[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94
diff --git a/.travis.yml b/.travis.yml
index b57921d..08b2c55 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,12 +1,12 @@
 language: c
 script: ./scripts/travis-builds.sh
 env:
-    # full magenta kernel + user space builds
-    - PROJECT=magenta-pc-x86-64
-    - PROJECT=magenta-qemu-arm64
-    - PROJECT=magenta-rpi3-arm64
-    - PROJECT=magenta-hikey960-arm64
-    - PROJECT=magenta-odroidc2-arm64
+    # full zircon kernel + user space builds
+    - PROJECT=zircon-pc-x86-64
+    - PROJECT=zircon-qemu-arm64
+    - PROJECT=zircon-rpi3-arm64
+    - PROJECT=zircon-hikey960-arm64
+    - PROJECT=zircon-odroidc2-arm64
 
 sudo: required
 dist: trusty
diff --git a/LICENSE b/LICENSE
index 3c3929f..3e8057e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-The Magenta Kernel (kernel/...) and the Magenta Scripts (scripts/...)
+The Zircon Kernel (kernel/...) and the Zircon Scripts (scripts/...)
 are under an MIT-style license, copies of which may be found in
 kernel/LICENSE and scripts/LICENSE.
 
@@ -6,7 +6,7 @@
 licenses (of the BSD, MIT, or Zlib style), which may be found in the
 root directory of each component, respectively.
 
-All other components and materials, including the Magenta System
+All other components and materials, including the Zircon System
 (system/...) and Bootloader (bootloader/...), are under a BSD-style
 license, copies of which may be found in system/LICENSE and
 bootloader/LICENSE.
diff --git a/README.md b/README.md
index 3f11a19..18c98b8 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,19 @@
-# Magenta
+# Zircon
 
-Magenta is the core platform that powers the Fuchsia OS.  Magenta is
+Zircon is the core platform that powers the Fuchsia OS.  Zircon is
 composed of a microkernel (source in kernel/...) as well as a small
 set of userspace services, drivers, and libraries (source in system/...)
 necessary for the system to boot, talk to hardware, load userspace
 processes and run them, etc.  Fuchsia builds a much larger OS on top
 of this foundation.
 
-The canonical Magenta Git repository is located
-at: https://fuchsia.googlesource.com/magenta
+The canonical Zircon Git repository is located
+at: https://fuchsia.googlesource.com/zircon
 
 A read-only mirror of the code is present
-at: https://github.com/fuchsia-mirror/magenta
+at: https://github.com/fuchsia-mirror/zircon
 
-The Magenta Kernel provides syscalls to manage processes, threads,
+The Zircon Kernel provides syscalls to manage processes, threads,
 virtual memory, inter-process communication, waiting on object state
 changes, and locking (via futexes).
 
@@ -22,17 +22,17 @@
 syscall API/ABI surface is finalized.  The expectation is that there will
 be about 100 syscalls.
 
-Magenta syscalls are generally non-blocking.  The wait_one, wait_many
+Zircon syscalls are generally non-blocking.  The wait_one, wait_many
 port_wait and thread sleep being the notable exceptions.
 
-This page is a non-comprehensive index of the magenta documentation.
+This page is a non-comprehensive index of the zircon documentation.
 
 + [Getting Started](docs/getting_started.md)
 + [Contributing Patches](docs/contributing.md)
 + [Testing](docs/testing.md)
 + [Hacking notes](docs/hacking.md)
 + [Memory usage analysis tools](docs/memory.md)
-+ [Relationship with LK](docs/mx_and_lk.md)
++ [Relationship with LK](docs/zx_and_lk.md)
 + [Kernel Objects](docs/objects.md)
 + [Process Objects](docs/objects/process.md)
 + [Thread Objects](docs/objects/thread.md)
diff --git a/bootloader/build.mk b/bootloader/build.mk
index 5c464ee..c701309 100644
--- a/bootloader/build.mk
+++ b/bootloader/build.mk
@@ -45,7 +45,7 @@
 EFI_SOURCES := \
     $(LOCAL_DIR)/src/osboot.c \
     $(LOCAL_DIR)/src/cmdline.c \
-    $(LOCAL_DIR)/src/magenta.c \
+    $(LOCAL_DIR)/src/zircon.c \
     $(LOCAL_DIR)/src/misc.c \
     $(LOCAL_DIR)/src/netboot.c \
     $(LOCAL_DIR)/src/netifc.c \
diff --git a/bootloader/include/printf.h b/bootloader/include/printf.h
index 7eeaff5..537eb5e 100644
--- a/bootloader/include/printf.h
+++ b/bootloader/include/printf.h
@@ -11,7 +11,7 @@
 #include <stdarg.h>
 #include <stdint.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/bootloader/scripts/bootmagenta b/bootloader/scripts/bootmagenta
deleted file mode 100755
index c5a992a..0000000
--- a/bootloader/scripts/bootmagenta
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-make && mcopy -o -i out/disk.img@@1024K ../build-magenta-pc-x86-64/magenta.bin ::magenta.bin && make qemu
diff --git a/bootloader/scripts/bootzircon b/bootloader/scripts/bootzircon
new file mode 100755
index 0000000..b9f8047
--- /dev/null
+++ b/bootloader/scripts/bootzircon
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make && mcopy -o -i out/disk.img@@1024K ../build-zircon-pc-x86-64/zircon.bin ::zircon.bin && make qemu
diff --git a/bootloader/src/framebuffer.c b/bootloader/src/framebuffer.c
index 29ed20a..9165ede 100644
--- a/bootloader/src/framebuffer.c
+++ b/bootloader/src/framebuffer.c
@@ -183,8 +183,8 @@
              logo_width, logo_height, 0);
 }
 
-#include <magenta/font/font-9x16.h>
-#include <magenta/font/font-18x32.h>
+#include <zircon/font/font-9x16.h>
+#include <zircon/font/font-18x32.h>
 
 static void putchar(efi_graphics_output_protocol* gop, fb_font* font, unsigned ch, unsigned x, unsigned y, unsigned scale_x, unsigned scale_y, efi_graphics_output_blt_pixel* fg, efi_graphics_output_blt_pixel* bg) {
     const uint16_t* cdata = font->data + ch * font->height;
diff --git a/bootloader/src/inet6.c b/bootloader/src/inet6.c
index 4b9b7fc..847efff 100644
--- a/bootloader/src/inet6.c
+++ b/bootloader/src/inet6.c
@@ -7,7 +7,7 @@
 #include <string.h>
 
 #include <inet6.h>
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 // Enable at your own risk. Some of these packet errors can be fairly
 // common when the buffers start to overflow.
diff --git a/bootloader/src/misc.c b/bootloader/src/misc.c
index a61e3cd..63620b6 100644
--- a/bootloader/src/misc.c
+++ b/bootloader/src/misc.c
@@ -8,7 +8,7 @@
 #include <string.h>
 #include <xefi.h>
 
-#include <magenta/pixelformat.h>
+#include <zircon/pixelformat.h>
 
 static efi_guid AcpiTableGUID = ACPI_TABLE_GUID;
 static efi_guid Acpi2TableGUID = ACPI_20_TABLE_GUID;
@@ -45,7 +45,7 @@
     *high = idx - 1;
 }
 
-static int get_mx_pixel_format_from_bitmask(efi_pixel_bitmask bitmask) {
+static int get_zx_pixel_format_from_bitmask(efi_pixel_bitmask bitmask) {
     int r_hi = -1, r_lo = -1, g_hi = -1, g_lo = -1, b_hi = -1, b_lo = -1;
 
     get_bit_range(bitmask.RedMask, &r_hi, &r_lo);
@@ -59,42 +59,42 @@
     if ((r_hi == 23 && r_lo == 16) &&
         (g_hi == 15 && g_lo == 8) &&
         (b_hi == 7 && b_lo == 0)) {
-        return MX_PIXEL_FORMAT_RGB_x888;
+        return ZX_PIXEL_FORMAT_RGB_x888;
     }
 
     if ((r_hi == 7 && r_lo == 5) &&
         (g_hi == 4 && g_lo == 2) &&
         (b_hi == 1 && b_lo == 0)) {
-        return MX_PIXEL_FORMAT_RGB_332;
+        return ZX_PIXEL_FORMAT_RGB_332;
     }
 
     if ((r_hi == 15 && r_lo == 11) &&
         (g_hi == 10 && g_lo == 5) &&
         (b_hi == 4 && b_lo == 0)) {
-        return MX_PIXEL_FORMAT_RGB_565;
+        return ZX_PIXEL_FORMAT_RGB_565;
     }
 
     if ((r_hi == 7 && r_lo == 6) &&
         (g_hi == 5 && g_lo == 4) &&
         (b_hi == 3 && b_lo == 2)) {
-        return MX_PIXEL_FORMAT_RGB_2220;
+        return ZX_PIXEL_FORMAT_RGB_2220;
     }
 
 unsupported:
     printf("unsupported pixel format bitmask: r %08x / g %08x / b %08x\n",
             bitmask.RedMask, bitmask.GreenMask, bitmask.BlueMask);
-    return MX_PIXEL_FORMAT_NONE;
+    return ZX_PIXEL_FORMAT_NONE;
 }
 
-uint32_t get_mx_pixel_format(efi_graphics_output_protocol* gop) {
+uint32_t get_zx_pixel_format(efi_graphics_output_protocol* gop) {
     efi_graphics_pixel_format efi_fmt = gop->Mode->Info->PixelFormat;
     switch (efi_fmt) {
     case PixelBlueGreenRedReserved8BitPerColor:
-        return MX_PIXEL_FORMAT_RGB_x888;
+        return ZX_PIXEL_FORMAT_RGB_x888;
     case PixelBitMask:
-        return get_mx_pixel_format_from_bitmask(gop->Mode->Info->PixelInformation);
+        return get_zx_pixel_format_from_bitmask(gop->Mode->Info->PixelInformation);
     default:
         printf("unsupported pixel format %d!\n", efi_fmt);
-        return MX_PIXEL_FORMAT_NONE;
+        return ZX_PIXEL_FORMAT_NONE;
     }
 }
diff --git a/bootloader/src/netboot.c b/bootloader/src/netboot.c
index 753d27b..c060359 100644
--- a/bootloader/src/netboot.c
+++ b/bootloader/src/netboot.c
@@ -10,7 +10,7 @@
 #include <netifc.h>
 #include <xefi.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 #include <tftp/tftp.h>
 
 #define TFTP_BUF_SZ 2048
@@ -43,7 +43,7 @@
 static int nb_active = 0;
 
 static char advertise_nodename[64] = "";
-static char advertise_data[256] = "nodename=magenta";
+static char advertise_data[256] = "nodename=zircon";
 
 static void send_query_ack(const ip6_addr* addr, uint16_t port,
                            uint32_t cookie) {
diff --git a/bootloader/src/osboot.c b/bootloader/src/osboot.c
index 8fcc0a0..019efa3 100644
--- a/bootloader/src/osboot.c
+++ b/bootloader/src/osboot.c
@@ -20,7 +20,7 @@
 
 #include "osboot.h"
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 #define DEFAULT_TIMEOUT 3
 
@@ -341,7 +341,7 @@
     }
 
     int32_t prev_attr = gConOut->Mode->Attribute;
-    gConOut->SetAttribute(gConOut, EFI_LIGHTMAGENTA | EFI_BACKGROUND_BLACK);
+    gConOut->SetAttribute(gConOut, EFI_LIGHTZIRCON | EFI_BACKGROUND_BLACK);
     draw_version(BOOTLOADER_VERSION);
     gConOut->SetAttribute(gConOut, prev_attr);
 
@@ -352,7 +352,7 @@
 
     // Default boot defaults to network
     const char* defboot = cmdline_get("bootloader.default", "network");
-    const char* nodename = cmdline_get("magenta.nodename", "");
+    const char* nodename = cmdline_get("zircon.nodename", "");
 
     // See if there's a network interface
     bool have_network = netboot_init(nodename) == 0;
@@ -367,14 +367,14 @@
         // return the generated value in which case it needs to be added to
         // the command line arguments.
         if (nodename[0] == 0) {
-            cmdline_set("magenta.nodename", netboot_nodename());
+            cmdline_set("zircon.nodename", netboot_nodename());
         }
     }
 
     printf("\n\n");
     print_cmdline();
 
-    // First look for a self-contained magentaboot image
+    // First look for a self-contained zirconboot image
     size_t ksz = 0;
     void* kernel = xefi_load_file(L"mxboot.bin", &ksz, 0);
 
@@ -384,7 +384,7 @@
 
     // Look for a kernel image on disk
     ksz = 0;
-    kernel = xefi_load_file(L"magenta.bin", &ksz, 0);
+    kernel = xefi_load_file(L"zircon.bin", &ksz, 0);
     if (!have_network && kernel == NULL) {
         goto fail;
     }
@@ -430,7 +430,7 @@
         }
         if (kernel) {
             printf(", ");
-            printf("or (m) to boot the magenta.bin on the device");
+            printf("or (m) to boot the zircon.bin on the device");
         }
         printf(" ...");
 
diff --git a/bootloader/src/osboot.h b/bootloader/src/osboot.h
index cfe7e86..5732a28 100644
--- a/bootloader/src/osboot.h
+++ b/bootloader/src/osboot.h
@@ -28,7 +28,7 @@
 
 uint64_t find_acpi_root(efi_handle img, efi_system_table* sys);
 
-uint32_t get_mx_pixel_format(efi_graphics_output_protocol* gop);
+uint32_t get_zx_pixel_format(efi_graphics_output_protocol* gop);
 
 int boot_deprecated(efi_handle img, efi_system_table* sys,
                     void* image, size_t sz,
diff --git a/bootloader/src/magenta.c b/bootloader/src/zircon.c
similarity index 89%
rename from bootloader/src/magenta.c
rename to bootloader/src/zircon.c
index b45b4f8..9791f3f 100644
--- a/bootloader/src/magenta.c
+++ b/bootloader/src/zircon.c
@@ -13,22 +13,22 @@
 #include <string.h>
 #include <xefi.h>
 
-#include <magenta/boot/bootdata.h>
-#include <magenta/pixelformat.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/pixelformat.h>
 
 
-static efi_guid magenta_guid = MAGENTA_VENDOR_GUID;
-static char16_t crashlog_name[] = MAGENTA_CRASHLOG_EFIVAR;
+static efi_guid zircon_guid = ZIRCON_VENDOR_GUID;
+static char16_t crashlog_name[] = ZIRCON_CRASHLOG_EFIVAR;
 
 static size_t get_last_crashlog(efi_system_table* sys, void* ptr, size_t max) {
     efi_runtime_services* rs = sys->RuntimeServices;
 
-    uint32_t attr = MAGENTA_CRASHLOG_EFIATTR;
+    uint32_t attr = ZIRCON_CRASHLOG_EFIATTR;
     size_t sz = max;
-    efi_status r = rs->GetVariable(crashlog_name, &magenta_guid, &attr, &sz, ptr);
+    efi_status r = rs->GetVariable(crashlog_name, &zircon_guid, &attr, &sz, ptr);
     if (r == EFI_SUCCESS) {
         // Erase it
-        rs->SetVariable(crashlog_name, &magenta_guid, MAGENTA_CRASHLOG_EFIATTR, 0, NULL);
+        rs->SetVariable(crashlog_name, &zircon_guid, ZIRCON_CRASHLOG_EFIATTR, 0, NULL);
     } else {
         sz = 0;
     }
@@ -37,7 +37,7 @@
 
 static unsigned char scratch[32768];
 
-static void start_magenta(uint64_t entry, void* bootdata) {
+static void start_zircon(uint64_t entry, void* bootdata) {
     // ebx = 0, ebp = 0, edi = 0, esi = bootdata
     __asm__ __volatile__(
         "movl $0, %%ebp \n"
@@ -97,11 +97,11 @@
 
     if (bd->flags & BOOTDATA_FLAG_EXTRA) {
         hsz = sizeof(bootdata_t) + sizeof(bootextra_t);
-        magenta_kernel2_t* kernel2 = image;
-        if ((sz < sizeof(magenta_kernel2_t)) ||
+        zircon_kernel2_t* kernel2 = image;
+        if ((sz < sizeof(zircon_kernel2_t)) ||
             (kernel2->hdr_kernel.type != BOOTDATA_KERNEL) ||
             ((kernel2->hdr_kernel.flags & BOOTDATA_FLAG_EXTRA) == 0)) {
-            printf("boot: invalid magenta kernel header\n");
+            printf("boot: invalid zircon kernel header\n");
             return -1;
         }
         flen = BOOTDATA_ALIGN(kernel2->hdr_file.length);
@@ -109,10 +109,10 @@
         entry = kernel2->data_kernel.entry64;
     } else {
         hsz = sizeof(bootdata_t);
-        magenta_kernel_t* kernel = image;
-        if ((sz < sizeof(magenta_kernel_t)) ||
+        zircon_kernel_t* kernel = image;
+        if ((sz < sizeof(zircon_kernel_t)) ||
             (kernel->hdr_kernel.type != BOOTDATA_KERNEL)) {
-            printf("boot: invalid magenta kernel header\n");
+            printf("boot: invalid zircon kernel header\n");
             return -1;
         }
         flen = BOOTDATA_ALIGN(kernel->hdr_file.length);
@@ -121,12 +121,12 @@
     }
 
     if (flen > (sz - hsz)) {
-        printf("boot: invalid magenta kernel header (bad flen)\n");
+        printf("boot: invalid zircon kernel header (bad flen)\n");
         return -1;
     }
 
     if (klen > (sz - (hsz * 2))) {
-        printf("boot: invalid magenta kernel header (bad klen)\n");
+        printf("boot: invalid zircon kernel header (bad klen)\n");
         return -1;
     }
     if (_entry) {
@@ -141,7 +141,7 @@
     return 0;
 }
 
-int boot_magenta(efi_handle img, efi_system_table* sys,
+int boot_zircon(efi_handle img, efi_system_table* sys,
                  void* image, size_t isz, void* ramdisk, size_t rsz,
                  void* cmdline, size_t csz) {
 
@@ -229,7 +229,7 @@
             .width = gop->Mode->Info->HorizontalResolution,
             .height = gop->Mode->Info->VerticalResolution,
             .stride = gop->Mode->Info->PixelsPerScanLine,
-            .format = get_mx_pixel_format(gop),
+            .format = get_zx_pixel_format(gop),
         };
         hdr.type = BOOTDATA_FRAMEBUFFER;
         hdr.length = sizeof(fb);
@@ -308,7 +308,7 @@
     }
 
     // jump to the kernel
-    start_magenta(entry, ramdisk - FRONT_BYTES);
+    start_zircon(entry, ramdisk - FRONT_BYTES);
 
 fail:
     bs->FreePages(mem, pages);
@@ -364,14 +364,14 @@
 
     // shrink original image header to include only the kernel
     if (hsz == sizeof(bootdata_t)) {
-        magenta_kernel_t* kernel = image;
+        zircon_kernel_t* kernel = image;
         kernel->hdr_file.length = hsz + klen;
     } else {
-        magenta_kernel2_t* kernel2 = image;
+        zircon_kernel2_t* kernel2 = image;
         kernel2->hdr_file.length = hsz + klen;
     }
 
-    return boot_magenta(img, sys, image, roff, ramdisk, rlen, cmdline, csz);
+    return boot_zircon(img, sys, image, roff, ramdisk, rlen, cmdline, csz);
 }
 
 int boot_kernel(efi_handle img, efi_system_table* sys,
@@ -383,7 +383,7 @@
     bootdata_t* bd = image;
     if ((bd->type == BOOTDATA_CONTAINER) &&
         (bd->extra == BOOTDATA_MAGIC)) {
-        return boot_magenta(img, sys, image, sz, ramdisk, rsz, cmdline, csz);
+        return boot_zircon(img, sys, image, sz, ramdisk, rsz, cmdline, csz);
     } else {
         return -1;
     }
diff --git a/docs/benchmarks/microbenchmarks.md b/docs/benchmarks/microbenchmarks.md
index f871f973..1e01d29 100644
--- a/docs/benchmarks/microbenchmarks.md
+++ b/docs/benchmarks/microbenchmarks.md
@@ -1,6 +1,6 @@
 ### Micro-benchmarks
 
-The benchmarks recorded below are obtained by running magenta-benchmarks in a
+The benchmarks recorded below are obtained by running zircon-benchmarks in a
 release build of fuchsia via ssh. When the benchmarks are recorded the Fuchsia user
 shell (GPU-accelerated) is running but no user has yet logged in.
 
@@ -11,7 +11,7 @@
 TASK                    PSS PRIVATE  SHARED NAME
 j:1029               796.8M  783.9M         root
   p:1044             558.8M  558.8M     28k bin/devmgr
-  j:1078              48.1M   39.6M         magenta-drivers
+  j:1078              48.1M   39.6M         zircon-drivers
     p:1752           180.8k    180k     28k devhost:root
     p:1791          1596.8k   1596k     28k devhost:acpi
     p:1840           592.8k    592k     28k devhost:misc
@@ -20,7 +20,7 @@
     p:4858          8540.8k   8540k     28k devhost:pci#6:8086:9d03
     p:4979           532.8k    532k     28k devhost:pci#14:8086:9d71
     p:5052           546.8k    380k    360k devhost:pci#16:8086:15d8
-  j:1179            5745.4k   1624k         magenta-services
+  j:1179            5745.4k   1624k         zircon-services
     p:1182           256.8k    256k     28k crashlogger
     p:1330          4490.8k    440k   8128k virtual-console
     p:1425           266.8k    200k    160k netsvc
diff --git a/docs/concepts.md b/docs/concepts.md
index 48e5f73..2803f50 100644
--- a/docs/concepts.md
+++ b/docs/concepts.md
@@ -1,4 +1,4 @@
-# Magenta Kernel Concepts
+# Zircon Kernel Concepts
 
 ## Introduction
 
@@ -12,7 +12,7 @@
 
 Userspace code interacts with kernel objects via system calls, and almost exclusively
 via Handles.  In userspace, a Handle is represented as 32bit integer
-(type mx_handle_t).  When syscalls are executed, the kernel checks that Handle
+(type zx_handle_t).  When syscalls are executed, the kernel checks that Handle
 parameters refer to an actual handle that exists within the calling process's handle
 table.  The kernel further checks that the Handle is of the correct type (passing
 a Thread Handle to a syscall requiring an event handle will result in an error),
@@ -21,25 +21,25 @@
 System calls fall into three broad categories, from an access standpoint:
 
 1. Calls which have no limitations, of which there are only a very few, for
-example [*mx_time_get()*](syscalls/time_get.md)
-and [*mx_nanosleep()*](syscalls/nanosleep.md) may be called by any thread.
+example [*zx_time_get()*](syscalls/time_get.md)
+and [*zx_nanosleep()*](syscalls/nanosleep.md) may be called by any thread.
 2. Calls which take a Handle as the first parameter, denoting the Object they act upon,
-which are the vast majority, for example [*mx_channel_write()*](syscalls/channel_write.md)
-and [*mx_port_bind()*](syscalls/port_bind.md).
+which are the vast majority, for example [*zx_channel_write()*](syscalls/channel_write.md)
+and [*zx_port_bind()*](syscalls/port_bind.md).
 3. Calls which create new Objects but do not take a Handle, such as
-[*mx_event_create()*](syscalls/event_create.md) and
-[*mx_channel_create()*](syscalls/channel_create.md).  Access to these (and limitations
+[*zx_event_create()*](syscalls/event_create.md) and
+[*zx_channel_create()*](syscalls/channel_create.md).  Access to these (and limitations
 upon them) is controlled by the Job in which the calling Process is contained.
 
-System calls are provided by libmagenta.so, which is a "virtual" shared
-library that the Magenta kernel provides to userspace, better known as the
+System calls are provided by libzircon.so, which is a "virtual" shared
+library that the Zircon kernel provides to userspace, better known as the
 [*virtual Dynamic Shared Object* or vDSO](vdso.md).
-They are C ELF ABI functions of the form *mx_noun_verb()* or
-*mx_noun_verb_direct-object()*.
+They are C ELF ABI functions of the form *zx_noun_verb()* or
+*zx_noun_verb_direct-object()*.
 
-The system calls are defined by [syscalls.sysgen](../system/public/magenta/syscalls.sysgen)
+The system calls are defined by [syscalls.sysgen](../system/public/zircon/syscalls.sysgen)
 and processed by the [sysgen](../system/host/sysgen/) tool into include files and glue
-code in libmagenta and the kernel's libsyscalls.
+code in libzircon and the kernel's libsyscalls.
 
 
 ## [Handles](handles.md) and [Rights](rights.md)
@@ -50,18 +50,18 @@
 the Object is either destroyed, or put into a final state that may not be undone.
 
 Handles may be moved from one Process to another by writing them into a Channel
-(using [*mx_channel_write()*](syscalls/channel_write.md)), or by using
-[*mx_process_start()*](syscalls/process_start.md) to pass a Handle as the argument
+(using [*zx_channel_write()*](syscalls/channel_write.md)), or by using
+[*zx_process_start()*](syscalls/process_start.md) to pass a Handle as the argument
 of the first thread in a new Process.
 
 The actions which may be taken on a Handle or the Object it refers to are governed
 by the Rights associated with that Handle.  Two Handles that refer to the same Object
 may have different Rights.
 
-The [*mx_handle_duplicate()*](syscalls/handle_duplicate.md) and
-[*mx_handle_replace()*](syscalls/handle_replace.md) system calls may be used to
+The [*zx_handle_duplicate()*](syscalls/handle_duplicate.md) and
+[*zx_handle_replace()*](syscalls/handle_replace.md) system calls may be used to
 obtain additional Handles referring to the same Object as the Handle passed in,
-optionally with reduced Rights.  The [*mx_handle_close()*](syscalls/handle_close.md)
+optionally with reduced Rights.  The [*zx_handle_close()*](syscalls/handle_close.md)
 system call closes a Handle, releasing the Object it refers to, if that Handle is
 the last one for that Object.
 
@@ -115,7 +115,7 @@
 
 ## Objects and Signals
 
-Objects may have up to 32 signals (represented by the mx_signals_t type and the MX_*_SIGNAL_*
+Objects may have up to 32 signals (represented by the zx_signals_t type and the ZX_*_SIGNAL_*
 defines) which represent a piece of information about their current state.  Channels and Sockets,
 for example, may be READABLE or WRITABLE.  Processes or Threads may be TERMINATED.  And so on.
 
@@ -125,9 +125,9 @@
 
 ## Waiting: Wait One, Wait Many, and Ports
 
-A Thread may use [*mx_object_wait_one()*](syscalls/object_wait_one.md)
+A Thread may use [*zx_object_wait_one()*](syscalls/object_wait_one.md)
 to wait for a signal to be active on a single handle or
-[*mx_object_wait_many()*](syscalls/object_wait_many.md) to wait for
+[*zx_object_wait_many()*](syscalls/object_wait_many.md) to wait for
 signals on multiple handles.  Both calls allow for a timeout after
 which they'll return even if no signals are pending.
 
@@ -160,12 +160,12 @@
 for pages (which will be created/filled lazily, on-demand).
 
 They may be mapped into the address space of a Process with
-[*mx_vmar_map()*](syscalls/vmar_map.md) and unmapped with
-[*mx_vmar_unmap()*](syscalls/vmar_unmap.md).  Permissions of
-mapped pages may be adjusted with [*mx_vmar_protect()*](syscalls/vmar_protect.md).
+[*zx_vmar_map()*](syscalls/vmar_map.md) and unmapped with
+[*zx_vmar_unmap()*](syscalls/vmar_unmap.md).  Permissions of
+mapped pages may be adjusted with [*zx_vmar_protect()*](syscalls/vmar_protect.md).
 
 VMOs may also be read from and written to directly with
-[*mx_vmo_read()*](syscalls/vmo_read.md) and [*mx_vmo_write()*](syscalls/vmo_write.md).
+[*zx_vmo_read()*](syscalls/vmo_read.md) and [*zx_vmo_write()*](syscalls/vmo_write.md).
 Thus the cost of mapping them into an address space may be avoided for one-shot operations
 like "create a VMO, write a dataset into it, and hand it to another Process to use."
 
@@ -175,9 +175,9 @@
 process's address space.  At process creation time, a handle to the root VMAR
 is given to the process creator.  That handle refers to a VMAR that spans the
 entire address space.  This space can be carved up via the
-[*mx_vmar_map()*](syscalls/vmar_map.md) and
-[*mx_vmar_allocate()*](syscalls/vmar_allocate.md) interfaces.
-[*mx_vmar_allocate()*](syscalls/vmar_allocate.md) can be used to generate new
+[*zx_vmar_map()*](syscalls/vmar_map.md) and
+[*zx_vmar_allocate()*](syscalls/vmar_allocate.md) interfaces.
+[*zx_vmar_allocate()*](syscalls/vmar_allocate.md) can be used to generate new
 VMARs (called subregions or children) which can be used to group together
 parts of the address space.
 
@@ -192,15 +192,15 @@
 Futexes are kernel primitives used with userspace atomic operations to implement
 efficient synchronization primitives -- for example, Mutexes which only need to make
 a syscall in the contended case.  Usually they are only of interest to implementers of
-standard libraries.  Magenta's libc and libc++ provide C11, C++, and pthread APIs for
+standard libraries.  Zircon's libc and libc++ provide C11, C++, and pthread APIs for
 mutexes, condition variables, etc, implemented in terms of Futexes.
 
 See: [futex_wait](syscalls/futex_wait.md),
 [futex_wake](syscalls/futex_wake.md),
 [futex_requeue](syscalls/futex_requeue.md).
 
-## Magenta Device Index
+## Zircon Device Index
 
-The Magenta Device Index (MDI) is a read-only binary data structure passed from the bootloader
-that contains configuration information for the kernel and various drivers in magenta.
+The Zircon Device Index (MDI) is a read-only binary data structure passed from the bootloader
+that contains configuration information for the kernel and various drivers in zircon.
 See [mdi](mdi.md).
diff --git a/docs/contributing.md b/docs/contributing.md
index 65f82e8..91ed65f 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -1,14 +1,14 @@
-# Contributing Patches to Magenta
+# Contributing Patches to Zircon
 
-At this point in time, Magenta is under heavy, active development, and we're
+At this point in time, Zircon is under heavy, active development, and we're
 not seeking major changes or new features from new contributors, however, if
 you desire to [contribute](https://fuchsia.googlesource.com/docs/+/master/CONTRIBUTING.md), small bugfixes are welcome.
 
-Here are some general guidelines for patches to Magenta.  This list is
+Here are some general guidelines for patches to Zircon.  This list is
 incomplete and will be expanded over time:
 
 * GitHub pull requests are not accepted.  Patches are handled via
-  Gerrit Code Review at: https://fuchsia-review.googlesource.com/#/q/project:magenta
+  Gerrit Code Review at: https://fuchsia-review.googlesource.com/#/q/project:zircon
 
 * Indentation is with spaces, four spaces per indent.  Never tabs.
 Do not leave trailing whitespace on lines.  Gerrit will flag bad
@@ -26,10 +26,10 @@
 app, etc, is affected by the change.  The style here is somewhat informal.
 Look at past changes to get a feel for how these are used.
 
-* Magenta should be buildable for all major targets (x86-64, arm64)
-at every change.  ./scripts/build-all-magenta can help with this.
+* Zircon should be buildable for all major targets (x86-64, arm64)
+at every change.  ./scripts/build-all-zircon can help with this.
 
-* Avoid breaking the unit tests.  Boot Magenta and run "runtests" to
+* Avoid breaking the unit tests.  Boot Zircon and run "runtests" to
 verify that they're all passing.
 
 * The #fuchsia channel on the freenode irc network is a good place to ask
@@ -37,5 +37,5 @@
 
 * [Googlers only] Commit messages may reference issue IDs, which will be
 turned into links in the Gerrit UI. Issues may also be automatically closed
-using the syntax `BUG-123 #done`.  *Note*: Magenta's issue tracker is not open
+using the syntax `BUG-123 #done`.  *Note*: Zircon's issue tracker is not open
 to external contributors at this time.
diff --git a/docs/cxx.md b/docs/cxx.md
index e769efa..86a8952 100644
--- a/docs/cxx.md
+++ b/docs/cxx.md
@@ -1,8 +1,8 @@
-# C++ in Magenta
+# C++ in Zircon
 
-A subset of the C++14 language is used in the Magenta tree. This
+A subset of the C++14 language is used in the Zircon tree. This
 includes both the upper layers of the kernel (above the lk layer), as
-well as some userspace code. In particular, Magenta does not use the
+well as some userspace code. In particular, Zircon does not use the
 C++ standard library, and many language features are not used or
 allowed.
 
@@ -83,21 +83,21 @@
 checked without having to reason about optimizations of the standard
 operator new in the presence of -fno-exceptions and so on.
 
-## mx
+## zx
 
-We have built a minimal C++ library around the various Magenta
+We have built a minimal C++ library around the various Zircon
 [objects](objects) and [syscalls](syscalls.md) called
-[`mx`](../system/ulib/mx/README.md). `mx` is a minimal layer on top of
-`mx_handle_t` and the system calls, to provide handles with type
+[`zx`](../system/ulib/zx/README.md). `zx` is a minimal layer on top of
+`zx_handle_t` and the system calls, to provide handles with type
 safety and ownership semantics.
 
-## mxcpp
+## zxcpp
 
 Some of our code runs in an environment which cannot include the
 standard C++ runtime environment. This environment includes symbols
 like __cxa_pure_virtual that are defined by the ABI and that the
-compiler expects to be ambient. [The mxcpp
-library](../system/ulib/mxcpp) provides that dependency. It also
+compiler expects to be ambient. [The zxcpp
+library](../system/ulib/zxcpp) provides that dependency. It also
 includes the placement operator new overloads and, in userspace, the
 standard new and delete operators. Note that it does not include the
 similarly named __cxa_atexit, which in userspace must be provided by
diff --git a/docs/ddk/device-ops.md b/docs/ddk/device-ops.md
index 502bf1b..2f198bb 100644
--- a/docs/ddk/device-ops.md
+++ b/docs/ddk/device-ops.md
@@ -19,7 +19,7 @@
 The open hook is called when a device is opened via the device filesystem,
 or when an existing open connection to a device is cloned (for example,
 when a device fd is shared with another process).  The default open hook,
-if a driver does not implement one, simply returns **MX_OK**.
+if a driver does not implement one, simply returns **ZX_OK**.
 
 Drivers may want to implement open to disallow simultaneous access (by
 failing if the device is already open), or to return a new **device instance**
@@ -32,7 +32,7 @@
 **DEVICE_ADD_INSTANCE** flag set in the arguments to **device_add()**.
 
 ```
-mx_status_t (*open)(void* ctx, mx_device_t** dev_out, uint32_t flags);
+zx_status_t (*open)(void* ctx, zx_device_t** dev_out, uint32_t flags);
 ```
 
 ## open_at
@@ -41,10 +41,10 @@
 exists as `/dev/misc/foo` and an attempt is made to `open("/dev/misc/foo/bar",...)`,
 the open_at hook would be invoked with a *path* of `"bar"`.
 
-The default open_at implementation returns **MX_ERR_NOT_SUPPORTED**
+The default open_at implementation returns **ZX_ERR_NOT_SUPPORTED**
 
 ```
-mx_status_t (*open_at)(void* ctx, mx_device_t** dev_out, const char* path, uint32_t flags);
+zx_status_t (*open_at)(void* ctx, zx_device_t** dev_out, const char* path, uint32_t flags);
 ```
 
 ## close
@@ -54,9 +54,9 @@
 **Note:** If open or open_at return a **device instance**, the balancing close
 hook that is called is the close hook on the **instance**, not the parent.
 
-The default close implementation returns **MX_OK**.
+The default close implementation returns **ZX_OK**.
 ```
-mx_status_t (*close)(void* ctx, uint32_t flags);
+zx_status_t (*close)(void* ctx, uint32_t flags);
 ```
 
 ## unbind
@@ -81,7 +81,7 @@
 removed and released.
 
 At the point release is invoked, the driver will not receive any further calls
-and absolutely must not use the underlying **mx_device_t** once this method
+and absolutely must not use the underlying **zx_device_t** once this method
 returns.
 
 The driver must free all memory and release all resources related to this device
@@ -94,43 +94,43 @@
 The read hook is an attempt to do a non-blocking read operation.
 
 On success *actual* must be set to the number of bytes read (which may be less
-than the number requested in *count*), and return **MX_OK**.
+than the number requested in *count*), and return **ZX_OK**.
 
 A successful read of 0 bytes is generally treated as an End Of File notification
 by clients.
 
-If no data is available now, **MX_ERR_SHOULD_WAIT** must be returned and when
+If no data is available now, **ZX_ERR_SHOULD_WAIT** must be returned and when
 data becomes available `device_state_set(DEVICE_STATE_READABLE)` may be used to
 signal waiting clients.
 
 This hook **must not block**.  Use `iotxn_queue` to handle IO which
 requires processing and delayed status.
 
-The default read implementation returns **MX_ERR_NOT_SUPPORTED**.
+The default read implementation returns **ZX_ERR_NOT_SUPPORTED**.
 
 ```
-mx_status_t (*read)(void* ctx, void* buf, size_t count,
-                    mx_off_t off, size_t* actual);
+zx_status_t (*read)(void* ctx, void* buf, size_t count,
+                    zx_off_t off, size_t* actual);
 ```
 
 ## write
 The write hook is an attempt to do a non-blocking write operation.
 
 On success *actual* must be set to the number of bytes written (which may be
-less than the number requested in *count*), and **MX_OK** should be returned.
+less than the number requested in *count*), and **ZX_OK** should be returned.
 
-If it is not possible to write data at present **MX_ERR_SHOULD_WAIT** must
+If it is not possible to write data at present **ZX_ERR_SHOULD_WAIT** must
 be returned and when it is again possible to write,
 `device_state_set(DEVICE_STATE_WRITABLE)` may be used to signal waiting clients.
 
 This hook **must not block**.  Use `iotxn_queue` to handle IO which
 requires processing and delayed status.
 
-The default write implementation returns **MX_ERR_NOT_SUPPORTED**.
+The default write implementation returns **ZX_ERR_NOT_SUPPORTED**.
 
 ```
-mx_status_t (*write)(void* ctx, const void* buf, size_t count,
-                     mx_off_t off, size_t* actual);
+zx_status_t (*write)(void* ctx, const void* buf, size_t count,
+                     zx_off_t off, size_t* actual);
 ```
 
 ## iotxn_queue
@@ -160,7 +160,7 @@
 
 The default implementation returns 0.
 ```
-mx_off_t (*get_size)(void* ctx);
+zx_off_t (*get_size)(void* ctx);
 ```
 
 ## ioctl
@@ -168,12 +168,12 @@
 
 These, like read, write, and iotxn_queue, must not block.
 
-On success, **MX_OK** must be returned and *out_actual* must be set
+On success, **ZX_OK** must be returned and *out_actual* must be set
 to the number of output bytes provided (0 if none).
 
-The default ioctl implementation returns **MX_ERR_NOT_SUPPORTED**.
+The default ioctl implementation returns **ZX_ERR_NOT_SUPPORTED**.
 ```
-mx_status_t (*ioctl)(void* ctx, uint32_t op,
+zx_status_t (*ioctl)(void* ctx, uint32_t op,
                      const void* in_buf, size_t in_len,
                      void* out_buf, size_t out_len, size_t* out_actual);
 ```
@@ -189,5 +189,5 @@
 
 #### device_state_set
 ```
-void device_state_set(mx_device_t* dev, mx_signals_t stateflag);
+void device_state_set(zx_device_t* dev, zx_signals_t stateflag);
 ```
diff --git a/docs/debugging/tips.md b/docs/debugging/tips.md
index 2285fe0..13d06b5 100644
--- a/docs/debugging/tips.md
+++ b/docs/debugging/tips.md
@@ -23,9 +23,9 @@
 
 The default is empty (meaning none).
 
-## Debugging magenta applications with GDB
+## Debugging zircon applications with GDB
 
-To debug magenta applications with GDB use gdbserver:
+To debug zircon applications with GDB use gdbserver:
 https://fuchsia.googlesource.com/gdbserver
 
 ## Adding debug info to boot image
@@ -35,11 +35,11 @@
 using tools like debuggers natively. Note that this does not apply
 to cross debugging where the debugger is running on separate machine.
 Adding debug info to the boot image is for when you are running debugging
-tools on magenta itself.
+tools on zircon itself.
 
 Example:
 ```
-$ make -j10 magenta-pc-x86-64 BOOTFS_DEBUG_MODULES=ulib/%,utest/debugger GLOBAL_DEBUGFLAGS=-g1
+$ make -j10 zircon-pc-x86-64 BOOTFS_DEBUG_MODULES=ulib/%,utest/debugger GLOBAL_DEBUGFLAGS=-g1
 ```
 
 This example will include in the boot image debug info files for all
@@ -50,4 +50,4 @@
 ## Debugging the kernel with QEMU+GDB.
 
 See "Debugging the kernel with GDB" in [QEMU](qemu.md) for
-documentation on debugging magenta with QEMU+GDB.
+documentation on debugging zircon with QEMU+GDB.
diff --git a/docs/driver_interfaces/audio.md b/docs/driver_interfaces/audio.md
index 06d6478..2daaee8 100644
--- a/docs/driver_interfaces/audio.md
+++ b/docs/driver_interfaces/audio.md
@@ -1,14 +1,14 @@
 # Audio Driver Streaming Interface
 
 This document describes the audio streaming interface exposed by audio drivers
-in Magenta.  It is meant to serve as a reference for both users and
+in Zircon.  It is meant to serve as a reference for both users and
 driver-authors, and to unambiguously define the interface contract which drivers
 must implement and users must follow.
 
 ## Overview
 
 Audio streams are device nodes published by driver services intended to be used
-by applications in order to capture and/or render audio in a Magenta device.
+by applications in order to capture and/or render audio in a Zircon device.
 Each stream in the system (input or output) represents a stream of digital audio
 information which may be either received or transmitted by device.  Streams are
 dynamic and may created or destroyed by the system at any time.  Which streams
@@ -26,7 +26,7 @@
 Term | Definition
 -----|-----------
 Sample | A representation of the sound rendered by a single speaker, or captured by a single microphone, at a single instant in time.
-LPCM | Linear pulse code modulation.  The specific representation of audio samples present in all Magenta uncompressed audio streams.  LPCM audio samples are representations of the amplitude of the audio signal at an instant in time where the numeric values of the encoded audio are linearly distributed across the amplitude levels of the rendering or capture device.  This is in contrast to A-law and &mu;-law encodings which have non-linear mappings from numeric value to amplitude level.
+LPCM | Linear pulse code modulation.  The specific representation of audio samples present in all Zircon uncompressed audio streams.  LPCM audio samples are representations of the amplitude of the audio signal at an instant in time where the numeric values of the encoded audio are linearly distributed across the amplitude levels of the rendering or capture device.  This is in contrast to A-law and &mu;-law encodings which have non-linear mappings from numeric value to amplitude level.
 Channel | Within an audio stream, the subset of information which will be rendered by a single speaker, or which was captured by a single microphone in a stream.
 Frame | A set of audio samples for every channel of a audio stream captured/rendered at a single instant in time.
 Frame Rate | a.k.a. "Sample Rate".  The rate (in Hz) at which audio frames are produced or consumed.  Common sample rates include 44.1 KHz, 48 KHz, 96 KHz, and so on.
@@ -72,14 +72,14 @@
    bus transaction failure, etc...
  * Receiving clock recovery information in the case that the audio output clock
    is based on a different oscillator than the oscillator which backs
-   [mx_ticks_get()](../syscalls/ticks_get.md)
+   [zx_ticks_get()](../syscalls/ticks_get.md)
 
 ## Operational Details
 
 ### Protocol definition
 
 In order to use the C API definitions of the
-[audio](../../system/public/magenta/device/audio.h) protocol, applications and
+[audio](../../system/public/zircon/device/audio.h) protocol, applications and
 drivers simply say
 ```C
 #include <device/audio.h>
@@ -95,8 +95,8 @@
 
 Stream Type | Protocol | Location
 ------------|----------|---------
-Input | `MX_PROTOCOL_AUDIO_INPUT` | /dev/class/audio-input
-Output | `MX_PROTOCOL_AUDIO_OUTPUT` | /dev/class/audio-output
+Input | `ZX_PROTOCOL_AUDIO_INPUT` | /dev/class/audio-input
+Output | `ZX_PROTOCOL_AUDIO_OUTPUT` | /dev/class/audio-output
 
 ### Establishing the stream channel
 
@@ -104,8 +104,8 @@
 for subsequent communication using the `AUDIO_IOCTL_GET_CHANNEL` ioctl.  For
 example...
 ```C
-mx_handle_t OpenStream(const char* dev_node_path) {
-    mx_handle_t ret = MX_HANDLE_INVALID;
+zx_handle_t OpenStream(const char* dev_node_path) {
+    zx_handle_t ret = ZX_HANDLE_INVALID;
     int fd = open(dev_node_path, O_RDONLY);
 
     if (fd < 0) {
@@ -113,12 +113,12 @@
         return ret;
     }
 
-    ssize_t res = mxio_ioctl(fd, AUDIO_IOCTL_GET_CHANNEL,
+    ssize_t res = fdio_ioctl(fd, AUDIO_IOCTL_GET_CHANNEL,
                              nullptr, 0,
                              &ret, sizeof(ret));
     close(fd);
 
-    if (res != MX_OK)
+    if (res != ZX_OK)
         printf("Failed to obtain channel (res %zd)\n", res);
 
     return ret;
@@ -128,7 +128,7 @@
 ### Client side termination of the stream channel
 
 Clients **may** terminate the connection to the stream at any time simply by
-calling [mx_handle_close(...)](../syscalls/handle_close.md) on the stream
+calling [zx_handle_close(...)](../syscalls/handle_close.md) on the stream
 channel.  Drivers **must** close any active ring-buffer channels established
 using this stream channel and **must** make every attempt to gracefully quiesce
 any on-going streaming operations in the process.
@@ -137,15 +137,15 @@
 
 All of the messages and message payloads which may be sent or received over
 stream and ring buffer channels are defined in the
-[audio](../../system/public/magenta/device/audio.h) protocol header.  Messages
+[audio](../../system/public/zircon/device/audio.h) protocol header.  Messages
 may be sent to the driver using the
-[mx_channel_write(...)](../syscalls/channel_write.md) syscall.  If a response is
+[zx_channel_write(...)](../syscalls/channel_write.md) syscall.  If a response is
 expected, it may be read using the
-[mx_channel_read(...)](../syscalls/channel_read.md) syscall.  Best practice,
+[zx_channel_read(...)](../syscalls/channel_read.md) syscall.  Best practice,
 however, is to bind your [channel(s)](../objects/channel.md) to a
 [port](../objects/port.md) using the
-[mx_port_bind(...)](../syscalls/port_bind.md) syscall, and use the
-[mx_port_wait(...)](../syscalls/port_wait.md) syscall to determine when your set
+[zx_port_bind(...)](../syscalls/port_bind.md) syscall, and use the
+[zx_port_wait(...)](../syscalls/port_wait.md) syscall to determine when your set
 of channels have messages (either expected responses or asynchronous
 notifications) to be read.
 
@@ -165,7 +165,7 @@
 `AUDIO_INVALID_TRANSACTION_ID` as the transaction ID for the message.
 Transaction IDs may be used by clients for whatever purpose they desire, however
 if the IDs are kept unique across all transactions in-flight, the
-[mx_channel_call(...)](../syscalls/channel_call.md) may be used to implement a
+[zx_channel_call(...)](../syscalls/channel_call.md) may be used to implement a
 simple synchronous calling interface.
 
 ### Validation requirements
@@ -189,7 +189,7 @@
 bitfield style enumeration which describes either the numeric encoding of the
 uncompressed LPCM audio samples as they reside in memory, or indicating that the
 audio stream consists of a compressed bitstream instead of uncompressed LPCM
-samples.  Refer to the [audio](../../system/public/magenta/device/audio.h)
+samples.  Refer to the [audio](../../system/public/zircon/device/audio.h)
 protocol header for exact symbol definitions.
 
 Notes
@@ -377,7 +377,7 @@
 `audio_stream_cmd_set_format_resp_t`.
 
 In the case of success, drivers **must** set the `result` field of the response
-to `MX_OK` and **must** return a new ring buffer channel over which streaming
+to `ZX_OK` and **must** return a new ring buffer channel over which streaming
 operations will be conducted.  If a previous ring buffer channel had been
 established and was still active, the driver **must** close this channel and
 make every attempt to gracefully quiesce any on-going streaming operations in
@@ -438,7 +438,7 @@
  * `AUDIO_SGF_MUTE`.  Indicates the application's desired mute/un-mute state
    for the stream.  Significant only if `AUDIO_SGF_MUTE_VALID` is also set.
 
-Drivers **must** fail the request with an `MX_ERR_INVALID_ARGS` result if the
+Drivers **must** fail the request with an `ZX_ERR_INVALID_ARGS` result if the
 application's request is incompatible with the stream's capabilities.
 Incompatible requests include.
  * The requested gain is less than the minimum support gain for the stream.
@@ -484,7 +484,7 @@
 state, and to enable or disable for asynchronous plug detection notifications,
 applications send a `AUDIO_STREAM_CMD_PLUG_DETECT` command over the stream
 channel.  Drivers respond with a set of `audio_pd_notify_flags_t`, along with a
-timestamp referenced from MX_CLOCK_MONOTONIC indicating the last time the plug
+timestamp referenced from ZX_CLOCK_MONOTONIC indicating the last time the plug
 state changed.
 
 Three valid flags are currently defined.
@@ -639,7 +639,7 @@
 
 Upon succeeding, the driver **must** return a handle to a
 [VMO](../objects/vm_object.md) with permissions which allow applications to map
-the VMO into their address space using [mx_vmar_map](../syscalls/vmar_map.md),
+the VMO into their address space using [zx_vmar_map](../syscalls/vmar_map.md),
 and to read/write data in the buffer in the case of readback, or simply read the
 data in the buffer in the case of capture.
 
@@ -656,18 +656,18 @@
 Upon successfully starting a stream, drivers **must** provide their best
 estimate of the time at which their hardware began to transmit or capture the
 stream in the `start_ticks` field of the response.  This time stamp **must** be
-taken from the clock exposed via the [mx_ticks_get()](../syscalls/ticks_get.md)
+taken from the clock exposed via the [zx_ticks_get()](../syscalls/ticks_get.md)
 syscall.  Along with with the FIFO depth property of the ring buffer, this
 timestamp allows applications to send or receive stream data without the need
 for periodic position updates from the driver.  Along with the outboard latency
 estimate provided by the stream channel, this timestamp allows applications to
 synchronize presentation of audio information across multiple streams, or even
 multiple devices (provided that an external time synchronization protocol is
-used to synchronize the [mx_ticks_get()](../syscalls/ticks_get.md) timelines
+used to synchronize the [zx_ticks_get()](../syscalls/ticks_get.md) timelines
 across the cohort of synchronized devices).
 
 > TODO: Redefine `start_time` to allow it to be an arbitrary 'audio stream
-> clock' instead of the mx_ticks_get() clock.  If the stream clock is made to
+> clock' instead of the zx_ticks_get() clock.  If the stream clock is made to
 > count in audio frames since start, then this start_ticks can be replaced with
 > the terms for a segment of a piecewise linear transformation which can be
 > subsequently updated via notifications sent by the driver in the case that the
@@ -705,7 +705,7 @@
 
 Driver playback/capture positions *always* begin at byte 0 in the ring buffer
 immediately following a successful start command.  When they reach the size of
-the VMO (as determined by [mx_vmo_get_size(...)](../syscalls/vmo_get_size.md))
+the VMO (as determined by [zx_vmo_get_size(...)](../syscalls/vmo_get_size.md))
 they wrap back to zero.  Drivers are not required to consume or produce data in
 integral numbers of audio frames.  Client whose notion of stream position
 depends on position notifications should take care to request that a sufficient
@@ -728,7 +728,7 @@
 
 > TODO: define a way that clock recovery information can be sent to clients in
 > the case that the audio output oscillator is not derived from the
-> mx_ticks_get() oscillator.  In addition, if the oscillator is slew-able in
+> zx_ticks_get() oscillator.  In addition, if the oscillator is slew-able in
 > hardware, provide the ability to discover this capability and control the slew
 > rate.  Given the fact that this oscillator is likely to be shared by multiple
 > streams, it might be best to return some form of system wide clock identifier
diff --git a/docs/editors.md b/docs/editors.md
index 0116aaa..14208aa 100644
--- a/docs/editors.md
+++ b/docs/editors.md
@@ -1,10 +1,10 @@
-# Editor integration for Magenta
+# Editor integration for Zircon
 
 ## YouCompleteMe for Vim/Atom
 
 [YouCompleteMe](https://valloric.github.io/YouCompleteMe/) is a semantic
 code-completion engine for Vim and Atom. You can use
-[Bear](https://github.com/rizsotto/Bear) to build its database from the Magenta
+[Bear](https://github.com/rizsotto/Bear) to build its database from the Zircon
 makefiles.
 
 ### Install YouCompleteMe in your editor
@@ -20,7 +20,7 @@
 
 You can try using your system's package manager (apt-get, brew) to install Bear,
 but you will need version 2.2.1 or later to match the compiler names that
-Magenta uses.
+Zircon uses.
 
 Example installation:
 
@@ -43,7 +43,7 @@
 make install  # Or 'sudo make install' to install to /usr/local
 ```
 
-### Invoke Bear on the Magenta build system
+### Invoke Bear on the Zircon build system
 
 You'll need to do this whenever the sources or makefiles change in a way that
 affects includes or types, or when you add/delete/move files, though it doesn't
@@ -52,7 +52,7 @@
 As easy as:
 
 ``` bash
-cd "${MAGENTA_DIR}"
+cd "${ZIRCON_DIR}"
 make clean
 bear make -j20
 ```
@@ -66,7 +66,7 @@
 details.
 
 It should pick up the `json` file automatically. If you want to move it out of
-the `magenta` tree, you can move the file to its parent directory.
+the `zircon` tree, you can move the file to its parent directory.
 
 ## See also
 
diff --git a/docs/entropy_quality_tests.md b/docs/entropy_quality_tests.md
index cd15665..c08e076 100644
--- a/docs/entropy_quality_tests.md
+++ b/docs/entropy_quality_tests.md
@@ -1,7 +1,7 @@
 # Entropy quality tests
 
 This document describes how we test the quality of the entropy sources used to
-seed the Magenta CPRNG.
+seed the Zircon CPRNG.
 
 [TOC]
 
@@ -56,7 +56,7 @@
 processed data: together, /dev/zero and "password" provide ~0 bits of entropy,
 but our tests are way more optimistic about the resulting data!
 
-For a more concrete Magenta-related example, consider jitterentropy (the RNG
+For a more concrete Zircon-related example, consider jitterentropy (the RNG
 discussed here: <http://www.chronox.de/jent/doc/CPU-Jitter-NPTRNG.html>).
 Jitterentropy draws entropy from variations in CPU timing. The unprocessed data
 are how long it took to run a certain block of CPU- and memory-intensive code
@@ -76,7 +76,7 @@
 ## Quality test implementation
 
 As mentioned above, the NIST test suite takes a file full of random bytes as
-input. We collect those bytes on a Magenta system (possibly with a thin Fuchsia
+input. We collect those bytes on a Zircon system (possibly with a thin Fuchsia
 layer on top), then usually export them to a more capable workstation to run the
 test suite.
 
@@ -141,11 +141,11 @@
 
 ## Test data export
 
-Test data is saved in `/boot/kernel/debug/entropy.bin` in the Magenta system
+Test data is saved in `/boot/kernel/debug/entropy.bin` in the Zircon system
 under test. So far I've usually exported the data file manually via `netcp`.
 Other options include `scp` if you build with the correct Fuchsia packages, or
 saving to persistent storage (probably using the Fuchsia `thinfs` FAT
-filesystem, so you can read the files on a non-Magenta computer).
+filesystem, so you can read the files on a non-Zircon computer).
 
 ## Running the NIST test suite
 
diff --git a/docs/errors.md b/docs/errors.md
index 4571557..e391f33 100644
--- a/docs/errors.md
+++ b/docs/errors.md
@@ -1,14 +1,14 @@
 # Errors
 
-This describes the set of userspace-exposed errors used in Magenta. The first section provides the
+This describes the set of userspace-exposed errors used in Zircon. The first section provides the
 canonical names and description of each error code. The second section provides the concrete values.
 
 Within the kernel, errors are typically resulted as variables of type `status_t` and errors are
-defined by macros of the form `MX_ERR_CANONICAL_NAME` e.g. `MX_ERR_INTERNAL`. All error cases are negative
+defined by macros of the form `ZX_ERR_CANONICAL_NAME` e.g. `ZX_ERR_INTERNAL`. All error cases are negative
 values and success is represented by a non-negative value.
 
-In userspace the syscall dispatch layer (libmagenta) exposes the result values as variables of type
-`mx_status_t` that currently use the same spelling and values as the kernel for errors, but which
+In userspace the syscall dispatch layer (libzircon) exposes the result values as variables of type
+`zx_status_t` that currently use the same spelling and values as the kernel for errors, but which
 will transition to using 0 for success and positive values for errors.
 
 See [Kernel internal errors](kernel_internal_errors.md) for a list of kernel-internal values.
@@ -29,7 +29,7 @@
 ## Categories
 
 ### Success
-**MX\_OK**
+**ZX\_OK**
  Operation succeeded.
 
 ### General errors
@@ -139,4 +139,4 @@
 
 ## Values
 
-[//]: # "TODO: Document values in various contexts (status_t vs mx_status_t)"
+[//]: # "TODO: Document values in various contexts (status_t vs zx_status_t)"
diff --git a/docs/fuzzing_fidl.md b/docs/fuzzing_fidl.md
index 4d53937..be77357 100644
--- a/docs/fuzzing_fidl.md
+++ b/docs/fuzzing_fidl.md
@@ -20,10 +20,10 @@
 Clear any existing build and then build with the afl-fuzz compiler wrappers.
 
 ```
-cd $MAGENTA_DIR
-rm -fr build-magenta-pc-x86-64
+cd $ZIRCON_DIR
+rm -fr build-zircon-pc-x86-64
 PATH=$PWD/prebuilt/downloads/clang+llvm-x86_64-linux/bin/:$PATH:$AFL_PATH make \
-  build-magenta-pc-x86-64/tools/fidl HOST_TOOLCHAIN_PREFIX=afl-
+  build-zircon-pc-x86-64/tools/fidl HOST_TOOLCHAIN_PREFIX=afl-
 ```
 adjusting if you're not building on x86-64 Linux, etc.
 
@@ -33,7 +33,7 @@
 the different interfaces declared across our tree, but for now we use what's in `system/host/fidl/examples`.
 
 ```
-$AFL_PATH/afl-fuzz -i system/host/fidl/examples -o fidl-fuzz-out build-magenta-pc-x86-64/tools/fidl dump '@@'
+$AFL_PATH/afl-fuzz -i system/host/fidl/examples -o fidl-fuzz-out build-zircon-pc-x86-64/tools/fidl dump '@@'
 ```
 
 ## Results
diff --git a/docs/getting_started.md b/docs/getting_started.md
index 401c5b7..436582e 100644
--- a/docs/getting_started.md
+++ b/docs/getting_started.md
@@ -1,24 +1,24 @@
 # Quick Start Recipes
 
-## Checking out the Magenta source code
+## Checking out the Zircon source code
 
 *** note
-NOTE: The Fuchsia source includes Magenta. See Fuchsia's
+NOTE: The Fuchsia source includes Zircon. See Fuchsia's
 [Getting Started](https://fuchsia.googlesource.com/docs/+/master/getting_started.md)
-doc. Follow this doc to work on only Magenta.
+doc. Follow this doc to work on only Zircon.
 ***
 
-The Magenta Git repository is located
-at: https://fuchsia.googlesource.com/magenta
+The Zircon Git repository is located
+at: https://fuchsia.googlesource.com/zircon
 
 To clone the repository, assuming you setup the $SRC variable
 in your environment:
 ```shell
-git clone https://fuchsia.googlesource.com/magenta $SRC/magenta
+git clone https://fuchsia.googlesource.com/zircon $SRC/zircon
 ```
 
-For the purpose of this document, we will assume that Magenta is checked
-out in $SRC/magenta and that we will build toolchains, QEMU, etc alongside
+For the purpose of this document, we will assume that Zircon is checked
+out in $SRC/zircon and that we will build toolchains, QEMU, etc alongside
 that.  Various make invocations are presented with a "-j32" option for
 parallel make.  If that's excessive for the machine you're building on,
 try -j16 or -j8.
@@ -53,7 +53,7 @@
 ## Install Toolchains
 
 If you're developing on Linux or macOS, there are prebuilt toolchain binaries avaiable.
-Just run this script from your Magenta working directory:
+Just run this script from your Zircon working directory:
 
 ```
 ./scripts/download-toolchain
@@ -62,39 +62,39 @@
 If you would like to build the toolchains yourself, follow the instructions later
 in the document.
 
-## Build Magenta
+## Build Zircon
 
-Build results will be in $SRC/magenta/build-{qemu-arm64,pc-x86-64}
+Build results will be in $SRC/zircon/build-{qemu-arm64,pc-x86-64}
 
 The variable $BUILDDIR in examples below refers to the build output directory
 for the particular build in question.
 
 ```
-cd $SRC/magenta
+cd $SRC/zircon
 
 # for aarch64
-make -j32 magenta-qemu-arm64
+make -j32 zircon-qemu-arm64
 
 # for x86-64
-make -j32 magenta-pc-x86-64
+make -j32 zircon-pc-x86-64
 ```
 
 ### Using Clang
 
-To build Magenta using Clang as the target toolchain, set the
+To build Zircon using Clang as the target toolchain, set the
 `USE_CLANG=true` variable when invoking Make.
 
 ```
-cd $SRC/magenta
+cd $SRC/zircon
 
 # for aarch64
-make -j32 USE_CLANG=true magenta-qemu-arm64
+make -j32 USE_CLANG=true zircon-qemu-arm64
 
 # for x86-64
-make -j32 USE_CLANG=true magenta-pc-x86-64
+make -j32 USE_CLANG=true zircon-pc-x86-64
 ```
 
-## Building Magenta for all targets
+## Building Zircon for all targets
 
 ```
 # The -r enables release builds as well
@@ -109,14 +109,14 @@
 You can skip this if you're only testing on actual hardware, but the emulator
 is handy for quick local tests and generally worth having around.
 
-See [QEMU](qemu.md) for information on building and using QEMU with magenta.
+See [QEMU](qemu.md) for information on building and using QEMU with zircon.
 
 
 ## Build Toolchains (Optional)
 
 If the prebuilt toolchain binaries do not work for you, there are a
 set of scripts which will download and build suitable gcc toolchains
-for building Magenta for the ARM64 and x86-64 architectures:
+for building Zircon for the ARM64 and x86-64 architectures:
 
 ```
 cd $SRC
@@ -142,13 +142,13 @@
 export PATH=$PATH:$SRC/toolchains/x86_64-elf-5.3.0-Darwin-x86_64/bin
 ```
 
-## Copying files to and from Magenta
+## Copying files to and from Zircon
 
-With local link IPv6 configured, the host tool ./build-magenta-ARCH/tools/netcp
+With local link IPv6 configured, the host tool ./build-zircon-ARCH/tools/netcp
 can be used to copy files.
 
 ```
-# Copy the file myprogram to Magenta
+# Copy the file myprogram to Zircon
 netcp myprogram :/tmp/myprogram
 
 # Copy the file myprogram back to the host
@@ -157,7 +157,7 @@
 
 ## Including Additional Userspace Files
 
-The Magenta build creates a bootfs image containing necessary userspace components
+The Zircon build creates a bootfs image containing necessary userspace components
 for the system to boot (the device manager, some device drivers, etc).  The kernel
 is capable of including a second bootfs image which is provided by QEMU or the
 bootloader as a ramdisk image.
@@ -175,22 +175,22 @@
 $BUILDDIR/tools/mkbootfs -o extra.bootfs manifest
 ```
 
-On the booted Magenta system, the files in the bootfs will appear under /boot, so
+On the booted Zircon system, the files in the bootfs will appear under /boot, so
 in the above manifest example, the "hosts" file would appear at /boot/etc/hosts.
 
-For QEMU, use the -x option to the run-magenta-* scripts to specify an extra bootfs image.
+For QEMU, use the -x option to the run-zircon-* scripts to specify an extra bootfs image.
 
 ## Network Booting
 
-Network booting is supported via two mechanisms: Gigaboot and Magentaboot.
-Gigaboot is an EFI based bootloader whereas magentaboot is a mechanism that
-allows a minimal magenta system to serve as a bootloader for magenta.
+Network booting is supported via two mechanisms: Gigaboot and Zirconboot.
+Gigaboot is an EFI based bootloader whereas zirconboot is a mechanism that
+allows a minimal zircon system to serve as a bootloader for zircon.
 
 On systems that boot via EFI (such as Acer and NUC), either option is viable.
-On other systems, magentaboot may be the only option for network booting.
+On other systems, zirconboot may be the only option for network booting.
 
 ### Via Gigaboot
-The [GigaBoot20x6](https://fuchsia.googlesource.com/magenta/+/master/bootloader) bootloader speaks a simple network boot protocol (over IPV6 UDP)
+The [GigaBoot20x6](https://fuchsia.googlesource.com/zircon/+/master/bootloader) bootloader speaks a simple network boot protocol (over IPV6 UDP)
 which does not require any special host configuration or privileged access to use.
 
 It does this by taking advantage of IPV6 Link Local Addressing and Multicast,
@@ -198,14 +198,14 @@
 it and send a system image to it.
 
 If you have a device (for example a Broadwell or Skylake Intel NUC) running
-GigaBoot20x6 first create a USB drive [manually](https://fuchsia.googlesource.com/magenta/+/master/docs/targets/acer12.md#How-to-Create-a-Bootable-USB-Flash-Drive)
+GigaBoot20x6 first create a USB drive [manually](https://fuchsia.googlesource.com/zircon/+/master/docs/targets/acer12.md#How-to-Create-a-Bootable-USB-Flash-Drive)
 or (Linux only) using the [script](https://fuchsia.googlesource.com/scripts/+/master/build-bootable-usb-gigaboot.sh).
 
 ```
-$BUILDDIR/tools/bootserver $BUILDDIR/magenta.bin
+$BUILDDIR/tools/bootserver $BUILDDIR/zircon.bin
 
 # if you have an extra bootfs image (see above):
-$BUILDDIR/tools/bootserver $BUILDDIR/magenta.bin /path/to/extra.bootfs
+$BUILDDIR/tools/bootserver $BUILDDIR/zircon.bin /path/to/extra.bootfs
 ```
 
 By default bootserver will continue to run and every time it obsveres a netboot
@@ -213,22 +213,22 @@
 pass the -1 option, bootserver will exit after a successful boot instead.
 
 
-### Via Magentaboot
-Magentaboot is a mechanism that allows a magenta system to serve as the
-bootloader for magenta itself. Magentaboot speaks the same boot protocol as
+### Via Zirconboot
+Zirconboot is a mechanism that allows a zircon system to serve as the
+bootloader for zircon itself. Zirconboot speaks the same boot protocol as
 Gigaboot described above.
 
-To use magentaboot, pass the `netsvc.netboot=true` argument to magenta via the
-kernel command line. When magentaboot starts, it will attempt to fetch and boot
-into a magenta system from a bootserver running on the attached host.
+To use zirconboot, pass the `netsvc.netboot=true` argument to zircon via the
+kernel command line. When zirconboot starts, it will attempt to fetch and boot
+into a zircon system from a bootserver running on the attached host.
 
 ## Network Log Viewing
 
-The default build of Magenta includes a network log service that multicasts the
+The default build of Zircon includes a network log service that multicasts the
 system log over the link local IPv6 UDP.  Please note that this is a quick hack
 and the protocol will certainly change at some point.
 
-For now, if you're running Magenta on QEMU with the -N flag or running on hardware
+For now, if you're running Zircon on QEMU with the -N flag or running on hardware
 with a supported ethernet interface (ASIX USB Dongle or Intel Ethernet on NUC),
 the loglistener tool will observe logs broadcast over the local link:
 
@@ -238,7 +238,7 @@
 
 ## Debugging
 
-For random tips on debugging in the magenta environment see
+For random tips on debugging in the zircon environment see
 [debugging](debugging/tips.md).
 
 ## Contribute changes
diff --git a/docs/hacking.md b/docs/hacking.md
index 12d24aa..72c171a 100644
--- a/docs/hacking.md
+++ b/docs/hacking.md
@@ -1,6 +1,6 @@
-# Notes for hacking on Magenta
+# Notes for hacking on Zircon
 
-This file contains a random collection of notes for hacking on Magenta.
+This file contains a random collection of notes for hacking on Zircon.
 
 [TOC]
 
@@ -12,13 +12,13 @@
 
 ```./scripts/buildall -q -c -r```
 
-From the magenta shell run `k ut all` to execute all kernel tests, and
+From the zircon shell run `k ut all` to execute all kernel tests, and
 `runtests` to execute all userspace tests.
 
 ## Syscall generation
 
 Syscall support is generated from
-system/public/magenta/syscalls.sysgen.  A host tool called
+system/public/zircon/syscalls.sysgen.  A host tool called
 [sysgen](../system/host/sysgen) consumes that file and produces output
 for both the kernel and userspace in a variety of languages. This
 output includes C or C++ headers for both the kernel and userspace,
@@ -43,7 +43,7 @@
 If the kernel crashes and the system reboots, the log from the kernel panic will
 appear at `/boot/log/last-panic.txt`, suitable for viewing, downloading, etc.
 
-> Please attach your `last-panic.txt` and `magenta.elf` files to any kernel
+> Please attach your `last-panic.txt` and `zircon.elf` files to any kernel
 > panic bugs you file.
 
 If there's a `last-panic.txt`, that indicates that this is the first successful
@@ -70,7 +70,7 @@
 On a skylake system, all these options together would look something like:
 
 ```
-$ tools/build-magenta-x86_64/bootserver build-magenta-x86_64/magenta.bin -- gfxconsole.early driver.intel-i915-display.disable
+$ tools/build-zircon-x86_64/bootserver build-zircon-x86_64/zircon.bin -- gfxconsole.early driver.intel-i915-display.disable
 ```
 
 To directly output to the console rather than buffering it (useful in the event
@@ -100,7 +100,7 @@
 debugger, or as a general builtin debug mechanism, this can be useful.
 
 ```
-#include <magenta/crashlogger.h>
+#include <zircon/crashlogger.h>
 
 void my_function() {
   crashlogger_request_backtrace();
@@ -144,6 +144,6 @@
 of the deprecated typedef.
 
 ```
-typedef int MX_RESUME_NOT_HANDLED_DEPRECATION __attribute__((deprecated));
-#define MX_RESUME_NOT_HANDLED ((MX_RESUME_NOT_HANDLED_DEPRECATION)(2))
+typedef int ZX_RESUME_NOT_HANDLED_DEPRECATION __attribute__((deprecated));
+#define ZX_RESUME_NOT_HANDLED ((ZX_RESUME_NOT_HANDLED_DEPRECATION)(2))
 ```
diff --git a/docs/handles.md b/docs/handles.md
index ce919c5..47299d8 100644
--- a/docs/handles.md
+++ b/docs/handles.md
@@ -1,4 +1,4 @@
-# Magenta Handles
+# Zircon Handles
 
 [TOC]
 
@@ -37,9 +37,9 @@
 ## Using Handles
 There are many syscalls that create a new kernel object
 and which return a handle to it. To name a few:
-+ `mx_event_create`
-+ `mx_process_create`
-+ `mx_thread_create`
++ `zx_event_create`
++ `zx_process_create`
++ `zx_thread_create`
 
 These calls create both the kernel object and the first
 handle pointing to it. The handle is bound to the process that
@@ -49,33 +49,33 @@
 There is only one syscall that can make a copy of a handle,
 which points to the same kernel object and is bound to the same
 process that issued the syscall:
-+ `mx_handle_duplicate`
++ `zx_handle_duplicate`
 
 There is one syscall that creates an equivalent handle (possibly
 with fewer rights), invalidating the original handle:
-+ `mx_handle_replace`
++ `zx_handle_replace`
 
 There is one syscall that just destroys a handle:
-+ `mx_handle_close`
++ `zx_handle_close`
 
 There is only one syscall that takes a handle bound to calling
 process and binds it into kernel (puts the handle in-transit):
-+ `mx_channel_write`
++ `zx_channel_write`
 
 There is only one syscall that takes an in-transit handle and
 binds it to the calling process:
-+ `mx_channel_read`
++ `zx_channel_read`
 
 The pair of channel syscalls above are used to transfer a handle
 from one process to another. The gist is that it is possible
 to connect two processes with a channel. To transfer a handle
-the source process calls `mx_channel_write` and then the
-destination process calls `mx_channel_read` on the same channel.
+the source process calls `zx_channel_write` and then the
+destination process calls `zx_channel_read` on the same channel.
 
 Finally, there is a single syscall that gives a new process its
 bootstrapping handle, that is, the handle that it can use to
 request other handles:
-+ `mx_process_start`
++ `zx_process_start`
 
 It is natural that the bootstrapping handle points to one end of a
 channel.
diff --git a/docs/hypervisor.md b/docs/hypervisor.md
index e0f7b8e..5668771 100644
--- a/docs/hypervisor.md
+++ b/docs/hypervisor.md
@@ -1,6 +1,6 @@
 # Hypervisor
 
-The Magenta hypervisor can be used to run a guest operating system. It is a work
+The Zircon hypervisor can be used to run a guest operating system. It is a work
 in progress.
 
 ## Running a guest
@@ -8,38 +8,38 @@
 To run a guest using the hypervisor, you must create a bootfs image containing
 the guest and use the `guest` app to launch it.
 
-Note: `guest` only supports the Magenta and Linux kernels.
+Note: `guest` only supports the Zircon and Linux kernels.
 
-On your host device, from the Magenta directory, run:
+On your host device, from the Zircon directory, run:
 ```
-scripts/build-magenta-x86-64
+scripts/build-zircon-x86-64
 
 # Optional: Build Linux, an initial RAM disk, and an EXT2 file-system.
 system/uapp/guest/scripts/mklinux.sh
 system/uapp/guest/scripts/mktoybox.sh -ri
 
-# Optional: Build a GPT disk image for Magenta guests.
+# Optional: Build a GPT disk image for Zircon guests.
 system/uapp/guest/scripts/mkgpt.sh
 
 system/uapp/guest/scripts/mkbootfs.sh
-build-magenta-pc-x86-64/tools/bootserver \
-    build-magenta-pc-x86-64/magenta.bin \
-    build-magenta-pc-x86-64/bootdata-with-guest.bin
+build-zircon-pc-x86-64/tools/bootserver \
+    build-zircon-pc-x86-64/zircon.bin \
+    build-zircon-pc-x86-64/bootdata-with-guest.bin
 ```
 
-### Magenta guest
+### Zircon guest
 
-After netbooting the target device, to run Magenta:
+After netbooting the target device, to run Zircon:
 ```
-/boot/bin/guest -r /boot/data/bootdata.bin /boot/data/magenta.bin
+/boot/bin/guest -r /boot/data/bootdata.bin /boot/data/zircon.bin
 ```
 
-To run Magenta using a GPT disk image:
+To run Zircon using a GPT disk image:
 ```
 /boot/bin/guest \
-    -b /boot/data/magenta.gpt \
+    -b /boot/data/zircon.gpt \
     -r /boot/data/bootdata.bin \
-    /boot/data/magenta.bin
+    /boot/data/zircon.bin
 ```
 
 ### Linux guest
diff --git a/docs/kernel_cmdline.md b/docs/kernel_cmdline.md
index b7dac63..8f89b6f 100644
--- a/docs/kernel_cmdline.md
+++ b/docs/kernel_cmdline.md
@@ -1,6 +1,6 @@
-# Magenta Kernel Commandline Options
+# Zircon Kernel Commandline Options
 
-The Magenta kernel receives a textual commandline from the bootloader,
+The Zircon kernel receives a textual commandline from the bootloader,
 which can be used to alter some behaviours of the system.  Kernel commandline
 parameters are in the form of *option* or *option=value*, separated by
 spaces, and may not contain spaces.
@@ -48,8 +48,8 @@
 ## driver.\<name>.disable
 
 Disables the driver with the given name. The driver name comes from the
-magenta\_driver\_info, and can be found as the second argument to the
-MAGENTA\_DRIVER\_BEGIN macro.
+zircon\_driver\_info, and can be found as the second argument to the
+ZIRCON\_DRIVER\_BEGIN macro.
 
 Example: `driver.usb-audio.disable`
 
@@ -197,7 +197,7 @@
 ## ktrace.grpmask
 
 This option specifies what ktrace records are emitted.
-The value is a bitmask of KTRACE\_GRP\_\* values from magenta/ktrace.h.
+The value is a bitmask of KTRACE\_GRP\_\* values from zircon/ktrace.h.
 Hex values may be specified as 0xNNN.
 
 ## ldso.trace
@@ -206,30 +206,30 @@
 The output is in a form that is consumable by clients like Intel
 Processor Trace support.
 
-## magenta.autorun.boot=\<path>\
+## zircon.autorun.boot=\<path>\
 
 This option requests that the executable at *path* be launched at boot,
 after devmgr starts up.
 
-## magenta.autorun.system=\<path>\
+## zircon.autorun.system=\<path>\
 
 This option requests that the executable at *path* be launched once the
 system partition is mounted and *init* is launched.  If there is no system
 bootfs or system partition, it will never be launched.
 
-## magenta.system.writable=\<bool>
+## zircon.system.writable=\<bool>
 
 This option requests that if a minfs partition with the system type GUID is
 found, it is to be mounted read-write rather than read-only.
 
 ## netsvc.netboot=\<bool>
 
-If true, magenta will attempt to netboot into another instance of magenta upon
+If true, zircon will attempt to netboot into another instance of zircon upon
 booting.
 
-More specifically, magenta will fetch a new magenta system from a bootserver on
+More specifically, zircon will fetch a new zircon system from a bootserver on
 the local link and attempt to kexec into the new image, thereby replacing the
-currently running instance of magenta.
+currently running instance of zircon.
 
 ## userboot=\<path>
 
@@ -255,8 +255,8 @@
 
 ## vdso.soft_ticks=\<bool>
 
-If this option is set, the `mx_ticks_get` and `mx_ticks_per_second` system
-calls will use `mx_time_get(MX_CLOCK_MONOTONIC)` in nanoseconds rather than
+If this option is set, the `zx_ticks_get` and `zx_ticks_per_second` system
+calls will use `zx_time_get(ZX_CLOCK_MONOTONIC)` in nanoseconds rather than
 hardware cycle counters in a hardware-based time unit.  Defaults to false.
 
 ## virtcon.disable
@@ -289,22 +289,22 @@
 Example: `bootloader.fbres=640x480`
 
 ## bootloader.default=\<network|local>
-This option sets the default boot device to netboot or local magenta.bin.
+This option sets the default boot device to netboot or local zircon.bin.
 
 # How to pass the commandline to the kernel
 
-## in Qemu, using scripts/run-magenta*
+## in Qemu, using scripts/run-zircon*
 
 Pass each option using -c, for example:
 ```
-./scripts/run-magenta-x86-64 -c gfxconsole.font=18x32 -c gfxconsole.early=false
+./scripts/run-zircon-x86-64 -c gfxconsole.font=18x32 -c gfxconsole.early=false
 ```
 
 ## in GigaBoot20x6, when netbooting
 
 Pass the kernel commandline at the end, after a -- separator, for example:
 ```
-bootserver magenta.bin bootfs.bin -- gfxconsole.font=18x32 gfxconsole.early=false
+bootserver zircon.bin bootfs.bin -- gfxconsole.font=18x32 gfxconsole.early=false
 ```
 
 ## in GigaBoot20x6, when booting from USB flash
diff --git a/docs/kernel_invariants.md b/docs/kernel_invariants.md
index de8ee4e..4c69b6a 100644
--- a/docs/kernel_invariants.md
+++ b/docs/kernel_invariants.md
@@ -1,11 +1,11 @@
-# Magenta Kernel Invariants
+# Zircon Kernel Invariants
 
-On x86, Magenta needs to maintain the following invariants for code running
+On x86, Zircon needs to maintain the following invariants for code running
 in ring 0 (kernel mode).
 
 These invariants are documented here because they are not necessarily easy
 to test -- breaking an invariant will not necessarily be caught by
-Magenta's test suite.
+Zircon's test suite.
 
 * Flags register:
 
diff --git a/docs/makefile_options.md b/docs/makefile_options.md
index 96973f2..f04f361 100644
--- a/docs/makefile_options.md
+++ b/docs/makefile_options.md
@@ -1,6 +1,6 @@
-# Magenta Makefile Options
+# Zircon Makefile Options
 
-The following options can be passed to **make** when building Magenta:
+The following options can be passed to **make** when building Zircon:
 
 * **BOOTFS_DEBUG_MODULES**: See [debugging tips](debugging/tips.md).
 
diff --git a/docs/mdi.md b/docs/mdi.md
index 04900af..99eb7de 100644
--- a/docs/mdi.md
+++ b/docs/mdi.md
@@ -1,9 +1,9 @@
-# Magenta Device Index (MDI)
+# Zircon Device Index (MDI)
 
 ## Introduction
 
-The Magenta Device Index (MDI) is a read-only binary data structure passed from the bootloader
-that contains configuration information for the kernel and various drivers in magenta.
+The Zircon Device Index (MDI) is a read-only binary data structure passed from the bootloader
+that contains configuration information for the kernel and various drivers in zircon.
 For platforms that use it, the MDI binary data is included as a section in the bootdata.bin file.
 The MDI binary is generated by the mdigen tool from one or more MDI source files.
 The mdigen tool also generates a header file containing C preprocessor defines for the MDI ids
@@ -134,7 +134,7 @@
 ## Binary Format
 
 An MDI binary begins with a `bootdata_t` header
-(see [system/public/magenta/boot/bootdata.h](../system/public/magenta/boot/bootdata.h))
+(see [system/public/zircon/boot/bootdata.h](../system/public/zircon/boot/bootdata.h))
 The `bootdata_t.type` field is set to `BOOTDATA_TYPE_MDI`.
 
 Following the `bootdata_t` header are a sequence of `mdi_node_t` structs.
@@ -152,7 +152,7 @@
 immediately followed by the string value or array elements.
 
 IDs contain the node type in the high bits and the ID's integer value in the low bits.
-See the header file [system/public/magenta/mdi.h](../system/public/magenta/mdi.h) for more details.
+See the header file [system/public/zircon/mdi.h](../system/public/zircon/mdi.h) for more details.
 
 ## mdigen
 
@@ -167,7 +167,7 @@
 
 ## MDI Library
 
-Magenta contains a library for reading the MDI binary format
+Zircon contains a library for reading the MDI binary format
  The library can be used both in the kernel and userspace.
 The header file for the MDI library is at
 [system/ulib/mdi/include/mdi/mdi.h](../system/ulib/mdi/include/mdi/mdi.h).
@@ -178,4 +178,4 @@
 or traverse the children of list nodes.
 
 The MDI library does not allocate memory or depend on any other libraries,
-so it can be used within any context in the magenta kernel or userspace.
+so it can be used within any context in the zircon kernel or userspace.
diff --git a/docs/memory.md b/docs/memory.md
index 2ff8c46..9e7ab7a 100644
--- a/docs/memory.md
+++ b/docs/memory.md
@@ -1,6 +1,6 @@
 # Memory and resource usage
 
-This file contains information about memory and resource management in Magenta,
+This file contains information about memory and resource management in Zircon,
 and talks about ways to examine process and system memory usage.
 
 *** note
@@ -24,14 +24,14 @@
 TASK           PSS PRIVATE  SHARED NAME
 j:1028       32.9M   32.8M         root
   p:1043   1386.3k   1384k     28k bin/devmgr
-  j:1082     30.0M   30.0M         magenta-drivers
+  j:1082     30.0M   30.0M         zircon-drivers
     p:1209  774.3k    772k     28k /boot/bin/acpisvc
     p:1565  250.3k    248k     28k devhost:root
     p:1619  654.3k    652k     28k devhost:misc
     p:1688  258.3k    256k     28k devhost:platform
     p:1867 3878.3k   3876k     28k devhost:pci#1:1234:1111
     p:1916   24.4M   24.4M     28k devhost:pci#3:8086:2922
-  j:1103   1475.7k   1464k         magenta-services
+  j:1103   1475.7k   1464k         zircon-services
     p:1104  298.3k    296k     28k crashlogger
     p:1290  242.3k    240k     28k netsvc
     p:2115  362.3k    360k     28k sh:console
@@ -112,9 +112,9 @@
 # This 'R' region is a dynamic library. The r-x section is .text, the r--
 # section is .rodata, and the rw- section is .data + .bss.
 R  00000187bc867000-00000187bc881000      104k:sz                    'useralloc'
- M 00000187bc867000-00000187bc87d000 r-x   88k:sz   0B:res  2535:vmo 'libmxio.so'
- M 00000187bc87e000-00000187bc87f000 r--    4k:sz   4k:res  2537:vmo 'libmxio.so'
- M 00000187bc87f000-00000187bc881000 rw-    8k:sz   8k:res  2537:vmo 'libmxio.so'
+ M 00000187bc867000-00000187bc87d000 r-x   88k:sz   0B:res  2535:vmo 'libfdio.so'
+ M 00000187bc87e000-00000187bc87f000 r--    4k:sz   4k:res  2537:vmo 'libfdio.so'
+ M 00000187bc87f000-00000187bc881000 rw-    8k:sz   8k:res  2537:vmo 'libfdio.so'
 ...
 # This 2MB anonymous mapping is probably part of the heap.
 M  0000246812b91000-0000246812d91000 rw-    2M:sz  76k:res  2542:vmo 'mmap-anonymous'
@@ -172,12 +172,12 @@
 
 -   `rights`: If the process points to the VMO via a handle, this column shows
     the rights that the handle has, zero or more of:
-    -   `r`: `MX_RIGHT_READ`
-    -   `w`: `MX_RIGHT_WRITE`
-    -   `x`: `MX_RIGHT_EXECUTE`
-    -   `m`: `MX_RIGHT_MAP`
-    -   `d`: `MX_RIGHT_DUPLICATE`
-    -   `t`: `MX_RIGHT_TRANSFER`
+    -   `r`: `ZX_RIGHT_READ`
+    -   `w`: `ZX_RIGHT_WRITE`
+    -   `x`: `ZX_RIGHT_EXECUTE`
+    -   `m`: `ZX_RIGHT_MAP`
+    -   `d`: `ZX_RIGHT_DUPLICATE`
+    -   `t`: `ZX_RIGHT_TRANSFER`
     -   **NOTE**: Non-handle entries will have a single '-' in this colum.
 -   `koid`: The koid of the VMO, if it has one. Zero otherwise. A VMO without a
     koid was created by the kernel, and has never had a userspace handle.
@@ -206,7 +206,7 @@
 > NOTE: This is a kernel command, and will print to the kernel console.
 
 ```
-k mx vmos hidden
+k zx vmos hidden
 ```
 
 Similar to `vmos <pid>`, but dumps all VMOs in the system that are not mapped
@@ -219,9 +219,9 @@
 
 A `#map` value of zero means that the VMO is not mapped into any address space.
 
-**See also**: `k mx vmos all`, which dumps all VMOs in the system. **NOTE**:
+**See also**: `k zx vmos all`, which dumps all VMOs in the system. **NOTE**:
 It's very common for this output to be truncated because of kernel console
-buffer limitations, so it's often better to combine the `k mx vmos hidden`
+buffer limitations, so it's often better to combine the `k zx vmos hidden`
 output with a `vmaps` dump of each user process.
 
 ### Limitations
@@ -243,8 +243,8 @@
     E.g., a process could have a million handles open, and those handles consume
     kernel memory.
 
-    You can look at process handle consumption with the `k mx ps` command; run
-    `k mx ps help` for a description of its columns.
+    You can look at process handle consumption with the `k zx ps` command; run
+    `k zx ps help` for a description of its columns.
 
 ## Kernel memory
 
@@ -286,14 +286,14 @@
 > NOTE: This is a kernel command, and will print to the kernel console.
 
 ```
-k mx asd kernel
+k zx asd kernel
 ```
 
 Dumps the kernel's VMAR/mapping/VMO hierarchy, similar to the `vmaps` tool for
 user processes.
 
 ```
-$ k mx asd kernel
+$ k zx asd kernel
 as 0xffffffff80252b20 [0xffffff8000000000 0xffffffffffffffff] sz 0x8000000000 fl 0x1 ref 71 'kernel'
   vmar 0xffffffff802529a0 [0xffffff8000000000 0xffffffffffffffff] sz 0x8000000000 ref 1 'root'
     map 0xffffff80015f89a0 [0xffffff8000000000 0xffffff8fffffffff] sz 0x1000000000 mmufl 0x18 vmo 0xffffff80015f8890/k0 off 0 p ages 0 ref 1 ''
diff --git a/docs/minfs.md b/docs/minfs.md
index dcb80d9..05d1a99 100644
--- a/docs/minfs.md
+++ b/docs/minfs.md
@@ -1,6 +1,6 @@
 # MinFS
 
-MinFS is a simple, unix-like filesystem built for Magenta.
+MinFS is a simple, unix-like filesystem built for Zircon.
 
 It currently supports files up to 512MB in size.
 
@@ -15,12 +15,12 @@
 (Mac)
 $ mkfile -n 16g blk.bin
 ```
- * Execute the run magenta script on your platform with the '--' to pass
+ * Execute the run zircon script on your platform with the '--' to pass
    arguments directly to QEMU and then use '-hda' to point to the file. If you
    wish to attach additional devices, you can supply them with '-hdb', '-hdc,
    and so on.
 ```shell
-$ ./scripts/run-magenta-x86-64 -- -hda blk.bin
+$ ./scripts/run-zircon-x86-64 -- -hda blk.bin
 ```
 
 ### Target Device (QEMU and Real Hardware)
@@ -31,9 +31,9 @@
 **BE CAREFUL NOT TO FORMAT THE WRONG DEVICE.** If in doubt, only run the
 following commands through QEMU.
 The `lsblk` command can be used to see more information about the devices
-accessible from Magenta.
+accessible from Zircon.
 
- * Within magenta, 'lsblk' can be used to list the block devices currently on
+ * Within zircon, 'lsblk' can be used to list the block devices currently on
    the system. On this example system below, "/dev/class/block/000" is a raw
    block device.
 ```
@@ -65,7 +65,7 @@
 ```
 > gpt add 34 20000000 minfs /dev/class/block/002
 ```
- * Within Magenta, format the partition as MinFS. Using 'lsblk' you should see
+ * Within Zircon, format the partition as MinFS. Using 'lsblk' you should see
    a block device which is the whole disk and a slightly smaller device which
    is the partition. In the above output, the partition is device 003, and would
    have the path '/dev/class/block/003'
diff --git a/docs/mx_and_lk.md b/docs/mx_and_lk.md
deleted file mode 100644
index 381c922..0000000
--- a/docs/mx_and_lk.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# Magenta and LK
-
-LK is a Kernel designed for small systems typically used in embedded
-applications. It is a good alternative to commercial offerings like
-[FreeRTOS](http://www.freertos.org/) or [ThreadX](http://rtos.com/products/threadx/).
-Such systems often have a very limited amount of ram, a fixed set of peripherals
-and a bounded set of tasks.
-
-On the other hand, Magenta targets modern phones and modern personal computers
-with fast processors, non-trivial amounts of ram with arbitrary peripherals
-doing open ended computation.
-
-Magenta inner constructs are based on [LK](https://github.com/littlekernel/lk) but
-the layers above are new. For example, Magenta has the concept of a process but LK
-does not. However, a Magenta process is made of by LK-level constructs such as
-threads and memory.
-
-More specifically, some the visible differences are:
-
-+ Magenta has first class user-mode support. LK does not.
-+ Magenta is an object-handle system. LK does not have either concept.
-+ Magenta has a capability-based security model. In LK all code is trusted.
-
-Over time, even the low level constructs will change to accomodate the new
-requirements and to be a better fit with the rest of the system.
-
diff --git a/docs/objects.md b/docs/objects.md
index 6207e74..7b82073 100644
--- a/docs/objects.md
+++ b/docs/objects.md
@@ -1,12 +1,12 @@
-# Magenta Kernel objects
+# Zircon Kernel objects
 
 [TOC]
 
-Magenta is a object-based kernel. User mode code almost exclusively interacts
+Zircon is a object-based kernel. User mode code almost exclusively interacts
 with OS resources via object handles. A handle can be thought of as an active
 session with a specific OS subsystem scoped to a particular resource.
 
-Magenta actively manages the following resources:
+Zircon actively manages the following resources:
 
 + processor time
 + memory and address spaces
diff --git a/docs/objects/channel.md b/docs/objects/channel.md
index ff67e62..dee7969 100644
--- a/docs/objects/channel.md
+++ b/docs/objects/channel.md
@@ -13,17 +13,17 @@
 
 Channels maintain an ordered queue of messages to be delivered in
 either direction. A message consists of some amount of data and some
-number of handles. A call to *mx_channel_write()* enqueues one message,
-and a call to *mx_channel_read()* dequeues one message (if any are
+number of handles. A call to *zx_channel_write()* enqueues one message,
+and a call to *zx_channel_read()* dequeues one message (if any are
 queued). A thread can block until messages are pending via
-*mx_object_wait_one()* or other waiting mechanisms.
+*zx_object_wait_one()* or other waiting mechanisms.
 
-Alternatively, a call to *mx_channel_call()* enqueues a message in one
+Alternatively, a call to *zx_channel_call()* enqueues a message in one
 direction of the channel, waits for a corresponding response, and
 dequeues the response message. In call mode, corresponding responses
 are identified via the first 4 bytes of the message, called the
 transaction ID. Coming up with distinct transaction IDs is up to the
-users of *mx_channel_call()*.
+users of *zx_channel_call()*.
 
 The process of sending a message via a channel has two steps. The
 first is to atomically write the data into the channel and move
@@ -34,7 +34,7 @@
 read, all the handles in the next message to read are either
 atomically moved into the process's handle table, all remain in the
 channel, or are discarded (only when the
-**MX_CHANNEL_READ_MAY_DISCARD** option is given).
+**ZX_CHANNEL_READ_MAY_DISCARD** option is given).
 
 Unlike many other kernel object types, channels are not
 duplicatable. Thus there is only ever one handle associated to a
@@ -59,5 +59,5 @@
 
 ## SEE ALSO
 
-+ [Magenta concepts](../concepts.md)
++ [Zircon concepts](../concepts.md)
 + [Handles](../handles.md)
diff --git a/docs/objects/event.md b/docs/objects/event.md
index c25deed..0e583ba 100644
--- a/docs/objects/event.md
+++ b/docs/objects/event.md
@@ -7,7 +7,7 @@
 ## SYNOPSIS
 
 Events are user-signalable objects. The 8 signal bits reserved for
-userspace (*MX_USER_SIGNAL_0* through *MX_USER_SIGNAL_7*) may be set,
+userspace (*ZX_USER_SIGNAL_0* through *ZX_USER_SIGNAL_7*) may be set,
 cleared, and waited upon.
 
 ## DESCRIPTION
diff --git a/docs/objects/eventpair.md b/docs/objects/eventpair.md
index 863a33c..16a8f3c 100644
--- a/docs/objects/eventpair.md
+++ b/docs/objects/eventpair.md
@@ -7,8 +7,8 @@
 ## SYNOPSIS
 
 Event Pairs are linked pairs of user-signalable objects. The 8 signal
-bits reserved for userspace (*MX_USER_SIGNAL_0* through
-*MX_USER_SIGNAL_7*) may be set or cleared on the local or opposing
+bits reserved for userspace (*ZX_USER_SIGNAL_0* through
+*ZX_USER_SIGNAL_7*) may be set or cleared on the local or opposing
 endpoint of an Event Pair.
 
 ## DESCRIPTION
diff --git a/docs/objects/futex.md b/docs/objects/futex.md
index f4bd934..af50cc0 100644
--- a/docs/objects/futex.md
+++ b/docs/objects/futex.md
@@ -15,14 +15,14 @@
 
 ## DESCRIPTION
 
-The magenta futex implementation currently supports three operations:
+The zircon futex implementation currently supports three operations:
 
 ```C
-    mx_status_t mx_futex_wait(mx_futex_t* value_ptr, int current_value,
-                              mx_time_t timeout);
-    mx_status_t mx_futex_wake(mx_futex_t* value_ptr, uint32_t wake_count);
-    mx_status_t mx_futex_requeue(mx_futex_t* value_ptr, uint32_t wake_count,
-                                 int current_value, mx_futex_t* requeue_ptr,
+    zx_status_t zx_futex_wait(zx_futex_t* value_ptr, int current_value,
+                              zx_time_t timeout);
+    zx_status_t zx_futex_wake(zx_futex_t* value_ptr, uint32_t wake_count);
+    zx_status_t zx_futex_requeue(zx_futex_t* value_ptr, uint32_t wake_count,
+                                 int current_value, zx_futex_t* requeue_ptr,
                                  uint32_t requeue_count);
 ```
 
@@ -40,7 +40,7 @@
 
 ### Differences from Linux futexes
 
-Note that all of the magenta futex operations key off of the virtual
+Note that all of the zircon futex operations key off of the virtual
 address of an userspace pointer. This differs from the Linux
 implementation, which distinguishes private futex operations (which
 correspond to our in-process-only ones) from ones shared across
diff --git a/docs/objects/process.md b/docs/objects/process.md
index 33e2d68..0906507 100644
--- a/docs/objects/process.md
+++ b/docs/objects/process.md
@@ -6,7 +6,7 @@
 
 ## SYNOPSIS
 
-A magenta process is an instance of a program in the traditional
+A zircon process is an instance of a program in the traditional
 sense: a set of instructions which will be executed by one or more
 threads, along with a collection of resources.
 
diff --git a/docs/objects/socket.md b/docs/objects/socket.md
index 31aa2c0..27fc270 100644
--- a/docs/objects/socket.md
+++ b/docs/objects/socket.md
@@ -11,40 +11,40 @@
 
 ## DESCRIPTION
 
-Data is written into one end of a socket via *mx_socket_write* and
-read from the opposing end via *mx_socket_read*.
+Data is written into one end of a socket via *zx_socket_write* and
+read from the opposing end via *zx_socket_read*.
 
 Upon creation, both ends of the socket are writable and readable. Via the
-**MX_SOCKET_SHUTDOWN_READ** and **MX_SOCKET_SHUTDOWN_WRITE** options to
-*mx_socket_write*, one end of the socket can be closed for reading and/or
+**ZX_SOCKET_SHUTDOWN_READ** and **ZX_SOCKET_SHUTDOWN_WRITE** options to
+*zx_socket_write*, one end of the socket can be closed for reading and/or
 writing.
 
 ## SIGNALS
 
 The following signals may be set for a socket object.
 
-**MX_SOCKET_READABLE** data is available to read from the socket
+**ZX_SOCKET_READABLE** data is available to read from the socket
 
-**MX_SOCKET_WRITABLE** data may be written to the socket
+**ZX_SOCKET_WRITABLE** data may be written to the socket
 
-**MX_SOCKET_PEER_CLOSED** the other endpoint of this socket has
+**ZX_SOCKET_PEER_CLOSED** the other endpoint of this socket has
 been closed.
 
-**MX_SOCKET_READ_DISABLED** reading (beyond already buffered data) is disabled
+**ZX_SOCKET_READ_DISABLED** reading (beyond already buffered data) is disabled
 permanently for this endpoint either because of passing
-**MX_SOCKET_SHUTDOWN_READ** to this endpoint or passing
-**MX_SOCKET_SHUTDOWN_WRITE** to the peer. Reads on a socket endpoint with this
+**ZX_SOCKET_SHUTDOWN_READ** to this endpoint or passing
+**ZX_SOCKET_SHUTDOWN_WRITE** to the peer. Reads on a socket endpoint with this
 signal raised will succeed so long as there is data in the socket that was
 written before reading was disabled.
 
-**MX_SOCKET_WRITE_DISABLED** writing is disabled permanently for this endpoing either
-because of passing **MX_SOCKET_SHUTDOWN_WRITE** to this endpoint or passing
-**MX_SOCKET_SHUTDOWN_READ** to the peer.
+**ZX_SOCKET_WRITE_DISABLED** writing is disabled permanently for this endpoing either
+because of passing **ZX_SOCKET_SHUTDOWN_WRITE** to this endpoint or passing
+**ZX_SOCKET_SHUTDOWN_READ** to the peer.
 
-**MX_SOCKET_CONTROL_READABLE** data is available to read from the
+**ZX_SOCKET_CONTROL_READABLE** data is available to read from the
 socket control plane.
 
-**MX_SOCKET_CONTROL_WRITABLE** data may be written to the socket control plane.
+**ZX_SOCKET_CONTROL_WRITABLE** data may be written to the socket control plane.
 
 ## SYSCALLS
 
diff --git a/docs/objects/vm_address_region.md b/docs/objects/vm_address_region.md
index 33c97d9..51b32ea 100644
--- a/docs/objects/vm_address_region.md
+++ b/docs/objects/vm_address_region.md
@@ -30,55 +30,55 @@
 creation time, the caller can choose which randomization algorithm is used.
 The default allocator attempts to spread allocations widely across the full
 width of the VMAR.  The alternate allocator, selected with
-*MX_VM_FLAG_COMPACT*, attempts to keep allocations close together within the
+*ZX_VM_FLAG_COMPACT*, attempts to keep allocations close together within the
 VMAR, but at a random location within the range.  It is recommended to use
 the default allocator.
 
 VMARs optionally support a fixed-offset mapping mode (called specific mapping).
 This mode can be used to create guard pages or ensure the relative locations of
-mappings.  Each VMAR may have the *MX_VM_FLAG_CAN_MAP_SPECIFIC* permission,
+mappings.  Each VMAR may have the *ZX_VM_FLAG_CAN_MAP_SPECIFIC* permission,
 regardless of whether or not its parent VMAR had that permission.
 
 ## EXAMPLE
 
 ```c
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 /* Map this VMO into the given VMAR, with |before| bytes of unmapped guard space
    before it and |after| bytes after it.  */
-mx_status_t map_with_guard(mx_handle_t vmar, size_t before, size_t after,
-                           mx_handle_t vmo, uint64_t vmo_offset,
+zx_status_t map_with_guard(zx_handle_t vmar, size_t before, size_t after,
+                           zx_handle_t vmo, uint64_t vmo_offset,
                            size_t mapping_len, uintptr_t* mapped_addr,
-                           mx_handle_t* wrapping_vmar) {
+                           zx_handle_t* wrapping_vmar) {
 
     /* wrap around check elided */
     const size_t child_vmar_size = before + after + mapping_len;
-    const uint32_t child_vmar_flags = MX_VM_FLAG_CAN_MAP_READ |
-                                      MX_VM_FLAG_CAN_MAP_WRITE |
-                                      MX_VM_FLAG_CAN_MAP_SPECIFIC;
-    const uint32_t mapping_flags = MX_VM_FLAG_SPECIFIC |
-                                   MX_VM_FLAG_PERM_READ |
-                                   MX_VM_FLAG_PERM_WRITE;
+    const uint32_t child_vmar_flags = ZX_VM_FLAG_CAN_MAP_READ |
+                                      ZX_VM_FLAG_CAN_MAP_WRITE |
+                                      ZX_VM_FLAG_CAN_MAP_SPECIFIC;
+    const uint32_t mapping_flags = ZX_VM_FLAG_SPECIFIC |
+                                   ZX_VM_FLAG_PERM_READ |
+                                   ZX_VM_FLAG_PERM_WRITE;
 
     uintptr_t child_vmar_addr;
-    mx_handle_t child_vmar;
-    mx_status_t status = mx_vmar_allocate(vmar, 0, child_vmar_size,
+    zx_handle_t child_vmar;
+    zx_status_t status = zx_vmar_allocate(vmar, 0, child_vmar_size,
                                           child_vmar_flags, &child_vmar,
                                           &child_vmar_addr);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
-    status = mx_vmar_map(child_vmar, before, vmo, vmo_offset, mapping_len,
+    status = zx_vmar_map(child_vmar, before, vmo, vmo_offset, mapping_len,
                          mapping_flags, mapped_addr);
-    if (status != MX_OK) {
-        mx_vmar_destroy(child_vmar);
-        mx_handle_close(child_vmar);
+    if (status != ZX_OK) {
+        zx_vmar_destroy(child_vmar);
+        zx_handle_close(child_vmar);
         return status;
     }
 
     *wrapping_vmar = child_vmar;
-    return MX_OK;
+    return ZX_OK;
 }
 ```
 
diff --git a/docs/objects/vm_object.md b/docs/objects/vm_object.md
index 3129424..657569f 100644
--- a/docs/objects/vm_object.md
+++ b/docs/objects/vm_object.md
@@ -19,7 +19,7 @@
 performed on them with [vmo_read](../syscalls/vmo_read.md) and [vmo_write](../syscalls/vmo_write.md). A VMO's size may be set using [vmo_set_size](../syscalls/vmo_set_size.md). Conversely, [vmo_get_size](../syscalls/vmo_get_size.md) will retrieve a VMO's current size.
 
 Pages are committed (allocated) for VMOs on demand through [vmo_read](../syscalls/vmo_read.md), [vmo_write](../syscalls/vmo_write.md), or by writing to a mapping of the VMO created using [vmar_map](../syscalls/vmar_map.md). Pages can be commited and decommited from a VMO manually by calling
-[vmo_op_range](../syscalls/vmo_op_range.md) with the *MX_VMO_OP_COMMIT* and *MX_VMO_OP_DECOMMIT*
+[vmo_op_range](../syscalls/vmo_op_range.md) with the *ZX_VMO_OP_COMMIT* and *ZX_VMO_OP_DECOMMIT*
 operations, but this should be considered a low level operation. [vmo_op_range](../syscalls/vmo_op_range.md) can also be used for cache and locking operations against pages a VMO holds.
 
 Processes with special purpose use cases involving cache policy can use
diff --git a/docs/oom.md b/docs/oom.md
index 64528e5..079c4fe 100644
--- a/docs/oom.md
+++ b/docs/oom.md
@@ -106,7 +106,7 @@
 
 TODO(dbort): Implement and document. This will be a driver that picks which job
 should be killed if the system hits a low-memory condition. It combines
-[MX_PROP_JOB_IMPORTANCE](syscalls/object_get_property.md#MX_PROP_JOB_IMPORTANCE)
+[ZX_PROP_JOB_IMPORTANCE](syscalls/object_get_property.md#ZX_PROP_JOB_IMPORTANCE)
 hints with other heuristics to generate a total ordering of all jobs in the
 system, and feeds that order to the kernel using
-[mx_job_set_relative_importance](syscalls/job_set_relative_importance.md).
+[zx_job_set_relative_importance](syscalls/job_set_relative_importance.md).
diff --git a/docs/program_loading.md b/docs/program_loading.md
index 9b8b93b..f04015f 100644
--- a/docs/program_loading.md
+++ b/docs/program_loading.md
@@ -1,6 +1,6 @@
-# Magenta program loading and dynamic linking
+# Zircon program loading and dynamic linking
 
-In Magenta, the kernel is not directly involved in normal program loading.
+In Zircon, the kernel is not directly involved in normal program loading.
 (The one necessary exception is bootstrapping the userspace environment at
 system startup; see [`userboot`](userboot.md).)  Instead, the kernel merely
 provides the building blocks
@@ -12,16 +12,16 @@
 
 ## ELF and the system ABI
 
-The standard Magenta userspace environment uses
+The standard Zircon userspace environment uses
 the [ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format)
 format for machine-code executable files, and provides a dynamic linker and
-C/C++ execution environment that are based on ELF.  Magenta processes can
+C/C++ execution environment that are based on ELF.  Zircon processes can
 use [system calls](syscalls.md) only via the [vDSO](vdso.md), which is
 provided by the kernel in ELF format and uses the C/C++ calling conventions
 common to ELF-based systems for the machine.  Userspace code (given the
 appropriate capabilities) can use the [system call](syscalls.md) building
 blocks directly to create processes and load programs into them without
-using ELF.  But Magenta's standard ABI for machine code uses ELF as
+using ELF.  But Zircon's standard ABI for machine code uses ELF as
 described here.
 
 ## Background: traditional ELF program loading
@@ -68,11 +68,11 @@
        When dynamic linking startup is complete, the dynamic linker jumps to
        the main executable's entry point address.
 
-Magenta program loading is inspired by this tradition, but does it somewhat
+Zircon program loading is inspired by this tradition, but does it somewhat
 differently.  A key reason for the traditional pattern of loading the
 executable before loading the dynamic linker is that the dynamic linker's
 randomly-chosen base address must not intersect with the fixed addresses
-used by an `ET_EXEC` executable file.  Magenta does not support
+used by an `ET_EXEC` executable file.  Zircon does not support
 fixed-address program loading (ELF `ET_EXEC` files) at all, only
 position-independent executables or *PIE*s, which are ELF `ET_DYN` files.
 
@@ -83,21 +83,21 @@
 in
 [`<launchpad/launchpad.h>`](../system/ulib/launchpad/include/launchpad/launchpad.h) but
 is not formally documented.  The `launchpad` API is not described here.  Its
-treatment of executable files and process startup forms the Magenta system
+treatment of executable files and process startup forms the Zircon system
 ABI for program loading.
 The [lowest userspace layers of the system](userboot.md) implement the same
 protocols.  It's anticipated that in the future most process launching in
 the system will be done by a system service that uses `launchpad` in its
 implementation, rather than by direct use of the library.
 
-Filesystems are not part of the lower layers of Magenta API.  Instead,
+Filesystems are not part of the lower layers of Zircon API.  Instead,
 program loading is based on [VMOs](objects/vm_object.md) and on IPC
 protocols used via [channels](objects/channel.md).
 
 A program loading request starts with:
 
- * a handle to a VMO containing the executable file (`MX_RIGHT_READ` and
-   `MX_RIGHT_EXECUTE` rights are required)
+ * a handle to a VMO containing the executable file (`ZX_RIGHT_READ` and
+   `ZX_RIGHT_EXECUTE` rights are required)
  * a list of argument strings (to become `argv[]` in a C/C++ program)
  * a list of environment strings (to become `environ[]` in a C/C++ program)
  * a list of initial [handles](handles.md), each with
@@ -173,7 +173,7 @@
 
      Thus, the program entry point can be written as a C function:
      ```c
-     noreturn void _start(mx_handle_t bootstrap_channel, uintptr_t vdso_base);
+     noreturn void _start(zx_handle_t bootstrap_channel, uintptr_t vdso_base);
      ```
 
 {#PT_INTERP}
@@ -236,7 +236,7 @@
 
 ## The **processargs** protocol
 
-[`<magenta/processargs.h>`](../system/public/magenta/processargs.h) defines
+[`<zircon/processargs.h>`](../system/public/zircon/processargs.h) defines
 the protocol for the *bootstrap message* sent on the *bootstrap channel* by
 the program loader.  When a process starts up, it has a handle to this
 bootstrap channel and it has access to [system calls](syscalls.md) via
@@ -253,7 +253,7 @@
 constrained environment.  Heap allocation is impossible and nontrivial
 library facilities may not be available.
 
-See the [header file](../system/public/magenta/processargs.h) for full
+See the [header file](../system/public/zircon/processargs.h) for full
 details of the message format.  It's anticipated that this ad hoc protocol
 will be replaced with a formal IDL-based protocol eventually, but the
 format will be kept simple enough to be decoded by simple hand-written
@@ -292,7 +292,7 @@
 responsible getting access to all these additional files to complete
 dynamic linking before the main program's entry point gets control.
 
-All of Magenta's standard userspace uses dynamic linking, down to the very
+All of Zircon's standard userspace uses dynamic linking, down to the very
 first process loaded by [`userboot`](userboot.md).  Device drivers and
 filesystems are implemented by userspace programs loaded this way.  So
 program loading cannot be defined in terms of higher-layer abstractions
@@ -306,7 +306,7 @@
 representing the additional files it needs to load as shared libraries.
 
 This is a simple RPC protocol, defined in
-[`<magenta/processargs.h>`](../system/public/magenta/processargs.h).
+[`<zircon/processargs.h>`](../system/public/zircon/processargs.h).
 As with [the `processargs` protocol](#the-processargs-protocol),
 it's anticipated that this ad hoc protocol will be replaced with a formal
 IDL-based protocol eventually, but the format will be kept simple enough to
@@ -318,7 +318,7 @@
 `processargs` bootstrap message, identified by the *handle info entry*
 `PA_HND(PA_SVC_LOADER, 0)`.  All requests are synchronous RPCs made
 with [**channel_call**()](syscalls/channel_call.md).  Both requests and
-replies start with the `mx_loader_svc_msg_t` header; some contain
+replies start with the `zx_loader_svc_msg_t` header; some contain
 additional data; some contain a VMO handle.  Request opcodes are:
 
  * `LOADER_SVC_OP_LOAD_SCRIPT_INTERP`: *string* -> *VMO handle*
@@ -372,7 +372,7 @@
    VMO mapped in and continue to write data to it.  Code instrumentation
    runtimes use this to deliver large binary trace results.
 
-## Magenta's standard ELF dynamic linker
+## Zircon's standard ELF dynamic linker
 
 The ELF conventions described above and
 the [`processargs`](#the-processargs-protocol)
@@ -382,11 +382,11 @@
 implementation can use the the [vDSO](vdso.md) [system call](syscalls.md)
 ABI, the `processargs` data, and the loader service facilities as it sees
 fit.  The exact details of what handles and data they will receive via
-these protocols depend on the higher-layer program environment.  Magenta's
+these protocols depend on the higher-layer program environment.  Zircon's
 system processes use an ELF interpreter that implements basic ELF dynamic
 linking, and a simple implementation of the loader service.
 
-Magenta's standard C library and dynamic linker have
+Zircon's standard C library and dynamic linker have
 a [unified implementation](../third_party/ulib/musl/) originally derived
 from [`musl`](http://www.musl-libc.org/).  It's identified by the
 `PT_INTERP` string `ld.so.1`.  It uses the `DT_NEEDED` strings naming
diff --git a/docs/qemu.md b/docs/qemu.md
index 7af0cc6..fb6d67e 100644
--- a/docs/qemu.md
+++ b/docs/qemu.md
@@ -1,6 +1,6 @@
 # QEMU
 
-Magenta can [run under emulation](https://fuchsia.googlesource.com/docs/+/master/getting_started.md#Boot-from-QEMU) using QEMU. QEMU can either be installed via
+Zircon can [run under emulation](https://fuchsia.googlesource.com/docs/+/master/getting_started.md#Boot-from-QEMU) using QEMU. QEMU can either be installed via
 prebuilt binaries, or built locally. (Note that a full [Fuchsia checkout](https://fuchsia.googlesource.com/docs/+/master/getting_source.md#Creating-a-new-checkout) already
 includes prebuilts.)
 
@@ -14,7 +14,7 @@
 
 This will download QEMU to the buildtools/qemu directory. You can either add
 buildtools/qemu/bin to your PATH, or specify buildtools/qemu/bin using the
--q flag to the run-magenta scripts (see below).
+-q flag to the run-zircon scripts (see below).
 
 ## Build QEMU
 
@@ -43,16 +43,16 @@
 If you don't want to install in /usr/local (the default), which will require you
 to be root, add --prefix=/path/to/install (perhaps $HOME/qemu). Then you'll
 either need to add /path/to/install/bin to your PATH or use -q /path/to/install
-when invoking run-magenta-{arch}.
+when invoking run-zircon-{arch}.
 
-## Run Magenta under QEMU
+## Run Zircon under QEMU
 
 ```
 # for aarch64
-./scripts/run-magenta-arm64
+./scripts/run-zircon-arm64
 
 # for x86-64
-./scripts/run-magenta-x86-64
+./scripts/run-zircon-x86-64
 ```
 
 If QEMU is not on your path, use -q <directory> to specify its location.
@@ -64,7 +64,7 @@
 
 ## Enabling Networking under QEMU (x86-64 only)
 
-The run-magenta-x86-64 script, when given the -N argument will attempt to create
+The run-zircon-x86-64 script, when given the -N argument will attempt to create
 a network interface using the Linux tun/tap network device named "qemu".  QEMU
 does not need to be run with any special privileges for this, but you need to
 create a persistent tun/tap device ahead of time (which does require you be root):
@@ -85,13 +85,13 @@
 used set of kernel extensions called tuntaposx which can be downloaded
 [here](http://tuntaposx.sourceforge.net/download.xhtml). Once the installer
 completes, the extensions will create up to 16 tun/tap devices. The
-run-magenta-x86-64 script uses /dev/tap0.
+run-zircon-x86-64 script uses /dev/tap0.
 
 ```
 sudo chown $USER /dev/tap0
 
-# Run magenta in QEMU, which will open /dev/tap0
-./scripts/run-magenta-x86-64 -N
+# Run zircon in QEMU, which will open /dev/tap0
+./scripts/run-zircon-x86-64 -N
 
 # (In a different window) bring up tap0 with a link local IPv6 address
 sudo ifconfig tap0 inet6 fc00::/7 up
@@ -105,7 +105,7 @@
 scripts/qemu-ifup-macos, so QEMU can be started with:
 
 ```
-./scripts/run-magenta-x86-64 -Nu ./scripts/qemu-ifup-macos
+./scripts/run-zircon-x86-64 -Nu ./scripts/qemu-ifup-macos
 ```
 
 ## Using Emulated Disk under QEMU
@@ -113,9 +113,9 @@
 Please follow the minfs instructions on how to create a disk image
 [here][minfs-create-image].
 
-After creating the image, you can run magenta in QEMU with the disk image:
+After creating the image, you can run zircon in QEMU with the disk image:
 ```
-./scripts/run-magenta-x86-64 -d [-D <disk_image_path (default: "blk.bin")>]
+./scripts/run-zircon-x86-64 -d [-D <disk_image_path (default: "blk.bin")>]
 ```
 
 
@@ -128,7 +128,7 @@
 In the shell you're running QEMU in:
 
 ```
-shell1$ ./scripts/run-magenta-x86-64 -- -s -S
+shell1$ ./scripts/run-zircon-x86-64 -- -s -S
 [... some QEMU start up text ...]
 ```
 
@@ -138,7 +138,7 @@
 then start QEMU without "-S" in the above example:
 
 ```
-shell1$ ./scripts/run-magenta-x86-64 -- -s
+shell1$ ./scripts/run-zircon-x86-64 -- -s
 [... some QEMU start up text ...]
 ```
 
@@ -146,7 +146,7 @@
 [Commands here are fully spelled out, but remember most can be abbreviated.]
 
 ```
-shell2$ gdb build-magenta-pc-x86-64/magenta.elf
+shell2$ gdb build-zircon-pc-x86-64/zircon.elf
 (gdb) target extended-remote :1234
 Remote debugging using :1234
 0x000000000000fff0 in ?? ()
@@ -164,7 +164,7 @@
 (gdb) continue
 ```
 
-At this point Magenta boots and back in shell1 you'll be at the Magenta
+At this point Zircon boots and back in shell1 you'll be at the Zircon
 prompt.
 
 ```
@@ -189,23 +189,23 @@
 
 QEMU reports one thread to GDB for each CPU.
 
-### The magenta.elf-gdb.py script
+### The zircon.elf-gdb.py script
 
-The scripts/magenta.elf-gdb.py script is automagically loaded by gdb.
+The scripts/zircon.elf-gdb.py script is automagically loaded by gdb.
 It provides several things:
 
-- Pretty-printers for magenta objects (alas none at the moment).
+- Pretty-printers for zircon objects (alas none at the moment).
 
-- Several magenta specific commands, all with a "magenta" prefix. To see them:
+- Several zircon specific commands, all with a "zircon" prefix. To see them:
 ```
-(gdb) help info magenta
-(gdb) help set magenta
-(gdb) help show magenta
+(gdb) help info zircon
+(gdb) help set zircon
+(gdb) help show zircon
 ```
 
 - Enhanced unwinder support for automagic unwinding through kernel faults.
 
-Heads up: This script isn't always updated as magenta changes.
+Heads up: This script isn't always updated as zircon changes.
 
 ### Terminating the session
 
@@ -269,4 +269,4 @@
 at stuff from the QEMU console.
 
 
-[minfs-create-image]: https://fuchsia.googlesource.com/magenta/+/master/docs/minfs.md#Host-Device-QEMU-Only
+[minfs-create-image]: https://fuchsia.googlesource.com/zircon/+/master/docs/minfs.md#Host-Device-QEMU-Only
diff --git a/docs/rights.md b/docs/rights.md
index 5492c7c..591872c 100644
--- a/docs/rights.md
+++ b/docs/rights.md
@@ -5,21 +5,21 @@
 Rights are associated with handles and convey privileges to perform actions on
 either the associated handle or the object associated with the handle.
 
-The [`<magenta/rights.h>`](../system/public/magenta/rights.h) header defines
+The [`<zircon/rights.h>`](../system/public/zircon/rights.h) header defines
 default rights for each object type, which can be reduced via
-`mx_handle_replace()` or `mx_handle_duplicate()`.
+`zx_handle_replace()` or `zx_handle_duplicate()`.
 
 | Right | Conferred Privileges |
 | ----- | -------------------- |
-| **MX_RIGHT_DUPLICATE** | Allows handle duplication via [*mx_handle_duplicate*](syscalls/handle_duplicate.md) |
-| **MX_RIGHT_TRANSFER** | Allows handle transfer via [*mx_channel_write*](syscalls/channel_write.md) |
-| **MX_RIGHT_READ** | Allows inspection of object state |
+| **ZX_RIGHT_DUPLICATE** | Allows handle duplication via [*zx_handle_duplicate*](syscalls/handle_duplicate.md) |
+| **ZX_RIGHT_TRANSFER** | Allows handle transfer via [*zx_channel_write*](syscalls/channel_write.md) |
+| **ZX_RIGHT_READ** | Allows inspection of object state |
 |                   | Allows reading of data from containers (channels, sockets, VM objects, etc) |
-| **MX_RIGHT_WRITE** | Allows modification of object state |
+| **ZX_RIGHT_WRITE** | Allows modification of object state |
 |                    | Allows writing of data to containers (channels, sockets, VM objects, etc) |
-| **MX_RIGHT_EXECUTE** | |
-| **MX_RIGHT_DEBUG** | Placeholder for debugger use, pending audit of all rights usage |
+| **ZX_RIGHT_EXECUTE** | |
+| **ZX_RIGHT_DEBUG** | Placeholder for debugger use, pending audit of all rights usage |
 
 ## See also
 [Objects](objects.md),
-[Magenta Handles](handles.md)
+[Zircon Handles](handles.md)
diff --git a/docs/safestack.md b/docs/safestack.md
index b98848b..b6ba688 100644
--- a/docs/safestack.md
+++ b/docs/safestack.md
@@ -1,4 +1,4 @@
-# SafeStack in Magenta & Fuchsia
+# SafeStack in Zircon & Fuchsia
 
 ## Introduction
 
@@ -22,8 +22,8 @@
 basis of exploits and attacks using the so-called *ROP*
 ("return-oriented programming") technique.
 
-The **Compatibility** section of that page does not apply to Magenta (or
-Fuchsia).  In Magenta user-mode code (including all of Fuchsia), the
+The **Compatibility** section of that page does not apply to Zircon (or
+Fuchsia).  In Zircon user-mode code (including all of Fuchsia), the
 runtime support for SafeStack is included directly in the standard C
 runtime library, and everything works fine in shared libraries (DSOs).
 
@@ -42,21 +42,21 @@
 correct when calling, or being called by, code that does use
 safe-stack.  The only potential exceptions to this are for code that
 is implementing its own kinds of non-local exits or context-switching
-(e.g. coroutines).  The Magenta C library's `setjmp`/`longjmp` code
+(e.g. coroutines).  The Zircon C library's `setjmp`/`longjmp` code
 saves and restores this additional state automatically, so anything
 that is based on `longjmp` already handles everything correctly even
 if the code calling `setjmp` and `longjmp` doesn't know about
 safe-stack.
 
-## Use in Magenta & Fuchsia
+## Use in Zircon & Fuchsia
 
 This is enabled in the Clang compiler by the `-fsanitize=safe-stack`
 command-line option.  In the near future, this will be the default mode
 of the compiler for `*-fuchsia` targets, and to disable it for a
 specific compilation will require the `-fno-sanitize=safe-stack` option.
 
-Magenta supports safe-stack for both user-mode and kernel code.
-In the Magenta build, safe-stack is always enabled when building
+Zircon supports safe-stack for both user-mode and kernel code.
+In the Zircon build, safe-stack is always enabled when building
 with Clang (pass `USE_CLANG=true` to `make`).
 
 ## Implementation details
@@ -71,15 +71,15 @@
 does not change the basic machine-specific calling conventions that
 assign uses to all the machine registers.
 
-The C and C++ ABI for Magenta and Fuchsia stores the unsafe stack
+The C and C++ ABI for Zircon and Fuchsia stores the unsafe stack
 pointer in memory that's at a fixed offset from the thread pointer.
-The [`<magenta/tls.h>`](../system/public/magenta/tls.h) header defines
+The [`<zircon/tls.h>`](../system/public/zircon/tls.h) header defines
 the offset for each machine.
 
 For x86 user-mode, the thread pointer is the `fsbase`, meaning access
-in assembly code looks like `%fs:MX_TLS_UNSAFE_SP_OFFSET`.
+in assembly code looks like `%fs:ZX_TLS_UNSAFE_SP_OFFSET`.
 For the x86 kernel, the thread pointer is the `gsbase`, meaning access
-in assembly code looks like `%gs:MX_TLS_UNSAFE_SP_OFFSET`.
+in assembly code looks like `%gs:ZX_TLS_UNSAFE_SP_OFFSET`.
 
 For Aarch64 (ARM64), in C or C++ code, `__builtin_thread_pointer()`
 returns the thread pointer.  In user-mode, the thread pointer is in the
@@ -102,7 +102,7 @@
 The context-switch code in the kernel handles switching the unsafe stack
 pointer.  On x86, this is explicit in the code: `%gs` points to the
 `struct x86_percpu`, which has a member `kernel_unsafe_sp` at
-`MX_TLS_UNSAFE_SP_OFFSET`; `arch_context_switch` copies this into the
+`ZX_TLS_UNSAFE_SP_OFFSET`; `arch_context_switch` copies this into the
 `unsafe_sp` field of the old thread's `struct arch_thread` and then
 copies the new thread's `unsafe_sp` into `kernel_unsafe_sp`.  On ARM64,
 this is implicitly done by `set_current_thread`, because that changes
diff --git a/docs/self_hosting.md b/docs/self_hosting.md
index 70c0dc6..262fece 100644
--- a/docs/self_hosting.md
+++ b/docs/self_hosting.md
@@ -54,21 +54,21 @@
 sed
 ```
 
-## Build Magenta
-Follow standard Magenta/Fuchsia source configuration instructions. Note that
-you will want a minimum of `magenta` and `sbase`.
+## Build Zircon
+Follow standard Zircon/Fuchsia source configuration instructions. Note that
+you will want a minimum of `zircon` and `sbase`.
 
 In order for gcc-built executables to run in Fuchsia, we will need the gcc
 runtime libraries, built for Fuchsia. They were built as part of the Fuchsia
 native build, but we need them to be installed into one of the standard runtime
 library locations on the target. One way to do this is to add the libraries to
-the manifest lines in `magenta/kernel/engine.mk`:
+the manifest lines in `zircon/kernel/engine.mk`:
 ```code
 USER_MANIFEST_LINES += lib/libgcc_s.so.1=<path-to-gcc>/x86_64-fuchsia-6.3.0-native/lib/libgcc_s.so.1
 USER_MANIFEST_LINES += lib/libgcc_s.so=<path-to-gcc>/x86_64-fuchsia-6.3.0-native/lib/libgcc_s.so
 USER_MANIFEST_LINES += lib/libstdc++.so=<path-to-gcc>/x86_64-fuchsia-6.3.0-native/lib/libstdc++.so
 ```
-Follow the standard Magenta/Fuchsia build instructions, and run the resulting
+Follow the standard Zircon/Fuchsia build instructions, and run the resulting
 image on the desired target.
 
 ## Copy Files Onto Target
@@ -76,10 +76,10 @@
 use /data). For your own sanity, this should be persistent storage of some
 sort. For this example, we'll use the following /data subdirectories:
 ```text
-bin             Directory for miscellaneous tools not provided in Fuchsia or Magenta
+bin             Directory for miscellaneous tools not provided in Fuchsia or Zircon
 gcc             Native gcc installation
 gcc-bare-metal  Fuchsia-hosted bare-metal tools
-magenta         The Magenta source files
+zircon         The Zircon source files
 sysroot         The sysroot of the installed Fuchsia
 ```
 * Netcp all native gcc files into `/data/gcc`
@@ -104,26 +104,26 @@
 ```bash
 netcp <make-build-dir>/make :/data/bin
 ```
-* Copy the magenta source code onto the target, either using netcp or a mounted
+* Copy the zircon source code onto the target, either using netcp or a mounted
 image, or git. Note that if you are using the same source tree as was used to
 build the target image, you'll want to remove any modifications to
 kernel/engine.mk that were made for previous steps (or update them to reflect
 the target location of these files), otherwise the build will fail when trying
 to generate the bootfs image.
 ```bash
-cd <path-to-magenta>
+cd <path-to-zircon>
 for filename in `find . -name .git -prune \
                         -o -path "./build-*" -prune \
                         -o -path "./prebuilt*" \
                         -o -type f -print`
 do
   echo "Copying $filename" 
-  netcp $filename :/data/magenta/$filename
+  netcp $filename :/data/zircon/$filename
 done
 ```
-* Copy the Magenta sysroot onto the target device in `/data/sysroot`
+* Copy the Zircon sysroot onto the target device in `/data/sysroot`
 ```bash
-cd <magenta-sysroot>
+cd <zircon-sysroot>
 for filename in `find . -type f`
 do
   echo "Copying $filename"
@@ -140,14 +140,14 @@
 done
 ```
 
-## Build Magenta
+## Build Zircon
 On the Fuchsia target, add `/data/bin`, `/data/gcc/bin`, and `data/gcc-bare-metal/bin` to your `PATH`
 ```bash
 export PATH="$PATH:/data/bin:/data/gcc/bin:/data/gcc-bare-metal/bin"
 ```
-* Finally, start the build in the magenta directory:
+* Finally, start the build in the zircon directory:
 ```bash
-cd magenta
+cd zircon
 make \
     HOST_SYSROOT=/data/sysroot \
     ARCH_x86_64_TOOLCHAIN_PREFIX="x86_64-elf-" \
diff --git a/docs/signals.md b/docs/signals.md
index 065491a..0d430e5 100644
--- a/docs/signals.md
+++ b/docs/signals.md
@@ -1,21 +1,21 @@
-# Magenta Signals
+# Zircon Signals
 
 ## Introduction
 
-A signal is a single bit of information that waitable magenta kernel objects expose to
+A signal is a single bit of information that waitable zircon kernel objects expose to
 applications.  Each object can expose one or more signals; some are generic and some
 are specific to the type of object.
 
-For example, the signal *MX_CHANNEL_READABLE* indicates "this channel endpoint has
-messages to read", and **MX_PROCESS_TERMINATED** indicates "this process stopped running."
+For example, the signal *ZX_CHANNEL_READABLE* indicates "this channel endpoint has
+messages to read", and **ZX_PROCESS_TERMINATED** indicates "this process stopped running."
 
 The signals for an object are stored in a uint32 bitmask, and their values (which are object-specific) are defined in the header
-[`magenta/types.h`](../system/public/magenta/types.h).  The typedef `mx_signals_t`
+[`zircon/types.h`](../system/public/zircon/types.h).  The typedef `zx_signals_t`
 is used to refer to signal bitmasks in syscalls and other APIs.
 
 Most objects are waitable.  Ports are an example of a non-waitable object.
 To determine if an object is waitable, call [object_get_info](syscalls/object_get_info.md)
-with **MX_INFO_HANDLE_BASIC** topic and test for **MX_OBJ_PROP_WAITABLE**.
+with **ZX_INFO_HANDLE_BASIC** topic and test for **ZX_OBJ_PROP_WAITABLE**.
 
 ## State, State Changes and their Terminology
 
@@ -25,19 +25,19 @@
 (even if it was already **Active**), and is said to be **Deasserted** when it is made
 **Inactive* in response to an event (even if it was already **Inactive**).
 
-For example:  When a message is written into a Channel endpoint, the *MX_CHANNEL_READABLE*
+For example:  When a message is written into a Channel endpoint, the *ZX_CHANNEL_READABLE*
 signal of the opposing endpoint is **asserted** (which causes that signal to become **active**,
 if it were not already active).  When the last message in a Channel endpoint's
-queue is read from that endpoint, the *MX_CHANNEL_READABLE* signal of that endpoint is
+queue is read from that endpoint, the *ZX_CHANNEL_READABLE* signal of that endpoint is
 **deasserted** (which causes that signal to become **inactive**)
 
 ## Observing Signals
 
-The syscalls **mx_object_wait_one**(), **mx_object_wait_many**(), and **mx_object_wait_async**() (in combination with a Port), can be used to wait for specified signals on one or more objects.
+The syscalls **zx_object_wait_one**(), **zx_object_wait_many**(), and **zx_object_wait_async**() (in combination with a Port), can be used to wait for specified signals on one or more objects.
 
 ## Common Signals
 
-### MX_SIGNAL_LAST_HANDLE
+### ZX_SIGNAL_LAST_HANDLE
 
 This signal is asserted when there is only a single handle referencing the object.  Thus it
 is always active on newly created objects.
@@ -48,20 +48,20 @@
 resources associated with an object whose handle was duplicated and shared with another
 process.
 
-### MX_SIGNAL_HANDLE_CLOSED
+### ZX_SIGNAL_HANDLE_CLOSED
 
 This synthetic signal only exists in the results of [object_wait_one](syscalls/object_wait_one.md)
 or [object_wait_many](syscalls/object_wait_many.md) and indicates that a handle that was
 being waited upon has been been closed causing the wait operation to be aborted.
 
 This signal can only be obtained as a result of the above two wait calls when the wait itself
-returns with **MX_ERR_CANCELED**.
+returns with **ZX_ERR_CANCELED**.
 
 ## User Signals
 
-There are eight User Signals (**MX_USER_SIGNAL_0** through **MX_USER_SIGNAL_7**) which may
-asserted or deasserted using the **mx_object_signal**() and **mx_object_signal_peer**() syscalls,
-provided the handle has the appropriate rights (**MX_RIGHT_SIGNAL** or **MX_RIGHT_SIGNAL_PEER**,
+There are eight User Signals (**ZX_USER_SIGNAL_0** through **ZX_USER_SIGNAL_7**) which may
+asserted or deasserted using the **zx_object_signal**() and **zx_object_signal_peer**() syscalls,
+provided the handle has the appropriate rights (**ZX_RIGHT_SIGNAL** or **ZX_RIGHT_SIGNAL_PEER**,
 respectively).  These User Signals are always initially inactive, and are only modified by
 the object signal syscalls.
 
diff --git a/docs/static_analysis.md b/docs/static_analysis.md
index bb95ead..c4c1a28 100644
--- a/docs/static_analysis.md
+++ b/docs/static_analysis.md
@@ -1,66 +1,66 @@
-# Static Analysis in Magenta
+# Static Analysis in Zircon
 
 This document describes:
 
-* How to perform static analysis with the Clang Static Analyzer in Magenta;
-* How to enable MagentaHandleChecker;
+* How to perform static analysis with the Clang Static Analyzer in Zircon;
+* How to enable ZirconHandleChecker;
 * How to add/modify annotate attributes to syscalls/functions and use annotate attributes to suppress false positives.
 
 ## Steps to run Clang Static Analyzer
 
-Assuming you already obtained a local copy of Fuchsia workspace according to the instructions written in [get_source.md](https://fuchsia.googlesource.com/docs/+/master/getting_source.md) and the source tree of fuchsia is located at `$LOCAL_DIR/fuchsia` and current working directory is `$LOCAL_DIR/fuchsia/magenta`. The Clang Static Analayzer can be run on Magenta by following commands:
+Assuming you already obtained a local copy of Fuchsia workspace according to the instructions written in [get_source.md](https://fuchsia.googlesource.com/docs/+/master/getting_source.md) and the source tree of fuchsia is located at `$LOCAL_DIR/fuchsia` and current working directory is `$LOCAL_DIR/fuchsia/zircon`. The Clang Static Analayzer can be run on Zircon by following commands:
 
 ```sh
 ./scripts/download-toolchain
-./scripts/analyze-magenta
+./scripts/analyze-zircon
 ```
 
-The Clang Static Analyzer will be run on Magenta code base with default checkers. After the finish of the analysis, you can see an outout in stdout similar to the one below:
+The Clang Static Analyzer will be run on Zircon code base with default checkers. After the finish of the analysis, you can see an outout in stdout similar to the one below:
 
 ```
-scan-build: Run 'scan-view $LOCAL_DIR/fuchsia/magenta/AnalysisResult/scan-build-2017-08-08-11-26-25-914570-SKSE39' to examine bug reports.
+scan-build: Run 'scan-view $LOCAL_DIR/fuchsia/zircon/AnalysisResult/scan-build-2017-08-08-11-26-25-914570-SKSE39' to examine bug reports.
 ```
 
 Just type the command start with `scan-view` in a terminal and it will open your web browser and show the analysis reports.
 
-## Steps to enable MagentaHandleChecker
+## Steps to enable ZirconHandleChecker
 
-At the time this document is written, all Magenta related checkers are still under review by upstream LLVM community:
+At the time this document is written, all Zircon related checkers are still under review by upstream LLVM community:
 
  * MutexInInterruptContext [D27854](https://reviews.llvm.org/D27854)
  * SpinLockChecker [D26340](https://reviews.llvm.org/D26340)
  * MutexChecker [D26342](https://reviews.llvm.org/D26342)
- * MagentaHandleChecker [D35968](https://reviews.llvm.org/D35968) [D36022](https://reviews.llvm.org/D36022) [D36023](https://reviews.llvm.org/D36023) [D36024](https://reviews.llvm.org/D36024) [D36251](https://reviews.llvm.org/D36251) [D36475](https://reviews.llvm.org/D36475))
+ * ZirconHandleChecker [D35968](https://reviews.llvm.org/D35968) [D36022](https://reviews.llvm.org/D36022) [D36023](https://reviews.llvm.org/D36023) [D36024](https://reviews.llvm.org/D36024) [D36251](https://reviews.llvm.org/D36251) [D36475](https://reviews.llvm.org/D36475))
 
-They are enabled by default when you executed the 'analyze-magenta' script. We will update the 'analyze-magenta' script to enable them by default once they get landed.
+They are enabled by default when you executed the 'analyze-zircon' script. We will update the 'analyze-zircon' script to enable them by default once they get landed.
 
-In the mean time, if you would like to try MagentaHandleChecker now, you can download the source code of LLVM with Clang and apply the patch from the diffs above and follow the instructions in [toolchain.md](https://fuchsia.googlesource.com/docs/+/master/toolchain.md) to build your own toolchain. Assuming you have built your own toolchain and it is located at `$LOCAL_TOOLCHAIN_PREFIX` and `$LOCAL_TOOLCHAIN_PREFIX/bin/clang` is the path to the `clang` command. The Clang Static Analyzer can be run with MagentaHandleChecker and other default checkers enabled by following command:
+In the mean time, if you would like to try ZirconHandleChecker now, you can download the source code of LLVM with Clang and apply the patch from the diffs above and follow the instructions in [toolchain.md](https://fuchsia.googlesource.com/docs/+/master/toolchain.md) to build your own toolchain. Assuming you have built your own toolchain and it is located at `$LOCAL_TOOLCHAIN_PREFIX` and `$LOCAL_TOOLCHAIN_PREFIX/bin/clang` is the path to the `clang` command. The Clang Static Analyzer can be run with ZirconHandleChecker and other default checkers enabled by following command:
 
 ```
-./scripts/analyze-magenta -p $LOCAL_TOOLCHAIN_PREFIX -m all
+./scripts/analyze-zircon -p $LOCAL_TOOLCHAIN_PREFIX -m all
 ```
 
-If you want to enable MagentaHandleChecker and disable other default checkers, please run following command:
+If you want to enable ZirconHandleChecker and disable other default checkers, please run following command:
 
 ```
-./scripts/analyze-magenta -p $LOCAL_TOOLCHAIN_PREFIX -m magenta
+./scripts/analyze-zircon -p $LOCAL_TOOLCHAIN_PREFIX -m zircon
 ```
 
-The 'analyze-magenta' scripts have additional options such as changing the output directories and changing build targets, please refer the to help information printed by `./scripts/analyze-magenta -h`.
+The 'analyze-zircon' scripts have additional options such as changing the output directories and changing build targets, please refer the to help information printed by `./scripts/analyze-zircon -h`.
 
 ## Steps to add/modify annotate attributes to syscalls/functions
 
-In Magenta code base, raw annotations like `__attribute__((annotate("string")))` should never be used in Magenta code base, all magenta related annotations should be wrapped by macros. In this section, we will discuss how to add or modify annotations in Magenta code base.
+In Zircon code base, raw annotations like `__attribute__((annotate("string")))` should never be used in Zircon code base, all zircon related annotations should be wrapped by macros. In this section, we will discuss how to add or modify annotations in Zircon code base.
 
 ### Annotations in syscall declaration
 
-As header files of Magenta syscalls are generated from syscalls.sysgen, in order to add/modify annotations of syscalls, the syscalls.sysgen should be modified directly.
-Let’s use `mx_channel_create syscall` as example. This syscall will allocate two handles when it is successfully executed. Without annotations, its declaration in sysgen will be like:
+As header files of Zircon syscalls are generated from syscalls.sysgen, in order to add/modify annotations of syscalls, the syscalls.sysgen should be modified directly.
+Let’s use `zx_channel_create syscall` as example. This syscall will allocate two handles when it is successfully executed. Without annotations, its declaration in sysgen will be like:
 
 ```c
 syscall channel_create
     (options: uint32_t)
-    returns (mx_status_t, out0: mx_handle_t, out1: mx_handle_t);
+    returns (zx_status_t, out0: zx_handle_t, out1: zx_handle_t);
 ```
 
 As argument `out0` and `out1` will be allocated handles, we should add `handle_acquire` annotation to these arguments:
@@ -68,77 +68,77 @@
 ```c
 syscall channel_create
     (options: uint32_t)
-    returns (mx_status_t, out0: mx_handle_t handle_acquire,
-             out1: mx_handle_t handle_acquire);
+    returns (zx_status_t, out0: zx_handle_t handle_acquire,
+             out1: zx_handle_t handle_acquire);
 ```
 
 This syscall declaration will be processed by sysgen and converted to:
 
 ```c
-extern mx_status_t mx_channel_create(
+extern zx_status_t zx_channel_create(
 uint32_t options,
-    MX_SYSCALL_PARAM_ATTR(handle_acquire) mx_handle_t* out0,
-    MX_SYSCALL_PARAM_ATTR(handle_acquire) mx_handle_t* out1));
+    ZX_SYSCALL_PARAM_ATTR(handle_acquire) zx_handle_t* out0,
+    ZX_SYSCALL_PARAM_ATTR(handle_acquire) zx_handle_t* out1));
 ```
 
-The declaration of macro can be found in system/public/magenta/syscalls.h, which is:
+The declaration of macro can be found in system/public/zircon/syscalls.h, which is:
 
 ```c
 #if defined(__clang__)
-#define MX_SYSCALL_PARAM_ATTR(x)   __attribute__((annotate("mx_" #x)))
+#define ZX_SYSCALL_PARAM_ATTR(x)   __attribute__((annotate("zx_" #x)))
 #else
-#define MX_SYSCALL_PARAM_ATTR(x)   // no-op
+#define ZX_SYSCALL_PARAM_ATTR(x)   // no-op
 #endif
 ```
 
-According to the definition of `MX_SYSCALL_PARAM_ATTR`, the `mx_channel_create` will be parsed into:
+According to the definition of `ZX_SYSCALL_PARAM_ATTR`, the `zx_channel_create` will be parsed into:
 
 ```c
-extern mx_status_t mx_channel_create(uint32_t options,
-__attribute__((annotate("mx_handle_acquire"))) mx_handle_t* out0,
-__attribute__((annotate("mx_handle_acquire"))) mx_handle_t* out1) __attribute__((__leaf__));;
+extern zx_status_t zx_channel_create(uint32_t options,
+__attribute__((annotate("zx_handle_acquire"))) zx_handle_t* out0,
+__attribute__((annotate("zx_handle_acquire"))) zx_handle_t* out1) __attribute__((__leaf__));;
 ```
 
 The reason that we use macros to wrap these annotations is that annotate attribute is not supported by compilers other than Clang, e.g. GCC. Furthermore, it would be convenient if we decide to use annotation solutions other than the annotate attributes in the future. Otherwise we need to change each annotation one by one.
 
 ### Annotations in other functions
 
-For functions other than syscalls, if `system/public/magenta/syscalls.h` is in current include path, you can use `MX_SYSCALL_PARAM_ATTR` macro to wrap your annotations. If not, you should use macros similar to this one. The reason that functions other than syscalls may require annotations is that some functions contain known false positives and we can use annotation to suppress the warnings of these false positives. For example, in MagentaHandleChecker’s test file we have:
+For functions other than syscalls, if `system/public/zircon/syscalls.h` is in current include path, you can use `ZX_SYSCALL_PARAM_ATTR` macro to wrap your annotations. If not, you should use macros similar to this one. The reason that functions other than syscalls may require annotations is that some functions contain known false positives and we can use annotation to suppress the warnings of these false positives. For example, in ZirconHandleChecker’s test file we have:
 
 ```c
 #if defined(__clang__)
-#define MX_ANALYZER_SUPPRESS   __attribute__((annotate("mx_suppress_warning)))
+#define ZX_ANALYZER_SUPPRESS   __attribute__((annotate("zx_suppress_warning)))
 #else
-#define MX_ANALYZER_SUPPRESS   // no-op
+#define ZX_ANALYZER_SUPPRESS   // no-op
 #endif
-void checkSuppressWarning() MX_ANALYZER_SUPPRESS {
-  mx_handle_t sa, sb;
-  if (mx_channel_create(0, &sa, &sb) < 0) {
+void checkSuppressWarning() ZX_ANALYZER_SUPPRESS {
+  zx_handle_t sa, sb;
+  if (zx_channel_create(0, &sa, &sb) < 0) {
     return;
   }
-  mx_handle_close(sa); // Should not report any bugs here
+  zx_handle_close(sa); // Should not report any bugs here
 }
 ```
 
 The analyzer will suppress the warnings on the bug it discovered in `checkSuppressWarning` function. If you don’t want to define your own macro for this purpose, and the `syscalls.h` is in the include path, you can use `_SYSCALL_PARAM_ATTR(suppress_warning)` instead, it will suppress the warnings of all bugs discovered in the functions with this annotation.
 
-Similar to `mx_suppress_warning` annotation, we have `mx_create_sink` annotation which currently used to suppress warnings on assertion failures. This annotation is unlikely to be used for other purpose, however, if you would like to know how it works, please refer to the discussions in CL[46428](https://fuchsia-review.googlesource.com/c/46428).
+Similar to `zx_suppress_warning` annotation, we have `zx_create_sink` annotation which currently used to suppress warnings on assertion failures. This annotation is unlikely to be used for other purpose, however, if you would like to know how it works, please refer to the discussions in CL[46428](https://fuchsia-review.googlesource.com/c/46428).
 
-To manually annotate non-syscall functions, the "MX_SYSCALL_PARAM_ATTR" macro can be applied to function arguments, emulating the effect of the sysgen attributes. For example, here, we annotate a regular function which might be used to call the "mx_create_channel" function without passing the "options" argument:
+To manually annotate non-syscall functions, the "ZX_SYSCALL_PARAM_ATTR" macro can be applied to function arguments, emulating the effect of the sysgen attributes. For example, here, we annotate a regular function which might be used to call the "zx_create_channel" function without passing the "options" argument:
 
 ```c
-mx_status_t create_channel(
-  MX_SYSCALL_PARAM_ATTR(handle_acquire) mx_handle_t* out0,
-  MX_SYSCALL_PARAM_ATTR(handle_acquire) mx_handle_t* out1);
+zx_status_t create_channel(
+  ZX_SYSCALL_PARAM_ATTR(handle_acquire) zx_handle_t* out0,
+  ZX_SYSCALL_PARAM_ATTR(handle_acquire) zx_handle_t* out1);
 ```
 Another example, we have another function `takeover_handle` that will take care the lifecycle of a handle if it is successfully executed and do nothing if it failed, we can declare this function in header file like this:
 
 ```c
-mx_status_t takeover_handle(
-  MX_SYSCALL_PARAM_ATTR(handle_escape) mx_handle_t in)
-  MX_SYSCALL_PARAM_ATTR(may_fail);
+zx_status_t takeover_handle(
+  ZX_SYSCALL_PARAM_ATTR(handle_escape) zx_handle_t in)
+  ZX_SYSCALL_PARAM_ATTR(may_fail);
 ```
 
-The `mx_may_fail` annotation here will cause state bifurcation when MagentaHandleChecker is evaluating calls to this function. So both succeeded and failed states will be covered.
+The `zx_may_fail` annotation here will cause state bifurcation when ZirconHandleChecker is evaluating calls to this function. So both succeeded and failed states will be covered.
 
-If the `MX_SYSCALL_PARAM_ATTR` is not available in the file that declares the function, you can define your own macros, as long as it will not expanded into annotate attribute if it is not compiled by Clang.
+If the `ZX_SYSCALL_PARAM_ATTR` is not available in the file that declares the function, you can define your own macros, as long as it will not expanded into annotate attribute if it is not compiled by Clang.
diff --git a/docs/symbolizer_markup.md b/docs/symbolizer_markup.md
index bb73108..27baeb6 100644
--- a/docs/symbolizer_markup.md
+++ b/docs/symbolizer_markup.md
@@ -29,8 +29,8 @@
 
 ## Scope and assumptions ##
 
-This specification defines a format standard for Magenta and Fuchsia.
-But there is nothing specific to Magenta or Fuchsia about the markup
+This specification defines a format standard for Zircon and Fuchsia.
+But there is nothing specific to Zircon or Fuchsia about the markup
 format.  A symbolizing filter implementation will be independent both of
 the _target_ operating system and machine architecture where the logs
 are generated and of the _host_ operating system and machine
@@ -53,7 +53,7 @@
 must be collated into separate per-process log streams and each stream
 processed by a separate instance of the symbolizing filter.  Because the
 kernel and user processes use disjoint address regions in most operating
-systems (including Magenta), a single user process address space plus
+systems (including Zircon), a single user process address space plus
 the kernel address space can be treated as a single address space for
 symbolization purposes if desired.
 
@@ -117,7 +117,7 @@
 | `32` | Green foreground   | |
 | `33` | Yellow foreground  | |
 | `34` | Blue foreground    | |
-| `35` | Magenta foreground | |
+| `35` | Zircon foreground | |
 | `36` | Cyan foreground    | |
 | `37` | White foreground   | |
 
@@ -297,10 +297,10 @@
   filter triggers other processing, it may need to feed some distilled
   form of the contextual information to those processes.
 
-  On Magenta and Fuchsia in particular, "publish" means to call the
-  `__sanitizer_publish_data` function from `<magenta/sanitizer.h>`
+  On Zircon and Fuchsia in particular, "publish" means to call the
+  `__sanitizer_publish_data` function from `<zircon/sanitizer.h>`
   with the "type" identifier as the "sink name" string.  The "dump
-  identifier" is the name attached to the Magenta VMO whose handle
+  identifier" is the name attached to the Zircon VMO whose handle
   was passed in the call to `__sanitizer_publish_data`.
   **TODO(mcgrathr): Link to docs about `__sanitizer_publish_data` and
   getting data dumps off the device.**
@@ -345,7 +345,7 @@
   for casual information.  The Build ID string is the sole way to
   identify the binary from which this module was loaded.  A "module" is
   a single linked binary, such as a loaded ELF file.  Usually each
-  module occupies a contiguous range of memory (always does on Magenta).
+  module occupies a contiguous range of memory (always does on Zircon).
 
   The `...` is a sequence of fields (separated by `:`) that each
   describe a range of memory, called a _segment_.  The field for each
diff --git a/docs/syscalls.md b/docs/syscalls.md
index cf0c7e2..dc4adca 100644
--- a/docs/syscalls.md
+++ b/docs/syscalls.md
@@ -1,4 +1,4 @@
-# Magenta System Calls
+# Zircon System Calls
 
 ## Handles
 + [handle_close](syscalls/handle_close.md) - close a handle
diff --git a/docs/syscalls/channel_call.md b/docs/syscalls/channel_call.md
index 686ccae..bb97ff4 100644
--- a/docs/syscalls/channel_call.md
+++ b/docs/syscalls/channel_call.md
@@ -1,4 +1,4 @@
-# mx_channel_call
+# zx_channel_call
 
 ## NAME
 
@@ -7,23 +7,23 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 typedef struct {
     void* wr_bytes;
-    mx_handle_t* wr_handles;
+    zx_handle_t* wr_handles;
     void *rd_bytes;
-    mx_handle_t* rd_handles;
+    zx_handle_t* rd_handles;
     uint32_t wr_num_bytes;
     uint32_t wr_num_handles;
     uint32_t rd_num_bytes;
     uint32_t rd_num_handles;
-} mx_channel_call_args_t;
+} zx_channel_call_args_t;
 
-mx_status_t mx_channel_call(mx_handle_t handle, uint32_t options,
-                            mx_time_t deadline, mx_channel_call_args_t* args,
+zx_status_t zx_channel_call(zx_handle_t handle, uint32_t options,
+                            zx_time_t deadline, zx_channel_call_args_t* args,
                             uint32_t* actual_bytes, uint32_t* actual_handles,
-                            mx_status_t* read_status);
+                            zx_status_t* read_status);
 ```
 
 ## DESCRIPTION
@@ -36,9 +36,9 @@
 
 The write and read phases of this operation behave like **channel_write**() and
 **channel_read**() with the difference that their parameters are provided via the
-*mx_channel_call_args_t* structure.
+*zx_channel_call_args_t* structure.
 
-The first four bytes (i.e., a leading **mx_txid_t**) of
+The first four bytes (i.e., a leading **zx_txid_t**) of
 *wr_bytes* are considered to be the transaction id (txid).  If there
 are fewer than four bytes, the txid is considered to be zero.
 
@@ -47,67 +47,67 @@
 
 While *deadline* has not passed, if an inbound message arrives with a matching txid,
 instead of being added to the tail of the general inbound message queue, it is delivered
-directly to the thread waiting in **mx_channel_call**().
+directly to the thread waiting in **zx_channel_call**().
 
 If such a reply arrives after *deadline* has passed, it will arrive in the general
-inbound message queue, cause **MX_CHANNEL_READABLE** to be signaled, etc.
+inbound message queue, cause **ZX_CHANNEL_READABLE** to be signaled, etc.
 
 Inbound messages that are too large to fit in *rd_num_bytes* and *rd_num_handles*
-are discarded and **MX_ERR_BUFFER_TOO_SMALL** is returned in that case.
+are discarded and **ZX_ERR_BUFFER_TOO_SMALL** is returned in that case.
 
 
 ## RETURN VALUE
 
-**channel_write**() returns **MX_OK** on success and the number of bytes and
+**channel_write**() returns **ZX_OK** on success and the number of bytes and
 count of handles in the reply message are returned via *actual_bytes* and
 *actual_handles*, respectively.
 
-The special return value **MX_ERR_CALL_FAILED** indicates that the message was
+The special return value **ZX_ERR_CALL_FAILED** indicates that the message was
 sent, but an error occurred while waiting for a response.  This is necessary
-to disambiguate errors like **MX_ERR_PEER_CLOSED** which could have occurred
+to disambiguate errors like **ZX_ERR_PEER_CLOSED** which could have occurred
 while attempting the write (in which case the caller would still own any handles
 passed via *handles*) or while waiting (in which case the caller would no longer
 own any of the handles).  The return parameter *read_status* is used to indicate
-the specific error that occurred during the wait or read phase when **MX_ERR_CALL_FAILED**
+the specific error that occurred during the wait or read phase when **ZX_ERR_CALL_FAILED**
 is returned.
 
-In the event of **MX_OK**, **MX_ERR_TIMED_OUT**, or **MX_ERR_CALL_FAILED**, the
+In the event of **ZX_OK**, **ZX_ERR_TIMED_OUT**, or **ZX_ERR_CALL_FAILED**, the
 handles in *handles* have been sent in a message to the other endpoint of the
 Channel and no longer exist in the calling process.  In the event of any other
 return values, the handles in *handles* remain in the calling process, unchanged.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle or any element in
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle or any element in
 *handles* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a channel handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a channel handle.
 
-**MX_ERR_INVALID_ARGS**  any of the provided pointers are invalid or null,
+**ZX_ERR_INVALID_ARGS**  any of the provided pointers are invalid or null,
 or there are duplicates among the handles in the *handles* array,
 or *options* is nonzero.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_WRITE** or
-any element in *handles* does not have **MX_RIGHT_TRANSFER**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_WRITE** or
+any element in *handles* does not have **ZX_RIGHT_TRANSFER**.
 
-**MX_ERR_PEER_CLOSED**  The other side of the channel was closed or became
+**ZX_ERR_PEER_CLOSED**  The other side of the channel was closed or became
 closed while waiting for the reply.
 
-**MX_ERR_CANCELED**  *handle* was closed while waiting for a reply.
+**ZX_ERR_CANCELED**  *handle* was closed while waiting for a reply.
 
-**MX_ERR_CALL_FAILED**  The write phase of the call succeeded, but an error occurred
+**ZX_ERR_CALL_FAILED**  The write phase of the call succeeded, but an error occurred
 while or after waiting for the response.  The specific error is returned via
 *read_status* if it is non-null.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
-**MX_ERR_OUT_OF_RANGE**  *wr_num_bytes* or *wr_num_handles* are larger than the
+**ZX_ERR_OUT_OF_RANGE**  *wr_num_bytes* or *wr_num_handles* are larger than the
 largest allowable size for channel messages.
 
-**MX_ERR_BUFFER_TOO_SMALL**  *rd_num_bytes* or *rd_num_handles* are too small
+**ZX_ERR_BUFFER_TOO_SMALL**  *rd_num_bytes* or *rd_num_handles* are too small
 to contain the reply message.
 
-**MX_ERR_NOT_SUPPORTED**  one of the handles in *handles* was *handle*
+**ZX_ERR_NOT_SUPPORTED**  one of the handles in *handles* was *handle*
 (the handle to the channel being written to).
 
 ## SEE ALSO
diff --git a/docs/syscalls/channel_create.md b/docs/syscalls/channel_create.md
index d339c62..163f20d 100644
--- a/docs/syscalls/channel_create.md
+++ b/docs/syscalls/channel_create.md
@@ -1,4 +1,4 @@
-# mx_channel_create
+# zx_channel_create
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_channel_create(uint32_t options,
-                              mx_handle_t* out0, mx_handle_t* out1);
+zx_status_t zx_channel_create(uint32_t options,
+                              zx_handle_t* out0, zx_handle_t* out1);
 
 ```
 
@@ -24,23 +24,23 @@
 of the channel.  Messages written to one handle may be read from
 the opposite.
 
-The handles will have *MX_RIGHT_TRANSFER* (allowing them to be sent
-to another process via channel write), *MX_RIGHT_WRITE* (allowing
-messages to be written to them), and *MX_RIGHT_READ* (allowing messages
+The handles will have *ZX_RIGHT_TRANSFER* (allowing them to be sent
+to another process via channel write), *ZX_RIGHT_WRITE* (allowing
+messages to be written to them), and *ZX_RIGHT_READ* (allowing messages
 to be read from them).
 
 
 ## RETURN VALUE
 
-**channel_create**() returns **MX_OK** on success. In the event
+**channel_create**() returns **ZX_OK** on success. In the event
 of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL or
+**ZX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL or
 *options* is any value other than 0.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/channel_read.md b/docs/syscalls/channel_read.md
index 1c778a7..c74b8b7 100644
--- a/docs/syscalls/channel_read.md
+++ b/docs/syscalls/channel_read.md
@@ -1,4 +1,4 @@
-# mx_channel_read
+# zx_channel_read
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_channel_read(mx_handle_t handle, uint32_t options,
-                            void* bytes, mx_handle_t* handles,
+zx_status_t zx_channel_read(zx_handle_t handle, uint32_t options,
+                            void* bytes, zx_handle_t* handles,
                             uint32_t num_bytes, uint32_t num_handles,
                             uint32_t* actual_bytes, uint32_t* actual_handles);
 ```
@@ -32,31 +32,31 @@
 
 ## RETURN VALUE
 
-**channel_read**() returns **MX_OK** on success, if *actual_bytes*
+**channel_read**() returns **ZX_OK** on success, if *actual_bytes*
 and *actual_handles* (if non-NULL), contain the exact number of bytes
 and count of handles read.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a channel handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a channel handle.
 
-**MX_ERR_INVALID_ARGS**  If any of *bytes*, *handles*, *actual_bytes*, or
+**ZX_ERR_INVALID_ARGS**  If any of *bytes*, *handles*, *actual_bytes*, or
 *actual_handles* are non-NULL and an invalid pointer.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_READ**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_READ**.
 
-**MX_ERR_SHOULD_WAIT**  The channel contained no messages to read.
+**ZX_ERR_SHOULD_WAIT**  The channel contained no messages to read.
 
-**MX_ERR_PEER_CLOSED**  The other side of the channel is closed.
+**ZX_ERR_PEER_CLOSED**  The other side of the channel is closed.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
-**MX_ERR_BUFFER_TOO_SMALL**  The provided *bytes* or *handles* buffers
+**ZX_ERR_BUFFER_TOO_SMALL**  The provided *bytes* or *handles* buffers
 are too small (in which case, the minimum sizes necessary to receive
 the message will be written to *actual_bytes* and *actual_handles*,
-provided they are non-NULL). If *options* has **MX_CHANNEL_READ_MAY_DISCARD**
+provided they are non-NULL). If *options* has **ZX_CHANNEL_READ_MAY_DISCARD**
 set, then the message is discarded.
 
 ## NOTES
diff --git a/docs/syscalls/channel_write.md b/docs/syscalls/channel_write.md
index e2ed812..a19f32f 100644
--- a/docs/syscalls/channel_write.md
+++ b/docs/syscalls/channel_write.md
@@ -1,4 +1,4 @@
-# mx_channel_write
+# zx_channel_write
 
 ## NAME
 
@@ -7,11 +7,11 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_channel_write(mx_handle_t handle, uint32_t options,
+zx_status_t zx_channel_write(zx_handle_t handle, uint32_t options,
                              void* bytes, uint32_t num_bytes,
-                             mx_handle_t* handles, uint32_t num_handles);
+                             zx_handle_t* handles, uint32_t num_handles);
 ```
 
 ## DESCRIPTION
@@ -31,39 +31,39 @@
 to) in the *handles* array (the handles being sent in the message).
 
 The maximum number of handles which may be sent in a message is
-*MX_CHANNEL_MAX_MSG_HANDLES*, which is 64.
+*ZX_CHANNEL_MAX_MSG_HANDLES*, which is 64.
 
 The maximum number of bytes which may be sent in a message is
-*MX_CHANNEL_MAX_MSG_BYTES*, which is 65536.
+*ZX_CHANNEL_MAX_MSG_BYTES*, which is 65536.
 
 
 ## RETURN VALUE
 
-**channel_write**() returns **MX_OK** on success.
+**channel_write**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle or any element in
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle or any element in
 *handles* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a channel handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a channel handle.
 
-**MX_ERR_INVALID_ARGS**  *bytes* is an invalid pointer, or *handles*
+**ZX_ERR_INVALID_ARGS**  *bytes* is an invalid pointer, or *handles*
 is an invalid pointer, or if there are duplicates among the handles
 in the *handles* array, or *options* is nonzero.
 
-**MX_ERR_NOT_SUPPORTED** *handle* was found in the *handles* array, or
+**ZX_ERR_NOT_SUPPORTED** *handle* was found in the *handles* array, or
 one of the handles in *handles* was *handle* (the handle to the
 channel being written to).
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_WRITE** or
-any element in *handles* does not have **MX_RIGHT_TRANSFER**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_WRITE** or
+any element in *handles* does not have **ZX_RIGHT_TRANSFER**.
 
-**MX_ERR_PEER_CLOSED**  The other side of the channel is closed.
+**ZX_ERR_PEER_CLOSED**  The other side of the channel is closed.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
-**MX_ERR_OUT_OF_RANGE**  *num_bytes* or *num_handles* are larger than the
+**ZX_ERR_OUT_OF_RANGE**  *num_bytes* or *num_handles* are larger than the
 largest allowable size for channel messages.
 
 ## NOTES
diff --git a/docs/syscalls/cprng_add_entropy.md b/docs/syscalls/cprng_add_entropy.md
index 518fcc1..2acf100 100644
--- a/docs/syscalls/cprng_add_entropy.md
+++ b/docs/syscalls/cprng_add_entropy.md
@@ -1,30 +1,30 @@
-# mx_cprng_add_entropy
+# zx_cprng_add_entropy
 
 ## NAME
 
-mx_cprng_add_entropy - Add entropy to the kernel CPRNG
+zx_cprng_add_entropy - Add entropy to the kernel CPRNG
 
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_cprng_add_entropy(const void* buffer, size_t len);
+zx_status_t zx_cprng_add_entropy(const void* buffer, size_t len);
 ```
 
 ## DESCRIPTION
 
-**mx_cprng_add_entropy**() mixes the given entropy into the kernel CPRNG.
-a privileged operation.  It will accept at most **MX_CPRNG_ADD_ENTROPY_MAX_LEN**
+**zx_cprng_add_entropy**() mixes the given entropy into the kernel CPRNG.
+a privileged operation.  It will accept at most **ZX_CPRNG_ADD_ENTROPY_MAX_LEN**
 bytes of entropy at a time.
 
 ## RETURN VALUE
 
-**mx_cprng_add_entropy**() returns **MX_OK** on success.
+**zx_cprng_add_entropy**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS** *len* is too large, or *buffer* is not a valid
+**ZX_ERR_INVALID_ARGS** *len* is too large, or *buffer* is not a valid
 userspace pointer.
 
 ## BUGS
diff --git a/docs/syscalls/cprng_draw.md b/docs/syscalls/cprng_draw.md
index 00bf90c..b3f6418 100644
--- a/docs/syscalls/cprng_draw.md
+++ b/docs/syscalls/cprng_draw.md
@@ -1,37 +1,37 @@
-# mx_cprng_draw
+# zx_cprng_draw
 
 ## NAME
 
-mx_cprng_draw - Draw from the kernel's CPRNG
+zx_cprng_draw - Draw from the kernel's CPRNG
 
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_cprng_draw(void* buffer, size_t len, size_t* actual);
+zx_status_t zx_cprng_draw(void* buffer, size_t len, size_t* actual);
 ```
 
 ## DESCRIPTION
 
-**mx_cprng_draw**() draws random bytes from the kernel CPRNG.  This data should be
+**zx_cprng_draw**() draws random bytes from the kernel CPRNG.  This data should be
 suitable for cryptographic applications.  It will return at most
-**MX_CPRNG_DRAW_MAX_LEN** bytes at a time.
+**ZX_CPRNG_DRAW_MAX_LEN** bytes at a time.
 
 ## RETURN VALUE
 
-**mx_cprng_draw**() returns MX_OK and the number of random bytes
+**zx_cprng_draw**() returns ZX_OK and the number of random bytes
 drawn into *buffer* (via *actual) on success.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS** *len* is too large, or *buffer* or *actual* is
+**ZX_ERR_INVALID_ARGS** *len* is too large, or *buffer* or *actual* is
 not a valid userspace pointer.
 
 ## NOTES
 
 There are no other error conditions.  If its arguments are valid,
-**mx_cprng_draw**() will succeed.
+**zx_cprng_draw**() will succeed.
 
 ## EXAMPLES
 
@@ -39,18 +39,18 @@
 // Draw |len| bytes of cryptographically secure random data into |buf|.
 // It is not recommended to call this with large lengths.  If you need many
 // bytes, you likely want a usermode CPRNG seeded by this function.
-mx_status_t draw(char* buf, size_t len) {
+zx_status_t draw(char* buf, size_t len) {
     // This loop is necessary to deal with short reads from the kernel.
     while (len > 0) {
         size_t actual;
-        mx_status_t status = mx_cprng_draw(buf, min(len, MX_CPRNG_DRAW_MAX_LEN), &actual);
-        if (status != MX_OK) {
+        zx_status_t status = zx_cprng_draw(buf, min(len, ZX_CPRNG_DRAW_MAX_LEN), &actual);
+        if (status != ZX_OK) {
             return status;
         }
         buf += actual;
         len -= actual;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 ```
 
diff --git a/docs/syscalls/deadline_after.md b/docs/syscalls/deadline_after.md
index b432bd3..a44efa8 100644
--- a/docs/syscalls/deadline_after.md
+++ b/docs/syscalls/deadline_after.md
@@ -1,4 +1,4 @@
-# mx_deadline_after
+# zx_deadline_after
 
 ## NAME
 
@@ -7,31 +7,31 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_time_t mx_deadline_after(mx_duration_t nanoseconds)
+zx_time_t zx_deadline_after(zx_duration_t nanoseconds)
 ```
 
 ## DESCRIPTION
 
-**mx_deadline_after**() is a utility for converting from now-relative durations
+**zx_deadline_after**() is a utility for converting from now-relative durations
 to absolute deadlines.
 
 ## RETURN VALUE
 
-**mx_deadline_after**() returns the absolute time (with respect to **CLOCK_MONOTONIC**)
+**zx_deadline_after**() returns the absolute time (with respect to **CLOCK_MONOTONIC**)
 that is *nanoseconds* nanoseconds from now.
 
 ## ERRORS
 
-**mx_deadline_after**() does not report any error conditions.
+**zx_deadline_after**() does not report any error conditions.
 
 ## EXAMPLES
 
 ```
 // Sleep 50 milliseconds
-mx_time_t deadline = mx_deadline_after(MX_MSEC(50));
-mx_nanosleep(deadline);
+zx_time_t deadline = zx_deadline_after(ZX_MSEC(50));
+zx_nanosleep(deadline);
 ```
 
 ## SEE ALSO
diff --git a/docs/syscalls/event_create.md b/docs/syscalls/event_create.md
index 536dfc8..d2521ed 100644
--- a/docs/syscalls/event_create.md
+++ b/docs/syscalls/event_create.md
@@ -1,4 +1,4 @@
-# mx_event_create
+# zx_event_create
 
 ## NAME
 
@@ -7,30 +7,30 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_event_create(uint32_t options, mx_handle_t* out);
+zx_status_t zx_event_create(uint32_t options, zx_handle_t* out);
 ```
 
 ## DESCRIPTION
 
 **event_create**() creates an event, which is an object that is signalable. That
-is, its *MX_USER_SIGNAL_n* (where *n* is 0 through 7) signals can be
+is, its *ZX_USER_SIGNAL_n* (where *n* is 0 through 7) signals can be
 manipulated using **object_signal**().
 
-The newly-created handle will have the *MX_RIGHT_TRANSFER*, *MX_RIGHT_DUPLICATE*,
-*MX_RIGHT_READ*, *MX_RIGHT_WRITE*, and *MX_RIGHT_SIGNAL* rights.
+The newly-created handle will have the *ZX_RIGHT_TRANSFER*, *ZX_RIGHT_DUPLICATE*,
+*ZX_RIGHT_READ*, *ZX_RIGHT_WRITE*, and *ZX_RIGHT_SIGNAL* rights.
 
 ## RETURN VALUE
 
-**event_create**() returns MX_OK and a valid event handle (via *out*) on success.
+**event_create**() returns ZX_OK and a valid event handle (via *out*) on success.
 On failure, an error value is returned.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *out* is an invalid pointer, or *options* is nonzero.
+**ZX_ERR_INVALID_ARGS**  *out* is an invalid pointer, or *options* is nonzero.
 
-**MX_ERR_NO_MEMORY**  Temporary failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  Temporary failure due to lack of memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/eventpair_create.md b/docs/syscalls/eventpair_create.md
index e86d9fa..99762e7 100644
--- a/docs/syscalls/eventpair_create.md
+++ b/docs/syscalls/eventpair_create.md
@@ -1,4 +1,4 @@
-# mx_eventpair_create
+# zx_eventpair_create
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_eventpair_create(uint32_t options, mx_handle_t* out0, mx_handle_t* out1);
+zx_status_t zx_eventpair_create(uint32_t options, zx_handle_t* out0, zx_handle_t* out1);
 ```
 
 
@@ -18,34 +18,34 @@
 **eventpair_create**() creates an event pair, which is a pair of objects that
 are mutually signalable.
 
-The signals *MX_EPAIR_SIGNALED* and *MX_USER_SIGNAL_n* (where *n* is 0 through 7)
+The signals *ZX_EPAIR_SIGNALED* and *ZX_USER_SIGNAL_n* (where *n* is 0 through 7)
 may be set or cleared using **object_signal**() (modifying the signals on the
 object itself), or **object_signal_peer**() (modifying the signals on its
 counterpart).
 
-When all the handles to one of the objects have been closed, the *MX_EPAIR_PEER_CLOSED*
+When all the handles to one of the objects have been closed, the *ZX_EPAIR_PEER_CLOSED*
 signal will be asserted on the opposing object.
 
-The newly-created handles will have the *MX_RIGHT_TRANSFER*,
-*MX_RIGHT_DUPLICATE*, *MX_RIGHT_READ*, *MX_RIGHT_WRITE*, *MX_RIGHT_SIGNAL*,
-and *MX_RIGHT_SIGNAL_PEER* rights.
+The newly-created handles will have the *ZX_RIGHT_TRANSFER*,
+*ZX_RIGHT_DUPLICATE*, *ZX_RIGHT_READ*, *ZX_RIGHT_WRITE*, *ZX_RIGHT_SIGNAL*,
+and *ZX_RIGHT_SIGNAL_PEER* rights.
 
 Currently, no options are supported, so *options* must be set to 0.
 
 
 ## RETURN VALUE
 
-**eventpair_create**() returns **MX_OK** on success. On failure, a (negative)
+**eventpair_create**() returns **ZX_OK** on success. On failure, a (negative)
 error code is returned.
 
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL.
+**ZX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL.
 
-**MX_ERR_NOT_SUPPORTED**  *options* has an unsupported flag set (i.e., is not 0).
+**ZX_ERR_NOT_SUPPORTED**  *options* has an unsupported flag set (i.e., is not 0).
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 
 ## SEE ALSO
diff --git a/docs/syscalls/fifo_create.md b/docs/syscalls/fifo_create.md
index 43d6024..cd4f569 100644
--- a/docs/syscalls/fifo_create.md
+++ b/docs/syscalls/fifo_create.md
@@ -1,4 +1,4 @@
-# mx_fifo_create
+# zx_fifo_create
 
 ## NAME
 
@@ -7,11 +7,11 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_fifo_create(uint32_t elem_count, uint32_t elem_size,
+zx_status_t zx_fifo_create(uint32_t elem_count, uint32_t elem_size,
                            uint32_t options,
-                           mx_handle_t* out0, mx_handle_t* out1);
+                           zx_handle_t* out0, zx_handle_t* out1);
 
 ```
 
@@ -34,18 +34,18 @@
 
 ## RETURN VALUE
 
-**fifo_create**() returns **MX_OK** on success. In the event of
+**fifo_create**() returns **ZX_OK** on success. In the event of
 failure, one of the following values is returned.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL or
+**ZX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL or
 *options* is any value other than 0.
 
-**MX_ERR_OUT_OF_RANGE**  *elem_count* or *elem_size* is zero, or *elem_count*
+**ZX_ERR_OUT_OF_RANGE**  *elem_count* or *elem_size* is zero, or *elem_count*
 is not a power of two, or *elem_count* * *elem_size* is greater than 4096.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 
 ## SEE ALSO
diff --git a/docs/syscalls/fifo_read.md b/docs/syscalls/fifo_read.md
index b604d57..dc2a5a9 100644
--- a/docs/syscalls/fifo_read.md
+++ b/docs/syscalls/fifo_read.md
@@ -1,4 +1,4 @@
-# mx_fifo_read
+# zx_fifo_read
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_fifo_read(mx_handle_t handle,
+zx_status_t zx_fifo_read(zx_handle_t handle,
                          void* buffer, size_t size,
                          uint32_t* num_entries_read) {
 ```
@@ -28,25 +28,25 @@
 
 ## RETURN VALUE
 
-**fifo_read**() returns **MX_OK** on success, and returns
+**fifo_read**() returns **ZX_OK** on success, and returns
 the number of elements read (at least one) via *num_entries_read*.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a fifo handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a fifo handle.
 
-**MX_ERR_INVALID_ARGS**  *buffer* is an invalid pointer or *num_entries_read*
+**ZX_ERR_INVALID_ARGS**  *buffer* is an invalid pointer or *num_entries_read*
 is an invalid pointer.
 
-**MX_ERR_OUT_OF_RANGE**  *size* was smaller than the size of a single element.
+**ZX_ERR_OUT_OF_RANGE**  *size* was smaller than the size of a single element.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_READ**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_READ**.
 
-**MX_ERR_PEER_CLOSED**  The other side of the fifo is closed.
+**ZX_ERR_PEER_CLOSED**  The other side of the fifo is closed.
 
-**MX_ERR_SHOULD_WAIT**  The fifo is empty.
+**ZX_ERR_SHOULD_WAIT**  The fifo is empty.
 
 
 ## SEE ALSO
diff --git a/docs/syscalls/fifo_write.md b/docs/syscalls/fifo_write.md
index 06feab7..32ae203 100644
--- a/docs/syscalls/fifo_write.md
+++ b/docs/syscalls/fifo_write.md
@@ -1,4 +1,4 @@
-# mx_fifo_write
+# zx_fifo_write
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_fifo_write(mx_handle_t handle,
+zx_status_t zx_fifo_write(zx_handle_t handle,
                           const void* buffer, size_t size,
                           uint32_t* num_entries_written) {
 ```
@@ -27,25 +27,25 @@
 
 ## RETURN VALUE
 
-**fifo_write**() returns **MX_OK** on success, and returns
+**fifo_write**() returns **ZX_OK** on success, and returns
 the number of elements written (at least one) via *num_entries_written*.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a fifo handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a fifo handle.
 
-**MX_ERR_INVALID_ARGS**  *buffer* is an invalid pointer or *num_entries_written*
+**ZX_ERR_INVALID_ARGS**  *buffer* is an invalid pointer or *num_entries_written*
 is an invalid pointer.
 
-**MX_ERR_OUT_OF_RANGE**  *size* was smaller than the size of a single element.
+**ZX_ERR_OUT_OF_RANGE**  *size* was smaller than the size of a single element.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_WRITE**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_WRITE**.
 
-**MX_ERR_PEER_CLOSED**  The other side of the fifo is closed.
+**ZX_ERR_PEER_CLOSED**  The other side of the fifo is closed.
 
-**MX_ERR_SHOULD_WAIT**  The fifo is full.
+**ZX_ERR_SHOULD_WAIT**  The fifo is full.
 
 
 ## SEE ALSO
diff --git a/docs/syscalls/futex_requeue.md b/docs/syscalls/futex_requeue.md
index 1b1c134..0548e27 100644
--- a/docs/syscalls/futex_requeue.md
+++ b/docs/syscalls/futex_requeue.md
@@ -1,4 +1,4 @@
-# mx_futex_requeue
+# zx_futex_requeue
 
 ## NAME
 
@@ -8,10 +8,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_futex_requeue(mx_futex_t* value_ptr, uint32_t wake_count,
-                             int current_value, mx_futex_t* requeue_ptr,
+zx_status_t zx_futex_requeue(zx_futex_t* value_ptr, uint32_t wake_count,
+                             int current_value, zx_futex_t* requeue_ptr,
                              uint32_t requeue_count);
 ```
 
@@ -19,7 +19,7 @@
 
 Requeuing is a generalization of waking. First, the kernel verifies
 that the value in wake_count matches the value of the futex at
-`value_ptr`, and if not reports *MX_ERR_ALREADY_BOUND*. After waking `wake_count`
+`value_ptr`, and if not reports *ZX_ERR_ALREADY_BOUND*. After waking `wake_count`
 threads, `requeue_count` threads are moved from the original futex's
 wait queue to the wait queue corresponding to `requeue_ptr`, another
 futex.
@@ -28,16 +28,16 @@
 
 ## RETURN VALUE
 
-**futex_requeue**() returns **MX_OK** on success.
+**futex_requeue**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *value_ptr* isn't a valid userspace pointer, or
+**ZX_ERR_INVALID_ARGS**  *value_ptr* isn't a valid userspace pointer, or
 *value_ptr* is the same futex as *requeue_ptr*, or
 *value_ptr* or *requeue_ptr* is not aligned, or
 *requeue_ptr* is NULL but *requeue_count* is positive.
 
-**MX_ERR_BAD_STATE**  *current_value* does not match the value at *value_ptr*.
+**ZX_ERR_BAD_STATE**  *current_value* does not match the value at *value_ptr*.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/futex_wait.md b/docs/syscalls/futex_wait.md
index cb90089..c4f6c0d 100644
--- a/docs/syscalls/futex_wait.md
+++ b/docs/syscalls/futex_wait.md
@@ -1,4 +1,4 @@
-# mx_futex_wait
+# zx_futex_wait
 
 ## NAME
 
@@ -7,31 +7,31 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_futex_wait(mx_futex_t* value_ptr, int current_value,
-                          mx_time_t deadline);
+zx_status_t zx_futex_wait(zx_futex_t* value_ptr, int current_value,
+                          zx_time_t deadline);
 ```
 
 ## DESCRIPTION
 
 Waiting on a futex (or acquiring it) causes a thread to sleep until
-the futex is made available by a call to `mx_futex_wake`. Optionally,
+the futex is made available by a call to `zx_futex_wake`. Optionally,
 the thread can also be woken up after the *deadline* (with respect
-to **MX_CLOCK_MONOTONIC**) passes.
+to **ZX_CLOCK_MONOTONIC**) passes.
 
 ## RETURN VALUE
 
-**futex_wait**() returns **MX_OK** on success.
+**futex_wait**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *value_ptr* is not a valid userspace pointer, or
+**ZX_ERR_INVALID_ARGS**  *value_ptr* is not a valid userspace pointer, or
 *value_ptr* is not aligned.
 
-**MX_ERR_BAD_STATE**  *current_value* does not match the value at *value_ptr*.
+**ZX_ERR_BAD_STATE**  *current_value* does not match the value at *value_ptr*.
 
-**MX_ERR_TIMED_OUT**  The thread was not woken before *deadline* passed.
+**ZX_ERR_TIMED_OUT**  The thread was not woken before *deadline* passed.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/futex_wake.md b/docs/syscalls/futex_wake.md
index ad2489a..ece7d0e 100644
--- a/docs/syscalls/futex_wake.md
+++ b/docs/syscalls/futex_wake.md
@@ -1,4 +1,4 @@
-# mx_futex_wake
+# zx_futex_wake
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_futex_wake(const mx_futex_t* value_ptr, uint32_t wake_count);
+zx_status_t zx_futex_wake(const zx_futex_t* value_ptr, uint32_t wake_count);
 ```
 
 ## DESCRIPTION
@@ -22,11 +22,11 @@
 
 ## RETURN VALUE
 
-**futex_wake**() returns **MX_OK** on success.
+**futex_wake**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *value_ptr* is not aligned.
+**ZX_ERR_INVALID_ARGS**  *value_ptr* is not aligned.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/futex_wake_handle_close_thread_exit.md b/docs/syscalls/futex_wake_handle_close_thread_exit.md
index f68c52d..4101631 100644
--- a/docs/syscalls/futex_wake_handle_close_thread_exit.md
+++ b/docs/syscalls/futex_wake_handle_close_thread_exit.md
@@ -1,4 +1,4 @@
-# mx_futex_wake_handle_close_thread_exit
+# zx_futex_wake_handle_close_thread_exit
 
 ## NAME
 
@@ -7,25 +7,25 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-_Noreturn void mx_futex_wake_handle_close_thread_exit(
-    mx_futex_t* value_ptr, uint32_t wake_count,
-    int new_value, mx_handle_t close_handle);
+_Noreturn void zx_futex_wake_handle_close_thread_exit(
+    zx_futex_t* value_ptr, uint32_t wake_count,
+    int new_value, zx_handle_t close_handle);
 ```
 
 ## DESCRIPTION
 
 **futex_wake_handle_close_thread_exit**() does a sequence of four operations:
 1. `atomic_store_explicit(value_ptr, new_value, memory_order_release);`
-2. `mx_futex_wake(value_ptr, wake_count);`
-3. `mx_handle_close(close_handle);`
-4. `mx_thread_exit();`
+2. `zx_futex_wake(value_ptr, wake_count);`
+3. `zx_handle_close(close_handle);`
+4. `zx_thread_exit();`
 
 The expectation is that as soon as the first operation completes,
 other threads may unmap or reuse the memory containing the calling
 thread's own stack.  This is valid for this call, though it would be
-invalid for plain *mx_futex_wake*() or any other call.
+invalid for plain *zx_futex_wake*() or any other call.
 
 If any of the operations fail, then the thread takes a trap (as if by `__builtin_trap();`).
 
diff --git a/docs/syscalls/guest_create.md b/docs/syscalls/guest_create.md
index 0adcde7..ad3a81f 100644
--- a/docs/syscalls/guest_create.md
+++ b/docs/syscalls/guest_create.md
@@ -1,4 +1,4 @@
-# mx_guest_create
+# zx_guest_create
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_guest_create(mx_handle_t resource, uint32_t options,
-                            mx_handle_t physmem_vmo, mx_handle_t* out);
+zx_status_t zx_guest_create(zx_handle_t resource, uint32_t options,
+                            zx_handle_t physmem_vmo, zx_handle_t* out);
 ```
 
 ## DESCRIPTION
@@ -19,38 +19,38 @@
 within the hypervisor, with *physmem_vmo* used to represent the physical memory
 of the guest.
 
-To create a guest, a *resource* of *MX_RSRC_KIND_HYPERVISOR* must be supplied.
+To create a guest, a *resource* of *ZX_RSRC_KIND_HYPERVISOR* must be supplied.
 
 In order to begin execution within the guest, a VCPU must be created using
 **vcpu_create**(), and then run using **vcpu_resume**().
 
 The following rights will be set on the handle *out* by default:
 
-**MX_RIGHT_DUPLICATE** — *out* may be duplicated.
+**ZX_RIGHT_DUPLICATE** — *out* may be duplicated.
 
-**MX_RIGHT_TRANSFER** — *out* may be transferred over a channel.
+**ZX_RIGHT_TRANSFER** — *out* may be transferred over a channel.
 
-**MX_RIGHT_WRITE** - A trap to be may be set using **guest_set_trap**(), or a
+**ZX_RIGHT_WRITE** - A trap to be may be set using **guest_set_trap**(), or a
 VCPU to be created using **vcpu_create**().
 
 ## RETURN VALUE
 
-**guest_create**() returns MX_OK on success. On failure, an error value is
+**guest_create**() returns ZX_OK on success. On failure, an error value is
 returned.
 
 ## ERRORS
 
-**MX_ERR_ACCESS_DENIED** *resource* is not of *MX_RSRC_KIND_HYPERVISOR*, or
-*physmem_vmo* does not have the *MX_RIGHT_READ*, *MX_RIGHT_WRITE*, and
-*MX_RIGHT_EXECUTE* rights.
+**ZX_ERR_ACCESS_DENIED** *resource* is not of *ZX_RSRC_KIND_HYPERVISOR*, or
+*physmem_vmo* does not have the *ZX_RIGHT_READ*, *ZX_RIGHT_WRITE*, and
+*ZX_RIGHT_EXECUTE* rights.
 
-**MX_ERR_BAD_HANDLE** *physmem_vmo* is an invalid handle.
+**ZX_ERR_BAD_HANDLE** *physmem_vmo* is an invalid handle.
 
-**MX_ERR_INVALID_ARGS** *out* is an invalid pointer, or *options* is nonzero.
+**ZX_ERR_INVALID_ARGS** *out* is an invalid pointer, or *options* is nonzero.
 
-**MX_ERR_NO_MEMORY** Temporary failure due to lack of memory.
+**ZX_ERR_NO_MEMORY** Temporary failure due to lack of memory.
 
-**MX_ERR_WRONG_TYPE** *resource* is not a handle to a resource, or *physmem_vmo*
+**ZX_ERR_WRONG_TYPE** *resource* is not a handle to a resource, or *physmem_vmo*
 is not a handle to a VMO.
 
 ## SEE ALSO
diff --git a/docs/syscalls/guest_set_trap.md b/docs/syscalls/guest_set_trap.md
index b360979..c31050b 100644
--- a/docs/syscalls/guest_set_trap.md
+++ b/docs/syscalls/guest_set_trap.md
@@ -1,4 +1,4 @@
-# mx_guest_set_trap
+# zx_guest_set_trap
 
 ## NAME
 
@@ -7,11 +7,11 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 
-mx_status_t mx_guest_set_trap(mx_handle_t guest, uint32_t kind, mx_vaddr_t addr,
-                              size_t len, mx_handle_t port, uint64_t key);
+zx_status_t zx_guest_set_trap(zx_handle_t guest, uint32_t kind, zx_vaddr_t addr,
+                              size_t len, zx_handle_t port, uint64_t key);
 ```
 
 ## DESCRIPTION
@@ -21,7 +21,7 @@
 *len*, within the address space defined by *kind*.
 
 If *port* is specified, a packet with a *key* for the trap will be delivered
-through the port each time it is triggered, otherwise if *MX_HANDLE_INVALID* is
+through the port each time it is triggered, otherwise if *ZX_HANDLE_INVALID* is
 given, the packet will be delivered through **vcpu_resume**() and a key of 0
 will be set. This provides control over whether the packet is delivered
 asynchronously or synchronously, and provides the ability to distinguish packets
@@ -34,34 +34,34 @@
 use *port_wait*() to dequeue packets, enabling the use of a thread pool to
 handle traps.
 
-*kind* may be either *MX_GUEST_TRAP_MEM* or *MX_GUEST_TRAP_IO*. If
-*MX_GUEST_TRAP_MEM* is specified, then *addr* and *len* must both be
+*kind* may be either *ZX_GUEST_TRAP_MEM* or *ZX_GUEST_TRAP_IO*. If
+*ZX_GUEST_TRAP_MEM* is specified, then *addr* and *len* must both be
 page-aligned.
 
-To identify what *kind* of trap generated a packet, use *MX_PKT_TYPE_GUEST_MEM*
-and *MX_PKT_TYPE_GUEST_IO*.
+To identify what *kind* of trap generated a packet, use *ZX_PKT_TYPE_GUEST_MEM*
+and *ZX_PKT_TYPE_GUEST_IO*.
 
 ## RETURN VALUE
 
-**guest_set_trap**() returns MX_OK on success. On failure, an error value is
+**guest_set_trap**() returns ZX_OK on success. On failure, an error value is
 returned.
 
 ## ERRORS
 
-**MX_ERR_ACCESS_DENIED** *guest* or *port* do not have the *MX_RIGHT_WRITE*
+**ZX_ERR_ACCESS_DENIED** *guest* or *port* do not have the *ZX_RIGHT_WRITE*
 right.
 
-**MX_ERR_BAD_HANDLE** *guest* or *port* are invalid handles.
+**ZX_ERR_BAD_HANDLE** *guest* or *port* are invalid handles.
 
-**MX_ERR_INVALID_ARGS** *kind* is not a valid address space, *addr* or *len*
+**ZX_ERR_INVALID_ARGS** *kind* is not a valid address space, *addr* or *len*
 do not meet the requirements of *kind*, or *len* is 0.
 
-**MX_ERR_NO_MEMORY** Temporary failure due to lack of memory.
+**ZX_ERR_NO_MEMORY** Temporary failure due to lack of memory.
 
-**MX_ERR_OUT_OF_RANGE** The region specified by *addr* and *len* is outside of
+**ZX_ERR_OUT_OF_RANGE** The region specified by *addr* and *len* is outside of
 of the valid bounds of the address space *kind*.
 
-**MX_ERR_WRONG_TYPE** *guest* is not a handle to a guest, or *port* is not a
+**ZX_ERR_WRONG_TYPE** *guest* is not a handle to a guest, or *port* is not a
 handle to a port.
 
 ## SEE ALSO
diff --git a/docs/syscalls/handle_close.md b/docs/syscalls/handle_close.md
index df406a8..7fc8bc6 100644
--- a/docs/syscalls/handle_close.md
+++ b/docs/syscalls/handle_close.md
@@ -1,4 +1,4 @@
-# mx_handle_close
+# zx_handle_close
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_handle_close(mx_handle_t handle);
+zx_status_t zx_handle_close(zx_handle_t handle);
 ```
 
 ## DESCRIPTION
@@ -21,18 +21,18 @@
 [object_wait_many](syscalls/object_wait_many.md) call, the wait will be aborted.
 
 If the *handle* was the next to last handle to the object. The last handle to the
-object will assert the **MX_SIGNAL_LAST_HANDLE** signal.
+object will assert the **ZX_SIGNAL_LAST_HANDLE** signal.
 
-It is not an error to close the special "never a valid handle" **MX_HANDLE_INVALID**,
+It is not an error to close the special "never a valid handle" **ZX_HANDLE_INVALID**,
 similar to free(NULL) being a valid call.
 
 ## RETURN VALUE
 
-**handle_close**() returns **MX_OK** on success.
+**handle_close**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* isn't a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* isn't a valid handle.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/handle_duplicate.md b/docs/syscalls/handle_duplicate.md
index 5d0ff13..ab4725b 100644
--- a/docs/syscalls/handle_duplicate.md
+++ b/docs/syscalls/handle_duplicate.md
@@ -1,4 +1,4 @@
-# mx_handle_duplicate
+# zx_handle_duplicate
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_handle_duplicate(mx_handle_t handle, mx_rights_t rights, mx_handle_t* out);
+zx_status_t zx_handle_duplicate(zx_handle_t handle, zx_rights_t rights, zx_handle_t* out);
 ```
 
 ## DESCRIPTION
@@ -17,24 +17,24 @@
 **handle_duplicate**() creates a duplicate of *handle*, referring
 to the same underlying object, with new access rights *rights*.
 
-To duplicate the handle with the same rights use **MX_RIGHT_SAME_RIGHTS**. If different
+To duplicate the handle with the same rights use **ZX_RIGHT_SAME_RIGHTS**. If different
 rights are desired they must be strictly lesser than of the source handle. It is possible
 to specify no rights by using 0.
 
 ## RETURN VALUE
 
-**handle_duplicate**() returns MX_OK and the duplicate handle via *out* on success.
+**handle_duplicate**() returns ZX_OK and the duplicate handle via *out* on success.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* isn't a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* isn't a valid handle.
 
-**MX_ERR_INVALID_ARGS**  The *rights* requested are not a subset of *handle* rights or
+**ZX_ERR_INVALID_ARGS**  The *rights* requested are not a subset of *handle* rights or
 *out* is an invalid pointer.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_DUPLICATE** and may not be duplicated.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_DUPLICATE** and may not be duplicated.
 
-**MX_ERR_NO_MEMORY**  (Temporary) out of memory situation.
+**ZX_ERR_NO_MEMORY**  (Temporary) out of memory situation.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/handle_replace.md b/docs/syscalls/handle_replace.md
index 3bedae2..c803022 100644
--- a/docs/syscalls/handle_replace.md
+++ b/docs/syscalls/handle_replace.md
@@ -1,4 +1,4 @@
-# mx_handle_replace
+# zx_handle_replace
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_handle_replace(mx_handle_t handle, mx_rights_t rights, mx_handle_t* out);
+zx_status_t zx_handle_replace(zx_handle_t handle, zx_rights_t rights, zx_handle_t* out);
 ```
 
 ## DESCRIPTION
@@ -18,23 +18,23 @@
 the same underlying object, with new access rights *rights*. On success,
 *handle* is invalidated.
 
-If *rights* is **MX_RIGHT_SAME_RIGHTS**, the replacement handle will
+If *rights* is **ZX_RIGHT_SAME_RIGHTS**, the replacement handle will
 have the same rights as the original handle. Otherwise, *rights* must be
 a subset of original handle's rights.
 
 ## RETURN VALUE
 
-**handle_replace**() returns MX_OK and the replacement handle (via *out)
+**handle_replace**() returns ZX_OK and the replacement handle (via *out)
 on success.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* isn't a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* isn't a valid handle.
 
-**MX_ERR_INVALID_ARGS**  The *rights* requested are not a subset of
+**ZX_ERR_INVALID_ARGS**  The *rights* requested are not a subset of
 *handle*'s rights or *out* is an invalid pointer.
 
-**MX_ERR_NO_MEMORY**  (Temporary) out of memory situation.
+**ZX_ERR_NO_MEMORY**  (Temporary) out of memory situation.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/job_create.md b/docs/syscalls/job_create.md
index 2060cb5..389b890 100644
--- a/docs/syscalls/job_create.md
+++ b/docs/syscalls/job_create.md
@@ -1,4 +1,4 @@
-# mx_job_create
+# zx_job_create
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_job_create(mx_handle_t job, uint32_t options, mx_handle_t* out);
+zx_status_t zx_job_create(zx_handle_t job, uint32_t options, zx_handle_t* out);
 
 ```
 
@@ -29,26 +29,26 @@
 
 ## RETURN VALUE
 
-**job_create**() returns MX_OK and a handle to the new job
+**job_create**() returns ZX_OK and a handle to the new job
 (via *out*) on success.  In the event of failure, a negative error value
 is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *job* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *job* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *job* is not a job handle.
+**ZX_ERR_WRONG_TYPE**  *job* is not a job handle.
 
-**MX_ERR_INVALID_ARGS**  *options* is nonzero, or *out* is an invalid pointer.
+**ZX_ERR_INVALID_ARGS**  *options* is nonzero, or *out* is an invalid pointer.
 
-**MX_ERR_ACCESS_DENIED**  *job* does not have the **MX_RIGHT_WRITE** right.
+**ZX_ERR_ACCESS_DENIED**  *job* does not have the **ZX_RIGHT_WRITE** right.
 
-**MX_ERR_OUT_OF_RANGE**  The height of *job* is too large to create a child job.
+**ZX_ERR_OUT_OF_RANGE**  The height of *job* is too large to create a child job.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
-**MX_ERR_BAD_STATE**  (Temporary) Failure due to the job object being in the
-middle of a *mx_task_kill()* operation.
+**ZX_ERR_BAD_STATE**  (Temporary) Failure due to the job object being in the
+middle of a *zx_task_kill()* operation.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/job_set_policy.md b/docs/syscalls/job_set_policy.md
index d69d635..2daafad 100644
--- a/docs/syscalls/job_set_policy.md
+++ b/docs/syscalls/job_set_policy.md
@@ -1,4 +1,4 @@
-# mx_job_set_policy
+# zx_job_set_policy
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/policy.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/policy.h>
 
-mx_status_t mx_job_set_policy(mx_handle_t job_handle, uint32_t options,
+zx_status_t zx_job_set_policy(zx_handle_t job_handle, uint32_t options,
                               uint32_t topic, void* policy, size_t count);
 
 ```
@@ -22,96 +22,96 @@
 the policies specified in *policy*. The effect in the case of conflict between
 the existing policies and the new policies is controlled by *options* values:
 
-+ **MX_JOB_POL_RELATIVE** : policy is applied for the conditions not specifically
++ **ZX_JOB_POL_RELATIVE** : policy is applied for the conditions not specifically
   overridden by the parent policy.
-+ **MX_JOB_POL_ABSOLUTE** : policy is applied for all conditions in *policy* or
++ **ZX_JOB_POL_ABSOLUTE** : policy is applied for all conditions in *policy* or
   the syscall fails.
 
 After this call succeeds any new child process or child job will have the new
 effective policy applied to it.
 
-*topic* indicates the *policy* format. Supported value is **MX_JOB_POL_BASIC**
+*topic* indicates the *policy* format. Supported value is **ZX_JOB_POL_BASIC**
 which indicates that *policy* is an array of *count* entries of:
 
 ```
-typedef struct mx_policy_basic {
+typedef struct zx_policy_basic {
     uint32_t condition;
     uint32_t policy;
-} mx_policy_basic_t;
+} zx_policy_basic_t;
 
 ```
 
 Where *condition* is one of
-+ **MX_POL_BAD_HANDLE** a process under this job is attempting to
++ **ZX_POL_BAD_HANDLE** a process under this job is attempting to
   issue a syscall with an invalid handle.  In this case,
-  **MX_POL_ACTION_ALLOW** and **MX_POL_ACTION_DENY** are equivalent:
+  **ZX_POL_ACTION_ALLOW** and **ZX_POL_ACTION_DENY** are equivalent:
   if the syscall returns, it will always return the error
-  **MX_ERR_BAD_HANDLE**.
-+ **MX_POL_WRONG_OBJECT** a process under this job is attempting to
+  **ZX_ERR_BAD_HANDLE**.
++ **ZX_POL_WRONG_OBJECT** a process under this job is attempting to
   issue a syscall with a handle that does not support such operation.
-+ **MX_POL_VMAR_WX** a process under this job is attempting to map an
++ **ZX_POL_VMAR_WX** a process under this job is attempting to map an
   address region with write-execute access.
-+ **MX_POL_NEW_VMO** a process under this job is attempting to create
++ **ZX_POL_NEW_VMO** a process under this job is attempting to create
   a new vm object.
-+ **MX_POL_NEW_CHANNEL** a process under this job is attempting to create
++ **ZX_POL_NEW_CHANNEL** a process under this job is attempting to create
   a new channel.
-+ **MX_POL_NEW_EVENT** a process under this job is attempting to create
++ **ZX_POL_NEW_EVENT** a process under this job is attempting to create
   a new event.
-+ **MX_POL_NEW_EVPAIR** a process under this job is attempting to create
++ **ZX_POL_NEW_EVPAIR** a process under this job is attempting to create
   a new event pair.
-+ **MX_POL_NEW_PORT** a process under this job is attempting to create
++ **ZX_POL_NEW_PORT** a process under this job is attempting to create
   a new port.
-+ **MX_POL_NEW_SOCKET** a process under this job is attempting to create
++ **ZX_POL_NEW_SOCKET** a process under this job is attempting to create
   a new socket.
-+ **MX_POL_NEW_FIFO** a process under this job is attempting to create
++ **ZX_POL_NEW_FIFO** a process under this job is attempting to create
   a new fifo.
-+ **MX_POL_NEW_TIMER** a process under this job is attempting to create
++ **ZX_POL_NEW_TIMER** a process under this job is attempting to create
   a new timer.
-+ **MX_POL_NEW_ANY** is a special *condition* that stands for all of
-  the above **MX_NEW** condtions such as **MX_POL_NEW_VMO**,
-  **MX_POL_NEW_CHANNEL**, **MX_POL_NEW_EVENT**, **MX_POL_NEW_EVPAIR**,
-  **MX_POL_NEW_PORT**, **MX_POL_NEW_SOCKET**, **MX_POL_NEW_FIFO**,
-  **MX_POL_NEW_GUEST**, and any future MX_NEW policy. This will include any new
++ **ZX_POL_NEW_ANY** is a special *condition* that stands for all of
+  the above **ZX_NEW** condtions such as **ZX_POL_NEW_VMO**,
+  **ZX_POL_NEW_CHANNEL**, **ZX_POL_NEW_EVENT**, **ZX_POL_NEW_EVPAIR**,
+  **ZX_POL_NEW_PORT**, **ZX_POL_NEW_SOCKET**, **ZX_POL_NEW_FIFO**,
+  **ZX_POL_NEW_GUEST**, and any future ZX_NEW policy. This will include any new
   kernel objects which do not require a parent object for creation.
 
 Where *policy* is either
-+ **MX_POL_ACTION_ALLOW**  allow *condition*.
-+ **MX_POL_ACTION_DENY**  prevent *condition*.
++ **ZX_POL_ACTION_ALLOW**  allow *condition*.
++ **ZX_POL_ACTION_DENY**  prevent *condition*.
 
 Optionally it can be augmented via OR with
-+ **MX_POL_ACTION_EXCEPTION** generate an exception via the debug port. An
++ **ZX_POL_ACTION_EXCEPTION** generate an exception via the debug port. An
   exception generated this way acts as a breakpoint. The thread may be
   resumed after the exception.
-+ **MX_POL_ACTION_KILL** terminate the process. It also
-implies **MX_POL_ACTION_DENY**.
++ **ZX_POL_ACTION_KILL** terminate the process. It also
+implies **ZX_POL_ACTION_DENY**.
 
 ## RETURN VALUE
 
-**mx_job_set_policy**() returns **MX_OK** on success.  In the event of failure,
+**zx_job_set_policy**() returns **ZX_OK** on success.  In the event of failure,
 a negative error value is returned.
 
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *policy* was not a valid pointer, or *count* was 0,
-or *policy* was not **MX_JOB_POL_RELATIVE** or **MX_JOB_POL_ABSOLUTE**, or
-*topic* was not **MX_JOB_POL_BASIC**.
+**ZX_ERR_INVALID_ARGS**  *policy* was not a valid pointer, or *count* was 0,
+or *policy* was not **ZX_JOB_POL_RELATIVE** or **ZX_JOB_POL_ABSOLUTE**, or
+*topic* was not **ZX_JOB_POL_BASIC**.
 
-**MX_ERR_BAD_HANDLE**  *job_handle* is not valid handle.
+**ZX_ERR_BAD_HANDLE**  *job_handle* is not valid handle.
 
-**MX_ERR_WRONG_TYPE**  *job_handle* is not a job handle.
+**ZX_ERR_WRONG_TYPE**  *job_handle* is not a job handle.
 
-**MX_ERR_ACCESS_DENIED**  *job_handle* does not have MX_POL_RIGHT_SET right.
+**ZX_ERR_ACCESS_DENIED**  *job_handle* does not have ZX_POL_RIGHT_SET right.
 
-**MX_ERR_BAD_STATE**  the job has existing jobs or processes alive.
+**ZX_ERR_BAD_STATE**  the job has existing jobs or processes alive.
 
-**MX_ERR_OUT_OF_RANGE** *count* is bigger than MX_MAX_POLICY.
+**ZX_ERR_OUT_OF_RANGE** *count* is bigger than ZX_MAX_POLICY.
 
-**MX_ERR_ALREADY_EXISTS** existing policy conflicts with the new policy.
+**ZX_ERR_ALREADY_EXISTS** existing policy conflicts with the new policy.
 
-**MX_ERR_NOT_SUPPORTED** an entry in *policy* has an invalid value.
+**ZX_ERR_NOT_SUPPORTED** an entry in *policy* has an invalid value.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Out of memory condition.
+**ZX_ERR_NO_MEMORY**  (Temporary) Out of memory condition.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/job_set_relative_importance.md b/docs/syscalls/job_set_relative_importance.md
index 131992a..47b42d3 100644
--- a/docs/syscalls/job_set_relative_importance.md
+++ b/docs/syscalls/job_set_relative_importance.md
@@ -1,4 +1,4 @@
-# mx_job_set_relative_importance
+# zx_job_set_relative_importance
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_job_set_relative_importance(
-    mx_handle_t resource, mx_handle_t job, mx_handle_t less_important_job)
+zx_status_t zx_job_set_relative_importance(
+    zx_handle_t resource, zx_handle_t job, zx_handle_t less_important_job)
 
 ```
 
@@ -26,7 +26,7 @@
 
 Upon success, updates a partial ordering between jobs so that
 *less_important_job* will be killed before *job* in low-resource situations. If
-*less_important_job* is **MX_INVALID_HANDLE**, then *job* becomes the
+*less_important_job* is **ZX_INVALID_HANDLE**, then *job* becomes the
 least-important job in the system.
 
 If the new order pair would create a cycle, an existing order pair will be
@@ -40,16 +40,16 @@
 
 ## RETURN VALUE
 
-**job_set_relative_importance**() returns MX_OK on success. In the event of
+**job_set_relative_importance**() returns ZX_OK on success. In the event of
 failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE** *resource* or *job* is not a valid handle.
+**ZX_ERR_BAD_HANDLE** *resource* or *job* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE** *resource* is not a resource handle, *job* is not a job
+**ZX_ERR_WRONG_TYPE** *resource* is not a resource handle, *job* is not a job
 handle, or *less_important_job* is not a job handle (if it is a value other than
-**MX_INVALID_HANDLE**).
+**ZX_INVALID_HANDLE**).
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/nanosleep.md b/docs/syscalls/nanosleep.md
index f450d81..9c7bb11 100644
--- a/docs/syscalls/nanosleep.md
+++ b/docs/syscalls/nanosleep.md
@@ -1,4 +1,4 @@
-# mx_nanosleep
+# zx_nanosleep
 
 ## NAME
 
@@ -7,27 +7,27 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_nanosleep(mx_time_t deadline);
+zx_status_t zx_nanosleep(zx_time_t deadline);
 ```
 
 ## DESCRIPTION
 
 **nanosleep**() suspends the calling thread execution until *deadline* passes on
-**MX_CLOCK_MONOTONIC**. The value **0** immediately yields the thread.
+**ZX_CLOCK_MONOTONIC**. The value **0** immediately yields the thread.
 
-To sleep for a duration, use [**mx_deadline_after**](deadline_after.md) and the
-**MX_\<time-unit\>** helpers:
+To sleep for a duration, use [**zx_deadline_after**](deadline_after.md) and the
+**ZX_\<time-unit\>** helpers:
 
 ```
-#include <magenta/syscalls.h> // mx_deadline_after, mx_nanosleep
-#include <magenta/types.h> // MX_MSEC et al.
+#include <zircon/syscalls.h> // zx_deadline_after, zx_nanosleep
+#include <zircon/types.h> // ZX_MSEC et al.
 
 // Sleep 50 milliseconds
-mx_nanosleep(mx_deadline_after(MX_MSEC(50)));
+zx_nanosleep(zx_deadline_after(ZX_MSEC(50)));
 ```
 
 ## RETURN VALUE
 
-**nanosleep**() always returns **MX_OK**.
+**nanosleep**() always returns **ZX_OK**.
diff --git a/docs/syscalls/object_get_child.md b/docs/syscalls/object_get_child.md
index c327250..3532d26 100644
--- a/docs/syscalls/object_get_child.md
+++ b/docs/syscalls/object_get_child.md
@@ -1,4 +1,4 @@
-# mx_object_get_child
+# zx_object_get_child
 
 ## NAME
 
@@ -8,22 +8,22 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_object_get_child(mx_handle_t handle, uint64_t koid,
-                                mx_rights_t rights, mx_handle_t* out);
+zx_status_t zx_object_get_child(zx_handle_t handle, uint64_t koid,
+                                zx_rights_t rights, zx_handle_t* out);
 
 ```
 
 ## DESCRIPTION
 
-**mx_object_get_child** attempts to find a child of the object referred to
+**zx_object_get_child** attempts to find a child of the object referred to
 by *handle* which has the kernel object id specified by *koid*.  If such an
 object exists, and the requested *rights* are not greater than those provided
 by the *handle* to the parent, a new handle to the specified child object is
 returned.
 
-*rights* may be *MX_RIGHT_SAME_RIGHTS* which will result in rights equivalent
+*rights* may be *ZX_RIGHT_SAME_RIGHTS* which will result in rights equivalent
 to the those on the *handle*.
 
 If the object is a *Process*, the *Threads* it contains may be obtained by
@@ -38,23 +38,23 @@
 
 ## RETURN VALUE
 
-On success, **MX_OK** is returned and a handle to the desired child object is returned via *out*.
+On success, **ZX_OK** is returned and a handle to the desired child object is returned via *out*.
 
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a *Process*, *Job*, or *Resource*.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a *Process*, *Job*, or *Resource*.
 
-**MX_ERR_ACCESS_DENIED**   *handle* lacks the right **MX_RIGHT_ENUMERATE** or *rights* specifies
+**ZX_ERR_ACCESS_DENIED**   *handle* lacks the right **ZX_RIGHT_ENUMERATE** or *rights* specifies
 rights that are not present on *handle*.
 
-**MX_ERR_NOT_FOUND**  *handle* does not have a child with the kernel object id *koid*.
+**ZX_ERR_NOT_FOUND**  *handle* does not have a child with the kernel object id *koid*.
 
-**MX_ERR_NO_MEMORY**  (temporary) out of memory failure.
+**ZX_ERR_NO_MEMORY**  (temporary) out of memory failure.
 
-**MX_ERR_INVALID_ARGS**  *out* is an invalid pointer.
+**ZX_ERR_INVALID_ARGS**  *out* is an invalid pointer.
 
 
 ## SEE ALSO
diff --git a/docs/syscalls/object_get_cookie.md b/docs/syscalls/object_get_cookie.md
index c4a6643..8d6dda2 100644
--- a/docs/syscalls/object_get_cookie.md
+++ b/docs/syscalls/object_get_cookie.md
@@ -1,4 +1,4 @@
-# mx_object_get_cookie
+# zx_object_get_cookie
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_object_get_cookie(mx_handle_t handle, mx_handle_t scope, uint64_t* cookie);
+zx_status_t zx_object_get_cookie(zx_handle_t handle, zx_handle_t scope, uint64_t* cookie);
 
 ```
 
@@ -18,15 +18,15 @@
 Some objects (Events, Event pairs, Resources, VMOs) may have a cookie attached,
 which is a 64bit opaque value.  Initially the cookie is undefined and not readable.
 
-If the cookie has been set on an object, **mx_object_get_cookie**() may be
+If the cookie has been set on an object, **zx_object_get_cookie**() may be
 called, using the same object as *scope* to obtain the cookie.
 
 Event pairs are special.  If one side of the pair is closed, the other side's
 cookie is invalidated. An invalidated cookie is not get-able or set-able with any scope.
 
 Cookies are useful for objects that will be passed to another process and
-later returned.  By setting the cookie with **mx_object_set_cookie**(),
-using a *scope* that is not accessible by other processes, **mx_object_get_cookie**()
+later returned.  By setting the cookie with **zx_object_set_cookie**(),
+using a *scope* that is not accessible by other processes, **zx_object_get_cookie**()
 may later be used to verify that a handle is referring to an object that was
 "created" by the calling process and simultaneously return an ID or pointer
 to local state for that object.
@@ -37,20 +37,20 @@
 
 ## RETURN VALUE
 
-**mx_object_get_cookie**() returns **MX_OK** and the *cookie* value on success.
+**zx_object_get_cookie**() returns **ZX_OK** and the *cookie* value on success.
 In the event of failure, a negative error value is returned.
 
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* or *scope* are not valid handles.
+**ZX_ERR_BAD_HANDLE**  *handle* or *scope* are not valid handles.
 
-**MX_ERR_NOT_SUPPORTED**  *handle* is not a handle to an object that may have a cookie set.
+**ZX_ERR_NOT_SUPPORTED**  *handle* is not a handle to an object that may have a cookie set.
 
-**MX_ERR_ACCESS_DENIED**  The cookie has not been set, or *scope* is not the correct scope
+**ZX_ERR_ACCESS_DENIED**  The cookie has not been set, or *scope* is not the correct scope
 to obtain the set cookie.
 
-**MX_ERR_INVALID_ARGS**  *cookie* is an invalid pointer.
+**ZX_ERR_INVALID_ARGS**  *cookie* is an invalid pointer.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/object_get_info.md b/docs/syscalls/object_get_info.md
index 57bfecd..0df9881 100644
--- a/docs/syscalls/object_get_info.md
+++ b/docs/syscalls/object_get_info.md
@@ -1,4 +1,4 @@
-# mx_object_get_info
+# zx_object_get_info
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 
-mx_status_t mx_object_get_info(mx_handle_t handle, uint32_t topic,
+zx_status_t zx_object_get_info(zx_handle_t handle, uint32_t topic,
                                void* buffer, size_t buffer_size,
                                size_t* actual, size_t* avail);
 ```
@@ -36,55 +36,55 @@
 
 ## TOPICS
 
-### MX_INFO_HANDLE_VALID
+### ZX_INFO_HANDLE_VALID
 
 *handle* type: **Any**
 
 *buffer* type: **n/a**
 
-Returns **MX_OK** if *handle* is valid, a negative status otherwise. No
+Returns **ZX_OK** if *handle* is valid, a negative status otherwise. No
 records are returned and *buffer* may be NULL.
 
-### MX_INFO_HANDLE_BASIC
+### ZX_INFO_HANDLE_BASIC
 
 *handle* type: **Any**
 
-*buffer* type: **mx_info_handle_basic_t[1]**
+*buffer* type: **zx_info_handle_basic_t[1]**
 
 ```
-typedef struct mx_info_handle_basic {
+typedef struct zx_info_handle_basic {
     // The unique id assigned by kernel to the object referenced by the
     // handle.
-    mx_koid_t koid;
+    zx_koid_t koid;
 
     // The immutable rights assigned to the handle. Two handles that
     // have the same koid and the same rights are equivalent and
     // interchangeable.
-    mx_rights_t rights;
+    zx_rights_t rights;
 
     // The object type: channel, event, socket, etc.
-    uint32_t type;                // mx_obj_type_t;
+    uint32_t type;                // zx_obj_type_t;
 
     // The koid of the logical counterpart or parent object of the
     // object referenced by the handle. Otherwise this value is zero.
-    mx_koid_t related_koid;
+    zx_koid_t related_koid;
 
-    // Set to MX_OBJ_PROP_WAITABLE if the object referenced by the
+    // Set to ZX_OBJ_PROP_WAITABLE if the object referenced by the
     // handle can be waited on; zero otherwise.
-    uint32_t props;               // mx_obj_props_t;
-} mx_info_handle_basic_t;
+    uint32_t props;               // zx_obj_props_t;
+} zx_info_handle_basic_t;
 ```
 
-### MX_INFO_PROCESS
+### ZX_INFO_PROCESS
 
 *handle* type: **Process**
 
-*buffer* type: **mx_info_process_t[1]**
+*buffer* type: **zx_info_process_t[1]**
 
 ```
-typedef struct mx_info_process {
+typedef struct zx_info_process {
     // The process's return code; only valid if |exited| is true.
-    // Guaranteed to be non-zero if the process was killed by |mx_task_kill|.
+    // Guaranteed to be non-zero if the process was killed by |zx_task_kill|.
     int return_code;
 
     // True if the process has ever left the initial creation state,
@@ -96,145 +96,145 @@
 
     // True if a debugger is attached to the process.
     bool debugger_attached;
-} mx_info_process_t;
+} zx_info_process_t;
 ```
 
-### MX_INFO_PROCESS_THREADS
+### ZX_INFO_PROCESS_THREADS
 
 *handle* type: **Process**
 
-*buffer* type: **mx_koid_t[n]**
+*buffer* type: **zx_koid_t[n]**
 
-Returns an array of *mx_koid_t*, one for each running thread in the Process at
+Returns an array of *zx_koid_t*, one for each running thread in the Process at
 that moment in time.
 
-### MX_INFO_RESOURCE_CHILDREN
+### ZX_INFO_RESOURCE_CHILDREN
 
 *handle* type: **Resource**
 
-*buffer* type: **mx_rrec_t[n]**
+*buffer* type: **zx_rrec_t[n]**
 
-Returns an array of *mx_rrec_t*, one for each child Resource of the provided
+Returns an array of *zx_rrec_t*, one for each child Resource of the provided
 Resource handle.
 
-### MX_INFO_RESOURCE_RECORDS
+### ZX_INFO_RESOURCE_RECORDS
 
 *handle* type: **Resource**
 
-*buffer* type: **mx_rrec_t[n]**
+*buffer* type: **zx_rrec_t[n]**
 
-Returns an array of *mx_rrec_t*, one for each Record associated with the
+Returns an array of *zx_rrec_t*, one for each Record associated with the
 provided Resource handle.
 
-### MX_INFO_THREAD
+### ZX_INFO_THREAD
 
 *handle* type: **Thread**
 
-*buffer* type: **mx_info_thread_t[1]**
+*buffer* type: **zx_info_thread_t[1]**
 
 ```
-typedef struct mx_info_thread {
-    // One of MX_THREAD_STATE_* values.
+typedef struct zx_info_thread {
+    // One of ZX_THREAD_STATE_* values.
     uint32_t state;
 
     // If nonzero, the thread has gotten an exception and is waiting for
     // the exception to be handled by the specified port.
-    // The value is one of MX_EXCEPTION_PORT_TYPE_*.
+    // The value is one of ZX_EXCEPTION_PORT_TYPE_*.
     // Note: If the thread is waiting for an exception response then |state|
-    // will have the value MX_THREAD_STATE_BLOCKED.
+    // will have the value ZX_THREAD_STATE_BLOCKED.
     uint32_t wait_exception_port_type;
-} mx_info_thread_t;
+} zx_info_thread_t;
 ```
 
 The values in this struct are mainly for informational and debugging
 purposes at the moment.
 
-The **MX_THREAD_STATE_\*** values are defined by
+The **ZX_THREAD_STATE_\*** values are defined by
 
 ```
-#include <magenta/syscalls/object.h>
+#include <zircon/syscalls/object.h>
 ```
 
-*   *MX_THREAD_STATE_NEW*
-*   *MX_THREAD_STATE_RUNNING*
-*   *MX_THREAD_STATE_SUSPENDED*
-*   *MX_THREAD_STATE_BLOCKED*
-*   *MX_THREAD_STATE_DYING*
-*   *MX_THREAD_STATE_DEAD*
+*   *ZX_THREAD_STATE_NEW*
+*   *ZX_THREAD_STATE_RUNNING*
+*   *ZX_THREAD_STATE_SUSPENDED*
+*   *ZX_THREAD_STATE_BLOCKED*
+*   *ZX_THREAD_STATE_DYING*
+*   *ZX_THREAD_STATE_DEAD*
 
-The **MX_EXCEPTION_PORT_TYPE_\*** values are defined by
+The **ZX_EXCEPTION_PORT_TYPE_\*** values are defined by
 
 ```
-#include <magenta/syscalls/exception.h>
+#include <zircon/syscalls/exception.h>
 ```
 
-*   *MX_EXCEPTION_PORT_TYPE_NONE*
-*   *MX_EXCEPTION_PORT_TYPE_DEBUGGER*
-*   *MX_EXCEPTION_PORT_TYPE_THREAD*
-*   *MX_EXCEPTION_PORT_TYPE_PROCESS*
-*   *MX_EXCEPTION_PORT_TYPE_SYSTEM*
+*   *ZX_EXCEPTION_PORT_TYPE_NONE*
+*   *ZX_EXCEPTION_PORT_TYPE_DEBUGGER*
+*   *ZX_EXCEPTION_PORT_TYPE_THREAD*
+*   *ZX_EXCEPTION_PORT_TYPE_PROCESS*
+*   *ZX_EXCEPTION_PORT_TYPE_SYSTEM*
 
-### MX_INFO_THREAD_EXCEPTION_REPORT
+### ZX_INFO_THREAD_EXCEPTION_REPORT
 
 *handle* type: **Thread**
 
-*buffer* type: **mx_exception_report_t[1]**
+*buffer* type: **zx_exception_report_t[1]**
 
 ```
-#include <magenta/syscalls/exception.h>
+#include <zircon/syscalls/exception.h>
 ```
 
 If the thread is currently in an exception and is waiting for an exception
 response, then this returns the exception report as a single
-*mx_exception_report_t*, with status MX_OK.
+*zx_exception_report_t*, with status ZX_OK.
 
-Returns **MX_ERR_BAD_STATE** if the thread is not in an exception and waiting for
+Returns **ZX_ERR_BAD_STATE** if the thread is not in an exception and waiting for
 an exception response.
 
-### MX_INFO_VMAR
+### ZX_INFO_VMAR
 
 *handle* type: **VM Address Region**
 
-*buffer* type: **mx_info_vmar_t[1]**
+*buffer* type: **zx_info_vmar_t[1]**
 
 ```
-typedef struct mx_info_vmar {
+typedef struct zx_info_vmar {
     // Base address of the region.
     uintptr_t base;
 
     // Length of the region, in bytes.
     size_t len;
-} mx_info_vmar_t;
+} zx_info_vmar_t;
 ```
 
-### MX_INFO_JOB_CHILDREN
+### ZX_INFO_JOB_CHILDREN
 
 *handle* type: **Job**
 
-*buffer* type: **mx_koid_t[n]**
+*buffer* type: **zx_koid_t[n]**
 
-Returns an array of *mx_koid_t*, one for each direct child Job of the provided
+Returns an array of *zx_koid_t*, one for each direct child Job of the provided
 Job handle.
 
-### MX_INFO_JOB_PROCESSES
+### ZX_INFO_JOB_PROCESSES
 
 *handle* type: **Job**
 
-*buffer* type: **mx_koid_t[n]**
+*buffer* type: **zx_koid_t[n]**
 
-Returns an array of *mx_koid_t*, one for each direct child Process of the
+Returns an array of *zx_koid_t*, one for each direct child Process of the
 provided Job handle.
 
-### MX_INFO_TASK_STATS
+### ZX_INFO_TASK_STATS
 
 *handle* type: **Process**
 
-*buffer* type: **mx_info_task_stats_t[1]**
+*buffer* type: **zx_info_task_stats_t[1]**
 
 ```
 // Statistics about resources (e.g., memory) used by a task. Can be relatively
 // expensive to gather.
-typedef struct mx_info_task_stats {
+typedef struct zx_info_task_stats {
     // The total size of mapped memory ranges in the task.
     // Not all will be backed by physical memory.
     size_t mem_mapped_bytes;
@@ -258,42 +258,42 @@
     //
     // This number is strictly smaller than mem_shared_bytes.
     size_t mem_scaled_shared_bytes;
-} mx_info_task_stats_t;
+} zx_info_task_stats_t;
 ```
 
 Additional errors:
 
-*   **MX_ERR_BAD_STATE**: If the target process is not currently running.
+*   **ZX_ERR_BAD_STATE**: If the target process is not currently running.
 
-### MX_INFO_PROCESS_MAPS
+### ZX_INFO_PROCESS_MAPS
 
-*handle* type: **Process** other than your own, with **MX_RIGHT_READ**
+*handle* type: **Process** other than your own, with **ZX_RIGHT_READ**
 
-*buffer* type: **mx_info_maps_t[n]**
+*buffer* type: **zx_info_maps_t[n]**
 
-The *mx_info_maps_t* array is a depth-first pre-order walk of the target
+The *zx_info_maps_t* array is a depth-first pre-order walk of the target
 process's Aspace/VMAR/Mapping tree.
 
 ```
-typedef struct mx_info_maps {
+typedef struct zx_info_maps {
     // Name if available; empty string otherwise.
-    char name[MX_MAX_NAME_LEN];
+    char name[ZX_MAX_NAME_LEN];
     // Base address.
-    mx_vaddr_t base;
+    zx_vaddr_t base;
     // Size in bytes.
     size_t size;
 
     // The depth of this node in the tree.
     // Can be used for indentation, or to rebuild the tree from an array
-    // of mx_info_maps_t entries, which will be in depth-first pre-order.
+    // of zx_info_maps_t entries, which will be in depth-first pre-order.
     size_t depth;
     // The type of this entry; indicates which union entry is valid.
-    uint32_t type; // mx_info_maps_type_t
+    uint32_t type; // zx_info_maps_type_t
     union {
-        mx_info_maps_mapping_t mapping;
+        zx_info_maps_mapping_t mapping;
         // No additional fields for other types.
     } u;
-} mx_info_maps_t;
+} zx_info_maps_t;
 ```
 
 The *depth* field of each entry describes its relationship to the nodes that
@@ -302,28 +302,28 @@
 
 To get a full picture of how a process uses its VMOs and how a VMO is used
 by various processes, you may need to combine this information with
-MX_INFO_PROCESS_VMOS.
+ZX_INFO_PROCESS_VMOS.
 
 See the `vmaps` command-line tool for an example user of this topic, and to dump
 the maps of arbitrary processes by koid.
 
 Additional errors:
 
-*   **MX_ERR_ACCESS_DENIED**: If the appropriate rights are missing, or if a
+*   **ZX_ERR_ACCESS_DENIED**: If the appropriate rights are missing, or if a
     process attempts to call this on a handle to itself. It's not safe to
     examine yourself: *buffer* will live inside the Aspace being examined, and
     the kernel can't safely fault in pages of the buffer while walking the
     Aspace.
-*   **MX_ERR_BAD_STATE**: If the target process is not currently running, or if
+*   **ZX_ERR_BAD_STATE**: If the target process is not currently running, or if
     its address space has been destroyed.
 
-### MX_INFO_PROCESS_VMOS
+### ZX_INFO_PROCESS_VMOS
 
-*handle* type: **Process** other than your own, with **MX_RIGHT_READ**
+*handle* type: **Process** other than your own, with **ZX_RIGHT_READ**
 
-*buffer* type: **mx_info_vmos_t[n]**
+*buffer* type: **zx_info_vmos_t[n]**
 
-The *mx_info_vmos_t* array is list of all VMOs pointed to by the target process.
+The *zx_info_vmos_t* array is list of all VMOs pointed to by the target process.
 Some VMOs are mapped, some are pointed to by handles, and some are both.
 
 **Note**: The same VMO may appear multiple times due to multiple
@@ -333,16 +333,16 @@
 
 To get a full picture of how a process uses its VMOs and how a VMO is used
 by various processes, you may need to combine this information with
-MX_INFO_PROCESS_MAPS.
+ZX_INFO_PROCESS_MAPS.
 
 ```
 // Describes a VMO.
-typedef struct mx_info_vmo {
+typedef struct zx_info_vmo {
     // The koid of this VMO.
-    mx_koid_t koid;
+    zx_koid_t koid;
 
     // The name of this VMO.
-    char name[MX_MAX_NAME_LEN];
+    char name[ZX_MAX_NAME_LEN];
 
     // The size of this VMO; i.e., the amount of virtual address space it
     // would consume if mapped.
@@ -350,7 +350,7 @@
 
     // If this VMO is a clone, the koid of its parent. Otherwise, zero.
     // See |flags| for the type of clone.
-    mx_koid_t parent_koid;
+    zx_koid_t parent_koid;
 
     // The number of clones of this VMO, if any.
     size_t num_children;
@@ -366,33 +366,33 @@
     // and so does the kernel.
     size_t share_count;
 
-    // Bitwise OR of MX_INFO_VMO_* values.
+    // Bitwise OR of ZX_INFO_VMO_* values.
     uint32_t flags;
 
-    // If |MX_INFO_VMO_TYPE(flags) == MX_INFO_VMO_TYPE_PAGED|, the amount of
+    // If |ZX_INFO_VMO_TYPE(flags) == ZX_INFO_VMO_TYPE_PAGED|, the amount of
     // memory currently allocated to this VMO; i.e., the amount of physical
     // memory it consumes. Undefined otherwise.
     uint64_t committed_bytes;
 
-    // If |flags & MX_INFO_VMO_VIA_HANDLE|, the handle rights.
+    // If |flags & ZX_INFO_VMO_VIA_HANDLE|, the handle rights.
     // Undefined otherwise.
-    mx_rights_t handle_rights;
-} mx_info_vmo_t;
+    zx_rights_t handle_rights;
+} zx_info_vmo_t;
 ```
 
 See the `vmos` command-line tool for an example user of this topic, and to dump
 the VMOs of arbitrary processes by koid.
 
-### MX_INFO_KMEM_STATS
+### ZX_INFO_KMEM_STATS
 
 *handle* type: **Resource** (Specifically, the root resource)
 
-*buffer* type: **mx_info_kmem_stats_t[1]**
+*buffer* type: **zx_info_kmem_stats_t[1]**
 
 ```
 // Information about kernel memory usage.
 // Can be expensive to gather.
-typedef struct mx_info_kmem_stats {
+typedef struct zx_info_kmem_stats {
     // The total amount of physical memory available to the system.
     size_t total_bytes;
 
@@ -425,55 +425,55 @@
 
     // Non-free memory that isn't accounted for in any other field.
     size_t other_bytes;
-} mx_info_kmem_stats_t;
+} zx_info_kmem_stats_t;
 ```
 
 ## RETURN VALUE
 
-**mx_object_get_info**() returns **MX_OK** on success. In the event of
+**zx_object_get_info**() returns **ZX_OK** on success. In the event of
 failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE** *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE** *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE** *handle* is not an appropriate type for *topic*
+**ZX_ERR_WRONG_TYPE** *handle* is not an appropriate type for *topic*
 
-**MX_ERR_ACCESS_DENIED**: If *handle* does not have the necessary rights for the
+**ZX_ERR_ACCESS_DENIED**: If *handle* does not have the necessary rights for the
 operation.
 
-**MX_ERR_INVALID_ARGS** *buffer*, *actual*, or *avail* are invalid pointers.
+**ZX_ERR_INVALID_ARGS** *buffer*, *actual*, or *avail* are invalid pointers.
 
-**MX_ERR_NO_MEMORY** Temporary out of memory failure.
+**ZX_ERR_NO_MEMORY** Temporary out of memory failure.
 
-**MX_ERR_BUFFER_TOO_SMALL** The *topic* returns a fixed number of records, but the
+**ZX_ERR_BUFFER_TOO_SMALL** The *topic* returns a fixed number of records, but the
 provided buffer is not large enough for these records.
 
-**MX_ERR_NOT_SUPPORTED** *topic* does not exist.
+**ZX_ERR_NOT_SUPPORTED** *topic* does not exist.
 
 ## EXAMPLES
 
 ```
-bool is_handle_valid(mx_handle_t handle) {
-    return mx_object_get_info(
-        handle, MX_INFO_HANDLE_VALID, NULL, 0, NULL, NULL) == MX_OK;
+bool is_handle_valid(zx_handle_t handle) {
+    return zx_object_get_info(
+        handle, ZX_INFO_HANDLE_VALID, NULL, 0, NULL, NULL) == ZX_OK;
 }
 
-mx_koid_t get_object_koid(mx_handle_t handle) {
-    mx_info_handle_basic_t info;
-    if (mx_object_get_info(handle, MX_INFO_HANDLE_BASIC,
-                           &info, sizeof(info), NULL, NULL) != MX_OK) {
+zx_koid_t get_object_koid(zx_handle_t handle) {
+    zx_info_handle_basic_t info;
+    if (zx_object_get_info(handle, ZX_INFO_HANDLE_BASIC,
+                           &info, sizeof(info), NULL, NULL) != ZX_OK) {
         return 0;
     }
     return info.koid;
 }
 
-void examine_threads(mx_handle_t proc) {
-    mx_koid_t threads[128];
+void examine_threads(zx_handle_t proc) {
+    zx_koid_t threads[128];
     size_t count, avail;
 
-    if (mx_object_get_info(proc, MX_INFO_PROCESS_THREADS, threads,
-                           sizeof(threads), &count, &avail) != MX_OK) {
+    if (zx_object_get_info(proc, ZX_INFO_PROCESS_THREADS, threads,
+                           sizeof(threads), &count, &avail) != ZX_OK) {
         // Error!
     } else {
         if (avail > count) {
diff --git a/docs/syscalls/object_get_property.md b/docs/syscalls/object_get_property.md
index 00e16cb..29978bb 100644
--- a/docs/syscalls/object_get_property.md
+++ b/docs/syscalls/object_get_property.md
@@ -1,4 +1,4 @@
-# mx_object_get_property, mx_object_set_property
+# zx_object_get_property, zx_object_set_property
 
 ## NAME
 
@@ -9,29 +9,29 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 
-mx_status_t mx_object_get_property(mx_handle_t handle, uint32_t property,
+zx_status_t zx_object_get_property(zx_handle_t handle, uint32_t property,
                                    void* value, size_t size);
 
-mx_status_t mx_object_set_property(mx_handle_t handle, uint32_t property,
+zx_status_t zx_object_set_property(zx_handle_t handle, uint32_t property,
                                    const void* value, size_t size);
 ```
 
 ## DESCRIPTION
 
-**mx_object_get_property()** requests the value of a kernel object's property.
-Getting a property requires **MX_RIGHT_GET_PROPERTY** rights on the handle.
+**zx_object_get_property()** requests the value of a kernel object's property.
+Getting a property requires **ZX_RIGHT_GET_PROPERTY** rights on the handle.
 
-**mx_object_set_property()** modifies the value of a kernel object's property.
-Setting a property requires **MX_RIGHT_SET_PROPERTY** rights on the handle.
+**zx_object_set_property()** modifies the value of a kernel object's property.
+Setting a property requires **ZX_RIGHT_SET_PROPERTY** rights on the handle.
 
 The *handle* parameter indicates the target kernel object. Different properties
 only work on certain types of kernel objects, as described below.
 
 The *property* parameter indicates which property to get/set. Property values
-have the prefix **MX_PROP_**, and are described below.
+have the prefix **ZX_PROP_**, and are described below.
 
 The *value* parameter holds the property value, and must be a pointer to a
 buffer of *size* bytes. Different properties expect different value types/sizes
@@ -39,13 +39,13 @@
 
 ## PROPERTIES
 
-Property values have the prefix **MX_PROP_**, and are defined in
+Property values have the prefix **ZX_PROP_**, and are defined in
 
 ```
-#include <magenta/syscalls/object.h>
+#include <zircon/syscalls/object.h>
 ```
 
-### MX_PROP_NUM_STATE_KINDS
+### ZX_PROP_NUM_STATE_KINDS
 
 *handle* type: **Thread**
 
@@ -57,17 +57,17 @@
 
 TODO: Describe the details of this property.
 
-### MX_PROP_NAME
+### ZX_PROP_NAME
 
 *handle* type: **(Most types)**
 
-*value* type: **char\[MX_MAX_NAME_LEN\]**
+*value* type: **char\[ZX_MAX_NAME_LEN\]**
 
 Allowed operations: **get**, **set**
 
 The name of the object, as a NUL-terminated string.
 
-### MX_PROP_REGISTER_FS
+### ZX_PROP_REGISTER_FS
 
 *handle* type: **Thread**
 
@@ -79,7 +79,7 @@
 
 Only defined for x86-64.
 
-### MX_PROP_PROCESS_DEBUG_ADDR
+### ZX_PROP_PROCESS_DEBUG_ADDR
 
 *handle* type: **Process**
 
@@ -89,7 +89,7 @@
 
 The value of ld.so's `_dl_debug_addr`.
 
-### MX_PROP_PROCESS_VDSO_BASE_ADDRESS
+### ZX_PROP_PROCESS_VDSO_BASE_ADDRESS
 
 *handle* type: **Process**
 
@@ -99,11 +99,11 @@
 
 The base address of the vDSO mapping, or zero.
 
-### MX_PROP_JOB_IMPORTANCE
+### ZX_PROP_JOB_IMPORTANCE
 
 *handle* type: **Job**
 
-*value* type: **mx_job_importance_t**
+*value* type: **zx_job_importance_t**
 
 Allowed operations: **get**, **set**
 
@@ -112,29 +112,29 @@
 
 Additional errors:
 
-*   **MX_ERR_OUT_OF_RANGE**: If the importance value is not valid
+*   **ZX_ERR_OUT_OF_RANGE**: If the importance value is not valid
 
 ## RETURN VALUE
 
-**mx_object_get_property**() returns **MX_OK** on success. In the event of
+**zx_object_get_property**() returns **ZX_OK** on success. In the event of
 failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**: *handle* is not a valid handle
+**ZX_ERR_BAD_HANDLE**: *handle* is not a valid handle
 
-**MX_ERR_WRONG_TYPE**: *handle* is not an appropriate type for *property*
+**ZX_ERR_WRONG_TYPE**: *handle* is not an appropriate type for *property*
 
-**MX_ERR_ACCESS_DENIED**: *handle* does not have the necessary rights for the
+**ZX_ERR_ACCESS_DENIED**: *handle* does not have the necessary rights for the
 operation
 
-**MX_ERR_INVALID_ARGS**: *value* is an invalid pointer
+**ZX_ERR_INVALID_ARGS**: *value* is an invalid pointer
 
-**MX_ERR_NO_MEMORY**: Temporary out of memory failure
+**ZX_ERR_NO_MEMORY**: Temporary out of memory failure
 
-**MX_ERR_BUFFER_TOO_SMALL**: *size* is too small for *property*
+**ZX_ERR_BUFFER_TOO_SMALL**: *size* is too small for *property*
 
-**MX_ERR_NOT_SUPPORTED**: *property* does not exist
+**ZX_ERR_NOT_SUPPORTED**: *property* does not exist
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/object_set_cookie.md b/docs/syscalls/object_set_cookie.md
index 1a7b6c1..13e15f0 100644
--- a/docs/syscalls/object_set_cookie.md
+++ b/docs/syscalls/object_set_cookie.md
@@ -1,4 +1,4 @@
-# mx_object_set_cookie
+# zx_object_set_cookie
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_object_set_cookie(mx_handle_t handle, mx_handle_t scope, uint64_t cookie);
+zx_status_t zx_object_set_cookie(zx_handle_t handle, zx_handle_t scope, uint64_t cookie);
 
 ```
 
@@ -18,7 +18,7 @@
 which is a 64bit opaque value.  Initially the Cookie is undefined and not
 readable.
 
-Once **mx_object_set_cookie**() is called successfully, the cookie is set,
+Once **zx_object_set_cookie**() is called successfully, the cookie is set,
 and the Object referenced by the *scope* handle becomes the key necessary
 to read the cookie or modify it.  The *scope* may never be changed for the
 lifetime of the object.
@@ -27,8 +27,8 @@
 cookie is invalidated. An invalidated cookie is not get-able or set-able with any scope.
 
 Cookies are useful for objects that will be passed to another process and
-later returned.  By setting the cookie with **mx_object_set_cookie**(),
-using a *scope* that is not accessible by other processes, **mx_object_get_cookie**()
+later returned.  By setting the cookie with **zx_object_set_cookie**(),
+using a *scope* that is not accessible by other processes, **zx_object_get_cookie**()
 may later be used to verify that a handle is referring to an object that was
 "created" by the calling process and simultaneously return an ID or pointer
 to local state for that object.
@@ -39,17 +39,17 @@
 
 ## RETURN VALUE
 
-**mx_object_set_cookie**() returns **MX_OK** on success.  In the event of failure,
+**zx_object_set_cookie**() returns **ZX_OK** on success.  In the event of failure,
 a negative error value is returned.
 
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* or *scope* are not valid handles.
+**ZX_ERR_BAD_HANDLE**  *handle* or *scope* are not valid handles.
 
-**MX_ERR_NOT_SUPPORTED**  *handle* is not a handle to an object that may have a cookie set.
+**ZX_ERR_NOT_SUPPORTED**  *handle* is not a handle to an object that may have a cookie set.
 
-**MX_ERR_ACCESS_DENIED**  **mx_object_set_cookie**() was called previously with a different
+**ZX_ERR_ACCESS_DENIED**  **zx_object_set_cookie**() was called previously with a different
 object as the *scope*, or the cookie has not been set.
 
 
diff --git a/docs/syscalls/object_set_property.md b/docs/syscalls/object_set_property.md
index 591dbf6..5b8c4a6 100644
--- a/docs/syscalls/object_set_property.md
+++ b/docs/syscalls/object_set_property.md
@@ -1,4 +1,4 @@
-# mx_object_set_property
+# zx_object_set_property
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_object_set_property(mx_handle_t handle, uint32_t property,
+zx_status_t zx_object_set_property(zx_handle_t handle, uint32_t property,
                                    const void* value, size_t size);
 
 ```
diff --git a/docs/syscalls/object_signal.md b/docs/syscalls/object_signal.md
index d7f813b..af54080 100644
--- a/docs/syscalls/object_signal.md
+++ b/docs/syscalls/object_signal.md
@@ -1,4 +1,4 @@
-# mx_object_signal, mx_object_signal_peer
+# zx_object_signal, zx_object_signal_peer
 
 ## NAME
 
@@ -10,26 +10,26 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_object_signal(mx_handle_t handle, uint32_t clear_mask, uint32_t set_mask);
-mx_status_t mx_object_signal_peer(mx_handle_t handle, uint32_t clear_mask, uint32_t set_mask);
+zx_status_t zx_object_signal(zx_handle_t handle, uint32_t clear_mask, uint32_t set_mask);
+zx_status_t zx_object_signal_peer(zx_handle_t handle, uint32_t clear_mask, uint32_t set_mask);
 
 ```
 
 ## DESCRIPTION
 
-**mx_object_signal**() and **mx_object_signal_peer**() set and clear the userspace-accessible
+**zx_object_signal**() and **zx_object_signal_peer**() set and clear the userspace-accessible
 signal bits on an object or on the object's peer, respectively.  A object peer is the opposite
 endpoint of a *channel*, *socket*, *fifo*, or *eventpair*.
 
 Most of the 32 signals are reserved for system use and are assigned to per-object functions, like
-*MX_CHANNEL_READABLE* or *MX_TASK_TERMINATED*.  8 signals are available for userspace processes
-to use as they see fit: *MX_USER_SIGNAL_0* through *MX_USER_SIGNAL_7*.
+*ZX_CHANNEL_READABLE* or *ZX_TASK_TERMINATED*.  8 signals are available for userspace processes
+to use as they see fit: *ZX_USER_SIGNAL_0* through *ZX_USER_SIGNAL_7*.
 
-*Event* objects also allow control over the *MX_EVENT_SIGNALED* bit.
+*Event* objects also allow control over the *ZX_EVENT_SIGNALED* bit.
 
-*Eventpair* objects also allow control over the *MX_EPAIR_SIGNALED* bit.
+*Eventpair* objects also allow control over the *ZX_EPAIR_SIGNALED* bit.
 
 The *clear_mask* is first used to clear any bits indicated, and then the *set_mask*
 is used to set any bits indicated.
@@ -37,26 +37,26 @@
 
 ## RETURN VALUE
 
-**mx_object_signal**() and **mx_object_signal_peer**() return **MX_OK** on success.
+**zx_object_signal**() and **zx_object_signal_peer**() return **ZX_OK** on success.
 In the event of failure, a negative error value is returned.
 
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* lacks the right **MX_RIGHT_SIGNAL** (for **mx_object_signal**()) or
-**MX_RIGHT_SIGNAL_PEER** (for **mx_object_signal_peer**()).
+**ZX_ERR_ACCESS_DENIED**  *handle* lacks the right **ZX_RIGHT_SIGNAL** (for **zx_object_signal**()) or
+**ZX_RIGHT_SIGNAL_PEER** (for **zx_object_signal_peer**()).
 
-**MX_ERR_INVALID_ARGS**  *clear_mask* or *set_mask* contain bits that are not allowed.
+**ZX_ERR_INVALID_ARGS**  *clear_mask* or *set_mask* contain bits that are not allowed.
 
-**MX_ERR_NOT_SUPPORTED**  **mx_object_signal_peer**() used on an object lacking a peer.
+**ZX_ERR_NOT_SUPPORTED**  **zx_object_signal_peer**() used on an object lacking a peer.
 
-**MX_ERR_PEER_CLOSED**  **mx_object_signal_peer**() called on an object with a closed peer.
+**ZX_ERR_PEER_CLOSED**  **zx_object_signal_peer**() called on an object with a closed peer.
 
 ## NOTE
 
-*MX_RIGHT_WRITE* is used to gate access to signal bits.  This will likely change.
+*ZX_RIGHT_WRITE* is used to gate access to signal bits.  This will likely change.
 
 
 ## SEE ALSO
diff --git a/docs/syscalls/object_wait_async.md b/docs/syscalls/object_wait_async.md
index b750211..ea549c1 100644
--- a/docs/syscalls/object_wait_async.md
+++ b/docs/syscalls/object_wait_async.md
@@ -1,4 +1,4 @@
-# mx_object_wait_async
+# zx_object_wait_async
 
 ## NAME
 
@@ -7,12 +7,12 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_object_wait_async(mx_handle_t handle,
-                                 mx_handle_t port,
+zx_status_t zx_object_wait_async(zx_handle_t handle,
+                                 zx_handle_t port,
                                  uint64_t key,
-                                 mx_signals_t signals,
+                                 zx_signals_t signals,
                                  uint32_t options);
 ```
 
@@ -24,17 +24,17 @@
 
 *handle* points to the object that is to be watched for changes and must be a waitable object.
 
-The *options* argument can be either **MX_WAIT_ASYNC_ONCE** or **MX_WAIT_ASYNC_REPEATING**.
+The *options* argument can be either **ZX_WAIT_ASYNC_ONCE** or **ZX_WAIT_ASYNC_REPEATING**.
 
 In both cases, *signals* indicates which signals on the object specified by *handle*
 will cause a packet to be enqueued, and if **any** of those signals are active when
 **object_wait_async**() is called, or become asserted afterwards, a packet will be
 enqueued on *port*.
 
-In the case of **MX_WAIT_ASYNC_ONCE**, once a packet has been enqueued the asynchronous
+In the case of **ZX_WAIT_ASYNC_ONCE**, once a packet has been enqueued the asynchronous
 waiting ends.  No further packets will be enqueued.
 
-In the case of **MX_WAIT_ASYNC_REPEATING** the asynchronous waiting continues until
+In the case of **ZX_WAIT_ASYNC_REPEATING** the asynchronous waiting continues until
 canceled.  If any of *signals* are asserted and a packet is not currently in *port*'s
 queue on behalf of this wait, a packet is enqueued.  If a packet is already in the
 queue, the packet's *observed* field is updated.  This mode acts in an edge-triggered
@@ -51,22 +51,22 @@
 
 ## RETURN VALUE
 
-**object_wait_async**() returns **MX_OK** if the subscription succeeded.
+**object_wait_async**() returns **ZX_OK** if the subscription succeeded.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *options* is not **MX_WAIT_ASYNC_ONCE** or **MX_WAIT_ASYNC_REPEATING**.
+**ZX_ERR_INVALID_ARGS**  *options* is not **ZX_WAIT_ASYNC_ONCE** or **ZX_WAIT_ASYNC_REPEATING**.
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle or *port* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle or *port* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *port* is not a Port handle.
+**ZX_ERR_WRONG_TYPE**  *port* is not a Port handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_READ** or *port*
-does not have **MX_RIGHT_WRITE**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_READ** or *port*
+does not have **ZX_RIGHT_WRITE**.
 
-**MX_ERR_NOT_SUPPORTED**  *handle* is a handle that cannot be waited on.
+**ZX_ERR_NOT_SUPPORTED**  *handle* is a handle that cannot be waited on.
 
-**MX_ERR_NO_MEMORY**  Temporary out of memory condition.
+**ZX_ERR_NO_MEMORY**  Temporary out of memory condition.
 
 ## NOTES
 
diff --git a/docs/syscalls/object_wait_many.md b/docs/syscalls/object_wait_many.md
index 0545654..19099cd 100644
--- a/docs/syscalls/object_wait_many.md
+++ b/docs/syscalls/object_wait_many.md
@@ -1,4 +1,4 @@
-# mx_object_wait_many
+# zx_object_wait_many
 
 ## NAME
 
@@ -7,15 +7,15 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_object_wait_many(mx_wait_item_t* items, uint32_t count, mx_time_t deadline);
+zx_status_t zx_object_wait_many(zx_wait_item_t* items, uint32_t count, zx_time_t deadline);
 
 typedef struct {
-    mx_handle_t handle;
-    mx_signals_t waitfor;
-    mx_signals_t pending;
-} mx_wait_item_t;
+    zx_handle_t handle;
+    zx_signals_t waitfor;
+    zx_signals_t pending;
+} zx_wait_item_t;
 ```
 
 ## DESCRIPTION
@@ -24,49 +24,49 @@
 wait until at least one of the specified signals is pending on one of
 the specified *items* or *deadline* passes.
 
-The caller must provide *count* mx_wait_item_ts in the *items* array,
+The caller must provide *count* zx_wait_item_ts in the *items* array,
 containing the handle and signals bitmask to wait for for each item.
 
 The *deadline* parameter specifies a deadline with respect to
-**MX_CLOCK_MONOTONIC**.  **MX_TIME_INFINITE** is a special value meaning wait forever.
+**ZX_CLOCK_MONOTONIC**.  **ZX_TIME_INFINITE** is a special value meaning wait forever.
 
 Upon return, the *pending* field of *items* is filled with bitmaps indicating
 which signals are pending for each item.
 
 The *pending* signals in *items* may not reflect the actual state of the object's
 signals if the state of the object was modified by another thread or
-process.  (For example, a Channel ceases asserting **MX_CHANNEL_READABLE**
+process.  (For example, a Channel ceases asserting **ZX_CHANNEL_READABLE**
 once the last message in its queue is read).
 
 ## RETURN VALUE
 
-**object_wait_many**() returns **MX_OK** if any of *waitfor* signals were
+**object_wait_many**() returns **ZX_OK** if any of *waitfor* signals were
 observed on their respective object before *deadline* passed.
 
-In the event of **MX_ERR_TIMED_OUT**, *items* may reflect state changes
+In the event of **ZX_ERR_TIMED_OUT**, *items* may reflect state changes
 that occurred after the deadline pased, but before the syscall returned.
 
 For any other return value, the *pending* fields of *items* are undefined.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *items* isn't a valid pointer or if *count* is too large.
+**ZX_ERR_INVALID_ARGS**  *items* isn't a valid pointer or if *count* is too large.
 
-**MX_ERR_BAD_HANDLE**  one of *items* contains an invalid handle.
+**ZX_ERR_BAD_HANDLE**  one of *items* contains an invalid handle.
 
-**MX_ERR_ACCESS_DENIED**  One or more of the provided *handles* does not
-have **MX_RIGHT_READ** and may not be waited upon.
+**ZX_ERR_ACCESS_DENIED**  One or more of the provided *handles* does not
+have **ZX_RIGHT_READ** and may not be waited upon.
 
-**MX_ERR_CANCELED**  One or more of the provided *handles* was invalidated
+**ZX_ERR_CANCELED**  One or more of the provided *handles* was invalidated
 (e.g., closed) during the wait.
 
-**MX_ERR_TIMED_OUT**  The specified deadline passed before any of the specified signals are
+**ZX_ERR_TIMED_OUT**  The specified deadline passed before any of the specified signals are
 observed on any of the specified handles.
 
-**MX_ERR_NOT_SUPPORTED**  One of the *items* contains a handle that cannot
+**ZX_ERR_NOT_SUPPORTED**  One of the *items* contains a handle that cannot
 be waited one (for example, a Port handle).
 
-**MX_ERR_NO_MEMORY** (Temporary) failure due to lack of memory.
+**ZX_ERR_NO_MEMORY** (Temporary) failure due to lack of memory.
 
 ## BUGS
 
diff --git a/docs/syscalls/object_wait_one.md b/docs/syscalls/object_wait_one.md
index eca727f..dbcbdda 100644
--- a/docs/syscalls/object_wait_one.md
+++ b/docs/syscalls/object_wait_one.md
@@ -1,4 +1,4 @@
-# mx_object_wait_one
+# zx_object_wait_one
 
 ## NAME
 
@@ -7,12 +7,12 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_object_wait_one(mx_handle_t handle,
-                               mx_signals_t signals,
-                               mx_time deadline,
-                               mx_signals_t* observed);
+zx_status_t zx_object_wait_one(zx_handle_t handle,
+                               zx_signals_t signals,
+                               zx_time deadline,
+                               zx_signals_t* observed);
 ```
 
 ## DESCRIPTION
@@ -26,37 +26,37 @@
 
 The *observed* signals may not reflect the actual state of the object's
 signals if the state of the object was modified by another thread or
-process.  (For example, a Channel ceases asserting **MX_CHANNEL_READABLE**
+process.  (For example, a Channel ceases asserting **ZX_CHANNEL_READABLE**
 once the last message in its queue is read).
 
 The *deadline* parameter specifies a deadline with respect to
-**MX_CLOCK_MONOTONIC**.  **MX_TIME_INFINITE** is a special value meaning wait forever.
+**ZX_CLOCK_MONOTONIC**.  **ZX_TIME_INFINITE** is a special value meaning wait forever.
 
 ## RETURN VALUE
 
-**object_wait_one**() returns **MX_OK** if any of *signals* were observed
+**object_wait_one**() returns **ZX_OK** if any of *signals* were observed
 on the object before *deadline* passes.
 
-In the event of **MX_ERR_TIMED_OUT**, *observed* may reflect state changes
+In the event of **ZX_ERR_TIMED_OUT**, *observed* may reflect state changes
 that occurred after the deadline passed, but before the syscall returned.
 
 For any other return value, *observed* is undefined.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *observed* is an invalid pointer.
+**ZX_ERR_INVALID_ARGS**  *observed* is an invalid pointer.
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_READ** and may
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_READ** and may
 not be waited upon.
 
-**MX_ERR_CANCELED**  *handle* was invalidated (e.g., closed) during the wait.
+**ZX_ERR_CANCELED**  *handle* was invalidated (e.g., closed) during the wait.
 
-**MX_ERR_TIMED_OUT**  The specified deadline passed before any of the specified
+**ZX_ERR_TIMED_OUT**  The specified deadline passed before any of the specified
 *signals* are observed on *handle*.
 
-**MX_ERR_NOT_SUPPORTED**  *handle* is a handle that cannot be waited on
+**ZX_ERR_NOT_SUPPORTED**  *handle* is a handle that cannot be waited on
 (for example, a Port handle).
 
 ## SEE ALSO
diff --git a/docs/syscalls/port_cancel.md b/docs/syscalls/port_cancel.md
index 124c79b..8143568 100644
--- a/docs/syscalls/port_cancel.md
+++ b/docs/syscalls/port_cancel.md
@@ -1,4 +1,4 @@
-# mx_port_cancel
+# zx_port_cancel
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_port_cancel(mx_handle_t port,
-                           mx_handle_t source,
+zx_status_t zx_port_cancel(zx_handle_t port,
+                           zx_handle_t source,
                            uint64_t key);
 ```
 
@@ -25,21 +25,21 @@
 
 ## RETURN VALUE
 
-**mx_port_cancel**() returns **MX_OK** if cancellation succeeded and
+**zx_port_cancel**() returns **ZX_OK** if cancellation succeeded and
 either queued packets were removed or pending **object_wait_async**() were
 canceled.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* or *port* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* or *port* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *port* is not a port handle.
+**ZX_ERR_WRONG_TYPE**  *port* is not a port handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* or *port* does not have **MX_RIGHT_WRITE**.
+**ZX_ERR_ACCESS_DENIED**  *handle* or *port* does not have **ZX_RIGHT_WRITE**.
 
-**MX_ERR_NOT_SUPPORTED**  *handle* is a handle that cannot be waited on.
+**ZX_ERR_NOT_SUPPORTED**  *handle* is a handle that cannot be waited on.
 
-**MX_ERR_NOT_FOUND** if either no pending packets or pending
+**ZX_ERR_NOT_FOUND** if either no pending packets or pending
 **object_wait_async** calls with *source* and *key* were found.
 
 ## SEE ALSO
diff --git a/docs/syscalls/port_create.md b/docs/syscalls/port_create.md
index c6ca6ec..33fbc2b 100644
--- a/docs/syscalls/port_create.md
+++ b/docs/syscalls/port_create.md
@@ -1,4 +1,4 @@
-# mx_port_create
+# zx_port_create
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_port_create(uint32_t options, mx_handle_t* out);
+zx_status_t zx_port_create(uint32_t options, zx_handle_t* out);
 
 ```
 
@@ -20,22 +20,22 @@
 
 *options* must be **0**.
 
-The returned handle will have MX_RIGHT_TRANSFER (allowing them to be sent
-to another process via channel write), MX_RIGHT_WRITE (allowing
-packets to be queued), MX_RIGHT_READ (allowing packets to be read) and
-MX_RIGHT_DUPLICATE (allowing them to be duplicated).
+The returned handle will have ZX_RIGHT_TRANSFER (allowing them to be sent
+to another process via channel write), ZX_RIGHT_WRITE (allowing
+packets to be queued), ZX_RIGHT_READ (allowing packets to be read) and
+ZX_RIGHT_DUPLICATE (allowing them to be duplicated).
 
 ## RETURN VALUE
 
-**port_create**() returns MX_OK and a valid IO port handle via *out* on
+**port_create**() returns ZX_OK and a valid IO port handle via *out* on
 success. In the event of failure, an error value is returned.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS** *options* has an invalid value, or *out* is an
+**ZX_ERR_INVALID_ARGS** *options* has an invalid value, or *out* is an
 invalid pointer or NULL.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/port_queue.md b/docs/syscalls/port_queue.md
index 00b739d..4500f77 100644
--- a/docs/syscalls/port_queue.md
+++ b/docs/syscalls/port_queue.md
@@ -1,4 +1,4 @@
-# mx_port_queue
+# zx_port_queue
 
 ## NAME
 
@@ -7,58 +7,58 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 
-mx_status_t mx_port_queue(mx_handle_t handle, const void* packet, size_t size);
+zx_status_t zx_port_queue(zx_handle_t handle, const void* packet, size_t size);
 
 ```
 
 ## DESCRIPTION
 
 **port_queue**() queues a *packet* to the port specified
-by *handle*. The *packet* must be of type **mx_port_packet** and
+by *handle*. The *packet* must be of type **zx_port_packet** and
 *size* should be set to zero.
 
 ```
-typedef struct mx_port_packet {
+typedef struct zx_port_packet {
     uint64_t key;
     uint32_t type;
     int32_t status;
     union {
-        mx_packet_user_t user;
-        mx_packet_signal_t signal;
+        zx_packet_user_t user;
+        zx_packet_signal_t signal;
     };
-} mx_port_packet_t;
+} zx_port_packet_t;
 
 ```
 
-In **mx** *type* should be MX_PKT_TYPE_USER and only the **user**
+In **zx** *type* should be ZX_PKT_TYPE_USER and only the **user**
 union element is considered valid:
 
 ```
-typedef union mx_packet_user {
+typedef union zx_packet_user {
     uint64_t u64[4];
     uint32_t u32[8];
     uint16_t u16[16];
     uint8_t   c8[32];
-} mx_packet_user_t;
+} zx_packet_user_t;
 
 ```
 
 ## RETURN VALUE
 
-**port_queue**() returns **MX_OK** on successful queue of a packet.
+**port_queue**() returns **ZX_OK** on successful queue of a packet.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *handle* isn't a valid port handle, or
+**ZX_ERR_INVALID_ARGS**  *handle* isn't a valid port handle, or
 *packet* is an invalid pointer.
 
-**MX_ERR_WRONG_TYPE** *size* is not zero or *handle* is not a port
+**ZX_ERR_WRONG_TYPE** *size* is not zero or *handle* is not a port
 handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_WRITE**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_WRITE**.
 
 ## NOTES
 
diff --git a/docs/syscalls/port_wait.md b/docs/syscalls/port_wait.md
index f8cbe92..6ac751d 100644
--- a/docs/syscalls/port_wait.md
+++ b/docs/syscalls/port_wait.md
@@ -1,4 +1,4 @@
-# mx_port_wait
+# zx_port_wait
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 
-mx_status_t mx_port_wait(mx_handle_t handle, mx_time_t deadline, void* packet, size_t size);
+zx_status_t zx_port_wait(zx_handle_t handle, zx_time_t deadline, void* packet, size_t size);
 ```
 
 ## DESCRIPTION
@@ -22,62 +22,62 @@
 available packet data.
 
 The **size** argument should be set to zero and the **packet** argument should be memory of at
-least ```sizeof(mx_port_packet_t)``` bytes.
+least ```sizeof(zx_port_packet_t)``` bytes.
 
 The *deadline* indicates when to stop waiting for a packet (with respect to
-**MX_CLOCK_MONOTONIC**).  If no packet has arrived by the deadline,
-**MX_ERR_TIMED_OUT** is returned.  The value **MX_TIME_INFINITE** will
+**ZX_CLOCK_MONOTONIC**).  If no packet has arrived by the deadline,
+**ZX_ERR_TIMED_OUT** is returned.  The value **ZX_TIME_INFINITE** will
 result in waiting forever.  A value in the past will result in an immediate
 timeout, unless a packet is already available for reading.
 
-Unlike **mx_object_wait_one**() and **mx_object_wait_many**() only one
+Unlike **zx_object_wait_one**() and **zx_object_wait_many**() only one
 waiting thread is released (per available packet) which makes ports
 amenable to be serviced by thread pools.
 
 There are two sources of packets: manually queued packets with **port_queue**() and packets
 generated by kernel when objects registered with **object_wait_async**() change state. In both
-cases the packet is always of type **mx_port_packet_t**:
+cases the packet is always of type **zx_port_packet_t**:
 
 ```
-struct mx_port_packet_t {
+struct zx_port_packet_t {
     uint64_t key;
     uint32_t type;
     int32_t status;
     union {
-        mx_packet_user_t user;
-        mx_packet_signal_t signal;
-        mx_packet_exception_t exception;
+        zx_packet_user_t user;
+        zx_packet_signal_t signal;
+        zx_packet_exception_t exception;
     };
 };
 ```
 
 In the case of packets generated via **port_queue**() *key* is the key in the
-input packet, *type* is set to **MX_PKT_TYPE_USER** and the union is of type **mx_packet_user_t**.
+input packet, *type* is set to **ZX_PKT_TYPE_USER** and the union is of type **zx_packet_user_t**.
 
 ```
-typedef union mx_packet_user {
+typedef union zx_packet_user {
     uint64_t u64[4];
     uint32_t u32[8];
     uint16_t u16[16];
     uint8_t   c8[32];
-} mx_packet_user_t;
+} zx_packet_user_t;
 ```
 
 The caller of **port_queue**() controls all the values in the structure.
 
 In the case of packets generated via **object_wait_async**() *key* is the key passed to the
-syscall, *type* is set to either **MX_PKT_TYPE_SIGNAL_ONE** or **MX_PKT_TYPE_SIGNAL_REP**
-and the union is of type **mx_packet_signal_t**:
+syscall, *type* is set to either **ZX_PKT_TYPE_SIGNAL_ONE** or **ZX_PKT_TYPE_SIGNAL_REP**
+and the union is of type **zx_packet_signal_t**:
 
 ```
-typedef struct mx_packet_signal {
-    mx_signals_t trigger;
-    mx_signals_t observed;
+typedef struct zx_packet_signal {
+    zx_signals_t trigger;
+    zx_signals_t observed;
     uint64_t count;
-} mx_packet_signal_t;
+} zx_packet_signal_t;
 ```
 
-for **MX_WAIT_ASYNC_ONCE** and **MX_WAIT_ASYNC_REPEATING**: *trigger* is the signals
+for **ZX_WAIT_ASYNC_ONCE** and **ZX_WAIT_ASYNC_REPEATING**: *trigger* is the signals
 used in the call to **object_wait_async**() and *count* is a per object defined count
 of pending operations. Use *key* to track what object this packet corresponds to and
 therefore match *count* with the operation.
@@ -86,19 +86,19 @@
 
 ## RETURN VALUE
 
-**port_wait**() returns **MX_OK** on successful packet dequeuing.
+**port_wait**() returns **ZX_OK** on successful packet dequeuing.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE** *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE** *handle* is not a valid handle.
 
-**MX_ERR_INVALID_ARGS** *handle* isn't a valid handle or *packet* isn't a valid
+**ZX_ERR_INVALID_ARGS** *handle* isn't a valid handle or *packet* isn't a valid
 pointer or *size* is an invalid packet size.
 
-**MX_ERR_ACCESS_DENIED** *handle* does not have **MX_RIGHT_WRITE** and may
+**ZX_ERR_ACCESS_DENIED** *handle* does not have **ZX_RIGHT_WRITE** and may
 not be waited upon.
 
-**MX_ERR_TIMED_OUT** *deadline* passed and no packet was available.
+**ZX_ERR_TIMED_OUT** *deadline* passed and no packet was available.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/process_create.md b/docs/syscalls/process_create.md
index 86168b8..7550698 100644
--- a/docs/syscalls/process_create.md
+++ b/docs/syscalls/process_create.md
@@ -1,4 +1,4 @@
-# mx_process_create
+# zx_process_create
 
 ## NAME
 
@@ -7,12 +7,12 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_process_create(mx_handle_t job,
+zx_status_t zx_process_create(zx_handle_t job,
                               const char* name, uint32_t name_len,
                               uint32_t options,
-                              mx_handle_t* proc_handle, mx_handle_t* vmar_handle);
+                              zx_handle_t* proc_handle, zx_handle_t* vmar_handle);
 
 ```
 
@@ -24,38 +24,38 @@
 are returned.  The thread will not start executing until *process_start()* is
 called.
 
-*name* is silently truncated to a maximum of *MX_MAX_NAME_LEN-1* characters.
+*name* is silently truncated to a maximum of *ZX_MAX_NAME_LEN-1* characters.
 
 When the last handle to a process is closed, the process is destroyed.
 
 Process handles may be waited on and will assert the signal
-*MX_PROCESS_TERMINATED* when the process exits.
+*ZX_PROCESS_TERMINATED* when the process exits.
 
 *job* is the controlling [job object](../objects/job.md) for the new
 process, which will become a child of that job.
 
 ## RETURN VALUE
 
-On success, **process_create**() returns **MX_OK**, a handle to the new process
+On success, **process_create**() returns **ZX_OK**, a handle to the new process
 (via *proc_handle*), and a handle to the root of its address space (via
 *vmar_handle*).  In the event of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *job* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *job* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *job* is not a job handle.
+**ZX_ERR_WRONG_TYPE**  *job* is not a job handle.
 
-**MX_ERR_ACCESS_DENIED**  *job* does not have the **MX_RIGHT_WRITE** right
-(only when not **MX_HANDLE_INVALID**).
+**ZX_ERR_ACCESS_DENIED**  *job* does not have the **ZX_RIGHT_WRITE** right
+(only when not **ZX_HANDLE_INVALID**).
 
-**MX_ERR_INVALID_ARGS**  *name*, *proc_handle*, or *vmar_handle*  was an invalid pointer,
+**ZX_ERR_INVALID_ARGS**  *name*, *proc_handle*, or *vmar_handle*  was an invalid pointer,
 or *options* was non-zero.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
-**MX_ERR_BAD_STATE**  (Temporary) Failure due to the job object being in the
-middle of a *mx_task_kill()* operation.
+**ZX_ERR_BAD_STATE**  (Temporary) Failure due to the job object being in the
+middle of a *zx_task_kill()* operation.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/process_exit.md b/docs/syscalls/process_exit.md
index 4ee36c3..8e202bf 100644
--- a/docs/syscalls/process_exit.md
+++ b/docs/syscalls/process_exit.md
@@ -1,4 +1,4 @@
-# mx_process_exit
+# zx_process_exit
 
 ## NAME
 
@@ -7,25 +7,25 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-void mx_process_exit(int ret_code);
+void zx_process_exit(int ret_code);
 
 ```
 
 ## DESCRIPTION
 
-The **mx_process_exit** call ends the calling process with the given
+The **zx_process_exit** call ends the calling process with the given
 return code. The return code of a process can be queried via the
-**MX_INFO_PROCESS** request to **mx_object_get_info**.
+**ZX_INFO_PROCESS** request to **zx_object_get_info**.
 
 ## RETURN VALUE
 
-**mx_process_exit** does not return.
+**zx_process_exit** does not return.
 
 ## ERRORS
 
-**mx_process_exit** cannot fail.
+**zx_process_exit** cannot fail.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/process_read_memory.md b/docs/syscalls/process_read_memory.md
index 7c02b79..d8488bf 100644
--- a/docs/syscalls/process_read_memory.md
+++ b/docs/syscalls/process_read_memory.md
@@ -1,4 +1,4 @@
-# mx_process_read_memory
+# zx_process_read_memory
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_process_read_memory(mx_handle_t proc, uintptr_t vaddr,
+zx_status_t zx_process_read_memory(zx_handle_t proc, uintptr_t vaddr,
                                    void* buffer, size_t len,
                                    size_t* actual);
 
diff --git a/docs/syscalls/process_start.md b/docs/syscalls/process_start.md
index 0b61ec0..2e0ab03 100644
--- a/docs/syscalls/process_start.md
+++ b/docs/syscalls/process_start.md
@@ -1,4 +1,4 @@
-# mx_process_start
+# zx_process_start
 
 ## NAME
 
@@ -7,11 +7,11 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_process_start(mx_handle_t process, mx_handle_t thread,
+zx_status_t zx_process_start(zx_handle_t process, zx_handle_t thread,
                             uintptr_t entry, uintptr_t stack,
-                            mx_handle_t arg1, uintptr_t arg2);
+                            zx_handle_t arg1, uintptr_t arg2);
 ```
 
 ## DESCRIPTION
@@ -32,21 +32,21 @@
 
 ## RETURN VALUE
 
-**process_start**() returns MX_OK on success.
+**process_start**() returns ZX_OK on success.
 In the event of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *process* or *thread* or *arg1* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *process* or *thread* or *arg1* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *process* is not a process handle or *thread* is
+**ZX_ERR_WRONG_TYPE**  *process* is not a process handle or *thread* is
 not a thread handle.
 
-**MX_ERR_ACCESS_DENIED**  The handle *thread* lacks *MX_RIGHT_WRITE* or *thread*
-does not belong to *process*, or the handle *process* lacks *MX_RIGHT_WRITE* or
-*arg1* lacks MX_RIGHT_TRANSFER.
+**ZX_ERR_ACCESS_DENIED**  The handle *thread* lacks *ZX_RIGHT_WRITE* or *thread*
+does not belong to *process*, or the handle *process* lacks *ZX_RIGHT_WRITE* or
+*arg1* lacks ZX_RIGHT_TRANSFER.
 
-**MX_ERR_BAD_STATE**  *process* is already running or has exited.
+**ZX_ERR_BAD_STATE**  *process* is already running or has exited.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/process_write_memory.md b/docs/syscalls/process_write_memory.md
index 7bfacaf..549bba8 100644
--- a/docs/syscalls/process_write_memory.md
+++ b/docs/syscalls/process_write_memory.md
@@ -1,4 +1,4 @@
-# mx_process_write_memory
+# zx_process_write_memory
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_process_write_memory(mx_handle_t proc, uintptr_t vaddr,
+zx_status_t zx_process_write_memory(zx_handle_t proc, uintptr_t vaddr,
                                     const void* buffer, size_t len,
                                     size_t* actual);
 
diff --git a/docs/syscalls/socket_create.md b/docs/syscalls/socket_create.md
index da2cf36..20d8dff 100644
--- a/docs/syscalls/socket_create.md
+++ b/docs/syscalls/socket_create.md
@@ -1,4 +1,4 @@
-# mx_socket_create
+# zx_socket_create
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_socket_create(uint32_t options,
-                             mx_handle_t* out0, mx_handle_t* out1);
+zx_status_t zx_socket_create(uint32_t options,
+                             zx_handle_t* out0, zx_handle_t* out1);
 
 ```
 
@@ -22,21 +22,21 @@
 
 Data written to one handle may be read from the opposite.
 
-The *options* must set either the **MX_SOCKET_STREAM** or
-**MX_SOCKET_DATAGRAM** flag. The **MX_SOCKET_HAS_CONTROL** flag
+The *options* must set either the **ZX_SOCKET_STREAM** or
+**ZX_SOCKET_DATAGRAM** flag. The **ZX_SOCKET_HAS_CONTROL** flag
 can also be set to enable the socket control plane.
 
 ## RETURN VALUE
 
-**socket_create**() returns **MX_OK** on success. In the event of
+**socket_create**() returns **ZX_OK** on success. In the event of
 failure, one of the following values is returned.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL or
+**ZX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL or
 *options* is any value other than 0.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 ## LIMITATIONS
 
diff --git a/docs/syscalls/socket_read.md b/docs/syscalls/socket_read.md
index c91891f..d55bc66 100644
--- a/docs/syscalls/socket_read.md
+++ b/docs/syscalls/socket_read.md
@@ -1,4 +1,4 @@
-# mx_socket_read
+# zx_socket_read
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_socket_read(mx_handle_t handle, uint32_t options,
+zx_status_t zx_socket_read(zx_handle_t handle, uint32_t options,
                            void* buffer, size_t size,
                            size_t* actual) {
 ```
@@ -26,41 +26,41 @@
 
 If a NULL *actual* is passed in, it will be ignored.
 
-If the socket was created with **MX_SOCKET_DATAGRAM** and *buffer*
+If the socket was created with **ZX_SOCKET_DATAGRAM** and *buffer*
 is too small for the packet, then the packet will be truncated,
 and any remaining bytes in the packet are discarded.
 
-If *options* is set to **MX_SOCKET_CONTROL**, then **socket_read**()
+If *options* is set to **ZX_SOCKET_CONTROL**, then **socket_read**()
 attempts to read from the socket control plane.
 
 ## RETURN VALUE
 
-**socket_read**() returns **MX_OK** on success, and writes into
+**socket_read**() returns **ZX_OK** on success, and writes into
 *actual* (if non-NULL) the exact number of bytes read.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_BAD_STATE** *options* includes **MX_SOCKET_CONTROL** and the
-socket was not created with **MX_SOCKET_HAS_CONTROL**.
+**ZX_ERR_BAD_STATE** *options* includes **ZX_SOCKET_CONTROL** and the
+socket was not created with **ZX_SOCKET_HAS_CONTROL**.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a socket handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a socket handle.
 
-**MX_ERR_INVALID_ARGS** If any of *buffer* or *actual* are non-NULL
+**ZX_ERR_INVALID_ARGS** If any of *buffer* or *actual* are non-NULL
 but invalid pointers, or if *buffer* is NULL but *size* is positive,
-or if *options* is not either zero or **MX_SOCKET_CONTROL*.
+or if *options* is not either zero or **ZX_SOCKET_CONTROL*.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_READ**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_READ**.
 
-**MX_ERR_SHOULD_WAIT**  The socket contained no data to read.
+**ZX_ERR_SHOULD_WAIT**  The socket contained no data to read.
 
-**MX_ERR_PEER_CLOSED**  The other side of the socket is closed and no data is
+**ZX_ERR_PEER_CLOSED**  The other side of the socket is closed and no data is
 readable.
 
-**MX_ERR_BAD_STATE**  Reading has been disabled for this socket endpoint.
+**ZX_ERR_BAD_STATE**  Reading has been disabled for this socket endpoint.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/socket_write.md b/docs/syscalls/socket_write.md
index bcfff26..7b72565 100644
--- a/docs/syscalls/socket_write.md
+++ b/docs/syscalls/socket_write.md
@@ -1,4 +1,4 @@
-# mx_socket_write
+# zx_socket_write
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_socket_write(mx_handle_t handle, uint32_t options,
+zx_status_t zx_socket_write(zx_handle_t handle, uint32_t options,
                             const void* buffer, size_t size,
                             size_t* actual) {
 ```
@@ -20,62 +20,62 @@
 specified by *handle*.  The pointer to *bytes* may be NULL if *size*
 is zero.
 
-If *size* is zero, a bitwise combination of **MX_SOCKET_SHUTDOWN_READ** and
-**MX_SOCKET_SHUTDOWN_WRITE** can be passed to *options* to disable reading or
+If *size* is zero, a bitwise combination of **ZX_SOCKET_SHUTDOWN_READ** and
+**ZX_SOCKET_SHUTDOWN_WRITE** can be passed to *options* to disable reading or
 writing from a socket endpoint.
 
-If **MX_SOCKET_SHUTDOWN_READ** is passed to *options*, and *size* is 0, then reading is disabled for
+If **ZX_SOCKET_SHUTDOWN_READ** is passed to *options*, and *size* is 0, then reading is disabled for
 the socket endpoint at *handle*. All data buffered in the socket at the time of the call may be
 read, but further reads from this endpoint or writes to the other endpoint of the socket will fail
-with **MX_ERR_BAD_STATE**.
+with **ZX_ERR_BAD_STATE**.
 
-If **MX_SOCKET_SHUTDOWN_WRITE** is passed to *options*, and *size* is 0, then writing is disabled for
+If **ZX_SOCKET_SHUTDOWN_WRITE** is passed to *options*, and *size* is 0, then writing is disabled for
 the socket endpoint at *handle*. Further writes to this endpoint or reads from the other endpoint of
-the socket will fail with **MX_ERR_BAD_STATE**.
+the socket will fail with **ZX_ERR_BAD_STATE**.
 
-If **MX_SOCKET_CONTROL** is passed to *options*, then **socket_write**() attempts to write
+If **ZX_SOCKET_CONTROL** is passed to *options*, then **socket_write**() attempts to write
 into the socket control plane. A write to the control plane is never short. If the socket
 control plane has insufficient space for *buffer*, it writes nothing and returns
-**MX_ERR_OUT_OF_RANGE**.
+**ZX_ERR_OUT_OF_RANGE**.
 
 If a NULL *actual* is passed in, it will be ignored.
 
-A **MX_SOCKET_STREAM** socket write can be short if the socket does not
+A **ZX_SOCKET_STREAM** socket write can be short if the socket does not
 have enough space for all of *buffer*. The amount written is returned
 via *actual*.
 
-A **MX_SOCKET_DATAGRAM** socket write is never short. If the socket has
+A **ZX_SOCKET_DATAGRAM** socket write is never short. If the socket has
 insufficient space for *buffer*, it writes nothing and returns
-**MX_ERR_SHOULD_WAIT**.
+**ZX_ERR_SHOULD_WAIT**.
 
 ## RETURN VALUE
 
-**socket_write**() returns **MX_OK** on success.
+**socket_write**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_BAD_STATE** *options* includes **MX_SOCKET_CONTROL** and the
-socket was not created with **MX_SOCKET_HAS_CONTROL**.
+**ZX_ERR_BAD_STATE** *options* includes **ZX_SOCKET_CONTROL** and the
+socket was not created with **ZX_SOCKET_HAS_CONTROL**.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a socket handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a socket handle.
 
-**MX_ERR_INVALID_ARGS**  *buffer* is an invalid pointer, or
-**MX_SOCKET_HALF_CLOSE** was passed to *options* but *size* was
-not 0, or *options* was not 0 or **MX_SOCKET_HALF_CLOSE**.
+**ZX_ERR_INVALID_ARGS**  *buffer* is an invalid pointer, or
+**ZX_SOCKET_HALF_CLOSE** was passed to *options* but *size* was
+not 0, or *options* was not 0 or **ZX_SOCKET_HALF_CLOSE**.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_WRITE**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_WRITE**.
 
-**MX_ERR_SHOULD_WAIT**  The buffer underlying the socket is full, or
-the socket was created with **MX_SOCKET_DATAGRAM** and *buffer* is
+**ZX_ERR_SHOULD_WAIT**  The buffer underlying the socket is full, or
+the socket was created with **ZX_SOCKET_DATAGRAM** and *buffer* is
 larger than the remaining space in the socket.
 
-**MX_ERR_BAD_STATE**  Writing has been disabled for this socket endpoint.
+**ZX_ERR_BAD_STATE**  Writing has been disabled for this socket endpoint.
 
-**MX_ERR_PEER_CLOSED**  The other side of the socket is closed.
+**ZX_ERR_PEER_CLOSED**  The other side of the socket is closed.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/system_get_num_cpus.md b/docs/syscalls/system_get_num_cpus.md
index c8e81f6..09bad1a 100644
--- a/docs/syscalls/system_get_num_cpus.md
+++ b/docs/syscalls/system_get_num_cpus.md
@@ -1,4 +1,4 @@
-# mx_system_num_cpus
+# zx_system_num_cpus
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-uint32_t mx_system_get_num_cpus(void);
+uint32_t zx_system_get_num_cpus(void);
 ```
 
 ## DESCRIPTION
diff --git a/docs/syscalls/system_get_physmem.md b/docs/syscalls/system_get_physmem.md
index febeb48..93b43e1 100644
--- a/docs/syscalls/system_get_physmem.md
+++ b/docs/syscalls/system_get_physmem.md
@@ -1,4 +1,4 @@
-# mx_system_get_physmem
+# zx_system_get_physmem
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-size_t mx_system_get_physmem(void);
+size_t zx_system_get_physmem(void);
 ```
 
 ## DESCRIPTION
diff --git a/docs/syscalls/system_get_version.md b/docs/syscalls/system_get_version.md
index 5e3e33e..dfe8325 100644
--- a/docs/syscalls/system_get_version.md
+++ b/docs/syscalls/system_get_version.md
@@ -1,4 +1,4 @@
-# mx_system_get_version
+# zx_system_get_version
 
 ## NAME
 
@@ -7,26 +7,26 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_system_get_version(char version[], uint32_t version_len);
+zx_status_t zx_system_get_version(char version[], uint32_t version_len);
 ```
 
 ## DESCRIPTION
 
 **system_get_version**() fills in the given character array with a string
-identifying the version of the Magenta system currently running.
+identifying the version of the Zircon system currently running.
 The provided length must be large enough for the complete string
 including its null terminator.
 
 
 ## RETURN VALUE
 
-**system_get_version**() returns **MX_OK** on success.
+**system_get_version**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_BUFFER_TOO_SMALL**  *version_len* is too short.
+**ZX_ERR_BUFFER_TOO_SMALL**  *version_len* is too short.
 
 ## NOTES
 
diff --git a/docs/syscalls/system_mexec.md b/docs/syscalls/system_mexec.md
index 8649ceb..6fcd367 100644
--- a/docs/syscalls/system_mexec.md
+++ b/docs/syscalls/system_mexec.md
@@ -1,25 +1,25 @@
-# mx_system_mexec
+# zx_system_mexec
 
 ## NAME
 
-mx_system_mexec - Soft reboot the system with a new kernel and bootimage
+zx_system_mexec - Soft reboot the system with a new kernel and bootimage
 
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_system_mexec(mx_handle_t kernel_vmo,
-                            mx_handle_t bootimage_vmo);
+zx_status_t zx_system_mexec(zx_handle_t kernel_vmo,
+                            zx_handle_t bootimage_vmo);
 ```
 
 ## DESCRIPTION
 
-**mx_system_mexec**() accepts two vmo handles: *kernel_vmo* should contain a
+**zx_system_mexec**() accepts two vmo handles: *kernel_vmo* should contain a
 kernel image and *bootimage_vmo* should contain an initrd whose address shall
 be passed to the new kernel as a kernel argument.
 
-Upon success, *mx_system_mexec* shall supplant the currently running kernel
+Upon success, *zx_system_mexec* shall supplant the currently running kernel
 image with the kernel image contained within *kernel_vmo*, load the ramdisk
 contained within *bootimage_vmo* to a location in physical memory and branch
 directly into the new kernel while providing the address of the loaded initrd
@@ -27,7 +27,7 @@
 
 ## RETURN VALUE
 
-**mx_system_mexec**() shall not return upon success.
+**zx_system_mexec**() shall not return upon success.
 
 ## BUGS
 
diff --git a/docs/syscalls/task_bind_exception_port.md b/docs/syscalls/task_bind_exception_port.md
index d29ea97..75add2e 100644
--- a/docs/syscalls/task_bind_exception_port.md
+++ b/docs/syscalls/task_bind_exception_port.md
@@ -1,4 +1,4 @@
-# mx_task_bind_exception_port
+# zx_task_bind_exception_port
 
 ## NAME
 
@@ -8,9 +8,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_task_bind_exception_port(mx_handle_t object, mx_handle_t eport,
+zx_status_t zx_task_bind_exception_port(zx_handle_t object, zx_handle_t eport,
                                           uint64_t key, uint32_t options);
 ```
 
@@ -19,9 +19,9 @@
 **task_bind_exception_port**() is used to bind (or unbind) a port to
 the exception port of a job, process, thread, or the system exception port.
 
-To bind to the system exception port pass **MX_HANDLE_INVALID** for *object*.
+To bind to the system exception port pass **ZX_HANDLE_INVALID** for *object*.
 
-*eport* is an IO port created by [mx_port_create](port_create.md). The same
+*eport* is an IO port created by [zx_port_create](port_create.md). The same
 IO port can be bound to multiple objects.
 
 *key* is passed back in exception reports, and is part of the port
@@ -32,11 +32,11 @@
 
 ### Unbinding
 
-To unbind from an exception port pass **MX_HANDLE_INVALID** for *eport*.
+To unbind from an exception port pass **ZX_HANDLE_INVALID** for *eport*.
 This will remove the exception port from *object* and *eport* will no
 longer participate in exception processing for *object*.
 
-To unbind from the system exception port pass **MX_HANDLE_INVALID** for
+To unbind from the system exception port pass **ZX_HANDLE_INVALID** for
 *object*.
 
 The exception port will unbind automatically if all handles to *eport*
@@ -51,7 +51,7 @@
 
 - Have the thread continue to wait for a response from the same kind
 of exception port as *eport*. This is done by passing
-*MX_EXCEPTION_PORT_UNBIND_QUIETLY* in *options* when unbinding *eport*.
+*ZX_EXCEPTION_PORT_UNBIND_QUIETLY* in *options* when unbinding *eport*.
 This option is useful, for example, when a debugger wants to detach from the
 thread's process, but leave the thread in stasis waiting for an exception
 response.
@@ -75,7 +75,7 @@
 
 Exception reports are messages sent through the port with a specific format
 defined by the port message protocol. The packet contents are defined by
-the *mx_exception_packet_t* type defined in magenta/syscalls/port.h.
+the *zx_exception_packet_t* type defined in zircon/syscalls/port.h.
 
 ### Exception search order
 
@@ -83,7 +83,7 @@
 
 - Debugger - The debugger exception port is associated with processes, and
 is for things like gdb. To bind to the debugger exception port
-pass *MX_EXCEPTION_PORT_DEBUGGER* in *options* when binding an
+pass *ZX_EXCEPTION_PORT_DEBUGGER* in *options* when binding an
 exception port to the process.
 There is only one debugger exception port per process.
 
@@ -96,7 +96,7 @@
 - Job - This is for exception ports bound to the process's job. Note that jobs
 have a hierarchy. First the process's job is searched. If it has a bound
 exception port then the exception is delivered to that port. If it does not
-have a bound exception port, or if the handler returns **MX_RESUME_TRY_NEXT**,
+have a bound exception port, or if the handler returns **ZX_RESUME_TRY_NEXT**,
 then that job's parent job is searched, and so on right up to the root job.
 
 - System - This is the last port searched and gives the system a chance to
@@ -112,29 +112,29 @@
 the NULL pointer) or executing an undefined instruction. Synthetic exceptions
 are things like thread start and stop notifications.
 
-Exception types are enumerated in the *mx_excp_type_t* enum defined
-in magenta/syscalls/exception.h.
+Exception types are enumerated in the *zx_excp_type_t* enum defined
+in zircon/syscalls/exception.h.
 
 ## RETURN VALUE
 
-**task_bind_exception_port**() returns **MX_OK** on success.
+**task_bind_exception_port**() returns **ZX_OK** on success.
 In the event of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE** *object* is not a valid handle,
+**ZX_ERR_BAD_HANDLE** *object* is not a valid handle,
 or *eport* is not a valid handle. Note that when binding/unbinding
-to the system exception port *object* is **MX_HANDLE_INVALID**.
+to the system exception port *object* is **ZX_HANDLE_INVALID**.
 Also note that when unbinding from an exception port *eport* is
-**MX_HANDLE_INVALID**.
+**ZX_HANDLE_INVALID**.
 
-**MX_ERR_WRONG_TYPE**  *object* is not that of a job, process, or thread,
-and is not **MX_HANDLE_INVALID**,
-or *eport* is not that of a port and is not **MX_HANDLE_INVALID**.
+**ZX_ERR_WRONG_TYPE**  *object* is not that of a job, process, or thread,
+and is not **ZX_HANDLE_INVALID**,
+or *eport* is not that of a port and is not **ZX_HANDLE_INVALID**.
 
-**MX_ERR_INVALID_ARGS** A bad value has been passed in *options*.
+**ZX_ERR_INVALID_ARGS** A bad value has been passed in *options*.
 
-**MX_ERR_NO_MEMORY**  (temporary) out of memory failure.
+**ZX_ERR_NO_MEMORY**  (temporary) out of memory failure.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/task_kill.md b/docs/syscalls/task_kill.md
index 38c9c68..a3f5242 100644
--- a/docs/syscalls/task_kill.md
+++ b/docs/syscalls/task_kill.md
@@ -1,4 +1,4 @@
-# mx_task_kill
+# zx_task_kill
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_task_kill(mx_handle_t handle);
+zx_status_t zx_task_kill(zx_handle_t handle);
 
 ```
 
@@ -24,6 +24,6 @@
 
 ## ERRORS
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have **MX_RIGHT_DESTROY**.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have **ZX_RIGHT_DESTROY**.
 
 ## SEE ALSO
diff --git a/docs/syscalls/task_resume.md b/docs/syscalls/task_resume.md
index 54c22ad..93c213f 100644
--- a/docs/syscalls/task_resume.md
+++ b/docs/syscalls/task_resume.md
@@ -1,4 +1,4 @@
-# mx_task_resume
+# zx_task_resume
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_task_resume(mx_handle_t task, uint32_t options);
+zx_status_t zx_task_resume(zx_handle_t task, uint32_t options);
 
 ```
 
@@ -20,7 +20,7 @@
 
 ### RESUMING FROM SUSPEND
 
-If **MX_RESUME_EXCEPTION** is not set in *options*, the operation is a
+If **ZX_RESUME_EXCEPTION** is not set in *options*, the operation is a
 resume-from-suspend.
 
 It is an error for *options* to have any options selected in this mode.
@@ -39,7 +39,7 @@
 
 Resuming from exceptions uses the same mechanism as resuming from
 suspensions: **task_resume**(). An option is passed specifying that
-the task is being resumed from an exception: **MX_RESUME_EXCEPTION**.
+the task is being resumed from an exception: **ZX_RESUME_EXCEPTION**.
 
 Note that a thread can be both suspended and in an exception, each
 requiring separate calls to **task_resume**() with appropriate options.
@@ -55,43 +55,43 @@
 To resume a thread where it left off:
 
 ```
-mx_status_t status = mx_task_resume(thread, MX_RESUME_EXCEPTION);
+zx_status_t status = zx_task_resume(thread, ZX_RESUME_EXCEPTION);
 ```
 
 To pass the exception on to the next handler in the search order,
-pass **MX_RESUME_TRY_NEXT** in addition to
-**MX_RESUME_EXCEPTION**:
+pass **ZX_RESUME_TRY_NEXT** in addition to
+**ZX_RESUME_EXCEPTION**:
 
 ```
-mx_status_t status = mx_task_resume(thread,
-                                    MX_RESUME_EXCEPTION |
-                                    MX_RESUME_TRY_NEXT);
+zx_status_t status = zx_task_resume(thread,
+                                    ZX_RESUME_EXCEPTION |
+                                    ZX_RESUME_TRY_NEXT);
 ```
 
 Note that even though exceptions are sent to handlers in a specific
-order, there is no way for the caller of **mx_task_resume**()
+order, there is no way for the caller of **zx_task_resume**()
 to verify it is that handler. Anyone with appropriate rights
 can resume a thread from an exception. It is up to exception
 handlers to not trip over each other, as well as all other
-software calling **mx_task_resume**() with **MX_RESUME_EXCEPTION**.
+software calling **zx_task_resume**() with **ZX_RESUME_EXCEPTION**.
 (MG-562 documents this issue.)
 
 ## RETURN VALUE
 
-**task_resume**() returns **MX_OK** on success.
+**task_resume**() returns **ZX_OK** on success.
 In the event of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE** *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE** *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE** *handle* is not a thread handle.
+**ZX_ERR_WRONG_TYPE** *handle* is not a thread handle.
 
-**MX_ERR_BAD_STATE**  The task is not in a state where resuming is possible (e.g.
-it is dead or **MX_RESUME_EXCEPTION** was passed but the thread is not in an
+**ZX_ERR_BAD_STATE**  The task is not in a state where resuming is possible (e.g.
+it is dead or **ZX_RESUME_EXCEPTION** was passed but the thread is not in an
 exception).
 
-**MX_ERR_INVALID_ARGS** *options* is not a valid combination.
+**ZX_ERR_INVALID_ARGS** *options* is not a valid combination.
 
 ## LIMITATIONS
 
diff --git a/docs/syscalls/task_suspend.md b/docs/syscalls/task_suspend.md
index f07f018..06c8193 100644
--- a/docs/syscalls/task_suspend.md
+++ b/docs/syscalls/task_suspend.md
@@ -1,4 +1,4 @@
-# mx_task_suspend
+# zx_task_suspend
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-void mx_task_suspend(mx_handle_t task);
+void zx_task_suspend(zx_handle_t task);
 
 ```
 
@@ -28,16 +28,16 @@
 
 ## RETURN VALUE
 
-**task_suspend**() returns **MX_OK** on success.
+**task_suspend**() returns **ZX_OK** on success.
 In the event of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE** *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE** *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE** *handle* is not a thread handle.
+**ZX_ERR_WRONG_TYPE** *handle* is not a thread handle.
 
-**MX_ERR_BAD_STATE**  The task is not in a state where suspending is possible.
+**ZX_ERR_BAD_STATE**  The task is not in a state where suspending is possible.
 
 ## LIMITATIONS
 
diff --git a/docs/syscalls/thread_create.md b/docs/syscalls/thread_create.md
index 9562f13..f66ea5c 100644
--- a/docs/syscalls/thread_create.md
+++ b/docs/syscalls/thread_create.md
@@ -1,4 +1,4 @@
-# mx_thread_create
+# zx_thread_create
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_thread_create(mx_handle_t process, const char* name,
-                             uint32_t name_len, uint32_t options, mx_handle_t* out);
+zx_status_t zx_thread_create(zx_handle_t process, const char* name,
+                             uint32_t name_len, uint32_t options, zx_handle_t* out);
 
 ```
 
@@ -21,12 +21,12 @@
 Upon success a handle for the new thread is returned.  The thread
 will not start executing until *thread_start()* is called.
 
-*name* is silently truncated to a maximum of *MX_MAX_NAME_LEN-1* characters.
+*name* is silently truncated to a maximum of *ZX_MAX_NAME_LEN-1* characters.
 
 When the last handle to a thread is closed, the thread is destroyed.
 
 Thread handles may be waited on and will assert the signal
-*MX_THREAD_TERMINATED* when the thread stops executing (due to
+*ZX_THREAD_TERMINATED* when the thread stops executing (due to
 *thread_exit**() being called).
 
 *process* is the controlling [process object](../objects/process.md) for the
@@ -34,20 +34,20 @@
 
 ## RETURN VALUE
 
-On success, **thread_create**() returns **MX_OK** and a handle (via *out*)
+On success, **thread_create**() returns **ZX_OK** and a handle (via *out*)
 to the new thread.  In the event of failure, a negative error value is
 returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *process* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *process* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *process* is not a process handle.
+**ZX_ERR_WRONG_TYPE**  *process* is not a process handle.
 
-**MX_ERR_INVALID_ARGS**  *name* or *out* was an invalid pointer, or *options* was
+**ZX_ERR_INVALID_ARGS**  *name* or *out* was an invalid pointer, or *options* was
 non-zero.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/thread_exit.md b/docs/syscalls/thread_exit.md
index 76ca8f5..60ec88f 100644
--- a/docs/syscalls/thread_exit.md
+++ b/docs/syscalls/thread_exit.md
@@ -1,4 +1,4 @@
-# mx_thread_exit
+# zx_thread_exit
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-void mx_thread_exit(void);
+void zx_thread_exit(void);
 
 ```
 
@@ -18,7 +18,7 @@
 **thread_exit**() causes the currently running thread to cease
 running and exit.
 
-The signal *MX_THREAD_TERMINATED* will be assserted on the thread
+The signal *ZX_THREAD_TERMINATED* will be assserted on the thread
 object upon exit and may be observed via *object_wait_one*()
 or *object_wait_many*() on a handle to the thread.
 
diff --git a/docs/syscalls/thread_read_state.md b/docs/syscalls/thread_read_state.md
index b31586c..de542fc 100644
--- a/docs/syscalls/thread_read_state.md
+++ b/docs/syscalls/thread_read_state.md
@@ -1,4 +1,4 @@
-# mx_thread_read_state
+# zx_thread_read_state
 
 ## NAME
 
@@ -7,11 +7,11 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/debug.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/debug.h>
 
-mx_status_t mx_thread_read_state(
-    mx_handle_t handle,
+zx_status_t zx_thread_read_state(
+    zx_handle_t handle,
     uint32_t kind,
     void* buffer,
     uint32_t len,
@@ -27,39 +27,39 @@
 By convention regset 0 contains the general purpose integer registers,
 stack pointer, program counter, and ALU flags register if the architecture
 defines one. Each register set's contents is defined by a struct in
-magenta/syscalls/debug.h.
+zircon/syscalls/debug.h.
 
 ## RETURN VALUE
 
-**thread_read_state**() returns **MX_OK** on success.
+**thread_read_state**() returns **ZX_OK** on success.
 In the event of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not that of a thread.
+**ZX_ERR_WRONG_TYPE**  *handle* is not that of a thread.
 
-**MX_ERR_ACCESS_DENIED**  *handle* lacks *MX_RIGHT_READ*.
+**ZX_ERR_ACCESS_DENIED**  *handle* lacks *ZX_RIGHT_READ*.
 
-**MX_ERR_INVALID_ARGS**  *kind* is not valid,
+**ZX_ERR_INVALID_ARGS**  *kind* is not valid,
 or *buffer* or *actual* are invalid pointers,
 or the provided *buffer_len* is too large.
 
-**MX_ERR_NO_MEMORY**  Temporary out of memory failure.
+**ZX_ERR_NO_MEMORY**  Temporary out of memory failure.
 
-**MX_ERR_BUFFER_TOO_SMALL**  The provided buffer is too small to hold *kind*.
+**ZX_ERR_BUFFER_TOO_SMALL**  The provided buffer is too small to hold *kind*.
 The required size is returned in *actual[0]*.
 
-**MX_ERR_BAD_STATE**  The thread is not stopped at a point where state
+**ZX_ERR_BAD_STATE**  The thread is not stopped at a point where state
 is available. Typically thread state is read by an exception handler
 when the thread is stopped due to an exception.
 
-**MX_ERR_NOT_SUPPORTED**  *kind* is not supported.
+**ZX_ERR_NOT_SUPPORTED**  *kind* is not supported.
 This can happen, for example, when trying to read a register set that
 is not supported by the h/w the program is currently running on.
 
-**MX_ERR_UNAVAILABLE**  *kind* is currently unavailable.
+**ZX_ERR_UNAVAILABLE**  *kind* is currently unavailable.
 This can happen, for example, when a regset requires the chip to be
 in a specific mode. The details are dependent on the architecture
 and regset.
diff --git a/docs/syscalls/thread_start.md b/docs/syscalls/thread_start.md
index 1e5997c..1a9f46b 100644
--- a/docs/syscalls/thread_start.md
+++ b/docs/syscalls/thread_start.md
@@ -1,4 +1,4 @@
-# mx_thread_start
+# zx_thread_start
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_thread_start(mx_handle_t thread, uintptr_t entry, uintptr_t stack,
+zx_status_t zx_thread_start(zx_handle_t thread, uintptr_t entry, uintptr_t stack,
                             uintptr_t arg1, uintptr_t arg2);
 ```
 
@@ -24,23 +24,23 @@
 When the last handle to a thread is closed, the thread is destroyed.
 
 Thread handles may be waited on and will assert the signal
-*MX_THREAD_TERMINATED* when the thread stops executing (due to
+*ZX_THREAD_TERMINATED* when the thread stops executing (due to
 *thread_exit**() being called.
 
 ## RETURN VALUE
 
-**thread_start**() returns MX_OK on success.
+**thread_start**() returns ZX_OK on success.
 In the event of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *thread* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *thread* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *thread* is not a thread handle.
+**ZX_ERR_WRONG_TYPE**  *thread* is not a thread handle.
 
-**MX_ERR_ACCESS_DENIED**  The handle *thread* lacks *MX_RIGHT_WRITE*.
+**ZX_ERR_ACCESS_DENIED**  The handle *thread* lacks *ZX_RIGHT_WRITE*.
 
-**MX_ERR_BAD_STATE**  *thread* is not ready to run or the process *thread*
+**ZX_ERR_BAD_STATE**  *thread* is not ready to run or the process *thread*
 is part of is no longer alive.
 
 ## SEE ALSO
diff --git a/docs/syscalls/thread_write_state.md b/docs/syscalls/thread_write_state.md
index d049b50..b62bf3e 100644
--- a/docs/syscalls/thread_write_state.md
+++ b/docs/syscalls/thread_write_state.md
@@ -1,4 +1,4 @@
-# mx_thread_write_state
+# zx_thread_write_state
 
 ## NAME
 
@@ -7,11 +7,11 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/debug.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/debug.h>
 
-mx_status_t mx_thread_write_state(
-    mx_handle_t handle,
+zx_status_t zx_thread_write_state(
+    zx_handle_t handle,
     uint32_t kind,
     void* buffer,
     uint32_t len);
@@ -26,36 +26,36 @@
 By convention regset 0 contains the general purpose integer registers,
 stack pointer, program counter, and ALU flags register if the architecture
 defines one. Each register set's contents is defined by a struct in
-magenta/syscalls/debug.h.
+zircon/syscalls/debug.h.
 
 ## RETURN VALUE
 
-**thread_write_state**() returns **MX_OK** on success.
+**thread_write_state**() returns **ZX_OK** on success.
 In the event of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not that of a thread.
+**ZX_ERR_WRONG_TYPE**  *handle* is not that of a thread.
 
-**MX_ERR_ACCESS_DENIED**  *handle* lacks *MX_RIGHT_WRITE*.
+**ZX_ERR_ACCESS_DENIED**  *handle* lacks *ZX_RIGHT_WRITE*.
 
-**MX_ERR_INVALID_ARGS**  *kind* is not valid,
+**ZX_ERR_INVALID_ARGS**  *kind* is not valid,
 or *buffer* is an invalid pointer,
 or the provided *len* is too large.
 
-**MX_ERR_NO_MEMORY**  Temporary out of memory failure.
+**ZX_ERR_NO_MEMORY**  Temporary out of memory failure.
 
-**MX_ERR_BAD_STATE**  The thread is not stopped at a point where state
+**ZX_ERR_BAD_STATE**  The thread is not stopped at a point where state
 is available. Typically thread state is read by an exception handler
 when the thread is stopped due to an exception.
 
-**MX_ERR_NOT_SUPPORTED**  *kind* is not supported.
+**ZX_ERR_NOT_SUPPORTED**  *kind* is not supported.
 This can happen, for example, when trying to write a register set that
 is not supported by the h/w the program is currently running on.
 
-**MX_ERR_UNAVAILABLE**  *kind* is currently unavailable.
+**ZX_ERR_UNAVAILABLE**  *kind* is currently unavailable.
 This can happen, for example, when a regset requires the chip to be
 in a specific mode. The details are dependent on the architecture
 and regset.
diff --git a/docs/syscalls/ticks_get.md b/docs/syscalls/ticks_get.md
index 47d780e..98b4f90 100644
--- a/docs/syscalls/ticks_get.md
+++ b/docs/syscalls/ticks_get.md
@@ -1,4 +1,4 @@
-# mx_ticks_get
+# zx_ticks_get
 
 ## NAME
 
@@ -7,25 +7,25 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-uint64_t mx_ticks_get(void)
+uint64_t zx_ticks_get(void)
 ```
 
 ## DESCRIPTION
 
-**mx_ticks_get**() returns the number of high-precision timer ticks since boot.
+**zx_ticks_get**() returns the number of high-precision timer ticks since boot.
 
 These ticks may be processor cycles, high speed timer, profiling timer, etc.
 They are not guaranteed to continue advancing when the system is asleep.
 
 ## RETURN VALUE
 
-**mx_ticks_get**() returns the number of high-precision timer ticks since boot.
+**zx_ticks_get**() returns the number of high-precision timer ticks since boot.
 
 ## ERRORS
 
-**mx_tick_get**() does not report any error conditions.
+**zx_tick_get**() does not report any error conditions.
 
 ## NOTES
 
diff --git a/docs/syscalls/ticks_per_second.md b/docs/syscalls/ticks_per_second.md
index 1a3e463..1ade89e 100644
--- a/docs/syscalls/ticks_per_second.md
+++ b/docs/syscalls/ticks_per_second.md
@@ -1,4 +1,4 @@
-# mx_ticks_per_second
+# zx_ticks_per_second
 
 ## NAME
 
@@ -7,37 +7,37 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-uint64_t mx_ticks_per_second(void)
+uint64_t zx_ticks_per_second(void)
 ```
 
 ## DESCRIPTION
 
-**mx_ticks_per_second**() returns the number of high-precision timer ticks in a
+**zx_ticks_per_second**() returns the number of high-precision timer ticks in a
 second.
 
-This can be used together with **mx_ticks_get**() to calculate the amount of
-time elapsed between two subsequent calls to **mx_ticks_get**().
+This can be used together with **zx_ticks_get**() to calculate the amount of
+time elapsed between two subsequent calls to **zx_ticks_get**().
 
 ## RETURN VALUE
 
-**mx_ticks_per_second**() returns the number of high-precision timer ticks in a
+**zx_ticks_per_second**() returns the number of high-precision timer ticks in a
 second.
 
 ## ERRORS
 
-**mx_ticks_per_second**() does not report any error conditions.
+**zx_ticks_per_second**() does not report any error conditions.
 
 ## EXAMPLES
 
 ```
-uint64_t ticks_per_second = mx_ticks_per_second();
-uint64_t ticks_start = mx_ticks_get();
+uint64_t ticks_per_second = zx_ticks_per_second();
+uint64_t ticks_start = zx_ticks_get();
 
 // do some more work
 
-uint64_t ticks_end = mx_ticks_get();
+uint64_t ticks_end = zx_ticks_get();
 double elapsed_seconds = (ticks_end - ticks_start) / (double)ticks_per_second;
 
 ```
diff --git a/docs/syscalls/time_get.md b/docs/syscalls/time_get.md
index 4b07c17..4dbef3e 100644
--- a/docs/syscalls/time_get.md
+++ b/docs/syscalls/time_get.md
@@ -1,4 +1,4 @@
-# mx_time_get
+# zx_time_get
 
 ## NAME
 
@@ -7,28 +7,28 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_time_t mx_time_get(uint32_t clock_id)
+zx_time_t zx_time_get(uint32_t clock_id)
 ```
 
 ## DESCRIPTION
 
-**mx_time_get**() returns the current time of *clock_id*, or 0 if *clock_id* is
+**zx_time_get**() returns the current time of *clock_id*, or 0 if *clock_id* is
 invalid.
 
 ## SUPPORTED CLOCK IDS
 
-*MX_CLOCK_MONOTONIC* number of nanoseconds since the system was powered on.
+*ZX_CLOCK_MONOTONIC* number of nanoseconds since the system was powered on.
 
-*MX_CLOCK_UTC* number of wall clock nanoseconds since the Unix epoch (midnight on January 1 1970) in UTC
+*ZX_CLOCK_UTC* number of wall clock nanoseconds since the Unix epoch (midnight on January 1 1970) in UTC
 
-*MX_CLOCK_THREAD* number of nanoseconds the current thread has been running for.
+*ZX_CLOCK_THREAD* number of nanoseconds the current thread has been running for.
 
 ## RETURN VALUE
 
-On success, **mx_time_get**() returns the current time according to the given clock ID.
+On success, **zx_time_get**() returns the current time according to the given clock ID.
 
 ## ERRORS
 
-On error, **mx_time_get**() currently returns 0.
+On error, **zx_time_get**() currently returns 0.
diff --git a/docs/syscalls/timer_cancel.md b/docs/syscalls/timer_cancel.md
index 4080613..ca4d1ad 100644
--- a/docs/syscalls/timer_cancel.md
+++ b/docs/syscalls/timer_cancel.md
@@ -1,4 +1,4 @@
-# mx_timer_cancel
+# zx_timer_cancel
 
 ## NAME
 
@@ -7,32 +7,32 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_timer_cancel(mx_handle_t handle);
+zx_status_t zx_timer_cancel(zx_handle_t handle);
 
 ```
 
 ## DESCRIPTION
 
-**mx_timer_cancel**() cancels a pending timer that was started with
+**zx_timer_cancel**() cancels a pending timer that was started with
 **timer_set**().
 
-Upon success the pending timer is canceled and the MX_TIMER_SIGNALED
+Upon success the pending timer is canceled and the ZX_TIMER_SIGNALED
 signal is de-asserted. If a new pending timer is immediately needed
 rather than calling **timer_cancel**() first, call **timer_set**()
 with the new deadline.
 
 ## RETURN VALUE
 
-**mx_timer_cancel**() returns **MX_OK** on success.
+**zx_timer_cancel**() returns **ZX_OK** on success.
 In the event of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* lacks the right *MX_RIGHT_WRITE*.
+**ZX_ERR_ACCESS_DENIED**  *handle* lacks the right *ZX_RIGHT_WRITE*.
 
 ## NOTE
 
diff --git a/docs/syscalls/timer_create.md b/docs/syscalls/timer_create.md
index c170087..fe3b540 100644
--- a/docs/syscalls/timer_create.md
+++ b/docs/syscalls/timer_create.md
@@ -1,4 +1,4 @@
-# mx_timer_create
+# zx_timer_create
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_timer_create(uint32_t options, uint32_t clock_id, mx_handle_t* out);
+zx_status_t zx_timer_create(uint32_t options, uint32_t clock_id, zx_handle_t* out);
 
 ```
 
@@ -17,7 +17,7 @@
 
 **timer_create**() creates a timer, an object that can signal
 when a specified point in time has been reached. The only valid
-*clock_id* is MX_CLOCK_MONOTONIC.
+*clock_id* is ZX_CLOCK_MONOTONIC.
 
 The *options* value specifies the coalescing behavior which
 controls whether the system can fire the time earlier or later
@@ -25,30 +25,30 @@
 
 The possible values are:
 
-+ **MX_TIMER_SLACK_CENTER** coalescing is allowed with earlier and
++ **ZX_TIMER_SLACK_CENTER** coalescing is allowed with earlier and
   later timers.
-+ **MX_TIMER_SLACK_EARLY** coalescing is allowed only with earlier
++ **ZX_TIMER_SLACK_EARLY** coalescing is allowed only with earlier
   timers.
-+ **MX_TIMER_SLACK_LAYE** coalescing is allowed only with later
++ **ZX_TIMER_SLACK_LAYE** coalescing is allowed only with later
   timers.
 
-Passing 0 in options is equivalent to MX_TIMER_SLACK_CENTER.
+Passing 0 in options is equivalent to ZX_TIMER_SLACK_CENTER.
 
-The returned handle has the MX_RIGHT_DUPLICATE, MX_RIGHT_TRANSFER,
-MX_RIGHT_READ and MX_RIGHT_WRITE right.
+The returned handle has the ZX_RIGHT_DUPLICATE, ZX_RIGHT_TRANSFER,
+ZX_RIGHT_READ and ZX_RIGHT_WRITE right.
 
 ## RETURN VALUE
 
-**timer_create**() returns **MX_OK** on success. In the event
+**timer_create**() returns **ZX_OK** on success. In the event
 of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *out* is an invalid pointer or NULL or
-*options* is not one of the MX_TIMER_SLACK values or *clock_id* is
-any value other than MX_CLOCK_MONOTONIC.
+**ZX_ERR_INVALID_ARGS**  *out* is an invalid pointer or NULL or
+*options* is not one of the ZX_TIMER_SLACK values or *clock_id* is
+any value other than ZX_CLOCK_MONOTONIC.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/timer_set.md b/docs/syscalls/timer_set.md
index 93becae..d1fa96c 100644
--- a/docs/syscalls/timer_set.md
+++ b/docs/syscalls/timer_set.md
@@ -1,4 +1,4 @@
-# mx_timer_set
+# zx_timer_set
 
 ## NAME
 
@@ -7,27 +7,27 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_timer_set(mx_handle_t handle, mx_time_t deadline,
-                         mx_duration_t slack);
+zx_status_t zx_timer_set(zx_handle_t handle, zx_time_t deadline,
+                         zx_duration_t slack);
 
 ```
 
 ## DESCRIPTION
 
-**mx_timer_set**() starts a one-shot timer that will fire when
-*deadline* passes. If a previous call to **mx_timer_set**() was
+**zx_timer_set**() starts a one-shot timer that will fire when
+*deadline* passes. If a previous call to **zx_timer_set**() was
 pending, the previous timer is canceled and
-*MX_TIMER_SIGNALED* is de-asserted as needed.
+*ZX_TIMER_SIGNALED* is de-asserted as needed.
 
 The *deadline* parameter specifies a deadline with respect to
-**MX_CLOCK_MONOTONIC**. To wait for a relative interval,
-use **mx_deadline_after**() returned value in *deadline*.
+**ZX_CLOCK_MONOTONIC**. To wait for a relative interval,
+use **zx_deadline_after**() returned value in *deadline*.
 
 To fire the timer immediately pass 0 to *deadline*.
 
-When the timer fires it asserts *MX_TIMER_SIGNALED*. To de-assert this
+When the timer fires it asserts *ZX_TIMER_SIGNALED*. To de-assert this
 signal call **timer_cancel**() or **timer_set**() again.
 
 The *slack* parameter specifies a range from *deadline* - *slack* to
@@ -35,24 +35,24 @@
 uses this parameter as a hint to coalesce nearby timers.
 
 The precise coalescing behavior is controlled by the *options* parameter
-specified when the timer was created. **MX_TIMER_SLACK_EARLY** allows only
-firing in the *deadline* - *slack* interval and **MX_TIMER_SLACK_LATE**
+specified when the timer was created. **ZX_TIMER_SLACK_EARLY** allows only
+firing in the *deadline* - *slack* interval and **ZX_TIMER_SLACK_LATE**
 allows only firing in the *deadline* + *slack* interval. The default
-option value of 0 is **MX_TIMER_SLACK_CENTER** and allows both early and
+option value of 0 is **ZX_TIMER_SLACK_CENTER** and allows both early and
 late firing with an effective interval of *deadline* - *slack* to
 *deadline* + *slack*
 
 ## RETURN VALUE
 
-**mx_timer_set**() returns **MX_OK** on success.
+**zx_timer_set**() returns **ZX_OK** on success.
 In the event of failure, a negative error value is returned.
 
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* lacks the right *MX_RIGHT_WRITE*.
+**ZX_ERR_ACCESS_DENIED**  *handle* lacks the right *ZX_RIGHT_WRITE*.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vcpu_create.md b/docs/syscalls/vcpu_create.md
index 60fcba8..aeedc57 100644
--- a/docs/syscalls/vcpu_create.md
+++ b/docs/syscalls/vcpu_create.md
@@ -1,4 +1,4 @@
-# mx_vcpu_create
+# zx_vcpu_create
 
 ## NAME
 
@@ -7,11 +7,11 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/hypervisor.h>
 
-mx_status_t mx_vcpu_create(mx_handle_t guest, uint32_t options,
-                           const mx_vcpu_create_args_t* args, mx_handle_t* out);
+zx_status_t zx_vcpu_create(zx_handle_t guest, uint32_t options,
+                           const zx_vcpu_create_args_t* args, zx_handle_t* out);
 ```
 
 ## DESCRIPTION
@@ -33,36 +33,36 @@
 
 The following rights will be set on the handle *out* by default:
 
-**MX_RIGHT_DUPLICATE** — *out* may be duplicated.
+**ZX_RIGHT_DUPLICATE** — *out* may be duplicated.
 
-**MX_RIGHT_TRANSFER** — *out* may be transferred over a channel.
+**ZX_RIGHT_TRANSFER** — *out* may be transferred over a channel.
 
-**MX_RIGHT_EXECUTE** — *out* may have its execution resumed (or begun)
+**ZX_RIGHT_EXECUTE** — *out* may have its execution resumed (or begun)
 
-**MX_RIGHT_SIGNAL** — *out* may be interrupted
+**ZX_RIGHT_SIGNAL** — *out* may be interrupted
 
-**MX_RIGHT_READ** — *out* may have its state read
+**ZX_RIGHT_READ** — *out* may have its state read
 
-**MX_RIGHT_WRITE** — *out* may have its state written
+**ZX_RIGHT_WRITE** — *out* may have its state written
 
 ## RETURN VALUE
 
-**vcpu_create**() returns MX_OK on success. On failure, an error value is
+**vcpu_create**() returns ZX_OK on success. On failure, an error value is
 returned.
 
 ## ERRORS
 
-**MX_ERR_ACCESS_DENIED** *guest* does not have the *MX_RIGHT_WRITE* right, or
-*apic_vmo* does not have the *MX_RIGHT_READ* and *MX_RIGHT_WRITE* rights.
+**ZX_ERR_ACCESS_DENIED** *guest* does not have the *ZX_RIGHT_WRITE* right, or
+*apic_vmo* does not have the *ZX_RIGHT_READ* and *ZX_RIGHT_WRITE* rights.
 
-**MX_ERR_BAD_HANDLE** *guest* is an invalid handle.
+**ZX_ERR_BAD_HANDLE** *guest* is an invalid handle.
 
-**MX_ERR_INVALID_ARGS** *args* contains an invalid argument, or *out* is an
+**ZX_ERR_INVALID_ARGS** *args* contains an invalid argument, or *out* is an
 invalid pointer, or *options* is nonzero.
 
-**MX_ERR_NO_MEMORY** Temporary failure due to lack of memory.
+**ZX_ERR_NO_MEMORY** Temporary failure due to lack of memory.
 
-**MX_ERR_WRONG_TYPE** *guest* is not a handle to a guest.
+**ZX_ERR_WRONG_TYPE** *guest* is not a handle to a guest.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vcpu_interrupt.md b/docs/syscalls/vcpu_interrupt.md
index a855f9d..564b57f 100644
--- a/docs/syscalls/vcpu_interrupt.md
+++ b/docs/syscalls/vcpu_interrupt.md
@@ -1,4 +1,4 @@
-# mx_vcpu_interrupt
+# zx_vcpu_interrupt
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vcpu_interrupt(mx_handle_t vcpu, uint32_t vector);
+zx_status_t zx_vcpu_interrupt(zx_handle_t vcpu, uint32_t vector);
 ```
 
 ## DESCRIPTION
@@ -19,19 +19,19 @@
 
 ## RETURN VALUE
 
-**vcpu_interrupt**() returns MX_OK on success. On failure, an error value is
+**vcpu_interrupt**() returns ZX_OK on success. On failure, an error value is
 returned.
 
 ## ERRORS
 
-**MX_ERR_ACCESS_DENIED** *vcpu* does not have the *MX_RIGHT_SIGNAL* right.
+**ZX_ERR_ACCESS_DENIED** *vcpu* does not have the *ZX_RIGHT_SIGNAL* right.
 
-**MX_ERR_BAD_HANDLE** *vcpu* is an invalid handle.
+**ZX_ERR_BAD_HANDLE** *vcpu* is an invalid handle.
 
-**MX_ERR_OUT_OF_RANGE** *vector* is outside of the range interrupts supported by
+**ZX_ERR_OUT_OF_RANGE** *vector* is outside of the range interrupts supported by
 the current architecture.
 
-**MX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU.
+**ZX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vcpu_read_state.md b/docs/syscalls/vcpu_read_state.md
index e3facd5..016515b 100644
--- a/docs/syscalls/vcpu_read_state.md
+++ b/docs/syscalls/vcpu_read_state.md
@@ -1,4 +1,4 @@
-# mx_vcpu_read_state
+# zx_vcpu_read_state
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/hypervisor.h>
 
-mx_status_t mx_vcpu_read_state(mx_handle_t vcpu, uint32_t kind, void* buffer,
+zx_status_t zx_vcpu_read_state(zx_handle_t vcpu, uint32_t kind, void* buffer,
                                uint32_t len);
 ```
 
@@ -22,21 +22,21 @@
 
 ## RETURN VALUE
 
-**vcpu_read_state**() returns MX_OK on success. On failure, an error value is
+**vcpu_read_state**() returns ZX_OK on success. On failure, an error value is
 returned.
 
 ## ERRORS
 
-**MX_ERR_ACCESS_DENIED** *vcpu* does not have the *MX_RIGHT_READ* right.
+**ZX_ERR_ACCESS_DENIED** *vcpu* does not have the *ZX_RIGHT_READ* right.
 
-**MX_ERR_BAD_HANDLE** *vcpu* is an invalid handle.
+**ZX_ERR_BAD_HANDLE** *vcpu* is an invalid handle.
 
-**MX_ERR_BAD_STATE** *vcpu* is in a bad state, and state can not be read.
+**ZX_ERR_BAD_STATE** *vcpu* is in a bad state, and state can not be read.
 
-**MX_ERR_INVALID_ARGS** *kind* does not name a known VCPU state, *buffer* is an
+**ZX_ERR_INVALID_ARGS** *kind* does not name a known VCPU state, *buffer* is an
 invalid pointer, or *len* does not match the expected size of *kind*.
 
-**MX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU.
+**ZX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vcpu_resume.md b/docs/syscalls/vcpu_resume.md
index c337aef..b55b574 100644
--- a/docs/syscalls/vcpu_resume.md
+++ b/docs/syscalls/vcpu_resume.md
@@ -1,4 +1,4 @@
-# mx_vcpu_resume
+# zx_vcpu_resume
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 
-mx_status_t mx_vcpu_resume(mx_handle_t vcpu, mx_port_packet_t* packet);
+zx_status_t zx_vcpu_resume(zx_handle_t vcpu, zx_port_packet_t* packet);
 ```
 
 ## DESCRIPTION
@@ -24,27 +24,27 @@
 
 ## RETURN VALUE
 
-**vcpu_resume**() returns MX_OK on success. On failure, an error value is
+**vcpu_resume**() returns ZX_OK on success. On failure, an error value is
 returned.
 
 ## ERRORS
 
-**MX_ERR_ACCESS_DENIED** *vcpu* does not have the *MX_RIGHT_EXECUTE* right.
+**ZX_ERR_ACCESS_DENIED** *vcpu* does not have the *ZX_RIGHT_EXECUTE* right.
 
-**MX_ERR_BAD_HANDLE** *vcpu* is an invalid handle.
+**ZX_ERR_BAD_HANDLE** *vcpu* is an invalid handle.
 
-**MX_ERR_BAD_STATE** *vcpu* is in a bad state, and can not be executed.
+**ZX_ERR_BAD_STATE** *vcpu* is in a bad state, and can not be executed.
 
-**MX_ERR_CANCELED** *vcpu* execution was canceled while waiting on an event.
+**ZX_ERR_CANCELED** *vcpu* execution was canceled while waiting on an event.
 
-**MX_ERR_INTERNAL** There was an error executing *vcpu*.
+**ZX_ERR_INTERNAL** There was an error executing *vcpu*.
 
-**MX_ERR_INVALID_ARGS** *packet* is an invalid pointer.
+**ZX_ERR_INVALID_ARGS** *packet* is an invalid pointer.
 
-**MX_ERR_NOT_SUPPORTED** An unsupported operation was encountered while
+**ZX_ERR_NOT_SUPPORTED** An unsupported operation was encountered while
 executing *vcpu*.
 
-**MX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU.
+**ZX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vcpu_write_state.md b/docs/syscalls/vcpu_write_state.md
index 7949842..ab9ba49 100644
--- a/docs/syscalls/vcpu_write_state.md
+++ b/docs/syscalls/vcpu_write_state.md
@@ -1,4 +1,4 @@
-# mx_vcpu_write_state
+# zx_vcpu_write_state
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/hypervisor.h>
 
-mx_status_t mx_vcpu_write_state(mx_handle_t vcpu, const mx_vcpu_state_t* state);
+zx_status_t zx_vcpu_write_state(zx_handle_t vcpu, const zx_vcpu_state_t* state);
 ```
 
 ## DESCRIPTION
@@ -21,21 +21,21 @@
 
 ## RETURN VALUE
 
-**vcpu_write_state**() returns MX_OK on success. On failure, an error value is
+**vcpu_write_state**() returns ZX_OK on success. On failure, an error value is
 returned.
 
 ## ERRORS
 
-**MX_ERR_ACCESS_DENIED** *vcpu* does not have the *MX_RIGHT_WRITE* right.
+**ZX_ERR_ACCESS_DENIED** *vcpu* does not have the *ZX_RIGHT_WRITE* right.
 
-**MX_ERR_BAD_HANDLE** *vcpu* is an invalid handle.
+**ZX_ERR_BAD_HANDLE** *vcpu* is an invalid handle.
 
-**MX_ERR_BAD_STATE** *vcpu* is in a bad state, and state can not be written.
+**ZX_ERR_BAD_STATE** *vcpu* is in a bad state, and state can not be written.
 
-**MX_ERR_INVALID_ARGS** *kind* does not name a known VCPU state, *buffer* is an
+**ZX_ERR_INVALID_ARGS** *kind* does not name a known VCPU state, *buffer* is an
 invalid pointer, or *len* does not match the expected size of *kind*.
 
-**MX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU.
+**ZX_ERR_WRONG_TYPE** *vcpu* is not a handle to a VCPU.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vmar_allocate.md b/docs/syscalls/vmar_allocate.md
index 7f560a5..e1c73c0 100644
--- a/docs/syscalls/vmar_allocate.md
+++ b/docs/syscalls/vmar_allocate.md
@@ -1,4 +1,4 @@
-# mx_vmar_allocate
+# zx_vmar_allocate
 
 ## NAME
 
@@ -7,11 +7,11 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmar_allocate(mx_handle_t parent_vmar_handle,
+zx_status_t zx_vmar_allocate(zx_handle_t parent_vmar_handle,
                              size_t offset, size_t size, uint32_t map_flags,
-                             mx_handle_t* child_vmar, uintptr_t* child_addr)
+                             zx_handle_t* child_vmar, uintptr_t* child_addr)
 ```
 
 ## DESCRIPTION
@@ -19,48 +19,48 @@
 Creates a new VMAR within the one specified by *parent_vmar_handle*.
 
 *map_flags* is a bit vector of the following flags:
-- **MX_VM_FLAG_COMPACT**  A hint to the kernel that allocations and mappings
+- **ZX_VM_FLAG_COMPACT**  A hint to the kernel that allocations and mappings
   within the newly created subregion should be kept close together.   See the
   NOTES section below for discussion.
-- **MX_VM_FLAG_SPECIFIC**  Use the *offset* to place the mapping, invalid if
-  vmar does not have the **MX_VM_FLAG_CAN_MAP_SPECIFIC** permission.  *offset*
+- **ZX_VM_FLAG_SPECIFIC**  Use the *offset* to place the mapping, invalid if
+  vmar does not have the **ZX_VM_FLAG_CAN_MAP_SPECIFIC** permission.  *offset*
   is an offset relative to the base address of the parent region.  It is an error
   to specify an address range that overlaps with another VMAR or mapping.
-- **MX_VM_FLAG_CAN_MAP_SPECIFIC**  The new VMAR can have subregions/mappings
-  created with **MX_VM_FLAG_SPECIFIC**.  It is NOT an error if the parent does
-  not have *MX_VM_FLAG_CAN_MAP_SPECIFIC* permissions.
-- **MX_VM_FLAG_CAN_MAP_READ**  The new VMAR can contain readable mappings.
-  It is an error if the parent does not have *MX_VM_FLAG_CAN_MAP_READ* permissions.
-- **MX_VM_FLAG_CAN_MAP_WRITE**  The new VMAR can contain writable mappings.
-  It is an error if the parent does not have *MX_VM_FLAG_CAN_MAP_WRITE* permissions.
-- **MX_VM_FLAG_CAN_MAP_EXECUTE**  The new VMAR can contain executable mappings.
-  It is an error if the parent does not have *MX_VM_FLAG_CAN_MAP_EXECUTE* permissions.
+- **ZX_VM_FLAG_CAN_MAP_SPECIFIC**  The new VMAR can have subregions/mappings
+  created with **ZX_VM_FLAG_SPECIFIC**.  It is NOT an error if the parent does
+  not have *ZX_VM_FLAG_CAN_MAP_SPECIFIC* permissions.
+- **ZX_VM_FLAG_CAN_MAP_READ**  The new VMAR can contain readable mappings.
+  It is an error if the parent does not have *ZX_VM_FLAG_CAN_MAP_READ* permissions.
+- **ZX_VM_FLAG_CAN_MAP_WRITE**  The new VMAR can contain writable mappings.
+  It is an error if the parent does not have *ZX_VM_FLAG_CAN_MAP_WRITE* permissions.
+- **ZX_VM_FLAG_CAN_MAP_EXECUTE**  The new VMAR can contain executable mappings.
+  It is an error if the parent does not have *ZX_VM_FLAG_CAN_MAP_EXECUTE* permissions.
 
-*offset* must be 0 if *map_flags* does not have **MX_VM_FLAG_SPECIFIC** set.
+*offset* must be 0 if *map_flags* does not have **ZX_VM_FLAG_SPECIFIC** set.
 
 ## RETURN VALUE
 
-**vmar_allocate**() returns **MX_OK**, the absolute base address of the
+**vmar_allocate**() returns **ZX_OK**, the absolute base address of the
 subregion (via *child_addr*), and a handle to the new subregion (via
 *child_vmar*) on success.  In the event of failure, a negative error value is
 returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *parent_vmar_handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *parent_vmar_handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *parent_vmar_handle* is not a VMAR handle.
+**ZX_ERR_WRONG_TYPE**  *parent_vmar_handle* is not a VMAR handle.
 
-**MX_ERR_BAD_STATE**  *parent_vmar_handle* refers to a destroyed VMAR.
+**ZX_ERR_BAD_STATE**  *parent_vmar_handle* refers to a destroyed VMAR.
 
-**MX_ERR_INVALID_ARGS**  *child_vmar* or *child_addr* are not valid, *offset* is
-non-zero when *MX_VM_FLAG_SPECIFIC* is not given, *offset* and *size* describe
+**ZX_ERR_INVALID_ARGS**  *child_vmar* or *child_addr* are not valid, *offset* is
+non-zero when *ZX_VM_FLAG_SPECIFIC* is not given, *offset* and *size* describe
 an unsatisfiable allocation due to exceeding the region bounds, *offset*
 or *size* is not page-aligned, or *size* is 0.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
-**MX_ERR_ACCESS_DENIED**  Insufficient privileges to make the requested allocation.
+**ZX_ERR_ACCESS_DENIED**  Insufficient privileges to make the requested allocation.
 
 ## NOTES
 
diff --git a/docs/syscalls/vmar_destroy.md b/docs/syscalls/vmar_destroy.md
index 5e95e0a..6d19c10 100644
--- a/docs/syscalls/vmar_destroy.md
+++ b/docs/syscalls/vmar_destroy.md
@@ -1,4 +1,4 @@
-# mx_vmar_destroy
+# zx_vmar_destroy
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmar_destroy(mx_handle_t vmar_handle);
+zx_status_t zx_vmar_destroy(zx_handle_t vmar_handle);
 ```
 
 ## DESCRIPTION
@@ -22,15 +22,15 @@
 
 ## RETURN VALUE
 
-**vmar_destroy**() returns **MX_OK** on success.
+**vmar_destroy**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *vmar_handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *vmar_handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *vmar_handle* is not a VMAR handle.
+**ZX_ERR_WRONG_TYPE**  *vmar_handle* is not a VMAR handle.
 
-**MX_ERR_BAD_STATE**  This region is already destroyed.
+**ZX_ERR_BAD_STATE**  This region is already destroyed.
 
 ## NOTES
 
diff --git a/docs/syscalls/vmar_map.md b/docs/syscalls/vmar_map.md
index deaac82..ea7abe7 100644
--- a/docs/syscalls/vmar_map.md
+++ b/docs/syscalls/vmar_map.md
@@ -1,4 +1,4 @@
-# mx_vmar_map
+# zx_vmar_map
 
 ## NAME
 
@@ -7,10 +7,10 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmar_map(mx_handle_t vmar, size_t vmar_offset,
-                        mx_handle_t vmo, uint64_t vmo_offset, size_t len,
+zx_status_t zx_vmar_map(zx_handle_t vmar, size_t vmar_offset,
+                        zx_handle_t vmo, uint64_t vmo_offset, size_t len,
                         uint32_t map_flags, uintptr_t* mapped_addr)
 ```
 
@@ -21,58 +21,58 @@
 closing the VMO handle does not remove the mapping added by this function.
 
 *map_flags* is a bit vector of the following flags:
-- **MX_VM_FLAG_SPECIFIC**  Use the *vmar_offset* to place the mapping, invalid if
-  vmar does not have the **MX_VM_FLAG_CAN_MAP_SPECIFIC** permission.
+- **ZX_VM_FLAG_SPECIFIC**  Use the *vmar_offset* to place the mapping, invalid if
+  vmar does not have the **ZX_VM_FLAG_CAN_MAP_SPECIFIC** permission.
   *vmar_offset* is an offset relative to the base address of the given VMAR.
   It is an error to specify a range that overlaps with another VMAR or mapping.
-- **MX_VM_FLAG_SPECIFIC_OVERWRITE**  Same as **MX_VM_FLAG_SPECIFIC**, but can
+- **ZX_VM_FLAG_SPECIFIC_OVERWRITE**  Same as **ZX_VM_FLAG_SPECIFIC**, but can
   overlap another mapping.  It is still an error to overlap another VMAR.  If
   the range meets these requirements, it will atomically (with respect to all
   other map/unmap/protect operations) replace existing mappings in the area.
-- **MX_VM_FLAG_PERM_READ**  Map *vmo* as readable.  It is an error if *vmar*
-  does not have *MX_VM_FLAG_CAN_MAP_READ* permissions, the *vmar* handle does
-  not have the *MX_RIGHT_READ* right, or the *vmo* handle does not have the
-  *MX_RIGHT_READ* right.
-- **MX_VM_FLAG_PERM_WRITE**  Map *vmo* as writable.  It is an error if *vmar*
-  does not have *MX_VM_FLAG_CAN_MAP_WRITE* permissions, the *vmar* handle does
-  not have the *MX_RIGHT_WRITE* right, or the *vmo* handle does not have the
-  *MX_RIGHT_WRITE* right.
-- **MX_VM_FLAG_PERM_EXECUTE**  Map *vmo* as executable.  It is an error if *vmar*
-  does not have *MX_VM_FLAG_CAN_MAP_EXECUTE* permissions, the *vmar* handle does
-  not have the *MX_RIGHT_EXECUTE* right, or the *vmo* handle does not have the
-  *MX_RIGHT_EXECUTE* right.
-- **MX_VM_FLAG_MAP_RANGE**  Immediately page into the new mapping all backed
+- **ZX_VM_FLAG_PERM_READ**  Map *vmo* as readable.  It is an error if *vmar*
+  does not have *ZX_VM_FLAG_CAN_MAP_READ* permissions, the *vmar* handle does
+  not have the *ZX_RIGHT_READ* right, or the *vmo* handle does not have the
+  *ZX_RIGHT_READ* right.
+- **ZX_VM_FLAG_PERM_WRITE**  Map *vmo* as writable.  It is an error if *vmar*
+  does not have *ZX_VM_FLAG_CAN_MAP_WRITE* permissions, the *vmar* handle does
+  not have the *ZX_RIGHT_WRITE* right, or the *vmo* handle does not have the
+  *ZX_RIGHT_WRITE* right.
+- **ZX_VM_FLAG_PERM_EXECUTE**  Map *vmo* as executable.  It is an error if *vmar*
+  does not have *ZX_VM_FLAG_CAN_MAP_EXECUTE* permissions, the *vmar* handle does
+  not have the *ZX_RIGHT_EXECUTE* right, or the *vmo* handle does not have the
+  *ZX_RIGHT_EXECUTE* right.
+- **ZX_VM_FLAG_MAP_RANGE**  Immediately page into the new mapping all backed
   regions of the VMO
 
-*vmar_offset* must be 0 if *map_flags* does not have **MX_VM_FLAG_SPECIFIC** or
-**MX_VM_FLAG_SPECIFIC_OVERWRITE** set.  If neither of those flags are set, then
+*vmar_offset* must be 0 if *map_flags* does not have **ZX_VM_FLAG_SPECIFIC** or
+**ZX_VM_FLAG_SPECIFIC_OVERWRITE** set.  If neither of those flags are set, then
 the mapping will be assigned an offset at random by the kernel (with an
 allocator determined by policy set on the target VMAR).
 
 ## RETURN VALUE
 
-**vmar_map**() returns **MX_OK** and the absolute base address of the
+**vmar_map**() returns **ZX_OK** and the absolute base address of the
 mapping (via *mapped_addr*) on success.  In the event of failure, a negative
 error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *vmar* or *vmo* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *vmar* or *vmo* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *vmar* or *vmo* is not a VMAR or VMO handle, respectively.
+**ZX_ERR_WRONG_TYPE**  *vmar* or *vmo* is not a VMAR or VMO handle, respectively.
 
-**MX_ERR_BAD_STATE**  *vmar* refers to a destroyed VMAR.
+**ZX_ERR_BAD_STATE**  *vmar* refers to a destroyed VMAR.
 
-**MX_ERR_INVALID_ARGS** *mapped_addr* or *map_flags* are not valid, *vmar_offset* is
-non-zero when neither **MX_VM_FLAG_SPECIFIC** nor
-**MX_VM_FLAG_SPECIFIC_OVERWRITE** are given, *vmar_offset* and *len*
+**ZX_ERR_INVALID_ARGS** *mapped_addr* or *map_flags* are not valid, *vmar_offset* is
+non-zero when neither **ZX_VM_FLAG_SPECIFIC** nor
+**ZX_VM_FLAG_SPECIFIC_OVERWRITE** are given, *vmar_offset* and *len*
 describe an unsatisfiable allocation due to exceeding the region bounds,
 *vmar_offset* or *vmo_offset* are not page-aligned,
 *vmo_offset* + ROUNDUP(*len*, PAGE_SIZE) overflows, or *len* is 0.
 
-**MX_ERR_ACCESS_DENIED**  Insufficient privileges to make the requested mapping.
+**ZX_ERR_ACCESS_DENIED**  Insufficient privileges to make the requested mapping.
 
-**MX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.
 
 ## NOTES
 
diff --git a/docs/syscalls/vmar_protect.md b/docs/syscalls/vmar_protect.md
index 5afee31..abfd6d7 100644
--- a/docs/syscalls/vmar_protect.md
+++ b/docs/syscalls/vmar_protect.md
@@ -1,4 +1,4 @@
-# mx_vmar_protect
+# zx_vmar_protect
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmar_protect(mx_handle_t vmar_handle,
+zx_status_t zx_vmar_protect(zx_handle_t vmar_handle,
                             uintptr_t addr, size_t len,
                             uint32_t prot_flags);
 ```
@@ -19,38 +19,38 @@
 **vmar_protect**() alters the access protections for the memory mappings
 in the range of *len* bytes starting from *addr*. The *prot_flags* argument should
 be a bitwise-or of one or more of the following:
-- **MX_VM_FLAG_PERM_READ**  Map as readable.  It is an error if *vmar*
-  does not have *MX_VM_FLAG_CAN_MAP_READ* permissions or the *vmar* handle does
-  not have the *MX_RIGHT_READ* right.  It is also an error if the VMO handle
-  used to create the mapping did not have the *MX_RIGHT_READ* right.
-- **MX_VM_FLAG_PERM_WRITE**  Map as writable.  It is an error if *vmar*
-  does not have *MX_VM_FLAG_CAN_MAP_WRITE* permissions or the *vmar* handle does
-  not have the *MX_RIGHT_WRITE* right.  It is also an error if the VMO handle
-  used to create the mapping did not have the *MX_RIGHT_WRITE* right.
-- **MX_VM_FLAG_PERM_EXECUTE**  Map as executable.  It is an error if *vmar*
-  does not have *MX_VM_FLAG_CAN_MAP_EXECUTE* permissions or the *vmar* handle does
-  not have the *MX_RIGHT_EXECUTE* right.  It is also an error if the VMO handle
-  used to create the mapping did not have the *MX_RIGHT_EXECUTE* right.
+- **ZX_VM_FLAG_PERM_READ**  Map as readable.  It is an error if *vmar*
+  does not have *ZX_VM_FLAG_CAN_MAP_READ* permissions or the *vmar* handle does
+  not have the *ZX_RIGHT_READ* right.  It is also an error if the VMO handle
+  used to create the mapping did not have the *ZX_RIGHT_READ* right.
+- **ZX_VM_FLAG_PERM_WRITE**  Map as writable.  It is an error if *vmar*
+  does not have *ZX_VM_FLAG_CAN_MAP_WRITE* permissions or the *vmar* handle does
+  not have the *ZX_RIGHT_WRITE* right.  It is also an error if the VMO handle
+  used to create the mapping did not have the *ZX_RIGHT_WRITE* right.
+- **ZX_VM_FLAG_PERM_EXECUTE**  Map as executable.  It is an error if *vmar*
+  does not have *ZX_VM_FLAG_CAN_MAP_EXECUTE* permissions or the *vmar* handle does
+  not have the *ZX_RIGHT_EXECUTE* right.  It is also an error if the VMO handle
+  used to create the mapping did not have the *ZX_RIGHT_EXECUTE* right.
 
 If *len* is not page-aligned, it will be rounded up the next page boundary.
 
 ## RETURN VALUE
 
-**vmar_protect**() returns **MX_OK** on success.
+**vmar_protect**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *vmar_handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *vmar_handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *vmar_handle* is not a VMAR handle.
+**ZX_ERR_WRONG_TYPE**  *vmar_handle* is not a VMAR handle.
 
-**MX_ERR_INVALID_ARGS**  *prot_flags* is an unsupported combination of flags
+**ZX_ERR_INVALID_ARGS**  *prot_flags* is an unsupported combination of flags
 (e.g., **PROT_WRITE** but not **PROT_READ**), *addr* is not page-aligned,
 *len* is 0, or some subrange of the requested range is occupied by a subregion.
 
-**MX_ERR_NOT_FOUND**  Some subrange of the requested range is not mapped.
+**ZX_ERR_NOT_FOUND**  Some subrange of the requested range is not mapped.
 
-**MX_ERR_ACCESS_DENIED**  *vmar_handle* does not have the proper rights for the
+**ZX_ERR_ACCESS_DENIED**  *vmar_handle* does not have the proper rights for the
 requested change, the original VMO handle used to create the mapping did not
 have the rights for the requested change, or the VMAR itself does not allow
 the requested change.
diff --git a/docs/syscalls/vmar_unmap.md b/docs/syscalls/vmar_unmap.md
index 356d588..86c92e0 100644
--- a/docs/syscalls/vmar_unmap.md
+++ b/docs/syscalls/vmar_unmap.md
@@ -1,4 +1,4 @@
-# mx_vmar_unmap
+# zx_vmar_unmap
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmar_unmap(mx_handle_t vmar_handle,
+zx_status_t zx_vmar_unmap(zx_handle_t vmar_handle,
                           uintptr_t addr, size_t len);
 ```
 
@@ -26,20 +26,20 @@
 
 ## RETURN VALUE
 
-**vmar_unmap**() returns **MX_OK** on success.
+**vmar_unmap**() returns **ZX_OK** on success.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *vmar_handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *vmar_handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *vmar_handle* is not a VMAR handle.
+**ZX_ERR_WRONG_TYPE**  *vmar_handle* is not a VMAR handle.
 
-**MX_ERR_INVALID_ARGS**  *addr* is not page-aligned, *len* is 0, or the
+**ZX_ERR_INVALID_ARGS**  *addr* is not page-aligned, *len* is 0, or the
 requested range partially overlaps a sub-region.
 
-**MX_ERR_BAD_STATE**  *vmar_handle* refers to a destroyed handle.
+**ZX_ERR_BAD_STATE**  *vmar_handle* refers to a destroyed handle.
 
-**MX_ERR_NOT_FOUND**  Could not find the requested mapping.
+**ZX_ERR_NOT_FOUND**  Could not find the requested mapping.
 
 ## NOTES
 
diff --git a/docs/syscalls/vmar_unmap_handle_close_thread_exit.md b/docs/syscalls/vmar_unmap_handle_close_thread_exit.md
index 5d78735..f939b79 100644
--- a/docs/syscalls/vmar_unmap_handle_close_thread_exit.md
+++ b/docs/syscalls/vmar_unmap_handle_close_thread_exit.md
@@ -1,4 +1,4 @@
-# mx_vmar_unmap_handle_close_thread_exit
+# zx_vmar_unmap_handle_close_thread_exit
 
 ## NAME
 
@@ -7,23 +7,23 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmar_unmap_handle_close_thread_exit(mx_handle_t vmar_handle,
+zx_status_t zx_vmar_unmap_handle_close_thread_exit(zx_handle_t vmar_handle,
                                                    uintptr_t addr, size_t len,
-                                                   mx_handle_t close_handle);
+                                                   zx_handle_t close_handle);
 ```
 
 ## DESCRIPTION
 
 **vmar_unmap_handle_close_thread_exit**() does a sequence of three operations:
-1. `mx_vmar_unmap(vmar_handle, addr, len);`
-2. `mx_handle_close(close_handle);`
-3. `mx_thread_exit();`
+1. `zx_vmar_unmap(vmar_handle, addr, len);`
+2. `zx_handle_close(close_handle);`
+3. `zx_thread_exit();`
 
 The expectation is that the first operation unmaps a region including the
 calling thread's own stack.  (It's not required, but it's permitted.)  This
-is valid for this call, though it would be invalid for *mx_vmar_unmap*() or
+is valid for this call, though it would be invalid for *zx_vmar_unmap*() or
 any other call.
 
 If the *vmar_unmap* operation is successful, then this call never returns.
@@ -36,7 +36,7 @@
 
 ## ERRORS
 
-Same as [*mx_vmar_unmap*()](vmar_unmap.md).
+Same as [*zx_vmar_unmap*()](vmar_unmap.md).
 
 ## NOTES
 
diff --git a/docs/syscalls/vmo_clone.md b/docs/syscalls/vmo_clone.md
index 7807874..373bce8 100644
--- a/docs/syscalls/vmo_clone.md
+++ b/docs/syscalls/vmo_clone.md
@@ -1,4 +1,4 @@
-# mx_vmo_clone
+# zx_vmo_clone
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmo_clone(mx_handle_t handle, uint32_t options, uint64_t offset, uint64_t size, mx_handle_t* out);
+zx_status_t zx_vmo_clone(zx_handle_t handle, uint32_t options, uint64_t offset, uint64_t size, zx_handle_t* out);
 
 ```
 
@@ -25,7 +25,7 @@
 
 Valid flags:
 
-- *MX_VMO_CLONE_COPY_ON_WRITE* - Create a copy-on-write clone. The cloned vmo will
+- *ZX_VMO_CLONE_COPY_ON_WRITE* - Create a copy-on-write clone. The cloned vmo will
 behave the same way the parent does, except that any write operation on the clone
 will bring in a copy of the page at the offset the write occurred. The new page in
 the cloned vmo is now a copy and may diverge from the parent. Any reads from
@@ -43,19 +43,19 @@
 original with a few exceptions. See [vmo_create](vmo_create.md) for a
 discussion of the details of each right.
 
-If *options* is *MX_VMO_CLONE_COPY_ON_WRITE* the following rights are added:
+If *options* is *ZX_VMO_CLONE_COPY_ON_WRITE* the following rights are added:
 
-- **MX_RIGHT_WRITE**
+- **ZX_RIGHT_WRITE**
 
 *TEMPORARY* The following rights are added:
 
-- **MX_RIGHT_EXECUTE**
+- **ZX_RIGHT_EXECUTE**
 
-- **MX_RIGHT_MAP**
+- **ZX_RIGHT_MAP**
 
 ## NOTES
 
-### MX_VMO_CLONE_COPY_ON_WRITE
+### ZX_VMO_CLONE_COPY_ON_WRITE
 
 VMOs produced by this mode will interact with the VMO syscalls in the following
 ways:
@@ -72,21 +72,21 @@
 
 ## RETURN VALUE
 
-**vmo_clone**() returns **MX_OK** on success. In the event
+**vmo_clone**() returns **ZX_OK** on success. In the event
 of failure, a negative error value is returned.
 
 ## ERRORS
 
 **ERR_BAD_TYPE**  Input handle is not a VMO.
 
-**MX_ERR_ACCESS_DENIED**  Input handle does not have sufficient rights.
+**ZX_ERR_ACCESS_DENIED**  Input handle does not have sufficient rights.
 
-**MX_ERR_INVALID_ARGS**  *out* is an invalid pointer or NULL
+**ZX_ERR_INVALID_ARGS**  *out* is an invalid pointer or NULL
 or the offset is not page aligned.
 
-**MX_ERR_OUT_OF_RANGE**  *offset* + *size* is too large.
+**ZX_ERR_OUT_OF_RANGE**  *offset* + *size* is too large.
 
-**MX_ERR_NO_MEMORY**  Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  Failure due to lack of memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vmo_create.md b/docs/syscalls/vmo_create.md
index a40255c..fa83258 100644
--- a/docs/syscalls/vmo_create.md
+++ b/docs/syscalls/vmo_create.md
@@ -1,4 +1,4 @@
-# mx_vmo_create
+# zx_vmo_create
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmo_create(uint64_t size, uint32_t options, mx_handle_t* out);
+zx_status_t zx_vmo_create(uint64_t size, uint32_t options, zx_handle_t* out);
 
 ```
 
@@ -24,37 +24,37 @@
 
 The following rights will be set on the handle by default:
 
-**MX_RIGHT_DUPLICATE** - The handle may be duplicated.
+**ZX_RIGHT_DUPLICATE** - The handle may be duplicated.
 
-**MX_RIGHT_TRANSFER** - The handle may be transferred to another process.
+**ZX_RIGHT_TRANSFER** - The handle may be transferred to another process.
 
-**MX_RIGHT_READ** - May be read from or mapped with read permissions.
+**ZX_RIGHT_READ** - May be read from or mapped with read permissions.
 
-**MX_RIGHT_WRITE** - May be written to or mapped with write permissions.
+**ZX_RIGHT_WRITE** - May be written to or mapped with write permissions.
 
-**MX_RIGHT_EXECUTE** - May be mapped with execute permissions.
+**ZX_RIGHT_EXECUTE** - May be mapped with execute permissions.
 
-**MX_RIGHT_MAP** - May be mapped.
+**ZX_RIGHT_MAP** - May be mapped.
 
-**MX_RIGHT_GET_PROPERTY** - May get its properties using
+**ZX_RIGHT_GET_PROPERTY** - May get its properties using
 [object_get_property](object_get_property).
 
-**MX_RIGHT_SET_PROPERTY** - May set its properties using
+**ZX_RIGHT_SET_PROPERTY** - May set its properties using
 [object_set_property](object_set_property).
 
 The *options* field is currently unused and must be set to 0.
 
 ## RETURN VALUE
 
-**vmo_create**() returns **MX_OK** on success. In the event
+**vmo_create**() returns **ZX_OK** on success. In the event
 of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_INVALID_ARGS**  *out* is an invalid pointer or NULL or *options* is
+**ZX_ERR_INVALID_ARGS**  *out* is an invalid pointer or NULL or *options* is
 any value other than 0.
 
-**MX_ERR_NO_MEMORY**  Failure due to lack of memory.
+**ZX_ERR_NO_MEMORY**  Failure due to lack of memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vmo_get_size.md b/docs/syscalls/vmo_get_size.md
index 0d64d24..9d4798c 100644
--- a/docs/syscalls/vmo_get_size.md
+++ b/docs/syscalls/vmo_get_size.md
@@ -1,4 +1,4 @@
-# mx_vmo_get_size
+# zx_vmo_get_size
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmo_get_size(mx_handle_t handle, uint64_t* size);
+zx_status_t zx_vmo_get_size(zx_handle_t handle, uint64_t* size);
 
 ```
 
@@ -19,16 +19,16 @@
 
 ## RETURN VALUE
 
-**vmo_get_size**() returns **MX_OK** on success. In the event
+**vmo_get_size**() returns **ZX_OK** on success. In the event
 of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
 
-**MX_ERR_INVALID_ARGS**  *size* is an invalid pointer or NULL.
+**ZX_ERR_INVALID_ARGS**  *size* is an invalid pointer or NULL.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vmo_op_range.md b/docs/syscalls/vmo_op_range.md
index 3afcd27..ad172ec 100644
--- a/docs/syscalls/vmo_op_range.md
+++ b/docs/syscalls/vmo_op_range.md
@@ -1,4 +1,4 @@
-# mx_vmo_op_range
+# zx_vmo_op_range
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmo_op_range(mx_handle_t handle, uint32_t op,
+zx_status_t zx_vmo_op_range(zx_handle_t handle, uint32_t op,
                             uint64_t offset, uint64_t size,
                             void* buffer, size_t buffer_size);
 
@@ -25,51 +25,51 @@
 
 *op* the operation to perform:
 
-*buffer* and *buffer_size* are used to store the addresses returned by *MX_VMO_OP_LOOKUP*.
+*buffer* and *buffer_size* are used to store the addresses returned by *ZX_VMO_OP_LOOKUP*.
 
-**MX_VMO_OP_COMMIT** - Commit *size* bytes worth of pages starting at byte *offset* for the VMO.
+**ZX_VMO_OP_COMMIT** - Commit *size* bytes worth of pages starting at byte *offset* for the VMO.
 More information can be found in the [vm object documentation](../objects/vm_object.md).
 
-**MX_VMO_OP_DECOMMIT** - Release a range of pages previously commited to the VMO from *offset* to *offset*+*size*.
+**ZX_VMO_OP_DECOMMIT** - Release a range of pages previously commited to the VMO from *offset* to *offset*+*size*.
 
-**MX_VMO_OP_LOCK** - Presently unsupported.
+**ZX_VMO_OP_LOCK** - Presently unsupported.
 
-**MX_VMO_OP_UNLOCK** - Presently unsupported.
+**ZX_VMO_OP_UNLOCK** - Presently unsupported.
 
-**MX_VMO_OP_LOOKUP** - Returns a list of physical addresses (paddr_t) corresponding to the pages held by the VMO
+**ZX_VMO_OP_LOOKUP** - Returns a list of physical addresses (paddr_t) corresponding to the pages held by the VMO
 from *offset* to *offset*+*size*. The result is stored in *buffer*, up to *buffer_size* bytes.
 The returned physical addresses are aligned to page boundaries. So if the provided offset
 is not page aligned, the first physical address returned will match the beginning of the page containing
 the offset, not the actual physical address corresponding to the offset.
 
-**MX_VMO_OP_CACHE_SYNC** - Performs a cache sync operation.
+**ZX_VMO_OP_CACHE_SYNC** - Performs a cache sync operation.
 
-**MX_VMO_OP_CACHE_INVALIDATE** - Performs a cache invalidation operation.
+**ZX_VMO_OP_CACHE_INVALIDATE** - Performs a cache invalidation operation.
 
-**MX_VMO_OP_CACHE_CLEAN** - Performs a cache clean operation.
+**ZX_VMO_OP_CACHE_CLEAN** - Performs a cache clean operation.
 
-**MX_VMO_OP_CACHE_CLEAN_INVALIDATE** - Performs cache clean and invalidate operations together.
+**ZX_VMO_OP_CACHE_CLEAN_INVALIDATE** - Performs cache clean and invalidate operations together.
 
 
 ## RETURN VALUE
 
-**vmo_op_range**() returns **MX_OK** on success. In the event of failure, a negative error
+**vmo_op_range**() returns **ZX_OK** on success. In the event of failure, a negative error
 value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_OUT_OF_RANGE**  An invalid memory range specified by *offset* and *size*.
+**ZX_ERR_OUT_OF_RANGE**  An invalid memory range specified by *offset* and *size*.
 
-**MX_ERR_NO_MEMORY**  Allocations to commit pages for *MX_VMO_OP_COMMIT* failed.
+**ZX_ERR_NO_MEMORY**  Allocations to commit pages for *ZX_VMO_OP_COMMIT* failed.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
 
-**MX_ERR_INVALID_ARGS**  *out* is an invalid pointer, *op* is not a valid operation, *op* is
-*MX_VMO_LOOPUP* and *buffer* is an invalid pointer, or *size* is zero and *op* is a cache operation.
+**ZX_ERR_INVALID_ARGS**  *out* is an invalid pointer, *op* is not a valid operation, *op* is
+*ZX_VMO_LOOPUP* and *buffer* is an invalid pointer, or *size* is zero and *op* is a cache operation.
 
-**MX_ERR_NOT_SUPPORTED**  *op* was *MX_VMO_OP_LOCK* or *MX_VMO_OP_UNLOCK*.
+**ZX_ERR_NOT_SUPPORTED**  *op* was *ZX_VMO_OP_LOCK* or *ZX_VMO_OP_UNLOCK*.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vmo_read.md b/docs/syscalls/vmo_read.md
index 51a88e3..da25bf0 100644
--- a/docs/syscalls/vmo_read.md
+++ b/docs/syscalls/vmo_read.md
@@ -1,4 +1,4 @@
-# mx_vmo_read
+# zx_vmo_read
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmo_read(mx_handle_t handle, void* data, uint64_t offset, size_t len,
+zx_status_t zx_vmo_read(zx_handle_t handle, void* data, uint64_t offset, size_t len,
                         size_t* actual);
 
 ```
@@ -26,24 +26,24 @@
 
 *actual* returns the actual number of bytes read, which may be anywhere from 0 to *len*. If
 a read extends beyond the size of the VMO, the actual bytes read will be trimmed. If the
-read starts at or beyond the size of the VMO, **MX_ERR_OUT_OF_RANGE** will be returned.
+read starts at or beyond the size of the VMO, **ZX_ERR_OUT_OF_RANGE** will be returned.
 
 ## RETURN VALUE
 
-**mx_vmo_read**() returns **MX_OK** on success. In the event of failure, a negative error
+**zx_vmo_read**() returns **ZX_OK** on success. In the event of failure, a negative error
 value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have the **MX_RIGHT_READ** right.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have the **ZX_RIGHT_READ** right.
 
-**MX_ERR_INVALID_ARGS**  *actual* or *data* is an invalid pointer or NULL.
+**ZX_ERR_INVALID_ARGS**  *actual* or *data* is an invalid pointer or NULL.
 
-**MX_ERR_OUT_OF_RANGE**  *offset* starts at or beyond the end of the VMO.
+**ZX_ERR_OUT_OF_RANGE**  *offset* starts at or beyond the end of the VMO.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vmo_set_cache_policy.md b/docs/syscalls/vmo_set_cache_policy.md
index b25b637..995b046 100644
--- a/docs/syscalls/vmo_set_cache_policy.md
+++ b/docs/syscalls/vmo_set_cache_policy.md
@@ -1,4 +1,4 @@
-# mx_vmo_op_range
+# zx_vmo_op_range
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t vmo_set_cache_policy(mx_handle_t handle, uint32_t cache_policy);
+zx_status_t vmo_set_cache_policy(zx_handle_t handle, uint32_t cache_policy);
 
 ```
 
@@ -18,42 +18,42 @@
 **vmo_set_cache_policy()** sets caching policy for a VMO holding physical
 memory. Such VMOs are generally only handed to userspace via bus protocol
 interfaces, so this syscall will typically only be used by drivers dealing with
-device memory. A handle must have the *MX_RIGHT_MAP* right for this call to be
+device memory. A handle must have the *ZX_RIGHT_MAP* right for this call to be
 permitted. Additionally, the VMO must not presently be mapped by any process,
 and the cache policy must not have been set prior to this call.
 
 *cache_policy* cache flags to use:
 
-**MX_CACHE_POLICY_CACHED** - Use hardware caching.
+**ZX_CACHE_POLICY_CACHED** - Use hardware caching.
 
-**MX_CACHE_POLICY_UNCACHED** - Disable caching.
+**ZX_CACHE_POLICY_UNCACHED** - Disable caching.
 
-**MX_CACHE_POLICY_UNCACHED_DEVICE** - Disable cache and treat as device memory.
+**ZX_CACHE_POLICY_UNCACHED_DEVICE** - Disable cache and treat as device memory.
 This is architecture dependent and may be equivalent to
-*MX_CACHE_POLICY_UNCACHED* on some architectures.
+*ZX_CACHE_POLICY_UNCACHED* on some architectures.
 
-**MX_CACHE_POLICY_WRITE_COMBINING** - Use write combining. This is architecture
-dependent and may be equivalent to *MX_CACHE_POLICY_UNCACHED*.
+**ZX_CACHE_POLICY_WRITE_COMBINING** - Use write combining. This is architecture
+dependent and may be equivalent to *ZX_CACHE_POLICY_UNCACHED*.
 
 ## RETURN VALUE
 
-**vmo_set_cache_policy()** returns **MX_OK** on success. In the event of
+**vmo_set_cache_policy()** returns **ZX_OK** on success. In the event of
 failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_ACCESS_DENIED** Cache policy has been configured for this VMO already and
-may not be changed, or *handle* lacks the MX_RIGHT_MAP right.
+**ZX_ERR_ACCESS_DENIED** Cache policy has been configured for this VMO already and
+may not be changed, or *handle* lacks the ZX_RIGHT_MAP right.
 
-**MX_ERR_BAD_HANDLE** *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE** *handle* is not a valid handle.
 
-**MX_ERR_INVALID_ARGS** *cache_policy* contains flags outside of the ones listed
+**ZX_ERR_INVALID_ARGS** *cache_policy* contains flags outside of the ones listed
 above, or *cache_policy* contains an invalid mix of cache policy flags.
 
-**MX_ERR_NOT_SUPPORTED** The VMO *handle* corresponds to is not one holding
+**ZX_ERR_NOT_SUPPORTED** The VMO *handle* corresponds to is not one holding
 physical memory.
 
-**MX_ERR_BAD_STATE** Cache policy cannot be changed because the VMO is presently
+**ZX_ERR_BAD_STATE** Cache policy cannot be changed because the VMO is presently
 mapped.
 
 ## SEE ALSO
diff --git a/docs/syscalls/vmo_set_size.md b/docs/syscalls/vmo_set_size.md
index ce3e8fa..f8f6f1f 100644
--- a/docs/syscalls/vmo_set_size.md
+++ b/docs/syscalls/vmo_set_size.md
@@ -1,4 +1,4 @@
-# mx_vmo_set_size
+# zx_vmo_set_size
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmo_set_size(mx_handle_t handle, uint64_t size);
+zx_status_t zx_vmo_set_size(zx_handle_t handle, uint64_t size);
 
 ```
 
@@ -19,20 +19,20 @@
 
 ## RETURN VALUE
 
-**vmo_set_size**() returns **MX_OK** on success. In the event
+**vmo_set_size**() returns **ZX_OK** on success. In the event
 of failure, a negative error value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have the **MX_RIGHT_WRITE** right.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have the **ZX_RIGHT_WRITE** right.
 
-**MX_ERR_OUT_OF_RANGE**  Requested size is too large.
+**ZX_ERR_OUT_OF_RANGE**  Requested size is too large.
 
-**MX_ERR_NO_MEMORY**  Failure due to lack of system memory.
+**ZX_ERR_NO_MEMORY**  Failure due to lack of system memory.
 
 ## SEE ALSO
 
diff --git a/docs/syscalls/vmo_write.md b/docs/syscalls/vmo_write.md
index cfabe1a..603e387 100644
--- a/docs/syscalls/vmo_write.md
+++ b/docs/syscalls/vmo_write.md
@@ -1,4 +1,4 @@
-# mx_vmo_write
+# zx_vmo_write
 
 ## NAME
 
@@ -7,9 +7,9 @@
 ## SYNOPSIS
 
 ```
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-mx_status_t mx_vmo_write(mx_handle_t handle, const void* data, uint64_t offset,
+zx_status_t zx_vmo_write(zx_handle_t handle, const void* data, uint64_t offset,
                          size_t len, size_t* actual);
 
 ```
@@ -25,27 +25,27 @@
 
 *actual* returns the actual number of bytes written, which may be anywhere from 0 to *len*. If
 a write extends beyond the size of the VMO, the actual bytes written will be trimmed to the end
-of the VMO. If the write starts at or beyond the size of the VMO, **MX_ERR_OUT_OF_RANGE** will be
+of the VMO. If the write starts at or beyond the size of the VMO, **ZX_ERR_OUT_OF_RANGE** will be
 returned.
 
 ## RETURN VALUE
 
-**mx_vmo_write**() returns **MX_OK** on success. In the event of failure, a negative error
+**zx_vmo_write**() returns **ZX_OK** on success. In the event of failure, a negative error
 value is returned.
 
 ## ERRORS
 
-**MX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
+**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
 
-**MX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
+**ZX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
 
-**MX_ERR_ACCESS_DENIED**  *handle* does not have the **MX_RIGHT_WRITE** right.
+**ZX_ERR_ACCESS_DENIED**  *handle* does not have the **ZX_RIGHT_WRITE** right.
 
-**MX_ERR_INVALID_ARGS**  *actual* or *data* is an invalid pointer or NULL.
+**ZX_ERR_INVALID_ARGS**  *actual* or *data* is an invalid pointer or NULL.
 
-**MX_ERR_NO_MEMORY**  Failure to allocate system memory to complete write.
+**ZX_ERR_NO_MEMORY**  Failure to allocate system memory to complete write.
 
-**MX_ERR_OUT_OF_RANGE**  *offset* starts at or beyond the end of the VMO.
+**ZX_ERR_OUT_OF_RANGE**  *offset* starts at or beyond the end of the VMO.
 
 ## SEE ALSO
 
diff --git a/docs/sysret_problem.md b/docs/sysret_problem.md
index 36f2975..302569a 100644
--- a/docs/sysret_problem.md
+++ b/docs/sysret_problem.md
@@ -19,7 +19,7 @@
   will be non-canonical.
 
 * We disallow setting the RIP register to a non-canonical address using
-  **mx_thread_write_state**() when the address would be used with SYSRET.
+  **zx_thread_write_state**() when the address would be used with SYSRET.
 
 For more background, see "A Stitch In Time Saves Nine: A Case Of Multiple
 OS Vulnerability", Rafal Wojtczuk
diff --git a/docs/targets/acer12.md b/docs/targets/acer12.md
index 75834ff..be028f2 100644
--- a/docs/targets/acer12.md
+++ b/docs/targets/acer12.md
@@ -11,7 +11,7 @@
 ## Entering the BIOS
 With the machine off, Press and hold Volume Up, then continue to hold while pressing and holding the Power button.  Let go of the Power button when the display backlight turns on.  Alternatively, hold F2 on an attached keyboard while powering the machine on.
 
-## Enabling Magenta Boot
+## Enabling Zircon Boot
 1. Boot the machine and enter the BIOS
 2. Select “Security” from the tabs at the left
 3. Tap the “[clean]” gray bar under “Supervisor Password Is”
@@ -57,18 +57,18 @@
 1. Build everything
   * `(cd $FUCHSIA_ROOT; fbuild)`
 2. Format your USB Flash Drive with a FAT32 partition as the first partition
-3. Copy `$FUCHSIA_ROOT/out/build-magenta/build-magenta-pc-x86-64/bootloader/bootx64.efi` to `EFI/BOOT/BOOTX64.EFI` on the USB Flash Drive.
+3. Copy `$FUCHSIA_ROOT/out/build-zircon/build-zircon-pc-x86-64/bootloader/bootx64.efi` to `EFI/BOOT/BOOTX64.EFI` on the USB Flash Drive.
 If you plan to netboot, you're done.
-4. Copy `$FUCHSIA_ROOT/out/build-magenta/build-magenta-pc-x86-64/magenta.bin` to the root of the USB Flash Drive
+4. Copy `$FUCHSIA_ROOT/out/build-zircon/build-zircon-pc-x86-64/zircon.bin` to the root of the USB Flash Drive
 5. Optionally copy an additional bootfs image to `ramdisk.bin` on the root of the USB Flash Drive (for a Fuchsia build, a bootfs image can be found at `$FUCHSIA_ROOT/out/debug-x86-64/user.bootfs`)
 
-If you need to boot magenta over the network, skip step 4 and/or delete
-magenta.bin from the root of the USB Flash Drive.
+If you need to boot zircon over the network, skip step 4 and/or delete
+zircon.bin from the root of the USB Flash Drive.
 
 ## Quirks
 It has been observed that USB initialization is racy on a cold boot.  So if you're starting from a cold boot and trying to boot to USB, you may find that you boot to disk instead.
 
 Mitigations:
-- It's useful to use a `cmdline` file to set `magenta.nodename=foo` to know during the boot screen whether you're booting from USB or disk.
+- It's useful to use a `cmdline` file to set `zircon.nodename=foo` to know during the boot screen whether you're booting from USB or disk.
 - If the Acer is booting from disk and you want to boot from USB, remove and reinsert the USB drive, then reboot with `ctrl-alt-del` (not the power button.)
 - You can tell from the bios whether USB has been initialized because it will name the USB device.
diff --git a/docs/targets/hikey960.md b/docs/targets/hikey960.md
index 7a39683..3ccfe7c 100644
--- a/docs/targets/hikey960.md
+++ b/docs/targets/hikey960.md
@@ -1,4 +1,4 @@
-#  Magenta on 96boards.org HiKey960
+#  Zircon on 96boards.org HiKey960
 
 ## Requirements
 
@@ -26,11 +26,11 @@
 + [AOSP HiKey960 Information](https://source.android.com/source/devices#hikey960)
 
 ## Building
-To build magenta, invoke the following command from the top level Magenta
+To build zircon, invoke the following command from the top level Zircon
 directory (ensure that you have checked out the ARM64 toolchains). For more
 information, see `docs/getting_started.md`:
 
-      make magenta-hikey960-arm64
+      make zircon-hikey960-arm64
 
 ## Setup
 Periodically check this file as the setup workflow will change/improve.
@@ -59,7 +59,7 @@
 
 In order to flash the board, it will need to be connected to your workstation via the USB-C OTG connection on the HiKey960.
 
-To install Magenta, the HiKey960 will need to be placed in fastboot mode.  This can be done in one of two ways:
+To install Zircon, the HiKey960 will need to be placed in fastboot mode.  This can be done in one of two ways:
 
 1. Using the DIP switches on the back of the board.  To place in fastboot mode the switches should be in the following positions:
 
@@ -87,7 +87,7 @@
         usbloader: usb: online (highspeed)
         usb: [USBFINFO]usb enum done
 
-Once the board is in fastboot, the following script can be run from the magenta root director to flash the necessary files onto the board:
+Once the board is in fastboot, the following script can be run from the zircon root director to flash the necessary files onto the board:
 
         ./scripts/flash-hikey
 
diff --git a/docs/targets/nuc.md b/docs/targets/nuc.md
index e98acff..79d71f7 100644
--- a/docs/targets/nuc.md
+++ b/docs/targets/nuc.md
@@ -21,10 +21,10 @@
 
 ## GigaBoot20x6 Setup
 1. Format the first partition on a USB flash drive as FAT.
-2. Build Magenta for x86-64
-3. The bootloader is here: build-magenta-pc-x86-64/bootloader/bootx64.efi
+2. Build Zircon for x86-64
+3. The bootloader is here: build-zircon-pc-x86-64/bootloader/bootx64.efi
 4. Copy `bootx64.efi` to `/EFI/BOOT/BOOTX64.EFI` on the USB flash drive.
 4. Use this flash drive to network boot.
-5. If you copy `magenta.bin` to `/magenta.bin` on the flash drive it will boot from the flash drive instead of the network.
+5. If you copy `zircon.bin` to `/zircon.bin` on the flash drive it will boot from the flash drive instead of the network.
 
 ## Important: network booting only works with the *built-in* ethernet port on the NUC, not via a USB dongle.
diff --git a/docs/targets/rpi3.md b/docs/targets/rpi3.md
index a0c583e..c74a04f 100644
--- a/docs/targets/rpi3.md
+++ b/docs/targets/rpi3.md
@@ -1,6 +1,6 @@
-#  Magenta on Raspberry Pi 3
+#  Zircon on Raspberry Pi 3
 
-Magenta is a 64-bit kernel that is capable of running on the Raspberry Pi 3.
+Zircon is a 64-bit kernel that is capable of running on the Raspberry Pi 3.
 
 Presently it supports a number of the Raspberry Pi 3's peripherals including
 the following:
@@ -25,29 +25,29 @@
     - USB Keyboard / HDMI Monitor
 
 ## Building
-To build magenta, invoke the following command from the top level Magenta
+To build zircon, invoke the following command from the top level Zircon
 directory (ensure that you have checked out the ARM64 toolchains). For more
 information, see `docs/getting_started.md`:
 
-    make magenta-rpi3-arm64
+    make zircon-rpi3-arm64
 
 ## Installing
-1. To install Magenta, ensure that your SD is formatted as follows:
+1. To install Zircon, ensure that your SD is formatted as follows:
    + Using an MBR partition table
    + With a FAT32 boot partition
 
-2. Invoking `make magenta-rpi3-arm64` should have created files `magenta.bin`
-   and `bootdata.bin` the following path `./build-magenta-rpi3-arm64/`
+2. Invoking `make zircon-rpi3-arm64` should have created files `zircon.bin`
+   and `bootdata.bin` the following path `./build-zircon-rpi3-arm64/`
 
 
-3. Copy the `magenta.bin` file to the SD card's boot partition as `kernel8.img`
+3. Copy the `zircon.bin` file to the SD card's boot partition as `kernel8.img`
    as follows:
 
-        cp ./build-magenta-rpi3-arm64/magenta.bin <path/to/sdcard/mount>/kernel8.img
+        cp ./build-zircon-rpi3-arm64/zircon.bin <path/to/sdcard/mount>/kernel8.img
 
 4. Copy the `bootdata.bin` file to the SD card's boot partition as follows:
 
-        cp ./build-magenta-rpi3-arm64/bootdata.bin <path/to/sdcard/mount>/bootdata.bin
+        cp ./build-zircon-rpi3-arm64/bootdata.bin <path/to/sdcard/mount>/bootdata.bin
 
 5. You must also copy `bootcode.bin` and `start.elf` to the boot partition. They
    can be obtained from [here](https://github.com/raspberrypi/firmware/raw/7fcb39cb5b5543ca7485cd1ae9e6d908f31e40c6/boot/bootcode.bin) and [here](https://github.com/raspberrypi/firmware/raw/390f53ed0fd79df274bdcc81d99e09fa262f03ab/boot/start.elf) respectively.
diff --git a/docs/testing.md b/docs/testing.md
index a321ae9..0d42273 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -34,7 +34,7 @@
 should be parsed using the [unittest header][unittest-header], as it may be
 updated in the future).
 
-## Magenta Tests (ulib/test, and/or using ulib/unittest)
+## Zircon Tests (ulib/test, and/or using ulib/unittest)
 
 The following macros can be used to filter tests into these categories:
 ```
diff --git a/docs/thread_annotations.md b/docs/thread_annotations.md
index 5c47f35..85eb405 100644
--- a/docs/thread_annotations.md
+++ b/docs/thread_annotations.md
@@ -1,6 +1,6 @@
-# Magenta thread safety annotations
+# Zircon thread safety annotations
 
-Magenta code takes advantage of clang's thread safety analysis feature to
+Zircon code takes advantage of clang's thread safety analysis feature to
 document and machine-verify some of our synchronization invariants. These
 annotations are checked when building for clang (see
 [getting started](getting_started.md) for instructions on building with
@@ -10,11 +10,11 @@
 
 [Clang's documentation](https://clang.llvm.org/docs/ThreadSafetyAnalysis.html)
 
-In Magenta, we provide our own set of macros wrapping the annotations and have
+In Zircon, we provide our own set of macros wrapping the annotations and have
 annotated our synchronization primitives. When writing new code involving
 synchronization or annotating existing code, in most cases you should use the
 thread annotation macros provided by
-[system/private/magenta/thread\_annotations.h](../system/private/magenta/thread_annotations.h). These macros all begin with
+[system/private/zircon/thread\_annotations.h](../system/private/zircon/thread_annotations.h). These macros all begin with
 the prefix `"TA_"` for thread analysis. The most commonly used ones are:
 
 * `TA_GUARDED(x)` the annotated variable is guarded by the capability (e.g. lock) `x`
@@ -80,7 +80,7 @@
 
 Library code exposed through the sysroot must use the more awkwardly named
 macros provided by
-[system/public/magenta/compiler.h](../system/public/magenta/compiler.h) to
+[system/public/zircon/compiler.h](../system/public/zircon/compiler.h) to
 avoid collisions with consumers of the sysroot.
 
 ## Best practices
diff --git a/docs/time.md b/docs/time.md
index 414627b..b5b3ac9 100644
--- a/docs/time.md
+++ b/docs/time.md
@@ -2,9 +2,9 @@
 
 ## Userspace exposed time units
 
-*mx\_time\_t* is in nanoseconds.
+*zx\_time\_t* is in nanoseconds.
 
-Use [mx_time_get()](syscalls/time_get.md) to get the current time.
+Use [zx_time_get()](syscalls/time_get.md) to get the current time.
 
 ## Kernel-internal time units
 
diff --git a/docs/tracing/design.md b/docs/tracing/design.md
index 0102fd2..b44f819 100644
--- a/docs/tracing/design.md
+++ b/docs/tracing/design.md
@@ -7,7 +7,7 @@
 
 The purpose of Fuchsia tracing is to provide a means to collect, aggregate,
 and visualize diagnostic tracing information from Fuchsia user space
-processes and from the Magenta kernel.
+processes and from the Zircon kernel.
 
 ## Design Goals
 
@@ -163,8 +163,8 @@
 
   // Start a thread for the loop to run on.
   // We could instead use async_loop_run() to run on the current thread.
-  mx_status_t status = loop.StartThread();
-  if (status != MX_OK) exit(1);
+  zx_status_t status = loop.StartThread();
+  if (status != ZX_OK) exit(1);
 
   // Create the trace provider.
   trace::TraceProvider trace_provider(loop.async());
@@ -183,18 +183,18 @@
 #include <trace-provider/provider.h>
 
 int main(int argc, char** argv) {
-  mx_status_t status;
+  zx_status_t status;
   async_t* async;
   trace_provider_t* trace_provider;
 
   // Create a message loop.
   status = async_loop_create(NULL, &async);
-  if (status != MX_OK) exit(1);
+  if (status != ZX_OK) exit(1);
 
   // Start a thread for the loop to run on.
   // We could instead use async_loop_run() to run on the current thread.
   status = async_loop_start_thread(async, "loop", NULL);
-  if (status != MX_OK) exit(1);
+  if (status != ZX_OK) exit(1);
 
   // Create the trace provider.
   trace_provider = trace_provider_create(async);
diff --git a/docs/tracing/trace_format.md b/docs/tracing/trace_format.md
index 093f20c..8f91d9e 100644
--- a/docs/tracing/trace_format.md
+++ b/docs/tracing/trace_format.md
@@ -170,7 +170,7 @@
 ### Kernel Object Information
 
 Traces can include annotations about kernel objects (anything that can be
-referenced using a Magenta koid such as a process, channel, or event)
+referenced using a Zircon koid such as a process, channel, or event)
 form of **Kernel Object Records**.  Trace providers typically generate such
 records when the object is created.
 
@@ -402,7 +402,7 @@
 
 #### Instant Event (event type = 0)
 
-Marks a moment in time on this thread.  These are equivalent to Magenta
+Marks a moment in time on this thread.  These are equivalent to Zircon
 kernel probes.
 
 ##### Format
@@ -588,7 +588,7 @@
 _header word_
 - `[0 .. 3]`: record type (7)
 - `[4 .. 15]`: record size (inclusive of this word) as a multiple of 8 bytes
-- `[16 .. 23]`: kernel object type (one of the MX_OBJ_TYPE_XXX constants from <magenta/syscalls/object.h>)
+- `[16 .. 23]`: kernel object type (one of the ZX_OBJ_TYPE_XXX constants from <zircon/syscalls/object.h>)
 - `[24 .. 39]`: name (string ref)
 - `[40 .. 43]`: number of arguments
 - `[44 .. 63]`: reserved (must be zero)
@@ -610,7 +610,7 @@
 
 _This information may not always be available._
 
-- `“process”`: for `MX_OBJ_TYPE_THREAD` objects, specifies the koid of the
+- `“process”`: for `ZX_OBJ_TYPE_THREAD` objects, specifies the koid of the
   process which contains the thread
 
 ### Context Switch Record (record type = 8)
@@ -658,7 +658,7 @@
 - `4`: dying
 - `5`: dead
 
-These values align with the `MX_THREAD_STATE_XXX` constants from <magenta/syscalls/object.h>.
+These values align with the `ZX_THREAD_STATE_XXX` constants from <zircon/syscalls/object.h>.
 
 ### Log Record (record type = 9)
 
diff --git a/docs/userboot.md b/docs/userboot.md
index fbda5c2..77e5023 100644
--- a/docs/userboot.md
+++ b/docs/userboot.md
@@ -1,11 +1,11 @@
-# Magenta kernel to userspace bootstrapping (`userboot`)
+# Zircon kernel to userspace bootstrapping (`userboot`)
 
-Magenta has a microkernel style of design.  A complexity for microkernel
+Zircon has a microkernel style of design.  A complexity for microkernel
 designs is how to bootstrap the initial userspace processes.  Often this
 is accomplished by having the kernel implement minimal versions of
 filesystem reading and program loading just for the purpose of
 bootstrapping, even when those kernel facilities are never used after boot
-time.  Magenta takes a different approach.
+time.  Zircon takes a different approach.
 
 [TOC]
 
@@ -13,9 +13,9 @@
 
 A boot loader loads the kernel into memory and transfers control to the
 kernel's startup code.  The details of the boot loader protocols are not
-described here.  The boot loaders used with Magenta load both the kernel
+described here.  The boot loaders used with Zircon load both the kernel
 image and a data blob in `BOOTDATA` format.
-The [`BOOTDATA` format](../system/public/magenta/boot/bootdata.h) is a
+The [`BOOTDATA` format](../system/public/zircon/boot/bootdata.h) is a
 simple container format that embeds items passed by the boot loader,
 including hardware-specific information,
 the [kernel "command line"](kernel_cmdline.md) giving boot options, and RAM
@@ -172,7 +172,7 @@
 down the system (as if by the `dm shutdown` command).  This can be useful
 to run a single test program and then shut down the machine (or emulator).
 For example, the command line `userboot=bin/core-tests userboot.shutdown`
-runs the Magenta core tests and then shuts down.
+runs the Zircon core tests and then shuts down.
 
 Otherwise, `userboot` does not wait for the process to exit.  `userboot`
 exits immediately, leaving the first "real" user process in charge of
diff --git a/docs/vdso.md b/docs/vdso.md
index a07b260..089a287 100644
--- a/docs/vdso.md
+++ b/docs/vdso.md
@@ -1,7 +1,7 @@
-# Magenta vDSO
+# Zircon vDSO
 
-The Magenta vDSO is the sole means of access to [system calls](syscalls.md)
-in Magenta.  vDSO stands for *virtual Dynamic Shared Object*.  (*Dynamic
+The Zircon vDSO is the sole means of access to [system calls](syscalls.md)
+in Zircon.  vDSO stands for *virtual Dynamic Shared Object*.  (*Dynamic
 Shared Object* is a term used for a shared library in the ELF format.)
 It's *virtual* because it's not loaded from an ELF file that sits in a
 filesystem.  Instead, the vDSO image is provided directly by the kernel.
@@ -91,8 +91,8 @@
 capable of making system calls must have access to the vDSO VMO.
 
 By convention, a VMO handle for the vDSO is passed from process to process
-in the `mx_proc_args_t` bootstrap message sent to each new process
-(see [`<magenta/processargs.h>`](../system/public/magenta/processargs.h)).
+in the `zx_proc_args_t` bootstrap message sent to each new process
+(see [`<zircon/processargs.h>`](../system/public/zircon/processargs.h)).
 The VMO handle's entry in the handle table is identified by the *handle
 info entry* `PA_HND(PA_VMO_VDSO, 0)`.
 
@@ -105,7 +105,7 @@
 C++ and assembly code used in the implementation of the vDSO.  Both the
 public API and the private interface between the kernel and the vDSO code
 are specified by
-[`<magenta/syscalls.sysgen>`](../system/public/magenta/syscalls.sysgen),
+[`<zircon/syscalls.sysgen>`](../system/public/zircon/syscalls.sysgen),
 which is the input to `sysgen`.
 
 The `syscall` entries in `syscalls.sysgen` fall into the following groups,
@@ -115,19 +115,19 @@
    (which are the majority of the system calls) where the public API and
    the private API are exactly the same.  These are implemented entirely
    by generated code.  The public API functions have names prefixed by
-   `_mx_` and `mx_` (aliases).
+   `_zx_` and `zx_` (aliases).
 
 * `vdsocall` entries are simply declarations for the public API.
   These functions are implemented by normal, hand-written C++ code found
-  in [`system/ulib/magenta/`](../system/ulib/magenta/).  Those source
+  in [`system/ulib/zircon/`](../system/ulib/zircon/).  Those source
   files `#include "private.h"` and then define the C++ function for the
-  system call with its name prefixed by `_mx_`.  Finally, they use the
+  system call with its name prefixed by `_zx_`.  Finally, they use the
   `VDSO_INTERFACE_FUNCTION` macro on the system call's name prefixed by
-  `mx_` (no leading underscore).  This implementation code can call the
+  `zx_` (no leading underscore).  This implementation code can call the
   C++ function for any other system call entry (whether a public
   generated call, a public hand-written `vdsocall`, or an `internal`
   generated call), but must use its private entry point alias, which has
-  the `VDSO_mx`_ prefix.  Otherwise the code is normal (minimal) C++,
+  the `VDSO_zx`_ prefix.  Otherwise the code is normal (minimal) C++,
   but must be stateless and reentrant (use only its stack and registers).
 
  * `internal` entries are declarations of a private API used only by the
@@ -135,8 +135,8 @@
    implementing `vdsocall` system calls).  These produce functions in the
    vDSO implementation with the same C signature that would be declared in
    the public API given the signature of the system call entry.  However,
-   instead of being named with the `_mx_` and `mx_` prefixes, these are
-   available only via `#include "private.h"` with `VDSO_mx_` prefixes.
+   instead of being named with the `_zx_` and `zx_` prefixes, these are
+   available only via `#include "private.h"` with `VDSO_zx_` prefixes.
 
 ### Read-Only Dynamic Shared Object Layout
 
@@ -225,14 +225,14 @@
  1. It constrains how the vDSO VMO can be mapped into a process.
 
     When a [**vmar_map**()](syscalls/vmar_map.md) call is made using the
-    vDSO VMO and requesting `MX_VM_FLAG_PERM_EXECUTE`, the kernel
+    vDSO VMO and requesting `ZX_VM_FLAG_PERM_EXECUTE`, the kernel
     requires that the offset and size of the mapping exactly match the
     vDSO's executable segment.  It also allows only one such mapping.
     Once the valid vDSO mapping has been established in a process, it
     cannot be removed.  Attempts to map the vDSO a second time into the
     same process, to unmap the vDSO code from a process, or to make an
     executable mapping of the vDSO that don't use the correct offset and
-    size, fail with `MX_ERR_ACCESS_DENIED`.
+    size, fail with `ZX_ERR_ACCESS_DENIED`.
 
     At compile time, the offset and size of the vDSO's code segment are
     extracted from the vDSO ELF file and used as constants in the
diff --git a/docs/zx_and_lk.md b/docs/zx_and_lk.md
new file mode 100644
index 0000000..70a3cb8
--- /dev/null
+++ b/docs/zx_and_lk.md
@@ -0,0 +1,26 @@
+# Zircon and LK
+
+LK is a Kernel designed for small systems typically used in embedded
+applications. It is a good alternative to commercial offerings like
+[FreeRTOS](http://www.freertos.org/) or [ThreadX](http://rtos.com/products/threadx/).
+Such systems often have a very limited amount of ram, a fixed set of peripherals
+and a bounded set of tasks.
+
+On the other hand, Zircon targets modern phones and modern personal computers
+with fast processors, non-trivial amounts of ram with arbitrary peripherals
+doing open ended computation.
+
+Zircon inner constructs are based on [LK](https://github.com/littlekernel/lk) but
+the layers above are new. For example, Zircon has the concept of a process but LK
+does not. However, a Zircon process is made of by LK-level constructs such as
+threads and memory.
+
+More specifically, some the visible differences are:
+
++ Zircon has first class user-mode support. LK does not.
++ Zircon is an object-handle system. LK does not have either concept.
++ Zircon has a capability-based security model. In LK all code is trusted.
+
+Over time, even the low level constructs will change to accomodate the new
+requirements and to be a better fit with the rest of the system.
+
diff --git a/kernel/app/app.cpp b/kernel/app/app.cpp
index bdf1cfa..ddc651e 100644
--- a/kernel/app/app.cpp
+++ b/kernel/app/app.cpp
@@ -7,7 +7,7 @@
 
 #include <app.h>
 #include <kernel/thread.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdio.h>
 
 extern const struct app_descriptor __start_apps[] __WEAK;
diff --git a/kernel/app/shell/rules.mk b/kernel/app/shell/rules.mk
index 888b44b..4e62128 100644
--- a/kernel/app/shell/rules.mk
+++ b/kernel/app/shell/rules.mk
@@ -9,7 +9,7 @@
 
 MODULE := $(LOCAL_DIR)
 
-GLOBAL_DEFINES += _MX_KERNEL_HAS_SHELL=1
+GLOBAL_DEFINES += _ZX_KERNEL_HAS_SHELL=1
 
 MODULE_DEPS += \
 	kernel/lib/console
diff --git a/kernel/app/tests/fibo.cpp b/kernel/app/tests/fibo.cpp
index 118428d..0ffccd3 100644
--- a/kernel/app/tests/fibo.cpp
+++ b/kernel/app/tests/fibo.cpp
@@ -71,5 +71,5 @@
     printf("fibo %d\n", retcode);
     printf("took %" PRIu64 " msecs to calculate\n", tim);
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/app/tests/mem_tests.cpp b/kernel/app/tests/mem_tests.cpp
index 21fa08a..863984b 100644
--- a/kernel/app/tests/mem_tests.cpp
+++ b/kernel/app/tests/mem_tests.cpp
@@ -39,11 +39,11 @@
     for (i = 0; i < len / 4; i++) {
         if (vbuf32[i] != pat) {
             mem_test_fail((void*)&vbuf32[i], pat, vbuf32[i]);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t do_moving_inversion_test(void* ptr, size_t len, uint32_t pat) {
@@ -62,7 +62,7 @@
     for (i = 0; i < len / 4; i++) {
         if (vbuf32[i] != pat) {
             mem_test_fail((void*)&vbuf32[i], pat, vbuf32[i]);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
 
         vbuf32[i] = ~pat;
@@ -73,7 +73,7 @@
     for (i = len / 4; i > 0; i--) {
         if (vbuf32[i - 1] != ~pat) {
             mem_test_fail((void*)&vbuf32[i - 1], ~pat, vbuf32[i - 1]);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
 
         vbuf32[i - 1] = pat;
@@ -84,11 +84,11 @@
     for (i = 0; i < len / 4; i++) {
         if (vbuf32[i] != pat) {
             mem_test_fail((void*)&vbuf32[i], pat, vbuf32[i]);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void do_mem_tests(void* ptr, size_t len) {
diff --git a/kernel/app/tests/sync_ipi_tests.cpp b/kernel/app/tests/sync_ipi_tests.cpp
index 618ed7f..69871b8 100644
--- a/kernel/app/tests/sync_ipi_tests.cpp
+++ b/kernel/app/tests/sync_ipi_tests.cpp
@@ -78,7 +78,7 @@
     uint online = mp_get_online_mask();
     if (online != (1U << num_cpus) - 1) {
         printf("Can only run test with all CPUs online\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint runs = TEST_RUNS;
@@ -119,5 +119,5 @@
     }
 
     printf("Success\n");
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/app/tests/tests.cpp b/kernel/app/tests/tests.cpp
index 25c4531..2a00713 100644
--- a/kernel/app/tests/tests.cpp
+++ b/kernel/app/tests/tests.cpp
@@ -8,7 +8,7 @@
 #include "tests.h"
 
 #include <debug.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #if defined(WITH_LIB_CONSOLE)
 #include <lib/console.h>
diff --git a/kernel/app/tests/tests.h b/kernel/app/tests/tests.h
index 1aad2c5..869a36e 100644
--- a/kernel/app/tests/tests.h
+++ b/kernel/app/tests/tests.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <lib/console.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/app/tests/thread_tests.cpp b/kernel/app/tests/thread_tests.cpp
index 2853935..9622038 100644
--- a/kernel/app/tests/thread_tests.cpp
+++ b/kernel/app/tests/thread_tests.cpp
@@ -118,7 +118,7 @@
     while (count > 0) {
         printf("thread %p: waiting on event...\n", get_current_thread());
         status_t err = event_wait_deadline(&e, INFINITE_TIME, true);
-        if (err == MX_ERR_INTERNAL_INTR_KILLED) {
+        if (err == ZX_ERR_INTERNAL_INTR_KILLED) {
             printf("thread %p: killed\n");
             return -1;
         } else if (err < 0) {
@@ -599,7 +599,7 @@
 
     thread_t* t = thread_create("spinner", spinner_thread, NULL, (int)argv[1].u, DEFAULT_STACK_SIZE);
     if (!t)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     if (argc >= 3 && !strcmp(argv[2].str, "rt")) {
         thread_set_real_time(t);
diff --git a/kernel/app/tests/timer_tests.cpp b/kernel/app/tests/timer_tests.cpp
index 2cf7144..85fde48 100644
--- a/kernel/app/tests/timer_tests.cpp
+++ b/kernel/app/tests/timer_tests.cpp
@@ -179,7 +179,7 @@
 
     timer_set(&timer, UINT64_MAX - 5, TIMER_SLACK_CENTER, 0, timer_cb, &event);
     status_t st = event_wait_deadline(&event, current_time() + LK_MSEC(100), false);
-    if (st != MX_ERR_TIMED_OUT) {
+    if (st != ZX_ERR_TIMED_OUT) {
         printf("error: unexpected timer fired!\n");
     } else {
         timer_cancel(&timer);
diff --git a/kernel/arch/arm64/arch.cpp b/kernel/arch/arm64/arch.cpp
index fda3b7a..e181c33 100644
--- a/kernel/arch/arm64/arch.cpp
+++ b/kernel/arch/arm64/arch.cpp
@@ -18,7 +18,7 @@
 #include <kernel/thread.h>
 #include <lk/init.h>
 #include <lk/main.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 #include <inttypes.h>
 #include <platform.h>
 #include <string.h>
@@ -53,8 +53,8 @@
 
 #define TP_OFFSET(field) \
     ((int)offsetof(arm64_sp_info_t, field) - (int)sizeof(arm64_sp_info_t))
-static_assert(TP_OFFSET(stack_guard) == MX_TLS_STACK_GUARD_OFFSET, "");
-static_assert(TP_OFFSET(unsafe_sp) == MX_TLS_UNSAFE_SP_OFFSET, "");
+static_assert(TP_OFFSET(stack_guard) == ZX_TLS_STACK_GUARD_OFFSET, "");
+static_assert(TP_OFFSET(unsafe_sp) == ZX_TLS_UNSAFE_SP_OFFSET, "");
 #undef TP_OFFSET
 
 /* smp boot lock */
@@ -81,7 +81,7 @@
         i++;
     }
     if (i==SMP_MAX_CPUS)
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     LTRACEF("set mpid 0x%lx sp to %p\n", mpid, sp);
 #if __has_feature(safe_stack)
     LTRACEF("set mpid 0x%lx unsafe-sp to %p\n", mpid, unsafe_sp);
@@ -93,7 +93,7 @@
     arm64_secondary_sp_list[i].stack_guard = get_current_thread()->arch.stack_guard;
     arm64_secondary_sp_list[i].unsafe_sp = unsafe_sp;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void parse_ccsid(arm64_cache_desc_t* desc, uint64_t ccsid) {
diff --git a/kernel/arch/arm64/debugger.cpp b/kernel/arch/arm64/debugger.cpp
index 73a883c..f5052b7 100644
--- a/kernel/arch/arm64/debugger.cpp
+++ b/kernel/arch/arm64/debugger.cpp
@@ -10,7 +10,7 @@
 #include <arch/arm64.h>
 #include <arch/debugger.h>
 #include <kernel/thread.h>
-#include <magenta/syscalls/debug.h>
+#include <zircon/syscalls/debug.h>
 
 // Only the NZCV flags (bits 31 to 28 respectively) of the CPSR are
 // readable and writable by userland on ARM64.
@@ -21,24 +21,24 @@
     return 1; // TODO(dje): Just the general regs for now.
 }
 
-static status_t arch_get_general_regs(struct thread *thread, mx_arm64_general_regs_t *out, uint32_t *buf_size)
+static status_t arch_get_general_regs(struct thread *thread, zx_arm64_general_regs_t *out, uint32_t *buf_size)
 {
     uint32_t provided_buf_size = *buf_size;
     *buf_size = sizeof(*out);
 
     if (provided_buf_size < sizeof(*out))
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     if (thread_stopped_in_exception(thread)) {
         // TODO(dje): We could get called while processing a synthetic
         // exception where there is no frame.
         if (thread->exception_context->frame == NULL)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     } else {
         // TODO(dje): Punt if, for example, suspended in channel call.
         // Can be removed when MG-747 done.
         if (thread->arch.suspended_general_regs == nullptr)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     }
 
     struct arm64_iframe_long *in = thread->arch.suspended_general_regs;
@@ -51,24 +51,24 @@
     out->pc = in->elr;
     out->cpsr = in->spsr & kUserVisibleFlags;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static status_t arch_set_general_regs(struct thread *thread, const mx_arm64_general_regs_t *in, uint32_t buf_size)
+static status_t arch_set_general_regs(struct thread *thread, const zx_arm64_general_regs_t *in, uint32_t buf_size)
 {
     if (buf_size != sizeof(*in))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (thread_stopped_in_exception(thread)) {
         // TODO(dje): We could get called while processing a synthetic
         // exception where there is no frame.
         if (thread->exception_context->frame == NULL)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     } else {
         // TODO(dje): Punt if, for example, suspended in channel call.
         // Can be removed when MG-747 done.
         if (thread->arch.suspended_general_regs == nullptr)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     }
 
     struct arm64_iframe_long *out = thread->arch.suspended_general_regs;
@@ -82,7 +82,7 @@
     out->spsr = (out->spsr & ~kUserVisibleFlags)
         | (in->cpsr & kUserVisibleFlags);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // The caller is responsible for making sure the thread is in an exception
@@ -92,9 +92,9 @@
     switch (regset)
     {
     case 0:
-        return arch_get_general_regs(thread, (mx_arm64_general_regs_t *)regs, buf_size);
+        return arch_get_general_regs(thread, (zx_arm64_general_regs_t *)regs, buf_size);
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
@@ -105,8 +105,8 @@
     switch (regset)
     {
     case 0:
-        return arch_set_general_regs(thread, (mx_arm64_general_regs_t *)regs, buf_size);
+        return arch_set_general_regs(thread, (zx_arm64_general_regs_t *)regs, buf_size);
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
diff --git a/kernel/arch/arm64/efi.cpp b/kernel/arch/arm64/efi.cpp
index 2e00826..eb7f39e 100644
--- a/kernel/arch/arm64/efi.cpp
+++ b/kernel/arch/arm64/efi.cpp
@@ -95,7 +95,7 @@
 
     sys_table = systable;
 
-    efi_printf("Booting Magenta from EFI loader...\n");
+    efi_printf("Booting Zircon from EFI loader...\n");
 
     status = systable->boottime->handle_protocol(handle,
                     &loaded_image_proto, (void **)&image);
@@ -121,25 +121,25 @@
     memcpy((void*)target_addr,(void*)image_addr,kern_pages*EFI_PAGE_SIZE);
 
 
-    efi_magenta_hdr_t *mag_hdr;
+    efi_zircon_hdr_t *mag_hdr;
 
     uint32_t cmd_line_len = efi_utf16_ascii_len((const uint16_t*)image->load_options,image->load_options_size/2) + 1;
 
     status = systable->boottime->allocate_pool(EFI_LOADER_DATA, sizeof(*mag_hdr) + cmd_line_len,
                                                                 (void **)&mag_hdr);
     if (status != EFI_SUCCESS) {
-        efi_printf("Failed to allocate space for magenta boot args\n");
+        efi_printf("Failed to allocate space for zircon boot args\n");
         return 0;
     }
 
-    efi_printf("Magenta boot args address= %p\n",(void*)mag_hdr);
+    efi_printf("Zircon boot args address= %p\n",(void*)mag_hdr);
 
-    mag_hdr->magic = EFI_MAGENTA_MAGIC;
+    mag_hdr->magic = EFI_ZIRCON_MAGIC;
     mag_hdr->cmd_line_len = cmd_line_len;
     efi_utf16_to_ascii(mag_hdr->cmd_line, (const uint16_t*)image->load_options, image->load_options_size/2);
     mag_hdr->cmd_line[cmd_line_len-1]=0;
 
-    efi_printf("Magenta cmdline args = %s\n",mag_hdr->cmd_line);
+    efi_printf("Zircon cmdline args = %s\n",mag_hdr->cmd_line);
     const char token[] = "initrd=";
     char* pos;
     uint64_t initrd_start_phys=0;
diff --git a/kernel/arch/arm64/exceptions_c.cpp b/kernel/arch/arm64/exceptions_c.cpp
index 286c42d..90a1898 100644
--- a/kernel/arch/arm64/exceptions_c.cpp
+++ b/kernel/arch/arm64/exceptions_c.cpp
@@ -21,7 +21,7 @@
 #include <platform.h>
 #include <vm/fault.h>
 
-#include <magenta/syscalls/exception.h>
+#include <zircon/syscalls/exception.h>
 
 #define LOCAL_TRACE 0
 
@@ -50,7 +50,7 @@
 }
 
 static status_t try_dispatch_user_data_fault_exception(
-    mx_excp_type_t type, struct arm64_iframe_long *iframe,
+    zx_excp_type_t type, struct arm64_iframe_long *iframe,
     uint32_t esr, uint64_t far)
 {
     thread_t *thread = get_current_thread();
@@ -70,7 +70,7 @@
 }
 
 static status_t try_dispatch_user_exception(
-    mx_excp_type_t type, struct arm64_iframe_long *iframe, uint32_t esr)
+    zx_excp_type_t type, struct arm64_iframe_long *iframe, uint32_t esr)
 {
     return try_dispatch_user_data_fault_exception(type, iframe, esr, 0);
 }
@@ -99,7 +99,7 @@
         printf("unknown exception in kernel: PC at %#" PRIx64 "\n", iframe->elr);
         exception_die(iframe, esr);
     }
-    try_dispatch_user_exception(MX_EXCP_UNDEFINED_INSTRUCTION, iframe, esr);
+    try_dispatch_user_exception(ZX_EXCP_UNDEFINED_INSTRUCTION, iframe, esr);
 }
 
 static void arm64_brk_handler(struct arm64_iframe_long *iframe, uint exception_flags,
@@ -110,7 +110,7 @@
         printf("BRK in kernel: PC at %#" PRIx64 "\n", iframe->elr);
         exception_die(iframe, esr);
     }
-    try_dispatch_user_exception(MX_EXCP_SW_BREAKPOINT, iframe, esr);
+    try_dispatch_user_exception(ZX_EXCP_SW_BREAKPOINT, iframe, esr);
 }
 
 static void arm64_fpu_handler(struct arm64_iframe_long *iframe, uint exception_flags,
@@ -170,7 +170,7 @@
     // get a shot at it.
     if (is_user) {
         CPU_STATS_INC(exceptions);
-        if (try_dispatch_user_data_fault_exception(MX_EXCP_FATAL_PAGE_FAULT, iframe, esr, far) == MX_OK)
+        if (try_dispatch_user_data_fault_exception(ZX_EXCP_FATAL_PAGE_FAULT, iframe, esr, far) == ZX_OK)
             return;
     }
 
@@ -223,11 +223,11 @@
     // get a shot at it.
     if (is_user) {
         CPU_STATS_INC(exceptions);
-        mx_excp_type_t excp_type = MX_EXCP_FATAL_PAGE_FAULT;
+        zx_excp_type_t excp_type = ZX_EXCP_FATAL_PAGE_FAULT;
         if (unlikely(dfsc == DFSC_ALIGNMENT_FAULT)) {
-            excp_type = MX_EXCP_UNALIGNED_ACCESS;
+            excp_type = ZX_EXCP_UNALIGNED_ACCESS;
         }
-        if (try_dispatch_user_data_fault_exception(excp_type, iframe, esr, far) == MX_OK)
+        if (try_dispatch_user_data_fault_exception(excp_type, iframe, esr, far) == ZX_OK)
             return;
     }
 
@@ -295,7 +295,7 @@
                 exception_die(iframe, esr);
             }
             /* let the user exception handler get a shot at it */
-            if (try_dispatch_user_exception(MX_EXCP_GENERAL, iframe, esr) == MX_OK)
+            if (try_dispatch_user_exception(ZX_EXCP_GENERAL, iframe, esr) == ZX_OK)
                 break;
             printf("unhandled synchronous exception\n");
             exception_die(iframe, esr);
@@ -425,24 +425,24 @@
     // try to dump the user stack
     if (is_user_address(context->frame->usp)) {
         uint8_t buf[256];
-        if (arch_copy_from_user(buf, (void *)context->frame->usp, sizeof(buf)) == MX_OK) {
+        if (arch_copy_from_user(buf, (void *)context->frame->usp, sizeof(buf)) == ZX_OK) {
             printf("bottom of user stack at 0x%lx:\n", (vaddr_t)context->frame->usp);
             hexdump_ex(buf, sizeof(buf), context->frame->usp);
         }
     }
 }
 
-void arch_fill_in_exception_context(const arch_exception_context_t *arch_context, mx_exception_report_t *report)
+void arch_fill_in_exception_context(const arch_exception_context_t *arch_context, zx_exception_report_t *report)
 {
-    mx_exception_context_t* mx_context = &report->context;
+    zx_exception_context_t* zx_context = &report->context;
 
-    mx_context->arch.u.arm_64.esr = arch_context->esr;
+    zx_context->arch.u.arm_64.esr = arch_context->esr;
 
     // If there was a fatal page fault, fill in the address that caused the fault.
-    if (MX_EXCP_FATAL_PAGE_FAULT == report->header.type) {
-        mx_context->arch.u.arm_64.far = arch_context->far;
+    if (ZX_EXCP_FATAL_PAGE_FAULT == report->header.type) {
+        zx_context->arch.u.arm_64.far = arch_context->far;
     } else {
-        mx_context->arch.u.arm_64.far = 0;
+        zx_context->arch.u.arm_64.far = 0;
     }
 }
 
@@ -451,5 +451,5 @@
     struct arm64_iframe_long frame = {};
     arch_exception_context_t context = {};
     context.frame = &frame;
-    return dispatch_user_exception(MX_EXCP_POLICY_ERROR, &context);
+    return dispatch_user_exception(ZX_EXCP_POLICY_ERROR, &context);
 }
diff --git a/kernel/arch/arm64/hypervisor/el2.S b/kernel/arch/arm64/hypervisor/el2.S
index 5074859..1f2fed0 100644
--- a/kernel/arch/arm64/hypervisor/el2.S
+++ b/kernel/arch/arm64/hypervisor/el2.S
@@ -7,7 +7,7 @@
 #include <arch/arm64/mmu.h>
 #include <arch/asm_macros.h>
 #include <asm.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 
 #define ESR_EL2_EC_MASK     0xfc000000
 #define ESR_EL2_ISS_MASK    0x01ffffff
@@ -19,7 +19,7 @@
 // EL2 functions
 LOCAL_FUNCTION(el2_set_stack)
     mov sp, x0
-    mov x0, #MX_OK
+    mov x0, #ZX_OK
     eret
 END_FUNCTION(el2_set_stack)
 
@@ -47,7 +47,7 @@
     b el2_set_stack
 
 out_of_range:
-    mov x0, MX_ERR_OUT_OF_RANGE
+    mov x0, ZX_ERR_OUT_OF_RANGE
     eret
 .endm
 
diff --git a/kernel/arch/arm64/hypervisor/el2_cpu_state.cpp b/kernel/arch/arm64/hypervisor/el2_cpu_state.cpp
index 925fa3a..9b09256 100644
--- a/kernel/arch/arm64/hypervisor/el2_cpu_state.cpp
+++ b/kernel/arch/arm64/hypervisor/el2_cpu_state.cpp
@@ -14,8 +14,8 @@
 static size_t num_guests TA_GUARDED(el2_mutex) = 0;
 static fbl::unique_ptr<El2CpuState> el2_cpu_state TA_GUARDED(el2_mutex);
 
-static mx_status_t el2_set_stack(mx_paddr_t stack_top) {
-    register mx_status_t status asm("x0") = MX_OK;
+static zx_status_t el2_set_stack(zx_paddr_t stack_top) {
+    register zx_status_t status asm("x0") = ZX_OK;
     __asm__ volatile("hvc #0" ::: "x0");
     return status;
 }
@@ -25,53 +25,53 @@
         pmm_free_kpages(paddr_to_kvaddr(stack_paddr_), ARCH_DEFAULT_STACK_SIZE / PAGE_SIZE);
 }
 
-mx_status_t El2Stack::Alloc() {
+zx_status_t El2Stack::Alloc() {
     pmm_alloc_kpages(ARCH_DEFAULT_STACK_SIZE / PAGE_SIZE, nullptr, &stack_paddr_);
-    return stack_paddr_ != 0 ? MX_OK : MX_ERR_NO_MEMORY;
+    return stack_paddr_ != 0 ? ZX_OK : ZX_ERR_NO_MEMORY;
 }
 
-mx_paddr_t El2Stack::Top() const {
+zx_paddr_t El2Stack::Top() const {
     return stack_paddr_ + ARCH_DEFAULT_STACK_SIZE;
 }
 
-static mx_status_t el2_on_task(void* context, uint cpu_num) {
+static zx_status_t el2_on_task(void* context, uint cpu_num) {
     auto stacks = static_cast<fbl::Array<El2Stack>*>(context);
     El2Stack& stack = (*stacks)[cpu_num];
 
-    mx_status_t status = el2_set_stack(stack.Top());
-    if (status != MX_OK) {
+    zx_status_t status = el2_set_stack(stack.Top());
+    if (status != ZX_OK) {
         dprintf(CRITICAL, "Failed to set EL2 stack for CPU %u\n", cpu_num);
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void el2_off_task(void* arg) {
-    mx_status_t status = el2_set_stack(0);
-    if (status != MX_OK)
+    zx_status_t status = el2_set_stack(0);
+    if (status != ZX_OK)
         dprintf(CRITICAL, "Failed to clear EL2 stack for CPU %u\n", arch_curr_cpu_num());
 }
 
 // static
-mx_status_t El2CpuState::Create(fbl::unique_ptr<El2CpuState>* out) {
+zx_status_t El2CpuState::Create(fbl::unique_ptr<El2CpuState>* out) {
     fbl::AllocChecker ac;
     fbl::unique_ptr<El2CpuState> el2_cpu_state(new (&ac) El2CpuState);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
-    mx_status_t status = el2_cpu_state->Init();
-    if (status != MX_OK)
+        return ZX_ERR_NO_MEMORY;
+    zx_status_t status = el2_cpu_state->Init();
+    if (status != ZX_OK)
         return status;
 
     // Allocate EL2 stack for each CPU.
     size_t num_cpus = arch_max_num_cpus();
     El2Stack* stacks = new (&ac) El2Stack[num_cpus];
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     fbl::Array<El2Stack> el2_stacks(stacks, num_cpus);
     for (auto& stack : el2_stacks) {
-        mx_status_t status = stack.Alloc();
-        if (status != MX_OK)
+        zx_status_t status = stack.Alloc();
+        if (status != ZX_OK)
             return status;
     }
 
@@ -79,36 +79,36 @@
     mp_cpu_mask_t cpu_mask = percpu_exec(el2_on_task, &el2_stacks);
     if (cpu_mask != mp_get_online_mask()) {
         mp_sync_exec(MP_IPI_TARGET_MASK, cpu_mask, el2_off_task, nullptr);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     el2_cpu_state->el2_stacks_ = fbl::move(el2_stacks);
     *out = fbl::move(el2_cpu_state);
-    return MX_OK;
+    return ZX_OK;
 }
 
 El2CpuState::~El2CpuState() {
     mp_sync_exec(MP_IPI_TARGET_ALL, 0, el2_off_task, nullptr);
 }
 
-mx_status_t alloc_vmid(uint8_t* vmid) {
+zx_status_t alloc_vmid(uint8_t* vmid) {
     fbl::AutoLock lock(&el2_mutex);
     if (num_guests == 0) {
-        mx_status_t status = El2CpuState::Create(&el2_cpu_state);
-        if (status != MX_OK)
+        zx_status_t status = El2CpuState::Create(&el2_cpu_state);
+        if (status != ZX_OK)
             return status;
     }
     num_guests++;
     return el2_cpu_state->AllocId(vmid);
 }
 
-mx_status_t free_vmid(uint8_t vmid) {
+zx_status_t free_vmid(uint8_t vmid) {
     fbl::AutoLock lock(&el2_mutex);
-    mx_status_t status = el2_cpu_state->FreeId(vmid);
-    if (status != MX_OK)
+    zx_status_t status = el2_cpu_state->FreeId(vmid);
+    if (status != ZX_OK)
         return status;
     num_guests--;
     if (num_guests == 0)
         el2_cpu_state.reset();
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/arch/arm64/hypervisor/el2_cpu_state_priv.h b/kernel/arch/arm64/hypervisor/el2_cpu_state_priv.h
index 640a33a..61673a5 100644
--- a/kernel/arch/arm64/hypervisor/el2_cpu_state_priv.h
+++ b/kernel/arch/arm64/hypervisor/el2_cpu_state_priv.h
@@ -17,17 +17,17 @@
     ~El2Stack();
     DISALLOW_COPY_ASSIGN_AND_MOVE(El2Stack);
 
-    mx_status_t Alloc();
-    mx_paddr_t Top() const;
+    zx_status_t Alloc();
+    zx_paddr_t Top() const;
 
 private:
-    mx_paddr_t stack_paddr_ = 0;
+    zx_paddr_t stack_paddr_ = 0;
 };
 
 /* Maintains the EL2 state for each CPU. */
 class El2CpuState : public hypervisor::CpuState<uint8_t, 64> {
 public:
-    static mx_status_t Create(fbl::unique_ptr<El2CpuState>* out);
+    static zx_status_t Create(fbl::unique_ptr<El2CpuState>* out);
     ~El2CpuState();
 
 private:
@@ -36,5 +36,5 @@
     El2CpuState() = default;
 };
 
-mx_status_t alloc_vmid(uint8_t* vmid);
-mx_status_t free_vmid(uint8_t vmid);
+zx_status_t alloc_vmid(uint8_t* vmid);
+zx_status_t free_vmid(uint8_t vmid);
diff --git a/kernel/arch/arm64/hypervisor/guest.cpp b/kernel/arch/arm64/hypervisor/guest.cpp
index 29e851b..04e2320 100644
--- a/kernel/arch/arm64/hypervisor/guest.cpp
+++ b/kernel/arch/arm64/hypervisor/guest.cpp
@@ -6,29 +6,29 @@
 
 #include <arch/hypervisor.h>
 #include <fbl/auto_call.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 #include <vm/vm_object.h>
 
 #include "el2_cpu_state_priv.h"
 
 // static
-mx_status_t Guest::Create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* out) {
+zx_status_t Guest::Create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* out) {
     uint8_t vmid;
-    mx_status_t status = alloc_vmid(&vmid);
-    if (status != MX_OK)
+    zx_status_t status = alloc_vmid(&vmid);
+    if (status != ZX_OK)
         return status;
     auto auto_call = fbl::MakeAutoCall([=]() { free_vmid(vmid); });
 
     fbl::AllocChecker ac;
     fbl::unique_ptr<Guest> guest(new (&ac) Guest(vmid));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto_call.cancel();
     *out = fbl::move(guest);
-    // TODO(abdulla): We intentionally return MX_ERR_NOT_SUPPORTED, as the guest
+    // TODO(abdulla): We intentionally return ZX_ERR_NOT_SUPPORTED, as the guest
     // physical address space has not been wired up yet.
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 Guest::Guest(uint8_t vmid)
@@ -38,14 +38,14 @@
     free_vmid(vmid_);
 }
 
-mx_status_t arch_guest_create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* guest) {
+zx_status_t arch_guest_create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* guest) {
     if (arm64_get_boot_el() < 2)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     return Guest::Create(fbl::move(physmem), guest);
 }
 
-mx_status_t arch_guest_set_trap(Guest* guest, uint32_t kind, mx_vaddr_t addr, size_t len,
+zx_status_t arch_guest_set_trap(Guest* guest, uint32_t kind, zx_vaddr_t addr, size_t len,
                                 fbl::RefPtr<PortDispatcher> port, uint64_t key) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
diff --git a/kernel/arch/arm64/hypervisor/vcpu.cpp b/kernel/arch/arm64/hypervisor/vcpu.cpp
index 566fc9f..f8d1a7c 100644
--- a/kernel/arch/arm64/hypervisor/vcpu.cpp
+++ b/kernel/arch/arm64/hypervisor/vcpu.cpp
@@ -5,20 +5,20 @@
 // https://opensource.org/licenses/MIT
 
 #include <arch/hypervisor.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 
-mx_status_t arch_vcpu_resume(Vcpu* vcpu, mx_port_packet_t* packet) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t arch_vcpu_resume(Vcpu* vcpu, zx_port_packet_t* packet) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t arch_vcpu_interrupt(Vcpu* vcpu, uint32_t interrupt) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t arch_vcpu_interrupt(Vcpu* vcpu, uint32_t interrupt) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t arch_vcpu_read_state(const Vcpu* vcpu, uint32_t kind, void* buffer, uint32_t len) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t arch_vcpu_read_state(const Vcpu* vcpu, uint32_t kind, void* buffer, uint32_t len) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t arch_vcpu_write_state(Vcpu* vcpu, uint32_t kind, const void* buffer, uint32_t len) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t arch_vcpu_write_state(Vcpu* vcpu, uint32_t kind, const void* buffer, uint32_t len) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
diff --git a/kernel/arch/arm64/include/arch/arch_ops.h b/kernel/arch/arm64/include/arch/arch_ops.h
index f18f45b..766cb38 100644
--- a/kernel/arch/arm64/include/arch/arch_ops.h
+++ b/kernel/arch/arm64/include/arch/arch_ops.h
@@ -10,7 +10,7 @@
 #ifndef ASSEMBLY
 
 #include <stdbool.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <reg.h>
 #include <arch/arm64.h>
 #include <arch/arm64/mp.h>
@@ -64,8 +64,8 @@
 
 // Log architecture-specific data for process creation.
 // This can only be called after the process has been created and before
-// it is running. Alas we can't use mx_koid_t here as the arch layer is at a
-// lower level than magenta.
+// it is running. Alas we can't use zx_koid_t here as the arch layer is at a
+// lower level than zircon.
 static inline void arch_trace_process_create(uint64_t pid, paddr_t tt_phys) {
     // nothing to do
 }
diff --git a/kernel/arch/arm64/include/arch/arch_thread.h b/kernel/arch/arm64/include/arch/arch_thread.h
index 6f343da..63b73bb 100644
--- a/kernel/arch/arm64/include/arch/arch_thread.h
+++ b/kernel/arch/arm64/include/arch/arch_thread.h
@@ -10,8 +10,8 @@
 #ifndef ASSEMBLY
 
 #include <assert.h>
-#include <magenta/compiler.h>
-#include <magenta/tls.h>
+#include <zircon/compiler.h>
+#include <zircon/tls.h>
 #include <stddef.h>
 #include <sys/types.h>
 
@@ -59,10 +59,10 @@
      (int)offsetof(struct arch_thread, thread_pointer_location))
 
 static_assert(
-    thread_pointer_offsetof(stack_guard) == MX_TLS_STACK_GUARD_OFFSET,
+    thread_pointer_offsetof(stack_guard) == ZX_TLS_STACK_GUARD_OFFSET,
     "stack_guard field in wrong place");
 static_assert(
-    thread_pointer_offsetof(unsafe_sp) == MX_TLS_UNSAFE_SP_OFFSET,
+    thread_pointer_offsetof(unsafe_sp) == ZX_TLS_UNSAFE_SP_OFFSET,
     "unsafe_sp field in wrong place");
 
 __END_CDECLS
diff --git a/kernel/arch/arm64/include/arch/arm64.h b/kernel/arch/arm64/include/arch/arm64.h
index f1e1246..b339061 100644
--- a/kernel/arch/arm64/include/arch/arm64.h
+++ b/kernel/arch/arm64/include/arch/arm64.h
@@ -12,7 +12,7 @@
 #include <assert.h>
 #include <stdbool.h>
 #include <sys/types.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/arch/arm64/include/arch/arm64/mmu.h b/kernel/arch/arm64/include/arch/arm64/mmu.h
index 774a288..375eb88 100644
--- a/kernel/arch/arm64/include/arch/arm64/mmu.h
+++ b/kernel/arch/arm64/include/arch/arm64/mmu.h
@@ -315,7 +315,7 @@
 
 #include <sys/types.h>
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <arch/arm64.h>
 
 typedef uint64_t pte_t;
diff --git a/kernel/arch/arm64/include/arch/arm64/mp.h b/kernel/arch/arm64/include/arch/arm64/mp.h
index 0881221..8d00ba6 100644
--- a/kernel/arch/arm64/include/arch/arm64/mp.h
+++ b/kernel/arch/arm64/include/arch/arm64/mp.h
@@ -8,7 +8,7 @@
 
 #include <arch/arm64.h>
 #include <arch/ops.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <reg.h>
 #include <arch/spinlock.h>
 
diff --git a/kernel/arch/arm64/include/arch/arm64/user_copy.h b/kernel/arch/arm64/include/arch/arm64/user_copy.h
index 44fe372..0e04264 100644
--- a/kernel/arch/arm64/include/arch/arm64/user_copy.h
+++ b/kernel/arch/arm64/include/arch/arm64/user_copy.h
@@ -5,7 +5,7 @@
 // https://opensource.org/licenses/MIT
 
 #pragma once
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/arch/arm64/include/arch/aspace.h b/kernel/arch/arm64/include/arch/aspace.h
index aa5103b..3d39902 100644
--- a/kernel/arch/arm64/include/arch/aspace.h
+++ b/kernel/arch/arm64/include/arch/aspace.h
@@ -9,7 +9,7 @@
 
 #include <arch/arm64/mmu.h>
 #include <vm/arch_vm_aspace.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/canary.h>
 #include <fbl/mutex.h>
 
diff --git a/kernel/arch/arm64/include/arch/efi.h b/kernel/arch/arm64/include/arch/efi.h
index ed60ee1..67ac669 100644
--- a/kernel/arch/arm64/include/arch/efi.h
+++ b/kernel/arch/arm64/include/arch/efi.h
@@ -20,7 +20,7 @@
 #define EFI_NOT_FOUND           (14 | EFI_ERROR)
 #define EFI_SECURITY_VIOLATION  (26 | EFI_ERROR)
 
-#define EFI_MAGENTA_MAGIC  (0x4d4147454e544121)
+#define EFI_ZIRCON_MAGIC  (0x4d4147454e544121)
 #define EFI_BOOT_SIGNATURE (0x5453595320494249)
 
 #ifndef ASSEMBLY
@@ -41,7 +41,7 @@
     uint64_t ramdisk_size;
     uint32_t cmd_line_len;
     char     cmd_line[];
-} efi_magenta_hdr_t;
+} efi_zircon_hdr_t;
 
 typedef struct {
     uint8_t b[16];
diff --git a/kernel/arch/arm64/include/arch/hypervisor.h b/kernel/arch/arm64/include/arch/hypervisor.h
index 4544ba9..8335d0c 100644
--- a/kernel/arch/arm64/include/arch/hypervisor.h
+++ b/kernel/arch/arm64/include/arch/hypervisor.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/ref_ptr.h>
 #include <fbl/unique_ptr.h>
 
@@ -15,7 +15,7 @@
 class PortDispatcher;
 class VmObject;
 
-typedef struct mx_port_packet mx_port_packet_t;
+typedef struct zx_port_packet zx_port_packet_t;
 
 class Guest {
 public:
@@ -35,20 +35,20 @@
 class Vcpu {};
 
 /* Create a guest. */
-mx_status_t arch_guest_create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* guest);
+zx_status_t arch_guest_create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* guest);
 
 /* Set a trap within a guest. */
-mx_status_t arch_guest_set_trap(Guest* guest, uint32_t kind, mx_vaddr_t addr, size_t len,
+zx_status_t arch_guest_set_trap(Guest* guest, uint32_t kind, zx_vaddr_t addr, size_t len,
                                 fbl::RefPtr<PortDispatcher> port, uint64_t key);
 
 /* Resume execution of a VCPU. */
-mx_status_t arch_vcpu_resume(Vcpu* vcpu, mx_port_packet_t* packet);
+zx_status_t arch_vcpu_resume(Vcpu* vcpu, zx_port_packet_t* packet);
 
 /* Issue an interrupt on a VCPU. */
-mx_status_t arch_vcpu_interrupt(Vcpu* vcpu, uint32_t interrupt);
+zx_status_t arch_vcpu_interrupt(Vcpu* vcpu, uint32_t interrupt);
 
 /* Read the register state of a VCPU. */
-mx_status_t arch_vcpu_read_state(const Vcpu* vcpu, uint32_t kind, void* buffer, uint32_t len);
+zx_status_t arch_vcpu_read_state(const Vcpu* vcpu, uint32_t kind, void* buffer, uint32_t len);
 
 /* Write the register state of a VCPU. */
-mx_status_t arch_vcpu_write_state(Vcpu* vcpu, uint32_t kind, const void* buffer, uint32_t len);
+zx_status_t arch_vcpu_write_state(Vcpu* vcpu, uint32_t kind, const void* buffer, uint32_t len);
diff --git a/kernel/arch/arm64/include/arch/spinlock.h b/kernel/arch/arm64/include/arch/spinlock.h
index aa93353..34cf6cf 100644
--- a/kernel/arch/arm64/include/arch/spinlock.h
+++ b/kernel/arch/arm64/include/arch/spinlock.h
@@ -9,7 +9,7 @@
 
 #include <stdbool.h>
 #include <sys/types.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <arch/arm64/interrupt.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/arch/arm64/mmu.cpp b/kernel/arch/arm64/mmu.cpp
index 65837f1..77ccd32 100644
--- a/kernel/arch/arm64/mmu.cpp
+++ b/kernel/arch/arm64/mmu.cpp
@@ -53,7 +53,7 @@
         retry--;
         if (retry == 0) {
             mutex_release(&asid_lock);
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
     } while ((asid_pool[new_asid >> 6] & (1 << (new_asid % 64))) || (new_asid == 0));
 
@@ -63,7 +63,7 @@
 
     *asid = new_asid;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t arm64_mmu_free_asid(uint16_t asid) {
@@ -74,7 +74,7 @@
 
     mutex_release(&asid_lock);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Convert user level mmu flags to flags that go in L1 descriptors.
@@ -95,7 +95,7 @@
     default:
         // Invalid user-supplied flag.
         DEBUG_ASSERT(1);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     switch (flags & (ARCH_MMU_FLAG_PERM_USER | ARCH_MMU_FLAG_PERM_WRITE)) {
@@ -141,7 +141,7 @@
 
     DEBUG_ASSERT(IsValidVaddr(vaddr));
     if (!IsValidVaddr(vaddr))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // Compute shift values based on if this address space is for kernel or user space.
     if (flags_ & ARCH_ASPACE_FLAG_KERNEL) {
@@ -176,7 +176,7 @@
                 vaddr, index, index_shift, vaddr_rem, pte);
 
         if (descriptor_type == MMU_PTE_DESCRIPTOR_INVALID)
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
 
         if (descriptor_type == ((index_shift > page_size_shift) ? MMU_PTE_L012_DESCRIPTOR_BLOCK : MMU_PTE_L3_DESCRIPTOR_PAGE)) {
             break;
@@ -244,23 +244,23 @@
         size_t ret = pmm_alloc_contiguous(count, PMM_ALLOC_FLAG_KMAP,
                                           static_cast<uint8_t>(page_size_shift), paddrp, NULL);
         if (ret != count)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         pt_pages_ += count;
     } else if (size == PAGE_SIZE) {
         void* vaddr = pmm_alloc_kpage(paddrp, NULL);
         if (!vaddr)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         pt_pages_++;
     } else {
         void* vaddr = memalign(size, size);
         if (!vaddr)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         *paddrp = vaddr_to_paddr(vaddr);
         if (*paddrp == 0) {
             free(vaddr);
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         pt_pages_++;
     }
@@ -439,7 +439,7 @@
 
     if ((vaddr_rel | paddr | size) & ((1UL << page_size_shift) - 1)) {
         TRACEF("not page aligned\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     mapped_size = 0;
@@ -493,7 +493,7 @@
     UnmapPageTable(vaddr_in, vaddr_rel_in, size_in - size, index_shift,
                    page_size_shift, page_table, asid);
     DSB;
-    return MX_ERR_INTERNAL;
+    return ZX_ERR_INTERNAL;
 }
 
 int ArmArchVmAspace::ProtectPageTable(vaddr_t vaddr_in, vaddr_t vaddr_rel_in,
@@ -521,7 +521,7 @@
 
     if ((vaddr_rel | size) & ((1UL << page_size_shift) - 1)) {
         TRACEF("not page aligned\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     while (size) {
@@ -572,7 +572,7 @@
     // here there's a programming bug since the higher level region abstraction
     // should guard against us trying to change permissions on an umapped page
     DSB;
-    return MX_ERR_INTERNAL;
+    return ZX_ERR_INTERNAL;
 }
 
 ssize_t ArmArchVmAspace::MapPages(vaddr_t vaddr, paddr_t paddr, size_t size,
@@ -589,12 +589,12 @@
     if (vaddr_rel > vaddr_rel_max - size || size > vaddr_rel_max) {
         TRACEF("vaddr %#" PRIxPTR ", size %#" PRIxPTR " out of range vaddr %#" PRIxPTR ", size %#" PRIxPTR "\n",
                vaddr, size, vaddr_base, vaddr_rel_max);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (!top_page_table) {
         TRACEF("page table is NULL\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     ssize_t ret = MapPageTable(vaddr, vaddr_rel, paddr, size, attrs,
@@ -619,12 +619,12 @@
     if (vaddr_rel > vaddr_rel_max - size || size > vaddr_rel_max) {
         TRACEF("vaddr 0x%lx, size 0x%lx out of range vaddr 0x%lx, size 0x%lx\n",
                vaddr, size, vaddr_base, vaddr_rel_max);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (!top_page_table) {
         TRACEF("page table is NULL\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     ssize_t ret = UnmapPageTable(vaddr, vaddr_rel, size, top_index_shift,
@@ -647,12 +647,12 @@
     if (vaddr_rel > vaddr_rel_max - size || size > vaddr_rel_max) {
         TRACEF("vaddr %#" PRIxPTR ", size %#" PRIxPTR " out of range vaddr %#" PRIxPTR ", size %#" PRIxPTR "\n",
                vaddr, size, vaddr_base, vaddr_rel_max);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (!top_page_table) {
         TRACEF("page table is NULL\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     status_t ret = ProtectPageTable(vaddr, vaddr_rel, size, attrs,
@@ -672,19 +672,19 @@
 
     DEBUG_ASSERT(IsValidVaddr(vaddr));
     if (!IsValidVaddr(vaddr))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     if (!(mmu_flags & ARCH_MMU_FLAG_PERM_READ))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // paddr and vaddr must be aligned.
     DEBUG_ASSERT(IS_PAGE_ALIGNED(vaddr));
     DEBUG_ASSERT(IS_PAGE_ALIGNED(paddr));
     if (!IS_PAGE_ALIGNED(vaddr) || !IS_PAGE_ALIGNED(paddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (count == 0)
-        return MX_OK;
+        return ZX_OK;
 
     ssize_t ret;
     {
@@ -710,7 +710,7 @@
         DEBUG_ASSERT(*mapped <= count);
     }
 
-    return (ret < 0) ? (status_t)ret : MX_OK;
+    return (ret < 0) ? (status_t)ret : ZX_OK;
 }
 
 status_t ArmArchVmAspace::Unmap(vaddr_t vaddr, size_t count, size_t* unmapped) {
@@ -722,11 +722,11 @@
     DEBUG_ASSERT(IsValidVaddr(vaddr));
 
     if (!IsValidVaddr(vaddr))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     DEBUG_ASSERT(IS_PAGE_ALIGNED(vaddr));
     if (!IS_PAGE_ALIGNED(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::AutoLock a(&lock_);
 
@@ -757,13 +757,13 @@
     canary_.Assert();
 
     if (!IsValidVaddr(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (!IS_PAGE_ALIGNED(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (!(mmu_flags & ARCH_MMU_FLAG_PERM_READ))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::AutoLock a(&lock_);
 
@@ -811,8 +811,8 @@
         //DEBUG_ASSERT(base >= 0);
         DEBUG_ASSERT(base + size <= 1UL << MMU_USER_SIZE_SHIFT);
 
-        if (arm64_mmu_alloc_asid(&asid_) != MX_OK)
-            return MX_ERR_NO_MEMORY;
+        if (arm64_mmu_alloc_asid(&asid_) != ZX_OK)
+            return ZX_ERR_NO_MEMORY;
 
         base_ = base;
         size_ = size;
@@ -820,7 +820,7 @@
         paddr_t pa;
         volatile pte_t* va = static_cast<volatile pte_t*>(pmm_alloc_kpage(&pa, NULL));
         if (!va)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         tt_virt_ = va;
         tt_phys_ = pa;
@@ -833,7 +833,7 @@
 
     LTRACEF("tt_phys %#" PRIxPTR " tt_virt %p\n", tt_phys_, tt_virt_);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t ArmArchVmAspace::Destroy() {
@@ -855,7 +855,7 @@
     arm64_mmu_free_asid(asid_);
     asid_ = 0;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void ArmArchVmAspace::ContextSwitch(ArmArchVmAspace* old_aspace, ArmArchVmAspace* aspace) {
diff --git a/kernel/arch/arm64/start.S b/kernel/arch/arm64/start.S
index 93e7d06..c30d595 100644
--- a/kernel/arch/arm64/start.S
+++ b/kernel/arch/arm64/start.S
@@ -11,7 +11,7 @@
 #include <arch/defines.h>
 #include <arch/efi.h>
 #include <vm/initial_map.h>
-#include <magenta/tls.h>
+#include <zircon/tls.h>
 
 #ifndef __has_feature
 #define __has_feature(x) 0
@@ -415,7 +415,7 @@
 
     // Choose a good (ideally random) stack-guard value as early as possible.
     bl      choose_stack_guard
-    str	    x0, [tmp, #MX_TLS_STACK_GUARD_OFFSET]
+    str	    x0, [tmp, #ZX_TLS_STACK_GUARD_OFFSET]
     // Don't leak the value to other code.
     mov	    x0, xzr
 
diff --git a/kernel/arch/arm64/thread.cpp b/kernel/arch/arm64/thread.cpp
index 5b791a6..2aeac9b 100644
--- a/kernel/arch/arm64/thread.cpp
+++ b/kernel/arch/arm64/thread.cpp
@@ -60,7 +60,7 @@
 
     // This is really a global (boot-time) constant value.
     // But it's stored in each thread struct to satisfy the
-    // compiler ABI (TPIDR_EL1 + MX_TLS_STACK_GUARD_OFFSET).
+    // compiler ABI (TPIDR_EL1 + ZX_TLS_STACK_GUARD_OFFSET).
     t->arch.stack_guard = get_current_thread()->arch.stack_guard;
 
     // set the stack pointer
@@ -86,7 +86,7 @@
     // Force the thread pointer immediately to the real struct.  This way
     // our callers don't have to avoid safe-stack code or risk losing track
     // of the unsafe_sp value.  The caller's unsafe_sp value is visible at
-    // TPIDR_EL1 + MX_TLS_UNSAFE_SP_OFFSET as expected, though TPIDR_EL1
+    // TPIDR_EL1 + ZX_TLS_UNSAFE_SP_OFFSET as expected, though TPIDR_EL1
     // happens to have changed.  (We're assuming that the compiler doesn't
     // decide to cache the TPIDR_EL1 value across this function call, which
     // would be pointless since it's just one instruction to fetch it afresh.)
diff --git a/kernel/arch/arm64/user_copy.S b/kernel/arch/arm64/user_copy.S
index 19e7a96..0ae70ec 100644
--- a/kernel/arch/arm64/user_copy.S
+++ b/kernel/arch/arm64/user_copy.S
@@ -24,10 +24,10 @@
     cbnz x2, .Lcopy_byte_from_user
 0:
 
-    mov x0, #MX_OK
+    mov x0, #ZX_OK
     b .Lcleanup_from_user
 .Lfault_from_user:
-    mov x0, #MX_ERR_INVALID_ARGS
+    mov x0, #ZX_ERR_INVALID_ARGS
 .Lcleanup_from_user:
     # Reset data fault return
     str xzr, [x3]
@@ -51,10 +51,10 @@
     cbnz x2, .Lcopy_byte_to_user
 0:
 
-    mov x0, #MX_OK
+    mov x0, #ZX_OK
     b .Lcleanup_to_user
 .Lfault_to_user:
-    mov x0, #MX_ERR_INVALID_ARGS
+    mov x0, #ZX_ERR_INVALID_ARGS
 .Lcleanup_to_user:
     # Reset data fault return
     str xzr, [x3]
diff --git a/kernel/arch/arm64/user_copy_c.cpp b/kernel/arch/arm64/user_copy_c.cpp
index 17d4cdd..03df28b 100644
--- a/kernel/arch/arm64/user_copy_c.cpp
+++ b/kernel/arch/arm64/user_copy_c.cpp
@@ -26,7 +26,7 @@
     // handler (since the fault will always be from trying to access an
     // unprivileged page).
     if (!is_user_address_range((vaddr_t)src, len)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     thread_t *thr = get_current_thread();
@@ -38,7 +38,7 @@
 status_t arch_copy_to_user(void *dst, const void *src, size_t len)
 {
     if (!is_user_address_range((vaddr_t)dst, len)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     thread_t *thr = get_current_thread();
diff --git a/kernel/arch/x86/64/bootstrap16.cpp b/kernel/arch/x86/64/bootstrap16.cpp
index 4d1fec9..a163034 100644
--- a/kernel/arch/x86/64/bootstrap16.cpp
+++ b/kernel/arch/x86/64/bootstrap16.cpp
@@ -28,21 +28,21 @@
     // Make sure bootstrap region will be entirely in the first 1MB of physical
     // memory
     if (bootstrap_phys_addr > (1 << 20) - 2 * PAGE_SIZE) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Make sure the entrypoint code is in the bootstrap code that will be
     // loaded
     if (entry64 < (uintptr_t)x86_bootstrap16_start ||
         entry64 >= (uintptr_t)x86_bootstrap16_end) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     VmAspace *kernel_aspace = VmAspace::kernel_aspace();
     fbl::RefPtr<VmAspace> bootstrap_aspace = VmAspace::Create(VmAspace::TYPE_LOW_KERNEL,
                                                                "bootstrap16");
     if (!bootstrap_aspace) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     void *bootstrap_virt_addr = NULL;
 
@@ -87,7 +87,7 @@
                 page_mappings[i].start_paddr,
                 VmAspace::VMM_FLAG_VALLOC_SPECIFIC,
                 ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE | ARCH_MMU_FLAG_PERM_EXECUTE);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             TRACEF("Failed to create wakeup bootstrap aspace\n");
             return status;
         }
@@ -103,7 +103,7 @@
             bootstrap_phys_addr, // physical address
             0, // vmm flags
             ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE); // arch mmu flags
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         TRACEF("could not allocate AP bootstrap page: %d\n", status);
         return status;
     }
@@ -128,7 +128,7 @@
         // TODO(MG-978): Once the pmm supports it, we should request that this
         // VmAspace is backed by a low mem PML4, so we can avoid this issue.
         TRACEF("bootstrap PML4 was not allocated out of low mem\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     ASSERT(phys_kernel_pml4 <= UINT32_MAX);
 
@@ -146,5 +146,5 @@
     // cancel the cleanup autocall, since we're returning the new aspace and region
     ac.cancel();
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/arch/x86/64/exceptions.S b/kernel/arch/x86/64/exceptions.S
index 7430aea..cefe8cb 100644
--- a/kernel/arch/x86/64/exceptions.S
+++ b/kernel/arch/x86/64/exceptions.S
@@ -126,7 +126,7 @@
 
 /* A label to assist gdb's backtracing through kernel exceptions.
    When gdb sees this as the return address it knows it can fetch
-   x86_iframe_t from $rsp. See scripts/magenta.elf-gdb.py. */
+   x86_iframe_t from $rsp. See scripts/zircon.elf-gdb.py. */
 interrupt_common_iframe_set_up_for_debugger:
 
     /* restore general purpose registers */
diff --git a/kernel/arch/x86/64/mexec.S b/kernel/arch/x86/64/mexec.S
index df12ecc..8a4baef 100644
--- a/kernel/arch/x86/64/mexec.S
+++ b/kernel/arch/x86/64/mexec.S
@@ -10,7 +10,7 @@
 #include <arch/x86/mmu.h>
 #include <arch/x86/registers.h>
 #include <asm.h>
-#include <magenta/tls.h>
+#include <zircon/tls.h>
 #include <mexec.h>
 
 #define ENTRY64_ADDR 0x100020
diff --git a/kernel/arch/x86/64/ops.S b/kernel/arch/x86/64/ops.S
index 04f402e..f2b3ea7 100644
--- a/kernel/arch/x86/64/ops.S
+++ b/kernel/arch/x86/64/ops.S
@@ -58,7 +58,7 @@
     or %rax, %rdx
     mov %rdx, (%rsi)
 
-    mov $MX_OK, %rax
+    mov $ZX_OK, %rax
     ret
 .Lgpf_handler:
     # Cleanup GPF handler
@@ -66,6 +66,6 @@
     # Restore interrupts if they were on before
     popfq
 
-    mov $MX_ERR_NOT_SUPPORTED, %rax
+    mov $ZX_ERR_NOT_SUPPORTED, %rax
     ret
 END_FUNCTION(read_msr_safe)
diff --git a/kernel/arch/x86/64/smp.cpp b/kernel/arch/x86/64/smp.cpp
index 2ff4f8a..a7f1a7e 100644
--- a/kernel/arch/x86/64/smp.cpp
+++ b/kernel/arch/x86/64/smp.cpp
@@ -26,7 +26,7 @@
 {
     DEBUG_ASSERT(num_cpus <= UINT8_MAX);
     status_t status = x86_allocate_ap_structures(apic_ids, (uint8_t)num_cpus);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         TRACEF("Failed to allocate structures for APs");
         return;
     }
@@ -37,11 +37,11 @@
 status_t x86_bringup_aps(uint32_t *apic_ids, uint32_t count)
 {
     volatile int aps_still_booting = 0;
-    status_t status = MX_ERR_INTERNAL;
+    status_t status = ZX_ERR_INTERNAL;
 
     // if being asked to bring up 0 cpus, move on
     if (count == 0) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Sanity check the given ids
@@ -49,10 +49,10 @@
         int cpu = x86_apic_id_to_cpu_num(apic_ids[i]);
         DEBUG_ASSERT(cpu > 0);
         if (cpu <= 0) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (mp_is_cpu_online(cpu)) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
         aps_still_booting |= 1U << cpu;
     }
@@ -65,7 +65,7 @@
             (uintptr_t)_x86_secondary_cpu_long_mode_entry,
             &bootstrap_aspace,
             (void **)&bootstrap_data);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -83,7 +83,7 @@
 #endif
                                     PAGE_SIZE);
         if (!thread) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto cleanup_allocations;
         }
         uintptr_t kstack_base =
@@ -171,7 +171,7 @@
         }
         DEBUG_ASSERT(failed_aps == 0);
 
-        status = MX_ERR_TIMED_OUT;
+        status = ZX_ERR_TIMED_OUT;
 
         goto finish;
     }
diff --git a/kernel/arch/x86/64/start.S b/kernel/arch/x86/64/start.S
index 5b30802..e6fd57a 100644
--- a/kernel/arch/x86/64/start.S
+++ b/kernel/arch/x86/64/start.S
@@ -12,7 +12,7 @@
 #include <arch/x86/descriptor.h>
 #include <arch/x86/mmu.h>
 #include <arch/x86/registers.h>
-#include <magenta/tls.h>
+#include <zircon/tls.h>
 
 /* shared code to set up a default 64bit page table structure */
 .macro page_table_init
@@ -143,7 +143,7 @@
     btsl $(31), %eax
     mov %eax,  %cr0
 
-    /* Start using the magenta stack from its physical address. */
+    /* Start using the zircon stack from its physical address. */
     mov $PHYS(_kstack + 4096), %esp
 
     /* Using another long jump to be on 64 bit mode
@@ -200,7 +200,7 @@
     call choose_stack_guard
 
     // Move it into place.
-    mov %rcx, %gs:MX_TLS_STACK_GUARD_OFFSET
+    mov %rcx, %gs:ZX_TLS_STACK_GUARD_OFFSET
     // Don't leak that value to other code.
     xor %ecx, %ecx
 
diff --git a/kernel/arch/x86/64/syscall.S b/kernel/arch/x86/64/syscall.S
index 9adf521..25f10cc 100644
--- a/kernel/arch/x86/64/syscall.S
+++ b/kernel/arch/x86/64/syscall.S
@@ -7,7 +7,7 @@
 
 #include <asm.h>
 #include <arch/x86/mp.h>
-#include <magenta/mx-syscall-numbers.h>
+#include <zircon/zx-syscall-numbers.h>
 
 #define DW_REG_rsp        0x7
 #define DW_REG_rip        0x10
@@ -301,7 +301,7 @@
     // pre_push and post_pop macros above to maintain alignment.
 #if WITH_LIB_SYSCALLS
     // Verify the syscall is in range and jump to it.
-    cmp     $MX_SYS_COUNT, %rax
+    cmp     $ZX_SYS_COUNT, %rax
     jae     .Lunknown_syscall
     jmp     *.Lcall_wrapper_table(, %rax, 8)
 #endif
@@ -403,5 +403,5 @@
 END_FUNCTION(x86_syscall)
 
 #if WITH_LIB_SYSCALLS
-#include <magenta/syscall-kernel-branches.S>
+#include <zircon/syscall-kernel-branches.S>
 #endif
diff --git a/kernel/arch/x86/64/user_copy.S b/kernel/arch/x86/64/user_copy.S
index b79846e..fc1a483 100644
--- a/kernel/arch/x86/64/user_copy.S
+++ b/kernel/arch/x86/64/user_copy.S
@@ -42,7 +42,7 @@
     movq %rdx, %rcx
     rep movsb  # while (rcx-- > 0) *rdi++ = *rsi++;
 
-    mov $MX_OK, %rax
+    mov $ZX_OK, %rax
 
 .Lcleanup_copy:
     # Reset fault return
@@ -56,6 +56,6 @@
     ret
 
 .Lfault_copy:
-    mov $MX_ERR_INVALID_ARGS, %rax
+    mov $ZX_ERR_INVALID_ARGS, %rax
     jmp .Lcleanup_copy
 END_FUNCTION(_x86_copy_to_or_from_user)
diff --git a/kernel/arch/x86/arch.cpp b/kernel/arch/x86/arch.cpp
index cc21306..93c567d 100644
--- a/kernel/arch/x86/arch.cpp
+++ b/kernel/arch/x86/arch.cpp
@@ -9,7 +9,7 @@
 
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 #include <err.h>
 #include <trace.h>
@@ -183,7 +183,7 @@
 #if __has_feature(safe_stack)
     // Set up the initial unsafe stack pointer.
     x86_write_gs_offset64(
-        MX_TLS_UNSAFE_SP_OFFSET,
+        ZX_TLS_UNSAFE_SP_OFFSET,
         ROUNDDOWN((uintptr_t)thread->unsafe_stack + thread->stack_size, 16));
 #endif
 
@@ -203,7 +203,7 @@
         printf("%s features\n", argv[0].str);
         printf("%s unplug <cpu_id>\n", argv[0].str);
         printf("%s hotplug <cpu_id>\n", argv[0].str);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     if (!strcmp(argv[1].str, "features")) {
@@ -227,7 +227,7 @@
         goto usage;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 STATIC_COMMAND_START
diff --git a/kernel/arch/x86/debugger.cpp b/kernel/arch/x86/debugger.cpp
index dac9f64..531823f 100644
--- a/kernel/arch/x86/debugger.cpp
+++ b/kernel/arch/x86/debugger.cpp
@@ -11,7 +11,7 @@
 #include <arch/x86.h>
 #include <arch/x86/feature.h>
 #include <arch/debugger.h>
-#include <magenta/syscalls/debug.h>
+#include <zircon/syscalls/debug.h>
 
 uint arch_num_regsets(void)
 {
@@ -20,7 +20,7 @@
 }
 
 #define SYSCALL_OFFSETS_EQUAL(reg) \
-  (__offsetof(mx_x86_64_general_regs_t, reg) == \
+  (__offsetof(zx_x86_64_general_regs_t, reg) == \
    __offsetof(x86_syscall_general_regs_t, reg))
 
 static_assert(SYSCALL_OFFSETS_EQUAL(rax), "");
@@ -39,16 +39,16 @@
 static_assert(SYSCALL_OFFSETS_EQUAL(r13), "");
 static_assert(SYSCALL_OFFSETS_EQUAL(r14), "");
 static_assert(SYSCALL_OFFSETS_EQUAL(r15), "");
-static_assert(sizeof(mx_x86_64_general_regs_t) == sizeof(x86_syscall_general_regs_t), "");
+static_assert(sizeof(zx_x86_64_general_regs_t) == sizeof(x86_syscall_general_regs_t), "");
 
-static void x86_fill_in_gregs_from_syscall(mx_x86_64_general_regs_t *out,
+static void x86_fill_in_gregs_from_syscall(zx_x86_64_general_regs_t *out,
                                            const x86_syscall_general_regs_t *in)
 {
     memcpy(out, in, sizeof(*in));
 }
 
 static void x86_fill_in_syscall_from_gregs(x86_syscall_general_regs_t *out,
-                                           const mx_x86_64_general_regs_t *in)
+                                           const zx_x86_64_general_regs_t *in)
 {
     // Don't allow overriding privileged fields of rflags, and ignore writes
     // to reserved fields.
@@ -78,7 +78,7 @@
     COPY_REG(out, in, r15); \
   } while (0)
 
-static void x86_fill_in_gregs_from_iframe(mx_x86_64_general_regs_t *out,
+static void x86_fill_in_gregs_from_iframe(zx_x86_64_general_regs_t *out,
                                           const x86_iframe_t *in)
 {
     COPY_COMMON_IFRAME_REGS(out, in);
@@ -88,7 +88,7 @@
 }
 
 static void x86_fill_in_iframe_from_gregs(x86_iframe_t *out,
-                                          const mx_x86_64_general_regs_t *in)
+                                          const zx_x86_64_general_regs_t *in)
 {
     COPY_COMMON_IFRAME_REGS(out, in);
     out->user_sp = in->rsp;
@@ -101,24 +101,24 @@
 
 static status_t arch_get_general_regs(struct thread *thread, void *grp, uint32_t *buf_size)
 {
-    mx_x86_64_general_regs_t *out = (mx_x86_64_general_regs_t *)grp;
+    zx_x86_64_general_regs_t *out = (zx_x86_64_general_regs_t *)grp;
 
     uint32_t provided_buf_size = *buf_size;
     *buf_size = sizeof(*out);
 
     if (provided_buf_size < sizeof(*out))
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     if (thread_stopped_in_exception(thread)) {
         // TODO(dje): We could get called while processing a synthetic
         // exception where there is no frame.
         if (thread->exception_context->frame == nullptr)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     } else {
         // TODO(dje): Punt if, for example, suspended in channel call.
         // Can be removed when MG-747 done.
         if (thread->arch.suspended_general_regs.gregs == nullptr)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     }
 
     DEBUG_ASSERT(thread->arch.suspended_general_regs.gregs);
@@ -131,29 +131,29 @@
             break;
         default:
             DEBUG_ASSERT(false);
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t arch_set_general_regs(struct thread *thread, const void *grp, uint32_t buf_size)
 {
-    const mx_x86_64_general_regs_t *in = (const mx_x86_64_general_regs_t *)grp;
+    const zx_x86_64_general_regs_t *in = (const zx_x86_64_general_regs_t *)grp;
 
     if (buf_size != sizeof(*in))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (thread_stopped_in_exception(thread)) {
         // TODO(dje): We could get called while processing a synthetic
         // exception where there is no frame.
         if (thread->exception_context->frame == nullptr)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     } else {
         // TODO(dje): Punt if, for example, suspended in channel call.
         // Can be removed when MG-747 done.
         if (thread->arch.suspended_general_regs.gregs == nullptr)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     }
 
     DEBUG_ASSERT(thread->arch.suspended_general_regs.gregs);
@@ -167,7 +167,7 @@
             uint8_t addr_width = x86_linear_address_width();
             uint64_t noncanonical_addr = ((uint64_t) 1) << (addr_width - 1);
             if (in->rip >= noncanonical_addr)
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             x86_fill_in_syscall_from_gregs(thread->arch.suspended_general_regs.syscall, in);
             break;
         }
@@ -176,10 +176,10 @@
             break;
         default:
             DEBUG_ASSERT(false);
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // The caller is responsible for making sure the thread is in an exception
@@ -191,7 +191,7 @@
     case 0:
         return arch_get_general_regs(thread, regs, buf_size);
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
@@ -204,6 +204,6 @@
     case 0:
         return arch_set_general_regs(thread, regs, buf_size);
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
diff --git a/kernel/arch/x86/descriptor.cpp b/kernel/arch/x86/descriptor.cpp
index a615193..6dd0772 100644
--- a/kernel/arch/x86/descriptor.cpp
+++ b/kernel/arch/x86/descriptor.cpp
@@ -15,7 +15,7 @@
 #include <arch/arch_ops.h>
 #include <assert.h>
 #include <bits.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <err.h>
 #include <string.h>
 #include <trace.h>
diff --git a/kernel/arch/x86/faults.cpp b/kernel/arch/x86/faults.cpp
index 1f5c698..322e5f8 100644
--- a/kernel/arch/x86/faults.cpp
+++ b/kernel/arch/x86/faults.cpp
@@ -22,7 +22,7 @@
 #include <vm/fault.h>
 
 #include <fbl/auto_call.h>
-#include <magenta/syscalls/exception.h>
+#include <zircon/syscalls/exception.h>
 
 #include <lib/ktrace.h>
 
@@ -62,7 +62,7 @@
     // try to dump the user stack
     if (is_user_address(frame->user_sp)) {
         uint8_t buf[256];
-        if (arch_copy_from_user(buf, (void *)frame->user_sp, sizeof(buf)) == MX_OK) {
+        if (arch_copy_from_user(buf, (void *)frame->user_sp, sizeof(buf)) == ZX_OK) {
             printf("bottom of user stack at 0x%lx:\n", (vaddr_t)frame->user_sp);
             hexdump_ex(buf, sizeof(buf), frame->user_sp);
         }
@@ -92,7 +92,7 @@
         status_t erc = call_dispatch_user_exception(kind, &context, frame);
         arch_disable_ints();
         arch_set_in_int_handler(true);
-        if (erc == MX_OK)
+        if (erc == ZX_OK)
             return true;
     }
 
@@ -101,7 +101,7 @@
 
 static void x86_debug_handler(x86_iframe_t *frame)
 {
-    if (try_dispatch_user_exception(frame, MX_EXCP_HW_BREAKPOINT))
+    if (try_dispatch_user_exception(frame, ZX_EXCP_HW_BREAKPOINT))
         return;
 
     exception_die(frame, "unhandled hw breakpoint, halting\n");
@@ -113,7 +113,7 @@
 
 static void x86_breakpoint_handler(x86_iframe_t *frame)
 {
-    if (try_dispatch_user_exception(frame, MX_EXCP_SW_BREAKPOINT))
+    if (try_dispatch_user_exception(frame, ZX_EXCP_SW_BREAKPOINT))
         return;
 
     exception_die(frame, "unhandled sw breakpoint, halting\n");
@@ -134,7 +134,7 @@
         return;
     }
 
-    if (try_dispatch_user_exception(frame, MX_EXCP_GENERAL))
+    if (try_dispatch_user_exception(frame, ZX_EXCP_GENERAL))
         return;
 
     exception_die(frame, "unhandled gpf, halting\n");
@@ -142,7 +142,7 @@
 
 static void x86_invop_handler(x86_iframe_t *frame)
 {
-    if (try_dispatch_user_exception(frame, MX_EXCP_UNDEFINED_INSTRUCTION))
+    if (try_dispatch_user_exception(frame, ZX_EXCP_UNDEFINED_INSTRUCTION))
         return;
 
     exception_die(frame, "invalid opcode, halting\n");
@@ -158,7 +158,7 @@
 
 static void x86_unhandled_exception(x86_iframe_t *frame)
 {
-    if (try_dispatch_user_exception(frame, MX_EXCP_GENERAL))
+    if (try_dispatch_user_exception(frame, ZX_EXCP_GENERAL))
         return;
 
     exception_die(frame, "unhandled exception, halting\n");
@@ -246,7 +246,7 @@
     /* check for flags we're not prepared to handle */
     if (unlikely(error_code & ~(PFEX_I | PFEX_U | PFEX_W | PFEX_P))) {
         printf("x86_pfe_handler: unhandled error code bits set, error code %#" PRIx64 "\n", error_code);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     /* check for a potential SMAP failure */
@@ -258,7 +258,7 @@
          is_user_address(va))) {
         /* supervisor mode page-present access failure with the AC bit clear (SMAP enabled) */
         printf("x86_pfe_handler: potential SMAP failure, supervisor access at address %#" PRIxPTR "\n", va);
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     /* convert the PF error codes to page fault flags */
@@ -270,8 +270,8 @@
 
     /* call the high level page fault handler */
     status_t pf_err = vmm_page_fault_handler(va, flags);
-    if (likely(pf_err == MX_OK))
-        return MX_OK;
+    if (likely(pf_err == ZX_OK))
+        return ZX_OK;
 
     /* if the high level page fault handler can't deal with it,
      * resort to trying to recover first, before bailing */
@@ -280,7 +280,7 @@
     thread_t *current_thread = get_current_thread();
     if (unlikely(current_thread->arch.page_fault_resume)) {
         frame->ip = (uintptr_t)current_thread->arch.page_fault_resume;
-        return MX_OK;
+        return ZX_OK;
     }
 
     /* let high level code deal with this */
@@ -288,12 +288,12 @@
     if (from_user) {
         CPU_STATS_INC(exceptions);
         struct arch_exception_context context = { true, frame, va };
-        return call_dispatch_user_exception(MX_EXCP_FATAL_PAGE_FAULT,
+        return call_dispatch_user_exception(ZX_EXCP_FATAL_PAGE_FAULT,
                                             &context, frame);
     }
 
     /* fall through to fatal path */
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static void x86_iframe_process_pending_signals(x86_iframe_t *frame)
@@ -374,7 +374,7 @@
 
         case X86_INT_PAGE_FAULT:
             CPU_STATS_INC(page_faults);
-            if (x86_pfe_handler(frame) != MX_OK)
+            if (x86_pfe_handler(frame) != ZX_OK)
                 x86_fatal_pfe_handler(frame, x86_get_cr2());
             break;
 
@@ -462,20 +462,20 @@
     // try to dump the user stack
     if (context->frame->cs != CODE_64_SELECTOR && is_user_address(context->frame->user_sp)) {
         uint8_t buf[256];
-        if (arch_copy_from_user(buf, (void *)context->frame->user_sp, sizeof(buf)) == MX_OK) {
+        if (arch_copy_from_user(buf, (void *)context->frame->user_sp, sizeof(buf)) == ZX_OK) {
             printf("bottom of user stack at 0x%lx:\n", (vaddr_t)context->frame->user_sp);
             hexdump_ex(buf, sizeof(buf), context->frame->user_sp);
         }
     }
 }
 
-void arch_fill_in_exception_context(const arch_exception_context_t *arch_context, mx_exception_report_t *report)
+void arch_fill_in_exception_context(const arch_exception_context_t *arch_context, zx_exception_report_t *report)
 {
-    mx_exception_context_t *mx_context = &report->context;
+    zx_exception_context_t *zx_context = &report->context;
 
-    mx_context->arch.u.x86_64.vector = arch_context->frame->vector;
-    mx_context->arch.u.x86_64.err_code = arch_context->frame->err_code;
-    mx_context->arch.u.x86_64.cr2 = arch_context->cr2;
+    zx_context->arch.u.x86_64.vector = arch_context->frame->vector;
+    zx_context->arch.u.x86_64.err_code = arch_context->frame->err_code;
+    zx_context->arch.u.x86_64.cr2 = arch_context->cr2;
 }
 
 status_t arch_dispatch_user_policy_exception(void)
@@ -483,5 +483,5 @@
     x86_iframe_t frame = {};
     arch_exception_context_t context = {};
     context.frame = &frame;
-    return dispatch_user_exception(MX_EXCP_POLICY_ERROR, &context);
+    return dispatch_user_exception(ZX_EXCP_POLICY_ERROR, &context);
 }
diff --git a/kernel/arch/x86/header.S b/kernel/arch/x86/header.S
index 794114b..a6ab34f 100644
--- a/kernel/arch/x86/header.S
+++ b/kernel/arch/x86/header.S
@@ -17,7 +17,7 @@
 
 
 
-#include <magenta/boot/bootdata.h>
+#include <zircon/boot/bootdata.h>
 
 .section .text.boot0, "ax", @progbits
 
diff --git a/kernel/arch/x86/hwp.cpp b/kernel/arch/x86/hwp.cpp
index 1b04ba7..94367ec 100644
--- a/kernel/arch/x86/hwp.cpp
+++ b/kernel/arch/x86/hwp.cpp
@@ -5,7 +5,7 @@
 // license that can be found in the LICENSE file or at
 // https://opensource.org/licenses/MIT
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <err.h>
 #include <inttypes.h>
 #include <string.h>
@@ -80,7 +80,7 @@
         printf("usage:\n");
         printf("%s enable\n", argv[0].str);
         printf("%s hint <0-255>\n", argv[0].str);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     if (!strcmp(argv[1].str, "enable")) {
@@ -99,7 +99,7 @@
         goto usage;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 STATIC_COMMAND_START
diff --git a/kernel/arch/x86/hypervisor/guest.cpp b/kernel/arch/x86/hypervisor/guest.cpp
index 102501b..4ad3120 100644
--- a/kernel/arch/x86/hypervisor/guest.cpp
+++ b/kernel/arch/x86/hypervisor/guest.cpp
@@ -7,11 +7,11 @@
 #include <arch/x86/apic.h>
 #include <arch/x86/feature.h>
 #include <hypervisor/guest_physical_address_space.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls/hypervisor.h>
 
 #include "vmx_cpu_state_priv.h"
 
-static const mx_vaddr_t kIoApicPhysBase = 0xfec00000;
+static const zx_vaddr_t kIoApicPhysBase = 0xfec00000;
 
 static void ignore_msr(VmxPage* msr_bitmaps_page, uint32_t msr) {
     // From Volume 3, Section 24.6.9.
@@ -32,36 +32,36 @@
 }
 
 // static
-mx_status_t Guest::Create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* out) {
+zx_status_t Guest::Create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* out) {
     fbl::AllocChecker ac;
     fbl::unique_ptr<Guest> guest(new (&ac) Guest);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    mx_status_t status = GuestPhysicalAddressSpace::Create(fbl::move(physmem), &guest->gpas_);
-    if (status != MX_OK)
+    zx_status_t status = GuestPhysicalAddressSpace::Create(fbl::move(physmem), &guest->gpas_);
+    if (status != ZX_OK)
         return status;
 
     // We ensure the page containing the IO APIC address is not mapped so that
     // we VM exit with an EPT violation when the guest accesses the page.
     status = guest->gpas_->UnmapRange(kIoApicPhysBase, PAGE_SIZE);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Setup common APIC access.
     VmxInfo vmx_info;
     status = guest->apic_access_page_.Alloc(vmx_info, 0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     status = guest->gpas_->MapApicPage(APIC_PHYS_BASE,
                                        guest->apic_access_page_.PhysicalAddress());
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Setup common MSR bitmaps.
     status = guest->msr_bitmaps_page_.Alloc(vmx_info, UINT8_MAX);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     ignore_msr(&guest->msr_bitmaps_page_, X86_MSR_IA32_PAT);
@@ -76,43 +76,43 @@
     ignore_msr(&guest->msr_bitmaps_page_, X86_MSR_IA32_TSC_AUX);
 
     *out = fbl::move(guest);
-    return MX_OK;
+    return ZX_OK;
 }
 
 Guest::~Guest() {
-    __UNUSED mx_status_t status = gpas_->UnmapRange(APIC_PHYS_BASE, PAGE_SIZE);
-    DEBUG_ASSERT(status == MX_OK);
+    __UNUSED zx_status_t status = gpas_->UnmapRange(APIC_PHYS_BASE, PAGE_SIZE);
+    DEBUG_ASSERT(status == ZX_OK);
 }
 
-mx_status_t Guest::SetTrap(uint32_t kind, mx_vaddr_t addr, size_t len,
+zx_status_t Guest::SetTrap(uint32_t kind, zx_vaddr_t addr, size_t len,
                            fbl::RefPtr<PortDispatcher> port, uint64_t key) {
     if (len == 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (SIZE_MAX - len < addr)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     switch (kind) {
-    case MX_GUEST_TRAP_MEM:
+    case ZX_GUEST_TRAP_MEM:
         if (!IS_PAGE_ALIGNED(addr) || !IS_PAGE_ALIGNED(len))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return gpas_->UnmapRange(addr, len);
-    case MX_GUEST_TRAP_IO:
+    case ZX_GUEST_TRAP_IO:
         if (addr + len > UINT16_MAX)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         return mux_.AddPortRange(addr, len, fbl::move(port), key);
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
-mx_status_t arch_guest_create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* guest) {
-    // Check that the CPU supports VMX.
+zx_status_t arch_guest_create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* guest) {
+    // Check that the CPU supports VZX.
     if (!x86_feature_test(X86_FEATURE_VMX))
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     return Guest::Create(fbl::move(physmem), guest);
 }
 
-mx_status_t arch_guest_set_trap(Guest* guest, uint32_t kind, mx_vaddr_t addr, size_t len,
+zx_status_t arch_guest_set_trap(Guest* guest, uint32_t kind, zx_vaddr_t addr, size_t len,
                                 fbl::RefPtr<PortDispatcher> port, uint64_t key) {
     return guest->SetTrap(kind, addr, len, port, key);
 }
diff --git a/kernel/arch/x86/hypervisor/vcpu.cpp b/kernel/arch/x86/hypervisor/vcpu.cpp
index 36d7ffd..684868d 100644
--- a/kernel/arch/x86/hypervisor/vcpu.cpp
+++ b/kernel/arch/x86/hypervisor/vcpu.cpp
@@ -13,7 +13,7 @@
 #include <vm/fault.h>
 #include <vm/pmm.h>
 #include <vm/vm_object.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls/hypervisor.h>
 #include <fbl/auto_call.h>
 
 #include "vcpu_priv.h"
@@ -28,7 +28,7 @@
 static const uint32_t kInterruptInfoDeliverErrorCode = 1u << 11;
 static const uint32_t kInterruptTypeHardwareException = 3u << 8;
 
-static mx_status_t vmptrld(paddr_t pa) {
+static zx_status_t vmptrld(paddr_t pa) {
     uint8_t err;
 
     __asm__ volatile(
@@ -37,10 +37,10 @@
         : [pa] "m"(pa)
         : "cc", "memory");
 
-    return err ? MX_ERR_INTERNAL : MX_OK;
+    return err ? ZX_ERR_INTERNAL : ZX_OK;
 }
 
-static mx_status_t vmclear(paddr_t pa) {
+static zx_status_t vmclear(paddr_t pa) {
     uint8_t err;
 
     __asm__ volatile(
@@ -49,7 +49,7 @@
         : [pa] "m"(pa)
         : "cc", "memory");
 
-    return err ? MX_ERR_INTERNAL : MX_OK;
+    return err ? ZX_ERR_INTERNAL : ZX_OK;
 }
 
 static uint64_t vmread(uint64_t field) {
@@ -62,7 +62,7 @@
         : [field] "r"(field)
         : "cc");
 
-    DEBUG_ASSERT(err == MX_OK);
+    DEBUG_ASSERT(err == ZX_OK);
     return val;
 }
 
@@ -75,15 +75,15 @@
         : [val] "r"(val), [field] "r"(field)
         : "cc");
 
-    DEBUG_ASSERT(err == MX_OK);
+    DEBUG_ASSERT(err == ZX_OK);
 }
 
 AutoVmcs::AutoVmcs(const paddr_t vmcs_address)
     : vmcs_address_(vmcs_address) {
     DEBUG_ASSERT(!arch_ints_disabled());
     arch_disable_ints();
-    __UNUSED mx_status_t status = vmptrld(vmcs_address_);
-    DEBUG_ASSERT(status == MX_OK);
+    __UNUSED zx_status_t status = vmptrld(vmcs_address_);
+    DEBUG_ASSERT(status == ZX_OK);
 }
 
 AutoVmcs::~AutoVmcs() {
@@ -93,8 +93,8 @@
 
 void AutoVmcs::Reload() {
     DEBUG_ASSERT(arch_ints_disabled());
-    __UNUSED mx_status_t status = vmptrld(vmcs_address_);
-    DEBUG_ASSERT(status == MX_OK);
+    __UNUSED zx_status_t status = vmptrld(vmcs_address_);
+    DEBUG_ASSERT(status == ZX_OK);
 }
 
 void AutoVmcs::InterruptibleReload() {
@@ -175,22 +175,22 @@
     vmwrite(static_cast<uint64_t>(field), val);
 }
 
-mx_status_t AutoVmcs::SetControl(VmcsField32 controls, uint64_t true_msr, uint64_t old_msr,
+zx_status_t AutoVmcs::SetControl(VmcsField32 controls, uint64_t true_msr, uint64_t old_msr,
                                  uint32_t set, uint32_t clear) {
     uint32_t allowed_0 = static_cast<uint32_t>(BITS(true_msr, 31, 0));
     uint32_t allowed_1 = static_cast<uint32_t>(BITS_SHIFT(true_msr, 63, 32));
     if ((allowed_1 & set) != set) {
         dprintf(SPEW, "can not set vmcs controls %#x\n", static_cast<uint>(controls));
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     if ((~allowed_0 & clear) != clear) {
         dprintf(SPEW, "can not clear vmcs controls %#x\n", static_cast<uint>(controls));
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     if ((set & clear) != 0) {
         dprintf(SPEW, "can not set and clear the same vmcs controls %#x\n",
                 static_cast<uint>(controls));
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Reference Volume 3, Section 31.5.1, Algorithm 3, Part C. If the control
@@ -200,7 +200,7 @@
     uint32_t unknown = flexible & ~(set | clear);
     uint32_t defaults = unknown & BITS(old_msr, 31, 0);
     Write(controls, allowed_0 | defaults | set);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static uint cpu_of(uint16_t vpid) {
@@ -267,12 +267,12 @@
     entry->value = value;
 }
 
-mx_status_t vmcs_init(paddr_t vmcs_address, uint16_t vpid, uintptr_t ip, uintptr_t cr3,
+zx_status_t vmcs_init(paddr_t vmcs_address, uint16_t vpid, uintptr_t ip, uintptr_t cr3,
                       paddr_t virtual_apic_address, paddr_t apic_access_address,
                       paddr_t msr_bitmaps_address, paddr_t pml4_address, VmxState* vmx_state,
                       VmxPage* host_msr_page, VmxPage* guest_msr_page) {
-    mx_status_t status = vmclear(vmcs_address);
-    if (status != MX_OK)
+    zx_status_t status = vmclear(vmcs_address);
+    if (status != ZX_OK)
         return status;
 
     AutoVmcs vmcs(vmcs_address);
@@ -292,7 +292,7 @@
                                  // Enable use of INVPCID instruction.
                                  PROCBASED_CTLS2_INVPCID,
                              0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Setup pin-based VMCS controls.
@@ -304,7 +304,7 @@
                                  // Non-maskable interrupts cause a VM exit.
                                  PINBASED_CTLS_NMI_EXITING,
                              0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Setup primary processor-based VMCS controls.
@@ -331,7 +331,7 @@
                                  PROCBASED_CTLS_CR8_LOAD_EXITING |
                                  // Disable VM exit on CR8 store.
                                  PROCBASED_CTLS_CR8_STORE_EXITING);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // We only enable interrupt-window exiting above to ensure that the
@@ -355,7 +355,7 @@
                                  // Load the host IA32_EFER MSR on exit.
                                  EXIT_CTLS_LOAD_IA32_EFER,
                              0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Setup VM-entry VMCS controls.
@@ -370,7 +370,7 @@
                                  // Load the guest IA32_EFER MSR on entry.
                                  ENTRY_CTLS_LOAD_IA32_EFER,
                              0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // From Volume 3, Section 24.6.3: The exception bitmap is a 32-bit field
@@ -483,14 +483,14 @@
                    X86_CR0_PG | // Enable paging
                    X86_CR0_NE; // Enable internal x87 exception handling
     if (cr_is_invalid(cr0, X86_MSR_IA32_VMX_CR0_FIXED0, X86_MSR_IA32_VMX_CR0_FIXED1)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     vmcs.Write(VmcsFieldXX::GUEST_CR0, cr0);
 
     uint64_t cr4 = X86_CR4_PAE | // Enable PAE paging
                    X86_CR4_VMXE; // Enable VMX
     if (cr_is_invalid(cr4, X86_MSR_IA32_VMX_CR4_FIXED0, X86_MSR_IA32_VMX_CR4_FIXED1)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     vmcs.Write(VmcsFieldXX::GUEST_CR4, cr4);
 
@@ -557,17 +557,17 @@
         vmx_state->guest_state.xcr0 = X86_XSAVE_STATE_X87;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // static
-mx_status_t Vcpu::Create(mx_vaddr_t ip, mx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
+zx_status_t Vcpu::Create(zx_vaddr_t ip, zx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
                          paddr_t apic_access_address, paddr_t msr_bitmaps_address,
                          GuestPhysicalAddressSpace* gpas, PacketMux& mux,
                          fbl::unique_ptr<Vcpu>* out) {
     uint16_t vpid;
-    mx_status_t status = alloc_vpid(&vpid);
-    if (status != MX_OK)
+    zx_status_t status = alloc_vpid(&vpid);
+    if (status != ZX_OK)
         return status;
     auto auto_call = fbl::MakeAutoCall([=]() { free_vpid(vpid); });
 
@@ -587,32 +587,32 @@
     fbl::AllocChecker ac;
     fbl::unique_ptr<Vcpu> vcpu(new (&ac) Vcpu(thread, vpid, apic_vmo, gpas, mux));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     timer_init(&vcpu->local_apic_state_.timer);
     event_init(&vcpu->local_apic_state_.event, false, EVENT_FLAG_AUTOUNSIGNAL);
     status = vcpu->local_apic_state_.interrupt_bitmap.Reset(kNumInterrupts);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     paddr_t virtual_apic_address;
     status = vcpu->apic_vmo_->Lookup(0, PAGE_SIZE, kPfFlags, guest_lookup_page,
                                      &virtual_apic_address);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     vcpu->local_apic_state_.apic_addr = paddr_to_kvaddr(virtual_apic_address);
 
     VmxInfo vmx_info;
     status = vcpu->host_msr_page_.Alloc(vmx_info, 0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     status = vcpu->guest_msr_page_.Alloc(vmx_info, 0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     status = vcpu->vmcs_page_.Alloc(vmx_info, 0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     VmxRegion* region = vcpu->vmcs_page_.VirtualAddress<VmxRegion>();
@@ -620,12 +620,12 @@
     status = vmcs_init(vcpu->vmcs_page_.PhysicalAddress(), vpid, ip, cr3, virtual_apic_address,
                        apic_access_address, msr_bitmaps_address, gpas->Pml4Address(),
                        &vcpu->vmx_state_, &vcpu->host_msr_page_, &vcpu->guest_msr_page_);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     auto_call.cancel();
     *out = fbl::move(vcpu);
-    return MX_OK;
+    return ZX_OK;
 }
 
 Vcpu::Vcpu(const thread_t* thread, uint16_t vpid, fbl::RefPtr<VmObject> apic_vmo,
@@ -641,14 +641,14 @@
     // pin the current thread to the same CPU as the VCPU.
     AutoPin pin(this);
     vmclear(vmcs_page_.PhysicalAddress());
-    __UNUSED mx_status_t status = free_vpid(vpid_);
-    DEBUG_ASSERT(status == MX_OK);
+    __UNUSED zx_status_t status = free_vpid(vpid_);
+    DEBUG_ASSERT(status == ZX_OK);
 }
 
-mx_status_t Vcpu::Resume(mx_port_packet_t* packet) {
+zx_status_t Vcpu::Resume(zx_port_packet_t* packet) {
     if (!check_pinned_cpu_invariant(thread_, vpid_))
-        return MX_ERR_BAD_STATE;
-    mx_status_t status;
+        return ZX_ERR_BAD_STATE;
+    zx_status_t status;
     do {
         AutoVmcs vmcs(vmcs_page_.PhysicalAddress());
         if (x86_feature_test(X86_FEATURE_XSAVE)) {
@@ -662,7 +662,7 @@
             vmx_state_.guest_state.xcr0 = x86_xgetbv(0);
             x86_xsetbv(0, vmx_state_.host_state.xcr0);
         }
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             uint64_t error = vmcs.Read(VmcsField32::INSTRUCTION_ERROR);
             dprintf(SPEW, "vmlaunch failed: %#" PRIx64 "\n", error);
         } else {
@@ -670,8 +670,8 @@
             GuestState* guest_state = &vmx_state_.guest_state;
             status = vmexit_handler(&vmcs, guest_state, &local_apic_state_, gpas_, mux_, packet);
         }
-    } while (status == MX_OK);
-    return status == MX_ERR_NEXT ? MX_OK : status;
+    } while (status == ZX_OK);
+    return status == ZX_ERR_NEXT ? ZX_OK : status;
 }
 
 void vmx_exit(VmxState* vmx_state) {
@@ -688,15 +688,15 @@
     idt_load(idt_get_readonly());
 }
 
-mx_status_t Vcpu::Interrupt(uint32_t vector) {
+zx_status_t Vcpu::Interrupt(uint32_t vector) {
     if (vector > X86_MAX_INT)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     if (!local_apic_signal_interrupt(&local_apic_state_, vector, true)) {
         // If we did not signal the VCPU, it means it is currently running,
         // therefore we should issue an IPI to force a VM exit.
         mp_reschedule(MP_IPI_TARGET_MASK, 1u << cpu_of(vpid_), 0);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 template <typename Out, typename In>
@@ -718,32 +718,32 @@
     out->r15 = in.r15;
 }
 
-mx_status_t Vcpu::ReadState(uint32_t kind, void* buffer, uint32_t len) const {
+zx_status_t Vcpu::ReadState(uint32_t kind, void* buffer, uint32_t len) const {
     if (!check_pinned_cpu_invariant(thread_, vpid_))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     switch (kind) {
-    case MX_VCPU_STATE: {
-        if (len != sizeof(mx_vcpu_state_t))
+    case ZX_VCPU_STATE: {
+        if (len != sizeof(zx_vcpu_state_t))
             break;
-        auto state = static_cast<mx_vcpu_state_t*>(buffer);
+        auto state = static_cast<zx_vcpu_state_t*>(buffer);
         register_copy(state, vmx_state_.guest_state);
         AutoVmcs vmcs(vmcs_page_.PhysicalAddress());
         state->rsp = vmcs.Read(VmcsFieldXX::GUEST_RSP);
         state->flags = vmcs.Read(VmcsFieldXX::GUEST_RFLAGS) & X86_FLAGS_USER;
-        return MX_OK;
+        return ZX_OK;
     }
     }
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
 
-mx_status_t Vcpu::WriteState(uint32_t kind, const void* buffer, uint32_t len) {
+zx_status_t Vcpu::WriteState(uint32_t kind, const void* buffer, uint32_t len) {
     if (!check_pinned_cpu_invariant(thread_, vpid_))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     switch (kind) {
-    case MX_VCPU_STATE: {
-        if (len != sizeof(mx_vcpu_state_t))
+    case ZX_VCPU_STATE: {
+        if (len != sizeof(zx_vcpu_state_t))
             break;
-        auto state = static_cast<const mx_vcpu_state_t*>(buffer);
+        auto state = static_cast<const zx_vcpu_state_t*>(buffer);
         register_copy(&vmx_state_.guest_state, *state);
         AutoVmcs vmcs(vmcs_page_.PhysicalAddress());
         vmcs.Write(VmcsFieldXX::GUEST_RSP, state->rsp);
@@ -753,20 +753,20 @@
                                         (state->flags & X86_FLAGS_USER);
             vmcs.Write(VmcsFieldXX::GUEST_RFLAGS, user_flags);
         }
-        return MX_OK;
+        return ZX_OK;
     }
-    case MX_VCPU_IO: {
-        if (len != sizeof(mx_vcpu_io_t))
+    case ZX_VCPU_IO: {
+        if (len != sizeof(zx_vcpu_io_t))
             break;
-        auto io = static_cast<const mx_vcpu_io_t*>(buffer);
+        auto io = static_cast<const zx_vcpu_io_t*>(buffer);
         memcpy(&vmx_state_.guest_state.rax, io->data, io->access_size);
-        return MX_OK;
+        return ZX_OK;
     }
     }
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
 
-mx_status_t x86_vcpu_create(mx_vaddr_t ip, mx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
+zx_status_t x86_vcpu_create(zx_vaddr_t ip, zx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
                             paddr_t apic_access_address, paddr_t msr_bitmaps_address,
                             GuestPhysicalAddressSpace* gpas, PacketMux& mux,
                             fbl::unique_ptr<Vcpu>* out) {
@@ -774,18 +774,18 @@
                         out);
 }
 
-mx_status_t arch_vcpu_resume(Vcpu* vcpu, mx_port_packet_t* packet) {
+zx_status_t arch_vcpu_resume(Vcpu* vcpu, zx_port_packet_t* packet) {
     return vcpu->Resume(packet);
 }
 
-mx_status_t arch_vcpu_interrupt(Vcpu* vcpu, uint32_t vector) {
+zx_status_t arch_vcpu_interrupt(Vcpu* vcpu, uint32_t vector) {
     return vcpu->Interrupt(vector);
 }
 
-mx_status_t arch_vcpu_read_state(const Vcpu* vcpu, uint32_t kind, void* buffer, uint32_t len) {
+zx_status_t arch_vcpu_read_state(const Vcpu* vcpu, uint32_t kind, void* buffer, uint32_t len) {
     return vcpu->ReadState(kind, buffer, len);
 }
 
-mx_status_t arch_vcpu_write_state(Vcpu* vcpu, uint32_t kind, const void* buffer, uint32_t len) {
+zx_status_t arch_vcpu_write_state(Vcpu* vcpu, uint32_t kind, const void* buffer, uint32_t len) {
     return vcpu->WriteState(kind, buffer, len);
 }
diff --git a/kernel/arch/x86/hypervisor/vcpu_priv.h b/kernel/arch/x86/hypervisor/vcpu_priv.h
index 459a08b..b3d1910 100644
--- a/kernel/arch/x86/hypervisor/vcpu_priv.h
+++ b/kernel/arch/x86/hypervisor/vcpu_priv.h
@@ -192,7 +192,7 @@
     void Write(VmcsField64 field, uint64_t val);
     void Write(VmcsFieldXX field, uint64_t val);
 
-    mx_status_t SetControl(VmcsField32 controls, uint64_t true_msr, uint64_t old_msr, uint32_t set,
+    zx_status_t SetControl(VmcsField32 controls, uint64_t true_msr, uint64_t old_msr, uint32_t set,
                            uint32_t clear);
 
 private:
diff --git a/kernel/arch/x86/hypervisor/vmexit.cpp b/kernel/arch/x86/hypervisor/vmexit.cpp
index 5333bd0..f27bd4c 100644
--- a/kernel/arch/x86/hypervisor/vmexit.cpp
+++ b/kernel/arch/x86/hypervisor/vmexit.cpp
@@ -19,7 +19,7 @@
 #include <kernel/auto_lock.h>
 #include <vm/fault.h>
 #include <vm/pmm.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls/hypervisor.h>
 #include <platform/pc/timer.h>
 
 #include "vcpu_priv.h"
@@ -141,16 +141,16 @@
     return event_signal(&local_apic_state->event, reschedule) > 0;
 }
 
-static mx_status_t handle_external_interrupt(AutoVmcs* vmcs, LocalApicState* local_apic_state) {
+static zx_status_t handle_external_interrupt(AutoVmcs* vmcs, LocalApicState* local_apic_state) {
     vmcs->InterruptibleReload();
     local_apic_maybe_interrupt(vmcs, local_apic_state);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t handle_interrupt_window(AutoVmcs* vmcs, LocalApicState* local_apic_state) {
+static zx_status_t handle_interrupt_window(AutoVmcs* vmcs, LocalApicState* local_apic_state) {
     vmcs->InterruptWindowExiting(false);
     local_apic_issue_interrupt(vmcs, local_apic_state);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // From Volume 2, Section 3.2, Table 3-8  "Processor Extended State Enumeration
@@ -159,24 +159,24 @@
 // Bits 31-00: Maximum size (bytes, from the beginning of the XSAVE/XRSTOR save
 // area) required by enabled features in XCR0. May be different than ECX if some
 // features at the end of the XSAVE save area are not enabled.
-static mx_status_t compute_xsave_size(uint64_t guest_xcr0, uint32_t* xsave_size) {
+static zx_status_t compute_xsave_size(uint64_t guest_xcr0, uint32_t* xsave_size) {
     *xsave_size = kXsaveLegacyRegionSize + kXsaveHeaderSize;
     for (uint32_t i = kFirstExtendedStateComponent; i <= kLastExtendedStateComponent; ++i) {
         cpuid_leaf leaf;
         if (!(guest_xcr0 & (1 << i)))
             continue;
         if (!x86_get_cpuid_subleaf(X86_CPUID_XSAVE, i, &leaf))
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         if (leaf.a == 0 && leaf.b == 0 && leaf.c == 0 && leaf.d == 0)
             continue;
         const uint32_t component_offset = leaf.b;
         const uint32_t component_size = leaf.a;
         *xsave_size = component_offset + component_size;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t handle_cpuid(const ExitInfo& exit_info, AutoVmcs* vmcs,
+static zx_status_t handle_cpuid(const ExitInfo& exit_info, AutoVmcs* vmcs,
                                 GuestState* guest_state) {
     const uint64_t leaf = guest_state->rax;
     const uint64_t subleaf = guest_state->rcx;
@@ -188,7 +188,7 @@
         cpuid((uint32_t)guest_state->rax,
               (uint32_t*)&guest_state->rax, (uint32_t*)&guest_state->rbx,
               (uint32_t*)&guest_state->rcx, (uint32_t*)&guest_state->rdx);
-        return MX_OK;
+        return ZX_OK;
     case X86_CPUID_BASE + 1 ... MAX_SUPPORTED_CPUID:
     case X86_CPUID_EXT_BASE + 1 ... MAX_SUPPORTED_CPUID_EXT:
         next_rip(exit_info, vmcs);
@@ -211,8 +211,8 @@
         case X86_CPUID_XSAVE:
             if (subleaf == 0) {
                 uint32_t xsave_size = 0;
-                mx_status_t status = compute_xsave_size(guest_state->xcr0, &xsave_size);
-                if (status != MX_OK)
+                zx_status_t status = compute_xsave_size(guest_state->xcr0, &xsave_size);
+                if (status != ZX_OK)
                     return status;
                 guest_state->rbx = xsave_size;
             } else if (subleaf == 1) {
@@ -240,34 +240,34 @@
             guest_state->rbx &= ~(1u << X86_FEATURE_PT.bit);
             break;
         }
-        return MX_OK;
+        return ZX_OK;
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-static mx_status_t handle_hlt(const ExitInfo& exit_info, AutoVmcs* vmcs,
+static zx_status_t handle_hlt(const ExitInfo& exit_info, AutoVmcs* vmcs,
                               LocalApicState* local_apic_state) {
     do {
-        mx_status_t status = event_wait_deadline(&local_apic_state->event, INFINITE_TIME, true);
+        zx_status_t status = event_wait_deadline(&local_apic_state->event, INFINITE_TIME, true);
         vmcs->Reload();
-        if (status != MX_OK)
-            return MX_ERR_CANCELED;
+        if (status != ZX_OK)
+            return ZX_ERR_CANCELED;
     } while (!local_apic_issue_interrupt(vmcs, local_apic_state));
     next_rip(exit_info, vmcs);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t handle_io_instruction(const ExitInfo& exit_info, AutoVmcs* vmcs,
+static zx_status_t handle_io_instruction(const ExitInfo& exit_info, AutoVmcs* vmcs,
                                          GuestState* guest_state, PacketMux& mux,
-                                         mx_port_packet_t* packet) {
+                                         zx_port_packet_t* packet) {
     IoInfo io_info(exit_info.exit_qualification);
     if (io_info.string || io_info.repeat)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     next_rip(exit_info, vmcs);
 
     memset(packet, 0, sizeof(*packet));
-    packet->type = MX_PKT_TYPE_GUEST_IO;
+    packet->type = ZX_PKT_TYPE_GUEST_IO;
     packet->guest_io.port = io_info.port;
     packet->guest_io.access_size = io_info.access_size;
     packet->guest_io.input = io_info.input;
@@ -279,17 +279,17 @@
             guest_state->rax = 0;
     } else {
         memcpy(packet->guest_io.data, &guest_state->rax, io_info.access_size);
-        mx_status_t status = mux.Queue(packet->guest_io.port, *packet, vmcs);
+        zx_status_t status = mux.Queue(packet->guest_io.port, *packet, vmcs);
         // If there was no FIFO to handle the trap, then we should return to
         // user-space. Otherwise, return the status of the FIFO write.
-        if (status != MX_ERR_NOT_FOUND)
+        if (status != ZX_ERR_NOT_FOUND)
             return status;
     }
 
-    return MX_ERR_NEXT;
+    return ZX_ERR_NEXT;
 }
 
-static mx_status_t handle_rdmsr(const ExitInfo& exit_info, AutoVmcs* vmcs,
+static zx_status_t handle_rdmsr(const ExitInfo& exit_info, AutoVmcs* vmcs,
                                 GuestState* guest_state) {
     switch (guest_state->rcx) {
     // Guests can't control most perf/power/metrics. We typically disable them through
@@ -300,18 +300,18 @@
     case X86_MSR_IA32_SMI_COUNT:
     case X86_MSR_IA32_TEMPERATURE_TARGET:
         vmcs->IssueInterrupt(X86_INT_GP_FAULT);
-        return MX_OK;
+        return ZX_OK;
     case X86_MSR_IA32_APIC_BASE:
         next_rip(exit_info, vmcs);
         guest_state->rax = kLocalApicPhysBase;
         guest_state->rdx = 0;
-        return MX_OK;
+        return ZX_OK;
     // From Volume 4, Section 2.1, Table 2-2: For now, only enable fast strings.
     case X86_MSR_IA32_MISC_ENABLE:
         next_rip(exit_info, vmcs);
         guest_state->rax = read_msr(X86_MSR_IA32_MISC_ENABLE) & kMiscEnableFastStrings;
         guest_state->rdx = 0;
-        return MX_OK;
+        return ZX_OK;
     // From Volume 3, Section 28.2.6.2: The MTRRs have no effect on the memory
     // type used for an access to a guest-physical address.
     case X86_MSR_IA32_MTRRCAP:
@@ -331,9 +331,9 @@
         next_rip(exit_info, vmcs);
         guest_state->rax = 0;
         guest_state->rdx = 0;
-        return MX_OK;
+        return ZX_OK;
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -350,14 +350,14 @@
     return INT_NO_RESCHEDULE;
 }
 
-static mx_status_t handle_wrmsr(const ExitInfo& exit_info, AutoVmcs* vmcs, GuestState* guest_state,
+static zx_status_t handle_wrmsr(const ExitInfo& exit_info, AutoVmcs* vmcs, GuestState* guest_state,
                                 LocalApicState* local_apic_state) {
     switch (guest_state->rcx) {
     case X86_MSR_IA32_APIC_BASE:
         if (guest_state->rax != kLocalApicPhysBase || guest_state->rdx != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         next_rip(exit_info, vmcs);
-        return MX_OK;
+        return ZX_OK;
     // See note in handle_rdmsr.
     case X86_MSR_IA32_MTRRCAP:
     case X86_MSR_IA32_MTRR_DEF_TYPE:
@@ -370,20 +370,20 @@
     // a null handler, even when not in compatibility mode. Just ignore it.
     case X86_MSR_IA32_CSTAR:
         next_rip(exit_info, vmcs);
-        return MX_OK;
+        return ZX_OK;
     // Legacy syscall MSRs are unused and we clear them in the VMCS.
     // Allow guests to clear them too. Anything else is an error.
     case X86_MSR_IA32_SYSENTER_CS:
     case X86_MSR_IA32_SYSENTER_ESP:
     case X86_MSR_IA32_SYSENTER_EIP:
         if (guest_state->rax != 0 || guest_state->rdx != 0)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         next_rip(exit_info, vmcs);
-        return MX_OK;
+        return ZX_OK;
     case X86_MSR_IA32_TSC_DEADLINE: {
         uint32_t* reg = apic_reg(local_apic_state, kLocalApicLvtTimer);
         if ((*reg & LVT_TIMER_MODE_MASK) != LVT_TIMER_MODE_TSC_DEADLINE)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         next_rip(exit_info, vmcs);
         timer_cancel(&local_apic_state->timer);
         uint64_t tsc_deadline = guest_state->rdx << 32 | (guest_state->rax & UINT32_MAX);
@@ -392,10 +392,10 @@
             timer_set_oneshot(&local_apic_state->timer, deadline, deadline_callback,
                               local_apic_state);
         }
-        return MX_OK;
+        return ZX_OK;
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -416,7 +416,7 @@
     return (pt_addr & X86_PG_FRAME) + (off & X86_PG_FRAME);
 }
 
-static mx_status_t get_page(const AutoVmcs& vmcs, GuestPhysicalAddressSpace* gpas,
+static zx_status_t get_page(const AutoVmcs& vmcs, GuestPhysicalAddressSpace* gpas,
                             vaddr_t guest_vaddr, paddr_t* host_paddr) {
     size_t indices[X86_PAGING_LEVELS] = {
         VADDR_TO_PML4_INDEX(guest_vaddr),
@@ -427,29 +427,29 @@
     paddr_t pt_addr = vmcs.Read(VmcsFieldXX::GUEST_CR3);
     paddr_t pa;
     for (size_t level = 0; level <= X86_PAGING_LEVELS; level++) {
-        mx_status_t status = gpas->GetPage(page_addr(pt_addr, level - 1, guest_vaddr), &pa);
-        if (status != MX_OK)
+        zx_status_t status = gpas->GetPage(page_addr(pt_addr, level - 1, guest_vaddr), &pa);
+        if (status != ZX_OK)
             return status;
         if (level == X86_PAGING_LEVELS || IS_LARGE_PAGE(pt_addr))
             break;
         pt_entry_t* pt = static_cast<pt_entry_t*>(paddr_to_kvaddr(pa));
         pt_addr = pt[indices[level]];
         if (!IS_PAGE_PRESENT(pt_addr))
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
     }
     *host_paddr = pa;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t fetch_data(const AutoVmcs& vmcs, GuestPhysicalAddressSpace* gpas,
+static zx_status_t fetch_data(const AutoVmcs& vmcs, GuestPhysicalAddressSpace* gpas,
                               vaddr_t guest_vaddr, uint8_t* data, size_t size) {
     // TODO(abdulla): Make this handle a fetch that crosses more than two pages.
     if (size > PAGE_SIZE)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     paddr_t pa;
-    mx_status_t status = get_page(vmcs, gpas, guest_vaddr, &pa);
-    if (status != MX_OK)
+    zx_status_t status = get_page(vmcs, gpas, guest_vaddr, &pa);
+    if (status != ZX_OK)
         return status;
 
     size_t page_offset = guest_vaddr & PAGE_OFFSET_MASK_4KB;
@@ -459,49 +459,49 @@
 
     // If the fetch is not split across pages, return.
     if (from_page == size)
-        return MX_OK;
+        return ZX_OK;
 
     status = get_page(vmcs, gpas, guest_vaddr + size, &pa);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     page = static_cast<uint8_t*>(paddr_to_kvaddr(pa));
     mandatory_memcpy(data + from_page, page, size - from_page);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t handle_memory(const ExitInfo& exit_info, AutoVmcs* vmcs, vaddr_t guest_paddr,
-                                 GuestPhysicalAddressSpace* gpas, mx_port_packet_t* packet) {
+static zx_status_t handle_memory(const ExitInfo& exit_info, AutoVmcs* vmcs, vaddr_t guest_paddr,
+                                 GuestPhysicalAddressSpace* gpas, zx_port_packet_t* packet) {
     if (exit_info.instruction_length > X86_MAX_INST_LEN)
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
 
     memset(packet, 0, sizeof(*packet));
-    packet->type = MX_PKT_TYPE_GUEST_MEM;
+    packet->type = ZX_PKT_TYPE_GUEST_MEM;
     packet->guest_mem.addr = guest_paddr;
     packet->guest_mem.inst_len = exit_info.instruction_length & UINT8_MAX;
-    mx_status_t status = fetch_data(*vmcs, gpas, exit_info.guest_rip, packet->guest_mem.inst_buf,
+    zx_status_t status = fetch_data(*vmcs, gpas, exit_info.guest_rip, packet->guest_mem.inst_buf,
                                     packet->guest_mem.inst_len);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     next_rip(exit_info, vmcs);
-    return MX_ERR_NEXT;
+    return ZX_ERR_NEXT;
 }
 
-static mx_status_t handle_apic_access(const ExitInfo& exit_info, AutoVmcs* vmcs,
+static zx_status_t handle_apic_access(const ExitInfo& exit_info, AutoVmcs* vmcs,
                                       LocalApicState* local_apic_state,
-                                      GuestPhysicalAddressSpace* gpas, mx_port_packet_t* packet) {
+                                      GuestPhysicalAddressSpace* gpas, zx_port_packet_t* packet) {
     ApicAccessInfo apic_access_info(exit_info.exit_qualification);
     switch (apic_access_info.access_type) {
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     case ApicAccessType::LINEAR_ACCESS_WRITE:
         if (apic_access_info.offset == kLocalApicEoi) {
             // When we observe an EOI, we issue any pending interrupts. This is
             // not architecture-accurate, but works for the virtual machine.
             local_apic_maybe_interrupt(vmcs, local_apic_state);
             next_rip(exit_info, vmcs);
-            return MX_OK;
+            return ZX_OK;
         }
     /* fallthrough */
     case ApicAccessType::LINEAR_ACCESS_READ:
@@ -510,8 +510,8 @@
     }
 }
 
-static mx_status_t handle_ept_violation(const ExitInfo& exit_info, AutoVmcs* vmcs,
-                                        GuestPhysicalAddressSpace* gpas, mx_port_packet_t* packet) {
+static zx_status_t handle_ept_violation(const ExitInfo& exit_info, AutoVmcs* vmcs,
+                                        GuestPhysicalAddressSpace* gpas, zx_port_packet_t* packet) {
     vaddr_t guest_paddr = exit_info.guest_physical_address;
     EptViolationInfo ept_violation_info(exit_info.exit_qualification);
 
@@ -526,26 +526,26 @@
     // TODO(tjdetwiler): We'll always call the page fault handler for addresses
     // that userspace wants to handle (ex: MMIO). We should be able to optimize
     // for this use case.
-    mx_status_t result = vmm_guest_page_fault_handler(guest_paddr, pf_flags, gpas->aspace());
-    if (result != MX_ERR_NOT_FOUND)
+    zx_status_t result = vmm_guest_page_fault_handler(guest_paddr, pf_flags, gpas->aspace());
+    if (result != ZX_ERR_NOT_FOUND)
         return result;
 
     return handle_memory(exit_info, vmcs, guest_paddr, gpas, packet);
 }
 
-static mx_status_t handle_xsetbv(const ExitInfo& exit_info, AutoVmcs* vmcs,
+static zx_status_t handle_xsetbv(const ExitInfo& exit_info, AutoVmcs* vmcs,
                                  GuestState* guest_state) {
     uint64_t guest_cr4 = vmcs->Read(VmcsFieldXX::GUEST_CR4);
     if (!(guest_cr4 & X86_CR4_OSXSAVE))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // We only support XCR0.
     if (guest_state->rcx != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     cpuid_leaf leaf;
     if (!x86_get_cpuid_subleaf(X86_CPUID_XSAVE, 0, &leaf))
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
 
     // Check that XCR0 is valid.
     uint64_t xcr0_bitmap = ((uint64_t)leaf.d << 32) | leaf.a;
@@ -555,16 +555,16 @@
         (xcr0 & X86_XSAVE_STATE_X87) != X86_XSAVE_STATE_X87 ||
         // If AVX state is enabled, SSE state must be enabled.
         (xcr0 & (X86_XSAVE_STATE_AVX | X86_XSAVE_STATE_SSE)) == X86_XSAVE_STATE_AVX)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     guest_state->xcr0 = xcr0;
     next_rip(exit_info, vmcs);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t vmexit_handler(AutoVmcs* vmcs, GuestState* guest_state,
+zx_status_t vmexit_handler(AutoVmcs* vmcs, GuestState* guest_state,
                            LocalApicState* local_apic_state, GuestPhysicalAddressSpace* gpas,
-                           PacketMux& mux, mx_port_packet_t* packet) {
+                           PacketMux& mux, zx_port_packet_t* packet) {
     ExitInfo exit_info(*vmcs);
 
     switch (exit_info.exit_reason) {
@@ -590,7 +590,7 @@
     case ExitReason::ENTRY_FAILURE_GUEST_STATE:
     case ExitReason::ENTRY_FAILURE_MSR_LOADING:
         LTRACEF("handling VM entry failure\n\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     case ExitReason::APIC_ACCESS:
         LTRACEF("handling APIC access\n\n");
         return handle_apic_access(exit_info, vmcs, local_apic_state, gpas, packet);
@@ -602,6 +602,6 @@
         return handle_xsetbv(exit_info, vmcs, guest_state);
     default:
         LTRACEF("unhandled VM exit %u\n\n", static_cast<uint32_t>(exit_info.exit_reason));
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
diff --git a/kernel/arch/x86/hypervisor/vmexit_priv.h b/kernel/arch/x86/hypervisor/vmexit_priv.h
index d08bd2e..e7efb69 100644
--- a/kernel/arch/x86/hypervisor/vmexit_priv.h
+++ b/kernel/arch/x86/hypervisor/vmexit_priv.h
@@ -90,6 +90,6 @@
 
 bool local_apic_signal_interrupt(LocalApicState* local_apic_state, uint32_t vector,
                                  bool reschedule);
-mx_status_t vmexit_handler(AutoVmcs* vmcs, GuestState* guest_state,
+zx_status_t vmexit_handler(AutoVmcs* vmcs, GuestState* guest_state,
                            LocalApicState* local_apic_state, GuestPhysicalAddressSpace* gpas,
-                           PacketMux& mux, mx_port_packet_t* packet);
+                           PacketMux& mux, zx_port_packet_t* packet);
diff --git a/kernel/arch/x86/hypervisor/vmx.S b/kernel/arch/x86/hypervisor/vmx.S
index bc75336..33d2fbc 100644
--- a/kernel/arch/x86/hypervisor/vmx.S
+++ b/kernel/arch/x86/hypervisor/vmx.S
@@ -7,7 +7,7 @@
 #include <asm.h>
 
 #include <arch/x86/vmx_state.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 
 .text
 
@@ -76,8 +76,8 @@
     // Set up the return address.
     pushq HS_RIP(%rdi)
 
-    // Return MX_ERR_INTERNAL.
-    mov $MX_ERR_INTERNAL, %eax
+    // Return ZX_ERR_INTERNAL.
+    mov $ZX_ERR_INTERNAL, %eax
     ret
 END_FUNCTION(vmx_enter)
 
@@ -136,7 +136,7 @@
     call vmx_exit
     add $8, %rsp
 
-    // Return MX_OK, using the return address of vmx_enter pushed above.
-    mov $MX_OK, %eax
+    // Return ZX_OK, using the return address of vmx_enter pushed above.
+    mov $ZX_OK, %eax
     ret
 END_FUNCTION(vmx_exit_entry)
diff --git a/kernel/arch/x86/hypervisor/vmx_cpu_state.cpp b/kernel/arch/x86/hypervisor/vmx_cpu_state.cpp
index f4511f1..eefe509 100644
--- a/kernel/arch/x86/hypervisor/vmx_cpu_state.cpp
+++ b/kernel/arch/x86/hypervisor/vmx_cpu_state.cpp
@@ -20,7 +20,7 @@
 static size_t num_vcpus TA_GUARDED(vmx_mutex) = 0;
 static fbl::unique_ptr<VmxCpuState> vmx_cpu_state TA_GUARDED(vmx_mutex);
 
-static mx_status_t vmxon(paddr_t pa) {
+static zx_status_t vmxon(paddr_t pa) {
     uint8_t err;
 
     __asm__ volatile(
@@ -29,10 +29,10 @@
         : [pa] "m"(pa)
         : "cc", "memory");
 
-    return err ? MX_ERR_INTERNAL : MX_OK;
+    return err ? ZX_ERR_INTERNAL : ZX_OK;
 }
 
-static mx_status_t vmxoff() {
+static zx_status_t vmxoff() {
     uint8_t err;
 
     __asm__ volatile(
@@ -41,7 +41,7 @@
         :
         : "cc");
 
-    return err ? MX_ERR_INTERNAL : MX_OK;
+    return err ? ZX_ERR_INTERNAL : ZX_OK;
 }
 
 VmxInfo::VmxInfo() {
@@ -85,25 +85,25 @@
         pmm_free_page(page);
 }
 
-mx_status_t VmxPage::Alloc(const VmxInfo& vmx_info, uint8_t fill) {
+zx_status_t VmxPage::Alloc(const VmxInfo& vmx_info, uint8_t fill) {
     // From Volume 3, Appendix A.1: Bits 44:32 report the number of bytes that
     // software should allocate for the VMXON region and any VMCS region. It is
     // a value greater than 0 and at most 4096 (bit 44 is set if and only if
     // bits 43:32 are clear).
     if (vmx_info.region_size > PAGE_SIZE)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Check use of write-back memory for VMX regions is supported.
     if (!vmx_info.write_back)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // The maximum size for a VMXON or VMCS region is 4096, therefore
     // unconditionally allocating a page is adequate.
     if (pmm_alloc_page(0, &pa_) == nullptr)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     memset(VirtualAddress(), fill, PAGE_SIZE);
-    return MX_OK;
+    return ZX_OK;
 }
 
 paddr_t VmxPage::PhysicalAddress() const {
@@ -116,40 +116,40 @@
     return paddr_to_kvaddr(pa_);
 }
 
-static mx_status_t vmxon_task(void* context, uint cpu_num) {
+static zx_status_t vmxon_task(void* context, uint cpu_num) {
     auto pages = static_cast<fbl::Array<VmxPage>*>(context);
     VmxPage& page = (*pages)[cpu_num];
 
     // Check that we have instruction information when we VM exit on IO.
     VmxInfo vmx_info;
     if (!vmx_info.io_exit_info)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Check that full VMX controls are supported.
     if (!vmx_info.vmx_controls)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Check that a page-walk length of 4 is supported.
     EptInfo ept_info;
     if (!ept_info.page_walk_4)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Check use write-back memory for EPT is supported.
     if (!ept_info.write_back)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Check that accessed and dirty flags for EPT are supported.
     if (!ept_info.ept_flags)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Check that the INVEPT instruction is supported.
     if (!ept_info.invept)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Check that wait for startup IPI is a supported activity state.
     MiscInfo misc_info;
     if (!misc_info.wait_for_sipi)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Enable VMXON, if required.
     uint64_t feature_control = read_msr(X86_MSR_IA32_FEATURE_CONTROL);
@@ -157,7 +157,7 @@
         !(feature_control & X86_MSR_IA32_FEATURE_CONTROL_VMXON)) {
         if ((feature_control & X86_MSR_IA32_FEATURE_CONTROL_LOCK) &&
             !(feature_control & X86_MSR_IA32_FEATURE_CONTROL_VMXON)) {
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
         feature_control |= X86_MSR_IA32_FEATURE_CONTROL_LOCK;
         feature_control |= X86_MSR_IA32_FEATURE_CONTROL_VMXON;
@@ -167,10 +167,10 @@
     // Check control registers are in a VMX-friendly state.
     uint64_t cr0 = x86_get_cr0();
     if (cr_is_invalid(cr0, X86_MSR_IA32_VMX_CR0_FIXED0, X86_MSR_IA32_VMX_CR0_FIXED1))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     uint64_t cr4 = x86_get_cr4() | X86_CR4_VMXE;
     if (cr_is_invalid(cr4, X86_MSR_IA32_VMX_CR4_FIXED0, X86_MSR_IA32_VMX_CR4_FIXED1))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     // Enable VMX using the VMXE bit.
     x86_set_cr4(cr4);
@@ -180,47 +180,47 @@
     region->revision_id = vmx_info.revision_id;
 
     // Execute VMXON.
-    mx_status_t status = vmxon(page.PhysicalAddress());
-    if (status != MX_OK) {
+    zx_status_t status = vmxon(page.PhysicalAddress());
+    if (status != ZX_OK) {
         dprintf(CRITICAL, "Failed to turn on VMX on CPU %u\n", cpu_num);
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void vmxoff_task(void* arg) {
     // Execute VMXOFF.
-    mx_status_t status = vmxoff();
-    if (status != MX_OK) {
+    zx_status_t status = vmxoff();
+    if (status != ZX_OK) {
         dprintf(CRITICAL, "Failed to turn off VMX on CPU %u\n", arch_curr_cpu_num());
         return;
     }
 
-    // Disable VMX.
+    // Disable VZX.
     x86_set_cr4(x86_get_cr4() & ~X86_CR4_VMXE);
 }
 
 // static
-mx_status_t VmxCpuState::Create(fbl::unique_ptr<VmxCpuState>* out) {
+zx_status_t VmxCpuState::Create(fbl::unique_ptr<VmxCpuState>* out) {
     fbl::AllocChecker ac;
     fbl::unique_ptr<VmxCpuState> vmx_cpu_state(new (&ac) VmxCpuState);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
-    mx_status_t status = vmx_cpu_state->Init();
-    if (status != MX_OK)
+        return ZX_ERR_NO_MEMORY;
+    zx_status_t status = vmx_cpu_state->Init();
+    if (status != ZX_OK)
         return status;
 
     // Allocate a VMXON page for each CPU.
     size_t num_cpus = arch_max_num_cpus();
     VmxPage* pages = new (&ac) VmxPage[num_cpus];
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     fbl::Array<VmxPage> vmxon_pages(pages, num_cpus);
     VmxInfo vmx_info;
     for (auto& page : vmxon_pages) {
-        mx_status_t status = page.Alloc(vmx_info, 0);
-        if (status != MX_OK)
+        zx_status_t status = page.Alloc(vmx_info, 0);
+        if (status != ZX_OK)
             return status;
     }
 
@@ -228,38 +228,38 @@
     mp_cpu_mask_t cpu_mask = percpu_exec(vmxon_task, &vmxon_pages);
     if (cpu_mask != mp_get_online_mask()) {
         mp_sync_exec(MP_IPI_TARGET_MASK, cpu_mask, vmxoff_task, nullptr);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     vmx_cpu_state->vmxon_pages_ = fbl::move(vmxon_pages);
     *out = fbl::move(vmx_cpu_state);
-    return MX_OK;
+    return ZX_OK;
 }
 
 VmxCpuState::~VmxCpuState() {
     mp_sync_exec(MP_IPI_TARGET_ALL, 0, vmxoff_task, nullptr);
 }
 
-mx_status_t alloc_vpid(uint16_t* vpid) {
+zx_status_t alloc_vpid(uint16_t* vpid) {
     fbl::AutoLock lock(&vmx_mutex);
     if (num_vcpus == 0) {
-        mx_status_t status = VmxCpuState::Create(&vmx_cpu_state);
-        if (status != MX_OK)
+        zx_status_t status = VmxCpuState::Create(&vmx_cpu_state);
+        if (status != ZX_OK)
             return status;
     }
     num_vcpus++;
     return vmx_cpu_state->AllocId(vpid);
 }
 
-mx_status_t free_vpid(uint16_t vpid) {
+zx_status_t free_vpid(uint16_t vpid) {
     fbl::AutoLock lock(&vmx_mutex);
-    mx_status_t status = vmx_cpu_state->FreeId(vpid);
-    if (status != MX_OK)
+    zx_status_t status = vmx_cpu_state->FreeId(vpid);
+    if (status != ZX_OK)
         return status;
     num_vcpus--;
     if (num_vcpus == 0)
         vmx_cpu_state.reset();
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool cr_is_invalid(uint64_t cr_value, uint32_t fixed0_msr, uint32_t fixed1_msr) {
diff --git a/kernel/arch/x86/hypervisor/vmx_cpu_state_priv.h b/kernel/arch/x86/hypervisor/vmx_cpu_state_priv.h
index f402d02..7638c35 100644
--- a/kernel/arch/x86/hypervisor/vmx_cpu_state_priv.h
+++ b/kernel/arch/x86/hypervisor/vmx_cpu_state_priv.h
@@ -71,7 +71,7 @@
 /* Maintains the VMX state for each CPU. */
 class VmxCpuState : public hypervisor::CpuState<uint16_t, 64> {
 public:
-    static mx_status_t Create(fbl::unique_ptr<VmxCpuState>* out);
+    static zx_status_t Create(fbl::unique_ptr<VmxCpuState>* out);
     ~VmxCpuState();
     DISALLOW_COPY_ASSIGN_AND_MOVE(VmxCpuState);
 
@@ -81,6 +81,6 @@
     VmxCpuState() = default;
 };
 
-mx_status_t alloc_vpid(uint16_t* vpid);
-mx_status_t free_vpid(uint16_t vpid);
+zx_status_t alloc_vpid(uint16_t* vpid);
+zx_status_t free_vpid(uint16_t vpid);
 bool cr_is_invalid(uint64_t cr_value, uint32_t fixed0_msr, uint32_t fixed1_msr);
diff --git a/kernel/arch/x86/idt.cpp b/kernel/arch/x86/idt.cpp
index ce97f17..47a5368 100644
--- a/kernel/arch/x86/idt.cpp
+++ b/kernel/arch/x86/idt.cpp
@@ -5,7 +5,7 @@
 // https://opensource.org/licenses/MIT
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <err.h>
 #include <string.h>
 #include <kernel/mp.h>
@@ -138,7 +138,7 @@
                                          vaddr_to_paddr(&_idt),
                                          0 /* vmm flags */,
                                          ARCH_MMU_FLAG_PERM_READ);
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
     idt_load(_idt_ro);
 }
 
diff --git a/kernel/arch/x86/include/arch/arch_ops.h b/kernel/arch/x86/include/arch/arch_ops.h
index 3222570..18b90ca 100644
--- a/kernel/arch/x86/include/arch/arch_ops.h
+++ b/kernel/arch/x86/include/arch/arch_ops.h
@@ -8,7 +8,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #ifndef ASSEMBLY
 
@@ -75,8 +75,8 @@
 
 // Log architecture-specific data for process creation.
 // This can only be called after the process has been created and before
-// it is running. Alas we can't use mx_koid_t here as the arch layer is at a
-// lower level than magenta.
+// it is running. Alas we can't use zx_koid_t here as the arch layer is at a
+// lower level than zircon.
 void arch_trace_process_create(uint64_t pid, paddr_t pt_phys);
 
 __END_CDECLS
diff --git a/kernel/arch/x86/include/arch/arch_thread.h b/kernel/arch/x86/include/arch/arch_thread.h
index cdeabe4..53177ef 100644
--- a/kernel/arch/x86/include/arch/arch_thread.h
+++ b/kernel/arch/x86/include/arch/arch_thread.h
@@ -9,7 +9,7 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <arch/x86/registers.h>
 #include <sys/types.h>
 
diff --git a/kernel/arch/x86/include/arch/aspace.h b/kernel/arch/x86/include/arch/aspace.h
index 0f2f45b..4710866 100644
--- a/kernel/arch/x86/include/arch/aspace.h
+++ b/kernel/arch/x86/include/arch/aspace.h
@@ -11,7 +11,7 @@
 #include <arch/x86/mmu.h>
 #include <kernel/atomic.h>
 #include <vm/arch_vm_aspace.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/canary.h>
 #include <fbl/mutex.h>
 
diff --git a/kernel/arch/x86/include/arch/hypervisor.h b/kernel/arch/x86/include/arch/hypervisor.h
index 53b09dd..d202fb5 100644
--- a/kernel/arch/x86/include/arch/hypervisor.h
+++ b/kernel/arch/x86/include/arch/hypervisor.h
@@ -14,7 +14,7 @@
 #include <kernel/event.h>
 #include <kernel/spinlock.h>
 #include <kernel/timer.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/array.h>
 #include <fbl/ref_ptr.h>
 #include <fbl/unique_ptr.h>
@@ -55,7 +55,7 @@
     ~Guest();
     DISALLOW_COPY_ASSIGN_AND_MOVE(Guest);
 
-    status_t SetTrap(uint32_t kind, mx_vaddr_t addr, size_t len,
+    status_t SetTrap(uint32_t kind, zx_vaddr_t addr, size_t len,
                      fbl::RefPtr<PortDispatcher> port, uint64_t key);
 
     GuestPhysicalAddressSpace* AddressSpace() const { return gpas_.get(); }
@@ -89,14 +89,14 @@
 /* Represents a virtual CPU within a guest. */
 class Vcpu {
 public:
-    static status_t Create(mx_vaddr_t ip, mx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
+    static status_t Create(zx_vaddr_t ip, zx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
                            paddr_t apic_access_address, paddr_t msr_bitmaps_address,
                            GuestPhysicalAddressSpace* gpas, PacketMux& mux,
                            fbl::unique_ptr<Vcpu>* out);
     ~Vcpu();
     DISALLOW_COPY_ASSIGN_AND_MOVE(Vcpu);
 
-    status_t Resume(mx_port_packet_t* packet);
+    status_t Resume(zx_port_packet_t* packet);
     status_t Interrupt(uint32_t interrupt);
     status_t ReadState(uint32_t kind, void* buffer, uint32_t len) const;
     status_t WriteState(uint32_t kind, const void* buffer, uint32_t len);
@@ -123,17 +123,17 @@
 status_t arch_guest_create(fbl::RefPtr<VmObject> physmem, fbl::unique_ptr<Guest>* guest);
 
 /* Set a trap within a guest. */
-status_t arch_guest_set_trap(Guest* guest, uint32_t kind, mx_vaddr_t addr, size_t len,
+status_t arch_guest_set_trap(Guest* guest, uint32_t kind, zx_vaddr_t addr, size_t len,
                              fbl::RefPtr<PortDispatcher> port, uint64_t key);
 
 /* Create a VCPU. */
-status_t x86_vcpu_create(mx_vaddr_t ip, mx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
+status_t x86_vcpu_create(zx_vaddr_t ip, zx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
                          paddr_t apic_access_address, paddr_t msr_bitmaps_address,
                          GuestPhysicalAddressSpace* gpas, PacketMux& mux,
                          fbl::unique_ptr<Vcpu>* out);
 
 /* Resume execution of a VCPU. */
-status_t arch_vcpu_resume(Vcpu* vcpu, mx_port_packet_t* packet);
+status_t arch_vcpu_resume(Vcpu* vcpu, zx_port_packet_t* packet);
 
 /* Issue an interrupt on a VCPU. */
 status_t arch_vcpu_interrupt(Vcpu* vcpu, uint32_t interrupt);
diff --git a/kernel/arch/x86/include/arch/spinlock.h b/kernel/arch/x86/include/arch/spinlock.h
index 0198e5c..16214eb 100644
--- a/kernel/arch/x86/include/arch/spinlock.h
+++ b/kernel/arch/x86/include/arch/spinlock.h
@@ -9,7 +9,7 @@
 
 #include <arch/x86.h>
 #include <kernel/atomic.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/arch/x86/include/arch/x86.h b/kernel/arch/x86/include/arch/x86.h
index b9024eb..588baa2 100644
--- a/kernel/arch/x86/include/arch/x86.h
+++ b/kernel/arch/x86/include/arch/x86.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 #include <stdlib.h>
 #include <stdbool.h>
@@ -89,9 +89,9 @@
  * @param apic_ids A list of all APIC IDs to launch.
  * @param count The number of entries in the apic_ids list.
  *
- * @return MX_ERR_INVALID_ARGS if an unknown APIC ID was provided.
- * @return MX_ERR_BAD_STATE if one of the targets is currently online
- * @return MX_ERR_TIMED_OUT if one of the targets failed to launch
+ * @return ZX_ERR_INVALID_ARGS if an unknown APIC ID was provided.
+ * @return ZX_ERR_BAD_STATE if one of the targets is currently online
+ * @return ZX_ERR_TIMED_OUT if one of the targets failed to launch
  */
 status_t x86_bringup_aps(uint32_t *apic_ids, uint32_t count);
 
diff --git a/kernel/arch/x86/include/arch/x86/apic.h b/kernel/arch/x86/include/arch/x86/apic.h
index 5446b8c..bcbc8d57 100644
--- a/kernel/arch/x86/include/arch/x86/apic.h
+++ b/kernel/arch/x86/include/arch/x86/apic.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <dev/interrupt.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/arch/x86/include/arch/x86/bootstrap16.h b/kernel/arch/x86/include/arch/x86/bootstrap16.h
index 7c4051d..82c72ad 100644
--- a/kernel/arch/x86/include/arch/x86/bootstrap16.h
+++ b/kernel/arch/x86/include/arch/x86/bootstrap16.h
@@ -23,7 +23,7 @@
 
 #ifndef ASSEMBLY
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <vm/vm_aspace.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/arch/x86/include/arch/x86/cpu_topology.h b/kernel/arch/x86/include/arch/x86/cpu_topology.h
index 637bd7d..a04022e 100644
--- a/kernel/arch/x86/include/arch/x86/cpu_topology.h
+++ b/kernel/arch/x86/include/arch/x86/cpu_topology.h
@@ -7,7 +7,7 @@
 #pragma once
 
 #include <arch/x86/feature.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/arch/x86/include/arch/x86/descriptor.h b/kernel/arch/x86/include/arch/x86/descriptor.h
index 6ea0f64..6821647 100644
--- a/kernel/arch/x86/include/arch/x86/descriptor.h
+++ b/kernel/arch/x86/include/arch/x86/descriptor.h
@@ -42,7 +42,7 @@
 #ifndef ASSEMBLY
 
 #include <arch/aspace.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <reg.h>
 #include <sys/types.h>
 
diff --git a/kernel/arch/x86/include/arch/x86/feature.h b/kernel/arch/x86/include/arch/x86/feature.h
index 417b325..3d1e3b7 100644
--- a/kernel/arch/x86/include/arch/x86/feature.h
+++ b/kernel/arch/x86/include/arch/x86/feature.h
@@ -7,7 +7,7 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 #include <arch/x86.h>
 
diff --git a/kernel/arch/x86/include/arch/x86/general_regs.h b/kernel/arch/x86/include/arch/x86/general_regs.h
index d076c86..02e811b 100644
--- a/kernel/arch/x86/include/arch/x86/general_regs.h
+++ b/kernel/arch/x86/include/arch/x86/general_regs.h
@@ -17,7 +17,7 @@
 #ifndef ASSEMBLY
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/arch/x86/include/arch/x86/idt.h b/kernel/arch/x86/include/arch/x86/idt.h
index 34e74ef..cfe1984 100644
--- a/kernel/arch/x86/include/arch/x86/idt.h
+++ b/kernel/arch/x86/include/arch/x86/idt.h
@@ -7,7 +7,7 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/arch/x86/include/arch/x86/mmu.h b/kernel/arch/x86/include/arch/x86/mmu.h
index 4e768ec..355260d 100644
--- a/kernel/arch/x86/include/arch/x86/mmu.h
+++ b/kernel/arch/x86/include/arch/x86/mmu.h
@@ -139,7 +139,7 @@
 #ifndef ASSEMBLY
 
 #include <sys/types.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <inttypes.h>
diff --git a/kernel/arch/x86/include/arch/x86/mmu_mem_types.h b/kernel/arch/x86/include/arch/x86/mmu_mem_types.h
index 0121bd3..32f8f0a 100644
--- a/kernel/arch/x86/include/arch/x86/mmu_mem_types.h
+++ b/kernel/arch/x86/include/arch/x86/mmu_mem_types.h
@@ -5,7 +5,7 @@
 // https://opensource.org/licenses/MIT
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <kernel/mp.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/arch/x86/include/arch/x86/mp.h b/kernel/arch/x86/include/arch/x86/mp.h
index 256317d..7cde2ea 100644
--- a/kernel/arch/x86/include/arch/x86/mp.h
+++ b/kernel/arch/x86/include/arch/x86/mp.h
@@ -12,8 +12,8 @@
 /* offsets into this structure, used by assembly */
 #define PERCPU_DIRECT_OFFSET           0x0
 #define PERCPU_CURRENT_THREAD_OFFSET   0x8
-//      MX_TLS_STACK_GUARD_OFFSET      0x10
-//      MX_TLS_UNSAFE_SP_OFFSET        0x18
+//      ZX_TLS_STACK_GUARD_OFFSET      0x10
+//      ZX_TLS_UNSAFE_SP_OFFSET        0x18
 #define PERCPU_SAVED_USER_SP_OFFSET    0x20
 #define PERCPU_IN_IRQ_OFFSET           0x28
 #define PERCPU_GPF_RETURN_OFFSET       0x30
@@ -30,8 +30,8 @@
 #include <arch/x86.h>
 #include <arch/x86/idt.h>
 #include <assert.h>
-#include <magenta/compiler.h>
-#include <magenta/tls.h>
+#include <zircon/compiler.h>
+#include <zircon/tls.h>
 #include <stdint.h>
 
 __BEGIN_CDECLS
@@ -46,7 +46,7 @@
     struct thread *current_thread;
 
     // The offsets of these two slots are published in
-    // system/public/magenta/tls.h and known to the compiler.
+    // system/public/zircon/tls.h and known to the compiler.
     uintptr_t stack_guard;
     uintptr_t kernel_unsafe_sp;
 
@@ -74,8 +74,8 @@
 
 static_assert(__offsetof(struct x86_percpu, direct) == PERCPU_DIRECT_OFFSET, "");
 static_assert(__offsetof(struct x86_percpu, current_thread) == PERCPU_CURRENT_THREAD_OFFSET, "");
-static_assert(__offsetof(struct x86_percpu, stack_guard) == MX_TLS_STACK_GUARD_OFFSET, "");
-static_assert(__offsetof(struct x86_percpu, kernel_unsafe_sp) == MX_TLS_UNSAFE_SP_OFFSET, "");
+static_assert(__offsetof(struct x86_percpu, stack_guard) == ZX_TLS_STACK_GUARD_OFFSET, "");
+static_assert(__offsetof(struct x86_percpu, kernel_unsafe_sp) == ZX_TLS_UNSAFE_SP_OFFSET, "");
 static_assert(__offsetof(struct x86_percpu, saved_user_sp) == PERCPU_SAVED_USER_SP_OFFSET, "");
 static_assert(__offsetof(struct x86_percpu, in_irq) == PERCPU_IN_IRQ_OFFSET, "");
 static_assert(__offsetof(struct x86_percpu, gpf_return_target) == PERCPU_GPF_RETURN_OFFSET, "");
diff --git a/kernel/arch/x86/include/arch/x86/proc_trace.h b/kernel/arch/x86/include/arch/x86/proc_trace.h
index 5686b2c..a9e4c88 100644
--- a/kernel/arch/x86/include/arch/x86/proc_trace.h
+++ b/kernel/arch/x86/include/arch/x86/proc_trace.h
@@ -9,8 +9,8 @@
 #include <err.h>
 #include <stdint.h>
 
-#include <magenta/compiler.h>
-#include <magenta/device/intel-pt.h>
+#include <zircon/compiler.h>
+#include <zircon/device/intel-pt.h>
 
 __BEGIN_CDECLS
 
@@ -35,8 +35,8 @@
 
 status_t x86_ipt_cpu_mode_stop();
 
-status_t x86_ipt_stage_cpu_data(uint32_t options, const mx_x86_pt_regs_t* regs);
+status_t x86_ipt_stage_cpu_data(uint32_t options, const zx_x86_pt_regs_t* regs);
 
-status_t x86_ipt_get_cpu_data(uint32_t options, mx_x86_pt_regs_t* regs);
+status_t x86_ipt_get_cpu_data(uint32_t options, zx_x86_pt_regs_t* regs);
 
 #endif // __cplusplus
diff --git a/kernel/arch/x86/include/arch/x86/registers.h b/kernel/arch/x86/include/arch/x86/registers.h
index 6d3d3bc..2980758 100644
--- a/kernel/arch/x86/include/arch/x86/registers.h
+++ b/kernel/arch/x86/include/arch/x86/registers.h
@@ -105,7 +105,7 @@
 
 #ifndef ASSEMBLY
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/arch/x86/include/arch/x86/user_copy.h b/kernel/arch/x86/include/arch/x86/user_copy.h
index 2161cda..40755d8 100644
--- a/kernel/arch/x86/include/arch/x86/user_copy.h
+++ b/kernel/arch/x86/include/arch/x86/user_copy.h
@@ -5,7 +5,7 @@
 // https://opensource.org/licenses/MIT
 
 #pragma once
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/arch/x86/include/arch/x86/vmx_state.h b/kernel/arch/x86/include/arch/x86/vmx_state.h
index 8c8f5df..1b3ed17 100644
--- a/kernel/arch/x86/include/arch/x86/vmx_state.h
+++ b/kernel/arch/x86/include/arch/x86/vmx_state.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #define VS_RESUME   0
 
diff --git a/kernel/arch/x86/ioapic.cpp b/kernel/arch/x86/ioapic.cpp
index f1a0cf8..3849e88 100644
--- a/kernel/arch/x86/ioapic.cpp
+++ b/kernel/arch/x86/ioapic.cpp
@@ -138,7 +138,7 @@
                     0, // vmm flags
                     ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE |
                         ARCH_MMU_FLAG_UNCACHED_DEVICE); // arch mmu flags
-            ASSERT(res == MX_OK);
+            ASSERT(res == ZX_OK);
             vaddr = (void *)((uintptr_t)vaddr + paddr - paddr_page_base);
         }
 
@@ -350,7 +350,7 @@
     struct io_apic *io_apic = apic_io_resolve_global_irq(global_irq);
 
     if (!io_apic)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     spin_lock_saved_state_t state;
     spin_lock_irqsave(&lock, state);
@@ -361,7 +361,7 @@
 
     spin_unlock_irqrestore(&lock, state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void apic_io_configure_irq_vector(
diff --git a/kernel/arch/x86/ioport.cpp b/kernel/arch/x86/ioport.cpp
index 44a0390..4f6c132 100644
--- a/kernel/arch/x86/ioport.cpp
+++ b/kernel/arch/x86/ioport.cpp
@@ -102,7 +102,7 @@
     DEBUG_ASSERT(!arch_ints_disabled());
 
     if ((port + len < port) || (port + len > IO_BITMAP_BITS))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::unique_ptr<bitmap::RleBitmap> optimistic_bitmap;
     if (!bitmap_) {
@@ -112,7 +112,7 @@
         fbl::AllocChecker ac;
         optimistic_bitmap.reset(new (&ac) bitmap::RleBitmap());
         if (!ac.check()) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
     }
 
@@ -125,14 +125,14 @@
         fbl::AllocChecker ac;
         bitmap_freelist.push_back(fbl::unique_ptr<bitmap::RleBitmapElement>(new (&ac) bitmap::RleBitmapElement()));
         if (!ac.check()) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
     }
 
     spin_lock_saved_state_t state;
     arch_interrupt_save(&state, 0);
 
-    status_t status = MX_OK;
+    status_t status = ZX_OK;
     do {
         AutoSpinLock guard(&lock_);
 
@@ -144,7 +144,7 @@
         status = enable ?
                 bitmap_->SetNoAlloc(port, port + len, &bitmap_freelist) :
                 bitmap_->ClearNoAlloc(port, port + len, &bitmap_freelist);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             break;
         }
 
@@ -161,7 +161,7 @@
     } while (0);
 
     // Let all other CPUs know about the update
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         struct ioport_update_context task_context = {.io_bitmap = this};
         mp_sync_exec(MP_IPI_TARGET_ALL_BUT_LOCAL, 0, IoBitmap::UpdateTask, &task_context);
     }
diff --git a/kernel/arch/x86/lapic.cpp b/kernel/arch/x86/lapic.cpp
index 62c7ea9..aa57f8c 100644
--- a/kernel/arch/x86/lapic.cpp
+++ b/kernel/arch/x86/lapic.cpp
@@ -96,7 +96,7 @@
             0, // vmm flags
             ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE |
                 ARCH_MMU_FLAG_UNCACHED_DEVICE); // arch mmu flags
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         panic("Could not allocate APIC management page: %d\n", res);
     }
     ASSERT(apic_virt_base != NULL);
@@ -220,10 +220,10 @@
         case 32: new_value = 0x8; break;
         case 64: new_value = 0x9; break;
         case 128: new_value = 0xa; break;
-        default: return MX_ERR_INVALID_ARGS;
+        default: return ZX_ERR_INVALID_ARGS;
     }
     *DIVIDE_CONF_ADDR = new_value;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void apic_timer_init(void) {
@@ -260,7 +260,7 @@
 }
 
 status_t apic_timer_set_oneshot(uint32_t count, uint8_t divisor, bool masked) {
-    status_t status = MX_OK;
+    status_t status = ZX_OK;
     uint32_t timer_config = LVT_VECTOR(X86_INT_APIC_TIMER) |
             LVT_TIMER_MODE_ONESHOT;
     if (masked) {
@@ -271,7 +271,7 @@
     arch_interrupt_save(&state, 0);
 
     status = apic_timer_set_divide_value(divisor);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup;
     }
     *LVT_TIMER_ADDR = timer_config;
@@ -304,12 +304,12 @@
 }
 
 status_t apic_timer_set_periodic(uint32_t count, uint8_t divisor) {
-    status_t status = MX_OK;
+    status_t status = ZX_OK;
     spin_lock_saved_state_t state;
     arch_interrupt_save(&state, 0);
 
     status = apic_timer_set_divide_value(divisor);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup;
     }
     *LVT_TIMER_ADDR = LVT_VECTOR(X86_INT_APIC_TIMER) | LVT_TIMER_MODE_PERIODIC;
@@ -349,7 +349,7 @@
         printf("%s dump local\n", argv[0].str);
         printf("%s broadcast <vec>\n", argv[0].str);
         printf("%s self <vec>\n", argv[0].str);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     if (!strcmp(argv[1].str, "broadcast")) {
@@ -385,7 +385,7 @@
         goto usage;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void apic_local_debug(void)
diff --git a/kernel/arch/x86/mmu.cpp b/kernel/arch/x86/mmu.cpp
index d84b0e9..5838a14 100644
--- a/kernel/arch/x86/mmu.cpp
+++ b/kernel/arch/x86/mmu.cpp
@@ -575,7 +575,7 @@
     DEBUG_ASSERT(IS_PAGE_PRESENT(*pte) && IS_LARGE_PAGE(*pte));
     volatile pt_entry_t* m = _map_alloc_page();
     if (m == nullptr) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     paddr_t paddr_base = PageTable::paddr_from_pte(*pte);
@@ -598,7 +598,7 @@
     flags = PageTable::intermediate_arch_flags();
     UpdateEntry<PageTable>(vaddr, pte, X86_VIRT_TO_PHYS(m), flags);
     pt_pages_++;
-    return MX_OK;
+    return ZX_OK;
 }
 
 /*
@@ -619,8 +619,8 @@
  * @param ret_level The level of the table that defines the found mapping
  * @param mapping The mapping that was found
  *
- * @return MX_OK if mapping is found
- * @return MX_ERR_NOT_FOUND if mapping is not found
+ * @return ZX_OK if mapping is found
+ * @return ZX_ERR_NOT_FOUND if mapping is not found
  */
 template <typename PageTable>
 status_t X86ArchVmAspace::GetMapping(volatile pt_entry_t* table, vaddr_t vaddr,
@@ -636,13 +636,13 @@
     volatile pt_entry_t* e = table + index;
     pt_entry_t pt_val = *e;
     if (!IS_PAGE_PRESENT(pt_val))
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     /* if this is a large page, stop here */
     if (IS_LARGE_PAGE(pt_val)) {
         *mapping = e;
         *ret_level = PageTable::level;
-        return MX_OK;
+        return ZX_OK;
     }
 
     volatile pt_entry_t* next_table = get_next_table_from_entry(pt_val);
@@ -676,11 +676,11 @@
     uint index = PageTable::vaddr_to_index(vaddr);
     volatile pt_entry_t* e = table + index;
     if (!IS_PAGE_PRESENT(*e))
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     *mapping = e;
     *ret_level = PageTable::level;
-    return MX_OK;
+    return ZX_OK;
 }
 
 /**
@@ -735,7 +735,7 @@
             // Otherwise, we need to split it
             vaddr_t page_vaddr = new_cursor->vaddr & ~(ps - 1);
             status_t status = SplitLargePage<PageTable>(page_vaddr, e);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 // If split fails, just unmap the whole thing, and let a
                 // subsequent page fault clean it up.
                 UnmapEntry<PageTable>(this, new_cursor->vaddr, e);
@@ -847,9 +847,9 @@
  * @param new_cursor A returned cursor describing how much work was not
  * completed.  Must be non-null.
  *
- * @return MX_OK if successful
- * @return MX_ERR_ALREADY_EXISTS if the range overlaps an existing mapping
- * @return MX_ERR_NO_MEMORY if intermediate page tables could not be allocated
+ * @return ZX_OK if successful
+ * @return ZX_ERR_ALREADY_EXISTS if the range overlaps an existing mapping
+ * @return ZX_ERR_NO_MEMORY if intermediate page tables could not be allocated
  */
 template <typename PageTable>
 status_t X86ArchVmAspace::AddMapping(volatile pt_entry_t* table, uint mmu_flags,
@@ -859,7 +859,7 @@
     DEBUG_ASSERT(x86_mmu_check_vaddr(start_cursor.vaddr));
     DEBUG_ASSERT(x86_mmu_check_paddr(start_cursor.paddr));
 
-    status_t ret = MX_OK;
+    status_t ret = ZX_OK;
     *new_cursor = start_cursor;
 
     arch_flags_t interm_arch_flags = PageTable::intermediate_arch_flags();
@@ -873,7 +873,7 @@
         pt_entry_t pt_val = *e;
         // See if there's a large page in our way
         if (IS_PAGE_PRESENT(pt_val) && IS_LARGE_PAGE(pt_val)) {
-            ret = MX_ERR_ALREADY_EXISTS;
+            ret = ZX_ERR_ALREADY_EXISTS;
             goto err;
         }
 
@@ -896,7 +896,7 @@
             if (!IS_PAGE_PRESENT(pt_val)) {
                 volatile pt_entry_t* m = _map_alloc_page();
                 if (m == nullptr) {
-                    ret = MX_ERR_NO_MEMORY;
+                    ret = ZX_ERR_NO_MEMORY;
                     goto err;
                 }
 
@@ -913,12 +913,12 @@
                 get_next_table_from_entry(pt_val), mmu_flags, *new_cursor, &cursor);
             *new_cursor = cursor;
             DEBUG_ASSERT(new_cursor->size <= start_cursor.size);
-            if (ret != MX_OK) {
+            if (ret != ZX_OK) {
                 goto err;
             }
         }
     }
-    return MX_OK;
+    return ZX_OK;
 err:
     if (fbl::is_same<PageTable, typename PageTable::TopTable>::value) {
         MappingCursor cursor = start_cursor;
@@ -965,7 +965,7 @@
     for (; index != NO_OF_PT_ENTRIES && new_cursor->size != 0; ++index) {
         volatile pt_entry_t* e = table + index;
         if (IS_PAGE_PRESENT(*e)) {
-            return MX_ERR_ALREADY_EXISTS;
+            return ZX_ERR_ALREADY_EXISTS;
         }
 
         UpdateEntry<PageTable>(new_cursor->vaddr, e, new_cursor->paddr, arch_flags);
@@ -976,7 +976,7 @@
         DEBUG_ASSERT(new_cursor->size <= start_cursor.size);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /**
@@ -1000,7 +1000,7 @@
             start_cursor.size);
     DEBUG_ASSERT(x86_mmu_check_vaddr(start_cursor.vaddr));
 
-    status_t ret = MX_OK;
+    status_t ret = ZX_OK;
     *new_cursor = start_cursor;
 
     arch_flags_t arch_flags = PageTable::arch_flags(flags_, mmu_flags);
@@ -1033,7 +1033,7 @@
             // Otherwise, we need to split it
             vaddr_t page_vaddr = new_cursor->vaddr & ~(ps - 1);
             ret = SplitLargePage<PageTable>(page_vaddr, e);
-            if (ret != MX_OK) {
+            if (ret != ZX_OK) {
                 // If we failed to split the table, just unmap it.  Subsequent
                 // page faults will bring it back in.
                 MappingCursor cursor;
@@ -1053,7 +1053,7 @@
         ret = UpdateMapping<typename PageTable::LowerTable>(next_table, mmu_flags,
                                                             *new_cursor, &cursor);
         *new_cursor = cursor;
-        if (ret != MX_OK) {
+        if (ret != ZX_OK) {
             // Currently this can't happen
             ASSERT(false);
         }
@@ -1061,7 +1061,7 @@
 
         DEBUG_ASSERT(new_cursor->size == 0 || PageTable::page_aligned(new_cursor->vaddr));
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 template <>
@@ -1110,7 +1110,7 @@
         DEBUG_ASSERT(new_cursor->size <= start_cursor.size);
     }
     DEBUG_ASSERT(new_cursor->size == 0 || PageTable::page_aligned(new_cursor->vaddr));
-    return MX_OK;
+    return ZX_OK;
 }
 
 template <template <int> class PageTable>
@@ -1121,11 +1121,11 @@
     canary_.Assert();
 
     if (!x86_mmu_check_vaddr(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (!IsValidVaddr(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (count == 0)
-        return MX_OK;
+        return ZX_OK;
 
     DEBUG_ASSERT(pt_virt_);
 
@@ -1140,7 +1140,7 @@
     if (unmapped)
         *unmapped = count;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t X86ArchVmAspace::Unmap(vaddr_t vaddr, size_t count, size_t* unmapped) {
@@ -1163,16 +1163,16 @@
             this, vaddr, paddr, count, mmu_flags);
 
     if ((!x86_mmu_check_paddr(paddr)))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (!x86_mmu_check_vaddr(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (!IsValidVaddr(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (count == 0)
-        return MX_OK;
+        return ZX_OK;
 
     if (!(mmu_flags & ARCH_MMU_FLAG_PERM_READ))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     DEBUG_ASSERT(pt_virt_);
 
@@ -1182,7 +1182,7 @@
     MappingCursor result;
     status_t status = AddMapping<PageTable<MAX_PAGING_LEVEL>>(pt_virt_, mmu_flags,
                                                               start, &result);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(SPEW, "Add mapping failed with err=%d\n", status);
         return status;
     }
@@ -1191,7 +1191,7 @@
     if (mapped)
         *mapped = count;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t X86ArchVmAspace::Map(vaddr_t vaddr, paddr_t paddr, size_t count,
@@ -1200,7 +1200,7 @@
 
     if (flags_ & ARCH_ASPACE_FLAG_GUEST_PASPACE) {
         if (mmu_flags & ~kValidEptFlags)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return MapPages<ExtendedPageTable>(vaddr, paddr, count, mmu_flags, mapped);
     } else {
         return MapPages<PageTable>(vaddr, paddr, count, mmu_flags, mapped);
@@ -1215,14 +1215,14 @@
             this, vaddr, count, mmu_flags);
 
     if (!x86_mmu_check_vaddr(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (!IsValidVaddr(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (count == 0)
-        return MX_OK;
+        return ZX_OK;
 
     if (!(mmu_flags & ARCH_MMU_FLAG_PERM_READ))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     MappingCursor start = {
         .paddr = 0, .vaddr = vaddr, .size = count * PAGE_SIZE,
@@ -1230,11 +1230,11 @@
     MappingCursor result;
     status_t status = UpdateMapping<PageTable<MAX_PAGING_LEVEL>>(
         pt_virt_, mmu_flags, start, &result);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     DEBUG_ASSERT(result.size == 0);
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t X86ArchVmAspace::Protect(vaddr_t vaddr, size_t count, uint mmu_flags) {
@@ -1242,7 +1242,7 @@
 
     if (flags_ & ARCH_ASPACE_FLAG_GUEST_PASPACE) {
         if (mmu_flags & ~kValidEptFlags)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return ProtectPages<ExtendedPageTable>(vaddr, count, mmu_flags);
     } else {
         return ProtectPages<PageTable>(vaddr, count, mmu_flags);
@@ -1300,7 +1300,7 @@
         vm_page_t* p = pmm_alloc_page(0, &pt_phys_);
         if (p == nullptr) {
             TRACEF("error allocating top level page directory\n");
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         p->state = VM_PAGE_STATE_MMU;
         pt_virt_ = static_cast<pt_entry_t*>(paddr_to_kvaddr(pt_phys_));
@@ -1313,7 +1313,7 @@
         pt_virt_ = (pt_entry_t*)pmm_alloc_kpage(&pa, &p);
         if (!pt_virt_) {
             TRACEF("error allocating top level page directory\n");
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         pt_phys_ = pa;
 
@@ -1332,7 +1332,7 @@
     pt_pages_ = 1;
     active_cpus_ = 0;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 template <template <int> class PageTable>
@@ -1362,7 +1362,7 @@
     pmm_free_page(paddr_to_vm_page(pt_phys_));
     pt_phys_ = 0;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t X86ArchVmAspace::Destroy() {
@@ -1413,12 +1413,12 @@
             mmu_flags);
 
     if (!IsValidVaddr(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     volatile pt_entry_t* last_valid_entry;
     status_t status = GetMapping<PageTable<MAX_PAGING_LEVEL>>(
         pt_virt_, vaddr, &ret_level, &last_valid_entry);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     DEBUG_ASSERT(last_valid_entry);
@@ -1452,7 +1452,7 @@
         *mmu_flags = arch_to_mmu(*last_valid_entry, ret_level);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t X86ArchVmAspace::Query(vaddr_t vaddr, paddr_t* paddr, uint* mmu_flags) {
diff --git a/kernel/arch/x86/mmu_mem_types.cpp b/kernel/arch/x86/mmu_mem_types.cpp
index c38b155..5bf8c99 100644
--- a/kernel/arch/x86/mmu_mem_types.cpp
+++ b/kernel/arch/x86/mmu_mem_types.cpp
@@ -258,7 +258,7 @@
         printf("usage:\n");
         printf("%s mtrr\n", argv[0].str);
         printf("%s pat\n", argv[0].str);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     if (!strcmp(argv[1].str, "mtrr")) {
@@ -269,7 +269,7 @@
             } else {
                 printf("usage: %s mtrr [-f]\n", argv[0].str);
                 printf("  -f    Display fixed registers\n");
-                return MX_ERR_INTERNAL;
+                return ZX_ERR_INTERNAL;
             }
         }
         uint64_t default_type = read_msr(X86_MSR_IA32_MTRR_DEF_TYPE);
@@ -307,7 +307,7 @@
         goto usage;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 STATIC_COMMAND_START
diff --git a/kernel/arch/x86/mmu_tests.cpp b/kernel/arch/x86/mmu_tests.cpp
index 828d7c4..c144740 100644
--- a/kernel/arch/x86/mmu_tests.cpp
+++ b/kernel/arch/x86/mmu_tests.cpp
@@ -19,7 +19,7 @@
         vaddr_t base = 1UL << 20;
         size_t size = (1UL << 47) - base - (1UL << 20);
         status_t err = aspace.Init(1UL << 20, size, 0);
-        EXPECT_EQ(err, MX_OK, "init aspace");
+        EXPECT_EQ(err, ZX_OK, "init aspace");
         EXPECT_EQ(aspace.pt_pages(), 1u, "single page for PML4 table");
 
         const uint arch_rw_flags = ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE;
@@ -35,14 +35,14 @@
         // to be created
         size_t mapped;
         err = aspace.Map(va - 3 * PAGE_SIZE, 0, 1, arch_rw_flags, &mapped);
-        EXPECT_EQ(err, MX_OK, "map single page");
+        EXPECT_EQ(err, ZX_OK, "map single page");
         EXPECT_EQ(mapped, 1u, "map single page");
         EXPECT_EQ(aspace.pt_pages(), 4u,
                   "map single page, PDP, PD and PT tables allocated");
 
         // Map the last page of the region
         err = aspace.Map(va + alloc_size - PAGE_SIZE, 0, 1, arch_rw_flags, &mapped);
-        EXPECT_EQ(err, MX_OK, "map last page");
+        EXPECT_EQ(err, ZX_OK, "map last page");
         EXPECT_EQ(mapped, 1u, "map single page");
         EXPECT_EQ(aspace.pt_pages(), 6u,
                   "map single page, PD and PT tables allocated");
@@ -50,27 +50,27 @@
         paddr_t pa;
         uint flags;
         err = aspace.Query(va + alloc_size - PAGE_SIZE, &pa, &flags);
-        EXPECT_EQ(err, MX_OK, "last entry is mapped");
+        EXPECT_EQ(err, ZX_OK, "last entry is mapped");
 
         // Attempt to unmap the target region (analogous to unmapping a demand
         // paged region that has only had its last page touched)
         size_t unmapped;
         err = aspace.Unmap(va, alloc_size / PAGE_SIZE, &unmapped);
-        EXPECT_EQ(err, MX_OK, "unmap unallocated region");
+        EXPECT_EQ(err, ZX_OK, "unmap unallocated region");
         EXPECT_EQ(unmapped, alloc_size / PAGE_SIZE, "unmap unallocated region");
         EXPECT_EQ(aspace.pt_pages(), 4u, "unmap allocated region");
 
         err = aspace.Query(va + alloc_size - PAGE_SIZE, &pa, &flags);
-        EXPECT_EQ(err, MX_ERR_NOT_FOUND, "last entry is not mapped anymore");
+        EXPECT_EQ(err, ZX_ERR_NOT_FOUND, "last entry is not mapped anymore");
 
         // Unmap the single page from earlier
         err = aspace.Unmap(va - 3 * PAGE_SIZE, 1, &unmapped);
-        EXPECT_EQ(err, MX_OK, "unmap single page");
+        EXPECT_EQ(err, ZX_OK, "unmap single page");
         EXPECT_EQ(unmapped, 1u, "unmap unallocated region");
         EXPECT_EQ(aspace.pt_pages(), 1u, "unmap single page");
 
         err = aspace.Destroy();
-        EXPECT_EQ(err, MX_OK, "destroy aspace");
+        EXPECT_EQ(err, ZX_OK, "destroy aspace");
     }
 
     unittest_printf("creating large un-aligned vm region, and unmap it without mapping (MG-315)\n");
@@ -79,7 +79,7 @@
         vaddr_t base = 1UL << 20;
         size_t size = (1UL << 47) - base - (1UL << 20);
         status_t err = aspace.Init(1UL << 20, size, 0);
-        EXPECT_EQ(err, MX_OK, "init aspace");
+        EXPECT_EQ(err, ZX_OK, "init aspace");
         EXPECT_EQ(aspace.pt_pages(), 1u, "single page for PML4 table");
 
         const uint arch_rw_flags = ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE;
@@ -95,7 +95,7 @@
         // to be created
         size_t mapped;
         err = aspace.Map(va - 2 * PAGE_SIZE, 0, 1, arch_rw_flags, &mapped);
-        EXPECT_EQ(err, MX_OK, "map single page");
+        EXPECT_EQ(err, ZX_OK, "map single page");
         EXPECT_EQ(mapped, 1u, "map single page");
         EXPECT_EQ(aspace.pt_pages(), 4u,
                   "map single page, PDP, PD and PT tables allocated");
@@ -104,18 +104,18 @@
         // paged region that has not been touched)
         size_t unmapped;
         err = aspace.Unmap(va, alloc_size / PAGE_SIZE, &unmapped);
-        EXPECT_EQ(err, MX_OK, "unmap unallocated region");
+        EXPECT_EQ(err, ZX_OK, "unmap unallocated region");
         EXPECT_EQ(unmapped, alloc_size / PAGE_SIZE, "unmap unallocated region");
         EXPECT_EQ(aspace.pt_pages(), 4u, "unmap unallocated region");
 
         // Unmap the single page from earlier
         err = aspace.Unmap(va - 2 * PAGE_SIZE, 1, &unmapped);
-        EXPECT_EQ(err, MX_OK, "unmap single page");
+        EXPECT_EQ(err, ZX_OK, "unmap single page");
         EXPECT_EQ(unmapped, 1u, "unmap single page");
         EXPECT_EQ(aspace.pt_pages(), 1u, "unmap single page");
 
         err = aspace.Destroy();
-        EXPECT_EQ(err, MX_OK, "destroy aspace");
+        EXPECT_EQ(err, ZX_OK, "destroy aspace");
     }
 
     unittest_printf("creating large vm region, and change permissions\n");
@@ -124,7 +124,7 @@
         vaddr_t base = 1UL << 20;
         size_t size = (1UL << 47) - base - (1UL << 20);
         status_t err = aspace.Init(1UL << 20, size, 0);
-        EXPECT_EQ(err, MX_OK, "init aspace");
+        EXPECT_EQ(err, ZX_OK, "init aspace");
         EXPECT_EQ(aspace.pt_pages(), 1u, "single page for PML4 table");
 
         const uint arch_rw_flags = ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE;
@@ -135,17 +135,17 @@
 
         size_t mapped;
         err = aspace.Map(va, 0, alloc_size / PAGE_SIZE, arch_rw_flags, &mapped);
-        EXPECT_EQ(err, MX_OK, "map large page");
+        EXPECT_EQ(err, ZX_OK, "map large page");
         EXPECT_EQ(mapped, 512u, "map large page");
         EXPECT_EQ(aspace.pt_pages(), 3u, "map large page");
 
         err = aspace.Protect(va + PAGE_SIZE, 1, ARCH_MMU_FLAG_PERM_READ);
-        EXPECT_EQ(err, MX_OK, "protect single page");
+        EXPECT_EQ(err, ZX_OK, "protect single page");
         EXPECT_EQ(aspace.pt_pages(), 4u,
                   "protect single page, split large page");
 
         err = aspace.Destroy();
-        EXPECT_EQ(err, MX_OK, "destroy aspace");
+        EXPECT_EQ(err, ZX_OK, "destroy aspace");
     }
 
     unittest_printf("done with mmu tests\n");
diff --git a/kernel/arch/x86/mp.cpp b/kernel/arch/x86/mp.cpp
index c047f7c..27f6130 100644
--- a/kernel/arch/x86/mp.cpp
+++ b/kernel/arch/x86/mp.cpp
@@ -6,7 +6,7 @@
 // https://opensource.org/licenses/MIT
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 #include <err.h>
 #include <stdio.h>
@@ -43,14 +43,14 @@
 
     DEBUG_ASSERT(cpu_count >= 1);
     if (cpu_count == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (cpu_count > 1) {
         size_t len = sizeof(*ap_percpus) * (cpu_count - 1);
         ap_percpus = (x86_percpu *)memalign(MAX_CACHE_LINE, len);
         if (ap_percpus == NULL) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         memset(ap_percpus, 0, len);
     }
@@ -65,7 +65,7 @@
         DEBUG_ASSERT(apic_idx != (uint)(cpu_count - 1));
         if (apic_idx == (uint)cpu_count - 1) {
             /* Never found bootstrap CPU in apic id list */
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
         ap_percpus[apic_idx].cpu_num = apic_idx + 1;
         ap_percpus[apic_idx].apic_id = apic_ids[i];
@@ -74,7 +74,7 @@
     }
 
     x86_num_cpus = cpu_count;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void x86_init_percpu(uint cpu_num)
@@ -243,10 +243,10 @@
 
     if (target == MP_IPI_TARGET_ALL_BUT_LOCAL) {
         apic_send_broadcast_ipi(vector, DELIVERY_MODE_FIXED);
-        return MX_OK;
+        return ZX_OK;
     } else if (target == MP_IPI_TARGET_ALL) {
         apic_send_broadcast_self_ipi(vector, DELIVERY_MODE_FIXED);
-        return MX_OK;
+        return ZX_OK;
     }
 
     ASSERT(x86_num_cpus <= sizeof(mask) * CHAR_BIT);
@@ -275,7 +275,7 @@
         cpu_id++;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 enum handler_return x86_ipi_generic_handler(void)
@@ -304,42 +304,42 @@
 
 status_t arch_mp_prep_cpu_unplug(uint cpu_id) {
     if (cpu_id == 0 || cpu_id >= x86_num_cpus) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t arch_mp_cpu_unplug(uint cpu_id)
 {
     /* we do not allow unplugging the bootstrap processor */
     if (cpu_id == 0 || cpu_id >= x86_num_cpus) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uint32_t dst_apic_id = ap_percpus[cpu_id - 1].apic_id;
     if (dst_apic_id == INVALID_APIC_ID) {
         /* This is a transient state that can occur during CPU onlining */
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     }
 
     DEBUG_ASSERT(dst_apic_id < UINT8_MAX);
     apic_send_ipi(0, (uint8_t)dst_apic_id, DELIVERY_MODE_INIT);
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t arch_mp_cpu_hotplug(uint cpu_id)
 {
     if (cpu_id >= x86_num_cpus) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (mp_is_cpu_online(cpu_id)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     DEBUG_ASSERT(cpu_id != 0);
     if (cpu_id == 0) {
         /* We shouldn't be able to shutoff the bootstrap CPU, so
          * no reason to be able to bring it back via this route. */
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     struct x86_percpu *percpu = &ap_percpus[cpu_id - 1];
diff --git a/kernel/arch/x86/proc_trace.cpp b/kernel/arch/x86/proc_trace.cpp
index bd20f83..5d79694 100644
--- a/kernel/arch/x86/proc_trace.cpp
+++ b/kernel/arch/x86/proc_trace.cpp
@@ -27,10 +27,10 @@
 #include <kernel/vm.h>
 #include <vm/vm_aspace.h>
 #include <lib/ktrace.h>
-#include <magenta/device/intel-pt.h>
-#include <magenta/ktrace.h>
-#include <magenta/mtrace.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/device/intel-pt.h>
+#include <zircon/ktrace.h>
+#include <zircon/mtrace.h>
+#include <zircon/thread_annotations.h>
 #include <fbl/auto_lock.h>
 #include <fbl/macros.h>
 #include <fbl/mutex.h>
@@ -167,29 +167,29 @@
     AutoLock al(&ipt_lock);
 
     if (!supports_pt)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     if (active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (ipt_cpu_state)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     // Changing to the same mode is a no-op.
     // This check is still done after the above checks. E.g., it doesn't make
     // sense to call this function if tracing is active.
     if (mode == trace_mode)
-        return MX_OK;
+        return ZX_OK;
 
     // MG-892: We don't support changing the mode from IPT_TRACE_THREADS to
     // IPT_TRACE_CPUS: We can't turn off XSS.PT until we're sure all threads
     // have no PT state, and that's too tricky to do right now. Instead,
     // require the developer to reboot (the default is IPT_TRACE_CPUS).
     if (trace_mode == IPT_TRACE_THREADS && mode == IPT_TRACE_CPUS)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     mp_sync_exec(MP_IPI_TARGET_ALL, 0, x86_ipt_set_mode_task,
                  reinterpret_cast<void*>(static_cast<uintptr_t>(mode)));
     trace_mode = mode;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Allocate all needed state for tracing.
@@ -198,21 +198,21 @@
     AutoLock al(&ipt_lock);
 
     if (!supports_pt)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     if (trace_mode == IPT_TRACE_THREADS)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (ipt_cpu_state)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     uint32_t num_cpus = arch_max_num_cpus();
     ipt_cpu_state =
         reinterpret_cast<ipt_cpu_state_t*>(calloc(num_cpus,
                                                   sizeof(*ipt_cpu_state)));
     if (!ipt_cpu_state)
-        return MX_ERR_NO_MEMORY;
-    return MX_OK;
+        return ZX_ERR_NO_MEMORY;
+    return ZX_OK;
 }
 
 // Free resources obtained by x86_ipt_cpu_mode_alloc().
@@ -223,15 +223,15 @@
     AutoLock al(&ipt_lock);
 
     if (!supports_pt)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     if (trace_mode == IPT_TRACE_THREADS)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     free(ipt_cpu_state);
     ipt_cpu_state = nullptr;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // This is invoked via mp_sync_exec which thread safety analysis cannot follow.
@@ -264,13 +264,13 @@
     AutoLock al(&ipt_lock);
 
     if (!supports_pt)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     if (trace_mode == IPT_TRACE_THREADS)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (!ipt_cpu_state)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     uint64_t kernel_cr3 = x86_kernel_cr3();
     TRACEF("Enabling processor trace, kernel cr3: 0x%" PRIxPTR "\n",
@@ -290,7 +290,7 @@
            model_info->stepping);
 
     mp_sync_exec(MP_IPI_TARGET_ALL, 0, x86_ipt_start_cpu_task, ipt_cpu_state);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // This is invoked via mp_sync_exec which thread safety analysis cannot follow.
@@ -332,34 +332,34 @@
     AutoLock al(&ipt_lock);
 
     if (!supports_pt)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     if (trace_mode == IPT_TRACE_THREADS)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (!ipt_cpu_state)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     TRACEF("Disabling processor trace\n");
 
     mp_sync_exec(MP_IPI_TARGET_ALL, 0, x86_ipt_stop_cpu_task, ipt_cpu_state);
     ktrace(TAG_IPT_STOP, 0, 0, 0, 0);
     active = false;
-    return MX_OK;
+    return ZX_OK;
 }
 
-status_t x86_ipt_stage_cpu_data(uint32_t cpu, const mx_x86_pt_regs_t* regs) {
+status_t x86_ipt_stage_cpu_data(uint32_t cpu, const zx_x86_pt_regs_t* regs) {
     AutoLock al(&ipt_lock);
 
     if (!supports_pt)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     if (trace_mode == IPT_TRACE_THREADS)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (!ipt_cpu_state)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
     uint32_t num_cpus = arch_max_num_cpus();
     if (cpu >= num_cpus)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     ipt_cpu_state[cpu].ctl = regs->ctl;
     ipt_cpu_state[cpu].status = regs->status;
@@ -369,23 +369,23 @@
     static_assert(sizeof(ipt_cpu_state[cpu].addr_ranges) == sizeof(regs->addr_ranges), "addr_ranges size mismatch");
     memcpy(ipt_cpu_state[cpu].addr_ranges, regs->addr_ranges, sizeof(regs->addr_ranges));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-status_t x86_ipt_get_cpu_data(uint32_t cpu, mx_x86_pt_regs_t* regs) {
+status_t x86_ipt_get_cpu_data(uint32_t cpu, zx_x86_pt_regs_t* regs) {
     AutoLock al(&ipt_lock);
 
     if (!supports_pt)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     if (trace_mode == IPT_TRACE_THREADS)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (!ipt_cpu_state)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     uint32_t num_cpus = arch_max_num_cpus();
     if (cpu >= num_cpus)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     regs->ctl = ipt_cpu_state[cpu].ctl;
     regs->status = ipt_cpu_state[cpu].status;
@@ -395,5 +395,5 @@
     static_assert(sizeof(regs->addr_ranges) == sizeof(ipt_cpu_state[cpu].addr_ranges), "addr_ranges size mismatch");
     memcpy(regs->addr_ranges, ipt_cpu_state[cpu].addr_ranges, sizeof(regs->addr_ranges));
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/arch/x86/registers.cpp b/kernel/arch/x86/registers.cpp
index fe0ed0b..4fdf6b0 100644
--- a/kernel/arch/x86/registers.cpp
+++ b/kernel/arch/x86/registers.cpp
@@ -26,7 +26,7 @@
 #include <arch/x86/proc_trace.h>
 #include <arch/x86/registers.h>
 #include <inttypes.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <kernel/spinlock.h>
 #include <kernel/thread.h>
 #include <fbl/auto_call.h>
diff --git a/kernel/arch/x86/thread.cpp b/kernel/arch/x86/thread.cpp
index e84862d..bba9552 100644
--- a/kernel/arch/x86/thread.cpp
+++ b/kernel/arch/x86/thread.cpp
@@ -117,8 +117,8 @@
     write_msr(X86_MSR_IA32_KERNEL_GS_BASE, newthread->arch.gs_base);
 
 #if __has_feature(safe_stack)
-    oldthread->arch.unsafe_sp = x86_read_gs_offset64(MX_TLS_UNSAFE_SP_OFFSET);
-    x86_write_gs_offset64(MX_TLS_UNSAFE_SP_OFFSET, newthread->arch.unsafe_sp);
+    oldthread->arch.unsafe_sp = x86_read_gs_offset64(ZX_TLS_UNSAFE_SP_OFFSET);
+    x86_write_gs_offset64(ZX_TLS_UNSAFE_SP_OFFSET, newthread->arch.unsafe_sp);
 #endif
 
     x86_64_context_switch(&oldthread->arch.sp, newthread->arch.sp);
diff --git a/kernel/arch/x86/timer_freq.cpp b/kernel/arch/x86/timer_freq.cpp
index 146af75..4f3b3f1 100644
--- a/kernel/arch/x86/timer_freq.cpp
+++ b/kernel/arch/x86/timer_freq.cpp
@@ -8,7 +8,7 @@
 #include <arch/x86/feature.h>
 #include <arch/x86/timer_freq.h>
 #include <bits.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 
 #define MSR_PLATFORM_INFO 0xCE
 
@@ -60,7 +60,7 @@
         case X86_MICROARCH_INTEL_HASWELL:
         case X86_MICROARCH_INTEL_BROADWELL: {
             uint64_t platform_info;
-            if (read_msr_safe(MSR_PLATFORM_INFO, &platform_info) == MX_OK) {
+            if (read_msr_safe(MSR_PLATFORM_INFO, &platform_info) == ZX_OK) {
                 uint64_t bus_freq_mult = (platform_info >> 8) & 0xf;
                 return bus_freq_mult * 100 * 1000 * 1000;
             }
@@ -98,7 +98,7 @@
                 // According to the Family 17h PPR, the first P-state MSR is indeed
                 // P0 state and appears to be experimentally so
                 uint64_t p0_state;
-                if (read_msr_safe(p0_state_msr, &p0_state) != MX_OK)
+                if (read_msr_safe(p0_state_msr, &p0_state) != ZX_OK)
                     break;
 
                 return compute_p_state_clock(p0_state);
diff --git a/kernel/arch/x86/user_copy.cpp b/kernel/arch/x86/user_copy.cpp
index 6b602ee..5deb617 100644
--- a/kernel/arch/x86/user_copy.cpp
+++ b/kernel/arch/x86/user_copy.cpp
@@ -38,7 +38,7 @@
     DEBUG_ASSERT(!ac_flag());
 
     if (!can_access(src, len))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     thread_t *thr = get_current_thread();
     status_t status = _x86_copy_to_or_from_user(dst, src, len,
@@ -53,7 +53,7 @@
     DEBUG_ASSERT(!ac_flag());
 
     if (!can_access(dst, len))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     thread_t *thr = get_current_thread();
     status_t status = _x86_copy_to_or_from_user(dst, src, len,
diff --git a/kernel/dev/hw_rng/debug.c b/kernel/dev/hw_rng/debug.c
index 8ced558..f451030 100644
--- a/kernel/dev/hw_rng/debug.c
+++ b/kernel/dev/hw_rng/debug.c
@@ -16,7 +16,7 @@
 {
     uint32_t val = hw_rng_get_u32();
     printf("Random val = %u (0x%08x)\n", val, val);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static int cmd_rng(int argc, const cmd_args *argv, uint32_t flags)
@@ -28,7 +28,7 @@
                "wait  : true  -> wait indefinitely for bytes to be generated\n"
                "      : false -> terminate if HW generator runs out of entropy (default)\n",
                argv[0].str);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     printf("Generating %lu random bytes\n", argv[1].u);
@@ -53,7 +53,7 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 STATIC_COMMAND_START
diff --git a/kernel/dev/hw_rng/include/dev/hw_rng.h b/kernel/dev/hw_rng/include/dev/hw_rng.h
index bafdcce..2d06874 100644
--- a/kernel/dev/hw_rng/include/dev/hw_rng.h
+++ b/kernel/dev/hw_rng/include/dev/hw_rng.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 #include <err.h>
 #include <sys/types.h>
diff --git a/kernel/dev/intel_rng/intel-rng.c b/kernel/dev/intel_rng/intel-rng.c
index 4cff42c..c205187 100644
--- a/kernel/dev/intel_rng/intel-rng.c
+++ b/kernel/dev/intel_rng/intel-rng.c
@@ -55,8 +55,8 @@
      * tests against this code */
 
     if (len >= SSIZE_MAX) {
-        static_assert(MX_ERR_INVALID_ARGS < 0, "");
-        return MX_ERR_INVALID_ARGS;
+        static_assert(ZX_ERR_INVALID_ARGS < 0, "");
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (x86_feature_test(X86_FEATURE_RDSEED)) {
@@ -66,8 +66,8 @@
     }
 
     /* We don't have an entropy source */
-    static_assert(MX_ERR_NOT_SUPPORTED < 0, "");
-    return MX_ERR_NOT_SUPPORTED;
+    static_assert(ZX_ERR_NOT_SUPPORTED < 0, "");
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 __attribute__((target("rdrnd,rdseed")))
diff --git a/kernel/dev/interrupt/arm_gicv2/arm_gic.c b/kernel/dev/interrupt/arm_gicv2/arm_gic.c
index 6818475..72c9098 100644
--- a/kernel/dev/interrupt/arm_gicv2/arm_gic.c
+++ b/kernel/dev/interrupt/arm_gicv2/arm_gic.c
@@ -153,33 +153,33 @@
         (irq & 0xf);
 
     if (irq >= 16)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     LTRACEF("GICD_SGIR: %x\n", val);
 
     GICREG(0, GICD_SGIR) = val;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t gic_mask_interrupt(unsigned int vector)
 {
     if (vector >= max_irqs)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     gic_set_enable(vector, false);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t gic_unmask_interrupt(unsigned int vector)
 {
     if (vector >= max_irqs)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     gic_set_enable(vector, true);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t gic_configure_interrupt(unsigned int vector,
@@ -188,11 +188,11 @@
 {
     //Only configurable for SPI interrupts
     if ((vector >= max_irqs) || (vector < GIC_BASE_SPI))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (pol != IRQ_POLARITY_ACTIVE_HIGH) {
         // TODO: polarity should actually be configure through a GPIO controller
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // type is encoded with two bits, MSB of the two determine type
@@ -205,7 +205,7 @@
     reg_val |= (type << bit_shift);
     GICREG(0, GICD_ICFGR(reg_ndx)) = reg_val;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t gic_get_interrupt_config(unsigned int vector,
@@ -213,12 +213,12 @@
                                          enum interrupt_polarity* pol)
 {
     if (vector >= max_irqs)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (tm)  *tm  = IRQ_TRIGGER_MODE_EDGE;
     if (pol) *pol = IRQ_POLARITY_ACTIVE_HIGH;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static unsigned int gic_remap_interrupt(unsigned int vector)
@@ -282,7 +282,7 @@
         arm_gic_sgi(gic_ipi_num, ARM_GIC_SGI_FLAG_NS, target);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static enum handler_return arm_ipi_generic_handler(void *arg) {
diff --git a/kernel/dev/interrupt/arm_gicv2/arm_gicv2m.c b/kernel/dev/interrupt/arm_gicv2/arm_gicv2m.c
index bbd2caf..94b1bc3 100644
--- a/kernel/dev/interrupt/arm_gicv2/arm_gicv2m.c
+++ b/kernel/dev/interrupt/arm_gicv2/arm_gicv2m.c
@@ -71,15 +71,15 @@
 
 status_t arm_gicv2m_get_frame_info(const uint frame_ndx, arm_gicv2m_frame_info_t* out_info) {
     if (!out_info)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     memset(out_info, 0, sizeof(*out_info));
 
     if (!g_reg_frames || !g_reg_frame_count)
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
 
     if (frame_ndx >= g_reg_frame_count)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     uint32_t type_reg = REG_RD(g_reg_frames_virt[frame_ndx], MSI_TYPER_OFFSET);
     uint     base_spi = (type_reg >> 16) & 0x3FF;
@@ -89,12 +89,12 @@
     if (!num_spi ||
         (base_spi < MIN_VALID_MSI_SPI) ||
         (last_spi > MAX_VALID_MSI_SPI))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     out_info->start_spi_id = base_spi;
     out_info->end_spi_id   = last_spi;
     out_info->doorbell     = g_reg_frames[frame_ndx] + MSI_SETSPI_NS_OFFSET;
     out_info->iid          = REG_RD(g_reg_frames_virt[frame_ndx], MSI_IIDR_OFFSET);
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/dev/interrupt/arm_gicv2/arm_gicv2m_msi.c b/kernel/dev/interrupt/arm_gicv2/arm_gicv2m_msi.c
index 6e5b5cc..9297fed 100644
--- a/kernel/dev/interrupt/arm_gicv2/arm_gicv2m_msi.c
+++ b/kernel/dev/interrupt/arm_gicv2/arm_gicv2m_msi.c
@@ -28,13 +28,13 @@
     status_t ret;
 
     ret = p2ra_init(&g_32bit_targets, PCIE_MAX_MSI_IRQS);
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         TRACEF("Failed to initialize 32 bit allocation pool!\n");
         return ret;
     }
 
     ret = p2ra_init(&g_64bit_targets, PCIE_MAX_MSI_IRQS);
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         TRACEF("Failed to initialize 64 bit allocation pool!\n");
         p2ra_free(&g_32bit_targets);
         return ret;
@@ -50,14 +50,14 @@
      * system more sophisticated.
      */
     arm_gicv2m_frame_info_t info;
-    for (uint i = 0; arm_gicv2m_get_frame_info(i, &info) == MX_OK; ++i) {
+    for (uint i = 0; arm_gicv2m_get_frame_info(i, &info) == ZX_OK; ++i) {
         p2ra_state_t* pool = ((uint64_t)info.doorbell & 0xFFFFFFFF00000000)
                            ? &g_64bit_targets
                            : &g_32bit_targets;
 
         uint len = info.end_spi_id - info.start_spi_id + 1;
         ret = p2ra_add_range(pool, info.start_spi_id, len);
-        if (ret != MX_OK) {
+        if (ret != ZX_OK) {
             TRACEF("Failed to add MSI IRQ range [%u, %u] to allocator (ret %d).\n",
                     info.start_spi_id, len, ret);
             goto finished;
@@ -65,7 +65,7 @@
     }
 
 finished:
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         p2ra_free(&g_32bit_targets);
         p2ra_free(&g_64bit_targets);
     }
@@ -78,15 +78,15 @@
                                     bool is_msix,
                                     pcie_msi_block_t* out_block) {
     if (!out_block)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (out_block->allocated)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     if (!requested_irqs || (requested_irqs > PCIE_MAX_MSI_IRQS))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
-    status_t ret = MX_ERR_INTERNAL;
+    status_t ret = ZX_ERR_INTERNAL;
     bool is_32bit = false;
     uint alloc_size = 1u << log2_uint_ceil(requested_irqs);
     uint alloc_start;
@@ -97,13 +97,13 @@
         ret = p2ra_allocate_range(&g_64bit_targets, alloc_size, &alloc_start);
 
     /* No allocation yet?  Fall back on the 32 bit pool */
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         ret = p2ra_allocate_range(&g_32bit_targets, alloc_size, &alloc_start);
         is_32bit = true;
     }
 
     /* If we have not managed to allocate yet, then we fail */
-    if (ret != MX_OK)
+    if (ret != ZX_OK)
         return ret;
 
     /* Find the target physical address for this allocation.
@@ -114,7 +114,7 @@
      * about this.
      */
     arm_gicv2m_frame_info_t info;
-    for (uint i = 0; (ret = arm_gicv2m_get_frame_info(i, &info)) == MX_OK; ++i) {
+    for (uint i = 0; (ret = arm_gicv2m_get_frame_info(i, &info)) == ZX_OK; ++i) {
         uint alloc_end = alloc_start + alloc_size - 1;
 
         if (((alloc_start >= info.start_spi_id) && (alloc_start <= info.end_spi_id)) &&
@@ -123,8 +123,8 @@
     }
 
     /* This should never ever fail */
-    DEBUG_ASSERT(ret == MX_OK);
-    if (ret != MX_OK) {
+    DEBUG_ASSERT(ret == ZX_OK);
+    if (ret != ZX_OK) {
         p2ra_free_range(is_32bit ? &g_32bit_targets : &g_64bit_targets, alloc_start, alloc_size);
         return ret;
     }
@@ -136,7 +136,7 @@
     out_block->tgt_addr     = info.doorbell;
     out_block->tgt_data     = alloc_start;
     out_block->allocated    = true;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void arm_gicv2m_free_msi_block(pcie_msi_block_t* block) {
diff --git a/kernel/dev/interrupt/arm_gicv2/include/dev/interrupt/arm_gicv2m.h b/kernel/dev/interrupt/arm_gicv2/include/dev/interrupt/arm_gicv2m.h
index f5b716c..07d9ce4 100644
--- a/kernel/dev/interrupt/arm_gicv2/include/dev/interrupt/arm_gicv2m.h
+++ b/kernel/dev/interrupt/arm_gicv2/include/dev/interrupt/arm_gicv2m.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
@@ -41,10 +41,10 @@
  * @param out_info A pointer to the structure which will hold info about the frame
  * @return A status code indicating the success or failure of the operation.
  * Status codes may include...
- *  ++ MX_ERR_UNAVAILABLE The GICv2m subsystem was never initialized
- *  ++ MX_ERR_NOT_FOUND frame_ndx is out of range
- *  ++ MX_ERR_INVALID_ARGS out_info is NULL
- *  ++ MX_ERR_BAD_STATE The frame index exists, but the registers in the frame
+ *  ++ ZX_ERR_UNAVAILABLE The GICv2m subsystem was never initialized
+ *  ++ ZX_ERR_NOT_FOUND frame_ndx is out of range
+ *  ++ ZX_ERR_INVALID_ARGS out_info is NULL
+ *  ++ ZX_ERR_BAD_STATE The frame index exists, but the registers in the frame
  *     appear to be corrupt or invalid (internal error)
  */
 status_t arm_gicv2m_get_frame_info(uint frame_ndx, arm_gicv2m_frame_info_t* out_info);
diff --git a/kernel/dev/interrupt/arm_gicv2/include/dev/interrupt/arm_gicv2m_msi.h b/kernel/dev/interrupt/arm_gicv2/include/dev/interrupt/arm_gicv2m_msi.h
index 180e220..306877a 100644
--- a/kernel/dev/interrupt/arm_gicv2/include/dev/interrupt/arm_gicv2m_msi.h
+++ b/kernel/dev/interrupt/arm_gicv2/include/dev/interrupt/arm_gicv2m_msi.h
@@ -9,7 +9,7 @@
 
 #if WITH_DEV_PCIE
 #include <dev/pcie_platform.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/dev/interrupt/arm_gicv3/arm_gicv3.c b/kernel/dev/interrupt/arm_gicv3/arm_gicv3.c
index 2b4d32d..27d2e5a 100644
--- a/kernel/dev/interrupt/arm_gicv3/arm_gicv3.c
+++ b/kernel/dev/interrupt/arm_gicv3/arm_gicv3.c
@@ -156,11 +156,11 @@
 static status_t arm_gic_sgi(u_int irq, u_int flags, u_int cpu_mask)
 {
     if (flags != ARM_GIC_SGI_FLAG_NS) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (irq >= 16) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     smp_mb();
@@ -186,27 +186,27 @@
         cluster += 1;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t gic_mask_interrupt(unsigned int vector)
 {
     if (vector >= gic_max_int)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     gic_set_enable(vector, false);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t gic_unmask_interrupt(unsigned int vector)
 {
     if (vector >= gic_max_int)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     gic_set_enable(vector, true);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t gic_configure_interrupt(unsigned int vector,
@@ -214,12 +214,12 @@
                              enum interrupt_polarity pol)
 {
     if (vector <= 15 || vector >= gic_max_int) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (pol != IRQ_POLARITY_ACTIVE_HIGH) {
         // TODO: polarity should actually be configure through a GPIO controller
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint reg = vector / 16;
@@ -232,7 +232,7 @@
     }
     GICREG(0, GICD_ICFGR(reg)) = val;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t gic_get_interrupt_config(unsigned int vector,
@@ -240,12 +240,12 @@
                               enum interrupt_polarity* pol)
 {
     if (vector >= gic_max_int)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (tm)  *tm  = IRQ_TRIGGER_MODE_EDGE;
     if (pol) *pol = IRQ_POLARITY_ACTIVE_HIGH;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static unsigned int gic_remap_interrupt(unsigned int vector) {
@@ -304,7 +304,7 @@
         arm_gic_sgi(gic_ipi_num, ARM_GIC_SGI_FLAG_NS, target);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static enum handler_return arm_ipi_generic_handler(void *arg) {
diff --git a/kernel/dev/interrupt/bcm28xx/intc.c b/kernel/dev/interrupt/bcm28xx/intc.c
index 1090bd2..329d692 100644
--- a/kernel/dev/interrupt/bcm28xx/intc.c
+++ b/kernel/dev/interrupt/bcm28xx/intc.c
@@ -58,7 +58,7 @@
 
     spin_unlock_irqrestore(&lock, state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static status_t bcm28xx_unmask_interrupt(unsigned int vector) {
@@ -98,7 +98,7 @@
 
     spin_unlock_irqrestore(&lock, state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static bool bcm28xx_is_valid_interrupt(unsigned int vector, uint32_t flags) {
@@ -116,7 +116,7 @@
                                             enum interrupt_trigger_mode tm,
                                             enum interrupt_polarity pol)
 {
-    return MX_OK;
+    return ZX_OK;
 }
 
 /*
@@ -128,7 +128,7 @@
 {
     if (tm)  *tm  = IRQ_TRIGGER_MODE_EDGE;
     if (pol) *pol = IRQ_POLARITY_ACTIVE_HIGH;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static enum handler_return bcm28xx_handle_irq(struct arm64_iframe_short* frame) {
@@ -235,7 +235,7 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void bcm28xx_init_percpu_early(void) {
diff --git a/kernel/dev/interrupt/include/dev/interrupt.h b/kernel/dev/interrupt/include/dev/interrupt.h
index 4061304..b35af30 100644
--- a/kernel/dev/interrupt/include/dev/interrupt.h
+++ b/kernel/dev/interrupt/include/dev/interrupt.h
@@ -7,7 +7,7 @@
 #pragma once
 
 #include <kernel/mp.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <sys/types.h>
 
diff --git a/kernel/dev/pcie/debug.cpp b/kernel/dev/pcie/debug.cpp
index bda217f..06c0a51 100644
--- a/kernel/dev/pcie/debug.cpp
+++ b/kernel/dev/pcie/debug.cpp
@@ -616,13 +616,13 @@
             printf("       -e : Dump raw extended config (implies -l -c)\n");
             printf("       -f : Force dump at least standard config, even if the device didn't "
                                "enumerate (requires a full BDF address)\n");
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
     auto bus_drv = PcieBusDriver::GetDriver();
     if (bus_drv == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     bus_drv->ForeachDevice(dump_pcie_device, &params);
 
@@ -643,7 +643,7 @@
         printf("PCIe scan discovered %u device%s\n", params.found, (params.found == 1) ? "" : "s");
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 int PcieDebugConsole::CmdPciUnplug(int argc, const cmd_args *argv, uint32_t flags) {
@@ -665,12 +665,12 @@
 
     if (confused) {
         printf("usage: %s <bus_id> <dev_id> <func_id>\n", argv[0].str);
-        return MX_OK;
+        return ZX_OK;
     }
 
     auto bus_drv = PcieBusDriver::GetDriver();
     if (bus_drv == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     fbl::RefPtr<PcieDevice> dev = bus_drv->GetRefedDevice(bus_id, dev_id, func_id);
 
@@ -684,7 +684,7 @@
         printf("done\n");
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 int PcieDebugConsole::CmdPciReset(int argc, const cmd_args *argv, uint32_t flags) {
@@ -706,12 +706,12 @@
 
     if (confused) {
         printf("usage: %s <bus_id> <dev_id> <func_id>\n", argv[0].str);
-        return MX_OK;
+        return ZX_OK;
     }
 
     auto bus_drv = PcieBusDriver::GetDriver();
     if (bus_drv == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     fbl::RefPtr<PcieDevice> dev = bus_drv->GetRefedDevice(bus_id, dev_id, func_id);
 
@@ -721,19 +721,19 @@
         printf("Attempting reset of device %02x:%02x.%01x...\n", bus_id, dev_id, func_id);
         status_t res = dev->DoFunctionLevelReset();
         dev = nullptr;
-        if (res != MX_OK)
+        if (res != ZX_OK)
             printf("Reset attempt failed (res = %d).\n", res);
         else
             printf("Success, device %02x:%02x.%01x has been reset.\n", bus_id, dev_id, func_id);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 int PcieDebugConsole::CmdPciRescan(int argc, const cmd_args *argv, uint32_t flags) {
     auto bus_drv = PcieBusDriver::GetDriver();
     if (bus_drv == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     return bus_drv->RescanDevices();
 }
diff --git a/kernel/dev/pcie/include/dev/pcie_bridge.h b/kernel/dev/pcie/include/dev/pcie_bridge.h
index 531839a..ef71a92 100644
--- a/kernel/dev/pcie/include/dev/pcie_bridge.h
+++ b/kernel/dev/pcie/include/dev/pcie_bridge.h
@@ -7,8 +7,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/errors.h>
+#include <zircon/compiler.h>
+#include <zircon/errors.h>
 #include <dev/pcie_bus_driver.h>
 #include <dev/pcie_device.h>
 #include <dev/pcie_ref_counted.h>
diff --git a/kernel/dev/pcie/include/dev/pcie_caps.h b/kernel/dev/pcie/include/dev/pcie_caps.h
index 8e17cd1..31f5188 100644
--- a/kernel/dev/pcie/include/dev/pcie_caps.h
+++ b/kernel/dev/pcie/include/dev/pcie_caps.h
@@ -9,7 +9,7 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <dev/pci_config.h>
 #include <dev/pci_common.h>
 #include <endian.h>
diff --git a/kernel/dev/pcie/include/dev/pcie_device.h b/kernel/dev/pcie/include/dev/pcie_device.h
index a86620b..37218da 100644
--- a/kernel/dev/pcie/include/dev/pcie_device.h
+++ b/kernel/dev/pcie/include/dev/pcie_device.h
@@ -9,8 +9,8 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
-#include <magenta/errors.h>
+#include <zircon/compiler.h>
+#include <zircon/errors.h>
 #include <dev/pcie_bus_driver.h>
 #include <dev/pcie_caps.h>
 #include <dev/pci_common.h>
@@ -103,7 +103,7 @@
      */
     inline status_t EnableBusMaster(bool enabled) {
         if (enabled && disabled_)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         return ModifyCmd(enabled ? 0 : PCI_COMMAND_BUS_MASTER_EN,
                          enabled ? PCI_COMMAND_BUS_MASTER_EN : 0);
@@ -117,7 +117,7 @@
      */
     inline status_t EnablePio(bool enabled) {
         if (enabled && disabled_)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         return ModifyCmd(enabled ? 0 : PCI_COMMAND_IO_EN,
                          enabled ? PCI_COMMAND_IO_EN : 0);
@@ -131,7 +131,7 @@
      */
     inline status_t EnableMmio(bool enabled) {
         if (enabled && disabled_)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         return ModifyCmd(enabled ? 0 : PCI_COMMAND_MEM_EN,
                          enabled ? PCI_COMMAND_MEM_EN : 0);
@@ -181,7 +181,7 @@
      * @return A status_t indicating the success or failure of the operation.
      * Status codes may include (but are not limited to)...
      *
-     * ++ MX_ERR_UNAVAILABLE
+     * ++ ZX_ERR_UNAVAILABLE
      *    The device has become unplugged and is waiting to be released.
      */
     status_t GetIrqMode(pcie_irq_mode_info_t* out_info) const;
@@ -207,16 +207,16 @@
      * @return A status_t indicating the success or failure of the operation.
      * Status codes may include (but are not limited to)...
      *
-     * ++ MX_ERR_UNAVAILABLE
+     * ++ ZX_ERR_UNAVAILABLE
      *    The device has become unplugged and is waiting to be released.
-     * ++ MX_ERR_BAD_STATE
+     * ++ ZX_ERR_BAD_STATE
      *    The device cannot transition into the selected mode at this point in time
      *    due to the mode it is currently in.
-     * ++ MX_ERR_NOT_SUPPORTED
+     * ++ ZX_ERR_NOT_SUPPORTED
      *    ++ The chosen mode is not supported by the device
      *    ++ The device supports the chosen mode, but does not support the number of
      *       IRQs requested.
-     * ++ MX_ERR_NO_RESOURCES
+     * ++ ZX_ERR_NO_RESOURCES
      *    The system is unable to allocate sufficient system IRQs to satisfy the
      *    number of IRQs and exclusivity mode requested the device driver.
      */
@@ -234,7 +234,7 @@
 
         result = SetIrqMode(PCIE_IRQ_MODE_DISABLED, 0);
 
-        DEBUG_ASSERT(result == MX_OK);
+        DEBUG_ASSERT(result == ZX_OK);
     }
 
     /**
@@ -249,11 +249,11 @@
      * @return A status_t indicating the success or failure of the operation.
      * Status codes may include (but are not limited to)...
      *
-     * ++ MX_ERR_UNAVAILABLE
+     * ++ ZX_ERR_UNAVAILABLE
      *    The device has become unplugged and is waiting to be released.
-     * ++ MX_ERR_BAD_STATE
+     * ++ ZX_ERR_BAD_STATE
      *    The device is in DISABLED IRQ mode.
-     * ++ MX_ERR_INVALID_ARGS
+     * ++ ZX_ERR_INVALID_ARGS
      *    The irq_id parameter is out of range for the currently configured mode.
      */
     status_t RegisterIrqHandler(uint irq_id, pcie_irq_handler_fn_t handler, void* ctx);
@@ -267,14 +267,14 @@
      * @return A status_t indicating the success or failure of the operation.
      * Status codes may include (but are not limited to)...
      *
-     * ++ MX_ERR_UNAVAILABLE
+     * ++ ZX_ERR_UNAVAILABLE
      *    The device has become unplugged and is waiting to be released.
-     * ++ MX_ERR_BAD_STATE
+     * ++ ZX_ERR_BAD_STATE
      *    Attempting to mask or unmask an IRQ while in the DISABLED mode or with no
      *    handler registered.
-     * ++ MX_ERR_INVALID_ARGS
+     * ++ ZX_ERR_INVALID_ARGS
      *    The irq_id parameter is out of range for the currently configured mode.
-     * ++ MX_ERR_NOT_SUPPORTED
+     * ++ ZX_ERR_NOT_SUPPORTED
      *    The device is operating in MSI mode, but neither the PCI device nor the
      *    platform interrupt controller support masking the MSI vector.
      */
diff --git a/kernel/dev/pcie/include/dev/pcie_platform.h b/kernel/dev/pcie/include/dev/pcie_platform.h
index b854cf3..20fe0be 100644
--- a/kernel/dev/pcie/include/dev/pcie_platform.h
+++ b/kernel/dev/pcie/include/dev/pcie_platform.h
@@ -10,8 +10,8 @@
 
 #include <dev/interrupt.h>
 #include <dev/pci_common.h>
-#include <magenta/compiler.h>
-#include <magenta/errors.h>
+#include <zircon/compiler.h>
+#include <zircon/errors.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
@@ -94,7 +94,7 @@
         // Bus driver code should not be calling this if the platform does not
         // indicate support for MSI.
         DEBUG_ASSERT(false);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     /**
diff --git a/kernel/dev/pcie/include/dev/pcie_ref_counted.h b/kernel/dev/pcie/include/dev/pcie_ref_counted.h
index 49e0f62..9f27968 100644
--- a/kernel/dev/pcie/include/dev/pcie_ref_counted.h
+++ b/kernel/dev/pcie/include/dev/pcie_ref_counted.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/ref_counted.h>
 
 /**
diff --git a/kernel/dev/pcie/include/dev/pcie_root.h b/kernel/dev/pcie/include/dev/pcie_root.h
index 7bdf8eb..4f8d4ed 100644
--- a/kernel/dev/pcie/include/dev/pcie_root.h
+++ b/kernel/dev/pcie/include/dev/pcie_root.h
@@ -10,7 +10,7 @@
 #include <dev/pcie_bus_driver.h>
 #include <dev/pcie_ref_counted.h>
 #include <dev/pcie_upstream_node.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/macros.h>
 #include <fbl/intrusive_wavl_tree.h>
 #include <fbl/ref_ptr.h>
@@ -42,8 +42,8 @@
     // @param pin     The pin we want to swizzle
     // @param irq     An output pointer for what IRQ this pin goes to
     //
-    // @return MX_OK if we successfully swizzled
-    // @return MX_ERR_NOT_FOUND if we did not know how to swizzle this pin
+    // @return ZX_OK if we successfully swizzled
+    // @return ZX_ERR_NOT_FOUND if we did not know how to swizzle this pin
     virtual status_t Swizzle(uint dev_id, uint func_id, uint pin, uint *irq) = 0;
 
     // WAVL-tree Index
diff --git a/kernel/dev/pcie/pci_config.cpp b/kernel/dev/pcie/pci_config.cpp
index 28908c6..6d77024 100644
--- a/kernel/dev/pcie/pci_config.cpp
+++ b/kernel/dev/pcie/pci_config.cpp
@@ -79,33 +79,33 @@
 
 uint8_t PciPioConfig::Read(const PciReg8 addr) const {
     uint32_t val;
-    mx_status_t status = Pci::PioCfgRead(static_cast<uint32_t>(base_ + addr.offset()), &val, 8u);
-    DEBUG_ASSERT(status == MX_OK);
+    zx_status_t status = Pci::PioCfgRead(static_cast<uint32_t>(base_ + addr.offset()), &val, 8u);
+    DEBUG_ASSERT(status == ZX_OK);
     return static_cast<uint8_t>(val & 0xFF);
 }
 uint16_t PciPioConfig::Read(const PciReg16 addr) const {
     uint32_t val;
-    mx_status_t status = Pci::PioCfgRead(static_cast<uint32_t>(base_ + addr.offset()), &val, 16u);
-    DEBUG_ASSERT(status == MX_OK);
+    zx_status_t status = Pci::PioCfgRead(static_cast<uint32_t>(base_ + addr.offset()), &val, 16u);
+    DEBUG_ASSERT(status == ZX_OK);
     return static_cast<uint16_t>(val & 0xFFFF);
 }
 uint32_t PciPioConfig::Read(const PciReg32 addr) const {
     uint32_t val;
-    mx_status_t status = Pci::PioCfgRead(static_cast<uint32_t>(base_ + addr.offset()), &val, 32u);
-    DEBUG_ASSERT(status == MX_OK);
+    zx_status_t status = Pci::PioCfgRead(static_cast<uint32_t>(base_ + addr.offset()), &val, 32u);
+    DEBUG_ASSERT(status == ZX_OK);
     return val;
 }
 void PciPioConfig::Write(const PciReg8 addr, uint8_t val) const {
-    mx_status_t status = Pci::PioCfgWrite(static_cast<uint32_t>(base_ + addr.offset()), val, 8u);
-    DEBUG_ASSERT(status == MX_OK);
+    zx_status_t status = Pci::PioCfgWrite(static_cast<uint32_t>(base_ + addr.offset()), val, 8u);
+    DEBUG_ASSERT(status == ZX_OK);
 }
 void PciPioConfig::Write(const PciReg16 addr, uint16_t val) const {
-    mx_status_t status = Pci::PioCfgWrite(static_cast<uint32_t>(base_ + addr.offset()), val, 16u);
-    DEBUG_ASSERT(status == MX_OK);
+    zx_status_t status = Pci::PioCfgWrite(static_cast<uint32_t>(base_ + addr.offset()), val, 16u);
+    DEBUG_ASSERT(status == ZX_OK);
 }
 void PciPioConfig::Write(const PciReg32 addr, uint32_t val) const {
-    mx_status_t status = Pci::PioCfgWrite(static_cast<uint32_t>(base_ + addr.offset()), val, 32u);
-    DEBUG_ASSERT(status == MX_OK);
+    zx_status_t status = Pci::PioCfgWrite(static_cast<uint32_t>(base_ + addr.offset()), val, 32u);
+    DEBUG_ASSERT(status == ZX_OK);
 }
 
 class PciMmioConfig : public PciConfig {
diff --git a/kernel/dev/pcie/pcie_bridge.cpp b/kernel/dev/pcie/pcie_bridge.cpp
index f978f97..e6424b0 100644
--- a/kernel/dev/pcie/pcie_bridge.cpp
+++ b/kernel/dev/pcie/pcie_bridge.cpp
@@ -6,7 +6,7 @@
 // https://opensource.org/licenses/MIT
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 #include <err.h>
 #include <inttypes.h>
@@ -55,7 +55,7 @@
 
     auto bridge = fbl::AdoptRef(static_cast<PcieDevice*>(raw_bridge));
     status_t res = raw_bridge->Init(upstream);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         TRACEF("Failed to initialize PCIe bridge %02x:%02x.%01x. (res %d)\n",
                 upstream.managed_bus_id(), dev_id, func_id, res);
         return nullptr;
@@ -69,7 +69,7 @@
 
     // Initialize the device portion of ourselves first.
     status_t res = PcieDevice::InitLocked(upstream);
-    if (res != MX_OK)
+    if (res != ZX_OK)
         return res;
 
     // Sanity checks of bus allocation.
@@ -87,26 +87,26 @@
         TRACEF("PCI-to-PCI bridge detected at %02x:%02x.%01x claims to be bridged to itsef "
                "(primary %02x == secondary %02x)... skipping scan.\n",
                bus_id_, dev_id_, func_id_, primary_id, secondary_id);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (primary_id != bus_id_) {
         TRACEF("PCI-to-PCI bridge detected at %02x:%02x.%01x has invalid primary bus id "
                "(%02x)... skipping scan.\n",
                bus_id_, dev_id_, func_id_, primary_id);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (secondary_id != managed_bus_id()) {
         TRACEF("PCI-to-PCI bridge detected at %02x:%02x.%01x has invalid secondary bus id "
                "(%02x)... skipping scan.\n",
                bus_id_, dev_id_, func_id_, secondary_id);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // Parse the state of its I/O and Memory windows.
     res = ParseBusWindowsLocked();
-    if (res != MX_OK)
+    if (res != ZX_OK)
         return res;
 
     // Things went well, flag the device as plugged in and link ourselves up to
@@ -162,7 +162,7 @@
             static_cast<uint64_t>(cfg_->Read(PciConfig::kPrefetchableMemoryLimitUpper)) << 32;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void PcieBridge::Unplug() {
@@ -175,19 +175,19 @@
 
     // Start by making sure we can allocate our bridge windows.
     status_t res = AllocateBridgeWindowsLocked();
-    if (res != MX_OK)
+    if (res != ZX_OK)
         return res;
 
     // Now, attempt to allocate our device BARs.
     res = PcieDevice::AllocateBarsLocked();
-    if (res != MX_OK)
+    if (res != ZX_OK)
         return res;
 
     // Great, we are good to go.  Leave our device lock and attempt to allocate
     // our downstream devices' resources.
     dev_lock.release();
     PcieUpstreamNode::AllocateDownstreamBars();
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t PcieBridge::AllocateBridgeWindowsLocked() {
@@ -199,7 +199,7 @@
     // should just fail out now.
     auto upstream = GetUpstream();
     if (upstream == nullptr)
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
 
     // We are configuring a bridge.  We need to be able to allocate the MMIO and
     // PIO regions this bridge is configured to manage.  Currently, we don't
@@ -212,7 +212,7 @@
         uint64_t size = static_cast<uint64_t>(io_limit_) - io_base_ + 1;
         ret = upstream->pio_regions().GetRegion({ .base = io_base_, .size = size }, pio_window_);
 
-        if (ret != MX_OK) {
+        if (ret != ZX_OK) {
             TRACEF("Failed to allocate bridge PIO window [0x%08x, 0x%08x]\n", io_base_, io_limit_);
             return ret;
         }
@@ -230,7 +230,7 @@
         ret = upstream->mmio_lo_regions().GetRegion({ .base = mem_base_, .size = size },
                                                     mmio_window_);
 
-        if (ret != MX_OK) {
+        if (ret != ZX_OK) {
             TRACEF("Failed to allocate bridge MMIO window [0x%08x, 0x%08x]\n",
                     mem_base_, mem_limit_);
             return ret;
@@ -240,7 +240,7 @@
         mmio_lo_regions().AddRegion(*mmio_window_);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void PcieBridge::Disable() {
diff --git a/kernel/dev/pcie/pcie_bus_driver.cpp b/kernel/dev/pcie/pcie_bus_driver.cpp
index b86bed7..28b53d0 100644
--- a/kernel/dev/pcie/pcie_bus_driver.cpp
+++ b/kernel/dev/pcie/pcie_bus_driver.cpp
@@ -75,12 +75,12 @@
 
 status_t PcieBusDriver::AddRoot(fbl::RefPtr<PcieRoot>&& root) {
     if (root == nullptr)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Make sure that we are not already started.
     if (!IsNotStarted()) {
         TRACEF("Cannot add more PCIe roots once the bus driver has been started!\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // Attempt to add it to the collection of roots.
@@ -89,17 +89,17 @@
         if (!roots_.insert_or_find(fbl::move(root))) {
             TRACEF("Failed to add PCIe root for bus %u, root already exists!\n",
                     root->managed_bus_id());
-            return MX_ERR_ALREADY_EXISTS;
+            return ZX_ERR_ALREADY_EXISTS;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t PcieBusDriver::RescanDevices() {
     if (!IsOperational()) {
         TRACEF("Cannot rescan devices until the bus driver is operational!\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     AutoLock lock(&bus_rescan_lock_);
@@ -116,7 +116,7 @@
                      return true;
                    }, nullptr);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool PcieBusDriver::IsNotStarted(bool allow_quirks_phase) const {
@@ -147,7 +147,7 @@
 
 status_t PcieBusDriver::StartBusDriver() {
     if (!AdvanceState(State::NOT_STARTED, State::STARTING_SCANNING))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     {
         AutoLock lock(&bus_rescan_lock_);
@@ -159,7 +159,7 @@
                        }, nullptr);
 
         if (!AdvanceState(State::STARTING_SCANNING, State::STARTING_RUNNING_QUIRKS))
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         // Run registered quirk handlers for any newly discovered devices.
         ForeachDevice([](const fbl::RefPtr<PcieDevice>& dev, void* ctx, uint level) -> bool {
@@ -172,7 +172,7 @@
         PcieBusDriver::RunQuirks(nullptr);
 
         if (!AdvanceState(State::STARTING_RUNNING_QUIRKS, State::STARTING_RESOURCE_ALLOCATION))
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         // Attempt to allocate any unallocated BARs
         ForeachRoot([](const fbl::RefPtr<PcieRoot>& root, void* ctx) -> bool {
@@ -182,9 +182,9 @@
     }
 
     if (!AdvanceState(State::STARTING_RESOURCE_ALLOCATION, State::OPERATIONAL))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 fbl::RefPtr<PcieDevice> PcieBusDriver::GetNthDevice(uint32_t index) {
@@ -352,14 +352,14 @@
     region_bookkeeping_ = RegionAllocator::RegionPool::Create(REGION_BOOKKEEPING_MAX_MEM);
     if (region_bookkeeping_ == nullptr) {
         TRACEF("Failed to create pool allocator for Region bookkeeping!\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     mmio_lo_regions_.SetRegionPool(region_bookkeeping_);
     mmio_hi_regions_.SetRegionPool(region_bookkeeping_);
     pio_regions_.SetRegionPool(region_bookkeeping_);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool PcieBusDriver::ForeachDownstreamDevice(const fbl::RefPtr<PcieUpstreamNode>& upstream,
@@ -402,11 +402,11 @@
                                              bool add_op) {
     if (!IsNotStarted(true)) {
         TRACEF("Cannot add/subtract bus regions once the bus driver has been started!\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (!size)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     uint64_t end = base + size - 1;
     auto OpPtr = add_op ? &RegionAllocator::AddRegion : &RegionAllocator::SubtractRegion;
@@ -431,7 +431,7 @@
             status_t res;
 
             res = (mmio_lo.*OpPtr)({ .base = lo_base, .size = lo_size }, true);
-            if (res != MX_OK)
+            if (res != ZX_OK)
                 return res;
 
             return (mmio_hi.*OpPtr)({ .base = hi_base, .size = hi_size }, true);
@@ -440,7 +440,7 @@
         DEBUG_ASSERT(aspace == PciAddrSpace::PIO);
 
         if ((base | end) & ~PCIE_PIO_ADDR_SPACE_MASK)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
 
         return (pio_regions_.*OpPtr)({ .base = base, .size = size }, true);
     }
@@ -451,18 +451,18 @@
 
     if (driver_ != nullptr) {
         TRACEF("Failed to initialize PCIe bus driver; driver already initialized\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     fbl::AllocChecker ac;
     driver_ = fbl::AdoptRef(new (&ac) PcieBusDriver(platform));
     if (!ac.check()) {
         TRACEF("Failed to allocate PCIe bus driver\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     status_t ret = driver_->AllocBookkeeping();
-    if (ret != MX_OK)
+    if (ret != ZX_OK)
         driver_.reset();
 
     return ret;
@@ -550,16 +550,16 @@
 status_t PcieBusDriver::AddEcamRegion(const EcamRegion& ecam) {
     if (!IsNotStarted()) {
         TRACEF("Cannot add/subtract ECAM regions once the bus driver has been started!\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // Sanity check the region first.
     if (ecam.bus_start > ecam.bus_end)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     size_t bus_count = static_cast<size_t>(ecam.bus_end) - ecam.bus_start + 1u;
     if (ecam.size != (PCIE_ECAM_BYTE_PER_BUS * bus_count))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Grab the ECAM lock and make certain that the region we have been asked to
     // add does not overlap with any already defined regions.
@@ -575,7 +575,7 @@
         uint8_t iter_end   = iter->ecam().bus_end;
         if (((iter_start >= ecam.bus_start) && (iter_start <= ecam.bus_end)) ||
             ((ecam.bus_start >= iter_start) && (ecam.bus_start <= iter_end)))
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
     }
 
     // Looks good.  Attempt to allocate and map this ECAM region.
@@ -584,11 +584,11 @@
     if (!ac.check()) {
         TRACEF("Failed to allocate ECAM region for bus range [0x%02x, 0x%02x]\n",
                ecam.bus_start, ecam.bus_end);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     status_t res = region->MapEcam();
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         TRACEF("Failed to map ECAM region for bus range [0x%02x, 0x%02x]\n",
                ecam.bus_start, ecam.bus_end);
         return res;
@@ -596,7 +596,7 @@
 
     // Everything checks out.  Add the new region to our set of regions and we are done.
     ecam_regions_.insert(fbl::move(region));
-    return MX_OK;
+    return ZX_OK;
 }
 
 PcieBusDriver::MappedEcamRegion::~MappedEcamRegion() {
@@ -612,7 +612,7 @@
                  (static_cast<size_t>(ecam_.bus_end) - ecam_.bus_start + 1u));
 
     if (vaddr_ != nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     char name_buf[32];
     snprintf(name_buf, sizeof(name_buf), "pcie_cfg_%02x_%02x", ecam_.bus_start, ecam_.bus_end);
diff --git a/kernel/dev/pcie/pcie_caps.cpp b/kernel/dev/pcie/pcie_caps.cpp
index 3138a62..51437f0 100644
--- a/kernel/dev/pcie/pcie_caps.cpp
+++ b/kernel/dev/pcie/pcie_caps.cpp
@@ -261,10 +261,10 @@
     if (offset == 0xFF
         || offset < PCIE_CAP_PTR_MIN_VALID
         || offset > PCIE_CAP_PTR_MAX_VALID) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /*
@@ -275,7 +275,7 @@
  */
 
 status_t PcieDevice::ParseStdCapabilitiesLocked() {
-    status_t res = MX_OK;
+    status_t res = ZX_OK;
     uint8_t cap_offset = cfg_->Read(PciConfig::kCapabilitiesPtr);
     uint8_t caps_found = 0;
     fbl::AllocChecker ac;
@@ -290,7 +290,7 @@
     LTRACEF("Scanning for capabilities at %02x:%02x.%01x (%04hx:%04hx)\n",
             bus_id(), dev_id(), func_id(), vendor_id(), device_id());
     while (cap_offset != PCIE_CAP_PTR_NULL && caps_found < PCIE_MAX_CAPABILITIES) {
-        if ((res = validate_capability_offset(cap_offset)) != MX_OK) {
+        if ((res = validate_capability_offset(cap_offset)) != ZX_OK) {
             TRACEF("Device %02x:%02x.%01x (%04hx:%04hx) has invalid cptr (%#02x)\n",
                     bus_id(), dev_id(), func_id(),
                     vendor_id(), device_id(), cap_offset);
@@ -327,7 +327,7 @@
 
         if (!ac.check()) {
             TRACEF("Could not allocate memory fori capability 0x%02x\n", id);
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
 
         caps_.detected.push_front(fbl::unique_ptr<PciStdCapability>(cap));
@@ -343,14 +343,14 @@
      * TODO(cja): Since ExtCaps are a no-op right now (we had nothing in the table for
      * supported extended capabilities) this is a stub for now.
      */
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Parse PCI Standard Capabilities starting with the pointer in the PCI
 // config structure.
 status_t PcieDevice::ProbeCapabilitiesLocked() {
     status_t ret = ParseStdCapabilitiesLocked();
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         return ret;
     }
 
diff --git a/kernel/dev/pcie/pcie_device.cpp b/kernel/dev/pcie/pcie_device.cpp
index 5386fd6..7fcd70e 100644
--- a/kernel/dev/pcie/pcie_device.cpp
+++ b/kernel/dev/pcie/pcie_device.cpp
@@ -7,7 +7,7 @@
 
 #include <arch/mmu.h>
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 #include <dev/pcie_bridge.h>
 #include <dev/pcie_bus_driver.h>
@@ -64,7 +64,7 @@
 
     auto dev = fbl::AdoptRef(static_cast<PcieDevice*>(raw_dev));
     status_t res = raw_dev->Init(upstream);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         TRACEF("Failed to initialize PCIe device %02x:%02x.%01x. (res %d)\n",
                 upstream.managed_bus_id(), dev_id, func_id, res);
         return nullptr;
@@ -106,7 +106,7 @@
     AutoLock dev_lock(&dev_lock_);
 
     status_t res = InitLocked(upstream);
-    if (res == MX_OK) {
+    if (res == ZX_OK) {
         // Things went well, flag the device as plugged in and link ourselves up to
         // the graph.
         plugged_in_ = true;
@@ -124,7 +124,7 @@
     cfg_ = bus_drv_.GetConfig(bus_id_, dev_id_, func_id_, &cfg_phys_);
     if (cfg_ == nullptr) {
         TRACEF("Failed to fetch config for device %02x:%02x.%01x.\n", bus_id_, dev_id_, func_id_);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // Cache basic device info
@@ -138,22 +138,22 @@
     // Determine the details of each of the BARs, but do not actually allocate
     // space on the bus for them yet.
     res = ProbeBarsLocked();
-    if (res != MX_OK)
+    if (res != ZX_OK)
         return res;
 
     // Parse and sanity check the capabilities and extended capabilities lists
     // if they exist
     res = ProbeCapabilitiesLocked();
-    if (res != MX_OK)
+    if (res != ZX_OK)
         return res;
 
     // Now that we know what our capabilities are, initialize our internal IRQ
     // bookkeeping
     res = InitLegacyIrqStateLocked(upstream);
-    if (res != MX_OK)
+    if (res != ZX_OK)
         return res;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 fbl::RefPtr<PcieUpstreamNode> PcieDevice::GetUpstream() {
@@ -195,7 +195,7 @@
     // a long time (more than a second).  We should not hold the device lock for
     // the entire duration of the operation.  This should be re-done so that the
     // device can be placed into a "resetting" state (and other API calls can
-    // fail with MX_ERR_BAD_STATE, or some-such) and the lock can be released while the
+    // fail with ZX_ERR_BAD_STATE, or some-such) and the lock can be released while the
     // reset timeouts run.  This way, a spontaneous unplug event can occur and
     // not block the whole world because the device unplugged was in the process
     // of a FLR.
@@ -203,7 +203,7 @@
 
     // Make certain to check to see if the device is still plugged in.
     if (!plugged_in_)
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
 
     // Disallow reset if we currently have an active IRQ mode.
     //
@@ -212,10 +212,10 @@
     // assert that the call should succeed.
     pcie_irq_mode_info_t irq_mode_info;
     ret = GetIrqModeLocked(&irq_mode_info);
-    DEBUG_ASSERT(MX_OK == ret);
+    DEBUG_ASSERT(ZX_OK == ret);
 
     if (irq_mode_info.mode != PCIE_IRQ_MODE_DISABLED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     DEBUG_ASSERT(!irq_mode_info.registered_handlers);
     DEBUG_ASSERT(!irq_mode_info.max_handlers);
@@ -223,7 +223,7 @@
     // If cannot reset via the PCIe capability, or the PCI advanced capability,
     // then this device simply does not support function level reset.
     if (!(pcie_ && pcie_->has_flr()) && !(pci_af_ && pci_af_->has_flr()))
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Pick the functions we need for testing whether or not transactions are
     // pending for this device, and for initiating the FLR
@@ -274,16 +274,16 @@
     // 3) Poll the transaction pending bit until it clears.  This may take
     //    "several seconds"
     lk_time_t start = current_time();
-    ret = MX_ERR_TIMED_OUT;
+    ret = ZX_ERR_TIMED_OUT;
     do {
         if (!check_trans_pending(this)) {
-            ret = MX_OK;
+            ret = ZX_OK;
             break;
         }
         thread_sleep_relative(LK_MSEC(1));
     } while ((current_time() - start) < LK_SEC(5));
 
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         TRACEF("Timeout waiting for pending transactions to clear the bus "
                "for %02x:%02x.%01x\n",
                bus_id_, dev_id_, func_id_);
@@ -308,16 +308,16 @@
     // Poll the Vendor ID field until the device finally completes it's
     // reset.
     start = current_time();
-    ret   = MX_ERR_TIMED_OUT;
+    ret   = ZX_ERR_TIMED_OUT;
     do {
         if (cfg_->Read(PciConfig::kVendorId) != PCIE_INVALID_VENDOR_ID) {
-            ret = MX_OK;
+            ret = ZX_OK;
             break;
         }
         thread_sleep_relative(LK_MSEC(1));
     } while ((current_time() - start) < LK_SEC(5));
 
-    if (ret == MX_OK) {
+    if (ret == ZX_OK) {
         // 6) Software reconfigures the function and enables it for normal operation
         AutoSpinLockIrqSave cmd_reg_lock(&cmd_reg_lock_);
 
@@ -349,10 +349,10 @@
 
     if (plugged_in_) {
         ModifyCmdLocked(clr_bits, set_bits);
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_UNAVAILABLE;
+    return ZX_ERR_UNAVAILABLE;
 }
 
 void PcieDevice::ModifyCmdLocked(uint16_t clr_bits, uint16_t set_bits) {
@@ -385,7 +385,7 @@
         DEBUG_ASSERT(bars_[i].allocation == nullptr);
 
         status_t probe_res = ProbeBarLocked(i);
-        if (probe_res != MX_OK)
+        if (probe_res != ZX_OK)
             return probe_res;
 
         if (bars_[i].size > 0) {
@@ -397,13 +397,13 @@
                 if (i >= bar_count_) {
                     TRACEF("Device %02x:%02x:%01x claims to have 64-bit BAR in position %u/%u!\n",
                            bus_id_, dev_id_, func_id_, i, bar_count_);
-                    return MX_ERR_BAD_STATE;
+                    return ZX_ERR_BAD_STATE;
                 }
             }
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t PcieDevice::ProbeBarLocked(uint bar_id) {
@@ -425,14 +425,14 @@
             TRACEF("Illegal 64-bit MMIO BAR position (%u/%u) while fetching BAR info "
                    "for device config @%p\n",
                    bar_id, bar_count_, cfg_);
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
     } else {
         if (bar_info.is_mmio && ((bar_val & PCI_BAR_MMIO_TYPE_MASK) != PCI_BAR_MMIO_TYPE_32BIT)) {
             TRACEF("Unrecognized MMIO BAR type (BAR[%u] == 0x%08x) while fetching BAR info "
                    "for device config @%p\n",
                    bar_id, bar_val, cfg_);
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
     }
 
@@ -490,7 +490,7 @@
     cfg_->Write(PciConfig::kCommand, backup);
 
     /* Success */
-    return MX_OK;
+    return ZX_OK;
 }
 
 
@@ -505,19 +505,19 @@
 
     // Have we become unplugged?
     if (!plugged_in_)
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
 
     /* Allocate BARs for the device */
     DEBUG_ASSERT(bar_count_ <= fbl::count_of(bars_));
     for (size_t i = 0; i < bar_count_; ++i) {
         if (bars_[i].size) {
             status_t ret = AllocateBarLocked(bars_[i]);
-            if (ret != MX_OK)
+            if (ret != ZX_OK)
                 return ret;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t PcieDevice::AllocateBarLocked(pcie_bar_info_t& info) {
@@ -527,14 +527,14 @@
     // Do not attempt to remap if we are rescanning the bus and this BAR is
     // already allocated, or if it does not exist (size is zero)
     if ((info.size == 0) || (info.allocation != nullptr))
-        return MX_OK;
+        return ZX_OK;
 
     // Hold a reference to our upstream node while we do this.  If we cannot
     // obtain a reference, then our upstream node has become unplugged and we
     // should just fail out now.
     auto upstream = GetUpstream();
     if (upstream == nullptr)
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
 
     /* Does this BAR already have an assigned address?  If so, try to preserve
      * it, if possible. */
@@ -555,13 +555,13 @@
             alloc = &upstream->pio_regions();
         }
 
-        status_t res = MX_ERR_NOT_FOUND;
+        status_t res = ZX_ERR_NOT_FOUND;
         if (alloc != nullptr) {
             res = alloc->GetRegion({ .base = info.bus_addr, .size = info.size }, info.allocation);
         }
 
-        if (res == MX_OK)
-            return MX_OK;
+        if (res == ZX_OK)
+            return ZX_OK;
 
         TRACEF("Failed to preserve device %02x:%02x.%01x's %s window "
                "[%#" PRIx64 ", %#" PRIx64 "] Attempting to re-allocate.\n",
@@ -601,8 +601,8 @@
                              : PAGE_SIZE;
         status_t res = alloc->GetRegion(align_size, align_size, info.allocation);
 
-        if (res != MX_OK) {
-            if ((res == MX_ERR_NOT_FOUND) && (alloc == &upstream->mmio_hi_regions())) {
+        if (res != ZX_OK) {
+            if ((res == ZX_ERR_NOT_FOUND) && (alloc == &upstream->mmio_hi_regions())) {
                 LTRACEF("Insufficient space to map 64-bit MMIO BAR in high region while "
                         "configuring BARs for device at %02x:%02x.%01x (cfg vaddr = %p).  "
                         "Falling back on low memory region.\n",
@@ -635,7 +635,7 @@
     if (info.is_64bit)
         cfg_->Write(PciConfig::kBAR(bar_reg + 1), static_cast<uint32_t>(info.bus_addr >> 32));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void PcieDevice::Disable() {
diff --git a/kernel/dev/pcie/pcie_irqs.cpp b/kernel/dev/pcie/pcie_irqs.cpp
index 31d6a20..457cb9f 100644
--- a/kernel/dev/pcie/pcie_irqs.cpp
+++ b/kernel/dev/pcie/pcie_irqs.cpp
@@ -63,7 +63,7 @@
         irq_.handlers = new (&ac) pcie_irq_handler_state_t[requested_irqs];
 
         if (!ac.check())
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         irq_.handler_count = requested_irqs;
     }
@@ -77,7 +77,7 @@
         irq_.handlers[i].masked     = is_masked;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /******************************************************************************
@@ -227,7 +227,7 @@
 
 status_t PcieDevice::MaskUnmaskLegacyIrq(bool mask) {
     if (!irq_.handlers || !irq_.handler_count)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     pcie_irq_handler_state_t& hstate = irq_.handlers[0];
 
@@ -239,14 +239,14 @@
         hstate.masked = mask;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t PcieDevice::EnterLegacyIrqMode(uint requested_irqs) {
     DEBUG_ASSERT(requested_irqs);
 
     if (!irq_.legacy.pin || (requested_irqs > 1))
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Make absolutely certain we are masked.
     ModifyCmdLocked(0, PCIE_CFG_COMMAND_INT_DISABLE);
@@ -254,13 +254,13 @@
     // We can never fail to allocated a single handlers (since we are going to
     // use the pre-allocated singleton)
     __UNUSED status_t res = AllocIrqHandlers(requested_irqs, true);
-    DEBUG_ASSERT(res == MX_OK);
+    DEBUG_ASSERT(res == ZX_OK);
     DEBUG_ASSERT(irq_.handlers == &irq_.singleton_handler);
 
     irq_.mode = PCIE_IRQ_MODE_LEGACY;
     irq_.legacy.shared_handler->AddDevice(*this);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void PcieDevice::LeaveLegacyIrqMode() {
@@ -313,13 +313,13 @@
 
 status_t PcieDevice::MaskUnmaskMsiIrq(uint irq_id, bool mask) {
     if (irq_id >= irq_.handler_count)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     /* If a mask is being requested, and we cannot mask at either the platform
      * interrupt controller or the PCI device level, tell the caller that the
      * operation is unsupported. */
     if (mask && !bus_drv_.platform().supports_msi_masking() && !irq_.msi->has_pvm())
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     DEBUG_ASSERT(irq_.handlers);
 
@@ -328,7 +328,7 @@
         MaskUnmaskMsiIrqLocked(irq_id, mask);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void PcieDevice::MaskAllMsiVectors() {
@@ -419,7 +419,7 @@
 status_t PcieDevice::EnterMsiIrqMode(uint requested_irqs) {
     DEBUG_ASSERT(requested_irqs);
 
-    status_t res = MX_OK;
+    status_t res = ZX_OK;
 
     // We cannot go into MSI mode if we don't support MSI at all, or we don't
     // support the number of IRQs requested
@@ -427,7 +427,7 @@
         !irq_.msi->is_valid()                 ||
         !bus_drv_.platform().supports_msi()   ||
         (requested_irqs > irq_.msi->max_irqs()))
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // If we support PVM, make sure that we are completely masked before
     // attempting to allocte the block of IRQs.
@@ -448,7 +448,7 @@
                                             irq_.msi->is64Bit(),
                                             false,  /* is_msix == false */
                                             &irq_.msi->irq_block_);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         LTRACEF("Failed to allocate a block of %u MSI IRQs for device "
                 "%02x:%02x.%01x (res %d)\n",
                 requested_irqs, bus_id_, dev_id_, func_id_, res);
@@ -457,7 +457,7 @@
 
     /* Allocate our handler table */
     res = AllocIrqHandlers(requested_irqs, initially_masked);
-    if (res != MX_OK)
+    if (res != ZX_OK)
         goto bailout;
 
     /* Record our new IRQ mode */
@@ -489,7 +489,7 @@
     SetMsiEnb(true);
 
 bailout:
-    if (res != MX_OK)
+    if (res != ZX_OK)
         LeaveMsiIrqMode();
 
     return res;
@@ -550,11 +550,11 @@
     // zero or the PVM supported flag to false, the memset has taken care of
     // this for us already.
     case PCIE_IRQ_MODE_DISABLED:
-        return MX_OK;
+        return ZX_OK;
 
     case PCIE_IRQ_MODE_LEGACY:
         if (!irq_.legacy.pin)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
 
         out_caps->max_irqs = 1;
         out_caps->per_vector_masking_supported = true;
@@ -564,12 +564,12 @@
         /* If the platform does not support MSI, then we don't support MSI,
          * even if the device does. */
         if (!bus_drv_.platform().supports_msi())
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
 
         /* If the device supports MSI, it will have a pointer to the control
          * structure in config. */
         if (!irq_.msi || !irq_.msi->is_valid())
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
 
         /* We support PVM if either the device does, or if the platform is
          * capable of masking and unmasking individual IRQs from an MSI block
@@ -583,16 +583,16 @@
         /* If the platform does not support MSI, then we don't support MSI,
          * even if the device does. */
         if (!bus_drv_.platform().supports_msi())
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
 
         /* TODO(johngro) : finish MSI-X implementation. */
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t PcieDevice::GetIrqModeLocked(pcie_irq_mode_info_t* out_info) const {
@@ -604,7 +604,7 @@
     out_info->max_handlers        = irq_.handler_count;
     out_info->registered_handlers = irq_.registered_handler_count;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t PcieDevice::SetIrqModeLocked(pcie_irq_mode_t mode, uint requested_irqs) {
@@ -617,7 +617,7 @@
         if (irq_.mode == PCIE_IRQ_MODE_DISABLED) {
             DEBUG_ASSERT(!irq_.handlers);
             DEBUG_ASSERT(!irq_.handler_count);
-            return MX_OK;
+            return ZX_OK;
         }
 
         DEBUG_ASSERT(irq_.handlers);
@@ -630,7 +630,7 @@
             LeaveLegacyIrqMode();
 
             DEBUG_ASSERT(!irq_.registered_handler_count);
-            return MX_OK;
+            return ZX_OK;
 
         case PCIE_IRQ_MODE_MSI:
             DEBUG_ASSERT(irq_.msi);
@@ -640,34 +640,34 @@
             LeaveMsiIrqMode();
 
             DEBUG_ASSERT(!irq_.registered_handler_count);
-            return MX_OK;
+            return ZX_OK;
 
         /* Right now, there should be no way to get into MSI-X mode */
         case PCIE_IRQ_MODE_MSI_X:
             DEBUG_ASSERT(false);
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
 
         default:
             /* mode is not one of the valid enum values, this should be impossible */
             DEBUG_ASSERT(false);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
     }
 
     /* We are picking an active IRQ mode, sanity check the args */
     if (requested_irqs < 1)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     /* If we are picking an active IRQ mode, we need to currently be in the
      * disabled_ state */
     if (irq_.mode != PCIE_IRQ_MODE_DISABLED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     switch (mode) {
     case PCIE_IRQ_MODE_LEGACY: return EnterLegacyIrqMode(requested_irqs);
     case PCIE_IRQ_MODE_MSI:    return EnterMsiIrqMode   (requested_irqs);
-    case PCIE_IRQ_MODE_MSI_X:  return MX_ERR_NOT_SUPPORTED;
-    default:                   return MX_ERR_INVALID_ARGS;
+    case PCIE_IRQ_MODE_MSI_X:  return ZX_ERR_NOT_SUPPORTED;
+    default:                   return ZX_ERR_INVALID_ARGS;
     }
 }
 
@@ -679,14 +679,14 @@
 
     /* Cannot register a handler if we are currently disabled_ */
     if (irq_.mode == PCIE_IRQ_MODE_DISABLED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     DEBUG_ASSERT(irq_.handlers);
     DEBUG_ASSERT(irq_.handler_count);
 
     /* Make sure that the IRQ ID is within range */
     if (irq_id >= irq_.handler_count)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     /* Looks good, register (or unregister the handler) and we are done. */
     pcie_irq_handler_state_t& hstate = irq_.handlers[irq_id];
@@ -708,7 +708,7 @@
         hstate.ctx     = handler ? ctx : nullptr;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t PcieDevice::MaskUnmaskIrqLocked(uint irq_id, bool mask) {
@@ -717,33 +717,33 @@
 
     /* Cannot manipulate mask status while in the DISABLED state */
     if (irq_.mode == PCIE_IRQ_MODE_DISABLED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     DEBUG_ASSERT(irq_.handlers);
     DEBUG_ASSERT(irq_.handler_count);
 
     /* Make sure that the IRQ ID is within range */
     if (irq_id >= irq_.handler_count)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     /* If we are unmasking (enabling), then we need to make sure that there is a
      * handler in place for the IRQ we are enabling. */
     pcie_irq_handler_state_t& hstate = irq_.handlers[irq_id];
     if (!mask && !hstate.handler)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     /* OK, everything looks good.  Go ahead and make the change based on the
      * mode we are currently in. */
     switch (irq_.mode) {
     case PCIE_IRQ_MODE_LEGACY: return MaskUnmaskLegacyIrq(mask);
     case PCIE_IRQ_MODE_MSI:    return MaskUnmaskMsiIrq(irq_id, mask);
-    case PCIE_IRQ_MODE_MSI_X:  return MX_ERR_NOT_SUPPORTED;
+    case PCIE_IRQ_MODE_MSI_X:  return ZX_ERR_NOT_SUPPORTED;
     default:
         DEBUG_ASSERT(false); /* This should be un-possible! */
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /******************************************************************************
@@ -754,24 +754,24 @@
 status_t PcieDevice::QueryIrqModeCapabilities(pcie_irq_mode_t mode,
                                               pcie_irq_mode_caps_t* out_caps) const {
     if (!out_caps)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     AutoLock dev_lock(&dev_lock_);
 
     return (plugged_in_ && !disabled_)
         ? QueryIrqModeCapabilitiesLocked(mode, out_caps)
-        : MX_ERR_BAD_STATE;
+        : ZX_ERR_BAD_STATE;
 }
 
 status_t PcieDevice::GetIrqMode(pcie_irq_mode_info_t* out_info) const {
     if (!out_info)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     AutoLock dev_lock(&dev_lock_);
 
     return (plugged_in_ && !disabled_)
         ? GetIrqModeLocked(out_info)
-        : MX_ERR_BAD_STATE;
+        : ZX_ERR_BAD_STATE;
 }
 
 status_t PcieDevice::SetIrqMode(pcie_irq_mode_t mode, uint requested_irqs) {
@@ -779,7 +779,7 @@
 
     return ((mode == PCIE_IRQ_MODE_DISABLED) || (plugged_in_ && !disabled_))
         ? SetIrqModeLocked(mode, requested_irqs)
-        : MX_ERR_BAD_STATE;
+        : ZX_ERR_BAD_STATE;
 }
 
 status_t PcieDevice::RegisterIrqHandler(uint irq_id, pcie_irq_handler_fn_t handler, void* ctx) {
@@ -787,7 +787,7 @@
 
     return (plugged_in_ && !disabled_)
         ? RegisterIrqHandlerLocked(irq_id, handler, ctx)
-        : MX_ERR_BAD_STATE;
+        : ZX_ERR_BAD_STATE;
 }
 
 status_t PcieDevice::MaskUnmaskIrq(uint irq_id, bool mask) {
@@ -795,7 +795,7 @@
 
     return (mask || (plugged_in_ && !disabled_))
         ? MaskUnmaskIrqLocked(irq_id, mask)
-        : MX_ERR_BAD_STATE;
+        : ZX_ERR_BAD_STATE;
 }
 
 
@@ -814,7 +814,7 @@
     DEBUG_ASSERT(dev_lock_.IsHeld());
 
     if (!legacy_irq_pin() || (legacy_irq_pin() > PCIE_MAX_LEGACY_IRQ_PINS))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     auto dev = fbl::WrapRefPtr(this);
     uint pin = legacy_irq_pin() - 1;  // Change to 0s indexing
@@ -840,7 +840,7 @@
         //    similar problems).
         auto bridge = fbl::RefPtr<PcieBridge>::Downcast(fbl::move(upstream));
         if (bridge == nullptr)
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
 
         // We need to swizzle every time we pass through...
         // 1) A PCI-to-PCI bridge (real or virtual)
@@ -880,7 +880,7 @@
     // If our upstream is ever null as we climb the tree, then something must
     // have been unplugged as we were climbing.
     if (upstream == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     // We have hit root of the tree.  Something is very wrong if our
     // UpstreamNode is not, in fact, a root.
@@ -891,14 +891,14 @@
                "bridge! (type %u)\n",
                bus_id_, dev_id_, func_id_, irq_.legacy.pin,
                upstream->managed_bus_id(), static_cast<uint>(upstream->type()));
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // TODO(johngro) : Eliminate the null-check of root below.  See the TODO for
     // the downcast of upstream -> bridge above for details.
     auto root = fbl::RefPtr<PcieRoot>::Downcast(fbl::move(upstream));
     if (root == nullptr)
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     return root->Swizzle(dev->dev_id(), dev->func_id(), pin, &irq_.legacy.irq_id);
 }
 
@@ -916,7 +916,7 @@
     irq_.legacy.pin = cfg_->Read(PciConfig::kInterruptPin);
     if (irq_.legacy.pin) {
         status_t res = MapPinToIrqLocked(fbl::RefPtr<PcieUpstreamNode>(&upstream));
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             TRACEF("Failed to map legacy pin to platform IRQ ID for "
                    "dev %02x:%02x.%01x (pin %u)\n",
                    bus_id_, dev_id_, func_id_,
@@ -930,11 +930,11 @@
                    "dev %02x:%02x.%01x (pin %u, irq_id %u)\n",
                    bus_id_, dev_id_, func_id_,
                    irq_.legacy.pin, irq_.legacy.irq_id);
-            return MX_ERR_NO_RESOURCES;
+            return ZX_ERR_NO_RESOURCES;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void PcieBusDriver::ShutdownIrqs() {
diff --git a/kernel/dev/pcie/pcie_upstream_node.cpp b/kernel/dev/pcie/pcie_upstream_node.cpp
index 6a6ff63..64393ca 100644
--- a/kernel/dev/pcie/pcie_upstream_node.cpp
+++ b/kernel/dev/pcie/pcie_upstream_node.cpp
@@ -6,7 +6,7 @@
 // https://opensource.org/licenses/MIT
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 #include <err.h>
 #include <inttypes.h>
@@ -45,7 +45,7 @@
         auto device = GetDownstream(i);
         if (device != nullptr) {
             status_t res = device->AllocateBars();
-            if (res != MX_OK)
+            if (res != ZX_OK)
                 device->Disable();
         }
     }
diff --git a/kernel/dev/pcie/rules.mk b/kernel/dev/pcie/rules.mk
index 83aae2e..d7628ae 100644
--- a/kernel/dev/pcie/rules.mk
+++ b/kernel/dev/pcie/rules.mk
@@ -20,7 +20,7 @@
 	$(LOCAL_DIR)/pcie_upstream_node.cpp
 
 MODULE_DEPS += \
-    kernel/lib/mxcpp \
+    kernel/lib/zxcpp \
     kernel/lib/fbl \
     kernel/lib/pci \
     kernel/lib/region-alloc
diff --git a/kernel/dev/pdev/include/pdev/driver.h b/kernel/dev/pdev/include/pdev/driver.h
index 2c5368c..a71351a 100644
--- a/kernel/dev/pdev/include/pdev/driver.h
+++ b/kernel/dev/pdev/include/pdev/driver.h
@@ -7,8 +7,8 @@
 #pragma once
 
 #include <lk/init.h>
-#include <magenta/compiler.h>
-#include <magenta/mdi.h>
+#include <zircon/compiler.h>
+#include <zircon/mdi.h>
 #include <mdi/mdi.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/dev/pdev/include/pdev/interrupt.h b/kernel/dev/pdev/include/pdev/interrupt.h
index 36f6c3d..f65ac57 100644
--- a/kernel/dev/pdev/include/pdev/interrupt.h
+++ b/kernel/dev/pdev/include/pdev/interrupt.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <dev/interrupt.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/dev/pdev/include/pdev/pdev.h b/kernel/dev/pdev/include/pdev/pdev.h
index ad814c0..913b8a3 100644
--- a/kernel/dev/pdev/include/pdev/pdev.h
+++ b/kernel/dev/pdev/include/pdev/pdev.h
@@ -6,8 +6,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/mdi.h>
+#include <zircon/compiler.h>
+#include <zircon/mdi.h>
 #include <mdi/mdi.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/dev/pdev/include/pdev/uart.h b/kernel/dev/pdev/include/pdev/uart.h
index 6a94c87..6d9c9f3 100644
--- a/kernel/dev/pdev/include/pdev/uart.h
+++ b/kernel/dev/pdev/include/pdev/uart.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <dev/uart.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/dev/pdev/interrupt/interrupt.c b/kernel/dev/pdev/interrupt/interrupt.c
index 8a4f3a4..6df314d 100644
--- a/kernel/dev/pdev/interrupt/interrupt.c
+++ b/kernel/dev/pdev/interrupt/interrupt.c
@@ -40,23 +40,23 @@
 }
 
 static status_t default_mask(unsigned int vector) {
-    return MX_ERR_NOT_CONFIGURED;
+    return ZX_ERR_NOT_CONFIGURED;
 }
 
 static status_t default_unmask(unsigned int vector) {
-    return MX_ERR_NOT_CONFIGURED;
+    return ZX_ERR_NOT_CONFIGURED;
 }
 
 static status_t default_configure(unsigned int vector,
                           enum interrupt_trigger_mode tm,
                           enum interrupt_polarity pol) {
-    return MX_ERR_NOT_CONFIGURED;
+    return ZX_ERR_NOT_CONFIGURED;
 }
 
 static status_t default_get_config(unsigned int vector,
                            enum interrupt_trigger_mode* tm,
                            enum interrupt_polarity* pol) {
-    return MX_ERR_NOT_CONFIGURED;
+    return ZX_ERR_NOT_CONFIGURED;
 }
 
 static bool default_is_valid(unsigned int vector, uint32_t flags) {
@@ -67,7 +67,7 @@
 }
 
 static status_t default_send_ipi(mp_cpu_mask_t target, mp_ipi_t ipi) {
-    return MX_ERR_NOT_CONFIGURED;
+    return ZX_ERR_NOT_CONFIGURED;
 }
 
 static void default_init_percpu_early(void) {
diff --git a/kernel/dev/qemu/qemu_pcie.cpp b/kernel/dev/qemu/qemu_pcie.cpp
index 1a8e506..778b92b 100644
--- a/kernel/dev/qemu/qemu_pcie.cpp
+++ b/kernel/dev/qemu/qemu_pcie.cpp
@@ -71,15 +71,15 @@
             (dev_id  >= PCIE_MAX_DEVICES_PER_BUS) ||
             (func_id >= PCIE_MAX_FUNCTIONS_PER_DEVICE) ||
             (pin     >= PCIE_MAX_LEGACY_IRQ_PINS))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
 
         // TODO(johngro) : Figure out what to do here if QEMU ever starts to
         // create root complexes which manage a bus other than 0.
         if (managed_bus_id() != 0)
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
 
         *irq = PCIE_INT_BASE + ((pin + dev_id) % PCIE_MAX_LEGACY_IRQ_PINS);
-        return MX_OK;
+        return ZX_OK;
     }
 
 private:
@@ -90,15 +90,15 @@
 static void arm_qemu_pcie_init(mdi_node_ref_t* node, uint level) {
     /* Initialize the MSI allocator */
     status_t res = arm_gicv2m_msi_init();
-    if (res != MX_OK)
+    if (res != ZX_OK)
         TRACEF("Failed to initialize MSI allocator (res = %d).  PCI will be "
                "restricted to legacy IRQ mode.\n", res);
 
     /* Initialize the PCI platform suppored based on whether or not we support MSI */
-    static QemuPciePlatformSupport platform_pcie_support(res == MX_OK);
+    static QemuPciePlatformSupport platform_pcie_support(res == ZX_OK);
 
     res = PcieBusDriver::InitializeDriver(platform_pcie_support);
-    if (res == MX_OK) {
+    if (res == ZX_OK) {
         /* Add the QEMU hardcoded ECAM and bus ranges to the bus driver, if we can. */
         auto pcie = PcieBusDriver::GetDriver();
         DEBUG_ASSERT(pcie != nullptr);
@@ -110,7 +110,7 @@
             .bus_end   = static_cast<uint8_t>(PCIE_ECAM_SIZE / PCIE_ECAM_BYTE_PER_BUS) - 1,
         };
         res = pcie->AddEcamRegion(ecam);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             TRACEF("Failed to add ECAM region to PCIe bus driver!\n");
             return;
         }
@@ -118,7 +118,7 @@
         constexpr uint64_t MMIO_BASE = PCIE_MMIO_BASE_PHYS;
         constexpr uint64_t MMIO_SIZE = PCIE_MMIO_SIZE;
         res = pcie->AddBusRegion(MMIO_BASE, MMIO_SIZE, PciAddrSpace::MMIO);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             TRACEF("WARNING - Failed to add initial PCIe MMIO region "
                    "[%" PRIx64 ", %" PRIx64") to bus driver! (res %d)\n",
                    MMIO_BASE, MMIO_BASE + MMIO_SIZE, res);
@@ -128,7 +128,7 @@
         constexpr uint64_t PIO_BASE = PCIE_PIO_BASE_PHYS;
         constexpr uint64_t PIO_SIZE = PCIE_PIO_SIZE;
         res = pcie->AddBusRegion(PIO_BASE, PIO_SIZE, PciAddrSpace::PIO);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             TRACEF("WARNING - Failed to add initial PCIe PIO region "
                    "[%" PRIx64 ", %" PRIx64") to bus driver! (res %d)\n",
                    PIO_BASE, PIO_BASE + PIO_SIZE, res);
@@ -141,12 +141,12 @@
             return;
 
         res = pcie->AddRoot(fbl::move(root));
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             TRACEF("Failed to add PCIe root complex for bus 0! (res %d)\n", res);
             return;
         }
         res = pcie->StartBusDriver();
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             TRACEF("Failed to start PCIe bus driver! (res %d)\n", res);
             return;
         }
diff --git a/kernel/dev/uart/amlogic_s905/uart.c b/kernel/dev/uart/amlogic_s905/uart.c
index 8f94aaa..6b7c47b 100644
--- a/kernel/dev/uart/amlogic_s905/uart.c
+++ b/kernel/dev/uart/amlogic_s905/uart.c
@@ -212,11 +212,11 @@
     mdi_each_child(node, &child) {
         switch (mdi_id(&child)) {
             case MDI_BASE_VIRT:
-                if(mdi_node_uint64(&child, &s905_uart_base) != MX_OK)
+                if(mdi_node_uint64(&child, &s905_uart_base) != ZX_OK)
                     return;
                 break;
             case MDI_IRQ:
-                if(mdi_node_uint32(&child, &s905_uart_irq) != MX_OK)
+                if(mdi_node_uint32(&child, &s905_uart_irq) != ZX_OK)
                     return;
                 break;
 
diff --git a/kernel/dev/udisplay/include/dev/udisplay.h b/kernel/dev/udisplay/include/dev/udisplay.h
index 84c3978..645e9cf 100644
--- a/kernel/dev/udisplay/include/dev/udisplay.h
+++ b/kernel/dev/udisplay/include/dev/udisplay.h
@@ -7,7 +7,7 @@
 #pragma once
 
 #include <dev/display.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <err.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/dev/udisplay/udisplay.cpp b/kernel/dev/udisplay/udisplay.cpp
index 4c1dd6c..7a7dbf0 100644
--- a/kernel/dev/udisplay/udisplay.cpp
+++ b/kernel/dev/udisplay/udisplay.cpp
@@ -52,7 +52,7 @@
 static struct udisplay_info g_udisplay;
 
 status_t udisplay_init(void) {
-    return MX_OK;
+    return ZX_OK;
 }
 
 void dlog_bluescreen_halt(void) {
@@ -114,7 +114,7 @@
     if (result)
         g_udisplay.framebuffer_virt = 0;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t udisplay_set_framebuffer_vmo(fbl::RefPtr<VmObject> vmo) {
@@ -126,28 +126,28 @@
     status_t status = VmAspace::kernel_aspace()->RootVmar()->CreateVmMapping(
             0 /* ignored */, size, 0 /* align pow2 */, 0 /* vmar flags */,
             fbl::move(vmo), 0, kFramebufferArchMmuFlags, "framebuffer_vmo", &mapping);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     status = mapping->MapRange(0, size, true);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         mapping->Destroy();
         return status;
     }
 
     g_udisplay.framebuffer_virt = reinterpret_cast<void*>(mapping->base());
     g_udisplay.framebuffer_size = size;
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t udisplay_set_display_info(struct display_info* display) {
     memcpy(&g_udisplay.info, display, sizeof(struct display_info));
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t udisplay_bind_gfxconsole(void) {
     if (g_udisplay.framebuffer_virt == 0)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     register_print_callback(&qrcode_cb);
 
@@ -156,5 +156,5 @@
     g_udisplay.info.flags = DISPLAY_FLAG_HW_FRAMEBUFFER | DISPLAY_FLAG_CRASH_FRAMEBUFFER;
     gfxconsole_bind_display(&g_udisplay.info, nullptr);
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/include/app.h b/kernel/include/app.h
index 5f5be0e..dd42c9a 100644
--- a/kernel/include/app.h
+++ b/kernel/include/app.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <stddef.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/include/arch.h b/kernel/include/arch.h
index c6e2818..b45c549 100644
--- a/kernel/include/arch.h
+++ b/kernel/include/arch.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/include/arch/debugger.h b/kernel/include/arch/debugger.h
index dc55f89..a4cb568 100644
--- a/kernel/include/arch/debugger.h
+++ b/kernel/include/arch/debugger.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 #include <stdbool.h>
 
diff --git a/kernel/include/arch/exception.h b/kernel/include/arch/exception.h
index eb85ebc..5b84ecd 100644
--- a/kernel/include/arch/exception.h
+++ b/kernel/include/arch/exception.h
@@ -6,13 +6,13 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
 
 typedef struct arch_exception_context arch_exception_context_t;
-typedef struct mx_exception_report mx_exception_report_t;
+typedef struct zx_exception_report zx_exception_report_t;
 
 // Called by arch code when it cannot handle an exception.
 // |context| is architecture-specific, and can be dumped to the console
@@ -33,6 +33,6 @@
 // Sets |report| using architecture-specific information from |context|.
 // Implemented by arch code.
 void arch_fill_in_exception_context(
-    const arch_exception_context_t* context, mx_exception_report_t* report);
+    const arch_exception_context_t* context, zx_exception_report_t* report);
 
 __END_CDECLS
diff --git a/kernel/include/arch/mmu.h b/kernel/include/arch/mmu.h
index 8e770f9..00d4c1a 100644
--- a/kernel/include/arch/mmu.h
+++ b/kernel/include/arch/mmu.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <arch.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 // forward declare the per-address space arch-specific context object
diff --git a/kernel/include/arch/ops.h b/kernel/include/arch/ops.h
index be1b8ea..b61e2eb 100644
--- a/kernel/include/arch/ops.h
+++ b/kernel/include/arch/ops.h
@@ -16,7 +16,7 @@
 
 #include <arch/defines.h>
 #include <kernel/atomic.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
diff --git a/kernel/include/arch/thread.h b/kernel/include/arch/thread.h
index e5f37ac..ec4cb50 100644
--- a/kernel/include/arch/thread.h
+++ b/kernel/include/arch/thread.h
@@ -9,7 +9,7 @@
 
 // give the arch code a chance to declare the arch_thread struct
 #include <arch/arch_thread.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/include/arch/user_copy.h b/kernel/include/arch/user_copy.h
index 22891a5..bd281f2 100644
--- a/kernel/include/arch/user_copy.h
+++ b/kernel/include/arch/user_copy.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <err.h>
 
 __BEGIN_CDECLS
@@ -21,7 +21,7 @@
  * @param src The source buffer.
  * @param len The number of bytes to copy.
  *
- * @return MX_OK on success
+ * @return ZX_OK on success
  */
 status_t arch_copy_from_user(void *dst, const void *src, size_t len);
 
@@ -35,7 +35,7 @@
  * @param src The source buffer.
  * @param len The number of bytes to copy.
  *
- * @return MX_OK on success
+ * @return ZX_OK on success
  */
 status_t arch_copy_to_user(void *dst, const void *src, size_t len);
 
diff --git a/kernel/include/bits.h b/kernel/include/bits.h
index 5d30510..699a80a 100644
--- a/kernel/include/bits.h
+++ b/kernel/include/bits.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <arch/ops.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/include/debug.h b/kernel/include/debug.h
index 51ff614..b603c8b 100644
--- a/kernel/include/debug.h
+++ b/kernel/include/debug.h
@@ -9,7 +9,7 @@
 
 #include <stddef.h>
 #include <stdio.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <platform/debug.h>
 
 #if !defined(LK_DEBUGLEVEL)
diff --git a/kernel/include/dev/display.h b/kernel/include/dev/display.h
index b60cf58..72ce031 100644
--- a/kernel/include/dev/display.h
+++ b/kernel/include/dev/display.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include <stdbool.h>
 #include <sys/types.h>
diff --git a/kernel/include/dev/uart.h b/kernel/include/dev/uart.h
index 943bb9a..e4810ee 100644
--- a/kernel/include/dev/uart.h
+++ b/kernel/include/dev/uart.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <sys/types.h>
 
diff --git a/kernel/include/err.h b/kernel/include/err.h
index b18bd09..b93e551 100644
--- a/kernel/include/err.h
+++ b/kernel/include/err.h
@@ -11,11 +11,11 @@
 #include <sys/types.h> // for status_t
 #endif
 
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 
 // TODO: This is used primarily by class drivers which are obsolete.
 // Re-examine when those are removed.
-#define MX_ERR_NOT_CONFIGURED (-501)
+#define ZX_ERR_NOT_CONFIGURED (-501)
 
 // MOVE to kernel internal used for thread teardown
-#define MX_ERR_INTERNAL_INTR_KILLED (-502)
+#define ZX_ERR_INTERNAL_INTR_KILLED (-502)
diff --git a/kernel/include/kernel/atomic.h b/kernel/include/kernel/atomic.h
index 26f093c..8eb64df 100644
--- a/kernel/include/kernel/atomic.h
+++ b/kernel/include/kernel/atomic.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <stdint.h>
 
diff --git a/kernel/include/kernel/cmdline.h b/kernel/include/kernel/cmdline.h
index 3039c88..ca5ce87 100644
--- a/kernel/include/kernel/cmdline.h
+++ b/kernel/include/kernel/cmdline.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <stdint.h>
 
diff --git a/kernel/include/kernel/event.h b/kernel/include/kernel/event.h
index a68fa65..424dada 100644
--- a/kernel/include/kernel/event.h
+++ b/kernel/include/kernel/event.h
@@ -9,7 +9,7 @@
 
 #include <err.h>
 #include <kernel/thread.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
@@ -55,7 +55,7 @@
 void event_destroy(event_t*);
 
 /* Wait until deadline
- * Interruptable arg allows it to return early with MX_ERR_INTERNAL_INTR_KILLED if thread
+ * Interruptable arg allows it to return early with ZX_ERR_INTERNAL_INTR_KILLED if thread
  * is signaled for kill.
  */
 status_t event_wait_deadline(event_t*, lk_time_t, bool interruptable);
@@ -97,9 +97,9 @@
     Event& operator=(const Event&) = delete;
 
     // Returns:
-    // MX_OK - signaled
-    // MX_ERR_TIMED_OUT - time out expired
-    // MX_ERR_INTERNAL_INTR_KILLED - thread killed
+    // ZX_OK - signaled
+    // ZX_ERR_TIMED_OUT - time out expired
+    // ZX_ERR_INTERNAL_INTR_KILLED - thread killed
     // Or the |status| which the caller specified in Event::Signal(status)
     status_t Wait(lk_time_t deadline) {
         return event_wait_deadline(&event_, deadline, true);
@@ -107,7 +107,7 @@
 
     // Returns number of ready threads. If it is bigger than 0
     // the caller must call thread_reschedule().
-    __WARN_UNUSED_RESULT int Signal(status_t status = MX_OK) {
+    __WARN_UNUSED_RESULT int Signal(status_t status = ZX_OK) {
         return event_signal_etc(&event_, false, status);
     }
 
diff --git a/kernel/include/kernel/mp.h b/kernel/include/kernel/mp.h
index 0fb42756..0f52083 100644
--- a/kernel/include/kernel/mp.h
+++ b/kernel/include/kernel/mp.h
@@ -10,7 +10,7 @@
 #include <kernel/mutex.h>
 #include <kernel/thread.h>
 #include <limits.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <stdint.h>
 
diff --git a/kernel/include/kernel/mutex.h b/kernel/include/kernel/mutex.h
index 02bd125..dec18cc 100644
--- a/kernel/include/kernel/mutex.h
+++ b/kernel/include/kernel/mutex.h
@@ -12,8 +12,8 @@
 #include <debug.h>
 #include <kernel/atomic.h>
 #include <kernel/thread.h>
-#include <magenta/compiler.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/compiler.h>
+#include <zircon/thread_annotations.h>
 #include <stdint.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/include/kernel/percpu.h b/kernel/include/kernel/percpu.h
index a0678d2..e7ef032 100644
--- a/kernel/include/kernel/percpu.h
+++ b/kernel/include/kernel/percpu.h
@@ -10,7 +10,7 @@
 #include <kernel/thread.h>
 #include <kernel/timer.h>
 #include <list.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/include/kernel/spinlock.h b/kernel/include/kernel/spinlock.h
index 401f6fe..bb699ed 100644
--- a/kernel/include/kernel/spinlock.h
+++ b/kernel/include/kernel/spinlock.h
@@ -8,8 +8,8 @@
 #pragma once
 
 #include <arch/spinlock.h>
-#include <magenta/compiler.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/compiler.h>
+#include <zircon/thread_annotations.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/include/kernel/stats.h b/kernel/include/kernel/stats.h
index 9b8904f..752e848 100644
--- a/kernel/include/kernel/stats.h
+++ b/kernel/include/kernel/stats.h
@@ -5,7 +5,7 @@
 // https://opensource.org/licenses/MIT
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/include/kernel/thread.h b/kernel/include/kernel/thread.h
index 3451c01..e45bb48 100644
--- a/kernel/include/kernel/thread.h
+++ b/kernel/include/kernel/thread.h
@@ -14,7 +14,7 @@
 #include <kernel/spinlock.h>
 #include <kernel/wait.h>
 #include <list.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
@@ -66,7 +66,7 @@
 #define THREAD_MAGIC (0x74687264) // 'thrd'
 
 // This includes the trailing NUL.
-// N.B. This must match MX_MAX_NAME_LEN.
+// N.B. This must match ZX_MAX_NAME_LEN.
 #define THREAD_NAME_LENGTH 32
 
 #define THREAD_LINEBUFFER_LENGTH 128
@@ -233,7 +233,7 @@
 }
 
 /* wait until after the specified deadline. interruptable may return early with
- * MX_ERR_INTERNAL_INTR_KILLED if thread is signaled for kill.
+ * ZX_ERR_INTERNAL_INTR_KILLED if thread is signaled for kill.
  */
 status_t thread_sleep_etc(lk_time_t deadline, bool interruptable);
 
diff --git a/kernel/include/kernel/timer.h b/kernel/include/kernel/timer.h
index a7d6561..b94423d 100644
--- a/kernel/include/kernel/timer.h
+++ b/kernel/include/kernel/timer.h
@@ -9,7 +9,7 @@
 
 #include <kernel/spinlock.h>
 #include <list.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
@@ -132,7 +132,7 @@
 
 /* Special helper routine to simultaneously try to acquire a spinlock and check for
  * timer cancel, which is needed in a few special cases.
- * returns MX_OK if spinlock was acquired, MX_ERR_TIMED_OUT if timer was canceled.
+ * returns ZX_OK if spinlock was acquired, ZX_ERR_TIMED_OUT if timer was canceled.
  */
 status_t timer_trylock_or_cancel(timer_t* t, spin_lock_t* lock);
 
diff --git a/kernel/include/kernel/vm.h b/kernel/include/kernel/vm.h
index 128df3f..7c6e3f2 100644
--- a/kernel/include/kernel/vm.h
+++ b/kernel/include/kernel/vm.h
@@ -10,7 +10,7 @@
 #include <arch.h>
 #include <assert.h>
 #include <list.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <sys/types.h>
diff --git a/kernel/include/kernel/wait.h b/kernel/include/kernel/wait.h
index 3971abb..7e2f262 100644
--- a/kernel/include/kernel/wait.h
+++ b/kernel/include/kernel/wait.h
@@ -11,7 +11,7 @@
 #include <arch/ops.h>
 #include <arch/thread.h>
 #include <list.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
@@ -42,7 +42,7 @@
  * block on a wait queue.
  * return status is whatever the caller of wait_queue_wake_*() specifies.
  * a deadline other than INFINITE_TIME will abort at the specified time
- * and return MX_ERR_TIMED_OUT. a deadline in the past will immediately return.
+ * and return ZX_ERR_TIMED_OUT. a deadline in the past will immediately return.
  */
 status_t wait_queue_block(wait_queue_t*, lk_time_t deadline);
 
diff --git a/kernel/include/lib/console.h b/kernel/include/lib/console.h
index 15fc6ed..883ad28 100644
--- a/kernel/include/lib/console.h
+++ b/kernel/include/lib/console.h
@@ -10,7 +10,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <sys/types.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/include/lib/gfxconsole.h b/kernel/include/lib/gfxconsole.h
index 367a6c0..f6c2520 100644
--- a/kernel/include/lib/gfxconsole.h
+++ b/kernel/include/lib/gfxconsole.h
@@ -8,12 +8,12 @@
 #pragma once
 
 #include <lib/gfx.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
-mx_status_t gfxconsole_display_get_info(struct display_info *info);
+zx_status_t gfxconsole_display_get_info(struct display_info *info);
 void gfxconsole_start(gfx_surface *surface, gfx_surface *hw_surface);
 void gfxconsole_bind_display(struct display_info *info, void *raw_sw_fb);
 void gfxconsole_putpixel(unsigned x, unsigned y, unsigned color);
diff --git a/kernel/include/lib/ktrace.h b/kernel/include/lib/ktrace.h
index 33af3dc..7ed95e3 100644
--- a/kernel/include/lib/ktrace.h
+++ b/kernel/include/lib/ktrace.h
@@ -7,8 +7,8 @@
 #pragma once
 
 #include <err.h>
-#include <magenta/compiler.h>
-#include <magenta/ktrace.h>
+#include <zircon/compiler.h>
+#include <zircon/ktrace.h>
 
 __BEGIN_CDECLS
 
@@ -58,11 +58,11 @@
     if ((len == 0) && (off == 0)) {
         return 0;
     } else {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 static inline status_t ktrace_control(uint32_t action, uint32_t options, void* ptr) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 #endif
 
diff --git a/kernel/include/lib/mtrace.h b/kernel/include/lib/mtrace.h
index 2d915d5..d195d54 100644
--- a/kernel/include/lib/mtrace.h
+++ b/kernel/include/lib/mtrace.h
@@ -6,7 +6,7 @@
 
 // N.B. This is ideally temporary. It is used by Intel PT support, and is a
 // stopgap until "resources" can be used to read/write x86 MSRs.
-// "mtrace" == "magenta trace": the idea being to be a generalization of
+// "mtrace" == "zircon trace": the idea being to be a generalization of
 // ktrace. It's all temporary, but there may be other uses before the stopgap
 // is no longer necessary.
 
@@ -14,7 +14,7 @@
 
 #include <err.h>
 #include <lib/user_copy/user_ptr.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 status_t mtrace_control(uint32_t kind, uint32_t action, uint32_t options,
diff --git a/kernel/include/list.h b/kernel/include/list.h
index c7007b7..1e750e7 100644
--- a/kernel/include/list.h
+++ b/kernel/include/list.h
@@ -5,4 +5,4 @@
 // license that can be found in the LICENSE file or at
 // https://opensource.org/licenses/MIT
 
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
diff --git a/kernel/include/lk/init.h b/kernel/include/lk/init.h
index 8ff2aea..38aa7e9 100644
--- a/kernel/include/lk/init.h
+++ b/kernel/include/lk/init.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/include/lk/main.h b/kernel/include/lk/main.h
index 7acd993..3aef7c5 100644
--- a/kernel/include/lk/main.h
+++ b/kernel/include/lk/main.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/include/mexec.h b/kernel/include/mexec.h
index 66d73c1..ebb8b53 100644
--- a/kernel/include/mexec.h
+++ b/kernel/include/mexec.h
@@ -12,8 +12,8 @@
 
 #ifndef ASSEMBLY
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <stddef.h>
 #include <stdint.h>
 
@@ -33,7 +33,7 @@
                                void* new_kernel_addr);
 
 // Appends a section to the end of a given bootdata image.
-mx_status_t bootdata_append_section(uint8_t* bootdata_buf, const size_t buflen,
+zx_status_t bootdata_append_section(uint8_t* bootdata_buf, const size_t buflen,
                                     const uint8_t* section, const uint32_t section_length,
                                     const uint32_t type, const uint32_t extra,
                                     const uint32_t flags);
@@ -41,7 +41,7 @@
 /* Allow the platform to patch the bootdata structure with any platform specific
  * data that might be necessary for the kernel that mexec is chain-loading.
  */
-mx_status_t platform_mexec_patch_bootdata(uint8_t* bootdata, const size_t len);
+zx_status_t platform_mexec_patch_bootdata(uint8_t* bootdata, const size_t len);
 
 /* Ask the platform to mexec into the next kernel.
  */
diff --git a/kernel/include/platform.h b/kernel/include/platform.h
index 1b71ba3..1db5744 100644
--- a/kernel/include/platform.h
+++ b/kernel/include/platform.h
@@ -8,8 +8,8 @@
 #pragma once
 
 #include <sys/types.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/include/platform/debug.h b/kernel/include/platform/debug.h
index be5798e..9e0ec0d 100644
--- a/kernel/include/platform/debug.h
+++ b/kernel/include/platform/debug.h
@@ -10,7 +10,7 @@
 #include <sys/types.h>
 #include <stdbool.h>
 #include <stdarg.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/include/platform/timer.h b/kernel/include/platform/timer.h
index e5144d2..598d266 100644
--- a/kernel/include/platform/timer.h
+++ b/kernel/include/platform/timer.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/include/pow2.h b/kernel/include/pow2.h
index 1858ed8..40f3517 100644
--- a/kernel/include/pow2.h
+++ b/kernel/include/pow2.h
@@ -10,7 +10,7 @@
 #include <sys/types.h>
 #include <stdbool.h>
 #include <stdint.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/include/target.h b/kernel/include/target.h
index cd9469c..2759c57 100644
--- a/kernel/include/target.h
+++ b/kernel/include/target.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/kernel/event.c b/kernel/kernel/event.c
index 440f9a4..ae232c2 100644
--- a/kernel/kernel/event.c
+++ b/kernel/kernel/event.c
@@ -72,13 +72,13 @@
  * @param deadline Deadline to abort at, in ns
  * @param interruptable  Allowed to interrupt if thread is signaled
  *
- * @return  0 on success, MX_ERR_TIMED_OUT on timeout,
+ * @return  0 on success, ZX_ERR_TIMED_OUT on timeout,
  *          other values depending on wait_result value
  *          when event_signal_etc is used.
  */
 status_t event_wait_deadline(event_t* e, lk_time_t deadline, bool interruptable) {
     thread_t* current_thread = get_current_thread();
-    status_t ret = MX_OK;
+    status_t ret = ZX_OK;
 
     DEBUG_ASSERT(e->magic == EVENT_MAGIC);
     DEBUG_ASSERT(!arch_in_int_handler());
@@ -184,7 +184,7 @@
  * @return  Returns the number of threads that have been unblocked.
  */
 int event_signal(event_t* e, bool reschedule) {
-    return event_signal_internal(e, reschedule, MX_OK, false);
+    return event_signal_internal(e, reschedule, ZX_OK, false);
 }
 
 /* same as above, but the thread lock must already be held */
@@ -192,7 +192,7 @@
     DEBUG_ASSERT(arch_ints_disabled());
     DEBUG_ASSERT(spin_lock_held(&thread_lock));
 
-    return event_signal_internal(e, false, MX_OK, true);
+    return event_signal_internal(e, false, ZX_OK, true);
 }
 
 /**
@@ -205,12 +205,12 @@
  *
  * @param e  Event object
  *
- * @return  Returns MX_OK on success.
+ * @return  Returns ZX_OK on success.
  */
 status_t event_unsignal(event_t* e) {
     DEBUG_ASSERT(e->magic == EVENT_MAGIC);
 
     e->signaled = false;
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/kernel/init.c b/kernel/kernel/init.c
index e79d512..9580271 100644
--- a/kernel/kernel/init.c
+++ b/kernel/kernel/init.c
@@ -9,7 +9,7 @@
 #include <kernel/mp.h>
 #include <kernel/thread.h>
 #include <kernel/timer.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 void kernel_init(void);
 
diff --git a/kernel/kernel/mp.c b/kernel/kernel/mp.c
index c00bad3..633861a 100644
--- a/kernel/kernel/mp.c
+++ b/kernel/kernel/mp.c
@@ -149,7 +149,7 @@
 
     /* let CPUs know to begin executing */
     __UNUSED status_t status = arch_mp_send_ipi(MP_IPI_TARGET_MASK, mask, MP_IPI_GENERIC);
-    DEBUG_ASSERT(status == MX_OK);
+    DEBUG_ASSERT(status == ZX_OK);
 
     if (targetting_self) {
         mp_sync_task(&sync_context);
@@ -231,12 +231,12 @@
 status_t mp_hotplug_cpu(uint cpu_id) {
     DEBUG_ASSERT(!arch_ints_disabled());
 
-    status_t status = MX_ERR_INTERNAL;
+    status_t status = ZX_ERR_INTERNAL;
 
     mutex_acquire(&mp.hotplug_lock);
 
     if (mp_is_cpu_online(cpu_id)) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto cleanup_mutex;
     }
 
@@ -254,13 +254,13 @@
     DEBUG_ASSERT(!arch_ints_disabled());
 
     thread_t* t = NULL;
-    status_t status = MX_ERR_INTERNAL;
+    status_t status = ZX_ERR_INTERNAL;
 
     mutex_acquire(&mp.hotplug_lock);
 
     if (!mp_is_cpu_online(cpu_id)) {
         /* Cannot unplug offline CPU */
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto cleanup_mutex;
     }
 
@@ -284,12 +284,12 @@
         NULL, NULL, 4096,
         mp_unplug_trampoline);
     if (t == NULL) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto cleanup_mutex;
     }
 
     status = platform_mp_prep_cpu_unplug(cpu_id);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup_thread;
     }
 
@@ -299,7 +299,7 @@
     thread_set_real_time(t);
 
     status = thread_detach_and_resume(t);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup_thread;
     }
 
@@ -312,7 +312,7 @@
     timer_transition_off_cpu(cpu_id);
 
     status = platform_mp_cpu_unplug(cpu_id);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         /* Do not cleanup the unplug thread in this case.  We have successfully
          * unplugged the CPU from the scheduler's perspective, but the platform
          * may have failed to shut down the CPU */
@@ -376,13 +376,13 @@
 }
 
 __WEAK status_t arch_mp_cpu_hotplug(uint cpu_id) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 __WEAK status_t arch_mp_prep_cpu_unplug(uint cpu_id) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 __WEAK status_t arch_mp_cpu_unplug(uint cpu_id) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 __WEAK status_t platform_mp_cpu_hotplug(uint cpu_id) {
     return arch_mp_cpu_hotplug(cpu_id);
diff --git a/kernel/kernel/mutex.c b/kernel/kernel/mutex.c
index 3eb36a9..024e6b9 100644
--- a/kernel/kernel/mutex.c
+++ b/kernel/kernel/mutex.c
@@ -100,7 +100,7 @@
 
     // we have signalled that we're blocking, so drop into the wait queue
     status_t ret = wait_queue_block(&m->wait, INFINITE_TIME);
-    if (unlikely(ret < MX_OK)) {
+    if (unlikely(ret < ZX_OK)) {
         // mutexes are not interruptable and cannot time out, so it
         // is illegal to return with any error state.
         panic("mutex_acquire: wait_queue_block returns with error %d m %p, thr %p, sp %p\n",
@@ -144,7 +144,7 @@
         spin_lock_irqsave(&thread_lock, state);
 
     // release a thread in the wait queue
-    thread_t* t = wait_queue_dequeue_one(&m->wait, MX_OK);
+    thread_t* t = wait_queue_dequeue_one(&m->wait, ZX_OK);
     DEBUG_ASSERT_MSG(t, "mutex_release: wait queue didn't have anything, but m->val = %#" PRIxPTR "\n", mutex_val(m));
 
     // we woke up a thread, mark the mutex owned by that thread
diff --git a/kernel/kernel/sched.c b/kernel/kernel/sched.c
index ca3a94f..740e54f 100644
--- a/kernel/kernel/sched.c
+++ b/kernel/kernel/sched.c
@@ -16,7 +16,7 @@
 #include <kernel/vm.h>
 #include <lib/ktrace.h>
 #include <list.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <platform.h>
 #include <printf.h>
 #include <string.h>
@@ -351,7 +351,7 @@
 
     /* did this tick complete the time slice? */
     DEBUG_ASSERT(now > current_thread->last_started_running);
-    mx_time_t delta = now - current_thread->last_started_running;
+    zx_time_t delta = now - current_thread->last_started_running;
     if (delta >= current_thread->remaining_time_slice) {
         /* we completed the time slice, do not restart it and let the scheduler run */
         current_thread->remaining_time_slice = 0;
@@ -417,7 +417,7 @@
 
     /* account for time used on the old thread */
     DEBUG_ASSERT(now >= oldthread->last_started_running);
-    mx_time_t old_runtime = now - oldthread->last_started_running;
+    zx_time_t old_runtime = now - oldthread->last_started_running;
     oldthread->runtime_ns += old_runtime;
     oldthread->remaining_time_slice -= MIN(old_runtime, oldthread->remaining_time_slice);
 
@@ -470,7 +470,7 @@
                              cpu, oldthread, oldthread->name, newthread, newthread->name);
 
         /* make sure the time slice is reasonable */
-        DEBUG_ASSERT(newthread->remaining_time_slice > 0 && newthread->remaining_time_slice < MX_SEC(1));
+        DEBUG_ASSERT(newthread->remaining_time_slice > 0 && newthread->remaining_time_slice < ZX_SEC(1));
 
         /* use a special version of the timer set api that lets it reset an existing timer efficiently, given
          * that we cannot possibly race with our own timer because interrupts are disabled.
diff --git a/kernel/kernel/thread.c b/kernel/kernel/thread.c
index 97c0a8c..8346df2 100644
--- a/kernel/kernel/thread.c
+++ b/kernel/kernel/thread.c
@@ -125,7 +125,7 @@
     t->state = THREAD_INITIAL;
     t->signals = 0;
     t->blocking_wait_queue = NULL;
-    t->blocked_status = MX_OK;
+    t->blocked_status = ZX_OK;
     t->interruptable = false;
     thread_set_last_cpu(t, 0);
 
@@ -220,11 +220,11 @@
  *
  * @param t Thread to flag
  *
- * @return MX_OK on success
+ * @return ZX_OK on success
  */
 status_t thread_set_real_time(thread_t* t) {
     if (!t)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     DEBUG_ASSERT(t->magic == THREAD_MAGIC);
 
@@ -236,7 +236,7 @@
     t->flags |= THREAD_FLAG_REAL_TIME;
     THREAD_UNLOCK(state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /**
@@ -248,7 +248,7 @@
  *
  * @param t  Thread to resume
  *
- * @return MX_OK on success.
+ * @return ZX_OK on success.
  */
 status_t thread_resume(thread_t* t) {
     DEBUG_ASSERT(t->magic == THREAD_MAGIC);
@@ -263,7 +263,7 @@
     if (t->state == THREAD_DEATH) {
         THREAD_UNLOCK(state);
         // The thread is dead, resuming it is a no-op.
-        return MX_OK;
+        return ZX_OK;
     }
 
     /* Clear the suspend signal in case there is a pending suspend */
@@ -277,7 +277,7 @@
 
     THREAD_UNLOCK(state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t thread_detach_and_resume(thread_t* t) {
@@ -293,7 +293,7 @@
  *
  * @param t  Thread to suspend
  *
- * @return MX_OK on success.
+ * @return ZX_OK on success.
  */
 status_t thread_suspend(thread_t* t) {
     DEBUG_ASSERT(t->magic == THREAD_MAGIC);
@@ -305,7 +305,7 @@
     case THREAD_INITIAL:
     case THREAD_DEATH:
         THREAD_UNLOCK(state);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     case THREAD_READY:
         /* thread is ready to run and not blocked or suspended.
              * will wake up and deal with the signal soon. */
@@ -323,12 +323,12 @@
     case THREAD_BLOCKED:
         /* thread is blocked on something and marked interruptable */
         if (t->interruptable)
-            thread_unblock_from_wait_queue(t, MX_ERR_INTERNAL_INTR_RETRY);
+            thread_unblock_from_wait_queue(t, ZX_ERR_INTERNAL_INTR_RETRY);
         break;
     case THREAD_SLEEPING:
         /* thread is sleeping */
         if (t->interruptable) {
-            t->blocked_status = MX_ERR_INTERNAL_INTR_RETRY;
+            t->blocked_status = ZX_ERR_INTERNAL_INTR_RETRY;
 
             sched_unblock(t);
         }
@@ -339,7 +339,7 @@
 
     THREAD_UNLOCK(state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* Signal an exception on the current thread, to be handled when the
@@ -363,7 +363,7 @@
     if (t->flags & THREAD_FLAG_DETACHED) {
         /* the thread is detached, go ahead and exit */
         THREAD_UNLOCK(state);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     /* wait for the thread to die */
@@ -394,7 +394,7 @@
 
     free_thread_resources(t);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t thread_detach(thread_t* t) {
@@ -404,7 +404,7 @@
 
     /* if another thread is blocked inside thread_join() on this thread,
      * wake them up with a specific return code */
-    wait_queue_wake_all(&t->retcode_wait_queue, false, MX_ERR_BAD_STATE);
+    wait_queue_wake_all(&t->retcode_wait_queue, false, ZX_ERR_BAD_STATE);
 
     /* if it's already dead, then just do what join would have and exit */
     if (t->state == THREAD_DEATH) {
@@ -414,7 +414,7 @@
     } else {
         t->flags |= THREAD_FLAG_DETACHED;
         THREAD_UNLOCK(state);
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
@@ -567,12 +567,12 @@
     case THREAD_BLOCKED:
         /* thread is blocked on something and marked interruptable */
         if (t->interruptable)
-            thread_unblock_from_wait_queue(t, MX_ERR_INTERNAL_INTR_KILLED);
+            thread_unblock_from_wait_queue(t, ZX_ERR_INTERNAL_INTR_KILLED);
         break;
     case THREAD_SLEEPING:
         /* thread is sleeping */
         if (t->interruptable) {
-            t->blocked_status = MX_ERR_INTERNAL_INTR_KILLED;
+            t->blocked_status = ZX_ERR_INTERNAL_INTR_KILLED;
 
             sched_unblock(t);
         }
@@ -630,7 +630,7 @@
         // Note: After calling this callback, we must not return without
         // calling the callback with THREAD_USER_STATE_RESUME.  That is
         // because those callbacks act as barriers which control when it is
-        // safe for the mx_thread_read_state()/mx_thread_write_state()
+        // safe for the zx_thread_read_state()/zx_thread_write_state()
         // syscalls to access the userland register state kept by thread_t.
         current_thread->user_callback(THREAD_USER_STATE_SUSPEND, current_thread->user_thread);
     }
@@ -678,8 +678,8 @@
     if (current_thread->signals & THREAD_SIGNAL_POLICY_EXCEPTION) {
         current_thread->signals &= ~THREAD_SIGNAL_POLICY_EXCEPTION;
         THREAD_UNLOCK(state);
-        mx_status_t status = arch_dispatch_user_policy_exception();
-        if (status != MX_OK) {
+        zx_status_t status = arch_dispatch_user_policy_exception();
+        if (status != ZX_OK) {
             panic("arch_dispatch_user_policy_exception() failed: status=%d\n",
                   status);
         }
@@ -790,7 +790,7 @@
         return INT_NO_RESCHEDULE;
     }
 
-    t->blocked_status = MX_OK;
+    t->blocked_status = ZX_OK;
 
     sched_unblock(t);
 
@@ -842,9 +842,9 @@
     /* if we've been killed and going in interruptable, abort here */
     if (interruptable && unlikely((current_thread->signals))) {
         if (current_thread->signals & THREAD_SIGNAL_KILL) {
-            blocked_status = MX_ERR_INTERNAL_INTR_KILLED;
+            blocked_status = ZX_ERR_INTERNAL_INTR_KILLED;
         } else {
-            blocked_status = MX_ERR_INTERNAL_INTR_RETRY;
+            blocked_status = ZX_ERR_INTERNAL_INTR_RETRY;
         }
         goto out;
     }
@@ -854,7 +854,7 @@
     timer_set(&timer, deadline, TIMER_SLACK_LATE, slack, thread_sleep_handler, current_thread);
 
     current_thread->state = THREAD_SLEEPING;
-    current_thread->blocked_status = MX_OK;
+    current_thread->blocked_status = ZX_OK;
 
     current_thread->interruptable = interruptable;
     sched_block();
@@ -1210,7 +1210,7 @@
         return INT_NO_RESCHEDULE;
 
     enum handler_return ret = INT_NO_RESCHEDULE;
-    if (thread_unblock_from_wait_queue(thread, MX_ERR_TIMED_OUT) >= MX_OK) {
+    if (thread_unblock_from_wait_queue(thread, ZX_ERR_TIMED_OUT) >= ZX_OK) {
         ret = INT_RESCHEDULE;
     }
 
@@ -1230,11 +1230,11 @@
  * @param  deadline The time at which to abort the wait
  *
  * If the deadline is zero, this function returns immediately with
- * MX_ERR_TIMED_OUT.  If the deadline is INFINITE_TIME, this function
+ * ZX_ERR_TIMED_OUT.  If the deadline is INFINITE_TIME, this function
  * waits indefinitely.  Otherwise, this function returns with
- * MX_ERR_TIMED_OUT when the deadline occurs.
+ * ZX_ERR_TIMED_OUT when the deadline occurs.
  *
- * @return MX_ERR_TIMED_OUT on timeout, else returns the return
+ * @return ZX_ERR_TIMED_OUT on timeout, else returns the return
  * value specified when the queue was woken by wait_queue_wake_one().
  */
 status_t wait_queue_block(wait_queue_t* wait, lk_time_t deadline) {
@@ -1248,13 +1248,13 @@
     DEBUG_ASSERT(spin_lock_held(&thread_lock));
 
     if (deadline <= current_time())
-        return MX_ERR_TIMED_OUT;
+        return ZX_ERR_TIMED_OUT;
 
     if (current_thread->interruptable && unlikely(current_thread->signals)) {
         if (current_thread->signals & THREAD_SIGNAL_KILL) {
-            return MX_ERR_INTERNAL_INTR_KILLED;
+            return ZX_ERR_INTERNAL_INTR_KILLED;
         } else if (current_thread->signals & THREAD_SIGNAL_SUSPEND) {
-            return MX_ERR_INTERNAL_INTR_RETRY;
+            return ZX_ERR_INTERNAL_INTR_RETRY;
         }
     }
 
@@ -1262,7 +1262,7 @@
     wait->count++;
     current_thread->state = THREAD_BLOCKED;
     current_thread->blocking_wait_queue = wait;
-    current_thread->blocked_status = MX_OK;
+    current_thread->blocked_status = ZX_OK;
 
     /* if the deadline is nonzero or noninfinite, set a callback to yank us out of the queue */
     if (deadline != INFINITE_TIME) {
@@ -1424,7 +1424,7 @@
  * @param wait_queue_error  The return value which the new thread will receive
  *   from wait_queue_block().
  *
- * @return MX_ERR_BAD_STATE if thread was not in any wait queue.
+ * @return ZX_ERR_BAD_STATE if thread was not in any wait queue.
  */
 status_t thread_unblock_from_wait_queue(thread_t* t, status_t wait_queue_error) {
     DEBUG_ASSERT(t->magic == THREAD_MAGIC);
@@ -1432,7 +1432,7 @@
     DEBUG_ASSERT(spin_lock_held(&thread_lock));
 
     if (t->state != THREAD_BLOCKED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     DEBUG_ASSERT(t->blocking_wait_queue != NULL);
     DEBUG_ASSERT(t->blocking_wait_queue->magic == WAIT_QUEUE_MAGIC);
@@ -1445,7 +1445,7 @@
 
     sched_unblock(t);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 #if WITH_PANIC_BACKTRACE
@@ -1453,10 +1453,10 @@
     if (!is_kernel_address((uintptr_t)ptr) ||
         (ptr < t->stack) ||
         (ptr > (t->stack + t->stack_size - sizeof(void*)))) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     memcpy(out, ptr, sz);
-    return MX_OK;
+    return ZX_OK;
 }
 
 int thread_get_backtrace(thread_t* t, void* fp, thread_backtrace_t* tb) {
diff --git a/kernel/kernel/timer.c b/kernel/kernel/timer.c
index 98c46fb..8355768 100644
--- a/kernel/kernel/timer.c
+++ b/kernel/kernel/timer.c
@@ -431,13 +431,13 @@
         /* we failed to grab it, check for cancel */
         if (t->cancel) {
             /* we were canceled, so bail immediately */
-            return MX_ERR_TIMED_OUT;
+            return ZX_ERR_TIMED_OUT;
         }
         /* tell the arch to wait */
         arch_spinloop_pause();
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void timer_transition_off_cpu(uint old_cpu) {
@@ -527,7 +527,7 @@
     // timer spinlock
     char* buf = malloc(timer_buffer_size);
     if (!buf)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     dump_timer_queues(buf, timer_buffer_size);
 
diff --git a/kernel/lib/cbuf/include/lib/cbuf.h b/kernel/lib/cbuf/include/lib/cbuf.h
index 2c29f36..332e8af 100644
--- a/kernel/lib/cbuf/include/lib/cbuf.h
+++ b/kernel/lib/cbuf/include/lib/cbuf.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 #include <kernel/event.h>
 #include <kernel/spinlock.h>
diff --git a/kernel/lib/console/console.c b/kernel/lib/console/console.c
index 80122d5..de636c9 100644
--- a/kernel/lib/console/console.c
+++ b/kernel/lib/console/console.c
@@ -8,8 +8,8 @@
 #include <debug.h>
 #include <trace.h>
 #include <assert.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <err.h>
 #include <string.h>
 #include <ctype.h>
@@ -557,7 +557,7 @@
 }
 
 
-static mx_status_t command_loop(int (*get_line)(const char **, void *),
+static zx_status_t command_loop(int (*get_line)(const char **, void *),
                                 void *get_line_cookie, bool showprompt,
                                 bool locked) TA_NO_THREAD_SAFETY_ANALYSIS
 {
@@ -659,7 +659,7 @@
 
     free(outbuf);
     free(args);
-    return MX_OK;
+    return ZX_OK;
 
 no_mem_error:
     if (outbuf)
@@ -669,7 +669,7 @@
         free(args);
 
     dprintf(INFO, "%s: not enough memory\n", __func__);
-    return MX_ERR_NO_MEMORY;
+    return ZX_ERR_NO_MEMORY;
 }
 
 void console_abort_script(void)
@@ -684,7 +684,7 @@
     dprintf(INFO, "entering main console loop\n");
 
 
-    while (command_loop(&read_debug_line, NULL, true, false) == MX_OK)
+    while (command_loop(&read_debug_line, NULL, true, false) == ZX_OK)
         ;
 
     dprintf(INFO, "exiting main console loop\n");
@@ -801,7 +801,7 @@
 {
     if (argc > 1)
         echo = argv[1].b;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void panic_putc(char c) {
diff --git a/kernel/lib/crypto/entropy/collector.cpp b/kernel/lib/crypto/entropy/collector.cpp
index 4ffcb69..8fffeef 100644
--- a/kernel/lib/crypto/entropy/collector.cpp
+++ b/kernel/lib/crypto/entropy/collector.cpp
@@ -13,7 +13,7 @@
 namespace entropy {
 
 Collector::Collector(const char* name, size_t entropy_per_1000_bytes)
-    : name_(name, strnlen(name, MX_MAX_NAME_LEN)),
+    : name_(name, strnlen(name, ZX_MAX_NAME_LEN)),
       entropy_per_1000_bytes_(entropy_per_1000_bytes) {
     DEBUG_ASSERT(entropy_per_1000_bytes_ > 0);
     DEBUG_ASSERT(entropy_per_1000_bytes_ <= 8000);
diff --git a/kernel/lib/crypto/entropy/hw_rng_collector.cpp b/kernel/lib/crypto/entropy/hw_rng_collector.cpp
index da1f100..7b46690 100644
--- a/kernel/lib/crypto/entropy/hw_rng_collector.cpp
+++ b/kernel/lib/crypto/entropy/hw_rng_collector.cpp
@@ -7,20 +7,20 @@
 #include <lib/crypto/entropy/hw_rng_collector.h>
 
 #include <dev/hw_rng.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 
 namespace crypto {
 
 namespace entropy {
 
-mx_status_t HwRngCollector::GetInstance(Collector** ptr) {
+zx_status_t HwRngCollector::GetInstance(Collector** ptr) {
 #if ARCH_X86_64
     static HwRngCollector instance;
     *ptr = &instance;
-    return MX_OK;
+    return ZX_OK;
 #else
     *ptr = nullptr;
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif
 }
 
diff --git a/kernel/lib/crypto/entropy/jitterentropy_collector.cpp b/kernel/lib/crypto/entropy/jitterentropy_collector.cpp
index 5bea4da..bb8d716 100644
--- a/kernel/lib/crypto/entropy/jitterentropy_collector.cpp
+++ b/kernel/lib/crypto/entropy/jitterentropy_collector.cpp
@@ -7,7 +7,7 @@
 #include <lib/crypto/entropy/jitterentropy_collector.h>
 
 #include <kernel/cmdline.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 #include <fbl/atomic.h>
 
 #ifndef JITTERENTROPY_MEM_SIZE
@@ -21,7 +21,7 @@
 
 namespace entropy {
 
-mx_status_t JitterentropyCollector::GetInstance(Collector** ptr) {
+zx_status_t JitterentropyCollector::GetInstance(Collector** ptr) {
     static JitterentropyCollector* instance = nullptr;
     // Note: this would be fbl::atomic<bool>, except that fbl doesn't support
     // that specialization.
@@ -55,10 +55,10 @@
 
     if (instance) {
         *ptr = instance;
-        return MX_OK;
+        return ZX_OK;
     } else {
         *ptr = nullptr;
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
diff --git a/kernel/lib/crypto/entropy/quality_test.cpp b/kernel/lib/crypto/entropy/quality_test.cpp
index dd8c1fa..949c37c 100644
--- a/kernel/lib/crypto/entropy/quality_test.cpp
+++ b/kernel/lib/crypto/entropy/quality_test.cpp
@@ -13,7 +13,7 @@
 #include <lib/crypto/entropy/hw_rng_collector.h>
 #include <lib/crypto/entropy/jitterentropy_collector.h>
 #include <lk/init.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <string.h>
 
 namespace crypto {
@@ -33,14 +33,14 @@
 
 static void SetupEntropyVmo(uint level) {
     if (VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, sizeof(entropy_buf),
-                              &entropy_vmo) != MX_OK) {
+                              &entropy_vmo) != ZX_OK) {
         printf("entropy-record: Failed to create entropy_vmo (data lost)\n");
         entropy_was_lost = true;
         return;
     }
     size_t actual;
     if (entropy_vmo->Write(entropy_buf, 0, sizeof(entropy_buf), &actual)
-            != MX_OK) {
+            != ZX_OK) {
         printf("entropy-record: Failed to write to entropy_vmo (data lost)\n");
         entropy_was_lost = true;
         return;
@@ -51,7 +51,7 @@
         return;
     }
     constexpr const char *name = "debug/entropy.bin";
-    if (entropy_vmo->set_name(name, strlen(name)) != MX_OK) {
+    if (entropy_vmo->set_name(name, strlen(name)) != ZX_OK) {
         // The name is needed because devmgr uses it to add the VMO as a file in
         // the /boot filesystem.
         printf("entropy-record: could not name entropy_vmo (data lost)\n");
@@ -69,19 +69,19 @@
 
     entropy::Collector* collector = nullptr;
     entropy::Collector* candidate;
-    char candidate_name[MX_MAX_NAME_LEN];
+    char candidate_name[ZX_MAX_NAME_LEN];
 
     // TODO(andrewkrieger): find a nicer way to enumerate all entropy collectors
-    if (HwRngCollector::GetInstance(&candidate) == MX_OK) {
+    if (HwRngCollector::GetInstance(&candidate) == ZX_OK) {
         candidate->get_name(candidate_name, sizeof(candidate_name));
-        if (strncmp(candidate_name, src_name, MX_MAX_NAME_LEN) == 0) {
+        if (strncmp(candidate_name, src_name, ZX_MAX_NAME_LEN) == 0) {
             collector = candidate;
         }
     }
     if (!collector &&
-        JitterentropyCollector::GetInstance(&candidate) == MX_OK) {
+        JitterentropyCollector::GetInstance(&candidate) == ZX_OK) {
         candidate->get_name(candidate_name, sizeof(candidate_name));
-        if (strncmp(candidate_name, src_name, MX_MAX_NAME_LEN) == 0) {
+        if (strncmp(candidate_name, src_name, ZX_MAX_NAME_LEN) == 0) {
             collector = candidate;
         }
     }
diff --git a/kernel/lib/crypto/global_prng.cpp b/kernel/lib/crypto/global_prng.cpp
index 93e8626..2c0922a 100644
--- a/kernel/lib/crypto/global_prng.cpp
+++ b/kernel/lib/crypto/global_prng.cpp
@@ -20,7 +20,7 @@
 #include <lib/crypto/entropy/hw_rng_collector.h>
 #include <lib/crypto/entropy/quality_test.h>
 #include <lib/crypto/prng.h>
-#include <mxcpp/new.h>
+#include <zxcpp/new.h>
 #include <lk/init.h>
 #include <string.h>
 #include <trace.h>
@@ -86,7 +86,7 @@
     size_t remaining = collector->BytesNeeded(8 * PRNG::kMinEntropy);
 #if LOCAL_TRACE
     {
-        char name[MX_MAX_NAME_LEN];
+        char name[ZX_MAX_NAME_LEN];
         collector->get_name(name, sizeof(name));
         LTRACEF("About to collect %zu bytes of entropy from '%s'.\n",
                 remaining, name);
@@ -133,11 +133,11 @@
 
     unsigned int successful = 0; // number of successful entropy sources
     entropy::Collector* collector;
-    if (entropy::HwRngCollector::GetInstance(&collector) == MX_OK &&
+    if (entropy::HwRngCollector::GetInstance(&collector) == ZX_OK &&
         SeedFrom(collector)) {
         successful++;
     }
-    if (entropy::JitterentropyCollector::GetInstance(&collector) == MX_OK &&
+    if (entropy::JitterentropyCollector::GetInstance(&collector) == ZX_OK &&
         SeedFrom(collector)) {
         successful++;
     }
diff --git a/kernel/lib/crypto/include/lib/crypto/entropy/collector.h b/kernel/lib/crypto/include/lib/crypto/entropy/collector.h
index 3239020..53f884d 100644
--- a/kernel/lib/crypto/include/lib/crypto/entropy/collector.h
+++ b/kernel/lib/crypto/include/lib/crypto/entropy/collector.h
@@ -51,7 +51,7 @@
 private:
     DISALLOW_COPY_ASSIGN_AND_MOVE(Collector);
 
-    fbl::Name<MX_MAX_NAME_LEN> name_;
+    fbl::Name<ZX_MAX_NAME_LEN> name_;
 
     size_t entropy_per_1000_bytes_;
 };
diff --git a/kernel/lib/crypto/include/lib/crypto/entropy/hw_rng_collector.h b/kernel/lib/crypto/include/lib/crypto/entropy/hw_rng_collector.h
index 51f57f3..d9c55537 100644
--- a/kernel/lib/crypto/include/lib/crypto/entropy/hw_rng_collector.h
+++ b/kernel/lib/crypto/include/lib/crypto/entropy/hw_rng_collector.h
@@ -7,7 +7,7 @@
 #pragma once
 
 #include <lib/crypto/entropy/collector.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/mutex.h>
 
 namespace crypto {
@@ -18,12 +18,12 @@
 // as its entropy source. Currently, this is only supported on x86.
 class HwRngCollector : public Collector {
 public:
-    // Gets the current HwRngCollector instance. Returns MX_ERR_NOT_SUPPORTED if
+    // Gets the current HwRngCollector instance. Returns ZX_ERR_NOT_SUPPORTED if
     // hw_rng_draw_entropy is not supported.
     //
     // This function is thread-safe, and the DrawEntropy() method of the global
     // HwRngCollector instance is also thread-safe.
-    static mx_status_t GetInstance(Collector** ptr);
+    static zx_status_t GetInstance(Collector** ptr);
 
     // Inherited from crypto::entropy::Collector; see comments there.
     //
diff --git a/kernel/lib/crypto/include/lib/crypto/entropy/jitterentropy_collector.h b/kernel/lib/crypto/include/lib/crypto/entropy/jitterentropy_collector.h
index 24a3d2e..2f97aac 100644
--- a/kernel/lib/crypto/include/lib/crypto/entropy/jitterentropy_collector.h
+++ b/kernel/lib/crypto/include/lib/crypto/entropy/jitterentropy_collector.h
@@ -8,7 +8,7 @@
 
 #include <lib/crypto/entropy/collector.h>
 #include <lib/jitterentropy/jitterentropy.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/mutex.h>
 
 namespace crypto {
@@ -19,12 +19,12 @@
 // its entropy source. Ultimately, the entropy is derived from variations in
 // CPU timing, when various code blocks are exercised.
 //
-// TODO(andrewkrieger): Document jitterentropy better for Magenta, then link to
+// TODO(andrewkrieger): Document jitterentropy better for Zircon, then link to
 // that documentation here.
 class JitterentropyCollector : public Collector {
 public:
     // Gets the global JitterentropyCollector instance. Returns
-    // MX_ERR_NOT_SUPPORTED if jitterentropy is not supported (usually because
+    // ZX_ERR_NOT_SUPPORTED if jitterentropy is not supported (usually because
     // the system clock is not available or not suitable).
     //
     // This function must be called once in a single-threaded context to
@@ -34,7 +34,7 @@
     // threads. The JitterentropyCollector::DrawEntropy method is internally
     // guarded by a mutex, so it's safe to call from multiple threads but it may
     // block.
-    static mx_status_t GetInstance(Collector** ptr);
+    static zx_status_t GetInstance(Collector** ptr);
 
     // Inherited from Collector; see comments there.
     //
diff --git a/kernel/lib/crypto/prng.cpp b/kernel/lib/crypto/prng.cpp
index 74dc552..953e13c 100644
--- a/kernel/lib/crypto/prng.cpp
+++ b/kernel/lib/crypto/prng.cpp
@@ -11,8 +11,8 @@
 
 #include <err.h>
 #include <lib/crypto/cryptolib.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <fbl/auto_lock.h>
 #include <openssl/chacha.h>
 #include <pow2.h>
@@ -69,8 +69,8 @@
         fbl::AutoLock guard(&lock_);
         if (unlikely(total_entropy_added_ < kMinEntropy)) {
             lock_.Release();
-            mx_status_t status = event_wait(&ready_);
-            ASSERT(status == MX_OK);
+            zx_status_t status = event_wait(&ready_);
+            ASSERT(status == ZX_OK);
             lock_.Acquire();
         }
         DrawInternal(out, size);
diff --git a/kernel/lib/debuglog/debuglog.c b/kernel/lib/debuglog/debuglog.c
index cbc9abd..51708d4 100644
--- a/kernel/lib/debuglog/debuglog.c
+++ b/kernel/lib/debuglog/debuglog.c
@@ -65,15 +65,15 @@
 
 #define ALIGN4(n) (((n) + 3) & (~3))
 
-mx_status_t dlog_write(uint32_t flags, const void* ptr, size_t len) {
+zx_status_t dlog_write(uint32_t flags, const void* ptr, size_t len) {
     dlog_t* log = &DLOG;
 
     if (len > DLOG_MAX_DATA) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
 
     if (log->panic) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // Our size "on the wire" must be a multiple of 4, so we know
@@ -139,19 +139,19 @@
 
     spin_unlock_irqrestore(&log->lock, state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // TODO: support reading multiple messages at a time
 // TODO: filter with flags
-mx_status_t dlog_read(dlog_reader_t* rdr, uint32_t flags, void* ptr, size_t len, size_t* _actual) {
+zx_status_t dlog_read(dlog_reader_t* rdr, uint32_t flags, void* ptr, size_t len, size_t* _actual) {
     // must be room for worst-case read
     if (len < DLOG_MAX_RECORD) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
 
     dlog_t* log = rdr->log;
-    mx_status_t status = MX_ERR_SHOULD_WAIT;
+    zx_status_t status = ZX_ERR_SHOULD_WAIT;
 
     spin_lock_saved_state_t state;
     spin_lock_irqsave(&log->lock, state);
@@ -181,7 +181,7 @@
         }
 
         *_actual = actual;
-        status = MX_OK;
+        status = ZX_OK;
 
         rtail += DLOG_HDR_GET_FIFOLEN(header);
     }
@@ -248,7 +248,7 @@
         }
         mutex_release(&log->readers_lock);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 
@@ -279,7 +279,7 @@
 
         // dump records to kernel console
         size_t actual;
-        while (dlog_read(&reader, 0, &rec, DLOG_MAX_RECORD, &actual) == MX_OK) {
+        while (dlog_read(&reader, 0, &rec, DLOG_MAX_RECORD, &actual) == ZX_OK) {
             if (rec.hdr.datalen && (rec.data[rec.hdr.datalen - 1] == '\n')) {
                 rec.data[rec.hdr.datalen - 1] = 0;
             } else {
@@ -311,14 +311,14 @@
 
     // replay debug log?
 
-    dprintf(INFO, "\nMAGENTA KERNEL PANIC\n\nUPTIME: %" PRIu64 "ms\n",
+    dprintf(INFO, "\nZIRCON KERNEL PANIC\n\nUPTIME: %" PRIu64 "ms\n",
             current_time() / LK_MSEC(1));
     dprintf(INFO, "BUILDID %s\n\n", version.buildid);
 
     // Log the ELF build ID in the format the symbolizer scripts understand.
     if (version.elf_build_id[0] != '\0') {
         vaddr_t base = KERNEL_BASE + KERNEL_LOAD_OFFSET;
-        dprintf(INFO, "dso: id=%s base=%#lx name=magenta.elf\n",
+        dprintf(INFO, "dso: id=%s base=%#lx name=zircon.elf\n",
                 version.elf_build_id, base);
     }
 }
diff --git a/kernel/lib/debuglog/include/lib/debuglog.h b/kernel/lib/debuglog/include/lib/debuglog.h
index 76ba75e..57a3ba8 100644
--- a/kernel/lib/debuglog/include/lib/debuglog.h
+++ b/kernel/lib/debuglog/include/lib/debuglog.h
@@ -6,8 +6,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <kernel/event.h>
 #include <kernel/mutex.h>
 #include <list.h>
@@ -75,8 +75,8 @@
 
 void dlog_reader_init(dlog_reader_t* rdr, void (*notify)(void*), void* cookie);
 void dlog_reader_destroy(dlog_reader_t* rdr);
-mx_status_t dlog_write(uint32_t flags, const void* ptr, size_t len);
-mx_status_t dlog_read(dlog_reader_t* rdr, uint32_t flags, void* ptr, size_t len, size_t* actual);
+zx_status_t dlog_write(uint32_t flags, const void* ptr, size_t len);
+zx_status_t dlog_read(dlog_reader_t* rdr, uint32_t flags, void* ptr, size_t len, size_t* actual);
 
 // bluescreen_init should be called at the "start" of a fatal fault or
 // panic to ensure that the fault output (via kernel printf/dprintf)
diff --git a/kernel/lib/dpc/dpc.c b/kernel/lib/dpc/dpc.c
index 33fa580..70002fc 100644
--- a/kernel/lib/dpc/dpc.c
+++ b/kernel/lib/dpc/dpc.c
@@ -19,13 +19,13 @@
 static struct list_node dpc_list = LIST_INITIAL_VALUE(dpc_list);
 static event_t dpc_event = EVENT_INITIAL_VALUE(dpc_event, false, 0);
 
-mx_status_t dpc_queue(dpc_t *dpc, bool reschedule)
+zx_status_t dpc_queue(dpc_t *dpc, bool reschedule)
 {
     DEBUG_ASSERT(dpc);
     DEBUG_ASSERT(dpc->func);
 
     if (list_in_list(&dpc->node))
-        return MX_OK;
+        return ZX_OK;
 
     spin_lock_saved_state_t state;
     spin_lock_irqsave(&dpc_lock, state);
@@ -40,16 +40,16 @@
     if (reschedule)
         thread_reschedule();
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t dpc_queue_thread_locked(dpc_t *dpc)
+zx_status_t dpc_queue_thread_locked(dpc_t *dpc)
 {
     DEBUG_ASSERT(dpc);
     DEBUG_ASSERT(dpc->func);
 
     if (list_in_list(&dpc->node))
-        return MX_OK;
+        return ZX_OK;
 
     spin_lock_saved_state_t state;
     spin_lock_irqsave(&dpc_lock, state);
@@ -60,7 +60,7 @@
 
     spin_unlock_irqrestore(&dpc_lock, state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool dpc_cancel(dpc_t *dpc)
@@ -85,8 +85,8 @@
 {
     for (;;) {
         // wait for a dpc to fire
-        __UNUSED mx_status_t err = event_wait(&dpc_event);
-        DEBUG_ASSERT(err == MX_OK);
+        __UNUSED zx_status_t err = event_wait(&dpc_event);
+        DEBUG_ASSERT(err == ZX_OK);
 
         spin_lock_saved_state_t state;
         spin_lock_irqsave(&dpc_lock, state);
diff --git a/kernel/lib/dpc/include/lib/dpc.h b/kernel/lib/dpc/include/lib/dpc.h
index c062f77..cec1ecb 100644
--- a/kernel/lib/dpc/include/lib/dpc.h
+++ b/kernel/lib/dpc/include/lib/dpc.h
@@ -5,8 +5,8 @@
 // https://opensource.org/licenses/MIT
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <list.h>
 #include <sys/types.h>
 
@@ -33,11 +33,11 @@
 
 /* queue an already filled out dpc, optionally reschedule immediately to run the dpc thread */
 /* the deferred procedure runs in a dedicated thread that runs at DPC_THREAD_PRIORITY */
-mx_status_t dpc_queue(dpc_t *dpc, bool reschedule);
+zx_status_t dpc_queue(dpc_t *dpc, bool reschedule);
 
 /* queue a dpc, but must be holding the thread lock */
 /* does not force a reschedule */
-mx_status_t dpc_queue_thread_locked(dpc_t *dpc);
+zx_status_t dpc_queue_thread_locked(dpc_t *dpc);
 
 /* Cancels a previously queued dpc. Returns true if the the dpc was canceled */
 /* before it was scheduled to run. */
diff --git a/kernel/lib/fbl/arena.cpp b/kernel/lib/fbl/arena.cpp
index c83c06e..4c967f2 100644
--- a/kernel/lib/fbl/arena.cpp
+++ b/kernel/lib/fbl/arena.cpp
@@ -15,7 +15,7 @@
 #include <kernel/vm.h>
 #include <vm/vm_aspace.h>
 #include <vm/vm_object_paged.h>
-#include <mxcpp/new.h>
+#include <zxcpp/new.h>
 #include <fbl/auto_call.h>
 
 #define LOCAL_TRACE 0
@@ -33,11 +33,11 @@
     }
 }
 
-mx_status_t Arena::Init(const char* name, size_t ob_size, size_t count) {
+zx_status_t Arena::Init(const char* name, size_t ob_size, size_t count) {
     if ((ob_size == 0) || (ob_size > PAGE_SIZE))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (!count)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     LTRACEF("Arena '%s': ob_size %zu, count %zu\n", name, ob_size, count);
 
     // Carve out the memory:
@@ -55,8 +55,8 @@
 
     // Create the VMO.
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, vmo_sz, &vmo);
-    if (status != MX_OK) {
+    zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, vmo_sz, &vmo);
+    if (status != ZX_OK) {
         LTRACEF("Arena '%s': can't create %zu-byte VMO\n", name, vmo_sz);
         return status;
     }
@@ -72,17 +72,17 @@
 
     // Create the VMAR.
     fbl::RefPtr<VmAddressRegion> vmar;
-    mx_status_t st = root_vmar->CreateSubVmar(0, // offset (ignored)
+    zx_status_t st = root_vmar->CreateSubVmar(0, // offset (ignored)
                                               vmar_sz,
                                               false, // align_pow2
                                               VMAR_FLAG_CAN_MAP_READ |
                                                   VMAR_FLAG_CAN_MAP_WRITE |
                                                   VMAR_FLAG_CAN_MAP_SPECIFIC,
                                               vname, &vmar);
-    if (st != MX_OK || vmar == nullptr) {
+    if (st != ZX_OK || vmar == nullptr) {
         LTRACEF("Arena '%s': can't create %zu-byte VMAR (%d)\n",
                 name, vmar_sz, st);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     // The VMAR's parent holds a ref, so it won't be destroyed
     // automatically when we return.
@@ -99,10 +99,10 @@
                                ARCH_MMU_FLAG_PERM_READ |
                                    ARCH_MMU_FLAG_PERM_WRITE,
                                "control", &control_mapping);
-    if (st != MX_OK || control_mapping == nullptr) {
+    if (st != ZX_OK || control_mapping == nullptr) {
         LTRACEF("Arena '%s': can't create %zu-byte control mapping (%d)\n",
                 name, control_mem_sz, st);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // Create a mapping for the data pool, leaving an unmapped gap
@@ -117,10 +117,10 @@
                                ARCH_MMU_FLAG_PERM_READ |
                                    ARCH_MMU_FLAG_PERM_WRITE,
                                "data", &data_mapping);
-    if (st != MX_OK || data_mapping == nullptr) {
+    if (st != ZX_OK || data_mapping == nullptr) {
         LTRACEF("Arena '%s': can't create %zu-byte data mapping (%d)\n",
                 name, data_mem_sz, st);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // TODO(dbort): Add a VmMapping flag that says "do not demand page",
@@ -137,7 +137,7 @@
     if (LOCAL_TRACE) {
         Dump();
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 void Arena::Pool::Init(const char* name, fbl::RefPtr<VmMapping> mapping,
@@ -177,8 +177,8 @@
         const size_t offset =
             reinterpret_cast<vaddr_t>(committed_) - mapping_->base();
         const size_t len = nc - committed_;
-        mx_status_t st = mapping_->MapRange(offset, len, /* commit */ true);
-        if (st != MX_OK) {
+        zx_status_t st = mapping_->MapRange(offset, len, /* commit */ true);
+        if (st != ZX_OK) {
             LTRACEF("%s: can't map range 0x%p..0x%p: %d\n",
                     name_, committed_, nc, st);
             // Try to clean up any committed pages, but don't require
diff --git a/kernel/lib/fbl/arena_tests.cpp b/kernel/lib/fbl/arena_tests.cpp
index 43e858d..e0fe76a 100644
--- a/kernel/lib/fbl/arena_tests.cpp
+++ b/kernel/lib/fbl/arena_tests.cpp
@@ -19,28 +19,28 @@
 static bool init_null_name_succeeds(void* context) {
     BEGIN_TEST;
     Arena arena;
-    EXPECT_EQ(MX_OK, arena.Init(nullptr, sizeof(TestObj), 16), "");
+    EXPECT_EQ(ZX_OK, arena.Init(nullptr, sizeof(TestObj), 16), "");
     END_TEST;
 }
 
 static bool init_zero_ob_size_fails(void* context) {
     BEGIN_TEST;
     Arena arena;
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, arena.Init("name", 0, 16), "");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, arena.Init("name", 0, 16), "");
     END_TEST;
 }
 
 static bool init_large_ob_size_fails(void* context) {
     BEGIN_TEST;
     Arena arena;
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, arena.Init("name", PAGE_SIZE + 1, 16), "");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, arena.Init("name", PAGE_SIZE + 1, 16), "");
     END_TEST;
 }
 
 static bool init_zero_count_fails(void* context) {
     BEGIN_TEST;
     Arena arena;
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, arena.Init("name", sizeof(TestObj), 0), "");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, arena.Init("name", sizeof(TestObj), 0), "");
     END_TEST;
 }
 
@@ -50,7 +50,7 @@
     static const size_t expected_size = num_slots * sizeof(TestObj);
 
     Arena arena;
-    EXPECT_EQ(MX_OK, arena.Init("name", sizeof(TestObj), num_slots), "");
+    EXPECT_EQ(ZX_OK, arena.Init("name", sizeof(TestObj), num_slots), "");
 
     EXPECT_NONNULL(arena.start(), "");
     EXPECT_NONNULL(arena.end(), "");
@@ -66,7 +66,7 @@
     static const size_t num_slots = (2 * PAGE_SIZE) / sizeof(TestObj);
 
     Arena arena;
-    EXPECT_EQ(MX_OK, arena.Init("name", sizeof(TestObj), num_slots), "");
+    EXPECT_EQ(ZX_OK, arena.Init("name", sizeof(TestObj), num_slots), "");
 
     auto start = reinterpret_cast<char*>(arena.start());
 
@@ -119,7 +119,7 @@
     static const size_t num_slots = (2 * PAGE_SIZE) / sizeof(TestObj);
 
     Arena arena;
-    EXPECT_EQ(MX_OK, arena.Init("name", sizeof(TestObj), num_slots), "");
+    EXPECT_EQ(ZX_OK, arena.Init("name", sizeof(TestObj), num_slots), "");
 
     // Allocate all of the data objects.
     void** objs = reinterpret_cast<void**>(malloc(sizeof(void*) * num_slots));
@@ -192,7 +192,7 @@
     static const size_t num_slots = (64 * PAGE_SIZE) / sizeof(TestObj);
 
     Arena arena;
-    EXPECT_EQ(MX_OK, arena.Init("name", sizeof(TestObj), num_slots), "");
+    EXPECT_EQ(ZX_OK, arena.Init("name", sizeof(TestObj), num_slots), "");
 
     auto start = reinterpret_cast<vaddr_t>(arena.start());
     auto end = reinterpret_cast<vaddr_t>(arena.end());
@@ -285,7 +285,7 @@
 
     Arena arena;
     // Use a small data slot size (1) to keep our memory usage down.
-    EXPECT_EQ(MX_OK, arena.Init("name", 1, num_slots), "");
+    EXPECT_EQ(ZX_OK, arena.Init("name", 1, num_slots), "");
 
     // Get the extent of the control pool.
     vaddr_t start;
@@ -418,7 +418,7 @@
     fbl::AllocChecker ac;
     Arena* arena = new (&ac) Arena();
     EXPECT_TRUE(ac.check(), "");
-    EXPECT_EQ(MX_OK, arena->Init("name", sizeof(TestObj), num_slots), "");
+    EXPECT_EQ(ZX_OK, arena->Init("name", sizeof(TestObj), num_slots), "");
 
     auto start = reinterpret_cast<vaddr_t>(arena->start());
     auto end = reinterpret_cast<vaddr_t>(arena->end());
@@ -455,8 +455,8 @@
 static bool content_preservation(void* context) {
     BEGIN_TEST;
     Arena arena;
-    mx_status_t s = arena.Init("arena_tests", sizeof(TestObj), 1000);
-    REQUIRE_EQ(MX_OK, s, "arena.Init()");
+    zx_status_t s = arena.Init("arena_tests", sizeof(TestObj), 1000);
+    REQUIRE_EQ(ZX_OK, s, "arena.Init()");
 
     const int count = 30;
 
diff --git a/kernel/lib/fbl/include/fbl/arena.h b/kernel/lib/fbl/include/fbl/arena.h
index b151b91..3781954 100644
--- a/kernel/lib/fbl/include/fbl/arena.h
+++ b/kernel/lib/fbl/include/fbl/arena.h
@@ -10,7 +10,7 @@
 
 #include <vm/vm_address_region.h>
 
-#include <mxcpp/new.h>
+#include <zxcpp/new.h>
 #include <fbl/intrusive_single_list.h>
 #include <fbl/ref_ptr.h>
 #include <fbl/type_support.h>
@@ -31,7 +31,7 @@
     Arena() = default;
     ~Arena();
 
-    mx_status_t Init(const char* name, size_t ob_size, size_t max_count);
+    zx_status_t Init(const char* name, size_t ob_size, size_t max_count);
     void* Alloc();
     void Free(void* addr);
     bool in_range(void* addr) const {
@@ -42,7 +42,7 @@
     void* end() const { return data_.end(); }
 
     // Dumps information about the Arena using printf().
-    // TIP: Use "k mx htinfo" to dump the handle table at runtime.
+    // TIP: Use "k zx htinfo" to dump the handle table at runtime.
     void Dump() const;
 
     // Returns the number of outstanding allocations from this arena.
diff --git a/kernel/lib/fbl/include/fbl/inline_array.h b/kernel/lib/fbl/include/fbl/inline_array.h
index 5d7e018..2c679e0 100644
--- a/kernel/lib/fbl/include/fbl/inline_array.h
+++ b/kernel/lib/fbl/include/fbl/inline_array.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <stddef.h>
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/macros.h>
 
@@ -20,9 +20,9 @@
 // |max_inline_count| or heap-allocated otherwise. This is typically used like:
 //
 //   fbl::AllocChecker ac;
-//   fbl::InlineArray<mx_handle_t, 4u> handle_values(&ac, num_handles);
+//   fbl::InlineArray<zx_handle_t, 4u> handle_values(&ac, num_handles);
 //   if (!ac.check())
-//       return MX_ERR_NO_MEMORY;
+//       return ZX_ERR_NO_MEMORY;
 //
 // Note: Currently, |max_inline_count| must be at least 1.
 template <typename T, size_t max_inline_count>
@@ -60,7 +60,7 @@
     T* get() const { return ptr_; }
 
     T& operator[](size_t i) const {
-        MX_DEBUG_ASSERT(i < count_);
+        ZX_DEBUG_ASSERT(i < count_);
         return ptr_[i];
     }
 
diff --git a/kernel/lib/fbl/include/fbl/name.h b/kernel/lib/fbl/include/fbl/name.h
index d21bb7d..1f8e2d8 100644
--- a/kernel/lib/fbl/include/fbl/name.h
+++ b/kernel/lib/fbl/include/fbl/name.h
@@ -11,8 +11,8 @@
 #include <kernel/auto_lock.h>
 #include <kernel/spinlock.h>
 
-#include <magenta/types.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/types.h>
+#include <zircon/thread_annotations.h>
 
 #include <fbl/algorithm.h>
 
@@ -51,14 +51,14 @@
 
     // Reset the Name to the given data. This will be guaranteed to
     // be nul terminated, so the given data may be truncated.
-    mx_status_t set(const char* name, size_t len) {
+    zx_status_t set(const char* name, size_t len) {
         if (len >= Size)
             len = Size - 1;
 
         AutoSpinLock lock(&lock_);
         memcpy(name_, name, len);
         memset(name_ + len, 0, Size - len);
-        return MX_OK;
+        return ZX_OK;
     }
 
     Name& operator=(const Name<Size>& other) {
diff --git a/kernel/lib/gfx/gfx.c b/kernel/lib/gfx/gfx.c
index 9d15a9d..04dacc7 100644
--- a/kernel/lib/gfx/gfx.c
+++ b/kernel/lib/gfx/gfx.c
@@ -28,8 +28,8 @@
 #include <lib/gfx.h>
 #include <dev/display.h>
 
-#include <magenta/font/font-9x16.h>
-#include <magenta/font/font-18x32.h>
+#include <zircon/font/font-9x16.h>
+#include <zircon/font/font-18x32.h>
 
 const struct gfx_font font_9x16 = {
     .data = FONT9X16,
@@ -694,14 +694,14 @@
             break;
         default:
             dprintf(INFO, "invalid graphics format\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
     }
 
     if (ptr == NULL) {
         // allocate a buffer
         ptr = malloc(surface->len);
         if (ptr == NULL) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         DEBUG_ASSERT(ptr);
         surface->flags |= GFX_FLAG_FREE_ON_DESTROY;
@@ -753,7 +753,7 @@
             break;
         default:
             dprintf(CRITICAL, "invalid graphics format %d", info->format);
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
     }
 
     uint32_t flags = (info->flags & DISPLAY_FLAG_NEEDS_CACHE_FLUSH) ? GFX_FLAG_FLUSH_CPU_CACHE : 0;
diff --git a/kernel/lib/gfxconsole/gfxconsole.c b/kernel/lib/gfxconsole/gfxconsole.c
index 1ba0c9f..e39de24 100644
--- a/kernel/lib/gfxconsole/gfxconsole.c
+++ b/kernel/lib/gfxconsole/gfxconsole.c
@@ -240,7 +240,7 @@
 static gfx_surface sw_surface;
 static struct display_info dispinfo;
 
-mx_status_t gfxconsole_display_get_info(struct display_info *info)
+zx_status_t gfxconsole_display_get_info(struct display_info *info)
 {
     if (gfxconsole.surface) {
         memcpy(info, &dispinfo, sizeof(*info));
diff --git a/kernel/lib/heap/cmpctmalloc/cmpctmalloc.c b/kernel/lib/heap/cmpctmalloc/cmpctmalloc.c
index 358b86d..a5c95f4 100644
--- a/kernel/lib/heap/cmpctmalloc/cmpctmalloc.c
+++ b/kernel/lib/heap/cmpctmalloc/cmpctmalloc.c
@@ -1152,7 +1152,7 @@
     if (ptr == NULL) {
         ptr = heap_page_alloc(size >> PAGE_SIZE_SHIFT);
         if (ptr == NULL) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         LTRACEF("Growing heap by 0x%zx bytes, new ptr %p (%s)\n",
                 size, ptr, bucket ? "large" : "small");
diff --git a/kernel/lib/heap/cmpctmalloc/include/lib/cmpctmalloc.h b/kernel/lib/heap/cmpctmalloc/include/lib/cmpctmalloc.h
index 553176d..bf8f440 100644
--- a/kernel/lib/heap/cmpctmalloc/include/lib/cmpctmalloc.h
+++ b/kernel/lib/heap/cmpctmalloc/include/lib/cmpctmalloc.h
@@ -10,7 +10,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/lib/heap/include/lib/heap.h b/kernel/lib/heap/include/lib/heap.h
index 91a2663..0f157b2 100644
--- a/kernel/lib/heap/include/lib/heap.h
+++ b/kernel/lib/heap/include/lib/heap.h
@@ -9,7 +9,7 @@
 
 #include <stddef.h>
 #include <sys/types.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/lib/hypervisor/cpu_state.cpp b/kernel/lib/hypervisor/cpu_state.cpp
index 786a14a..437cd90 100644
--- a/kernel/lib/hypervisor/cpu_state.cpp
+++ b/kernel/lib/hypervisor/cpu_state.cpp
@@ -19,8 +19,8 @@
 static void percpu_task(void* arg) {
     auto state = static_cast<percpu_state*>(arg);
     uint cpu_num = arch_curr_cpu_num();
-    mx_status_t status = state->task(state->context, cpu_num);
-    if (status == MX_OK)
+    zx_status_t status = state->task(state->context, cpu_num);
+    if (status == ZX_OK)
         state->cpu_mask.fetch_or(1 << cpu_num);
 }
 
diff --git a/kernel/lib/hypervisor/fault.cpp b/kernel/lib/hypervisor/fault.cpp
index af87d27..8aff916 100644
--- a/kernel/lib/hypervisor/fault.cpp
+++ b/kernel/lib/hypervisor/fault.cpp
@@ -6,7 +6,7 @@
 
 #include "hypervisor/fault.h"
 
-mx_status_t vmm_guest_page_fault_handler(vaddr_t guest_paddr, uint flags,
+zx_status_t vmm_guest_page_fault_handler(vaddr_t guest_paddr, uint flags,
                                          fbl::RefPtr<VmAspace> paspace) {
     return paspace->PageFault(guest_paddr, flags);
 }
diff --git a/kernel/lib/hypervisor/guest_physical_address_space.cpp b/kernel/lib/hypervisor/guest_physical_address_space.cpp
index 5416400..7c819c0 100644
--- a/kernel/lib/hypervisor/guest_physical_address_space.cpp
+++ b/kernel/lib/hypervisor/guest_physical_address_space.cpp
@@ -41,28 +41,28 @@
 };
 } // namespace
 
-mx_status_t GuestPhysicalAddressSpace::Create(fbl::RefPtr<VmObject> guest_phys_mem,
+zx_status_t GuestPhysicalAddressSpace::Create(fbl::RefPtr<VmObject> guest_phys_mem,
                                               fbl::unique_ptr<GuestPhysicalAddressSpace>* _gpas) {
     fbl::AllocChecker ac;
     fbl::unique_ptr<GuestPhysicalAddressSpace> gpas(new (&ac)
                                                          GuestPhysicalAddressSpace(guest_phys_mem));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     gpas->paspace_ = VmAspace::Create(VmAspace::TYPE_GUEST_PHYS, "guest_paspace");
     if (!gpas->paspace_)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // Initialize our VMAR with the provided VMO, mapped at address 0.
     fbl::RefPtr<VmMapping> mapping;
-    mx_status_t result = gpas->paspace_->RootVmar()->CreateVmMapping(
+    zx_status_t result = gpas->paspace_->RootVmar()->CreateVmMapping(
         0 /* mapping_offset */, guest_phys_mem->size(), /* align_pow2*/ 0, VMAR_FLAG_SPECIFIC,
         guest_phys_mem, /* vmo_offset */ 0, kMmuFlags, "guest_phys_mem_vmo", &mapping);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     *_gpas = fbl::move(gpas);
-    return MX_OK;
+    return ZX_OK;
 }
 
 GuestPhysicalAddressSpace::GuestPhysicalAddressSpace(fbl::RefPtr<VmObject> guest_phys_mem)
@@ -77,14 +77,14 @@
 }
 
 #if ARCH_X86_64
-mx_status_t GuestPhysicalAddressSpace::MapApicPage(vaddr_t guest_paddr, paddr_t host_paddr) {
+zx_status_t GuestPhysicalAddressSpace::MapApicPage(vaddr_t guest_paddr, paddr_t host_paddr) {
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t result = VmObjectPhysical::Create(host_paddr, PAGE_SIZE, &vmo);
-    if (result != MX_OK)
+    zx_status_t result = VmObjectPhysical::Create(host_paddr, PAGE_SIZE, &vmo);
+    if (result != ZX_OK)
         return result;
 
     result = vmo->SetMappingCachePolicy(ARCH_MMU_FLAG_CACHED);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     // The root VMAR will maintain a reference to the VmMapping internally so
@@ -93,30 +93,30 @@
     result = paspace_->RootVmar()->CreateVmMapping(guest_paddr, vmo->size(), /* align_pow2*/ 0,
                                                    VMAR_FLAG_SPECIFIC, vmo, /* vmo_offset */ 0,
                                                    kApicMmuFlags, "guest_apic_vmo", &mapping);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     // Write mapping to page table.
     result = mapping->MapRange(0, vmo->size(), true);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         mapping->Destroy();
         return result;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 #endif // ARCH_X86_64
 
-mx_status_t GuestPhysicalAddressSpace::UnmapRange(vaddr_t guest_paddr, size_t size) {
+zx_status_t GuestPhysicalAddressSpace::UnmapRange(vaddr_t guest_paddr, size_t size) {
     return paspace_->RootVmar()->Unmap(guest_paddr, size);
 }
 
-mx_status_t GuestPhysicalAddressSpace::GetPage(vaddr_t guest_paddr, paddr_t* host_paddr) {
+zx_status_t GuestPhysicalAddressSpace::GetPage(vaddr_t guest_paddr, paddr_t* host_paddr) {
     // Locate the VMO for the guest physical address (if present).
     AspaceVmoLocator vmo_locator(guest_paddr);
     paspace_->EnumerateChildren(&vmo_locator);
     fbl::RefPtr<VmObject> vmo = vmo_locator.vmo;
     if (!vmo)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     // Lookup the physical address of this page in the VMO.
     vaddr_t offset = guest_paddr - vmo_locator.base;
diff --git a/kernel/lib/hypervisor/hypervisor_unittest.cpp b/kernel/lib/hypervisor/hypervisor_unittest.cpp
index b5a2ad6..74e1b3b 100644
--- a/kernel/lib/hypervisor/hypervisor_unittest.cpp
+++ b/kernel/lib/hypervisor/hypervisor_unittest.cpp
@@ -15,26 +15,26 @@
 #include <vm/vm_object_paged.h>
 #include <unittest.h>
 
-static mx_status_t get_paddr(void* context, size_t offset, size_t index, paddr_t pa) {
+static zx_status_t get_paddr(void* context, size_t offset, size_t index, paddr_t pa) {
     *static_cast<paddr_t*>(context) = pa;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t setup_vmo(size_t vmo_size, fbl::RefPtr<VmObject>* vmo_out) {
+zx_status_t setup_vmo(size_t vmo_size, fbl::RefPtr<VmObject>* vmo_out) {
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(0, vmo_size, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = VmObjectPaged::Create(0, vmo_size, &vmo);
+    if (status != ZX_OK)
         return status;
 
     uint64_t committed = 0;
     status = vmo->CommitRange(0, vmo->size(), &committed);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     if (committed != vmo->size())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     *vmo_out = vmo;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static bool guest_physical_address_space_unmap_range(void* context) {
@@ -42,20 +42,20 @@
 
     // Setup
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = setup_vmo(PAGE_SIZE, &vmo);
-    EXPECT_EQ(MX_OK, status, "Failed to setup vmo.\n");
+    zx_status_t status = setup_vmo(PAGE_SIZE, &vmo);
+    EXPECT_EQ(ZX_OK, status, "Failed to setup vmo.\n");
     fbl::unique_ptr<GuestPhysicalAddressSpace> gpas;
     status = GuestPhysicalAddressSpace::Create(vmo, &gpas);
-    EXPECT_EQ(MX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
 
     // Unmap page.
     status = gpas->UnmapRange(0, PAGE_SIZE);
-    EXPECT_EQ(MX_OK, status, "Failed to unmap page from GuestPhysicalAddressSpace.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to unmap page from GuestPhysicalAddressSpace.\n");
 
     // Verify GetPage for unmapped address fails.
     paddr_t gpas_paddr;
     status = gpas->GetPage(0, &gpas_paddr);
-    EXPECT_EQ(MX_ERR_NOT_FOUND, status,
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, status,
               "GetPage returning unexpected value for unmapped address.\n");
     END_TEST;
 }
@@ -65,16 +65,16 @@
 
     // Setup
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = setup_vmo(PAGE_SIZE, &vmo);
-    EXPECT_EQ(MX_OK, status, "Failed to setup vmo.\n");
+    zx_status_t status = setup_vmo(PAGE_SIZE, &vmo);
+    EXPECT_EQ(ZX_OK, status, "Failed to setup vmo.\n");
     fbl::unique_ptr<GuestPhysicalAddressSpace> gpas;
     status = GuestPhysicalAddressSpace::Create(vmo, &gpas);
-    EXPECT_EQ(MX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
 
     // Query unmapped address.
     paddr_t gpas_paddr = 0;
     status = gpas->GetPage(UINTPTR_MAX, &gpas_paddr);
-    EXPECT_EQ(MX_ERR_NOT_FOUND, status,
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, status,
               "GetPage returning unexpected value for unmapped address.\n");
 
     END_TEST;
@@ -85,22 +85,22 @@
 
     // Setup
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = setup_vmo(PAGE_SIZE, &vmo);
-    EXPECT_EQ(MX_OK, status, "Failed to setup vmo.\n");
+    zx_status_t status = setup_vmo(PAGE_SIZE, &vmo);
+    EXPECT_EQ(ZX_OK, status, "Failed to setup vmo.\n");
     fbl::unique_ptr<GuestPhysicalAddressSpace> gpas;
     status = GuestPhysicalAddressSpace::Create(vmo, &gpas);
-    EXPECT_EQ(MX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
 
     // Read expected physical address from the VMO.
     paddr_t vmo_paddr = 0;
     status = vmo->Lookup(0, PAGE_SIZE, 0, get_paddr, &vmo_paddr);
-    EXPECT_EQ(MX_OK, status, "Failed to lookup physical address of VMO.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to lookup physical address of VMO.\n");
     EXPECT_NE(0u, vmo_paddr, "Failed to lookup physical address of VMO.\n");
 
     // Read physical address from GPAS & compare with address read from VMO.
     paddr_t gpas_paddr = 0;
     status = gpas->GetPage(0, &gpas_paddr);
-    EXPECT_EQ(MX_OK, status, "Failed to read page from GuestPhysicalAddressSpace.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to read page from GuestPhysicalAddressSpace.\n");
     EXPECT_EQ(vmo_paddr, gpas_paddr,
               "Incorrect physical address returned from GuestPhysicalAddressSpace::GetPage.\n");
 
@@ -131,11 +131,11 @@
 
     // Setup
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = setup_vmo(ROOT_VMO_SIZE, &vmo);
-    EXPECT_EQ(MX_OK, status, "Failed to setup vmo.\n");
+    zx_status_t status = setup_vmo(ROOT_VMO_SIZE, &vmo);
+    EXPECT_EQ(ZX_OK, status, "Failed to setup vmo.\n");
     fbl::unique_ptr<GuestPhysicalAddressSpace> gpas;
     status = GuestPhysicalAddressSpace::Create(vmo, &gpas);
-    EXPECT_EQ(MX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
 
     // Allocate second VMAR, offset one page into the root.
     fbl::RefPtr<VmAddressRegion> root_vmar = gpas->aspace()->RootVmar();
@@ -143,12 +143,12 @@
     status = root_vmar->CreateSubVmar(ROOT_VMO_SIZE, root_vmar->size() - ROOT_VMO_SIZE,
                                       /* align_pow2 */ 0, root_vmar->flags() | VMAR_FLAG_SPECIFIC,
                                       "test_vmar1", &shadow_vmar);
-    EXPECT_EQ(MX_OK, status, "Failed to create shadow VMAR.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to create shadow VMAR.\n");
 
     // Allocate second VMO; we'll map the original VMO on top of this one.
     fbl::RefPtr<VmObject> vmo2;
     status = setup_vmo(SECOND_VMO_SIZE, &vmo2);
-    EXPECT_EQ(MX_OK, status, "Failed allocate second VMO.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed allocate second VMO.\n");
 
     // Map second VMO into second VMAR.
     fbl::RefPtr<VmMapping> mapping;
@@ -157,18 +157,18 @@
     status = shadow_vmar->CreateVmMapping(
         /* mapping_offset */ 0, vmo2->size(), /* align_pow2 */ 0, VMAR_FLAG_SPECIFIC, vmo2,
         /* vmar_offset */ 0, mmu_flags, "vmo2", &mapping);
-    EXPECT_EQ(MX_OK, status, "Failed to map vmo into shadow vmar.");
+    EXPECT_EQ(ZX_OK, status, "Failed to map vmo into shadow vmar.");
 
     // Read expected physical address from the VMO.
     paddr_t vmo_paddr = 0;
     status = vmo2->Lookup(0, PAGE_SIZE, 0, get_paddr, &vmo_paddr);
-    EXPECT_EQ(MX_OK, status, "Failed to lookup physical address of VMO.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to lookup physical address of VMO.\n");
     EXPECT_NE(0u, vmo_paddr, "Failed to lookup physical address of VMO.\n");
 
     // Read physical address from GPAS.
     paddr_t gpas_paddr = 0;
     status = gpas->GetPage(ROOT_VMO_SIZE, &gpas_paddr);
-    EXPECT_EQ(MX_OK, status, "Failed to read page from GuestPhysicalAddressSpace.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to read page from GuestPhysicalAddressSpace.\n");
     EXPECT_EQ(vmo_paddr, gpas_paddr,
               "Incorrect physical address returned from GuestPhysicalAddressSpace::GetPage.\n");
     END_TEST;
@@ -180,14 +180,14 @@
 
     // Allocate VMO.
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(0, PAGE_SIZE, &vmo);
-    EXPECT_EQ(status, MX_OK, "vmobject creation\n");
+    zx_status_t status = VmObjectPaged::Create(0, PAGE_SIZE, &vmo);
+    EXPECT_EQ(status, ZX_OK, "vmobject creation\n");
     EXPECT_NONNULL(vmo, "Failed to allocate VMO.\n");
 
     // Setup GuestPhysicalAddressSpace.
     fbl::unique_ptr<GuestPhysicalAddressSpace> gpas;
     status = GuestPhysicalAddressSpace::Create(vmo, &gpas);
-    EXPECT_EQ(MX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to create GuestPhysicalAddressSpace.\n");
 
     // Allocate a page to use as the APIC page.
     paddr_t paddr = 0;
@@ -197,7 +197,7 @@
     // Map APIC page in an arbitrary location.
     const vaddr_t APIC_ADDRESS = 0xffff0000;
     status = gpas->MapApicPage(APIC_ADDRESS, paddr);
-    EXPECT_EQ(MX_OK, status, "Failed to map APIC page.\n");
+    EXPECT_EQ(ZX_OK, status, "Failed to map APIC page.\n");
 
     // Cleanup
     pmm_free_page(vm_page);
diff --git a/kernel/lib/hypervisor/include/hypervisor/cpu_state.h b/kernel/lib/hypervisor/include/hypervisor/cpu_state.h
index 71d70ef..dfa6a88 100644
--- a/kernel/lib/hypervisor/include/hypervisor/cpu_state.h
+++ b/kernel/lib/hypervisor/include/hypervisor/cpu_state.h
@@ -20,25 +20,25 @@
 template <typename T, T N>
 class CpuState {
 public:
-    mx_status_t AllocId(T* id) {
+    zx_status_t AllocId(T* id) {
         size_t first_unset;
         bool all_set = id_bitmap_.Get(0, N, &first_unset);
         if (all_set)
-            return MX_ERR_NO_RESOURCES;
+            return ZX_ERR_NO_RESOURCES;
         if (first_unset >= N)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         *id = static_cast<T>(first_unset + 1);
         return id_bitmap_.SetOne(first_unset);
     }
 
-    mx_status_t FreeId(T id) {
+    zx_status_t FreeId(T id) {
         if (id == 0 || !id_bitmap_.GetOne(id - 1))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return id_bitmap_.ClearOne(id - 1);
     }
 
 protected:
-    mx_status_t Init() {
+    zx_status_t Init() {
         return id_bitmap_.Reset(N);
     }
 
@@ -48,7 +48,7 @@
 
 } // namespace hypervisor
 
-typedef mx_status_t (* percpu_task_t)(void* context, uint cpu_num);
+typedef zx_status_t (* percpu_task_t)(void* context, uint cpu_num);
 
 /* Executes a task on each online CPU, and returns a CPU mask containing each
  * CPU the task was successfully run on. */
diff --git a/kernel/lib/hypervisor/include/hypervisor/fault.h b/kernel/lib/hypervisor/include/hypervisor/fault.h
index 2a42c44..d2c4ea2 100644
--- a/kernel/lib/hypervisor/include/hypervisor/fault.h
+++ b/kernel/lib/hypervisor/include/hypervisor/fault.h
@@ -10,4 +10,4 @@
 #include <vm/vm_aspace.h>
 
 // page fault handler for second level address translation.
-mx_status_t vmm_guest_page_fault_handler(vaddr_t va, uint flags, fbl::RefPtr<VmAspace> paspace);
+zx_status_t vmm_guest_page_fault_handler(vaddr_t va, uint flags, fbl::RefPtr<VmAspace> paspace);
diff --git a/kernel/lib/hypervisor/include/hypervisor/guest_physical_address_space.h b/kernel/lib/hypervisor/include/hypervisor/guest_physical_address_space.h
index df3a91b..5cb2f4f 100644
--- a/kernel/lib/hypervisor/include/hypervisor/guest_physical_address_space.h
+++ b/kernel/lib/hypervisor/include/hypervisor/guest_physical_address_space.h
@@ -12,7 +12,7 @@
 
 class GuestPhysicalAddressSpace {
 public:
-    static mx_status_t Create(fbl::RefPtr<VmObject> guest_phys_mem,
+    static zx_status_t Create(fbl::RefPtr<VmObject> guest_phys_mem,
                               fbl::unique_ptr<GuestPhysicalAddressSpace>* gpas);
 
     ~GuestPhysicalAddressSpace();
@@ -22,10 +22,10 @@
 
 #if ARCH_X86_64
     paddr_t Pml4Address() { return paspace_->arch_aspace().pt_phys(); }
-    mx_status_t MapApicPage(vaddr_t guest_paddr, paddr_t host_paddr);
+    zx_status_t MapApicPage(vaddr_t guest_paddr, paddr_t host_paddr);
 #endif
-    mx_status_t UnmapRange(vaddr_t guest_paddr, size_t size);
-    mx_status_t GetPage(vaddr_t guest_paddr, paddr_t* host_paddr);
+    zx_status_t UnmapRange(vaddr_t guest_paddr, size_t size);
+    zx_status_t GetPage(vaddr_t guest_paddr, paddr_t* host_paddr);
 
 private:
     fbl::RefPtr<VmAspace> paspace_;
@@ -34,8 +34,8 @@
     explicit GuestPhysicalAddressSpace(fbl::RefPtr<VmObject> guest_phys_mem);
 };
 
-static inline mx_status_t guest_lookup_page(void* context, size_t offset, size_t index,
+static inline zx_status_t guest_lookup_page(void* context, size_t offset, size_t index,
                                             paddr_t pa) {
     *static_cast<paddr_t*>(context) = pa;
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/lib/hypervisor/include/hypervisor/packet_mux.h b/kernel/lib/hypervisor/include/hypervisor/packet_mux.h
index 04c73ce..3298e6b 100644
--- a/kernel/lib/hypervisor/include/hypervisor/packet_mux.h
+++ b/kernel/lib/hypervisor/include/hypervisor/packet_mux.h
@@ -22,7 +22,7 @@
 public:
     BlockingPortAllocator();
 
-    mx_status_t Init() TA_NO_THREAD_SAFETY_ANALYSIS;
+    zx_status_t Init() TA_NO_THREAD_SAFETY_ANALYSIS;
     PortPacket* Alloc(StateReloader* reloader);
     virtual void Free(PortPacket* port_packet) override;
 
@@ -36,17 +36,17 @@
 /* Specifies an address range to associate with a port. */
 class PortRange : public fbl::WAVLTreeContainable<fbl::unique_ptr<PortRange>> {
 public:
-    PortRange(mx_vaddr_t addr, size_t len, fbl::RefPtr<PortDispatcher> port, uint64_t key);
+    PortRange(zx_vaddr_t addr, size_t len, fbl::RefPtr<PortDispatcher> port, uint64_t key);
     virtual ~PortRange(){};
 
-    mx_status_t Init();
-    mx_status_t Queue(const mx_port_packet_t& packet, StateReloader* reloader);
+    zx_status_t Init();
+    zx_status_t Queue(const zx_port_packet_t& packet, StateReloader* reloader);
 
-    mx_vaddr_t GetKey() const { return addr_; }
-    bool InRange(mx_vaddr_t val) const { return val >= addr_ && val < addr_ + len_; }
+    zx_vaddr_t GetKey() const { return addr_; }
+    bool InRange(zx_vaddr_t val) const { return val >= addr_ && val < addr_ + len_; }
 
 private:
-    const mx_vaddr_t addr_;
+    const zx_vaddr_t addr_;
     const size_t len_;
     const fbl::RefPtr<PortDispatcher> port_;
     const uint64_t key_; // Key for packets in this port range.
@@ -56,15 +56,15 @@
 /* Demultiplexes packets onto ports. */
 class PacketMux {
 public:
-    mx_status_t AddPortRange(mx_vaddr_t addr, size_t len, fbl::RefPtr<PortDispatcher> port,
+    zx_status_t AddPortRange(zx_vaddr_t addr, size_t len, fbl::RefPtr<PortDispatcher> port,
                              uint64_t key);
-    mx_status_t Queue(mx_vaddr_t addr, const mx_port_packet_t& packet, StateReloader* reloader);
+    zx_status_t Queue(zx_vaddr_t addr, const zx_port_packet_t& packet, StateReloader* reloader);
 
 private:
-    using PortTree = fbl::WAVLTree<mx_vaddr_t, fbl::unique_ptr<PortRange>>;
+    using PortTree = fbl::WAVLTree<zx_vaddr_t, fbl::unique_ptr<PortRange>>;
 
     fbl::Mutex mutex_;
     PortTree ports_ TA_GUARDED(mutex_);
 
-    mx_status_t FindPortRange(mx_vaddr_t addr, PortRange** port_range);
+    zx_status_t FindPortRange(zx_vaddr_t addr, PortRange** port_range);
 };
diff --git a/kernel/lib/hypervisor/packet_mux.cpp b/kernel/lib/hypervisor/packet_mux.cpp
index e1ff5d1..9078f00 100644
--- a/kernel/lib/hypervisor/packet_mux.cpp
+++ b/kernel/lib/hypervisor/packet_mux.cpp
@@ -6,7 +6,7 @@
 
 #include <hypervisor/packet_mux.h>
 
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls/hypervisor.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 
@@ -14,18 +14,18 @@
 
 BlockingPortAllocator::BlockingPortAllocator() : semaphore_(kMaxPacketsPerRange) {}
 
-mx_status_t BlockingPortAllocator::Init() {
+zx_status_t BlockingPortAllocator::Init() {
     return arena_.Init("hypervisor-packets", kMaxPacketsPerRange);
 }
 
 PortPacket* BlockingPortAllocator::Alloc(StateReloader* reloader) {
     PortPacket* port_packet = Alloc();
-    mx_status_t status = semaphore_.Wait(INFINITE_TIME);
+    zx_status_t status = semaphore_.Wait(INFINITE_TIME);
     // If port_packet is NULL, then Wait would have blocked. So we need to:
     // reload our state, check the status of Wait, and Alloc again.
     if (port_packet == nullptr) {
         reloader->Reload();
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return nullptr;
         port_packet = Alloc();
     }
@@ -42,45 +42,45 @@
         thread_reschedule();
 }
 
-PortRange::PortRange(mx_vaddr_t addr, size_t len, fbl::RefPtr<PortDispatcher> port, uint64_t key)
+PortRange::PortRange(zx_vaddr_t addr, size_t len, fbl::RefPtr<PortDispatcher> port, uint64_t key)
     : addr_(addr), len_(len), port_(fbl::move(port)), key_(key) {
     (void) key_;
 }
 
-mx_status_t PortRange::Init() {
+zx_status_t PortRange::Init() {
     return port_allocator_.Init();
 }
 
-mx_status_t PortRange::Queue(const mx_port_packet_t& packet, StateReloader* reloader) {
+zx_status_t PortRange::Queue(const zx_port_packet_t& packet, StateReloader* reloader) {
     PortPacket* port_packet = port_allocator_.Alloc(reloader);
     if (port_packet == nullptr)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     port_packet->packet = packet;
     port_packet->packet.key = key_;
     port_packet->packet.type |= PKT_FLAG_EPHEMERAL;
-    mx_status_t status = port_->Queue(port_packet, MX_SIGNAL_NONE, 0);
-    if (status != MX_OK)
+    zx_status_t status = port_->Queue(port_packet, ZX_SIGNAL_NONE, 0);
+    if (status != ZX_OK)
         port_allocator_.Free(port_packet);
     return status;
 }
 
-mx_status_t PacketMux::AddPortRange(mx_vaddr_t addr, size_t len,
+zx_status_t PacketMux::AddPortRange(zx_vaddr_t addr, size_t len,
                                     fbl::RefPtr<PortDispatcher> port, uint64_t key) {
     fbl::AllocChecker ac;
     fbl::unique_ptr<PortRange> range(new (&ac) PortRange(addr, len, fbl::move(port), key));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
-    mx_status_t status = range->Init();
-    if (status != MX_OK)
+        return ZX_ERR_NO_MEMORY;
+    zx_status_t status = range->Init();
+    if (status != ZX_OK)
         return status;
     {
         fbl::AutoLock lock(&mutex_);
         ports_.insert(fbl::move(range));
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t PacketMux::FindPortRange(mx_vaddr_t addr, PortRange** port_range) {
+zx_status_t PacketMux::FindPortRange(zx_vaddr_t addr, PortRange** port_range) {
     PortTree::iterator iter;
     {
         fbl::AutoLock lock(&mutex_);
@@ -88,16 +88,16 @@
     }
     --iter;
     if (!iter.IsValid() || !iter->InRange(addr))
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     *port_range = const_cast<PortRange*>(&*iter);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t PacketMux::Queue(mx_vaddr_t addr, const mx_port_packet_t& packet,
+zx_status_t PacketMux::Queue(zx_vaddr_t addr, const zx_port_packet_t& packet,
                              StateReloader* reloader) {
     PortRange* port_range;
-    mx_status_t status = FindPortRange(addr, &port_range);
-    if (status != MX_OK)
+    zx_status_t status = FindPortRange(addr, &port_range);
+    if (status != ZX_OK)
         return status;
     return port_range->Queue(packet, reloader);
 }
diff --git a/kernel/lib/io/include/lib/io.h b/kernel/lib/io/include/lib/io.h
index 1807ee0..c71ed8d 100644
--- a/kernel/lib/io/include/lib/io.h
+++ b/kernel/lib/io/include/lib/io.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <list.h>
 #include <sys/types.h>
 
diff --git a/kernel/lib/iovec/iovec.c b/kernel/lib/iovec/iovec.c
index da8ff27..eaf8ad2 100644
--- a/kernel/lib/iovec/iovec.c
+++ b/kernel/lib/iovec/iovec.c
@@ -21,7 +21,7 @@
 ssize_t iovec_size (const iovec_t *iov, uint iov_cnt)
 {
     if (!iov)
-        return (ssize_t) MX_ERR_INVALID_ARGS;
+        return (ssize_t) ZX_ERR_INVALID_ARGS;
 
     size_t c = 0;
     for (uint i = 0; i < iov_cnt; i++, iov++) {
@@ -39,7 +39,7 @@
     uint buf_pos = 0;
 
     if (!buf || !iov)
-        return (ssize_t) MX_ERR_INVALID_ARGS;
+        return (ssize_t) ZX_ERR_INVALID_ARGS;
 
     /* for all iovec */
     for (uint i = 0; i < iov_cnt; i++, iov++) {
diff --git a/kernel/lib/ktrace/ktrace.cpp b/kernel/lib/ktrace/ktrace.cpp
index f0acf7e..0fb2e7e 100644
--- a/kernel/lib/ktrace/ktrace.cpp
+++ b/kernel/lib/ktrace/ktrace.cpp
@@ -15,7 +15,7 @@
 #include <vm/vm_aspace.h>
 #include <lib/ktrace.h>
 #include <lk/init.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/thread_annotations.h>
 #include <object/thread_dispatcher.h>
 
 #if __x86_64__
@@ -34,7 +34,7 @@
     uint32_t nargs;
     const char* name;
 } kt_syscall_info [] = {
-    #include <magenta/syscall-ktrace-info.inc>
+    #include <zircon/syscall-ktrace-info.inc>
     {0, 0, nullptr}
 };
 
@@ -131,13 +131,13 @@
         len = max - off;
     }
 
-    if (arch_copy_to_user(ptr, ks->buffer + off, len) != MX_OK) {
-        return MX_ERR_INVALID_ARGS;
+    if (arch_copy_to_user(ptr, ks->buffer + off, len) != ZX_OK) {
+        return ZX_ERR_INVALID_ARGS;
     }
     return len;
 }
 
-mx_status_t ktrace_control(uint32_t action, uint32_t options, void* ptr) {
+zx_status_t ktrace_control(uint32_t action, uint32_t options, void* ptr) {
     ktrace_state_t* ks = &KTRACE_STATE;
     switch (action) {
     case KTRACE_ACTION_START:
@@ -170,21 +170,21 @@
             mutex_release(&probe_list_lock);
             return probe->num;
         }
-        probe = (ktrace_probe_info_t*) calloc(sizeof(*probe) + MX_MAX_NAME_LEN, 1);
+        probe = (ktrace_probe_info_t*) calloc(sizeof(*probe) + ZX_MAX_NAME_LEN, 1);
         if (probe == nullptr) {
             mutex_release(&probe_list_lock);
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         probe->name = (const char*) (probe + 1);
-        memcpy(probe + 1, ptr, MX_MAX_NAME_LEN);
+        memcpy(probe + 1, ptr, ZX_MAX_NAME_LEN);
         ktrace_add_probe(probe);
         mutex_release(&probe_list_lock);
         return probe->num;
     }
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 int trace_not_ready = 0;
@@ -202,7 +202,7 @@
 
     mb *= (1024*1024);
 
-    mx_status_t status;
+    zx_status_t status;
     VmAspace* aspace = VmAspace::kernel_aspace();
     if ((status = aspace->Alloc("ktrace", mb, (void**)&ks->buffer, 0, VmAspace::VMM_FLAG_COMMIT,
                                 ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE)) < 0) {
diff --git a/kernel/lib/libc/include/assert.h b/kernel/lib/libc/include/assert.h
index ca4368e..5483801 100644
--- a/kernel/lib/libc/include/assert.h
+++ b/kernel/lib/libc/include/assert.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 
 #define PANIC(args...) panic(args)
diff --git a/kernel/lib/libc/include/ctype.h b/kernel/lib/libc/include/ctype.h
index ae8630e..84359a4 100644
--- a/kernel/lib/libc/include/ctype.h
+++ b/kernel/lib/libc/include/ctype.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/lib/libc/include/errno.h b/kernel/lib/libc/include/errno.h
index 1da12f8..c4389bb 100644
--- a/kernel/lib/libc/include/errno.h
+++ b/kernel/lib/libc/include/errno.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/lib/libc/include/iovec.h b/kernel/lib/libc/include/iovec.h
index ceba6a2..d052a25 100644
--- a/kernel/lib/libc/include/iovec.h
+++ b/kernel/lib/libc/include/iovec.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stddef.h>
 #include <sys/types.h>
 
diff --git a/kernel/lib/libc/include/malloc.h b/kernel/lib/libc/include/malloc.h
index 91c9bba..8da4d19 100644
--- a/kernel/lib/libc/include/malloc.h
+++ b/kernel/lib/libc/include/malloc.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <sys/types.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stddef.h>
 
 /* lib/heap provides malloc/free definitions */
diff --git a/kernel/lib/libc/include/printf.h b/kernel/lib/libc/include/printf.h
index 4293faf..7cf4ab0 100644
--- a/kernel/lib/libc/include/printf.h
+++ b/kernel/lib/libc/include/printf.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <stdarg.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stddef.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/lib/libc/include/rand.h b/kernel/lib/libc/include/rand.h
index cdac879..21a4c2f 100644
--- a/kernel/lib/libc/include/rand.h
+++ b/kernel/lib/libc/include/rand.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/lib/libc/include/stdio.h b/kernel/lib/libc/include/stdio.h
index 5db84b7..ce10455 100644
--- a/kernel/lib/libc/include/stdio.h
+++ b/kernel/lib/libc/include/stdio.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <printf.h>
 #include <sys/types.h>
 #include <lib/io.h>
diff --git a/kernel/lib/libc/include/stdlib.h b/kernel/lib/libc/include/stdlib.h
index f0b3a54..787f1af 100644
--- a/kernel/lib/libc/include/stdlib.h
+++ b/kernel/lib/libc/include/stdlib.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 #include <stddef.h>
 #include <malloc.h>
diff --git a/kernel/lib/libc/include/string.h b/kernel/lib/libc/include/string.h
index 631cd5d..9835793 100644
--- a/kernel/lib/libc/include/string.h
+++ b/kernel/lib/libc/include/string.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <stddef.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/lib/memory_limit/include/lib/memory_limit.h b/kernel/lib/memory_limit/include/lib/memory_limit.h
index 660e83d..4e93483 100644
--- a/kernel/lib/memory_limit/include/lib/memory_limit.h
+++ b/kernel/lib/memory_limit/include/lib/memory_limit.h
@@ -5,7 +5,7 @@
 // https://opensource.org/licenses/MIT
 #pragma once
 #include <iovec.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <sys/types.h>
 #include <vm/pmm.h>
 
@@ -49,9 +49,9 @@
 // @iovs[]: array of iovecs to stored returned vectors. Must have two entries.
 // @used_cnt: the number of entries filled in and returned in iovs[].
 //
-// Returns MX_OK on completion, and MX_ERR_INVALID_ARGS if parameters are
+// Returns ZX_OK on completion, and ZX_ERR_INVALID_ARGS if parameters are
 // invalid.
-mx_status_t mem_limit_get_iovs(mem_limit_ctx_t* ctx, uintptr_t range_base, size_t range_size,
+zx_status_t mem_limit_get_iovs(mem_limit_ctx_t* ctx, uintptr_t range_base, size_t range_size,
                                iovec_t iovs[], size_t* used_cnt);
 
 // This is a higher level helper function for users of the library if they have
@@ -64,16 +64,16 @@
 // @arena_template: a structure containing the default values for flags,
 // priority, and name used for arenas created by this function.
 //
-// Returns MX_OK on completion, and MX_ERR_INVALID_ARGS if parameters are
+// Returns ZX_OK on completion, and ZX_ERR_INVALID_ARGS if parameters are
 // invalid
-mx_status_t mem_limit_add_arenas_from_range(mem_limit_ctx_t* ctx, uintptr_t range_base,
+zx_status_t mem_limit_add_arenas_from_range(mem_limit_ctx_t* ctx, uintptr_t range_base,
                                             size_t range_size, pmm_arena_info_t arena_template);
 
 // Checks if a memory limit exists and initializes the memory_limit member of ctx
 // if one is found.
 //
-// Returns MX_OK on success, or ERR_UNSUPPORTED if no memory limit was passed
+// Returns ZX_OK on success, or ERR_UNSUPPORTED if no memory limit was passed
 // via kernel.memory-limit-mb
-mx_status_t mem_limit_init(mem_limit_ctx_t* ctx);
+zx_status_t mem_limit_init(mem_limit_ctx_t* ctx);
 
 __END_CDECLS
diff --git a/kernel/lib/memory_limit/memory_limit.cpp b/kernel/lib/memory_limit/memory_limit.cpp
index 9074621..d3348b6 100644
--- a/kernel/lib/memory_limit/memory_limit.cpp
+++ b/kernel/lib/memory_limit/memory_limit.cpp
@@ -20,9 +20,9 @@
 
 #define LOCAL_TRACE 0
 
-mx_status_t mem_limit_init(mem_limit_ctx_t* ctx) {
+zx_status_t mem_limit_init(mem_limit_ctx_t* ctx) {
     if (!ctx) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uint64_t limit = cmdline_get_uint64("kernel.memory-limit-mb", 0u);
@@ -31,13 +31,13 @@
         ctx->memory_limit = limit * MB;
         ctx->found_kernel = 0;
         ctx->found_ramdisk = 0;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t mem_limit_get_iovs(mem_limit_ctx_t* ctx, uintptr_t range_base, size_t range_size,
+zx_status_t mem_limit_get_iovs(mem_limit_ctx_t* ctx, uintptr_t range_base, size_t range_size,
                                iovec_t iovs[], size_t* used_cnt) {
     DEBUG_ASSERT(ctx);
     DEBUG_ASSERT(iovs);
@@ -46,7 +46,7 @@
     if (range_size == 0 || ctx->memory_limit == 0) {
         /* If our limit has been reached this range can be skipped */
         *used_cnt = 0;
-        return MX_OK;
+        return ZX_OK;
     }
 
     LTRACEF("scanning range %" PRIxPTR " of size %zu, (kernel start %#" PRIxPTR " limit %zu\n",
@@ -203,16 +203,16 @@
     *used_cnt = !!(iovs[0].iov_len) + !!(iovs[1].iov_len);
 
     LTRACEF("used %zu iov%s remaining memory %zu bytes\n", *used_cnt, (*used_cnt == 1) ? "," : "s,", ctx->memory_limit);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mem_limit_add_arenas_from_range(mem_limit_ctx_t* ctx, uintptr_t range_base,
+zx_status_t mem_limit_add_arenas_from_range(mem_limit_ctx_t* ctx, uintptr_t range_base,
                                             size_t range_size, pmm_arena_info_t arena_template) {
     size_t used;
     iovec_t vecs[2];
-    mx_status_t status = mem_limit_get_iovs(ctx, range_base, range_size, vecs, &used);
+    zx_status_t status = mem_limit_get_iovs(ctx, range_base, range_size, vecs, &used);
 
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -226,7 +226,7 @@
 
         // If either vector failed then abort the rest of the operation. There is no
         // valid situation where only the second vector is used.
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             break;
         }
     }
diff --git a/kernel/lib/memory_limit/memory_limit_tests.cpp b/kernel/lib/memory_limit/memory_limit_tests.cpp
index cf5a544..247dcba 100644
--- a/kernel/lib/memory_limit/memory_limit_tests.cpp
+++ b/kernel/lib/memory_limit/memory_limit_tests.cpp
@@ -94,9 +94,9 @@
     for (size_t i = 0; i < test.range_cnt; i++) {
         size_t used;
         total_platform_size += test.ranges[i].size;
-        mx_status_t status = mem_limit_get_iovs(&ctx, test.ranges[i].base, test.ranges[i].size, vecs, &used);
+        zx_status_t status = mem_limit_get_iovs(&ctx, test.ranges[i].base, test.ranges[i].size, vecs, &used);
 
-        REQUIRE_EQ(MX_OK, status, "checking mem_limit_get_iovs status");
+        REQUIRE_EQ(ZX_OK, status, "checking mem_limit_get_iovs status");
 
         for (size_t j = 0; j < used; j++) {
             size += vecs[j].iov_len;
@@ -138,8 +138,8 @@
     ctx.ramdisk_size = 64 * MB;
     ctx.memory_limit = memory_limit;
     for (size_t i = 0; i < fbl::count_of(nuc_ranges); i++) {
-        mx_status_t status = mem_limit_get_iovs(&ctx, nuc_ranges[i].base, nuc_ranges[i].size, vecs, &used);
-        EXPECT_EQ(MX_OK, status, "checking status");
+        zx_status_t status = mem_limit_get_iovs(&ctx, nuc_ranges[i].base, nuc_ranges[i].size, vecs, &used);
+        EXPECT_EQ(ZX_OK, status, "checking status");
         for (size_t i = 0; i < used; i++) {
             size += vecs[i].iov_len;
         }
diff --git a/kernel/lib/mtrace/mtrace-ipt.cpp b/kernel/lib/mtrace/mtrace-ipt.cpp
index 067bd7f..8920e4b 100644
--- a/kernel/lib/mtrace/mtrace-ipt.cpp
+++ b/kernel/lib/mtrace/mtrace-ipt.cpp
@@ -6,7 +6,7 @@
 
 // N.B. This is ideally temporary. It is used by Intel PT support, and is a
 // stopgap until "resources" can be used to read/write x86 MSRs.
-// "mtrace" == "magenta trace": the idea being to be a generalization of
+// "mtrace" == "zircon trace": the idea being to be a generalization of
 // ktrace. It's all temporary, but there may be other uses before the stopgap
 // is no longer necessary.
 
@@ -17,13 +17,13 @@
 #include "lib/mtrace.h"
 #include "trace.h"
 
-#include <magenta/mtrace.h>
+#include <zircon/mtrace.h>
 
 #include "arch/x86/proc_trace.h"
 
 #define LOCAL_TRACE 0
 
-mx_status_t mtrace_ipt_control(uint32_t action, uint32_t options,
+zx_status_t mtrace_ipt_control(uint32_t action, uint32_t options,
                                user_ptr<void> arg, uint32_t size) {
     TRACEF("action %u, options 0x%x, arg %p, size 0x%x\n",
            action, options, arg.get(), size);
@@ -31,12 +31,12 @@
     switch (action) {
     case MTRACE_IPT_SET_MODE: {
         if (options != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         uint32_t mode;
         if (size != sizeof(mode))
-            return MX_ERR_INVALID_ARGS;
-        if (arg.reinterpret<uint32_t>().copy_from_user(&mode) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
+        if (arg.reinterpret<uint32_t>().copy_from_user(&mode) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
         TRACEF("action %u, mode 0x%x\n", action, mode);
         switch (mode) {
         case IPT_MODE_CPUS:
@@ -44,60 +44,60 @@
         case IPT_MODE_THREADS:
             return x86_ipt_set_mode(IPT_TRACE_THREADS);
         default:
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     }
 
     case MTRACE_IPT_STAGE_CPU_DATA: {
-        mx_x86_pt_regs_t regs;
+        zx_x86_pt_regs_t regs;
         if (size != sizeof(regs))
-            return MX_ERR_INVALID_ARGS;
-        if (arg.reinterpret<mx_x86_pt_regs_t>().copy_from_user(&regs) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
+        if (arg.reinterpret<zx_x86_pt_regs_t>().copy_from_user(&regs) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
         uint32_t cpu = MTRACE_IPT_OPTIONS_CPU(options);
         if ((options & ~MTRACE_IPT_OPTIONS_CPU_MASK) != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         TRACEF("action %u, cpu %u, ctl 0x%" PRIx64 ", output_base 0x%" PRIx64 "\n",
                action, cpu, regs.ctl, regs.output_base);
         return x86_ipt_stage_cpu_data(cpu, &regs);
     }
 
     case MTRACE_IPT_GET_CPU_DATA: {
-        mx_x86_pt_regs_t regs;
+        zx_x86_pt_regs_t regs;
         if (size != sizeof(regs))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         uint32_t cpu = MTRACE_IPT_OPTIONS_CPU(options);
         if ((options & ~MTRACE_IPT_OPTIONS_CPU_MASK) != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         auto status = x86_ipt_get_cpu_data(cpu, &regs);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         TRACEF("action %u, cpu %u, ctl 0x%" PRIx64 ", output_base 0x%" PRIx64 "\n",
                action, cpu, regs.ctl, regs.output_base);
-        if (arg.reinterpret<mx_x86_pt_regs_t>().copy_to_user(regs) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
-        return MX_OK;
+        if (arg.reinterpret<zx_x86_pt_regs_t>().copy_to_user(regs) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
+        return ZX_OK;
     }
 
     case MTRACE_IPT_CPU_MODE_ALLOC:
         if (options != 0 || size != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return x86_ipt_cpu_mode_alloc();
     case MTRACE_IPT_CPU_MODE_START:
         if (options != 0 || size != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return x86_ipt_cpu_mode_start();
     case MTRACE_IPT_CPU_MODE_STOP:
         if (options != 0 || size != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return x86_ipt_cpu_mode_stop();
     case MTRACE_IPT_CPU_MODE_FREE:
         if (options != 0 || size != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return x86_ipt_cpu_mode_free();
 
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
diff --git a/kernel/lib/mtrace/mtrace.cpp b/kernel/lib/mtrace/mtrace.cpp
index f8e89f7..431b08d 100644
--- a/kernel/lib/mtrace/mtrace.cpp
+++ b/kernel/lib/mtrace/mtrace.cpp
@@ -6,19 +6,19 @@
 
 // N.B. This is ideally temporary. It is used by Intel PT support, and is a
 // stopgap until "resources" can be used to read/write x86 MSRs.
-// "mtrace" == "magenta trace": the idea being to be a generalization of
+// "mtrace" == "zircon trace": the idea being to be a generalization of
 // ktrace. It's all temporary, but there may be other uses before the stopgap
 // is no longer necessary.
 
 #include "lib/mtrace.h"
 
-#include <magenta/mtrace.h>
+#include <zircon/mtrace.h>
 
 #ifdef __x86_64__
 #include "arch/x86/proc_trace.h"
 #endif
 
-mx_status_t mtrace_control(uint32_t kind, uint32_t action, uint32_t options,
+zx_status_t mtrace_control(uint32_t kind, uint32_t action, uint32_t options,
                            user_ptr<void> arg, uint32_t size) {
     switch (kind) {
 #ifdef __x86_64__
@@ -26,6 +26,6 @@
         return mtrace_ipt_control(action, options, arg, size);
 #endif
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
diff --git a/kernel/lib/oom/oom.cpp b/kernel/lib/oom/oom.cpp
index d1bbadc..42f57bc 100644
--- a/kernel/lib/oom/oom.cpp
+++ b/kernel/lib/oom/oom.cpp
@@ -9,7 +9,7 @@
 #include <kernel/thread.h>
 #include <vm/pmm.h>
 #include <lib/console.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 #include <fbl/auto_lock.h>
 #include <fbl/mutex.h>
 #include <platform.h>
@@ -177,8 +177,8 @@
             lk_time_t deadline = current_time() + 4 * oom_sleep_duration_ns;
 
             lock.release();
-            mx_status_t s = thread_join(t, nullptr, deadline);
-            if (s == MX_OK) {
+            zx_status_t s = thread_join(t, nullptr, deadline);
+            if (s == ZX_OK) {
                 printf("OOM thread stopped.\n");
             } else {
                 printf("Error stopping OOM thread: %d\n", s);
diff --git a/kernel/lib/pci/include/lib/pci/pio.h b/kernel/lib/pci/include/lib/pci/pio.h
index d1c8e8d..574e7a4 100644
--- a/kernel/lib/pci/include/lib/pci/pio.h
+++ b/kernel/lib/pci/include/lib/pci/pio.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 namespace Pci {
     constexpr uint32_t PciBdfAddr(uint8_t bus, uint8_t dev, uint8_t func, uint8_t off) {
@@ -15,10 +15,10 @@
                 (off & 0xFC));         // bits 7-2 register, bits 1 & 0 must be zero
     }
 
-    mx_status_t PioCfgRead(uint32_t addr, uint32_t* val, size_t width);
-    mx_status_t PioCfgRead(uint8_t bus, uint8_t dev, uint8_t func, uint8_t offset,
+    zx_status_t PioCfgRead(uint32_t addr, uint32_t* val, size_t width);
+    zx_status_t PioCfgRead(uint8_t bus, uint8_t dev, uint8_t func, uint8_t offset,
             uint32_t* val, size_t width);
-    mx_status_t PioCfgWrite(uint32_t addr, uint32_t val, size_t width);
-    mx_status_t PioCfgWrite(uint8_t bus, uint8_t dev, uint8_t func, uint8_t offset,
+    zx_status_t PioCfgWrite(uint32_t addr, uint32_t val, size_t width);
+    zx_status_t PioCfgWrite(uint8_t bus, uint8_t dev, uint8_t func, uint8_t offset,
             uint32_t val, size_t width);
 }
diff --git a/kernel/lib/pci/pio.cpp b/kernel/lib/pci/pio.cpp
index 9d66fd4..e256740 100644
--- a/kernel/lib/pci/pio.cpp
+++ b/kernel/lib/pci/pio.cpp
@@ -4,7 +4,7 @@
 #include <assert.h>
 #include <endian.h>
 #include <kernel/mutex.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <lib/pci/pio.h>
 #include <kernel/auto_lock.h>
 
@@ -28,12 +28,12 @@
     return (width == 32) ? 0xffffffff : (1u << width) - 1u;
 }
 
-mx_status_t PioCfgRead(uint32_t addr, uint32_t* val, size_t width) {
+zx_status_t PioCfgRead(uint32_t addr, uint32_t* val, size_t width) {
     fbl::AutoLock lock(&pio_lock);
 
     size_t shift = (addr & 0x3) * 8u;
     if (shift + width > 32) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     outpd(kPciConfigAddr, addr | kPciCfgEnable);;
@@ -42,20 +42,20 @@
 
     // Align the read to the correct offset, then mask based on byte width
     *val = (tmp_val >> shift) & width_mask;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t PioCfgRead(uint8_t bus, uint8_t dev, uint8_t func,
+zx_status_t PioCfgRead(uint8_t bus, uint8_t dev, uint8_t func,
                              uint8_t offset, uint32_t* val, size_t width) {
     return PioCfgRead(PciBdfAddr(bus, dev, func, offset), val, width);
 }
 
-mx_status_t PioCfgWrite(uint32_t addr, uint32_t val, size_t width) {
+zx_status_t PioCfgWrite(uint32_t addr, uint32_t val, size_t width) {
     fbl::AutoLock lock(&pio_lock);
 
     size_t shift = (addr & 0x3) * 8u;
     if (shift + width > 32) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uint32_t width_mask = WidthMask(width);
@@ -68,31 +68,31 @@
     tmp_val |= (val << shift);
     outpd(kPciConfigData, LE32(tmp_val));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t PioCfgWrite(uint8_t bus, uint8_t dev, uint8_t func,
+zx_status_t PioCfgWrite(uint8_t bus, uint8_t dev, uint8_t func,
                               uint8_t offset, uint32_t val, size_t width) {
     return PioCfgWrite(PciBdfAddr(bus, dev, func, offset), val, width);
 }
 
 #else // not x86
-mx_status_t PioCfgRead(uint32_t addr, uint32_t* val, size_t width) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t PioCfgRead(uint32_t addr, uint32_t* val, size_t width) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t PioCfgRead(uint8_t bus, uint8_t dev, uint8_t func, uint8_t offset,
+zx_status_t PioCfgRead(uint8_t bus, uint8_t dev, uint8_t func, uint8_t offset,
                              uint32_t* val, size_t width) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t PioCfgWrite(uint32_t addr, uint32_t val, size_t width) {
-    return MX_ERR_NOT_SUPPORTED;;
+zx_status_t PioCfgWrite(uint32_t addr, uint32_t val, size_t width) {
+    return ZX_ERR_NOT_SUPPORTED;;
 }
 
-mx_status_t PioCfgWrite(uint8_t bus, uint8_t dev, uint8_t func, uint8_t offset,
+zx_status_t PioCfgWrite(uint8_t bus, uint8_t dev, uint8_t func, uint8_t offset,
                              uint32_t val, size_t width) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 #endif // ARCH_X86
diff --git a/kernel/lib/pow2_range_allocator/include/lib/pow2_range_allocator.h b/kernel/lib/pow2_range_allocator/include/lib/pow2_range_allocator.h
index 8f2a86b..dc6fad0 100644
--- a/kernel/lib/pow2_range_allocator/include/lib/pow2_range_allocator.h
+++ b/kernel/lib/pow2_range_allocator/include/lib/pow2_range_allocator.h
@@ -11,7 +11,7 @@
 #include <err.h>
 #include <kernel/mutex.h>
 #include <list.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
@@ -47,7 +47,7 @@
  *
  * @return A status code indicating the success or failure of the operation.
  */
-mx_status_t p2ra_init(p2ra_state_t* state, uint max_alloc_size);
+zx_status_t p2ra_init(p2ra_state_t* state, uint max_alloc_size);
 
 /**
  * Free all of the state associated with a previously initialized pow2 range
@@ -66,14 +66,14 @@
  *
  * @return A status code incidcating the success or failure of the operation.
  * Possible return values include
- * ++ MX_ERR_INVALID_ARGS range_len is zero, or would cause the range to wrap the
+ * ++ ZX_ERR_INVALID_ARGS range_len is zero, or would cause the range to wrap the
  *    maximum range of a uint.
- * ++ MX_ERR_ALREADY_EXISTS the specified range overlaps with a range already added
+ * ++ ZX_ERR_ALREADY_EXISTS the specified range overlaps with a range already added
  *    to the allocator.
- * ++ MX_ERR_NO_MEMORY Not enough memory to allocate the bookkeeping required for
+ * ++ ZX_ERR_NO_MEMORY Not enough memory to allocate the bookkeeping required for
  *    managing the range.
  */
-mx_status_t p2ra_add_range(p2ra_state_t* state, uint range_start, uint range_len);
+zx_status_t p2ra_add_range(p2ra_state_t* state, uint range_start, uint range_len);
 
 /**
  * Attempt to allocate a range of uints from the available sub-ranges.  The
@@ -88,16 +88,16 @@
  *
  * @return A status code indicating the success or failure of the operation.
  * Possible return values include
- * ++ MX_ERR_INVALID_ARGS Multiple reasons, including...
+ * ++ ZX_ERR_INVALID_ARGS Multiple reasons, including...
  *    ++ size is zero.
  *    ++ size is not a power of two.
  *    ++ out_range_start is NULL.
- * ++ MX_ERR_NO_RESOURCES No contiguous, aligned region could be found to satisfy
+ * ++ ZX_ERR_NO_RESOURCES No contiguous, aligned region could be found to satisfy
  *    the allocation request.
- * ++ MX_ERR_NO_MEMORY A region could be found, but memory required for bookkeeping
+ * ++ ZX_ERR_NO_MEMORY A region could be found, but memory required for bookkeeping
  *    could not be allocated.
  */
-mx_status_t p2ra_allocate_range(p2ra_state_t* state, uint size, uint* out_range_start);
+zx_status_t p2ra_allocate_range(p2ra_state_t* state, uint size, uint* out_range_start);
 
 /**
  * Free a range previously allocated using p2ra_allocate_range.
diff --git a/kernel/lib/pow2_range_allocator/pow2_range_allocator.c b/kernel/lib/pow2_range_allocator/pow2_range_allocator.c
index 674027c..7d77f46 100644
--- a/kernel/lib/pow2_range_allocator/pow2_range_allocator.c
+++ b/kernel/lib/pow2_range_allocator/pow2_range_allocator.c
@@ -124,13 +124,13 @@
 }
 
 
-mx_status_t p2ra_init(p2ra_state_t* state, uint max_alloc_size) {
+zx_status_t p2ra_init(p2ra_state_t* state, uint max_alloc_size) {
     if (!state)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (!max_alloc_size || !ispow2(max_alloc_size)) {
         TRACEF("max_alloc_size (%u) is not an integer power of two!\n", max_alloc_size);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     /* Allocate the storage for our free buckets */
@@ -138,7 +138,7 @@
     state->free_block_buckets = malloc(state->bucket_count * sizeof(state->free_block_buckets[0]));
     if (!state->free_block_buckets) {
         TRACEF("Failed to allocate storage for %u free bucket lists!\n", state->bucket_count);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     /* Initialize the rest of our bookeeping */
@@ -149,7 +149,7 @@
     for (uint i = 0; i < state->bucket_count; ++i)
         list_initialize(&state->free_block_buckets[i]);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void p2ra_free(p2ra_state_t* state) {
@@ -168,15 +168,15 @@
     memset(state, 0, sizeof(*state));
 }
 
-mx_status_t p2ra_add_range(p2ra_state_t* state, uint range_start, uint range_len) {
+zx_status_t p2ra_add_range(p2ra_state_t* state, uint range_start, uint range_len) {
     LTRACEF("Adding range [%u, %u]\n", range_start, range_start + range_len - 1);
 
     if (!state      ||
         !range_len  ||
         ((range_start + range_len) < range_start))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
-    mx_status_t      ret       = MX_OK;
+    zx_status_t      ret       = ZX_OK;
     p2ra_range_t*    new_range = NULL;
     struct list_node new_blocks;
     list_initialize(&new_blocks);
@@ -191,7 +191,7 @@
             TRACEF("Range [%u, %u] overlaps with existing range [%u, %u].\n",
                     range_start,  range_start  + range_len  - 1,
                     range->start, range->start + range->len - 1);
-            ret = MX_ERR_ALREADY_EXISTS;
+            ret = ZX_ERR_ALREADY_EXISTS;
             goto finished;
         }
     }
@@ -199,7 +199,7 @@
     /* Allocate our range state */
     new_range = calloc(1, sizeof(*new_range));
     if (!new_range) {
-        ret = MX_ERR_NO_MEMORY;
+        ret = ZX_ERR_NO_MEMORY;
         goto finished;
     }
     new_range->start = range_start;
@@ -247,7 +247,7 @@
             TRACEF("WARNING! Failed to allocate block bookkeeping with sub-range "
                    "[%u, %u] still left to track.\n",
                    range_start, range_start + range_len - 1);
-            ret = MX_ERR_NO_MEMORY;
+            ret = ZX_ERR_NO_MEMORY;
             goto finished;
         }
 
@@ -271,7 +271,7 @@
 finished:
     mutex_release(&state->lock);
 
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         if (new_range) {
             DEBUG_ASSERT(!list_in_list(&new_range->node));
             free(new_range);
@@ -283,13 +283,13 @@
     return ret;
 }
 
-mx_status_t p2ra_allocate_range(p2ra_state_t* state, uint size, uint* out_range_start) {
+zx_status_t p2ra_allocate_range(p2ra_state_t* state, uint size, uint* out_range_start) {
     if (!state || !out_range_start)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (!size || !ispow2(size)) {
         TRACEF("Size (%u) is not an integer power of 2.\n", size);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uint orig_bucket = log2_uint_floor(size);
@@ -297,12 +297,12 @@
     if (bucket >= state->bucket_count) {
         TRACEF("Invalid size (%u).  Valid sizes are integer powers of 2 from [1, %u]\n",
                 size, 1u << (state->bucket_count - 1));
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     /* Lock state during allocation */
     p2ra_block_t* block = NULL;
-    mx_status_t   ret   = MX_OK;
+    zx_status_t   ret   = ZX_OK;
     mutex_acquire(&state->lock);
 
     /* Find the smallest sized chunk which can hold the allocation and is
@@ -316,7 +316,7 @@
 
     /* Nothing found, unlock and get out */
     if (!block) {
-        ret = MX_ERR_NO_RESOURCES;
+        ret = ZX_ERR_NO_RESOURCES;
         goto finished;
     }
 
@@ -335,7 +335,7 @@
             TRACEF("Failed to allocated free bookkeeping block when attempting to "
                    "split for allocation\n");
             p2ra_return_free_block(state, block, true);
-            ret = MX_ERR_NO_MEMORY;
+            ret = ZX_ERR_NO_MEMORY;
             goto finished;
         }
 
diff --git a/kernel/lib/syscalls/bootdata_unittest.cpp b/kernel/lib/syscalls/bootdata_unittest.cpp
index cec0fe8..3934587 100644
--- a/kernel/lib/syscalls/bootdata_unittest.cpp
+++ b/kernel/lib/syscalls/bootdata_unittest.cpp
@@ -10,8 +10,8 @@
 //                the method that it tests lives inside syscalls_system.cpp
 
 #include <assert.h>
-#include <magenta/boot/bootdata.h>
-#include <magenta/types.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/types.h>
 #include <mexec.h>
 #include <stddef.h>
 #include <unittest.h>
@@ -55,11 +55,11 @@
 
     // Deliberately attempt to overflow the bootdata.
     uint8_t bootdata_section[kBootdataBufferLen + 1];
-    mx_status_t result = bootdata_append_section(bootdata_buffer, kBootdataBufferLen,
+    zx_status_t result = bootdata_append_section(bootdata_buffer, kBootdataBufferLen,
                                                  bootdata_section, sizeof(bootdata_section),
                                                  0x0, 0x0, 0x0);
 
-    EXPECT_EQ(result, MX_ERR_BUFFER_TOO_SMALL, "append boot section");
+    EXPECT_EQ(result, ZX_ERR_BUFFER_TOO_SMALL, "append boot section");
 
     // Make sure that we didn't touch any of the overflow buffer.
     EXPECT_TRUE(sentinel_integrity_okay(bootdata_sentinel, kBootdataSentinelLen),
@@ -87,11 +87,11 @@
     uint8_t bootdata_section[kSectionSize];
     memset(bootdata_section, kBootdataSectionContentsByte, kSectionSize);
 
-    mx_status_t result = bootdata_append_section(bootdata_buffer, kBootdataBufferLen,
+    zx_status_t result = bootdata_append_section(bootdata_buffer, kBootdataBufferLen,
                                                  bootdata_section, kSectionSize,
                                                  0x0, 0x0, 0x0);
 
-    EXPECT_EQ(MX_OK, result, "fill whole bootdata buffer");
+    EXPECT_EQ(ZX_OK, result, "fill whole bootdata buffer");
 
     EXPECT_TRUE(sentinel_integrity_okay(bootdata_sentinel, kBootdataSentinelLen),
                 "check sentinel integrity");
diff --git a/kernel/lib/syscalls/rules.mk b/kernel/lib/syscalls/rules.mk
index b1b991c..5f7db4e 100644
--- a/kernel/lib/syscalls/rules.mk
+++ b/kernel/lib/syscalls/rules.mk
@@ -30,7 +30,7 @@
     $(LOCAL_DIR)/syscalls_futex.cpp \
     $(LOCAL_DIR)/syscalls_handle_ops.cpp \
     $(LOCAL_DIR)/syscalls_hypervisor.cpp \
-    $(LOCAL_DIR)/syscalls_magenta.cpp \
+    $(LOCAL_DIR)/syscalls_zircon.cpp \
     $(LOCAL_DIR)/syscalls_object.cpp \
     $(LOCAL_DIR)/syscalls_object_wait.cpp \
     $(LOCAL_DIR)/syscalls_port.cpp \
diff --git a/kernel/lib/syscalls/syscalls.cpp b/kernel/lib/syscalls/syscalls.cpp
index 1fa4174..3e41e5d 100644
--- a/kernel/lib/syscalls/syscalls.cpp
+++ b/kernel/lib/syscalls/syscalls.cpp
@@ -9,7 +9,7 @@
 #include <kernel/thread.h>
 #include <lib/ktrace.h>
 #include <lib/vdso.h>
-#include <magenta/mx-syscall-numbers.h>
+#include <zircon/zx-syscall-numbers.h>
 #include <object/process_dispatcher.h>
 #include <platform.h>
 #include <trace.h>
@@ -27,7 +27,7 @@
     LTRACEF("invalid syscall %lu from PC %#lx vDSO code %#lx\n",
             num, pc, vdso_code_address);
     thread_signal_policy_exception();
-    return MX_ERR_BAD_SYSCALL;
+    return ZX_ERR_BAD_SYSCALL;
 }
 
 inline uint64_t invoke_syscall(
@@ -47,7 +47,7 @@
     } while (0)
 
     switch (syscall_num) {
-#include <magenta/syscall-invocation-cases.inc>
+#include <zircon/syscall-invocation-cases.inc>
     default:
         return sys_invalid_syscall(syscall_num, pc, vdso_code_address);
     }
@@ -145,11 +145,11 @@
                       [](uintptr_t) { return false; },
                       [&]() {
                           __builtin_unreachable();
-                          return MX_ERR_INTERNAL;
+                          return ZX_ERR_INTERNAL;
                       });
 }
 
 #endif
 
 // Autogenerated per-syscall wrapper functions.
-#include <magenta/syscall-kernel-wrappers.inc>
+#include <zircon/syscall-kernel-wrappers.inc>
diff --git a/kernel/lib/syscalls/syscalls_channel.cpp b/kernel/lib/syscalls/syscalls_channel.cpp
index f243e1e..537c0ae 100644
--- a/kernel/lib/syscalls/syscalls_channel.cpp
+++ b/kernel/lib/syscalls/syscalls_channel.cpp
@@ -10,7 +10,7 @@
 
 #include <lib/ktrace.h>
 
-#include <magenta/syscalls/policy.h>
+#include <zircon/syscalls/policy.h>
 #include <object/channel_dispatcher.h>
 #include <object/handle_owner.h>
 #include <object/handles.h>
@@ -27,22 +27,22 @@
 
 #define LOCAL_TRACE 0
 
-mx_status_t sys_channel_create(
-    uint32_t options, user_ptr<mx_handle_t> out0, user_ptr<mx_handle_t> out1) {
+zx_status_t sys_channel_create(
+    uint32_t options, user_ptr<zx_handle_t> out0, user_ptr<zx_handle_t> out1) {
     LTRACEF("out_handles %p,%p\n", out0.get(), out1.get());
 
     if (options != 0u)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
-    mx_status_t res = up->QueryPolicy(MX_POL_NEW_CHANNEL);
-    if (res != MX_OK)
+    zx_status_t res = up->QueryPolicy(ZX_POL_NEW_CHANNEL);
+    if (res != ZX_OK)
         return res;
 
     fbl::RefPtr<Dispatcher> mpd0, mpd1;
-    mx_rights_t rights;
-    mx_status_t result = ChannelDispatcher::Create(&mpd0, &mpd1, &rights);
-    if (result != MX_OK)
+    zx_rights_t rights;
+    zx_status_t result = ChannelDispatcher::Create(&mpd0, &mpd1, &rights);
+    if (result != ZX_OK)
         return result;
 
     uint64_t id0 = mpd0->get_koid();
@@ -50,30 +50,30 @@
 
     HandleOwner h0(MakeHandle(fbl::move(mpd0), rights));
     if (!h0)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     HandleOwner h1(MakeHandle(fbl::move(mpd1), rights));
     if (!h1)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    if (out0.copy_to_user(up->MapHandleToValue(h0)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-    if (out1.copy_to_user(up->MapHandleToValue(h1)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (out0.copy_to_user(up->MapHandleToValue(h0)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+    if (out1.copy_to_user(up->MapHandleToValue(h1)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(h0));
     up->AddHandle(fbl::move(h1));
 
     ktrace(TAG_CHANNEL_CREATE, (uint32_t)id0, (uint32_t)id1, options, 0);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void msg_get_handles(ProcessDispatcher* up, MessagePacket* msg,
-                            user_ptr<mx_handle_t> handles, uint32_t num_handles) {
+                            user_ptr<zx_handle_t> handles, uint32_t num_handles) {
     Handle* const* handle_list = msg->handles();
     msg->set_owns_handles(false);
 
-    mx_handle_t hvs[kMaxMessageHandles];
+    zx_handle_t hvs[kMaxMessageHandles];
     for (size_t i = 0; i < num_handles; ++i) {
         hvs[i] = up->MapHandleToValue(handle_list[i]);
     }
@@ -88,8 +88,8 @@
     }
 }
 
-mx_status_t sys_channel_read(mx_handle_t handle_value, uint32_t options,
-                             user_ptr<void> bytes, user_ptr<mx_handle_t> handles,
+zx_status_t sys_channel_read(zx_handle_t handle_value, uint32_t options,
+                             user_ptr<void> bytes, user_ptr<zx_handle_t> handles,
                              uint32_t num_bytes, uint32_t num_handles,
                              user_ptr<uint32_t> actual_bytes, user_ptr<uint32_t> actual_handles) {
     LTRACEF("handle %x bytes %p num_bytes %p handles %p num_handles %p",
@@ -98,36 +98,36 @@
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<ChannelDispatcher> channel;
-    mx_status_t result = up->GetDispatcherWithRights(handle_value, MX_RIGHT_READ, &channel);
-    if (result != MX_OK)
+    zx_status_t result = up->GetDispatcherWithRights(handle_value, ZX_RIGHT_READ, &channel);
+    if (result != ZX_OK)
         return result;
 
     // Currently MAY_DISCARD is the only allowable option.
-    if (options & ~MX_CHANNEL_READ_MAY_DISCARD)
-        return MX_ERR_NOT_SUPPORTED;
+    if (options & ~ZX_CHANNEL_READ_MAY_DISCARD)
+        return ZX_ERR_NOT_SUPPORTED;
 
     fbl::unique_ptr<MessagePacket> msg;
     result = channel->Read(&num_bytes, &num_handles, &msg,
-                           options & MX_CHANNEL_READ_MAY_DISCARD);
-    if (result != MX_OK && result != MX_ERR_BUFFER_TOO_SMALL)
+                           options & ZX_CHANNEL_READ_MAY_DISCARD);
+    if (result != ZX_OK && result != ZX_ERR_BUFFER_TOO_SMALL)
         return result;
 
-    // On MX_ERR_BUFFER_TOO_SMALL, Read() gives us the size of the next message (which remains
-    // unconsumed, unless |options| has MX_CHANNEL_READ_MAY_DISCARD set).
+    // On ZX_ERR_BUFFER_TOO_SMALL, Read() gives us the size of the next message (which remains
+    // unconsumed, unless |options| has ZX_CHANNEL_READ_MAY_DISCARD set).
     if (actual_bytes) {
-        if (actual_bytes.copy_to_user(num_bytes) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+        if (actual_bytes.copy_to_user(num_bytes) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
     }
     if (actual_handles) {
-        if (actual_handles.copy_to_user(num_handles) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+        if (actual_handles.copy_to_user(num_handles) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
     }
-    if (result == MX_ERR_BUFFER_TOO_SMALL)
+    if (result == ZX_ERR_BUFFER_TOO_SMALL)
         return result;
 
     if (num_bytes > 0u) {
-        if (msg->CopyDataTo(bytes) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+        if (msg->CopyDataTo(bytes) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
     }
 
     // The documented public API states that that writing to the handles buffer
@@ -140,70 +140,70 @@
     return result;
 }
 
-static mx_status_t channel_read_out(ProcessDispatcher* up,
+static zx_status_t channel_read_out(ProcessDispatcher* up,
                                     fbl::unique_ptr<MessagePacket> reply,
-                                    mx_channel_call_args_t* args,
+                                    zx_channel_call_args_t* args,
                                     user_ptr<uint32_t> actual_bytes,
                                     user_ptr<uint32_t> actual_handles) {
     uint32_t num_bytes = reply->data_size();
     uint32_t num_handles = reply->num_handles();
 
     if ((args->rd_num_bytes < num_bytes) || (args->rd_num_handles < num_handles)) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
 
-    if (actual_bytes.copy_to_user(num_bytes) != MX_OK) {
-        return MX_ERR_INVALID_ARGS;
+    if (actual_bytes.copy_to_user(num_bytes) != ZX_OK) {
+        return ZX_ERR_INVALID_ARGS;
     }
-    if (actual_handles.copy_to_user(num_handles) != MX_OK) {
-        return MX_ERR_INVALID_ARGS;
+    if (actual_handles.copy_to_user(num_handles) != ZX_OK) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (num_bytes > 0u) {
-        if (reply->CopyDataTo(make_user_ptr(args->rd_bytes)) != MX_OK) {
-            return MX_ERR_INVALID_ARGS;
+        if (reply->CopyDataTo(make_user_ptr(args->rd_bytes)) != ZX_OK) {
+            return ZX_ERR_INVALID_ARGS;
         }
     }
 
     if (num_handles > 0u) {
         msg_get_handles(up, reply.get(), make_user_ptr(args->rd_handles), num_handles);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Handles generating the final results for call successes and read-half failures.
-static mx_status_t channel_call_epilogue(ProcessDispatcher* up,
+static zx_status_t channel_call_epilogue(ProcessDispatcher* up,
                                          fbl::unique_ptr<MessagePacket> reply,
-                                         mx_channel_call_args_t* args,
-                                         mx_status_t call_status,
+                                         zx_channel_call_args_t* args,
+                                         zx_status_t call_status,
                                          user_ptr<uint32_t> actual_bytes,
                                          user_ptr<uint32_t> actual_handles,
-                                         user_ptr<mx_status_t> read_status) {
+                                         user_ptr<zx_status_t> read_status) {
     // Timeout is always returned directly.
-    if (call_status == MX_ERR_TIMED_OUT) {
+    if (call_status == ZX_ERR_TIMED_OUT) {
         return call_status;
     }
 
-    if (call_status == MX_OK) {
+    if (call_status == ZX_OK) {
         call_status = channel_read_out(up, fbl::move(reply), args, actual_bytes, actual_handles);
     }
 
-    if (call_status != MX_OK) {
+    if (call_status != ZX_OK) {
         if (read_status) {
             read_status.copy_to_user(call_status);
         }
-        return MX_ERR_CALL_FAILED;
+        return ZX_ERR_CALL_FAILED;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t msg_put_handles(ProcessDispatcher* up, MessagePacket* msg, mx_handle_t* handles,
-                                   user_ptr<const mx_handle_t> user_handles, uint32_t num_user_handles,
+static zx_status_t msg_put_handles(ProcessDispatcher* up, MessagePacket* msg, zx_handle_t* handles,
+                                   user_ptr<const zx_handle_t> user_handles, uint32_t num_user_handles,
                                    Dispatcher* channel) {
 
-    if (user_handles.copy_array_from_user(handles, num_user_handles) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (user_handles.copy_array_from_user(handles, num_user_handles) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     {
         // Loop twice, first we collect and validate handles, the second pass
@@ -213,16 +213,16 @@
         for (size_t ix = 0; ix != num_user_handles; ++ix) {
             auto handle = up->GetHandleLocked(handles[ix]);
             if (!handle)
-                return MX_ERR_BAD_HANDLE;
+                return ZX_ERR_BAD_HANDLE;
 
             if (handle->dispatcher().get() == channel) {
                 // You may not write a channel endpoint handle
                 // into that channel endpoint
-                return MX_ERR_NOT_SUPPORTED;
+                return ZX_ERR_NOT_SUPPORTED;
             }
 
-            if (!handle->HasRights(MX_RIGHT_TRANSFER))
-                return MX_ERR_ACCESS_DENIED;
+            if (!handle->HasRights(ZX_RIGHT_TRANSFER))
+                return ZX_ERR_ACCESS_DENIED;
 
             msg->mutable_handles()[ix] = handle;
         }
@@ -237,39 +237,39 @@
                     up->UndoRemoveHandleLocked(handles[idx]);
                 }
                 // TODO(MG-968): more specific error?
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
         }
     }
 
     // On success, the MessagePacket owns the handles.
     msg->set_owns_handles(true);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_channel_write(mx_handle_t handle_value, uint32_t options,
+zx_status_t sys_channel_write(zx_handle_t handle_value, uint32_t options,
                               user_ptr<const void> user_bytes, uint32_t num_bytes,
-                              user_ptr<const mx_handle_t> user_handles, uint32_t num_handles) {
+                              user_ptr<const zx_handle_t> user_handles, uint32_t num_handles) {
     LTRACEF("handle %x bytes %p num_bytes %u handles %p num_handles %u options 0x%x\n",
             handle_value, user_bytes.get(), num_bytes, user_handles.get(), num_handles, options);
 
     if (options)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<ChannelDispatcher> channel;
-    mx_status_t result = up->GetDispatcherWithRights(handle_value, MX_RIGHT_WRITE, &channel);
-    if (result != MX_OK)
+    zx_status_t result = up->GetDispatcherWithRights(handle_value, ZX_RIGHT_WRITE, &channel);
+    if (result != ZX_OK)
         return result;
 
 
     fbl::unique_ptr<MessagePacket> msg;
     result = MessagePacket::Create(user_bytes, num_bytes, num_handles, &msg);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
-    mx_handle_t handles[kMaxMessageHandles];
+    zx_handle_t handles[kMaxMessageHandles];
     if (num_handles > 0u) {
         result = msg_put_handles(up, msg.get(), handles, user_handles, num_handles,
                                  static_cast<Dispatcher*>(channel.get()));
@@ -278,7 +278,7 @@
     }
 
     result = channel->Write(fbl::move(msg));
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         // Write failed, put back the handles into this process.
         AutoLock lock(up->handle_table_lock());
         for (size_t ix = 0; ix != num_handles; ++ix) {
@@ -288,22 +288,22 @@
     }
 
     ktrace(TAG_CHANNEL_WRITE, (uint32_t)channel->get_koid(), num_bytes, num_handles, 0);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_channel_call_noretry(mx_handle_t handle_value, uint32_t options,
-                                     mx_time_t deadline,
-                                     user_ptr<const mx_channel_call_args_t> user_args,
+zx_status_t sys_channel_call_noretry(zx_handle_t handle_value, uint32_t options,
+                                     zx_time_t deadline,
+                                     user_ptr<const zx_channel_call_args_t> user_args,
                                      user_ptr<uint32_t> actual_bytes,
                                      user_ptr<uint32_t> actual_handles,
-                                     user_ptr<mx_status_t> read_status) {
-    mx_channel_call_args_t args;
+                                     user_ptr<zx_status_t> read_status) {
+    zx_channel_call_args_t args;
 
-    if (user_args.copy_from_user(&args) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (user_args.copy_from_user(&args) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     if (options)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     uint32_t num_bytes = args.wr_num_bytes;
     uint32_t num_handles = args.wr_num_handles;
@@ -311,22 +311,22 @@
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<ChannelDispatcher> channel;
-    mx_status_t result =
-        up->GetDispatcherWithRights(handle_value, MX_RIGHT_WRITE | MX_RIGHT_READ, &channel);
-    if (result != MX_OK)
+    zx_status_t result =
+        up->GetDispatcherWithRights(handle_value, ZX_RIGHT_WRITE | ZX_RIGHT_READ, &channel);
+    if (result != ZX_OK)
         return result;
 
     // Prepare a MessagePacket for writing
     fbl::unique_ptr<MessagePacket> msg;
     result = MessagePacket::Create(make_user_ptr<const void>(args.wr_bytes),
                                    num_bytes, num_handles, &msg);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
-    mx_handle_t handles[kMaxMessageHandles];
+    zx_handle_t handles[kMaxMessageHandles];
     if (num_handles > 0u) {
         result = msg_put_handles(up, msg.get(), handles,
-                                 make_user_ptr<const mx_handle_t>(args.wr_handles), num_handles,
+                                 make_user_ptr<const zx_handle_t>(args.wr_handles), num_handles,
                                  static_cast<Dispatcher*>(channel.get()));
         if (result)
             return result;
@@ -337,7 +337,7 @@
     // Write message and wait for reply, deadline, or cancelation
     bool return_handles = false;
     fbl::unique_ptr<MessagePacket> reply;
-    if ((result = channel->Call(fbl::move(msg), deadline, &return_handles, &reply)) != MX_OK) {
+    if ((result = channel->Call(fbl::move(msg), deadline, &return_handles, &reply)) != ZX_OK) {
         if (return_handles) {
             // Write phase failed:
             // 1. Put back the handles into this process.
@@ -346,8 +346,8 @@
                 up->UndoRemoveHandleLocked(handles[ix]);
             }
             // 2. Return error directly.  Note that the write phase cannot fail
-            // with MX_ERR_INTERNAL_INTR_RETRY.
-            DEBUG_ASSERT(result != MX_ERR_INTERNAL_INTR_RETRY);
+            // with ZX_ERR_INTERNAL_INTR_RETRY.
+            DEBUG_ASSERT(result != ZX_ERR_INTERNAL_INTR_RETRY);
             return result;
         }
     }
@@ -355,25 +355,25 @@
                                  actual_bytes, actual_handles, read_status);
 }
 
-mx_status_t sys_channel_call_finish(mx_time_t deadline,
-                                    user_ptr<const mx_channel_call_args_t> user_args,
+zx_status_t sys_channel_call_finish(zx_time_t deadline,
+                                    user_ptr<const zx_channel_call_args_t> user_args,
                                     user_ptr<uint32_t> actual_bytes,
                                     user_ptr<uint32_t> actual_handles,
-                                    user_ptr<mx_status_t> read_status) {
+                                    user_ptr<zx_status_t> read_status) {
 
-    mx_channel_call_args_t args;
-    if (user_args.copy_from_user(&args) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    zx_channel_call_args_t args;
+    if (user_args.copy_from_user(&args) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     auto waiter = ThreadDispatcher::GetCurrent()->GetMessageWaiter();
     fbl::RefPtr<ChannelDispatcher> channel = waiter->get_channel();
     if (!channel)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     fbl::unique_ptr<MessagePacket> reply;
-    mx_status_t result = channel->ResumeInterruptedCall(
+    zx_status_t result = channel->ResumeInterruptedCall(
         waiter, deadline, &reply);
     return channel_call_epilogue(up, fbl::move(reply), &args, result,
                                  actual_bytes, actual_handles, read_status);
diff --git a/kernel/lib/syscalls/syscalls_ddk.cpp b/kernel/lib/syscalls/syscalls_ddk.cpp
index 7f59715..02c6f60 100644
--- a/kernel/lib/syscalls/syscalls_ddk.cpp
+++ b/kernel/lib/syscalls/syscalls_ddk.cpp
@@ -30,101 +30,101 @@
 #include <platform/pc/bootloader.h>
 #endif
 
-#include <magenta/syscalls/pci.h>
+#include <zircon/syscalls/pci.h>
 
 #include "syscalls_priv.h"
 
 #define LOCAL_TRACE 0
 
-static_assert(MX_CACHE_POLICY_CACHED == ARCH_MMU_FLAG_CACHED,
+static_assert(ZX_CACHE_POLICY_CACHED == ARCH_MMU_FLAG_CACHED,
               "Cache policy constant mismatch - CACHED");
-static_assert(MX_CACHE_POLICY_UNCACHED == ARCH_MMU_FLAG_UNCACHED,
+static_assert(ZX_CACHE_POLICY_UNCACHED == ARCH_MMU_FLAG_UNCACHED,
               "Cache policy constant mismatch - UNCACHED");
-static_assert(MX_CACHE_POLICY_UNCACHED_DEVICE == ARCH_MMU_FLAG_UNCACHED_DEVICE,
+static_assert(ZX_CACHE_POLICY_UNCACHED_DEVICE == ARCH_MMU_FLAG_UNCACHED_DEVICE,
               "Cache policy constant mismatch - UNCACHED_DEVICE");
-static_assert(MX_CACHE_POLICY_WRITE_COMBINING == ARCH_MMU_FLAG_WRITE_COMBINING,
+static_assert(ZX_CACHE_POLICY_WRITE_COMBINING == ARCH_MMU_FLAG_WRITE_COMBINING,
               "Cache policy constant mismatch - WRITE_COMBINING");
 
-mx_status_t sys_interrupt_create(mx_handle_t hrsrc, uint32_t vector, uint32_t options,
-                                 user_ptr<mx_handle_t> out_handle) {
+zx_status_t sys_interrupt_create(zx_handle_t hrsrc, uint32_t vector, uint32_t options,
+                                 user_ptr<zx_handle_t> out_handle) {
     LTRACEF("vector %u options 0x%x\n", vector, options);
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = validate_resource_irq(hrsrc, vector)) < 0) {
         return status;
     }
 
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
-    mx_status_t result = InterruptEventDispatcher::Create(vector, options, &dispatcher, &rights);
-    if (result != MX_OK)
+    zx_rights_t rights;
+    zx_status_t result = InterruptEventDispatcher::Create(vector, options, &dispatcher, &rights);
+    if (result != ZX_OK)
         return result;
 
     HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
 
     auto up = ProcessDispatcher::GetCurrent();
-    mx_handle_t hv = up->MapHandleToValue(handle);
+    zx_handle_t hv = up->MapHandleToValue(handle);
 
-    if (out_handle.copy_to_user(hv) != MX_OK) {
-        return MX_ERR_INVALID_ARGS;
+    if (out_handle.copy_to_user(hv) != ZX_OK) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
     up->AddHandle(fbl::move(handle));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_interrupt_complete(mx_handle_t handle_value) {
+zx_status_t sys_interrupt_complete(zx_handle_t handle_value) {
     LTRACEF("handle %x\n", handle_value);
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<InterruptDispatcher> interrupt;
-    mx_status_t status = up->GetDispatcher(handle_value, &interrupt);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcher(handle_value, &interrupt);
+    if (status != ZX_OK)
         return status;
 
     return interrupt->InterruptComplete();
 }
 
-mx_status_t sys_interrupt_wait(mx_handle_t handle_value) {
+zx_status_t sys_interrupt_wait(zx_handle_t handle_value) {
     LTRACEF("handle %x\n", handle_value);
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<InterruptDispatcher> interrupt;
-    mx_status_t status = up->GetDispatcher(handle_value, &interrupt);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcher(handle_value, &interrupt);
+    if (status != ZX_OK)
         return status;
 
     return interrupt->WaitForInterrupt();
 }
 
-mx_status_t sys_interrupt_signal(mx_handle_t handle_value) {
+zx_status_t sys_interrupt_signal(zx_handle_t handle_value) {
     LTRACEF("handle %x\n", handle_value);
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<InterruptDispatcher> interrupt;
-    mx_status_t status = up->GetDispatcher(handle_value, &interrupt);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcher(handle_value, &interrupt);
+    if (status != ZX_OK)
         return status;
 
     return interrupt->UserSignal();
 }
 
-mx_status_t sys_vmo_create_contiguous(mx_handle_t hrsrc, size_t size,
+zx_status_t sys_vmo_create_contiguous(zx_handle_t hrsrc, size_t size,
                                       uint32_t alignment_log2,
-                                      user_ptr<mx_handle_t> _out) {
+                                      user_ptr<zx_handle_t> _out) {
     LTRACEF("size 0x%zu\n", size);
 
-    if (size == 0) return MX_ERR_INVALID_ARGS;
+    if (size == 0) return ZX_ERR_INVALID_ARGS;
     if (alignment_log2 == 0)
         alignment_log2 = PAGE_SIZE_SHIFT;
     // catch obviously wrong values
     if (alignment_log2 < PAGE_SIZE_SHIFT ||
             alignment_log2 >= (8 * sizeof(uint64_t)))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(hrsrc, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(hrsrc, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
@@ -132,7 +132,7 @@
     // create a vm object
     fbl::RefPtr<VmObject> vmo;
     status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, size, &vmo);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // always immediately commit memory to the object
@@ -143,37 +143,37 @@
     if (status < 0 || (size_t)committed < size) {
         LTRACEF("failed to allocate enough pages (asked for %zu, got %zu)\n", size / PAGE_SIZE,
                 (size_t)committed / PAGE_SIZE);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // create a Vm Object dispatcher
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
-    mx_status_t result = VmObjectDispatcher::Create(fbl::move(vmo), &dispatcher, &rights);
-    if (result != MX_OK)
+    zx_rights_t rights;
+    zx_status_t result = VmObjectDispatcher::Create(fbl::move(vmo), &dispatcher, &rights);
+    if (result != ZX_OK)
         return result;
 
     // create a handle and attach the dispatcher to it
     HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto up = ProcessDispatcher::GetCurrent();
 
-    if (_out.copy_to_user(up->MapHandleToValue(handle)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out.copy_to_user(up->MapHandleToValue(handle)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(handle));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_vmo_create_physical(mx_handle_t hrsrc, uintptr_t paddr, size_t size,
-                                    user_ptr<mx_handle_t> _out) {
+zx_status_t sys_vmo_create_physical(zx_handle_t hrsrc, uintptr_t paddr, size_t size,
+                                    user_ptr<zx_handle_t> _out) {
     LTRACEF("size 0x%zu\n", size);
 
     // TODO: attempting to create a physical VMO that points to memory should be an error
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = validate_resource_mmio(hrsrc, paddr, size)) < 0) {
         return status;
     }
@@ -182,52 +182,52 @@
 
     // create a vm object
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t result = VmObjectPhysical::Create(paddr, size, &vmo);
-    if (result != MX_OK) {
+    zx_status_t result = VmObjectPhysical::Create(paddr, size, &vmo);
+    if (result != ZX_OK) {
         return result;
     }
 
     // create a Vm Object dispatcher
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
+    zx_rights_t rights;
     result = VmObjectDispatcher::Create(fbl::move(vmo), &dispatcher, &rights);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     // create a handle and attach the dispatcher to it
     HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto up = ProcessDispatcher::GetCurrent();
 
-    if (_out.copy_to_user(up->MapHandleToValue(handle)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out.copy_to_user(up->MapHandleToValue(handle)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(handle));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_bootloader_fb_get_info(user_ptr<uint32_t> format, user_ptr<uint32_t> width, user_ptr<uint32_t> height, user_ptr<uint32_t> stride) {
+zx_status_t sys_bootloader_fb_get_info(user_ptr<uint32_t> format, user_ptr<uint32_t> width, user_ptr<uint32_t> height, user_ptr<uint32_t> stride) {
 #if ARCH_X86
     if (!bootloader.fb.base ||
             format.copy_to_user(bootloader.fb.format) ||
             width.copy_to_user(bootloader.fb.width) ||
             height.copy_to_user(bootloader.fb.height) ||
             stride.copy_to_user(bootloader.fb.stride)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     } else {
-        return MX_OK;
+        return ZX_OK;
     }
 #else
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif
 }
 
-mx_status_t sys_set_framebuffer(mx_handle_t hrsrc, user_ptr<void> vaddr, uint32_t len, uint32_t format, uint32_t width, uint32_t height, uint32_t stride) {
+zx_status_t sys_set_framebuffer(zx_handle_t hrsrc, user_ptr<void> vaddr, uint32_t len, uint32_t format, uint32_t width, uint32_t height, uint32_t stride) {
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(hrsrc, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(hrsrc, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
@@ -243,12 +243,12 @@
     di.flags = DISPLAY_FLAG_HW_FRAMEBUFFER;
     udisplay_set_display_info(&di);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_set_framebuffer_vmo(mx_handle_t hrsrc, mx_handle_t vmo_handle, uint32_t len, uint32_t format, uint32_t width, uint32_t height, uint32_t stride) {
-    mx_status_t status;
-    if ((status = validate_resource(hrsrc, MX_RSRC_KIND_ROOT)) < 0)
+zx_status_t sys_set_framebuffer_vmo(zx_handle_t hrsrc, zx_handle_t vmo_handle, uint32_t len, uint32_t format, uint32_t width, uint32_t height, uint32_t stride) {
+    zx_status_t status;
+    if ((status = validate_resource(hrsrc, ZX_RSRC_KIND_ROOT)) < 0)
         return status;
 
     auto up = ProcessDispatcher::GetCurrent();
@@ -256,11 +256,11 @@
     // lookup the dispatcher from handle
     fbl::RefPtr<VmObjectDispatcher> vmo;
     status = up->GetDispatcher(vmo_handle, &vmo);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     status = udisplay_set_framebuffer_vmo(vmo->vmo());
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     struct display_info di;
@@ -272,17 +272,17 @@
     di.flags = DISPLAY_FLAG_HW_FRAMEBUFFER;
     udisplay_set_display_info(&di);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 #if ARCH_X86
 #include <arch/x86/descriptor.h>
 #include <arch/x86/ioport.h>
 
-mx_status_t sys_mmap_device_io(mx_handle_t hrsrc, uint32_t io_addr, uint32_t len) {
+zx_status_t sys_mmap_device_io(zx_handle_t hrsrc, uint32_t io_addr, uint32_t len) {
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(hrsrc, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(hrsrc, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
@@ -291,16 +291,16 @@
     return IoBitmap::GetCurrent().SetIoBitmap(io_addr, len, 1);
 }
 #else
-mx_status_t sys_mmap_device_io(mx_handle_t hrsrc, uint32_t io_addr, uint32_t len) {
+zx_status_t sys_mmap_device_io(zx_handle_t hrsrc, uint32_t io_addr, uint32_t len) {
     // doesn't make sense on non-x86
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 #endif
 
-uint64_t sys_acpi_uefi_rsdp(mx_handle_t hrsrc) {
+uint64_t sys_acpi_uefi_rsdp(zx_handle_t hrsrc) {
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(hrsrc, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(hrsrc, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 #if ARCH_X86
@@ -309,10 +309,10 @@
     return 0;
 }
 
-mx_status_t sys_acpi_cache_flush(mx_handle_t hrsrc) {
+zx_status_t sys_acpi_cache_flush(zx_handle_t hrsrc) {
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(hrsrc, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(hrsrc, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
     // TODO(teisenbe): This should be restricted to when interrupts are
@@ -321,8 +321,8 @@
     // like poweroff and (more importantly) sleep.
 #if ARCH_X86
     __asm__ volatile ("wbinvd");
-    return MX_OK;
+    return ZX_OK;
 #else
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif
 }
diff --git a/kernel/lib/syscalls/syscalls_ddk_pci.cpp b/kernel/lib/syscalls/syscalls_ddk_pci.cpp
index 9ed9e66..f5888fa 100644
--- a/kernel/lib/syscalls/syscalls_ddk_pci.cpp
+++ b/kernel/lib/syscalls/syscalls_ddk_pci.cpp
@@ -22,7 +22,7 @@
 #include <object/resources.h>
 #include <object/vm_object_dispatcher.h>
 
-#include <magenta/syscalls/pci.h>
+#include <zircon/syscalls/pci.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/limits.h>
@@ -58,7 +58,7 @@
 public:
     static fbl::RefPtr<PcieRoot> Create(PcieBusDriver& bus_drv,
                                          uint managed_bus_id,
-                                         const mx_pci_irq_swizzle_lut_t& lut) {
+                                         const zx_pci_irq_swizzle_lut_t& lut) {
         fbl::AllocChecker ac;
         auto root = fbl::AdoptRef(new (&ac) PcieRootLUTSwizzle(bus_drv,
                                                                 managed_bus_id,
@@ -72,42 +72,42 @@
         return root;
     }
 
-    mx_status_t Swizzle(uint dev_id, uint func_id, uint pin, uint* irq) override {
+    zx_status_t Swizzle(uint dev_id, uint func_id, uint pin, uint* irq) override {
         if ((irq == nullptr) ||
             (dev_id >= fbl::count_of(lut_)) ||
             (func_id >= fbl::count_of(lut_[dev_id])) ||
             (pin >= fbl::count_of(lut_[dev_id][func_id])))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
 
         *irq = lut_[dev_id][func_id][pin];
-        return (*irq == MX_PCI_NO_IRQ_MAPPING) ? MX_ERR_NOT_FOUND : MX_OK;
+        return (*irq == ZX_PCI_NO_IRQ_MAPPING) ? ZX_ERR_NOT_FOUND : ZX_OK;
     }
 
 private:
     PcieRootLUTSwizzle(PcieBusDriver& bus_drv,
                        uint managed_bus_id,
-                       const mx_pci_irq_swizzle_lut_t& lut)
+                       const zx_pci_irq_swizzle_lut_t& lut)
         : PcieRoot(bus_drv, managed_bus_id) {
         ::memcpy(&lut_, &lut, sizeof(lut_));
     }
 
-    mx_pci_irq_swizzle_lut_t lut_;
+    zx_pci_irq_swizzle_lut_t lut_;
 };
 
-mx_status_t sys_pci_add_subtract_io_range(mx_handle_t handle, bool mmio, uint64_t base, uint64_t len, bool add) {
+zx_status_t sys_pci_add_subtract_io_range(zx_handle_t handle, bool mmio, uint64_t base, uint64_t len, bool add) {
 
     LTRACEF("handle %x mmio %d base %#" PRIx64 " len %#" PRIx64 " add %d\n", handle, mmio, base, len, add);
 
     // TODO(MG-971): finer grained validation
     // TODO(security): Add additional access checks
-    mx_status_t status;
-    if ((status = validate_resource(handle, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(handle, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
     auto pcie = PcieBusDriver::GetDriver();
     if (pcie == nullptr) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     PciAddrSpace addr_space = mmio ? PciAddrSpace::MMIO : PciAddrSpace::PIO;
@@ -119,33 +119,33 @@
     }
 }
 
-mx_status_t sys_pci_init(mx_handle_t handle, user_ptr<const mx_pci_init_arg_t> _init_buf, uint32_t len) {
+zx_status_t sys_pci_init(zx_handle_t handle, user_ptr<const zx_pci_init_arg_t> _init_buf, uint32_t len) {
     // TODO(MG-971): finer grained validation
     // TODO(security): Add additional access checks
-    mx_status_t status;
-    if ((status = validate_resource(handle, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(handle, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
-    fbl::unique_free_ptr<mx_pci_init_arg_t> arg;
+    fbl::unique_free_ptr<zx_pci_init_arg_t> arg;
 
-    if (len < sizeof(*arg) || len > MX_PCI_INIT_ARG_MAX_SIZE) {
-        return MX_ERR_INVALID_ARGS;
+    if (len < sizeof(*arg) || len > ZX_PCI_INIT_ARG_MAX_SIZE) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
     auto pcie = PcieBusDriver::GetDriver();
     if (pcie == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     // we have to malloc instead of new since this is a variable-sized structure
-    arg.reset(static_cast<mx_pci_init_arg_t*>(malloc(len)));
+    arg.reset(static_cast<zx_pci_init_arg_t*>(malloc(len)));
     if (!arg) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     {
         status = _init_buf.reinterpret<const void>().copy_array_from_user(
             arg.get(), len);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
     }
@@ -164,11 +164,11 @@
 
     const uint32_t win_count = arg->addr_window_count;
     if (len != sizeof(*arg) + sizeof(arg->addr_windows[0]) * win_count) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (arg->num_irqs > fbl::count_of(arg->irqs)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Configure interrupts
@@ -183,22 +183,22 @@
             pol = IRQ_POLARITY_ACTIVE_HIGH;
         }
 
-        mx_status_t status = configure_interrupt(irq, tm, pol);
-        if (status != MX_OK) {
+        zx_status_t status = configure_interrupt(irq, tm, pol);
+        if (status != ZX_OK) {
             return status;
         }
     }
     // TODO(teisenbe): For now assume there is only one ECAM
     if (win_count != 1) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (arg->addr_windows[0].bus_start != 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (arg->addr_windows[0].bus_start > arg->addr_windows[0].bus_end) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
 #if ARCH_X86
@@ -213,14 +213,14 @@
         TRACEF("PCIe config space collides with arch devices, truncating\n");
         end = high_limit;
         if (end < arg->addr_windows[0].base) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         arg->addr_windows[0].size = ROUNDDOWN(end - arg->addr_windows[0].base,
                                               PCIE_ECAM_BYTE_PER_BUS);
         uint64_t new_bus_end = (arg->addr_windows[0].size / PCIE_ECAM_BYTE_PER_BUS) +
                                arg->addr_windows[0].bus_start - 1;
         if (new_bus_end >= PCIE_MAX_BUSSES) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         arg->addr_windows[0].bus_end = static_cast<uint8_t>(new_bus_end);
     }
@@ -228,12 +228,12 @@
 
     if (arg->addr_windows[0].is_mmio) {
         if (arg->addr_windows[0].size < PCIE_ECAM_BYTE_PER_BUS) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (arg->addr_windows[0].size / PCIE_ECAM_BYTE_PER_BUS >
                 PCIE_MAX_BUSSES - arg->addr_windows[0].bus_start) {
 
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         // TODO(johngro): Update the syscall to pass a paddr_t for base instead of a uint64_t
@@ -249,8 +249,8 @@
             .bus_end = static_cast<uint8_t>((arg->addr_windows[0].size / PCIE_ECAM_BYTE_PER_BUS) - 1),
         };
 
-        mx_status_t ret = pcie->AddEcamRegion(ecam);
-        if (ret != MX_OK) {
+        zx_status_t ret = pcie->AddEcamRegion(ecam);
+        if (ret != ZX_OK) {
             TRACEF("Failed to add ECAM region to PCIe bus driver! (ret %d)\n", ret);
             return ret;
         }
@@ -261,31 +261,31 @@
     // it manages bus ID 0.
     auto root = PcieRootLUTSwizzle::Create(*pcie, 0, arg->dev_pin_to_global_irq);
     if (root == nullptr)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // Enable PIO config space if the address window was not MMIO
     pcie->EnablePIOWorkaround(!arg->addr_windows[0].is_mmio);
 
-    mx_status_t ret = pcie->AddRoot(fbl::move(root));
-    if (ret != MX_OK) {
+    zx_status_t ret = pcie->AddRoot(fbl::move(root));
+    if (ret != ZX_OK) {
         TRACEF("Failed to add root complex to PCIe bus driver! (ret %d)\n", ret);
         return ret;
     }
 
     ret = pcie->StartBusDriver();
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         TRACEF("Failed to start PCIe bus driver! (ret %d)\n", ret);
         return ret;
     }
 
     shutdown_early_init_console();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_pci_get_nth_device(mx_handle_t hrsrc,
+zx_status_t sys_pci_get_nth_device(zx_handle_t hrsrc,
                                    uint32_t index,
-                                   user_ptr<mx_pcie_device_info_t> out_info,
-                                   user_ptr<mx_handle_t> out_handle) {
+                                   user_ptr<zx_pcie_device_info_t> out_info,
+                                   user_ptr<zx_handle_t> out_handle) {
     /**
      * Returns the pci config of a device.
      * @param index Device index
@@ -294,50 +294,50 @@
     LTRACEF("handle %x index %u\n", hrsrc, index);
 
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(hrsrc, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(hrsrc, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
     if (!out_info || !out_handle) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
-    mx_pcie_device_info_t info;
-    mx_status_t result = PciDeviceDispatcher::Create(index, &info, &dispatcher, &rights);
-    if (result != MX_OK) {
+    zx_rights_t rights;
+    zx_pcie_device_info_t info;
+    zx_status_t result = PciDeviceDispatcher::Create(index, &info, &dispatcher, &rights);
+    if (result != ZX_OK) {
         return result;
     }
 
     HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
     if (!handle) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     auto up = ProcessDispatcher::GetCurrent();
-    mx_handle_t handle_value = up->MapHandleToValue(handle);
+    zx_handle_t handle_value = up->MapHandleToValue(handle);
 
     // If everything is successful add the handle to the process
-    if (out_info.copy_to_user(info) != MX_OK ||
-            out_handle.copy_to_user(handle_value) != MX_OK) {
-        return MX_ERR_INVALID_ARGS;
+    if (out_info.copy_to_user(info) != ZX_OK ||
+            out_handle.copy_to_user(handle_value) != ZX_OK) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
     up->AddHandle(fbl::move(handle));
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* This is a transitional method to bootstrap legacy PIO access before
  * PCI moves to userspace.
  */
-mx_status_t sys_pci_cfg_pio_rw(mx_handle_t handle, uint8_t bus, uint8_t dev, uint8_t func,
+zx_status_t sys_pci_cfg_pio_rw(zx_handle_t handle, uint8_t bus, uint8_t dev, uint8_t func,
                                uint8_t offset, user_ptr<uint32_t> val, size_t width, bool write) {
 #if ARCH_X86
     uint32_t val_;
-    mx_status_t status = validate_resource(handle, MX_RSRC_KIND_ROOT);
-    if (status != MX_OK) {
+    zx_status_t status = validate_resource(handle, ZX_RSRC_KIND_ROOT);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -346,18 +346,18 @@
         status = Pci::PioCfgWrite(bus, dev, func, offset, val_, width);
     } else {
         status = Pci::PioCfgRead(bus, dev, func, offset, &val_, width);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             val.copy_to_user(val_);
         }
     }
 
     return status;
 #else
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif
 }
 
-mx_status_t sys_pci_enable_bus_master(mx_handle_t dev_handle, bool enable) {
+zx_status_t sys_pci_enable_bus_master(zx_handle_t dev_handle, bool enable) {
     /**
      * Enables or disables bus mastering for the PCI device associated with the handle.
      * @param handle Handle associated with a PCI device
@@ -368,14 +368,14 @@
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PciDeviceDispatcher> pci_device;
-    mx_status_t status = up->GetDispatcherWithRights(dev_handle, MX_RIGHT_WRITE, &pci_device);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(dev_handle, ZX_RIGHT_WRITE, &pci_device);
+    if (status != ZX_OK)
         return status;
 
     return pci_device->EnableBusMaster(enable);
 }
 
-mx_status_t sys_pci_enable_pio(mx_handle_t dev_handle, bool enable) {
+zx_status_t sys_pci_enable_pio(zx_handle_t dev_handle, bool enable) {
     /**
      * Enables or disables PIO accesss for the PCI device associated with the handle.
      * @param handle Handle associated with a PCI device
@@ -386,14 +386,14 @@
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PciDeviceDispatcher> pci_device;
-    mx_status_t status = up->GetDispatcherWithRights(dev_handle, MX_RIGHT_WRITE, &pci_device);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(dev_handle, ZX_RIGHT_WRITE, &pci_device);
+    if (status != ZX_OK)
         return status;
 
     return pci_device->EnablePio(enable);
 }
 
-mx_status_t sys_pci_reset_device(mx_handle_t dev_handle) {
+zx_status_t sys_pci_reset_device(zx_handle_t dev_handle) {
     /**
      * Resets the PCI device associated with the handle.
      * @param handle Handle associated with a PCI device
@@ -403,37 +403,37 @@
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PciDeviceDispatcher> pci_device;
-    mx_status_t status = up->GetDispatcherWithRights(dev_handle, MX_RIGHT_WRITE, &pci_device);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(dev_handle, ZX_RIGHT_WRITE, &pci_device);
+    if (status != ZX_OK)
         return status;
 
     return pci_device->ResetDevice();
 }
 
-mx_status_t sys_pci_get_bar(mx_handle_t dev_handle, uint32_t bar_num, user_ptr<mx_pci_resource_t> out_bar) {
+zx_status_t sys_pci_get_bar(zx_handle_t dev_handle, uint32_t bar_num, user_ptr<zx_pci_resource_t> out_bar) {
     fbl::RefPtr<PciDeviceDispatcher> pci_device;
     fbl::RefPtr<Dispatcher> dispatcher;
     HandleOwner mmio_handle;
-    mx_pci_resource_t bar;
-    mx_status_t status;
+    zx_pci_resource_t bar;
+    zx_status_t status;
 
     LTRACEF("handle %x\n", dev_handle);
     if (!dev_handle || !out_bar || bar_num >= PCIE_MAX_BAR_REGS) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     auto up = ProcessDispatcher::GetCurrent();
 
     // Grab the PCI device object
-    status = up->GetDispatcherWithRights(dev_handle, MX_RIGHT_READ | MX_RIGHT_WRITE, &pci_device);
-    if (status != MX_OK) {
+    status = up->GetDispatcherWithRights(dev_handle, ZX_RIGHT_READ | ZX_RIGHT_WRITE, &pci_device);
+    if (status != ZX_OK) {
         return status;
     }
 
     // Get bar info from the device via the dispatcher and make sure it makes sense
     const pcie_bar_info_t* info = pci_device->GetBar(bar_num);
     if (info == nullptr || info->size == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // A bar can be MMIO, PIO, or unused. In the MMIO case it can be passed
@@ -449,7 +449,7 @@
         fbl::RefPtr<VmObject> vmo;
         status = VmObjectPhysical::Create(info->bus_addr,
                                             fbl::max<uint64_t>(info->size, PAGE_SIZE), &vmo);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
 
@@ -461,15 +461,15 @@
         vmo->set_name(name, sizeof(name));
 
         // We have a VMO, time to prep a handle to it for the caller
-        mx_rights_t rights;
+        zx_rights_t rights;
         status = VmObjectDispatcher::Create(vmo, &dispatcher, &rights);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
 
         mmio_handle = HandleOwner(MakeHandle(fbl::move(dispatcher), rights));
         if (!mmio_handle) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
 
         bar.mmio_handle = up->MapHandleToValue(mmio_handle);
@@ -479,8 +479,8 @@
     }
 
     /* Success so far, copy everything back to usersapce */
-    if (out_bar.copy_to_user(bar) != MX_OK) {
-        return MX_ERR_INVALID_ARGS;
+    if (out_bar.copy_to_user(bar) != ZX_OK) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
     /* If the bar is an mmio the VMO handle still needs to be accounted for */
@@ -491,32 +491,32 @@
         pci_device->EnablePio(true);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_pci_get_config(mx_handle_t dev_handle, user_ptr<mx_pci_resource_t> out_config) {
+zx_status_t sys_pci_get_config(zx_handle_t dev_handle, user_ptr<zx_pci_resource_t> out_config) {
     fbl::RefPtr<PciDeviceDispatcher> pci_device;
     fbl::RefPtr<Dispatcher> dispatcher;
     pci_config_info_t pci_config;
-    mx_pci_resource_t config;
+    zx_pci_resource_t config;
     HandleOwner mmio_handle;
-    mx_status_t status;
+    zx_status_t status;
 
     if (!out_config) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Get the process context and device dispatcher from the caller device handle
     auto up = ProcessDispatcher::GetCurrent();
-    status = up->GetDispatcherWithRights(dev_handle, MX_RIGHT_READ | MX_RIGHT_WRITE, &pci_device);
-    if (status != MX_OK) {
+    status = up->GetDispatcherWithRights(dev_handle, ZX_RIGHT_READ | ZX_RIGHT_WRITE, &pci_device);
+    if (status != ZX_OK) {
         return status;
     }
 
     // Get the config metadata from the device dispatcher. This contains either
     // a size/addr tuple for pio, or a size and vmo for mmio.
     status = pci_device->GetConfig(&pci_config);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("failed to get config: %d\n", status);
         return status;
     }
@@ -530,7 +530,7 @@
         auto dev = pci_device->device();
         fbl::RefPtr<VmObject> vmo;
         status = VmObjectPhysical::Create(dev->config_phys(), PAGE_SIZE, &vmo);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
 
@@ -549,18 +549,18 @@
         // TODO(cja): Rethink this for dealing with gap registers in capability space
         // later. It might make sense to keep a mapping of gaps in the space to allow
         // writes and provide a syscall to do so.
-        mx_rights_t rights;
+        zx_rights_t rights;
         status = VmObjectDispatcher::Create(vmo, &dispatcher, &rights);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
 
         // Drivers are not granted access to write to their own config space. It is
         // restricted to the bus driver.
-        rights &= ~MX_RIGHT_WRITE;
+        rights &= ~ZX_RIGHT_WRITE;
         mmio_handle = HandleOwner(MakeHandle(fbl::move(dispatcher), rights));
         if (!mmio_handle) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
 
         config.mmio_handle = up->MapHandleToValue(mmio_handle);
@@ -570,8 +570,8 @@
     }
 
     // Success so far, copy everything back to the usersapce out_config pointer.
-    if (out_config.copy_to_user(config) != MX_OK) {
-        return MX_ERR_INVALID_ARGS;
+    if (out_config.copy_to_user(config) != ZX_OK) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // If we created an MMIO handle it needs to be held by the process
@@ -580,10 +580,10 @@
         up->AddHandle(fbl::move(mmio_handle));
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_pci_io_write(mx_handle_t handle, uint32_t bar_num, uint32_t offset, uint32_t len,
+zx_status_t sys_pci_io_write(zx_handle_t handle, uint32_t bar_num, uint32_t offset, uint32_t len,
                              uint32_t value) {
     /**
      * Performs port I/O write for the PCI device associated with the handle.
@@ -593,10 +593,10 @@
      * @param len Length of the operation in bytes
      * @param value_ptr Pointer to the value to write
      */
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_io_read(mx_handle_t handle, uint32_t bar_num, uint32_t offset, uint32_t len,
+zx_status_t sys_pci_io_read(zx_handle_t handle, uint32_t bar_num, uint32_t offset, uint32_t len,
                             user_ptr<uint32_t> out_value_ptr) {
     /**
      * Performs port I/O read for the PCI device associated with the handle.
@@ -606,12 +606,12 @@
      * @param len Length of the operation in bytes
      * @param out_value_ptr Pointer to read the value into
      */
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_map_interrupt(mx_handle_t dev_handle,
+zx_status_t sys_pci_map_interrupt(zx_handle_t dev_handle,
                                   int32_t which_irq,
-                                  user_ptr<mx_handle_t> out_handle) {
+                                  user_ptr<zx_handle_t> out_handle) {
     /**
      * Returns a handle that can be waited on.
      * @param handle Handle associated with a PCI device
@@ -621,34 +621,34 @@
      */
     LTRACEF("handle %x\n", dev_handle);
     if (!out_handle) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PciDeviceDispatcher> pci_device;
-    mx_status_t status =
-        up->GetDispatcherWithRights(dev_handle, MX_RIGHT_READ, &pci_device);
-    if (status != MX_OK)
+    zx_status_t status =
+        up->GetDispatcherWithRights(dev_handle, ZX_RIGHT_READ, &pci_device);
+    if (status != ZX_OK)
         return status;
 
     fbl::RefPtr<Dispatcher> interrupt_dispatcher;
-    mx_rights_t rights;
-    mx_status_t result = pci_device->MapInterrupt(which_irq, &interrupt_dispatcher, &rights);
-    if (result != MX_OK)
+    zx_rights_t rights;
+    zx_status_t result = pci_device->MapInterrupt(which_irq, &interrupt_dispatcher, &rights);
+    if (result != ZX_OK)
         return result;
 
     HandleOwner handle(MakeHandle(fbl::move(interrupt_dispatcher), rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     status = out_handle.copy_to_user(up->MapHandleToValue(handle));
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     up->AddHandle(fbl::move(handle));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /**
@@ -657,7 +657,7 @@
  * @param mode The IRQ mode whose capabilities are to be queried.
  * @param out_len Out param which will hold the maximum number of IRQs supported by the mode.
  */
-mx_status_t sys_pci_query_irq_mode_caps(mx_handle_t dev_handle,
+zx_status_t sys_pci_query_irq_mode_caps(zx_handle_t dev_handle,
                                         uint32_t mode,
                                         user_ptr<uint32_t> out_max_irqs) {
     LTRACEF("handle %x\n", dev_handle);
@@ -665,17 +665,17 @@
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PciDeviceDispatcher> pci_device;
-    mx_status_t status = up->GetDispatcherWithRights(dev_handle, MX_RIGHT_READ, &pci_device);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(dev_handle, ZX_RIGHT_READ, &pci_device);
+    if (status != ZX_OK)
         return status;
 
     uint32_t max_irqs;
-    mx_status_t result = pci_device->QueryIrqModeCaps((mx_pci_irq_mode_t)mode, &max_irqs);
-    if (result != MX_OK)
+    zx_status_t result = pci_device->QueryIrqModeCaps((zx_pci_irq_mode_t)mode, &max_irqs);
+    if (result != ZX_OK)
         return result;
 
-    if (out_max_irqs.copy_to_user(max_irqs) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (out_max_irqs.copy_to_user(max_irqs) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     return result;
 }
@@ -686,7 +686,7 @@
  * @param mode The IRQ mode to select.
  * @param requested_irq_count The number of IRQs to select request for the given mode.
  */
-mx_status_t sys_pci_set_irq_mode(mx_handle_t dev_handle,
+zx_status_t sys_pci_set_irq_mode(zx_handle_t dev_handle,
                                  uint32_t mode,
                                  uint32_t requested_irq_count) {
     LTRACEF("handle %x\n", dev_handle);
@@ -694,64 +694,64 @@
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PciDeviceDispatcher> pci_device;
-    mx_status_t status = up->GetDispatcherWithRights(dev_handle, MX_RIGHT_WRITE, &pci_device);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(dev_handle, ZX_RIGHT_WRITE, &pci_device);
+    if (status != ZX_OK)
         return status;
 
-    return pci_device->SetIrqMode((mx_pci_irq_mode_t)mode, requested_irq_count);
+    return pci_device->SetIrqMode((zx_pci_irq_mode_t)mode, requested_irq_count);
 }
 #else  // WITH_DEV_PCIE
-mx_status_t sys_pci_init(mx_handle_t, user_ptr<const mx_pci_init_arg_t>, uint32_t) {
+zx_status_t sys_pci_init(zx_handle_t, user_ptr<const zx_pci_init_arg_t>, uint32_t) {
     shutdown_early_init_console();
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_add_subtract_io_range(mx_handle_t handle, bool mmio, uint64_t base, uint64_t len, bool add) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_add_subtract_io_range(zx_handle_t handle, bool mmio, uint64_t base, uint64_t len, bool add) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_get_nth_device(mx_handle_t, uint32_t, user_ptr<mx_pcie_device_info_t>,
-                                   user_ptr<mx_handle_t>) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_get_nth_device(zx_handle_t, uint32_t, user_ptr<zx_pcie_device_info_t>,
+                                   user_ptr<zx_handle_t>) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_enable_bus_master(mx_handle_t, bool) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_enable_bus_master(zx_handle_t, bool) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_enable_pio(mx_handle_t, bool) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_enable_pio(zx_handle_t, bool) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_reset_device(mx_handle_t) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_reset_device(zx_handle_t) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_get_bar(mx_handle_t, uint32_t, pci_resource_t**) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_get_bar(zx_handle_t, uint32_t, pci_resource_t**) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_get_config(mx_handle_t dev_handle, mx_pci_resource_t* out_config) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_get_config(zx_handle_t dev_handle, zx_pci_resource_t* out_config) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_io_write(mx_handle_t, uint32_t, uint32_t, uint32_t, uint32_t) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_io_write(zx_handle_t, uint32_t, uint32_t, uint32_t, uint32_t) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_io_read(mx_handle_t, uint32_t, uint32_t, uint32_t, user_ptr<uint32_t>) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_io_read(zx_handle_t, uint32_t, uint32_t, uint32_t, user_ptr<uint32_t>) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_map_interrupt(mx_handle_t, int32_t, user_ptr<mx_handle_t>) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_map_interrupt(zx_handle_t, int32_t, user_ptr<zx_handle_t>) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_query_irq_mode_caps(mx_handle_t, uint32_t, user_ptr<uint32_t>) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_query_irq_mode_caps(zx_handle_t, uint32_t, user_ptr<uint32_t>) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t sys_pci_set_irq_mode(mx_handle_t, uint32_t, uint32_t) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t sys_pci_set_irq_mode(zx_handle_t, uint32_t, uint32_t) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 #endif // WITH_DEV_PCIE
diff --git a/kernel/lib/syscalls/syscalls_debug.cpp b/kernel/lib/syscalls/syscalls_debug.cpp
index 11d4587..cae2d5c 100644
--- a/kernel/lib/syscalls/syscalls_debug.cpp
+++ b/kernel/lib/syscalls/syscalls_debug.cpp
@@ -23,7 +23,7 @@
 
 #include <platform/debug.h>
 
-#include <magenta/syscalls/debug.h>
+#include <zircon/syscalls/debug.h>
 
 #include "syscalls_priv.h"
 
@@ -31,12 +31,12 @@
 
 constexpr uint32_t kMaxDebugWriteSize = 256u;
 
-mx_status_t sys_debug_read(mx_handle_t handle, user_ptr<void> ptr, uint32_t len) {
+zx_status_t sys_debug_read(zx_handle_t handle, user_ptr<void> ptr, uint32_t len) {
     LTRACEF("ptr %p\n", ptr.get());
 
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(handle, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(handle, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
@@ -53,55 +53,55 @@
             c = '\n';
 
         auto cur = uptr.byte_offset(idx);
-        if (cur.copy_to_user(static_cast<uint8_t>(c)) != MX_OK)
+        if (cur.copy_to_user(static_cast<uint8_t>(c)) != ZX_OK)
             break;
     }
     // TODO: fix this cast, which can overflow.
-    return static_cast<mx_status_t>(idx);
+    return static_cast<zx_status_t>(idx);
 }
 
-mx_status_t sys_debug_write(user_ptr<const void> ptr, uint32_t len) {
+zx_status_t sys_debug_write(user_ptr<const void> ptr, uint32_t len) {
     LTRACEF("ptr %p, len %u\n", ptr.get(), len);
 
     if (len > kMaxDebugWriteSize)
         len = kMaxDebugWriteSize;
 
     char buf[kMaxDebugWriteSize];
-    if (ptr.copy_array_from_user(buf, len) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (ptr.copy_array_from_user(buf, len) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     __kernel_serial_write(buf, len);
 
     return len;
 }
 
-mx_status_t sys_debug_send_command(mx_handle_t handle, user_ptr<const void> ptr, uint32_t len) {
+zx_status_t sys_debug_send_command(zx_handle_t handle, user_ptr<const void> ptr, uint32_t len) {
     LTRACEF("ptr %p, len %u\n", ptr.get(), len);
 
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(handle, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(handle, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
     if (len > kMaxDebugWriteSize)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     char buf[kMaxDebugWriteSize + 2];
-    if (ptr.copy_array_from_user(buf, len) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (ptr.copy_array_from_user(buf, len) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     buf[len] = '\n';
     buf[len + 1] = 0;
     return console_run_script(buf);
 }
 
-mx_status_t sys_ktrace_read(mx_handle_t handle, user_ptr<void> _data,
+zx_status_t sys_ktrace_read(zx_handle_t handle, user_ptr<void> _data,
                             uint32_t offset, uint32_t len,
                             user_ptr<uint32_t> _actual) {
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(handle, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(handle, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
@@ -112,19 +112,19 @@
     return _actual.copy_to_user(static_cast<uint32_t>(result));
 }
 
-mx_status_t sys_ktrace_control(
-        mx_handle_t handle, uint32_t action, uint32_t options, user_ptr<void> _ptr) {
+zx_status_t sys_ktrace_control(
+        zx_handle_t handle, uint32_t action, uint32_t options, user_ptr<void> _ptr) {
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(handle, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(handle, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
     switch (action) {
     case KTRACE_ACTION_NEW_PROBE: {
-        char name[MX_MAX_NAME_LEN];
-        if (_ptr.copy_array_from_user(name, sizeof(name) - 1) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+        char name[ZX_MAX_NAME_LEN];
+        if (_ptr.copy_array_from_user(name, sizeof(name) - 1) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
         name[sizeof(name) - 1] = 0;
         return ktrace_control(action, options, name);
     }
@@ -133,34 +133,34 @@
     }
 }
 
-mx_status_t sys_ktrace_write(mx_handle_t handle, uint32_t event_id, uint32_t arg0, uint32_t arg1) {
+zx_status_t sys_ktrace_write(zx_handle_t handle, uint32_t event_id, uint32_t arg0, uint32_t arg1) {
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(handle, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(handle, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
     if (event_id > 0x7FF) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uint32_t* args = static_cast<uint32_t*>(ktrace_open(TAG_PROBE_24(event_id)));
     if (!args) {
         //  There is not a single reason for failure. Assume it reached the end.
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     }
 
     args[0] = arg0;
     args[1] = arg1;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_mtrace_control(mx_handle_t handle,
+zx_status_t sys_mtrace_control(zx_handle_t handle,
                                uint32_t kind, uint32_t action, uint32_t options,
                                user_ptr<void> ptr, uint32_t size) {
     // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(handle, MX_RSRC_KIND_ROOT)) < 0) {
+    zx_status_t status;
+    if ((status = validate_resource(handle, ZX_RSRC_KIND_ROOT)) < 0) {
         return status;
     }
 
diff --git a/kernel/lib/syscalls/syscalls_exceptions.cpp b/kernel/lib/syscalls/syscalls_exceptions.cpp
index 1a52322..63fcb68 100644
--- a/kernel/lib/syscalls/syscalls_exceptions.cpp
+++ b/kernel/lib/syscalls/syscalls_exceptions.cpp
@@ -22,71 +22,71 @@
 
 #define LOCAL_TRACE 0
 
-static mx_status_t object_unbind_exception_port(mx_handle_t obj_handle, bool debugger, bool quietly) {
+static zx_status_t object_unbind_exception_port(zx_handle_t obj_handle, bool debugger, bool quietly) {
     // TODO(MG-968): check rights once appropriate right is determined
 
-    if (obj_handle == MX_HANDLE_INVALID) {
+    if (obj_handle == ZX_HANDLE_INVALID) {
         // TODO(MG-987): handle for system exception
         if (debugger || quietly)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return ResetSystemExceptionPort()
-                   ? MX_OK
-                   : MX_ERR_BAD_STATE;  // No port was bound.
+                   ? ZX_OK
+                   : ZX_ERR_BAD_STATE;  // No port was bound.
     }
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<Dispatcher> dispatcher;
     auto status = up->GetDispatcher(obj_handle, &dispatcher);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     auto job = DownCastDispatcher<JobDispatcher>(&dispatcher);
     if (job) {
         if (debugger)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return job->ResetExceptionPort(quietly)
-                   ? MX_OK
-                   : MX_ERR_BAD_STATE;  // No port was bound.
+                   ? ZX_OK
+                   : ZX_ERR_BAD_STATE;  // No port was bound.
     }
 
     auto process = DownCastDispatcher<ProcessDispatcher>(&dispatcher);
     if (process) {
         return process->ResetExceptionPort(debugger, quietly)
-                   ? MX_OK
-                   : MX_ERR_BAD_STATE;  // No port was bound.
+                   ? ZX_OK
+                   : ZX_ERR_BAD_STATE;  // No port was bound.
     }
 
     auto thread = DownCastDispatcher<ThreadDispatcher>(&dispatcher);
     if (thread) {
         if (debugger)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return thread->ResetExceptionPort(quietly)
-                   ? MX_OK
-                   : MX_ERR_BAD_STATE;  // No port was bound.
+                   ? ZX_OK
+                   : ZX_ERR_BAD_STATE;  // No port was bound.
     }
 
-    return MX_ERR_WRONG_TYPE;
+    return ZX_ERR_WRONG_TYPE;
 }
 
-static mx_status_t task_bind_exception_port(mx_handle_t obj_handle, mx_handle_t eport_handle, uint64_t key, bool debugger) {
+static zx_status_t task_bind_exception_port(zx_handle_t obj_handle, zx_handle_t eport_handle, uint64_t key, bool debugger) {
     // TODO(MG-968): check rights once appropriate right is determined
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PortDispatcher> port;
-    mx_status_t status = up->GetDispatcher(eport_handle, &port);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcher(eport_handle, &port);
+    if (status != ZX_OK)
         return status;
 
     fbl::RefPtr<ExceptionPort> eport;
 
-    if (obj_handle == MX_HANDLE_INVALID) {
+    if (obj_handle == ZX_HANDLE_INVALID) {
         // TODO(MG-987): handle for system exception
         if (debugger)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         status = ExceptionPort::Create(ExceptionPort::Type::JOB,
                                        fbl::move(port), key, &eport);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
 
         return SetSystemExceptionPort(eport);
@@ -94,23 +94,23 @@
 
     fbl::RefPtr<Dispatcher> dispatcher;
     status = up->GetDispatcher(obj_handle, &dispatcher);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     auto job = DownCastDispatcher<JobDispatcher>(&dispatcher);
     if (job) {
         if (debugger)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         status = ExceptionPort::Create(ExceptionPort::Type::JOB,
                                        fbl::move(port), key, &eport);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         status = job->SetExceptionPort(eport);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
 
         eport->SetTarget(job);
-        return MX_OK;
+        return ZX_OK;
     }
 
     auto process = DownCastDispatcher<ProcessDispatcher>(&dispatcher);
@@ -121,66 +121,66 @@
         else
             type = ExceptionPort::Type::PROCESS;
         status = ExceptionPort::Create(type, fbl::move(port), key, &eport);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         status = process->SetExceptionPort(eport);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
 
         eport->SetTarget(process);
-        return MX_OK;
+        return ZX_OK;
     }
 
     auto thread = DownCastDispatcher<ThreadDispatcher>(&dispatcher);
     if (thread) {
         if (debugger)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         status = ExceptionPort::Create(ExceptionPort::Type::THREAD,
                                        fbl::move(port), key, &eport);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         status = thread->SetExceptionPort(eport);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
 
         eport->SetTarget(thread);
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_WRONG_TYPE;
+    return ZX_ERR_WRONG_TYPE;
 }
 
-mx_status_t sys_task_bind_exception_port(mx_handle_t obj_handle, mx_handle_t eport_handle,
+zx_status_t sys_task_bind_exception_port(zx_handle_t obj_handle, zx_handle_t eport_handle,
                                            uint64_t key, uint32_t options) {
     LTRACE_ENTRY;
 
-    if (eport_handle == MX_HANDLE_INVALID) {
-        if (options & ~(MX_EXCEPTION_PORT_DEBUGGER + MX_EXCEPTION_PORT_UNBIND_QUIETLY))
-            return MX_ERR_INVALID_ARGS;
+    if (eport_handle == ZX_HANDLE_INVALID) {
+        if (options & ~(ZX_EXCEPTION_PORT_DEBUGGER + ZX_EXCEPTION_PORT_UNBIND_QUIETLY))
+            return ZX_ERR_INVALID_ARGS;
     } else {
-        if (options & ~MX_EXCEPTION_PORT_DEBUGGER)
-            return MX_ERR_INVALID_ARGS;
+        if (options & ~ZX_EXCEPTION_PORT_DEBUGGER)
+            return ZX_ERR_INVALID_ARGS;
     }
 
-    bool debugger = (options & MX_EXCEPTION_PORT_DEBUGGER) != 0;
+    bool debugger = (options & ZX_EXCEPTION_PORT_DEBUGGER) != 0;
 
-    if (eport_handle == MX_HANDLE_INVALID) {
-        bool quietly = (options & MX_EXCEPTION_PORT_UNBIND_QUIETLY) != 0;
+    if (eport_handle == ZX_HANDLE_INVALID) {
+        bool quietly = (options & ZX_EXCEPTION_PORT_UNBIND_QUIETLY) != 0;
         return object_unbind_exception_port(obj_handle, debugger, quietly);
     } else {
         return task_bind_exception_port(obj_handle, eport_handle, key, debugger);
     }
 }
 
-mx_status_t sys_task_resume(mx_handle_t handle, uint32_t options) {
+zx_status_t sys_task_resume(zx_handle_t handle, uint32_t options) {
     LTRACE_ENTRY;
 
-    if (options & ~(MX_RESUME_EXCEPTION | MX_RESUME_TRY_NEXT))
-        return MX_ERR_INVALID_ARGS;
-    if (!(options & MX_RESUME_EXCEPTION)) {
-        // These options are only valid with MX_RESUME_EXCEPTION.
-        if (options & MX_RESUME_TRY_NEXT)
-            return MX_ERR_INVALID_ARGS;
+    if (options & ~(ZX_RESUME_EXCEPTION | ZX_RESUME_TRY_NEXT))
+        return ZX_ERR_INVALID_ARGS;
+    if (!(options & ZX_RESUME_EXCEPTION)) {
+        // These options are only valid with ZX_RESUME_EXCEPTION.
+        if (options & ZX_RESUME_TRY_NEXT)
+            return ZX_ERR_INVALID_ARGS;
     }
 
     auto up = ProcessDispatcher::GetCurrent();
@@ -188,16 +188,16 @@
     // TODO(MG-968): Rights checking here
     fbl::RefPtr<Dispatcher> dispatcher;
     auto status = up->GetDispatcher(handle, &dispatcher);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     auto thread = DownCastDispatcher<ThreadDispatcher>(&dispatcher);
     if (!thread)
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
 
-    if (options & MX_RESUME_EXCEPTION) {
+    if (options & ZX_RESUME_EXCEPTION) {
         ThreadDispatcher::ExceptionStatus estatus;
-        if (options & MX_RESUME_TRY_NEXT) {
+        if (options & ZX_RESUME_TRY_NEXT) {
             estatus = ThreadDispatcher::ExceptionStatus::TRY_NEXT;
         } else {
             estatus = ThreadDispatcher::ExceptionStatus::RESUME;
@@ -205,7 +205,7 @@
         return thread->MarkExceptionHandled(estatus);
     } else {
         if (options != 0) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         return thread->Resume();
diff --git a/kernel/lib/syscalls/syscalls_fifo.cpp b/kernel/lib/syscalls/syscalls_fifo.cpp
index a2e329f..0aca1d3 100644
--- a/kernel/lib/syscalls/syscalls_fifo.cpp
+++ b/kernel/lib/syscalls/syscalls_fifo.cpp
@@ -17,83 +17,83 @@
 #include <object/handles.h>
 #include <object/process_dispatcher.h>
 
-#include <magenta/syscalls/policy.h>
+#include <zircon/syscalls/policy.h>
 #include <fbl/ref_ptr.h>
 
 #include "syscalls_priv.h"
 
 #define LOCAL_TRACE 0
 
-mx_status_t sys_fifo_create(uint32_t count, uint32_t elemsize, uint32_t options,
-                            user_ptr<mx_handle_t> _out0, user_ptr<mx_handle_t> _out1) {
+zx_status_t sys_fifo_create(uint32_t count, uint32_t elemsize, uint32_t options,
+                            user_ptr<zx_handle_t> _out0, user_ptr<zx_handle_t> _out1) {
     auto up = ProcessDispatcher::GetCurrent();
-    mx_status_t res = up->QueryPolicy(MX_POL_NEW_FIFO);
-    if (res != MX_OK)
+    zx_status_t res = up->QueryPolicy(ZX_POL_NEW_FIFO);
+    if (res != ZX_OK)
         return res;
 
     fbl::RefPtr<Dispatcher> dispatcher0;
     fbl::RefPtr<Dispatcher> dispatcher1;
-    mx_rights_t rights;
-    mx_status_t result = FifoDispatcher::Create(count, elemsize, options,
+    zx_rights_t rights;
+    zx_status_t result = FifoDispatcher::Create(count, elemsize, options,
                                                 &dispatcher0, &dispatcher1, &rights);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     HandleOwner handle0(MakeHandle(fbl::move(dispatcher0), rights));
     if (!handle0)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     HandleOwner handle1(MakeHandle(fbl::move(dispatcher1), rights));
     if (!handle1)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    if (_out0.copy_to_user(up->MapHandleToValue(handle0)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-    if (_out1.copy_to_user(up->MapHandleToValue(handle1)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out0.copy_to_user(up->MapHandleToValue(handle0)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+    if (_out1.copy_to_user(up->MapHandleToValue(handle1)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(handle0));
     up->AddHandle(fbl::move(handle1));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_fifo_write(mx_handle_t handle, user_ptr<const void> entries,
+zx_status_t sys_fifo_write(zx_handle_t handle, user_ptr<const void> entries,
         size_t len, user_ptr<uint32_t> _actual) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<FifoDispatcher> fifo;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &fifo);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &fifo);
+    if (status != ZX_OK)
         return status;
 
     uint32_t actual;
     // TODO(andymutton): Change FifoDispatcher to accept user_ptr
     status = fifo->WriteFromUser(reinterpret_cast<const uint8_t*>(entries.get()), len, &actual);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
-    if (_actual.copy_to_user(actual) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_actual.copy_to_user(actual) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_fifo_read(mx_handle_t handle, user_ptr<void> entries, size_t len, user_ptr<uint32_t> _actual) {
+zx_status_t sys_fifo_read(zx_handle_t handle, user_ptr<void> entries, size_t len, user_ptr<uint32_t> _actual) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<FifoDispatcher> fifo;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &fifo);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &fifo);
+    if (status != ZX_OK)
         return status;
 
     uint32_t actual;
     // TODO(andymutton): Change FifoDispatcher to accept user_ptr
     status = fifo->ReadToUser(reinterpret_cast<uint8_t*>(entries.get()), len, &actual);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
-    if (_actual.copy_to_user(actual) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_actual.copy_to_user(actual) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/lib/syscalls/syscalls_futex.cpp b/kernel/lib/syscalls/syscalls_futex.cpp
index b03d8fe..cdaff26 100644
--- a/kernel/lib/syscalls/syscalls_futex.cpp
+++ b/kernel/lib/syscalls/syscalls_futex.cpp
@@ -12,22 +12,22 @@
 
 #define LOCAL_TRACE 0
 
-mx_status_t sys_futex_wait(user_ptr<mx_futex_t> value_ptr, int current_value, mx_time_t deadline) {
+zx_status_t sys_futex_wait(user_ptr<zx_futex_t> value_ptr, int current_value, zx_time_t deadline) {
     LTRACEF("futex %p current %d\n", value_ptr.get(), current_value);
 
     return ProcessDispatcher::GetCurrent()->futex_context()->FutexWait(
         value_ptr, current_value, deadline);
 }
 
-mx_status_t sys_futex_wake(user_ptr<const mx_futex_t> value_ptr, uint32_t count) {
+zx_status_t sys_futex_wake(user_ptr<const zx_futex_t> value_ptr, uint32_t count) {
     LTRACEF("futex %p count %" PRIu32 "\n", value_ptr.get(), count);
 
     return ProcessDispatcher::GetCurrent()->futex_context()->FutexWake(
         value_ptr, count);
 }
 
-mx_status_t sys_futex_requeue(user_ptr<mx_futex_t> wake_ptr, uint32_t wake_count, int current_value,
-                              user_ptr<mx_futex_t> requeue_ptr, uint32_t requeue_count) {
+zx_status_t sys_futex_requeue(user_ptr<zx_futex_t> wake_ptr, uint32_t wake_count, int current_value,
+                              user_ptr<zx_futex_t> requeue_ptr, uint32_t requeue_count) {
     LTRACEF("futex %p wake_count %" PRIu32 "current_value %d "
            "requeue_futex %p requeue_count %" PRIu32 "\n",
            wake_ptr.get(), wake_count, current_value, requeue_ptr.get(), requeue_count);
diff --git a/kernel/lib/syscalls/syscalls_handle_ops.cpp b/kernel/lib/syscalls/syscalls_handle_ops.cpp
index fdf3293..884b2e5 100644
--- a/kernel/lib/syscalls/syscalls_handle_ops.cpp
+++ b/kernel/lib/syscalls/syscalls_handle_ops.cpp
@@ -17,22 +17,22 @@
 
 #define LOCAL_TRACE 0
 
-mx_status_t sys_handle_close(mx_handle_t handle_value) {
+zx_status_t sys_handle_close(zx_handle_t handle_value) {
     LTRACEF("handle %x\n", handle_value);
 
     // Closing the "never a handle" invalid handle is not an error
     // It's like free(NULL).
-    if (handle_value == MX_HANDLE_INVALID)
-        return MX_OK;
+    if (handle_value == ZX_HANDLE_INVALID)
+        return ZX_OK;
     auto up = ProcessDispatcher::GetCurrent();
     HandleOwner handle(up->RemoveHandle(handle_value));
     if (!handle)
-        return MX_ERR_BAD_HANDLE;
-    return MX_OK;
+        return ZX_ERR_BAD_HANDLE;
+    return ZX_OK;
 }
 
-static mx_status_t handle_dup_replace(
-    bool is_replace, mx_handle_t handle_value, mx_rights_t rights, user_ptr<mx_handle_t> _out) {
+static zx_status_t handle_dup_replace(
+    bool is_replace, zx_handle_t handle_value, zx_rights_t rights, user_ptr<zx_handle_t> _out) {
     LTRACEF("handle %x\n", handle_value);
 
     auto up = ProcessDispatcher::GetCurrent();
@@ -41,25 +41,25 @@
         fbl::AutoLock lock(up->handle_table_lock());
         auto source = up->GetHandleLocked(handle_value);
         if (!source)
-            return MX_ERR_BAD_HANDLE;
+            return ZX_ERR_BAD_HANDLE;
 
         if (!is_replace) {
-            if (!source->HasRights(MX_RIGHT_DUPLICATE))
-                return MX_ERR_ACCESS_DENIED;
+            if (!source->HasRights(ZX_RIGHT_DUPLICATE))
+                return ZX_ERR_ACCESS_DENIED;
         }
 
-        if (rights == MX_RIGHT_SAME_RIGHTS) {
+        if (rights == ZX_RIGHT_SAME_RIGHTS) {
             rights = source->rights();
         } else if ((source->rights() & rights) != rights) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         HandleOwner dest(DupHandle(source, rights, is_replace));
         if (!dest)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
-        if (_out.copy_to_user(up->MapHandleToValue(dest)) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+        if (_out.copy_to_user(up->MapHandleToValue(dest)) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
 
         if (is_replace)
             up->RemoveHandleLocked(handle_value);
@@ -67,15 +67,15 @@
         up->AddHandleLocked(fbl::move(dest));
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_handle_duplicate(
-    mx_handle_t handle_value, mx_rights_t rights, user_ptr<mx_handle_t> _out) {
+zx_status_t sys_handle_duplicate(
+    zx_handle_t handle_value, zx_rights_t rights, user_ptr<zx_handle_t> _out) {
     return handle_dup_replace(false, handle_value, rights, _out);
 }
 
-mx_status_t sys_handle_replace(
-    mx_handle_t handle_value, mx_rights_t rights, user_ptr<mx_handle_t> _out) {
+zx_status_t sys_handle_replace(
+    zx_handle_t handle_value, zx_rights_t rights, user_ptr<zx_handle_t> _out) {
     return handle_dup_replace(true, handle_value, rights, _out);
 }
diff --git a/kernel/lib/syscalls/syscalls_hypervisor.cpp b/kernel/lib/syscalls/syscalls_hypervisor.cpp
index 42a1196..51eff3b 100644
--- a/kernel/lib/syscalls/syscalls_hypervisor.cpp
+++ b/kernel/lib/syscalls/syscalls_hypervisor.cpp
@@ -4,7 +4,7 @@
 // license that can be found in the LICENSE file or at
 // https://opensource.org/licenses/MIT
 
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls/hypervisor.h>
 
 #include <object/guest_dispatcher.h>
 #include <object/handle_owner.h>
@@ -19,166 +19,166 @@
 
 #include "syscalls_priv.h"
 
-mx_status_t sys_guest_create(mx_handle_t resource, uint32_t options, mx_handle_t physmem_vmo,
-                             user_ptr<mx_handle_t> out) {
+zx_status_t sys_guest_create(zx_handle_t resource, uint32_t options, zx_handle_t physmem_vmo,
+                             user_ptr<zx_handle_t> out) {
     if (options != 0u)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
-    mx_status_t status = validate_resource(resource, MX_RSRC_KIND_HYPERVISOR);
-    if (status != MX_OK)
+    zx_status_t status = validate_resource(resource, ZX_RSRC_KIND_HYPERVISOR);
+    if (status != ZX_OK)
         return status;
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<VmObjectDispatcher> physmem;
-    mx_rights_t rights = MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_EXECUTE;
+    zx_rights_t rights = ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_EXECUTE;
     status = up->GetDispatcherWithRights(physmem_vmo, rights, &physmem);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     fbl::RefPtr<Dispatcher> dispatcher;
     status = GuestDispatcher::Create(physmem->vmo(), &dispatcher, &rights);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     status = out.copy_to_user(up->MapHandleToValue(handle));
-    if (status != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (status != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(handle));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_guest_set_trap(mx_handle_t guest_handle, uint32_t kind, mx_vaddr_t addr, size_t len,
-                               mx_handle_t port_handle, uint64_t key) {
+zx_status_t sys_guest_set_trap(zx_handle_t guest_handle, uint32_t kind, zx_vaddr_t addr, size_t len,
+                               zx_handle_t port_handle, uint64_t key) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<GuestDispatcher> guest;
-    mx_status_t status = up->GetDispatcherWithRights(guest_handle, MX_RIGHT_WRITE, &guest);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(guest_handle, ZX_RIGHT_WRITE, &guest);
+    if (status != ZX_OK)
         return status;
 
     fbl::RefPtr<PortDispatcher> port;
-    if (port_handle != MX_HANDLE_INVALID) {
-        status = up->GetDispatcherWithRights(port_handle, MX_RIGHT_WRITE, &port);
-        if (status != MX_OK)
+    if (port_handle != ZX_HANDLE_INVALID) {
+        status = up->GetDispatcherWithRights(port_handle, ZX_RIGHT_WRITE, &port);
+        if (status != ZX_OK)
             return status;
     }
 
     return guest->SetTrap(kind, addr, len, fbl::move(port), key);
 }
 
-mx_status_t sys_vcpu_create(mx_handle_t guest_handle, uint32_t options,
-                            user_ptr<const mx_vcpu_create_args_t> _args,
-                            user_ptr<mx_handle_t> out) {
+zx_status_t sys_vcpu_create(zx_handle_t guest_handle, uint32_t options,
+                            user_ptr<const zx_vcpu_create_args_t> _args,
+                            user_ptr<zx_handle_t> out) {
     if (options != 0u)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<GuestDispatcher> guest;
-    mx_status_t status = up->GetDispatcherWithRights(guest_handle, MX_RIGHT_WRITE, &guest);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(guest_handle, ZX_RIGHT_WRITE, &guest);
+    if (status != ZX_OK)
         return status;
 
-    mx_vcpu_create_args_t args;
+    zx_vcpu_create_args_t args;
     status = _args.copy_from_user(&args);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
 #if ARCH_X86_64
     fbl::RefPtr<VmObjectDispatcher> apic;
-    status = up->GetDispatcherWithRights(args.apic_vmo, MX_RIGHT_READ | MX_RIGHT_WRITE, &apic);
-    if (status != MX_OK)
+    status = up->GetDispatcherWithRights(args.apic_vmo, ZX_RIGHT_READ | ZX_RIGHT_WRITE, &apic);
+    if (status != ZX_OK)
         return status;
 
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
+    zx_rights_t rights;
     status = VcpuDispatcher::Create(guest, args.ip, args.cr3, apic->vmo(), &dispatcher, &rights);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     status = out.copy_to_user(up->MapHandleToValue(handle));
-    if (status != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (status != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(handle));
-    return MX_OK;
+    return ZX_OK;
 #else // ARCH_X86_64
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif
 }
 
-mx_status_t sys_vcpu_resume(mx_handle_t vcpu_handle, user_ptr<mx_port_packet_t> _packet) {
+zx_status_t sys_vcpu_resume(zx_handle_t vcpu_handle, user_ptr<zx_port_packet_t> _packet) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<VcpuDispatcher> vcpu;
-    mx_status_t status = up->GetDispatcherWithRights(vcpu_handle, MX_RIGHT_EXECUTE, &vcpu);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(vcpu_handle, ZX_RIGHT_EXECUTE, &vcpu);
+    if (status != ZX_OK)
         return status;
 
-    mx_port_packet packet;
+    zx_port_packet packet;
     status = vcpu->Resume(&packet);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     status = _packet.copy_to_user(packet);
-    if (status != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (status != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_vcpu_interrupt(mx_handle_t vcpu_handle, uint32_t vector) {
+zx_status_t sys_vcpu_interrupt(zx_handle_t vcpu_handle, uint32_t vector) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<VcpuDispatcher> vcpu;
-    mx_status_t status = up->GetDispatcherWithRights(vcpu_handle, MX_RIGHT_SIGNAL, &vcpu);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(vcpu_handle, ZX_RIGHT_SIGNAL, &vcpu);
+    if (status != ZX_OK)
         return status;
 
     return vcpu->Interrupt(vector);
 }
 
-mx_status_t sys_vcpu_read_state(mx_handle_t vcpu_handle, uint32_t kind,
+zx_status_t sys_vcpu_read_state(zx_handle_t vcpu_handle, uint32_t kind,
                                 user_ptr<void> _buffer, uint32_t len) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<VcpuDispatcher> vcpu;
-    mx_status_t status = up->GetDispatcherWithRights(vcpu_handle, MX_RIGHT_READ, &vcpu);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(vcpu_handle, ZX_RIGHT_READ, &vcpu);
+    if (status != ZX_OK)
         return status;
 
-    alignas(alignof(mx_vcpu_state_t)) uint8_t buffer[sizeof(mx_vcpu_state_t)];
+    alignas(alignof(zx_vcpu_state_t)) uint8_t buffer[sizeof(zx_vcpu_state_t)];
     if (len > sizeof(buffer))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     status = vcpu->ReadState(kind, buffer, len);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     status = _buffer.copy_array_to_user(buffer, len);
-    if (status != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-    return MX_OK;
+    if (status != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+    return ZX_OK;
 }
 
-mx_status_t sys_vcpu_write_state(mx_handle_t vcpu_handle, uint32_t kind,
+zx_status_t sys_vcpu_write_state(zx_handle_t vcpu_handle, uint32_t kind,
                                  user_ptr<const void> _buffer, uint32_t len) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<VcpuDispatcher> vcpu;
-    mx_status_t status = up->GetDispatcherWithRights(vcpu_handle, MX_RIGHT_WRITE, &vcpu);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(vcpu_handle, ZX_RIGHT_WRITE, &vcpu);
+    if (status != ZX_OK)
         return status;
 
-    uint8_t buffer[sizeof(mx_vcpu_state_t)];
+    uint8_t buffer[sizeof(zx_vcpu_state_t)];
     if (len > sizeof(buffer))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     status = _buffer.copy_array_from_user(buffer, len);
-    if (status != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (status != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
     return vcpu->WriteState(kind, buffer, len);
 }
diff --git a/kernel/lib/syscalls/syscalls_magenta.cpp b/kernel/lib/syscalls/syscalls_magenta.cpp
deleted file mode 100644
index 9d3e1c1..0000000
--- a/kernel/lib/syscalls/syscalls_magenta.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-// Copyright 2016 The Fuchsia Authors
-//
-// Use of this source code is governed by a MIT-style
-// license that can be found in the LICENSE file or at
-// https://opensource.org/licenses/MIT
-
-#include <err.h>
-#include <inttypes.h>
-#include <platform.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <trace.h>
-
-#include <explicit-memory/bytes.h>
-#include <kernel/auto_lock.h>
-#include <kernel/thread.h>
-#include <lib/crypto/global_prng.h>
-#include <lib/user_copy/user_ptr.h>
-#include <object/event_dispatcher.h>
-#include <object/event_pair_dispatcher.h>
-#include <object/handle_owner.h>
-#include <object/handles.h>
-#include <object/log_dispatcher.h>
-#include <object/process_dispatcher.h>
-#include <object/resources.h>
-#include <object/thread_dispatcher.h>
-
-#include <magenta/syscalls/log.h>
-#include <magenta/syscalls/policy.h>
-#include <fbl/alloc_checker.h>
-#include <fbl/atomic.h>
-#include <fbl/ref_ptr.h>
-
-#include "syscalls_priv.h"
-
-#define LOCAL_TRACE 0
-
-constexpr size_t kMaxCPRNGDraw = MX_CPRNG_DRAW_MAX_LEN;
-constexpr size_t kMaxCPRNGSeed = MX_CPRNG_ADD_ENTROPY_MAX_LEN;
-
-mx_status_t sys_nanosleep(mx_time_t deadline) {
-    LTRACEF("nseconds %" PRIu64 "\n", deadline);
-
-    if (deadline == 0ull) {
-        thread_yield();
-        return MX_OK;
-    }
-
-    // This syscall is declared as "blocking" in syscalls.sysgen, so a higher
-    // layer will automatically retry if we return MX_ERR_INTERNAL_INTR_RETRY.
-    return thread_sleep_etc(deadline, /*interruptable=*/true);
-}
-
-// This must be accessed atomically from any given thread.
-static fbl::atomic<int64_t> utc_offset;
-
-uint64_t sys_time_get(uint32_t clock_id) {
-    switch (clock_id) {
-    case MX_CLOCK_MONOTONIC:
-        return current_time();
-    case MX_CLOCK_UTC:
-        return current_time() + utc_offset.load();
-    case MX_CLOCK_THREAD:
-        return ThreadDispatcher::GetCurrent()->runtime_ns();
-    default:
-        //TODO: figure out the best option here
-        return 0u;
-    }
-}
-
-mx_status_t sys_clock_adjust(mx_handle_t hrsrc, uint32_t clock_id, int64_t offset) {
-    // TODO(MG-971): finer grained validation
-    mx_status_t status;
-    if ((status = validate_resource(hrsrc, MX_RSRC_KIND_ROOT)) < 0) {
-        return status;
-    }
-
-    switch (clock_id) {
-    case MX_CLOCK_MONOTONIC:
-        return MX_ERR_ACCESS_DENIED;
-    case MX_CLOCK_UTC:
-        utc_offset.store(offset);
-        return MX_OK;
-    default:
-        return MX_ERR_INVALID_ARGS;
-    }
-}
-
-mx_status_t sys_event_create(uint32_t options, user_ptr<mx_handle_t> _out) {
-    LTRACEF("options 0x%x\n", options);
-
-    if (options != 0u)
-        return MX_ERR_INVALID_ARGS;
-
-    auto up = ProcessDispatcher::GetCurrent();
-    mx_status_t res = up->QueryPolicy(MX_POL_NEW_EVENT);
-    if (res != MX_OK)
-        return res;
-
-    fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
-
-    mx_status_t result = EventDispatcher::Create(options, &dispatcher, &rights);
-    if (result != MX_OK)
-        return result;
-
-    HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
-    if (!handle)
-        return MX_ERR_NO_MEMORY;
-
-    if (_out.copy_to_user(up->MapHandleToValue(handle)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-
-    up->AddHandle(fbl::move(handle));
-    return MX_OK;
-}
-
-mx_status_t sys_eventpair_create(uint32_t options,
-                                 user_ptr<mx_handle_t> _out0, user_ptr<mx_handle_t> _out1) {
-    LTRACEF("entry out_handles %p,%p\n", _out0.get(), _out1.get());
-
-    if (options != 0u)  // No options defined/supported yet.
-        return MX_ERR_NOT_SUPPORTED;
-
-    auto up = ProcessDispatcher::GetCurrent();
-    mx_status_t res = up->QueryPolicy(MX_POL_NEW_EVPAIR);
-    if (res != MX_OK)
-        return res;
-
-    fbl::RefPtr<Dispatcher> epd0, epd1;
-    mx_rights_t rights;
-    mx_status_t result = EventPairDispatcher::Create(&epd0, &epd1, &rights);
-    if (result != MX_OK)
-        return result;
-
-    HandleOwner h0(MakeHandle(fbl::move(epd0), rights));
-    if (!h0)
-        return MX_ERR_NO_MEMORY;
-
-    HandleOwner h1(MakeHandle(fbl::move(epd1), rights));
-    if (!h1)
-        return MX_ERR_NO_MEMORY;
-
-    if (_out0.copy_to_user(up->MapHandleToValue(h0)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-
-    if (_out1.copy_to_user(up->MapHandleToValue(h1)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-
-    up->AddHandle(fbl::move(h0));
-    up->AddHandle(fbl::move(h1));
-
-    return MX_OK;
-}
-
-mx_status_t sys_log_create(uint32_t options, user_ptr<mx_handle_t> out) {
-    LTRACEF("options 0x%x\n", options);
-
-    // create a Log dispatcher
-    fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
-    mx_status_t result = LogDispatcher::Create(options, &dispatcher, &rights);
-    if (result != MX_OK)
-        return result;
-
-    // by default log objects are write-only
-    // as readable logs are more expensive
-    if (options & MX_LOG_FLAG_READABLE) {
-        rights |= MX_RIGHT_READ;
-    }
-
-    // create a handle and attach the dispatcher to it
-    HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
-    if (!handle)
-        return MX_ERR_NO_MEMORY;
-
-    auto up = ProcessDispatcher::GetCurrent();
-
-    if (out.copy_to_user(up->MapHandleToValue(handle)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-
-    up->AddHandle(fbl::move(handle));
-
-    return MX_OK;
-}
-
-mx_status_t sys_debuglog_create(mx_handle_t rsrc, uint32_t options,
-                                user_ptr<mx_handle_t> out) {
-    mx_status_t status = validate_resource(rsrc, MX_RSRC_KIND_ROOT);
-    if (status != MX_OK)
-        return status;
-
-    return sys_log_create(options, out);
-}
-
-mx_status_t sys_debuglog_write(mx_handle_t log_handle, uint32_t options, user_ptr<const void> _ptr, size_t len) {
-    LTRACEF("log handle %x, opt %x, ptr 0x%p, len %zu\n", log_handle, options, _ptr.get(), len);
-
-    if (len > DLOG_MAX_DATA)
-        return MX_ERR_OUT_OF_RANGE;
-
-    if (options & (~MX_LOG_FLAGS_MASK))
-        return MX_ERR_INVALID_ARGS;
-
-    auto up = ProcessDispatcher::GetCurrent();
-
-    fbl::RefPtr<LogDispatcher> log;
-    mx_status_t status = up->GetDispatcherWithRights(log_handle, MX_RIGHT_WRITE, &log);
-    if (status != MX_OK)
-        return status;
-
-    char buf[DLOG_MAX_RECORD];
-    if (_ptr.reinterpret<const char>().copy_array_from_user(buf, len) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-
-    return log->Write(options, buf, len);
-}
-
-mx_status_t sys_debuglog_read(mx_handle_t log_handle, uint32_t options, user_ptr<void> _ptr, size_t len) {
-    LTRACEF("log handle %x, opt %x, ptr 0x%p, len %zu\n", log_handle, options, _ptr.get(), len);
-
-    if (options != 0)
-        return MX_ERR_INVALID_ARGS;
-
-    auto up = ProcessDispatcher::GetCurrent();
-
-    fbl::RefPtr<LogDispatcher> log;
-    mx_status_t status = up->GetDispatcherWithRights(log_handle, MX_RIGHT_READ, &log);
-    if (status != MX_OK)
-        return status;
-
-    char buf[DLOG_MAX_RECORD];
-    size_t actual;
-    if ((status = log->Read(options, buf, DLOG_MAX_RECORD, &actual)) < 0)
-        return status;
-
-    if (_ptr.copy_array_to_user(buf, actual) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-
-    return static_cast<mx_status_t>(actual);
-}
-
-mx_status_t sys_log_write(mx_handle_t log_handle, uint32_t len, user_ptr<const void> _ptr, uint32_t options) {
-    return sys_debuglog_write(log_handle, options, _ptr, len);
-}
-
-mx_status_t sys_log_read(mx_handle_t log_handle, uint32_t len, user_ptr<void> _ptr, uint32_t options) {
-    return sys_debuglog_read(log_handle, options, _ptr, len);
-}
-
-mx_status_t sys_cprng_draw(user_ptr<void> _buffer, size_t len, user_ptr<size_t> _actual) {
-    if (len > kMaxCPRNGDraw)
-        return MX_ERR_INVALID_ARGS;
-
-    uint8_t kernel_buf[kMaxCPRNGDraw];
-    // Ensure we get rid of the stack copy of the random data as this function
-    // returns.
-    explicit_memory::ZeroDtor<uint8_t> zero_guard(kernel_buf, sizeof(kernel_buf));
-
-    auto prng = crypto::GlobalPRNG::GetInstance();
-    ASSERT(prng->is_thread_safe());
-    prng->Draw(kernel_buf, static_cast<int>(len));
-
-    if (_buffer.copy_array_to_user(kernel_buf, len) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-    if (_actual.copy_to_user(len) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-
-    return MX_OK;
-}
-
-mx_status_t sys_cprng_add_entropy(user_ptr<const void> _buffer, size_t len) {
-    if (len > kMaxCPRNGSeed)
-        return MX_ERR_INVALID_ARGS;
-
-    uint8_t kernel_buf[kMaxCPRNGSeed];
-    // Ensure we get rid of the stack copy of the entropy as this function
-    // returns.
-    explicit_memory::ZeroDtor<uint8_t> zero_guard(kernel_buf, sizeof(kernel_buf));
-
-    if (_buffer.copy_array_from_user(kernel_buf, len) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
-
-    auto prng = crypto::GlobalPRNG::GetInstance();
-    ASSERT(prng->is_thread_safe());
-    prng->AddEntropy(kernel_buf, static_cast<int>(len));
-
-    return MX_OK;
-}
diff --git a/kernel/lib/syscalls/syscalls_object.cpp b/kernel/lib/syscalls/syscalls_object.cpp
index d24a2a6..8b1bcb3 100644
--- a/kernel/lib/syscalls/syscalls_object.cpp
+++ b/kernel/lib/syscalls/syscalls_object.cpp
@@ -37,7 +37,7 @@
 public:
     // If |job| is true, only records job koids; otherwise, only
     // records process koids.
-    SimpleJobEnumerator(user_ptr<mx_koid_t> ptr, size_t max, bool jobs)
+    SimpleJobEnumerator(user_ptr<zx_koid_t> ptr, size_t max, bool jobs)
         : jobs_(jobs), ptr_(ptr), max_(max) {}
 
     size_t get_avail() const { return avail_; }
@@ -58,11 +58,11 @@
         return RecordKoid(proc->get_koid());
     }
 
-    bool RecordKoid(mx_koid_t koid) {
+    bool RecordKoid(zx_koid_t koid) {
         avail_++;
         if (count_ < max_) {
             // TODO: accumulate batches and do fewer user copies
-            if (ptr_.copy_array_to_user(&koid, 1, count_) != MX_OK) {
+            if (ptr_.copy_array_to_user(&koid, 1, count_) != ZX_OK) {
                 return false;
             }
             count_++;
@@ -71,33 +71,33 @@
     }
 
     const bool jobs_;
-    const user_ptr<mx_koid_t> ptr_;
+    const user_ptr<zx_koid_t> ptr_;
     const size_t max_;
 
     size_t count_ = 0;
     size_t avail_ = 0;
 };
 
-mx_status_t single_record_result(user_ptr<void> _buffer, size_t buffer_size,
+zx_status_t single_record_result(user_ptr<void> _buffer, size_t buffer_size,
                                  user_ptr<size_t> _actual,
                                  user_ptr<size_t> _avail,
                                  void* record_data, size_t record_size) {
     size_t avail = 1;
     size_t actual;
     if (buffer_size >= record_size) {
-        if (_buffer.copy_array_to_user(record_data, record_size) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+        if (_buffer.copy_array_to_user(record_data, record_size) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
         actual = 1;
     } else {
         actual = 0;
     }
-    if (_actual && (_actual.copy_to_user(actual) != MX_OK))
-        return MX_ERR_INVALID_ARGS;
-    if (_avail && (_avail.copy_to_user(avail) != MX_OK))
-        return MX_ERR_INVALID_ARGS;
+    if (_actual && (_actual.copy_to_user(actual) != ZX_OK))
+        return ZX_ERR_INVALID_ARGS;
+    if (_avail && (_avail.copy_to_user(avail) != ZX_OK))
+        return ZX_ERR_INVALID_ARGS;
     if (actual == 0)
-        return MX_ERR_BUFFER_TOO_SMALL;
-    return MX_OK;
+        return ZX_ERR_BUFFER_TOO_SMALL;
+    return ZX_OK;
 }
 
 } // namespace
@@ -105,11 +105,11 @@
 // actual is an optional return parameter for the number of records returned
 // avail is an optional return parameter for the number of records available
 
-// Topics which return a fixed number of records will return MX_ERR_BUFFER_TOO_SMALL
+// Topics which return a fixed number of records will return ZX_ERR_BUFFER_TOO_SMALL
 // if there is not enough buffer space provided.
-// This allows for mx_object_get_info(handle, topic, &info, sizeof(info), NULL, NULL)
+// This allows for zx_object_get_info(handle, topic, &info, sizeof(info), NULL, NULL)
 
-mx_status_t sys_object_get_info(mx_handle_t handle, uint32_t topic,
+zx_status_t sys_object_get_info(zx_handle_t handle, uint32_t topic,
                                 user_ptr<void> _buffer, size_t buffer_size,
                                 user_ptr<size_t> _actual, user_ptr<size_t> _avail) {
     LTRACEF("handle %x topic %u\n", handle, topic);
@@ -117,57 +117,57 @@
     ProcessDispatcher* up = ProcessDispatcher::GetCurrent();
 
     switch (topic) {
-        case MX_INFO_HANDLE_VALID: {
-            return up->IsHandleValid(handle) ?  MX_OK : MX_ERR_BAD_HANDLE;
+        case ZX_INFO_HANDLE_VALID: {
+            return up->IsHandleValid(handle) ?  ZX_OK : ZX_ERR_BAD_HANDLE;
         }
-        case MX_INFO_HANDLE_BASIC: {
+        case ZX_INFO_HANDLE_BASIC: {
             // TODO(MG-458): Handle forward/backward compatibility issues
             // with changes to the struct.
 
             fbl::RefPtr<Dispatcher> dispatcher;
-            mx_rights_t rights;
+            zx_rights_t rights;
             auto status = up->GetDispatcherAndRights(handle, &dispatcher, &rights);
-            if (status != MX_OK)
+            if (status != ZX_OK)
                 return status;
 
             bool waitable = dispatcher->get_state_tracker() != nullptr;
 
             // build the info structure
-            mx_info_handle_basic_t info = {
+            zx_info_handle_basic_t info = {
                 .koid = dispatcher->get_koid(),
                 .rights = rights,
                 .type = dispatcher->get_type(),
                 .related_koid = dispatcher->get_related_koid(),
-                .props = waitable ? MX_OBJ_PROP_WAITABLE : MX_OBJ_PROP_NONE,
+                .props = waitable ? ZX_OBJ_PROP_WAITABLE : ZX_OBJ_PROP_NONE,
             };
 
             return single_record_result(
                 _buffer, buffer_size, _actual, _avail, &info, sizeof(info));
         }
-        case MX_INFO_PROCESS: {
+        case ZX_INFO_PROCESS: {
             // TODO(MG-458): Handle forward/backward compatibility issues
             // with changes to the struct.
 
             // grab a reference to the dispatcher
             fbl::RefPtr<ProcessDispatcher> process;
-            auto error = up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &process);
+            auto error = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &process);
             if (error < 0)
                 return error;
 
             // build the info structure
-            mx_info_process_t info = { };
+            zx_info_process_t info = { };
 
             auto err = process->GetInfo(&info);
-            if (err != MX_OK)
+            if (err != ZX_OK)
                 return err;
 
             return single_record_result(
                 _buffer, buffer_size, _actual, _avail, &info, sizeof(info));
         }
-        case MX_INFO_PROCESS_THREADS: {
+        case ZX_INFO_PROCESS_THREADS: {
             // grab a reference to the dispatcher
             fbl::RefPtr<ProcessDispatcher> process;
-            auto error = up->GetDispatcherWithRights(handle, MX_RIGHT_ENUMERATE, &process);
+            auto error = up->GetDispatcherWithRights(handle, ZX_RIGHT_ENUMERATE, &process);
             if (error < 0)
                 return error;
 
@@ -178,186 +178,186 @@
             // more threads exist than what we computed at that same point in
             // time.
 
-            fbl::Array<mx_koid_t> threads;
-            mx_status_t status = process->GetThreads(&threads);
-            if (status != MX_OK)
+            fbl::Array<zx_koid_t> threads;
+            zx_status_t status = process->GetThreads(&threads);
+            if (status != ZX_OK)
                 return status;
             size_t num_threads = threads.size();
-            size_t num_space_for = buffer_size / sizeof(mx_koid_t);
+            size_t num_space_for = buffer_size / sizeof(zx_koid_t);
             size_t num_to_copy = MIN(num_threads, num_space_for);
 
             // Don't try to copy if there are no bytes to copy, as the "is
             // user space" check may not handle (_buffer == NULL and len == 0).
             if (num_to_copy &&
-                _buffer.copy_array_to_user(threads.get(), sizeof(mx_koid_t) * num_to_copy) != MX_OK)
-                return MX_ERR_INVALID_ARGS;
-            if (_actual && (_actual.copy_to_user(num_to_copy) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
-            if (_avail && (_avail.copy_to_user(num_threads) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
-            return MX_OK;
+                _buffer.copy_array_to_user(threads.get(), sizeof(zx_koid_t) * num_to_copy) != ZX_OK)
+                return ZX_ERR_INVALID_ARGS;
+            if (_actual && (_actual.copy_to_user(num_to_copy) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
+            if (_avail && (_avail.copy_to_user(num_threads) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
+            return ZX_OK;
         }
-        case MX_INFO_JOB_CHILDREN:
-        case MX_INFO_JOB_PROCESSES: {
+        case ZX_INFO_JOB_CHILDREN:
+        case ZX_INFO_JOB_PROCESSES: {
             fbl::RefPtr<JobDispatcher> job;
-            auto error = up->GetDispatcherWithRights(handle, MX_RIGHT_ENUMERATE, &job);
+            auto error = up->GetDispatcherWithRights(handle, ZX_RIGHT_ENUMERATE, &job);
             if (error < 0)
                 return error;
 
-            size_t max = buffer_size / sizeof(mx_koid_t);
-            auto koids = _buffer.reinterpret<mx_koid_t>();
-            SimpleJobEnumerator sje(koids, max, topic == MX_INFO_JOB_CHILDREN);
+            size_t max = buffer_size / sizeof(zx_koid_t);
+            auto koids = _buffer.reinterpret<zx_koid_t>();
+            SimpleJobEnumerator sje(koids, max, topic == ZX_INFO_JOB_CHILDREN);
 
             // Don't recurse; we only want the job's direct children.
             if (!job->EnumerateChildren(&sje, /* recurse */ false)) {
                 // SimpleJobEnumerator only returns false when it can't
                 // write to the user pointer.
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
-            if (_actual && (_actual.copy_to_user(sje.get_count()) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
-            if (_avail && (_avail.copy_to_user(sje.get_avail()) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
-            return MX_OK;
+            if (_actual && (_actual.copy_to_user(sje.get_count()) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
+            if (_avail && (_avail.copy_to_user(sje.get_avail()) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
+            return ZX_OK;
         }
-        case MX_INFO_THREAD: {
+        case ZX_INFO_THREAD: {
             // TODO(MG-458): Handle forward/backward compatibility issues
             // with changes to the struct.
 
             // grab a reference to the dispatcher
             fbl::RefPtr<ThreadDispatcher> thread;
-            auto error = up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &thread);
+            auto error = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &thread);
             if (error < 0)
                 return error;
 
             // build the info structure
-            mx_info_thread_t info = { };
+            zx_info_thread_t info = { };
 
             auto err = thread->GetInfoForUserspace(&info);
-            if (err != MX_OK)
+            if (err != ZX_OK)
                 return err;
 
             return single_record_result(
                 _buffer, buffer_size, _actual, _avail, &info, sizeof(info));
         }
-        case MX_INFO_THREAD_EXCEPTION_REPORT: {
+        case ZX_INFO_THREAD_EXCEPTION_REPORT: {
             // TODO(MG-458): Handle forward/backward compatibility issues
             // with changes to the struct.
 
             // grab a reference to the dispatcher
             fbl::RefPtr<ThreadDispatcher> thread;
-            auto error = up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &thread);
+            auto error = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &thread);
             if (error < 0)
                 return error;
 
             // build the info structure
-            mx_exception_report_t report = { };
+            zx_exception_report_t report = { };
 
             auto err = thread->GetExceptionReport(&report);
-            if (err != MX_OK)
+            if (err != ZX_OK)
                 return err;
 
             return single_record_result(
                 _buffer, buffer_size, _actual, _avail, &report, sizeof(report));
         }
-        case MX_INFO_THREAD_STATS: {
+        case ZX_INFO_THREAD_STATS: {
             // TODO(MG-458): Handle forward/backward compatibility issues
             // with changes to the struct.
 
             // grab a reference to the dispatcher
             fbl::RefPtr<ThreadDispatcher> thread;
-            auto error = up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &thread);
+            auto error = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &thread);
             if (error < 0)
                 return error;
 
             // build the info structure
-            mx_info_thread_stats_t info = { };
+            zx_info_thread_stats_t info = { };
 
             auto err = thread->GetStatsForUserspace(&info);
-            if (err != MX_OK)
+            if (err != ZX_OK)
                 return err;
 
             return single_record_result(
                 _buffer, buffer_size, _actual, _avail, &info, sizeof(info));
         }
-        case MX_INFO_TASK_STATS: {
+        case ZX_INFO_TASK_STATS: {
             // TODO(MG-458): Handle forward/backward compatibility issues
             // with changes to the struct.
 
             // Grab a reference to the dispatcher. Only supports processes for
             // now, but could support jobs or threads in the future.
             fbl::RefPtr<ProcessDispatcher> process;
-            auto error = up->GetDispatcherWithRights(handle, MX_RIGHT_READ,
+            auto error = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ,
                                                      &process);
             if (error < 0)
                 return error;
 
             // Build the info structure.
-            mx_info_task_stats_t info = {};
+            zx_info_task_stats_t info = {};
 
             auto err = process->GetStats(&info);
-            if (err != MX_OK)
+            if (err != ZX_OK)
                 return err;
 
             return single_record_result(
                 _buffer, buffer_size, _actual, _avail, &info, sizeof(info));
         }
-        case MX_INFO_PROCESS_MAPS: {
+        case ZX_INFO_PROCESS_MAPS: {
             fbl::RefPtr<ProcessDispatcher> process;
-            mx_status_t status =
-                up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &process);
+            zx_status_t status =
+                up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &process);
             if (status < 0)
                 return status;
             if (process.get() == up) {
                 // Not safe to look at yourself: the user buffer will live
                 // inside the VmAspace we're examining, and we can't
                 // fault in the buffer's pages while the aspace lock is held.
-                return MX_ERR_ACCESS_DENIED;
+                return ZX_ERR_ACCESS_DENIED;
             }
 
-            auto maps = _buffer.reinterpret<mx_info_maps_t>();
-            size_t count = buffer_size / sizeof(mx_info_maps_t);
+            auto maps = _buffer.reinterpret<zx_info_maps_t>();
+            size_t count = buffer_size / sizeof(zx_info_maps_t);
             size_t avail = 0;
             status = process->GetAspaceMaps(maps, count, &count, &avail);
 
-            if (_actual && (_actual.copy_to_user(count) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
-            if (_avail && (_avail.copy_to_user(avail) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
+            if (_actual && (_actual.copy_to_user(count) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
+            if (_avail && (_avail.copy_to_user(avail) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
             return status;
         }
-        case MX_INFO_PROCESS_VMOS: {
+        case ZX_INFO_PROCESS_VMOS: {
             fbl::RefPtr<ProcessDispatcher> process;
-            mx_status_t status =
-                up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &process);
+            zx_status_t status =
+                up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &process);
             if (status < 0)
                 return status;
             if (process.get() == up) {
                 // Not safe to look at yourself: the user buffer will live
                 // inside the VmAspace we're examining, and we can't
                 // fault in the buffer's pages while the aspace lock is held.
-                return MX_ERR_ACCESS_DENIED;
+                return ZX_ERR_ACCESS_DENIED;
             }
 
-            auto vmos = _buffer.reinterpret<mx_info_vmo_t>();
-            size_t count = buffer_size / sizeof(mx_info_vmo_t);
+            auto vmos = _buffer.reinterpret<zx_info_vmo_t>();
+            size_t count = buffer_size / sizeof(zx_info_vmo_t);
             size_t avail = 0;
             status = process->GetVmos(vmos, count, &count, &avail);
 
-            if (_actual && (_actual.copy_to_user(count) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
-            if (_avail && (_avail.copy_to_user(avail) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
+            if (_actual && (_actual.copy_to_user(count) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
+            if (_avail && (_avail.copy_to_user(avail) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
             return status;
         }
-        case MX_INFO_VMAR: {
+        case ZX_INFO_VMAR: {
             fbl::RefPtr<VmAddressRegionDispatcher> vmar;
-            mx_status_t status = up->GetDispatcher(handle, &vmar);
+            zx_status_t status = up->GetDispatcher(handle, &vmar);
             if (status < 0)
                 return status;
 
             auto real_vmar = vmar->vmar();
-            mx_info_vmar_t info = {
+            zx_info_vmar_t info = {
                 .base = real_vmar->base(),
                 .len = real_vmar->size(),
             };
@@ -365,20 +365,20 @@
             return single_record_result(
                 _buffer, buffer_size, _actual, _avail, &info, sizeof(info));
         }
-        case MX_INFO_CPU_STATS: {
-            auto status = validate_resource(handle, MX_RSRC_KIND_ROOT);
-            if (status != MX_OK)
+        case ZX_INFO_CPU_STATS: {
+            auto status = validate_resource(handle, ZX_RSRC_KIND_ROOT);
+            if (status != ZX_OK)
                 return status;
 
             // TODO: figure out a better handle to hang this off to and push this copy code into
             // that dispatcher.
 
             size_t num_cpus = arch_max_num_cpus();
-            size_t num_space_for = buffer_size / sizeof(mx_info_cpu_stats_t);
+            size_t num_space_for = buffer_size / sizeof(zx_info_cpu_stats_t);
             size_t num_to_copy = MIN(num_cpus, num_space_for);
 
             // build an alias to the output buffer that is in units of the cpu stat structure
-            user_ptr<mx_info_cpu_stats_t> cpu_buf(static_cast<mx_info_cpu_stats_t *>(_buffer.get()));
+            user_ptr<zx_info_cpu_stats_t> cpu_buf(static_cast<zx_info_cpu_stats_t *>(_buffer.get()));
 
             for (unsigned int i = 0; i < static_cast<unsigned int>(num_to_copy); i++) {
                 const auto cpu = &percpu[i];
@@ -387,15 +387,15 @@
                 // NOTE: it's technically racy to read this without grabbing a lock
                 // but since each field is wordwise any sane architecture will not
                 // return a corrupted value.
-                mx_info_cpu_stats_t stats = {};
+                zx_info_cpu_stats_t stats = {};
                 stats.cpu_number = i;
-                stats.flags = mp_is_cpu_online(i) ? MX_INFO_CPU_STATS_FLAG_ONLINE : 0;
+                stats.flags = mp_is_cpu_online(i) ? ZX_INFO_CPU_STATS_FLAG_ONLINE : 0;
 
                 // account for idle time if a cpu is currently idle
                 {
                     AutoSpinLockIrqSave lock(&thread_lock);
 
-                    mx_time_t idle_time = cpu->stats.idle_time;
+                    zx_time_t idle_time = cpu->stats.idle_time;
                     bool is_idle = mp_is_cpu_idle(i);
                     if (is_idle) {
                         idle_time += current_time() - percpu[i].idle_thread.last_started_running;
@@ -418,19 +418,19 @@
                 stats.generic_ipis = cpu->stats.generic_ipis;
 
                 // copy out one at a time
-                if (cpu_buf.copy_array_to_user(&stats, 1, i) != MX_OK)
-                    return MX_ERR_INVALID_ARGS;
+                if (cpu_buf.copy_array_to_user(&stats, 1, i) != ZX_OK)
+                    return ZX_ERR_INVALID_ARGS;
             }
 
-            if (_actual && (_actual.copy_to_user(num_to_copy) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
-            if (_avail && (_avail.copy_to_user(num_cpus) != MX_OK))
-                return MX_ERR_INVALID_ARGS;
-            return MX_OK;
+            if (_actual && (_actual.copy_to_user(num_to_copy) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
+            if (_avail && (_avail.copy_to_user(num_cpus) != ZX_OK))
+                return ZX_ERR_INVALID_ARGS;
+            return ZX_OK;
         }
-        case MX_INFO_KMEM_STATS: {
-            auto status = validate_resource(handle, MX_RSRC_KIND_ROOT);
-            if (status != MX_OK)
+        case ZX_INFO_KMEM_STATS: {
+            auto status = validate_resource(handle, ZX_RSRC_KIND_ROOT);
+            if (status != ZX_OK)
                 return status;
 
             // TODO: figure out a better handle to hang this off to and push this copy code into
@@ -451,7 +451,7 @@
             // Note that this intentionally uses uint64_t instead of
             // size_t in case we ever have a 32-bit userspace but more
             // than 4GB physical memory.
-            mx_info_kmem_stats_t stats = {};
+            zx_info_kmem_stats_t stats = {};
             stats.total_bytes = total * PAGE_SIZE;
             size_t other_bytes = stats.total_bytes;
 
@@ -477,15 +477,15 @@
             return single_record_result(
                 _buffer, buffer_size, _actual, _avail, &stats, sizeof(stats));
         }
-        case MX_INFO_RESOURCE: {
+        case ZX_INFO_RESOURCE: {
             // grab a reference to the dispatcher
             fbl::RefPtr<ResourceDispatcher> resource;
-            auto error = up->GetDispatcherWithRights(handle, MX_RIGHT_NONE, &resource);
+            auto error = up->GetDispatcherWithRights(handle, ZX_RIGHT_NONE, &resource);
             if (error < 0)
                 return error;
 
             // build the info structure
-            mx_info_resource_t info = {};
+            zx_info_resource_t info = {};
             info.kind = resource->get_kind();
             resource->get_range(&info.low, &info.high);
 
@@ -493,185 +493,185 @@
                 _buffer, buffer_size, _actual, _avail, &info, sizeof(info));
         }
         default:
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-mx_status_t sys_object_get_property(mx_handle_t handle_value, uint32_t property,
+zx_status_t sys_object_get_property(zx_handle_t handle_value, uint32_t property,
                                     user_ptr<void> _value, size_t size) {
     if (!_value)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<Dispatcher> dispatcher;
-    auto status = up->GetDispatcherWithRights(handle_value, MX_RIGHT_GET_PROPERTY, &dispatcher);
-    if (status != MX_OK)
+    auto status = up->GetDispatcherWithRights(handle_value, ZX_RIGHT_GET_PROPERTY, &dispatcher);
+    if (status != ZX_OK)
         return status;
 
     switch (property) {
-        case MX_PROP_NUM_STATE_KINDS: {
+        case ZX_PROP_NUM_STATE_KINDS: {
             if (size != sizeof(uint32_t))
-                return MX_ERR_BUFFER_TOO_SMALL;
+                return ZX_ERR_BUFFER_TOO_SMALL;
             auto thread = DownCastDispatcher<ThreadDispatcher>(&dispatcher);
             if (!thread)
-                return MX_ERR_WRONG_TYPE;
+                return ZX_ERR_WRONG_TYPE;
             uint32_t value = thread->get_num_state_kinds();
-            if (_value.reinterpret<uint32_t>().copy_to_user(value) != MX_OK)
-                return MX_ERR_INVALID_ARGS;
-            return MX_OK;
+            if (_value.reinterpret<uint32_t>().copy_to_user(value) != ZX_OK)
+                return ZX_ERR_INVALID_ARGS;
+            return ZX_OK;
         }
-        case MX_PROP_NAME: {
-            if (size < MX_MAX_NAME_LEN)
-                return MX_ERR_BUFFER_TOO_SMALL;
-            char name[MX_MAX_NAME_LEN];
+        case ZX_PROP_NAME: {
+            if (size < ZX_MAX_NAME_LEN)
+                return ZX_ERR_BUFFER_TOO_SMALL;
+            char name[ZX_MAX_NAME_LEN];
             dispatcher->get_name(name);
-            if (_value.copy_array_to_user(name, MX_MAX_NAME_LEN) != MX_OK)
-                return MX_ERR_INVALID_ARGS;
-            return MX_OK;
+            if (_value.copy_array_to_user(name, ZX_MAX_NAME_LEN) != ZX_OK)
+                return ZX_ERR_INVALID_ARGS;
+            return ZX_OK;
         }
-        case MX_PROP_PROCESS_DEBUG_ADDR: {
+        case ZX_PROP_PROCESS_DEBUG_ADDR: {
             if (size < sizeof(uintptr_t))
-                return MX_ERR_BUFFER_TOO_SMALL;
+                return ZX_ERR_BUFFER_TOO_SMALL;
             auto process = DownCastDispatcher<ProcessDispatcher>(&dispatcher);
             if (!process)
-                return MX_ERR_WRONG_TYPE;
+                return ZX_ERR_WRONG_TYPE;
             uintptr_t value = process->get_debug_addr();
-            if (_value.reinterpret<uintptr_t>().copy_to_user(value) != MX_OK)
-                return MX_ERR_INVALID_ARGS;
-            return MX_OK;
+            if (_value.reinterpret<uintptr_t>().copy_to_user(value) != ZX_OK)
+                return ZX_ERR_INVALID_ARGS;
+            return ZX_OK;
         }
-        case MX_PROP_PROCESS_VDSO_BASE_ADDRESS: {
+        case ZX_PROP_PROCESS_VDSO_BASE_ADDRESS: {
             if (size < sizeof(uintptr_t))
-                return MX_ERR_BUFFER_TOO_SMALL;
+                return ZX_ERR_BUFFER_TOO_SMALL;
             auto process = DownCastDispatcher<ProcessDispatcher>(&dispatcher);
             if (!process)
-                return MX_ERR_WRONG_TYPE;
+                return ZX_ERR_WRONG_TYPE;
             uintptr_t value = process->aspace()->vdso_base_address();
             return _value.reinterpret<uintptr_t>().copy_to_user(value);
         }
-        case MX_PROP_JOB_IMPORTANCE: {
-            if (size != sizeof(mx_job_importance_t))
-                return MX_ERR_BUFFER_TOO_SMALL;
+        case ZX_PROP_JOB_IMPORTANCE: {
+            if (size != sizeof(zx_job_importance_t))
+                return ZX_ERR_BUFFER_TOO_SMALL;
             auto job = DownCastDispatcher<JobDispatcher>(&dispatcher);
             if (!job)
-                return MX_ERR_WRONG_TYPE;
-            mx_job_importance_t value;
-            mx_status_t status = job->get_importance(&value);
-            if (status != MX_OK) {
+                return ZX_ERR_WRONG_TYPE;
+            zx_job_importance_t value;
+            zx_status_t status = job->get_importance(&value);
+            if (status != ZX_OK) {
                 // Usually a problem resolving inherited importance,
                 // like racing with task death.
                 return status;
             }
-            if (_value.reinterpret<mx_job_importance_t>()
-                    .copy_to_user(value) != MX_OK) {
-                return MX_ERR_INVALID_ARGS;
+            if (_value.reinterpret<zx_job_importance_t>()
+                    .copy_to_user(value) != ZX_OK) {
+                return ZX_ERR_INVALID_ARGS;
             }
-            return MX_OK;
+            return ZX_OK;
         }
         default:
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
     }
 
     __UNREACHABLE;
 }
 
-static mx_status_t is_current_thread(fbl::RefPtr<Dispatcher>* dispatcher) {
+static zx_status_t is_current_thread(fbl::RefPtr<Dispatcher>* dispatcher) {
     auto thread_dispatcher = DownCastDispatcher<ThreadDispatcher>(dispatcher);
     if (!thread_dispatcher)
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     if (thread_dispatcher.get() != ThreadDispatcher::GetCurrent())
-        return MX_ERR_ACCESS_DENIED;
-    return MX_OK;
+        return ZX_ERR_ACCESS_DENIED;
+    return ZX_OK;
 }
 
-mx_status_t sys_object_set_property(mx_handle_t handle_value, uint32_t property,
+zx_status_t sys_object_set_property(zx_handle_t handle_value, uint32_t property,
                                     user_ptr<const void> _value, size_t size) {
     if (!_value)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<Dispatcher> dispatcher;
 
-    auto status = up->GetDispatcherWithRights(handle_value, MX_RIGHT_SET_PROPERTY, &dispatcher);
-    if (status != MX_OK)
+    auto status = up->GetDispatcherWithRights(handle_value, ZX_RIGHT_SET_PROPERTY, &dispatcher);
+    if (status != ZX_OK)
         return status;
 
     switch (property) {
-        case MX_PROP_NAME: {
-            if (size >= MX_MAX_NAME_LEN)
-                size = MX_MAX_NAME_LEN - 1;
-            char name[MX_MAX_NAME_LEN - 1];
-            if (_value.copy_array_from_user(name, size) != MX_OK)
-                return MX_ERR_INVALID_ARGS;
+        case ZX_PROP_NAME: {
+            if (size >= ZX_MAX_NAME_LEN)
+                size = ZX_MAX_NAME_LEN - 1;
+            char name[ZX_MAX_NAME_LEN - 1];
+            if (_value.copy_array_from_user(name, size) != ZX_OK)
+                return ZX_ERR_INVALID_ARGS;
             return dispatcher->set_name(name, size);
         }
 #if ARCH_X86_64
-        case MX_PROP_REGISTER_FS: {
+        case ZX_PROP_REGISTER_FS: {
             if (size < sizeof(uintptr_t))
-                return MX_ERR_BUFFER_TOO_SMALL;
-            mx_status_t status = is_current_thread(&dispatcher);
-            if (status != MX_OK)
+                return ZX_ERR_BUFFER_TOO_SMALL;
+            zx_status_t status = is_current_thread(&dispatcher);
+            if (status != ZX_OK)
                 return status;
             uintptr_t addr;
-            if (_value.reinterpret<const uintptr_t>().copy_from_user(&addr) != MX_OK)
-                return MX_ERR_INVALID_ARGS;
+            if (_value.reinterpret<const uintptr_t>().copy_from_user(&addr) != ZX_OK)
+                return ZX_ERR_INVALID_ARGS;
             if (!x86_is_vaddr_canonical(addr))
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             write_msr(X86_MSR_IA32_FS_BASE, addr);
-            return MX_OK;
+            return ZX_OK;
         }
 #endif
-        case MX_PROP_PROCESS_DEBUG_ADDR: {
+        case ZX_PROP_PROCESS_DEBUG_ADDR: {
             if (size < sizeof(uintptr_t))
-                return MX_ERR_BUFFER_TOO_SMALL;
+                return ZX_ERR_BUFFER_TOO_SMALL;
             auto process = DownCastDispatcher<ProcessDispatcher>(&dispatcher);
             if (!process)
-                return MX_ERR_WRONG_TYPE;
+                return ZX_ERR_WRONG_TYPE;
             uintptr_t value = 0;
-            if (_value.reinterpret<const uintptr_t>().copy_from_user(&value) != MX_OK)
-                return MX_ERR_INVALID_ARGS;
+            if (_value.reinterpret<const uintptr_t>().copy_from_user(&value) != ZX_OK)
+                return ZX_ERR_INVALID_ARGS;
             return process->set_debug_addr(value);
         }
-        case MX_PROP_JOB_IMPORTANCE: {
-            if (size != sizeof(mx_job_importance_t))
-                return MX_ERR_BUFFER_TOO_SMALL;
+        case ZX_PROP_JOB_IMPORTANCE: {
+            if (size != sizeof(zx_job_importance_t))
+                return ZX_ERR_BUFFER_TOO_SMALL;
             auto job = DownCastDispatcher<JobDispatcher>(&dispatcher);
             if (!job)
-                return MX_ERR_WRONG_TYPE;
+                return ZX_ERR_WRONG_TYPE;
             int32_t value = 0;
-            if (_value.reinterpret<const mx_job_importance_t>()
-                    .copy_from_user(&value) != MX_OK) {
-                return MX_ERR_INVALID_ARGS;
+            if (_value.reinterpret<const zx_job_importance_t>()
+                    .copy_from_user(&value) != ZX_OK) {
+                return ZX_ERR_INVALID_ARGS;
             }
             return job->set_importance(
-                static_cast<mx_job_importance_t>(value));
+                static_cast<zx_job_importance_t>(value));
         }
     }
 
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
 
-mx_status_t sys_object_signal(mx_handle_t handle_value, uint32_t clear_mask, uint32_t set_mask) {
+zx_status_t sys_object_signal(zx_handle_t handle_value, uint32_t clear_mask, uint32_t set_mask) {
     LTRACEF("handle %x\n", handle_value);
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<Dispatcher> dispatcher;
 
-    auto status = up->GetDispatcherWithRights(handle_value, MX_RIGHT_SIGNAL, &dispatcher);
-    if (status != MX_OK)
+    auto status = up->GetDispatcherWithRights(handle_value, ZX_RIGHT_SIGNAL, &dispatcher);
+    if (status != ZX_OK)
         return status;
 
     return dispatcher->user_signal(clear_mask, set_mask, false);
 }
 
-mx_status_t sys_object_signal_peer(mx_handle_t handle_value, uint32_t clear_mask, uint32_t set_mask) {
+zx_status_t sys_object_signal_peer(zx_handle_t handle_value, uint32_t clear_mask, uint32_t set_mask) {
     LTRACEF("handle %x\n", handle_value);
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<Dispatcher> dispatcher;
 
-    auto status = up->GetDispatcherWithRights(handle_value, MX_RIGHT_SIGNAL_PEER, &dispatcher);
-    if (status != MX_OK)
+    auto status = up->GetDispatcherWithRights(handle_value, ZX_RIGHT_SIGNAL_PEER, &dispatcher);
+    if (status != ZX_OK)
         return status;
 
     return dispatcher->user_signal(clear_mask, set_mask, true);
@@ -680,67 +680,67 @@
 // Given a kernel object with children objects, obtain a handle to the
 // child specified by the provided kernel object id.
 //
-// MX_HANDLE_INVALID is currently treated as a "magic" handle used to
+// ZX_HANDLE_INVALID is currently treated as a "magic" handle used to
 // obtain a process from "the system".
-mx_status_t sys_object_get_child(mx_handle_t handle, uint64_t koid, mx_rights_t rights,
-                                 user_ptr<mx_handle_t> _out) {
+zx_status_t sys_object_get_child(zx_handle_t handle, uint64_t koid, zx_rights_t rights,
+                                 user_ptr<zx_handle_t> _out) {
     auto up = ProcessDispatcher::GetCurrent();
 
-    if (handle == MX_HANDLE_INVALID) {
+    if (handle == ZX_HANDLE_INVALID) {
         //TODO: lookup process from job instead of treating INVALID as magic
         const auto kDebugRights =
-            MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER |
-            MX_RIGHT_GET_PROPERTY | MX_RIGHT_SET_PROPERTY | MX_RIGHT_ENUMERATE;
+            ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER |
+            ZX_RIGHT_GET_PROPERTY | ZX_RIGHT_SET_PROPERTY | ZX_RIGHT_ENUMERATE;
 
-        if (rights == MX_RIGHT_SAME_RIGHTS) {
+        if (rights == ZX_RIGHT_SAME_RIGHTS) {
             rights = kDebugRights;
         } else if ((kDebugRights & rights) != rights) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
 
         auto process = ProcessDispatcher::LookupProcessById(koid);
         if (!process)
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
 
         HandleOwner process_h(
             MakeHandle(fbl::RefPtr<Dispatcher>(process.get()), rights));
         if (!process_h)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         if (_out.copy_to_user(up->MapHandleToValue(process_h)))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         up->AddHandle(fbl::move(process_h));
-        return MX_OK;
+        return ZX_OK;
     }
 
     fbl::RefPtr<Dispatcher> dispatcher;
     uint32_t parent_rights;
     auto status = up->GetDispatcherAndRights(handle, &dispatcher, &parent_rights);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
-    if (!(parent_rights & MX_RIGHT_ENUMERATE))
-        return MX_ERR_ACCESS_DENIED;
+    if (!(parent_rights & ZX_RIGHT_ENUMERATE))
+        return ZX_ERR_ACCESS_DENIED;
 
-    if (rights == MX_RIGHT_SAME_RIGHTS) {
+    if (rights == ZX_RIGHT_SAME_RIGHTS) {
         rights = parent_rights;
     } else if ((parent_rights & rights) != rights) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     auto process = DownCastDispatcher<ProcessDispatcher>(&dispatcher);
     if (process) {
         auto thread = process->LookupThreadById(koid);
         if (!thread)
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
         HandleOwner thread_h(MakeHandle(thread, rights));
         if (!thread_h)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
-        if (_out.copy_to_user(up->MapHandleToValue(thread_h)) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+        if (_out.copy_to_user(up->MapHandleToValue(thread_h)) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
         up->AddHandle(fbl::move(thread_h));
-        return MX_OK;
+        return ZX_OK;
     }
 
     auto job = DownCastDispatcher<JobDispatcher>(&dispatcher);
@@ -749,73 +749,73 @@
         if (child) {
             HandleOwner child_h(MakeHandle(child, rights));
             if (!child_h)
-                return MX_ERR_NO_MEMORY;
+                return ZX_ERR_NO_MEMORY;
 
-            if (_out.copy_to_user(up->MapHandleToValue(child_h)) != MX_OK)
-                return MX_ERR_INVALID_ARGS;
+            if (_out.copy_to_user(up->MapHandleToValue(child_h)) != ZX_OK)
+                return ZX_ERR_INVALID_ARGS;
             up->AddHandle(fbl::move(child_h));
-            return MX_OK;
+            return ZX_OK;
         }
         auto proc = job->LookupProcessById(koid);
         if (proc) {
             HandleOwner child_h(MakeHandle(proc, rights));
             if (!child_h)
-                return MX_ERR_NO_MEMORY;
+                return ZX_ERR_NO_MEMORY;
 
-            if (_out.copy_to_user(up->MapHandleToValue(child_h)) != MX_OK)
-                return MX_ERR_INVALID_ARGS;
+            if (_out.copy_to_user(up->MapHandleToValue(child_h)) != ZX_OK)
+                return ZX_ERR_INVALID_ARGS;
             up->AddHandle(fbl::move(child_h));
-            return MX_OK;
+            return ZX_OK;
         }
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
-    return MX_ERR_WRONG_TYPE;
+    return ZX_ERR_WRONG_TYPE;
 }
 
 
-mx_status_t sys_object_set_cookie(mx_handle_t handle, mx_handle_t hscope, uint64_t cookie) {
+zx_status_t sys_object_set_cookie(zx_handle_t handle, zx_handle_t hscope, uint64_t cookie) {
     auto up = ProcessDispatcher::GetCurrent();
 
-    mx_koid_t scope = up->GetKoidForHandle(hscope);
-    if (scope == MX_KOID_INVALID)
-        return MX_ERR_BAD_HANDLE;
+    zx_koid_t scope = up->GetKoidForHandle(hscope);
+    if (scope == ZX_KOID_INVALID)
+        return ZX_ERR_BAD_HANDLE;
 
     fbl::RefPtr<Dispatcher> dispatcher;
     auto status = up->GetDispatcher(handle, &dispatcher);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     StateTracker* st = dispatcher->get_state_tracker();
     if (st == nullptr)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     return st->SetCookie(dispatcher->get_cookie_jar(), scope, cookie);
 }
 
-mx_status_t sys_object_get_cookie(mx_handle_t handle, mx_handle_t hscope, user_ptr<uint64_t> _cookie) {
+zx_status_t sys_object_get_cookie(zx_handle_t handle, zx_handle_t hscope, user_ptr<uint64_t> _cookie) {
     auto up = ProcessDispatcher::GetCurrent();
 
-    mx_koid_t scope = up->GetKoidForHandle(hscope);
-    if (scope == MX_KOID_INVALID)
-        return MX_ERR_BAD_HANDLE;
+    zx_koid_t scope = up->GetKoidForHandle(hscope);
+    if (scope == ZX_KOID_INVALID)
+        return ZX_ERR_BAD_HANDLE;
 
     fbl::RefPtr<Dispatcher> dispatcher;
     auto status = up->GetDispatcher(handle, &dispatcher);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     StateTracker* st = dispatcher->get_state_tracker();
     if (st == nullptr)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     uint64_t cookie;
     status = st->GetCookie(dispatcher->get_cookie_jar(), scope, &cookie);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
-    if (_cookie.copy_to_user(cookie) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_cookie.copy_to_user(cookie) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/lib/syscalls/syscalls_object_wait.cpp b/kernel/lib/syscalls/syscalls_object_wait.cpp
index ad7ece4..3980e10 100644
--- a/kernel/lib/syscalls/syscalls_object_wait.cpp
+++ b/kernel/lib/syscalls/syscalls_object_wait.cpp
@@ -35,15 +35,15 @@
 // Note: This is used for quite a few InlineArrays (simultaneously) in sys_handle_wait_many.
 constexpr size_t kWaitManyInlineCount = 8u;
 
-mx_status_t sys_object_wait_one(mx_handle_t handle_value,
-                                mx_signals_t signals,
-                                mx_time_t deadline,
-                                user_ptr<mx_signals_t> _observed) {
+zx_status_t sys_object_wait_one(zx_handle_t handle_value,
+                                zx_signals_t signals,
+                                zx_time_t deadline,
+                                user_ptr<zx_signals_t> _observed) {
     LTRACEF("handle %x\n", handle_value);
 
     Event event;
 
-    mx_status_t result;
+    zx_status_t result;
     WaitStateObserver wait_state_observer;
 
     auto up = ProcessDispatcher::GetCurrent();
@@ -52,12 +52,12 @@
 
         Handle* handle = up->GetHandleLocked(handle_value);
         if (!handle)
-            return MX_ERR_BAD_HANDLE;
-        if (!handle->HasRights(MX_RIGHT_READ))
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_BAD_HANDLE;
+        if (!handle->HasRights(ZX_RIGHT_READ))
+            return ZX_ERR_ACCESS_DENIED;
 
         result = wait_state_observer.Begin(&event, handle, signals);
-        if (result != MX_OK)
+        if (result != ZX_OK)
             return result;
     }
 
@@ -66,8 +66,8 @@
     ktrace(TAG_WAIT_ONE, koid, signals, (uint32_t)deadline, (uint32_t)(deadline >> 32));
 #endif
 
-    // event_wait() will return MX_OK if already signaled,
-    // even if the deadline has passed.  It will return MX_ERR_TIMED_OUT
+    // event_wait() will return ZX_OK if already signaled,
+    // even if the deadline has passed.  It will return ZX_ERR_TIMED_OUT
     // after the deadline passes if the event has not been
     // signaled.
     result = event.Wait(deadline);
@@ -80,46 +80,46 @@
 #endif
 
     if (_observed) {
-        if (_observed.copy_to_user(signals_state) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+        if (_observed.copy_to_user(signals_state) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
     }
 
-    if (signals_state & MX_SIGNAL_HANDLE_CLOSED)
-        return MX_ERR_CANCELED;
+    if (signals_state & ZX_SIGNAL_HANDLE_CLOSED)
+        return ZX_ERR_CANCELED;
 
     return result;
 }
 
-mx_status_t sys_object_wait_many(user_ptr<mx_wait_item_t> _items, uint32_t count, mx_time_t deadline) {
+zx_status_t sys_object_wait_many(user_ptr<zx_wait_item_t> _items, uint32_t count, zx_time_t deadline) {
     LTRACEF("count %u\n", count);
 
     if (!count) {
-        mx_status_t result = thread_sleep_etc(deadline, /*interruptable=*/true);
-        if (result != MX_OK)
+        zx_status_t result = thread_sleep_etc(deadline, /*interruptable=*/true);
+        if (result != ZX_OK)
             return result;
-        return MX_ERR_TIMED_OUT;
+        return ZX_ERR_TIMED_OUT;
     }
 
     if (!_items)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (count > kMaxWaitHandleCount)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::AllocChecker ac;
-    fbl::InlineArray<mx_wait_item_t, kWaitManyInlineCount> items(&ac, count);
+    fbl::InlineArray<zx_wait_item_t, kWaitManyInlineCount> items(&ac, count);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
-    if (_items.copy_array_from_user(items.get(), count) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_NO_MEMORY;
+    if (_items.copy_array_from_user(items.get(), count) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::InlineArray<WaitStateObserver, kWaitManyInlineCount> wait_state_observers(&ac, count);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     Event event;
 
     // We may need to unwind (which can be done outside the lock).
-    mx_status_t result = MX_OK;
+    zx_status_t result = ZX_OK;
     size_t num_added = 0;
     {
         auto up = ProcessDispatcher::GetCurrent();
@@ -128,64 +128,64 @@
         for (; num_added != count; ++num_added) {
             Handle* handle = up->GetHandleLocked(items[num_added].handle);
             if (!handle) {
-                result = MX_ERR_BAD_HANDLE;
+                result = ZX_ERR_BAD_HANDLE;
                 break;
             }
-            if (!handle->HasRights(MX_RIGHT_READ)) {
-                result = MX_ERR_ACCESS_DENIED;
+            if (!handle->HasRights(ZX_RIGHT_READ)) {
+                result = ZX_ERR_ACCESS_DENIED;
                 break;
             }
 
             result = wait_state_observers[num_added].Begin(&event, handle, items[num_added].waitfor);
-            if (result != MX_OK)
+            if (result != ZX_OK)
                 break;
         }
     }
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         for (size_t ix = 0; ix < num_added; ++ix)
             wait_state_observers[ix].End();
         return result;
     }
 
-    // event_wait() will return MX_OK if already signaled,
-    // even if deadline has passed.  It will return MX_ERR_TIMED_OUT
+    // event_wait() will return ZX_OK if already signaled,
+    // even if deadline has passed.  It will return ZX_ERR_TIMED_OUT
     // after the deadline passes if the event has not been
     // signaled.
     result = event.Wait(deadline);
 
     // Regardless of wait outcome, we must call End().
-    mx_signals_t combined = 0;
+    zx_signals_t combined = 0;
     for (size_t ix = 0; ix != count; ++ix) {
         combined |= (items[ix].pending = wait_state_observers[ix].End());
     }
 
-    if (_items.copy_array_to_user(items.get(), count) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_items.copy_array_to_user(items.get(), count) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    if (combined & MX_SIGNAL_HANDLE_CLOSED)
-        return MX_ERR_CANCELED;
+    if (combined & ZX_SIGNAL_HANDLE_CLOSED)
+        return ZX_ERR_CANCELED;
 
     return result;
 }
 
-mx_status_t sys_object_wait_async(mx_handle_t handle_value, mx_handle_t port_handle,
-                                  uint64_t key, mx_signals_t signals, uint32_t options) {
+zx_status_t sys_object_wait_async(zx_handle_t handle_value, zx_handle_t port_handle,
+                                  uint64_t key, zx_signals_t signals, uint32_t options) {
     LTRACEF("handle %x\n", handle_value);
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PortDispatcher> port;
-    auto status = up->GetDispatcherWithRights(port_handle, MX_RIGHT_WRITE, &port);
-    if (status != MX_OK)
+    auto status = up->GetDispatcherWithRights(port_handle, ZX_RIGHT_WRITE, &port);
+    if (status != ZX_OK)
         return status;
 
     {
         AutoLock lock(up->handle_table_lock());
         Handle* handle = up->GetHandleLocked(handle_value);
         if (!handle)
-            return MX_ERR_BAD_HANDLE;
-        if (!handle->HasRights(MX_RIGHT_READ))
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_BAD_HANDLE;
+        if (!handle->HasRights(ZX_RIGHT_READ))
+            return ZX_ERR_ACCESS_DENIED;
 
         return port->MakeObserver(options, handle, key, signals);
     }
diff --git a/kernel/lib/syscalls/syscalls_port.cpp b/kernel/lib/syscalls/syscalls_port.cpp
index d8f8bfc..be42a1d 100644
--- a/kernel/lib/syscalls/syscalls_port.cpp
+++ b/kernel/lib/syscalls/syscalls_port.cpp
@@ -14,7 +14,7 @@
 #include <object/port_dispatcher.h>
 #include <object/process_dispatcher.h>
 
-#include <magenta/syscalls/policy.h>
+#include <zircon/syscalls/policy.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 #include <fbl/ref_ptr.h>
@@ -23,117 +23,117 @@
 
 #define LOCAL_TRACE 0
 
-mx_status_t sys_port_create(uint32_t options, user_ptr<mx_handle_t> _out) {
+zx_status_t sys_port_create(uint32_t options, user_ptr<zx_handle_t> _out) {
     LTRACEF("options %u\n", options);
 
     // No options are supported.
     if (options != 0u)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
-    mx_status_t res = up->QueryPolicy(MX_POL_NEW_PORT);
-    if (res != MX_OK)
+    zx_status_t res = up->QueryPolicy(ZX_POL_NEW_PORT);
+    if (res != ZX_OK)
         return res;
 
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
+    zx_rights_t rights;
 
-    mx_status_t result = PortDispatcher::Create(options, &dispatcher, &rights);
+    zx_status_t result = PortDispatcher::Create(options, &dispatcher, &rights);
 
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     uint32_t koid = (uint32_t)dispatcher->get_koid();
 
     HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    mx_handle_t hv = up->MapHandleToValue(handle);
+    zx_handle_t hv = up->MapHandleToValue(handle);
 
-    if (_out.copy_to_user(hv) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out.copy_to_user(hv) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
     up->AddHandle(fbl::move(handle));
 
     ktrace(TAG_PORT_CREATE, koid, 0, 0, 0);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_port_queue(mx_handle_t handle, user_ptr<const void> _packet, size_t size) {
+zx_status_t sys_port_queue(zx_handle_t handle, user_ptr<const void> _packet, size_t size) {
     LTRACEF("handle %x\n", handle);
 
     if (size != 0u)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PortDispatcher> port;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &port);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &port);
+    if (status != ZX_OK)
         return status;
 
-    mx_port_packet_t packet;
-    if (_packet.copy_array_from_user(&packet, sizeof(packet)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    zx_port_packet_t packet;
+    if (_packet.copy_array_from_user(&packet, sizeof(packet)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     return port->QueueUser(packet);
 }
 
-mx_status_t sys_port_wait(mx_handle_t handle, mx_time_t deadline,
+zx_status_t sys_port_wait(zx_handle_t handle, zx_time_t deadline,
                           user_ptr<void> _packet, size_t size) {
     LTRACEF("handle %x\n", handle);
 
     if (size != 0u)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PortDispatcher> port;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &port);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &port);
+    if (status != ZX_OK)
         return status;
 
     ktrace(TAG_PORT_WAIT, (uint32_t)port->get_koid(), 0, 0, 0);
 
-    mx_port_packet_t pp;
-    mx_status_t st = port->Dequeue(deadline, &pp);
+    zx_port_packet_t pp;
+    zx_status_t st = port->Dequeue(deadline, &pp);
 
     ktrace(TAG_PORT_WAIT_DONE, (uint32_t)port->get_koid(), st, 0, 0);
 
-    if (st != MX_OK)
+    if (st != ZX_OK)
         return st;
 
     // remove internal flag bits
     pp.type &= PKT_FLAG_MASK;
 
-    if (_packet.copy_array_to_user(&pp, sizeof(pp)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_packet.copy_array_to_user(&pp, sizeof(pp)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_port_cancel(mx_handle_t handle, mx_handle_t source, uint64_t key) {
+zx_status_t sys_port_cancel(zx_handle_t handle, zx_handle_t source, uint64_t key) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<PortDispatcher> port;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &port);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &port);
+    if (status != ZX_OK)
         return status;
 
     {
         fbl::AutoLock lock(up->handle_table_lock());
         Handle* watched = up->GetHandleLocked(source);
         if (!watched)
-            return MX_ERR_BAD_HANDLE;
-        if (!watched->HasRights(MX_RIGHT_READ))
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_BAD_HANDLE;
+        if (!watched->HasRights(ZX_RIGHT_READ))
+            return ZX_ERR_ACCESS_DENIED;
 
         auto state_tracker = watched->dispatcher()->get_state_tracker();
         if (!state_tracker)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
 
         bool had_observer = state_tracker->CancelByKey(watched, port.get(), key);
         bool packet_removed = port->CancelQueued(watched, key);
-        return (had_observer || packet_removed) ? MX_OK : MX_ERR_NOT_FOUND;
+        return (had_observer || packet_removed) ? ZX_OK : ZX_ERR_NOT_FOUND;
     }
 }
diff --git a/kernel/lib/syscalls/syscalls_priv.h b/kernel/lib/syscalls/syscalls_priv.h
index 7ce151f..33c158d 100644
--- a/kernel/lib/syscalls/syscalls_priv.h
+++ b/kernel/lib/syscalls/syscalls_priv.h
@@ -6,9 +6,9 @@
 
 #pragma once
 
-#include <magenta/types.h>
-#include <magenta/syscalls/types.h>
+#include <zircon/types.h>
+#include <zircon/syscalls/types.h>
 #include <lib/user_copy/user_ptr.h>
 
-#define MX_SYSCALL_PARAM_ATTR(x)
-#include <magenta/syscall-definitions.h>
+#define ZX_SYSCALL_PARAM_ATTR(x)
+#include <zircon/syscall-definitions.h>
diff --git a/kernel/lib/syscalls/syscalls_resource.cpp b/kernel/lib/syscalls/syscalls_resource.cpp
index fd2002c..111b837 100644
--- a/kernel/lib/syscalls/syscalls_resource.cpp
+++ b/kernel/lib/syscalls/syscalls_resource.cpp
@@ -18,62 +18,62 @@
 
 // Create a new resource, child of the provided resource.
 // records must be an array of valid resource info records
-// records[0] must be a mx_rrec_type_self describing the resource.
+// records[0] must be a zx_rrec_type_self describing the resource.
 // On success, a new resource is created and handle is returned
 //
 // The range low:high is inclusive on both ends, high must be
 // greater than or equal low.
 //
-// If the parent resource is of type MX_RSRC_KIND_ROOT, then there
+// If the parent resource is of type ZX_RSRC_KIND_ROOT, then there
 // are no further limitations on the child resource created.
 //
 // Otherwise the kind of the child resource must be the same as
 // the parent and the range of the child resource must be within
 // the range of the parent.
-mx_status_t sys_resource_create(mx_handle_t handle, uint32_t kind,
+zx_status_t sys_resource_create(zx_handle_t handle, uint32_t kind,
                                 uint64_t low, uint64_t high,
-                                user_ptr<mx_handle_t> _rsrc_out) {
+                                user_ptr<zx_handle_t> _rsrc_out) {
     auto up = ProcessDispatcher::GetCurrent();
 
     if (high < low)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Obtain the parent Resource
     // WRITE access is required to create a child resource
-    mx_status_t result;
+    zx_status_t result;
     fbl::RefPtr<ResourceDispatcher> parent;
-    result = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &parent);
+    result = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &parent);
     if (result)
         return result;
 
     uint32_t parent_kind = parent->get_kind();
-    if (parent_kind != MX_RSRC_KIND_ROOT) {
+    if (parent_kind != ZX_RSRC_KIND_ROOT) {
         if (kind != parent_kind)
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
 
         uint64_t parent_low, parent_high;
         parent->get_range(&parent_low, &parent_high);
 
         if ((low < parent_low) || (high > parent_high))
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
     }
 
     // Create a new Resource
-    mx_rights_t rights;
+    zx_rights_t rights;
     fbl::RefPtr<ResourceDispatcher> child;
     result = ResourceDispatcher::Create(&child, &rights, kind, low, high);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     // Create a handle for the child
     HandleOwner child_h(MakeHandle(fbl::RefPtr<Dispatcher>(child.get()), rights));
     if (!child_h)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    if (_rsrc_out.copy_to_user(up->MapHandleToValue(child_h)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_rsrc_out.copy_to_user(up->MapHandleToValue(child_h)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(child_h));
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/lib/syscalls/syscalls_socket.cpp b/kernel/lib/syscalls/syscalls_socket.cpp
index 28bbeb3..7b79a1f 100644
--- a/kernel/lib/syscalls/syscalls_socket.cpp
+++ b/kernel/lib/syscalls/syscalls_socket.cpp
@@ -19,60 +19,60 @@
 #include <object/process_dispatcher.h>
 #include <object/socket_dispatcher.h>
 
-#include <magenta/syscalls/policy.h>
+#include <zircon/syscalls/policy.h>
 #include <fbl/ref_ptr.h>
 
 #include "syscalls_priv.h"
 
 #define LOCAL_TRACE 0
 
-mx_status_t sys_socket_create(uint32_t options, user_ptr<mx_handle_t> _out0, user_ptr<mx_handle_t> _out1) {
+zx_status_t sys_socket_create(uint32_t options, user_ptr<zx_handle_t> _out0, user_ptr<zx_handle_t> _out1) {
     LTRACEF("entry out_handles %p, %p\n", _out0.get(), _out1.get());
 
     auto up = ProcessDispatcher::GetCurrent();
-    mx_status_t res = up->QueryPolicy(MX_POL_NEW_SOCKET);
-    if (res != MX_OK)
+    zx_status_t res = up->QueryPolicy(ZX_POL_NEW_SOCKET);
+    if (res != ZX_OK)
         return res;
 
     fbl::RefPtr<Dispatcher> socket0, socket1;
-    mx_rights_t rights;
-    mx_status_t result = SocketDispatcher::Create(options, &socket0, &socket1, &rights);
-    if (result != MX_OK)
+    zx_rights_t rights;
+    zx_status_t result = SocketDispatcher::Create(options, &socket0, &socket1, &rights);
+    if (result != ZX_OK)
         return result;
 
     HandleOwner h0(MakeHandle(fbl::move(socket0), rights));
     if (!h0)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     HandleOwner h1(MakeHandle(fbl::move(socket1), rights));
     if (!h1)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    if (_out0.copy_to_user(up->MapHandleToValue(h0)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out0.copy_to_user(up->MapHandleToValue(h0)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    if (_out1.copy_to_user(up->MapHandleToValue(h1)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out1.copy_to_user(up->MapHandleToValue(h1)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(h0));
     up->AddHandle(fbl::move(h1));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_socket_write(mx_handle_t handle, uint32_t options,
+zx_status_t sys_socket_write(zx_handle_t handle, uint32_t options,
                              user_ptr<const void> _buffer, size_t size,
                              user_ptr<size_t> _actual) {
     LTRACEF("handle %x\n", handle);
 
     if ((size > 0u) && !_buffer)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<SocketDispatcher> socket;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &socket);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &socket);
+    if (status != ZX_OK)
         return status;
 
     size_t nwritten;
@@ -80,29 +80,29 @@
     case 0:
         status = socket->Write(_buffer, size, &nwritten);
         break;
-    case MX_SOCKET_CONTROL:
+    case ZX_SOCKET_CONTROL:
         status = socket->WriteControl(_buffer, size);
-        if (status == MX_OK)
+        if (status == ZX_OK)
             nwritten = size;
         break;
-    case MX_SOCKET_SHUTDOWN_WRITE:
-    case MX_SOCKET_SHUTDOWN_READ:
-    case MX_SOCKET_SHUTDOWN_READ | MX_SOCKET_SHUTDOWN_WRITE:
+    case ZX_SOCKET_SHUTDOWN_WRITE:
+    case ZX_SOCKET_SHUTDOWN_READ:
+    case ZX_SOCKET_SHUTDOWN_READ | ZX_SOCKET_SHUTDOWN_WRITE:
         if (size == 0)
-            return socket->Shutdown(options & MX_SOCKET_SHUTDOWN_MASK);
+            return socket->Shutdown(options & ZX_SOCKET_SHUTDOWN_MASK);
         // fallthrough
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Caller may ignore results if desired.
-    if (status == MX_OK && _actual)
+    if (status == ZX_OK && _actual)
         status = _actual.copy_to_user(nwritten);
 
     return status;
 }
 
-mx_status_t sys_socket_read(mx_handle_t handle, uint32_t options,
+zx_status_t sys_socket_read(zx_handle_t handle, uint32_t options,
                             user_ptr<void> _buffer, size_t size,
                             user_ptr<size_t> _actual) {
     LTRACEF("handle %x\n", handle);
@@ -110,13 +110,13 @@
     if (options)
 
     if (!_buffer && size > 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<SocketDispatcher> socket;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &socket);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &socket);
+    if (status != ZX_OK)
         return status;
 
     size_t nread;
@@ -125,15 +125,15 @@
     case 0:
         status = socket->Read(_buffer, size, &nread);
         break;
-    case MX_SOCKET_CONTROL:
+    case ZX_SOCKET_CONTROL:
         status = socket->ReadControl(_buffer, size, &nread);
         break;
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Caller may ignore results if desired.
-    if (status == MX_OK && _actual)
+    if (status == ZX_OK && _actual)
         status = _actual.copy_to_user(nread);
 
     return status;
diff --git a/kernel/lib/syscalls/syscalls_system.cpp b/kernel/lib/syscalls/syscalls_system.cpp
index f0c0bdf..5df4a23 100644
--- a/kernel/lib/syscalls/syscalls_system.cpp
+++ b/kernel/lib/syscalls/syscalls_system.cpp
@@ -14,9 +14,9 @@
 #include <kernel/vm.h>
 #include <vm/pmm.h>
 #include <vm/vm_aspace.h>
-#include <magenta/boot/bootdata.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <mexec.h>
 #include <object/process_dispatcher.h>
 #include <object/vm_object_dispatcher.h>
@@ -37,14 +37,14 @@
 
 /* Allocates a page of memory that has the same physical and virtual addressresses.
  */
-static mx_status_t identity_page_allocate(void** result_addr) {
-    mx_status_t result;
+static zx_status_t identity_page_allocate(void** result_addr) {
+    zx_status_t result;
 
     // Start by obtaining an unused physical page. This address will eventually
     // be the physical/virtual address of our identity mapped page.
     paddr_t pa;
     if (pmm_alloc_page(0, &pa) == nullptr) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // The kernel address space may be in high memory which cannot be identity
@@ -54,7 +54,7 @@
     fbl::RefPtr<VmAspace> identity_aspace =
             VmAspace::Create(VmAspace::TYPE_LOW_KERNEL, "mexec identity");
     if (!identity_aspace)
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
 
     // Create a new allocation in the new address space that identity maps the
     // target page.
@@ -66,14 +66,14 @@
                                             &identity_address, 0, pa,
                                             VmAspace::VMM_FLAG_VALLOC_SPECIFIC,
                                             perm_flags_rwx);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     vmm_set_active_aspace(reinterpret_cast<vmm_aspace_t*>(identity_aspace.get()));
 
     *result_addr = identity_address;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* Takes all the pages in a VMO and creates a copy of them where all the pages
@@ -81,19 +81,19 @@
  * TODO(gkalsi): Don't coalesce pages into a physically contiguous region and
  *               just pass a vectored I/O list to the mexec assembly.
  */
-static mx_status_t vmo_coalesce_pages(mx_handle_t vmo_hdl, const size_t extra_bytes,
+static zx_status_t vmo_coalesce_pages(zx_handle_t vmo_hdl, const size_t extra_bytes,
                                       paddr_t* addr, uint8_t** vaddr, size_t* size) {
     DEBUG_ASSERT(addr);
-    if (!addr) return MX_ERR_INVALID_ARGS;
+    if (!addr) return ZX_ERR_INVALID_ARGS;
 
     DEBUG_ASSERT(size);
-    if (!size) return MX_ERR_INVALID_ARGS;
+    if (!size) return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<VmObjectDispatcher> vmo_dispatcher;
-    mx_status_t st =
-        up->GetDispatcherWithRights(vmo_hdl, MX_RIGHT_READ, &vmo_dispatcher);
-    if (st != MX_OK)
+    zx_status_t st =
+        up->GetDispatcherWithRights(vmo_hdl, ZX_RIGHT_READ, &vmo_dispatcher);
+    if (st != ZX_OK)
         return st;
 
     fbl::RefPtr<VmObject> vmo = vmo_dispatcher->vmo();
@@ -120,7 +120,7 @@
 
         st = vmo->Read(dst_addr + offset, offset, bytes_remaining, &bytes_read);
 
-        if (st != MX_OK || bytes_read == 0) {
+        if (st != ZX_OK || bytes_read == 0) {
             // TODO(gkalsi): Free pages allocated by pmm_alloc_contiguous pages
             //               and return an error.
             panic("Failed to read to contiguous vmo");
@@ -137,7 +137,7 @@
     if (vaddr)
         *vaddr = dst_addr;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static inline bool intervals_intersect(const void* start1, const size_t len1,
@@ -159,7 +159,7 @@
 
 
 /* Takes a buffer to a bootimage and appends a section to the end of it */
-mx_status_t bootdata_append_section(uint8_t* bootdata_buf, const size_t buflen,
+zx_status_t bootdata_append_section(uint8_t* bootdata_buf, const size_t buflen,
                                     const uint8_t* section, const uint32_t section_length,
                                     const uint32_t type, const uint32_t extra,
                                     const uint32_t flags) {
@@ -169,7 +169,7 @@
         (hdr->extra != BOOTDATA_MAGIC) ||
         (hdr->flags != 0)) {
         // This buffer does not point to a bootimage.
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
 
     size_t total_len = hdr->length + sizeof(*hdr);
@@ -178,7 +178,7 @@
     // Make sure there's enough buffer space after the bootdata container to
     // append the new section.
     if ((total_len + new_section_length) > buflen) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
 
     // Seek to the end of the bootimage.
@@ -196,10 +196,10 @@
 
     hdr->length += (uint32_t)new_section_length;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t bootdata_append_cmdline(user_ptr<const char> _cmdlinebuf,
+static zx_status_t bootdata_append_cmdline(user_ptr<const char> _cmdlinebuf,
                                            const size_t cmdlinebuf_size,
                                            uint8_t* bootimage_buffer,
                                            const size_t bootimage_buflen) {
@@ -210,12 +210,12 @@
     // If the user passes us a command line that's longer than our limit, we
     // fail immediately.
     if (cmdlinebuf_size > CMDLINE_MAX) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // No command line provided, nothing to be done.
     if (cmdlinebuf_size == 0) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Allocate a buffer large enough to accomodate the whole command line.
@@ -224,7 +224,7 @@
     auto deleter = fbl::unique_ptr<char[]>(new (&ac) char[CMDLINE_MAX]{});
     char* buffer = deleter.get();
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // Copy contents from the user buffer to the local kernel buffer.
@@ -236,7 +236,7 @@
     // terminator.
     const size_t cmdline_len = strnlen(buffer, cmdlinebuf_size) + 1;
     if (cmdline_len > CMDLINE_MAX) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     return bootdata_append_section(bootimage_buffer, bootimage_buflen,
@@ -245,15 +245,15 @@
                                    BOOTDATA_CMDLINE, 0, 0);
 }
 
-mx_status_t sys_system_mexec(mx_handle_t kernel_vmo, mx_handle_t bootimage_vmo,
+zx_status_t sys_system_mexec(zx_handle_t kernel_vmo, zx_handle_t bootimage_vmo,
                              user_ptr<const char> _cmdline, uint32_t cmdline_len) {
-    mx_status_t result;
+    zx_status_t result;
 
     paddr_t new_kernel_addr;
     size_t new_kernel_len;
     result = vmo_coalesce_pages(kernel_vmo, 0, &new_kernel_addr, nullptr,
                                 &new_kernel_len);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         return result;
     }
 
@@ -263,12 +263,12 @@
     result = vmo_coalesce_pages(bootimage_vmo, kBootdataPlatformExtraBytes + cmdline_len,
                                 &new_bootimage_addr, &bootimage_buffer,
                                 &new_bootimage_len);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         return result;
     }
 
     result = bootdata_append_cmdline(_cmdline, cmdline_len, bootimage_buffer, new_bootimage_len);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         return result;
     }
 
@@ -282,17 +282,17 @@
     // Allow the platform to patch the bootdata with any platform specific
     // sections before mexecing.
     result = platform_mexec_patch_bootdata(bootimage_buffer, new_bootimage_len);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         panic("Error while patching platform bootdata.");
     }
 
     void* id_page_addr = 0x0;
     result = identity_page_allocate(&id_page_addr);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         panic("Unable to allocate identity page");
     }
 
-    LTRACEF("mx_system_mexec allocated identity mapped page at %p\n",
+    LTRACEF("zx_system_mexec allocated identity mapped page at %p\n",
             id_page_addr);
 
     // We assume that when the system starts, only one CPU is running. We denote
@@ -352,5 +352,5 @@
     platform_mexec(mexec_assembly, ops, new_bootimage_addr, new_bootimage_len);
 
     panic("Execution should never reach here\n");
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/lib/syscalls/syscalls_task.cpp b/kernel/lib/syscalls/syscalls_task.cpp
index bf98ab4..32f5582 100644
--- a/kernel/lib/syscalls/syscalls_task.cpp
+++ b/kernel/lib/syscalls/syscalls_task.cpp
@@ -25,8 +25,8 @@
 #include <object/thread_dispatcher.h>
 #include <object/vm_address_region_dispatcher.h>
 
-#include <magenta/syscalls/debug.h>
-#include <magenta/syscalls/policy.h>
+#include <zircon/syscalls/debug.h>
+#include <zircon/syscalls/policy.h>
 #include <fbl/auto_lock.h>
 #include <fbl/inline_array.h>
 #include <fbl/ref_ptr.h>
@@ -48,7 +48,7 @@
 // conservative estimate for an architecture with 32 general purpose
 // integer registers.
 constexpr uint32_t kInlineThreadStateSize = sizeof(void*) * 64;
-constexpr uint32_t kMaxThreadStateSize = MX_MAX_THREAD_STATE_SIZE;
+constexpr uint32_t kMaxThreadStateSize = ZX_MAX_THREAD_STATE_SIZE;
 
 constexpr size_t kMaxDebugReadBlock = 64 * 1024u * 1024u;
 constexpr size_t kMaxDebugWriteBlock = 64 * 1024u * 1024u;
@@ -72,16 +72,16 @@
 // TODO(MG-1025): copy_user_string may truncate the incoming string,
 // and may copy extra data past the NUL.
 // TODO(dbort): If anyone else needs this, move it into user_ptr.
-static mx_status_t copy_user_string(const user_ptr<const char>& src,
+static zx_status_t copy_user_string(const user_ptr<const char>& src,
                                     size_t src_len,
                                     char* buf, size_t buf_len,
                                     fbl::StringPiece* sp) {
     if (!src || src_len > buf_len) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    mx_status_t result = src.copy_array_from_user(buf, src_len);
-    if (result != MX_OK) {
-        return MX_ERR_INVALID_ARGS;
+    zx_status_t result = src.copy_array_from_user(buf, src_len);
+    if (result != ZX_OK) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // ensure zero termination
@@ -89,34 +89,34 @@
     buf[str_len] = 0;
     *sp = fbl::StringPiece(buf);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Convenience function to go from process handle to process.
-static mx_status_t get_process(ProcessDispatcher* up,
-                               mx_handle_t proc_handle,
+static zx_status_t get_process(ProcessDispatcher* up,
+                               zx_handle_t proc_handle,
                                fbl::RefPtr<ProcessDispatcher>* proc) {
-    return up->GetDispatcherWithRights(proc_handle, MX_RIGHT_WRITE, proc);
+    return up->GetDispatcherWithRights(proc_handle, ZX_RIGHT_WRITE, proc);
 }
 
-mx_status_t sys_thread_create(mx_handle_t process_handle,
+zx_status_t sys_thread_create(zx_handle_t process_handle,
                               user_ptr<const char> _name, uint32_t name_len,
-                              uint32_t options, user_ptr<mx_handle_t> _out) {
+                              uint32_t options, user_ptr<zx_handle_t> _out) {
     LTRACEF("process handle %x, options %#x\n", process_handle, options);
 
     // currently, the only valid option value is 0
     if (options != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // copy out the name
-    char buf[MX_MAX_NAME_LEN];
+    char buf[ZX_MAX_NAME_LEN];
     fbl::StringPiece sp;
     // Silently truncate the given name.
     if (name_len > sizeof(buf))
         name_len = sizeof(buf);
-    mx_status_t result = copy_user_string(_name, name_len,
+    zx_status_t result = copy_user_string(_name, name_len,
                                           buf, sizeof(buf), &sp);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
     LTRACEF("name %s\n", buf);
 
@@ -125,17 +125,17 @@
 
     fbl::RefPtr<ProcessDispatcher> process;
     result = get_process(up, process_handle, &process);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     uint32_t pid = (uint32_t)process->get_koid();
 
     // create the thread dispatcher
     fbl::RefPtr<Dispatcher> thread_dispatcher;
-    mx_rights_t thread_rights;
+    zx_rights_t thread_rights;
     result = ThreadDispatcher::Create(fbl::move(process), options, sp,
                                       &thread_dispatcher, &thread_rights);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     uint32_t tid = (uint32_t)thread_dispatcher->get_koid();
@@ -144,16 +144,16 @@
 
     HandleOwner handle(MakeHandle(fbl::move(thread_dispatcher), thread_rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    if (_out.copy_to_user(up->MapHandleToValue(handle)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out.copy_to_user(up->MapHandleToValue(handle)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
     up->AddHandle(fbl::move(handle));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_thread_start(mx_handle_t thread_handle, uintptr_t entry,
+zx_status_t sys_thread_start(zx_handle_t thread_handle, uintptr_t entry,
                              uintptr_t stack, uintptr_t arg1, uintptr_t arg2) {
     LTRACEF("handle %x, entry %#" PRIxPTR ", sp %#" PRIxPTR
             ", arg1 %#" PRIxPTR ", arg2 %#" PRIxPTR "\n",
@@ -162,9 +162,9 @@
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<ThreadDispatcher> thread;
-    mx_status_t status = up->GetDispatcherWithRights(thread_handle, MX_RIGHT_WRITE,
+    zx_status_t status = up->GetDispatcherWithRights(thread_handle, ZX_RIGHT_WRITE,
                                                      &thread);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     ktrace(TAG_THREAD_START, (uint32_t)thread->get_koid(), 0, 0, 0);
@@ -176,7 +176,7 @@
     ThreadDispatcher::GetCurrent()->Exit();
 }
 
-mx_status_t sys_thread_read_state(mx_handle_t handle, uint32_t state_kind,
+zx_status_t sys_thread_read_state(zx_handle_t handle, uint32_t state_kind,
                                   user_ptr<void> _buffer,
                                   uint32_t buffer_len, user_ptr<uint32_t> _actual) {
     LTRACEF("handle %x, state_kind %u\n", handle, state_kind);
@@ -185,38 +185,38 @@
 
     // TODO(MG-968): debug rights
     fbl::RefPtr<ThreadDispatcher> thread;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &thread);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &thread);
+    if (status != ZX_OK)
         return status;
 
     // avoid malloc'ing insane amounts
     if (buffer_len > kMaxThreadStateSize)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::AllocChecker ac;
     fbl::InlineArray<uint8_t, kInlineThreadStateSize> bytes(&ac, buffer_len);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     status = thread->ReadState(state_kind, bytes.get(), &buffer_len);
 
     // Always set the actual size so the caller can provide larger buffers.
-    // The value is only usable if the status is MX_OK or MX_ERR_BUFFER_TOO_SMALL.
-    if (status == MX_OK || status == MX_ERR_BUFFER_TOO_SMALL) {
-        if (_actual.copy_to_user(buffer_len) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+    // The value is only usable if the status is ZX_OK or ZX_ERR_BUFFER_TOO_SMALL.
+    if (status == ZX_OK || status == ZX_ERR_BUFFER_TOO_SMALL) {
+        if (_actual.copy_to_user(buffer_len) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
     }
 
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
-    if (_buffer.copy_array_to_user(bytes.get(), buffer_len) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_buffer.copy_array_to_user(bytes.get(), buffer_len) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_thread_write_state(mx_handle_t handle, uint32_t state_kind,
+zx_status_t sys_thread_write_state(zx_handle_t handle, uint32_t state_kind,
                                    user_ptr<const void> _buffer, uint32_t buffer_len) {
     LTRACEF("handle %x, state_kind %u\n", handle, state_kind);
 
@@ -224,80 +224,80 @@
 
     // TODO(MG-968): debug rights
     fbl::RefPtr<ThreadDispatcher> thread;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &thread);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &thread);
+    if (status != ZX_OK)
         return status;
 
     // avoid malloc'ing insane amounts
     if (buffer_len > kMaxThreadStateSize)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::AllocChecker ac;
     fbl::InlineArray<uint8_t, kInlineThreadStateSize> bytes(&ac, buffer_len);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     status = _buffer.copy_array_from_user(bytes.get(), buffer_len);
-    if (status != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (status != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     status = thread->WriteState(state_kind, bytes.get(), buffer_len);
     return status;
 }
 
 // See MG-940
-mx_status_t sys_thread_set_priority(int32_t prio) {
+zx_status_t sys_thread_set_priority(int32_t prio) {
 #if THREAD_SET_PRIORITY_EXPERIMENT
-    // If the experimental mx_thread_set_priority has not been enabled using the
+    // If the experimental zx_thread_set_priority has not been enabled using the
     // kernel command line option, simply deny this request.
     if (!thread_set_priority_allowed)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     if ((prio < LOWEST_PRIORITY) || (prio > HIGHEST_PRIORITY))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     thread_set_priority(prio);
 
-    return MX_OK;
+    return ZX_OK;
 #else
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif
 }
 
-mx_status_t sys_task_suspend(mx_handle_t task_handle) {
+zx_status_t sys_task_suspend(zx_handle_t task_handle) {
     LTRACE_ENTRY;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     // TODO(teisenbe): Add support for tasks other than threads
     fbl::RefPtr<ThreadDispatcher> thread;
-    mx_status_t status = up->GetDispatcherWithRights(task_handle, MX_RIGHT_WRITE,
+    zx_status_t status = up->GetDispatcherWithRights(task_handle, ZX_RIGHT_WRITE,
                                                      &thread);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     return thread->Suspend();
 }
 
-mx_status_t sys_process_create(mx_handle_t job_handle,
+zx_status_t sys_process_create(zx_handle_t job_handle,
                                user_ptr<const char> _name, uint32_t name_len,
-                               uint32_t options, user_ptr<mx_handle_t> _proc_handle,
-                               user_ptr<mx_handle_t> _vmar_handle) {
+                               uint32_t options, user_ptr<zx_handle_t> _proc_handle,
+                               user_ptr<zx_handle_t> _vmar_handle) {
     LTRACEF("job handle %x, options %#x\n", job_handle, options);
 
     // currently, the only valid option value is 0
     if (options != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // copy out the name
-    char buf[MX_MAX_NAME_LEN];
+    char buf[ZX_MAX_NAME_LEN];
     fbl::StringPiece sp;
     // Silently truncate the given name.
     if (name_len > sizeof(buf))
         name_len = sizeof(buf);
-    mx_status_t result = copy_user_string(_name, name_len,
+    zx_status_t result = copy_user_string(_name, name_len,
                                           buf, sizeof(buf), &sp);
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
     LTRACEF("name %s\n", buf);
 
@@ -306,18 +306,18 @@
 
     fbl::RefPtr<JobDispatcher> job;
     // TODO(MG-968): define process creation job rights.
-    auto status = up->GetDispatcherWithRights(job_handle, MX_RIGHT_WRITE, &job);
-    if (status != MX_OK)
+    auto status = up->GetDispatcherWithRights(job_handle, ZX_RIGHT_WRITE, &job);
+    if (status != ZX_OK)
         return status;
 
     // create a new process dispatcher
     fbl::RefPtr<Dispatcher> proc_dispatcher;
     fbl::RefPtr<VmAddressRegionDispatcher> vmar_dispatcher;
-    mx_rights_t proc_rights, vmar_rights;
-    mx_status_t res = ProcessDispatcher::Create(fbl::move(job), sp, options,
+    zx_rights_t proc_rights, vmar_rights;
+    zx_status_t res = ProcessDispatcher::Create(fbl::move(job), sp, options,
                                                 &proc_dispatcher, &proc_rights,
                                                 &vmar_dispatcher, &vmar_rights);
-    if (res != MX_OK)
+    if (res != ZX_OK)
         return res;
 
     uint32_t koid = (uint32_t)proc_dispatcher->get_koid();
@@ -330,23 +330,23 @@
     // Create a handle and attach the dispatcher to it
     HandleOwner proc_h(MakeHandle(fbl::move(proc_dispatcher), proc_rights));
     if (!proc_h)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // Create a handle and attach the dispatcher to it
     HandleOwner vmar_h(MakeHandle(fbl::move(vmar_dispatcher), vmar_rights));
     if (!vmar_h)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    if (_proc_handle.copy_to_user(up->MapHandleToValue(proc_h)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_proc_handle.copy_to_user(up->MapHandleToValue(proc_h)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    if (_vmar_handle.copy_to_user(up->MapHandleToValue(vmar_h)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_vmar_handle.copy_to_user(up->MapHandleToValue(vmar_h)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(vmar_h));
     up->AddHandle(fbl::move(proc_h));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Note: This is used to start the main thread (as opposed to using
@@ -359,9 +359,9 @@
 // - maintains the state machine invariant that 'started' processes have one
 //   thread running
 
-mx_status_t sys_process_start(mx_handle_t process_handle, mx_handle_t thread_handle,
+zx_status_t sys_process_start(zx_handle_t process_handle, zx_handle_t thread_handle,
                               uintptr_t pc, uintptr_t sp,
-                              mx_handle_t arg_handle_value, uintptr_t arg2) {
+                              zx_handle_t arg_handle_value, uintptr_t arg2) {
     LTRACEF("phandle %x, thandle %x, pc %#" PRIxPTR ", sp %#" PRIxPTR
             ", arg_handle %x, arg2 %#" PRIxPTR "\n",
             process_handle, thread_handle, pc, sp, arg_handle_value, arg2);
@@ -370,28 +370,28 @@
 
     // get process dispatcher
     fbl::RefPtr<ProcessDispatcher> process;
-    mx_status_t status = get_process(up, process_handle, &process);
-    if (status != MX_OK)
+    zx_status_t status = get_process(up, process_handle, &process);
+    if (status != ZX_OK)
         return status;
 
     // get thread_dispatcher
     fbl::RefPtr<ThreadDispatcher> thread;
-    status = up->GetDispatcherWithRights(thread_handle, MX_RIGHT_WRITE, &thread);
-    if (status != MX_OK)
+    status = up->GetDispatcherWithRights(thread_handle, ZX_RIGHT_WRITE, &thread);
+    if (status != ZX_OK)
         return status;
 
     // test that the thread belongs to the starting process
     if (thread->process() != process.get())
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
 
     HandleOwner arg_handle;
     {
         fbl::AutoLock lock(up->handle_table_lock());
         auto handle = up->GetHandleLocked(arg_handle_value);
         if (!handle)
-            return MX_ERR_BAD_HANDLE;
-        if (!handle->HasRights(MX_RIGHT_TRANSFER))
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_BAD_HANDLE;
+        if (!handle->HasRights(ZX_RIGHT_TRANSFER))
+            return ZX_ERR_ACCESS_DENIED;
         arg_handle = up->RemoveHandleLocked(arg_handle_value);
     }
 
@@ -399,7 +399,7 @@
     process->AddHandle(fbl::move(arg_handle));
 
     status = thread->Start(pc, sp, arg_nhv, arg2, /* initial_thread */ true);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         // Put back the |arg_handle| into the calling process.
         auto handle = process->RemoveHandle(arg_nhv);
         up->AddHandle(fbl::move(handle));
@@ -409,7 +409,7 @@
     ktrace(TAG_PROC_START, (uint32_t)thread->get_koid(),
            (uint32_t)process->get_koid(), 0, 0);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void sys_process_exit(int retcode) {
@@ -417,39 +417,39 @@
     ProcessDispatcher::GetCurrent()->Exit(retcode);
 }
 
-mx_status_t sys_process_read_memory(mx_handle_t proc, uintptr_t vaddr,
+zx_status_t sys_process_read_memory(zx_handle_t proc, uintptr_t vaddr,
                                     user_ptr<void> _buffer,
                                     size_t len, user_ptr<size_t> _actual) {
     LTRACEF("vaddr 0x%" PRIxPTR ", size %zu\n", vaddr, len);
 
     if (!_buffer)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (len == 0 || len > kMaxDebugReadBlock)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<ProcessDispatcher> process;
-    mx_status_t status = up->GetDispatcherWithRights(proc, MX_RIGHT_READ | MX_RIGHT_WRITE,
+    zx_status_t status = up->GetDispatcherWithRights(proc, ZX_RIGHT_READ | ZX_RIGHT_WRITE,
                                                      &process);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     auto aspace = process->aspace();
     if (!aspace)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     auto region = aspace->FindRegion(vaddr);
     if (!region)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto vm_mapping = region->as_vm_mapping();
     if (!vm_mapping)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto vmo = vm_mapping->vmo();
     if (!vmo)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     uint64_t offset = vaddr - vm_mapping->base() + vm_mapping->object_offset();
     size_t read = 0;
@@ -462,59 +462,59 @@
         auto int_data = _buffer.reinterpret<uint8_t>();
         for (size_t i = 0; i < len; i += PAGE_SIZE) {
             status = int_data.copy_array_to_user(&byte, 1, i);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
         }
         if (len > 0) {
             status = int_data.copy_array_to_user(&byte, 1, len - 1);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
         }
     }
 
-    mx_status_t st = vmo->ReadUser(_buffer, offset, len, &read);
+    zx_status_t st = vmo->ReadUser(_buffer, offset, len, &read);
 
-    if (st == MX_OK) {
-        if (_actual.copy_to_user(static_cast<size_t>(read)) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+    if (st == ZX_OK) {
+        if (_actual.copy_to_user(static_cast<size_t>(read)) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
     }
     return st;
 }
 
-mx_status_t sys_process_write_memory(mx_handle_t proc, uintptr_t vaddr,
+zx_status_t sys_process_write_memory(zx_handle_t proc, uintptr_t vaddr,
                                      user_ptr<const void> _buffer,
                                      size_t len, user_ptr<size_t> _actual) {
     LTRACEF("vaddr 0x%" PRIxPTR ", size %zu\n", vaddr, len);
 
     if (!_buffer)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (len == 0 || len > kMaxDebugWriteBlock)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<ProcessDispatcher> process;
-    mx_status_t status = up->GetDispatcherWithRights(proc, MX_RIGHT_WRITE, &process);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(proc, ZX_RIGHT_WRITE, &process);
+    if (status != ZX_OK)
         return status;
 
     auto aspace = process->aspace();
     if (!aspace)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     auto region = aspace->FindRegion(vaddr);
     if (!region)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto vm_mapping = region->as_vm_mapping();
     if (!vm_mapping)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto vmo = vm_mapping->vmo();
     if (!vmo)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // Force map the range, even if it crosses multiple mappings.
     // TODO(MG-730): This is a workaround for this bug.  If we start decommitting
@@ -524,13 +524,13 @@
         auto int_data = _buffer.reinterpret<const uint8_t>();
         for (size_t i = 0; i < len; i += PAGE_SIZE) {
             status = int_data.copy_array_from_user(&byte, 1, i);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
         }
         if (len > 0) {
             status = int_data.copy_array_from_user(&byte, 1, len - 1);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
         }
@@ -539,110 +539,110 @@
     uint64_t offset = vaddr - vm_mapping->base() + vm_mapping->object_offset();
     size_t written = 0;
 
-    mx_status_t st = vmo->WriteUser(_buffer, offset, len, &written);
+    zx_status_t st = vmo->WriteUser(_buffer, offset, len, &written);
 
-    if (st == MX_OK) {
-        if (_actual.copy_to_user(static_cast<size_t>(written)) != MX_OK)
-            return MX_ERR_INVALID_ARGS;
+    if (st == ZX_OK) {
+        if (_actual.copy_to_user(static_cast<size_t>(written)) != ZX_OK)
+            return ZX_ERR_INVALID_ARGS;
     }
     return st;
 }
 
 // helper routine for sys_task_kill
 template <typename T>
-static mx_status_t kill_task(fbl::RefPtr<Dispatcher> dispatcher) {
+static zx_status_t kill_task(fbl::RefPtr<Dispatcher> dispatcher) {
     auto task = DownCastDispatcher<T>(&dispatcher);
     if (!task)
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
 
     task->Kill();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_task_kill(mx_handle_t task_handle) {
+zx_status_t sys_task_kill(zx_handle_t task_handle) {
     LTRACEF("handle %x\n", task_handle);
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<Dispatcher> dispatcher;
-    auto status = up->GetDispatcherWithRights(task_handle, MX_RIGHT_DESTROY, &dispatcher);
-    if (status != MX_OK)
+    auto status = up->GetDispatcherWithRights(task_handle, ZX_RIGHT_DESTROY, &dispatcher);
+    if (status != ZX_OK)
         return status;
 
     // see if it's a process or thread and dispatch accordingly
     switch (dispatcher->get_type()) {
-        case MX_OBJ_TYPE_PROCESS:
+        case ZX_OBJ_TYPE_PROCESS:
             return kill_task<ProcessDispatcher>(fbl::move(dispatcher));
-        case MX_OBJ_TYPE_THREAD:
+        case ZX_OBJ_TYPE_THREAD:
             return kill_task<ThreadDispatcher>(fbl::move(dispatcher));
-        case MX_OBJ_TYPE_JOB:
+        case ZX_OBJ_TYPE_JOB:
             return kill_task<JobDispatcher>(fbl::move(dispatcher));
         default:
-            return MX_ERR_WRONG_TYPE;
+            return ZX_ERR_WRONG_TYPE;
     }
 }
 
-mx_status_t sys_job_create(mx_handle_t parent_job, uint32_t options, user_ptr<mx_handle_t> _out) {
+zx_status_t sys_job_create(zx_handle_t parent_job, uint32_t options, user_ptr<zx_handle_t> _out) {
     LTRACEF("parent: %x\n", parent_job);
 
     if (options != 0u)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<JobDispatcher> parent;
-    mx_status_t status = up->GetDispatcherWithRights(parent_job, MX_RIGHT_WRITE, &parent);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(parent_job, ZX_RIGHT_WRITE, &parent);
+    if (status != ZX_OK)
         return status;
 
     fbl::RefPtr<Dispatcher> job;
-    mx_rights_t rights;
+    zx_rights_t rights;
     status = JobDispatcher::Create(options, fbl::move(parent), &job, &rights);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     HandleOwner job_handle(MakeHandle(fbl::move(job), rights));
-    if (_out.copy_to_user(up->MapHandleToValue(job_handle)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out.copy_to_user(up->MapHandleToValue(job_handle)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(job_handle));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_job_set_policy(mx_handle_t job_handle, uint32_t options,
+zx_status_t sys_job_set_policy(zx_handle_t job_handle, uint32_t options,
     uint32_t topic, user_ptr<const void> _policy, uint32_t count) {
 
-    if ((options != MX_JOB_POL_RELATIVE) && (options != MX_JOB_POL_ABSOLUTE))
-        return MX_ERR_INVALID_ARGS;
+    if ((options != ZX_JOB_POL_RELATIVE) && (options != ZX_JOB_POL_ABSOLUTE))
+        return ZX_ERR_INVALID_ARGS;
     if (!_policy || (count == 0u))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
-    if (topic != MX_JOB_POL_BASIC)
-        return MX_ERR_INVALID_ARGS;
+    if (topic != ZX_JOB_POL_BASIC)
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::AllocChecker ac;
     fbl::InlineArray<
-        mx_policy_basic, kPolicyBasicInlineCount> policy(&ac, count);
+        zx_policy_basic, kPolicyBasicInlineCount> policy(&ac, count);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    auto status = _policy.copy_array_from_user(policy.get(), sizeof(mx_policy_basic) * count);
-    if (status != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    auto status = _policy.copy_array_from_user(policy.get(), sizeof(zx_policy_basic) * count);
+    if (status != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<JobDispatcher> job;
-    status = up->GetDispatcherWithRights(job_handle, MX_RIGHT_SET_POLICY, &job);
-    if (status != MX_OK)
+    status = up->GetDispatcherWithRights(job_handle, ZX_RIGHT_SET_POLICY, &job);
+    if (status != ZX_OK)
         return status;
 
     return job->SetPolicy(options, policy.get(), policy.size());
 }
 
-mx_status_t sys_job_set_relative_importance(
-    mx_handle_t resource_handle,
-    mx_handle_t job_handle, mx_handle_t less_important_job_handle) {
+zx_status_t sys_job_set_relative_importance(
+    zx_handle_t resource_handle,
+    zx_handle_t job_handle, zx_handle_t less_important_job_handle) {
 
     ProcessDispatcher* up = ProcessDispatcher::GetCurrent();
 
@@ -650,26 +650,26 @@
     // this operation no matter the rights on the job handles.
     {
         fbl::RefPtr<ResourceDispatcher> resource;
-        mx_status_t status = up->GetDispatcherWithRights(
-            resource_handle, MX_RIGHT_NONE, &resource);
-        if (status != MX_OK)
+        zx_status_t status = up->GetDispatcherWithRights(
+            resource_handle, ZX_RIGHT_NONE, &resource);
+        if (status != ZX_OK)
             return status;
         // TODO(MG-971): Check that this is actually the appropriate resource
     }
 
     // Get the job to modify.
     fbl::RefPtr<JobDispatcher> job;
-    mx_status_t status = up->GetDispatcherWithRights(
-        job_handle, MX_RIGHT_NONE, &job);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(
+        job_handle, ZX_RIGHT_NONE, &job);
+    if (status != ZX_OK)
         return status;
 
     // Get its less-important neighbor, or null.
     fbl::RefPtr<JobDispatcher> li_job;
-    if (less_important_job_handle != MX_HANDLE_INVALID) {
+    if (less_important_job_handle != ZX_HANDLE_INVALID) {
         status = up->GetDispatcherWithRights(
-            less_important_job_handle, MX_RIGHT_NONE, &li_job);
-        if (status != MX_OK)
+            less_important_job_handle, ZX_RIGHT_NONE, &li_job);
+        if (status != ZX_OK)
             return status;
     }
 
diff --git a/kernel/lib/syscalls/syscalls_test.cpp b/kernel/lib/syscalls/syscalls_test.cpp
index 14161d1..756d471 100644
--- a/kernel/lib/syscalls/syscalls_test.cpp
+++ b/kernel/lib/syscalls/syscalls_test.cpp
@@ -6,33 +6,33 @@
 
 #include "syscalls_priv.h"
 
-mx_status_t sys_syscall_test_0(void) {
+zx_status_t sys_syscall_test_0(void) {
     return 0;
 }
-mx_status_t sys_syscall_test_1(int a) {
+zx_status_t sys_syscall_test_1(int a) {
     return a;
 }
-mx_status_t sys_syscall_test_2(int a, int b) {
+zx_status_t sys_syscall_test_2(int a, int b) {
     return a + b;
 }
-mx_status_t sys_syscall_test_3(int a, int b, int c) {
+zx_status_t sys_syscall_test_3(int a, int b, int c) {
     return a + b + c;
 }
-mx_status_t sys_syscall_test_4(int a, int b, int c, int d) {
+zx_status_t sys_syscall_test_4(int a, int b, int c, int d) {
     return a + b + c + d;
 }
-mx_status_t sys_syscall_test_5(int a, int b, int c, int d, int e) {
+zx_status_t sys_syscall_test_5(int a, int b, int c, int d, int e) {
     return a + b + c + d + e;
 }
-mx_status_t sys_syscall_test_6(int a, int b, int c, int d, int e, int f) {
+zx_status_t sys_syscall_test_6(int a, int b, int c, int d, int e, int f) {
     return a + b + c + d + e + f;
 }
-mx_status_t sys_syscall_test_7(int a, int b, int c, int d, int e, int f, int g) {
+zx_status_t sys_syscall_test_7(int a, int b, int c, int d, int e, int f, int g) {
     return a + b + c + d + e + f + g;
 }
-mx_status_t sys_syscall_test_8(int a, int b, int c, int d, int e, int f, int g, int h) {
+zx_status_t sys_syscall_test_8(int a, int b, int c, int d, int e, int f, int g, int h) {
     return a + b + c + d + e + f + g + h;
 }
-mx_status_t sys_syscall_test_wrapper(int a, int b, int c) {
+zx_status_t sys_syscall_test_wrapper(int a, int b, int c) {
     return a + b + c;
 }
diff --git a/kernel/lib/syscalls/syscalls_timer.cpp b/kernel/lib/syscalls/syscalls_timer.cpp
index fce8046..9df1197 100644
--- a/kernel/lib/syscalls/syscalls_timer.cpp
+++ b/kernel/lib/syscalls/syscalls_timer.cpp
@@ -20,55 +20,55 @@
 
 #include "syscalls_priv.h"
 
-mx_status_t sys_timer_create(uint32_t options, uint32_t clock_id, user_ptr<mx_handle_t> _out) {
-    if (clock_id != MX_CLOCK_MONOTONIC)
-        return MX_ERR_INVALID_ARGS;
+zx_status_t sys_timer_create(uint32_t options, uint32_t clock_id, user_ptr<zx_handle_t> _out) {
+    if (clock_id != ZX_CLOCK_MONOTONIC)
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
-    mx_status_t result = up->QueryPolicy(MX_POL_NEW_TIMER);
-    if (result != MX_OK)
+    zx_status_t result = up->QueryPolicy(ZX_POL_NEW_TIMER);
+    if (result != ZX_OK)
         return result;
 
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
+    zx_rights_t rights;
 
     result = TimerDispatcher::Create(options, &dispatcher, &rights);
 
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
     HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    mx_handle_t hv = up->MapHandleToValue(handle);
+    zx_handle_t hv = up->MapHandleToValue(handle);
 
-    if (_out.copy_to_user(hv) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out.copy_to_user(hv) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(handle));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_timer_set(
-    mx_handle_t handle, mx_time_t deadline, mx_duration_t slack) {
+zx_status_t sys_timer_set(
+    zx_handle_t handle, zx_time_t deadline, zx_duration_t slack) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<TimerDispatcher> timer;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &timer);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &timer);
+    if (status != ZX_OK)
         return status;
 
     return timer->Set(deadline, slack);
 }
 
 
-mx_status_t sys_timer_cancel(mx_handle_t handle) {
+zx_status_t sys_timer_cancel(zx_handle_t handle) {
     auto up = ProcessDispatcher::GetCurrent();
 
     fbl::RefPtr<TimerDispatcher> timer;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &timer);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &timer);
+    if (status != ZX_OK)
         return status;
 
     return timer->Cancel();
diff --git a/kernel/lib/syscalls/syscalls_vmar.cpp b/kernel/lib/syscalls/syscalls_vmar.cpp
index 5d6d376..0124fe6 100644
--- a/kernel/lib/syscalls/syscalls_vmar.cpp
+++ b/kernel/lib/syscalls/syscalls_vmar.cpp
@@ -26,32 +26,32 @@
 
 #define LOCAL_TRACE 0
 
-mx_status_t sys_vmar_allocate(mx_handle_t parent_vmar_handle,
+zx_status_t sys_vmar_allocate(zx_handle_t parent_vmar_handle,
                     size_t offset, size_t size, uint32_t map_flags,
-                    user_ptr<mx_handle_t> _child_vmar, user_ptr<uintptr_t> _child_addr) {
+                    user_ptr<zx_handle_t> _child_vmar, user_ptr<uintptr_t> _child_addr) {
 
     auto up = ProcessDispatcher::GetCurrent();
 
     // Compute needed rights from requested mapping protections.
-    mx_rights_t vmar_rights = 0u;
-    if (map_flags & MX_VM_FLAG_CAN_MAP_READ)
-        vmar_rights |= MX_RIGHT_READ;
-    if (map_flags & MX_VM_FLAG_CAN_MAP_WRITE)
-        vmar_rights |= MX_RIGHT_WRITE;
-    if (map_flags & MX_VM_FLAG_CAN_MAP_EXECUTE)
-        vmar_rights |= MX_RIGHT_EXECUTE;
+    zx_rights_t vmar_rights = 0u;
+    if (map_flags & ZX_VM_FLAG_CAN_MAP_READ)
+        vmar_rights |= ZX_RIGHT_READ;
+    if (map_flags & ZX_VM_FLAG_CAN_MAP_WRITE)
+        vmar_rights |= ZX_RIGHT_WRITE;
+    if (map_flags & ZX_VM_FLAG_CAN_MAP_EXECUTE)
+        vmar_rights |= ZX_RIGHT_EXECUTE;
 
     // lookup the dispatcher from handle
     fbl::RefPtr<VmAddressRegionDispatcher> vmar;
-    mx_status_t status = up->GetDispatcherWithRights(parent_vmar_handle, vmar_rights, &vmar);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(parent_vmar_handle, vmar_rights, &vmar);
+    if (status != ZX_OK)
         return status;
 
     // Create the new VMAR
     fbl::RefPtr<VmAddressRegionDispatcher> new_vmar;
-    mx_rights_t new_rights;
+    zx_rights_t new_rights;
     status = vmar->Allocate(offset, size, map_flags, &new_vmar, &new_rights);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Setup a handler to destroy the new VMAR if the syscall is unsuccessful.
@@ -67,95 +67,95 @@
     // Create a handle and attach the dispatcher to it
     HandleOwner handle(MakeHandle(fbl::move(new_vmar), new_rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    if (_child_addr.copy_to_user(base) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_child_addr.copy_to_user(base) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
-    if (_child_vmar.copy_to_user(up->MapHandleToValue(handle)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_child_vmar.copy_to_user(up->MapHandleToValue(handle)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(handle));
     cleanup_handler.cancel();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_vmar_destroy(mx_handle_t vmar_handle) {
+zx_status_t sys_vmar_destroy(zx_handle_t vmar_handle) {
     auto up = ProcessDispatcher::GetCurrent();
 
     // lookup the dispatcher from handle
     fbl::RefPtr<VmAddressRegionDispatcher> vmar;
-    mx_status_t status = up->GetDispatcher(vmar_handle, &vmar);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcher(vmar_handle, &vmar);
+    if (status != ZX_OK)
         return status;
 
     return vmar->Destroy();
 }
 
-mx_status_t sys_vmar_map(mx_handle_t vmar_handle, size_t vmar_offset,
-                    mx_handle_t vmo_handle, uint64_t vmo_offset, size_t len, uint32_t map_flags,
+zx_status_t sys_vmar_map(zx_handle_t vmar_handle, size_t vmar_offset,
+                    zx_handle_t vmo_handle, uint64_t vmo_offset, size_t len, uint32_t map_flags,
                     user_ptr<uintptr_t> _mapped_addr) {
     auto up = ProcessDispatcher::GetCurrent();
 
     // lookup the VMAR dispatcher from handle
     fbl::RefPtr<VmAddressRegionDispatcher> vmar;
-    mx_rights_t vmar_rights;
-    mx_status_t status = up->GetDispatcherAndRights(vmar_handle, &vmar, &vmar_rights);
-    if (status != MX_OK)
+    zx_rights_t vmar_rights;
+    zx_status_t status = up->GetDispatcherAndRights(vmar_handle, &vmar, &vmar_rights);
+    if (status != ZX_OK)
         return status;
 
     // lookup the VMO dispatcher from handle
     fbl::RefPtr<VmObjectDispatcher> vmo;
-    mx_rights_t vmo_rights;
+    zx_rights_t vmo_rights;
     status = up->GetDispatcherAndRights(vmo_handle, &vmo, &vmo_rights);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // test to see if we should even be able to map this
-    if (!(vmo_rights & MX_RIGHT_MAP))
-        return MX_ERR_ACCESS_DENIED;
+    if (!(vmo_rights & ZX_RIGHT_MAP))
+        return ZX_ERR_ACCESS_DENIED;
 
     if (!VmAddressRegionDispatcher::is_valid_mapping_protection(map_flags))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     bool do_map_range = false;
-    if (map_flags & MX_VM_FLAG_MAP_RANGE) {
+    if (map_flags & ZX_VM_FLAG_MAP_RANGE) {
         do_map_range = true;
-        map_flags &= ~MX_VM_FLAG_MAP_RANGE;
+        map_flags &= ~ZX_VM_FLAG_MAP_RANGE;
     }
 
     // Usermode is not allowed to specify these flags on mappings, though we may
     // set them below.
-    if (map_flags & (MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE | MX_VM_FLAG_CAN_MAP_EXECUTE)) {
-        return MX_ERR_INVALID_ARGS;
+    if (map_flags & (ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE | ZX_VM_FLAG_CAN_MAP_EXECUTE)) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Permissions allowed by both the VMO and the VMAR
-    const bool can_read = (vmo_rights & MX_RIGHT_READ) && (vmar_rights & MX_RIGHT_READ);
-    const bool can_write = (vmo_rights & MX_RIGHT_WRITE) && (vmar_rights & MX_RIGHT_WRITE);
-    const bool can_exec = (vmo_rights & MX_RIGHT_EXECUTE) && (vmar_rights & MX_RIGHT_EXECUTE);
+    const bool can_read = (vmo_rights & ZX_RIGHT_READ) && (vmar_rights & ZX_RIGHT_READ);
+    const bool can_write = (vmo_rights & ZX_RIGHT_WRITE) && (vmar_rights & ZX_RIGHT_WRITE);
+    const bool can_exec = (vmo_rights & ZX_RIGHT_EXECUTE) && (vmar_rights & ZX_RIGHT_EXECUTE);
 
     // test to see if the requested mapping protections are allowed
-    if ((map_flags & MX_VM_FLAG_PERM_READ) && !can_read)
-        return MX_ERR_ACCESS_DENIED;
-    if ((map_flags & MX_VM_FLAG_PERM_WRITE) && !can_write)
-        return MX_ERR_ACCESS_DENIED;
-    if ((map_flags & MX_VM_FLAG_PERM_EXECUTE) && !can_exec)
-        return MX_ERR_ACCESS_DENIED;
+    if ((map_flags & ZX_VM_FLAG_PERM_READ) && !can_read)
+        return ZX_ERR_ACCESS_DENIED;
+    if ((map_flags & ZX_VM_FLAG_PERM_WRITE) && !can_write)
+        return ZX_ERR_ACCESS_DENIED;
+    if ((map_flags & ZX_VM_FLAG_PERM_EXECUTE) && !can_exec)
+        return ZX_ERR_ACCESS_DENIED;
 
     // If a permission is allowed by both the VMO and the VMAR, add it to the
     // flags for the new mapping, so that the VMO's rights as of now can be used
     // to constrain future permission changes via Protect().
     if (can_read)
-        map_flags |= MX_VM_FLAG_CAN_MAP_READ;
+        map_flags |= ZX_VM_FLAG_CAN_MAP_READ;
     if (can_write)
-        map_flags |= MX_VM_FLAG_CAN_MAP_WRITE;
+        map_flags |= ZX_VM_FLAG_CAN_MAP_WRITE;
     if (can_exec)
-        map_flags |= MX_VM_FLAG_CAN_MAP_EXECUTE;
+        map_flags |= ZX_VM_FLAG_CAN_MAP_EXECUTE;
 
     fbl::RefPtr<VmMapping> vm_mapping;
     status = vmar->Map(vmar_offset, vmo->vmo(), vmo_offset, len, map_flags, &vm_mapping);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Setup a handler to destroy the new mapping if the syscall is unsuccessful.
@@ -165,49 +165,49 @@
 
     if (do_map_range) {
         status = vm_mapping->MapRange(vmo_offset, len, false);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
     }
 
-    if (_mapped_addr.copy_to_user(vm_mapping->base()) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_mapped_addr.copy_to_user(vm_mapping->base()) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     cleanup_handler.cancel();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_vmar_unmap(mx_handle_t vmar_handle, uintptr_t addr, size_t len) {
+zx_status_t sys_vmar_unmap(zx_handle_t vmar_handle, uintptr_t addr, size_t len) {
     auto up = ProcessDispatcher::GetCurrent();
 
     // lookup the dispatcher from handle
     fbl::RefPtr<VmAddressRegionDispatcher> vmar;
-    mx_status_t status = up->GetDispatcher(vmar_handle, &vmar);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcher(vmar_handle, &vmar);
+    if (status != ZX_OK)
         return status;
 
     return vmar->Unmap(addr, len);
 }
 
-mx_status_t sys_vmar_protect(mx_handle_t vmar_handle, uintptr_t addr, size_t len, uint32_t prot) {
+zx_status_t sys_vmar_protect(zx_handle_t vmar_handle, uintptr_t addr, size_t len, uint32_t prot) {
     auto up = ProcessDispatcher::GetCurrent();
 
-    mx_rights_t vmar_rights = 0u;
-    if (prot & MX_VM_FLAG_PERM_READ)
-        vmar_rights |= MX_RIGHT_READ;
-    if (prot & MX_VM_FLAG_PERM_WRITE)
-        vmar_rights |= MX_RIGHT_WRITE;
-    if (prot & MX_VM_FLAG_PERM_EXECUTE)
-        vmar_rights |= MX_RIGHT_EXECUTE;
+    zx_rights_t vmar_rights = 0u;
+    if (prot & ZX_VM_FLAG_PERM_READ)
+        vmar_rights |= ZX_RIGHT_READ;
+    if (prot & ZX_VM_FLAG_PERM_WRITE)
+        vmar_rights |= ZX_RIGHT_WRITE;
+    if (prot & ZX_VM_FLAG_PERM_EXECUTE)
+        vmar_rights |= ZX_RIGHT_EXECUTE;
 
     // lookup the dispatcher from handle
     fbl::RefPtr<VmAddressRegionDispatcher> vmar;
-    mx_status_t status = up->GetDispatcherWithRights(vmar_handle, vmar_rights, &vmar);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(vmar_handle, vmar_rights, &vmar);
+    if (status != ZX_OK)
         return status;
 
     if (!VmAddressRegionDispatcher::is_valid_mapping_protection(prot))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     return vmar->Protect(addr, len, prot);
 }
diff --git a/kernel/lib/syscalls/syscalls_vmo.cpp b/kernel/lib/syscalls/syscalls_vmo.cpp
index 6bac874..66b996e 100644
--- a/kernel/lib/syscalls/syscalls_vmo.cpp
+++ b/kernel/lib/syscalls/syscalls_vmo.cpp
@@ -24,44 +24,44 @@
 
 #define LOCAL_TRACE 0
 
-mx_status_t sys_vmo_create(uint64_t size, uint32_t options, user_ptr<mx_handle_t> _out) {
+zx_status_t sys_vmo_create(uint64_t size, uint32_t options, user_ptr<zx_handle_t> _out) {
     LTRACEF("size %#" PRIx64 "\n", size);
 
     if (options != 0u)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto up = ProcessDispatcher::GetCurrent();
-    mx_status_t res = up->QueryPolicy(MX_POL_NEW_VMO);
-    if (res != MX_OK)
+    zx_status_t res = up->QueryPolicy(ZX_POL_NEW_VMO);
+    if (res != ZX_OK)
         return res;
 
     // create a vm object
     fbl::RefPtr<VmObject> vmo;
     res = VmObjectPaged::Create(0, size, &vmo);
-    if (res != MX_OK)
+    if (res != ZX_OK)
         return res;
 
     // create a Vm Object dispatcher
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
-    mx_status_t result = VmObjectDispatcher::Create(fbl::move(vmo), &dispatcher, &rights);
-    if (result != MX_OK)
+    zx_rights_t rights;
+    zx_status_t result = VmObjectDispatcher::Create(fbl::move(vmo), &dispatcher, &rights);
+    if (result != ZX_OK)
         return result;
 
     // create a handle and attach the dispatcher to it
     HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
     if (!handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    if (_out.copy_to_user(up->MapHandleToValue(handle)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out.copy_to_user(up->MapHandleToValue(handle)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(handle));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t sys_vmo_read(mx_handle_t handle, user_ptr<void> _data,
+zx_status_t sys_vmo_read(zx_handle_t handle, user_ptr<void> _data,
                          uint64_t offset, size_t len, user_ptr<size_t> _actual) {
     LTRACEF("handle %x, data %p, offset %#" PRIx64 ", len %#zx\n",
             handle, _data.get(), offset, len);
@@ -70,8 +70,8 @@
 
     // lookup the dispatcher from handle
     fbl::RefPtr<VmObjectDispatcher> vmo;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_READ, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_READ, &vmo);
+    if (status != ZX_OK)
         return status;
 
     // Force map the range, even if it crosses multiple mappings.
@@ -82,13 +82,13 @@
         auto int_data = _data.reinterpret<uint8_t>();
         for (size_t i = 0; i < len; i += PAGE_SIZE) {
             status = int_data.copy_array_to_user(&byte, 1, i);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
         }
         if (len > 0) {
             status = int_data.copy_array_to_user(&byte, 1, len - 1);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
         }
@@ -97,13 +97,13 @@
     // do the read operation
     size_t nread;
     status = vmo->Read(_data, len, offset, &nread);
-    if (status == MX_OK)
+    if (status == ZX_OK)
         status = _actual.copy_to_user(nread);
 
     return status;
 }
 
-mx_status_t sys_vmo_write(mx_handle_t handle, user_ptr<const void> _data,
+zx_status_t sys_vmo_write(zx_handle_t handle, user_ptr<const void> _data,
                           uint64_t offset, size_t len, user_ptr<size_t> _actual) {
     LTRACEF("handle %x, data %p, offset %#" PRIx64 ", len %#zx\n",
             handle, _data.get(), offset, len);
@@ -112,8 +112,8 @@
 
     // lookup the dispatcher from handle
     fbl::RefPtr<VmObjectDispatcher> vmo;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &vmo);
+    if (status != ZX_OK)
         return status;
 
     // Force map the range, even if it crosses multiple mappings.
@@ -124,13 +124,13 @@
         auto int_data = _data.reinterpret<const uint8_t>();
         for (size_t i = 0; i < len; i += PAGE_SIZE) {
             status = int_data.copy_array_from_user(&byte, 1, i);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
         }
         if (len > 0) {
             status = int_data.copy_array_from_user(&byte, 1, len - 1);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
         }
@@ -139,21 +139,21 @@
     // do the write operation
     size_t nwritten;
     status = vmo->Write(_data, len, offset, &nwritten);
-    if (status == MX_OK)
+    if (status == ZX_OK)
         status = _actual.copy_to_user(nwritten);
 
     return status;
 }
 
-mx_status_t sys_vmo_get_size(mx_handle_t handle, user_ptr<uint64_t> _size) {
+zx_status_t sys_vmo_get_size(zx_handle_t handle, user_ptr<uint64_t> _size) {
     LTRACEF("handle %x, sizep %p\n", handle, _size.get());
 
     auto up = ProcessDispatcher::GetCurrent();
 
     // lookup the dispatcher from handle
     fbl::RefPtr<VmObjectDispatcher> vmo;
-    mx_status_t status = up->GetDispatcher(handle, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcher(handle, &vmo);
+    if (status != ZX_OK)
         return status;
 
     // no rights check, anyone should be able to get the size
@@ -163,28 +163,28 @@
     status = vmo->GetSize(&size);
 
     // copy the size back, even if it failed
-    if (_size.copy_to_user(size) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_size.copy_to_user(size) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     return status;
 }
 
-mx_status_t sys_vmo_set_size(mx_handle_t handle, uint64_t size) {
+zx_status_t sys_vmo_set_size(zx_handle_t handle, uint64_t size) {
     LTRACEF("handle %x, size %#" PRIx64 "\n", handle, size);
 
     auto up = ProcessDispatcher::GetCurrent();
 
     // lookup the dispatcher from handle
     fbl::RefPtr<VmObjectDispatcher> vmo;
-    mx_status_t status = up->GetDispatcherWithRights(handle, MX_RIGHT_WRITE, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &vmo);
+    if (status != ZX_OK)
         return status;
 
     // do the operation
     return vmo->SetSize(size);
 }
 
-mx_status_t sys_vmo_op_range(mx_handle_t handle, uint32_t op, uint64_t offset, uint64_t size,
+zx_status_t sys_vmo_op_range(zx_handle_t handle, uint32_t op, uint64_t offset, uint64_t size,
                              user_ptr<void> _buffer, size_t buffer_size) {
     LTRACEF("handle %x op %u offset %#" PRIx64 " size %#" PRIx64
             " buffer %p buffer_size %zu\n",
@@ -195,53 +195,53 @@
     // lookup the dispatcher from handle
     // TODO(MG-967): test rights on the handle
     fbl::RefPtr<VmObjectDispatcher> vmo;
-    mx_status_t status = up->GetDispatcher(handle, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = up->GetDispatcher(handle, &vmo);
+    if (status != ZX_OK)
         return status;
 
     return vmo->RangeOp(op, offset, size, _buffer, buffer_size);
 }
 
-mx_status_t sys_vmo_set_cache_policy(mx_handle_t handle, uint32_t cache_policy) {
+zx_status_t sys_vmo_set_cache_policy(zx_handle_t handle, uint32_t cache_policy) {
     fbl::RefPtr<VmObjectDispatcher> vmo;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     auto up = ProcessDispatcher::GetCurrent();
 
     // Sanity check the cache policy.
-    if (cache_policy & ~MX_CACHE_POLICY_MASK) {
-        return MX_ERR_INVALID_ARGS;
+    if (cache_policy & ~ZX_CACHE_POLICY_MASK) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // lookup the dispatcher from handle.
-    status = up->GetDispatcherWithRights(handle, MX_RIGHT_MAP, &vmo);
-    if (status != MX_OK) {
+    status = up->GetDispatcherWithRights(handle, ZX_RIGHT_MAP, &vmo);
+    if (status != ZX_OK) {
         return status;
     }
 
     return vmo->SetMappingCachePolicy(cache_policy);
 }
 
-mx_status_t sys_vmo_clone(mx_handle_t handle, uint32_t options, uint64_t offset, uint64_t size,
-        user_ptr<mx_handle_t>(_out_handle)) {
+zx_status_t sys_vmo_clone(zx_handle_t handle, uint32_t options, uint64_t offset, uint64_t size,
+        user_ptr<zx_handle_t>(_out_handle)) {
     LTRACEF("handle %x options %#x offset %#" PRIx64 " size %#" PRIx64 "\n",
             handle, options, offset, size);
 
     auto up = ProcessDispatcher::GetCurrent();
 
-    mx_status_t status;
+    zx_status_t status;
     fbl::RefPtr<VmObject> clone_vmo;
-    mx_rights_t in_rights;
+    zx_rights_t in_rights;
 
     {
         // lookup the dispatcher from handle, save a copy of the rights for later
         fbl::RefPtr<VmObjectDispatcher> vmo;
-        status = up->GetDispatcherWithRights(handle, MX_RIGHT_DUPLICATE | MX_RIGHT_READ, &vmo, &in_rights);
-        if (status != MX_OK)
+        status = up->GetDispatcherWithRights(handle, ZX_RIGHT_DUPLICATE | ZX_RIGHT_READ, &vmo, &in_rights);
+        if (status != ZX_OK)
             return status;
 
         // clone the vmo into a new one
-        status = vmo->Clone(options, offset, size, in_rights & MX_RIGHT_GET_PROPERTY,  &clone_vmo);
-        if (status != MX_OK)
+        status = vmo->Clone(options, offset, size, in_rights & ZX_RIGHT_GET_PROPERTY,  &clone_vmo);
+        if (status != ZX_OK)
             return status;
 
         DEBUG_ASSERT(clone_vmo);
@@ -249,18 +249,18 @@
 
     // create a Vm Object dispatcher
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t default_rights;
-    mx_status_t result = VmObjectDispatcher::Create(fbl::move(clone_vmo), &dispatcher, &default_rights);
-    if (result != MX_OK)
+    zx_rights_t default_rights;
+    zx_status_t result = VmObjectDispatcher::Create(fbl::move(clone_vmo), &dispatcher, &default_rights);
+    if (result != ZX_OK)
         return result;
 
     // Set the rights to the new handle to no greater than the input
     // handle, plus WRITE if making a COW clone, and always allow
-    // GET/SET_PROPERTY so the user can set MX_PROP_NAME on the new clone.
-    mx_rights_t rights =
-        in_rights | MX_RIGHT_GET_PROPERTY | MX_RIGHT_SET_PROPERTY;
-    if (options & MX_VMO_CLONE_COPY_ON_WRITE)
-        rights |= MX_RIGHT_WRITE;
+    // GET/SET_PROPERTY so the user can set ZX_PROP_NAME on the new clone.
+    zx_rights_t rights =
+        in_rights | ZX_RIGHT_GET_PROPERTY | ZX_RIGHT_SET_PROPERTY;
+    if (options & ZX_VMO_CLONE_COPY_ON_WRITE)
+        rights |= ZX_RIGHT_WRITE;
 
     // make sure we're somehow not elevating rights beyond what a new vmo should have
     DEBUG_ASSERT((default_rights & rights) == rights);
@@ -268,12 +268,12 @@
     // create a handle and attach the dispatcher to it
     HandleOwner clone_handle(MakeHandle(fbl::move(dispatcher), rights));
     if (!clone_handle)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    if (_out_handle.copy_to_user(up->MapHandleToValue(clone_handle)) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (_out_handle.copy_to_user(up->MapHandleToValue(clone_handle)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     up->AddHandle(fbl::move(clone_handle));
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/lib/syscalls/syscalls_zircon.cpp b/kernel/lib/syscalls/syscalls_zircon.cpp
new file mode 100644
index 0000000..5cf5f0d
--- /dev/null
+++ b/kernel/lib/syscalls/syscalls_zircon.cpp
@@ -0,0 +1,291 @@
+// Copyright 2016 The Fuchsia Authors
+//
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file or at
+// https://opensource.org/licenses/MIT
+
+#include <err.h>
+#include <inttypes.h>
+#include <platform.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <trace.h>
+
+#include <explicit-memory/bytes.h>
+#include <kernel/auto_lock.h>
+#include <kernel/thread.h>
+#include <lib/crypto/global_prng.h>
+#include <lib/user_copy/user_ptr.h>
+#include <object/event_dispatcher.h>
+#include <object/event_pair_dispatcher.h>
+#include <object/handle_owner.h>
+#include <object/handles.h>
+#include <object/log_dispatcher.h>
+#include <object/process_dispatcher.h>
+#include <object/resources.h>
+#include <object/thread_dispatcher.h>
+
+#include <zircon/syscalls/log.h>
+#include <zircon/syscalls/policy.h>
+#include <fbl/alloc_checker.h>
+#include <fbl/atomic.h>
+#include <fbl/ref_ptr.h>
+
+#include "syscalls_priv.h"
+
+#define LOCAL_TRACE 0
+
+constexpr size_t kMaxCPRNGDraw = ZX_CPRNG_DRAW_MAX_LEN;
+constexpr size_t kMaxCPRNGSeed = ZX_CPRNG_ADD_ENTROPY_MAX_LEN;
+
+zx_status_t sys_nanosleep(zx_time_t deadline) {
+    LTRACEF("nseconds %" PRIu64 "\n", deadline);
+
+    if (deadline == 0ull) {
+        thread_yield();
+        return ZX_OK;
+    }
+
+    // This syscall is declared as "blocking" in syscalls.sysgen, so a higher
+    // layer will automatically retry if we return ZX_ERR_INTERNAL_INTR_RETRY.
+    return thread_sleep_etc(deadline, /*interruptable=*/true);
+}
+
+// This must be accessed atomically from any given thread.
+static fbl::atomic<int64_t> utc_offset;
+
+uint64_t sys_time_get(uint32_t clock_id) {
+    switch (clock_id) {
+    case ZX_CLOCK_MONOTONIC:
+        return current_time();
+    case ZX_CLOCK_UTC:
+        return current_time() + utc_offset.load();
+    case ZX_CLOCK_THREAD:
+        return ThreadDispatcher::GetCurrent()->runtime_ns();
+    default:
+        //TODO: figure out the best option here
+        return 0u;
+    }
+}
+
+zx_status_t sys_clock_adjust(zx_handle_t hrsrc, uint32_t clock_id, int64_t offset) {
+    // TODO(MG-971): finer grained validation
+    zx_status_t status;
+    if ((status = validate_resource(hrsrc, ZX_RSRC_KIND_ROOT)) < 0) {
+        return status;
+    }
+
+    switch (clock_id) {
+    case ZX_CLOCK_MONOTONIC:
+        return ZX_ERR_ACCESS_DENIED;
+    case ZX_CLOCK_UTC:
+        utc_offset.store(offset);
+        return ZX_OK;
+    default:
+        return ZX_ERR_INVALID_ARGS;
+    }
+}
+
+zx_status_t sys_event_create(uint32_t options, user_ptr<zx_handle_t> _out) {
+    LTRACEF("options 0x%x\n", options);
+
+    if (options != 0u)
+        return ZX_ERR_INVALID_ARGS;
+
+    auto up = ProcessDispatcher::GetCurrent();
+    zx_status_t res = up->QueryPolicy(ZX_POL_NEW_EVENT);
+    if (res != ZX_OK)
+        return res;
+
+    fbl::RefPtr<Dispatcher> dispatcher;
+    zx_rights_t rights;
+
+    zx_status_t result = EventDispatcher::Create(options, &dispatcher, &rights);
+    if (result != ZX_OK)
+        return result;
+
+    HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
+    if (!handle)
+        return ZX_ERR_NO_MEMORY;
+
+    if (_out.copy_to_user(up->MapHandleToValue(handle)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+
+    up->AddHandle(fbl::move(handle));
+    return ZX_OK;
+}
+
+zx_status_t sys_eventpair_create(uint32_t options,
+                                 user_ptr<zx_handle_t> _out0, user_ptr<zx_handle_t> _out1) {
+    LTRACEF("entry out_handles %p,%p\n", _out0.get(), _out1.get());
+
+    if (options != 0u)  // No options defined/supported yet.
+        return ZX_ERR_NOT_SUPPORTED;
+
+    auto up = ProcessDispatcher::GetCurrent();
+    zx_status_t res = up->QueryPolicy(ZX_POL_NEW_EVPAIR);
+    if (res != ZX_OK)
+        return res;
+
+    fbl::RefPtr<Dispatcher> epd0, epd1;
+    zx_rights_t rights;
+    zx_status_t result = EventPairDispatcher::Create(&epd0, &epd1, &rights);
+    if (result != ZX_OK)
+        return result;
+
+    HandleOwner h0(MakeHandle(fbl::move(epd0), rights));
+    if (!h0)
+        return ZX_ERR_NO_MEMORY;
+
+    HandleOwner h1(MakeHandle(fbl::move(epd1), rights));
+    if (!h1)
+        return ZX_ERR_NO_MEMORY;
+
+    if (_out0.copy_to_user(up->MapHandleToValue(h0)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+
+    if (_out1.copy_to_user(up->MapHandleToValue(h1)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+
+    up->AddHandle(fbl::move(h0));
+    up->AddHandle(fbl::move(h1));
+
+    return ZX_OK;
+}
+
+zx_status_t sys_log_create(uint32_t options, user_ptr<zx_handle_t> out) {
+    LTRACEF("options 0x%x\n", options);
+
+    // create a Log dispatcher
+    fbl::RefPtr<Dispatcher> dispatcher;
+    zx_rights_t rights;
+    zx_status_t result = LogDispatcher::Create(options, &dispatcher, &rights);
+    if (result != ZX_OK)
+        return result;
+
+    // by default log objects are write-only
+    // as readable logs are more expensive
+    if (options & ZX_LOG_FLAG_READABLE) {
+        rights |= ZX_RIGHT_READ;
+    }
+
+    // create a handle and attach the dispatcher to it
+    HandleOwner handle(MakeHandle(fbl::move(dispatcher), rights));
+    if (!handle)
+        return ZX_ERR_NO_MEMORY;
+
+    auto up = ProcessDispatcher::GetCurrent();
+
+    if (out.copy_to_user(up->MapHandleToValue(handle)) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+
+    up->AddHandle(fbl::move(handle));
+
+    return ZX_OK;
+}
+
+zx_status_t sys_debuglog_create(zx_handle_t rsrc, uint32_t options,
+                                user_ptr<zx_handle_t> out) {
+    zx_status_t status = validate_resource(rsrc, ZX_RSRC_KIND_ROOT);
+    if (status != ZX_OK)
+        return status;
+
+    return sys_log_create(options, out);
+}
+
+zx_status_t sys_debuglog_write(zx_handle_t log_handle, uint32_t options, user_ptr<const void> _ptr, size_t len) {
+    LTRACEF("log handle %x, opt %x, ptr 0x%p, len %zu\n", log_handle, options, _ptr.get(), len);
+
+    if (len > DLOG_MAX_DATA)
+        return ZX_ERR_OUT_OF_RANGE;
+
+    if (options & (~ZX_LOG_FLAGS_MASK))
+        return ZX_ERR_INVALID_ARGS;
+
+    auto up = ProcessDispatcher::GetCurrent();
+
+    fbl::RefPtr<LogDispatcher> log;
+    zx_status_t status = up->GetDispatcherWithRights(log_handle, ZX_RIGHT_WRITE, &log);
+    if (status != ZX_OK)
+        return status;
+
+    char buf[DLOG_MAX_RECORD];
+    if (_ptr.reinterpret<const char>().copy_array_from_user(buf, len) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+
+    return log->Write(options, buf, len);
+}
+
+zx_status_t sys_debuglog_read(zx_handle_t log_handle, uint32_t options, user_ptr<void> _ptr, size_t len) {
+    LTRACEF("log handle %x, opt %x, ptr 0x%p, len %zu\n", log_handle, options, _ptr.get(), len);
+
+    if (options != 0)
+        return ZX_ERR_INVALID_ARGS;
+
+    auto up = ProcessDispatcher::GetCurrent();
+
+    fbl::RefPtr<LogDispatcher> log;
+    zx_status_t status = up->GetDispatcherWithRights(log_handle, ZX_RIGHT_READ, &log);
+    if (status != ZX_OK)
+        return status;
+
+    char buf[DLOG_MAX_RECORD];
+    size_t actual;
+    if ((status = log->Read(options, buf, DLOG_MAX_RECORD, &actual)) < 0)
+        return status;
+
+    if (_ptr.copy_array_to_user(buf, actual) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+
+    return static_cast<zx_status_t>(actual);
+}
+
+zx_status_t sys_log_write(zx_handle_t log_handle, uint32_t len, user_ptr<const void> _ptr, uint32_t options) {
+    return sys_debuglog_write(log_handle, options, _ptr, len);
+}
+
+zx_status_t sys_log_read(zx_handle_t log_handle, uint32_t len, user_ptr<void> _ptr, uint32_t options) {
+    return sys_debuglog_read(log_handle, options, _ptr, len);
+}
+
+zx_status_t sys_cprng_draw(user_ptr<void> _buffer, size_t len, user_ptr<size_t> _actual) {
+    if (len > kMaxCPRNGDraw)
+        return ZX_ERR_INVALID_ARGS;
+
+    uint8_t kernel_buf[kMaxCPRNGDraw];
+    // Ensure we get rid of the stack copy of the random data as this function
+    // returns.
+    explicit_memory::ZeroDtor<uint8_t> zero_guard(kernel_buf, sizeof(kernel_buf));
+
+    auto prng = crypto::GlobalPRNG::GetInstance();
+    ASSERT(prng->is_thread_safe());
+    prng->Draw(kernel_buf, static_cast<int>(len));
+
+    if (_buffer.copy_array_to_user(kernel_buf, len) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+    if (_actual.copy_to_user(len) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+
+    return ZX_OK;
+}
+
+zx_status_t sys_cprng_add_entropy(user_ptr<const void> _buffer, size_t len) {
+    if (len > kMaxCPRNGSeed)
+        return ZX_ERR_INVALID_ARGS;
+
+    uint8_t kernel_buf[kMaxCPRNGSeed];
+    // Ensure we get rid of the stack copy of the entropy as this function
+    // returns.
+    explicit_memory::ZeroDtor<uint8_t> zero_guard(kernel_buf, sizeof(kernel_buf));
+
+    if (_buffer.copy_array_from_user(kernel_buf, len) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
+
+    auto prng = crypto::GlobalPRNG::GetInstance();
+    ASSERT(prng->is_thread_safe());
+    prng->AddEntropy(kernel_buf, static_cast<int>(len));
+
+    return ZX_OK;
+}
diff --git a/kernel/lib/unittest/include/unittest.h b/kernel/lib/unittest/include/unittest.h
index 58612e0..6e58bdc 100644
--- a/kernel/lib/unittest/include/unittest.h
+++ b/kernel/lib/unittest/include/unittest.h
@@ -45,7 +45,7 @@
  *      EXPECT_EQ(1, foo_value, "foo_func failed");
  *      ... there are EXPECT_* macros for many conditions...
  *      EXPECT_TRUE(foo_condition(), "condition should be true");
- *      EXPECT_NE(MX_ERR_TIMED_OUT, foo_event(), "event timed out");
+ *      EXPECT_NE(ZX_ERR_TIMED_OUT, foo_event(), "event timed out");
  *
  *      END_TEST;
  * }
@@ -56,14 +56,14 @@
  *
  * The init function might look something like...
  *
- * static mx_status_t init_foo_test_env(void** context)
+ * static zx_status_t init_foo_test_env(void** context)
  * {
  *      *context = new FooTestEnvironment(...);
  *
  *      if (!(*context))
- *          return MX_ERR_NO_MEMORY;
+ *          return ZX_ERR_NO_MEMORY;
  *
- *      return MX_OK;
+ *      return ZX_OK;
  * }
  *
  * While the cleanup function might look like...
@@ -85,8 +85,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <trace.h>
 
 __BEGIN_CDECLS
@@ -316,7 +316,7 @@
                            bool expect_eq);
 
 typedef bool        (*unitest_fn_t)(void* context);
-typedef mx_status_t (*unitest_testcase_init_fn_t)(void** context);
+typedef zx_status_t (*unitest_testcase_init_fn_t)(void** context);
 typedef void        (*unitest_testcase_cleanup_fn_t)(void* context);
 
 typedef struct unitest_registration {
diff --git a/kernel/lib/unittest/unittest.c b/kernel/lib/unittest/unittest.c
index 32edb1c..bf23667 100644
--- a/kernel/lib/unittest/unittest.c
+++ b/kernel/lib/unittest/unittest.c
@@ -12,7 +12,7 @@
 #include <debug.h>
 #include <err.h>
 #include <inttypes.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <platform.h>
 #include <stdbool.h>
 #include <stddef.h>
@@ -141,8 +141,8 @@
                     testcase->test_cnt == 1 ? "" : "s");
 
     void* context = NULL;
-    mx_status_t init_res = testcase->init ? testcase->init(&context) : MX_OK;
-    if (init_res != MX_OK) {
+    zx_status_t init_res = testcase->init ? testcase->init(&context) : ZX_OK;
+    if (init_res != ZX_OK) {
         printf("%s : FAILED to initialize testcase! (status %d)", testcase->name, init_res);
         return false;
     }
diff --git a/kernel/lib/user_copy/include/lib/user_copy/user_ptr.h b/kernel/lib/user_copy/include/lib/user_copy/user_ptr.h
index e7138d1..7c4ea0e 100644
--- a/kernel/lib/user_copy/include/lib/user_copy/user_ptr.h
+++ b/kernel/lib/user_copy/include/lib/user_copy/user_ptr.h
@@ -7,7 +7,7 @@
 #include <arch/user_copy.h>
 #include <kernel/vm.h>
 #include <lib/user_copy/internal.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/type_support.h>
 
 // user_ptr<> wraps a pointer to user memory, to differentiate it from kernel
@@ -41,7 +41,7 @@
     // Copies a single T to user memory. (Using this will fail to compile if T is |void|.)
     // Note: The templatization is simply to allow the class to compile if T is |void|.
     template <typename S = T>
-    mx_status_t copy_to_user(const S& src) const {
+    zx_status_t copy_to_user(const S& src) const {
         static_assert(fbl::is_same<S, T>::value, "Do not use the template parameter.");
         return arch_copy_to_user(ptr_, &src, sizeof(S));
     }
@@ -49,19 +49,19 @@
     // Copies an array of T to user memory. Note: This takes a count not a size, unless T is |void|.
     // WARNING: This does not check that |count| is reasonable (i.e., that multiplication won't
     // overflow).
-    mx_status_t copy_array_to_user(const T* src, size_t count) const {
+    zx_status_t copy_array_to_user(const T* src, size_t count) const {
         return arch_copy_to_user(ptr_, src, count * internal::type_size<T>());
     }
 
     // Copies an array of T to user memory. Note: This takes a count not a size, unless T is |void|.
     // WARNING: This does not check that |count| is reasonable (i.e., that multiplication won't
     // overflow).
-    mx_status_t copy_array_to_user(const T* src, size_t count, size_t offset) const {
+    zx_status_t copy_array_to_user(const T* src, size_t count, size_t offset) const {
         return arch_copy_to_user(ptr_ + offset, src, count * internal::type_size<T>());
     }
 
     // Copies a single T from user memory. (Using this will fail to compile if T is |void|.)
-    mx_status_t copy_from_user(typename fbl::remove_const<T>::type* dst) const {
+    zx_status_t copy_from_user(typename fbl::remove_const<T>::type* dst) const {
         // Intentionally use sizeof(T) here, so *using* this method won't compile if T is |void|.
         return arch_copy_from_user(dst, ptr_, sizeof(T));
     }
@@ -70,7 +70,7 @@
     // |void|.
     // WARNING: This does not check that |count| is reasonable (i.e., that multiplication won't
     // overflow).
-    mx_status_t copy_array_from_user(typename fbl::remove_const<T>::type* dst, size_t count) const {
+    zx_status_t copy_array_from_user(typename fbl::remove_const<T>::type* dst, size_t count) const {
         return arch_copy_from_user(dst, ptr_, count * internal::type_size<T>());
     }
 
@@ -78,7 +78,7 @@
     // |void|.
     // WARNING: This does not check that |count| is reasonable (i.e., that multiplication won't
     // overflow).
-    mx_status_t copy_array_from_user(typename fbl::remove_const<T>::type* dst, size_t count, size_t offset) const {
+    zx_status_t copy_array_from_user(typename fbl::remove_const<T>::type* dst, size_t count, size_t offset) const {
         return arch_copy_from_user(dst, ptr_ + offset, count * internal::type_size<T>());
     }
 
diff --git a/kernel/lib/userboot/userboot.cpp b/kernel/lib/userboot/userboot.cpp
index e95f68b..fb67dce 100644
--- a/kernel/lib/userboot/userboot.cpp
+++ b/kernel/lib/userboot/userboot.cpp
@@ -30,14 +30,14 @@
 #include <object/vm_address_region_dispatcher.h>
 #include <object/vm_object_dispatcher.h>
 
-#include <magenta/processargs.h>
-#include <magenta/stack.h>
+#include <zircon/processargs.h>
+#include <zircon/stack.h>
 
 #if ENABLE_ENTROPY_COLLECTOR_TEST
 #include <lib/crypto/entropy/quality_test.h>
 #endif
 
-static const size_t stack_size = MAGENTA_DEFAULT_STACK_SIZE;
+static const size_t stack_size = ZIRCON_DEFAULT_STACK_SIZE;
 
 #define STACK_VMO_NAME "userboot-initial-stack"
 #define RAMDISK_VMO_NAME "userboot-raw-ramdisk"
@@ -69,23 +69,23 @@
         return RoDso::size() + vdso_->size();
     }
 
-    mx_status_t Map(fbl::RefPtr<VmAddressRegionDispatcher> root_vmar,
+    zx_status_t Map(fbl::RefPtr<VmAddressRegionDispatcher> root_vmar,
                     uintptr_t* vdso_base, uintptr_t* entry) {
         // Create a VMAR (placed anywhere) to hold the combined image.
         fbl::RefPtr<VmAddressRegionDispatcher> vmar;
-        mx_rights_t vmar_rights;
-        mx_status_t status = root_vmar->Allocate(0, size(),
-                                                 MX_VM_FLAG_CAN_MAP_READ |
-                                                 MX_VM_FLAG_CAN_MAP_WRITE |
-                                                 MX_VM_FLAG_CAN_MAP_EXECUTE |
-                                                 MX_VM_FLAG_CAN_MAP_SPECIFIC,
+        zx_rights_t vmar_rights;
+        zx_status_t status = root_vmar->Allocate(0, size(),
+                                                 ZX_VM_FLAG_CAN_MAP_READ |
+                                                 ZX_VM_FLAG_CAN_MAP_WRITE |
+                                                 ZX_VM_FLAG_CAN_MAP_EXECUTE |
+                                                 ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                                  &vmar, &vmar_rights);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
 
         // Map userboot proper.
         status = RoDso::Map(vmar, 0);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             *entry = vmar->vmar()->base() + USERBOOT_ENTRY;
 
             // Map the vDSO right after it.
@@ -103,74 +103,74 @@
 
 
 // Get a handle to a VM object, with full rights except perhaps for writing.
-static mx_status_t get_vmo_handle(fbl::RefPtr<VmObject> vmo, bool readonly,
+static zx_status_t get_vmo_handle(fbl::RefPtr<VmObject> vmo, bool readonly,
                                   fbl::RefPtr<VmObjectDispatcher>* disp_ptr,
                                   Handle** ptr) {
     if (!vmo)
-        return MX_ERR_NO_MEMORY;
-    mx_rights_t rights;
+        return ZX_ERR_NO_MEMORY;
+    zx_rights_t rights;
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_status_t result = VmObjectDispatcher::Create(
+    zx_status_t result = VmObjectDispatcher::Create(
         fbl::move(vmo), &dispatcher, &rights);
-    if (result == MX_OK) {
+    if (result == ZX_OK) {
         if (disp_ptr)
             *disp_ptr = fbl::RefPtr<VmObjectDispatcher>::Downcast(dispatcher);
         if (readonly)
-            rights &= ~MX_RIGHT_WRITE;
+            rights &= ~ZX_RIGHT_WRITE;
         if (ptr)
             *ptr = MakeHandle(fbl::move(dispatcher), rights);
     }
     return result;
 }
 
-static mx_status_t get_job_handle(Handle** ptr) {
-    mx_rights_t rights;
+static zx_status_t get_job_handle(Handle** ptr) {
+    zx_rights_t rights;
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_status_t result = JobDispatcher::Create(
+    zx_status_t result = JobDispatcher::Create(
         0u, GetRootJobDispatcher(), &dispatcher, &rights);
-    if (result == MX_OK)
+    if (result == ZX_OK)
         *ptr = MakeHandle(fbl::move(dispatcher), rights);
     return result;
 }
 
-static mx_status_t get_resource_handle(Handle** ptr) {
-    mx_rights_t rights;
+static zx_status_t get_resource_handle(Handle** ptr) {
+    zx_rights_t rights;
     fbl::RefPtr<ResourceDispatcher> root;
-    mx_status_t result = ResourceDispatcher::Create(&root, &rights, MX_RSRC_KIND_ROOT, 0, 0);
-    if (result == MX_OK)
+    zx_status_t result = ResourceDispatcher::Create(&root, &rights, ZX_RSRC_KIND_ROOT, 0, 0);
+    if (result == ZX_OK)
         *ptr = MakeHandle(fbl::RefPtr<Dispatcher>(root.get()), rights);
     return result;
 }
 
 // Create a channel and write the bootstrap message down one side of
 // it, returning the handle to the other side.
-static mx_status_t make_bootstrap_channel(
+static zx_status_t make_bootstrap_channel(
     fbl::RefPtr<ProcessDispatcher> process,
     fbl::unique_ptr<MessagePacket> msg,
-    mx_handle_t* out) {
+    zx_handle_t* out) {
     HandleOwner user_channel_handle;
     fbl::RefPtr<ChannelDispatcher> kernel_channel;
-    *out = MX_HANDLE_INVALID;
+    *out = ZX_HANDLE_INVALID;
     {
         fbl::RefPtr<Dispatcher> mpd0, mpd1;
-        mx_rights_t rights;
-        mx_status_t status = ChannelDispatcher::Create(&mpd0, &mpd1, &rights);
-        if (status != MX_OK)
+        zx_rights_t rights;
+        zx_status_t status = ChannelDispatcher::Create(&mpd0, &mpd1, &rights);
+        if (status != ZX_OK)
             return status;
         user_channel_handle.reset(MakeHandle(fbl::move(mpd0), rights));
         kernel_channel = DownCastDispatcher<ChannelDispatcher>(&mpd1);
     }
 
     // Here it goes!
-    mx_status_t status = kernel_channel->Write(fbl::move(msg));
-    if (status != MX_OK)
+    zx_status_t status = kernel_channel->Write(fbl::move(msg));
+    if (status != ZX_OK)
         return status;
 
-    mx_handle_t hv = process->MapHandleToValue(user_channel_handle);
+    zx_handle_t hv = process->MapHandleToValue(user_channel_handle);
     process->AddHandle(fbl::move(user_channel_handle));
 
     *out = hv;
-    return MX_OK;
+    return ZX_OK;
 }
 
 enum bootstrap_handle_index {
@@ -191,7 +191,7 @@
 };
 
 struct bootstrap_message {
-    mx_proc_args_t header;
+    zx_proc_args_t header;
     uint32_t handle_info[BOOTSTRAP_HANDLES];
     char cmdline[CMDLINE_MAX];
 };
@@ -207,8 +207,8 @@
     }
 
     memset(&msg->header, 0, sizeof(msg->header));
-    msg->header.protocol = MX_PROCARGS_PROTOCOL;
-    msg->header.version = MX_PROCARGS_VERSION;
+    msg->header.protocol = ZX_PROCARGS_PROTOCOL;
+    msg->header.version = ZX_PROCARGS_VERSION;
     msg->header.environ_off = offsetof(struct bootstrap_message, cmdline);
     msg->header.environ_num = __kernel_cmdline_count;
     msg->header.handle_info_off =
@@ -257,10 +257,10 @@
 
     fbl::unique_ptr<MessagePacket> packet;
     uint32_t num_handles = BOOTSTRAP_HANDLES;
-    mx_status_t status =
+    zx_status_t status =
         MessagePacket::Create(msg, data_size, num_handles, &packet);
     free(msg);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return nullptr;
     }
     return packet;
@@ -272,28 +272,28 @@
     vmo->Write(data, off, len, &actual);
 }
 
-static mx_status_t attempt_userboot() {
+static zx_status_t attempt_userboot() {
     size_t rsize;
     void* rbase = platform_get_ramdisk(&rsize);
     if (rbase)
         dprintf(INFO, "userboot: ramdisk %#15zx @ %p\n", rsize, rbase);
 
     fbl::RefPtr<VmObject> stack_vmo;
-    mx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, stack_size, &stack_vmo);
-    if (status != MX_OK)
+    zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, stack_size, &stack_vmo);
+    if (status != ZX_OK)
         return status;
     stack_vmo->set_name(STACK_VMO_NAME, sizeof(STACK_VMO_NAME) - 1);
 
     fbl::RefPtr<VmObject> rootfs_vmo;
     status = VmObjectPaged::CreateFromROData(rbase, rsize, &rootfs_vmo);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     rootfs_vmo->set_name(RAMDISK_VMO_NAME, sizeof(RAMDISK_VMO_NAME) - 1);
 
     size_t size = platform_recover_crashlog(0, NULL, NULL);
     fbl::RefPtr<VmObject> crashlog_vmo;
     status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, size, &crashlog_vmo);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     platform_recover_crashlog(size, crashlog_vmo.get(), clog_to_vmo);
     crashlog_vmo->set_name(CRASHLOG_VMO_NAME, sizeof(CRASHLOG_VMO_NAME) - 1);
@@ -303,29 +303,29 @@
     // We'll fill in the handles as we create things.
     fbl::unique_ptr<MessagePacket> msg = prepare_bootstrap_message();
     if (!msg)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     Handle** const handles = msg->mutable_handles();
     DEBUG_ASSERT(msg->num_handles() == BOOTSTRAP_HANDLES);
     status = get_vmo_handle(rootfs_vmo, false, nullptr,
                             &handles[BOOTSTRAP_RAMDISK]);
     fbl::RefPtr<VmObjectDispatcher> stack_vmo_dispatcher;
-    if (status == MX_OK)
+    if (status == ZX_OK)
         status = get_vmo_handle(stack_vmo, false, &stack_vmo_dispatcher,
                                 &handles[BOOTSTRAP_STACK]);
-    if (status == MX_OK)
+    if (status == ZX_OK)
         status = get_vmo_handle(crashlog_vmo, false, nullptr,
                                 &handles[BOOTSTRAP_CRASHLOG]);
-    if (status == MX_OK)
+    if (status == ZX_OK)
         status = get_resource_handle(&handles[BOOTSTRAP_RESOURCE_ROOT]);
 
-    if (status == MX_OK)
+    if (status == ZX_OK)
         status = get_job_handle(&handles[BOOTSTRAP_JOB]);
 
 #if ENABLE_ENTROPY_COLLECTOR_TEST
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         if (crypto::entropy::entropy_was_lost) {
-            status = MX_ERR_INTERNAL;
+            status = ZX_ERR_INTERNAL;
         } else {
             status = get_vmo_handle(
                     crypto::entropy::entropy_vmo,
@@ -334,12 +334,12 @@
         }
     }
 #endif
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     fbl::RefPtr<Dispatcher> proc_disp;
     fbl::RefPtr<VmAddressRegionDispatcher> vmar;
-    mx_rights_t rights, vmar_rights;
+    zx_rights_t rights, vmar_rights;
     status = ProcessDispatcher::Create(GetRootJobDispatcher(), "userboot", 0,
                                        &proc_disp, &rights,
                                        &vmar, &vmar_rights);
@@ -364,16 +364,16 @@
     uintptr_t vdso_base = 0;
     uintptr_t entry = 0;
     status = userboot.Map(vmar, &vdso_base, &entry);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Map the stack anywhere.
     fbl::RefPtr<VmMapping> stack_mapping;
     status = vmar->Map(0,
                        fbl::move(stack_vmo), 0, stack_size,
-                       MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+                       ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                        &stack_mapping);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     uintptr_t stack_base = stack_mapping->base();
@@ -394,9 +394,9 @@
     DEBUG_ASSERT(thread);
 
     // All the handles are in place, so we can send the bootstrap message.
-    mx_handle_t hv;
+    zx_handle_t hv;
     status = make_bootstrap_channel(proc, fbl::move(msg), &hv);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     dprintf(SPEW, "userboot: %-23s @ %#" PRIxPTR "\n", "entry point", entry);
@@ -404,12 +404,12 @@
     // Start the process's initial thread.
     status = thread->Start(entry, sp, hv, vdso_base,
                            /* initial_thread= */ true);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("userboot: failed to start initial thread: %d\n", status);
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void userboot_init(uint level) {
diff --git a/kernel/lib/vdso/include/lib/rodso.h b/kernel/lib/vdso/include/lib/rodso.h
index b71bfeb..88f4ea5 100644
--- a/kernel/lib/vdso/include/lib/rodso.h
+++ b/kernel/lib/vdso/include/lib/rodso.h
@@ -23,7 +23,7 @@
         return vmo_offset == code_start_ && size == size_ - code_start_;
     }
 
-    mx_status_t Map(fbl::RefPtr<VmAddressRegionDispatcher> vmar,
+    zx_status_t Map(fbl::RefPtr<VmAddressRegionDispatcher> vmar,
                     size_t offset) const;
 
 protected:
@@ -31,11 +31,11 @@
     RoDso(const char* name, const void* image, size_t size,
           uintptr_t code_start);
 
-    mx_rights_t vmo_rights() const { return vmo_rights_; }
+    zx_rights_t vmo_rights() const { return vmo_rights_; }
 
 private:
 
-    mx_status_t MapSegment(fbl::RefPtr<VmAddressRegionDispatcher> vmar,
+    zx_status_t MapSegment(fbl::RefPtr<VmAddressRegionDispatcher> vmar,
                            bool code,
                            size_t vmar_offset,
                            size_t start_offset,
@@ -43,7 +43,7 @@
 
     const char* name_;
     fbl::RefPtr<VmObjectDispatcher> vmo_;
-    mx_rights_t vmo_rights_;
+    zx_rights_t vmo_rights_;
     uintptr_t code_start_;
     size_t size_;
 };
diff --git a/kernel/lib/vdso/include/lib/vdso-constants.h b/kernel/lib/vdso/include/lib/vdso-constants.h
index e944113..ad8180a 100644
--- a/kernel/lib/vdso/include/lib/vdso-constants.h
+++ b/kernel/lib/vdso/include/lib/vdso-constants.h
@@ -34,7 +34,7 @@
     // Number of bytes in an instruction cache line.
     uint32_t icache_line_size;
 
-    // Conversion factor for mx_ticks_get return values to seconds.
+    // Conversion factor for zx_ticks_get return values to seconds.
     uint64_t ticks_per_second;
 
     // Total amount of physical memory in the system, in bytes.
diff --git a/kernel/lib/vdso/rodso.cpp b/kernel/lib/vdso/rodso.cpp
index a0c46e1..654e716 100644
--- a/kernel/lib/vdso/rodso.cpp
+++ b/kernel/lib/vdso/rodso.cpp
@@ -25,18 +25,18 @@
     fbl::RefPtr<Dispatcher> dispatcher;
 
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::CreateFromROData(image, size, &vmo);
-    ASSERT(status == MX_OK);
+    zx_status_t status = VmObjectPaged::CreateFromROData(image, size, &vmo);
+    ASSERT(status == ZX_OK);
 
     status = VmObjectDispatcher::Create(
         fbl::move(vmo),
         &dispatcher, &vmo_rights_);
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
 
     status = dispatcher->set_name(name, strlen(name));
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
     vmo_ = DownCastDispatcher<VmObjectDispatcher>(&dispatcher);
-    vmo_rights_ &= ~MX_RIGHT_WRITE;
+    vmo_rights_ &= ~ZX_RIGHT_WRITE;
 }
 
 HandleOwner RoDso::vmo_handle() const {
@@ -44,24 +44,24 @@
 }
 
 // Map one segment from our VM object.
-mx_status_t RoDso::MapSegment(fbl::RefPtr<VmAddressRegionDispatcher> vmar,
+zx_status_t RoDso::MapSegment(fbl::RefPtr<VmAddressRegionDispatcher> vmar,
                               bool code,
                               size_t vmar_offset,
                               size_t start_offset,
                               size_t end_offset) const {
 
-    uint32_t flags = MX_VM_FLAG_SPECIFIC | MX_VM_FLAG_PERM_READ;
+    uint32_t flags = ZX_VM_FLAG_SPECIFIC | ZX_VM_FLAG_PERM_READ;
     if (code)
-        flags |= MX_VM_FLAG_PERM_EXECUTE;
+        flags |= ZX_VM_FLAG_PERM_EXECUTE;
 
     size_t len = end_offset - start_offset;
 
     fbl::RefPtr<VmMapping> mapping;
-    mx_status_t status = vmar->Map(vmar_offset, vmo_->vmo(),
+    zx_status_t status = vmar->Map(vmar_offset, vmo_->vmo(),
                                    start_offset, len, flags, &mapping);
 
     const char* segment_name = code ? "code" : "rodata";
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(CRITICAL,
                 "userboot: %s %s mapping %#zx @ %#" PRIxPTR
                 " size %#zx failed %d\n",
@@ -77,10 +77,10 @@
     return status;
 }
 
-mx_status_t RoDso::Map(fbl::RefPtr<VmAddressRegionDispatcher> vmar,
+zx_status_t RoDso::Map(fbl::RefPtr<VmAddressRegionDispatcher> vmar,
                        size_t offset) const {
-    mx_status_t status = MapSegment(vmar, false, offset, 0, code_start_);
-    if (status == MX_OK)
+    zx_status_t status = MapSegment(vmar, false, offset, 0, code_start_);
+    if (status == ZX_OK)
         status = MapSegment(fbl::move(vmar), true,
                             offset + code_start_, code_start_, size_);
     return status;
diff --git a/kernel/lib/vdso/rules.mk b/kernel/lib/vdso/rules.mk
index 7b52797..7b687da 100644
--- a/kernel/lib/vdso/rules.mk
+++ b/kernel/lib/vdso/rules.mk
@@ -16,7 +16,7 @@
 MODULE_DEPS := \
     kernel/lib/fbl \
 
-vdso-filename := $(BUILDDIR)/system/ulib/magenta/libmagenta.so
+vdso-filename := $(BUILDDIR)/system/ulib/zircon/libzircon.so
 
 # vdso-image.S embeds this file, so building depends on it.
 MODULE_SRCDEPS += $(vdso-filename).strip
diff --git a/kernel/lib/vdso/vdso.cpp b/kernel/lib/vdso/vdso.cpp
index 870a3b0..852d34c 100644
--- a/kernel/lib/vdso/vdso.cpp
+++ b/kernel/lib/vdso/vdso.cpp
@@ -43,17 +43,17 @@
 
         const size_t size = offset_in_page + sizeof(T);
         const uint arch_mmu_flags = ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE;
-        mx_status_t status = VmAspace::kernel_aspace()->RootVmar()->CreateVmMapping(
+        zx_status_t status = VmAspace::kernel_aspace()->RootVmar()->CreateVmMapping(
                 0 /* ignored */, size, 0 /* align pow2 */, 0 /* vmar flags */,
                 fbl::move(vmo), page_offset, arch_mmu_flags, name, &mapping_);
-        ASSERT(status == MX_OK);
+        ASSERT(status == ZX_OK);
         data_ = reinterpret_cast<T*>(mapping_->base() + offset_in_page);
     }
 
     ~KernelVmoWindow() {
         if (mapping_) {
-            mx_status_t status = mapping_->Destroy();
-            ASSERT(status == MX_OK);
+            zx_status_t status = mapping_->Destroy();
+            ASSERT(status == ZX_OK);
         }
     }
 
@@ -165,7 +165,7 @@
         dynsym_window.set_symbol(_ ## symbol, target);          \
     } while (0)
 
-// Blacklist the named mx_* function.  The symbol table entry will
+// Blacklist the named zx_* function.  The symbol table entry will
 // become invisible to runtime symbol resolution, and the code of
 // the function will be clobbered with trapping instructions.
 #define BLACKLIST_SYSCALL(dynsym_window, code_window, symbol)           \
@@ -190,10 +190,10 @@
 void blacklist_##category##_syscalls(VDsoDynSymWindow& dynsym_window, \
                                      VDsoCodeWindow& code_window) {
 #define SYSCALL_IN_CATEGORY(syscall) \
-    BLACKLIST_SYSCALL(dynsym_window, code_window, mx_##syscall);
+    BLACKLIST_SYSCALL(dynsym_window, code_window, zx_##syscall);
 #define SYSCALL_CATEGORY_END(category) \
 }
-#include <magenta/syscall-category.inc>
+#include <zircon/syscall-category.inc>
 #undef SYSCALL_CATEGORY_BEGIN
 #undef SYSCALL_IN_CATEGORY_END
 #undef SYSCALL_CATEGORY_END
@@ -236,12 +236,12 @@
     // If ticks_per_second has not been calibrated, it will return 0. In this
     // case, use soft_ticks instead.
     if (per_second == 0 || cmdline_get_bool("vdso.soft_ticks", false)) {
-        // Make mx_ticks_per_second return nanoseconds per second.
-        constants_window.data()->ticks_per_second = MX_SEC(1);
+        // Make zx_ticks_per_second return nanoseconds per second.
+        constants_window.data()->ticks_per_second = ZX_SEC(1);
 
-        // Adjust the mx_ticks_get entry point to be soft_ticks_get.
+        // Adjust the zx_ticks_get entry point to be soft_ticks_get.
         VDsoDynSymWindow dynsym_window(vdso->vmo()->vmo());
-        REDIRECT_SYSCALL(dynsym_window, mx_ticks_get, soft_ticks_get);
+        REDIRECT_SYSCALL(dynsym_window, zx_ticks_get, soft_ticks_get);
     }
 
     for (size_t v = static_cast<size_t>(Variant::FULL) + 1;
@@ -263,7 +263,7 @@
     if (variant == Variant::FULL)
         return RoDso::vmo_handle();
 
-    DEBUG_ASSERT(!(vmo_rights() & MX_RIGHT_WRITE));
+    DEBUG_ASSERT(!(vmo_rights() & ZX_RIGHT_WRITE));
     return HandleOwner(MakeHandle(variant_vmo_[variant_index(variant)],
                                   vmo_rights()));
 }
@@ -285,9 +285,9 @@
     DEBUG_ASSERT(!variant_vmo_[variant_index(variant)]);
 
     fbl::RefPtr<VmObject> new_vmo;
-    mx_status_t status = vmo()->Clone(MX_VMO_CLONE_COPY_ON_WRITE, 0, size(),
+    zx_status_t status = vmo()->Clone(ZX_VMO_CLONE_COPY_ON_WRITE, 0, size(),
                                       false, &new_vmo);
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
 
     VDsoDynSymWindow dynsym_window(new_vmo);
     VDsoCodeWindow code_window(new_vmo);
@@ -311,13 +311,13 @@
     }
 
     fbl::RefPtr<Dispatcher> dispatcher;
-    mx_rights_t rights;
+    zx_rights_t rights;
     status = VmObjectDispatcher::Create(fbl::move(new_vmo),
                                         &dispatcher, &rights);
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
 
     status = dispatcher->set_name(name, strlen(name));
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
 
     variant_vmo_[variant_index(variant)] =
         DownCastDispatcher<VmObjectDispatcher>(&dispatcher);
diff --git a/kernel/lib/version/include/lib/version.h b/kernel/lib/version/include/lib/version.h
index 1295b33..2cd1e04 100644
--- a/kernel/lib/version/include/lib/version.h
+++ b/kernel/lib/version/include/lib/version.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/kernel/lib/watchdog/include/lib/watchdog.h b/kernel/lib/watchdog/include/lib/watchdog.h
index 60b5dd5..eb726c6 100644
--- a/kernel/lib/watchdog/include/lib/watchdog.h
+++ b/kernel/lib/watchdog/include/lib/watchdog.h
@@ -11,7 +11,7 @@
 #include <stdint.h>
 #include <kernel/thread.h>
 #include <kernel/timer.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #define WATCHDOG_MAGIC 'wdog'
 
@@ -33,7 +33,7 @@
  */
 void watchdog_handler(watchdog_t *dog) __NO_RETURN;
 
-mx_status_t watchdog_init(watchdog_t *dog, lk_time_t timeout, const char *name);
+zx_status_t watchdog_init(watchdog_t *dog, lk_time_t timeout, const char *name);
 void        watchdog_set_enabled(watchdog_t *dog, bool enabled);
 void        watchdog_pet(watchdog_t *dog);
 
@@ -58,10 +58,10 @@
  * something managed to break timers on LK.
  */
 
-extern mx_status_t platform_watchdog_init(lk_time_t  target_timeout,
+extern zx_status_t platform_watchdog_init(lk_time_t  target_timeout,
                                           lk_time_t *recommended_pet_period);
 extern void platform_watchdog_set_enabled(bool enabled);
 extern void platform_watchdog_pet(void);
 
-mx_status_t watchdog_hw_init(lk_time_t timeout);
+zx_status_t watchdog_hw_init(lk_time_t timeout);
 void watchdog_hw_set_enabled(bool enabled);
diff --git a/kernel/lib/watchdog/watchdog.c b/kernel/lib/watchdog/watchdog.c
index 4529ebf..6cd1532 100644
--- a/kernel/lib/watchdog/watchdog.c
+++ b/kernel/lib/watchdog/watchdog.c
@@ -10,7 +10,7 @@
 #include <assert.h>
 #include <err.h>
 #include <inttypes.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <platform.h>
 
 #include <kernel/thread.h>
@@ -38,7 +38,7 @@
     return INT_NO_RESCHEDULE;
 }
 
-mx_status_t watchdog_init(watchdog_t *dog, lk_time_t timeout, const char *name)
+zx_status_t watchdog_init(watchdog_t *dog, lk_time_t timeout, const char *name)
 {
     DEBUG_ASSERT(NULL != dog);
     DEBUG_ASSERT(INFINITE_TIME != timeout);
@@ -49,7 +49,7 @@
     dog->timeout = timeout;
     timer_init(&dog->expire_timer);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void watchdog_set_enabled(watchdog_t *dog, bool enabled)
@@ -102,7 +102,7 @@
     return INT_NO_RESCHEDULE;
 }
 
-mx_status_t watchdog_hw_init(lk_time_t timeout)
+zx_status_t watchdog_hw_init(lk_time_t timeout)
 {
     DEBUG_ASSERT(INFINITE_TIME != timeout);
     timer_init(&hw_watchdog_timer);
diff --git a/kernel/lib/mxcpp/rules.mk b/kernel/lib/zxcpp/rules.mk
similarity index 92%
rename from kernel/lib/mxcpp/rules.mk
rename to kernel/lib/zxcpp/rules.mk
index 552a755..2537bb6 100644
--- a/kernel/lib/mxcpp/rules.mk
+++ b/kernel/lib/zxcpp/rules.mk
@@ -4,7 +4,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-SRC_DIR := system/ulib/mxcpp
+SRC_DIR := system/ulib/zxcpp
 LOCAL_DIR := $(GET_LOCAL_DIR)
 
 MODULE := $(LOCAL_DIR)
diff --git a/kernel/object/channel_dispatcher.cpp b/kernel/object/channel_dispatcher.cpp
index 539788b..5d4ec58 100644
--- a/kernel/object/channel_dispatcher.cpp
+++ b/kernel/object/channel_dispatcher.cpp
@@ -19,7 +19,7 @@
 #include <object/process_dispatcher.h>
 #include <object/thread_dispatcher.h>
 
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 #include <fbl/type_support.h>
@@ -29,29 +29,29 @@
 #define LOCAL_TRACE 0
 
 // static
-mx_status_t ChannelDispatcher::Create(fbl::RefPtr<Dispatcher>* dispatcher0,
+zx_status_t ChannelDispatcher::Create(fbl::RefPtr<Dispatcher>* dispatcher0,
                                       fbl::RefPtr<Dispatcher>* dispatcher1,
-                                      mx_rights_t* rights) {
+                                      zx_rights_t* rights) {
     fbl::AllocChecker ac;
     auto ch0 = fbl::AdoptRef(new (&ac) ChannelDispatcher());
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto ch1 = fbl::AdoptRef(new (&ac) ChannelDispatcher());
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     ch0->Init(ch1);
     ch1->Init(ch0);
 
-    *rights = MX_DEFAULT_CHANNEL_RIGHTS;
+    *rights = ZX_DEFAULT_CHANNEL_RIGHTS;
     *dispatcher0 = fbl::move(ch0);
     *dispatcher1 = fbl::move(ch1);
-    return MX_OK;
+    return ZX_OK;
 }
 
 ChannelDispatcher::ChannelDispatcher()
-    : state_tracker_(MX_CHANNEL_WRITABLE) {
+    : state_tracker_(ZX_CHANNEL_WRITABLE) {
 }
 
 // This is called before either ChannelDispatcher is accessible from threads other than the one
@@ -71,14 +71,14 @@
     messages_.clear();
 }
 
-mx_status_t ChannelDispatcher::add_observer(StateObserver* observer) {
+zx_status_t ChannelDispatcher::add_observer(StateObserver* observer) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
     StateObserver::CountInfo cinfo =
-        {{{messages_.size_slow(), MX_CHANNEL_READABLE}, {0u, 0u}}};
+        {{{messages_.size_slow(), ZX_CHANNEL_READABLE}, {0u, 0u}}};
     state_tracker_.AddObserver(observer, &cinfo);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void ChannelDispatcher::RemoveWaiter(MessageWaiter* waiter) {
@@ -104,7 +104,7 @@
         // Remove waiter from list.
         while (!waiters_.is_empty()) {
             auto waiter = waiters_.pop_front();
-            waiter->Cancel(MX_ERR_CANCELED);
+            waiter->Cancel(ZX_ERR_CANCELED);
         }
     }
 
@@ -118,18 +118,18 @@
 
     AutoLock lock(&lock_);
     other_.reset();
-    state_tracker_.UpdateState(MX_CHANNEL_WRITABLE, MX_CHANNEL_PEER_CLOSED);
+    state_tracker_.UpdateState(ZX_CHANNEL_WRITABLE, ZX_CHANNEL_PEER_CLOSED);
     // (3B) Abort any waiting Call operations
     // because we've been canceled by reason
     // of the opposing endpoint going away.
     // Remove waiter from list.
     while (!waiters_.is_empty()) {
         auto waiter = waiters_.pop_front();
-        waiter->Cancel(MX_ERR_PEER_CLOSED);
+        waiter->Cancel(ZX_ERR_PEER_CLOSED);
     }
 }
 
-mx_status_t ChannelDispatcher::Read(uint32_t* msg_size,
+zx_status_t ChannelDispatcher::Read(uint32_t* msg_size,
                                     uint32_t* msg_handle_count,
                                     fbl::unique_ptr<MessagePacket>* msg,
                                     bool may_discard) {
@@ -141,26 +141,26 @@
     AutoLock lock(&lock_);
 
     if (messages_.is_empty())
-        return other_ ? MX_ERR_SHOULD_WAIT : MX_ERR_PEER_CLOSED;
+        return other_ ? ZX_ERR_SHOULD_WAIT : ZX_ERR_PEER_CLOSED;
 
     *msg_size = messages_.front().data_size();
     *msg_handle_count = messages_.front().num_handles();
-    mx_status_t rv = MX_OK;
+    zx_status_t rv = ZX_OK;
     if (*msg_size > max_size || *msg_handle_count > max_handle_count) {
         if (!may_discard)
-            return MX_ERR_BUFFER_TOO_SMALL;
-        rv = MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
+        rv = ZX_ERR_BUFFER_TOO_SMALL;
     }
 
     *msg = messages_.pop_front();
 
     if (messages_.is_empty())
-        state_tracker_.UpdateState(MX_CHANNEL_READABLE, 0u);
+        state_tracker_.UpdateState(ZX_CHANNEL_READABLE, 0u);
 
     return rv;
 }
 
-mx_status_t ChannelDispatcher::Write(fbl::unique_ptr<MessagePacket> msg) {
+zx_status_t ChannelDispatcher::Write(fbl::unique_ptr<MessagePacket> msg) {
     canary_.Assert();
 
     fbl::RefPtr<ChannelDispatcher> other;
@@ -170,7 +170,7 @@
             // |msg| will be destroyed but we want to keep the handles alive since
             // the caller should put them back into the process table.
             msg->set_owns_handles(false);
-            return MX_ERR_PEER_CLOSED;
+            return ZX_ERR_PEER_CLOSED;
         }
         other = other_;
     }
@@ -178,21 +178,21 @@
     if (other->WriteSelf(fbl::move(msg)) > 0)
         thread_reschedule();
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ChannelDispatcher::Call(fbl::unique_ptr<MessagePacket> msg,
-                                    mx_time_t deadline, bool* return_handles,
+zx_status_t ChannelDispatcher::Call(fbl::unique_ptr<MessagePacket> msg,
+                                    zx_time_t deadline, bool* return_handles,
                                     fbl::unique_ptr<MessagePacket>* reply) {
 
     canary_.Assert();
 
     auto waiter = ThreadDispatcher::GetCurrent()->GetMessageWaiter();
-    if (unlikely(waiter->BeginWait(fbl::WrapRefPtr(this), msg->get_txid()) != MX_OK)) {
+    if (unlikely(waiter->BeginWait(fbl::WrapRefPtr(this), msg->get_txid()) != ZX_OK)) {
         // If a thread tries BeginWait'ing twice, the VDSO contract around retrying
         // channel calls has been violated.  Shoot the misbehaving process.
         ProcessDispatcher::GetCurrent()->Kill();
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     fbl::RefPtr<ChannelDispatcher> other;
@@ -204,7 +204,7 @@
             msg->set_owns_handles(false);
             *return_handles = true;
             waiter->EndWait(reply);
-            return MX_ERR_PEER_CLOSED;
+            return ZX_ERR_PEER_CLOSED;
         }
         other = other_;
 
@@ -221,15 +221,15 @@
     return ResumeInterruptedCall(waiter, deadline, reply);
 }
 
-mx_status_t ChannelDispatcher::ResumeInterruptedCall(MessageWaiter* waiter,
-                                                     mx_time_t deadline,
+zx_status_t ChannelDispatcher::ResumeInterruptedCall(MessageWaiter* waiter,
+                                                     zx_time_t deadline,
                                                      fbl::unique_ptr<MessagePacket>* reply) {
     canary_.Assert();
 
     // (2) Wait for notification via waiter's event or for the
     // deadline to hit.
-    mx_status_t status = waiter->Wait(deadline);
-    if (status == MX_ERR_INTERNAL_INTR_RETRY) {
+    zx_status_t status = waiter->Wait(deadline);
+    if (status == ZX_ERR_INTERNAL_INTR_RETRY) {
         // If we got interrupted, return out to usermode, but
         // do not clear the waiter.
         return status;
@@ -246,10 +246,10 @@
 
         // (4) If any of (3A), (3B), or (3C) have occurred,
         // we were removed from the waiters list already
-        // and EndWait() returns a non-MX_ERR_TIMED_OUT status.
-        // Otherwise, the status is MX_ERR_TIMED_OUT and it
+        // and EndWait() returns a non-ZX_ERR_TIMED_OUT status.
+        // Otherwise, the status is ZX_ERR_TIMED_OUT and it
         // is our job to remove the waiter from the list.
-        if ((status = waiter->EndWait(reply)) == MX_ERR_TIMED_OUT)
+        if ((status = waiter->EndWait(reply)) == ZX_ERR_TIMED_OUT)
             waiters_.erase(*waiter);
     }
 
@@ -265,7 +265,7 @@
         // If the far side is waiting for replies to messages
         // send via "call", see if this message has a matching
         // txid to one of the waiters, and if so, deliver it.
-        mx_txid_t txid = msg->get_txid();
+        zx_txid_t txid = msg->get_txid();
         for (auto& waiter: waiters_) {
             // (3C) Deliver message to waiter.
             // Remove waiter from list.
@@ -278,36 +278,36 @@
     }
     messages_.push_back(fbl::move(msg));
 
-    state_tracker_.UpdateState(0u, MX_CHANNEL_READABLE);
+    state_tracker_.UpdateState(0u, ZX_CHANNEL_READABLE);
     return 0;
 }
 
-mx_status_t ChannelDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
+zx_status_t ChannelDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
     canary_.Assert();
 
-    if ((set_mask & ~MX_USER_SIGNAL_ALL) || (clear_mask & ~MX_USER_SIGNAL_ALL))
-        return MX_ERR_INVALID_ARGS;
+    if ((set_mask & ~ZX_USER_SIGNAL_ALL) || (clear_mask & ~ZX_USER_SIGNAL_ALL))
+        return ZX_ERR_INVALID_ARGS;
 
     if (!peer) {
         state_tracker_.UpdateState(clear_mask, set_mask);
-        return MX_OK;
+        return ZX_OK;
     }
 
     fbl::RefPtr<ChannelDispatcher> other;
     {
         AutoLock lock(&lock_);
         if (!other_)
-            return MX_ERR_PEER_CLOSED;
+            return ZX_ERR_PEER_CLOSED;
         other = other_;
     }
 
     return other->UserSignalSelf(clear_mask, set_mask);
 }
 
-mx_status_t ChannelDispatcher::UserSignalSelf(uint32_t clear_mask, uint32_t set_mask) {
+zx_status_t ChannelDispatcher::UserSignalSelf(uint32_t clear_mask, uint32_t set_mask) {
     canary_.Assert();
     state_tracker_.UpdateState(clear_mask, set_mask);
-    return MX_OK;
+    return ZX_OK;
 }
 
 ChannelDispatcher::MessageWaiter::~MessageWaiter() {
@@ -317,46 +317,46 @@
     DEBUG_ASSERT(!InContainer());
 }
 
-mx_status_t ChannelDispatcher::MessageWaiter::BeginWait(fbl::RefPtr<ChannelDispatcher> channel,
-                                                        mx_txid_t txid) {
+zx_status_t ChannelDispatcher::MessageWaiter::BeginWait(fbl::RefPtr<ChannelDispatcher> channel,
+                                                        zx_txid_t txid) {
     if (unlikely(channel_)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     DEBUG_ASSERT(!InContainer());
 
     txid_ = txid;
-    status_ = MX_ERR_TIMED_OUT;
+    status_ = ZX_ERR_TIMED_OUT;
     channel_ = fbl::move(channel);
     event_.Unsignal();
-    return MX_OK;
+    return ZX_OK;
 }
 
 int ChannelDispatcher::MessageWaiter::Deliver(fbl::unique_ptr<MessagePacket> msg) {
     DEBUG_ASSERT(channel_);
 
     msg_ = fbl::move(msg);
-    status_ = MX_OK;
-    return event_.Signal(MX_OK);
+    status_ = ZX_OK;
+    return event_.Signal(ZX_OK);
 }
 
-int ChannelDispatcher::MessageWaiter::Cancel(mx_status_t status) {
+int ChannelDispatcher::MessageWaiter::Cancel(zx_status_t status) {
     DEBUG_ASSERT(!InContainer());
     DEBUG_ASSERT(channel_);
     status_ = status;
     return event_.Signal(status);
 }
 
-mx_status_t ChannelDispatcher::MessageWaiter::Wait(lk_time_t deadline) {
+zx_status_t ChannelDispatcher::MessageWaiter::Wait(lk_time_t deadline) {
     if (unlikely(!channel_)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     return event_.Wait(deadline);
 }
 
 // Returns any delivered message via out and the status.
-mx_status_t ChannelDispatcher::MessageWaiter::EndWait(fbl::unique_ptr<MessagePacket>* out) {
+zx_status_t ChannelDispatcher::MessageWaiter::EndWait(fbl::unique_ptr<MessagePacket>* out) {
     if (unlikely(!channel_)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     *out = fbl::move(msg_);
     channel_ = nullptr;
diff --git a/kernel/object/diagnostics.cpp b/kernel/object/diagnostics.cpp
index 6857d5c..85d61d9 100644
--- a/kernel/object/diagnostics.cpp
+++ b/kernel/object/diagnostics.cpp
@@ -57,39 +57,39 @@
     printf("#fi : number of fifos\n");
 }
 
-static const char* ObjectTypeToString(mx_obj_type_t type) {
-    static_assert(MX_OBJ_TYPE_LAST == 23, "need to update switch below");
+static const char* ObjectTypeToString(zx_obj_type_t type) {
+    static_assert(ZX_OBJ_TYPE_LAST == 23, "need to update switch below");
 
     switch (type) {
-        case MX_OBJ_TYPE_PROCESS: return "process";
-        case MX_OBJ_TYPE_THREAD: return "thread";
-        case MX_OBJ_TYPE_VMO: return "vmo";
-        case MX_OBJ_TYPE_CHANNEL: return "channel";
-        case MX_OBJ_TYPE_EVENT: return "event";
-        case MX_OBJ_TYPE_PORT: return "port";
-        case MX_OBJ_TYPE_INTERRUPT: return "interrupt";
-        case MX_OBJ_TYPE_PCI_DEVICE: return "pci-device";
-        case MX_OBJ_TYPE_LOG: return "log";
-        case MX_OBJ_TYPE_SOCKET: return "socket";
-        case MX_OBJ_TYPE_RESOURCE: return "resource";
-        case MX_OBJ_TYPE_EVENT_PAIR: return "event-pair";
-        case MX_OBJ_TYPE_JOB: return "job";
-        case MX_OBJ_TYPE_VMAR: return "vmar";
-        case MX_OBJ_TYPE_FIFO: return "fifo";
-        case MX_OBJ_TYPE_GUEST: return "guest";
-        case MX_OBJ_TYPE_VCPU: return "vcpu";
-        case MX_OBJ_TYPE_TIMER: return "timer";
+        case ZX_OBJ_TYPE_PROCESS: return "process";
+        case ZX_OBJ_TYPE_THREAD: return "thread";
+        case ZX_OBJ_TYPE_VMO: return "vmo";
+        case ZX_OBJ_TYPE_CHANNEL: return "channel";
+        case ZX_OBJ_TYPE_EVENT: return "event";
+        case ZX_OBJ_TYPE_PORT: return "port";
+        case ZX_OBJ_TYPE_INTERRUPT: return "interrupt";
+        case ZX_OBJ_TYPE_PCI_DEVICE: return "pci-device";
+        case ZX_OBJ_TYPE_LOG: return "log";
+        case ZX_OBJ_TYPE_SOCKET: return "socket";
+        case ZX_OBJ_TYPE_RESOURCE: return "resource";
+        case ZX_OBJ_TYPE_EVENT_PAIR: return "event-pair";
+        case ZX_OBJ_TYPE_JOB: return "job";
+        case ZX_OBJ_TYPE_VMAR: return "vmar";
+        case ZX_OBJ_TYPE_FIFO: return "fifo";
+        case ZX_OBJ_TYPE_GUEST: return "guest";
+        case ZX_OBJ_TYPE_VCPU: return "vcpu";
+        case ZX_OBJ_TYPE_TIMER: return "timer";
         default: return "???";
     }
 }
 
 // Returns the count of a process's handles. If |handle_type| is non-NULL,
 // it should point to |size| elements. For each handle, the corresponding
-// mx_obj_type_t-indexed element of |handle_type| is incremented.
+// zx_obj_type_t-indexed element of |handle_type| is incremented.
 static uint32_t BuildHandleStats(const ProcessDispatcher& pd,
                                  uint32_t* handle_type, size_t size) {
     uint32_t total = 0;
-    pd.ForEachHandle([&](mx_handle_t handle, mx_rights_t rights,
+    pd.ForEachHandle([&](zx_handle_t handle, zx_rights_t rights,
                          fbl::RefPtr<const Dispatcher> disp) {
         if (handle_type) {
             uint32_t type = static_cast<uint32_t>(disp->get_type());
@@ -98,7 +98,7 @@
             }
         }
         ++total;
-        return MX_OK;
+        return ZX_OK;
     });
     return total;
 }
@@ -116,22 +116,22 @@
 // buffer as strings.
 static void FormatHandleTypeCount(const ProcessDispatcher& pd,
                                   char *buf, size_t buf_len) {
-    uint32_t types[MX_OBJ_TYPE_LAST] = {0};
+    uint32_t types[ZX_OBJ_TYPE_LAST] = {0};
     uint32_t handle_count = BuildHandleStats(pd, types, sizeof(types));
 
     snprintf(buf, buf_len, "%4u: %3u %3u %3u %3u %3u %3u %3u %3u %3u %3u %3u",
              handle_count,
-             types[MX_OBJ_TYPE_JOB],
-             types[MX_OBJ_TYPE_PROCESS],
-             types[MX_OBJ_TYPE_THREAD],
-             types[MX_OBJ_TYPE_VMO],
-             types[MX_OBJ_TYPE_VMAR],
-             types[MX_OBJ_TYPE_CHANNEL],
-             types[MX_OBJ_TYPE_EVENT] + types[MX_OBJ_TYPE_EVENT_PAIR],
-             types[MX_OBJ_TYPE_PORT],
-             types[MX_OBJ_TYPE_SOCKET],
-             types[MX_OBJ_TYPE_TIMER],
-             types[MX_OBJ_TYPE_FIFO]
+             types[ZX_OBJ_TYPE_JOB],
+             types[ZX_OBJ_TYPE_PROCESS],
+             types[ZX_OBJ_TYPE_THREAD],
+             types[ZX_OBJ_TYPE_VMO],
+             types[ZX_OBJ_TYPE_VMAR],
+             types[ZX_OBJ_TYPE_CHANNEL],
+             types[ZX_OBJ_TYPE_EVENT] + types[ZX_OBJ_TYPE_EVENT_PAIR],
+             types[ZX_OBJ_TYPE_PORT],
+             types[ZX_OBJ_TYPE_SOCKET],
+             types[ZX_OBJ_TYPE_TIMER],
+             types[ZX_OBJ_TYPE_FIFO]
              );
 }
 
@@ -139,10 +139,10 @@
     printf("%7s  #h:  #jb #pr #th #vo #vm #ch #ev #po #so #tm #fi [name]\n", "id");
 
     auto walker = MakeProcessWalker([](ProcessDispatcher* process) {
-        char handle_counts[(MX_OBJ_TYPE_LAST * 4) + 1 + /*slop*/ 16];
+        char handle_counts[(ZX_OBJ_TYPE_LAST * 4) + 1 + /*slop*/ 16];
         FormatHandleTypeCount(*process, handle_counts, sizeof(handle_counts));
 
-        char pname[MX_MAX_NAME_LEN];
+        char pname[ZX_MAX_NAME_LEN];
         process->get_name(pname);
         printf("%7" PRIu64 "%s [%s]\n",
                process->get_koid(),
@@ -156,14 +156,14 @@
     printf("All jobs from least to most important:\n");
     printf("%7s %s\n", "koid", "name");
     JobDispatcher::ForEachJobByImportance([&](JobDispatcher* job) {
-        char name[MX_MAX_NAME_LEN];
+        char name[ZX_MAX_NAME_LEN];
         job->get_name(name);
         printf("%7" PRIu64 " '%s'\n", job->get_koid(), name);
-        return MX_OK;
+        return ZX_OK;
     });
 }
 
-void DumpProcessHandles(mx_koid_t id) {
+void DumpProcessHandles(zx_koid_t id) {
     auto pd = ProcessDispatcher::LookupProcessById(id);
     if (!pd) {
         printf("process %" PRIu64 " not found!\n", id);
@@ -174,19 +174,19 @@
     printf("handle       koid : type\n");
 
     uint32_t total = 0;
-    pd->ForEachHandle([&](mx_handle_t handle, mx_rights_t rights,
+    pd->ForEachHandle([&](zx_handle_t handle, zx_rights_t rights,
                           fbl::RefPtr<const Dispatcher> disp) {
         printf("%9x %7" PRIu64 " : %s\n",
             handle, disp->get_koid(), ObjectTypeToString(disp->get_type()));
         ++total;
-        return MX_OK;
+        return ZX_OK;
     });
     printf("total: %u handles\n", total);
 }
 
 void ktrace_report_live_processes() {
     auto walker = MakeProcessWalker([](ProcessDispatcher* process) {
-        char name[MX_MAX_NAME_LEN];
+        char name[ZX_MAX_NAME_LEN];
         process->get_name(name);
         ktrace_name(TAG_PROC_NAME, (uint32_t)process->get_koid(), 0, name);
     });
@@ -197,12 +197,12 @@
 static constexpr size_t kRightsStrLen = 8;
 static const char* VmoRightsToString(uint32_t rights, char str[kRightsStrLen]) {
     char* c = str;
-    *c++ = (rights & MX_RIGHT_READ) ? 'r' : '-';
-    *c++ = (rights & MX_RIGHT_WRITE) ? 'w' : '-';
-    *c++ = (rights & MX_RIGHT_EXECUTE) ? 'x' : '-';
-    *c++ = (rights & MX_RIGHT_MAP) ? 'm' : '-';
-    *c++ = (rights & MX_RIGHT_DUPLICATE) ? 'd' : '-';
-    *c++ = (rights & MX_RIGHT_TRANSFER) ? 't' : '-';
+    *c++ = (rights & ZX_RIGHT_READ) ? 'r' : '-';
+    *c++ = (rights & ZX_RIGHT_WRITE) ? 'w' : '-';
+    *c++ = (rights & ZX_RIGHT_EXECUTE) ? 'x' : '-';
+    *c++ = (rights & ZX_RIGHT_MAP) ? 'm' : '-';
+    *c++ = (rights & ZX_RIGHT_DUPLICATE) ? 'd' : '-';
+    *c++ = (rights & ZX_RIGHT_TRANSFER) ? 't' : '-';
     *c = '\0';
     return str;
 }
@@ -217,10 +217,10 @@
 
 static void DumpVmObject(
     const VmObject& vmo, char format_unit,
-    mx_handle_t handle, uint32_t rights, mx_koid_t koid) {
+    zx_handle_t handle, uint32_t rights, zx_koid_t koid) {
 
     char handle_str[11];
-    if (handle != MX_HANDLE_INVALID) {
+    if (handle != ZX_HANDLE_INVALID) {
         snprintf(handle_str, sizeof(handle_str),
                  "%u", static_cast<uint32_t>(handle));
     } else {
@@ -256,7 +256,7 @@
         clone_str[1] = '\0';
     }
 
-    char name[MX_MAX_NAME_LEN];
+    char name[ZX_MAX_NAME_LEN];
     vmo.get_name(name, sizeof(name));
     if (name[0] == '\0') {
         name[0] = '-';
@@ -299,18 +299,18 @@
     PrintVmoDumpHeader(/* handles */ false);
     VmObject::ForEach([=](const VmObject& vmo) {
         if (hidden_only && vmo.IsMappedByUser()) {
-            return MX_OK;
+            return ZX_OK;
         }
         DumpVmObject(
             vmo,
             format_unit,
-            MX_HANDLE_INVALID,
+            ZX_HANDLE_INVALID,
             /* rights */ 0u,
             /* koid */ vmo.user_id());
         // TODO(dbort): Dump the VmAspaces (processes) that map the VMO.
         // TODO(dbort): Dump the processes that hold handles to the VMO.
         //     This will be a lot harder to gather.
-        return MX_OK;
+        return ZX_OK;
     });
     PrintVmoDumpHeader(/* handles */ false);
 }
@@ -326,7 +326,7 @@
         DumpVmObject(
             *vmo,
             format_unit_,
-            MX_HANDLE_INVALID,
+            ZX_HANDLE_INVALID,
             /* rights */ 0u,
             /* koid */ vmo->user_id());
         return true;
@@ -337,7 +337,7 @@
 } // namespace
 
 // Dumps all VMOs associated with a process.
-static void DumpProcessVmObjects(mx_koid_t id, char format_unit) {
+static void DumpProcessVmObjects(zx_koid_t id, char format_unit) {
     auto pd = ProcessDispatcher::LookupProcessById(id);
     if (!pd) {
         printf("process not found!\n");
@@ -350,11 +350,11 @@
     int count = 0;
     uint64_t total_size = 0;
     uint64_t total_alloc = 0;
-    pd->ForEachHandle([&](mx_handle_t handle, mx_rights_t rights,
+    pd->ForEachHandle([&](zx_handle_t handle, zx_rights_t rights,
                           fbl::RefPtr<const Dispatcher> disp) {
         auto vmod = DownCastDispatcher<const VmObjectDispatcher>(&disp);
         if (vmod == nullptr) {
-            return MX_OK;
+            return ZX_OK;
         }
         auto vmo = vmod->vmo();
         DumpVmObject(*vmo, format_unit, handle, rights, vmod->get_koid());
@@ -366,7 +366,7 @@
         // TODO: Doing this twice (here and in DumpVmObject) is a waste of
         // work, and can get out of sync.
         total_alloc += vmo->AllocatedPages() * PAGE_SIZE;
-        return MX_OK;
+        return ZX_OK;
     });
     char size_str[MAX_FORMAT_SIZE_LEN];
     char alloc_str[MAX_FORMAT_SIZE_LEN];
@@ -385,7 +385,7 @@
     PrintVmoDumpHeader(/* handles */ false);
 }
 
-void KillProcess(mx_koid_t id) {
+void KillProcess(zx_koid_t id) {
     // search the process list and send a kill if found
     auto pd = ProcessDispatcher::LookupProcessById(id);
     if (!pd) {
@@ -422,14 +422,14 @@
 };
 } // namespace
 
-mx_status_t VmAspace::GetMemoryUsage(vm_usage_t* usage) {
+zx_status_t VmAspace::GetMemoryUsage(vm_usage_t* usage) {
     VmCounter vc;
     if (!EnumerateChildren(&vc)) {
         *usage = {};
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     *usage = vc.usage;
-    return MX_OK;
+    return ZX_OK;
 }
 
 namespace {
@@ -439,13 +439,13 @@
     }
     unsigned int ret = 0;
     if (arch_mmu_flags & ARCH_MMU_FLAG_PERM_READ) {
-        ret |= MX_VM_FLAG_PERM_READ;
+        ret |= ZX_VM_FLAG_PERM_READ;
     }
     if (arch_mmu_flags & ARCH_MMU_FLAG_PERM_WRITE) {
-        ret |= MX_VM_FLAG_PERM_WRITE;
+        ret |= ZX_VM_FLAG_PERM_WRITE;
     }
     if (arch_mmu_flags & ARCH_MMU_FLAG_PERM_EXECUTE) {
-        ret |= MX_VM_FLAG_PERM_EXECUTE;
+        ret |= ZX_VM_FLAG_PERM_EXECUTE;
     }
     return ret;
 }
@@ -455,19 +455,19 @@
 public:
     // NOTE: Code outside of the syscall layer should not typically know about
     // user_ptrs; do not use this pattern as an example.
-    VmMapBuilder(user_ptr<mx_info_maps_t> maps, size_t max)
+    VmMapBuilder(user_ptr<zx_info_maps_t> maps, size_t max)
         : maps_(maps), max_(max) {}
 
     bool OnVmAddressRegion(const VmAddressRegion* vmar, uint depth) override {
         available_++;
         if (nelem_ < max_) {
-            mx_info_maps_t entry = {};
+            zx_info_maps_t entry = {};
             strlcpy(entry.name, vmar->name(), sizeof(entry.name));
             entry.base = vmar->base();
             entry.size = vmar->size();
             entry.depth = depth + 1; // The root aspace is depth 0.
-            entry.type = MX_INFO_MAPS_TYPE_VMAR;
-            if (maps_.copy_array_to_user(&entry, 1, nelem_) != MX_OK) {
+            entry.type = ZX_INFO_MAPS_TYPE_VMAR;
+            if (maps_.copy_array_to_user(&entry, 1, nelem_) != ZX_OK) {
                 return false;
             }
             nelem_++;
@@ -479,20 +479,20 @@
                      uint depth) override {
         available_++;
         if (nelem_ < max_) {
-            mx_info_maps_t entry = {};
+            zx_info_maps_t entry = {};
             auto vmo = map->vmo();
             vmo->get_name(entry.name, sizeof(entry.name));
             entry.base = map->base();
             entry.size = map->size();
             entry.depth = depth + 1; // The root aspace is depth 0.
-            entry.type = MX_INFO_MAPS_TYPE_MAPPING;
-            mx_info_maps_mapping_t* u = &entry.u.mapping;
+            entry.type = ZX_INFO_MAPS_TYPE_MAPPING;
+            zx_info_maps_mapping_t* u = &entry.u.mapping;
             u->mmu_flags =
                 arch_mmu_flags_to_vm_flags(map->arch_mmu_flags());
             u->vmo_koid = vmo->user_id();
             u->committed_pages = vmo->AllocatedPagesInRange(
                 map->object_offset(), map->size());
-            if (maps_.copy_array_to_user(&entry, 1, nelem_) != MX_OK) {
+            if (maps_.copy_array_to_user(&entry, 1, nelem_) != ZX_OK) {
                 return false;
             }
             nelem_++;
@@ -507,31 +507,31 @@
     // The caller must write an entry for the root VmAspace at index 0.
     size_t nelem_ = 1;
     size_t available_ = 1;
-    user_ptr<mx_info_maps_t> maps_;
+    user_ptr<zx_info_maps_t> maps_;
     size_t max_;
 };
 } // namespace
 
 // NOTE: Code outside of the syscall layer should not typically know about
 // user_ptrs; do not use this pattern as an example.
-mx_status_t GetVmAspaceMaps(fbl::RefPtr<VmAspace> aspace,
-                            user_ptr<mx_info_maps_t> maps, size_t max,
+zx_status_t GetVmAspaceMaps(fbl::RefPtr<VmAspace> aspace,
+                            user_ptr<zx_info_maps_t> maps, size_t max,
                             size_t* actual, size_t* available) {
     DEBUG_ASSERT(aspace != nullptr);
     *actual = 0;
     *available = 0;
     if (aspace->is_destroyed()) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (max > 0) {
-        mx_info_maps_t entry = {};
+        zx_info_maps_t entry = {};
         strlcpy(entry.name, aspace->name(), sizeof(entry.name));
         entry.base = aspace->base();
         entry.size = aspace->size();
         entry.depth = 0;
-        entry.type = MX_INFO_MAPS_TYPE_ASPACE;
-        if (maps.copy_array_to_user(&entry, 1, 0) != MX_OK) {
-            return MX_ERR_INVALID_ARGS;
+        entry.type = ZX_INFO_MAPS_TYPE_ASPACE;
+        if (maps.copy_array_to_user(&entry, 1, 0) != ZX_OK) {
+            return ZX_ERR_INVALID_ARGS;
         }
     }
 
@@ -539,17 +539,17 @@
     if (!aspace->EnumerateChildren(&b)) {
         // VmMapBuilder only returns false
         // when it can't copy to the user pointer.
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     *actual = max > 0 ? b.nelem() : 0;
     *available = b.available();
-    return MX_OK;
+    return ZX_OK;
 }
 
 namespace {
-mx_info_vmo_t VmoToInfoEntry(const VmObject* vmo,
-                             bool is_handle, mx_rights_t handle_rights) {
-    mx_info_vmo_t entry = {};
+zx_info_vmo_t VmoToInfoEntry(const VmObject* vmo,
+                             bool is_handle, zx_rights_t handle_rights) {
+    zx_info_vmo_t entry = {};
     entry.koid = vmo->user_id();
     vmo->get_name(entry.name, sizeof(entry.name));
     entry.size_bytes = vmo->size();
@@ -558,14 +558,14 @@
     entry.num_mappings = vmo->num_mappings();
     entry.share_count = vmo->share_count();
     entry.flags =
-        (vmo->is_paged() ? MX_INFO_VMO_TYPE_PAGED : MX_INFO_VMO_TYPE_PHYSICAL) |
-        (vmo->is_cow_clone() ? MX_INFO_VMO_IS_COW_CLONE : 0);
+        (vmo->is_paged() ? ZX_INFO_VMO_TYPE_PAGED : ZX_INFO_VMO_TYPE_PHYSICAL) |
+        (vmo->is_cow_clone() ? ZX_INFO_VMO_IS_COW_CLONE : 0);
     entry.committed_bytes = vmo->AllocatedPages() * PAGE_SIZE;
     if (is_handle) {
-        entry.flags |= MX_INFO_VMO_VIA_HANDLE;
+        entry.flags |= ZX_INFO_VMO_VIA_HANDLE;
         entry.handle_rights = handle_rights;
     } else {
-        entry.flags |= MX_INFO_VMO_VIA_MAPPING;
+        entry.flags |= ZX_INFO_VMO_VIA_MAPPING;
     }
     return entry;
 }
@@ -575,7 +575,7 @@
 public:
     // NOTE: Code outside of the syscall layer should not typically know about
     // user_ptrs; do not use this pattern as an example.
-    AspaceVmoEnumerator(user_ptr<mx_info_vmo_t> vmos, size_t max)
+    AspaceVmoEnumerator(user_ptr<zx_info_vmo_t> vmos, size_t max)
         : vmos_(vmos), max_(max) {}
 
     bool OnVmMapping(const VmMapping* map, const VmAddressRegion* vmar,
@@ -585,10 +585,10 @@
             // We're likely to see the same VMO a couple times in a given
             // address space (e.g., somelib.so mapped as r--, r-x), but leave it
             // to userspace to do deduping.
-            mx_info_vmo_t entry = VmoToInfoEntry(map->vmo().get(),
+            zx_info_vmo_t entry = VmoToInfoEntry(map->vmo().get(),
                                                  /*is_handle=*/false,
                                                  /*handle_rights=*/0);
-            if (vmos_.copy_array_to_user(&entry, 1, nelem_) != MX_OK) {
+            if (vmos_.copy_array_to_user(&entry, 1, nelem_) != ZX_OK) {
                 return false;
             }
             nelem_++;
@@ -600,7 +600,7 @@
     size_t available() const { return available_; }
 
 private:
-    const user_ptr<mx_info_vmo_t> vmos_;
+    const user_ptr<zx_info_vmo_t> vmos_;
     const size_t max_;
 
     size_t nelem_ = 0;
@@ -610,8 +610,8 @@
 
 // NOTE: Code outside of the syscall layer should not typically know about
 // user_ptrs; do not use this pattern as an example.
-mx_status_t GetVmAspaceVmos(fbl::RefPtr<VmAspace> aspace,
-                            user_ptr<mx_info_vmo_t> vmos, size_t max,
+zx_status_t GetVmAspaceVmos(fbl::RefPtr<VmAspace> aspace,
+                            user_ptr<zx_info_vmo_t> vmos, size_t max,
                             size_t* actual, size_t* available) {
     DEBUG_ASSERT(aspace != nullptr);
     DEBUG_ASSERT(actual != nullptr);
@@ -619,24 +619,24 @@
     *actual = 0;
     *available = 0;
     if (aspace->is_destroyed()) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     AspaceVmoEnumerator ave(vmos, max);
     if (!aspace->EnumerateChildren(&ave)) {
         // AspaceVmoEnumerator only returns false
         // when it can't copy to the user pointer.
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     *actual = ave.nelem();
     *available = ave.available();
-    return MX_OK;
+    return ZX_OK;
 }
 
 // NOTE: Code outside of the syscall layer should not typically know about
 // user_ptrs; do not use this pattern as an example.
-mx_status_t GetProcessVmosViaHandles(ProcessDispatcher* process,
-                                     user_ptr<mx_info_vmo_t> vmos, size_t max,
+zx_status_t GetProcessVmosViaHandles(ProcessDispatcher* process,
+                                     user_ptr<zx_info_vmo_t> vmos, size_t max,
                                      size_t* actual_out, size_t* available_out) {
     DEBUG_ASSERT(process != nullptr);
     DEBUG_ASSERT(actual_out != nullptr);
@@ -645,35 +645,35 @@
     size_t available = 0;
     // We may see multiple handles to the same VMO, but leave it to userspace to
     // do deduping.
-    mx_status_t s = process->ForEachHandle([&](mx_handle_t handle,
-                                               mx_rights_t rights,
+    zx_status_t s = process->ForEachHandle([&](zx_handle_t handle,
+                                               zx_rights_t rights,
                                                fbl::RefPtr<Dispatcher> disp) {
         auto vmod = DownCastDispatcher<VmObjectDispatcher>(&disp);
         if (vmod == nullptr) {
             // This handle isn't a VMO; skip it.
-            return MX_OK;
+            return ZX_OK;
         }
         available++;
         if (actual < max) {
-            mx_info_vmo_t entry = VmoToInfoEntry(vmod->vmo().get(),
+            zx_info_vmo_t entry = VmoToInfoEntry(vmod->vmo().get(),
                                                  /*is_handle=*/true,
                                                  rights);
-            if (vmos.copy_array_to_user(&entry, 1, actual) != MX_OK) {
-                return MX_ERR_INVALID_ARGS;
+            if (vmos.copy_array_to_user(&entry, 1, actual) != ZX_OK) {
+                return ZX_ERR_INVALID_ARGS;
             }
             actual++;
         }
-        return MX_OK;
+        return ZX_OK;
     });
-    if (s != MX_OK) {
+    if (s != ZX_OK) {
         return s;
     }
     *actual_out = actual;
     *available_out = available;
-    return MX_OK;
+    return ZX_OK;
 }
 
-void DumpProcessAddressSpace(mx_koid_t id) {
+void DumpProcessAddressSpace(zx_koid_t id) {
     auto pd = ProcessDispatcher::LookupProcessById(id);
     if (!pd) {
         printf("process %" PRIu64 " not found!\n", id);
@@ -729,7 +729,7 @@
     auto walker = MakeProcessWalker([&](ProcessDispatcher* process) {
         size_t pages = process->PageCount();
         if (pages >= min_pages) {
-            char pname[MX_MAX_NAME_LEN];
+            char pname[ZX_MAX_NAME_LEN];
             process->get_name(pname);
             printf("%sproc %5" PRIu64 " %4zuM '%s'\n",
                    prefix, process->get_koid(), pages / 256, pname);
@@ -840,5 +840,5 @@
 }
 
 STATIC_COMMAND_START
-STATIC_COMMAND("mx", "kernel object diagnostics", &cmd_diagnostics)
-STATIC_COMMAND_END(mx);
+STATIC_COMMAND("zx", "kernel object diagnostics", &cmd_diagnostics)
+STATIC_COMMAND_END(zx);
diff --git a/kernel/object/dispatcher.cpp b/kernel/object/dispatcher.cpp
index 2b4697a..58d5f70 100644
--- a/kernel/object/dispatcher.cpp
+++ b/kernel/object/dispatcher.cpp
@@ -13,9 +13,9 @@
 
 namespace {
 // The first 1K koids are reserved.
-fbl::atomic<mx_koid_t> global_koid(1024ULL);
+fbl::atomic<zx_koid_t> global_koid(1024ULL);
 
-mx_koid_t GenerateKernelObjectId() {
+zx_koid_t GenerateKernelObjectId() {
     return global_koid.fetch_add(1ULL);
 }
 
@@ -32,27 +32,27 @@
 #endif
 }
 
-mx_status_t Dispatcher::add_observer(StateObserver* observer) {
+zx_status_t Dispatcher::add_observer(StateObserver* observer) {
     auto state_tracker = get_state_tracker();
     if (!state_tracker)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     state_tracker->AddObserver(observer, nullptr);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Dispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
+zx_status_t Dispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
     if (peer)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     auto state_tracker = get_state_tracker();
     if (!state_tracker)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Generic objects can set all USER_SIGNALs. Particular object
     // types (events and eventpairs) may be able to set more.
-    if ((set_mask & ~MX_USER_SIGNAL_ALL) || (clear_mask & ~MX_USER_SIGNAL_ALL))
-        return MX_ERR_INVALID_ARGS;
+    if ((set_mask & ~ZX_USER_SIGNAL_ALL) || (clear_mask & ~ZX_USER_SIGNAL_ALL))
+        return ZX_ERR_INVALID_ARGS;
 
     state_tracker->UpdateState(clear_mask, set_mask);
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/object/event_dispatcher.cpp b/kernel/object/event_dispatcher.cpp
index 0745abc..53eddea 100644
--- a/kernel/object/event_dispatcher.cpp
+++ b/kernel/object/event_dispatcher.cpp
@@ -8,22 +8,22 @@
 
 #include <err.h>
 
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 #include <object/state_tracker.h>
 
-constexpr uint32_t kUserSignalMask = MX_EVENT_SIGNALED | MX_USER_SIGNAL_ALL;
+constexpr uint32_t kUserSignalMask = ZX_EVENT_SIGNALED | ZX_USER_SIGNAL_ALL;
 
-mx_status_t EventDispatcher::Create(uint32_t options, fbl::RefPtr<Dispatcher>* dispatcher,
-                                    mx_rights_t* rights) {
+zx_status_t EventDispatcher::Create(uint32_t options, fbl::RefPtr<Dispatcher>* dispatcher,
+                                    zx_rights_t* rights) {
     fbl::AllocChecker ac;
     auto disp = new (&ac) EventDispatcher(options);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    *rights = MX_DEFAULT_EVENT_RIGHTS;
+    *rights = ZX_DEFAULT_EVENT_RIGHTS;
     *dispatcher = fbl::AdoptRef<Dispatcher>(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 EventDispatcher::EventDispatcher(uint32_t options)
@@ -31,15 +31,15 @@
 
 EventDispatcher::~EventDispatcher() {}
 
-mx_status_t EventDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
+zx_status_t EventDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
     canary_.Assert();
 
     if (peer)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     if ((set_mask & ~kUserSignalMask) || (clear_mask & ~kUserSignalMask))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     state_tracker_.UpdateState(clear_mask, set_mask);
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/object/event_pair_dispatcher.cpp b/kernel/object/event_pair_dispatcher.cpp
index d8fa4af..aba51b6 100644
--- a/kernel/object/event_pair_dispatcher.cpp
+++ b/kernel/object/event_pair_dispatcher.cpp
@@ -9,33 +9,33 @@
 #include <assert.h>
 #include <err.h>
 
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 #include <object/state_tracker.h>
 
-constexpr uint32_t kUserSignalMask = MX_EVENT_SIGNALED | MX_USER_SIGNAL_ALL;
+constexpr uint32_t kUserSignalMask = ZX_EVENT_SIGNALED | ZX_USER_SIGNAL_ALL;
 
-mx_status_t EventPairDispatcher::Create(fbl::RefPtr<Dispatcher>* dispatcher0,
+zx_status_t EventPairDispatcher::Create(fbl::RefPtr<Dispatcher>* dispatcher0,
                                         fbl::RefPtr<Dispatcher>* dispatcher1,
-                                        mx_rights_t* rights) {
+                                        zx_rights_t* rights) {
     fbl::AllocChecker ac;
     auto disp0 = fbl::AdoptRef(new (&ac) EventPairDispatcher());
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto disp1 = fbl::AdoptRef(new (&ac) EventPairDispatcher());
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     disp0->Init(disp1);
     disp1->Init(disp0);
 
-    *rights = MX_DEFAULT_EVENT_PAIR_RIGHTS;
+    *rights = ZX_DEFAULT_EVENT_PAIR_RIGHTS;
     *dispatcher0 = fbl::move(disp0);
     *dispatcher1 = fbl::move(disp1);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 EventPairDispatcher::~EventPairDispatcher() {}
@@ -47,27 +47,27 @@
     DEBUG_ASSERT(other_);
 
     other_->state_tracker_.InvalidateCookie(other_->get_cookie_jar());
-    other_->state_tracker_.UpdateState(0u, MX_EPAIR_PEER_CLOSED);
+    other_->state_tracker_.UpdateState(0u, ZX_EPAIR_PEER_CLOSED);
     other_.reset();
 }
 
-mx_status_t EventPairDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
+zx_status_t EventPairDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
     canary_.Assert();
 
     if ((set_mask & ~kUserSignalMask) || (clear_mask & ~kUserSignalMask))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (!peer) {
         state_tracker_.UpdateState(clear_mask, set_mask);
-        return MX_OK;
+        return ZX_OK;
     }
 
     fbl::AutoLock locker(&lock_);
     // object_signal() may race with handle_close() on another thread.
     if (!other_)
-        return MX_ERR_PEER_CLOSED;
+        return ZX_ERR_PEER_CLOSED;
     other_->state_tracker_.UpdateState(clear_mask, set_mask);
-    return MX_OK;
+    return ZX_OK;
 }
 
 EventPairDispatcher::EventPairDispatcher()
diff --git a/kernel/object/exception.cpp b/kernel/object/exception.cpp
index 576570f..9bad4cd 100644
--- a/kernel/object/exception.cpp
+++ b/kernel/object/exception.cpp
@@ -22,19 +22,19 @@
 
 static const char* excp_type_to_string(uint type) {
     switch (type) {
-    case MX_EXCP_FATAL_PAGE_FAULT:
+    case ZX_EXCP_FATAL_PAGE_FAULT:
         return "fatal page fault";
-    case MX_EXCP_UNDEFINED_INSTRUCTION:
+    case ZX_EXCP_UNDEFINED_INSTRUCTION:
         return "undefined instruction";
-    case MX_EXCP_GENERAL:
+    case ZX_EXCP_GENERAL:
         return "general fault";
-    case MX_EXCP_SW_BREAKPOINT:
+    case ZX_EXCP_SW_BREAKPOINT:
         return "software breakpoint";
-    case MX_EXCP_HW_BREAKPOINT:
+    case ZX_EXCP_HW_BREAKPOINT:
         return "hardware breakpoint";
-    case MX_EXCP_UNALIGNED_ACCESS:
+    case ZX_EXCP_UNALIGNED_ACCESS:
         return "alignment fault";
-    case MX_EXCP_POLICY_ERROR:
+    case ZX_EXCP_POLICY_ERROR:
         return "policy error";
     default:
         return "unknown fault";
@@ -116,9 +116,9 @@
     DISALLOW_COPY_ASSIGN_AND_MOVE(ExceptionPortIterator);
 };
 
-static mx_status_t try_exception_handler(fbl::RefPtr<ExceptionPort> eport,
+static zx_status_t try_exception_handler(fbl::RefPtr<ExceptionPort> eport,
                                          ThreadDispatcher* thread,
-                                         const mx_exception_report_t* report,
+                                         const zx_exception_report_t* report,
                                          const arch_exception_context_t* arch_context,
                                          ThreadDispatcher::ExceptionStatus* estatus) {
     LTRACEF("Trying exception port type %d\n", static_cast<int>(eport->type()));
@@ -149,7 +149,7 @@
                                                  bool* out_processed) {
     *out_processed = false;
 
-    mx_exception_report_t report;
+    zx_exception_report_t report;
     ExceptionPort::BuildArchReport(&report, exception_type, context);
 
     ExceptionPortIterator iter(thread);
@@ -162,10 +162,10 @@
         LTRACEF("handler returned %d/%d\n",
                 static_cast<int>(status), static_cast<int>(estatus));
         switch (status) {
-        case MX_ERR_INTERNAL_INTR_KILLED:
-            // thread was killed, probably with mx_task_kill
+        case ZX_ERR_INTERNAL_INTR_KILLED:
+            // thread was killed, probably with zx_task_kill
             return HS_KILLED;
-        case MX_OK:
+        case ZX_OK:
             switch (estatus) {
             case ThreadDispatcher::ExceptionStatus::TRY_NEXT:
                 *out_processed = true;
@@ -190,11 +190,11 @@
 // Dispatches an exception to the appropriate handler. Called by arch code
 // when it cannot handle an exception.
 //
-// If we return MX_OK, the caller is expected to resume the thread "as if"
+// If we return ZX_OK, the caller is expected to resume the thread "as if"
 // nothing happened, the handler is expected to have modified state such that
 // resumption is possible.
 //
-// If we return MX_ERR_BAD_STATE, the current thread is not a user thread
+// If we return ZX_ERR_BAD_STATE, the current thread is not a user thread
 // (i.e., not associated with a ThreadDispatcher).
 //
 // Otherwise, we cause the current thread to exit and do not return at all.
@@ -208,7 +208,7 @@
     ThreadDispatcher* thread = ThreadDispatcher::GetCurrent();
     if (unlikely(!thread)) {
         // The current thread is not a user thread; bail.
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     bool processed;
@@ -216,7 +216,7 @@
                                                         thread, &processed);
     switch (hstatus) {
         case HS_RESUME:
-            return MX_OK;
+            return ZX_OK;
         case HS_KILLED:
             thread->Exit();
             __UNREACHABLE;
@@ -233,9 +233,9 @@
     if (!processed) {
         // only print this if an exception handler wasn't involved
         // in handling the exception
-        char pname[MX_MAX_NAME_LEN];
+        char pname[ZX_MAX_NAME_LEN];
         process->get_name(pname);
-        char tname[MX_MAX_NAME_LEN];
+        char tname[ZX_MAX_NAME_LEN];
         thread->get_name(tname);
         printf("KERN: %s in user thread '%s' in process '%s'\n",
                excp_type_to_string(exception_type), tname, pname);
diff --git a/kernel/object/excp_port.cpp b/kernel/object/excp_port.cpp
index a0df3d4..8669fd6 100644
--- a/kernel/object/excp_port.cpp
+++ b/kernel/object/excp_port.cpp
@@ -26,8 +26,8 @@
 
 #define LOCAL_TRACE 0
 
-static PortPacket* MakePacket(uint64_t key, uint32_t type, mx_koid_t pid, mx_koid_t tid) {
-    if (!MX_PKT_IS_EXCEPTION(type))
+static PortPacket* MakePacket(uint64_t key, uint32_t type, zx_koid_t pid, zx_koid_t tid) {
+    if (!ZX_PKT_IS_EXCEPTION(type))
         return nullptr;
 
     auto port_packet = PortDispatcher::DefaultPortAllocator()->Alloc();
@@ -45,17 +45,17 @@
 }
 
 // static
-mx_status_t ExceptionPort::Create(Type type, fbl::RefPtr<PortDispatcher> port, uint64_t port_key,
+zx_status_t ExceptionPort::Create(Type type, fbl::RefPtr<PortDispatcher> port, uint64_t port_key,
                                   fbl::RefPtr<ExceptionPort>* out_eport) {
     fbl::AllocChecker ac;
     auto eport = new (&ac) ExceptionPort(type, fbl::move(port), port_key);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // ExceptionPort's ctor causes the first ref to be adopted,
     // so we should only wrap.
     *out_eport = fbl::WrapRefPtr<ExceptionPort>(eport);
-    return MX_OK;
+    return ZX_OK;
 }
 
 ExceptionPort::ExceptionPort(Type type, fbl::RefPtr<PortDispatcher> port, uint64_t port_key)
@@ -124,7 +124,7 @@
     if (port_ == nullptr) {
         // Already unbound. This can happen when
         // PortDispatcher::on_zero_handles and a manual unbind (via
-        // mx_task_bind_exception_port) race with each other.
+        // zx_task_bind_exception_port) race with each other.
         LTRACEF("already unbound\n");
         DEBUG_ASSERT(!IsBoundLocked());
         return;
@@ -198,7 +198,7 @@
             // Already unbound.
             // This could happen if ::OnPortZeroHandles releases the
             // lock and another thread immediately does a manual unbind
-            // via mx_task_bind_exception_port.
+            // via zx_task_bind_exception_port.
             DEBUG_ASSERT(!IsBoundLocked());
             return;
         }
@@ -221,7 +221,7 @@
     LTRACE_EXIT_OBJ;
 }
 
-mx_status_t ExceptionPort::SendPacketWorker(uint32_t type, mx_koid_t pid, mx_koid_t tid) {
+zx_status_t ExceptionPort::SendPacketWorker(uint32_t type, zx_koid_t pid, zx_koid_t tid) {
     AutoLock lock(&lock_);
     LTRACEF("%s, type %u, pid %" PRIu64 ", tid %" PRIu64 "\n",
             port_ == nullptr ? "Not sending exception report on unbound port"
@@ -229,35 +229,35 @@
             type, pid, tid);
     if (port_ == nullptr) {
         // The port has been unbound.
-        return MX_ERR_PEER_CLOSED;
+        return ZX_ERR_PEER_CLOSED;
     }
 
     auto iopk = MakePacket(port_key_, type, pid, tid);
     if (!iopk)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    mx_status_t status = port_->Queue(iopk, 0, 0);
-    if (status != MX_OK) {
+    zx_status_t status = port_->Queue(iopk, 0, 0);
+    if (status != ZX_OK) {
         iopk->Free();
     }
     return status;
 }
 
-mx_status_t ExceptionPort::SendPacket(ThreadDispatcher* thread, uint32_t type) {
+zx_status_t ExceptionPort::SendPacket(ThreadDispatcher* thread, uint32_t type) {
     canary_.Assert();
 
-    mx_koid_t pid = thread->process()->get_koid();
-    mx_koid_t tid = thread->get_koid();
+    zx_koid_t pid = thread->process()->get_koid();
+    zx_koid_t tid = thread->get_koid();
     return SendPacketWorker(type, pid, tid);
 }
 
-void ExceptionPort::BuildReport(mx_exception_report_t* report, uint32_t type) {
+void ExceptionPort::BuildReport(zx_exception_report_t* report, uint32_t type) {
     memset(report, 0, sizeof(*report));
     report->header.size = sizeof(*report);
     report->header.type = type;
 }
 
-void ExceptionPort::BuildArchReport(mx_exception_report_t* report, uint32_t type,
+void ExceptionPort::BuildArchReport(zx_exception_report_t* report, uint32_t type,
                                     const arch_exception_context_t* arch_context) {
     BuildReport(report, type);
     arch_fill_in_exception_context(arch_context, report);
@@ -266,22 +266,22 @@
 void ExceptionPort::OnThreadStart(ThreadDispatcher* thread) {
     canary_.Assert();
 
-    mx_koid_t pid = thread->process()->get_koid();
-    mx_koid_t tid = thread->get_koid();
+    zx_koid_t pid = thread->process()->get_koid();
+    zx_koid_t tid = thread->get_koid();
     LTRACEF("thread %" PRIu64 ".%" PRIu64 " started\n", pid, tid);
 
-    mx_exception_report_t report;
-    BuildReport(&report, MX_EXCP_THREAD_STARTING);
+    zx_exception_report_t report;
+    BuildReport(&report, ZX_EXCP_THREAD_STARTING);
     arch_exception_context_t context;
     // There is no iframe at the moment. We'll need one (or equivalent) if/when
     // we want to make $pc, $sp available.
     memset(&context, 0, sizeof(context));
     ThreadDispatcher::ExceptionStatus estatus;
     auto status = thread->ExceptionHandlerExchange(fbl::RefPtr<ExceptionPort>(this), &report, &context, &estatus);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         // Ignore any errors. There's nothing we can do here, and
         // we still want the thread to run. It's possible the thread was
-        // killed (status == MX_ERR_INTERNAL_INTR_KILLED), the kernel will kill the
+        // killed (status == ZX_ERR_INTERNAL_INTR_KILLED), the kernel will kill the
         // thread shortly.
     }
 }
@@ -289,8 +289,8 @@
 void ExceptionPort::OnThreadSuspending(ThreadDispatcher* thread) {
     canary_.Assert();
 
-    mx_koid_t pid = thread->process()->get_koid();
-    mx_koid_t tid = thread->get_koid();
+    zx_koid_t pid = thread->process()->get_koid();
+    zx_koid_t tid = thread->get_koid();
     LTRACEF("thread %" PRIu64 ".%" PRIu64 " suspending\n", pid, tid);
 
     // A note on the tense of the words used here: suspending vs suspended.
@@ -300,21 +300,21 @@
     // report it can assume the thread is, for its purposes, suspended.
 
     // The result is ignored, not much else we can do.
-    SendPacket(thread, MX_EXCP_THREAD_SUSPENDED);
+    SendPacket(thread, ZX_EXCP_THREAD_SUSPENDED);
 }
 
 void ExceptionPort::OnThreadResuming(ThreadDispatcher* thread) {
     canary_.Assert();
 
-    mx_koid_t pid = thread->process()->get_koid();
-    mx_koid_t tid = thread->get_koid();
+    zx_koid_t pid = thread->process()->get_koid();
+    zx_koid_t tid = thread->get_koid();
     LTRACEF("thread %" PRIu64 ".%" PRIu64 " resuming\n", pid, tid);
 
     // See OnThreadSuspending for a note on the tense of the words uses here:
     // suspending vs suspended.
 
     // The result is ignored, not much else we can do.
-    SendPacket(thread, MX_EXCP_THREAD_RESUMED);
+    SendPacket(thread, ZX_EXCP_THREAD_RESUMED);
 }
 
 // This isn't called for every process's destruction, only for processes that
@@ -323,11 +323,11 @@
 void ExceptionPort::OnProcessExit(ProcessDispatcher* process) {
     canary_.Assert();
 
-    mx_koid_t pid = process->get_koid();
+    zx_koid_t pid = process->get_koid();
     LTRACEF("process %" PRIu64 " gone\n", pid);
 
     // The result is ignored, not much else we can do.
-    SendPacketWorker(MX_EXCP_GONE, pid, MX_KOID_INVALID);
+    SendPacketWorker(ZX_EXCP_GONE, pid, ZX_KOID_INVALID);
 }
 
 // This isn't called for every thread's destruction, only for threads that
@@ -336,12 +336,12 @@
 void ExceptionPort::OnThreadExit(ThreadDispatcher* thread) {
     canary_.Assert();
 
-    mx_koid_t pid = thread->process()->get_koid();
-    mx_koid_t tid = thread->get_koid();
+    zx_koid_t pid = thread->process()->get_koid();
+    zx_koid_t tid = thread->get_koid();
     LTRACEF("thread %" PRIu64 ".%" PRIu64 " gone\n", pid, tid);
 
     // The result is ignored, not much else we can do.
-    SendPacket(thread, MX_EXCP_GONE);
+    SendPacket(thread, ZX_EXCP_GONE);
 }
 
 // This isn't called for every thread's destruction, only when a debugger
@@ -350,12 +350,12 @@
 void ExceptionPort::OnThreadExitForDebugger(ThreadDispatcher* thread) {
     canary_.Assert();
 
-    mx_koid_t pid = thread->process()->get_koid();
-    mx_koid_t tid = thread->get_koid();
+    zx_koid_t pid = thread->process()->get_koid();
+    zx_koid_t tid = thread->get_koid();
     LTRACEF("thread %" PRIu64 ".%" PRIu64 " exited\n", pid, tid);
 
-    mx_exception_report_t report;
-    BuildReport(&report, MX_EXCP_THREAD_EXITING);
+    zx_exception_report_t report;
+    BuildReport(&report, ZX_EXCP_THREAD_EXITING);
     arch_exception_context_t context;
     // There is no iframe at the moment. We'll need one (or equivalent) if/when
     // we want to make $pc, $sp available.
@@ -363,9 +363,9 @@
     ThreadDispatcher::ExceptionStatus estatus;
     // N.B. If the process is exiting it will have killed all threads. That
     // means all threads get marked with THREAD_SIGNAL_KILL which means this
-    // exchange will return immediately with MX_ERR_INTERNAL_INTR_KILLED.
+    // exchange will return immediately with ZX_ERR_INTERNAL_INTR_KILLED.
     auto status = thread->ExceptionHandlerExchange(fbl::RefPtr<ExceptionPort>(this), &report, &context, &estatus);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         // Ignore any errors, we still want the thread to continue exiting.
     }
 }
diff --git a/kernel/object/fifo_dispatcher.cpp b/kernel/object/fifo_dispatcher.cpp
index 6ddee01..c44eaaa 100644
--- a/kernel/object/fifo_dispatcher.cpp
+++ b/kernel/object/fifo_dispatcher.cpp
@@ -9,7 +9,7 @@
 #include <string.h>
 
 #include <lib/user_copy/user_ptr.h>
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 #include <object/handle.h>
@@ -17,49 +17,49 @@
 using fbl::AutoLock;
 
 // static
-mx_status_t FifoDispatcher::Create(uint32_t count, uint32_t elemsize, uint32_t options,
+zx_status_t FifoDispatcher::Create(uint32_t count, uint32_t elemsize, uint32_t options,
                                    fbl::RefPtr<Dispatcher>* dispatcher0,
                                    fbl::RefPtr<Dispatcher>* dispatcher1,
-                                   mx_rights_t* rights) {
+                                   zx_rights_t* rights) {
     // count and elemsize must be nonzero
     // count must be a power of two
     // total size must be <= kMaxSizeBytes
     if (!count || !elemsize || (count & (count - 1)) ||
         (count > kMaxSizeBytes) || (elemsize > kMaxSizeBytes) ||
         ((count * elemsize) > kMaxSizeBytes)) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
 
     fbl::AllocChecker ac;
     auto data0 = fbl::unique_ptr<uint8_t[]>(new (&ac) uint8_t[count * elemsize]);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto fifo0 = fbl::AdoptRef(new (&ac) FifoDispatcher(options, count, elemsize, fbl::move(data0)));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto data1 = fbl::unique_ptr<uint8_t[]>(new (&ac) uint8_t[count * elemsize]);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto fifo1 = fbl::AdoptRef(new (&ac) FifoDispatcher(options, count, elemsize, fbl::move(data1)));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     fifo0->Init(fifo1);
     fifo1->Init(fifo0);
 
-    *rights = MX_DEFAULT_FIFO_RIGHTS;
+    *rights = ZX_DEFAULT_FIFO_RIGHTS;
     *dispatcher0 = fbl::move(fifo0);
     *dispatcher1 = fbl::move(fifo1);
-    return MX_OK;
+    return ZX_OK;
 }
 
 FifoDispatcher::FifoDispatcher(uint32_t /*options*/, uint32_t count, uint32_t elem_size,
                                fbl::unique_ptr<uint8_t[]> data)
     : elem_count_(count), elem_size_(elem_size), mask_(count - 1),
-      peer_koid_(0u), state_tracker_(MX_FIFO_WRITABLE),
+      peer_koid_(0u), state_tracker_(ZX_FIFO_WRITABLE),
       head_(0u), tail_(0u), data_(fbl::move(data)) {
 }
 
@@ -73,32 +73,32 @@
     peer_koid_ = other_->get_koid();
 }
 
-mx_status_t FifoDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
+zx_status_t FifoDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
     canary_.Assert();
 
-    if ((set_mask & ~MX_USER_SIGNAL_ALL) || (clear_mask & ~MX_USER_SIGNAL_ALL))
-        return MX_ERR_INVALID_ARGS;
+    if ((set_mask & ~ZX_USER_SIGNAL_ALL) || (clear_mask & ~ZX_USER_SIGNAL_ALL))
+        return ZX_ERR_INVALID_ARGS;
 
     if (!peer) {
         state_tracker_.UpdateState(clear_mask, set_mask);
-        return MX_OK;
+        return ZX_OK;
     }
 
     fbl::RefPtr<FifoDispatcher> other;
     {
         AutoLock lock(&lock_);
         if (!other_)
-            return MX_ERR_PEER_CLOSED;
+            return ZX_ERR_PEER_CLOSED;
         other = other_;
     }
 
     return other->UserSignalSelf(clear_mask, set_mask);
 }
 
-mx_status_t FifoDispatcher::UserSignalSelf(uint32_t clear_mask, uint32_t set_mask) {
+zx_status_t FifoDispatcher::UserSignalSelf(uint32_t clear_mask, uint32_t set_mask) {
     canary_.Assert();
     state_tracker_.UpdateState(clear_mask, set_mask);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void FifoDispatcher::on_zero_handles() {
@@ -118,40 +118,40 @@
 
     AutoLock lock(&lock_);
     other_.reset();
-    state_tracker_.UpdateState(MX_FIFO_WRITABLE, MX_FIFO_PEER_CLOSED);
+    state_tracker_.UpdateState(ZX_FIFO_WRITABLE, ZX_FIFO_PEER_CLOSED);
 }
 
-mx_status_t FifoDispatcher::Write(const uint8_t* src, size_t len, uint32_t* actual) {
-    auto copy_from_fn = [](const uint8_t* src, uint8_t* data, size_t len) -> mx_status_t {
+zx_status_t FifoDispatcher::Write(const uint8_t* src, size_t len, uint32_t* actual) {
+    auto copy_from_fn = [](const uint8_t* src, uint8_t* data, size_t len) -> zx_status_t {
         memcpy(data, src, len);
-        return MX_OK;
+        return ZX_OK;
     };
     return Write(src, len, actual, copy_from_fn);
 }
 
-mx_status_t FifoDispatcher::Read(uint8_t* dst, size_t len, uint32_t* actual) {
-    auto copy_to_fn = [](uint8_t* dst, const uint8_t* data, size_t len) -> mx_status_t {
+zx_status_t FifoDispatcher::Read(uint8_t* dst, size_t len, uint32_t* actual) {
+    auto copy_to_fn = [](uint8_t* dst, const uint8_t* data, size_t len) -> zx_status_t {
         memcpy(dst, data, len);
-        return MX_OK;
+        return ZX_OK;
     };
     return Read(dst, len, actual, copy_to_fn);
 }
 
-mx_status_t FifoDispatcher::WriteFromUser(const uint8_t* src, size_t len, uint32_t* actual) {
-    auto copy_from_fn = [](const uint8_t* src, uint8_t* data, size_t len) -> mx_status_t {
+zx_status_t FifoDispatcher::WriteFromUser(const uint8_t* src, size_t len, uint32_t* actual) {
+    auto copy_from_fn = [](const uint8_t* src, uint8_t* data, size_t len) -> zx_status_t {
         return make_user_ptr(src).copy_array_from_user(data, len);
     };
     return Write(src, len, actual, copy_from_fn);
 }
 
-mx_status_t FifoDispatcher::ReadToUser(uint8_t* dst, size_t len, uint32_t* actual) {
-    auto copy_to_fn = [](uint8_t* dst, const uint8_t* data, size_t len) -> mx_status_t {
+zx_status_t FifoDispatcher::ReadToUser(uint8_t* dst, size_t len, uint32_t* actual) {
+    auto copy_to_fn = [](uint8_t* dst, const uint8_t* data, size_t len) -> zx_status_t {
         return make_user_ptr(dst).copy_array_to_user(data, len);
     };
     return Read(dst, len, actual, copy_to_fn);
 }
 
-mx_status_t FifoDispatcher::Write(const uint8_t* ptr, size_t len, uint32_t* actual,
+zx_status_t FifoDispatcher::Write(const uint8_t* ptr, size_t len, uint32_t* actual,
                                   fifo_copy_from_fn_t copy_from_fn) {
     canary_.Assert();
 
@@ -159,20 +159,20 @@
     {
         AutoLock lock(&lock_);
         if (!other_)
-            return MX_ERR_PEER_CLOSED;
+            return ZX_ERR_PEER_CLOSED;
         other = other_;
     }
 
     return other->WriteSelf(ptr, len, actual, copy_from_fn);
 }
 
-mx_status_t FifoDispatcher::WriteSelf(const uint8_t* ptr, size_t bytelen, uint32_t* actual,
+zx_status_t FifoDispatcher::WriteSelf(const uint8_t* ptr, size_t bytelen, uint32_t* actual,
                                       fifo_copy_from_fn_t copy_from_fn) {
     canary_.Assert();
 
     size_t count = bytelen / elem_size_;
     if (count == 0)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     AutoLock lock(&lock_);
 
@@ -182,7 +182,7 @@
     size_t avail = elem_count_ - (head_ - tail_);
 
     if (avail == 0)
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
 
     bool was_empty = (avail == elem_count_);
 
@@ -198,11 +198,11 @@
         // number of slots we can actually copy
         size_t to_copy = (count > n) ? n : count;
 
-        mx_status_t status = copy_from_fn(ptr, &data_[offset * elem_size_], to_copy * elem_size_);
-        if (status != MX_OK) {
+        zx_status_t status = copy_from_fn(ptr, &data_[offset * elem_size_], to_copy * elem_size_);
+        if (status != ZX_OK) {
             // roll back, in case this is the second copy
             head_ = old_head;
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         // adjust head and count
@@ -214,23 +214,23 @@
 
     // if was empty, we've become readable
     if (was_empty)
-        state_tracker_.UpdateState(0u, MX_FIFO_READABLE);
+        state_tracker_.UpdateState(0u, ZX_FIFO_READABLE);
 
     // if now full, we're no longer writable
     if (elem_count_ == (head_ - tail_))
-        other_->state_tracker_.UpdateState(MX_FIFO_WRITABLE, 0u);
+        other_->state_tracker_.UpdateState(ZX_FIFO_WRITABLE, 0u);
 
     *actual = (head_ - old_head);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t FifoDispatcher::Read(uint8_t* ptr, size_t bytelen, uint32_t* actual,
+zx_status_t FifoDispatcher::Read(uint8_t* ptr, size_t bytelen, uint32_t* actual,
                                  fifo_copy_to_fn_t copy_to_fn) {
     canary_.Assert();
 
     size_t count = bytelen / elem_size_;
     if (count == 0)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     AutoLock lock(&lock_);
 
@@ -240,7 +240,7 @@
     size_t avail = (head_ - tail_);
 
     if (avail == 0)
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
 
     bool was_full = (avail == elem_count_);
 
@@ -256,11 +256,11 @@
         // number of slots we can actually copy
         size_t to_copy = (count > n) ? n : count;
 
-        mx_status_t status = copy_to_fn(ptr, &data_[offset * elem_size_], to_copy * elem_size_);
-        if (status != MX_OK) {
+        zx_status_t status = copy_to_fn(ptr, &data_[offset * elem_size_], to_copy * elem_size_);
+        if (status != ZX_OK) {
             // roll back, in case this is the second copy
             tail_ = old_tail;
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         // adjust tail and count
@@ -273,12 +273,12 @@
 
     // if we were full, we have become writable
     if (was_full && other_)
-        other_->state_tracker_.UpdateState(0u, MX_FIFO_WRITABLE);
+        other_->state_tracker_.UpdateState(0u, ZX_FIFO_WRITABLE);
 
     // if we've become empty, we're no longer readable
     if ((head_ - tail_) == 0)
-        state_tracker_.UpdateState(MX_FIFO_READABLE, 0u);
+        state_tracker_.UpdateState(ZX_FIFO_READABLE, 0u);
 
     *actual = (tail_ - old_tail);
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/object/futex_context.cpp b/kernel/object/futex_context.cpp
index c73eb0a..8617c8c 100644
--- a/kernel/object/futex_context.cpp
+++ b/kernel/object/futex_context.cpp
@@ -28,12 +28,12 @@
     DEBUG_ASSERT(futex_table_.is_empty());
 }
 
-mx_status_t FutexContext::FutexWait(user_ptr<int> value_ptr, int current_value, mx_time_t deadline) {
+zx_status_t FutexContext::FutexWait(user_ptr<int> value_ptr, int current_value, zx_time_t deadline) {
     LTRACE_ENTRY;
 
     uintptr_t futex_key = reinterpret_cast<uintptr_t>(value_ptr.get());
     if (futex_key % sizeof(int))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     FutexNode* node;
 
@@ -46,14 +46,14 @@
     lock_.Acquire();
 
     int value;
-    mx_status_t result = value_ptr.copy_from_user(&value);
-    if (result != MX_OK) {
+    zx_status_t result = value_ptr.copy_from_user(&value);
+    if (result != ZX_OK) {
         lock_.Release();
         return result;
     }
     if (value != current_value) {
         lock_.Release();
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     ThreadDispatcher* thread = ThreadDispatcher::GetCurrent();
@@ -65,15 +65,15 @@
 
     // Block current thread.  This releases lock_ and does not reacquire it.
     result = node->BlockThread(&lock_, deadline);
-    if (result == MX_OK) {
+    if (result == ZX_OK) {
         DEBUG_ASSERT(!node->IsInQueue());
         // All the work necessary for removing us from the hash table was done by FutexWake()
-        return MX_OK;
+        return ZX_OK;
     }
 
-    // The following happens if we hit the deadline (MX_ERR_TIMED_OUT) or if
-    // the thread was killed (MX_ERR_INTERNAL_INTR_KILLED) or suspended
-    // (MX_ERR_INTERNAL_INTR_RETRY).
+    // The following happens if we hit the deadline (ZX_ERR_TIMED_OUT) or if
+    // the thread was killed (ZX_ERR_INTERNAL_INTR_KILLED) or suspended
+    // (ZX_ERR_INTERNAL_INTR_RETRY).
     //
     // We need to ensure that the thread's node is removed from the wait
     // queue, because FutexWake() probably didn't do that.
@@ -100,25 +100,25 @@
     // FutexWait() call returns a timeout status.  If that happens, and if
     // another thread is waiting on the mutex, then that thread won't get
     // woken -- the wakeup from the FutexWake() call would have got lost.
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t FutexContext::FutexWake(user_ptr<const int> value_ptr,
+zx_status_t FutexContext::FutexWake(user_ptr<const int> value_ptr,
                                     uint32_t count) {
     LTRACE_ENTRY;
 
-    if (count == 0) return MX_OK;
+    if (count == 0) return ZX_OK;
 
     uintptr_t futex_key = reinterpret_cast<uintptr_t>(value_ptr.get());
     if (futex_key % sizeof(int))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     AutoLock lock(&lock_);
 
     FutexNode* node = futex_table_.erase(futex_key);
     if (!node) {
         // nothing blocked on this futex if we can't find it
-        return MX_OK;
+        return ZX_OK;
     }
     DEBUG_ASSERT(node->GetKey() == futex_key);
 
@@ -136,28 +136,28 @@
         thread_reschedule();
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t FutexContext::FutexRequeue(user_ptr<int> wake_ptr, uint32_t wake_count, int current_value,
+zx_status_t FutexContext::FutexRequeue(user_ptr<int> wake_ptr, uint32_t wake_count, int current_value,
                                        user_ptr<int> requeue_ptr, uint32_t requeue_count) {
     LTRACE_ENTRY;
 
     if ((requeue_ptr.get() == nullptr) && requeue_count)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     AutoLock lock(&lock_);
 
     int value;
-    mx_status_t result = wake_ptr.copy_from_user(&value);
-    if (result != MX_OK) return result;
-    if (value != current_value) return MX_ERR_BAD_STATE;
+    zx_status_t result = wake_ptr.copy_from_user(&value);
+    if (result != ZX_OK) return result;
+    if (value != current_value) return ZX_ERR_BAD_STATE;
 
     uintptr_t wake_key = reinterpret_cast<uintptr_t>(wake_ptr.get());
     uintptr_t requeue_key = reinterpret_cast<uintptr_t>(requeue_ptr.get());
-    if (wake_key == requeue_key) return MX_ERR_INVALID_ARGS;
+    if (wake_key == requeue_key) return ZX_ERR_INVALID_ARGS;
     if (wake_key % sizeof(int) || requeue_key % sizeof(int))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // This must happen before RemoveFromHead() calls set_hash_key() on
     // nodes below, because operations on futex_table_ look at the GetKey
@@ -165,7 +165,7 @@
     FutexNode* node = futex_table_.erase(wake_key);
     if (!node) {
         // nothing blocked on this futex if we can't find it
-        return MX_OK;
+        return ZX_OK;
     }
 
     bool any_woken = false;
@@ -198,7 +198,7 @@
         thread_reschedule();
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void FutexContext::QueueNodesLocked(FutexNode* head) {
diff --git a/kernel/object/futex_node.cpp b/kernel/object/futex_node.cpp
index 6c7efd4..41bf897 100644
--- a/kernel/object/futex_node.cpp
+++ b/kernel/object/futex_node.cpp
@@ -148,7 +148,7 @@
 // This blocks the current thread.  This releases the given mutex (which
 // must be held when BlockThread() is called).  To reduce contention, it
 // does not reclaim the mutex on return.
-mx_status_t FutexNode::BlockThread(fbl::Mutex* mutex, mx_time_t deadline) TA_NO_THREAD_SAFETY_ANALYSIS {
+zx_status_t FutexNode::BlockThread(fbl::Mutex* mutex, zx_time_t deadline) TA_NO_THREAD_SAFETY_ANALYSIS {
     AutoThreadLock lock;
 
     // We specifically want reschedule=false here, otherwise the
@@ -157,7 +157,7 @@
     mutex_release_thread_locked(mutex->GetInternal(), /* reschedule= */ false);
 
     thread_t* current_thread = get_current_thread();
-    mx_status_t result;
+    zx_status_t result;
     current_thread->interruptable = true;
     result = wait_queue_block(&wait_queue_, deadline);
     current_thread->interruptable = false;
@@ -192,7 +192,7 @@
     // will release the lock and then arrange for a reschedule operation
     // (which leads to a smoother transition).
     AutoThreadLock lock;
-    return wait_queue_wake_one(&wait_queue_, /* reschedule */ false, MX_OK);
+    return wait_queue_wake_one(&wait_queue_, /* reschedule */ false, ZX_OK);
 }
 
 // Set |node1| and |node2|'s list pointers so that |node1| is immediately
diff --git a/kernel/object/glue.cpp b/kernel/object/glue.cpp
index 4b33db6..864ef28 100644
--- a/kernel/object/glue.cpp
+++ b/kernel/object/glue.cpp
@@ -69,7 +69,7 @@
 static PolicyManager* policy_manager;
 
 // Masks for building a Handle's base_value, which ProcessDispatcher
-// uses to create mx_handle_t values.
+// uses to create zx_handle_t values.
 //
 // base_value bit fields:
 //   [31..30]: Must be zero
@@ -149,7 +149,7 @@
     printf("WARNING: High handle count: %zu handles\n", count);
 }
 
-Handle* MakeHandle(fbl::RefPtr<Dispatcher> dispatcher, mx_rights_t rights) {
+Handle* MakeHandle(fbl::RefPtr<Dispatcher> dispatcher, zx_rights_t rights) {
     uint32_t* handle_count = nullptr;
     void* addr;
     uint32_t base_value;
@@ -182,7 +182,7 @@
     return new (addr) Handle(fbl::move(dispatcher), rights, base_value);
 }
 
-Handle* DupHandle(Handle* source, mx_rights_t rights, bool is_replace) {
+Handle* DupHandle(Handle* source, zx_rights_t rights, bool is_replace) {
     fbl::RefPtr<Dispatcher> dispatcher(source->dispatcher());
     uint32_t* handle_count;
     void* addr;
@@ -275,7 +275,7 @@
     handle_arena.Dump();
 }
 
-mx_status_t SetSystemExceptionPort(fbl::RefPtr<ExceptionPort> eport) {
+zx_status_t SetSystemExceptionPort(fbl::RefPtr<ExceptionPort> eport) {
     DEBUG_ASSERT(eport->type() == ExceptionPort::Type::JOB);
     return root_job->SetExceptionPort(fbl::move(eport));
 }
@@ -292,41 +292,41 @@
     return policy_manager;
 }
 
-mx_status_t validate_resource(mx_handle_t handle, uint32_t kind) {
+zx_status_t validate_resource(zx_handle_t handle, uint32_t kind) {
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<ResourceDispatcher> resource;
     auto status = up->GetDispatcher(handle, &resource);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     uint32_t rkind = resource->get_kind();
-    if ((rkind == MX_RSRC_KIND_ROOT) || (rkind == kind)) {
-        return MX_OK;
+    if ((rkind == ZX_RSRC_KIND_ROOT) || (rkind == kind)) {
+        return ZX_OK;
     }
-    return MX_ERR_ACCESS_DENIED;
+    return ZX_ERR_ACCESS_DENIED;
 }
 
-mx_status_t validate_ranged_resource(mx_handle_t handle, uint32_t kind, uint64_t low,
+zx_status_t validate_ranged_resource(zx_handle_t handle, uint32_t kind, uint64_t low,
                                      uint64_t high) {
     auto up = ProcessDispatcher::GetCurrent();
     fbl::RefPtr<ResourceDispatcher> resource;
     auto status = up->GetDispatcher(handle, &resource);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     uint32_t rsrc_kind = resource->get_kind();
-    if (rsrc_kind == MX_RSRC_KIND_ROOT) {
+    if (rsrc_kind == ZX_RSRC_KIND_ROOT) {
         // root resource is valid for everything
-        return MX_OK;
+        return ZX_OK;
     } else if (rsrc_kind == kind) {
         uint64_t rsrc_low, rsrc_high;
         resource->get_range(&rsrc_low, &rsrc_high);
         if (low >= rsrc_low && high <= rsrc_high) {
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
-    return MX_ERR_ACCESS_DENIED;
+    return ZX_ERR_ACCESS_DENIED;
 }
 
 // Counts and optionally prints all job/process descendants of a job.
@@ -348,7 +348,7 @@
 private:
     bool OnJob(JobDispatcher* job) final {
         if (prefix_ != nullptr) {
-            char name[MX_MAX_NAME_LEN];
+            char name[ZX_MAX_NAME_LEN];
             job->get_name(name);
             printf("%sjob %6" PRIu64 " '%s'\n", prefix_, job->get_koid(), name);
         }
@@ -360,7 +360,7 @@
         // count running processes that aren't attached to a debugger.
         // It's a race, but will stop us from re-killing a job that only has
         // blocked-by-debugger processes.
-        mx_info_process_t info = {};
+        zx_info_process_t info = {};
         process->GetInfo(&info);
         if (info.started && !info.exited && !info.debugger_attached) {
             num_running_processes_++;
@@ -376,7 +376,7 @@
             if (info.debugger_attached) {
                 tag = "dbg";
             }
-            char name[MX_MAX_NAME_LEN];
+            char name[ZX_MAX_NAME_LEN];
             process->get_name(name);
             printf("%sproc %5" PRIu64 " %4s '%s'\n",
                    prefix_, process->get_koid(), tag, name);
@@ -425,7 +425,7 @@
         } else {
             tag = "(next)";
         }
-        char name[MX_MAX_NAME_LEN];
+        char name[ZX_MAX_NAME_LEN];
         job->get_name(name);
         printf("OOM:   %s job %6" PRIu64 " '%s'\n", tag, job->get_koid(), name);
         if (kill) {
@@ -444,10 +444,10 @@
             killed = true;
         } else if (killed) {
             if (--next == 0) {
-                return MX_ERR_STOP;
+                return ZX_ERR_STOP;
             }
         }
-        return MX_OK;
+        return ZX_OK;
     });
 }
 
diff --git a/kernel/object/guest_dispatcher.cpp b/kernel/object/guest_dispatcher.cpp
index 93ab3db..3fa2a46 100644
--- a/kernel/object/guest_dispatcher.cpp
+++ b/kernel/object/guest_dispatcher.cpp
@@ -8,26 +8,26 @@
 
 #include <arch/hypervisor.h>
 #include <vm/vm_object.h>
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 
 // static
-mx_status_t GuestDispatcher::Create(fbl::RefPtr<VmObject> physmem,
+zx_status_t GuestDispatcher::Create(fbl::RefPtr<VmObject> physmem,
                                     fbl::RefPtr<Dispatcher>* dispatcher,
-                                    mx_rights_t* rights) {
+                                    zx_rights_t* rights) {
     fbl::unique_ptr<Guest> guest;
-    mx_status_t status = arch_guest_create(physmem, &guest);
-    if (status != MX_OK)
+    zx_status_t status = arch_guest_create(physmem, &guest);
+    if (status != ZX_OK)
         return status;
 
     fbl::AllocChecker ac;
     auto disp = new (&ac) GuestDispatcher(fbl::move(guest));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    *rights = MX_DEFAULT_GUEST_RIGHTS;
+    *rights = ZX_DEFAULT_GUEST_RIGHTS;
     *dispatcher = fbl::AdoptRef<Dispatcher>(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 GuestDispatcher::GuestDispatcher(fbl::unique_ptr<Guest> guest)
@@ -35,7 +35,7 @@
 
 GuestDispatcher::~GuestDispatcher() {}
 
-mx_status_t GuestDispatcher::SetTrap(uint32_t kind, mx_vaddr_t addr, size_t len,
+zx_status_t GuestDispatcher::SetTrap(uint32_t kind, zx_vaddr_t addr, size_t len,
                                      fbl::RefPtr<PortDispatcher> port, uint64_t key) {
     canary_.Assert();
 
diff --git a/kernel/object/handle.cpp b/kernel/object/handle.cpp
index 794b4eb..709c39b 100644
--- a/kernel/object/handle.cpp
+++ b/kernel/object/handle.cpp
@@ -16,7 +16,7 @@
       base_value_(base_value) {
 }
 
-Handle::Handle(const Handle* rhs, mx_rights_t rights, uint32_t base_value)
+Handle::Handle(const Handle* rhs, zx_rights_t rights, uint32_t base_value)
     : process_id_(rhs->process_id_),
       dispatcher_(rhs->dispatcher_),
       rights_(rights),
diff --git a/kernel/object/include/object/channel_dispatcher.h b/kernel/object/include/object/channel_dispatcher.h
index 8e028dc..3d1fcae 100644
--- a/kernel/object/include/object/channel_dispatcher.h
+++ b/kernel/object/include/object/channel_dispatcher.h
@@ -13,7 +13,7 @@
 #include <object/message_packet.h>
 #include <object/state_tracker.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/mutex.h>
@@ -24,37 +24,37 @@
 public:
     class MessageWaiter;
 
-    static mx_status_t Create(fbl::RefPtr<Dispatcher>* dispatcher0,
-                              fbl::RefPtr<Dispatcher>* dispatcher1, mx_rights_t* rights);
+    static zx_status_t Create(fbl::RefPtr<Dispatcher>* dispatcher0,
+                              fbl::RefPtr<Dispatcher>* dispatcher1, zx_rights_t* rights);
 
     ~ChannelDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_CHANNEL; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_CHANNEL; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
-    mx_status_t add_observer(StateObserver* observer) final;
-    mx_koid_t get_related_koid() const final TA_REQ(lock_) { return other_koid_; }
-    mx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
+    zx_status_t add_observer(StateObserver* observer) final;
+    zx_koid_t get_related_koid() const final TA_REQ(lock_) { return other_koid_; }
+    zx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
 
     void on_zero_handles() final;
 
     // Read from this endpoint's message queue.
     // |msg_size| and |msg_handle_count| are in-out parameters. As input, they specify the maximum
-    // size and handle count, respectively. On MX_OK or MX_ERR_BUFFER_TOO_SMALL, they specify the
+    // size and handle count, respectively. On ZX_OK or ZX_ERR_BUFFER_TOO_SMALL, they specify the
     // actual size and handle count of the next message. The next message is returned in |*msg| on
-    // MX_OK and also on MX_ERR_BUFFER_TOO_SMALL when |may_discard| is set.
-    mx_status_t Read(uint32_t* msg_size,
+    // ZX_OK and also on ZX_ERR_BUFFER_TOO_SMALL when |may_discard| is set.
+    zx_status_t Read(uint32_t* msg_size,
                      uint32_t* msg_handle_count,
                      fbl::unique_ptr<MessagePacket>* msg,
                      bool may_disard);
 
     // Write to the opposing endpoint's message queue.
-    mx_status_t Write(fbl::unique_ptr<MessagePacket> msg);
-    mx_status_t Call(fbl::unique_ptr<MessagePacket> msg,
-                     mx_time_t deadline, bool* return_handles,
+    zx_status_t Write(fbl::unique_ptr<MessagePacket> msg);
+    zx_status_t Call(fbl::unique_ptr<MessagePacket> msg,
+                     zx_time_t deadline, bool* return_handles,
                      fbl::unique_ptr<MessagePacket>* reply);
 
     // Performs the wait-then-read half of Call.  This is meant for retrying
     // after an interruption caused by suspending.
-    mx_status_t ResumeInterruptedCall(MessageWaiter* waiter, mx_time_t deadline,
+    zx_status_t ResumeInterruptedCall(MessageWaiter* waiter, zx_time_t deadline,
                                       fbl::unique_ptr<MessagePacket>* reply);
 
     // MessageWaiter's state is guarded by the lock of the
@@ -69,19 +69,19 @@
     // See also: comments in ChannelDispatcher::Call()
     class MessageWaiter : public fbl::DoublyLinkedListable<MessageWaiter*> {
     public:
-        MessageWaiter() : txid_(0), status_(MX_ERR_BAD_STATE) {
+        MessageWaiter() : txid_(0), status_(ZX_ERR_BAD_STATE) {
         }
 
         ~MessageWaiter();
 
-        mx_status_t BeginWait(fbl::RefPtr<ChannelDispatcher> channel, mx_txid_t txid);
+        zx_status_t BeginWait(fbl::RefPtr<ChannelDispatcher> channel, zx_txid_t txid);
         int Deliver(fbl::unique_ptr<MessagePacket> msg);
-        int Cancel(mx_status_t status);
+        int Cancel(zx_status_t status);
         fbl::RefPtr<ChannelDispatcher> get_channel() { return channel_; }
-        mx_txid_t get_txid() const { return txid_; }
-        mx_status_t Wait(lk_time_t deadline);
+        zx_txid_t get_txid() const { return txid_; }
+        zx_status_t Wait(lk_time_t deadline);
         // Returns any delivered message via out and the status.
-        mx_status_t EndWait(fbl::unique_ptr<MessagePacket>* out);
+        zx_status_t EndWait(fbl::unique_ptr<MessagePacket>* out);
 
     private:
         fbl::RefPtr<ChannelDispatcher> channel_;
@@ -89,8 +89,8 @@
         // TODO(teisenbe/swetland): Investigate hoisting this outside to reduce
         // userthread size
         Event event_;
-        mx_txid_t txid_;
-        mx_status_t status_;
+        zx_txid_t txid_;
+        zx_status_t status_;
     };
 
 private:
@@ -102,7 +102,7 @@
     ChannelDispatcher();
     void Init(fbl::RefPtr<ChannelDispatcher> other);
     int WriteSelf(fbl::unique_ptr<MessagePacket> msg);
-    mx_status_t UserSignalSelf(uint32_t clear_mask, uint32_t set_mask);
+    zx_status_t UserSignalSelf(uint32_t clear_mask, uint32_t set_mask);
     void OnPeerZeroHandles();
 
     fbl::Canary<fbl::magic("CHAN")> canary_;
@@ -112,5 +112,5 @@
     WaiterList waiters_ TA_GUARDED(lock_);
     StateTracker state_tracker_;
     fbl::RefPtr<ChannelDispatcher> other_ TA_GUARDED(lock_);
-    mx_koid_t other_koid_ TA_GUARDED(lock_);
+    zx_koid_t other_koid_ TA_GUARDED(lock_);
 };
diff --git a/kernel/object/include/object/diagnostics.h b/kernel/object/include/object/diagnostics.h
index d100e41..ad5e487 100644
--- a/kernel/object/include/object/diagnostics.h
+++ b/kernel/object/include/object/diagnostics.h
@@ -7,8 +7,8 @@
 #pragma once
 
 #include <lib/user_copy/user_ptr.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 #include <fbl/ref_ptr.h>
 
 class ProcessDispatcher;
@@ -20,8 +20,8 @@
 // been written is returned via |available|.
 // NOTE: Code outside of the syscall layer should not typically know about
 // user_ptrs; do not use this pattern as an example.
-mx_status_t GetVmAspaceMaps(fbl::RefPtr<VmAspace> aspace,
-                            user_ptr<mx_info_maps_t> maps, size_t max,
+zx_status_t GetVmAspaceMaps(fbl::RefPtr<VmAspace> aspace,
+                            user_ptr<zx_info_maps_t> maps, size_t max,
                             size_t* actual, size_t* available);
 
 // Walks the VmAspace and writes entries that describe its mapped VMOs into
@@ -30,8 +30,8 @@
 // have been written is returned via |available|.
 // NOTE: Code outside of the syscall layer should not typically know about
 // user_ptrs; do not use this pattern as an example.
-mx_status_t GetVmAspaceVmos(fbl::RefPtr<VmAspace> aspace,
-                            user_ptr<mx_info_vmo_t> vmos, size_t max,
+zx_status_t GetVmAspaceVmos(fbl::RefPtr<VmAspace> aspace,
+                            user_ptr<zx_info_vmo_t> vmos, size_t max,
                             size_t* actual, size_t* available);
 
 // For every VMO in the process's handle table, writes an entry into |vmos|,
@@ -40,8 +40,8 @@
 // been written is returned via |available|.
 // NOTE: Code outside of the syscall layer should not typically know about
 // user_ptrs; do not use this pattern as an example.
-mx_status_t GetProcessVmosViaHandles(ProcessDispatcher* process,
-                                     user_ptr<mx_info_vmo_t> vmos, size_t max,
+zx_status_t GetProcessVmosViaHandles(ProcessDispatcher* process,
+                                     user_ptr<zx_info_vmo_t> vmos, size_t max,
                                      size_t* actual, size_t* available);
 
 // Prints (with the supplied prefix) the number of mapped, committed bytes for
diff --git a/kernel/object/include/object/dispatcher.h b/kernel/object/include/object/dispatcher.h
index e8193b3..7e5721b 100644
--- a/kernel/object/include/object/dispatcher.h
+++ b/kernel/object/include/object/dispatcher.h
@@ -9,8 +9,8 @@
 #include <err.h>
 #include <stdint.h>
 
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 #include <fbl/ref_counted.h>
 #include <fbl/ref_ptr.h>
 #include <fbl/unique_ptr.h>
@@ -21,27 +21,27 @@
 #define DECLARE_DISPTAG(T, E)               \
 class T;                                    \
 template <> struct DispatchTag<T> {         \
-    static constexpr mx_obj_type_t ID = E;  \
+    static constexpr zx_obj_type_t ID = E;  \
 };
 
-DECLARE_DISPTAG(ProcessDispatcher, MX_OBJ_TYPE_PROCESS)
-DECLARE_DISPTAG(ThreadDispatcher, MX_OBJ_TYPE_THREAD)
-DECLARE_DISPTAG(VmObjectDispatcher, MX_OBJ_TYPE_VMO)
-DECLARE_DISPTAG(ChannelDispatcher, MX_OBJ_TYPE_CHANNEL)
-DECLARE_DISPTAG(EventDispatcher, MX_OBJ_TYPE_EVENT)
-DECLARE_DISPTAG(PortDispatcher, MX_OBJ_TYPE_PORT)
-DECLARE_DISPTAG(InterruptDispatcher, MX_OBJ_TYPE_INTERRUPT)
-DECLARE_DISPTAG(PciDeviceDispatcher, MX_OBJ_TYPE_PCI_DEVICE)
-DECLARE_DISPTAG(LogDispatcher, MX_OBJ_TYPE_LOG)
-DECLARE_DISPTAG(SocketDispatcher, MX_OBJ_TYPE_SOCKET)
-DECLARE_DISPTAG(ResourceDispatcher, MX_OBJ_TYPE_RESOURCE)
-DECLARE_DISPTAG(EventPairDispatcher, MX_OBJ_TYPE_EVENT_PAIR)
-DECLARE_DISPTAG(JobDispatcher, MX_OBJ_TYPE_JOB)
-DECLARE_DISPTAG(VmAddressRegionDispatcher, MX_OBJ_TYPE_VMAR)
-DECLARE_DISPTAG(FifoDispatcher, MX_OBJ_TYPE_FIFO)
-DECLARE_DISPTAG(GuestDispatcher, MX_OBJ_TYPE_GUEST)
-DECLARE_DISPTAG(VcpuDispatcher, MX_OBJ_TYPE_VCPU)
-DECLARE_DISPTAG(TimerDispatcher, MX_OBJ_TYPE_TIMER)
+DECLARE_DISPTAG(ProcessDispatcher, ZX_OBJ_TYPE_PROCESS)
+DECLARE_DISPTAG(ThreadDispatcher, ZX_OBJ_TYPE_THREAD)
+DECLARE_DISPTAG(VmObjectDispatcher, ZX_OBJ_TYPE_VMO)
+DECLARE_DISPTAG(ChannelDispatcher, ZX_OBJ_TYPE_CHANNEL)
+DECLARE_DISPTAG(EventDispatcher, ZX_OBJ_TYPE_EVENT)
+DECLARE_DISPTAG(PortDispatcher, ZX_OBJ_TYPE_PORT)
+DECLARE_DISPTAG(InterruptDispatcher, ZX_OBJ_TYPE_INTERRUPT)
+DECLARE_DISPTAG(PciDeviceDispatcher, ZX_OBJ_TYPE_PCI_DEVICE)
+DECLARE_DISPTAG(LogDispatcher, ZX_OBJ_TYPE_LOG)
+DECLARE_DISPTAG(SocketDispatcher, ZX_OBJ_TYPE_SOCKET)
+DECLARE_DISPTAG(ResourceDispatcher, ZX_OBJ_TYPE_RESOURCE)
+DECLARE_DISPTAG(EventPairDispatcher, ZX_OBJ_TYPE_EVENT_PAIR)
+DECLARE_DISPTAG(JobDispatcher, ZX_OBJ_TYPE_JOB)
+DECLARE_DISPTAG(VmAddressRegionDispatcher, ZX_OBJ_TYPE_VMAR)
+DECLARE_DISPTAG(FifoDispatcher, ZX_OBJ_TYPE_FIFO)
+DECLARE_DISPTAG(GuestDispatcher, ZX_OBJ_TYPE_GUEST)
+DECLARE_DISPTAG(VcpuDispatcher, ZX_OBJ_TYPE_VCPU)
+DECLARE_DISPTAG(TimerDispatcher, ZX_OBJ_TYPE_TIMER)
 
 #undef DECLARE_DISPTAG
 
@@ -54,39 +54,39 @@
     Dispatcher();
     virtual ~Dispatcher();
 
-    mx_koid_t get_koid() const { return koid_; }
+    zx_koid_t get_koid() const { return koid_; }
 
     // Updating |handle_count_| is done at the Handle management layer.
     uint32_t* get_handle_count_ptr() { return &handle_count_; }
 
     // Interface for derived classes.
 
-    virtual mx_obj_type_t get_type() const = 0;
+    virtual zx_obj_type_t get_type() const = 0;
 
     virtual StateTracker* get_state_tracker() { return nullptr; }
 
-    virtual mx_status_t add_observer(StateObserver* observer);
+    virtual zx_status_t add_observer(StateObserver* observer);
 
-    virtual mx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer);
+    virtual zx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer);
 
     virtual void on_zero_handles() { }
 
-    virtual mx_koid_t get_related_koid() const { return 0ULL; }
+    virtual zx_koid_t get_related_koid() const { return 0ULL; }
 
-    // get_name() will return a null-terminated name of MX_MAX_NAME_LEN - 1 or fewer
+    // get_name() will return a null-terminated name of ZX_MAX_NAME_LEN - 1 or fewer
     // characters.  For objects that don't have names it will be "".
-    virtual void get_name(char out_name[MX_MAX_NAME_LEN]) const { out_name[0] = 0; }
+    virtual void get_name(char out_name[ZX_MAX_NAME_LEN]) const { out_name[0] = 0; }
 
-    // set_name() will truncate to MX_MAX_NAME_LEN - 1 and ensure there is a
+    // set_name() will truncate to ZX_MAX_NAME_LEN - 1 and ensure there is a
     // terminating null
-    virtual mx_status_t set_name(const char* name, size_t len) { return MX_ERR_NOT_SUPPORTED; }
+    virtual zx_status_t set_name(const char* name, size_t len) { return ZX_ERR_NOT_SUPPORTED; }
 
     // Dispatchers that support get/set cookie must provide
     // a CookieJar for those cookies to be stored in.
     virtual CookieJar* get_cookie_jar() { return nullptr; }
 
 private:
-    const mx_koid_t koid_;
+    const zx_koid_t koid_;
     uint32_t handle_count_;
 };
 
diff --git a/kernel/object/include/object/event_dispatcher.h b/kernel/object/include/object/event_dispatcher.h
index f61d49e..7cbb6b9 100644
--- a/kernel/object/include/object/event_dispatcher.h
+++ b/kernel/object/include/object/event_dispatcher.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <object/dispatcher.h>
 #include <object/state_tracker.h>
@@ -15,14 +15,14 @@
 
 class EventDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(uint32_t options, fbl::RefPtr<Dispatcher>* dispatcher,
-                              mx_rights_t* rights);
+    static zx_status_t Create(uint32_t options, fbl::RefPtr<Dispatcher>* dispatcher,
+                              zx_rights_t* rights);
 
     ~EventDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_EVENT; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_EVENT; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
     CookieJar* get_cookie_jar() final { return &cookie_jar_; }
-    mx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
+    zx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
 
 private:
     explicit EventDispatcher(uint32_t options);
diff --git a/kernel/object/include/object/event_pair_dispatcher.h b/kernel/object/include/object/event_pair_dispatcher.h
index fb70e8c..e0f612e 100644
--- a/kernel/object/include/object/event_pair_dispatcher.h
+++ b/kernel/object/include/object/event_pair_dispatcher.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/mutex.h>
 #include <fbl/ref_ptr.h>
@@ -16,17 +16,17 @@
 
 class EventPairDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(fbl::RefPtr<Dispatcher>* dispatcher0,
+    static zx_status_t Create(fbl::RefPtr<Dispatcher>* dispatcher0,
                               fbl::RefPtr<Dispatcher>* dispatcher1,
-                              mx_rights_t* rights);
+                              zx_rights_t* rights);
 
     ~EventPairDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_EVENT_PAIR; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_EVENT_PAIR; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
     CookieJar* get_cookie_jar() final { return &cookie_jar_; }
-    mx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
+    zx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
     void on_zero_handles() final;
-    mx_koid_t get_related_koid() const final { return other_koid_; }
+    zx_koid_t get_related_koid() const final { return other_koid_; }
 
 private:
     EventPairDispatcher();
@@ -39,7 +39,7 @@
     StateTracker state_tracker_;
 
     // Set in Init(); never changes otherwise.
-    mx_koid_t other_koid_;
+    zx_koid_t other_koid_;
 
     // Protects |other_| (except in Init(), where it's not needed).
     fbl::Mutex lock_;
diff --git a/kernel/object/include/object/excp_port.h b/kernel/object/include/object/excp_port.h
index 18a1530..6b5d86d 100644
--- a/kernel/object/include/object/excp_port.h
+++ b/kernel/object/include/object/excp_port.h
@@ -12,9 +12,9 @@
 #include <kernel/mutex.h>
 #include <object/dispatcher.h>
 
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/port.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/types.h>
 #include <fbl/auto_lock.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
@@ -34,14 +34,14 @@
 public:
     enum class Type { NONE, DEBUGGER, THREAD, PROCESS, JOB};
 
-    static mx_status_t Create(Type type, fbl::RefPtr<PortDispatcher> port,
+    static zx_status_t Create(Type type, fbl::RefPtr<PortDispatcher> port,
                               uint64_t port_key,
                               fbl::RefPtr<ExceptionPort>* eport);
     ~ExceptionPort();
 
     Type type() const { return type_; }
 
-    mx_status_t SendPacket(ThreadDispatcher* thread, uint32_t type);
+    zx_status_t SendPacket(ThreadDispatcher* thread, uint32_t type);
 
     void OnThreadStart(ThreadDispatcher* thread);
 
@@ -62,7 +62,7 @@
     // Called by the target when the port is explicitly unbound.
     void OnTargetUnbind();
 
-    static void BuildArchReport(mx_exception_report_t* report, uint32_t type,
+    static void BuildArchReport(zx_exception_report_t* report, uint32_t type,
                                 const arch_exception_context_t* arch_context);
 
 private:
@@ -73,7 +73,7 @@
     ExceptionPort(const ExceptionPort&) = delete;
     ExceptionPort& operator=(const ExceptionPort&) = delete;
 
-    mx_status_t SendPacketWorker(uint32_t type, mx_koid_t pid, mx_koid_t tid);
+    zx_status_t SendPacketWorker(uint32_t type, zx_koid_t pid, zx_koid_t tid);
 
     // Unbinds from the target if bound, and drops the ref to |port_|.
     // Called by |port_| when it reaches zero handles.
@@ -93,7 +93,7 @@
         return target_ != nullptr;
     }
 
-    static void BuildReport(mx_exception_report_t* report, uint32_t type);
+    static void BuildReport(zx_exception_report_t* report, uint32_t type);
 
     fbl::Canary<fbl::magic("EXCP")> canary_;
 
@@ -118,7 +118,7 @@
 
 // Sets the system exception port. |eport| must be non-null; use
 // ResetSystemExceptionPort() to remove the currently-set port.
-mx_status_t SetSystemExceptionPort(fbl::RefPtr<ExceptionPort> eport);
+zx_status_t SetSystemExceptionPort(fbl::RefPtr<ExceptionPort> eport);
 
 // Removes the system exception port. Returns true if a port had been set.
 bool ResetSystemExceptionPort();
diff --git a/kernel/object/include/object/fifo_dispatcher.h b/kernel/object/include/object/fifo_dispatcher.h
index 7a0d674..b0bd5a3 100644
--- a/kernel/object/include/object/fifo_dispatcher.h
+++ b/kernel/object/include/object/fifo_dispatcher.h
@@ -11,46 +11,46 @@
 #include <object/dispatcher.h>
 #include <object/state_tracker.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/mutex.h>
 #include <fbl/ref_counted.h>
 
-typedef mx_status_t (*fifo_copy_from_fn_t)(const uint8_t* ptr, uint8_t* data, size_t len);
-typedef mx_status_t (*fifo_copy_to_fn_t)(uint8_t* ptr, const uint8_t* data, size_t len);
+typedef zx_status_t (*fifo_copy_from_fn_t)(const uint8_t* ptr, uint8_t* data, size_t len);
+typedef zx_status_t (*fifo_copy_to_fn_t)(uint8_t* ptr, const uint8_t* data, size_t len);
 
 class FifoDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(uint32_t elem_count, uint32_t elem_size, uint32_t options,
+    static zx_status_t Create(uint32_t elem_count, uint32_t elem_size, uint32_t options,
                               fbl::RefPtr<Dispatcher>* dispatcher0,
                               fbl::RefPtr<Dispatcher>* dispatcher1,
-                              mx_rights_t* rights);
+                              zx_rights_t* rights);
 
     ~FifoDispatcher() final;
 
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_FIFO; }
-    mx_koid_t get_related_koid() const final { return peer_koid_; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_FIFO; }
+    zx_koid_t get_related_koid() const final { return peer_koid_; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
     void on_zero_handles() final;
-    mx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
+    zx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
 
-    mx_status_t Write(const uint8_t* src, size_t len, uint32_t* actual);
-    mx_status_t Read(uint8_t* dst, size_t len, uint32_t* actual);
+    zx_status_t Write(const uint8_t* src, size_t len, uint32_t* actual);
+    zx_status_t Read(uint8_t* dst, size_t len, uint32_t* actual);
 
-    mx_status_t WriteFromUser(const uint8_t* src, size_t len, uint32_t* actual);
-    mx_status_t ReadToUser(uint8_t* dst, size_t len, uint32_t* actual);
+    zx_status_t WriteFromUser(const uint8_t* src, size_t len, uint32_t* actual);
+    zx_status_t ReadToUser(uint8_t* dst, size_t len, uint32_t* actual);
 
 private:
     FifoDispatcher(uint32_t options, uint32_t elem_count, uint32_t elem_size,
                    fbl::unique_ptr<uint8_t[]> data);
     void Init(fbl::RefPtr<FifoDispatcher> other);
-    mx_status_t Write(const uint8_t* ptr, size_t len, uint32_t* actual,
+    zx_status_t Write(const uint8_t* ptr, size_t len, uint32_t* actual,
                       fifo_copy_from_fn_t copy_from_fn);
-    mx_status_t WriteSelf(const uint8_t* ptr, size_t len, uint32_t* actual,
+    zx_status_t WriteSelf(const uint8_t* ptr, size_t len, uint32_t* actual,
                           fifo_copy_from_fn_t copy_from_fn);
-    mx_status_t Read(uint8_t* ptr, size_t len, uint32_t* actual,
+    zx_status_t Read(uint8_t* ptr, size_t len, uint32_t* actual,
                      fifo_copy_to_fn_t copy_to_fn);
-    mx_status_t UserSignalSelf(uint32_t clear_mask, uint32_t set_mask);
+    zx_status_t UserSignalSelf(uint32_t clear_mask, uint32_t set_mask);
 
     void OnPeerZeroHandles();
 
@@ -58,7 +58,7 @@
     const uint32_t elem_count_;
     const uint32_t elem_size_;
     const uint32_t mask_;
-    mx_koid_t peer_koid_;
+    zx_koid_t peer_koid_;
     StateTracker state_tracker_;
 
     fbl::Mutex lock_;
diff --git a/kernel/object/include/object/futex_context.h b/kernel/object/include/object/futex_context.h
index 43296d9..7e06dd4 100644
--- a/kernel/object/include/object/futex_context.h
+++ b/kernel/object/include/object/futex_context.h
@@ -7,7 +7,7 @@
 #pragma once
 
 #include <lib/user_copy/user_ptr.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/mutex.h>
 #include <object/futex_node.h>
 
@@ -33,10 +33,10 @@
     // Otherwise it will block the current thread until the |deadline| passes,
     // or until the thread is woken by a FutexWake or FutexRequeue operation
     // on the same |value_ptr| futex.
-    mx_status_t FutexWait(user_ptr<int> value_ptr, int current_value, mx_time_t deadline);
+    zx_status_t FutexWait(user_ptr<int> value_ptr, int current_value, zx_time_t deadline);
 
     // FutexWake will wake up to |count| number of threads blocked on the |value_ptr| futex.
-    mx_status_t FutexWake(user_ptr<const int> value_ptr, uint32_t count);
+    zx_status_t FutexWake(user_ptr<const int> value_ptr, uint32_t count);
 
     // FutexWait first verifies that the integer pointed to by |wake_ptr|
     // still equals |current_value|. If the test fails, FutexWait returns FAILED_PRECONDITION.
@@ -44,7 +44,7 @@
     // If any other threads remain blocked on on the |wake_ptr| futex, up to |requeue_count|
     // of them will then be requeued to the tail of the list of threads
     // blocked on the |requeue_ptr| futex.
-    mx_status_t FutexRequeue(user_ptr<int> wake_ptr, uint32_t wake_count, int current_value,
+    zx_status_t FutexRequeue(user_ptr<int> wake_ptr, uint32_t wake_count, int current_value,
                              user_ptr<int> requeue_ptr, uint32_t requeue_count);
 
 private:
diff --git a/kernel/object/include/object/futex_node.h b/kernel/object/include/object/futex_node.h
index 049e5df..452011f 100644
--- a/kernel/object/include/object/futex_node.h
+++ b/kernel/object/include/object/futex_node.h
@@ -9,7 +9,7 @@
 #include <kernel/thread.h>
 #include <kernel/wait.h>
 #include <list.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/intrusive_hash_table.h>
 #include <fbl/mutex.h>
 
@@ -42,7 +42,7 @@
                                      uintptr_t new_hash_key);
 
     // This must be called with |mutex| held and returns without |mutex| held.
-    mx_status_t BlockThread(fbl::Mutex* mutex, mx_time_t deadline) TA_REL(mutex);
+    zx_status_t BlockThread(fbl::Mutex* mutex, zx_time_t deadline) TA_REL(mutex);
 
     void set_hash_key(uintptr_t key) {
         hash_key_ = key;
diff --git a/kernel/object/include/object/guest_dispatcher.h b/kernel/object/include/object/guest_dispatcher.h
index f7e281c..cb4bccb 100644
--- a/kernel/object/include/object/guest_dispatcher.h
+++ b/kernel/object/include/object/guest_dispatcher.h
@@ -6,8 +6,8 @@
 
 #pragma once
 
-#include <magenta/syscalls/hypervisor.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/hypervisor.h>
+#include <zircon/types.h>
 #include <object/port_dispatcher.h>
 
 class Guest;
@@ -15,15 +15,15 @@
 
 class GuestDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(fbl::RefPtr<VmObject> physmem,
+    static zx_status_t Create(fbl::RefPtr<VmObject> physmem,
                               fbl::RefPtr<Dispatcher>* dispatcher,
-                              mx_rights_t* rights);
+                              zx_rights_t* rights);
     ~GuestDispatcher();
 
-    mx_obj_type_t get_type() const { return MX_OBJ_TYPE_GUEST; }
+    zx_obj_type_t get_type() const { return ZX_OBJ_TYPE_GUEST; }
     Guest* guest() const { return guest_.get(); }
 
-    mx_status_t SetTrap(uint32_t kind, mx_vaddr_t addr, size_t len,
+    zx_status_t SetTrap(uint32_t kind, zx_vaddr_t addr, size_t len,
                         fbl::RefPtr<PortDispatcher> port, uint64_t key);
 
 private:
diff --git a/kernel/object/include/object/handle.h b/kernel/object/include/object/handle.h
index 7e4d9e3..717c526 100644
--- a/kernel/object/include/object/handle.h
+++ b/kernel/object/include/object/handle.h
@@ -8,7 +8,7 @@
 
 #include <stdint.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/ref_ptr.h>
 
@@ -28,12 +28,12 @@
 
     // Returns the process that owns this instance. Used to guarantee
     // that one process may not access a handle owned by a different process.
-    mx_koid_t process_id() const {
+    zx_koid_t process_id() const {
         return process_id_;
     }
 
     // Sets the value returned by process_id().
-    void set_process_id(mx_koid_t pid) {
+    void set_process_id(zx_koid_t pid) {
         process_id_ = pid;
     }
 
@@ -44,13 +44,13 @@
     }
 
     // Returns true if this handle has all of the desired rights bits set.
-    bool HasRights(mx_rights_t desired) const {
+    bool HasRights(zx_rights_t desired) const {
         return (rights_ & desired) == desired;
     }
 
     // Returns a value that can be decoded by MapU32ToHandle() to derive
     // a pointer to this instance. ProcessDispatcher will XOR this with
-    // its |handle_rand_| to create the mx_handle_t value that user
+    // its |handle_rand_| to create the zx_handle_t value that user
     // space sees.
     uint32_t base_value() const {
         return base_value_;
@@ -60,12 +60,12 @@
     // Handle should never be created by anything other than
     // MakeHandle or DupHandle.
     friend Handle* MakeHandle(fbl::RefPtr<Dispatcher> dispatcher,
-                              mx_rights_t rights);
-    friend Handle* DupHandle(Handle* source, mx_rights_t rights, bool is_replace);
+                              zx_rights_t rights);
+    friend Handle* DupHandle(Handle* source, zx_rights_t rights, bool is_replace);
     Handle(const Handle&) = delete;
-    Handle(fbl::RefPtr<Dispatcher> dispatcher, mx_rights_t rights,
+    Handle(fbl::RefPtr<Dispatcher> dispatcher, zx_rights_t rights,
            uint32_t base_value);
-    Handle(const Handle* rhs, mx_rights_t rights, uint32_t base_value);
+    Handle(const Handle* rhs, zx_rights_t rights, uint32_t base_value);
 
     Handle& operator=(const Handle&) = delete;
 
@@ -74,8 +74,8 @@
     friend void internal::TearDownHandle(Handle* handle);
     ~Handle() = default;
 
-    mx_koid_t process_id_;
+    zx_koid_t process_id_;
     fbl::RefPtr<Dispatcher> dispatcher_;
-    const mx_rights_t rights_;
+    const zx_rights_t rights_;
     const uint32_t base_value_;
 };
diff --git a/kernel/object/include/object/handles.h b/kernel/object/include/object/handles.h
index 15d0468..5d7df76 100644
--- a/kernel/object/include/object/handles.h
+++ b/kernel/object/include/object/handles.h
@@ -8,7 +8,7 @@
 
 #include <stdint.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/ref_ptr.h>
 
 class Dispatcher;
@@ -16,14 +16,14 @@
 
 // Creates a handle attached to |dispatcher| and with |rights| from a
 // specific arena which makes their addresses come from a fixed range.
-Handle* MakeHandle(fbl::RefPtr<Dispatcher> dispatcher, mx_rights_t rights);
+Handle* MakeHandle(fbl::RefPtr<Dispatcher> dispatcher, zx_rights_t rights);
 
 // Duplicate a handle created by MakeHandle(). If |is_replace| is true
-// then the logic to triger MX_SIGNAL_LAST_HANDLE is not executed.
-Handle* DupHandle(Handle* source, mx_rights_t rights, bool is_replace);
+// then the logic to triger ZX_SIGNAL_LAST_HANDLE is not executed.
+Handle* DupHandle(Handle* source, zx_rights_t rights, bool is_replace);
 
 // Deletes a handle created by MakeHandle() or DupHandle(). This might
-// trigger MX_SIGNAL_LAST_HANDLE.
+// trigger ZX_SIGNAL_LAST_HANDLE.
 void DeleteHandle(Handle* handle);
 
 // Maps an integer obtained by Handle->base_value() back to a Handle.
diff --git a/kernel/object/include/object/interrupt_dispatcher.h b/kernel/object/include/object/interrupt_dispatcher.h
index 0b747f7..da149cc 100644
--- a/kernel/object/include/object/interrupt_dispatcher.h
+++ b/kernel/object/include/object/interrupt_dispatcher.h
@@ -7,7 +7,7 @@
 #pragma once
 
 #include <kernel/event.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <object/dispatcher.h>
 #include <sys/types.h>
@@ -27,22 +27,22 @@
 public:
     InterruptDispatcher& operator=(const InterruptDispatcher &) = delete;
 
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_INTERRUPT; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_INTERRUPT; }
 
     // Notify the system that the caller has finished processing the interrupt.
     // Required before the handle can be waited upon again.
-    virtual mx_status_t InterruptComplete() = 0;
+    virtual zx_status_t InterruptComplete() = 0;
 
     // Signal the IRQ from non-IRQ state in response to a user-land request.
-    virtual mx_status_t UserSignal() = 0;
+    virtual zx_status_t UserSignal() = 0;
 
-    mx_status_t WaitForInterrupt() {
+    zx_status_t WaitForInterrupt() {
         return event_wait_deadline(&event_, INFINITE_TIME, true);
     }
 
     virtual void on_zero_handles() final {
         // Ensure any waiters stop waiting
-        event_signal_etc(&event_, false, MX_ERR_CANCELED);
+        event_signal_etc(&event_, false, ZX_ERR_CANCELED);
     }
 
 protected:
diff --git a/kernel/object/include/object/interrupt_event_dispatcher.h b/kernel/object/include/object/interrupt_event_dispatcher.h
index 2758c71..e90cc44 100644
--- a/kernel/object/include/object/interrupt_event_dispatcher.h
+++ b/kernel/object/include/object/interrupt_event_dispatcher.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_wavl_tree.h>
 #include <fbl/mutex.h>
@@ -15,17 +15,17 @@
 
 class InterruptEventDispatcher final : public InterruptDispatcher {
 public:
-    static mx_status_t Create(uint32_t vector,
+    static zx_status_t Create(uint32_t vector,
                               uint32_t flags,
                               fbl::RefPtr<Dispatcher>* dispatcher,
-                              mx_rights_t* rights);
+                              zx_rights_t* rights);
 
     InterruptEventDispatcher(const InterruptDispatcher &) = delete;
     InterruptEventDispatcher& operator=(const InterruptDispatcher &) = delete;
 
     ~InterruptEventDispatcher() final;
-    mx_status_t InterruptComplete() final;
-    mx_status_t UserSignal() final;
+    zx_status_t InterruptComplete() final;
+    zx_status_t UserSignal() final;
 
     // requred to exist in our collection of allocated vectors.
     uint32_t GetKey() const { return vector_; }
diff --git a/kernel/object/include/object/job_dispatcher.h b/kernel/object/include/object/job_dispatcher.h
index 08f0ceb..dec36e3 100644
--- a/kernel/object/include/object/job_dispatcher.h
+++ b/kernel/object/include/object/job_dispatcher.h
@@ -14,7 +14,7 @@
 #include <object/process_dispatcher.h>
 #include <object/state_tracker.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/array.h>
 #include <fbl/auto_lock.h>
 #include <fbl/canary.h>
@@ -57,32 +57,32 @@
     };
 
     static fbl::RefPtr<JobDispatcher> CreateRootJob();
-    static mx_status_t Create(uint32_t flags,
+    static zx_status_t Create(uint32_t flags,
                               fbl::RefPtr<JobDispatcher> parent,
                               fbl::RefPtr<Dispatcher>* dispatcher,
-                              mx_rights_t* rights);
+                              zx_rights_t* rights);
 
     ~JobDispatcher() final;
 
     // Dispatcher implementation.
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_JOB; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_JOB; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
     void on_zero_handles() final;
-    mx_koid_t get_related_koid() const final;
+    zx_koid_t get_related_koid() const final;
     fbl::RefPtr<JobDispatcher> parent() { return fbl::RefPtr<JobDispatcher>(parent_); }
 
     // Job methods.
-    void get_name(char out_name[MX_MAX_NAME_LEN]) const final;
-    mx_status_t set_name(const char* name, size_t len) final;
+    void get_name(char out_name[ZX_MAX_NAME_LEN]) const final;
+    zx_status_t set_name(const char* name, size_t len) final;
     uint32_t max_height() const { return max_height_; }
 
     // "Importance" is a userspace-settable hint that is used to rank jobs for
-    // OOM killing. See MX_PROP_JOB_IMPORTANCE.
-    // Note: if the importance is set to MX_JOB_IMPORTANCE_INHERITED (which is
+    // OOM killing. See ZX_PROP_JOB_IMPORTANCE.
+    // Note: if the importance is set to ZX_JOB_IMPORTANCE_INHERITED (which is
     // the default for all jobs except the root job), get_importance() will
     // return the inherited value.
-    mx_status_t get_importance(mx_job_importance_t* out) const;
-    mx_status_t set_importance(mx_job_importance_t importance);
+    zx_status_t get_importance(zx_job_importance_t* out) const;
+    zx_status_t set_importance(zx_job_importance_t importance);
 
     // TODO(dbort): Consider adding a get_capped_importance() so that userspace
     // doesn't need to check all ancestor jobs to find the value (which is the
@@ -94,29 +94,29 @@
     void RemoveChildProcess(ProcessDispatcher* process);
     void Kill();
 
-    // Set policy. |mode| is is either MX_JOB_POL_RELATIVE or MX_JOB_POL_ABSOLUTE and
+    // Set policy. |mode| is is either ZX_JOB_POL_RELATIVE or ZX_JOB_POL_ABSOLUTE and
     // in_policy is an array of |count| elements.
-    mx_status_t SetPolicy(uint32_t mode, const mx_policy_basic* in_policy, size_t policy_count);
+    zx_status_t SetPolicy(uint32_t mode, const zx_policy_basic* in_policy, size_t policy_count);
     pol_cookie_t GetPolicy();
 
     // Updates a partial ordering between jobs so that this job will be killed
     // after |other| in low-resource situations. If |other| is null, then this
     // job becomes the least-important job in the system.
-    mx_status_t MakeMoreImportantThan(fbl::RefPtr<JobDispatcher> other);
+    zx_status_t MakeMoreImportantThan(fbl::RefPtr<JobDispatcher> other);
 
-    // Calls the provided |mx_status_t func(JobDispatcher*)| on every
+    // Calls the provided |zx_status_t func(JobDispatcher*)| on every
     // JobDispatcher in the system, from least important to most important,
     // using the order determined by MakeMoreImportantThan(). Stops if |func|
     // returns an error, returning the error value.
     template <typename T>
-    static mx_status_t ForEachJobByImportance(T func) {
+    static zx_status_t ForEachJobByImportance(T func) {
         fbl::AutoLock lock(&importance_lock_);
         for (auto &job : importance_list_) {
-            mx_status_t s = func(&job);
-            if (s != MX_OK)
+            zx_status_t s = func(&job);
+            if (s != ZX_OK)
                 return s;
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Walks the job/process tree and invokes |je| methods on each node. If
@@ -124,11 +124,11 @@
     // false if any methods of |je| return false; returns true otherwise.
     bool EnumerateChildren(JobEnumerator* je, bool recurse);
 
-    fbl::RefPtr<ProcessDispatcher> LookupProcessById(mx_koid_t koid);
-    fbl::RefPtr<JobDispatcher> LookupJobById(mx_koid_t koid);
+    fbl::RefPtr<ProcessDispatcher> LookupProcessById(zx_koid_t koid);
+    fbl::RefPtr<JobDispatcher> LookupJobById(zx_koid_t koid);
 
     // exception handling support
-    mx_status_t SetExceptionPort(fbl::RefPtr<ExceptionPort> eport);
+    zx_status_t SetExceptionPort(fbl::RefPtr<ExceptionPort> eport);
     // Returns true if a port had been set.
     bool ResetExceptionPort(bool quietly);
     fbl::RefPtr<ExceptionPort> exception_port();
@@ -142,8 +142,8 @@
     JobDispatcher(uint32_t flags, fbl::RefPtr<JobDispatcher> parent, pol_cookie_t policy);
 
     // Like get_importance(), but does not resolve inheritance; i.e., this
-    // method may return MX_JOB_IMPORTANCE_INHERITED.
-    mx_job_importance_t GetRawImportance() const;
+    // method may return ZX_JOB_IMPORTANCE_INHERITED.
+    zx_job_importance_t GetRawImportance() const;
 
     bool AddChildJob(JobDispatcher* job);
     void RemoveChildJob(JobDispatcher* job);
@@ -161,14 +161,14 @@
 
     // The user-friendly job name. For debug purposes only. That
     // is, there is no mechanism to mint a handle to a job via this name.
-    fbl::Name<MX_MAX_NAME_LEN> name_;
+    fbl::Name<ZX_MAX_NAME_LEN> name_;
 
     // The |lock_| protects all members below.
     mutable fbl::Mutex lock_;
     State state_ TA_GUARDED(lock_);
     uint32_t process_count_ TA_GUARDED(lock_);
     uint32_t job_count_ TA_GUARDED(lock_);
-    mx_job_importance_t importance_ TA_GUARDED(lock_);
+    zx_job_importance_t importance_ TA_GUARDED(lock_);
     StateTracker state_tracker_;
 
     using RawJobList =
diff --git a/kernel/object/include/object/log_dispatcher.h b/kernel/object/include/object/log_dispatcher.h
index ed1ffb0..80f1bb2 100644
--- a/kernel/object/include/object/log_dispatcher.h
+++ b/kernel/object/include/object/log_dispatcher.h
@@ -10,21 +10,21 @@
 #include <object/dispatcher.h>
 #include <object/state_tracker.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/mutex.h>
 
 class LogDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(uint32_t flags, fbl::RefPtr<Dispatcher>* dispatcher,
-                              mx_rights_t* rights);
+    static zx_status_t Create(uint32_t flags, fbl::RefPtr<Dispatcher>* dispatcher,
+                              zx_rights_t* rights);
 
     ~LogDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_LOG; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_LOG; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
 
-    mx_status_t Write(uint32_t flags, const void* ptr, size_t len);
-    mx_status_t Read(uint32_t flags, void* ptr, size_t len, size_t* actual);
+    zx_status_t Write(uint32_t flags, const void* ptr, size_t len);
+    zx_status_t Read(uint32_t flags, void* ptr, size_t len, size_t* actual);
 
 private:
     explicit LogDispatcher(uint32_t flags);
diff --git a/kernel/object/include/object/mbuf.h b/kernel/object/include/object/mbuf.h
index 0deafd3..410444d 100644
--- a/kernel/object/include/object/mbuf.h
+++ b/kernel/object/include/object/mbuf.h
@@ -9,7 +9,7 @@
 #include <stdint.h>
 
 #include <lib/user_copy/user_ptr.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/intrusive_single_list.h>
 
 class MBufChain {
@@ -17,8 +17,8 @@
     MBufChain() = default;
     ~MBufChain();
 
-    mx_status_t WriteStream(user_ptr<const void> src, size_t len, size_t* written);
-    mx_status_t WriteDatagram(user_ptr<const void> src, size_t len, size_t* written);
+    zx_status_t WriteStream(user_ptr<const void> src, size_t len, size_t* written);
+    zx_status_t WriteDatagram(user_ptr<const void> src, size_t len, size_t* written);
     size_t Read(user_ptr<void> dst, size_t len, bool datagram);
     bool is_full() const;
     bool is_empty() const;
@@ -38,10 +38,10 @@
         uint32_t off_ = 0u;
         uint32_t len_ = 0u;
         // pkt_len_ is set to the total number of bytes in a packet
-        // when a socket is in MX_SOCKET_DATAGRAM mode. A pkt_len_ of
+        // when a socket is in ZX_SOCKET_DATAGRAM mode. A pkt_len_ of
         // 0 means this mbuf is part of the body of a packet.
         //
-        // Always 0 in MX_SOCKET_STREAM mode.
+        // Always 0 in ZX_SOCKET_STREAM mode.
         uint32_t pkt_len_ = 0u;
         uint32_t unused_;
         char data_[kPayloadSize] = {0};
diff --git a/kernel/object/include/object/message_packet.h b/kernel/object/include/object/message_packet.h
index c87594b..2e5aba3 100644
--- a/kernel/object/include/object/message_packet.h
+++ b/kernel/object/include/object/message_packet.h
@@ -9,7 +9,7 @@
 #include <stdint.h>
 
 #include <lib/user_copy/user_ptr.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/unique_ptr.h>
 
@@ -17,8 +17,8 @@
 constexpr uint32_t kMaxMessageHandles = 64u;
 
 // ensure public constants are aligned
-static_assert(MX_CHANNEL_MAX_MSG_BYTES == kMaxMessageSize, "");
-static_assert(MX_CHANNEL_MAX_MSG_HANDLES == kMaxMessageHandles, "");
+static_assert(ZX_CHANNEL_MAX_MSG_BYTES == kMaxMessageSize, "");
+static_assert(ZX_CHANNEL_MAX_MSG_HANDLES == kMaxMessageHandles, "");
 
 class Handle;
 
@@ -27,10 +27,10 @@
     // Creates a message packet containing the provided data and space for
     // |num_handles| handles. The handles array is uninitialized and must
     // be completely overwritten by clients.
-    static mx_status_t Create(user_ptr<const void> data, uint32_t data_size,
+    static zx_status_t Create(user_ptr<const void> data, uint32_t data_size,
                               uint32_t num_handles,
                               fbl::unique_ptr<MessagePacket>* msg);
-    static mx_status_t Create(const void* data, uint32_t data_size,
+    static zx_status_t Create(const void* data, uint32_t data_size,
                               uint32_t num_handles,
                               fbl::unique_ptr<MessagePacket>* msg);
 
@@ -38,7 +38,7 @@
 
     // Copies the packet's |data_size()| bytes to |buf|.
     // Returns an error if |buf| points to a bad user address.
-    mx_status_t CopyDataTo(user_ptr<void> buf) const {
+    zx_status_t CopyDataTo(user_ptr<void> buf) const {
         return buf.copy_array_to_user(data(), data_size_);
     }
 
@@ -48,13 +48,13 @@
 
     void set_owns_handles(bool own_handles) { owns_handles_ = own_handles; }
 
-    // mx_channel_call treats the leading bytes of the payload as
-    // a transaction id of type mx_txid_t.
-    mx_txid_t get_txid() const {
-        if (data_size_ < sizeof(mx_txid_t)) {
+    // zx_channel_call treats the leading bytes of the payload as
+    // a transaction id of type zx_txid_t.
+    zx_txid_t get_txid() const {
+        if (data_size_ < sizeof(zx_txid_t)) {
             return 0;
         } else {
-            return *(reinterpret_cast<const mx_txid_t*>(data()));
+            return *(reinterpret_cast<const zx_txid_t*>(data()));
         }
     }
 
@@ -64,7 +64,7 @@
 
     // Allocates a new packet that can hold the specified amount of
     // data/handles.
-    static mx_status_t NewPacket(uint32_t data_size, uint32_t num_handles,
+    static zx_status_t NewPacket(uint32_t data_size, uint32_t num_handles,
                                  fbl::unique_ptr<MessagePacket>* msg);
 
     // Create() uses malloc(), so we must delete using free().
diff --git a/kernel/object/include/object/pci_device_dispatcher.h b/kernel/object/include/object/pci_device_dispatcher.h
index dc35fdc..1a04daa 100644
--- a/kernel/object/include/object/pci_device_dispatcher.h
+++ b/kernel/object/include/object/pci_device_dispatcher.h
@@ -11,8 +11,8 @@
 #include <dev/pcie_device.h>
 #include <kernel/spinlock.h>
 #include <vm/vm_aspace.h>
-#include <magenta/syscalls/pci.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/pci.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_single_list.h>
 #include <fbl/mutex.h>
@@ -25,36 +25,36 @@
 
 class PciDeviceDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(uint32_t index,
-                              mx_pcie_device_info_t*    out_info,
+    static zx_status_t Create(uint32_t index,
+                              zx_pcie_device_info_t*    out_info,
                               fbl::RefPtr<Dispatcher>* out_dispatcher,
-                              mx_rights_t* out_rights);
+                              zx_rights_t* out_rights);
 
     ~PciDeviceDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_PCI_DEVICE; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_PCI_DEVICE; }
     const fbl::RefPtr<PcieDevice>& device() { return device_; }
 
     void ReleaseDevice();
 
     // TODO(cja): revisit Enable____ methods to be automatic when vmos are handed
     // out so there is less of a dispatcher surface to worry about.
-    mx_status_t EnableBusMaster(bool enable);
-    mx_status_t EnableMmio(bool enable);
-    mx_status_t EnablePio(bool enable);
+    zx_status_t EnableBusMaster(bool enable);
+    zx_status_t EnableMmio(bool enable);
+    zx_status_t EnablePio(bool enable);
     const pcie_bar_info_t* GetBar(uint32_t bar_num);
-    mx_status_t GetConfig(pci_config_info_t* out);
-    mx_status_t ResetDevice();
-    mx_status_t MapInterrupt(int32_t which_irq,
+    zx_status_t GetConfig(pci_config_info_t* out);
+    zx_status_t ResetDevice();
+    zx_status_t MapInterrupt(int32_t which_irq,
                              fbl::RefPtr<Dispatcher>* interrupt_dispatcher,
-                             mx_rights_t* rights);
-    mx_status_t QueryIrqModeCaps(mx_pci_irq_mode_t mode, uint32_t* out_max_irqs);
-    mx_status_t SetIrqMode(mx_pci_irq_mode_t mode, uint32_t requested_irq_count);
+                             zx_rights_t* rights);
+    zx_status_t QueryIrqModeCaps(zx_pci_irq_mode_t mode, uint32_t* out_max_irqs);
+    zx_status_t SetIrqMode(zx_pci_irq_mode_t mode, uint32_t requested_irq_count);
 
     bool irqs_maskable() const TA_REQ(lock_) { return irqs_maskable_; }
 
 private:
     PciDeviceDispatcher(fbl::RefPtr<PcieDevice> device,
-                        mx_pcie_device_info_t* out_info);
+                        zx_pcie_device_info_t* out_info);
 
     PciDeviceDispatcher(const PciDeviceDispatcher &) = delete;
     PciDeviceDispatcher& operator=(const PciDeviceDispatcher &) = delete;
diff --git a/kernel/object/include/object/pci_interrupt_dispatcher.h b/kernel/object/include/object/pci_interrupt_dispatcher.h
index f481216..748ea22 100644
--- a/kernel/object/include/object/pci_interrupt_dispatcher.h
+++ b/kernel/object/include/object/pci_interrupt_dispatcher.h
@@ -8,7 +8,7 @@
 #if WITH_DEV_PCIE
 
 #include <dev/pcie_irqs.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <object/interrupt_dispatcher.h>
 #include <object/pci_device_dispatcher.h>
 #include <sys/types.h>
@@ -17,15 +17,15 @@
 
 class PciInterruptDispatcher final : public InterruptDispatcher {
 public:
-    static mx_status_t Create(const fbl::RefPtr<PcieDevice>& device,
+    static zx_status_t Create(const fbl::RefPtr<PcieDevice>& device,
                               uint32_t irq_id,
                               bool maskable,
-                              mx_rights_t* out_rights,
+                              zx_rights_t* out_rights,
                               fbl::RefPtr<Dispatcher>* out_interrupt);
 
     ~PciInterruptDispatcher() final;
-    mx_status_t InterruptComplete() final;
-    mx_status_t UserSignal() final;
+    zx_status_t InterruptComplete() final;
+    zx_status_t UserSignal() final;
 
 private:
     static pcie_irq_handler_retval_t IrqThunk(const PcieDevice& dev,
diff --git a/kernel/object/include/object/policy_manager.h b/kernel/object/include/object/policy_manager.h
index a0a18c4..80611d4 100644
--- a/kernel/object/include/object/policy_manager.h
+++ b/kernel/object/include/object/policy_manager.h
@@ -7,12 +7,12 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include <magenta/syscalls/policy.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/policy.h>
+#include <zircon/types.h>
 
 #include <fbl/ref_ptr.h>
 
-struct mx_policy_basic;
+struct zx_policy_basic;
 class PortDispatcher;
 
 typedef uint64_t pol_cookie_t;
@@ -20,15 +20,15 @@
 
 // PolicyManager is in charge of providing a space-efficient encoding of
 // the external policy as defined in the policy.h public header which
-// the client expresses as an array of mx_policy_basic elements.
+// the client expresses as an array of zx_policy_basic elements.
 //
 // For example:
 //
-//   mx_policy_basic in_policy[] = {
-//      { MX_POL_BAD_HANDLE, MX_POL_ACTION_KILL },
-//      { MX_POL_NEW_CHANNEL, MX_POL_ACTION_ALLOW },
-//      { MX_POL_NEW_FIFO, MX_POL_ACTION_ALLOW | MX_POL_ACTION_EXCEPTION },
-//      { MX_POL_VMAR_WX, MX_POL_ACTION_DENY | MX_POL_ACTION_KILL }}
+//   zx_policy_basic in_policy[] = {
+//      { ZX_POL_BAD_HANDLE, ZX_POL_ACTION_KILL },
+//      { ZX_POL_NEW_CHANNEL, ZX_POL_ACTION_ALLOW },
+//      { ZX_POL_NEW_FIFO, ZX_POL_ACTION_ALLOW | ZX_POL_ACTION_EXCEPTION },
+//      { ZX_POL_VMAR_WX, ZX_POL_ACTION_DENY | ZX_POL_ACTION_KILL }}
 //
 //  Which is 64 bytes but PolicyManager can encode it in the pol_cookie_t
 //  itself if it is a simple policy.
@@ -37,38 +37,38 @@
 public:
     // Creates in the heap a policy manager with a |default_action|
     // which is returned when QueryBasicPolicy() matches no known condition.
-    static PolicyManager* Create(uint32_t default_action = MX_POL_ACTION_ALLOW);
+    static PolicyManager* Create(uint32_t default_action = ZX_POL_ACTION_ALLOW);
 
     // Creates a |new_policy| based on an |existing_policy| or based on
     // kPolicyEmpty and an array of |policy_input|. When done with the
     // new policy RemovePolicy() must be called.
     //
     // |mode| can be:
-    // - MX_JOB_POL_RELATIVE which creates a new policy that only uses
+    // - ZX_JOB_POL_RELATIVE which creates a new policy that only uses
     //   the |policy_input| entries that are unespecified in |existing_policy|
-    // - MX_JOB_POL_ABSOLUTE which creates a new policy that requires
+    // - ZX_JOB_POL_ABSOLUTE which creates a new policy that requires
     //   that all |policy_input| entries are used.
     //
     // This call can fail in low memory cases and when the |existing_policy|
     // and the policy_input are in conflict given the |mode| paramater.
-    mx_status_t AddPolicy(
+    zx_status_t AddPolicy(
         uint32_t mode, pol_cookie_t existing_policy,
-        const mx_policy_basic* policy_input, size_t policy_count,
+        const zx_policy_basic* policy_input, size_t policy_count,
         pol_cookie_t* new_policy);
 
-    // Returns whether |condition| (from the MX_POL_xxxx set) is allowed
+    // Returns whether |condition| (from the ZX_POL_xxxx set) is allowed
     // by |policy| (created using AddPolicy()).
     //
-    // If the condition is allowed, returns MX_POL_ACTION_ALLOW,
-    // optionally ORed with MX_POL_ACTION_EXCEPTION according to the
+    // If the condition is allowed, returns ZX_POL_ACTION_ALLOW,
+    // optionally ORed with ZX_POL_ACTION_EXCEPTION according to the
     // policy.
     //
-    // If the condition is not allowed, returns MX_POL_ACTION_DENY,
-    // optionally ORed with zero or more of MX_POL_ACTION_EXCEPTION and
-    // MX_POL_ACTION_KILL.
+    // If the condition is not allowed, returns ZX_POL_ACTION_DENY,
+    // optionally ORed with zero or more of ZX_POL_ACTION_EXCEPTION and
+    // ZX_POL_ACTION_KILL.
     //
     // This method asserts if |policy| is invalid, and returns
-    // MX_POL_ACTION_DENY all other failure modes.
+    // ZX_POL_ACTION_DENY all other failure modes.
     uint32_t QueryBasicPolicy(pol_cookie_t policy, uint32_t condition);
 
 private:
@@ -78,7 +78,7 @@
     uint32_t GetEffectiveAction(uint64_t policy);
     bool CanSetEntry(uint64_t existing, uint32_t new_action);
 
-    mx_status_t AddPartial(uint32_t mode, pol_cookie_t existing_policy,
+    zx_status_t AddPartial(uint32_t mode, pol_cookie_t existing_policy,
         uint32_t condition, uint32_t policy, uint64_t* partial);
 
     const uint32_t default_action_;
diff --git a/kernel/object/include/object/port_dispatcher.h b/kernel/object/include/object/port_dispatcher.h
index dd7d629..e95358c 100644
--- a/kernel/object/include/object/port_dispatcher.h
+++ b/kernel/object/include/object/port_dispatcher.h
@@ -10,8 +10,8 @@
 #include <object/semaphore.h>
 #include <object/state_observer.h>
 
-#include <magenta/syscalls/port.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/mutex.h>
@@ -90,7 +90,7 @@
 };
 
 struct PortPacket final : public fbl::DoublyLinkedListable<PortPacket*> {
-    mx_port_packet_t packet;
+    zx_port_packet_t packet;
     const void* const handle;
     PortObserver* observer;
     PortAllocator* const allocator;
@@ -110,7 +110,7 @@
 class PortObserver final : public StateObserver {
 public:
     PortObserver(uint32_t type, const Handle* handle, fbl::RefPtr<PortDispatcher> port,
-                 uint64_t key, mx_signals_t signals);
+                 uint64_t key, zx_signals_t signals);
     ~PortObserver() = default;
 
 private:
@@ -118,18 +118,18 @@
     PortObserver& operator=(const PortObserver&) = delete;
 
     // StateObserver overrides.
-    Flags OnInitialize(mx_signals_t initial_state, const StateObserver::CountInfo* cinfo) final;
-    Flags OnStateChange(mx_signals_t new_state) final;
+    Flags OnInitialize(zx_signals_t initial_state, const StateObserver::CountInfo* cinfo) final;
+    Flags OnStateChange(zx_signals_t new_state) final;
     Flags OnCancel(Handle* handle) final;
     Flags OnCancelByKey(Handle* handle, const void* port, uint64_t key) final;
     void OnRemoved() final;
 
     // The following method can only be called from
     // OnInitialize(), OnStateChange() and OnCancel().
-    Flags MaybeQueue(mx_signals_t new_state, uint64_t count);
+    Flags MaybeQueue(zx_signals_t new_state, uint64_t count);
 
     const uint32_t type_;
-    const mx_signals_t trigger_;
+    const zx_signals_t trigger_;
     PortPacket packet_;
 
     fbl::RefPtr<PortDispatcher> const port_;
@@ -139,24 +139,24 @@
 public:
     static void Init();
     static PortAllocator* DefaultPortAllocator();
-    static mx_status_t Create(uint32_t options, fbl::RefPtr<Dispatcher>* dispatcher,
-                              mx_rights_t* rights);
+    static zx_status_t Create(uint32_t options, fbl::RefPtr<Dispatcher>* dispatcher,
+                              zx_rights_t* rights);
 
     ~PortDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_PORT; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_PORT; }
 
     void on_zero_handles() final;
 
-    mx_status_t Queue(PortPacket* port_packet, mx_signals_t observed, uint64_t count);
-    mx_status_t QueueUser(const mx_port_packet_t& packet);
-    mx_status_t Dequeue(mx_time_t deadline, mx_port_packet_t* packet);
+    zx_status_t Queue(PortPacket* port_packet, zx_signals_t observed, uint64_t count);
+    zx_status_t QueueUser(const zx_port_packet_t& packet);
+    zx_status_t Dequeue(zx_time_t deadline, zx_port_packet_t* packet);
 
     // Decides who is going to destroy the observer. If it returns |true| it
     // is the duty of the caller. If it is false it is the duty of the port.
     bool CanReap(PortObserver* observer, PortPacket* port_packet);
 
     // Called under the handle table lock.
-    mx_status_t MakeObserver(uint32_t options, Handle* handle, uint64_t key, mx_signals_t signals);
+    zx_status_t MakeObserver(uint32_t options, Handle* handle, uint64_t key, zx_signals_t signals);
 
     // Called under the handle table lock. Returns true if at least one packet was
     // removed from the queue.
diff --git a/kernel/object/include/object/process_dispatcher.h b/kernel/object/include/object/process_dispatcher.h
index 30eac80..678af61 100644
--- a/kernel/object/include/object/process_dispatcher.h
+++ b/kernel/object/include/object/process_dispatcher.h
@@ -16,8 +16,8 @@
 #include <object/state_tracker.h>
 #include <object/thread_dispatcher.h>
 
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 #include <fbl/array.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
@@ -31,11 +31,11 @@
 
 class ProcessDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(
+    static zx_status_t Create(
         fbl::RefPtr<JobDispatcher> job, fbl::StringPiece name, uint32_t flags,
-        fbl::RefPtr<Dispatcher>* dispatcher, mx_rights_t* rights,
+        fbl::RefPtr<Dispatcher>* dispatcher, zx_rights_t* rights,
         fbl::RefPtr<VmAddressRegionDispatcher>* root_vmar_disp,
-        mx_rights_t* root_vmar_rights);
+        zx_rights_t* root_vmar_rights);
 
     // Traits to belong in the parent job's raw list.
     struct JobListTraitsRaw {
@@ -60,10 +60,10 @@
     }
 
     // Dispatcher implementation
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_PROCESS; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_PROCESS; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
     void on_zero_handles() final;
-    mx_koid_t get_related_koid() const final;
+    zx_koid_t get_related_koid() const final;
 
     ~ProcessDispatcher() final;
 
@@ -77,16 +77,16 @@
 
     // Performs initialization on a newly constructed ProcessDispatcher
     // If this fails, then the object is invalid and should be deleted
-    mx_status_t Initialize();
+    zx_status_t Initialize();
 
     // Maps a |handle| to an integer which can be given to usermode as a
     // handle value. Uses Handle->base_value() plus additional mixing.
-    mx_handle_t MapHandleToValue(const Handle* handle) const;
-    mx_handle_t MapHandleToValue(const HandleOwner& handle) const;
+    zx_handle_t MapHandleToValue(const Handle* handle) const;
+    zx_handle_t MapHandleToValue(const HandleOwner& handle) const;
 
     // Maps a handle value into a Handle as long we can verify that
     // it belongs to this process.
-    Handle* GetHandleLocked(mx_handle_t handle_value) TA_REQ(handle_table_lock_);
+    Handle* GetHandleLocked(zx_handle_t handle_value) TA_REQ(handle_table_lock_);
 
     // Adds |handle| to this process handle list. The handle->process_id() is
     // set to this process id().
@@ -95,87 +95,87 @@
 
     // Removes the Handle corresponding to |handle_value| from this process
     // handle list.
-    HandleOwner RemoveHandle(mx_handle_t handle_value);
-    HandleOwner RemoveHandleLocked(mx_handle_t handle_value) TA_REQ(handle_table_lock_);
+    HandleOwner RemoveHandle(zx_handle_t handle_value);
+    HandleOwner RemoveHandleLocked(zx_handle_t handle_value) TA_REQ(handle_table_lock_);
 
     // Puts back the |handle_value| which has not yet been given to another process
     // back into this process.
-    void UndoRemoveHandleLocked(mx_handle_t handle_value) TA_REQ(handle_table_lock_);
+    void UndoRemoveHandleLocked(zx_handle_t handle_value) TA_REQ(handle_table_lock_);
 
     // Get the dispatcher corresponding to this handle value.
     template <typename T>
-    mx_status_t GetDispatcher(mx_handle_t handle_value,
+    zx_status_t GetDispatcher(zx_handle_t handle_value,
                               fbl::RefPtr<T>* dispatcher) {
         return GetDispatcherAndRights(handle_value, dispatcher, nullptr);
     }
 
     // Get the dispatcher and the rights corresponding to this handle value.
     template <typename T>
-    mx_status_t GetDispatcherAndRights(mx_handle_t handle_value,
+    zx_status_t GetDispatcherAndRights(zx_handle_t handle_value,
                                        fbl::RefPtr<T>* dispatcher,
-                                       mx_rights_t* out_rights) {
+                                       zx_rights_t* out_rights) {
         fbl::RefPtr<Dispatcher> generic_dispatcher;
         auto status = GetDispatcherInternal(handle_value, &generic_dispatcher, out_rights);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         *dispatcher = DownCastDispatcher<T>(&generic_dispatcher);
         if (!*dispatcher)
-            return MX_ERR_WRONG_TYPE;
-        return MX_OK;
+            return ZX_ERR_WRONG_TYPE;
+        return ZX_OK;
     }
 
     // Get the dispatcher corresponding to this handle value, after
     // checking that this handle has the desired rights.
     // Returns the rights the handle currently has.
     template <typename T>
-    mx_status_t GetDispatcherWithRights(mx_handle_t handle_value,
-                                        mx_rights_t desired_rights,
+    zx_status_t GetDispatcherWithRights(zx_handle_t handle_value,
+                                        zx_rights_t desired_rights,
                                         fbl::RefPtr<T>* dispatcher,
-                                        mx_rights_t* out_rights) {
+                                        zx_rights_t* out_rights) {
         fbl::RefPtr<Dispatcher> generic_dispatcher;
         auto status = GetDispatcherWithRightsInternal(handle_value,
                                                       desired_rights,
                                                       &generic_dispatcher,
                                                       out_rights);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         *dispatcher = DownCastDispatcher<T>(&generic_dispatcher);
         if (!*dispatcher)
-            return MX_ERR_WRONG_TYPE;
-        return MX_OK;
+            return ZX_ERR_WRONG_TYPE;
+        return ZX_OK;
     }
 
     // Get the dispatcher corresponding to this handle value, after
     // checking that this handle has the desired rights.
     template <typename T>
-    mx_status_t GetDispatcherWithRights(mx_handle_t handle_value,
-                                        mx_rights_t desired_rights,
+    zx_status_t GetDispatcherWithRights(zx_handle_t handle_value,
+                                        zx_rights_t desired_rights,
                                         fbl::RefPtr<T>* dispatcher) {
         return GetDispatcherWithRights(handle_value, desired_rights, dispatcher, nullptr);
     }
 
-    mx_koid_t GetKoidForHandle(mx_handle_t handle_value);
+    zx_koid_t GetKoidForHandle(zx_handle_t handle_value);
 
-    bool IsHandleValid(mx_handle_t handle_value);
+    bool IsHandleValid(zx_handle_t handle_value);
 
     // Calls the provided
-    // |mx_status_t func(mx_handle_t, mx_rights_t, fbl::RefPtr<Dispatcher>)|
+    // |zx_status_t func(zx_handle_t, zx_rights_t, fbl::RefPtr<Dispatcher>)|
     // on every handle owned by the process. Stops if |func| returns an error,
     // returning the error value.
     template <typename T>
-    mx_status_t ForEachHandle(T func) const {
+    zx_status_t ForEachHandle(T func) const {
         fbl::AutoLock lock(&handle_table_lock_);
         for (const auto& handle : handles_) {
             // It would be nice to only pass a const Dispatcher* to the
             // callback, but many callers will use DownCastDispatcher()
             // which requires a (necessarily non-const) RefPtr<Dispatcher>.
-            mx_status_t s = func(MapHandleToValue(&handle), handle.rights(),
+            zx_status_t s = func(MapHandleToValue(&handle), handle.rights(),
                                  fbl::move(handle.dispatcher()));
-            if (s != MX_OK) {
+            if (s != ZX_OK) {
                 return s;
             }
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
     // accessors
@@ -185,26 +185,26 @@
     fbl::RefPtr<VmAspace> aspace() { return aspace_; }
     fbl::RefPtr<JobDispatcher> job();
 
-    void get_name(char out_name[MX_MAX_NAME_LEN]) const final;
-    mx_status_t set_name(const char* name, size_t len) final;
+    void get_name(char out_name[ZX_MAX_NAME_LEN]) const final;
+    zx_status_t set_name(const char* name, size_t len) final;
 
     void Exit(int retcode) __NO_RETURN;
     void Kill();
 
     // Syscall helpers
-    mx_status_t GetInfo(mx_info_process_t* info);
-    mx_status_t GetStats(mx_info_task_stats_t* stats);
+    zx_status_t GetInfo(zx_info_process_t* info);
+    zx_status_t GetStats(zx_info_task_stats_t* stats);
     // NOTE: Code outside of the syscall layer should not typically know about
     // user_ptrs; do not use this pattern as an example.
-    mx_status_t GetAspaceMaps(user_ptr<mx_info_maps_t> maps, size_t max,
+    zx_status_t GetAspaceMaps(user_ptr<zx_info_maps_t> maps, size_t max,
                            size_t* actual, size_t* available);
-    mx_status_t GetVmos(user_ptr<mx_info_vmo_t> vmos, size_t max,
+    zx_status_t GetVmos(user_ptr<zx_info_vmo_t> vmos, size_t max,
                      size_t* actual, size_t* available);
 
-    mx_status_t GetThreads(fbl::Array<mx_koid_t>* threads);
+    zx_status_t GetThreads(fbl::Array<zx_koid_t>* threads);
 
     // exception handling support
-    mx_status_t SetExceptionPort(fbl::RefPtr<ExceptionPort> eport);
+    zx_status_t SetExceptionPort(fbl::RefPtr<ExceptionPort> eport);
     // Returns true if a port had been set.
     bool ResetExceptionPort(bool debugger, bool quietly);
     fbl::RefPtr<ExceptionPort> exception_port();
@@ -219,33 +219,33 @@
 
     // Look up a process given its koid.
     // Returns nullptr if not found.
-    static fbl::RefPtr<ProcessDispatcher> LookupProcessById(mx_koid_t koid);
+    static fbl::RefPtr<ProcessDispatcher> LookupProcessById(zx_koid_t koid);
 
     // Look up a thread in this process given its koid.
     // Returns nullptr if not found.
-    fbl::RefPtr<ThreadDispatcher> LookupThreadById(mx_koid_t koid);
+    fbl::RefPtr<ThreadDispatcher> LookupThreadById(zx_koid_t koid);
 
     uintptr_t get_debug_addr() const;
-    mx_status_t set_debug_addr(uintptr_t addr);
+    zx_status_t set_debug_addr(uintptr_t addr);
 
     // Checks the |condition| against the parent job's policy.
     //
     // Must be called by syscalls before performing an action represented by an
-    // MX_POL_xxxxx condition. If the return value is MX_OK the action can
+    // ZX_POL_xxxxx condition. If the return value is ZX_OK the action can
     // proceed; otherwise, the process is not allowed to perform the action,
     // and the status value should be returned to the usermode caller.
     //
     // E.g., in sys_channel_create:
     //
     //     auto up = ProcessDispatcher::GetCurrent();
-    //     mx_status_t res = up->QueryPolicy(MX_POL_NEW_CHANNEL);
-    //     if (res != MX_OK) {
+    //     zx_status_t res = up->QueryPolicy(ZX_POL_NEW_CHANNEL);
+    //     if (res != ZX_OK) {
     //         // Channel creation denied by the calling process's
     //         // parent job's policy.
     //         return res;
     //     }
     //     // Ok to create a channel.
-    mx_status_t QueryPolicy(uint32_t condition) const;
+    zx_status_t QueryPolicy(uint32_t condition) const;
 
     // return a cached copy of the vdso code address or compute a new one
     uintptr_t vdso_code_address() {
@@ -261,7 +261,7 @@
 
     // The diagnostic code is allow to know about the internals of this code.
     friend void DumpProcessList();
-    friend void KillProcess(mx_koid_t id);
+    friend void KillProcess(zx_koid_t id);
     friend void DumpProcessMemoryUsage(const char* prefix, size_t min_pages);
 
     ProcessDispatcher(fbl::RefPtr<JobDispatcher> job, fbl::StringPiece name, uint32_t flags);
@@ -270,16 +270,16 @@
     ProcessDispatcher& operator=(const ProcessDispatcher&) = delete;
 
 
-    mx_status_t GetDispatcherInternal(mx_handle_t handle_value, fbl::RefPtr<Dispatcher>* dispatcher,
-                                      mx_rights_t* rights);
+    zx_status_t GetDispatcherInternal(zx_handle_t handle_value, fbl::RefPtr<Dispatcher>* dispatcher,
+                                      zx_rights_t* rights);
 
-    mx_status_t GetDispatcherWithRightsInternal(mx_handle_t handle_value, mx_rights_t desired_rights,
+    zx_status_t GetDispatcherWithRightsInternal(zx_handle_t handle_value, zx_rights_t desired_rights,
                                                 fbl::RefPtr<Dispatcher>* dispatcher_out,
-                                                mx_rights_t* out_rights);
+                                                zx_rights_t* out_rights);
 
     // Thread lifecycle support
     friend class ThreadDispatcher;
-    mx_status_t AddThread(ThreadDispatcher* t, bool initial_thread);
+    zx_status_t AddThread(ThreadDispatcher* t, bool initial_thread);
     void RemoveThread(ThreadDispatcher* t);
 
     void SetStateLocked(State) TA_REQ(state_lock_);
@@ -299,7 +299,7 @@
     fbl::DoublyLinkedListNodeState<ProcessDispatcher*> dll_job_raw_;
     fbl::SinglyLinkedListNodeState<fbl::RefPtr<ProcessDispatcher>> dll_job_;
 
-    mx_handle_t handle_rand_ = 0;
+    zx_handle_t handle_rand_ = 0;
 
     // list of threads in this process
     using ThreadList = fbl::DoublyLinkedList<ThreadDispatcher*, ThreadDispatcher::ThreadListTraits>;
@@ -337,7 +337,7 @@
 
     // The user-friendly process name. For debug purposes only. That
     // is, there is no mechanism to mint a handle to a process via this name.
-    fbl::Name<MX_MAX_NAME_LEN> name_;
+    fbl::Name<ZX_MAX_NAME_LEN> name_;
 };
 
 const char* StateToString(ProcessDispatcher::State state);
diff --git a/kernel/object/include/object/resource_dispatcher.h b/kernel/object/include/object/resource_dispatcher.h
index 9c351ec..5466d63 100644
--- a/kernel/object/include/object/resource_dispatcher.h
+++ b/kernel/object/include/object/resource_dispatcher.h
@@ -7,9 +7,9 @@
 #pragma once
 
 #include <kernel/mutex.h>
-#include <magenta/syscalls/resource.h>
-#include <magenta/thread_annotations.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/resource.h>
+#include <zircon/thread_annotations.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/name.h>
@@ -23,12 +23,12 @@
 class ResourceDispatcher final : public Dispatcher,
     public fbl::DoublyLinkedListable<fbl::RefPtr<ResourceDispatcher>> {
 public:
-    static mx_status_t Create(fbl::RefPtr<ResourceDispatcher>* dispatcher,
-                           mx_rights_t* rights, uint32_t kind,
+    static zx_status_t Create(fbl::RefPtr<ResourceDispatcher>* dispatcher,
+                           zx_rights_t* rights, uint32_t kind,
                            uint64_t low, uint64_t hight);
 
     ~ResourceDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_RESOURCE; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_RESOURCE; }
     StateTracker* get_state_tracker()  final { return &state_tracker_; }
     CookieJar* get_cookie_jar() final { return &cookie_jar_; }
 
diff --git a/kernel/object/include/object/resources.h b/kernel/object/include/object/resources.h
index 85cd5ba..8949998 100644
--- a/kernel/object/include/object/resources.h
+++ b/kernel/object/include/object/resources.h
@@ -6,34 +6,34 @@
 
 #pragma once
 
-#include <magenta/syscalls/resource.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/resource.h>
+#include <zircon/types.h>
 
-// Resource constants (MX_RSRC_KIND_..., etc) are located
-// in system/public/magenta/syscalls/resource.h
+// Resource constants (ZX_RSRC_KIND_..., etc) are located
+// in system/public/zircon/syscalls/resource.h
 
 // Determines if this handle is to a resource of the specified
 // kind *or* to the root resource, which can stand in for any kind.
 // Used to provide access to privileged syscalls.
-mx_status_t validate_resource(mx_handle_t handle, uint32_t kind);
+zx_status_t validate_resource(zx_handle_t handle, uint32_t kind);
 
 // Validates a resource based on type and low/high range;
-mx_status_t validate_ranged_resource(mx_handle_t handle, uint32_t kind,
+zx_status_t validate_ranged_resource(zx_handle_t handle, uint32_t kind,
                                      uint64_t low, uint64_t high);
 
 // Validates mapping an MMIO range based on a resource handle
-static inline mx_status_t validate_resource_mmio(
-    mx_handle_t handle, uintptr_t base, size_t length) {
+static inline zx_status_t validate_resource_mmio(
+    zx_handle_t handle, uintptr_t base, size_t length) {
 
     if (length < 1 || UINT64_MAX - base < length) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    return validate_ranged_resource(handle, MX_RSRC_KIND_MMIO,
+    return validate_ranged_resource(handle, ZX_RSRC_KIND_MMIO,
                                     base, base + length - 1);
 }
 
 // Validates creation of an interrupt object based on a resource handle
-static inline mx_status_t validate_resource_irq(mx_handle_t handle,
+static inline zx_status_t validate_resource_irq(zx_handle_t handle,
                                                 uint32_t irq) {
-    return validate_ranged_resource(handle, MX_RSRC_KIND_IRQ, irq, irq);
+    return validate_ranged_resource(handle, ZX_RSRC_KIND_IRQ, irq, irq);
 }
diff --git a/kernel/object/include/object/semaphore.h b/kernel/object/include/object/semaphore.h
index 31ce57b..4599f71 100644
--- a/kernel/object/include/object/semaphore.h
+++ b/kernel/object/include/object/semaphore.h
@@ -8,7 +8,7 @@
 
 #include <stdint.h>
 #include <kernel/thread.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 // You probably don't want to use this class.
 class Semaphore {
@@ -22,7 +22,7 @@
     // Returns the number of ready threads. If it is bigger than 0
     // the caller must call thread_reschedule().
     __WARN_UNUSED_RESULT int Post();
-    mx_status_t Wait(lk_time_t deadline);
+    zx_status_t Wait(lk_time_t deadline);
 
 private:
     int64_t count_;
diff --git a/kernel/object/include/object/socket_dispatcher.h b/kernel/object/include/object/socket_dispatcher.h
index 4c99483..0e14b67 100644
--- a/kernel/object/include/object/socket_dispatcher.h
+++ b/kernel/object/include/object/socket_dispatcher.h
@@ -13,7 +13,7 @@
 #include <object/mbuf.h>
 #include <object/state_tracker.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_single_list.h>
 #include <fbl/mutex.h>
@@ -23,41 +23,41 @@
 
 class SocketDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(uint32_t flags, fbl::RefPtr<Dispatcher>* dispatcher0,
-                              fbl::RefPtr<Dispatcher>* dispatcher1, mx_rights_t* rights);
+    static zx_status_t Create(uint32_t flags, fbl::RefPtr<Dispatcher>* dispatcher0,
+                              fbl::RefPtr<Dispatcher>* dispatcher1, zx_rights_t* rights);
 
     ~SocketDispatcher() final;
 
     // Dispatcher implementation.
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_SOCKET; }
-    mx_koid_t get_related_koid() const final { return peer_koid_; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_SOCKET; }
+    zx_koid_t get_related_koid() const final { return peer_koid_; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
     void on_zero_handles() final;
-    mx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
+    zx_status_t user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) final;
 
     // Socket methods.
-    mx_status_t Write(user_ptr<const void> src, size_t len, size_t* written);
+    zx_status_t Write(user_ptr<const void> src, size_t len, size_t* written);
 
-    mx_status_t WriteControl(user_ptr<const void> src, size_t len);
+    zx_status_t WriteControl(user_ptr<const void> src, size_t len);
 
     // Shut this endpoint of the socket down for reading, writing, or both.
-    mx_status_t Shutdown(uint32_t how);
+    zx_status_t Shutdown(uint32_t how);
 
-    mx_status_t HalfClose();
+    zx_status_t HalfClose();
 
-    mx_status_t Read(user_ptr<void> dst, size_t len, size_t* nread);
+    zx_status_t Read(user_ptr<void> dst, size_t len, size_t* nread);
 
-    mx_status_t ReadControl(user_ptr<void> dst, size_t len, size_t* nread);
+    zx_status_t ReadControl(user_ptr<void> dst, size_t len, size_t* nread);
 
     void OnPeerZeroHandles();
 
 private:
     explicit SocketDispatcher(uint32_t flags);
     void Init(fbl::RefPtr<SocketDispatcher> other);
-    mx_status_t WriteSelf(user_ptr<const void> src, size_t len, size_t* nwritten);
-    mx_status_t WriteControlSelf(user_ptr<const void> src, size_t len);
-    mx_status_t UserSignalSelf(uint32_t clear_mask, uint32_t set_mask);
-    mx_status_t ShutdownOther(uint32_t how);
+    zx_status_t WriteSelf(user_ptr<const void> src, size_t len, size_t* nwritten);
+    zx_status_t WriteControlSelf(user_ptr<const void> src, size_t len);
+    zx_status_t UserSignalSelf(uint32_t clear_mask, uint32_t set_mask);
+    zx_status_t ShutdownOther(uint32_t how);
 
     bool is_full() const TA_REQ(lock_) { return data_.is_full(); }
     bool is_empty() const TA_REQ(lock_) { return data_.is_empty(); }
@@ -65,7 +65,7 @@
     fbl::Canary<fbl::magic("SOCK")> canary_;
 
     uint32_t flags_;
-    mx_koid_t peer_koid_;
+    zx_koid_t peer_koid_;
     StateTracker state_tracker_;
 
     // The |lock_| protects all members below.
diff --git a/kernel/object/include/object/state_observer.h b/kernel/object/include/object/state_observer.h
index d697e4c..726fe5d 100644
--- a/kernel/object/include/object/state_observer.h
+++ b/kernel/object/include/object/state_observer.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
@@ -24,7 +24,7 @@
     struct CountInfo {
         struct {
             uint64_t count;
-            mx_signals_t signal;
+            zx_signals_t signal;
         } entry[2];
     };
 
@@ -41,12 +41,12 @@
     // Note that |cinfo| might be null.
     // May return flags: kWokeThreads, kNeedRemoval
     // WARNING: This is called under StateTracker's mutex.
-    virtual Flags OnInitialize(mx_signals_t initial_state, const CountInfo* cinfo) = 0;
+    virtual Flags OnInitialize(zx_signals_t initial_state, const CountInfo* cinfo) = 0;
 
     // Called whenever the state changes, to give it the new state.
     // May return flags: kWokeThreads, kNeedRemoval
     // WARNING: This is called under StateTracker's mutex
-    virtual Flags OnStateChange(mx_signals_t new_state) = 0;
+    virtual Flags OnStateChange(zx_signals_t new_state) = 0;
 
     // Called when |handle| (which refers to a handle to the object that owns the StateTracker) is
     // being destroyed/"closed"/transferred. (The object itself, and thus the StateTracker too, may
diff --git a/kernel/object/include/object/state_tracker.h b/kernel/object/include/object/state_tracker.h
index ee59cfc..a9f1d02 100644
--- a/kernel/object/include/object/state_tracker.h
+++ b/kernel/object/include/object/state_tracker.h
@@ -9,7 +9,7 @@
 #include <stdint.h>
 
 #include <kernel/spinlock.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/mutex.h>
@@ -19,14 +19,14 @@
 
 class CookieJar {
 public:
-    CookieJar() : scope_(MX_KOID_INVALID), cookie_(0) {}
-    mx_koid_t scope_;
+    CookieJar() : scope_(ZX_KOID_INVALID), cookie_(0) {}
+    zx_koid_t scope_;
     uint64_t cookie_;
 };
 
 class StateTracker {
 public:
-    StateTracker(mx_signals_t signals = 0u) : signals_(signals | MX_SIGNAL_LAST_HANDLE) { }
+    StateTracker(zx_signals_t signals = 0u) : signals_(signals | ZX_SIGNAL_LAST_HANDLE) { }
 
     StateTracker(const StateTracker& o) = delete;
     StateTracker& operator=(const StateTracker& o) = delete;
@@ -42,18 +42,18 @@
     // destroyed or transferred. Returns true if at least one observer was found.
     bool Cancel(Handle* handle);
 
-    // Like Cancel() but issued via via mx_port_cancel().
+    // Like Cancel() but issued via via zx_port_cancel().
     bool CancelByKey(Handle* handle, const void* port, uint64_t key);
 
     // Notify others of a change in state (possibly waking them). (Clearing satisfied signals or
     // setting satisfiable signals should not wake anyone.)
-    void UpdateState(mx_signals_t clear_mask, mx_signals_t set_mask);
+    void UpdateState(zx_signals_t clear_mask, zx_signals_t set_mask);
 
-    // Nofity others with MX_SIGNAL_LAST_HANDLE if the value pointed by |count| is 1. This
+    // Nofity others with ZX_SIGNAL_LAST_HANDLE if the value pointed by |count| is 1. This
     // value is allowed to mutate by other threads while this call is executing.
     void UpdateLastHandleSignal(uint32_t* count);
 
-    mx_signals_t GetSignalsState() { return signals_; }
+    zx_signals_t GetSignalsState() { return signals_; }
 
     using ObserverList = fbl::DoublyLinkedList<StateObserver*, StateObserverListTraits>;
 
@@ -61,17 +61,17 @@
     // These live with the state tracker so they can make use of the state tracker's
     // lock (since not all objects have their own locks, but all Dispatchers that are
     // cookie-capable have state trackers)
-    mx_status_t SetCookie(CookieJar* cookiejar, mx_koid_t scope, uint64_t cookie);
-    mx_status_t GetCookie(CookieJar* cookiejar, mx_koid_t scope, uint64_t* cookie);
-    mx_status_t InvalidateCookie(CookieJar *cookiejar);
+    zx_status_t SetCookie(CookieJar* cookiejar, zx_koid_t scope, uint64_t cookie);
+    zx_status_t GetCookie(CookieJar* cookiejar, zx_koid_t scope, uint64_t* cookie);
+    zx_status_t InvalidateCookie(CookieJar *cookiejar);
 
 private:
     // Returns flag kHandled if one of the observers have been signaled.
-    StateObserver::Flags UpdateInternalLocked(ObserverList* obs_to_remove, mx_signals_t signals) TA_REQ(lock_);
+    StateObserver::Flags UpdateInternalLocked(ObserverList* obs_to_remove, zx_signals_t signals) TA_REQ(lock_);
 
     fbl::Canary<fbl::magic("STRK")> canary_;
 
-    mx_signals_t signals_;
+    zx_signals_t signals_;
     fbl::Mutex lock_;
 
     // Active observers are elements in |observers_|.
diff --git a/kernel/object/include/object/thread_dispatcher.h b/kernel/object/include/object/thread_dispatcher.h
index 4790b02..a2801fb 100644
--- a/kernel/object/include/object/thread_dispatcher.h
+++ b/kernel/object/include/object/thread_dispatcher.h
@@ -19,8 +19,8 @@
 #include <object/futex_node.h>
 #include <object/state_tracker.h>
 
-#include <magenta/syscalls/exception.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/mutex.h>
@@ -63,7 +63,7 @@
         // As an analogy, this would be like typing "c" in gdb after a
         // segfault. In linux the signal would be delivered to the thread,
         // which would either terminate the process or run a signal handler if
-        // defined. In magenta this gives the next signal handler in the list
+        // defined. In zircon this gives the next signal handler in the list
         // a crack at the exception.
         TRY_NEXT,
 
@@ -79,10 +79,10 @@
         RESUME,
     };
 
-    static mx_status_t Create(fbl::RefPtr<ProcessDispatcher> process, uint32_t flags,
+    static zx_status_t Create(fbl::RefPtr<ProcessDispatcher> process, uint32_t flags,
                               fbl::StringPiece name,
                               fbl::RefPtr<Dispatcher>* out_dispatcher,
-                              mx_rights_t* out_rights);
+                              zx_rights_t* out_rights);
     ~ThreadDispatcher();
 
     static ThreadDispatcher* GetCurrent() {
@@ -90,31 +90,31 @@
     }
 
     // Dispatcher implementation.
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_THREAD; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_THREAD; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
     void on_zero_handles() final;
-    mx_koid_t get_related_koid() const final;
+    zx_koid_t get_related_koid() const final;
 
     // Performs initialization on a newly constructed ThreadDispatcher
     // If this fails, then the object is invalid and should be deleted
-    mx_status_t Initialize(const char* name, size_t len);
-    mx_status_t Start(uintptr_t pc, uintptr_t sp, uintptr_t arg1, uintptr_t arg2,
+    zx_status_t Initialize(const char* name, size_t len);
+    zx_status_t Start(uintptr_t pc, uintptr_t sp, uintptr_t arg1, uintptr_t arg2,
                       bool initial_thread);
     void Exit() __NO_RETURN;
     void Kill();
 
-    mx_status_t Suspend();
-    mx_status_t Resume();
+    zx_status_t Suspend();
+    zx_status_t Resume();
 
     // accessors
     ProcessDispatcher* process() const { return process_.get(); }
 
     FutexNode* futex_node() { return &futex_node_; }
-    mx_status_t set_name(const char* name, size_t len) final;
-    void get_name(char out_name[MX_MAX_NAME_LEN]) const final;
+    zx_status_t set_name(const char* name, size_t len) final;
+    void get_name(char out_name[ZX_MAX_NAME_LEN]) const final;
     uint64_t runtime_ns() const { return thread_runtime(&thread_); }
 
-    mx_status_t SetExceptionPort(fbl::RefPtr<ExceptionPort> eport);
+    zx_status_t SetExceptionPort(fbl::RefPtr<ExceptionPort> eport);
     // Returns true if a port had been set.
     bool ResetExceptionPort(bool quietly);
     fbl::RefPtr<ExceptionPort> exception_port();
@@ -125,15 +125,15 @@
     // debugger, thread, process, and system. The kind of the exception port is
     // specified by |eport->type()|.
     // Returns:
-    // MX_OK: the exception was handled in some way, and |*out_estatus|
+    // ZX_OK: the exception was handled in some way, and |*out_estatus|
     // specifies how.
-    // MX_ERR_INTERNAL_INTR_KILLED: the thread was killed (probably via mx_task_kill)
-    mx_status_t ExceptionHandlerExchange(fbl::RefPtr<ExceptionPort> eport,
-                                         const mx_exception_report_t* report,
+    // ZX_ERR_INTERNAL_INTR_KILLED: the thread was killed (probably via zx_task_kill)
+    zx_status_t ExceptionHandlerExchange(fbl::RefPtr<ExceptionPort> eport,
+                                         const zx_exception_report_t* report,
                                          const arch_exception_context_t* arch_context,
                                          ExceptionStatus* out_estatus);
     // Called when an exception handler is finished processing the exception.
-    mx_status_t MarkExceptionHandled(ExceptionStatus estatus);
+    zx_status_t MarkExceptionHandled(ExceptionStatus estatus);
     // Called when exception port |eport| is removed.
     // If the thread is waiting for the associated exception handler, continue
     // exception processing as if the exception port had not been installed.
@@ -143,21 +143,21 @@
     bool InExceptionLocked() TA_REQ(state_lock_);
     // Assuming the thread is stopped waiting for an exception response,
     // fill in |*report| with the exception report.
-    // Returns MX_ERR_BAD_STATE if not in an exception.
-    mx_status_t GetExceptionReport(mx_exception_report_t* report);
+    // Returns ZX_ERR_BAD_STATE if not in an exception.
+    zx_status_t GetExceptionReport(zx_exception_report_t* report);
 
     // Fetch the state of the thread for userspace tools.
-    mx_status_t GetInfoForUserspace(mx_info_thread_t* info);
+    zx_status_t GetInfoForUserspace(zx_info_thread_t* info);
 
     // Fetch per thread stats for userspace.
-    mx_status_t GetStatsForUserspace(mx_info_thread_stats_t* info);
+    zx_status_t GetStatsForUserspace(zx_info_thread_stats_t* info);
 
     // For debugger usage.
     // TODO(dje): The term "state" here conflicts with "state tracker".
     uint32_t get_num_state_kinds() const;
     // TODO(dje): Consider passing an Array<uint8_t> here and in WriteState.
-    mx_status_t ReadState(uint32_t state_kind, void* buffer, uint32_t* buffer_len);
-    mx_status_t WriteState(uint32_t state_kind, const void* buffer, uint32_t buffer_len);
+    zx_status_t ReadState(uint32_t state_kind, void* buffer, uint32_t* buffer_len);
+    zx_status_t WriteState(uint32_t state_kind, const void* buffer, uint32_t buffer_len);
 
     // For ChannelDispatcher use.
     ChannelDispatcher::MessageWaiter* GetMessageWaiter() { return &channel_waiter_; }
@@ -216,7 +216,7 @@
         = ExceptionStatus::IDLE;
     // The exception port of the handler the thread is waiting for a response from.
     fbl::RefPtr<ExceptionPort> exception_wait_port_ TA_GUARDED(state_lock_);
-    const mx_exception_report_t* exception_report_ TA_GUARDED(state_lock_);
+    const zx_exception_report_t* exception_report_ TA_GUARDED(state_lock_);
     event_t exception_event_ =
         EVENT_INITIAL_VALUE(exception_event_, false, EVENT_FLAG_AUTOUNSIGNAL);
 
diff --git a/kernel/object/include/object/timer_dispatcher.h b/kernel/object/include/object/timer_dispatcher.h
index b646fe4..64a104f 100644
--- a/kernel/object/include/object/timer_dispatcher.h
+++ b/kernel/object/include/object/timer_dispatcher.h
@@ -8,7 +8,7 @@
 
 #include <kernel/timer.h>
 #include <lib/dpc.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/mutex.h>
 #include <object/dispatcher.h>
@@ -18,18 +18,18 @@
 
 class TimerDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(uint32_t options,
+    static zx_status_t Create(uint32_t options,
                               fbl::RefPtr<Dispatcher>* dispatcher,
-                              mx_rights_t* rights);
+                              zx_rights_t* rights);
 
     ~TimerDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_TIMER; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_TIMER; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
     void on_zero_handles() final;
 
     // Timer specific ops.
-    mx_status_t Set(mx_time_t deadline, mx_duration_t slack);
-    mx_status_t Cancel();
+    zx_status_t Set(zx_time_t deadline, zx_duration_t slack);
+    zx_status_t Cancel();
 
     // Timer callback.
     void OnTimerFired();
@@ -43,8 +43,8 @@
     const slack_mode slack_mode_;
     dpc_t timer_dpc_;
     fbl::Mutex lock_;
-    mx_time_t deadline_ TA_GUARDED(lock_);
-    mx_duration_t slack_ TA_GUARDED(lock_);
+    zx_time_t deadline_ TA_GUARDED(lock_);
+    zx_duration_t slack_ TA_GUARDED(lock_);
     bool cancel_pending_ TA_GUARDED(lock_);
     timer_t timer_ TA_GUARDED(lock_);
     StateTracker state_tracker_;
diff --git a/kernel/object/include/object/vcpu_dispatcher.h b/kernel/object/include/object/vcpu_dispatcher.h
index 52a5393..d18ed56 100644
--- a/kernel/object/include/object/vcpu_dispatcher.h
+++ b/kernel/object/include/object/vcpu_dispatcher.h
@@ -12,21 +12,21 @@
 class Vcpu;
 class VmObject;
 
-typedef struct mx_port_packet mx_port_packet_t;
+typedef struct zx_port_packet zx_port_packet_t;
 
 class VcpuDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(fbl::RefPtr<GuestDispatcher> guest_dispatcher, mx_vaddr_t ip,
-                              mx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
-                              fbl::RefPtr<Dispatcher>* dispatcher, mx_rights_t* rights);
+    static zx_status_t Create(fbl::RefPtr<GuestDispatcher> guest_dispatcher, zx_vaddr_t ip,
+                              zx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
+                              fbl::RefPtr<Dispatcher>* dispatcher, zx_rights_t* rights);
     ~VcpuDispatcher();
 
-    mx_obj_type_t get_type() const { return MX_OBJ_TYPE_VCPU; }
+    zx_obj_type_t get_type() const { return ZX_OBJ_TYPE_VCPU; }
 
-    mx_status_t Resume(mx_port_packet_t* packet);
-    mx_status_t Interrupt(uint32_t vector);
-    mx_status_t ReadState(uint32_t kind, void* buffer, uint32_t len) const;
-    mx_status_t WriteState(uint32_t kind, const void* buffer, uint32_t len);
+    zx_status_t Resume(zx_port_packet_t* packet);
+    zx_status_t Interrupt(uint32_t vector);
+    zx_status_t ReadState(uint32_t kind, void* buffer, uint32_t len) const;
+    zx_status_t WriteState(uint32_t kind, const void* buffer, uint32_t len);
 
 private:
     fbl::Canary<fbl::magic("VCPD")> canary_;
diff --git a/kernel/object/include/object/vm_address_region_dispatcher.h b/kernel/object/include/object/vm_address_region_dispatcher.h
index 38a1db8..fed908f 100644
--- a/kernel/object/include/object/vm_address_region_dispatcher.h
+++ b/kernel/object/include/object/vm_address_region_dispatcher.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <object/dispatcher.h>
 
@@ -18,27 +18,27 @@
 
 class VmAddressRegionDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(fbl::RefPtr<VmAddressRegion> vmar,
+    static zx_status_t Create(fbl::RefPtr<VmAddressRegion> vmar,
                               fbl::RefPtr<Dispatcher>* dispatcher,
-                              mx_rights_t* rights);
+                              zx_rights_t* rights);
 
     ~VmAddressRegionDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_VMAR; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_VMAR; }
 
     // TODO(teisenbe): Make this the planned batch interface
-    mx_status_t Allocate(size_t offset, size_t size, uint32_t flags,
+    zx_status_t Allocate(size_t offset, size_t size, uint32_t flags,
                          fbl::RefPtr<VmAddressRegionDispatcher>* dispatcher,
-                         mx_rights_t* rights);
+                         zx_rights_t* rights);
 
-    mx_status_t Destroy();
+    zx_status_t Destroy();
 
-    mx_status_t Map(size_t vmar_offset,
+    zx_status_t Map(size_t vmar_offset,
                     fbl::RefPtr<VmObject> vmo, uint64_t vmo_offset, size_t len,
                     uint32_t flags, fbl::RefPtr<VmMapping>* out);
 
-    mx_status_t Protect(vaddr_t base, size_t len, uint32_t flags);
+    zx_status_t Protect(vaddr_t base, size_t len, uint32_t flags);
 
-    mx_status_t Unmap(vaddr_t base, size_t len);
+    zx_status_t Unmap(vaddr_t base, size_t len);
 
     fbl::RefPtr<VmAddressRegion> vmar() const { return vmar_; }
 
diff --git a/kernel/object/include/object/vm_object_dispatcher.h b/kernel/object/include/object/vm_object_dispatcher.h
index cbf0e43..fa50a35 100644
--- a/kernel/object/include/object/vm_object_dispatcher.h
+++ b/kernel/object/include/object/vm_object_dispatcher.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <object/dispatcher.h>
 #include <object/state_tracker.h>
@@ -20,25 +20,25 @@
 
 class VmObjectDispatcher final : public Dispatcher {
 public:
-    static mx_status_t Create(fbl::RefPtr<VmObject> vmo, fbl::RefPtr<Dispatcher>* dispatcher,
-                              mx_rights_t* rights);
+    static zx_status_t Create(fbl::RefPtr<VmObject> vmo, fbl::RefPtr<Dispatcher>* dispatcher,
+                              zx_rights_t* rights);
 
     ~VmObjectDispatcher() final;
-    mx_obj_type_t get_type() const final { return MX_OBJ_TYPE_VMO; }
+    zx_obj_type_t get_type() const final { return ZX_OBJ_TYPE_VMO; }
     StateTracker* get_state_tracker() final { return &state_tracker_; }
-    void get_name(char out_name[MX_MAX_NAME_LEN]) const final;
-    mx_status_t set_name(const char* name, size_t len) final;
+    void get_name(char out_name[ZX_MAX_NAME_LEN]) const final;
+    zx_status_t set_name(const char* name, size_t len) final;
     CookieJar* get_cookie_jar() final { return &cookie_jar_; }
 
-    mx_status_t Read(user_ptr<void> user_data, size_t length,
+    zx_status_t Read(user_ptr<void> user_data, size_t length,
                      uint64_t offset, size_t* actual);
-    mx_status_t Write(user_ptr<const void> user_data, size_t length,
+    zx_status_t Write(user_ptr<const void> user_data, size_t length,
                       uint64_t offset, size_t* actual);
-    mx_status_t SetSize(uint64_t);
-    mx_status_t GetSize(uint64_t* size);
-    mx_status_t RangeOp(uint32_t op, uint64_t offset, uint64_t size, user_ptr<void> buffer, size_t buffer_size);
-    mx_status_t Clone(uint32_t options, uint64_t offset, uint64_t size, bool copy_name, fbl::RefPtr<VmObject>* clone_vmo);
-    mx_status_t SetMappingCachePolicy(uint32_t cache_policy);
+    zx_status_t SetSize(uint64_t);
+    zx_status_t GetSize(uint64_t* size);
+    zx_status_t RangeOp(uint32_t op, uint64_t offset, uint64_t size, user_ptr<void> buffer, size_t buffer_size);
+    zx_status_t Clone(uint32_t options, uint64_t offset, uint64_t size, bool copy_name, fbl::RefPtr<VmObject>* clone_vmo);
+    zx_status_t SetMappingCachePolicy(uint32_t cache_policy);
 
     fbl::RefPtr<VmObject> vmo() const { return vmo_; }
 
diff --git a/kernel/object/include/object/wait_state_observer.h b/kernel/object/include/object/wait_state_observer.h
index 3b2ac0a..1811381 100644
--- a/kernel/object/include/object/wait_state_observer.h
+++ b/kernel/object/include/object/wait_state_observer.h
@@ -12,7 +12,7 @@
 #include <object/dispatcher.h>
 #include <object/state_observer.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/canary.h>
 #include <fbl/ref_ptr.h>
 
@@ -25,27 +25,27 @@
 
     // This should be called under the handle table lock. If this succeeds, End() must be called
     // (before the Event is destroyed).
-    mx_status_t Begin(Event* event,
+    zx_status_t Begin(Event* event,
                       Handle* handle,
-                      mx_signals_t watched_signals);
+                      zx_signals_t watched_signals);
 
     // This should *not* be called under the handle table lock.
-    mx_signals_t End();
+    zx_signals_t End();
 
 private:
     WaitStateObserver(const WaitStateObserver&) = delete;
     WaitStateObserver& operator=(const WaitStateObserver&) = delete;
 
     // StateObserver implementation:
-    Flags OnInitialize(mx_signals_t initial_state, const StateObserver::CountInfo* cinfo) final;
-    Flags OnStateChange(mx_signals_t new_state) final;
+    Flags OnInitialize(zx_signals_t initial_state, const StateObserver::CountInfo* cinfo) final;
+    Flags OnStateChange(zx_signals_t new_state) final;
     Flags OnCancel(Handle* handle) final;
 
     fbl::Canary<fbl::magic("WTSO")> canary_;
 
     Event* event_ = nullptr;
     Handle* handle_ = nullptr;
-    mx_signals_t watched_signals_ = 0u;
-    mx_signals_t wakeup_reasons_;
+    zx_signals_t watched_signals_ = 0u;
+    zx_signals_t wakeup_reasons_;
     fbl::RefPtr<Dispatcher> dispatcher_;  // Non-null only between Begin() and End().
 };
diff --git a/kernel/object/interrupt_event_dispatcher.cpp b/kernel/object/interrupt_event_dispatcher.cpp
index 050cb3a..fb19303 100644
--- a/kernel/object/interrupt_event_dispatcher.cpp
+++ b/kernel/object/interrupt_event_dispatcher.cpp
@@ -8,7 +8,7 @@
 
 #include <kernel/auto_lock.h>
 #include <dev/interrupt.h>
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 #include <fbl/mutex.h>
@@ -20,23 +20,23 @@
 InterruptEventDispatcher::VectorCollection InterruptEventDispatcher::vectors_;
 
 // static
-mx_status_t InterruptEventDispatcher::Create(uint32_t vector,
+zx_status_t InterruptEventDispatcher::Create(uint32_t vector,
                                              uint32_t flags,
                                              fbl::RefPtr<Dispatcher>* dispatcher,
-                                             mx_rights_t* rights) {
+                                             zx_rights_t* rights) {
     // Remap the vector if we have been asked to do so.
-    if (flags & MX_FLAG_REMAP_IRQ)
+    if (flags & ZX_FLAG_REMAP_IRQ)
         vector = remap_interrupt(vector);
 
     // If this is not a valid interrupt vector, fail.
     if (!is_valid_interrupt(vector, 0))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Attempt to construct the dispatcher.
     fbl::AllocChecker ac;
     InterruptEventDispatcher* disp = new (&ac) InterruptEventDispatcher(vector);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // Hold a ref while we check to see if someone else owns this vector or not.
     // If things go wrong, this ref will be released and the IED will get
@@ -47,7 +47,7 @@
     {
         fbl::AutoLock lock(&vectors_lock_);
         if (!vectors_.insert_or_find(disp))
-            return MX_ERR_ALREADY_EXISTS;
+            return ZX_ERR_ALREADY_EXISTS;
     }
 
     // Looks like things went well.  Register our callback and unmask our
@@ -56,10 +56,10 @@
     unmask_interrupt(vector);
 
     // Transfer control of the new dispatcher to the creator and we are done.
-    *rights     = MX_DEFAULT_INTERRUPT_RIGHTS;
+    *rights     = ZX_DEFAULT_INTERRUPT_RIGHTS;
     *dispatcher = fbl::move(disp_ref);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 InterruptEventDispatcher::~InterruptEventDispatcher() {
@@ -77,20 +77,20 @@
     }
 }
 
-mx_status_t InterruptEventDispatcher::InterruptComplete() {
+zx_status_t InterruptEventDispatcher::InterruptComplete() {
     canary_.Assert();
 
     unsignal();
     unmask_interrupt(vector_);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t InterruptEventDispatcher::UserSignal() {
+zx_status_t InterruptEventDispatcher::UserSignal() {
     canary_.Assert();
 
     mask_interrupt(vector_);
     signal(true);
-    return MX_OK;
+    return ZX_OK;
 }
 
 enum handler_return InterruptEventDispatcher::IrqHandler(void* ctx) {
diff --git a/kernel/object/job_dispatcher.cpp b/kernel/object/job_dispatcher.cpp
index 8e0b801..a76facf 100644
--- a/kernel/object/job_dispatcher.cpp
+++ b/kernel/object/job_dispatcher.cpp
@@ -8,8 +8,8 @@
 
 #include <err.h>
 
-#include <magenta/rights.h>
-#include <magenta/syscalls/policy.h>
+#include <zircon/rights.h>
+#include <zircon/syscalls/policy.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 #include <fbl/mutex.h>
@@ -31,28 +31,28 @@
     return job;
 }
 
-mx_status_t JobDispatcher::Create(uint32_t flags,
+zx_status_t JobDispatcher::Create(uint32_t flags,
                                   fbl::RefPtr<JobDispatcher> parent,
                                   fbl::RefPtr<Dispatcher>* dispatcher,
-                                  mx_rights_t* rights) {
+                                  zx_rights_t* rights) {
     if (parent != nullptr && parent->max_height() == 0) {
         // The parent job cannot have children.
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
 
     fbl::AllocChecker ac;
     fbl::RefPtr<JobDispatcher> job =
         fbl::AdoptRef(new (&ac) JobDispatcher(flags, parent, parent->GetPolicy()));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     if (!parent->AddChildJob(job.get())) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
-    *rights = MX_DEFAULT_JOB_RIGHTS;
+    *rights = ZX_DEFAULT_JOB_RIGHTS;
     *dispatcher = fbl::move(job);
-    return MX_OK;
+    return ZX_OK;
 }
 
 JobDispatcher::JobDispatcher(uint32_t /*flags*/,
@@ -64,9 +64,9 @@
       process_count_(0u),
       job_count_(0u),
       importance_(parent != nullptr
-                      ? MX_JOB_IMPORTANCE_INHERITED
-                      : MX_JOB_IMPORTANCE_MAX),
-      state_tracker_(MX_JOB_NO_PROCESSES | MX_JOB_NO_JOBS),
+                      ? ZX_JOB_IMPORTANCE_INHERITED
+                      : ZX_JOB_IMPORTANCE_MAX),
+      state_tracker_(ZX_JOB_NO_PROCESSES | ZX_JOB_NO_JOBS),
       policy_(policy) {
 
     // Set the initial relative importance.
@@ -119,7 +119,7 @@
     canary_.Assert();
 }
 
-mx_koid_t JobDispatcher::get_related_koid() const {
+zx_koid_t JobDispatcher::get_related_koid() const {
     return parent_ ? parent_->get_koid() : 0u;
 }
 
@@ -177,14 +177,14 @@
 
     DEBUG_ASSERT(lock_.IsHeld());
     // removing jobs or processes.
-    mx_signals_t set = 0u;
+    zx_signals_t set = 0u;
     if (process_count_ == 0u) {
         DEBUG_ASSERT(procs_.is_empty());
-        set |= MX_JOB_NO_PROCESSES;
+        set |= ZX_JOB_NO_PROCESSES;
     }
     if (job_count_ == 0u) {
         DEBUG_ASSERT(jobs_.is_empty());
-        set |= MX_JOB_NO_JOBS;
+        set |= ZX_JOB_NO_JOBS;
     }
 
     if ((job_count_ == 0) && (process_count_ == 0)) {
@@ -202,14 +202,14 @@
 
     DEBUG_ASSERT(lock_.IsHeld());
     // Adding jobs or processes.
-    mx_signals_t clear = 0u;
+    zx_signals_t clear = 0u;
     if (process_count_ == 1u) {
         DEBUG_ASSERT(!procs_.is_empty());
-        clear |= MX_JOB_NO_PROCESSES;
+        clear |= ZX_JOB_NO_PROCESSES;
     }
     if (job_count_ == 1u) {
         DEBUG_ASSERT(!jobs_.is_empty());
-        clear |= MX_JOB_NO_JOBS;
+        clear |= ZX_JOB_NO_JOBS;
     }
     state_tracker_.UpdateState(clear, 0u);
 }
@@ -273,13 +273,13 @@
     }
 }
 
-mx_status_t JobDispatcher::SetPolicy(
-    uint32_t mode, const mx_policy_basic* in_policy, size_t policy_count) {
+zx_status_t JobDispatcher::SetPolicy(
+    uint32_t mode, const zx_policy_basic* in_policy, size_t policy_count) {
     // Can't set policy when there are active processes or jobs.
     AutoLock lock(&lock_);
 
     if (!procs_.is_empty() || !jobs_.is_empty())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     pol_cookie_t new_policy;
     auto status = GetSystemPolicyManager()->AddPolicy(
@@ -289,7 +289,7 @@
         return status;
 
     policy_ = new_policy;
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool JobDispatcher::EnumerateChildren(JobEnumerator* je, bool recurse) {
@@ -317,7 +317,7 @@
     return true;
 }
 
-fbl::RefPtr<ProcessDispatcher> JobDispatcher::LookupProcessById(mx_koid_t koid) {
+fbl::RefPtr<ProcessDispatcher> JobDispatcher::LookupProcessById(zx_koid_t koid) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
@@ -328,7 +328,7 @@
     return nullptr;
 }
 
-fbl::RefPtr<JobDispatcher> JobDispatcher::LookupJobById(mx_koid_t koid) {
+fbl::RefPtr<JobDispatcher> JobDispatcher::LookupJobById(zx_koid_t koid) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
@@ -340,29 +340,29 @@
     return nullptr;
 }
 
-void JobDispatcher::get_name(char out_name[MX_MAX_NAME_LEN]) const {
+void JobDispatcher::get_name(char out_name[ZX_MAX_NAME_LEN]) const {
     canary_.Assert();
 
-    name_.get(MX_MAX_NAME_LEN, out_name);
+    name_.get(ZX_MAX_NAME_LEN, out_name);
 }
 
-mx_status_t JobDispatcher::set_name(const char* name, size_t len) {
+zx_status_t JobDispatcher::set_name(const char* name, size_t len) {
     canary_.Assert();
 
     return name_.set(name, len);
 }
 
-mx_status_t JobDispatcher::get_importance(mx_job_importance_t* out) const {
+zx_status_t JobDispatcher::get_importance(zx_job_importance_t* out) const {
     canary_.Assert();
     DEBUG_ASSERT(out != nullptr);
 
     // Find the importance value that we inherit.
     const JobDispatcher* job = this;
     do {
-        mx_job_importance_t imp = job->GetRawImportance();
-        if (imp != MX_JOB_IMPORTANCE_INHERITED) {
+        zx_job_importance_t imp = job->GetRawImportance();
+        if (imp != ZX_JOB_IMPORTANCE_INHERITED) {
             *out = imp;
-            return MX_OK;
+            return ZX_OK;
         }
         // Don't need to use RefPtrs or grab locks: our caller has a reference
         // to |this|, and there's a const RefPtr chain from |this| to all
@@ -375,20 +375,20 @@
           get_koid());
 }
 
-// Does not resolve MX_JOB_IMPORTANCE_INHERITED.
-mx_job_importance_t JobDispatcher::GetRawImportance() const {
+// Does not resolve ZX_JOB_IMPORTANCE_INHERITED.
+zx_job_importance_t JobDispatcher::GetRawImportance() const {
     canary_.Assert();
     AutoLock lock(&lock_);
     return importance_;
 }
 
-mx_status_t JobDispatcher::set_importance(mx_job_importance_t importance) {
+zx_status_t JobDispatcher::set_importance(zx_job_importance_t importance) {
     canary_.Assert();
 
-    if ((importance < MX_JOB_IMPORTANCE_MIN ||
-         importance > MX_JOB_IMPORTANCE_MAX) &&
-        importance != MX_JOB_IMPORTANCE_INHERITED) {
-        return MX_ERR_OUT_OF_RANGE;
+    if ((importance < ZX_JOB_IMPORTANCE_MIN ||
+         importance > ZX_JOB_IMPORTANCE_MAX) &&
+        importance != ZX_JOB_IMPORTANCE_INHERITED) {
+        return ZX_ERR_OUT_OF_RANGE;
     }
     AutoLock lock(&lock_);
     // No-one is allowed to change the importance of the root job.  Note that
@@ -396,19 +396,19 @@
     // no userspace program should see this error.  The job that userspace calls
     // "root" is actually a child of the real (super) root job.
     if (parent_ == nullptr) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
     importance_ = importance;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Global importance ranking. Note that this is independent of
-// mx_task_importance_t-style importance as far as JobDispatcher is concerned;
+// zx_task_importance_t-style importance as far as JobDispatcher is concerned;
 // some other entity will choose how to order importance_list_.
 fbl::Mutex JobDispatcher::importance_lock_;
 JobDispatcher::JobImportanceList JobDispatcher::importance_list_;
 
-mx_status_t JobDispatcher::MakeMoreImportantThan(
+zx_status_t JobDispatcher::MakeMoreImportantThan(
     fbl::RefPtr<JobDispatcher> other) {
 
     canary_.Assert();
@@ -432,20 +432,20 @@
     }
     DEBUG_ASSERT(dll_importance_.InContainer());
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t JobDispatcher::SetExceptionPort(fbl::RefPtr<ExceptionPort> eport) {
+zx_status_t JobDispatcher::SetExceptionPort(fbl::RefPtr<ExceptionPort> eport) {
     canary_.Assert();
 
     DEBUG_ASSERT(eport->type() == ExceptionPort::Type::JOB);
 
     AutoLock lock(&lock_);
     if (exception_port_)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     exception_port_ = fbl::move(eport);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 class OnExceptionPortRemovalEnumerator final : public JobEnumerator {
diff --git a/kernel/object/log_dispatcher.cpp b/kernel/object/log_dispatcher.cpp
index 2ac4e9f..1292da8 100644
--- a/kernel/object/log_dispatcher.cpp
+++ b/kernel/object/log_dispatcher.cpp
@@ -6,35 +6,35 @@
 
 #include <object/log_dispatcher.h>
 
-#include <magenta/rights.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/rights.h>
+#include <zircon/syscalls/log.h>
 
 #include <err.h>
 
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 
-mx_status_t LogDispatcher::Create(uint32_t flags, fbl::RefPtr<Dispatcher>* dispatcher,
-                                  mx_rights_t* rights) {
+zx_status_t LogDispatcher::Create(uint32_t flags, fbl::RefPtr<Dispatcher>* dispatcher,
+                                  zx_rights_t* rights) {
     fbl::AllocChecker ac;
     auto disp = new (&ac) LogDispatcher(flags);
-    if (!ac.check()) return MX_ERR_NO_MEMORY;
+    if (!ac.check()) return ZX_ERR_NO_MEMORY;
 
-    if (flags & MX_LOG_FLAG_READABLE) {
+    if (flags & ZX_LOG_FLAG_READABLE) {
         dlog_reader_init(&disp->reader_, &LogDispatcher::Notify, disp);
     }
 
-    *rights = MX_DEFAULT_LOG_RIGHTS;
+    *rights = ZX_DEFAULT_LOG_RIGHTS;
     *dispatcher = fbl::AdoptRef<Dispatcher>(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 LogDispatcher::LogDispatcher(uint32_t flags)
-    : flags_(flags), state_tracker_(MX_LOG_WRITABLE) {
+    : flags_(flags), state_tracker_(ZX_LOG_WRITABLE) {
 }
 
 LogDispatcher::~LogDispatcher() {
-    if (flags_ & MX_LOG_FLAG_READABLE) {
+    if (flags_ & ZX_LOG_FLAG_READABLE) {
         dlog_reader_destroy(&reader_);
     }
 }
@@ -43,7 +43,7 @@
     canary_.Assert();
 
     fbl::AutoLock lock(&lock_);
-    state_tracker_.UpdateState(0, MX_CHANNEL_READABLE);
+    state_tracker_.UpdateState(0, ZX_CHANNEL_READABLE);
 }
 
 // static
@@ -52,23 +52,23 @@
     log->Signal();
 }
 
-mx_status_t LogDispatcher::Write(uint32_t flags, const void* ptr, size_t len) {
+zx_status_t LogDispatcher::Write(uint32_t flags, const void* ptr, size_t len) {
     canary_.Assert();
 
     return dlog_write(flags_ | flags, ptr, len);
 }
 
-mx_status_t LogDispatcher::Read(uint32_t flags, void* ptr, size_t len, size_t* actual) {
+zx_status_t LogDispatcher::Read(uint32_t flags, void* ptr, size_t len, size_t* actual) {
     canary_.Assert();
 
-    if (!(flags_ & MX_LOG_FLAG_READABLE))
-        return MX_ERR_BAD_STATE;
+    if (!(flags_ & ZX_LOG_FLAG_READABLE))
+        return ZX_ERR_BAD_STATE;
 
     fbl::AutoLock lock(&lock_);
 
-    mx_status_t status = dlog_read(&reader_, 0, ptr, len, actual);
-    if (status == MX_ERR_SHOULD_WAIT) {
-        state_tracker_.UpdateState(MX_CHANNEL_READABLE, 0);
+    zx_status_t status = dlog_read(&reader_, 0, ptr, len, actual);
+    if (status == ZX_ERR_SHOULD_WAIT) {
+        state_tracker_.UpdateState(ZX_CHANNEL_READABLE, 0);
     }
 
     return status;
diff --git a/kernel/object/mbuf.cpp b/kernel/object/mbuf.cpp
index 7934ab5..11e1e04 100644
--- a/kernel/object/mbuf.cpp
+++ b/kernel/object/mbuf.cpp
@@ -46,7 +46,7 @@
         MBuf& cur = tail_.front();
         char* src = cur.data_ + cur.off_;
         size_t copy_len = MIN(cur.len_, len - pos);
-        if (dst.byte_offset(pos).copy_array_to_user(src, copy_len) != MX_OK)
+        if (dst.byte_offset(pos).copy_array_to_user(src, copy_len) != ZX_OK)
             return pos;
         pos += copy_len;
         cur.off_ += static_cast<uint32_t>(copy_len);
@@ -72,10 +72,10 @@
     return pos;
 }
 
-mx_status_t MBufChain::WriteDatagram(user_ptr<const void> src,
+zx_status_t MBufChain::WriteDatagram(user_ptr<const void> src,
                                      size_t len, size_t* written) {
     if (len + size_ > kSizeMax)
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
 
     fbl::SinglyLinkedList<MBuf*> bufs;
     for (size_t need = 1 + ((len - 1) / MBuf::kPayloadSize); need != 0; need--) {
@@ -83,7 +83,7 @@
         if (buf == nullptr) {
             while (!bufs.is_empty())
                 FreeMBuf(bufs.pop_front());
-            return MX_ERR_SHOULD_WAIT;
+            return ZX_ERR_SHOULD_WAIT;
         }
         bufs.push_front(buf);
     }
@@ -91,10 +91,10 @@
     size_t pos = 0;
     for (auto& buf : bufs) {
         size_t copy_len = fbl::min(MBuf::kPayloadSize, len - pos);
-        if (src.byte_offset(pos).copy_array_from_user(buf.data_, copy_len) != MX_OK) {
+        if (src.byte_offset(pos).copy_array_from_user(buf.data_, copy_len) != ZX_OK) {
             while (!bufs.is_empty())
                 FreeMBuf(bufs.pop_front());
-            return MX_ERR_INVALID_ARGS; // Bad user buffer.
+            return ZX_ERR_INVALID_ARGS; // Bad user buffer.
         }
         pos += copy_len;
         buf.len_ += static_cast<uint32_t>(copy_len);
@@ -115,15 +115,15 @@
 
     *written = len;
     size_ += len;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t MBufChain::WriteStream(user_ptr<const void> src,
+zx_status_t MBufChain::WriteStream(user_ptr<const void> src,
                                    size_t len, size_t* written) {
     if (head_ == nullptr) {
         head_ = AllocMBuf();
         if (head_ == nullptr)
-            return MX_ERR_SHOULD_WAIT;
+            return ZX_ERR_SHOULD_WAIT;
         tail_.push_front(head_);
     }
 
@@ -143,7 +143,7 @@
             if (copy_len == 0)
                 break;
         }
-        if (src.byte_offset(pos).copy_array_from_user(dst, copy_len) != MX_OK)
+        if (src.byte_offset(pos).copy_array_from_user(dst, copy_len) != ZX_OK)
             break;
         pos += copy_len;
         head_->len_ += static_cast<uint32_t>(copy_len);
@@ -151,10 +151,10 @@
     }
 
     if (pos == 0)
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
 
     *written = pos;
-    return MX_OK;
+    return ZX_OK;
 }
 
 MBufChain::MBuf* MBufChain::AllocMBuf() {
diff --git a/kernel/object/message_packet.cpp b/kernel/object/message_packet.cpp
index 331b39b..f04e033 100644
--- a/kernel/object/message_packet.cpp
+++ b/kernel/object/message_packet.cpp
@@ -10,17 +10,17 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <mxcpp/new.h>
+#include <zxcpp/new.h>
 #include <object/handle_reaper.h>
 
 // static
-mx_status_t MessagePacket::NewPacket(uint32_t data_size, uint32_t num_handles,
+zx_status_t MessagePacket::NewPacket(uint32_t data_size, uint32_t num_handles,
                                      fbl::unique_ptr<MessagePacket>* msg) {
     // Although the API uses uint32_t, we pack the handle count into a smaller
     // field internally. Make sure it fits.
     static_assert(kMaxMessageHandles <= UINT16_MAX, "");
     if (data_size > kMaxMessageSize || num_handles > kMaxMessageHandles) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
 
     // Allocate space for the MessagePacket object followed by num_handles
@@ -32,7 +32,7 @@
                                           num_handles * sizeof(Handle*) +
                                           data_size));
     if (ptr == nullptr) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // The storage space for the Handle*s is not initialized because
@@ -42,38 +42,38 @@
     msg->reset(new (ptr) MessagePacket(
         data_size, num_handles,
         reinterpret_cast<Handle**>(ptr + sizeof(MessagePacket))));
-    return MX_OK;
+    return ZX_OK;
 }
 
 // static
-mx_status_t MessagePacket::Create(user_ptr<const void> data, uint32_t data_size,
+zx_status_t MessagePacket::Create(user_ptr<const void> data, uint32_t data_size,
                                   uint32_t num_handles,
                                   fbl::unique_ptr<MessagePacket>* msg) {
-    mx_status_t status = NewPacket(data_size, num_handles, msg);
-    if (status != MX_OK) {
+    zx_status_t status = NewPacket(data_size, num_handles, msg);
+    if (status != ZX_OK) {
         return status;
     }
     if (data_size > 0u) {
-        if (data.copy_array_from_user((*msg)->data(), data_size) != MX_OK) {
+        if (data.copy_array_from_user((*msg)->data(), data_size) != ZX_OK) {
             msg->reset();
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 // static
-mx_status_t MessagePacket::Create(const void* data, uint32_t data_size,
+zx_status_t MessagePacket::Create(const void* data, uint32_t data_size,
                                   uint32_t num_handles,
                                   fbl::unique_ptr<MessagePacket>* msg) {
-    mx_status_t status = NewPacket(data_size, num_handles, msg);
-    if (status != MX_OK) {
+    zx_status_t status = NewPacket(data_size, num_handles, msg);
+    if (status != ZX_OK) {
         return status;
     }
     if (data_size > 0u) {
         memcpy((*msg)->data(), data, data_size);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 MessagePacket::~MessagePacket() {
diff --git a/kernel/object/pci_device_dispatcher.cpp b/kernel/object/pci_device_dispatcher.cpp
index 4af0bd3..2f12007 100644
--- a/kernel/object/pci_device_dispatcher.cpp
+++ b/kernel/object/pci_device_dispatcher.cpp
@@ -9,7 +9,7 @@
 #include <object/pci_device_dispatcher.h>
 
 #include <kernel/auto_lock.h>
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <object/pci_interrupt_dispatcher.h>
 #include <object/process_dispatcher.h>
 
@@ -22,30 +22,30 @@
 
 using fbl::AutoLock;
 
-mx_status_t PciDeviceDispatcher::Create(uint32_t                  index,
-                                        mx_pcie_device_info_t*    out_info,
+zx_status_t PciDeviceDispatcher::Create(uint32_t                  index,
+                                        zx_pcie_device_info_t*    out_info,
                                         fbl::RefPtr<Dispatcher>* out_dispatcher,
-                                        mx_rights_t*              out_rights) {
+                                        zx_rights_t*              out_rights) {
     auto bus_drv = PcieBusDriver::GetDriver();
     if (bus_drv == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     auto device = bus_drv->GetNthDevice(index);
     if (device == nullptr)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     fbl::AllocChecker ac;
     auto disp = new (&ac) PciDeviceDispatcher(fbl::move(device), out_info);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     *out_dispatcher = fbl::AdoptRef<Dispatcher>(disp);
-    *out_rights     = MX_DEFAULT_PCI_DEVICE_RIGHTS;
-    return MX_OK;
+    *out_rights     = ZX_DEFAULT_PCI_DEVICE_RIGHTS;
+    return ZX_OK;
 }
 
 PciDeviceDispatcher::PciDeviceDispatcher(fbl::RefPtr<PcieDevice> device,
-                                         mx_pcie_device_info_t* out_info)
+                                         zx_pcie_device_info_t* out_info)
     : device_(device) {
 
     out_info->vendor_id         = device_->vendor_id();
@@ -64,14 +64,14 @@
     // disabled when the driver using them has been unloaded.
     DEBUG_ASSERT(device_);
 
-    mx_status_t s = EnableBusMaster(false);
-    if (s != MX_OK) {
+    zx_status_t s = EnableBusMaster(false);
+    if (s != ZX_OK) {
         printf("Failed to disable bus mastering on %02x:%02x:%1x\n",
                device_->bus_id(), device_->dev_id(), device_->func_id());
     }
 
-    s = SetIrqMode(static_cast<mx_pci_irq_mode_t>(PCIE_IRQ_MODE_DISABLED), 0);
-    if (s != MX_OK) {
+    s = SetIrqMode(static_cast<zx_pci_irq_mode_t>(PCIE_IRQ_MODE_DISABLED), 0);
+    if (s != ZX_OK) {
         printf("Failed to disable IRQs on %02x:%02x:%1x\n",
                device_->bus_id(), device_->dev_id(), device_->func_id());
     }
@@ -86,7 +86,7 @@
     device_ = nullptr;
 }
 
-mx_status_t PciDeviceDispatcher::EnableBusMaster(bool enable) {
+zx_status_t PciDeviceDispatcher::EnableBusMaster(bool enable) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
@@ -94,10 +94,10 @@
 
     device_->EnableBusMaster(enable);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t PciDeviceDispatcher::EnablePio(bool enable) {
+zx_status_t PciDeviceDispatcher::EnablePio(bool enable) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
@@ -105,10 +105,10 @@
 
     device_->EnablePio(enable);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t PciDeviceDispatcher::EnableMmio(bool enable) {
+zx_status_t PciDeviceDispatcher::EnableMmio(bool enable) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
@@ -116,7 +116,7 @@
 
     device_->EnableMmio(enable);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 const pcie_bar_info_t* PciDeviceDispatcher::GetBar(uint32_t bar_num) {
@@ -126,12 +126,12 @@
     return device_->GetBarInfo(bar_num);
 }
 
-mx_status_t PciDeviceDispatcher::GetConfig(pci_config_info_t* out) {
+zx_status_t PciDeviceDispatcher::GetConfig(pci_config_info_t* out) {
     AutoLock lock(&lock_);
     DEBUG_ASSERT(device_);
 
     if (!out) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     auto cfg = device_->config();
@@ -139,10 +139,10 @@
     out->base_addr = cfg->base();
     out->is_mmio = (cfg->addr_space() == PciAddrSpace::MMIO);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t PciDeviceDispatcher::ResetDevice() {
+zx_status_t PciDeviceDispatcher::ResetDevice() {
     canary_.Assert();
 
     AutoLock lock(&lock_);
@@ -151,9 +151,9 @@
     return device_->DoFunctionLevelReset();
 }
 
-mx_status_t PciDeviceDispatcher::MapInterrupt(int32_t which_irq,
+zx_status_t PciDeviceDispatcher::MapInterrupt(int32_t which_irq,
                                               fbl::RefPtr<Dispatcher>* interrupt_dispatcher,
-                                              mx_rights_t* rights) {
+                                              zx_rights_t* rights) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
@@ -161,7 +161,7 @@
 
     if ((which_irq < 0) ||
         (static_cast<uint32_t>(which_irq) >= irqs_avail_cnt_))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Attempt to create the dispatcher.  It will take care of things like checking for
     // duplicate registration.
@@ -172,48 +172,48 @@
                                           interrupt_dispatcher);
 }
 
-static_assert(static_cast<uint>(MX_PCIE_IRQ_MODE_DISABLED) ==
+static_assert(static_cast<uint>(ZX_PCIE_IRQ_MODE_DISABLED) ==
               static_cast<uint>(PCIE_IRQ_MODE_DISABLED),
-              "Mode mismatch, MX_PCIE_IRQ_MODE_DISABLED != PCIE_IRQ_MODE_DISABLED");
-static_assert(static_cast<uint>(MX_PCIE_IRQ_MODE_LEGACY) ==
+              "Mode mismatch, ZX_PCIE_IRQ_MODE_DISABLED != PCIE_IRQ_MODE_DISABLED");
+static_assert(static_cast<uint>(ZX_PCIE_IRQ_MODE_LEGACY) ==
               static_cast<uint>(PCIE_IRQ_MODE_LEGACY),
-              "Mode mismatch, MX_PCIE_IRQ_MODE_LEGACY != PCIE_IRQ_MODE_LEGACY");
-static_assert(static_cast<uint>(MX_PCIE_IRQ_MODE_MSI) ==
+              "Mode mismatch, ZX_PCIE_IRQ_MODE_LEGACY != PCIE_IRQ_MODE_LEGACY");
+static_assert(static_cast<uint>(ZX_PCIE_IRQ_MODE_MSI) ==
               static_cast<uint>(PCIE_IRQ_MODE_MSI),
-              "Mode mismatch, MX_PCIE_IRQ_MODE_MSI != PCIE_IRQ_MODE_MSI");
-static_assert(static_cast<uint>(MX_PCIE_IRQ_MODE_MSI_X) ==
+              "Mode mismatch, ZX_PCIE_IRQ_MODE_MSI != PCIE_IRQ_MODE_MSI");
+static_assert(static_cast<uint>(ZX_PCIE_IRQ_MODE_MSI_X) ==
               static_cast<uint>(PCIE_IRQ_MODE_MSI_X),
-              "Mode mismatch, MX_PCIE_IRQ_MODE_MSI_X != PCIE_IRQ_MODE_MSI_X");
-mx_status_t PciDeviceDispatcher::QueryIrqModeCaps(mx_pci_irq_mode_t mode, uint32_t* out_max_irqs) {
+              "Mode mismatch, ZX_PCIE_IRQ_MODE_MSI_X != PCIE_IRQ_MODE_MSI_X");
+zx_status_t PciDeviceDispatcher::QueryIrqModeCaps(zx_pci_irq_mode_t mode, uint32_t* out_max_irqs) {
     AutoLock lock(&lock_);
     DEBUG_ASSERT(device_);
 
     pcie_irq_mode_caps_t caps;
-    mx_status_t ret = device_->QueryIrqModeCapabilities(static_cast<pcie_irq_mode_t>(mode),
+    zx_status_t ret = device_->QueryIrqModeCapabilities(static_cast<pcie_irq_mode_t>(mode),
                                                         &caps);
 
-    *out_max_irqs = (ret == MX_OK) ? caps.max_irqs : 0;
+    *out_max_irqs = (ret == ZX_OK) ? caps.max_irqs : 0;
     return ret;
 }
 
-mx_status_t PciDeviceDispatcher::SetIrqMode(mx_pci_irq_mode_t mode, uint32_t requested_irq_count) {
+zx_status_t PciDeviceDispatcher::SetIrqMode(zx_pci_irq_mode_t mode, uint32_t requested_irq_count) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
     DEBUG_ASSERT(device_);
 
-    if (mode == MX_PCIE_IRQ_MODE_DISABLED)
+    if (mode == ZX_PCIE_IRQ_MODE_DISABLED)
         requested_irq_count = 0;
 
-    mx_status_t ret;
+    zx_status_t ret;
     ret = device_->SetIrqMode(static_cast<pcie_irq_mode_t>(mode), requested_irq_count);
-    if (ret == MX_OK) {
+    if (ret == ZX_OK) {
         pcie_irq_mode_caps_t caps;
         ret = device_->QueryIrqModeCapabilities(static_cast<pcie_irq_mode_t>(mode), &caps);
 
         // The only way for QueryIrqMode to fail at this point should be for the
         // device to have become unplugged.
-        if (ret == MX_OK) {
+        if (ret == ZX_OK) {
             irqs_avail_cnt_ = requested_irq_count;
             irqs_maskable_  = caps.per_vector_masking_supported;
         } else {
diff --git a/kernel/object/pci_interrupt_dispatcher.cpp b/kernel/object/pci_interrupt_dispatcher.cpp
index bf78f9b..907f41f 100644
--- a/kernel/object/pci_interrupt_dispatcher.cpp
+++ b/kernel/object/pci_interrupt_dispatcher.cpp
@@ -9,16 +9,16 @@
 #include <object/pci_interrupt_dispatcher.h>
 
 #include <kernel/auto_lock.h>
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 #include <object/pci_device_dispatcher.h>
 
 PciInterruptDispatcher::~PciInterruptDispatcher() {
     if (device_) {
         // Unregister our handler.
-        __UNUSED mx_status_t ret;
+        __UNUSED zx_status_t ret;
         ret = device_->RegisterIrqHandler(irq_id_, nullptr, nullptr);
-        DEBUG_ASSERT(ret == MX_OK);  // This should never fail.
+        DEBUG_ASSERT(ret == ZX_OK);  // This should never fail.
 
         // Release our reference to our device.
         device_ = nullptr;
@@ -40,15 +40,15 @@
     }
 }
 
-mx_status_t PciInterruptDispatcher::Create(
+zx_status_t PciInterruptDispatcher::Create(
         const fbl::RefPtr<PcieDevice>& device,
         uint32_t irq_id,
         bool maskable,
-        mx_rights_t* out_rights,
+        zx_rights_t* out_rights,
         fbl::RefPtr<Dispatcher>* out_interrupt) {
     // Sanity check our args
     if (!device || !out_rights || !out_interrupt) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     fbl::AllocChecker ac;
@@ -56,16 +56,16 @@
     auto interrupt_dispatcher = new (&ac) PciInterruptDispatcher(irq_id, maskable);
     fbl::RefPtr<Dispatcher> dispatcher = fbl::AdoptRef<Dispatcher>(interrupt_dispatcher);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // Stash reference to the underlying device in the dispatcher we just
     // created, then attempt to register our dispatcher with the bus driver.
     DEBUG_ASSERT(device);
     interrupt_dispatcher->device_ = device;
-    mx_status_t result = device->RegisterIrqHandler(irq_id,
+    zx_status_t result = device->RegisterIrqHandler(irq_id,
                                                            IrqThunk,
                                                            interrupt_dispatcher);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         interrupt_dispatcher->device_ = nullptr;
         return result;
     }
@@ -77,21 +77,21 @@
         device->UnmaskIrq(irq_id);
     }
     *out_interrupt = fbl::move(dispatcher);
-    *out_rights    = MX_DEFAULT_PCI_INTERRUPT_RIGHTS;
-    return MX_OK;
+    *out_rights    = ZX_DEFAULT_PCI_INTERRUPT_RIGHTS;
+    return ZX_OK;
 }
 
-mx_status_t PciInterruptDispatcher::InterruptComplete() {
+zx_status_t PciInterruptDispatcher::InterruptComplete() {
     DEBUG_ASSERT(device_ != nullptr);
     unsignal();
 
     if (maskable_)
         device_->UnmaskIrq(irq_id_);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t PciInterruptDispatcher::UserSignal() {
+zx_status_t PciInterruptDispatcher::UserSignal() {
     DEBUG_ASSERT(device_ != nullptr);
 
     if (maskable_)
@@ -99,7 +99,7 @@
 
     signal(true);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 #endif  // if WITH_DEV_PCIE
diff --git a/kernel/object/policy_manager.cpp b/kernel/object/policy_manager.cpp
index 1474c00..01c854e 100644
--- a/kernel/object/policy_manager.cpp
+++ b/kernel/object/policy_manager.cpp
@@ -7,7 +7,7 @@
 #include <assert.h>
 #include <err.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/alloc_checker.h>
 
 namespace {
@@ -15,9 +15,9 @@
 // The encoding of the basic policy is done 4 bits per each item.
 //
 // - When the top bit is 1, the lower 3 bits track the action:
-//    0 : MX_POL_ACTION_ALLOW or not (MX_POL_ACTION_DENY)
-//    1 : MX_POL_ACTION_EXCEPTION or not
-//    2 : MX_POL_ACTION_KILL or not
+//    0 : ZX_POL_ACTION_ALLOW or not (ZX_POL_ACTION_DENY)
+//    1 : ZX_POL_ACTION_EXCEPTION or not
+//    2 : ZX_POL_ACTION_KILL or not
 //
 // - When the top bit is 0 then its the default policy and other bits
 //   should be zero so that kPolicyEmpty == 0 meets the requirement of
@@ -54,7 +54,7 @@
 }  // namespace
 
 constexpr uint32_t kPolicyActionValidBits =
-    MX_POL_ACTION_ALLOW | MX_POL_ACTION_DENY | MX_POL_ACTION_EXCEPTION | MX_POL_ACTION_KILL;
+    ZX_POL_ACTION_ALLOW | ZX_POL_ACTION_DENY | ZX_POL_ACTION_EXCEPTION | ZX_POL_ACTION_KILL;
 
 // The packing of bits on a bitset (above) is defined by the standard as
 // implementation dependent so we must check that it is using the storage
@@ -62,7 +62,7 @@
 static_assert(sizeof(Encoding) == sizeof(pol_cookie_t), "bitfield issue");
 
 // Make sure that adding new policies forces updating this file.
-static_assert(MX_POL_MAX == 12u, "please update PolicyManager AddPolicy and QueryBasicPolicy");
+static_assert(ZX_POL_MAX == 12u, "please update PolicyManager AddPolicy and QueryBasicPolicy");
 
 PolicyManager* PolicyManager::Create(uint32_t default_action) {
     fbl::AllocChecker ac;
@@ -74,16 +74,16 @@
     : default_action_(default_action) {
 }
 
-mx_status_t PolicyManager::AddPolicy(
+zx_status_t PolicyManager::AddPolicy(
     uint32_t mode, pol_cookie_t existing_policy,
-    const mx_policy_basic* policy_input, size_t policy_count,
+    const zx_policy_basic* policy_input, size_t policy_count,
     pol_cookie_t* new_policy) {
 
     // Don't allow overlong policies.
-    if (policy_count > MX_POL_MAX)
-        return MX_ERR_OUT_OF_RANGE;
+    if (policy_count > ZX_POL_MAX)
+        return ZX_ERR_OUT_OF_RANGE;
 
-    uint64_t partials[MX_POL_MAX] = {0};
+    uint64_t partials[ZX_POL_MAX] = {0};
 
     // The policy computation algorithm is as follows:
     //
@@ -93,26 +93,26 @@
     //        else if mode is absolute exit with failure
     //        else continue
     //
-    // A special case is MX_POL_NEW_ANY which applies the algorithm with
-    // the same input over all MX_NEW_ actions so that the following can
+    // A special case is ZX_POL_NEW_ANY which applies the algorithm with
+    // the same input over all ZX_NEW_ actions so that the following can
     // be expressed:
     //
-    //   [0] MX_POL_NEW_ANY     --> MX_POL_ACTION_DENY
-    //   [1] MX_POL_NEW_CHANNEL --> MX_POL_ACTION_ALLOW
+    //   [0] ZX_POL_NEW_ANY     --> ZX_POL_ACTION_DENY
+    //   [1] ZX_POL_NEW_CHANNEL --> ZX_POL_ACTION_ALLOW
     //
     // Which means "deny all object creation except for channel".
 
-    mx_status_t res = MX_OK;
+    zx_status_t res = ZX_OK;
 
     for (size_t ix = 0; ix != policy_count; ++ix) {
         const auto& in = policy_input[ix];
 
-        if (in.condition >= MX_POL_MAX)
-            return MX_ERR_INVALID_ARGS;
+        if (in.condition >= ZX_POL_MAX)
+            return ZX_ERR_INVALID_ARGS;
 
-        if (in.condition == MX_POL_NEW_ANY) {
-            // loop over all MX_POL_NEW_xxxx conditions.
-            for (uint32_t it = MX_POL_NEW_VMO; it <= MX_POL_NEW_TIMER; ++it) {
+        if (in.condition == ZX_POL_NEW_ANY) {
+            // loop over all ZX_POL_NEW_xxxx conditions.
+            for (uint32_t it = ZX_POL_NEW_VMO; it <= ZX_POL_NEW_TIMER; ++it) {
                 if ((res = AddPartial(mode, existing_policy, it, in.policy, &partials[it])) < 0)
                     return res;
             }
@@ -130,7 +130,7 @@
     }
 
     *new_policy = existing_policy;
-    return MX_OK;
+    return ZX_OK;
 }
 
 uint32_t PolicyManager::QueryBasicPolicy(pol_cookie_t policy, uint32_t condition) {
@@ -141,18 +141,18 @@
     DEBUG_ASSERT(existing.cookie_mode == Encoding::kPolicyInCookie);
 
     switch (condition) {
-    case MX_POL_BAD_HANDLE: return GetEffectiveAction(existing.bad_handle);
-    case MX_POL_WRONG_OBJECT: return GetEffectiveAction(existing.wrong_obj);
-    case MX_POL_NEW_VMO: return GetEffectiveAction(existing.new_vmo);
-    case MX_POL_NEW_CHANNEL: return GetEffectiveAction(existing.new_channel);
-    case MX_POL_NEW_EVENT: return GetEffectiveAction(existing.new_event);
-    case MX_POL_NEW_EVPAIR: return GetEffectiveAction(existing.new_evpair);
-    case MX_POL_NEW_PORT: return GetEffectiveAction(existing.new_port);
-    case MX_POL_NEW_SOCKET: return GetEffectiveAction(existing.new_socket);
-    case MX_POL_NEW_FIFO: return GetEffectiveAction(existing.new_fifo);
-    case MX_POL_NEW_TIMER: return GetEffectiveAction(existing.new_fifo);
-    case MX_POL_VMAR_WX: return GetEffectiveAction(existing.vmar_wx);
-    default: return MX_POL_ACTION_DENY;
+    case ZX_POL_BAD_HANDLE: return GetEffectiveAction(existing.bad_handle);
+    case ZX_POL_WRONG_OBJECT: return GetEffectiveAction(existing.wrong_obj);
+    case ZX_POL_NEW_VMO: return GetEffectiveAction(existing.new_vmo);
+    case ZX_POL_NEW_CHANNEL: return GetEffectiveAction(existing.new_channel);
+    case ZX_POL_NEW_EVENT: return GetEffectiveAction(existing.new_event);
+    case ZX_POL_NEW_EVPAIR: return GetEffectiveAction(existing.new_evpair);
+    case ZX_POL_NEW_PORT: return GetEffectiveAction(existing.new_port);
+    case ZX_POL_NEW_SOCKET: return GetEffectiveAction(existing.new_socket);
+    case ZX_POL_NEW_FIFO: return GetEffectiveAction(existing.new_fifo);
+    case ZX_POL_NEW_TIMER: return GetEffectiveAction(existing.new_fifo);
+    case ZX_POL_VMAR_WX: return GetEffectiveAction(existing.vmar_wx);
+    default: return ZX_POL_ACTION_DENY;
     }
 }
 
@@ -172,59 +172,59 @@
         if (CanSetEntry(existing, in_pol)) {                            \
             resultant = in_pol & Encoding::kActionBits;                 \
             resultant |= Encoding::kExplicitBit;                        \
-        } else if (mode == MX_JOB_POL_ABSOLUTE) {                       \
-            return MX_ERR_ALREADY_EXISTS;                               \
+        } else if (mode == ZX_JOB_POL_ABSOLUTE) {                       \
+            return ZX_ERR_ALREADY_EXISTS;                               \
         }                                                               \
     } while (0)
 
-mx_status_t PolicyManager::AddPartial(uint32_t mode, pol_cookie_t existing_policy,
+zx_status_t PolicyManager::AddPartial(uint32_t mode, pol_cookie_t existing_policy,
                                       uint32_t condition, uint32_t policy, uint64_t* partial) {
     Encoding existing = { existing_policy };
     Encoding result = {0};
 
     if (policy & ~kPolicyActionValidBits)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     switch (condition) {
-    case MX_POL_BAD_HANDLE:
+    case ZX_POL_BAD_HANDLE:
         POLMAN_SET_ENTRY(mode, existing.bad_handle, policy, result.bad_handle);
         break;
-    case MX_POL_WRONG_OBJECT:
+    case ZX_POL_WRONG_OBJECT:
         POLMAN_SET_ENTRY(mode, existing.wrong_obj, policy, result.wrong_obj);
         break;
-    case MX_POL_VMAR_WX:
+    case ZX_POL_VMAR_WX:
         POLMAN_SET_ENTRY(mode, existing.vmar_wx, policy, result.vmar_wx);
         break;
-    case MX_POL_NEW_VMO:
+    case ZX_POL_NEW_VMO:
         POLMAN_SET_ENTRY(mode, existing.new_vmo, policy, result.new_vmo);
         break;
-    case MX_POL_NEW_CHANNEL:
+    case ZX_POL_NEW_CHANNEL:
         POLMAN_SET_ENTRY(mode, existing.new_channel, policy, result.new_channel);
         break;
-    case MX_POL_NEW_EVENT:
+    case ZX_POL_NEW_EVENT:
         POLMAN_SET_ENTRY(mode, existing.new_event, policy, result.new_event);
         break;
-    case MX_POL_NEW_EVPAIR:
+    case ZX_POL_NEW_EVPAIR:
         POLMAN_SET_ENTRY(mode, existing.new_evpair, policy, result.new_evpair);
         break;
-    case MX_POL_NEW_PORT:
+    case ZX_POL_NEW_PORT:
         POLMAN_SET_ENTRY(mode, existing.new_port, policy, result.new_port);
         break;
-    case MX_POL_NEW_SOCKET:
+    case ZX_POL_NEW_SOCKET:
         POLMAN_SET_ENTRY(mode, existing.new_socket, policy, result.new_socket);
         break;
-    case MX_POL_NEW_FIFO:
+    case ZX_POL_NEW_FIFO:
         POLMAN_SET_ENTRY(mode, existing.new_fifo, policy, result.new_fifo);
         break;
-    case MX_POL_NEW_TIMER:
+    case ZX_POL_NEW_TIMER:
         POLMAN_SET_ENTRY(mode, existing.new_timer, policy, result.new_timer);
         break;
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     *partial = result.encoded;
-    return MX_OK;
+    return ZX_OK;
 }
 
 #undef POLMAN_SET_ENTRY
diff --git a/kernel/object/port_dispatcher.cpp b/kernel/object/port_dispatcher.cpp
index 1dd7ce8..32da01a 100644
--- a/kernel/object/port_dispatcher.cpp
+++ b/kernel/object/port_dispatcher.cpp
@@ -11,9 +11,9 @@
 #include <platform.h>
 #include <pow2.h>
 
-#include <magenta/compiler.h>
-#include <magenta/rights.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/compiler.h>
+#include <zircon/rights.h>
+#include <zircon/syscalls/port.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/arena.h>
 #include <fbl/auto_lock.h>
@@ -22,18 +22,18 @@
 
 using fbl::AutoLock;
 
-static_assert(sizeof(mx_packet_signal_t) == sizeof(mx_packet_user_t),
-              "size of mx_packet_signal_t must match mx_packet_user_t");
-static_assert(sizeof(mx_packet_exception_t) == sizeof(mx_packet_user_t),
-              "size of mx_packet_exception_t must match mx_packet_user_t");
-static_assert(sizeof(mx_packet_guest_mem_t) == sizeof(mx_packet_user_t),
-              "size of mx_packet_guest_mem_t must match mx_packet_user_t");
-static_assert(sizeof(mx_packet_guest_io_t) == sizeof(mx_packet_user_t),
-              "size of mx_packet_guest_io_t must match mx_packet_user_t");
+static_assert(sizeof(zx_packet_signal_t) == sizeof(zx_packet_user_t),
+              "size of zx_packet_signal_t must match zx_packet_user_t");
+static_assert(sizeof(zx_packet_exception_t) == sizeof(zx_packet_user_t),
+              "size of zx_packet_exception_t must match zx_packet_user_t");
+static_assert(sizeof(zx_packet_guest_mem_t) == sizeof(zx_packet_user_t),
+              "size of zx_packet_guest_mem_t must match zx_packet_user_t");
+static_assert(sizeof(zx_packet_guest_io_t) == sizeof(zx_packet_user_t),
+              "size of zx_packet_guest_io_t must match zx_packet_user_t");
 
 class ArenaPortAllocator final : public PortAllocator {
 public:
-    mx_status_t Init();
+    zx_status_t Init();
     virtual ~ArenaPortAllocator() = default;
 
     virtual PortPacket* Alloc();
@@ -48,7 +48,7 @@
 ArenaPortAllocator port_allocator;
 }  // namespace.
 
-mx_status_t ArenaPortAllocator::Init() {
+zx_status_t ArenaPortAllocator::Init() {
     return arena_.Init("packets", kMaxPendingPacketCount);
 }
 
@@ -76,7 +76,7 @@
 }
 
 PortObserver::PortObserver(uint32_t type, const Handle* handle, fbl::RefPtr<PortDispatcher> port,
-                           uint64_t key, mx_signals_t signals)
+                           uint64_t key, zx_signals_t signals)
     : type_(type),
       trigger_(signals),
       packet_(handle, nullptr),
@@ -85,13 +85,13 @@
     DEBUG_ASSERT(handle != nullptr);
 
     auto& packet = packet_.packet;
-    packet.status = MX_OK;
+    packet.status = ZX_OK;
     packet.key = key;
     packet.type = type_;
     packet.signal.trigger = trigger_;
 }
 
-StateObserver::Flags PortObserver::OnInitialize(mx_signals_t initial_state,
+StateObserver::Flags PortObserver::OnInitialize(zx_signals_t initial_state,
                                                 const StateObserver::CountInfo* cinfo) {
     uint64_t count = 1u;
 
@@ -106,7 +106,7 @@
     return MaybeQueue(initial_state, count);
 }
 
-StateObserver::Flags PortObserver::OnStateChange(mx_signals_t new_state) {
+StateObserver::Flags PortObserver::OnStateChange(zx_signals_t new_state) {
     return MaybeQueue(new_state, 1u);
 }
 
@@ -129,14 +129,14 @@
         delete this;
 }
 
-StateObserver::Flags PortObserver::MaybeQueue(mx_signals_t new_state, uint64_t count) {
+StateObserver::Flags PortObserver::MaybeQueue(zx_signals_t new_state, uint64_t count) {
     // Always called with the object state lock being held.
     if ((trigger_ & new_state) == 0u)
         return 0;
 
     auto status = port_->Queue(&packet_, new_state, count);
 
-    if ((type_ == MX_PKT_TYPE_SIGNAL_ONE) || (status < 0))
+    if ((type_ == ZX_PKT_TYPE_SIGNAL_ONE) || (status < 0))
         return kNeedRemoval;
 
     return 0;
@@ -152,17 +152,17 @@
     return &port_allocator;
 }
 
-mx_status_t PortDispatcher::Create(uint32_t options, fbl::RefPtr<Dispatcher>* dispatcher,
-                                   mx_rights_t* rights) {
+zx_status_t PortDispatcher::Create(uint32_t options, fbl::RefPtr<Dispatcher>* dispatcher,
+                                   zx_rights_t* rights) {
     DEBUG_ASSERT(options == 0);
     fbl::AllocChecker ac;
     auto disp = new (&ac) PortDispatcher(options);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    *rights = MX_DEFAULT_PORT_RIGHTS;
+    *rights = ZX_DEFAULT_PORT_RIGHTS;
     *dispatcher = fbl::AdoptRef<Dispatcher>(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 PortDispatcher::PortDispatcher(uint32_t /*options*/)
@@ -190,18 +190,18 @@
             lock_.Acquire();
         }
     }
-    while (Dequeue(0ull, nullptr) == MX_OK) {}
+    while (Dequeue(0ull, nullptr) == ZX_OK) {}
 }
 
-mx_status_t PortDispatcher::QueueUser(const mx_port_packet_t& packet) {
+zx_status_t PortDispatcher::QueueUser(const zx_port_packet_t& packet) {
     canary_.Assert();
 
     auto port_packet = port_allocator.Alloc();
     if (!port_packet)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     port_packet->packet = packet;
-    port_packet->packet.type = MX_PKT_TYPE_USER | PKT_FLAG_EPHEMERAL;
+    port_packet->packet.type = ZX_PKT_TYPE_USER | PKT_FLAG_EPHEMERAL;
 
     auto status = Queue(port_packet, 0u, 0u);
     if (status < 0)
@@ -209,18 +209,18 @@
     return status;
 }
 
-mx_status_t PortDispatcher::Queue(PortPacket* port_packet, mx_signals_t observed, uint64_t count) {
+zx_status_t PortDispatcher::Queue(PortPacket* port_packet, zx_signals_t observed, uint64_t count) {
     canary_.Assert();
 
     int wake_count = 0;
     {
         AutoLock al(&lock_);
         if (zero_handles_)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         if (observed) {
             if (port_packet->InContainer())
-                return MX_OK;
+                return ZX_OK;
             port_packet->packet.signal.observed = observed;
             port_packet->packet.signal.count = count;
         }
@@ -232,10 +232,10 @@
     if (wake_count)
         thread_reschedule();
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t PortDispatcher::Dequeue(mx_time_t deadline, mx_port_packet_t* out_packet) {
+zx_status_t PortDispatcher::Dequeue(zx_time_t deadline, zx_port_packet_t* out_packet) {
     canary_.Assert();
 
     while (true) {
@@ -262,11 +262,11 @@
             }
         }
 
-        return MX_OK;
+        return ZX_OK;
 
 wait:
-        mx_status_t st = sema_.Wait(deadline);
-        if (st != MX_OK)
+        zx_status_t st = sema_.Wait(deadline);
+        if (st != ZX_OK)
             return st;
     }
 }
@@ -283,27 +283,27 @@
     return false;
 }
 
-mx_status_t PortDispatcher::MakeObserver(uint32_t options, Handle* handle, uint64_t key,
-                                         mx_signals_t signals) {
+zx_status_t PortDispatcher::MakeObserver(uint32_t options, Handle* handle, uint64_t key,
+                                         zx_signals_t signals) {
     canary_.Assert();
 
     // Called under the handle table lock.
 
     auto dispatcher = handle->dispatcher();
     if (!dispatcher->get_state_tracker())
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     fbl::AllocChecker ac;
-    auto type = (options == MX_WAIT_ASYNC_ONCE) ?
-        MX_PKT_TYPE_SIGNAL_ONE : MX_PKT_TYPE_SIGNAL_REP;
+    auto type = (options == ZX_WAIT_ASYNC_ONCE) ?
+        ZX_PKT_TYPE_SIGNAL_ONE : ZX_PKT_TYPE_SIGNAL_REP;
 
     auto observer = new (&ac) PortObserver(type, handle, fbl::RefPtr<PortDispatcher>(this), key,
                                            signals);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     dispatcher->add_observer(observer);
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool PortDispatcher::CancelQueued(const void* handle, uint64_t key) {
diff --git a/kernel/object/process_dispatcher.cpp b/kernel/object/process_dispatcher.cpp
index 9672262..02aafa4 100644
--- a/kernel/object/process_dispatcher.cpp
+++ b/kernel/object/process_dispatcher.cpp
@@ -23,7 +23,7 @@
 #include <lib/crypto/global_prng.h>
 #include <lib/ktrace.h>
 
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 
 #include <object/diagnostics.h>
 #include <object/futex_context.h>
@@ -42,7 +42,7 @@
 
 #define LOCAL_TRACE 0
 
-static mx_handle_t map_handle_to_value(const Handle* handle, mx_handle_t mixer) {
+static zx_handle_t map_handle_to_value(const Handle* handle, zx_handle_t mixer) {
     // Ensure that the last bit of the result is not zero, and make sure
     // we don't lose any base_value bits or make the result negative
     // when shifting.
@@ -53,26 +53,26 @@
     return mixer ^ handle_id;
 }
 
-static Handle* map_value_to_handle(mx_handle_t value, mx_handle_t mixer) {
+static Handle* map_value_to_handle(zx_handle_t value, zx_handle_t mixer) {
     auto handle_id = (value ^ mixer) >> 1;
     return MapU32ToHandle(handle_id);
 }
 
-mx_status_t ProcessDispatcher::Create(
+zx_status_t ProcessDispatcher::Create(
     fbl::RefPtr<JobDispatcher> job, fbl::StringPiece name, uint32_t flags,
-    fbl::RefPtr<Dispatcher>* dispatcher, mx_rights_t* rights,
+    fbl::RefPtr<Dispatcher>* dispatcher, zx_rights_t* rights,
     fbl::RefPtr<VmAddressRegionDispatcher>* root_vmar_disp,
-    mx_rights_t* root_vmar_rights) {
+    zx_rights_t* root_vmar_rights) {
     fbl::AllocChecker ac;
     fbl::unique_ptr<ProcessDispatcher> process(new (&ac) ProcessDispatcher(job, name, flags));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     if (!job->AddChildProcess(process.get()))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
-    mx_status_t result = process->Initialize();
-    if (result != MX_OK)
+    zx_status_t result = process->Initialize();
+    if (result != ZX_OK)
         return result;
 
     fbl::RefPtr<VmAddressRegion> vmar(process->aspace()->RootVmar());
@@ -80,17 +80,17 @@
     // Create a dispatcher for the root VMAR.
     fbl::RefPtr<Dispatcher> new_vmar_dispatcher;
     result = VmAddressRegionDispatcher::Create(vmar, &new_vmar_dispatcher, root_vmar_rights);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         process->aspace_->Destroy();
         return result;
     }
 
-    *rights = MX_DEFAULT_PROCESS_RIGHTS;
+    *rights = ZX_DEFAULT_PROCESS_RIGHTS;
     *dispatcher = fbl::AdoptRef<Dispatcher>(process.release());
     *root_vmar_disp = DownCastDispatcher<VmAddressRegionDispatcher>(
             &new_vmar_dispatcher);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 ProcessDispatcher::ProcessDispatcher(fbl::RefPtr<JobDispatcher> job,
@@ -126,15 +126,15 @@
     LTRACE_EXIT_OBJ;
 }
 
-void ProcessDispatcher::get_name(char out_name[MX_MAX_NAME_LEN]) const {
-    name_.get(MX_MAX_NAME_LEN, out_name);
+void ProcessDispatcher::get_name(char out_name[ZX_MAX_NAME_LEN]) const {
+    name_.get(ZX_MAX_NAME_LEN, out_name);
 }
 
-mx_status_t ProcessDispatcher::set_name(const char* name, size_t len) {
+zx_status_t ProcessDispatcher::set_name(const char* name, size_t len) {
     return name_.set(name, len);
 }
 
-mx_status_t ProcessDispatcher::Initialize() {
+zx_status_t ProcessDispatcher::Initialize() {
     LTRACE_ENTRY_OBJ;
 
     AutoLock lock(&state_lock_);
@@ -142,15 +142,15 @@
     DEBUG_ASSERT(state_ == State::INITIAL);
 
     // create an address space for this process, named after the process's koid.
-    char aspace_name[MX_MAX_NAME_LEN];
+    char aspace_name[ZX_MAX_NAME_LEN];
     snprintf(aspace_name, sizeof(aspace_name), "proc:%" PRIu64, get_koid());
     aspace_ = VmAspace::Create(VmAspace::TYPE_USER, aspace_name);
     if (!aspace_) {
         TRACEF("error creating address space\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void ProcessDispatcher::Exit(int retcode) {
@@ -225,19 +225,19 @@
     }
 }
 
-mx_status_t ProcessDispatcher::AddThread(ThreadDispatcher* t, bool initial_thread) {
+zx_status_t ProcessDispatcher::AddThread(ThreadDispatcher* t, bool initial_thread) {
     LTRACE_ENTRY_OBJ;
 
     AutoLock state_lock(&state_lock_);
 
     if (initial_thread) {
         if (state_ != State::INITIAL)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
     } else {
         // We must not add a thread when in the DYING or DEAD states.
         // Also, we want to ensure that this is not the first thread.
         if (state_ != State::RUNNING)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
     }
 
     // add the thread to our list
@@ -249,7 +249,7 @@
     if (initial_thread)
         SetStateLocked(State::RUNNING);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // This is called within thread T's context when it is exiting.
@@ -287,7 +287,7 @@
     Kill();
 }
 
-mx_koid_t ProcessDispatcher::get_related_koid() const {
+zx_koid_t ProcessDispatcher::get_related_koid() const {
     return job_->get_koid();
 }
 
@@ -337,7 +337,7 @@
         // tear down the address space
         aspace_->Destroy();
 
-        // Send out exception reports before signalling MX_TASK_TERMINATED,
+        // Send out exception reports before signalling ZX_TASK_TERMINATED,
         // the theory being that marking the process as terminated is the
         // last thing that is done.
         //
@@ -369,7 +369,7 @@
 
         // signal waiter
         LTRACEF_LEVEL(2, "signaling waiters\n");
-        state_tracker_.UpdateState(0u, MX_TASK_TERMINATED);
+        state_tracker_.UpdateState(0u, ZX_TASK_TERMINATED);
 
         // IWBN to call job_->RemoveChildProcess(this) here, but that risks
         // a deadlock as we have |state_lock_| and RemoveChildProcess grabs the
@@ -380,7 +380,7 @@
         // here, so we leave that to the caller after it has released
         // |state_lock_|. MG-880
         // The caller should call RemoveChildProcess soon so that the semantics
-        // of signaling MX_JOB_NO_PROCESSES match that of MX_TASK_TERMINATED.
+        // of signaling ZX_JOB_NO_PROCESSES match that of ZX_TASK_TERMINATED.
 
         // The PROC_CREATE record currently emits a uint32_t.
         uint32_t koid = static_cast<uint32_t>(get_koid());
@@ -389,24 +389,24 @@
 }
 
 // process handle manipulation routines
-mx_handle_t ProcessDispatcher::MapHandleToValue(const Handle* handle) const {
+zx_handle_t ProcessDispatcher::MapHandleToValue(const Handle* handle) const {
     return map_handle_to_value(handle, handle_rand_);
 }
 
-mx_handle_t ProcessDispatcher::MapHandleToValue(const HandleOwner& handle) const {
+zx_handle_t ProcessDispatcher::MapHandleToValue(const HandleOwner& handle) const {
     return map_handle_to_value(handle.get(), handle_rand_);
 }
 
-Handle* ProcessDispatcher::GetHandleLocked(mx_handle_t handle_value) {
+Handle* ProcessDispatcher::GetHandleLocked(zx_handle_t handle_value) {
     auto handle = map_value_to_handle(handle_value, handle_rand_);
     if (handle && handle->process_id() == get_koid())
         return handle;
 
     // Handle lookup failed.  We potentially generate an exception,
     // depending on the job policy.  Note that we don't use the return
-    // value from QueryPolicy() here: MX_POL_ACTION_ALLOW and
-    // MX_POL_ACTION_DENY are equivalent for MX_POL_BAD_HANDLE.
-    QueryPolicy(MX_POL_BAD_HANDLE);
+    // value from QueryPolicy() here: ZX_POL_ACTION_ALLOW and
+    // ZX_POL_ACTION_DENY are equivalent for ZX_POL_BAD_HANDLE.
+    QueryPolicy(ZX_POL_BAD_HANDLE);
     return nullptr;
 }
 
@@ -420,12 +420,12 @@
     handles_.push_front(handle.release());
 }
 
-HandleOwner ProcessDispatcher::RemoveHandle(mx_handle_t handle_value) {
+HandleOwner ProcessDispatcher::RemoveHandle(zx_handle_t handle_value) {
     AutoLock lock(&handle_table_lock_);
     return RemoveHandleLocked(handle_value);
 }
 
-HandleOwner ProcessDispatcher::RemoveHandleLocked(mx_handle_t handle_value) {
+HandleOwner ProcessDispatcher::RemoveHandleLocked(zx_handle_t handle_value) {
     auto handle = GetHandleLocked(handle_value);
     if (!handle)
         return nullptr;
@@ -436,52 +436,52 @@
     return HandleOwner(handle);
 }
 
-void ProcessDispatcher::UndoRemoveHandleLocked(mx_handle_t handle_value) {
+void ProcessDispatcher::UndoRemoveHandleLocked(zx_handle_t handle_value) {
     auto handle = map_value_to_handle(handle_value, handle_rand_);
     AddHandleLocked(HandleOwner(handle));
 }
 
-mx_koid_t ProcessDispatcher::GetKoidForHandle(mx_handle_t handle_value) {
+zx_koid_t ProcessDispatcher::GetKoidForHandle(zx_handle_t handle_value) {
     AutoLock lock(&handle_table_lock_);
     Handle* handle = GetHandleLocked(handle_value);
     if (!handle)
-        return MX_KOID_INVALID;
+        return ZX_KOID_INVALID;
     return handle->dispatcher()->get_koid();
 }
 
-mx_status_t ProcessDispatcher::GetDispatcherInternal(mx_handle_t handle_value,
+zx_status_t ProcessDispatcher::GetDispatcherInternal(zx_handle_t handle_value,
                                                      fbl::RefPtr<Dispatcher>* dispatcher,
-                                                     mx_rights_t* rights) {
+                                                     zx_rights_t* rights) {
     AutoLock lock(&handle_table_lock_);
     Handle* handle = GetHandleLocked(handle_value);
     if (!handle)
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
 
     *dispatcher = handle->dispatcher();
     if (rights)
         *rights = handle->rights();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ProcessDispatcher::GetDispatcherWithRightsInternal(mx_handle_t handle_value,
-                                                               mx_rights_t desired_rights,
+zx_status_t ProcessDispatcher::GetDispatcherWithRightsInternal(zx_handle_t handle_value,
+                                                               zx_rights_t desired_rights,
                                                                fbl::RefPtr<Dispatcher>* dispatcher_out,
-                                                               mx_rights_t* out_rights) {
+                                                               zx_rights_t* out_rights) {
     AutoLock lock(&handle_table_lock_);
     Handle* handle = GetHandleLocked(handle_value);
     if (!handle)
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
 
     if (!handle->HasRights(desired_rights))
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
 
     *dispatcher_out = handle->dispatcher();
     if (out_rights)
         *out_rights = handle->rights();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ProcessDispatcher::GetInfo(mx_info_process_t* info) {
+zx_status_t ProcessDispatcher::GetInfo(zx_info_process_t* info) {
     // retcode_ depends on the state: make sure they're consistent.
     state_lock_.Acquire();
     int retcode = retcode_;
@@ -508,48 +508,48 @@
             info->debugger_attached = true;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ProcessDispatcher::GetStats(mx_info_task_stats_t* stats) {
+zx_status_t ProcessDispatcher::GetStats(zx_info_task_stats_t* stats) {
     DEBUG_ASSERT(stats != nullptr);
     AutoLock lock(&state_lock_);
     if (state_ != State::RUNNING) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     VmAspace::vm_usage_t usage;
-    mx_status_t s = aspace_->GetMemoryUsage(&usage);
-    if (s != MX_OK) {
+    zx_status_t s = aspace_->GetMemoryUsage(&usage);
+    if (s != ZX_OK) {
         return s;
     }
     stats->mem_mapped_bytes = usage.mapped_pages * PAGE_SIZE;
     stats->mem_private_bytes = usage.private_pages * PAGE_SIZE;
     stats->mem_shared_bytes = usage.shared_pages * PAGE_SIZE;
     stats->mem_scaled_shared_bytes = usage.scaled_shared_bytes;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ProcessDispatcher::GetAspaceMaps(
-    user_ptr<mx_info_maps_t> maps, size_t max,
+zx_status_t ProcessDispatcher::GetAspaceMaps(
+    user_ptr<zx_info_maps_t> maps, size_t max,
     size_t* actual, size_t* available) {
     AutoLock lock(&state_lock_);
     if (state_ != State::RUNNING) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     return GetVmAspaceMaps(aspace_, maps, max, actual, available);
 }
 
-mx_status_t ProcessDispatcher::GetVmos(
-    user_ptr<mx_info_vmo_t> vmos, size_t max,
+zx_status_t ProcessDispatcher::GetVmos(
+    user_ptr<zx_info_vmo_t> vmos, size_t max,
     size_t* actual_out, size_t* available_out) {
     AutoLock lock(&state_lock_);
     if (state_ != State::RUNNING) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     size_t actual = 0;
     size_t available = 0;
-    mx_status_t s = GetProcessVmosViaHandles(this, vmos, max, &actual, &available);
-    if (s != MX_OK) {
+    zx_status_t s = GetProcessVmosViaHandles(this, vmos, max, &actual, &available);
+    if (s != ZX_OK) {
         return s;
     }
     size_t actual2 = 0;
@@ -557,22 +557,22 @@
     DEBUG_ASSERT(max >= actual);
     s = GetVmAspaceVmos(aspace_, vmos.element_offset(actual), max - actual,
                         &actual2, &available2);
-    if (s != MX_OK) {
+    if (s != ZX_OK) {
         return s;
     }
     *actual_out = actual + actual2;
     *available_out = available + available2;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ProcessDispatcher::GetThreads(fbl::Array<mx_koid_t>* out_threads) {
+zx_status_t ProcessDispatcher::GetThreads(fbl::Array<zx_koid_t>* out_threads) {
     AutoLock lock(&state_lock_);
     size_t n = thread_list_.size_slow();
-    fbl::Array<mx_koid_t> threads;
+    fbl::Array<zx_koid_t> threads;
     fbl::AllocChecker ac;
-    threads.reset(new (&ac) mx_koid_t[n], n);
+    threads.reset(new (&ac) zx_koid_t[n], n);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     size_t i = 0;
     for (auto& thread : thread_list_) {
         threads[i] = thread.get_koid();
@@ -580,10 +580,10 @@
     }
     DEBUG_ASSERT(i == n);
     *out_threads = fbl::move(threads);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ProcessDispatcher::SetExceptionPort(fbl::RefPtr<ExceptionPort> eport) {
+zx_status_t ProcessDispatcher::SetExceptionPort(fbl::RefPtr<ExceptionPort> eport) {
     LTRACE_ENTRY_OBJ;
     bool debugger = false;
     switch (eport->type()) {
@@ -603,18 +603,18 @@
     AutoLock state_lock(&state_lock_);
     AutoLock excp_lock(&exception_lock_);
     if (state_ == State::DEAD)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     if (debugger) {
         if (debugger_exception_port_)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         debugger_exception_port_ = eport;
     } else {
         if (exception_port_)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         exception_port_ = eport;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool ProcessDispatcher::ResetExceptionPort(bool debugger, bool quietly) {
@@ -682,7 +682,7 @@
 
 class FindProcessByKoid final : public JobEnumerator {
 public:
-    FindProcessByKoid(mx_koid_t koid) : koid_(koid) {}
+    FindProcessByKoid(zx_koid_t koid) : koid_(koid) {}
     FindProcessByKoid(const FindProcessByKoid&) = delete;
 
     // To be called after enumeration.
@@ -699,18 +699,18 @@
         return true;
     }
 
-    const mx_koid_t koid_;
+    const zx_koid_t koid_;
     fbl::RefPtr<ProcessDispatcher> pd_ = nullptr;
 };
 
 // static
-fbl::RefPtr<ProcessDispatcher> ProcessDispatcher::LookupProcessById(mx_koid_t koid) {
+fbl::RefPtr<ProcessDispatcher> ProcessDispatcher::LookupProcessById(zx_koid_t koid) {
     FindProcessByKoid finder(koid);
     GetRootJobDispatcher()->EnumerateChildren(&finder, /* recurse */ true);
     return finder.get_pd();
 }
 
-fbl::RefPtr<ThreadDispatcher> ProcessDispatcher::LookupThreadById(mx_koid_t koid) {
+fbl::RefPtr<ThreadDispatcher> ProcessDispatcher::LookupThreadById(zx_koid_t koid) {
     LTRACE_ENTRY_OBJ;
     AutoLock lock(&state_lock_);
 
@@ -723,25 +723,25 @@
     return debug_addr_;
 }
 
-mx_status_t ProcessDispatcher::set_debug_addr(uintptr_t addr) {
+zx_status_t ProcessDispatcher::set_debug_addr(uintptr_t addr) {
     if (addr == 0u)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     AutoLock lock(&state_lock_);
     // Only allow the value to be set once: Once ld.so has set it that's it.
     if (debug_addr_ != 0u)
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     debug_addr_ = addr;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ProcessDispatcher::QueryPolicy(uint32_t condition) const {
+zx_status_t ProcessDispatcher::QueryPolicy(uint32_t condition) const {
     auto action = GetSystemPolicyManager()->QueryBasicPolicy(policy_, condition);
-    if (action & MX_POL_ACTION_EXCEPTION) {
+    if (action & ZX_POL_ACTION_EXCEPTION) {
         thread_signal_policy_exception();
     }
-    // TODO(cpu): check for the MX_POL_KILL bit and return an error code
+    // TODO(cpu): check for the ZX_POL_KILL bit and return an error code
     // that sysgen understands as termination.
-    return (action & MX_POL_ACTION_DENY) ? MX_ERR_ACCESS_DENIED : MX_OK;
+    return (action & ZX_POL_ACTION_DENY) ? ZX_ERR_ACCESS_DENIED : ZX_OK;
 }
 
 uintptr_t ProcessDispatcher::cache_vdso_code_address() {
@@ -764,7 +764,7 @@
     return "unknown";
 }
 
-bool ProcessDispatcher::IsHandleValid(mx_handle_t handle_value) {
+bool ProcessDispatcher::IsHandleValid(zx_handle_t handle_value) {
     AutoLock lock(&handle_table_lock_);
     return (GetHandleLocked(handle_value) != nullptr);
 }
diff --git a/kernel/object/resource_dispatcher.cpp b/kernel/object/resource_dispatcher.cpp
index 15d19e1..e1b0027 100644
--- a/kernel/object/resource_dispatcher.cpp
+++ b/kernel/object/resource_dispatcher.cpp
@@ -6,24 +6,24 @@
 
 #include <object/resource_dispatcher.h>
 
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 
 #include <kernel/auto_lock.h>
 #include <string.h>
 
 
-mx_status_t ResourceDispatcher::Create(fbl::RefPtr<ResourceDispatcher>* dispatcher,
-                                       mx_rights_t* rights, uint32_t kind,
+zx_status_t ResourceDispatcher::Create(fbl::RefPtr<ResourceDispatcher>* dispatcher,
+                                       zx_rights_t* rights, uint32_t kind,
                                        uint64_t low, uint64_t high) {
     fbl::AllocChecker ac;
     ResourceDispatcher* disp = new (&ac) ResourceDispatcher(kind, low, high);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    *rights = MX_DEFAULT_RESOURCE_RIGHTS;
+    *rights = ZX_DEFAULT_RESOURCE_RIGHTS;
     *dispatcher = fbl::AdoptRef<ResourceDispatcher>(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 ResourceDispatcher::ResourceDispatcher(uint32_t kind, uint64_t low, uint64_t high) :
diff --git a/kernel/object/semaphore.cpp b/kernel/object/semaphore.cpp
index 8b58a6b..1bce49c 100644
--- a/kernel/object/semaphore.cpp
+++ b/kernel/object/semaphore.cpp
@@ -7,7 +7,7 @@
 #include <object/semaphore.h>
 
 #include <err.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 Semaphore::Semaphore(int64_t initial_count) : count_(initial_count) {
     wait_queue_init(&waitq_);
@@ -22,23 +22,23 @@
     // otherwise it's safe to just increase the count available with no downsides.
     AutoThreadLock lock;
     if (unlikely(++count_ <= 0))
-        return wait_queue_wake_one(&waitq_, false, MX_OK);
+        return wait_queue_wake_one(&waitq_, false, ZX_OK);
     return 0;
 }
 
-mx_status_t Semaphore::Wait(lk_time_t deadline) {
+zx_status_t Semaphore::Wait(lk_time_t deadline) {
     thread_t *current_thread = get_current_thread();
 
      // If there are no resources available then we need to
      // sit in the wait queue until sem_post adds some.
-    mx_status_t ret = MX_OK;
+    zx_status_t ret = ZX_OK;
     AutoThreadLock lock;
     current_thread->interruptable = true;
 
     if (unlikely(--count_ < 0)) {
         ret = wait_queue_block(&waitq_, deadline);
-        if (ret < MX_OK) {
-            if ((ret == MX_ERR_TIMED_OUT) || (ret == MX_ERR_INTERNAL_INTR_KILLED))
+        if (ret < ZX_OK) {
+            if ((ret == ZX_ERR_TIMED_OUT) || (ret == ZX_ERR_INTERNAL_INTR_KILLED))
                 count_++;
         }
     }
diff --git a/kernel/object/socket_dispatcher.cpp b/kernel/object/socket_dispatcher.cpp
index b0f8cf5..d3b7b76 100644
--- a/kernel/object/socket_dispatcher.cpp
+++ b/kernel/object/socket_dispatcher.cpp
@@ -20,7 +20,7 @@
 #include <vm/vm_object_paged.h>
 #include <object/handle.h>
 
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 
@@ -29,55 +29,55 @@
 #define LOCAL_TRACE 0
 
 // static
-mx_status_t SocketDispatcher::Create(uint32_t flags,
+zx_status_t SocketDispatcher::Create(uint32_t flags,
                                      fbl::RefPtr<Dispatcher>* dispatcher0,
                                      fbl::RefPtr<Dispatcher>* dispatcher1,
-                                     mx_rights_t* rights) {
+                                     zx_rights_t* rights) {
     LTRACE_ENTRY;
 
-    if (flags & ~MX_SOCKET_CREATE_MASK)
-        return MX_ERR_INVALID_ARGS;
+    if (flags & ~ZX_SOCKET_CREATE_MASK)
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::AllocChecker ac;
     auto socket0 = fbl::AdoptRef(new (&ac) SocketDispatcher(flags));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto socket1 = fbl::AdoptRef(new (&ac) SocketDispatcher(flags));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     socket0->Init(socket1);
     socket1->Init(socket0);
 
     // TODO: use mbufs to avoid pinning control buffer memory.
-    if (flags & MX_SOCKET_HAS_CONTROL) {
+    if (flags & ZX_SOCKET_HAS_CONTROL) {
         // TODO: after moving to an mbuf pool, do this in Init
         // to avoid the need to hold the mutex.
         AutoLock lock0(&socket0->lock_);
         socket0->control_msg_.reset(new (&ac) char[kControlMsgSize]);
         if (!ac.check())
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         AutoLock lock1(&socket1->lock_);
         socket1->control_msg_.reset(new (&ac) char[kControlMsgSize]);
         if (!ac.check())
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
-        socket0->state_tracker_.UpdateState(0u, MX_SOCKET_CONTROL_WRITABLE);
-        socket1->state_tracker_.UpdateState(0u, MX_SOCKET_CONTROL_WRITABLE);
+        socket0->state_tracker_.UpdateState(0u, ZX_SOCKET_CONTROL_WRITABLE);
+        socket1->state_tracker_.UpdateState(0u, ZX_SOCKET_CONTROL_WRITABLE);
     }
 
-    *rights = MX_DEFAULT_SOCKET_RIGHTS;
+    *rights = ZX_DEFAULT_SOCKET_RIGHTS;
     *dispatcher0 = fbl::move(socket0);
     *dispatcher1 = fbl::move(socket1);
-    return MX_OK;
+    return ZX_OK;
 }
 
 SocketDispatcher::SocketDispatcher(uint32_t flags)
     : flags_(flags),
       peer_koid_(0u),
-      state_tracker_(MX_SOCKET_WRITABLE),
+      state_tracker_(ZX_SOCKET_WRITABLE),
       control_msg_len_(0),
       read_disabled_(false) {
 }
@@ -111,68 +111,68 @@
 
     AutoLock lock(&lock_);
     other_.reset();
-    state_tracker_.UpdateState(MX_SOCKET_WRITABLE, MX_SOCKET_PEER_CLOSED);
+    state_tracker_.UpdateState(ZX_SOCKET_WRITABLE, ZX_SOCKET_PEER_CLOSED);
 }
 
-mx_status_t SocketDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
+zx_status_t SocketDispatcher::user_signal(uint32_t clear_mask, uint32_t set_mask, bool peer) {
     canary_.Assert();
 
-    if ((set_mask & ~MX_USER_SIGNAL_ALL) || (clear_mask & ~MX_USER_SIGNAL_ALL))
-        return MX_ERR_INVALID_ARGS;
+    if ((set_mask & ~ZX_USER_SIGNAL_ALL) || (clear_mask & ~ZX_USER_SIGNAL_ALL))
+        return ZX_ERR_INVALID_ARGS;
 
     if (!peer) {
         state_tracker_.UpdateState(clear_mask, set_mask);
-        return MX_OK;
+        return ZX_OK;
     }
 
     fbl::RefPtr<SocketDispatcher> other;
     {
         AutoLock lock(&lock_);
         if (!other_)
-            return MX_ERR_PEER_CLOSED;
+            return ZX_ERR_PEER_CLOSED;
         other = other_;
     }
 
     return other->UserSignalSelf(clear_mask, set_mask);
 }
 
-mx_status_t SocketDispatcher::UserSignalSelf(uint32_t clear_mask, uint32_t set_mask) {
+zx_status_t SocketDispatcher::UserSignalSelf(uint32_t clear_mask, uint32_t set_mask) {
     canary_.Assert();
     state_tracker_.UpdateState(clear_mask, set_mask);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t SocketDispatcher::Shutdown(uint32_t how) {
+zx_status_t SocketDispatcher::Shutdown(uint32_t how) {
     canary_.Assert();
 
     LTRACE_ENTRY;
 
-    const bool shutdown_read = how & MX_SOCKET_SHUTDOWN_READ;
-    const bool shutdown_write = how & MX_SOCKET_SHUTDOWN_WRITE;
+    const bool shutdown_read = how & ZX_SOCKET_SHUTDOWN_READ;
+    const bool shutdown_write = how & ZX_SOCKET_SHUTDOWN_WRITE;
 
     fbl::RefPtr<SocketDispatcher> other;
     {
         AutoLock lock(&lock_);
-        mx_signals_t signals = state_tracker_.GetSignalsState();
+        zx_signals_t signals = state_tracker_.GetSignalsState();
         // If we're already shut down in the requested way, return immediately.
         const uint32_t want_signals =
-            (shutdown_read ? MX_SOCKET_READ_DISABLED : 0) |
-            (shutdown_write ? MX_SOCKET_WRITE_DISABLED : 0);
-        const uint32_t have_signals = signals & (MX_SOCKET_READ_DISABLED | MX_SOCKET_WRITE_DISABLED);
+            (shutdown_read ? ZX_SOCKET_READ_DISABLED : 0) |
+            (shutdown_write ? ZX_SOCKET_WRITE_DISABLED : 0);
+        const uint32_t have_signals = signals & (ZX_SOCKET_READ_DISABLED | ZX_SOCKET_WRITE_DISABLED);
         if (want_signals == have_signals) {
-            return MX_OK;
+            return ZX_OK;
         }
         other = other_;
-        mx_signals_t clear_mask = 0u;
-        mx_signals_t set_mask = 0u;
+        zx_signals_t clear_mask = 0u;
+        zx_signals_t set_mask = 0u;
         if (shutdown_read) {
             read_disabled_ = true;
             if (is_empty())
-                set_mask |= MX_SOCKET_READ_DISABLED;
+                set_mask |= ZX_SOCKET_READ_DISABLED;
         }
         if (shutdown_write) {
-            clear_mask |= MX_SOCKET_WRITABLE;
-            set_mask |= MX_SOCKET_WRITE_DISABLED;
+            clear_mask |= ZX_SOCKET_WRITABLE;
+            set_mask |= ZX_SOCKET_WRITE_DISABLED;
         }
         state_tracker_.UpdateState(clear_mask, set_mask);
     }
@@ -181,38 +181,38 @@
     if (other) {
         return other->ShutdownOther(how);
     } else {
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
-mx_status_t SocketDispatcher::ShutdownOther(uint32_t how) {
+zx_status_t SocketDispatcher::ShutdownOther(uint32_t how) {
     canary_.Assert();
 
-    const bool shutdown_read = how & MX_SOCKET_SHUTDOWN_READ;
-    const bool shutdown_write = how & MX_SOCKET_SHUTDOWN_WRITE;
+    const bool shutdown_read = how & ZX_SOCKET_SHUTDOWN_READ;
+    const bool shutdown_write = how & ZX_SOCKET_SHUTDOWN_WRITE;
 
     AutoLock lock(&lock_);
-    mx_signals_t clear_mask = 0u;
-    mx_signals_t set_mask = 0u;
+    zx_signals_t clear_mask = 0u;
+    zx_signals_t set_mask = 0u;
     if (shutdown_read) {
         // If the other end shut down reading, we can't write any more.
-        clear_mask |= MX_SOCKET_WRITABLE;
-        set_mask |= MX_SOCKET_WRITE_DISABLED;
+        clear_mask |= ZX_SOCKET_WRITABLE;
+        set_mask |= ZX_SOCKET_WRITE_DISABLED;
     }
     if (shutdown_write) {
         // If the other end shut down writing, we can't read any more than already exists in the
-        // buffer. If we're empty, set MX_SOCKET_READ_DISABLED now. If we aren't empty, Read() will
+        // buffer. If we're empty, set ZX_SOCKET_READ_DISABLED now. If we aren't empty, Read() will
         // set this bit after reading the remaining data from the socket.
         read_disabled_ = true;
         if (is_empty())
-            set_mask |= MX_SOCKET_READ_DISABLED;
+            set_mask |= ZX_SOCKET_READ_DISABLED;
     }
 
     state_tracker_.UpdateState(clear_mask, set_mask);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t SocketDispatcher::Write(user_ptr<const void> src, size_t len,
+zx_status_t SocketDispatcher::Write(user_ptr<const void> src, size_t len,
                                     size_t* nwritten) {
     canary_.Assert();
 
@@ -222,80 +222,80 @@
     {
         AutoLock lock(&lock_);
         if (!other_)
-            return MX_ERR_PEER_CLOSED;
-        mx_signals_t signals = state_tracker_.GetSignalsState();
-        if (signals & MX_SOCKET_WRITE_DISABLED)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_PEER_CLOSED;
+        zx_signals_t signals = state_tracker_.GetSignalsState();
+        if (signals & ZX_SOCKET_WRITE_DISABLED)
+            return ZX_ERR_BAD_STATE;
         other = other_;
     }
 
     if (len == 0) {
         *nwritten = 0;
-        return MX_OK;
+        return ZX_OK;
     }
     if (len != static_cast<size_t>(static_cast<uint32_t>(len)))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     return other->WriteSelf(src, len, nwritten);
 }
 
-mx_status_t SocketDispatcher::WriteControl(user_ptr<const void> src, size_t len) {
+zx_status_t SocketDispatcher::WriteControl(user_ptr<const void> src, size_t len) {
     canary_.Assert();
 
-    if ((flags_ & MX_SOCKET_HAS_CONTROL) == 0)
-        return MX_ERR_BAD_STATE;
+    if ((flags_ & ZX_SOCKET_HAS_CONTROL) == 0)
+        return ZX_ERR_BAD_STATE;
 
     if (len == 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (len > kControlMsgSize)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     fbl::RefPtr<SocketDispatcher> other;
     {
         AutoLock lock(&lock_);
         if (!other_)
-            return MX_ERR_PEER_CLOSED;
+            return ZX_ERR_PEER_CLOSED;
         other = other_;
     }
 
     return other->WriteControlSelf(src, len);
 }
 
-mx_status_t SocketDispatcher::WriteControlSelf(user_ptr<const void> src,
+zx_status_t SocketDispatcher::WriteControlSelf(user_ptr<const void> src,
                                                size_t len) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
 
     if (control_msg_len_ != 0)
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
 
-    if (src.copy_array_from_user(control_msg_.get(), len) != MX_OK)
-        return MX_ERR_INVALID_ARGS; // Bad user buffer.
+    if (src.copy_array_from_user(control_msg_.get(), len) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS; // Bad user buffer.
 
     control_msg_len_ = static_cast<uint32_t>(len);
 
-    state_tracker_.UpdateState(0u, MX_SOCKET_CONTROL_READABLE);
-    other_->state_tracker_.UpdateState(MX_SOCKET_CONTROL_WRITABLE, 0u);
+    state_tracker_.UpdateState(0u, ZX_SOCKET_CONTROL_READABLE);
+    other_->state_tracker_.UpdateState(ZX_SOCKET_CONTROL_WRITABLE, 0u);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t SocketDispatcher::WriteSelf(user_ptr<const void> src, size_t len,
+zx_status_t SocketDispatcher::WriteSelf(user_ptr<const void> src, size_t len,
                                         size_t* written) {
     canary_.Assert();
 
     AutoLock lock(&lock_);
 
     if (is_full())
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
 
     bool was_empty = is_empty();
 
     size_t st = 0u;
-    mx_status_t status;
-    if (flags_ & MX_SOCKET_DATAGRAM) {
+    zx_status_t status;
+    if (flags_ & ZX_SOCKET_DATAGRAM) {
         status = data_.WriteDatagram(src, len, &st);
     } else {
         status = data_.WriteStream(src, len, &st);
@@ -305,17 +305,17 @@
 
     if (st > 0) {
         if (was_empty)
-            state_tracker_.UpdateState(0u, MX_SOCKET_READABLE);
+            state_tracker_.UpdateState(0u, ZX_SOCKET_READABLE);
     }
 
     if (is_full())
-        other_->state_tracker_.UpdateState(MX_SOCKET_WRITABLE, 0u);
+        other_->state_tracker_.UpdateState(ZX_SOCKET_WRITABLE, 0u);
 
     *written = st;
     return status;
 }
 
-mx_status_t SocketDispatcher::Read(user_ptr<void> dst, size_t len,
+zx_status_t SocketDispatcher::Read(user_ptr<void> dst, size_t len,
                                    size_t* nread) {
     canary_.Assert();
 
@@ -326,61 +326,61 @@
     // Just query for bytes outstanding.
     if (!dst && len == 0) {
         *nread = data_.size();
-        return MX_OK;
+        return ZX_OK;
     }
 
     if (len != (size_t)((uint32_t)len))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (is_empty()) {
         if (!other_)
-            return MX_ERR_PEER_CLOSED;
+            return ZX_ERR_PEER_CLOSED;
         // If reading is disabled on our end and we're empty, we'll never become readable again.
         // Return a different error to let the caller know.
         if (read_disabled_)
-            return MX_ERR_BAD_STATE;
-        return MX_ERR_SHOULD_WAIT;
+            return ZX_ERR_BAD_STATE;
+        return ZX_ERR_SHOULD_WAIT;
     }
 
     bool was_full = is_full();
 
-    auto st = data_.Read(dst, len, flags_ & MX_SOCKET_DATAGRAM);
+    auto st = data_.Read(dst, len, flags_ & ZX_SOCKET_DATAGRAM);
 
     if (is_empty()) {
         uint32_t set_mask = 0u;
         if (read_disabled_)
-            set_mask |= MX_SOCKET_READ_DISABLED;
-        state_tracker_.UpdateState(MX_SOCKET_READABLE, set_mask);
+            set_mask |= ZX_SOCKET_READ_DISABLED;
+        state_tracker_.UpdateState(ZX_SOCKET_READABLE, set_mask);
     }
 
     if (other_ && was_full && (st > 0))
-        other_->state_tracker_.UpdateState(0u, MX_SOCKET_WRITABLE);
+        other_->state_tracker_.UpdateState(0u, ZX_SOCKET_WRITABLE);
 
     *nread = static_cast<size_t>(st);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t SocketDispatcher::ReadControl(user_ptr<void> dst, size_t len,
+zx_status_t SocketDispatcher::ReadControl(user_ptr<void> dst, size_t len,
                                           size_t* nread) {
     canary_.Assert();
 
-    if ((flags_ & MX_SOCKET_HAS_CONTROL) == 0) {
-        return MX_ERR_BAD_STATE;
+    if ((flags_ & ZX_SOCKET_HAS_CONTROL) == 0) {
+        return ZX_ERR_BAD_STATE;
     }
 
     AutoLock lock(&lock_);
 
     if (control_msg_len_ == 0)
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
 
     size_t copy_len = MIN(control_msg_len_, len);
-    if (dst.copy_array_to_user(control_msg_.get(), copy_len) != MX_OK)
-        return MX_ERR_INVALID_ARGS; // Invalid user buffer.
+    if (dst.copy_array_to_user(control_msg_.get(), copy_len) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS; // Invalid user buffer.
 
     control_msg_len_ = 0;
-    state_tracker_.UpdateState(MX_SOCKET_CONTROL_READABLE, 0u);
-    other_->state_tracker_.UpdateState(0u, MX_SOCKET_CONTROL_WRITABLE);
+    state_tracker_.UpdateState(ZX_SOCKET_CONTROL_READABLE, 0u);
+    other_->state_tracker_.UpdateState(0u, ZX_SOCKET_CONTROL_WRITABLE);
 
     *nread = copy_len;
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/object/state_tracker.cpp b/kernel/object/state_tracker.cpp
index 6cb0912..327bb660 100644
--- a/kernel/object/state_tracker.cpp
+++ b/kernel/object/state_tracker.cpp
@@ -97,8 +97,8 @@
     return flags & StateObserver::kHandled;
 }
 
-void StateTracker::UpdateState(mx_signals_t clear_mask,
-                               mx_signals_t set_mask) {
+void StateTracker::UpdateState(zx_signals_t clear_mask,
+                               zx_signals_t set_mask) {
     canary_.Assert();
 
     StateObserver::Flags flags;
@@ -141,7 +141,7 @@
         // We assume here that the value pointed by |count| can mutate by
         // other threads.
         signals_ = (*count == 1u) ?
-            signals_ | MX_SIGNAL_LAST_HANDLE : signals_ & ~MX_SIGNAL_LAST_HANDLE;
+            signals_ | ZX_SIGNAL_LAST_HANDLE : signals_ & ~ZX_SIGNAL_LAST_HANDLE;
 
         if (previous_signals == signals_)
             return;
@@ -157,51 +157,51 @@
         thread_reschedule();
 }
 
-mx_status_t StateTracker::SetCookie(CookieJar* cookiejar, mx_koid_t scope, uint64_t cookie) {
+zx_status_t StateTracker::SetCookie(CookieJar* cookiejar, zx_koid_t scope, uint64_t cookie) {
     if (cookiejar == nullptr)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     AutoLock lock(&lock_);
 
-    if (cookiejar->scope_ == MX_KOID_INVALID) {
+    if (cookiejar->scope_ == ZX_KOID_INVALID) {
         cookiejar->scope_ = scope;
         cookiejar->cookie_ = cookie;
-        return MX_OK;
+        return ZX_OK;
     }
 
     if (cookiejar->scope_ == scope) {
         cookiejar->cookie_ = cookie;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_ACCESS_DENIED;
+    return ZX_ERR_ACCESS_DENIED;
 }
 
-mx_status_t StateTracker::GetCookie(CookieJar* cookiejar, mx_koid_t scope, uint64_t* cookie) {
+zx_status_t StateTracker::GetCookie(CookieJar* cookiejar, zx_koid_t scope, uint64_t* cookie) {
     if (cookiejar == nullptr)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     AutoLock lock(&lock_);
 
     if (cookiejar->scope_ == scope) {
         *cookie = cookiejar->cookie_;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_ACCESS_DENIED;
+    return ZX_ERR_ACCESS_DENIED;
 }
 
-mx_status_t StateTracker::InvalidateCookie(CookieJar* cookiejar) {
+zx_status_t StateTracker::InvalidateCookie(CookieJar* cookiejar) {
     if (cookiejar == nullptr)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     AutoLock lock(&lock_);
 
-    cookiejar->scope_ = MX_KOID_KERNEL;
-    return MX_OK;
+    cookiejar->scope_ = ZX_KOID_KERNEL;
+    return ZX_OK;
 }
 
-StateObserver::Flags StateTracker::UpdateInternalLocked(ObserverList* obs_to_remove, mx_signals_t signals) {
+StateObserver::Flags StateTracker::UpdateInternalLocked(ObserverList* obs_to_remove, zx_signals_t signals) {
     StateObserver::Flags flags = 0;
 
     for (auto it = observers_.begin(); it != observers_.end();) {
diff --git a/kernel/object/state_tracker_tests.cpp b/kernel/object/state_tracker_tests.cpp
index c877c34..9c20ee3d 100644
--- a/kernel/object/state_tracker_tests.cpp
+++ b/kernel/object/state_tracker_tests.cpp
@@ -21,11 +21,11 @@
 
 private:
     // No-op overrides of pure virtuals.
-    Flags OnInitialize(mx_signals_t initial_state,
+    Flags OnInitialize(zx_signals_t initial_state,
                        const StateObserver::CountInfo* cinfo) override {
         return 0;
     }
-    Flags OnStateChange(mx_signals_t new_state) override { return 0; }
+    Flags OnStateChange(zx_signals_t new_state) override { return 0; }
     Flags OnCancel(Handle* handle) override { return 0; }
     Flags OnCancelByKey(Handle* handle, const void* port, uint64_t key)
         override { return 0; }
@@ -52,7 +52,7 @@
 
     class RmOnInitialize : public RemovableObserver {
     public:
-        Flags OnInitialize(mx_signals_t initial_state,
+        Flags OnInitialize(zx_signals_t initial_state,
                            const StateObserver::CountInfo* cinfo) override {
             return kNeedRemoval;
         }
@@ -77,7 +77,7 @@
 
 class RmOnStateChange : public RemovableObserver {
 public:
-    Flags OnStateChange(mx_signals_t new_state) override {
+    Flags OnStateChange(zx_signals_t new_state) override {
         return kNeedRemoval;
     }
 };
@@ -116,7 +116,7 @@
     EXPECT_EQ(0, obs.removals(), ""); // Not removed yet.
 
     // Cause OnStateChange() to be called. Need to transition out of and
-    // back into MX_SIGNAL_LAST_HANDLE, because it's asserted by default.
+    // back into ZX_SIGNAL_LAST_HANDLE, because it's asserted by default.
     uint32_t count = 2;
     st.UpdateLastHandleSignal(&count);
     count = 1;
diff --git a/kernel/object/thread_dispatcher.cpp b/kernel/object/thread_dispatcher.cpp
index 0672f59..83a998a 100644
--- a/kernel/object/thread_dispatcher.cpp
+++ b/kernel/object/thread_dispatcher.cpp
@@ -24,8 +24,8 @@
 #include <vm/vm_address_region.h>
 #include <vm/vm_object_paged.h>
 
-#include <magenta/rights.h>
-#include <magenta/syscalls/debug.h>
+#include <zircon/rights.h>
+#include <zircon/syscalls/debug.h>
 
 #include <object/c_user_thread.h>
 #include <object/excp_port.h>
@@ -42,22 +42,22 @@
 #define LOCAL_TRACE 0
 
 // static
-mx_status_t ThreadDispatcher::Create(fbl::RefPtr<ProcessDispatcher> process, uint32_t flags,
+zx_status_t ThreadDispatcher::Create(fbl::RefPtr<ProcessDispatcher> process, uint32_t flags,
                                      fbl::StringPiece name,
                                      fbl::RefPtr<Dispatcher>* out_dispatcher,
-                                     mx_rights_t* out_rights) {
+                                     zx_rights_t* out_rights) {
     fbl::AllocChecker ac;
     auto disp = fbl::AdoptRef(new (&ac) ThreadDispatcher(fbl::move(process), flags));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto result = disp->Initialize(name.data(), name.length());
-    if (result != MX_OK)
+    if (result != ZX_OK)
         return result;
 
-    *out_rights = MX_DEFAULT_THREAD_RIGHTS;
+    *out_rights = ZX_DEFAULT_THREAD_RIGHTS;
     *out_dispatcher = fbl::move(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 ThreadDispatcher::ThreadDispatcher(fbl::RefPtr<ProcessDispatcher> process,
@@ -79,7 +79,7 @@
         LTRACEF("joining LK thread to clean up state\n");
         __UNUSED auto ret = thread_join(&thread_, nullptr, INFINITE_TIME);
         LTRACEF("done joining LK thread\n");
-        DEBUG_ASSERT_MSG(ret == MX_OK, "thread_join returned something other than MX_OK\n");
+        DEBUG_ASSERT_MSG(ret == ZX_OK, "thread_join returned something other than ZX_OK\n");
         break;
     }
     case State::INITIAL:
@@ -114,15 +114,15 @@
 
 namespace {
 
-mx_status_t allocate_stack(const fbl::RefPtr<VmAddressRegion>& vmar, bool unsafe,
+zx_status_t allocate_stack(const fbl::RefPtr<VmAddressRegion>& vmar, bool unsafe,
                            fbl::RefPtr<VmMapping>* out_kstack_mapping,
                            fbl::RefPtr<VmAddressRegion>* out_kstack_vmar) {
     LTRACEF("allocating %s stack\n", unsafe ? "unsafe" : "safe");
 
     // Create a VMO for our stack
     fbl::RefPtr<VmObject> stack_vmo;
-    mx_status_t status = VmObjectPaged::Create(0, DEFAULT_STACK_SIZE, &stack_vmo);
-    if (status != MX_OK) {
+    zx_status_t status = VmObjectPaged::Create(0, DEFAULT_STACK_SIZE, &stack_vmo);
+    if (status != ZX_OK) {
         TRACEF("error allocating %s stack for thread\n",
                unsafe ? "unsafe" : "safe");
         return status;
@@ -139,7 +139,7 @@
         VMAR_FLAG_CAN_MAP_WRITE,
         unsafe ? "unsafe_kstack_vmar" : "kstack_vmar",
         &kstack_vmar);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // destroy the vmar if we early abort
@@ -160,7 +160,7 @@
                                           ARCH_MMU_FLAG_PERM_WRITE,
                                           unsafe ? "unsafe_kstack" : "kstack",
                                           &kstack_mapping);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     LTRACEF("%s stack mapping at %#" PRIxPTR "\n",
@@ -168,7 +168,7 @@
 
     // fault in all the pages so we dont demand fault in the stack
     status = kstack_mapping->MapRange(0, DEFAULT_STACK_SIZE, true);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Cancel the cleanup handler on the vmar since we're about to save a
@@ -176,13 +176,13 @@
     vmar_cleanup.cancel();
     *out_kstack_mapping = fbl::move(kstack_mapping);
     *out_kstack_vmar = fbl::move(kstack_vmar);
-    return MX_OK;
+    return ZX_OK;
 }
 
 } // namespace
 
 // complete initialization of the thread object outside of the constructor
-mx_status_t ThreadDispatcher::Initialize(const char* name, size_t len) {
+zx_status_t ThreadDispatcher::Initialize(const char* name, size_t len) {
     LTRACE_ENTRY_OBJ;
 
     AutoLock lock(&state_lock_);
@@ -190,25 +190,25 @@
     DEBUG_ASSERT(state_ == State::INITIAL);
 
     // Make sure LK's max name length agrees with ours.
-    static_assert(THREAD_NAME_LENGTH == MX_MAX_NAME_LEN, "name length issue");
-    if (len >= MX_MAX_NAME_LEN)
-        len = MX_MAX_NAME_LEN - 1;
+    static_assert(THREAD_NAME_LENGTH == ZX_MAX_NAME_LEN, "name length issue");
+    if (len >= ZX_MAX_NAME_LEN)
+        len = ZX_MAX_NAME_LEN - 1;
 
     char thread_name[THREAD_NAME_LENGTH];
     memcpy(thread_name, name, len);
-    memset(thread_name + len, 0, MX_MAX_NAME_LEN - len);
+    memset(thread_name + len, 0, ZX_MAX_NAME_LEN - len);
 
     // Map the kernel stack somewhere
     auto vmar = VmAspace::kernel_aspace()->RootVmar()->as_vm_address_region();
     DEBUG_ASSERT(!!vmar);
 
     auto status = allocate_stack(vmar, false, &kstack_mapping_, &kstack_vmar_);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 #if __has_feature(safe_stack)
     status = allocate_stack(vmar, true,
                             &unsafe_kstack_mapping_, &unsafe_kstack_vmar_);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 #endif
 
@@ -225,7 +225,7 @@
 
     if (!lkthread) {
         TRACEF("error creating thread\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     DEBUG_ASSERT(lkthread == &thread_);
 
@@ -244,30 +244,30 @@
     // we've entered the initialized state
     SetStateLocked(State::INITIALIZED);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ThreadDispatcher::set_name(const char* name, size_t len) {
+zx_status_t ThreadDispatcher::set_name(const char* name, size_t len) {
     canary_.Assert();
 
-    if (len >= MX_MAX_NAME_LEN)
-        len = MX_MAX_NAME_LEN - 1;
+    if (len >= ZX_MAX_NAME_LEN)
+        len = ZX_MAX_NAME_LEN - 1;
 
     AutoSpinLock lock(&name_lock_);
     memcpy(thread_.name, name, len);
-    memset(thread_.name + len, 0, MX_MAX_NAME_LEN - len);
-    return MX_OK;
+    memset(thread_.name + len, 0, ZX_MAX_NAME_LEN - len);
+    return ZX_OK;
 }
 
-void ThreadDispatcher::get_name(char out_name[MX_MAX_NAME_LEN]) const {
+void ThreadDispatcher::get_name(char out_name[ZX_MAX_NAME_LEN]) const {
     canary_.Assert();
 
     AutoSpinLock lock(&name_lock_);
-    memcpy(out_name, thread_.name, MX_MAX_NAME_LEN);
+    memcpy(out_name, thread_.name, ZX_MAX_NAME_LEN);
 }
 
 // start a thread
-mx_status_t ThreadDispatcher::Start(uintptr_t entry, uintptr_t sp,
+zx_status_t ThreadDispatcher::Start(uintptr_t entry, uintptr_t sp,
                                     uintptr_t arg1, uintptr_t arg2,
                                     bool initial_thread) {
     canary_.Assert();
@@ -277,7 +277,7 @@
     AutoLock lock(&state_lock_);
 
     if (state_ != State::INITIALIZED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     // save the user space entry state
     user_entry_ = entry;
@@ -297,7 +297,7 @@
     thread_.user_pid = process_->get_koid();
     thread_resume(&thread_);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // called in the context of our thread
@@ -361,7 +361,7 @@
     }
 }
 
-mx_status_t ThreadDispatcher::Suspend() {
+zx_status_t ThreadDispatcher::Suspend() {
     canary_.Assert();
 
     LTRACE_ENTRY_OBJ;
@@ -371,12 +371,12 @@
     LTRACEF("%p: state %s\n", this, StateToString(state_));
 
     if (state_ != State::RUNNING && state_ != State::SUSPENDED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     return thread_suspend(&thread_);
 }
 
-mx_status_t ThreadDispatcher::Resume() {
+zx_status_t ThreadDispatcher::Resume() {
     canary_.Assert();
 
     LTRACE_ENTRY_OBJ;
@@ -386,7 +386,7 @@
     LTRACEF("%p: state %s\n", this, StateToString(state_));
 
     if (state_ != State::RUNNING && state_ != State::SUSPENDED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     return thread_resume(&thread_);
 }
@@ -406,7 +406,7 @@
     LTRACE_ENTRY_OBJ;
 
     // signal any waiters
-    state_tracker_.UpdateState(0u, MX_TASK_TERMINATED);
+    state_tracker_.UpdateState(0u, ZX_TASK_TERMINATED);
 
     {
         AutoLock lock(&exception_lock_);
@@ -574,7 +574,7 @@
     state_ = state;
 }
 
-mx_status_t ThreadDispatcher::SetExceptionPort(fbl::RefPtr<ExceptionPort> eport) {
+zx_status_t ThreadDispatcher::SetExceptionPort(fbl::RefPtr<ExceptionPort> eport) {
     canary_.Assert();
 
     DEBUG_ASSERT(eport->type() == ExceptionPort::Type::THREAD);
@@ -584,12 +584,12 @@
     AutoLock state_lock(&state_lock_);
     AutoLock excp_lock(&exception_lock_);
     if (state_ == State::DEAD)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     if (exception_port_)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     exception_port_ = eport;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool ThreadDispatcher::ResetExceptionPort(bool quietly) {
@@ -640,9 +640,9 @@
     return exception_port_;
 }
 
-mx_status_t ThreadDispatcher::ExceptionHandlerExchange(
+zx_status_t ThreadDispatcher::ExceptionHandlerExchange(
         fbl::RefPtr<ExceptionPort> eport,
-        const mx_exception_report_t* report,
+        const zx_exception_report_t* report,
         const arch_exception_context_t* arch_context,
         ExceptionStatus *out_estatus) {
     canary_.Assert();
@@ -659,12 +659,12 @@
         // locking state_lock_ in places where the handler can see/modify
         // thread state.
 
-        mx_status_t status = eport->SendPacket(this, report->header.type);
-        if (status != MX_OK) {
+        zx_status_t status = eport->SendPacket(this, report->header.type);
+        if (status != ZX_OK) {
             LTRACEF("SendPacket returned %d\n", status);
             // Treat the exception as unhandled.
             *out_estatus = ExceptionStatus::TRY_NEXT;
-            return MX_OK;
+            return ZX_OK;
         }
 
         // Mark that we're in an exception.
@@ -685,17 +685,17 @@
     // exception response is received (requiring a second resume).
     // Exceptions and suspensions are essentially treated orthogonally.
 
-    mx_status_t status;
+    zx_status_t status;
     do {
         status = event_wait_deadline(&exception_event_, INFINITE_TIME, true);
-    } while (status == MX_ERR_INTERNAL_INTR_RETRY);
+    } while (status == ZX_ERR_INTERNAL_INTR_RETRY);
 
     AutoLock lock(&state_lock_);
 
-    // Note: If |status| != MX_OK, then |exception_status_| is still
+    // Note: If |status| != ZX_OK, then |exception_status_| is still
     // ExceptionStatus::UNPROCESSED.
     switch (status) {
-    case MX_OK:
+    case ZX_OK:
         // It's critical that at this point the event no longer be armed.
         // Otherwise the next time we get an exception we'll fall right through
         // without waiting for an exception response.
@@ -705,7 +705,7 @@
         DEBUG_ASSERT(exception_status_ != ExceptionStatus::IDLE &&
                      exception_status_ != ExceptionStatus::UNPROCESSED);
         break;
-    case MX_ERR_INTERNAL_INTR_KILLED:
+    case ZX_ERR_INTERNAL_INTR_KILLED:
         // Thread was killed.
         break;
     default:
@@ -725,7 +725,7 @@
     return status;
 }
 
-mx_status_t ThreadDispatcher::MarkExceptionHandled(ExceptionStatus estatus) {
+zx_status_t ThreadDispatcher::MarkExceptionHandled(ExceptionStatus estatus) {
     canary_.Assert();
 
     LTRACEF("obj %p, estatus %d\n", this, static_cast<int>(estatus));
@@ -734,7 +734,7 @@
 
     AutoLock lock(&state_lock_);
     if (!InExceptionLocked())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     // The thread can be in several states at this point. Alas this is a bit
     // complicated because there is a window in the middle of
@@ -746,11 +746,11 @@
     // To keep things simple we take a first-one-wins approach.
     DEBUG_ASSERT(exception_status_ != ExceptionStatus::IDLE);
     if (exception_status_ != ExceptionStatus::UNPROCESSED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     exception_status_ = estatus;
     event_signal(&exception_event_, true);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void ThreadDispatcher::OnExceptionPortRemoval(const fbl::RefPtr<ExceptionPort>& eport) {
@@ -778,7 +778,7 @@
     return thread_stopped_in_exception(&thread_);
 }
 
-mx_status_t ThreadDispatcher::GetInfoForUserspace(mx_info_thread_t* info) {
+zx_status_t ThreadDispatcher::GetInfoForUserspace(zx_info_thread_t* info) {
     canary_.Assert();
 
     LTRACE_ENTRY_OBJ;
@@ -815,35 +815,35 @@
     switch (state) {
     case ThreadDispatcher::State::INITIAL:
     case ThreadDispatcher::State::INITIALIZED:
-        info->state = MX_THREAD_STATE_NEW;
+        info->state = ZX_THREAD_STATE_NEW;
         break;
     case ThreadDispatcher::State::RUNNING:
         // The thread may be "running" but be blocked in a syscall or
         // exception handler.
         switch (lk_state) {
         case THREAD_BLOCKED:
-            info->state = MX_THREAD_STATE_BLOCKED;
+            info->state = ZX_THREAD_STATE_BLOCKED;
             break;
         default:
             // If we're in the window where we've released |state_lock_| but
             // haven't gone to sleep yet (to wait for an exception response)
             // then we're still "blocked" as far as userspace is concerned.
             if (excp_port_type != ExceptionPort::Type::NONE) {
-                info->state = MX_THREAD_STATE_BLOCKED;
+                info->state = ZX_THREAD_STATE_BLOCKED;
             } else {
-                info->state = MX_THREAD_STATE_RUNNING;
+                info->state = ZX_THREAD_STATE_RUNNING;
             }
             break;
         }
         break;
     case ThreadDispatcher::State::SUSPENDED:
-        info->state = MX_THREAD_STATE_SUSPENDED;
+        info->state = ZX_THREAD_STATE_SUSPENDED;
         break;
     case ThreadDispatcher::State::DYING:
-        info->state = MX_THREAD_STATE_DYING;
+        info->state = ZX_THREAD_STATE_DYING;
         break;
     case ThreadDispatcher::State::DEAD:
-        info->state = MX_THREAD_STATE_DEAD;
+        info->state = ZX_THREAD_STATE_DEAD;
         break;
     default:
         DEBUG_ASSERT_MSG(false, "unexpected run state: %d",
@@ -853,19 +853,19 @@
 
     switch (excp_port_type) {
     case ExceptionPort::Type::NONE:
-        info->wait_exception_port_type = MX_EXCEPTION_PORT_TYPE_NONE;
+        info->wait_exception_port_type = ZX_EXCEPTION_PORT_TYPE_NONE;
         break;
     case ExceptionPort::Type::DEBUGGER:
-        info->wait_exception_port_type = MX_EXCEPTION_PORT_TYPE_DEBUGGER;
+        info->wait_exception_port_type = ZX_EXCEPTION_PORT_TYPE_DEBUGGER;
         break;
     case ExceptionPort::Type::THREAD:
-        info->wait_exception_port_type = MX_EXCEPTION_PORT_TYPE_THREAD;
+        info->wait_exception_port_type = ZX_EXCEPTION_PORT_TYPE_THREAD;
         break;
     case ExceptionPort::Type::PROCESS:
-        info->wait_exception_port_type = MX_EXCEPTION_PORT_TYPE_PROCESS;
+        info->wait_exception_port_type = ZX_EXCEPTION_PORT_TYPE_PROCESS;
         break;
     case ExceptionPort::Type::JOB:
-        info->wait_exception_port_type = MX_EXCEPTION_PORT_TYPE_JOB;
+        info->wait_exception_port_type = ZX_EXCEPTION_PORT_TYPE_JOB;
         break;
     default:
         DEBUG_ASSERT_MSG(false, "unexpected exception port type: %d",
@@ -873,10 +873,10 @@
         break;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ThreadDispatcher::GetStatsForUserspace(mx_info_thread_stats_t* info) {
+zx_status_t ThreadDispatcher::GetStatsForUserspace(zx_info_thread_stats_t* info) {
     canary_.Assert();
 
     LTRACE_ENTRY_OBJ;
@@ -884,19 +884,19 @@
     *info = {};
 
     info->total_runtime = runtime_ns();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ThreadDispatcher::GetExceptionReport(mx_exception_report_t* report) {
+zx_status_t ThreadDispatcher::GetExceptionReport(zx_exception_report_t* report) {
     canary_.Assert();
 
     LTRACE_ENTRY_OBJ;
     AutoLock lock(&state_lock_);
     if (!InExceptionLocked())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     DEBUG_ASSERT(exception_report_ != nullptr);
     *report = *exception_report_;
-    return MX_OK;
+    return ZX_OK;
 }
 
 uint32_t ThreadDispatcher::get_num_state_kinds() const {
@@ -905,7 +905,7 @@
 
 // Note: buffer must be sufficiently aligned
 
-mx_status_t ThreadDispatcher::ReadState(uint32_t state_kind, void* buffer, uint32_t* buffer_len) {
+zx_status_t ThreadDispatcher::ReadState(uint32_t state_kind, void* buffer, uint32_t* buffer_len) {
     canary_.Assert();
 
     LTRACE_ENTRY_OBJ;
@@ -915,20 +915,20 @@
     AutoLock state_lock(&state_lock_);
 
     if (state_ != State::SUSPENDED && !InExceptionLocked())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     switch (state_kind)
     {
-    case MX_THREAD_STATE_REGSET0 ... MX_THREAD_STATE_REGSET9:
-        return arch_get_regset(&thread_, state_kind - MX_THREAD_STATE_REGSET0, buffer, buffer_len);
+    case ZX_THREAD_STATE_REGSET0 ... ZX_THREAD_STATE_REGSET9:
+        return arch_get_regset(&thread_, state_kind - ZX_THREAD_STATE_REGSET0, buffer, buffer_len);
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
 // Note: buffer must be sufficiently aligned
 
-mx_status_t ThreadDispatcher::WriteState(uint32_t state_kind, const void* buffer, uint32_t buffer_len) {
+zx_status_t ThreadDispatcher::WriteState(uint32_t state_kind, const void* buffer, uint32_t buffer_len) {
     canary_.Assert();
 
     LTRACE_ENTRY_OBJ;
@@ -938,19 +938,19 @@
     AutoLock state_lock(&state_lock_);
 
     if (state_ != State::SUSPENDED && !InExceptionLocked())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     switch (state_kind)
     {
-    case MX_THREAD_STATE_REGSET0 ... MX_THREAD_STATE_REGSET9:
-        return arch_set_regset(&thread_, state_kind - MX_THREAD_STATE_REGSET0, buffer, buffer_len);
+    case ZX_THREAD_STATE_REGSET0 ... ZX_THREAD_STATE_REGSET9:
+        return arch_set_regset(&thread_, state_kind - ZX_THREAD_STATE_REGSET0, buffer, buffer_len);
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
 void get_user_thread_process_name(const void* user_thread,
-                                  char out_name[MX_MAX_NAME_LEN]) {
+                                  char out_name[ZX_MAX_NAME_LEN]) {
     const ThreadDispatcher* ut =
         reinterpret_cast<const ThreadDispatcher*>(user_thread);
     ut->process()->get_name(out_name);
@@ -974,7 +974,7 @@
     return "unknown";
 }
 
-mx_koid_t ThreadDispatcher::get_related_koid() const {
+zx_koid_t ThreadDispatcher::get_related_koid() const {
     canary_.Assert();
 
     return process_->get_koid();
diff --git a/kernel/object/timer_dispatcher.cpp b/kernel/object/timer_dispatcher.cpp
index 48ab602..81123a3 100644
--- a/kernel/object/timer_dispatcher.cpp
+++ b/kernel/object/timer_dispatcher.cpp
@@ -12,8 +12,8 @@
 
 #include <kernel/thread.h>
 
-#include <magenta/compiler.h>
-#include <magenta/rights.h>
+#include <zircon/compiler.h>
+#include <zircon/rights.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 
@@ -30,33 +30,33 @@
     reinterpret_cast<TimerDispatcher*>(d->arg)->OnTimerFired();
 }
 
-mx_status_t TimerDispatcher::Create(uint32_t options,
+zx_status_t TimerDispatcher::Create(uint32_t options,
                                     fbl::RefPtr<Dispatcher>* dispatcher,
-                                    mx_rights_t* rights) {
-    if (options > MX_TIMER_SLACK_LATE)
-        return MX_ERR_INVALID_ARGS;
+                                    zx_rights_t* rights) {
+    if (options > ZX_TIMER_SLACK_LATE)
+        return ZX_ERR_INVALID_ARGS;
 
     slack_mode slack_mode;
 
     switch (options) {
-    case MX_TIMER_SLACK_CENTER: slack_mode = TIMER_SLACK_CENTER;
+    case ZX_TIMER_SLACK_CENTER: slack_mode = TIMER_SLACK_CENTER;
         break;
-    case MX_TIMER_SLACK_EARLY: slack_mode = TIMER_SLACK_EARLY;
+    case ZX_TIMER_SLACK_EARLY: slack_mode = TIMER_SLACK_EARLY;
         break;
-    case MX_TIMER_SLACK_LATE: slack_mode = TIMER_SLACK_LATE;
+    case ZX_TIMER_SLACK_LATE: slack_mode = TIMER_SLACK_LATE;
         break;
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     };
 
     fbl::AllocChecker ac;
     auto disp = new (&ac) TimerDispatcher(slack_mode);
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    *rights = MX_DEFAULT_TIMERS_RIGHTS;
+    *rights = ZX_DEFAULT_TIMERS_RIGHTS;
     *dispatcher = fbl::AdoptRef<Dispatcher>(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 TimerDispatcher::TimerDispatcher(slack_mode slack_mode)
@@ -82,7 +82,7 @@
         timer_cancel(&timer_);
 }
 
-mx_status_t TimerDispatcher::Set(mx_time_t deadline, mx_duration_t slack) {
+zx_status_t TimerDispatcher::Set(zx_time_t deadline, zx_duration_t slack) {
     canary_.Assert();
 
     AutoLock al(&lock_);
@@ -92,8 +92,8 @@
     // If the timer is already due, then we can set the signal immediately without
     // starting the timer.
     if ((deadline == 0u) || (deadline <= current_time())) {
-        state_tracker_.UpdateState(0u, MX_TIMER_SIGNALED);
-        return MX_OK;
+        state_tracker_.UpdateState(0u, ZX_TIMER_SIGNALED);
+        return ZX_OK;
     }
 
     deadline_ = deadline;
@@ -103,7 +103,7 @@
     // let the callback take care of restarting the timer too so everthing happens in the
     // right sequence.
     if (cancel_pending_)
-        return MX_OK;
+        return ZX_OK;
 
     // We need to ref-up because the timer and the dpc don't understand
     // refcounted objects. The Release() is called either in OnTimerFired()
@@ -115,14 +115,14 @@
     // timer again.  So cancel the timer if we haven't already.
     SetTimerLocked(!did_cancel);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t TimerDispatcher::Cancel() {
+zx_status_t TimerDispatcher::Cancel() {
     canary_.Assert();
     AutoLock al(&lock_);
     CancelTimerLocked();
-    return MX_OK;
+    return ZX_OK;
 }
 
 void TimerDispatcher::SetTimerLocked(bool cancel_first) {
@@ -134,7 +134,7 @@
 
 bool TimerDispatcher::CancelTimerLocked() {
     // Always clear the signal bit.
-    state_tracker_.UpdateState(MX_TIMER_SIGNALED, 0u);
+    state_tracker_.UpdateState(ZX_TIMER_SIGNALED, 0u);
 
     // If the timer isn't pending then we're done.
     if (!deadline_)
@@ -182,7 +182,7 @@
             }
         } else {
             // The timer is firing.
-            state_tracker_.UpdateState(0u, MX_TIMER_SIGNALED);
+            state_tracker_.UpdateState(0u, ZX_TIMER_SIGNALED);
             deadline_ = 0u;
         }
     }
diff --git a/kernel/object/vcpu_dispatcher.cpp b/kernel/object/vcpu_dispatcher.cpp
index f43ab3d..5083cb8 100644
--- a/kernel/object/vcpu_dispatcher.cpp
+++ b/kernel/object/vcpu_dispatcher.cpp
@@ -9,39 +9,39 @@
 #include <arch/hypervisor.h>
 #include <hypervisor/guest_physical_address_space.h>
 #include <vm/vm_object.h>
-#include <magenta/rights.h>
-#include <magenta/types.h>
+#include <zircon/rights.h>
+#include <zircon/types.h>
 #include <fbl/alloc_checker.h>
 #include <object/guest_dispatcher.h>
 
-mx_status_t VcpuDispatcher::Create(fbl::RefPtr<GuestDispatcher> guest_dispatcher, mx_vaddr_t ip,
-                                   mx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
-                                   fbl::RefPtr<Dispatcher>* dispatcher, mx_rights_t* rights) {
+zx_status_t VcpuDispatcher::Create(fbl::RefPtr<GuestDispatcher> guest_dispatcher, zx_vaddr_t ip,
+                                   zx_vaddr_t cr3, fbl::RefPtr<VmObject> apic_vmo,
+                                   fbl::RefPtr<Dispatcher>* dispatcher, zx_rights_t* rights) {
     Guest* guest = guest_dispatcher->guest();
     GuestPhysicalAddressSpace* gpas = guest->AddressSpace();
     if (ip >= gpas->size())
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (cr3 >= gpas->size() - PAGE_SIZE)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::unique_ptr<Vcpu> vcpu;
 #if ARCH_X86_64
-    mx_status_t status = x86_vcpu_create(ip, cr3, apic_vmo, guest->ApicAccessAddress(),
+    zx_status_t status = x86_vcpu_create(ip, cr3, apic_vmo, guest->ApicAccessAddress(),
                                       guest->MsrBitmapsAddress(), gpas, guest->Mux(), &vcpu);
 #else // ARCH_X86_64
-    mx_status_t status = MX_ERR_NOT_SUPPORTED;
+    zx_status_t status = ZX_ERR_NOT_SUPPORTED;
 #endif
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     fbl::AllocChecker ac;
     auto disp = new (&ac) VcpuDispatcher(guest_dispatcher, fbl::move(vcpu));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    *rights = MX_DEFAULT_VCPU_RIGHTS;
+    *rights = ZX_DEFAULT_VCPU_RIGHTS;
     *dispatcher = fbl::AdoptRef<Dispatcher>(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 VcpuDispatcher::VcpuDispatcher(fbl::RefPtr<GuestDispatcher> guest, fbl::unique_ptr<Vcpu> vcpu)
@@ -49,25 +49,25 @@
 
 VcpuDispatcher::~VcpuDispatcher() {}
 
-mx_status_t VcpuDispatcher::Resume(mx_port_packet_t* packet) {
+zx_status_t VcpuDispatcher::Resume(zx_port_packet_t* packet) {
     canary_.Assert();
 
     return arch_vcpu_resume(vcpu_.get(), packet);
 }
 
-mx_status_t VcpuDispatcher::Interrupt(uint32_t vector) {
+zx_status_t VcpuDispatcher::Interrupt(uint32_t vector) {
     canary_.Assert();
 
     return arch_vcpu_interrupt(vcpu_.get(), vector);
 }
 
-mx_status_t VcpuDispatcher::ReadState(uint32_t kind, void* buffer, uint32_t len) const {
+zx_status_t VcpuDispatcher::ReadState(uint32_t kind, void* buffer, uint32_t len) const {
     canary_.Assert();
 
     return arch_vcpu_read_state(vcpu_.get(), kind, buffer, len);
 }
 
-mx_status_t VcpuDispatcher::WriteState(uint32_t kind, const void* buffer, uint32_t len) {
+zx_status_t VcpuDispatcher::WriteState(uint32_t kind, const void* buffer, uint32_t len) {
     canary_.Assert();
 
     return arch_vcpu_write_state(vcpu_.get(), kind, buffer, len);
diff --git a/kernel/object/vm_address_region_dispatcher.cpp b/kernel/object/vm_address_region_dispatcher.cpp
index 7492e80..355bd1f 100644
--- a/kernel/object/vm_address_region_dispatcher.cpp
+++ b/kernel/object/vm_address_region_dispatcher.cpp
@@ -10,7 +10,7 @@
 #include <vm/vm_aspace.h>
 #include <vm/vm_object.h>
 
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 
 #include <fbl/alloc_checker.h>
 
@@ -26,91 +26,91 @@
 // Split out the syscall flags into vmar flags and mmu flags.  Note that this
 // does not validate that the requested protections in *flags* are valid.  For
 // that use is_valid_mapping_protection()
-mx_status_t split_syscall_flags(uint32_t flags, uint32_t* vmar_flags, uint* arch_mmu_flags) {
+zx_status_t split_syscall_flags(uint32_t flags, uint32_t* vmar_flags, uint* arch_mmu_flags) {
     // Figure out arch_mmu_flags
     uint mmu_flags = ARCH_MMU_FLAG_PERM_USER;
-    switch (flags & (MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE)) {
-        case MX_VM_FLAG_PERM_READ:
+    switch (flags & (ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE)) {
+        case ZX_VM_FLAG_PERM_READ:
             mmu_flags |= ARCH_MMU_FLAG_PERM_READ;
             break;
-        case MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE:
+        case ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE:
             mmu_flags |= ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE;
             break;
     }
 
-    if (flags & MX_VM_FLAG_PERM_EXECUTE) {
+    if (flags & ZX_VM_FLAG_PERM_EXECUTE) {
         mmu_flags |= ARCH_MMU_FLAG_PERM_EXECUTE;
     }
 
     // Mask out arch_mmu_flags options
-    flags &= ~(MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE);
+    flags &= ~(ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE);
 
     // Figure out vmar flags
     uint32_t vmar = 0;
-    if (flags & MX_VM_FLAG_COMPACT) {
+    if (flags & ZX_VM_FLAG_COMPACT) {
         vmar |= VMAR_FLAG_COMPACT;
-        flags &= ~MX_VM_FLAG_COMPACT;
+        flags &= ~ZX_VM_FLAG_COMPACT;
     }
-    if (flags & MX_VM_FLAG_SPECIFIC) {
+    if (flags & ZX_VM_FLAG_SPECIFIC) {
         vmar |= VMAR_FLAG_SPECIFIC;
-        flags &= ~MX_VM_FLAG_SPECIFIC;
+        flags &= ~ZX_VM_FLAG_SPECIFIC;
     }
-    if (flags & MX_VM_FLAG_SPECIFIC_OVERWRITE) {
+    if (flags & ZX_VM_FLAG_SPECIFIC_OVERWRITE) {
         vmar |= VMAR_FLAG_SPECIFIC_OVERWRITE;
-        flags &= ~MX_VM_FLAG_SPECIFIC_OVERWRITE;
+        flags &= ~ZX_VM_FLAG_SPECIFIC_OVERWRITE;
     }
-    if (flags & MX_VM_FLAG_CAN_MAP_SPECIFIC) {
+    if (flags & ZX_VM_FLAG_CAN_MAP_SPECIFIC) {
         vmar |= VMAR_FLAG_CAN_MAP_SPECIFIC;
-        flags &= ~MX_VM_FLAG_CAN_MAP_SPECIFIC;
+        flags &= ~ZX_VM_FLAG_CAN_MAP_SPECIFIC;
     }
-    if (flags & MX_VM_FLAG_CAN_MAP_READ) {
+    if (flags & ZX_VM_FLAG_CAN_MAP_READ) {
         vmar |= VMAR_FLAG_CAN_MAP_READ;
-        flags &= ~MX_VM_FLAG_CAN_MAP_READ;
+        flags &= ~ZX_VM_FLAG_CAN_MAP_READ;
     }
-    if (flags & MX_VM_FLAG_CAN_MAP_WRITE) {
+    if (flags & ZX_VM_FLAG_CAN_MAP_WRITE) {
         vmar |= VMAR_FLAG_CAN_MAP_WRITE;
-        flags &= ~MX_VM_FLAG_CAN_MAP_WRITE;
+        flags &= ~ZX_VM_FLAG_CAN_MAP_WRITE;
     }
-    if (flags & MX_VM_FLAG_CAN_MAP_EXECUTE) {
+    if (flags & ZX_VM_FLAG_CAN_MAP_EXECUTE) {
         vmar |= VMAR_FLAG_CAN_MAP_EXECUTE;
-        flags &= ~MX_VM_FLAG_CAN_MAP_EXECUTE;
+        flags &= ~ZX_VM_FLAG_CAN_MAP_EXECUTE;
     }
 
     if (flags != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     *vmar_flags = vmar;
     *arch_mmu_flags = mmu_flags;
-    return MX_OK;
+    return ZX_OK;
 }
 
 } // namespace
 
-mx_status_t VmAddressRegionDispatcher::Create(fbl::RefPtr<VmAddressRegion> vmar,
+zx_status_t VmAddressRegionDispatcher::Create(fbl::RefPtr<VmAddressRegion> vmar,
                                               fbl::RefPtr<Dispatcher>* dispatcher,
-                                              mx_rights_t* rights) {
+                                              zx_rights_t* rights) {
 
     // The initial rights should match the VMAR's creation permissions
-    mx_rights_t vmar_rights = MX_DEFAULT_VMAR_RIGHTS;
+    zx_rights_t vmar_rights = ZX_DEFAULT_VMAR_RIGHTS;
     uint32_t vmar_flags = vmar->flags();
     if (vmar_flags & VMAR_FLAG_CAN_MAP_READ) {
-        vmar_rights |= MX_RIGHT_READ;
+        vmar_rights |= ZX_RIGHT_READ;
     }
     if (vmar_flags & VMAR_FLAG_CAN_MAP_WRITE) {
-        vmar_rights |= MX_RIGHT_WRITE;
+        vmar_rights |= ZX_RIGHT_WRITE;
     }
     if (vmar_flags & VMAR_FLAG_CAN_MAP_EXECUTE) {
-        vmar_rights |= MX_RIGHT_EXECUTE;
+        vmar_rights |= ZX_RIGHT_EXECUTE;
     }
 
     fbl::AllocChecker ac;
     auto disp = new (&ac) VmAddressRegionDispatcher(fbl::move(vmar));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     *rights = vmar_rights;
     *dispatcher = fbl::AdoptRef<Dispatcher>(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 VmAddressRegionDispatcher::VmAddressRegionDispatcher(fbl::RefPtr<VmAddressRegion> vmar)
@@ -118,61 +118,61 @@
 
 VmAddressRegionDispatcher::~VmAddressRegionDispatcher() {}
 
-mx_status_t VmAddressRegionDispatcher::Allocate(
+zx_status_t VmAddressRegionDispatcher::Allocate(
     size_t offset, size_t size, uint32_t flags,
     fbl::RefPtr<VmAddressRegionDispatcher>* new_dispatcher,
-    mx_rights_t* new_rights) {
+    zx_rights_t* new_rights) {
 
     canary_.Assert();
 
     uint32_t vmar_flags;
     uint arch_mmu_flags;
-    mx_status_t status = split_syscall_flags(flags, &vmar_flags, &arch_mmu_flags);
-    if (status != MX_OK)
+    zx_status_t status = split_syscall_flags(flags, &vmar_flags, &arch_mmu_flags);
+    if (status != ZX_OK)
         return status;
 
     // Check if any MMU-related flags were requested (USER is always implied)
     if (arch_mmu_flags != ARCH_MMU_FLAG_PERM_USER) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     fbl::RefPtr<VmAddressRegion> new_vmar;
     status = vmar_->CreateSubVmar(offset, size, /* align_pow2 */ 0 , vmar_flags,
                                   "useralloc", &new_vmar);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Create the dispatcher.
     fbl::RefPtr<Dispatcher> dispatcher;
     status = VmAddressRegionDispatcher::Create(fbl::move(new_vmar),
                                                &dispatcher, new_rights);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     *new_dispatcher =
         DownCastDispatcher<VmAddressRegionDispatcher>(&dispatcher);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VmAddressRegionDispatcher::Destroy() {
+zx_status_t VmAddressRegionDispatcher::Destroy() {
     canary_.Assert();
 
     return vmar_->Destroy();
 }
 
-mx_status_t VmAddressRegionDispatcher::Map(size_t vmar_offset, fbl::RefPtr<VmObject> vmo,
+zx_status_t VmAddressRegionDispatcher::Map(size_t vmar_offset, fbl::RefPtr<VmObject> vmo,
                                            uint64_t vmo_offset, size_t len, uint32_t flags,
                                            fbl::RefPtr<VmMapping>* out) {
     canary_.Assert();
 
     if (!is_valid_mapping_protection(flags))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Split flags into vmar_flags and arch_mmu_flags
     uint32_t vmar_flags;
     uint arch_mmu_flags;
-    mx_status_t status = split_syscall_flags(flags, &vmar_flags, &arch_mmu_flags);
-    if (status != MX_OK)
+    zx_status_t status = split_syscall_flags(flags, &vmar_flags, &arch_mmu_flags);
+    if (status != ZX_OK)
         return status;
 
     fbl::RefPtr<VmMapping> result(nullptr);
@@ -180,52 +180,52 @@
                                     vmar_flags, fbl::move(vmo), vmo_offset,
                                     arch_mmu_flags, "useralloc",
                                     &result);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     *out = fbl::move(result);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VmAddressRegionDispatcher::Protect(vaddr_t base, size_t len, uint32_t flags) {
+zx_status_t VmAddressRegionDispatcher::Protect(vaddr_t base, size_t len, uint32_t flags) {
     canary_.Assert();
 
     if (!IS_PAGE_ALIGNED(base)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (!is_valid_mapping_protection(flags))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     uint32_t vmar_flags;
     uint arch_mmu_flags;
-    mx_status_t status = split_syscall_flags(flags, &vmar_flags, &arch_mmu_flags);
-    if (status != MX_OK)
+    zx_status_t status = split_syscall_flags(flags, &vmar_flags, &arch_mmu_flags);
+    if (status != ZX_OK)
         return status;
 
     // This request does not allow any VMAR flags to be set
     if (vmar_flags)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     return vmar_->Protect(base, len, arch_mmu_flags);
 }
 
-mx_status_t VmAddressRegionDispatcher::Unmap(vaddr_t base, size_t len) {
+zx_status_t VmAddressRegionDispatcher::Unmap(vaddr_t base, size_t len) {
     canary_.Assert();
 
     if (!IS_PAGE_ALIGNED(base)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     return vmar_->Unmap(base, len);
 }
 
 bool VmAddressRegionDispatcher::is_valid_mapping_protection(uint32_t flags) {
-    if (!(flags & MX_VM_FLAG_PERM_READ)) {
+    if (!(flags & ZX_VM_FLAG_PERM_READ)) {
         // No way to express non-readable mappings that are also writeable or
         // executable.
-        if (flags & (MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE)) {
+        if (flags & (ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE)) {
             return false;
         }
     }
diff --git a/kernel/object/vm_object_dispatcher.cpp b/kernel/object/vm_object_dispatcher.cpp
index dde0a4f..5bc60c0 100644
--- a/kernel/object/vm_object_dispatcher.cpp
+++ b/kernel/object/vm_object_dispatcher.cpp
@@ -9,7 +9,7 @@
 #include <vm/vm_aspace.h>
 #include <vm/vm_object.h>
 
-#include <magenta/rights.h>
+#include <zircon/rights.h>
 
 #include <fbl/alloc_checker.h>
 
@@ -20,18 +20,18 @@
 
 #define LOCAL_TRACE 0
 
-mx_status_t VmObjectDispatcher::Create(fbl::RefPtr<VmObject> vmo,
+zx_status_t VmObjectDispatcher::Create(fbl::RefPtr<VmObject> vmo,
                                        fbl::RefPtr<Dispatcher>* dispatcher,
-                                       mx_rights_t* rights) {
+                                       zx_rights_t* rights) {
     fbl::AllocChecker ac;
     auto disp = new (&ac) VmObjectDispatcher(fbl::move(vmo));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     disp->vmo()->set_user_id(disp->get_koid());
-    *rights = MX_DEFAULT_VMO_RIGHTS;
+    *rights = ZX_DEFAULT_VMO_RIGHTS;
     *dispatcher = fbl::AdoptRef<Dispatcher>(disp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 VmObjectDispatcher::VmObjectDispatcher(fbl::RefPtr<VmObject> vmo)
@@ -43,17 +43,17 @@
     // recycled, and it could be a useful breadcrumb.
 }
 
-void VmObjectDispatcher::get_name(char out_name[MX_MAX_NAME_LEN]) const {
+void VmObjectDispatcher::get_name(char out_name[ZX_MAX_NAME_LEN]) const {
     canary_.Assert();
-    vmo_->get_name(out_name, MX_MAX_NAME_LEN);
+    vmo_->get_name(out_name, ZX_MAX_NAME_LEN);
 }
 
-mx_status_t VmObjectDispatcher::set_name(const char* name, size_t len) {
+zx_status_t VmObjectDispatcher::set_name(const char* name, size_t len) {
     canary_.Assert();
     return vmo_->set_name(name, len);
 }
 
-mx_status_t VmObjectDispatcher::Read(user_ptr<void> user_data,
+zx_status_t VmObjectDispatcher::Read(user_ptr<void> user_data,
                                      size_t length,
                                      uint64_t offset,
                                      size_t* bytes_read) {
@@ -62,7 +62,7 @@
     return vmo_->ReadUser(user_data, offset, length, bytes_read);
 }
 
-mx_status_t VmObjectDispatcher::Write(user_ptr<const void> user_data,
+zx_status_t VmObjectDispatcher::Write(user_ptr<const void> user_data,
                                       size_t length,
                                       uint64_t offset,
                                       size_t* bytes_written) {
@@ -71,21 +71,21 @@
     return vmo_->WriteUser(user_data, offset, length, bytes_written);
 }
 
-mx_status_t VmObjectDispatcher::SetSize(uint64_t size) {
+zx_status_t VmObjectDispatcher::SetSize(uint64_t size) {
     canary_.Assert();
 
     return vmo_->Resize(size);
 }
 
-mx_status_t VmObjectDispatcher::GetSize(uint64_t* size) {
+zx_status_t VmObjectDispatcher::GetSize(uint64_t* size) {
     canary_.Assert();
 
     *size = vmo_->size();
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VmObjectDispatcher::RangeOp(uint32_t op, uint64_t offset, uint64_t size,
+zx_status_t VmObjectDispatcher::RangeOp(uint32_t op, uint64_t offset, uint64_t size,
                                         user_ptr<void> buffer, size_t buffer_size) {
     canary_.Assert();
 
@@ -94,56 +94,56 @@
             op, offset, size, buffer.get(), buffer_size);
 
     switch (op) {
-        case MX_VMO_OP_COMMIT: {
+        case ZX_VMO_OP_COMMIT: {
             // TODO: handle partial commits
             auto status = vmo_->CommitRange(offset, size, nullptr);
             return status;
         }
-        case MX_VMO_OP_DECOMMIT: {
+        case ZX_VMO_OP_DECOMMIT: {
             // TODO: handle partial decommits
             auto status = vmo_->DecommitRange(offset, size, nullptr);
             return status;
         }
-        case MX_VMO_OP_LOCK:
-        case MX_VMO_OP_UNLOCK:
+        case ZX_VMO_OP_LOCK:
+        case ZX_VMO_OP_UNLOCK:
             // TODO: handle
-            return MX_ERR_NOT_SUPPORTED;
-        case MX_VMO_OP_LOOKUP:
+            return ZX_ERR_NOT_SUPPORTED;
+        case ZX_VMO_OP_LOOKUP:
             // we will be using the user pointer
             if (!buffer)
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
 
-            // make sure that mx_paddr_t doesn't drift from paddr_t, which the VM uses internally
-            static_assert(sizeof(mx_paddr_t) == sizeof(paddr_t), "");
+            // make sure that zx_paddr_t doesn't drift from paddr_t, which the VM uses internally
+            static_assert(sizeof(zx_paddr_t) == sizeof(paddr_t), "");
 
             return vmo_->LookupUser(offset, size, buffer.reinterpret<paddr_t>(), buffer_size);
-        case MX_VMO_OP_CACHE_SYNC:
+        case ZX_VMO_OP_CACHE_SYNC:
             return vmo_->SyncCache(offset, size);
-        case MX_VMO_OP_CACHE_INVALIDATE:
+        case ZX_VMO_OP_CACHE_INVALIDATE:
             return vmo_->InvalidateCache(offset, size);
-        case MX_VMO_OP_CACHE_CLEAN:
+        case ZX_VMO_OP_CACHE_CLEAN:
             return vmo_->CleanCache(offset, size);
-        case MX_VMO_OP_CACHE_CLEAN_INVALIDATE:
+        case ZX_VMO_OP_CACHE_CLEAN_INVALIDATE:
             return vmo_->CleanInvalidateCache(offset, size);
         default:
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
     }
 }
 
-mx_status_t VmObjectDispatcher::SetMappingCachePolicy(uint32_t cache_policy) {
+zx_status_t VmObjectDispatcher::SetMappingCachePolicy(uint32_t cache_policy) {
     return vmo_->SetMappingCachePolicy(cache_policy);
 }
 
-mx_status_t VmObjectDispatcher::Clone(uint32_t options, uint64_t offset, uint64_t size,
+zx_status_t VmObjectDispatcher::Clone(uint32_t options, uint64_t offset, uint64_t size,
         bool copy_name, fbl::RefPtr<VmObject>* clone_vmo) {
     canary_.Assert();
 
     LTRACEF("options 0x%x offset %#" PRIx64 " size %#" PRIx64 "\n",
             options, offset, size);
 
-    if (options & MX_VMO_CLONE_COPY_ON_WRITE) {
+    if (options & ZX_VMO_CLONE_COPY_ON_WRITE) {
         return vmo_->CloneCOW(offset, size, copy_name, clone_vmo);
     } else {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
diff --git a/kernel/object/wait_state_observer.cpp b/kernel/object/wait_state_observer.cpp
index 64ba448..0015c91 100644
--- a/kernel/object/wait_state_observer.cpp
+++ b/kernel/object/wait_state_observer.cpp
@@ -18,9 +18,9 @@
     DEBUG_ASSERT(!dispatcher_);
 }
 
-mx_status_t WaitStateObserver::Begin(Event* event,
+zx_status_t WaitStateObserver::Begin(Event* event,
                                      Handle* handle,
-                                     mx_signals_t watched_signals) {
+                                     zx_signals_t watched_signals) {
     canary_.Assert();
     DEBUG_ASSERT(!dispatcher_);
 
@@ -31,14 +31,14 @@
     wakeup_reasons_ = 0u;
 
     auto status = dispatcher_->add_observer(this);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dispatcher_.reset();
         return status;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_signals_t WaitStateObserver::End() {
+zx_signals_t WaitStateObserver::End() {
     canary_.Assert();
     DEBUG_ASSERT(dispatcher_);
 
@@ -53,7 +53,7 @@
     return wakeup_reasons_;
 }
 
-StateObserver::Flags WaitStateObserver::OnInitialize(mx_signals_t initial_state,
+StateObserver::Flags WaitStateObserver::OnInitialize(zx_signals_t initial_state,
                                                      const StateObserver::CountInfo* cinfo) {
     canary_.Assert();
 
@@ -71,7 +71,7 @@
     return 0;
 }
 
-StateObserver::Flags WaitStateObserver::OnStateChange(mx_signals_t new_state) {
+StateObserver::Flags WaitStateObserver::OnStateChange(zx_signals_t new_state) {
     canary_.Assert();
 
     // If we are still on our StateTracker's list of observers, and the
@@ -93,8 +93,8 @@
     canary_.Assert();
 
     if (handle == handle_) {
-        wakeup_reasons_ |= MX_SIGNAL_HANDLE_CLOSED;
-        if (event_->Signal(MX_ERR_CANCELED) > 0) {
+        wakeup_reasons_ |= ZX_SIGNAL_HANDLE_CLOSED;
+        if (event_->Signal(ZX_ERR_CANCELED) > 0) {
             return kHandled | kWokeThreads;
         } else {
             return kHandled;
diff --git a/kernel/platform/debug.c b/kernel/platform/debug.c
index c345c12..f4610e8 100644
--- a/kernel/platform/debug.c
+++ b/kernel/platform/debug.c
@@ -6,7 +6,7 @@
 // https://opensource.org/licenses/MIT
 
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 #include <trace.h>
 
diff --git a/kernel/platform/generic-arm/platform.cpp b/kernel/platform/generic-arm/platform.cpp
index 2cc578b..2eab0d8 100644
--- a/kernel/platform/generic-arm/platform.cpp
+++ b/kernel/platform/generic-arm/platform.cpp
@@ -47,7 +47,7 @@
 #include <kernel/thread.h>
 #endif
 
-#include <magenta/boot/bootdata.h>
+#include <zircon/boot/bootdata.h>
 #include <mdi/mdi.h>
 #include <mdi/mdi-defs.h>
 #include <pdev/pdev.h>
@@ -245,7 +245,7 @@
 static void platform_cpu_early_init(mdi_node_ref_t* cpu_map) {
     mdi_node_ref_t  clusters;
 
-    if (mdi_find_node(cpu_map, MDI_CPU_CLUSTERS, &clusters) != MX_OK) {
+    if (mdi_find_node(cpu_map, MDI_CPU_CLUSTERS, &clusters) != ZX_OK) {
         panic("platform_cpu_early_init couldn't find clusters\n");
         return;
     }
@@ -256,11 +256,11 @@
         mdi_node_ref_t node;
         uint8_t cpu_count;
 
-        if (mdi_find_node(&cluster, MDI_CPU_COUNT, &node) != MX_OK) {
+        if (mdi_find_node(&cluster, MDI_CPU_COUNT, &node) != ZX_OK) {
             panic("platform_cpu_early_init couldn't find cluster cpu-count\n");
             return;
         }
-        if (mdi_node_uint8(&node, &cpu_count) != MX_OK) {
+        if (mdi_node_uint8(&node, &cpu_count) != ZX_OK) {
             panic("platform_cpu_early_init could not read cluster id\n");
             return;
         }
@@ -334,7 +334,7 @@
                                             VmAspace::VMM_FLAG_VALLOC_SPECIFIC,
                                             perm_flags_rwx);
 
-        if (result != MX_OK) {
+        if (result != ZX_OK) {
             printf("Unable to allocate physical at vaddr = %p, paddr = %p\n",
                    base_of_ram, (void*)pa);
             return;
@@ -465,13 +465,13 @@
     }
 }
 
-static inline bool is_magenta_boot_header(void* addr) {
+static inline bool is_zircon_boot_header(void* addr) {
     DEBUG_ASSERT(addr);
 
-    efi_magenta_hdr_t* header = (efi_magenta_hdr_t*)addr;
+    efi_zircon_hdr_t* header = (efi_zircon_hdr_t*)addr;
 
 
-    return header->magic == EFI_MAGENTA_MAGIC;
+    return header->magic == EFI_ZIRCON_MAGIC;
 }
 
 static inline bool is_bootdata_container(void* addr) {
@@ -502,15 +502,15 @@
     const void* section_ptr = reinterpret_cast<const void *>(section);
     const size_t length = reinterpret_cast<uintptr_t>(ramdisk_end) - reinterpret_cast<uintptr_t>(section_ptr);
 
-    if (mdi_init(section_ptr, length, &root) != MX_OK) {
+    if (mdi_init(section_ptr, length, &root) != ZX_OK) {
         panic("mdi_init failed\n");
     }
 
     // search top level nodes for CPU info and kernel drivers
-    if (mdi_find_node(&root, MDI_CPU_MAP, &cpu_map) != MX_OK) {
+    if (mdi_find_node(&root, MDI_CPU_MAP, &cpu_map) != ZX_OK) {
         panic("platform_mdi_init couldn't find cpu-map\n");
     }
-    if (mdi_find_node(&root, MDI_KERNEL, &kernel_drivers) != MX_OK) {
+    if (mdi_find_node(&root, MDI_KERNEL, &kernel_drivers) != ZX_OK) {
         panic("platform_mdi_init couldn't find kernel-drivers\n");
     }
 
@@ -602,8 +602,8 @@
         // We leave out arena size for now
         ramdisk_from_bootdata_container(boot_structure_kvaddr, &ramdisk_base,
                                         &ramdisk_size);
-    } else if (is_magenta_boot_header(boot_structure_kvaddr)) {
-            efi_magenta_hdr_t *hdr = (efi_magenta_hdr_t*)boot_structure_kvaddr;
+    } else if (is_zircon_boot_header(boot_structure_kvaddr)) {
+            efi_zircon_hdr_t *hdr = (efi_zircon_hdr_t*)boot_structure_kvaddr;
             cmdline_append(hdr->cmd_line);
             ramdisk_start_phys = hdr->ramdisk_base_phys;
             ramdisk_size = hdr->ramdisk_size;
@@ -635,7 +635,7 @@
     // find memory ranges to use if one is found.
     mem_limit_ctx_t ctx;
     status_t status = mem_limit_init(&ctx);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         // For these ranges we're using the base physical values
         ctx.kernel_base = MEMBASE + KERNEL_LOAD_OFFSET;
         ctx.kernel_size = (uintptr_t)&_end - ctx.kernel_base;
@@ -648,7 +648,7 @@
 
     // If no memory limit was found, or adding arenas from the range failed, then add
     // the existing global arena.
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         pmm_add_arena(&arena);
     }
 
@@ -708,7 +708,7 @@
 
 /* no built in framebuffer */
 status_t display_get_info(struct display_info *info) {
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
 static void reboot() {
@@ -780,8 +780,8 @@
     return 0;
 }
 
-mx_status_t platform_mexec_patch_bootdata(uint8_t* bootdata, const size_t len) {
-    return MX_OK;
+zx_status_t platform_mexec_patch_bootdata(uint8_t* bootdata, const size_t len) {
+    return ZX_OK;
 }
 
 void platform_mexec(mexec_asm_func mexec_assembly, memmov_ops_t* ops,
diff --git a/kernel/platform/pc/acpi.cpp b/kernel/platform/pc/acpi.cpp
index d9b32cd..3003d3a 100644
--- a/kernel/platform/pc/acpi.cpp
+++ b/kernel/platform/pc/acpi.cpp
@@ -4,7 +4,7 @@
 // license that can be found in the LICENSE file or at
 // https://opensource.org/licenses/MIT
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include <acpica/acpi.h>
 
@@ -62,23 +62,23 @@
     ACPI_STATUS status = AcpiGetTable((char *)ACPI_SIG_MADT, 1, &table);
     if (status != AE_OK) {
         TRACEF("could not find MADT\n");
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     ACPI_TABLE_MADT *madt = (ACPI_TABLE_MADT *)table;
     uintptr_t records_start = ((uintptr_t)madt) + sizeof(*madt);
     uintptr_t records_end = ((uintptr_t)madt) + madt->Header.Length;
     if (records_start >= records_end) {
         TRACEF("MADT wraps around address space\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     // Shouldn't be too many records
     if (madt->Header.Length > 4096) {
         TRACEF("MADT suspiciously long: %u\n", madt->Header.Length);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     *start = records_start;
     *end = records_end;
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* @brief Enumerate all functioning CPUs and their APIC IDs
@@ -90,7 +90,7 @@
  * @param len Length of apic_ids.
  * @param num_cpus Output for the number of logical processors detected.
  *
- * @return MX_OK on success. Note that if len < *num_cpus, not all
+ * @return ZX_OK on success. Note that if len < *num_cpus, not all
  *         logical apic_ids will be returned.
  */
 status_t platform_enumerate_cpus(
@@ -99,7 +99,7 @@
         uint32_t *num_cpus)
 {
     if (num_cpus == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uintptr_t records_start, records_end;
@@ -129,10 +129,10 @@
     }
     if (addr != records_end) {
       TRACEF("malformed MADT\n");
-      return MX_ERR_INTERNAL;
+      return ZX_ERR_INTERNAL;
     }
     *num_cpus = count;
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* @brief Enumerate all IO APICs
@@ -144,7 +144,7 @@
  * @param len Length of io_apics.
  * @param num_io_apics Number of IO apics found
  *
- * @return MX_OK on success. Note that if len < *num_io_apics, not all
+ * @return ZX_OK on success. Note that if len < *num_io_apics, not all
  *         IO APICs will be returned.
  */
 status_t platform_enumerate_io_apics(
@@ -153,7 +153,7 @@
         uint32_t *num_io_apics)
 {
     if (num_io_apics == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uintptr_t records_start, records_end;
@@ -183,10 +183,10 @@
     }
     if (addr != records_end) {
       TRACEF("malformed MADT\n");
-      return MX_ERR_INVALID_ARGS;
+      return ZX_ERR_INVALID_ARGS;
     }
     *num_io_apics = count;
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* @brief Enumerate all interrupt source overrides
@@ -197,7 +197,7 @@
  * @param len Length of isos.
  * @param num_isos Number of ISOs found
  *
- * @return MX_OK on success. Note that if len < *num_isos, not all
+ * @return ZX_OK on success. Note that if len < *num_isos, not all
  *         ISOs will be returned.
  */
 status_t platform_enumerate_interrupt_source_overrides(
@@ -206,7 +206,7 @@
         uint32_t *num_isos)
 {
     if (num_isos == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uintptr_t records_start, records_end;
@@ -270,17 +270,17 @@
     }
     if (addr != records_end) {
       TRACEF("malformed MADT\n");
-      return MX_ERR_INVALID_ARGS;
+      return ZX_ERR_INVALID_ARGS;
     }
     *num_isos = count;
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* @brief Return information about the High Precision Event Timer, if present.
  *
  * @param hpet Descriptor to populate
  *
- * @return MX_OK on success.
+ * @return ZX_OK on success.
  */
 status_t platform_find_hpet(struct acpi_hpet_descriptor *hpet)
 {
@@ -288,12 +288,12 @@
     ACPI_STATUS status = AcpiGetTable((char *)ACPI_SIG_HPET, 1, &table);
     if (status != AE_OK) {
         TRACEF("could not find HPET\n");
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     ACPI_TABLE_HPET *hpet_tbl = (ACPI_TABLE_HPET *)table;
     if (hpet_tbl->Header.Length != sizeof(ACPI_TABLE_HPET)) {
         TRACEF("Unexpected HPET table length\n");
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     hpet->minimum_tick = hpet_tbl->MinimumTick;
@@ -302,8 +302,8 @@
     switch (hpet_tbl->Address.SpaceId) {
         case ACPI_ADR_SPACE_SYSTEM_IO: hpet->port_io = true; break;
         case ACPI_ADR_SPACE_SYSTEM_MEMORY: hpet->port_io = false; break;
-        default: return MX_ERR_NOT_SUPPORTED;
+        default: return ZX_ERR_NOT_SUPPORTED;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/platform/pc/hpet.cpp b/kernel/platform/pc/hpet.cpp
index 9cc0ed8..918e31e 100644
--- a/kernel/platform/pc/hpet.cpp
+++ b/kernel/platform/pc/hpet.cpp
@@ -64,7 +64,7 @@
 static void hpet_init(uint level)
 {
     status_t status = platform_find_hpet(&hpet_desc);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return;
     }
 
@@ -81,7 +81,7 @@
             0, /* vmm flags */
             ARCH_MMU_FLAG_UNCACHED_DEVICE | ARCH_MMU_FLAG_PERM_READ |
                 ARCH_MMU_FLAG_PERM_WRITE);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         return;
     }
 
@@ -118,13 +118,13 @@
 status_t hpet_timer_disable(uint n)
 {
     if (unlikely(n >= num_timers)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     AutoSpinLock guard(&lock);
     hpet_regs->timers[n].conf_caps &= ~TIMER_CONF_INT_EN;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 uint64_t hpet_get_value(void)
@@ -145,24 +145,24 @@
     AutoSpinLock guard(&lock);
 
     if (hpet_regs->general_config & GEN_CONF_EN) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     hpet_regs->main_counter_value = v;
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t hpet_timer_configure_irq(uint n, uint irq)
 {
     if (unlikely(n >= num_timers)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     AutoSpinLock guard(&lock);
 
     uint32_t irq_bitmap = TIMER_CAP_IRQS(hpet_regs->timers[n].conf_caps);
     if (irq >= 32 || !BIT_SET(irq_bitmap, irq)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint64_t conf = hpet_regs->timers[n].conf_caps;
@@ -170,13 +170,13 @@
     conf |= TIMER_CONF_IRQ(irq);
     hpet_regs->timers[n].conf_caps = conf;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t hpet_timer_set_oneshot(uint n, uint64_t deadline)
 {
     if (unlikely(n >= num_timers)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     AutoSpinLock guard(&lock);
@@ -184,10 +184,10 @@
     uint64_t difference = deadline - hpet_get_value();
     if (unlikely(difference > (1ULL>>63))) {
         /* Either this is a very long timer, or we wrapped around */
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (unlikely(difference < min_ticks_ahead)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     hpet_regs->timers[n].conf_caps &= ~(TIMER_CONF_PERIODIC |
@@ -195,26 +195,26 @@
     hpet_regs->timers[n].comparator_value = deadline;
     hpet_regs->timers[n].conf_caps |= TIMER_CONF_INT_EN;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t hpet_timer_set_periodic(uint n, uint64_t period)
 {
     if (unlikely(n >= num_timers)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     AutoSpinLock guard(&lock);
 
     if (!TIMER_CAP_PERIODIC(hpet_regs->timers[n].conf_caps)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     /* It's unsafe to set a periodic timer while the hpet is running or the
      * main counter value is not 0. */
     if ((hpet_regs->general_config & GEN_CONF_EN) ||
         hpet_regs->main_counter_value != 0ULL) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     hpet_regs->timers[n].conf_caps |= TIMER_CONF_PERIODIC |
@@ -222,7 +222,7 @@
     hpet_regs->timers[n].comparator_value = period;
     hpet_regs->timers[n].conf_caps |= TIMER_CONF_INT_EN;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool hpet_is_present(void)
diff --git a/kernel/platform/pc/include/platform/console.h b/kernel/platform/pc/include/platform/console.h
index c9b3eff..1c194c6 100644
--- a/kernel/platform/pc/include/platform/console.h
+++ b/kernel/platform/pc/include/platform/console.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
@@ -51,7 +51,7 @@
 #define GREEN           2
 #define CYAN            3
 #define RED             4
-#define MAGENTA         5
+#define ZIRCON         5
 #define BROWN           6
 #define LIGHTGRAY       7
 #define DARKGRAY        8
@@ -59,7 +59,7 @@
 #define LIGHTGREEN      10
 #define LIGHTCYAN       11
 #define LIGHTRED        12
-#define LIGHTMAGENTA    13
+#define LIGHTZIRCON    13
 #define YELLOW          14
 #define WHITE           15
 
diff --git a/kernel/platform/pc/include/platform/pc/acpi.h b/kernel/platform/pc/include/platform/pc/acpi.h
index 7b3a1d0..a84d0f8 100644
--- a/kernel/platform/pc/include/platform/pc/acpi.h
+++ b/kernel/platform/pc/include/platform/pc/acpi.h
@@ -6,8 +6,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <acpica/acpi.h>
 #include <arch/x86/apic.h>
 
diff --git a/kernel/platform/pc/include/platform/pc/bootloader.h b/kernel/platform/pc/include/platform/pc/bootloader.h
index 4e4e56d..364cdb5 100644
--- a/kernel/platform/pc/include/platform/pc/bootloader.h
+++ b/kernel/platform/pc/include/platform/pc/bootloader.h
@@ -8,7 +8,7 @@
 
 #include <stdint.h>
 
-#include <magenta/boot/bootdata.h>
+#include <zircon/boot/bootdata.h>
 
 // Data passed in by the bootloader
 // Used by various bits of pc platform init
diff --git a/kernel/platform/pc/include/platform/pc/hpet.h b/kernel/platform/pc/include/platform/pc/hpet.h
index 4af3bfb..972191f 100644
--- a/kernel/platform/pc/include/platform/pc/hpet.h
+++ b/kernel/platform/pc/include/platform/pc/hpet.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <platform/pc/acpi.h>
 
 __BEGIN_CDECLS
diff --git a/kernel/platform/pc/include/platform/pc/memory.h b/kernel/platform/pc/include/platform/pc/memory.h
index ee7f9cd..fb8c340 100644
--- a/kernel/platform/pc/include/platform/pc/memory.h
+++ b/kernel/platform/pc/include/platform/pc/memory.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #define E820_RAM 1
 #define E820_RESERVED 2
diff --git a/kernel/platform/pc/interrupts.cpp b/kernel/platform/pc/interrupts.cpp
index f4fb710..ca09504 100644
--- a/kernel/platform/pc/interrupts.cpp
+++ b/kernel/platform/pc/interrupts.cpp
@@ -60,19 +60,19 @@
     status_t status = platform_enumerate_io_apics(NULL, 0, &num_io_apics);
     // TODO: If we want to support x86 without IO APICs, we should do something
     // better here.
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
     io_apic_descriptor *io_apics =
             static_cast<io_apic_descriptor *>(calloc(num_io_apics, sizeof(*io_apics)));
     ASSERT(io_apics != NULL);
     uint32_t num_found = 0;
     status = platform_enumerate_io_apics(io_apics, num_io_apics, &num_found);
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
     ASSERT(num_io_apics == num_found);
 
     // Enumerate the IO APICs
     uint32_t num_isos;
     status = platform_enumerate_interrupt_source_overrides(NULL, 0, &num_isos);
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
     io_apic_isa_override *isos = NULL;
     if (num_isos > 0) {
         isos = static_cast<io_apic_isa_override *>(calloc(num_isos, sizeof(*isos)));
@@ -81,7 +81,7 @@
                 isos,
                 num_isos,
                 &num_found);
-        ASSERT(status == MX_OK);
+        ASSERT(status == ZX_OK);
         ASSERT(num_isos == num_found);
     }
 
@@ -122,12 +122,12 @@
 
     // Initialize the x86 IRQ vector allocator and add the range of vectors to manage.
     status = p2ra_init(&x86_irq_vector_allocator, MAX_IRQ_BLOCK_SIZE);
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
 
     status = p2ra_add_range(&x86_irq_vector_allocator,
                             X86_INT_PLATFORM_BASE,
                             X86_INT_PLATFORM_MAX - X86_INT_PLATFORM_BASE + 1);
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
 }
 LK_INIT_HOOK(apic, &platform_init_apic, LK_INIT_LEVEL_VM + 2);
 
@@ -140,7 +140,7 @@
 
     spin_unlock_irqrestore(&lock, state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t unmask_interrupt(unsigned int vector)
@@ -152,7 +152,7 @@
 
     spin_unlock_irqrestore(&lock, state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t configure_interrupt(unsigned int vector,
@@ -174,7 +174,7 @@
 
     spin_unlock_irqrestore(&lock, state);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t get_interrupt_config(unsigned int vector,
@@ -243,9 +243,9 @@
          * builds, we log a message and then silently ignore the request to
          * register a new handler. */
         result = p2ra_allocate_range(&x86_irq_vector_allocator, 1, &range_start);
-        DEBUG_ASSERT(result == MX_OK);
+        DEBUG_ASSERT(result == ZX_OK);
 
-        if (result != MX_OK) {
+        if (result != ZX_OK) {
             TRACEF("Failed to allocate x86 IRQ vector for global IRQ (%u) when "
                    "registering new handler (%p, %p)\n",
                    vector, handler, arg);
@@ -294,20 +294,20 @@
                              bool is_msix,
                              pcie_msi_block_t* out_block) {
     if (!out_block)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (out_block->allocated)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     if (!requested_irqs || (requested_irqs > PCIE_MAX_MSI_IRQS))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     status_t res;
     uint alloc_start;
     uint alloc_size = 1u << log2_uint_ceil(requested_irqs);
 
     res = p2ra_allocate_range(&x86_irq_vector_allocator, alloc_size, &alloc_start);
-    if (res == MX_OK) {
+    if (res == ZX_OK) {
         // Compute the target address.
         // See section 10.11.1 of the Intel 64 and IA-32 Architectures Software
         // Developer's Manual Volume 3A.
diff --git a/kernel/platform/pc/memory.cpp b/kernel/platform/pc/memory.cpp
index 4e25c40..91ec3b6 100644
--- a/kernel/platform/pc/memory.cpp
+++ b/kernel/platform/pc/memory.cpp
@@ -11,7 +11,7 @@
 #include <inttypes.h>
 #include <kernel/vm.h>
 #include <lib/memory_limit.h>
-#include <magenta/boot/multiboot.h>
+#include <zircon/boot/multiboot.h>
 #include <fbl/algorithm.h>
 #include <platform.h>
 #include <platform/pc/bootloader.h>
@@ -89,7 +89,7 @@
     ctx.kernel_size = reinterpret_cast<uintptr_t>(&_end) - ctx.kernel_base;
     ctx.ramdisk_base = reinterpret_cast<uintptr_t>(platform_get_ramdisk(&ctx.ramdisk_size));
 
-    bool have_limit = (mem_limit_init(&ctx) == MX_OK);
+    bool have_limit = (mem_limit_init(&ctx) == ZX_OK);
 
     // Set up a base arena template to use
     pmm_arena_info_t base_arena;
@@ -119,14 +119,14 @@
             size -= adjust;
         }
 
-        status_t status = MX_OK;
+        status_t status = ZX_OK;
         if (have_limit) {
             status = mem_limit_add_arenas_from_range(&ctx, base, size, base_arena);
         }
 
         // If there is no limit, or we failed to add arenas from processing
         // ranges then add the original range.
-        if (!have_limit || status != MX_OK) {
+        if (!have_limit || status != ZX_OK) {
             auto arena = base_arena;
             arena.base = base;
             arena.size = size;
@@ -135,7 +135,7 @@
             status = pmm_add_arena(&arena);
             // This will result in subsequent arenas not being added, but this
             // is a fairly fatal event so it's justifiable.
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 TRACEF("Failed to add pmm range at %#" PRIxPTR "\n", arena.base);
                 return status;
             }
@@ -143,7 +143,7 @@
 
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 typedef struct e820_range_seq {
@@ -410,20 +410,20 @@
     /* first try the efi memory table */
     efi_range_seq_t efi_seq;
     if (efi_range_init(&range, &efi_seq) &&
-        (mem_arena_init(&range) == MX_OK))
-        return MX_OK;
+        (mem_arena_init(&range) == ZX_OK))
+        return ZX_OK;
 
     /* then try getting range info from e820 */
     e820_range_seq_t e820_seq;
     if (e820_range_init(&range, &e820_seq) &&
-        (mem_arena_init(&range) == MX_OK))
-        return MX_OK;
+        (mem_arena_init(&range) == ZX_OK))
+        return ZX_OK;
 
     /* if no ranges were found, try multiboot */
     multiboot_range_seq_t multiboot_seq;
     if (multiboot_range_init(&range, &multiboot_seq) &&
-        (mem_arena_init(&range) == MX_OK))
-        return MX_OK;
+        (mem_arena_init(&range) == ZX_OK))
+        return ZX_OK;
 
     /* if still no ranges were found, make a safe guess */
     e820_range_init(&range, &e820_seq);
@@ -442,23 +442,23 @@
 
 status_t enumerate_e820(enumerate_e820_callback callback, void* ctx) {
     if (callback == NULL)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if(!cached_e820_entry_count)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     DEBUG_ASSERT(cached_e820_entry_count <= fbl::count_of(cached_e820_entries));
     for (size_t i = 0; i < cached_e820_entry_count; ++i)
         callback(cached_e820_entries[i].base, cached_e820_entries[i].size,
                  cached_e820_entries[i].is_mem, ctx);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* Discover the basic memory map */
 void platform_mem_init(void)
 {
-    if (platform_mem_range_init() != MX_OK) {
+    if (platform_mem_range_init() != ZX_OK) {
         TRACEF("Error adding arenas from provided memory tables.\n");
     }
 
diff --git a/kernel/platform/pc/pcie_quirks.cpp b/kernel/platform/pc/pcie_quirks.cpp
index 5c0d076..b4e9c8f 100644
--- a/kernel/platform/pc/pcie_quirks.cpp
+++ b/kernel/platform/pc/pcie_quirks.cpp
@@ -119,7 +119,7 @@
         if (tolud_val) {
             LTRACEF("TOLUD Quirk subtracting region [0x%08x, 0x%08x)\n", 0u, tolud_val);
             status_t res = dev->driver().SubtractBusRegion(0u, tolud_val, PciAddrSpace::MMIO);
-            if (res != MX_OK)
+            if (res != ZX_OK)
                 TRACEF("WARNING : PCIe TOLUD Quirk failed to subtract region "
                        "[0x%08x, 0x%08x) (res %d)!\n", 0u, tolud_val, res);
         }
@@ -172,7 +172,7 @@
 
     if (top_mem && dev) {
         status_t res = dev->driver().SubtractBusRegion(0u, top_mem, PciAddrSpace::MMIO);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             TRACEF("WARNING : PCIe AMD top_mem quirk failed to subtract region "
                    "[0x0, %#" PRIx64 ") (res %d)!\n", top_mem, res);
         }
@@ -184,7 +184,7 @@
         // TODO: make this subtractive on (0, TOP_MEM2) when we start preloading the
         // upper pci range.
         status_t res = dev->driver().AddBusRegion(top_mem2, max, PciAddrSpace::MMIO);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             TRACEF("WARNING : PCIe AMD top_mem quirk failed to add 64bit region "
                    "[%#" PRIx64 ", %#" PRIx64 ") (res %d)!\n", top_mem2, max, res);
         }
diff --git a/kernel/platform/pc/platform.cpp b/kernel/platform/pc/platform.cpp
index 619ef1e..b8c63ec 100644
--- a/kernel/platform/pc/platform.cpp
+++ b/kernel/platform/pc/platform.cpp
@@ -24,8 +24,8 @@
 #include <platform/pc/memory.h>
 #include <platform/console.h>
 #include <platform/keyboard.h>
-#include <magenta/boot/bootdata.h>
-#include <magenta/boot/multiboot.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/boot/multiboot.h>
 #include <arch/mmu.h>
 #include <arch/mp.h>
 #include <arch/x86.h>
@@ -357,7 +357,7 @@
             0 /* vmm flags */,
             ARCH_MMU_FLAG_WRITE_COMBINING | ARCH_MMU_FLAG_PERM_READ |
                 ARCH_MMU_FLAG_PERM_WRITE);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         TRACEF("Failed to map boot_fb: %d\n", status);
         return;
     }
@@ -367,8 +367,8 @@
 }
 LK_INIT_HOOK(display_memtype, &platform_ensure_display_memtype, LK_INIT_LEVEL_VM + 1);
 
-static efi_guid magenta_guid = MAGENTA_VENDOR_GUID;
-static char16_t crashlog_name[] = MAGENTA_CRASHLOG_EFIVAR;
+static efi_guid zircon_guid = ZIRCON_VENDOR_GUID;
+static char16_t crashlog_name[] = ZIRCON_CRASHLOG_EFIVAR;
 
 static fbl::RefPtr<VmAspace> efi_aspace;
 
@@ -457,14 +457,14 @@
         //      the platforms we're working on right now, but is probably
         //      not entirely correct.
         void* ptr = (void*) 0;
-        mx_status_t r = efi_aspace->AllocPhysical("1:1", 16*1024*1024*1024UL, &ptr,
+        zx_status_t r = efi_aspace->AllocPhysical("1:1", 16*1024*1024*1024UL, &ptr,
                                                   PAGE_SIZE_SHIFT, 0,
                                                   VmAspace::VMM_FLAG_VALLOC_SPECIFIC,
                                                   ARCH_MMU_FLAG_PERM_READ |
                                                   ARCH_MMU_FLAG_PERM_WRITE |
                                                   ARCH_MMU_FLAG_PERM_EXECUTE);
 
-        if (r != MX_OK) {
+        if (r != ZX_OK) {
             efi_aspace.reset();
         }
     }
@@ -489,7 +489,7 @@
 
     efi_system_table* sys = static_cast<efi_system_table*>(bootloader.efi_system_table);
     efi_runtime_services* rs = sys->RuntimeServices;
-    if (rs->SetVariable(crashlog_name, &magenta_guid, MAGENTA_CRASHLOG_EFIATTR, len, log) == 0) {
+    if (rs->SetVariable(crashlog_name, &zircon_guid, ZIRCON_CRASHLOG_EFIATTR, len, log) == 0) {
         return len;
     } else {
         return 0;
@@ -516,7 +516,7 @@
 typedef struct e820_walk_ctx {
     uint8_t* buf;
     size_t len;
-    mx_status_t ret;
+    zx_status_t ret;
 } e820_walk_ctx_t;
 
 static void e820_entry_walk(uint64_t base, uint64_t size, bool is_mem, void* void_ctx) {
@@ -524,12 +524,12 @@
 
     // Something went wrong in one of the previous calls, don't attempt to
     // continue.
-    if (ctx->ret != MX_OK)
+    if (ctx->ret != ZX_OK)
         return;
 
     // Make sure we have enough space in the buffer.
     if (ctx->len < sizeof(e820entry_t)) {
-        ctx->ret = MX_ERR_BUFFER_TOO_SMALL;
+        ctx->ret = ZX_ERR_BUFFER_TOO_SMALL;
         return;
     }
 
@@ -544,25 +544,25 @@
 
     ctx->buf += sizeof(*entry);
     ctx->len -= sizeof(*entry);
-    ctx->ret = MX_OK;
+    ctx->ret = ZX_OK;
 }
 
 // Give the platform an opportunity to append any platform specific bootdata
 // sections.
-mx_status_t platform_mexec_patch_bootdata(uint8_t* bootdata, const size_t len) {
+zx_status_t platform_mexec_patch_bootdata(uint8_t* bootdata, const size_t len) {
     uint8_t e820buf[sizeof(e820entry_t) * 32];
 
     e820_walk_ctx ctx;
     ctx.buf = e820buf;
     ctx.len = sizeof(e820buf);
-    ctx.ret = MX_OK;
+    ctx.ret = ZX_OK;
 
-    mx_status_t ret = enumerate_e820(e820_entry_walk, &ctx);
+    zx_status_t ret = enumerate_e820(e820_entry_walk, &ctx);
 
-    if (ret != MX_OK)
+    if (ret != ZX_OK)
         return ret;
 
-    if (ctx.ret != MX_OK)
+    if (ctx.ret != ZX_OK)
         return ctx.ret;
 
     uint32_t section_length = (uint32_t)(sizeof(e820buf) - ctx.len);
@@ -570,14 +570,14 @@
     ret = bootdata_append_section(bootdata, len, e820buf, section_length,
                                   BOOTDATA_E820_TABLE, 0, 0);
 
-    if (ret != MX_OK)
+    if (ret != ZX_OK)
         return ret;
 
     // Append information about the framebuffer to the bootdata
     if (bootloader.fb.base) {
         ret = bootdata_append_section(bootdata, len, (uint8_t*)&bootloader.fb,
                                       sizeof(bootloader.fb), BOOTDATA_FRAMEBUFFER, 0, 0);
-        if (ret != MX_OK)
+        if (ret != ZX_OK)
             return ret;
     }
 
@@ -585,18 +585,18 @@
         ret = bootdata_append_section(bootdata, len, (uint8_t*)&bootloader.efi_system_table,
                                       sizeof(bootloader.efi_system_table),
                                       BOOTDATA_EFI_SYSTEM_TABLE, 0, 0);
-        if (ret != MX_OK)
+        if (ret != ZX_OK)
             return ret;
     }
 
     if (bootloader.acpi_rsdp) {
         ret = bootdata_append_section(bootdata, len, (uint8_t*)&bootloader.acpi_rsdp,
                                       sizeof(bootloader.acpi_rsdp), BOOTDATA_ACPI_RSDP, 0, 0);
-        if (ret != MX_OK)
+        if (ret != ZX_OK)
             return ret;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Number of pages required to identity map 4GiB of memory.
@@ -658,11 +658,11 @@
                                 ARCH_MMU_FLAG_PERM_EXECUTE;
     void* identity_address = 0x0;
     paddr_t pa = 0;
-    mx_status_t result = identity_aspace->AllocPhysical("1:1 mapping", kBytesToIdentityMap,
+    zx_status_t result = identity_aspace->AllocPhysical("1:1 mapping", kBytesToIdentityMap,
                                             &identity_address, 0, pa,
                                             VmAspace::VMM_FLAG_VALLOC_SPECIFIC,
                                             perm_flags_rwx);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         panic("failed to identity map low memory");
     }
 
@@ -740,7 +740,7 @@
     uint32_t num_cpus = 0;
 
     status_t status = platform_enumerate_cpus(NULL, 0, &num_cpus);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         TRACEF("failed to enumerate CPUs, disabling SMP\n");
         return;
     }
@@ -758,7 +758,7 @@
     // find the list of all cpu apic ids into a temporary list
     uint32_t real_num_cpus;
     status = platform_enumerate_cpus(apic_ids_temp, num_cpus, &real_num_cpus);
-    if (status != MX_OK || num_cpus != real_num_cpus) {
+    if (status != ZX_OK || num_cpus != real_num_cpus) {
         TRACEF("failed to enumerate CPUs, disabling SMP\n");
         free(apic_ids);
         return;
diff --git a/kernel/platform/pc/platform_p.h b/kernel/platform/pc/platform_p.h
index 3bd3646..5bba324 100644
--- a/kernel/platform/pc/platform_p.h
+++ b/kernel/platform/pc/platform_p.h
@@ -10,7 +10,7 @@
 #include <sys/types.h>
 #include <dev/pcie_platform.h>
 #include <lib/cbuf.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 extern cbuf_t console_input_buf;
 
diff --git a/kernel/platform/pc/platform_pcie.cpp b/kernel/platform/pc/platform_pcie.cpp
index 75260f3..8bd77d1 100644
--- a/kernel/platform/pc/platform_pcie.cpp
+++ b/kernel/platform/pc/platform_pcie.cpp
@@ -14,7 +14,7 @@
 #include <inttypes.h>
 #include <kernel/mutex.h>
 #include <lk/init.h>
-#include <magenta/syscalls/pci.h>
+#include <zircon/syscalls/pci.h>
 #include <fbl/limits.h>
 #include <string.h>
 #include <trace.h>
@@ -52,16 +52,16 @@
     // release build.
     status_t res;
     res = pcie.SubtractBusRegion(0x0, 0x10000, PciAddrSpace::PIO);
-    ASSERT(res == MX_OK);
+    ASSERT(res == ZX_OK);
 
     res = pcie.SubtractBusRegion(0x0, fbl::numeric_limits<uint64_t>::max(), PciAddrSpace::MMIO);
-    ASSERT(res == MX_OK);
+    ASSERT(res == ZX_OK);
 }
 
 static void x86_pcie_init_hook(uint level) {
     // Initialize the bus driver
     status_t res = PcieBusDriver::InitializeDriver(platform_pcie_support);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         TRACEF("Failed to initialize PCI bus driver (res = %d).  "
                "PCI will be non-functional.\n", res);
         return;
@@ -79,7 +79,7 @@
     constexpr uint64_t pcie_pio_size = 0x10000 - pcie_pio_base;
 
     res = pcie->AddBusRegion(pcie_pio_base, pcie_pio_size, PciAddrSpace::PIO);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         TRACEF("WARNING - Failed to add initial PCIe PIO region "
                "[%" PRIx64 ", %" PRIx64") to bus driver! (res %d)\n",
                 pcie_pio_base, pcie_pio_base + pcie_pio_size, res);
@@ -98,7 +98,7 @@
     constexpr uint64_t pcie_mmio_base = 0x0;
     constexpr uint64_t pcie_mmio_size = 0x100000000;
     res = pcie->AddBusRegion(pcie_mmio_base, pcie_mmio_size, PciAddrSpace::MMIO);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         TRACEF("WARNING - Failed to add initial PCIe MMIO region "
                "[%" PRIx64 ", %" PRIx64") to bus driver! (res %d)\n",
                 pcie_mmio_base, pcie_mmio_base + pcie_mmio_size, res);
@@ -112,7 +112,7 @@
         status_t res;
 
         res = pcie->SubtractBusRegion(base, size, PciAddrSpace::MMIO);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             // Woah, this is Very Bad!  If we failed to prohibit the PCIe bus
             // driver from using a region of the MMIO bus we are in a pretty
             // dangerous situation.  For now, log a message, then attempt to
@@ -124,7 +124,7 @@
         }
     }, pcie.get());
 
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         // Woah, this is Very Bad!  If we failed to prohibit the PCIe bus
         // driver from using a region of the MMIO bus we are in a pretty
         // dangerous situation.  For now, log a message, then attempt to
diff --git a/kernel/platform/pc/timer.cpp b/kernel/platform/pc/timer.cpp
index 98b695d..e0a8fe2 100644
--- a/kernel/platform/pc/timer.cpp
+++ b/kernel/platform/pc/timer.cpp
@@ -318,7 +318,7 @@
                         UINT32_MAX,
                         apic_divisor,
                         true);
-                ASSERT(status == MX_OK);
+                ASSERT(status == ZX_OK);
 
                 switch (calibration_clock) {
                     case CLOCK_HPET:
@@ -530,14 +530,14 @@
 
     if (use_tsc_deadline) {
         if (UINT64_MAX / deadline < (tsc_ticks_per_ms / LK_MSEC(1))) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         // We rounded up to the tick after above.
         const uint64_t tsc_deadline = u64_mul_u64_fp32_64(deadline, tsc_per_ns);
         LTRACEF("Scheduling oneshot timer: %" PRIu64 " deadline\n", tsc_deadline);
         apic_timer_set_tsc_deadline(tsc_deadline, false /* unmasked */);
-        return MX_OK;
+        return ZX_OK;
     }
 
     const lk_time_t now = current_time();
@@ -597,7 +597,7 @@
         case CLOCK_TSC: {
             /* Use the PIT IRQ number since the PIT isn't running */
             uint32_t irq = apic_io_isa_to_global(ISA_IRQ_PIT);
-            if (hpet_timer_configure_irq(0, irq) == MX_OK) {
+            if (hpet_timer_configure_irq(0, irq) == ZX_OK) {
                 apic_io_configure_isa_irq(
                         ISA_IRQ_PIT,
                         DELIVERY_MODE_NMI,
@@ -609,12 +609,12 @@
                 uint64_t hpet_rate_ms = hpet_ticks_per_ms();
                 hpet_disable();
                 __UNUSED status_t status = hpet_set_value(0);
-                DEBUG_ASSERT(status == MX_OK);
+                DEBUG_ASSERT(status == ZX_OK);
                 status = hpet_timer_set_periodic(0, hpet_rate_ms * frequency / 1000);
-                DEBUG_ASSERT(status == MX_OK);
+                DEBUG_ASSERT(status == ZX_OK);
                 hpet_enable();
 
-                return MX_OK;
+                return ZX_OK;
             }
             /* Fallthrough and use the PIT instead */
         }
@@ -632,8 +632,8 @@
                     0,
                     0);
             printf("CONFIGURED WATCHDOG\n");
-            return MX_OK;
+            return ZX_OK;
         }
-        default: return MX_ERR_NOT_SUPPORTED;
+        default: return ZX_ERR_NOT_SUPPORTED;
     }
 }
diff --git a/kernel/platform/power.c b/kernel/platform/power.c
index 9e18511..a82872c 100644
--- a/kernel/platform/power.c
+++ b/kernel/platform/power.c
@@ -7,7 +7,7 @@
 
 #include <debug.h>
 #include <err.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <platform.h>
 #include <platform/debug.h>
 #include <kernel/thread.h>
diff --git a/kernel/project/magenta-hikey960-arm64.mk b/kernel/project/zircon-hikey960-arm64.mk
similarity index 100%
rename from kernel/project/magenta-hikey960-arm64.mk
rename to kernel/project/zircon-hikey960-arm64.mk
diff --git a/kernel/project/magenta-odroidc2-arm64.mk b/kernel/project/zircon-odroidc2-arm64.mk
similarity index 100%
rename from kernel/project/magenta-odroidc2-arm64.mk
rename to kernel/project/zircon-odroidc2-arm64.mk
diff --git a/kernel/project/magenta-pc-x86-64.mk b/kernel/project/zircon-pc-x86-64.mk
similarity index 87%
rename from kernel/project/magenta-pc-x86-64.mk
rename to kernel/project/zircon-pc-x86-64.mk
index 0171f7f..052f2c4 100644
--- a/kernel/project/magenta-pc-x86-64.mk
+++ b/kernel/project/zircon-pc-x86-64.mk
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-# Project file to build magenta + user space on top of qemu
+# Project file to build zircon + user space on top of qemu
 # emulating a standard PC with a 64bit x86 core
 
 SUBARCH := x86-64
diff --git a/kernel/project/magenta-qemu-arm64.mk b/kernel/project/zircon-qemu-arm64.mk
similarity index 86%
rename from kernel/project/magenta-qemu-arm64.mk
rename to kernel/project/zircon-qemu-arm64.mk
index a0b3b8d..26501f6 100644
--- a/kernel/project/magenta-qemu-arm64.mk
+++ b/kernel/project/zircon-qemu-arm64.mk
@@ -5,7 +5,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-# Project file to build magenta + user space on top of qemu
+# Project file to build zircon + user space on top of qemu
 # for 64bit arm (cortex-a53)
 
 include kernel/project/virtual/test.mk
diff --git a/kernel/project/magenta-rpi3-arm64.mk b/kernel/project/zircon-rpi3-arm64.mk
similarity index 100%
rename from kernel/project/magenta-rpi3-arm64.mk
rename to kernel/project/zircon-rpi3-arm64.mk
diff --git a/kernel/target/hikey960/hikey960.mdi b/kernel/target/hikey960/hikey960.mdi
index 476fafe..925cf96 100644
--- a/kernel/target/hikey960/hikey960.mdi
+++ b/kernel/target/hikey960/hikey960.mdi
@@ -1,4 +1,4 @@
-include "system/public/magenta/mdi/magenta.mdi"
+include "system/public/zircon/mdi/zircon.mdi"
 
 const PAGE_SIZE = 4096
 
diff --git a/kernel/target/init.c b/kernel/target/init.c
index 5261006..df47c0d 100644
--- a/kernel/target/init.c
+++ b/kernel/target/init.c
@@ -8,7 +8,7 @@
 #include <err.h>
 #include <debug.h>
 #include <target.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 /*
  * default implementations of these routines, if the target code
diff --git a/kernel/target/odroidc2/boot.ini b/kernel/target/odroidc2/boot.ini
index db40669..118f5a8 100644
--- a/kernel/target/odroidc2/boot.ini
+++ b/kernel/target/odroidc2/boot.ini
@@ -24,7 +24,7 @@
 fdt resize
 fatload mmc 0 ${ramdisk_start} bootdata.bin
 fdt chosen ${ramdisk_start} ${ramdisk_end}
-fatload mmc 0 ${kern_load} magenta.bin
+fatload mmc 0 ${kern_load} zircon.bin
 
 fdt print
 
diff --git a/kernel/target/odroidc2/odroidc2.mdi b/kernel/target/odroidc2/odroidc2.mdi
index b54a8f8..7fa73af 100644
--- a/kernel/target/odroidc2/odroidc2.mdi
+++ b/kernel/target/odroidc2/odroidc2.mdi
@@ -1,4 +1,4 @@
-include "system/public/magenta/mdi/magenta.mdi"
+include "system/public/zircon/mdi/zircon.mdi"
 
 cpu-map = {
     clusters = {
diff --git a/kernel/target/qemu-virt/qemu.mdi b/kernel/target/qemu-virt/qemu.mdi
index 5b618ac..0896338 100644
--- a/kernel/target/qemu-virt/qemu.mdi
+++ b/kernel/target/qemu-virt/qemu.mdi
@@ -1,4 +1,4 @@
-include "system/public/magenta/mdi/magenta.mdi"
+include "system/public/zircon/mdi/zircon.mdi"
 
 cpu-map = {
     clusters = {
diff --git a/kernel/target/rpi3/rpi3.mdi b/kernel/target/rpi3/rpi3.mdi
index fb1d34e..609455e 100644
--- a/kernel/target/rpi3/rpi3.mdi
+++ b/kernel/target/rpi3/rpi3.mdi
@@ -1,4 +1,4 @@
-include "system/public/magenta/mdi/magenta.mdi"
+include "system/public/zircon/mdi/zircon.mdi"
 
 cpu-map = {
     clusters = {
diff --git a/kernel/top/init.c b/kernel/top/init.c
index 8505408..62d453c 100644
--- a/kernel/top/init.c
+++ b/kernel/top/init.c
@@ -15,7 +15,7 @@
 #include <lk/init.h>
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 #include <trace.h>
 
diff --git a/kernel/top/main.c b/kernel/top/main.c
index 9816fc1..d979226 100644
--- a/kernel/top/main.c
+++ b/kernel/top/main.c
@@ -10,7 +10,7 @@
  * Main entry point to the OS. Initializes modules in order and creates
  * the default thread.
  */
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <debug.h>
 #include <string.h>
 #include <app.h>
diff --git a/kernel/vm/include/vm/fault.h b/kernel/vm/include/vm/fault.h
index 4327215..6f02cd5 100644
--- a/kernel/vm/include/vm/fault.h
+++ b/kernel/vm/include/vm/fault.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 // page fault flags
 const uint VMM_PF_FLAG_WRITE = (1u << 0);
diff --git a/kernel/vm/include/vm/initial_map.h b/kernel/vm/include/vm/initial_map.h
index 2dfef9b..f148a38 100644
--- a/kernel/vm/include/vm/initial_map.h
+++ b/kernel/vm/include/vm/initial_map.h
@@ -26,7 +26,7 @@
 // this file can be included from assembly to get to the defines above
 #ifndef ASSEMBLY
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 
 struct mmu_initial_mapping {
diff --git a/kernel/vm/include/vm/page.h b/kernel/vm/include/vm/page.h
index 279d4f1..50b3133 100644
--- a/kernel/vm/include/vm/page.h
+++ b/kernel/vm/include/vm/page.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <list.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 // forward declare
diff --git a/kernel/vm/include/vm/pmm.h b/kernel/vm/include/vm/pmm.h
index f533c64..226355b 100644
--- a/kernel/vm/include/vm/pmm.h
+++ b/kernel/vm/include/vm/pmm.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/types.h>
 #include <vm/page.h>
 
diff --git a/kernel/vm/include/vm/vm_address_region.h b/kernel/vm/include/vm/vm_address_region.h
index 0760231..b3755ee 100644
--- a/kernel/vm/include/vm/vm_address_region.h
+++ b/kernel/vm/include/vm/vm_address_region.h
@@ -7,7 +7,7 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/thread_annotations.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/intrusive_wavl_tree.h>
@@ -94,7 +94,7 @@
     // If a VMO-mapping, unmap all pages and remove dependency on vm object it has a ref to.
     // Otherwise recursively destroy child VMARs and transition to the DEAD state.
     //
-    // Returns MX_OK on success, MX_ERR_BAD_STATE if already dead, and other
+    // Returns ZX_OK on success, ZX_ERR_BAD_STATE if already dead, and other
     // values on error (typically unmap failure).
     virtual status_t Destroy();
 
@@ -341,14 +341,14 @@
     status_t CreateSubVmar(size_t offset, size_t size, uint8_t align_pow2,
                            uint32_t vmar_flags, const char* name,
                            fbl::RefPtr<VmAddressRegion>* out) override {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     status_t CreateVmMapping(size_t mapping_offset, size_t size, uint8_t align_pow2,
                              uint32_t vmar_flags,
                              fbl::RefPtr<VmObject> vmo, uint64_t vmo_offset,
                              uint arch_mmu_flags, const char* name,
                              fbl::RefPtr<VmMapping>* out) override {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     fbl::RefPtr<VmAddressRegionOrMapping> FindRegion(vaddr_t addr) override {
@@ -356,11 +356,11 @@
     }
 
     status_t Protect(vaddr_t base, size_t size, uint new_arch_mmu_flags) override {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     status_t Unmap(vaddr_t base, size_t size) override {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     void Dump(uint depth, bool verbose) const override {
@@ -370,7 +370,7 @@
     status_t PageFault(vaddr_t va, uint pf_flags) override {
         // We should never be trying to page fault on this...
         ASSERT(false);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     size_t AllocatedPages() const override {
@@ -378,7 +378,7 @@
     }
 
     status_t Destroy() override {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     ~VmAddressRegionDummy() override {}
@@ -388,7 +388,7 @@
     }
 
     status_t DestroyLocked() override {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     void Activate() override {
diff --git a/kernel/vm/include/vm/vm_object.h b/kernel/vm/include/vm/vm_object.h
index ec5b716..032bc09 100644
--- a/kernel/vm/include/vm/vm_object.h
+++ b/kernel/vm/include/vm/vm_object.h
@@ -11,7 +11,7 @@
 #include <kernel/vm.h>
 #include <lib/user_copy/user_ptr.h>
 #include <list.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/thread_annotations.h>
 #include <fbl/array.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
@@ -35,8 +35,8 @@
                  public fbl::DoublyLinkedListable<VmObject*> {
 public:
     // public API
-    virtual status_t Resize(uint64_t size) { return MX_ERR_NOT_SUPPORTED; }
-    virtual status_t ResizeLocked(uint64_t size) TA_REQ(lock_) { return MX_ERR_NOT_SUPPORTED; }
+    virtual status_t Resize(uint64_t size) { return ZX_ERR_NOT_SUPPORTED; }
+    virtual status_t ResizeLocked(uint64_t size) TA_REQ(lock_) { return ZX_ERR_NOT_SUPPORTED; }
 
     virtual uint64_t size() const { return 0; }
 
@@ -56,24 +56,24 @@
 
     // find physical pages to back the range of the object
     virtual status_t CommitRange(uint64_t offset, uint64_t len, uint64_t* committed) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // find a contiguous run of physical pages to back the range of the object
     virtual status_t CommitRangeContiguous(uint64_t offset, uint64_t len, uint64_t* committed,
                                            uint8_t alignment_log2) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // free a range of the vmo back to the default state
     virtual status_t DecommitRange(uint64_t offset, uint64_t len, uint64_t* decommitted) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Pin the given range of the vmo.  If any pages are not committed, this
-    // returns a MX_ERR_NO_MEMORY.
+    // returns a ZX_ERR_NO_MEMORY.
     virtual status_t Pin(uint64_t offset, uint64_t len) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Unpin the given range of the vmo.  This asserts if it tries to unpin a
@@ -85,31 +85,31 @@
 
     // read/write operators against kernel pointers only
     virtual status_t Read(void* ptr, uint64_t offset, size_t len, size_t* bytes_read) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     virtual status_t Write(const void* ptr, uint64_t offset, size_t len, size_t* bytes_written) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // execute lookup_fn on a given range of physical addresses within the vmo
     virtual status_t Lookup(uint64_t offset, uint64_t len, uint pf_flags,
                             vmo_lookup_fn_t lookup_fn, void* context) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // read/write operators against user space pointers only
     virtual status_t ReadUser(user_ptr<void> ptr, uint64_t offset, size_t len, size_t* bytes_read) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     virtual status_t WriteUser(user_ptr<const void> ptr, uint64_t offset, size_t len,
                                size_t* bytes_written) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // translate a range of the vmo to physical addresses and store in the buffer
     virtual status_t LookupUser(uint64_t offset, uint64_t len, user_ptr<paddr_t> buffer,
                                 size_t buffer_size) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Returns a null-terminated name, or the empty string if set_name() has not
@@ -121,7 +121,7 @@
     status_t set_name(const char* name, size_t len);
 
     // Returns a user ID associated with this VMO, or zero.
-    // Typically used to hold a magenta koid for Dispatcher-wrapped VMOs.
+    // Typically used to hold a zircon koid for Dispatcher-wrapped VMOs.
     uint64_t user_id() const;
 
     // Returns the parent's user_id() if this VMO has a parent,
@@ -135,31 +135,31 @@
 
     // cache maintainence operations.
     virtual status_t InvalidateCache(const uint64_t offset, const uint64_t len) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     virtual status_t CleanCache(const uint64_t offset, const uint64_t len) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     virtual status_t CleanInvalidateCache(const uint64_t offset, const uint64_t len) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     virtual status_t SyncCache(const uint64_t offset, const uint64_t len) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     virtual status_t GetMappingCachePolicy(uint32_t* cache_policy) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     virtual status_t SetMappingCachePolicy(const uint32_t cache_policy) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // create a copy-on-write clone vmo at the page-aligned offset and length
     // note: it's okay to start or extend past the size of the parent
     virtual status_t CloneCOW(uint64_t offset, uint64_t size, bool copy_name,
                               fbl::RefPtr<VmObject>* clone_vmo) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Returns true if this VMO was created via CloneCOW().
@@ -171,7 +171,7 @@
     // valid flags are VMM_PF_FLAG_*
     virtual status_t GetPageLocked(uint64_t offset, uint pf_flags, list_node* free_list,
                                    vm_page_t** page, paddr_t* pa) TA_REQ(lock_) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     fbl::Mutex* lock() TA_RET_CAP(lock_) { return &lock_; }
@@ -201,11 +201,11 @@
         fbl::AutoLock a(&all_vmos_lock_);
         for (const auto& iter : all_vmos_) {
             status_t s = func(iter);
-            if (s != MX_OK) {
+            if (s != ZX_OK) {
                 return s;
             }
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
 protected:
@@ -258,7 +258,7 @@
 
     // The user-friendly VMO name. For debug purposes only. That
     // is, there is no mechanism to get access to a VMO via this name.
-    fbl::Name<MX_MAX_NAME_LEN> name_;
+    fbl::Name<ZX_MAX_NAME_LEN> name_;
 
 private:
     // Per-node state for the global VMO list.
diff --git a/kernel/vm/include/vm/vm_object_paged.h b/kernel/vm/include/vm/vm_object_paged.h
index a1c785c..50e22bf 100644
--- a/kernel/vm/include/vm/vm_object_paged.h
+++ b/kernel/vm/include/vm/vm_object_paged.h
@@ -11,7 +11,7 @@
 #include <kernel/vm.h>
 #include <lib/user_copy/user_ptr.h>
 #include <list.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/thread_annotations.h>
 #include <fbl/array.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
diff --git a/kernel/vm/include/vm/vm_object_physical.h b/kernel/vm/include/vm/vm_object_physical.h
index 8ac891e..436940d 100644
--- a/kernel/vm/include/vm/vm_object_physical.h
+++ b/kernel/vm/include/vm/vm_object_physical.h
@@ -11,7 +11,7 @@
 #include <kernel/vm.h>
 #include <lib/user_copy/user_ptr.h>
 #include <list.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/thread_annotations.h>
 #include <fbl/array.h>
 #include <fbl/canary.h>
 #include <fbl/intrusive_double_list.h>
diff --git a/kernel/vm/include/vm/vm_page_list.h b/kernel/vm/include/vm/vm_page_list.h
index f5778ab..12be73a 100644
--- a/kernel/vm/include/vm/vm_page_list.h
+++ b/kernel/vm/include/vm/vm_page_list.h
@@ -38,7 +38,7 @@
             start = (start_offset - obj_offset_) / PAGE_SIZE;
         }
         if (end_offset < obj_offset_) {
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         }
         if (end_offset < obj_offset_ + kPageFanOut * PAGE_SIZE) {
             end = (end_offset - obj_offset_) / PAGE_SIZE;
@@ -46,12 +46,12 @@
         for (size_t i = start; i < end; i++) {
             if (pages_[i]) {
                 status_t status = func(pages_[i], obj_offset_ + i * PAGE_SIZE);
-                if (unlikely(status != MX_ERR_NEXT)) {
+                if (unlikely(status != ZX_ERR_NEXT)) {
                     return status;
                 }
             }
         }
-        return MX_ERR_NEXT;
+        return ZX_ERR_NEXT;
     }
 
     // for every valid page in the node call the passed in function
@@ -64,7 +64,7 @@
             start = (start_offset - obj_offset_) / PAGE_SIZE;
         }
         if (end_offset < obj_offset_) {
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         }
         if (end_offset < obj_offset_ + kPageFanOut * PAGE_SIZE) {
             end = (end_offset - obj_offset_) / PAGE_SIZE;
@@ -72,12 +72,12 @@
         for (size_t i = start; i < end; i++) {
             if (pages_[i]) {
                 status_t status = func(pages_[i], obj_offset_ + i * PAGE_SIZE);
-                if (unlikely(status != MX_ERR_NEXT)) {
+                if (unlikely(status != ZX_ERR_NEXT)) {
                     return status;
                 }
             }
         }
-        return MX_ERR_NEXT;
+        return ZX_ERR_NEXT;
     }
 
     vm_page* GetPage(size_t index);
@@ -112,14 +112,14 @@
         for (auto& pl : list_) {
             status_t status = pl.ForEveryPage(per_page_func, pl.offset(),
                                               pl.offset() + pl.kPageFanOut * PAGE_SIZE);
-            if (unlikely(status != MX_ERR_NEXT)) {
-                if (status == MX_ERR_STOP) {
+            if (unlikely(status != ZX_ERR_NEXT)) {
+                if (status == ZX_ERR_STOP) {
                     break;
                 }
                 return status;
             }
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
     // walk the page tree, calling the passed in function on every tree node
@@ -128,14 +128,14 @@
         for (auto& pl : list_) {
             status_t status = pl.ForEveryPage(per_page_func, pl.offset(),
                                               pl.offset() + pl.kPageFanOut * PAGE_SIZE);
-            if (unlikely(status != MX_ERR_NEXT)) {
-                if (status == MX_ERR_STOP) {
+            if (unlikely(status != ZX_ERR_NEXT)) {
+                if (status == ZX_ERR_STOP) {
                     break;
                 }
                 return status;
             }
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
     // walk the page tree, calling the passed in function on every tree node
@@ -152,14 +152,14 @@
         for (auto itr = start; itr != end; ++itr) {
             auto& pl = *itr;
             status_t status = pl.ForEveryPage(per_page_func, start_offset, end_offset);
-            if (unlikely(status != MX_ERR_NEXT)) {
-                if (status == MX_ERR_STOP) {
+            if (unlikely(status != ZX_ERR_NEXT)) {
+                if (status == ZX_ERR_STOP) {
                     break;
                 }
                 return status;
             }
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
     template <typename T>
@@ -176,14 +176,14 @@
         for (auto itr = start; itr != end; ++itr) {
             auto& pl = *itr;
             status_t status = pl.ForEveryPage(per_page_func, start_offset, end_offset);
-            if (unlikely(status != MX_ERR_NEXT)) {
-                if (status == MX_ERR_STOP) {
+            if (unlikely(status != ZX_ERR_NEXT)) {
+                if (status == ZX_ERR_STOP) {
                     break;
                 }
                 return status;
             }
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
     status_t AddPage(vm_page*, uint64_t offset);
diff --git a/kernel/vm/page.cpp b/kernel/vm/page.cpp
index 83c1624..aba9907 100644
--- a/kernel/vm/page.cpp
+++ b/kernel/vm/page.cpp
@@ -46,7 +46,7 @@
         printf("usage:\n");
         printf("%s dump <address>\n", argv[0].str);
         printf("%s hexdump <address>\n", argv[0].str);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     if (!strcmp(argv[1].str, "dump")) {
@@ -74,7 +74,7 @@
         goto usage;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 STATIC_COMMAND_START
diff --git a/kernel/vm/pmm.cpp b/kernel/vm/pmm.cpp
index 3f5ce44..404f493 100644
--- a/kernel/vm/pmm.cpp
+++ b/kernel/vm/pmm.cpp
@@ -25,8 +25,8 @@
 #include "pmm_arena.h"
 #include "vm_priv.h"
 
-#include <magenta/thread_annotations.h>
-#include <mxcpp/new.h>
+#include <zircon/thread_annotations.h>
+#include <zxcpp/new.h>
 #include <fbl/auto_lock.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/mutex.h>
@@ -107,7 +107,7 @@
 
     arena_cumulative_size += info->size;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 vm_page_t* pmm_alloc_page(uint alloc_flags, paddr_t* pa) {
@@ -402,7 +402,7 @@
             printf("%s free_alloced\n", argv[0].str);
             printf("%s free\n", argv[0].str);
         }
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     static struct list_node allocated = LIST_INITIAL_VALUE(allocated);
@@ -515,7 +515,7 @@
         goto usage;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 STATIC_COMMAND_START
diff --git a/kernel/vm/pmm_arena.cpp b/kernel/vm/pmm_arena.cpp
index 8b8d2f0..d59a9d0 100644
--- a/kernel/vm/pmm_arena.cpp
+++ b/kernel/vm/pmm_arena.cpp
@@ -218,7 +218,7 @@
 status_t PmmArena::FreePage(vm_page_t* page) {
     LTRACEF("page %p\n", page);
     if (!page_belongs_to_arena(page))
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     DEBUG_ASSERT(page->state != VM_PAGE_STATE_OBJECT || page->object.pin_count == 0);
 
@@ -230,7 +230,7 @@
 
     list_add_head(&free_list_, &page->free.node);
     free_count_++;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void PmmArena::CountStates(size_t state_count[_VM_PAGE_STATE_COUNT]) const {
diff --git a/kernel/vm/vm.cpp b/kernel/vm/vm.cpp
index af3daea..549d105 100644
--- a/kernel/vm/vm.cpp
+++ b/kernel/vm/vm.cpp
@@ -97,11 +97,11 @@
 status_t ProtectRegion(VmAspace* aspace, vaddr_t va, uint arch_mmu_flags) {
     auto r = aspace->FindRegion(va);
     if (!r)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     auto vm_mapping = r->as_vm_mapping();
     if (!vm_mapping)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     return vm_mapping->Protect(vm_mapping->base(), vm_mapping->size(), arch_mmu_flags);
 }
@@ -199,9 +199,9 @@
                 region->base, region->base + region->size, region->arch_mmu_flags, region->name);
 
         status_t status = aspace->ReserveSpace(region->name, region->size, region->base);
-        ASSERT(status == MX_OK);
+        ASSERT(status == ZX_OK);
         status = ProtectRegion(aspace, region->base, region->arch_mmu_flags);
-        ASSERT(status == MX_OK);
+        ASSERT(status == ZX_OK);
     }
 
     // mmu_initial_mappings should reflect where we are now, use it to construct the actual
@@ -235,17 +235,17 @@
             // a mapping between it and the next closest one.
             if (next_kernel_region != vaddr) {
                 status_t status = aspace->ReserveSpace(map->name, next_kernel_region - vaddr, vaddr);
-                ASSERT(status == MX_OK);
+                ASSERT(status == ZX_OK);
 
                 if (map->flags & MMU_INITIAL_MAPPING_TEMPORARY) {
                     // If the region is part of a temporary mapping, immediately unmap it
                     dprintf(INFO, "VM: freeing region [%016" PRIxPTR ", %016" PRIxPTR ")\n", vaddr, next_kernel_region);
                     status = aspace->FreeRegion(vaddr);
-                    ASSERT(status == MX_OK);
+                    ASSERT(status == ZX_OK);
                 } else {
                     // Otherwise, mark it no-exec since it's not explicitly code
                     status = ProtectRegion(aspace, vaddr, ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE);
-                    ASSERT(status == MX_OK);
+                    ASSERT(status == ZX_OK);
                 }
             }
             vaddr = next_kernel_region_end;
@@ -263,7 +263,7 @@
     vaddr_t end_first_mapping = first_mapping->virt + first_mapping->size;
 
     status_t status = aspace->ReserveSpace("random_padding", random_size, end_first_mapping);
-    ASSERT(status == MX_OK);
+    ASSERT(status == ZX_OK);
     LTRACEF("VM: aspace random padding size: %#" PRIxPTR "\n", random_size);
 }
 
@@ -303,7 +303,7 @@
         printf("%s virt2phys <address>\n", argv[0].str);
         printf("%s map <phys> <virt> <count> <flags>\n", argv[0].str);
         printf("%s unmap <virt> <count>\n", argv[0].str);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     if (!strcmp(argv[1].str, "phys2virt")) {
@@ -361,7 +361,7 @@
         goto usage;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 STATIC_COMMAND_START
diff --git a/kernel/vm/vm_address_region.cpp b/kernel/vm/vm_address_region.cpp
index 4c4040c..df0b245 100644
--- a/kernel/vm/vm_address_region.cpp
+++ b/kernel/vm/vm_address_region.cpp
@@ -69,12 +69,12 @@
     fbl::AllocChecker ac;
     auto vmar = new (&ac) VmAddressRegion(aspace, aspace.base(), aspace.size(), vmar_flags);
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     vmar->state_ = LifeCycleState::ALIVE;
     *out = fbl::AdoptRef(vmar);
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmAddressRegion::CreateSubVmarInternal(size_t offset, size_t size, uint8_t align_pow2,
@@ -86,34 +86,34 @@
 
     AutoLock guard(aspace_->lock());
     if (state_ != LifeCycleState::ALIVE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (size == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Check if there are any RWX privileges that the child would have that the
     // parent does not.
     if (vmar_flags & ~flags_ & VMAR_CAN_RWX_FLAGS) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     bool is_specific_overwrite = static_cast<bool>(vmar_flags & VMAR_FLAG_SPECIFIC_OVERWRITE);
     bool is_specific = static_cast<bool>(vmar_flags & VMAR_FLAG_SPECIFIC) || is_specific_overwrite;
     if (!is_specific && offset != 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Check to see if a cache policy exists if a VMO is passed in. VMOs that are not physical
-    // return ERR_UNSUPPORTED, anything aside from that and MX_OK is an error.
+    // return ERR_UNSUPPORTED, anything aside from that and ZX_OK is an error.
     // TODO(cja): explore whether it makes sense to add a default PAGED value to VmObjectPaged
     // and allow them to be treated the same, since by default we're mapping those objects that
     // way anyway.
     if (vmo) {
         uint32_t cache_policy;
         status_t status = vmo->GetMappingCachePolicy(&cache_policy);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             // Warn in the event that we somehow receive a VMO that has a cache
             // policy set while also holding cache policy flags within the arch
             // flags. The only path that should be able to achieve this is if
@@ -124,40 +124,40 @@
                        name, cache_policy, arch_mmu_flags & ARCH_MMU_FLAG_CACHE_MASK);
             }
             arch_mmu_flags |= cache_policy;
-        } else if (status != MX_ERR_NOT_SUPPORTED) {
-            return MX_ERR_INVALID_ARGS;
+        } else if (status != ZX_ERR_NOT_SUPPORTED) {
+            return ZX_ERR_INVALID_ARGS;
         }
     }
 
     // Check that we have the required privileges if we want a SPECIFIC mapping
     if (is_specific && !(flags_ & VMAR_FLAG_CAN_MAP_SPECIFIC)) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     if (offset >= size_ || size > size_ - offset) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     vaddr_t new_base = -1;
     if (is_specific) {
         new_base = base_ + offset;
         if (!IS_PAGE_ALIGNED(new_base)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (align_pow2 > 0 && (new_base & ((1ULL << align_pow2) - 1))) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (!IsRangeAvailableLocked(new_base, size)) {
             if (is_specific_overwrite) {
                 return OverwriteVmMapping(new_base, size, vmar_flags,
                                           vmo, vmo_offset, arch_mmu_flags, out);
             }
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
     } else {
         // If we're not mapping to a specific place, search for an opening.
         status_t status = AllocSpotLocked(size, align_pow2, arch_mmu_flags, &new_base);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
     }
@@ -182,7 +182,7 @@
     }
 
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
 #if WITH_LIB_VDSO
@@ -191,7 +191,7 @@
         // and only for the valid range of the image.
         if (aspace_->vdso_code_mapping_ ||
             !VDso::valid_code_mapping(vmo_offset, size)) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
         aspace_->vdso_code_mapping_ = fbl::RefPtr<VmMapping>::Downcast(vmar);
     }
@@ -199,7 +199,7 @@
 
     vmar->Activate();
     *out = fbl::move(vmar);
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmAddressRegion::CreateSubVmar(size_t offset, size_t size, uint8_t align_pow2,
@@ -208,23 +208,23 @@
     DEBUG_ASSERT(out);
 
     if (!IS_PAGE_ALIGNED(size)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Check that only allowed flags have been set
     if (vmar_flags & ~(VMAR_FLAG_SPECIFIC | VMAR_FLAG_CAN_MAP_SPECIFIC | VMAR_FLAG_COMPACT | VMAR_CAN_RWX_FLAGS)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     fbl::RefPtr<VmAddressRegionOrMapping> res;
     status_t status = CreateSubVmarInternal(offset, size, align_pow2, vmar_flags, nullptr, 0,
                                             ARCH_MMU_FLAG_INVALID, name, &res);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     // TODO(teisenbe): optimize this
     *out = res->as_vm_address_region();
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmAddressRegion::CreateVmMapping(size_t mapping_offset, size_t size, uint8_t align_pow2,
@@ -236,12 +236,12 @@
 
     // Check that only allowed flags have been set
     if (vmar_flags & ~(VMAR_FLAG_SPECIFIC | VMAR_FLAG_SPECIFIC_OVERWRITE | VMAR_CAN_RWX_FLAGS)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Validate that arch_mmu_flags does not contain any prohibited flags
     if (!is_valid_mapping_flags(arch_mmu_flags)) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     // If size overflows, it'll become 0 and get rejected in
@@ -251,7 +251,7 @@
     // Make sure that vmo_offset is aligned and that a mapping of this size
     // wouldn't overflow the vmo offset.
     if (!IS_PAGE_ALIGNED(vmo_offset) || vmo_offset + size < vmo_offset) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // If we're mapping it with a specific permission, we should allow
@@ -270,12 +270,12 @@
     status_t status =
         CreateSubVmarInternal(mapping_offset, size, align_pow2, vmar_flags, fbl::move(vmo),
                               vmo_offset, arch_mmu_flags, name, &res);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     // TODO(teisenbe): optimize this
     *out = res->as_vm_mapping();
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmAddressRegion::OverwriteVmMapping(
@@ -294,17 +294,17 @@
                               VmMapping(*this, base, size, vmar_flags,
                                         fbl::move(vmo), vmo_offset, arch_mmu_flags));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     status_t status = UnmapInternalLocked(base, size, false /* can_destroy_regions */);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     vmar->Activate();
     *out = fbl::move(vmar);
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmAddressRegion::DestroyLocked() {
@@ -322,7 +322,7 @@
 
         // DestroyLocked should remove this child from our list on success
         status_t status = child->DestroyLocked();
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             // TODO(teisenbe): Do we want to handle this case differently?
             return status;
         }
@@ -336,7 +336,7 @@
 
     parent_ = nullptr;
     state_ = LifeCycleState::DEAD;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void VmAddressRegion::RemoveSubregion(VmAddressRegionOrMapping* region) {
@@ -390,7 +390,7 @@
             return next->PageFault(va, pf_flags);
     }
 
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
 bool VmAddressRegion::IsRangeAvailableLocked(vaddr_t base, size_t size) {
@@ -579,12 +579,12 @@
 
     size = ROUNDUP(size, PAGE_SIZE);
     if (size == 0 || !IS_PAGE_ALIGNED(base)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     AutoLock guard(aspace_->lock());
     if (state_ != LifeCycleState::ALIVE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     return UnmapInternalLocked(base, size, true /* can_destroy_regions */);
@@ -594,11 +594,11 @@
     DEBUG_ASSERT(is_mutex_held(aspace_->lock()));
 
     if (!is_in_range(base, size)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (subregions_.is_empty()) {
-        return MX_OK;
+        return ZX_OK;
     }
 
 #if WITH_LIB_VDSO
@@ -606,7 +606,7 @@
     if (aspace_->vdso_code_mapping_ &&
         aspace_->vdso_code_mapping_->base() >= base &&
         aspace_->vdso_code_mapping_->base() - base < size) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 #endif
 
@@ -629,7 +629,7 @@
         const vaddr_t itr_end = itr->base() + itr->size();
         if (!itr->is_mapping() && (!can_destroy_regions ||
                                    itr->base() < base || itr_end > end_addr)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     }
 
@@ -646,7 +646,7 @@
             // If we're unmapping the entire region, just call Destroy
             if (unmap_base == curr->base() && unmap_size == curr->size()) {
                 __UNUSED status_t status = curr->as_vm_mapping()->DestroyLocked();
-                DEBUG_ASSERT(status == MX_OK);
+                DEBUG_ASSERT(status == ZX_OK);
                 continue;
             }
 
@@ -658,18 +658,18 @@
             // fail.  We need to rework the system so that is no longer
             // possible.
             status_t status = curr->as_vm_mapping()->UnmapLocked(unmap_base, unmap_size);
-            DEBUG_ASSERT(status == MX_OK || curr == begin);
-            if (status != MX_OK) {
+            DEBUG_ASSERT(status == ZX_OK || curr == begin);
+            if (status != ZX_OK) {
                 return status;
             }
         } else {
             DEBUG_ASSERT(curr->base() >= base && curr_end <= end_addr);
             __UNUSED status_t status = curr->DestroyLocked();
-            DEBUG_ASSERT(status == MX_OK);
+            DEBUG_ASSERT(status == ZX_OK);
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmAddressRegion::Protect(vaddr_t base, size_t size, uint new_arch_mmu_flags) {
@@ -677,20 +677,20 @@
 
     size = ROUNDUP(size, PAGE_SIZE);
     if (size == 0 || !IS_PAGE_ALIGNED(base)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     AutoLock guard(aspace_->lock());
     if (state_ != LifeCycleState::ALIVE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (!is_in_range(base, size)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (subregions_.is_empty()) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     const vaddr_t end_addr = base + size;
@@ -701,7 +701,7 @@
     // that entry, bail since it's unmapped.
     auto begin = --subregions_.upper_bound(base);
     if (!begin.IsValid() || begin->base() + begin->size() <= base) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     // Check if we're overlapping a subregion, or a part of the range is not
@@ -709,24 +709,24 @@
     vaddr_t last_mapped = begin->base();
     for (auto itr = begin; itr != end; ++itr) {
         if (!itr->is_mapping()) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (itr->base() != last_mapped) {
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
         }
         if (!itr->is_valid_mapping_flags(new_arch_mmu_flags)) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
 #if WITH_LIB_VDSO
         if (itr->as_vm_mapping() == aspace_->vdso_code_mapping_) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
 #endif
 
         last_mapped = itr->base() + itr->size();
     }
     if (last_mapped < base + size) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     for (auto itr = begin; itr != end;) {
@@ -742,7 +742,7 @@
 
         status_t status = itr->as_vm_mapping()->ProtectLocked(protect_base, protect_size,
                                                               new_arch_mmu_flags);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             // TODO(teisenbe): Try to work out a way to guarantee success, or
             // provide a full unwind?
             return status;
@@ -751,7 +751,7 @@
         itr = fbl::move(next);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmAddressRegion::LinearRegionAllocatorLocked(size_t size, uint8_t align_pow2,
@@ -772,9 +772,9 @@
     do {
         if (CheckGapLocked(before_iter, after_iter, spot, base, align, size, 0, arch_mmu_flags)) {
             if (*spot != static_cast<vaddr_t>(-1)) {
-                return MX_OK;
+                return ZX_OK;
             } else {
-                return MX_ERR_NO_MEMORY;
+                return ZX_ERR_NO_MEMORY;
             }
         }
 
@@ -782,7 +782,7 @@
     } while (before_iter.IsValid());
 
     // couldn't find anything
-    return MX_ERR_NO_MEMORY;
+    return ZX_ERR_NO_MEMORY;
 }
 
 template <typename F>
@@ -846,7 +846,7 @@
                align_pow2);
 
     if (candidate_spaces == 0) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // Choose the index of the allocation to use.
@@ -888,7 +888,7 @@
     if (CheckGapLocked(before_iter, after_iter, spot, alloc_spot, align, size, 0,
                        arch_mmu_flags) &&
         *spot != static_cast<vaddr_t>(-1)) {
-        return MX_OK;
+        return ZX_OK;
     }
     panic("Unexpected allocation failure\n");
 }
@@ -956,10 +956,10 @@
             if (CheckGapLocked(before_iter, after_iter, spot, chosen_base, align, size, 0,
                                arch_mmu_flags) &&
                 *spot != static_cast<vaddr_t>(-1)) {
-                return MX_OK;
+                return ZX_OK;
             }
         }
     }
 
-    return MX_ERR_NO_MEMORY;
+    return ZX_ERR_NO_MEMORY;
 }
diff --git a/kernel/vm/vm_address_region_or_mapping.cpp b/kernel/vm/vm_address_region_or_mapping.cpp
index cbf26d8..00d977c 100644
--- a/kernel/vm/vm_address_region_or_mapping.cpp
+++ b/kernel/vm/vm_address_region_or_mapping.cpp
@@ -34,7 +34,7 @@
 
     AutoLock guard(aspace_->lock());
     if (state_ != LifeCycleState::ALIVE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     return DestroyLocked();
diff --git a/kernel/vm/vm_aspace.cpp b/kernel/vm/vm_aspace.cpp
index d1618df..3f431cd 100644
--- a/kernel/vm/vm_aspace.cpp
+++ b/kernel/vm/vm_aspace.cpp
@@ -145,7 +145,7 @@
         (is_high_kernel ? ARCH_ASPACE_FLAG_KERNEL : 0u) |
         (is_guest ? ARCH_ASPACE_FLAG_GUEST_PASPACE : 0u);
     status_t status = arch_aspace_.Init(base_, size_, arch_aspace_flags);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -154,7 +154,7 @@
     if (likely(!root_vmar_)) {
         return VmAddressRegion::CreateRoot(*this, VMAR_FLAG_CAN_MAP_SPECIFIC, &root_vmar_);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 fbl::RefPtr<VmAspace> VmAspace::Create(uint32_t flags, const char* name) {
@@ -253,7 +253,7 @@
     // tear down and free all of the regions in our address space
     if (root_vmar_) {
         status_t status = root_vmar_->DestroyLocked();
-        if (status != MX_OK && status != MX_ERR_BAD_STATE) {
+        if (status != ZX_OK && status != ZX_ERR_BAD_STATE) {
             return status;
         }
     }
@@ -262,7 +262,7 @@
     // Break the reference cycle between this aspace and the root VMAR
     root_vmar_.reset(dummy_root_vmar);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool VmAspace::is_destroyed() const {
@@ -283,24 +283,24 @@
 
     size = ROUNDUP(size, PAGE_SIZE);
     if (size == 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (!vmo)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (!IS_PAGE_ALIGNED(offset))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     vaddr_t vmar_offset = 0;
     // if they're asking for a specific spot or starting address, copy the address
     if (vmm_flags & VMM_FLAG_VALLOC_SPECIFIC) {
         // can't ask for a specific spot and then not provide one
         if (!ptr) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         vmar_offset = reinterpret_cast<vaddr_t>(*ptr);
 
         // check that it's page aligned
         if (!IS_PAGE_ALIGNED(vmar_offset) || vmar_offset < base_)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
 
         vmar_offset -= base_;
     }
@@ -320,7 +320,7 @@
     status_t status = RootVmar()->CreateVmMapping(vmar_offset, size, align_pow2,
                                                   vmar_flags,
                                                   vmo, offset, arch_mmu_flags, name, &r);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -335,7 +335,7 @@
     if (ptr)
         *ptr = (void*)r->base();
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmAspace::ReserveSpace(const char* name, size_t size, vaddr_t vaddr) {
@@ -347,11 +347,11 @@
 
     size = ROUNDUP_PAGE_SIZE(size);
     if (size == 0)
-        return MX_OK;
+        return ZX_OK;
     if (!IS_PAGE_ALIGNED(vaddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (!is_inside(*this, vaddr))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // trim the size
     size = trim_to_aspace(*this, vaddr, size);
@@ -359,8 +359,8 @@
     // allocate a zero length vm object to back it
     // TODO: decide if a null vmo object is worth it
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0, &vmo);
+    if (status != ZX_OK)
         return status;
 
     // lookup how it's already mapped
@@ -386,16 +386,16 @@
     DEBUG_ASSERT(IS_PAGE_ALIGNED(paddr));
 
     if (size == 0)
-        return MX_OK;
+        return ZX_OK;
     if (!IS_PAGE_ALIGNED(paddr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     size = ROUNDUP_PAGE_SIZE(size);
 
     // create a vm object to back it
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPhysical::Create(paddr, size, &vmo);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // force it to be mapped up front
@@ -403,8 +403,8 @@
     vmm_flags |= VMM_FLAG_COMMIT;
 
     // Apply the cache policy
-    if (vmo->SetMappingCachePolicy(arch_mmu_flags & ARCH_MMU_FLAG_CACHE_MASK) != MX_OK)
-        return MX_ERR_INVALID_ARGS;
+    if (vmo->SetMappingCachePolicy(arch_mmu_flags & ARCH_MMU_FLAG_CACHE_MASK) != ZX_OK)
+        return ZX_ERR_INVALID_ARGS;
 
     arch_mmu_flags &= ~ARCH_MMU_FLAG_CACHE_MASK;
     return MapObjectInternal(fbl::move(vmo), name, 0, size, ptr, align_pow2, vmm_flags,
@@ -419,16 +419,16 @@
 
     size = ROUNDUP(size, PAGE_SIZE);
     if (size == 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // test for invalid flags
     if (!(vmm_flags & VMM_FLAG_COMMIT))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // create a vm object to back it
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, size, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, size, &vmo);
+    if (status != ZX_OK)
         return status;
 
     // always immediately commit memory to the object
@@ -439,7 +439,7 @@
     if (static_cast<size_t>(committed) < size) {
         LTRACEF("failed to allocate enough pages (asked for %zu, got %zu)\n", size / PAGE_SIZE,
                 static_cast<size_t>(committed) / PAGE_SIZE);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     return MapObjectInternal(fbl::move(vmo), name, 0, size, ptr, align_pow2, vmm_flags,
@@ -454,12 +454,12 @@
 
     size = ROUNDUP(size, PAGE_SIZE);
     if (size == 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // allocate a vm object to back it
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, size, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, size, &vmo);
+    if (status != ZX_OK)
         return status;
 
     // commit memory up front if requested
@@ -472,7 +472,7 @@
         if (static_cast<size_t>(committed) < size) {
             LTRACEF("failed to allocate enough pages (asked for %zu, got %zu)\n", size / PAGE_SIZE,
                     static_cast<size_t>(committed) / PAGE_SIZE);
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
     }
 
@@ -486,7 +486,7 @@
 
     fbl::RefPtr<VmAddressRegionOrMapping> r = RootVmar()->FindRegion(va);
     if (!r) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     return r->Destroy();
diff --git a/kernel/vm/vm_mapping.cpp b/kernel/vm/vm_mapping.cpp
index 874935a..ad078b8 100644
--- a/kernel/vm/vm_mapping.cpp
+++ b/kernel/vm/vm_mapping.cpp
@@ -76,18 +76,18 @@
     LTRACEF("%p %#" PRIxPTR " %#x %#x\n", this, base_, flags_, new_arch_mmu_flags);
 
     if (!IS_PAGE_ALIGNED(base)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     size = ROUNDUP(size, PAGE_SIZE);
 
     AutoLock guard(aspace_->lock());
     if (state_ != LifeCycleState::ALIVE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (size == 0 || !is_in_range(base, size)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     return ProtectLocked(base, size, new_arch_mmu_flags);
@@ -113,11 +113,11 @@
 
     // Do not allow changing caching
     if (new_arch_mmu_flags & ARCH_MMU_FLAG_CACHE_MASK) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (!is_valid_mapping_flags(new_arch_mmu_flags)) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     DEBUG_ASSERT(object_);
@@ -129,7 +129,7 @@
 
     // If we're not actually changing permissions, return fast.
     if (new_arch_mmu_flags == arch_mmu_flags_) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     // TODO(teisenbe): deal with error mapping on arch_mmu_protect fail
@@ -139,7 +139,7 @@
         status_t status = ProtectOrUnmap(aspace_, base, size, new_arch_mmu_flags);
         LTRACEF("arch_mmu_protect returns %d\n", status);
         arch_mmu_flags_ = new_arch_mmu_flags;
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Handle changing from the left
@@ -150,7 +150,7 @@
             new (&ac) VmMapping(*parent_, base + size, size_ - size, flags_,
                                 object_, object_offset_ + size, arch_mmu_flags_)));
         if (!ac.check()) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
 
         status_t status = ProtectOrUnmap(aspace_, base, size, new_arch_mmu_flags);
@@ -159,7 +159,7 @@
 
         size_ = size;
         mapping->ActivateLocked();
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Handle changing from the right
@@ -172,7 +172,7 @@
                                 object_, object_offset_ + base - base_,
                                 new_arch_mmu_flags)));
         if (!ac.check()) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
 
         status_t status = ProtectOrUnmap(aspace_, base, size, new_arch_mmu_flags);
@@ -180,7 +180,7 @@
 
         size_ -= size;
         mapping->ActivateLocked();
-        return MX_OK;
+        return ZX_OK;
     }
 
     // We're unmapping from the center, so we need to create two new mappings
@@ -194,13 +194,13 @@
         new (&ac) VmMapping(*parent_, base, size, flags_,
                             object_, center_vmo_offset, new_arch_mmu_flags)));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     fbl::RefPtr<VmMapping> right_mapping(fbl::AdoptRef(
         new (&ac) VmMapping(*parent_, base + size, right_size, flags_,
                             object_, right_vmo_offset, arch_mmu_flags_)));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     status_t status = ProtectOrUnmap(aspace_, base, size, new_arch_mmu_flags);
@@ -211,30 +211,30 @@
 
     center_mapping->ActivateLocked();
     right_mapping->ActivateLocked();
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmMapping::Unmap(vaddr_t base, size_t size) {
     LTRACEF("%p %#" PRIxPTR " %zu\n", this, base, size);
 
     if (!IS_PAGE_ALIGNED(base)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     size = ROUNDUP(size, PAGE_SIZE);
 
     fbl::RefPtr<VmAspace> aspace(aspace_);
     if (!aspace) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     AutoLock guard(aspace->lock());
     if (state_ != LifeCycleState::ALIVE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (size == 0 || !is_in_range(base, size)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // If we're unmapping everything, destroy this mapping
@@ -254,7 +254,7 @@
     DEBUG_ASSERT(parent_);
 
     if (state_ != LifeCycleState::ALIVE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // If our parent VMAR is DEAD, then we can only unmap everything.
@@ -284,7 +284,7 @@
         }
         size_ -= size;
 
-        return MX_OK;
+        return ZX_OK;
     }
 
     // We're unmapping from the center, so we need to split the mapping
@@ -299,7 +299,7 @@
         new (&ac) VmMapping(*parent_, new_base, new_size, flags_, object_, vmo_offset,
                             arch_mmu_flags_)));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // Unmap the middle segment
@@ -312,7 +312,7 @@
     // Turn us into the left half
     size_ = base - base_;
     mapping->ActivateLocked();
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmMapping::UnmapVmoRangeLocked(uint64_t offset, uint64_t len) const {
@@ -344,18 +344,18 @@
     // so that we don't do extra work.
     if (likely(currently_faulting_)) {
         LTRACEF("recursing to ourself, abort\n");
-        return MX_OK;
+        return ZX_OK;
     }
 
     if (len == 0)
-        return MX_OK;
+        return ZX_OK;
 
     // compute the intersection of the passed in vmo range and our mapping
     uint64_t offset_new;
     uint64_t len_new;
     if (!GetIntersect(object_offset_, static_cast<uint64_t>(size_), offset, len,
                       &offset_new, &len_new))
-        return MX_OK;
+        return ZX_OK;
 
     DEBUG_ASSERT(len_new > 0 && len_new <= SIZE_MAX);
     DEBUG_ASSERT(offset_new >= object_offset_);
@@ -379,7 +379,7 @@
     if (status < 0)
         return status;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmMapping::MapRange(size_t offset, size_t len, bool commit) {
@@ -387,19 +387,19 @@
 
     len = ROUNDUP(len, PAGE_SIZE);
     if (len == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     AutoLock guard(aspace_->lock());
     if (state_ != LifeCycleState::ALIVE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     LTRACEF("region %p, offset %#zx, size %#zx, commit %d\n", this, offset, len, commit);
 
     DEBUG_ASSERT(object_);
     if (!IS_PAGE_ALIGNED(offset) || !is_in_range(base_ + offset, len)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // precompute the flags we'll pass GetPageLocked
@@ -450,7 +450,7 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmMapping::DecommitRange(size_t offset, size_t len,
@@ -461,10 +461,10 @@
 
     AutoLock guard(aspace_->lock());
     if (state_ != LifeCycleState::ALIVE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (offset + len < offset || offset + len > size_) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     // VmObject::DecommitRange will typically call back into our instance's
     // VmMapping::UnmapVmoRangeLocked.
@@ -485,15 +485,15 @@
     // The vDSO code mapping can never be unmapped, not even
     // by VMAR destruction (except for process exit, of course).
     // TODO(mcgrathr): Turn this into a policy-driven process-fatal case
-    // at some point.  teisenbe@ wants to eventually make mx_vmar_destroy
+    // at some point.  teisenbe@ wants to eventually make zx_vmar_destroy
     // never fail.
     if (aspace_->vdso_code_mapping_ == self)
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
 #endif
 
     // unmap our entire range
     status_t status = UnmapLocked(base_, size_);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -518,7 +518,7 @@
     // mark ourself as dead
     parent_ = nullptr;
     state_ = LifeCycleState::DEAD;
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmMapping::PageFault(vaddr_t va, const uint pf_flags) {
@@ -539,22 +539,22 @@
     if ((pf_flags & VMM_PF_FLAG_USER) && !(arch_mmu_flags_ & ARCH_MMU_FLAG_PERM_USER)) {
         // user page fault on non user mapped region
         LTRACEF("permission failure: user fault on non user region\n");
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
     if ((pf_flags & VMM_PF_FLAG_WRITE) && !(arch_mmu_flags_ & ARCH_MMU_FLAG_PERM_WRITE)) {
         // write to a non-writeable region
         LTRACEF("permission failure: write fault on non-writable region\n");
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
     if (!(pf_flags & VMM_PF_FLAG_WRITE) && !(arch_mmu_flags_ & ARCH_MMU_FLAG_PERM_READ)) {
         // read to a non-readable region
         LTRACEF("permission failure: read fault on non-readable region\n");
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
     if ((pf_flags & VMM_PF_FLAG_INSTRUCTION) && !(arch_mmu_flags_ & ARCH_MMU_FLAG_PERM_EXECUTE)) {
         // instruction fetch from a no execute region
         LTRACEF("permission failure: execute fault on no execute region\n");
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     // grab the lock for the vmo
@@ -600,7 +600,7 @@
             // test that the page is already mapped with either the region's mmu flags
             // or the flags that we're about to try to switch it to, which may be read-only
             if (page_flags == arch_mmu_flags_ || page_flags == mmu_flags)
-                return MX_OK;
+                return ZX_OK;
 
             // assert that we're not accidentally marking the zero page writable
             DEBUG_ASSERT((pa != vm_get_zero_page_paddr()) || !(mmu_flags & ARCH_MMU_FLAG_PERM_WRITE));
@@ -609,7 +609,7 @@
             status = aspace_->arch_aspace().Protect(va, 1, mmu_flags);
             if (status < 0) {
                 TRACEF("failed to modify permissions on existing mapping\n");
-                return MX_ERR_NO_MEMORY;
+                return ZX_ERR_NO_MEMORY;
             }
         } else {
             // some other page is mapped there already
@@ -624,18 +624,18 @@
             status = aspace_->arch_aspace().Unmap(va, 1, nullptr);
             if (status < 0) {
                 TRACEF("failed to remove old mapping before replacing\n");
-                return MX_ERR_NO_MEMORY;
+                return ZX_ERR_NO_MEMORY;
             }
 
             size_t mapped;
             status = aspace_->arch_aspace().Map(va, new_pa, 1, mmu_flags, &mapped);
             if (status < 0) {
                 TRACEF("failed to map replacement page\n");
-                return MX_ERR_NO_MEMORY;
+                return ZX_ERR_NO_MEMORY;
             }
             DEBUG_ASSERT(mapped == 1);
 
-            return MX_OK;
+            return ZX_OK;
         }
     } else {
         // nothing was mapped there before, map it now
@@ -649,7 +649,7 @@
         status = aspace_->arch_aspace().Map(va, new_pa, 1, mmu_flags, &mapped);
         if (status < 0) {
             TRACEF("failed to map page\n");
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         DEBUG_ASSERT(mapped == 1);
     }
@@ -659,7 +659,7 @@
     if (arch_mmu_flags_ & ARCH_MMU_FLAG_PERM_EXECUTE)
         arch_sync_cache_range(va, PAGE_SIZE);
 #endif
-    return MX_OK;
+    return ZX_OK;
 }
 
 // We disable thread safety analysis here because one of the common uses of this
diff --git a/kernel/vm/vm_object.cpp b/kernel/vm/vm_object.cpp
index d55383c..84eeebe 100644
--- a/kernel/vm/vm_object.cpp
+++ b/kernel/vm/vm_object.cpp
@@ -241,7 +241,7 @@
         printf("usage:\n");
         printf("%s dump <address>\n", argv[0].str);
         printf("%s dump_pages <address>\n", argv[0].str);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     if (!strcmp(argv[1].str, "dump")) {
@@ -263,7 +263,7 @@
         goto usage;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 STATIC_COMMAND_START
diff --git a/kernel/vm/vm_object_paged.cpp b/kernel/vm/vm_object_paged.cpp
index 5d0bda7..67ae504 100644
--- a/kernel/vm/vm_object_paged.cpp
+++ b/kernel/vm/vm_object_paged.cpp
@@ -66,30 +66,30 @@
                 p->object.pin_count--;
             }
             ASSERT(p->object.pin_count == 0);
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         });
 
     // free all of the pages attached to us
     page_list_.FreeAllPages();
 }
 
-mx_status_t VmObjectPaged::Create(uint32_t pmm_alloc_flags, uint64_t size, fbl::RefPtr<VmObject>* obj) {
+zx_status_t VmObjectPaged::Create(uint32_t pmm_alloc_flags, uint64_t size, fbl::RefPtr<VmObject>* obj) {
     // there's a max size to keep indexes within range
     if (size > MAX_SIZE)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::AllocChecker ac;
     auto vmo = fbl::AdoptRef<VmObject>(new (&ac) VmObjectPaged(pmm_alloc_flags, nullptr));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     auto err = vmo->Resize(size);
-    if (err != MX_OK)
+    if (err != ZX_OK)
         return err;
 
     *obj = fbl::move(vmo);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPaged::CloneCOW(uint64_t offset, uint64_t size, bool copy_name, fbl::RefPtr<VmObject>* clone_vmo) {
@@ -100,7 +100,7 @@
     fbl::AllocChecker ac;
     auto vmo = fbl::AdoptRef<VmObjectPaged>(new (&ac) VmObjectPaged(pmm_alloc_flags_, fbl::WrapRefPtr(this)));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     AutoLock a(&lock_);
 
@@ -109,12 +109,12 @@
 
     // set the new clone's size
     auto status = vmo->ResizeLocked(size);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // set the offset with the parent
     status = vmo->SetParentOffsetLocked(offset);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     if (copy_name)
@@ -122,7 +122,7 @@
 
     *clone_vmo = fbl::move(vmo);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void VmObjectPaged::Dump(uint depth, bool verbose) {
@@ -136,7 +136,7 @@
     size_t count = 0;
     page_list_.ForEveryPage([&count](const auto p, uint64_t) {
         count++;
-        return MX_ERR_NEXT;
+        return ZX_ERR_NEXT;
     });
 
     for (uint i = 0; i < depth; ++i) {
@@ -152,7 +152,7 @@
                 printf("  ");
             }
             printf("offset %#" PRIx64 " page %p paddr %#" PRIxPTR "\n", offset, p, vm_page_to_paddr(p));
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         };
         page_list_.ForEveryPage(f);
     }
@@ -173,7 +173,7 @@
             if (off >= offset && off < offset + new_len) {
                 count++;
             }
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         });
     return count;
 }
@@ -193,22 +193,22 @@
     DEBUG_ASSERT(p);
 
     if (offset >= size_)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     status_t err = page_list_.AddPage(p, offset);
-    if (err != MX_OK)
+    if (err != ZX_OK)
         return err;
 
     // other mappings may have covered this offset into the vmo, so unmap those ranges
     RangeChangeUpdateLocked(offset, PAGE_SIZE);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VmObjectPaged::CreateFromROData(const void* data, size_t size, fbl::RefPtr<VmObject>* obj) {
+zx_status_t VmObjectPaged::CreateFromROData(const void* data, size_t size, fbl::RefPtr<VmObject>* obj) {
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = Create(PMM_ALLOC_FLAG_ANY, size, &vmo);
-    if (status != MX_OK)
+    zx_status_t status = Create(PMM_ALLOC_FLAG_ANY, size, &vmo);
+    if (status != ZX_OK)
         return status;
 
     if (size > 0) {
@@ -257,7 +257,7 @@
 
     *obj = fbl::move(vmo);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Looks up the page at the requested offset, faulting it in if requested and necessary.  If
@@ -273,7 +273,7 @@
     DEBUG_ASSERT(lock_.IsHeld());
 
     if (offset >= size_)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     vm_page_t* p;
     paddr_t pa;
@@ -285,7 +285,7 @@
             *page_out = p;
         if (pa_out)
             *pa_out = vm_page_to_paddr(p);
-        return MX_OK;
+        return ZX_OK;
     }
 
     __UNUSED char pf_string[5];
@@ -303,7 +303,7 @@
 
         status_t status = parent_->GetPageLocked(parent_offset.ValueOrDie(), parent_pf_flags,
                                                  nullptr, &p, &pa);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             // we have a page from them. if we're read-only faulting, return that page so they can map
             // or read from it directly
             if ((pf_flags & VMM_PF_FLAG_WRITE) == 0) {
@@ -314,7 +314,7 @@
 
                 LTRACEF("read only faulting in page %p, pa %#" PRIxPTR " from parent\n", p, pa);
 
-                return MX_OK;
+                return ZX_OK;
             }
 
             // if we're write faulting, we need to clone it and return the new page
@@ -330,7 +330,7 @@
                 p_clone = pmm_alloc_page(pmm_alloc_flags_, &pa_clone);
             }
             if (!p_clone) {
-                return MX_ERR_NO_MEMORY;
+                return ZX_ERR_NO_MEMORY;
             }
 
             InitializeVmPage(p_clone);
@@ -345,7 +345,7 @@
 
             // add the new page and return it
             status = AddPageLocked(p_clone, offset);
-            DEBUG_ASSERT(status == MX_OK);
+            DEBUG_ASSERT(status == ZX_OK);
 
             LTRACEF("copy-on-write faulted in page %p, pa %#" PRIxPTR " copied from %p, pa %#" PRIxPTR "\n",
                     p, pa, p_clone, pa_clone);
@@ -355,13 +355,13 @@
             if (pa_out)
                 *pa_out = pa_clone;
 
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
     // if we're not being asked to sw or hw fault in the page, return not found
     if ((pf_flags & VMM_PF_FLAG_FAULT_MASK) == 0)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     // if we're read faulting, we don't already have a page, and the parent doesn't have it,
     // return the single global zero page
@@ -371,7 +371,7 @@
             *page_out = vm_get_zero_page();
         if (pa_out)
             *pa_out = vm_get_zero_page_paddr();
-        return MX_OK;
+        return ZX_OK;
     }
 
     // allocate a page
@@ -385,7 +385,7 @@
         p = pmm_alloc_page(pmm_alloc_flags_, &pa);
     }
     if (!p) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     InitializeVmPage(p);
@@ -394,7 +394,7 @@
     ZeroPage(pa);
 
     status_t status = AddPageLocked(p, offset);
-    DEBUG_ASSERT(status == MX_OK);
+    DEBUG_ASSERT(status == ZX_OK);
 
     // other mappings may have covered this offset into the vmo, so unmap those ranges
     RangeChangeUpdateLocked(offset, PAGE_SIZE);
@@ -406,7 +406,7 @@
     if (pa_out)
         *pa_out = pa;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPaged::CommitRange(uint64_t offset, uint64_t len, uint64_t* committed) {
@@ -421,11 +421,11 @@
     // trim the size
     uint64_t new_len;
     if (!TrimRange(offset, len, size_, &new_len))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // was in range, just zero length
     if (new_len == 0)
-        return MX_OK;
+        return ZX_OK;
 
     // compute a page aligned end to do our searches in to make sure we cover all the pages
     uint64_t end = ROUNDUP_PAGE_SIZE(offset + new_len);
@@ -440,7 +440,7 @@
 
             count += (off - expected_next_off) / PAGE_SIZE;
             expected_next_off = off + PAGE_SIZE;
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         },
         expected_next_off, end);
 
@@ -449,7 +449,7 @@
     DEBUG_ASSERT(end >= expected_next_off);
     count += (end - expected_next_off) / PAGE_SIZE;
     if (count == 0)
-        return MX_OK;
+        return ZX_OK;
 
     // allocate count number of pages
     list_node page_list;
@@ -459,7 +459,7 @@
     if (allocated < count) {
         LTRACEF("failed to allocate enough pages (asked for %zu, got %zu)\n", count, allocated);
         pmm_free(&page_list);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // unmap all of the pages in this range on all the mapping regions
@@ -479,7 +479,7 @@
         // Should not be able to fail, since we're providing it memory and the
         // range should be valid.
         status_t status = GetPageLocked(o, flags, &page_list, &p, &pa);
-        ASSERT(status == MX_OK);
+        ASSERT(status == ZX_OK);
 
         if (committed)
             *committed += PAGE_SIZE;
@@ -490,7 +490,7 @@
     // for now we only support committing as much as we were asked for
     DEBUG_ASSERT(!committed || *committed == count * PAGE_SIZE);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPaged::CommitRangeContiguous(uint64_t offset, uint64_t len, uint64_t* committed,
@@ -505,17 +505,17 @@
 
     // This function does not support cloned VMOs.
     if (unlikely(parent_)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // trim the size
     uint64_t new_len;
     if (!TrimRange(offset, len, size_, &new_len))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // was in range, just zero length
     if (new_len == 0)
-        return MX_OK;
+        return ZX_OK;
 
     // compute a page aligned end to do our searches in to make sure we cover all the pages
     uint64_t end = ROUNDUP_PAGE_SIZE(offset + new_len);
@@ -530,7 +530,7 @@
 
     DEBUG_ASSERT(count == new_len / PAGE_SIZE);
     if (count != new_len / PAGE_SIZE) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // allocate count number of pages
@@ -541,7 +541,7 @@
     if (allocated < count) {
         LTRACEF("failed to allocate enough pages (asked for %zu, got %zu)\n", count, allocated);
         pmm_free(&page_list);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     DEBUG_ASSERT(list_length(&page_list) == allocated);
@@ -560,7 +560,7 @@
         ZeroPage(p);
 
         auto status = page_list_.AddPage(p, o);
-        DEBUG_ASSERT(status == MX_OK);
+        DEBUG_ASSERT(status == ZX_OK);
 
         // Mark the pages as pinned, so they can't be physically rearranged
         // underneath us.
@@ -574,7 +574,7 @@
     // for now we only support committing as much as we were asked for
     DEBUG_ASSERT(!committed || *committed == count * PAGE_SIZE);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPaged::DecommitRange(uint64_t offset, uint64_t len, uint64_t* decommitted) {
@@ -589,11 +589,11 @@
     // trim the size
     uint64_t new_len;
     if (!TrimRange(offset, len, size_, &new_len))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // was in range, just zero length
     if (new_len == 0)
-        return MX_OK;
+        return ZX_OK;
 
     // figure the starting and ending page offset
     uint64_t start = ROUNDDOWN(offset, PAGE_SIZE);
@@ -609,7 +609,7 @@
     // CommitRangeContiguous
 
     if (AnyPagesPinnedLocked(start, page_aligned_len)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // unmap all of the pages in this range on all the mapping regions
@@ -618,13 +618,13 @@
     // iterate through the pages, freeing them
     while (start < end) {
         auto status = page_list_.FreePage(start);
-        if (status == MX_OK && decommitted) {
+        if (status == ZX_OK && decommitted) {
             *decommitted += PAGE_SIZE;
         }
         start += PAGE_SIZE;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPaged::Pin(uint64_t offset, uint64_t len) {
@@ -639,10 +639,10 @@
 
     // verify that the range is within the object
     if (unlikely(!InRange(offset, len, size_)))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     if (unlikely(len == 0))
-        return MX_OK;
+        return ZX_OK;
 
     const uint64_t start_page_offset = ROUNDDOWN(offset, PAGE_SIZE);
     const uint64_t end_page_offset = ROUNDUP(offset + len, PAGE_SIZE);
@@ -651,29 +651,29 @@
     status_t status = page_list_.ForEveryPageInRange(
         [&expected_next_off](const auto p, uint64_t off) {
             if (off != expected_next_off) {
-                return MX_ERR_NOT_FOUND;
+                return ZX_ERR_NOT_FOUND;
             }
 
             DEBUG_ASSERT(p->state == VM_PAGE_STATE_OBJECT);
             if (p->object.pin_count == VM_PAGE_OBJECT_MAX_PIN_COUNT) {
-                return MX_ERR_UNAVAILABLE;
+                return ZX_ERR_UNAVAILABLE;
             }
 
             p->object.pin_count++;
             expected_next_off = off + PAGE_SIZE;
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         },
         start_page_offset, end_page_offset);
 
-    if (status == MX_OK && expected_next_off != end_page_offset) {
-        status = MX_ERR_NOT_FOUND;
+    if (status == ZX_OK && expected_next_off != end_page_offset) {
+        status = ZX_ERR_NOT_FOUND;
     }
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         UnpinLocked(start_page_offset, expected_next_off - start_page_offset);
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void VmObjectPaged::Unpin(uint64_t offset, uint64_t len) {
@@ -698,17 +698,17 @@
     status_t status = page_list_.ForEveryPageInRange(
         [&expected_next_off](const auto p, uint64_t off) {
             if (off != expected_next_off) {
-                return MX_ERR_NOT_FOUND;
+                return ZX_ERR_NOT_FOUND;
             }
 
             DEBUG_ASSERT(p->state == VM_PAGE_STATE_OBJECT);
             ASSERT(p->object.pin_count > 0);
             p->object.pin_count--;
             expected_next_off = off + PAGE_SIZE;
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         },
         start_page_offset, end_page_offset);
-    ASSERT_MSG(status == MX_OK && expected_next_off == end_page_offset,
+    ASSERT_MSG(status == ZX_OK && expected_next_off == end_page_offset,
                "Tried to unpin an uncommitted page");
     return;
 }
@@ -728,9 +728,9 @@
             DEBUG_ASSERT(off >= start_page_offset && off < end_page_offset);
             if (p->object.pin_count > 0) {
                 found_pinned = true;
-                return MX_ERR_STOP;
+                return ZX_ERR_STOP;
             }
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         },
         start_page_offset, end_page_offset);
 
@@ -745,7 +745,7 @@
 
     // there's a max size to keep indexes within range
     if (s > MAX_SIZE)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // see if we're shrinking or expanding the vmo
     if (s < size_) {
@@ -758,7 +758,7 @@
         // we're only worried about whole pages to be removed
         if (page_aligned_len > 0) {
             if (AnyPagesPinnedLocked(start, page_aligned_len)) {
-                return MX_ERR_BAD_STATE;
+                return ZX_ERR_BAD_STATE;
             }
             // unmap all of the pages in this range on all the mapping regions
             RangeChangeUpdateLocked(start, page_aligned_len);
@@ -786,7 +786,7 @@
     // save bytewise size
     size_ = s;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPaged::Resize(uint64_t s) {
@@ -800,7 +800,7 @@
 
     // offset must be page aligned
     if (!IS_PAGE_ALIGNED(offset))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // TODO: MG-692 make sure that the accumulated offset of the entire parent chain doesn't wrap 64bit space
 
@@ -808,11 +808,11 @@
     safeint::CheckedNumeric<uint64_t> end = offset;
     end += size_;
     if (!end.IsValid())
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     parent_offset_ = offset;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // perform some sort of copy in/out on a range of the object using a passed in lambda
@@ -829,7 +829,7 @@
     // trim the size
     uint64_t new_len;
     if (!TrimRange(offset, len, size_, &new_len))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // was in range, just zero length
     if (new_len == 0)
@@ -865,7 +865,7 @@
         new_len -= tocopy;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPaged::Read(void* _ptr, uint64_t offset, size_t len, size_t* bytes_read) {
@@ -873,14 +873,14 @@
     // test to make sure this is a kernel pointer
     if (!is_kernel_address(reinterpret_cast<vaddr_t>(_ptr))) {
         DEBUG_ASSERT_MSG(0, "non kernel pointer passed\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // read routine that just uses a memcpy
     uint8_t* ptr = reinterpret_cast<uint8_t*>(_ptr);
     auto read_routine = [ptr](const void* src, size_t offset, size_t len) -> status_t {
         memcpy(ptr + offset, src, len);
-        return MX_OK;
+        return ZX_OK;
     };
 
     return ReadWriteInternal(offset, len, bytes_read, false, read_routine);
@@ -891,14 +891,14 @@
     // test to make sure this is a kernel pointer
     if (!is_kernel_address(reinterpret_cast<vaddr_t>(_ptr))) {
         DEBUG_ASSERT_MSG(0, "non kernel pointer passed\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // write routine that just uses a memcpy
     const uint8_t* ptr = reinterpret_cast<const uint8_t*>(_ptr);
     auto write_routine = [ptr](void* dst, size_t offset, size_t len) -> status_t {
         memcpy(dst, ptr + offset, len);
-        return MX_OK;
+        return ZX_OK;
     };
 
     return ReadWriteInternal(offset, len, bytes_written, true, write_routine);
@@ -908,13 +908,13 @@
                                vmo_lookup_fn_t lookup_fn, void* context) {
     canary_.Assert();
     if (unlikely(len == 0))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     AutoLock a(&lock_);
 
     // verify that the range is within the object
     if (unlikely(!InRange(offset, len, size_)))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     const uint64_t start_page_offset = ROUNDDOWN(offset, PAGE_SIZE);
     const uint64_t end_page_offset = ROUNDUP(offset + len, PAGE_SIZE);
@@ -932,14 +932,14 @@
                 paddr_t pa;
                 status_t status = this->GetPageLocked(missing_off, pf_flags, nullptr,
                                                       nullptr, &pa);
-                if (status != MX_OK) {
-                    return MX_ERR_NO_MEMORY;
+                if (status != ZX_OK) {
+                    return ZX_ERR_NO_MEMORY;
                 }
                 const size_t index = (off - start_page_offset) / PAGE_SIZE;
                 status = lookup_fn(context, missing_off, index, pa);
-                if (status != MX_OK) {
-                    if (unlikely(status == MX_ERR_NEXT || status == MX_ERR_STOP)) {
-                        status = MX_ERR_INTERNAL;
+                if (status != ZX_OK) {
+                    if (unlikely(status == ZX_ERR_NEXT || status == ZX_ERR_STOP)) {
+                        status = ZX_ERR_INTERNAL;
                     }
                     return status;
                 }
@@ -948,18 +948,18 @@
             const size_t index = (off - start_page_offset) / PAGE_SIZE;
             paddr_t pa = vm_page_to_paddr(p);
             status_t status = lookup_fn(context, off, index, pa);
-            if (status != MX_OK) {
-                if (unlikely(status == MX_ERR_NEXT || status == MX_ERR_STOP)) {
-                    status = MX_ERR_INTERNAL;
+            if (status != ZX_OK) {
+                if (unlikely(status == ZX_ERR_NEXT || status == ZX_ERR_STOP)) {
+                    status = ZX_ERR_INTERNAL;
                 }
                 return status;
             }
 
             expected_next_off = off + PAGE_SIZE;
-            return MX_ERR_NEXT;
+            return ZX_ERR_NEXT;
         },
         start_page_offset, end_page_offset);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -967,17 +967,17 @@
     for (uint64_t off = expected_next_off; off < end_page_offset; off += PAGE_SIZE) {
         paddr_t pa;
         status_t status = GetPageLocked(off, pf_flags, nullptr, nullptr, &pa);
-        if (status != MX_OK) {
-            return MX_ERR_NO_MEMORY;
+        if (status != ZX_OK) {
+            return ZX_ERR_NO_MEMORY;
         }
         const size_t index = (off - start_page_offset) / PAGE_SIZE;
         status = lookup_fn(context, off, index, pa);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPaged::ReadUser(user_ptr<void> ptr, uint64_t offset, size_t len, size_t* bytes_read) {
@@ -1012,7 +1012,7 @@
     // compute the size of the table we'll need and make sure it fits in the user buffer
     uint64_t table_size = ((end_page_offset - start_page_offset) / PAGE_SIZE) * sizeof(paddr_t);
     if (unlikely(table_size > buffer_size))
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     auto copy_to_user = [](void* context, size_t offset, size_t index, paddr_t pa) -> status_t {
         user_ptr<paddr_t>* buffer = static_cast<user_ptr<paddr_t>*>(context);
@@ -1043,12 +1043,12 @@
     canary_.Assert();
 
     if (unlikely(len == 0))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     AutoLock a(&lock_);
 
     if (unlikely(!InRange(start_offset, len, size_)))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     const size_t end_offset = static_cast<size_t>(start_offset + len);
     size_t op_start_offset = static_cast<size_t>(start_offset);
@@ -1069,7 +1069,7 @@
         paddr_t pa;
         auto status = GetPageLocked(op_start_offset, 0, nullptr, nullptr, &pa);
 
-        if (likely(status == MX_OK)) {
+        if (likely(status == ZX_OK)) {
             // Convert the page address to a Kernel virtual address.
             const void* ptr = paddr_to_kvaddr(pa);
             const addr_t cache_op_addr = reinterpret_cast<addr_t>(ptr) + page_offset;
@@ -1094,7 +1094,7 @@
         op_start_offset += cache_op_len;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void VmObjectPaged::RangeChangeUpdateFromParentLocked(const uint64_t offset, const uint64_t len) {
diff --git a/kernel/vm/vm_object_physical.cpp b/kernel/vm/vm_object_physical.cpp
index 2a9c56a..bd5f78f 100644
--- a/kernel/vm/vm_object_physical.cpp
+++ b/kernel/vm/vm_object_physical.cpp
@@ -36,25 +36,25 @@
 
 status_t VmObjectPhysical::Create(paddr_t base, uint64_t size, fbl::RefPtr<VmObject>* obj) {
     if (!IS_PAGE_ALIGNED(base) || !IS_PAGE_ALIGNED(size) || size == 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // check that base + size is a valid range
     safeint::CheckedNumeric<paddr_t> safe_base = base;
     safe_base += size - 1;
     if (!safe_base.IsValid())
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     fbl::AllocChecker ac;
     auto vmo = fbl::AdoptRef<VmObject>(new (&ac) VmObjectPhysical(base, size));
     if (!ac.check())
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // Physical VMOs should default to uncached access.
     vmo->SetMappingCachePolicy(ARCH_MMU_FLAG_UNCACHED);
 
     *obj = fbl::move(vmo);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void VmObjectPhysical::Dump(uint depth, bool verbose) {
@@ -76,15 +76,15 @@
         *_page = nullptr;
 
     if (offset >= size_)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     uint64_t pa = base_ + ROUNDDOWN(offset, PAGE_SIZE);
     if (pa > UINTPTR_MAX)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     *_pa = (paddr_t)pa;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPhysical::LookupUser(uint64_t offset, uint64_t len, user_ptr<paddr_t> buffer,
@@ -92,13 +92,13 @@
     canary_.Assert();
 
     if (unlikely(len == 0))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     AutoLock a(&lock_);
 
     // verify that the range is within the object
     if (unlikely(!InRange(offset, len, size_)))
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     uint64_t start_page_offset = ROUNDDOWN(offset, PAGE_SIZE);
     uint64_t end = offset + len;
@@ -107,14 +107,14 @@
     // compute the size of the table we'll need and make sure it fits in the user buffer
     uint64_t table_size = ((end_page_offset - start_page_offset) / PAGE_SIZE) * sizeof(paddr_t);
     if (unlikely(table_size > buffer_size))
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     size_t index = 0;
     for (uint64_t off = start_page_offset; off != end_page_offset; off += PAGE_SIZE, index++) {
         // find the physical address
         uint64_t tmp = base_ + off;
         if (tmp > UINTPTR_MAX)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
 
         paddr_t pa = (paddr_t)tmp;
 
@@ -127,18 +127,18 @@
             return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPhysical::GetMappingCachePolicy(uint32_t* cache_policy) {
     AutoLock l(&lock_);
 
     if (!cache_policy) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     *cache_policy = mapping_cache_flags_;
-    return MX_OK;
+    return ZX_OK;
 }
 
 status_t VmObjectPhysical::SetMappingCachePolicy(const uint32_t cache_policy) {
@@ -146,7 +146,7 @@
 
     // Is it a valid cache flag?
     if (cache_policy & ~ARCH_MMU_FLAG_CACHE_MASK) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // If the cache policy is already configured on this VMO and matches
@@ -154,15 +154,15 @@
     // in the serialio and magma drivers, but may change.
     // TODO: revisit this when we shake out more of the future DDK protocol.
     if (cache_policy == mapping_cache_flags_) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     // If this VMO is mapped already it is not safe to allow its caching policy to change
     if (mapping_list_len_ != 0) {
         LTRACEF("Warning: trying to change cache policy while this vmo is mapped!\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     mapping_cache_flags_ = cache_policy;
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/kernel/vm/vm_page_list.cpp b/kernel/vm/vm_page_list.cpp
index 6003bee..9fe4346 100644
--- a/kernel/vm/vm_page_list.cpp
+++ b/kernel/vm/vm_page_list.cpp
@@ -54,9 +54,9 @@
     canary_.Assert();
     DEBUG_ASSERT(index < kPageFanOut);
     if (pages_[index])
-        return MX_ERR_ALREADY_EXISTS;
+        return ZX_ERR_ALREADY_EXISTS;
     pages_[index] = p;
-    return MX_OK;
+    return ZX_OK;
 }
 
 VmPageList::VmPageList() {
@@ -82,18 +82,18 @@
         fbl::unique_ptr<VmPageListNode> pl =
             fbl::unique_ptr<VmPageListNode>(new (&ac) VmPageListNode(node_offset));
         if (!ac.check())
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         LTRACEF("allocating new inner node %p\n", pl.get());
         __UNUSED auto status = pl->AddPage(p, index);
-        DEBUG_ASSERT(status == MX_OK);
+        DEBUG_ASSERT(status == ZX_OK);
 
         list_.insert(fbl::move(pl));
     } else {
         pln->AddPage(p, index);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 vm_page* VmPageList::GetPage(uint64_t offset) {
@@ -122,7 +122,7 @@
     // lookup the tree node that holds this page
     auto pln = list_.find(node_offset);
     if (!pln.IsValid()) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     // free this page
@@ -137,7 +137,7 @@
         pmm_free_page(page);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 size_t VmPageList::FreeAllPages() {
@@ -154,7 +154,7 @@
         list_add_tail(&list, &p->free.node);
         p = nullptr;
         count++;
-        return MX_ERR_NEXT;
+        return ZX_ERR_NEXT;
     };
 
     // walk the tree in order, freeing all the pages on every node
diff --git a/kernel/vm/vm_unittest.cpp b/kernel/vm/vm_unittest.cpp
index 881ffdf..83fde1c 100644
--- a/kernel/vm/vm_unittest.cpp
+++ b/kernel/vm/vm_unittest.cpp
@@ -242,7 +242,7 @@
     void* ptr;
     status_t err = VmAspace::kernel_aspace()->Alloc(
         "test", zero_size, &ptr, 0, 0, kArchRwFlags);
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, err, "");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, err, "");
     END_TEST;
 }
 
@@ -253,7 +253,7 @@
     status_t err = VmAspace::kernel_aspace()->Alloc(
         "test", 16384, &ptr, 0,
         VmAspace::VMM_FLAG_VALLOC_SPECIFIC | VmAspace::VMM_FLAG_COMMIT, kArchRwFlags);
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, err, "");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, err, "");
     END_TEST;
 }
 
@@ -264,7 +264,7 @@
     void* ptr;
     status_t err = VmAspace::kernel_aspace()->AllocContiguous(
         "test", 4096, &ptr, 0, zero_vmm_flags, kArchRwFlags);
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, err, "");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, err, "");
     END_TEST;
 }
 
@@ -274,7 +274,7 @@
     void* ptr;
     status_t err = VmAspace::kernel_aspace()->AllocContiguous(
         "test", zero_size, &ptr, 0, VmAspace::VMM_FLAG_COMMIT, kArchRwFlags);
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, err, "");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, err, "");
     END_TEST;
 }
 
@@ -294,7 +294,7 @@
 
     void* ptr;
     auto err = aspace->Alloc("test", PAGE_SIZE, &ptr, 0, 0, kArchRwFlags);
-    EXPECT_EQ(MX_OK, err, "allocating region\n");
+    EXPECT_EQ(ZX_OK, err, "allocating region\n");
 
     // destroy the aspace, which should drop all the internal refs to it
     aspace->Destroy();
@@ -318,8 +318,8 @@
 static bool vmo_create_test(void* context) {
     BEGIN_TEST;
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, PAGE_SIZE, &vmo);
-    EXPECT_EQ(status, MX_OK, "");
+    zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, PAGE_SIZE, &vmo);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_TRUE(vmo, "");
     END_TEST;
 }
@@ -329,8 +329,8 @@
     BEGIN_TEST;
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     uint64_t committed;
@@ -347,60 +347,60 @@
 
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     status = vmo->Pin(PAGE_SIZE, alloc_size);
-    EXPECT_EQ(MX_ERR_OUT_OF_RANGE, status, "pinning out of range\n");
+    EXPECT_EQ(ZX_ERR_OUT_OF_RANGE, status, "pinning out of range\n");
     status = vmo->Pin(PAGE_SIZE, 0);
-    EXPECT_EQ(MX_OK, status, "pinning range of len 0\n");
+    EXPECT_EQ(ZX_OK, status, "pinning range of len 0\n");
     status = vmo->Pin(alloc_size + PAGE_SIZE, 0);
-    EXPECT_EQ(MX_ERR_OUT_OF_RANGE, status, "pinning out-of-range of len 0\n");
+    EXPECT_EQ(ZX_ERR_OUT_OF_RANGE, status, "pinning out-of-range of len 0\n");
 
     status = vmo->Pin(PAGE_SIZE, 3 * PAGE_SIZE);
-    EXPECT_EQ(MX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
     status = vmo->Pin(0, alloc_size);
-    EXPECT_EQ(MX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
 
     uint64_t n;
     status = vmo->CommitRange(PAGE_SIZE, 3 * PAGE_SIZE, &n);
-    EXPECT_EQ(MX_OK, status, "committing range\n");
+    EXPECT_EQ(ZX_OK, status, "committing range\n");
 
     status = vmo->Pin(0, alloc_size);
-    EXPECT_EQ(MX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
     status = vmo->Pin(PAGE_SIZE, 4 * PAGE_SIZE);
-    EXPECT_EQ(MX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
     status = vmo->Pin(0, 4 * PAGE_SIZE);
-    EXPECT_EQ(MX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, status, "pinning uncommitted range\n");
 
     status = vmo->Pin(PAGE_SIZE, 3 * PAGE_SIZE);
-    EXPECT_EQ(MX_OK, status, "pinning committed range\n");
+    EXPECT_EQ(ZX_OK, status, "pinning committed range\n");
 
     status = vmo->DecommitRange(PAGE_SIZE, 3 * PAGE_SIZE, &n);
-    EXPECT_EQ(MX_ERR_BAD_STATE, status, "decommitting pinned range\n");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, status, "decommitting pinned range\n");
     status = vmo->DecommitRange(PAGE_SIZE, PAGE_SIZE, &n);
-    EXPECT_EQ(MX_ERR_BAD_STATE, status, "decommitting pinned range\n");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, status, "decommitting pinned range\n");
     status = vmo->DecommitRange(3 * PAGE_SIZE, PAGE_SIZE, &n);
-    EXPECT_EQ(MX_ERR_BAD_STATE, status, "decommitting pinned range\n");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, status, "decommitting pinned range\n");
 
     vmo->Unpin(PAGE_SIZE, 3 * PAGE_SIZE);
 
     status = vmo->DecommitRange(PAGE_SIZE, 3 * PAGE_SIZE, &n);
-    EXPECT_EQ(MX_OK, status, "decommitting unpinned range\n");
+    EXPECT_EQ(ZX_OK, status, "decommitting unpinned range\n");
 
     status = vmo->CommitRange(PAGE_SIZE, 3 * PAGE_SIZE, &n);
-    EXPECT_EQ(MX_OK, status, "committing range\n");
+    EXPECT_EQ(ZX_OK, status, "committing range\n");
     status = vmo->Pin(PAGE_SIZE, 3 * PAGE_SIZE);
-    EXPECT_EQ(MX_OK, status, "pinning committed range\n");
+    EXPECT_EQ(ZX_OK, status, "pinning committed range\n");
 
     status = vmo->Resize(0);
-    EXPECT_EQ(MX_ERR_BAD_STATE, status, "resizing pinned range\n");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, status, "resizing pinned range\n");
 
     vmo->Unpin(PAGE_SIZE, 3 * PAGE_SIZE);
 
     status = vmo->Resize(0);
-    EXPECT_EQ(MX_OK, status, "resizing unpinned range\n");
+    EXPECT_EQ(ZX_OK, status, "resizing unpinned range\n");
 
     END_TEST;
 }
@@ -412,44 +412,44 @@
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     uint64_t n;
     status = vmo->CommitRange(0, alloc_size, &n);
-    EXPECT_EQ(MX_OK, status, "committing range\n");
+    EXPECT_EQ(ZX_OK, status, "committing range\n");
 
     status = vmo->Pin(0, alloc_size);
-    EXPECT_EQ(MX_OK, status, "pinning whole range\n");
+    EXPECT_EQ(ZX_OK, status, "pinning whole range\n");
     status = vmo->Pin(PAGE_SIZE, 4 * PAGE_SIZE);
-    EXPECT_EQ(MX_OK, status, "pinning subrange\n");
+    EXPECT_EQ(ZX_OK, status, "pinning subrange\n");
 
     for (unsigned int i = 1; i < VM_PAGE_OBJECT_MAX_PIN_COUNT; ++i) {
         status = vmo->Pin(0, PAGE_SIZE);
-        EXPECT_EQ(MX_OK, status, "pinning first page max times\n");
+        EXPECT_EQ(ZX_OK, status, "pinning first page max times\n");
     }
     status = vmo->Pin(0, PAGE_SIZE);
-    EXPECT_EQ(MX_ERR_UNAVAILABLE, status, "page is pinned too much\n");
+    EXPECT_EQ(ZX_ERR_UNAVAILABLE, status, "page is pinned too much\n");
 
     vmo->Unpin(0, alloc_size);
     status = vmo->DecommitRange(PAGE_SIZE, 4 * PAGE_SIZE, &n);
-    EXPECT_EQ(MX_ERR_BAD_STATE, status, "decommitting pinned range\n");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, status, "decommitting pinned range\n");
     status = vmo->DecommitRange(5 * PAGE_SIZE, alloc_size - 5 * PAGE_SIZE, &n);
-    EXPECT_EQ(MX_OK, status, "decommitting unpinned range\n");
+    EXPECT_EQ(ZX_OK, status, "decommitting unpinned range\n");
 
     vmo->Unpin(PAGE_SIZE, 4 * PAGE_SIZE);
     status = vmo->DecommitRange(PAGE_SIZE, 4 * PAGE_SIZE, &n);
-    EXPECT_EQ(MX_OK, status, "decommitting unpinned range\n");
+    EXPECT_EQ(ZX_OK, status, "decommitting unpinned range\n");
 
     for (unsigned int i = 2; i < VM_PAGE_OBJECT_MAX_PIN_COUNT; ++i) {
         vmo->Unpin(0, PAGE_SIZE);
     }
     status = vmo->DecommitRange(0, PAGE_SIZE, &n);
-    EXPECT_EQ(MX_ERR_BAD_STATE, status, "decommitting unpinned range\n");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, status, "decommitting unpinned range\n");
 
     vmo->Unpin(0, PAGE_SIZE);
     status = vmo->DecommitRange(0, PAGE_SIZE, &n);
-    EXPECT_EQ(MX_OK, status, "decommitting unpinned range\n");
+    EXPECT_EQ(ZX_OK, status, "decommitting unpinned range\n");
 
     END_TEST;
 }
@@ -460,7 +460,7 @@
     static const size_t alloc_size = 15;
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     uint64_t committed;
@@ -476,8 +476,8 @@
     BEGIN_TEST;
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
-    mx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    zx_status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     uint64_t committed;
@@ -494,21 +494,21 @@
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     auto ka = VmAspace::kernel_aspace();
     void* ptr;
     auto ret = ka->MapObjectInternal(vmo, "test", 0, alloc_size, &ptr,
                                      0, VmAspace::VMM_FLAG_COMMIT, kArchRwFlags);
-    EXPECT_EQ(MX_OK, ret, "mapping object");
+    EXPECT_EQ(ZX_OK, ret, "mapping object");
 
     // fill with known pattern and test
     if (!fill_and_test(ptr, alloc_size))
         all_ok = false;
 
     auto err = ka->FreeRegion((vaddr_t)ptr);
-    EXPECT_EQ(MX_OK, err, "unmapping object");
+    EXPECT_EQ(ZX_OK, err, "unmapping object");
     END_TEST;
 }
 
@@ -518,21 +518,21 @@
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     auto ka = VmAspace::kernel_aspace();
     void* ptr;
     auto ret = ka->MapObjectInternal(vmo, "test", 0, alloc_size, &ptr,
                                      0, 0, kArchRwFlags);
-    EXPECT_EQ(ret, MX_OK, "mapping object");
+    EXPECT_EQ(ret, ZX_OK, "mapping object");
 
     // fill with known pattern and test
     if (!fill_and_test(ptr, alloc_size))
         all_ok = false;
 
     auto err = ka->FreeRegion((vaddr_t)ptr);
-    EXPECT_EQ(MX_OK, err, "unmapping object");
+    EXPECT_EQ(ZX_OK, err, "unmapping object");
     END_TEST;
 }
 
@@ -542,14 +542,14 @@
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     auto ka = VmAspace::kernel_aspace();
     void* ptr;
     auto ret = ka->MapObjectInternal(fbl::move(vmo), "test", 0, alloc_size, &ptr,
                                      0, VmAspace::VMM_FLAG_COMMIT, kArchRwFlags);
-    EXPECT_EQ(ret, MX_OK, "mapping object");
+    EXPECT_EQ(ret, ZX_OK, "mapping object");
 
     EXPECT_NULL(vmo, "dropped ref to object");
 
@@ -558,7 +558,7 @@
         all_ok = false;
 
     auto err = ka->FreeRegion((vaddr_t)ptr);
-    EXPECT_EQ(MX_OK, err, "unmapping object");
+    EXPECT_EQ(ZX_OK, err, "unmapping object");
     END_TEST;
 }
 
@@ -569,33 +569,33 @@
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     auto ka = VmAspace::kernel_aspace();
     void* ptr;
     auto ret = ka->MapObjectInternal(vmo, "test", 0, alloc_size, &ptr,
                                      0, VmAspace::VMM_FLAG_COMMIT, kArchRwFlags);
-    EXPECT_EQ(MX_OK, ret, "mapping object");
+    EXPECT_EQ(ZX_OK, ret, "mapping object");
 
     // fill with known pattern and test
     if (!fill_and_test(ptr, alloc_size))
         all_ok = false;
 
     auto err = ka->FreeRegion((vaddr_t)ptr);
-    EXPECT_EQ(MX_OK, err, "unmapping object");
+    EXPECT_EQ(ZX_OK, err, "unmapping object");
 
     // map it again
     ret = ka->MapObjectInternal(vmo, "test", 0, alloc_size, &ptr,
                                 0, VmAspace::VMM_FLAG_COMMIT, kArchRwFlags);
-    EXPECT_EQ(ret, MX_OK, "mapping object");
+    EXPECT_EQ(ret, ZX_OK, "mapping object");
 
     // test that the pattern is still valid
     bool result = test_region((uintptr_t)ptr, ptr, alloc_size);
     EXPECT_TRUE(result, "testing region for corruption");
 
     err = ka->FreeRegion((vaddr_t)ptr);
-    EXPECT_EQ(MX_OK, err, "unmapping object");
+    EXPECT_EQ(ZX_OK, err, "unmapping object");
     END_TEST;
 }
 
@@ -606,14 +606,14 @@
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     auto ka = VmAspace::kernel_aspace();
     void* ptr;
     auto ret = ka->MapObjectInternal(vmo, "test0", 0, alloc_size, &ptr,
                                      0, 0, kArchRwFlags);
-    EXPECT_EQ(MX_OK, ret, "mapping object");
+    EXPECT_EQ(ZX_OK, ret, "mapping object");
 
     // fill with known pattern and test
     if (!fill_and_test(ptr, alloc_size))
@@ -623,7 +623,7 @@
     void* ptr2;
     ret = ka->MapObjectInternal(vmo, "test1", 0, alloc_size, &ptr2,
                                 0, 0, kArchRwFlags);
-    EXPECT_EQ(ret, MX_OK, "mapping object second time");
+    EXPECT_EQ(ret, ZX_OK, "mapping object second time");
     EXPECT_NE(ptr, ptr2, "second mapping is different");
 
     // test that the pattern is still valid
@@ -635,7 +635,7 @@
     static const size_t alloc_offset = PAGE_SIZE;
     ret = ka->MapObjectInternal(vmo, "test2", alloc_offset, alloc_size - alloc_offset,
                                 &ptr3, 0, 0, kArchRwFlags);
-    EXPECT_EQ(ret, MX_OK, "mapping object third time");
+    EXPECT_EQ(ret, ZX_OK, "mapping object third time");
     EXPECT_NE(ptr3, ptr2, "third mapping is different");
     EXPECT_NE(ptr3, ptr, "third mapping is different");
 
@@ -645,13 +645,13 @@
     EXPECT_EQ(0, mc, "testing region for corruption");
 
     ret = ka->FreeRegion((vaddr_t)ptr3);
-    EXPECT_EQ(MX_OK, ret, "unmapping object third time");
+    EXPECT_EQ(ZX_OK, ret, "unmapping object third time");
 
     ret = ka->FreeRegion((vaddr_t)ptr2);
-    EXPECT_EQ(MX_OK, ret, "unmapping object second time");
+    EXPECT_EQ(ZX_OK, ret, "unmapping object second time");
 
     ret = ka->FreeRegion((vaddr_t)ptr);
-    EXPECT_EQ(MX_OK, ret, "unmapping object");
+    EXPECT_EQ(ZX_OK, ret, "unmapping object");
     END_TEST;
 }
 
@@ -662,7 +662,7 @@
     // create object
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPaged::Create(0, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     // create test buffer
@@ -674,34 +674,34 @@
     // write to it, make sure it seems to work with valid args
     size_t bytes_written = -1;
     status_t err = vmo->Write(a.get(), 0, 0, &bytes_written);
-    EXPECT_EQ(MX_OK, err, "writing to object");
+    EXPECT_EQ(ZX_OK, err, "writing to object");
     EXPECT_EQ(0u, bytes_written, "writing to object");
 
     bytes_written = -1;
     err = vmo->Write(a.get(), 0, 37, &bytes_written);
-    EXPECT_EQ(MX_OK, err, "writing to object");
+    EXPECT_EQ(ZX_OK, err, "writing to object");
     EXPECT_EQ(37u, bytes_written, "writing to object");
 
     bytes_written = -1;
     err = vmo->Write(a.get(), 99, 37, &bytes_written);
-    EXPECT_EQ(MX_OK, err, "writing to object");
+    EXPECT_EQ(ZX_OK, err, "writing to object");
     EXPECT_EQ(37u, bytes_written, "writing to object");
 
     // should trim the returned size
     bytes_written = -1;
     err = vmo->Write(a.get(), 0, alloc_size + 47, &bytes_written);
-    EXPECT_EQ(MX_OK, err, "writing to object");
+    EXPECT_EQ(ZX_OK, err, "writing to object");
     EXPECT_EQ(alloc_size - 0, bytes_written, "writing to object");
 
     bytes_written = -1;
     err = vmo->Write(a.get(), 31, alloc_size + 47, &bytes_written);
-    EXPECT_EQ(MX_OK, err, "writing to object");
+    EXPECT_EQ(ZX_OK, err, "writing to object");
     EXPECT_EQ(alloc_size - 31, bytes_written, "writing to object");
 
     // should return an error because out of range
     bytes_written = -1;
     err = vmo->Write(a.get(), alloc_size + 99, 42, &bytes_written);
-    EXPECT_EQ(MX_ERR_OUT_OF_RANGE, err, "writing to object");
+    EXPECT_EQ(ZX_ERR_OUT_OF_RANGE, err, "writing to object");
     EXPECT_EQ(0u, bytes_written, "writing to object");
 
     // map the object
@@ -709,19 +709,19 @@
     uint8_t* ptr;
     err = ka->MapObjectInternal(vmo, "test", 0, alloc_size, (void**)&ptr,
                                 0, 0, kArchRwFlags);
-    EXPECT_EQ(MX_OK, err, "mapping object");
+    EXPECT_EQ(ZX_OK, err, "mapping object");
 
     // write to it at odd offsets
     bytes_written = -1;
     err = vmo->Write(a.get(), 31, 4197, &bytes_written);
-    EXPECT_EQ(MX_OK, err, "writing to object");
+    EXPECT_EQ(ZX_OK, err, "writing to object");
     EXPECT_EQ(4197u, bytes_written, "writing to object");
     int cmpres = memcmp(ptr + 31, a.get(), 4197);
     EXPECT_EQ(0, cmpres, "reading from object");
 
     // write to it, filling the object completely
     err = vmo->Write(a.get(), 0, alloc_size, &bytes_written);
-    EXPECT_EQ(MX_OK, err, "writing to object");
+    EXPECT_EQ(ZX_OK, err, "writing to object");
     EXPECT_EQ(alloc_size, bytes_written, "writing to object");
 
     // test that the data was actually written to it
@@ -737,7 +737,7 @@
 
     size_t bytes_read = -1;
     err = vmo->Read(b.get(), 0, alloc_size, &bytes_read);
-    EXPECT_EQ(MX_OK, err, "reading from object");
+    EXPECT_EQ(ZX_OK, err, "reading from object");
     EXPECT_EQ(alloc_size, bytes_read, "reading from object");
 
     // validate the buffer is valid
@@ -747,7 +747,7 @@
     // read from it at an offset
     bytes_read = -1;
     err = vmo->Read(b.get(), 31, 4197, &bytes_read);
-    EXPECT_EQ(MX_OK, err, "reading from object");
+    EXPECT_EQ(ZX_OK, err, "reading from object");
     EXPECT_EQ(4197u, bytes_read, "reading from object");
     cmpres = memcmp(b.get(), a.get() + 31, 4197);
     EXPECT_EQ(0, cmpres, "reading from object");
@@ -769,12 +769,12 @@
     {
         fbl::RefPtr<VmObject> vmo;
         status_t status = VmObjectPhysical::Create(pa, PAGE_SIZE, &vmo);
-        EXPECT_EQ(status, MX_OK, "vmobject creation\n");
+        EXPECT_EQ(status, ZX_OK, "vmobject creation\n");
         EXPECT_TRUE(vmo, "vmobject creation\n");
-        EXPECT_EQ(MX_OK, vmo->GetMappingCachePolicy(&cache_policy_get), "try get");
+        EXPECT_EQ(ZX_OK, vmo->GetMappingCachePolicy(&cache_policy_get), "try get");
         EXPECT_NE(cache_policy, cache_policy_get, "check initial cache policy");
-        EXPECT_EQ(MX_OK, vmo->SetMappingCachePolicy(cache_policy), "try set");
-        EXPECT_EQ(MX_OK, vmo->GetMappingCachePolicy(&cache_policy_get), "try get");
+        EXPECT_EQ(ZX_OK, vmo->SetMappingCachePolicy(cache_policy), "try set");
+        EXPECT_EQ(ZX_OK, vmo->GetMappingCachePolicy(&cache_policy_get), "try get");
         EXPECT_EQ(cache_policy, cache_policy_get, "compare flags");
     }
 
@@ -782,49 +782,49 @@
     for (uint32_t i = 0; i <= ARCH_MMU_FLAG_CACHE_MASK; i++) {
         fbl::RefPtr<VmObject> vmo;
         status_t status = VmObjectPhysical::Create(pa, PAGE_SIZE, &vmo);
-        EXPECT_EQ(status, MX_OK, "vmobject creation\n");
+        EXPECT_EQ(status, ZX_OK, "vmobject creation\n");
         EXPECT_TRUE(vmo, "vmobject creation\n");
-        EXPECT_EQ(MX_OK, vmo->SetMappingCachePolicy(cache_policy), "try setting valid flags");
+        EXPECT_EQ(ZX_OK, vmo->SetMappingCachePolicy(cache_policy), "try setting valid flags");
     }
 
     // Test invalid flags
     for (uint32_t i = ARCH_MMU_FLAG_CACHE_MASK + 1; i < 32; i++) {
         fbl::RefPtr<VmObject> vmo;
         status_t status = VmObjectPhysical::Create(pa, PAGE_SIZE, &vmo);
-        EXPECT_EQ(status, MX_OK, "vmobject creation\n");
+        EXPECT_EQ(status, ZX_OK, "vmobject creation\n");
         EXPECT_TRUE(vmo, "vmobject creation\n");
-        EXPECT_EQ(MX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(i), "try set with invalid flags");
+        EXPECT_EQ(ZX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(i), "try set with invalid flags");
     }
 
     // Test valid flags with invalid flags
     {
         fbl::RefPtr<VmObject> vmo;
         status_t status = VmObjectPhysical::Create(pa, PAGE_SIZE, &vmo);
-        EXPECT_EQ(status, MX_OK, "vmobject creation\n");
+        EXPECT_EQ(status, ZX_OK, "vmobject creation\n");
         EXPECT_TRUE(vmo, "vmobject creation\n");
-        EXPECT_EQ(MX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(cache_policy | 0x5), "bad 0x5");
-        EXPECT_EQ(MX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(cache_policy | 0xA), "bad 0xA");
-        EXPECT_EQ(MX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(cache_policy | 0x55), "bad 0x55");
-        EXPECT_EQ(MX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(cache_policy | 0xAA), "bad 0xAA");
+        EXPECT_EQ(ZX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(cache_policy | 0x5), "bad 0x5");
+        EXPECT_EQ(ZX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(cache_policy | 0xA), "bad 0xA");
+        EXPECT_EQ(ZX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(cache_policy | 0x55), "bad 0x55");
+        EXPECT_EQ(ZX_ERR_INVALID_ARGS, vmo->SetMappingCachePolicy(cache_policy | 0xAA), "bad 0xAA");
     }
 
     // Test that changing policy while mapped is blocked
     {
         fbl::RefPtr<VmObject> vmo;
         status_t status = VmObjectPhysical::Create(pa, PAGE_SIZE, &vmo);
-        EXPECT_EQ(status, MX_OK, "vmobject creation\n");
+        EXPECT_EQ(status, ZX_OK, "vmobject creation\n");
         EXPECT_TRUE(vmo, "vmobject creation\n");
-        EXPECT_EQ(MX_OK, ka->MapObjectInternal(vmo, "test", 0, PAGE_SIZE, (void**)&ptr, 0, 0,
+        EXPECT_EQ(ZX_OK, ka->MapObjectInternal(vmo, "test", 0, PAGE_SIZE, (void**)&ptr, 0, 0,
                                                kArchRwFlags),
                   "map vmo");
-        EXPECT_EQ(MX_ERR_BAD_STATE, vmo->SetMappingCachePolicy(cache_policy),
+        EXPECT_EQ(ZX_ERR_BAD_STATE, vmo->SetMappingCachePolicy(cache_policy),
                   "set flags while mapped");
-        EXPECT_EQ(MX_OK, ka->FreeRegion((vaddr_t)ptr), "unmap vmo");
-        EXPECT_EQ(MX_OK, vmo->SetMappingCachePolicy(cache_policy), "set flags after unmapping");
-        EXPECT_EQ(MX_OK, ka->MapObjectInternal(vmo, "test", 0, PAGE_SIZE, (void**)&ptr, 0, 0,
+        EXPECT_EQ(ZX_OK, ka->FreeRegion((vaddr_t)ptr), "unmap vmo");
+        EXPECT_EQ(ZX_OK, vmo->SetMappingCachePolicy(cache_policy), "set flags after unmapping");
+        EXPECT_EQ(ZX_OK, ka->MapObjectInternal(vmo, "test", 0, PAGE_SIZE, (void**)&ptr, 0, 0,
                                                kArchRwFlags),
                   "map vmo again");
-        EXPECT_EQ(MX_OK, ka->FreeRegion((vaddr_t)ptr), "unmap vmo");
+        EXPECT_EQ(ZX_OK, ka->FreeRegion((vaddr_t)ptr), "unmap vmo");
     }
 
     pmm_free_page(vm_page);
@@ -837,50 +837,50 @@
     static const size_t alloc_size = PAGE_SIZE * 16;
     fbl::RefPtr<VmObject> vmo;
     status_t status = VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, alloc_size, &vmo);
-    REQUIRE_EQ(status, MX_OK, "vmobject creation\n");
+    REQUIRE_EQ(status, ZX_OK, "vmobject creation\n");
     REQUIRE_TRUE(vmo, "vmobject creation\n");
 
     size_t pages_seen = 0;
     auto lookup_fn = [](void* context, size_t offset, size_t index, paddr_t pa) {
         size_t* pages_seen = static_cast<size_t*>(context);
         (*pages_seen)++;
-        return MX_OK;
+        return ZX_OK;
     };
     status = vmo->Lookup(0, alloc_size, 0, lookup_fn, &pages_seen);
-    EXPECT_EQ(MX_ERR_NO_MEMORY, status, "lookup on uncommitted pages\n");
+    EXPECT_EQ(ZX_ERR_NO_MEMORY, status, "lookup on uncommitted pages\n");
     EXPECT_EQ(0u, pages_seen, "lookup on uncommitted pages\n");
     pages_seen = 0;
 
     uint64_t committed;
     status = vmo->CommitRange(PAGE_SIZE, PAGE_SIZE, &committed);
-    EXPECT_EQ(MX_OK, status, "committing vm object\n");
+    EXPECT_EQ(ZX_OK, status, "committing vm object\n");
     EXPECT_EQ(static_cast<size_t>(PAGE_SIZE), committed, "committing vm object\n");
 
     // Should fail, since first page isn't mapped
     status = vmo->Lookup(0, alloc_size, 0, lookup_fn, &pages_seen);
-    EXPECT_EQ(MX_ERR_NO_MEMORY, status, "lookup on partially committed pages\n");
+    EXPECT_EQ(ZX_ERR_NO_MEMORY, status, "lookup on partially committed pages\n");
     EXPECT_EQ(0u, pages_seen, "lookup on partially committed pages\n");
     pages_seen = 0;
 
     // Should fail, but see the mapped page
     status = vmo->Lookup(PAGE_SIZE, alloc_size - PAGE_SIZE, 0, lookup_fn, &pages_seen);
-    EXPECT_EQ(MX_ERR_NO_MEMORY, status, "lookup on partially committed pages\n");
+    EXPECT_EQ(ZX_ERR_NO_MEMORY, status, "lookup on partially committed pages\n");
     EXPECT_EQ(1u, pages_seen, "lookup on partially committed pages\n");
     pages_seen = 0;
 
     // Should succeed
     status = vmo->Lookup(PAGE_SIZE, PAGE_SIZE, 0, lookup_fn, &pages_seen);
-    EXPECT_EQ(MX_OK, status, "lookup on partially committed pages\n");
+    EXPECT_EQ(ZX_OK, status, "lookup on partially committed pages\n");
     EXPECT_EQ(1u, pages_seen, "lookup on partially committed pages\n");
     pages_seen = 0;
 
     // Commit the rest
     status = vmo->CommitRange(0, alloc_size, &committed);
-    EXPECT_EQ(MX_OK, status, "committing vm object\n");
+    EXPECT_EQ(ZX_OK, status, "committing vm object\n");
     EXPECT_EQ(alloc_size - PAGE_SIZE, committed, "committing vm object\n");
 
     status = vmo->Lookup(0, alloc_size, 0, lookup_fn, &pages_seen);
-    EXPECT_EQ(MX_OK, status, "lookup on partially committed pages\n");
+    EXPECT_EQ(ZX_OK, status, "lookup on partially committed pages\n");
     EXPECT_EQ(alloc_size / PAGE_SIZE, pages_seen, "lookup on partially committed pages\n");
 
     END_TEST;
diff --git a/kernel/vm/vmm.cpp b/kernel/vm/vmm.cpp
index 511564d..fce81f8 100644
--- a/kernel/vm/vmm.cpp
+++ b/kernel/vm/vmm.cpp
@@ -54,7 +54,7 @@
     // get the address space object this pointer is in
     VmAspace* aspace = VmAspace::vaddr_to_aspace(addr);
     if (!aspace)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     // page fault it
     status_t status = aspace->PageFault(addr, flags);
@@ -63,7 +63,7 @@
     // If it's a kernel fault, the kernel could possibly already
     // hold locks on VMOs, Aspaces, etc, so we can't safely do
     // this.
-    if ((status == MX_ERR_NOT_FOUND) && (flags & VMM_PF_FLAG_USER)) {
+    if ((status == ZX_ERR_NOT_FOUND) && (flags & VMM_PF_FLAG_USER)) {
         printf("PageFault: %zu free pages\n", pmm_count_free_pages());
         DumpProcessMemoryUsage("PageFault: MemoryUsed: ", 8 * 256);
     }
@@ -106,7 +106,7 @@
         printf("%s create_test_aspace\n", argv[0].str);
         printf("%s free_aspace <address>\n", argv[0].str);
         printf("%s set_test_aspace <address>\n", argv[0].str);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     static fbl::RefPtr<VmAspace> test_aspace;
@@ -185,7 +185,7 @@
         goto usage;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 STATIC_COMMAND_START
diff --git a/make/engine.mk b/make/engine.mk
index c07d83e..c77613d 100644
--- a/make/engine.mk
+++ b/make/engine.mk
@@ -38,7 +38,7 @@
 USE_GOLD ?= true
 endif
 THINLTO_CACHE_DIR ?= $(BUILDDIR)/thinlto-cache
-LKNAME ?= magenta
+LKNAME ?= zircon
 CLANG_TARGET_FUCHSIA ?= false
 USE_LINKER_GC ?= true
 
@@ -126,7 +126,7 @@
 # the compiler will record the absolute path of the current directory and
 # make everything relative to that.  Instead, we tell the compiler to map
 # the current directory to $(DEBUG_BUILDROOT), which is the "relative"
-# location of the magenta source tree (i.e. usually . in a standalone build).
+# location of the zircon source tree (i.e. usually . in a standalone build).
 DEBUG_BUILDROOT ?= $(BUILDROOT)
 GLOBAL_COMPILEFLAGS := $(GLOBAL_DEBUGFLAGS)
 GLOBAL_COMPILEFLAGS += -fdebug-prefix-map=$(shell pwd)=$(DEBUG_BUILDROOT)
@@ -273,13 +273,13 @@
 # BFD ld stupidly insists on resolving dependency DSO's symbols when
 # doing a -shared -z defs link.  To do this it needs to find
 # dependencies' dependencies, which requires -rpath-link.  Gold does
-# not have this misfeature.  Since ulib/musl needs ulib/magenta and
+# not have this misfeature.  Since ulib/musl needs ulib/zircon and
 # everything needs ulib/musl, this covers the actual needs in the
 # build today without resorting to resolving inter-module dependencies
 # to generate -rpath-link in a general fashion.  Eventually we should
 # always use gold or lld for all the user-mode links, and then we'll
 # never need this.
-USERAPP_LDFLAGS += -rpath-link $(BUILDDIR)/ulib/magenta
+USERAPP_LDFLAGS += -rpath-link $(BUILDDIR)/ulib/zircon
 endif
 
 # Architecture specific compile flags
@@ -313,10 +313,10 @@
 GLOBAL_DEFINES :=
 
 # anything added to KERNEL_DEFINES will be put into $(BUILDDIR)/config-kernel.h
-KERNEL_DEFINES := LK=1 _KERNEL=1 MAGENTA_TOOLCHAIN=1
+KERNEL_DEFINES := LK=1 _KERNEL=1 ZIRCON_TOOLCHAIN=1
 
 # anything added to USER_DEFINES will be put into $(BUILDDIR)/config-user.h
-USER_DEFINES := MAGENTA_TOOLCHAIN=1
+USER_DEFINES := ZIRCON_TOOLCHAIN=1
 
 # anything added to HOST_DEFINES will be put into $(BUILDDIR)/config-host.h
 HOST_DEFINES :=
@@ -382,7 +382,7 @@
 MDI_SRCS :=
 
 # MDI source files used to generate the mdi-defs.h header file
-MDI_INCLUDES := system/public/magenta/mdi/magenta.mdi
+MDI_INCLUDES := system/public/zircon/mdi/zircon.mdi
 
 # For now always enable frame pointers so kernel backtraces
 # can work and define WITH_PANIC_BACKTRACE to enable them in panics
@@ -625,11 +625,11 @@
 	ARCH=\"$(ARCH)\" \
 
 # debug build?
-# TODO(johngro) : Make LK and MX debug levels independently controlable.
+# TODO(johngro) : Make LK and ZX debug levels independently controlable.
 ifneq ($(DEBUG),)
 GLOBAL_DEFINES += \
 	LK_DEBUGLEVEL=$(DEBUG) \
-	MX_DEBUGLEVEL=$(DEBUG)
+	ZX_DEBUGLEVEL=$(DEBUG)
 endif
 
 # allow additional defines from outside the build system
diff --git a/make/macros.mk b/make/macros.mk
index 8345b0e..71f3eb4 100644
--- a/make/macros.mk
+++ b/make/macros.mk
@@ -95,7 +95,7 @@
 copy-dst-src = $(eval $(call generate-copy-dst-src,$(strip $1),$(strip $2)))
 
 HOST_PLATFORM := $(shell uname -s | tr '[:upper:]' '[:lower:]')
-ifeq ($(HOST_PLATFORM), magenta)
+ifeq ($(HOST_PLATFORM), zircon)
 SHELLEXEC = /boot/bin/sh
 else
 SHELLEXEC =
diff --git a/make/module.mk b/make/module.mk
index d2e5f53..b7b7fd2 100644
--- a/make/module.mk
+++ b/make/module.mk
@@ -22,7 +22,7 @@
 # MODULE_SRCDEPS : extra dependencies that all of this module's files depend on
 # MODULE_EXTRA_OBJS : extra .o files that should be linked with the module
 # MODULE_TYPE : "userapp" for userspace executables, "userlib" for userspace library,
-#               "driver" for Magenta driver, "" for standard LK module
+#               "driver" for Zircon driver, "" for standard LK module
 # MODULE_LIBS : shared libraries for a userapp or userlib to depend on
 # MODULE_STATIC_LIBS : static libraries for a userapp or userlib to depend on
 # MODULE_SO_NAME : linkage name for the shared library
diff --git a/make/sysgen.mk b/make/sysgen.mk
index 25cc0c6..6d0bd61 100644
--- a/make/sysgen.mk
+++ b/make/sysgen.mk
@@ -4,7 +4,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-SYSCALLS_SRC := system/public/magenta/syscalls.sysgen
+SYSCALLS_SRC := system/public/zircon/syscalls.sysgen
 
 GEN_DIR := $(BUILDDIR)/gen
 
@@ -12,28 +12,28 @@
 # This gets STAMPY built (and generation complete) early in the build.
 TARGET_MODDEPS += $(STAMPY)
 
-SG_MAGENTA := $(GENERATED_INCLUDES)/magenta
+SG_ZIRCON := $(GENERATED_INCLUDES)/zircon
 
-SG_KERNEL_CODE := $(SG_MAGENTA)/syscall-invocation-cases.inc
-SG_KERNEL_HEADER := $(SG_MAGENTA)/syscall-definitions.h
-SG_KERNEL_TRACE := $(SG_MAGENTA)/syscall-ktrace-info.inc
-SG_KERNEL_CATEGORY := $(SG_MAGENTA)/syscall-category.inc
-SG_KERNEL_WRAPPERS := $(SG_MAGENTA)/syscall-kernel-wrappers.inc
-SG_KERNEL_BRANCHES := $(SG_MAGENTA)/syscall-kernel-branches.S
+SG_KERNEL_CODE := $(SG_ZIRCON)/syscall-invocation-cases.inc
+SG_KERNEL_HEADER := $(SG_ZIRCON)/syscall-definitions.h
+SG_KERNEL_TRACE := $(SG_ZIRCON)/syscall-ktrace-info.inc
+SG_KERNEL_CATEGORY := $(SG_ZIRCON)/syscall-category.inc
+SG_KERNEL_WRAPPERS := $(SG_ZIRCON)/syscall-kernel-wrappers.inc
+SG_KERNEL_BRANCHES := $(SG_ZIRCON)/syscall-kernel-branches.S
 
-SG_ULIB_VDSO_HEADER := $(SG_MAGENTA)/syscall-vdso-definitions.h
-SG_ULIB_VDSO_WRAPPERS := $(SG_MAGENTA)/syscall-vdso-wrappers.inc
-SG_ULIB_SYSCALL_NUMBER := $(SG_MAGENTA)/mx-syscall-numbers.h
-SG_ULIB_ARM := $(SG_MAGENTA)/syscalls-arm64.S
-SG_ULIB_X86 := $(SG_MAGENTA)/syscalls-x86-64.S
+SG_ULIB_VDSO_HEADER := $(SG_ZIRCON)/syscall-vdso-definitions.h
+SG_ULIB_VDSO_WRAPPERS := $(SG_ZIRCON)/syscall-vdso-wrappers.inc
+SG_ULIB_SYSCALL_NUMBER := $(SG_ZIRCON)/zx-syscall-numbers.h
+SG_ULIB_ARM := $(SG_ZIRCON)/syscalls-arm64.S
+SG_ULIB_X86 := $(SG_ZIRCON)/syscalls-x86-64.S
 
-SG_SYSCALLS := $(SG_MAGENTA)/syscalls
+SG_SYSCALLS := $(SG_ZIRCON)/syscalls
 SG_PUBLIC_HEADER := $(SG_SYSCALLS)/definitions.h
 SG_PUBLIC_RUST := $(SG_SYSCALLS)/definitions.rs
 
-SG_SYSROOT_MAGENTA := $(BUILDSYSROOT)/include/magenta
-SG_SYSROOT_HEADER := $(SG_SYSROOT_MAGENTA)/syscalls/definitions.h
-SG_SYSROOT_RUST := $(SG_SYSROOT_MAGENTA)/syscalls/definitions.rs
+SG_SYSROOT_ZIRCON := $(BUILDSYSROOT)/include/zircon
+SG_SYSROOT_HEADER := $(SG_SYSROOT_ZIRCON)/syscalls/definitions.h
+SG_SYSROOT_RUST := $(SG_SYSROOT_ZIRCON)/syscalls/definitions.rs
 
 # STAMPY ultimately generates most of the files and paths here.
 $(STAMPY): $(SYSGEN) $(SYSCALLS_SRC)
diff --git a/makefile b/makefile
index 83d6be8..fcbf7a2 100644
--- a/makefile
+++ b/makefile
@@ -7,13 +7,13 @@
 
 LKMAKEROOT := .
 BUILDROOT ?= .
-DEFAULT_PROJECT ?= magenta-pc-x86-64
+DEFAULT_PROJECT ?= zircon-pc-x86-64
 TOOLCHAIN_PREFIX ?=
 
 ENABLE_BUILD_SYSROOT ?= true
 # if true, $BUILDDIR/sysroot/{lib,include,...} will be populated with
 # public libraries, headers, and other "build artifacts" necessary
-# for a toolchain to compile binaries for Magenta.
+# for a toolchain to compile binaries for Zircon.
 
 ENABLE_BUILD_LISTFILES ?= false
 # If true, various verbose listings (*.lst, *.sym, *,dump, etc) will
diff --git a/navbar.md b/navbar.md
index 631ced7..b4578ab 100644
--- a/navbar.md
+++ b/navbar.md
@@ -1,4 +1,4 @@
-* [Magenta](/README.md)
+* [Zircon](/README.md)
 * [Concepts](/docs/concepts.md)
 * [Objects](/docs/objects.md)
 * [Syscalls](/docs/syscalls.md)
diff --git a/prebuilt/versions/README.md b/prebuilt/versions/README.md
index d13a407..742743e 100644
--- a/prebuilt/versions/README.md
+++ b/prebuilt/versions/README.md
@@ -1,7 +1,7 @@
-# Magenta Prebuilt Versions
+# Zircon Prebuilt Versions
 
 The `prebuilt/versions` directory mirrors the directory structure found in the
-Magenta prebuilt Google Storage bucket at `gs://fuchsia-build/magenta/`.  The
+Zircon prebuilt Google Storage bucket at `gs://fuchsia-build/zircon/`.  The
 files indicate which versions to download.  The filename to use and where to install
 the prebuilts is left up to the tool that does the downloading.
 
@@ -10,7 +10,7 @@
 On Google Storage, this file exists:
 
 ```
-fuchsia-build/magenta/toolchain/aarch64-elf/Linux-x86_64/d1b546ffcd826482cea63ae67a13d3c98a92bf1e
+fuchsia-build/zircon/toolchain/aarch64-elf/Linux-x86_64/d1b546ffcd826482cea63ae67a13d3c98a92bf1e
 ```
 
 In `prebuilt/versions`, the corresponding file exists:
diff --git a/scripts/analyze-magenta b/scripts/analyze-zircon
similarity index 84%
rename from scripts/analyze-magenta
rename to scripts/analyze-zircon
index b62c8ff..e7e3422 100755
--- a/scripts/analyze-magenta
+++ b/scripts/analyze-zircon
@@ -7,11 +7,11 @@
 # https://opensource.org/licenses/MIT
 
 # This script will perform static analyses provided by Clang Static analyzers
-# on Magenta. It requires either a prebuilt Clang toolchan or a Clang toolchain
+# on Zircon. It requires either a prebuilt Clang toolchan or a Clang toolchain
 # built from official Clang repository. For instructions on how to obtain a
 # prebuilt toolchain or build the toolchain from scratch, please refer to
 # document at
-# https://fuchsia.googlesource.com/magenta/+/master/docs/getting_started.md
+# https://fuchsia.googlesource.com/zircon/+/master/docs/getting_started.md
 
 set -eu
 
@@ -55,10 +55,10 @@
   unix.cstring.NullArg \
 "
 
-# Magenta specific checkers
+# Zircon specific checkers
 # Content may change in the future
 # TODO: This checker will only work after https://reviews.llvm.org/D36024 lands.
-CHECKERS_MAGENTA="alpha.magenta.MagentaHandleChecker"
+CHECKERS_ZIRCON="alpha.zircon.ZirconHandleChecker"
 
 # Checkers that should be enabled
 CHECKERS_TO_ENABLE=""
@@ -98,7 +98,7 @@
 # Register trap
 trap func_trap_handler SIGHUP SIGINT SIGTERM EXIT
 
-# Analyzer run mode. clang|magenta|all
+# Analyzer run mode. clang|zircon|all
 RUN_MODE="clang"
 # Path to python version of scan_build
 SCAN_BUILD_PY=""
@@ -129,12 +129,12 @@
   echo "-p <toolchain prefix>     : path to the directory containing bin/clang"
   echo "-s <scan-build-py prefix> : path to the directory bin/scan-build"
   echo "-o <output dir>           : path to output dir (default: AnalysisResult)"
-  echo "-m <clang|magenta|all>    : run mode. clang mode will only enable checkers that"
-  echo "                            is enabled by default. magenta mode will only enable"
-  echo "                            magenta related checkers. all mode will enable both"
-  echo "                            default checkers and magenta related checkers."
+  echo "-m <clang|zircon|all>    : run mode. clang mode will only enable checkers that"
+  echo "                            is enabled by default. zircon mode will only enable"
+  echo "                            zircon related checkers. all mode will enable both"
+  echo "                            default checkers and zircon related checkers."
   echo "                            Default value is clang."
-  echo "-t <target>               : build target. Default is magenta-pc-x86-64"
+  echo "-t <target>               : build target. Default is zircon-pc-x86-64"
   echo "-n                        : do not run analyzer on unit tests"
   echo "-h                        : for help"
   exit 1
@@ -149,10 +149,10 @@
   [[ "$SOURCE" != /* ]] && SOURCE="$SCRIPT_DIR/$SOURCE"
 done
 SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-MAGENTA_ROOT="$SCRIPT_DIR/.."
+ZIRCON_ROOT="$SCRIPT_DIR/.."
 
 # Path to output analysis results
-OUT_DIR="$MAGENTA_ROOT/AnalysisResult"
+OUT_DIR="$ZIRCON_ROOT/AnalysisResult"
 
 # Read args from command line
 while getopts "p:s:t:o:m:hn" opt; do
@@ -174,7 +174,7 @@
 if [ -z "$TOOLCHAIN_PREFIX" ]; then
   # User did not provide toolchain prefix
   # Assume user prefer prebuilt toolchain
-  PREBUILT_DIR="$MAGENTA_ROOT/prebuilt/downloads"
+  PREBUILT_DIR="$ZIRCON_ROOT/prebuilt/downloads"
   # Determine OS type
   OS_STR="$(uname)"
   if [ "$OS_STR" = "Darwin" ]; then
@@ -202,7 +202,7 @@
 if [ -z "$SCAN_BUILD_PY_PREFIX" ]; then
   # SCAN_BUILD_PY_PREFIX not defined
   # Try fuchsia/third_party
-  SCAN_BUILD_PY_PREFIX="$MAGENTA_ROOT/../third_party/llvm/tools/clang/tools/scan-build-py"
+  SCAN_BUILD_PY_PREFIX="$ZIRCON_ROOT/../third_party/llvm/tools/clang/tools/scan-build-py"
 fi
 
 if [ ! -d "$SCAN_BUILD_PY_PREFIX" ]; then
@@ -220,18 +220,18 @@
 func_test_exist "$SCAN_BUILD_PY_CXX"
 
 # Construct Checker Args that should be passed to scan-build
-if [ "$RUN_MODE" = "magenta" ]; then
+if [ "$RUN_MODE" = "zircon" ]; then
   CHECKERS_TO_DISABLE="${CHECKERS_TO_DISABLE} ${CHECKERS_DEFAULT_ON}"
-  CHECKERS_TO_ENABLE="${CHECKERS_TO_ENABLE} ${CHECKERS_MAGENTA}"
+  CHECKERS_TO_ENABLE="${CHECKERS_TO_ENABLE} ${CHECKERS_ZIRCON}"
 elif [ "$RUN_MODE" = "all" ]; then
-  CHECKERS_TO_ENABLE="${CHECKERS_TO_ENABLE} ${CHECKERS_MAGENTA}"
+  CHECKERS_TO_ENABLE="${CHECKERS_TO_ENABLE} ${CHECKERS_ZIRCON}"
 fi
 func_disable_checkers
 func_enable_checkers
 
 # All clear, perform analysis
-# Change dir to magenta
-cd "$MAGENTA_ROOT"
+# Change dir to zircon
+cd "$ZIRCON_ROOT"
 # Run scan-build on make
 if [ ! -z "${BUILD_TARGET}" ]; then
   make USE_CLANG=true "${BUILD_TARGET}" clean &> /dev/null
diff --git a/scripts/bisect-helper-arm64 b/scripts/bisect-helper-arm64
index 038687a..11a74a1 100755
--- a/scripts/bisect-helper-arm64
+++ b/scripts/bisect-helper-arm64
@@ -9,8 +9,8 @@
 # Use this to use git bisect with prebuilt binary artifacts. To use, first copy the script somewhere
 # outside of the source tree (so git bisect won't mess with it) then run the following commands:
 #   git bisect start <bad> <good>
-#   git bisect run PATH_TO/bisect-helper <optional additional args to run-magenta>
-# The script will download the prebuilt magenta.bin associated with each commit, if it exists, and
+#   git bisect run PATH_TO/bisect-helper <optional additional args to run-zircon>
+# The script will download the prebuilt zircon.bin associated with each commit, if it exists, and
 # start it up in qemu. After qemu exits, the script will ask if the build is good or bad.  Type 'y'
 # or 'n' and the bisect will proceed.
 
@@ -21,13 +21,13 @@
 readonly TEMP_DIR="$(mktemp -d)"
 trap "rm -rf -- "${TEMP_DIR}"" EXIT
 readonly CURRENT_COMMIT="$(git rev-parse HEAD)"
-readonly MAGENTA_BIN_URL="https://storage-download.googleapis.com/fuchsia-build/magenta/qemu-arm64/magenta.elf/${CURRENT_COMMIT}"
-readonly DOWNLOAD_STATUS="$(curl -s -w %{http_code} --progress-bar --output "${TEMP_DIR}/magenta.elf" "${MAGENTA_BIN_URL}")"
+readonly ZIRCON_BIN_URL="https://storage-download.googleapis.com/fuchsia-build/zircon/qemu-arm64/zircon.elf/${CURRENT_COMMIT}"
+readonly DOWNLOAD_STATUS="$(curl -s -w %{http_code} --progress-bar --output "${TEMP_DIR}/zircon.elf" "${ZIRCON_BIN_URL}")"
 if [[ "${DOWNLOAD_STATUS}" != 200 ]]; then
-    echo "Could not find prebuilt at ${MAGENTA_BIN_URL}: ${DOWNLOAD_STATUS}"
+    echo "Could not find prebuilt at ${ZIRCON_BIN_URL}: ${DOWNLOAD_STATUS}"
     exit 125  # could not evaluate this commit, no prebuilt available
 fi
-"${SCRIPT_DIR}/run-magenta-arm64" -o "${TEMP_DIR}"
+"${SCRIPT_DIR}/run-zircon-arm64" -o "${TEMP_DIR}"
 
 echo "Did it work? y/n"
 read RESULT
diff --git a/scripts/bisect-helper-x86-64 b/scripts/bisect-helper-x86-64
index 74e4b8d..e9f355e 100755
--- a/scripts/bisect-helper-x86-64
+++ b/scripts/bisect-helper-x86-64
@@ -9,8 +9,8 @@
 # Use this to use git bisect with prebuilt binary artifacts. To use, first copy the script somewhere
 # outside of the source tree (so git bisect won't mess with it) then run the following commands:
 #   git bisect start <bad> <good>
-#   git bisect run PATH_TO/bisect-helper <optional additional args to run-magenta>
-# The script will download the prebuilt magenta.bin associated with each commit, if it exists, and
+#   git bisect run PATH_TO/bisect-helper <optional additional args to run-zircon>
+# The script will download the prebuilt zircon.bin associated with each commit, if it exists, and
 # start it up in qemu. After qemu exits, the script will ask if the build is good or bad.  Type 'y'
 # or 'n' and the bisect will proceed.
 
@@ -21,13 +21,13 @@
 readonly TEMP_DIR="$(mktemp -d)"
 trap "rm -rf -- "${TEMP_DIR}"" EXIT
 readonly CURRENT_COMMIT="$(git rev-parse HEAD)"
-readonly MAGENTA_BIN_URL="https://storage-download.googleapis.com/fuchsia-build/magenta/pc-x86-64/magenta.bin/${CURRENT_COMMIT}"
-readonly DOWNLOAD_STATUS="$(curl -s -w %{http_code} --progress-bar --output "${TEMP_DIR}/magenta.bin" "${MAGENTA_BIN_URL}")"
+readonly ZIRCON_BIN_URL="https://storage-download.googleapis.com/fuchsia-build/zircon/pc-x86-64/zircon.bin/${CURRENT_COMMIT}"
+readonly DOWNLOAD_STATUS="$(curl -s -w %{http_code} --progress-bar --output "${TEMP_DIR}/zircon.bin" "${ZIRCON_BIN_URL}")"
 if [[ "${DOWNLOAD_STATUS}" != 200 ]]; then
-    echo "Could not find prebuilt at ${MAGENTA_BIN_URL}: ${DOWNLOAD_STATUS}"
+    echo "Could not find prebuilt at ${ZIRCON_BIN_URL}: ${DOWNLOAD_STATUS}"
     exit 125  # could not evaluate this commit, no prebuilt available
 fi
-"${SCRIPT_DIR}/run-magenta-x86-64" -o "${TEMP_DIR}"
+"${SCRIPT_DIR}/run-zircon-x86-64" -o "${TEMP_DIR}"
 
 echo "Did it work? y/n"
 read RESULT
diff --git a/scripts/bisect-prebuilts-arm64 b/scripts/bisect-prebuilts-arm64
index e56ba63..09cf25d 100755
--- a/scripts/bisect-prebuilts-arm64
+++ b/scripts/bisect-prebuilts-arm64
@@ -6,7 +6,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-# Use this script to bisect a regression using the prebuilt magenta kernel images. The arguments to
+# Use this script to bisect a regression using the prebuilt zircon kernel images. The arguments to
 # this script are passed to 'git bisect start'
 
 set -e
diff --git a/scripts/bisect-prebuilts-x86-64 b/scripts/bisect-prebuilts-x86-64
index b19731f..114b2d4 100755
--- a/scripts/bisect-prebuilts-x86-64
+++ b/scripts/bisect-prebuilts-x86-64
@@ -6,7 +6,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-# Use this script to bisect a regression using the prebuilt magenta kernel images. The arguments to
+# Use this script to bisect a regression using the prebuilt zircon kernel images. The arguments to
 # this script are passed to 'git bisect start'
 
 set -e
diff --git a/scripts/build-all-magenta b/scripts/build-all-zircon
similarity index 100%
rename from scripts/build-all-magenta
rename to scripts/build-all-zircon
diff --git a/scripts/build-bootable-odroidc2-sdcard.sh b/scripts/build-bootable-odroidc2-sdcard.sh
index 0334e1e..03288c0 100755
--- a/scripts/build-bootable-odroidc2-sdcard.sh
+++ b/scripts/build-bootable-odroidc2-sdcard.sh
@@ -20,14 +20,14 @@
 fi
 
 SCRIPT_DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd)
-MAGENTA_DIR="$SCRIPT_DIR/.."
+ZIRCON_DIR="$SCRIPT_DIR/.."
 
-echo $MAGENTA_DIR
+echo $ZIRCON_DIR
 
 
-# Ensure Magenta has been built prior to formatting USB
-pushd "$MAGENTA_DIR" > /dev/null
-./scripts/make-parallel magenta-odroidc2-arm64
+# Ensure Zircon has been built prior to formatting USB
+pushd "$ZIRCON_DIR" > /dev/null
+./scripts/make-parallel zircon-odroidc2-arm64
 popd > /dev/null
 
 lsblk
@@ -147,14 +147,14 @@
 trap "umount_retry \"${MOUNT_PATH}\" && rm -rf \"${MOUNT_PATH}\" && echo \"Unmounted succesfully\"" INT TERM EXIT
 
 # Copy the kernel to the boot partition.
-sudo cp "$MAGENTA_DIR/build-magenta-odroidc2-arm64/magenta.bin" \
+sudo cp "$ZIRCON_DIR/build-zircon-odroidc2-arm64/zircon.bin" \
         "${MOUNT_PATH}/"
 
 # Copy the ramdisk
-sudo cp "$MAGENTA_DIR/build-magenta-odroidc2-arm64/bootdata.bin" \
+sudo cp "$ZIRCON_DIR/build-zircon-odroidc2-arm64/bootdata.bin" \
         "${MOUNT_PATH}/"
 
-sudo cp "$MAGENTA_DIR/kernel/target/odroidc2/boot.ini" \
+sudo cp "$ZIRCON_DIR/kernel/target/odroidc2/boot.ini" \
         "${MOUNT_PATH}/"
 
 
diff --git a/scripts/build-qemu-x86-64 b/scripts/build-qemu-x86-64
index 1513b90..b52af7c 100755
--- a/scripts/build-qemu-x86-64
+++ b/scripts/build-qemu-x86-64
@@ -6,7 +6,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-export PROJECT=magenta-pc-x86-64
+export PROJECT=zircon-pc-x86-64
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
diff --git a/scripts/build-magenta-arm64 b/scripts/build-zircon-arm64
similarity index 89%
rename from scripts/build-magenta-arm64
rename to scripts/build-zircon-arm64
index 2a86c7c..134d766 100755
--- a/scripts/build-magenta-arm64
+++ b/scripts/build-zircon-arm64
@@ -6,7 +6,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-export PROJECT=magenta-qemu-arm64
+export PROJECT=zircon-qemu-arm64
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
diff --git a/scripts/build-magenta-odroidc2 b/scripts/build-zircon-odroidc2
similarity index 88%
rename from scripts/build-magenta-odroidc2
rename to scripts/build-zircon-odroidc2
index 20b6cc3..30d8e9f 100755
--- a/scripts/build-magenta-odroidc2
+++ b/scripts/build-zircon-odroidc2
@@ -6,7 +6,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-export PROJECT=magenta-odroidc2-arm64
+export PROJECT=zircon-odroidc2-arm64
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
diff --git a/scripts/build-magenta-x86-64 b/scripts/build-zircon-x86-64
similarity index 90%
rename from scripts/build-magenta-x86-64
rename to scripts/build-zircon-x86-64
index 4923185..b1084f3 100755
--- a/scripts/build-magenta-x86-64
+++ b/scripts/build-zircon-x86-64
@@ -6,7 +6,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-export PROJECT=magenta-pc-x86-64
+export PROJECT=zircon-pc-x86-64
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
diff --git a/scripts/buildall b/scripts/buildall
index 044841b..87caf33 100755
--- a/scripts/buildall
+++ b/scripts/buildall
@@ -11,7 +11,7 @@
     echo "help:"
     echo "-a arg              : Pass arg to make"
     echo "-f                  : Exit on first failure"
-    echo "-m                  : Build magenta targets only"
+    echo "-m                  : Build zircon targets only"
     echo "-r                  : Also build release mode builds"
     echo "-c                  : Also build with clang"
     echo "-A                  : Also build with ASan"
@@ -24,7 +24,7 @@
 DO_RELEASE=0
 DO_CLANG=0
 DO_ASAN=0
-MAGENTA_ONLY=0
+ZIRCON_ONLY=0
 MAKE_ARGS=
 QUIET=0
 
@@ -36,7 +36,7 @@
         h) HELP;;
         r) DO_RELEASE=1;;
         c) DO_CLANG=1;;
-        m) MAGENTA_ONLY=1;;
+        m) ZIRCON_ONLY=1;;
         q) QUIET=1;;
         \?)
             echo unrecognized option
@@ -45,9 +45,9 @@
 done
 shift $((OPTIND-1))
 
-if [ "$MAGENTA_ONLY" -eq 1 ]; then
+if [ "$ZIRCON_ONLY" -eq 1 ]; then
     # build everything in the projects directory
-    PROJECTS=`echo kernel/project/magenta*.mk | xargs -n1 basename | sed 's/\.mk//'`
+    PROJECTS=`echo kernel/project/zircon*.mk | xargs -n1 basename | sed 's/\.mk//'`
 else
     PROJECTS=`echo kernel/project/*.mk | xargs -n1 basename | sed 's/\.mk//'`
 fi
diff --git a/scripts/do-qemuarm b/scripts/do-qemuarm
index 023918f..47c5e4a 100755
--- a/scripts/do-qemuarm
+++ b/scripts/do-qemuarm
@@ -71,7 +71,7 @@
     PROJECT="qemu-virt-a15-test"
 fi
 
-ARGS=" -m $MEMSIZE -smp $SMP -kernel build-${PROJECT}/magenta.elf"
+ARGS=" -m $MEMSIZE -smp $SMP -kernel build-${PROJECT}/zircon.elf"
 
 AUDIO_ARGS=" -soundhw hda"
 BLOCK_ARGS=" -drive if=none,file=blk.bin,id=blk,format=raw -device virtio-blk-device,drive=blk"
diff --git a/scripts/do-qemux86 b/scripts/do-qemux86
index a854140..e7d6cc9 100755
--- a/scripts/do-qemux86
+++ b/scripts/do-qemux86
@@ -64,7 +64,7 @@
 BLOCK_ARGS=" -drive if=virtio,file=blk.bin,id=blk,format=raw"
 NET_ARGS=" -netdev type=user,hostname=qemu,id=net0 -device virtio-net-pci,netdev=net0"
 
-ARGS=" -m $MEMSIZE -smp $SMP -machine q35 -kernel build-${PROJECT}/magenta.bin"
+ARGS=" -m $MEMSIZE -smp $SMP -machine q35 -kernel build-${PROJECT}/zircon.bin"
 
 if [ $DO_AUDIO == 1 ]; then
     ARGS+=$AUDIO_ARGS
diff --git a/scripts/download-firmware b/scripts/download-firmware
index 14225fa..0d3e5e6 100755
--- a/scripts/download-firmware
+++ b/scripts/download-firmware
@@ -19,11 +19,11 @@
 readonly GS_BUCKET="https://fuchsia-build.storage.googleapis.com"
 
 # We assume the following directory structure:
-# ./magenta/scripts
-# ./magenta/prebuilt
+# ./zircon/scripts
+# ./zircon/prebuilt
 readonly SCRIPT_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
-readonly MAGENTA_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
-readonly PREBUILTS_DIR="$(cd "${MAGENTA_ROOT}/prebuilt" && pwd)"
+readonly ZIRCON_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
+readonly PREBUILTS_DIR="$(cd "${ZIRCON_ROOT}/prebuilt" && pwd)"
 
 # Install prebuilts into a .gitignore'd directory to keep things clean
 mkdir -p "${PREBUILTS_DIR}/downloads/firmware"
diff --git a/scripts/download-toolchain b/scripts/download-toolchain
index 1b889be..6db4eb5 100755
--- a/scripts/download-toolchain
+++ b/scripts/download-toolchain
@@ -6,29 +6,29 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-# This script downloads the Magenta toolchain as prebuilts from Google Storage.
+# This script downloads the Zircon toolchain as prebuilts from Google Storage.
 
 # This script is expected to be executed by Jiri as a runhook, or by individual
 # developers who want to grab the latest prebuilts.  It takes no arguments, will
-# download the latest version of the Magenta toolchain, install it in the
+# download the latest version of the Zircon toolchain, install it in the
 # prebuilt/downloads directory, and update prebuilt/config.mk with the toolchain
 # prefix (so you shouldn't have to set PATH or anything yourself).
 
 set -e
 
 readonly FUCHSIA_GS_BUCKET="https://storage.googleapis.com/fuchsia"
-readonly MAGENTA_GS_BUCKET="https://fuchsia-build.storage.googleapis.com/magenta"
+readonly ZIRCON_GS_BUCKET="https://fuchsia-build.storage.googleapis.com/magenta"
 readonly OS="$(uname)"
 readonly HOSTOS=$(uname | tr '[:upper:]' '[:lower:]')
 readonly HOSTARCH="$(uname -m)"
 readonly GCC_VERSION="6.3.0"
 
 # We assume the following directory structure:
-# ./magenta/scripts
-# ./magenta/prebuilt
+# ./zircon/scripts
+# ./zircon/prebuilt
 readonly SCRIPT_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
-readonly MAGENTA_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
-readonly PREBUILTS_DIR="$(cd "${MAGENTA_ROOT}/prebuilt" && pwd)"
+readonly ZIRCON_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
+readonly PREBUILTS_DIR="$(cd "${ZIRCON_ROOT}/prebuilt" && pwd)"
 
 # Install prebuilts into a .gitignore'd directory to keep things clean
 mkdir -p "${PREBUILTS_DIR}/downloads"
@@ -49,7 +49,7 @@
     exit 1
   fi
   local required_version="$(cat "${version_file}" )"
-  local prebuilt_url="${MAGENTA_GS_BUCKET}/${common_path}/${required_version}"
+  local prebuilt_url="${ZIRCON_GS_BUCKET}/${common_path}/${required_version}"
 
   # These are files and paths we control in this script.
   local tool_name="${target}-${OS}-${HOSTARCH}"
@@ -70,7 +70,7 @@
 
   # Record the locations of the various toolchains.
   local toolchain_dir="${target}-${GCC_VERSION}-${OS}-${HOSTARCH}"
-  local relative_install_dir="\$(LKMAKEROOT)${INSTALL_DIR#${MAGENTA_ROOT}}"
+  local relative_install_dir="\$(LKMAKEROOT)${INSTALL_DIR#${ZIRCON_ROOT}}"
   case "${target}" in
     "aarch64-elf")
       TOOLCHAIN_MAKEVARS+=("ARCH_arm64_TOOLCHAIN_PREFIX = ${relative_install_dir}/${toolchain_dir}/bin/${target}-")
@@ -82,8 +82,8 @@
 
   # Leave some breadcrumbs in the makefile so `make ...` can check if the toolchain is up-to-date.
   PREBUILT_NAMES+=" ${tool_name}"  # FYI: That's load-bearing leading whitespace.
-  TOOLCHAIN_MAKEVARS+=("PREBUILT_${tool_name}_TOOLCHAIN_STAMP = \$(LKMAKEROOT)${stamp_path#${MAGENTA_ROOT}}")
-  TOOLCHAIN_MAKEVARS+=("PREBUILT_${tool_name}_TOOLCHAIN_SHAFILE = \$(LKMAKEROOT)${version_file#${MAGENTA_ROOT}}")
+  TOOLCHAIN_MAKEVARS+=("PREBUILT_${tool_name}_TOOLCHAIN_STAMP = \$(LKMAKEROOT)${stamp_path#${ZIRCON_ROOT}}")
+  TOOLCHAIN_MAKEVARS+=("PREBUILT_${tool_name}_TOOLCHAIN_SHAFILE = \$(LKMAKEROOT)${version_file#${ZIRCON_ROOT}}")
 }
 
 function downloadClangToolchain() {
@@ -124,13 +124,13 @@
 
   # Record the locations of the various toolchains.
   local toolchain_dir="clang+llvm-${HOSTARCH}-${HOSTOS}"
-  local relative_install_dir="\$(LKMAKEROOT)${INSTALL_DIR#${MAGENTA_ROOT}}"
+  local relative_install_dir="\$(LKMAKEROOT)${INSTALL_DIR#${ZIRCON_ROOT}}"
   TOOLCHAIN_MAKEVARS+=("CLANG_TOOLCHAIN_PREFIX = ${relative_install_dir}/${toolchain_dir}/bin/")
 
   # Leave some breadcrumbs in the makefile so `make ...` can check if the toolchain is up-to-date.
   PREBUILT_NAMES+=" ${tool_name}"  # FYI: That's load-bearing leading whitespace.
-  TOOLCHAIN_MAKEVARS+=("PREBUILT_${tool_name}_TOOLCHAIN_STAMP = \$(LKMAKEROOT)${stamp_path#${MAGENTA_ROOT}}")
-  TOOLCHAIN_MAKEVARS+=("PREBUILT_${tool_name}_TOOLCHAIN_SHAFILE = \$(LKMAKEROOT)${version_file#${MAGENTA_ROOT}}")
+  TOOLCHAIN_MAKEVARS+=("PREBUILT_${tool_name}_TOOLCHAIN_STAMP = \$(LKMAKEROOT)${stamp_path#${ZIRCON_ROOT}}")
+  TOOLCHAIN_MAKEVARS+=("PREBUILT_${tool_name}_TOOLCHAIN_SHAFILE = \$(LKMAKEROOT)${version_file#${ZIRCON_ROOT}}")
 }
 
 # We want the toolchains for all target types.
diff --git a/scripts/flash-hikey b/scripts/flash-hikey
index 3991e68..1fac230 100755
--- a/scripts/flash-hikey
+++ b/scripts/flash-hikey
@@ -6,9 +6,9 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-BUILD_DIR=build-magenta-hikey960-arm64
+BUILD_DIR=build-zircon-hikey960-arm64
 
-KERNEL=$BUILD_DIR/zmagenta.bin
+KERNEL=$BUILD_DIR/zzircon.bin
 RAMDISK=$BUILD_DIR/bootdata.bin
 
 OUT_IMAGE=$BUILD_DIR/boot.img
diff --git a/scripts/gen-vdso-valid-sysret.sh b/scripts/gen-vdso-valid-sysret.sh
index 97770a1..db56bd7 100755
--- a/scripts/gen-vdso-valid-sysret.sh
+++ b/scripts/gen-vdso-valid-sysret.sh
@@ -31,7 +31,7 @@
     *) continue ;;
     esac
 
-    syscall="${symbol#VDSO_CODE_SYSRET_mx_}"
+    syscall="${symbol#VDSO_CODE_SYSRET_zx_}"
     caller="${syscall#*_VIA_}"
     syscall="${syscall%_VIA_*}"
     if eval "test -z \"\$syscall_callers_${syscall}\""; then
@@ -50,7 +50,7 @@
     eval "local callers=\$syscall_callers_$syscall"
     for caller in $callers; do
       echo "\
-        case VDSO_CODE_SYSRET_mx_${syscall}_VIA_${caller} - VDSO_CODE_START:
+        case VDSO_CODE_SYSRET_zx_${syscall}_VIA_${caller} - VDSO_CODE_START:
             return true;\
 "
     done
diff --git a/scripts/git-version.sh b/scripts/git-version.sh
index e91a0dd..7c52482 100755
--- a/scripts/git-version.sh
+++ b/scripts/git-version.sh
@@ -12,5 +12,5 @@
 cat > "$1" <<EOF
 // This file is generated by $0.  DO NOT EDIT.
 #pragma once
-#define MAGENTA_GIT_REV "${REV}"
+#define ZIRCON_GIT_REV "${REV}"
 EOF
diff --git a/scripts/hikey-efi-boot-image b/scripts/hikey-efi-boot-image
index e9c5811..ad1683a 100755
--- a/scripts/hikey-efi-boot-image
+++ b/scripts/hikey-efi-boot-image
@@ -9,7 +9,7 @@
 # Uploads boot image (kernel+ramdisk) into RAM of a hikey960 which is in fastboot
 #  mode, and then executes image. Requires that the hikey be equiped with UEFI 
 #  bootloader.
-#  Assumes this is run from the magenta source directory.
+#  Assumes this is run from the zircon source directory.
 
 if [ "$#" -ne 1 ]; then
 	echo "Usage: hikey-efi-boot-image <uefi repo path>"
@@ -19,15 +19,15 @@
 
 #where the hikey repos live
 HIKEY_DIR=$1
-MAGENTA_DIR=.
-MAGENTA_BUILD=${MAGENTA_DIR}/build-magenta-hikey960-arm64
+ZIRCON_DIR=.
+ZIRCON_BUILD=${ZIRCON_DIR}/build-zircon-hikey960-arm64
 
-KERNEL=${MAGENTA_BUILD}/magenta.bin-dtb
-RAMDISK=${MAGENTA_BUILD}/bootdata.bin
+KERNEL=${ZIRCON_BUILD}/zircon.bin-dtb
+RAMDISK=${ZIRCON_BUILD}/bootdata.bin
 
-OUT_IMAGE=${MAGENTA_BUILD}/boot.img
-DTB_FILE=${MAGENTA_DIR}/kernel/target/hikey960/device-tree.dtb
-DT_IMAGE=${MAGENTA_BUILD}/dt.img
+OUT_IMAGE=${ZIRCON_BUILD}/boot.img
+DTB_FILE=${ZIRCON_DIR}/kernel/target/hikey960/device-tree.dtb
+DT_IMAGE=${ZIRCON_BUILD}/dt.img
 
 MEMBASE=0x00000000
 KERNEL_OFFSET=0x00080000
diff --git a/scripts/hikey-efi-flash-image b/scripts/hikey-efi-flash-image
index b70a23e..3fcab77 100755
--- a/scripts/hikey-efi-flash-image
+++ b/scripts/hikey-efi-flash-image
@@ -8,7 +8,7 @@
 
 # Flashes new boot image (kernel+ramdisk) into a hikey960 which is in fastboot
 #  mode.  Requires that the hikey be equiped with UEFI bootloader.
-#  Assumes this is run from the magenta source directory.
+#  Assumes this is run from the zircon source directory.
 
 if [ "$#" -ne 1 ]; then
 	echo "Usage: hikey-efi-flash-image <uefi repo path>"
@@ -19,15 +19,15 @@
 #where the hikey repos live
 HIKEY_DIR=$1
 
-MAGENTA_DIR=.
-MAGENTA_BUILD=${MAGENTA_DIR}/build-magenta-hikey960-arm64
+ZIRCON_DIR=.
+ZIRCON_BUILD=${ZIRCON_DIR}/build-zircon-hikey960-arm64
 
-KERNEL=${MAGENTA_BUILD}/magenta.bin-dtb
-RAMDISK=${MAGENTA_BUILD}/bootdata.bin
+KERNEL=${ZIRCON_BUILD}/zircon.bin-dtb
+RAMDISK=${ZIRCON_BUILD}/bootdata.bin
 
-OUT_IMAGE=${MAGENTA_BUILD}/boot.img
-DTB_FILE=${MAGENTA_DIR}/kernel/target/hikey960/device-tree.dtb
-DT_IMAGE=${MAGENTA_BUILD}/dt.img
+OUT_IMAGE=${ZIRCON_BUILD}/boot.img
+DTB_FILE=${ZIRCON_DIR}/kernel/target/hikey960/device-tree.dtb
+DT_IMAGE=${ZIRCON_BUILD}/dt.img
 
 MEMBASE=0x00000000
 KERNEL_OFFSET=0x00080000
diff --git a/scripts/make-magenta-x86-64-grub b/scripts/make-zircon-x86-64-grub
similarity index 79%
rename from scripts/make-magenta-x86-64-grub
rename to scripts/make-zircon-x86-64-grub
index e35eb93..39d9233 100755
--- a/scripts/make-magenta-x86-64-grub
+++ b/scripts/make-zircon-x86-64-grub
@@ -10,7 +10,7 @@
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-PROJECT="magenta-pc-x86-64"
+PROJECT="zircon-pc-x86-64"
 PROJECT_DIR="$DIR/../build-$PROJECT"
 BOOTDATA="${1:-$PROJECT_DIR/bootdata.bin}"
 
@@ -23,14 +23,14 @@
 
 TEMP="$(mktemp -d)"
 mkdir -p "$TEMP/boot/grub"
-cp "$PROJECT_DIR/magenta.bin" "$TEMP/boot/magenta.bin"
+cp "$PROJECT_DIR/zircon.bin" "$TEMP/boot/zircon.bin"
 cp "$BOOTDATA" "$TEMP/boot/ramdisk.bin"
 cat > "$TEMP/boot/grub/grub.cfg" << EOF
 set timeout=0
-menuentry "Magenta" {
-  multiboot /boot/magenta.bin
+menuentry "Zircon" {
+  multiboot /boot/zircon.bin
   module /boot/ramdisk.bin
 }
 EOF
-grub-mkrescue -o "$PROJECT_DIR/magenta.iso" "$TEMP"
+grub-mkrescue -o "$PROJECT_DIR/zircon.iso" "$TEMP"
 rm -rf "$TEMP"
diff --git a/scripts/netcmd b/scripts/netcmd
index 06e8c8d..8948b6f 100755
--- a/scripts/netcmd
+++ b/scripts/netcmd
@@ -8,6 +8,6 @@
 
 for netruncmd in ./build-*/tools/netruncmd ;
 do
-	$netruncmd magenta $*
+	$netruncmd zircon $*
 	break
 done
diff --git a/scripts/rodso.ld b/scripts/rodso.ld
index 3b70eca..7b5e92f 100644
--- a/scripts/rodso.ld
+++ b/scripts/rodso.ld
@@ -13,7 +13,7 @@
  * Ideally this could be accomplished without an explicit linker
  * script.  The linker would need an option to make the .dynamic
  * section (aka PT_DYNAMIC segment) read-only rather than read-write;
- * in fact that could be the default for Magenta/Fuchsia or for
+ * in fact that could be the default for Zircon/Fuchsia or for
  * anything using a dynamic linker like musl's that doesn't try to
  * write into the .dynamic section at runtime (for -shared that is;
  * for -pie and dynamically-linked executables there is the DT_DEBUG
diff --git a/scripts/run-magenta-x86-64 b/scripts/run-magenta-x86-64
deleted file mode 100755
index 5ec9210..0000000
--- a/scripts/run-magenta-x86-64
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright 2016 The Fuchsia Authors
-#
-# Use of this source code is governed by a MIT-style
-# license that can be found in the LICENSE file or at
-# https://opensource.org/licenses/MIT
-
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-exec $DIR/run-magenta -a x86-64 "$@"
diff --git a/scripts/run-magenta b/scripts/run-zircon
similarity index 96%
rename from scripts/run-magenta
rename to scripts/run-zircon
index 7805f5a..e759967 100755
--- a/scripts/run-magenta
+++ b/scripts/run-zircon
@@ -127,9 +127,9 @@
 fi
 
 if [[ "$ARCH" == "x86-64" ]]; then
-    PROJECT=magenta-pc-x86-64
+    PROJECT=zircon-pc-x86-64
 else
-    PROJECT=magenta-qemu-$ARCH
+    PROJECT=zircon-qemu-$ARCH
 fi
 
 BUILDDIR_SUFFIX=
@@ -190,7 +190,7 @@
 else
     ARGS+=" -serial stdio"
     if [[ "$ARCH" == "x86-64" && $VIRTIO == 0 ]]; then
-        # Enable Bochs VBE device, which Magenta has a device for
+        # Enable Bochs VBE device, which Zircon has a device for
         ARGS+=" -vga std"
     else
         # use the virtio gpu for display
@@ -215,7 +215,7 @@
     elif [[ "$DISKTYPE" == "ahci" ]]; then
         ARGS+=" -device ich9-ahci,id=ahci -device ide-drive,drive=mydisk,bus=ahci.0"
     elif [[ "$DISKTYPE" == "nvme" ]]; then
-        ARGS+=" -device nvme,drive=mydisk,serial=magenta"
+        ARGS+=" -device nvme,drive=mydisk,serial=zircon"
     else
         echo unrecognized disk type \"$DISKTYPE\"
         exit
@@ -311,7 +311,7 @@
 case $ARCH in
     arm64)
         QEMU=${QEMUDIR}qemu-system-aarch64
-        ARGS+=" -machine virt -kernel $BUILDDIR/magenta.elf"
+        ARGS+=" -machine virt -kernel $BUILDDIR/zircon.elf"
         if (( $DO_KVM )); then
           ARGS+=" -enable-kvm -cpu host"
         else
@@ -320,7 +320,7 @@
         ;;
     x86-64)
         QEMU=${QEMUDIR}qemu-system-x86_64
-        ARGS+=" -machine q35 -kernel $BUILDDIR/magenta.bin"
+        ARGS+=" -machine q35 -kernel $BUILDDIR/zircon.bin"
         if (( $DO_KVM )); then
           ARGS+=" -enable-kvm -cpu host,migratable=no"
         else
diff --git a/scripts/run-magenta-arm64 b/scripts/run-zircon-arm64
similarity index 87%
copy from scripts/run-magenta-arm64
copy to scripts/run-zircon-arm64
index 96d658a..7330b7a 100755
--- a/scripts/run-magenta-arm64
+++ b/scripts/run-zircon-arm64
@@ -8,4 +8,4 @@
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-exec $DIR/run-magenta -a arm64 "$@"
+exec $DIR/run-zircon -a arm64 "$@"
diff --git a/scripts/run-magenta-arm64 b/scripts/run-zircon-x86-64
similarity index 87%
rename from scripts/run-magenta-arm64
rename to scripts/run-zircon-x86-64
index 96d658a..0c731a4 100755
--- a/scripts/run-magenta-arm64
+++ b/scripts/run-zircon-x86-64
@@ -8,4 +8,4 @@
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-exec $DIR/run-magenta -a arm64 "$@"
+exec $DIR/run-zircon -a x86-64 "$@"
diff --git a/scripts/symbolize b/scripts/symbolize
index 2fd6b9d..7ea817e 100755
--- a/scripts/symbolize
+++ b/scripts/symbolize
@@ -8,20 +8,20 @@
 
 """
 
-This tool will symbolize a crash from Magenta's crash logger, adding
+This tool will symbolize a crash from Zircon's crash logger, adding
 function names and, if available, source code locations (filenames and
 line numbers from debug info).
 
 Example usage #1:
-  ./scripts/run-magenta -a x86-64 | ./scripts/symbolize devmgr.elf --build-dir=build-magenta-pc-x86-64
+  ./scripts/run-zircon -a x86-64 | ./scripts/symbolize devmgr.elf --build-dir=build-zircon-pc-x86-64
 
 Example usage #2:
-  ./scripts/symbolize devmgr.elf --build-dir=build-magenta-pc-x86-64
-  <copy and paste output from Magenta>
+  ./scripts/symbolize devmgr.elf --build-dir=build-zircon-pc-x86-64
+  <copy and paste output from Zircon>
 
-Example usage #3 (for magenta kernel output):
-  ./scripts/symbolize --build-dir=build-magenta-pc-x86-64
-  <copy and paste output from Magenta>
+Example usage #3 (for zircon kernel output):
+  ./scripts/symbolize --build-dir=build-zircon-pc-x86-64
+  <copy and paste output from Zircon>
 
 
 """
@@ -195,12 +195,12 @@
     parser.set_defaults(echo=True)
     args = parser.parse_args()
 
-    magenta_build_dir = os.path.join(
-        os.path.dirname(SCRIPT_DIR), "build-magenta-pc-x86-64")
-    if not os.path.exists(magenta_build_dir):
-        magenta_build_dir = os.path.join(
-            os.path.dirname(SCRIPT_DIR), os.pardir, "out", "build-magenta", "build-magenta-pc-x86-64")
-    build_dirs = [magenta_build_dir]
+    zircon_build_dir = os.path.join(
+        os.path.dirname(SCRIPT_DIR), "build-zircon-pc-x86-64")
+    if not os.path.exists(zircon_build_dir):
+        zircon_build_dir = os.path.join(
+            os.path.dirname(SCRIPT_DIR), os.pardir, "out", "build-zircon", "build-zircon-pc-x86-64")
+    build_dirs = [zircon_build_dir]
     if args.build_dir:
         build_dirs = args.build_dir + build_dirs
     else:
@@ -229,15 +229,15 @@
         "dso: id=([0-9a-z]+) base=(0x[0-9a-f]+) name=(.+)$")
     disasm_re = re.compile("^ *(0x[0-9a-f]+)( .+)$")
 
-    # Magenta backtraces
-    magenta_crash_re = re.compile("^MAGENTA KERNEL PANIC$")
+    # Zircon backtraces
+    zircon_crash_re = re.compile("^ZIRCON KERNEL PANIC$")
     # TODO(cja): Add ARM to the regex
-    magenta_pc_re = re.compile("RIP: (0x[0-9a-z]+)")
-    magenta_bt_re = re.compile(full_prefix +
+    zircon_pc_re = re.compile("RIP: (0x[0-9a-z]+)")
+    zircon_bt_re = re.compile(full_prefix +
         "bt#(\d+): (\dx[0-9a-fA-F]+)$")
-    magenta_elf_path = ''
-    magenta_bt = False
-    magenta_pc = ''
+    zircon_elf_path = ''
+    zircon_bt = False
+    zircon_pc = ''
 
     while True:
         line = args.file.readline()
@@ -268,7 +268,7 @@
                 name_to_buildid = {}
                 total_stack_size = 0
                 prev_sp = None
-                magenta_bt = False
+                zircon_bt = False
             if end_of_file:
                 break
         m = arch_re.match(line)
@@ -283,7 +283,7 @@
             name_to_buildid[name] = buildid
             continue
         m = btre.match(line)
-        if m and not magenta_bt:
+        if m and not zircon_bt:
             frame_num = m.group(2)
             m = bt_with_offset_re.match(line)
             if m:
@@ -327,29 +327,29 @@
             # fallthru print if we don't recognize the format of the backtrace entry
             processed_lines.append("#%s: (unknown)\n" % (frame_num,))
 
-        # Magenta Specific Handling
-        if magenta_crash_re.search(line):
-            magenta_elf_path = find_file_in_build_dir("magenta.elf", build_dirs)
-            if magenta_elf_path:
-                magenta_bt = True
+        # Zircon Specific Handling
+        if zircon_crash_re.search(line):
+            zircon_elf_path = find_file_in_build_dir("zircon.elf", build_dirs)
+            if zircon_elf_path:
+                zircon_bt = True
             else:
-                sys.stderr.write("Symbolize could not find the magenta elf binary. Perhaps you need to build "
-                                  "magenta or specify the build directory with -b?\n")
-        m = magenta_pc_re.search(line)
+                sys.stderr.write("Symbolize could not find the zircon elf binary. Perhaps you need to build "
+                                  "zircon or specify the build directory with -b?\n")
+        m = zircon_pc_re.search(line)
         if m:
-            magenta_pc = m.group(1)
-        m = magenta_bt_re.match(line)
-        if m and magenta_bt:
+            zircon_pc = m.group(1)
+        m = zircon_bt_re.match(line)
+        if m and zircon_bt:
             frame_num = m.group(2)
             addr = m.group(3)
             # If we saw the instruction pointer for the fault/panic then use it once
-            if magenta_pc:
-                prefix = "   pc: %s => " % magenta_pc
-                a2l_out = run_tool(arch, "addr2line", "-Cpife", magenta_elf_path,
-                        magenta_pc)
+            if zircon_pc:
+                prefix = "   pc: %s => " % zircon_pc
+                a2l_out = run_tool(arch, "addr2line", "-Cpife", zircon_elf_path,
+                        zircon_pc)
                 processed_lines.append(prefix +
                         a2l_out.replace("(inlined", (" " * len(prefix)) + "(inlined"))
-                magenta_pc = None
+                zircon_pc = None
 
 
             prefix = "bt#%s: %s => " % (frame_num, addr)
@@ -359,7 +359,7 @@
             # more correct results in the presence of inlining and
             # 'noreturn' functions.  (See MG-842.)
             call_addr = "0x%x" % (int(addr, 16) - 1)
-            a2l_out = run_tool(arch, "addr2line", "-Cpife", magenta_elf_path,
+            a2l_out = run_tool(arch, "addr2line", "-Cpife", zircon_elf_path,
                                call_addr)
             # In the case of inlined methods, it is more readable if the
             # inlined lines are aligned to be to the right of "=>".
diff --git a/scripts/upload-toolchain b/scripts/upload-toolchain
index 200911b..51d6aa8 100755
--- a/scripts/upload-toolchain
+++ b/scripts/upload-toolchain
@@ -6,21 +6,21 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-# This script builds the Magenta toolchain and uploads it to Google Storage.
+# This script builds the Zircon toolchain and uploads it to Google Storage.
 
 # This script is expected to be executed on Jenkins, as part of a continuous
 # builds infrastructure.  As such, it it organized to accept the arch target
 # as an environment variable, since that is how Jenkins passes arguments from
 # matrix build configurations.
 
-# This script also assumes a directory structure based on the Magenta Jiri
+# This script also assumes a directory structure based on the Zircon Jiri
 # manifests.  Jenkins uses these manifests to sync the code.
 
 set -e
 set -x
 
 # We assume the following directory structure:
-# ./magenta/scripts
+# ./zircon/scripts
 # ./third_party/gcc_none_toolchains
 readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 cd "${SCRIPT_DIR}/../../third_party/gcc_none_toolchains"
@@ -63,5 +63,5 @@
 # Upload the prebuilts to Google Storage.  We don't do any authentication here because
 # we assume that the environment has been set up with auth already.  For notes on
 # how to do that, see: https://cloud.google.com/storage/docs/authentication
-readonly GS_BUCKET="gs://fuchsia-build/magenta/toolchain/${ARCH}-${ABI}/${OS}-${HOSTARCH}"
+readonly GS_BUCKET="gs://fuchsia-build/zircon/toolchain/${ARCH}-${ABI}/${OS}-${HOSTARCH}"
 gsutil cp "${TARBALL}" "${GS_BUCKET}/${GIT_SHA}"
diff --git a/scripts/upload-toolchain.README.md b/scripts/upload-toolchain.README.md
index 1fb2ab3..0940992 100644
--- a/scripts/upload-toolchain.README.md
+++ b/scripts/upload-toolchain.README.md
@@ -1,4 +1,4 @@
-# Magenta Toolchain Prebuilts
+# Zircon Toolchain Prebuilts
 
 These prebuilts were built automatically on the Fuchsia build infrastructure.
 
@@ -10,10 +10,10 @@
 upstream sources have been mirrored to Google Storage for posterity.
 
 List all the upstream sources:
-gsutil ls gs://fuchsia-build/magenta/toolchain/sources/
+gsutil ls gs://fuchsia-build/zircon/toolchain/sources/
 
 You can download them with HTTPS at addresses with the form of:
-https://fuchsia-build.storage.googleapis.com/magenta/toolchain/sources/[package name]
-(E.g. https://fuchsia-build.storage.googleapis.com/magenta/toolchain/sources/gcc-5.3.0.tar.bz2)
+https://fuchsia-build.storage.googleapis.com/zircon/toolchain/sources/[package name]
+(E.g. https://fuchsia-build.storage.googleapis.com/zircon/toolchain/sources/gcc-5.3.0.tar.bz2)
 
 # Git SHA used to build this package:
diff --git a/scripts/magenta.elf-gdb.py b/scripts/zircon.elf-gdb.py
similarity index 80%
rename from scripts/magenta.elf-gdb.py
rename to scripts/zircon.elf-gdb.py
index 40e30d2..06c20a2 100644
--- a/scripts/magenta.elf-gdb.py
+++ b/scripts/zircon.elf-gdb.py
@@ -4,7 +4,7 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 
-# GDB support for magenta kernel.
+# GDB support for zircon kernel.
 
 # TODO(dje): gdb should let us use a better command class than COMMAND_DATA.
 # TODO(dje): Add arm64 support.
@@ -23,12 +23,12 @@
   long = int
 
 # The command prefix, passed in from gdbinit.py.
-_MAGENTA_COMMAND_PREFIX = "magenta"
+_ZIRCON_COMMAND_PREFIX = "zircon"
 _KERNEL_EXCEPTION_UNWINDER_PARAMETER = "kernel-exception-unwinder"
 
 _THREAD_MAGIC = 0x74687264
 
-print("Loading magenta.elf-gdb.py ...")
+print("Loading zircon.elf-gdb.py ...")
 
 
 def _is_x86_64():
@@ -47,57 +47,57 @@
 #  gdb.execute("set remotetimeout 10")
 
 
-class _MagentaPrefix(gdb.Command):
-  """magenta command prefix"""
+class _ZirconPrefix(gdb.Command):
+  """zircon command prefix"""
 
   def __init__(self):
-    super(_MagentaPrefix, self).__init__("%s" % (_MAGENTA_COMMAND_PREFIX),
+    super(_ZirconPrefix, self).__init__("%s" % (_ZIRCON_COMMAND_PREFIX),
                                         gdb.COMMAND_DATA,
                                         prefix=True)
 
 
-class _InfoMagenta(gdb.Command):
-  """info magenta command prefix"""
+class _InfoZircon(gdb.Command):
+  """info zircon command prefix"""
 
   def __init__(self):
-    super(_InfoMagenta, self).__init__("info %s" % (_MAGENTA_COMMAND_PREFIX),
+    super(_InfoZircon, self).__init__("info %s" % (_ZIRCON_COMMAND_PREFIX),
                                        gdb.COMMAND_DATA,
                                        prefix=True)
 
 
-class _SetMagenta(gdb.Command):
-  """set magenta command prefix"""
+class _SetZircon(gdb.Command):
+  """set zircon command prefix"""
 
   def __init__(self):
-    super(_SetMagenta, self).__init__("set %s" % (_MAGENTA_COMMAND_PREFIX),
+    super(_SetZircon, self).__init__("set %s" % (_ZIRCON_COMMAND_PREFIX),
                                       gdb.COMMAND_DATA,
                                       prefix=True)
 
 
-class _ShowMagenta(gdb.Command):
-  """show magenta command prefix"""
+class _ShowZircon(gdb.Command):
+  """show zircon command prefix"""
 
   def __init__(self):
-    super(_ShowMagenta, self).__init__("show %s" % (_MAGENTA_COMMAND_PREFIX),
+    super(_ShowZircon, self).__init__("show %s" % (_ZIRCON_COMMAND_PREFIX),
                                        gdb.COMMAND_DATA,
                                        prefix=True)
 
 
-class _MagentaMaxInfoThreads(gdb.Parameter):
-  """Parameter to limit output of "info magenta threads" command.
+class _ZirconMaxInfoThreads(gdb.Parameter):
+  """Parameter to limit output of "info zircon threads" command.
 
   This parameter is an escape hatch to catch corrupted lists.
-  We don't want "info magenta threads" to loop forever.
+  We don't want "info zircon threads" to loop forever.
 
   The value is the maximum number of threads that will be printed.
   """
 
-  set_doc = "Set the maximum number of magenta threads to print."
-  show_doc = "Show the maximum number of magenta threads to print."
+  set_doc = "Set the maximum number of zircon threads to print."
+  show_doc = "Show the maximum number of zircon threads to print."
 
   def __init__(self):
-    super(_MagentaMaxInfoThreads, self).__init__(
-        "%s max-info-threads" % (_MAGENTA_COMMAND_PREFIX),
+    super(_ZirconMaxInfoThreads, self).__init__(
+        "%s max-info-threads" % (_ZIRCON_COMMAND_PREFIX),
         gdb.COMMAND_DATA, gdb.PARAM_UINTEGER)
     self.value = 1000
 
@@ -114,21 +114,21 @@
     return "Maximum number of threads to print been set to %s." % (value)
 
 
-class _MagentaMaxInfoProcesses(gdb.Parameter):
-  """Parameter to limit output of "info magenta processes" command.
+class _ZirconMaxInfoProcesses(gdb.Parameter):
+  """Parameter to limit output of "info zircon processes" command.
 
   This parameter is an escape hatch to catch corrupted lists.
-  We don't want "info magenta processes" to loop forever.
+  We don't want "info zircon processes" to loop forever.
 
   The value is the maximum number of processes that will be printed.
   """
 
-  set_doc = "Set the maximum number of magenta processes to print."
-  show_doc = "Show the maximum number of magenta processes to print."
+  set_doc = "Set the maximum number of zircon processes to print."
+  show_doc = "Show the maximum number of zircon processes to print."
 
   def __init__(self):
-    super(_MagentaMaxInfoProcesses, self).__init__(
-        "%s max-info-processes" % (_MAGENTA_COMMAND_PREFIX),
+    super(_ZirconMaxInfoProcesses, self).__init__(
+        "%s max-info-processes" % (_ZIRCON_COMMAND_PREFIX),
         gdb.COMMAND_DATA, gdb.PARAM_UINTEGER)
     self.value = 1000
 
@@ -145,21 +145,21 @@
     return "Maximum number of processes to print been set to %s." % (value)
 
 
-class _MagentaMaxInfoHandles(gdb.Parameter):
-  """Parameter to limit output of "info magenta handles" command.
+class _ZirconMaxInfoHandles(gdb.Parameter):
+  """Parameter to limit output of "info zircon handles" command.
 
   This parameter is an escape hatch to catch corrupted lists.
-  We don't want "info magenta handles" to loop forever.
+  We don't want "info zircon handles" to loop forever.
 
   The value is the maximum number of handles that will be printed.
   """
 
-  set_doc = "Set the maximum number of magenta handles to print."
-  show_doc = "Show the maximum number of magenta handles to print."
+  set_doc = "Set the maximum number of zircon handles to print."
+  show_doc = "Show the maximum number of zircon handles to print."
 
   def __init__(self):
-    super(_MagentaMaxInfoHandles, self).__init__(
-        "%s max-info-handles" % (_MAGENTA_COMMAND_PREFIX),
+    super(_ZirconMaxInfoHandles, self).__init__(
+        "%s max-info-handles" % (_ZIRCON_COMMAND_PREFIX),
         gdb.COMMAND_DATA, gdb.PARAM_UINTEGER)
     self.value = 1000
 
@@ -177,7 +177,7 @@
 
 
 def containerof(node_ptr, type_name, member_name):
-  """Python version of magenta's containerof macro."""
+  """Python version of zircon's containerof macro."""
   # TODO(dje): This could only be computed once.
   # For more popular types, compute all possible once.
   char_ptr = gdb.lookup_type("char").pointer()
@@ -187,30 +187,30 @@
   return (ptr - offsetof).cast(type_object_ptr)
 
 
-def _build_magenta_pretty_printers():
-  pp = gdb.printing.RegexpCollectionPrettyPrinter("magenta")
+def _build_zircon_pretty_printers():
+  pp = gdb.printing.RegexpCollectionPrettyPrinter("zircon")
   # Insert printer registration here.
-  #pp.add_printer("foo", "^foo$", _MagentaFooPrinter)
+  #pp.add_printer("foo", "^foo$", _ZirconFooPrinter)
   return pp
 
 
-def register_magenta_pretty_printers(obj):
+def register_zircon_pretty_printers(obj):
   if obj is None:
     obj = gdb
-  gdb.printing.register_pretty_printer(obj, _build_magenta_pretty_printers(),
+  gdb.printing.register_pretty_printer(obj, _build_zircon_pretty_printers(),
                                        replace=True)
 
 
 def _get_thread_list():
   """ Return a list of all thread_t threads.
 
-  The result is constrained by "magenta max-info-threads".
+  The result is constrained by "zircon max-info-threads".
   """
   threads = []
   head = gdb.parse_and_eval("&thread_list")
   t = head["next"]
   count = 0
-  max_threads = gdb.parameter("%s max-info-threads" % (_MAGENTA_COMMAND_PREFIX))
+  max_threads = gdb.parameter("%s max-info-threads" % (_ZIRCON_COMMAND_PREFIX))
   int_type = gdb.lookup_type("int")
   ptr_size = int_type.pointer().sizeof
   # Note: A "corrupted" list can happen for a short time while an
@@ -241,14 +241,14 @@
 def _get_process_list():
   """Return list of all processes.
 
-  The result is constrained by "magenta max-info-processes".
+  The result is constrained by "zircon max-info-processes".
   """
   processes = []
   head = gdb.parse_and_eval("&process_list")
   head = head["head_"]
   p = head
   count = 0
-  max_processes = gdb.parameter("%s max-info-processes" % (_MAGENTA_COMMAND_PREFIX))
+  max_processes = gdb.parameter("%s max-info-processes" % (_ZIRCON_COMMAND_PREFIX))
   int_type = gdb.lookup_type("int")
   ptr_size = int_type.pointer().sizeof
   # Note: A "corrupted" list can happen for a short time while an
@@ -278,14 +278,14 @@
 def _get_handle_list(process):
   """Return list of all handles of process.
 
-  The result is constrained by "magenta max-info-handles".
+  The result is constrained by "zircon max-info-handles".
   """
   handles = []
   head = process["handles_"]
   head = head["head_"]
   h = head
   count = 0
-  max_handles = gdb.parameter("%s max-info-handles" % (_MAGENTA_COMMAND_PREFIX))
+  max_handles = gdb.parameter("%s max-info-handles" % (_ZIRCON_COMMAND_PREFIX))
   int_type = gdb.lookup_type("int")
   ptr_size = int_type.pointer().sizeof
   # Note: A "corrupted" list can happen for a short time while an
@@ -326,32 +326,32 @@
       number, pid, thread.address, name, thread["state"]))
 
 
-class _InfoMagentaThreads(gdb.Command):
-  """info magenta threads command
+class _InfoZirconThreads(gdb.Command):
+  """info zircon threads command
 
-  This command prints a list of all magenta threads.
+  This command prints a list of all zircon threads.
   TODO: Allow specifying which threads to print.
   """
 
   def __init__(self):
-    super(_InfoMagentaThreads, self).__init__("info %s threads" % (_MAGENTA_COMMAND_PREFIX),
+    super(_InfoZirconThreads, self).__init__("info %s threads" % (_ZIRCON_COMMAND_PREFIX),
                                               gdb.COMMAND_USER)
 
   def invoke(self, arg, from_tty):
     # Do this first to make sure the previous value gets cleared out.
     # There's no way to unset a convenience var, so KISS.
-    gdb.execute("set $mx_threads = (thread_t*[1]) { 0 }")
+    gdb.execute("set $zx_threads = (thread_t*[1]) { 0 }")
     tls_entry_lkuser = gdb.parse_and_eval("TLS_ENTRY_LKUSER")
     threads = _get_thread_list()
     num_threads = len(threads)
     # The array is origin-1-indexed. Have a null first entry to KISS.
-    gdb.execute("set $mx_threads = (thread_t*[%d]) { 0 }" % (num_threads + 1))
+    gdb.execute("set $zx_threads = (thread_t*[%d]) { 0 }" % (num_threads + 1))
 
     # Populate the array first, before printing the summary, to make sure this
     # gets done even if there's an error during printing.
     num = 1
     for thread_ptr in threads:
-      gdb.execute("set $mx_threads[%d] = (thread_t*) %u" % (num, thread_ptr))
+      gdb.execute("set $zx_threads[%d] = (thread_t*) %u" % (num, thread_ptr))
       num += 1
 
     # Translating gdb values to python often trips over these. Heads up.
@@ -374,7 +374,7 @@
       gdb.execute("set print address %s" % (save_print_address))
       gdb.execute("set print symbol %s" % (save_print_symbol))
     if num_threads:
-      print("Note: Each thread is now available in $mx_threads[num].")
+      print("Note: Each thread is now available in $zx_threads[num].")
     else:
       print("<no threads>")
 
@@ -386,32 +386,32 @@
       number, process.address, process["id_"], state))
 
 
-class _InfoMagentaProcesses(gdb.Command):
-  """info magenta processes command
+class _InfoZirconProcesses(gdb.Command):
+  """info zircon processes command
 
-  This command prints a list of all magenta processes.
+  This command prints a list of all zircon processes.
   TODO: Allow specifying which processes to print.
   """
 
   def __init__(self):
-    super(_InfoMagentaProcesses, self).__init__("info %s processes" % (_MAGENTA_COMMAND_PREFIX),
+    super(_InfoZirconProcesses, self).__init__("info %s processes" % (_ZIRCON_COMMAND_PREFIX),
                                               gdb.COMMAND_USER)
 
   def invoke(self, arg, from_tty):
     # Do this first to make sure the previous value gets cleared out.
     # There's no way to unset a convenience var, so KISS.
-    gdb.execute("set $mx_processes = (ProcessDispatcher*[1]) { 0 }")
+    gdb.execute("set $zx_processes = (ProcessDispatcher*[1]) { 0 }")
     tls_entry_lkuser = gdb.parse_and_eval("TLS_ENTRY_LKUSER")
     processes = _get_process_list()
     num_processes = len(processes)
     # The array is origin-1-indexed. Have a null first entry to KISS.
-    gdb.execute("set $mx_processes = (ProcessDispatcher*[%d]) { 0 }" % (num_processes + 1))
+    gdb.execute("set $zx_processes = (ProcessDispatcher*[%d]) { 0 }" % (num_processes + 1))
 
     # Populate the array first, before printing the summary, to make sure this
     # gets done even if there's an error during printing.
     num = 1
     for process_ptr in processes:
-      gdb.execute("set $mx_processes[%d] = (ProcessDispatcher*) %u" % (num, process_ptr))
+      gdb.execute("set $zx_processes[%d] = (ProcessDispatcher*) %u" % (num, process_ptr))
       num += 1
 
     # Translating gdb values to python often trips over these. Heads up.
@@ -432,7 +432,7 @@
       gdb.execute("set print address %s" % (save_print_address))
       gdb.execute("set print symbol %s" % (save_print_symbol))
     if num_processes:
-      print("Note: Each process is now available in $mx_processes[num].")
+      print("Note: Each process is now available in $zx_processes[num].")
     else:
       print("<no processes>")
 
@@ -454,15 +454,15 @@
       number, handle.address, process_id, rights, dispatcher_text))
 
 
-class _InfoMagentaHandles(gdb.Command):
-  """info magenta handles command
+class _InfoZirconHandles(gdb.Command):
+  """info zircon handles command
 
-  This command prints a list of all magenta handles.
+  This command prints a list of all zircon handles.
   TODO: Allow specifying which handles to print.
   """
 
   def __init__(self):
-    super(_InfoMagentaHandles, self).__init__("info %s handles" % (_MAGENTA_COMMAND_PREFIX),
+    super(_InfoZirconHandles, self).__init__("info %s handles" % (_ZIRCON_COMMAND_PREFIX),
                                               gdb.COMMAND_USER)
 
   def invoke(self, arg, from_tty):
@@ -497,8 +497,8 @@
       gdb.execute("set print symbol %s" % (save_print_symbol))
 
 
-class _MagentaKernelExceptionUnwinder(gdb.Parameter):
-  """Parameter to enable magenta kernel exception unwinding.
+class _ZirconKernelExceptionUnwinder(gdb.Parameter):
+  """Parameter to enable zircon kernel exception unwinding.
 
   This parameter is an escape hatch in case there are problems with the unwinder.
 
@@ -507,12 +507,12 @@
   "flushregs" if s/he wants to reprint a recent backtrace.
   """
 
-  set_doc = "Set whether the magenta kernel exception unwinder is enabled."
-  show_doc = "Show whether the magenta kernel exception unwinder is enabled."
+  set_doc = "Set whether the zircon kernel exception unwinder is enabled."
+  show_doc = "Show whether the zircon kernel exception unwinder is enabled."
 
   def __init__(self):
-    super(_MagentaKernelExceptionUnwinder, self).__init__(
-        "%s %s" % (_MAGENTA_COMMAND_PREFIX, _KERNEL_EXCEPTION_UNWINDER_PARAMETER),
+    super(_ZirconKernelExceptionUnwinder, self).__init__(
+        "%s %s" % (_ZIRCON_COMMAND_PREFIX, _KERNEL_EXCEPTION_UNWINDER_PARAMETER),
         gdb.COMMAND_DATA, gdb.PARAM_BOOLEAN)
     self.value = True
 
@@ -587,7 +587,7 @@
   def __call__(self, pending_frame):
     try:
       # Punt if disabled.
-      if not gdb.parameter("%s %s" % (_MAGENTA_COMMAND_PREFIX, _KERNEL_EXCEPTION_UNWINDER_PARAMETER)):
+      if not gdb.parameter("%s %s" % (_ZIRCON_COMMAND_PREFIX, _KERNEL_EXCEPTION_UNWINDER_PARAMETER)):
         return None
       # Note: We use rip,rsp here instead of pc,sp to work around bug 20128
       #pc = pending_frame.read_register("pc").cast(self.uintptr_t)
@@ -628,24 +628,24 @@
       return None
 
 
-_MagentaPrefix()
-_InfoMagenta()
-_SetMagenta()
-_ShowMagenta()
+_ZirconPrefix()
+_InfoZircon()
+_SetZircon()
+_ShowZircon()
 
-_MagentaMaxInfoThreads()
-_MagentaMaxInfoProcesses()
-_MagentaMaxInfoHandles()
+_ZirconMaxInfoThreads()
+_ZirconMaxInfoProcesses()
+_ZirconMaxInfoHandles()
 
-_InfoMagentaThreads()
-_InfoMagentaProcesses()
-_InfoMagentaHandles()
+_InfoZirconThreads()
+_InfoZirconProcesses()
+_InfoZirconHandles()
 
-_MagentaKernelExceptionUnwinder()
+_ZirconKernelExceptionUnwinder()
 
 def _install():
   current_objfile = gdb.current_objfile()
-  register_magenta_pretty_printers(current_objfile)
+  register_zircon_pretty_printers(current_objfile)
   if current_objfile is not None and _is_x86_64():
     gdb.unwinder.register_unwinder(current_objfile, _Amd64KernelExceptionUnwinder(), True)
 
diff --git a/system/core/crashlogger/backtrace.cpp b/system/core/crashlogger/backtrace.cpp
index c7fcc53..3ae7777 100644
--- a/system/core/crashlogger/backtrace.cpp
+++ b/system/core/crashlogger/backtrace.cpp
@@ -16,9 +16,9 @@
 #include <ngunwind/libunwind.h>
 #include <ngunwind/fuchsia.h>
 
-#include <magenta/types.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 
 #include <fbl/alloc_checker.h>
 #include <fbl/array.h>
@@ -61,7 +61,7 @@
 
     dsoinfo_t* dso_list() { return dso_list_; }
 
-    mx_status_t GetDebugInfo(uintptr_t pc, dsoinfo_t** out_dso, backtrace_state** out_bt_state);
+    zx_status_t GetDebugInfo(uintptr_t pc, dsoinfo_t** out_dso, backtrace_state** out_bt_state);
     
  private:
     dsoinfo_t* dso_list_;
@@ -105,26 +105,26 @@
 }
 
 // Find the DSO and debug info (backtrace_state) for PC.
-// Returns MX_ERR_NOT_FOUND if |pc| is not in any DSO.
-// Otherwise the result is MX_OK, even if there is no extended debug
+// Returns ZX_ERR_NOT_FOUND if |pc| is not in any DSO.
+// Otherwise the result is ZX_OK, even if there is no extended debug
 // info for libbacktrace (e.g., -g1 info).
-// If the result is MX_OK then |*out_dso| is set.
-// If the result is MX_OK then |*out_bt_state| is set to the
+// If the result is ZX_OK then |*out_dso| is set.
+// If the result is ZX_OK then |*out_bt_state| is set to the
 // accompanying libbacktrace state if available or nullptr if not.
 
-mx_status_t DebugInfoCache::GetDebugInfo(uintptr_t pc,
+zx_status_t DebugInfoCache::GetDebugInfo(uintptr_t pc,
                                          dsoinfo_t** out_dso,
                                          backtrace_state** out_bt_state) {
     dsoinfo_t* dso = dso_lookup(dso_list_, pc);
     if (dso == nullptr) {
         debugf(1, "No DSO found for pc %p\n", (void*) pc);
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
 #if 1 // Skip using libbacktrace until leaks are fixed. MG-351
     *out_dso = dso;
     *out_bt_state = nullptr;
-    return MX_OK;
+    return ZX_OK;
 #endif
 
     // If we failed to initialize the cache (OOM) we can still report the
@@ -132,7 +132,7 @@
     if (!cache_avail_) {
         *out_dso = dso;
         *out_bt_state = nullptr;
-        return MX_OK;
+        return ZX_OK;
     }
 
     const size_t nr_ways = ways_.size();
@@ -142,12 +142,12 @@
             debugf(1, "using cached debug info entry for pc %p\n", (void*) pc);
             *out_dso = dso;
             *out_bt_state = ways_[i].bt_state;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
     // PC is in a DSO, but not found in the cache.
-    // N.B. From this point on the result is MX_OK.
+    // N.B. From this point on the result is ZX_OK.
     // If there is an "error" the user can still print something (and there's
     // no point in having error messages pollute the backtrace, at least by
     // default).
@@ -157,9 +157,9 @@
 
     const char* debug_file = nullptr;
     auto status = dso_find_debug_file(dso, &debug_file);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         // There's no additional debug file available, but we did find the DSO.
-        return MX_OK;
+        return ZX_OK;
     }
 
     struct backtrace_state* bt_state =
@@ -167,7 +167,7 @@
                                bt_error_callback, nullptr);
     if (bt_state == nullptr) {
         debugf(1, "backtrace_create_state failed (OOM)\n");
-        return MX_OK;
+        return ZX_OK;
     }
 
     // last_used_+1: KISS until there's data warranting something better
@@ -188,7 +188,7 @@
     ways_[way].bt_state = bt_state;
     *out_bt_state = bt_state;
     last_used_ = way;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Data to pass back from backtrace_pcinfo.
@@ -221,7 +221,7 @@
     backtrace_state* bt_state;
     auto status = di_cache->GetDebugInfo(pc, &dso, &bt_state);
 
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         // The pc is not in any DSO.
         printf("bt#%02d: pc %p sp %p\n",
                n, (void*) pc, (void*) sp);
@@ -265,7 +265,7 @@
     return 1;
 }
 
-void backtrace(mx_handle_t process, mx_handle_t thread,
+void backtrace(zx_handle_t process, zx_handle_t thread,
                uintptr_t pc, uintptr_t sp, uintptr_t fp,
                bool use_libunwind) {
     // Prepend "app:" to the name we print for the process binary to tell the
@@ -274,12 +274,12 @@
     // N.B. The symbolize script looks for "app" and "app:".
 #define PROCESS_NAME_PREFIX "app:"
 #define PROCESS_NAME_PREFIX_LEN (sizeof(PROCESS_NAME_PREFIX) - 1)
-    char name[MX_MAX_NAME_LEN + PROCESS_NAME_PREFIX_LEN];
+    char name[ZX_MAX_NAME_LEN + PROCESS_NAME_PREFIX_LEN];
     strcpy(name, PROCESS_NAME_PREFIX);
-    auto status = mx_object_get_property(process, MX_PROP_NAME, name + PROCESS_NAME_PREFIX_LEN,
+    auto status = zx_object_get_property(process, ZX_PROP_NAME, name + PROCESS_NAME_PREFIX_LEN,
                                          sizeof(name) - PROCESS_NAME_PREFIX_LEN);
-    if (status != MX_OK) {
-        print_mx_error("mx_object_get_property, falling back to \"app\" for program name", status);
+    if (status != ZX_OK) {
+        print_zx_error("zx_object_get_property, falling back to \"app\" for program name", status);
         strlcpy(name, "app", sizeof(name));
     }
     dsoinfo_t* dso_list = dso_fetch_list(process, name);
diff --git a/system/core/crashlogger/backtrace.h b/system/core/crashlogger/backtrace.h
index 70a0466..895ef8b 100644
--- a/system/core/crashlogger/backtrace.h
+++ b/system/core/crashlogger/backtrace.h
@@ -4,13 +4,13 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
 #include <inttypes.h>
 
-void backtrace(mx_handle_t process, mx_handle_t thread,
+void backtrace(zx_handle_t process, zx_handle_t thread,
                uintptr_t pc, uintptr_t sp, uintptr_t fp,
                bool use_libunwind);
 
diff --git a/system/core/crashlogger/crashlogger.cpp b/system/core/crashlogger/crashlogger.cpp
index ea87cc3..255abfe 100644
--- a/system/core/crashlogger/crashlogger.cpp
+++ b/system/core/crashlogger/crashlogger.cpp
@@ -9,16 +9,16 @@
 #include <string.h>
 #include <threads.h>
 
-#include <magenta/assert.h>
-#include <magenta/crashlogger.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/debug.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/port.h>
-#include <magenta/threads.h>
-#include <mxio/util.h>
+#include <zircon/assert.h>
+#include <zircon/crashlogger.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/debug.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/threads.h>
+#include <fdio/util.h>
 #include <pretty/hexdump.h>
 
 #include "backtrace.h"
@@ -27,9 +27,9 @@
 #include "utils.h"
 
 #if defined(__x86_64__)
-using gregs_type = mx_x86_64_general_regs_t;
+using gregs_type = zx_x86_64_general_regs_t;
 #elif defined(__aarch64__)
-using gregs_type = mx_arm64_general_regs_t;
+using gregs_type = zx_arm64_general_regs_t;
 #else
 using gregs_type = int; // unsupported arch
 #endif
@@ -50,7 +50,7 @@
 // won't kill it, and thus the kill process).
 
 static bool is_resumable_swbreak(uint32_t excp_type) {
-    if (excp_type == MX_EXCP_SW_BREAKPOINT && swbreak_backtrace_enabled)
+    if (excp_type == ZX_EXCP_SW_BREAKPOINT && swbreak_backtrace_enabled)
         return true;
     return false;
 }
@@ -77,19 +77,19 @@
 
 const char* excp_type_to_str(uint32_t type) {
     switch (type) {
-    case MX_EXCP_GENERAL:
+    case ZX_EXCP_GENERAL:
         return "general fault";
-    case MX_EXCP_FATAL_PAGE_FAULT:
+    case ZX_EXCP_FATAL_PAGE_FAULT:
         return "fatal page fault";
-    case MX_EXCP_UNDEFINED_INSTRUCTION:
+    case ZX_EXCP_UNDEFINED_INSTRUCTION:
         return "undefined instruction";
-    case MX_EXCP_SW_BREAKPOINT:
+    case ZX_EXCP_SW_BREAKPOINT:
         return "sw breakpoint";
-    case MX_EXCP_HW_BREAKPOINT:
+    case ZX_EXCP_HW_BREAKPOINT:
         return "hw breakpoint";
-    case MX_EXCP_UNALIGNED_ACCESS:
+    case ZX_EXCP_UNALIGNED_ACCESS:
         return "alignment fault";
-    case MX_EXCP_POLICY_ERROR:
+    case ZX_EXCP_POLICY_ERROR:
         return "policy error";
     default:
         // Note: To get a compilation failure when a new exception type has
@@ -110,13 +110,13 @@
 // This is used by both the main thread and the self-dumper thread.
 // However there is no need to lock it as the self-dumper thread only runs
 // when the main thread has crashed.
-mx_handle_t crashed_thread = MX_HANDLE_INVALID;
+zx_handle_t crashed_thread = ZX_HANDLE_INVALID;
 
 // The exception that |crashed_thread| got.
 uint32_t crashed_thread_excp_type;
 
 void output_frame_x86_64(const x86_64_exc_data_t& exc_data,
-                         const mx_x86_64_general_regs_t& regs) {
+                         const zx_x86_64_general_regs_t& regs) {
     printf(" CS:  %#18llx RIP: %#18" PRIx64 " EFL: %#18" PRIx64 " CR2: %#18" PRIx64 "\n",
            0ull, regs.rip, regs.rflags, exc_data.cr2);
     printf(" RAX: %#18" PRIx64 " RBX: %#18" PRIx64 " RCX: %#18" PRIx64 " RDX: %#18" PRIx64 "\n",
@@ -132,7 +132,7 @@
 }
 
 void output_frame_arm64(const arm64_exc_data_t& exc_data,
-                        const mx_arm64_general_regs_t& regs) {
+                        const zx_arm64_general_regs_t& regs) {
     printf(" x0  %#18" PRIx64 " x1  %#18" PRIx64 " x2  %#18" PRIx64 " x3  %#18" PRIx64 "\n",
            regs.r[0], regs.r[1], regs.r[2], regs.r[3]);
     printf(" x4  %#18" PRIx64 " x5  %#18" PRIx64 " x6  %#18" PRIx64 " x7  %#18" PRIx64 "\n",
@@ -153,13 +153,13 @@
            regs.pc, regs.cpsr);
 };
 
-bool read_general_regs(mx_handle_t thread, void* buf, size_t buf_size) {
+bool read_general_regs(zx_handle_t thread, void* buf, size_t buf_size) {
     // The syscall takes a uint32_t.
     auto to_xfer = static_cast<uint32_t>(buf_size);
     uint32_t bytes_read;
-    auto status = mx_thread_read_state(thread, MX_THREAD_STATE_REGSET0, buf, to_xfer, &bytes_read);
+    auto status = zx_thread_read_state(thread, ZX_THREAD_STATE_REGSET0, buf, to_xfer, &bytes_read);
     if (status < 0) {
-        print_mx_error("unable to access general regs", status);
+        print_zx_error("unable to access general regs", status);
         return false;
     }
     if (bytes_read != buf_size) {
@@ -169,23 +169,23 @@
     return true;
 }
 
-bool write_general_regs(mx_handle_t thread, void* buf, size_t buf_size) {
+bool write_general_regs(zx_handle_t thread, void* buf, size_t buf_size) {
     // The syscall takes a uint32_t.
     auto to_xfer = static_cast<uint32_t> (buf_size);
-    auto status = mx_thread_write_state(thread, MX_THREAD_STATE_REGSET0, buf, to_xfer);
+    auto status = zx_thread_write_state(thread, ZX_THREAD_STATE_REGSET0, buf, to_xfer);
     if (status < 0) {
-        print_mx_error("unable to access general regs", status);
+        print_zx_error("unable to access general regs", status);
         return false;
     }
     return true;
 }
 
-void dump_memory(mx_handle_t proc, uintptr_t start, size_t len) {
+void dump_memory(zx_handle_t proc, uintptr_t start, size_t len) {
     // Make sure we're not allocating an excessive amount of stack.
-    MX_DEBUG_ASSERT(len <= kMemoryDumpSize);
+    ZX_DEBUG_ASSERT(len <= kMemoryDumpSize);
 
     uint8_t buf[len];
-    auto res = mx_process_read_memory(proc, start, buf, len, &len);
+    auto res = zx_process_read_memory(proc, start, buf, len, &len);
     if (res < 0) {
         printf("failed reading %p memory; error : %d\n", (void*)start, res);
     } else if (len != 0) {
@@ -193,20 +193,20 @@
     }
 }
 
-void resume_thread(mx_handle_t thread, bool handled) {
-    uint32_t options = MX_RESUME_EXCEPTION;
+void resume_thread(zx_handle_t thread, bool handled) {
+    uint32_t options = ZX_RESUME_EXCEPTION;
     if (!handled)
-        options |= MX_RESUME_TRY_NEXT;
-    auto status = mx_task_resume(thread, options);
-    if (status != MX_OK) {
-        print_mx_error("unable to \"resume\" thread", status);
+        options |= ZX_RESUME_TRY_NEXT;
+    auto status = zx_task_resume(thread, options);
+    if (status != ZX_OK) {
+        print_zx_error("unable to \"resume\" thread", status);
         // This shouldn't happen (unless someone killed it already).
         // The task is now effectively hung (until someone kills it).
         // TODO: Try to forcefully kill it ourselves?
     }
 }
 
-void resume_thread_from_exception(mx_handle_t thread,
+void resume_thread_from_exception(zx_handle_t thread,
                                   uint32_t excp_type,
                                   const gregs_type* gregs) {
     if (is_resumable_swbreak(excp_type) &&
@@ -230,9 +230,9 @@
     // For now, we turn policy exceptions into non-fatal warnings, by
     // resuming the thread when these exceptions occur.  TODO(MG-922):
     // Remove this and make these exceptions fatal after the system has
-    // received some amount of testing with MX_POL_BAD_HANDLE enabled as a
+    // received some amount of testing with ZX_POL_BAD_HANDLE enabled as a
     // warning.
-    if (excp_type == MX_EXCP_POLICY_ERROR) {
+    if (excp_type == ZX_EXCP_POLICY_ERROR) {
         resume_thread(thread, true);
         return;
     }
@@ -244,20 +244,20 @@
 }
 
 void process_report(uint64_t pid, uint64_t tid, uint32_t type, bool use_libunwind) {
-    if (!MX_EXCP_IS_ARCH(type) && type != MX_EXCP_POLICY_ERROR)
+    if (!ZX_EXCP_IS_ARCH(type) && type != ZX_EXCP_POLICY_ERROR)
         return;
 
-    mx_handle_t process;
-    mx_status_t status = mx_object_get_child(0, pid, MX_RIGHT_SAME_RIGHTS, &process);
+    zx_handle_t process;
+    zx_status_t status = zx_object_get_child(0, pid, ZX_RIGHT_SAME_RIGHTS, &process);
     if (status < 0) {
         printf("failed to get a handle to [%" PRIu64 "] : error %d\n", pid, status);
         return;
     }
-    mx_handle_t thread;
-    status = mx_object_get_child(process, tid, MX_RIGHT_SAME_RIGHTS, &thread);
+    zx_handle_t thread;
+    status = zx_object_get_child(process, tid, ZX_RIGHT_SAME_RIGHTS, &thread);
     if (status < 0) {
         printf("failed to get a handle to [%" PRIu64 ".%" PRIu64 "] : error %d\n", pid, tid, status);
-        mx_handle_close(process);
+        zx_handle_close(process);
         return;
     }
 
@@ -266,20 +266,20 @@
     crashed_thread = thread;
     crashed_thread_excp_type = type;
 
-    mx_exception_report_t report;
-    status = mx_object_get_info(thread, MX_INFO_THREAD_EXCEPTION_REPORT,
+    zx_exception_report_t report;
+    status = zx_object_get_info(thread, ZX_INFO_THREAD_EXCEPTION_REPORT,
                                 &report, sizeof(report), NULL, NULL);
     if (status < 0) {
         printf("failed to get exception report for [%" PRIu64 ".%" PRIu64 "] : error %d\n", pid, tid, status);
-        mx_handle_close(process);
-        mx_handle_close(thread);
+        zx_handle_close(process);
+        zx_handle_close(thread);
         return;
     }
     auto context = report.context;
 
     gregs_type reg_buf;
     gregs_type *regs = nullptr;
-    mx_vaddr_t pc = 0, sp = 0, fp = 0;
+    zx_vaddr_t pc = 0, sp = 0, fp = 0;
     const char* arch = "unknown";
     const char* fatal = "fatal ";
 
@@ -310,17 +310,17 @@
     if (is_resumable_swbreak(type))
         fatal = "";
     // TODO(MA-922): Remove this and make policy exceptions fatal.
-    if (type == MX_EXCP_POLICY_ERROR)
+    if (type == ZX_EXCP_POLICY_ERROR)
         fatal = "";
 
-    char process_name[MX_MAX_NAME_LEN];
-    status = mx_object_get_property(process, MX_PROP_NAME, process_name, sizeof(process_name));
+    char process_name[ZX_MAX_NAME_LEN];
+    status = zx_object_get_property(process, ZX_PROP_NAME, process_name, sizeof(process_name));
     if (status < 0) {
         strlcpy(process_name, "unknown", sizeof(process_name));
     }
 
-    char thread_name[MX_MAX_NAME_LEN];
-    status = mx_object_get_property(thread, MX_PROP_NAME, thread_name, sizeof(thread_name));
+    char thread_name[ZX_MAX_NAME_LEN];
+    status = zx_object_get_property(thread, ZX_PROP_NAME, thread_name, sizeof(thread_name));
     if (status < 0) {
         strlcpy(thread_name, "unknown", sizeof(thread_name));
     }
@@ -335,7 +335,7 @@
     output_frame_arm64(context.arch.u.arm_64, *regs);
 
     // Only output the Fault address register if there's a data fault.
-    if (MX_EXCP_FATAL_PAGE_FAULT == report.header.type)
+    if (ZX_EXCP_FATAL_PAGE_FAULT == report.header.type)
         printf(" far %#18" PRIx64 "\n", context.arch.u.arm_64.far);
 #else
     __UNREACHABLE;
@@ -360,36 +360,36 @@
     // allow the thread (and then process) to die, unless the exception is
     // to just trigger a backtrace (if enabled)
     resume_thread_from_exception(thread, type, regs);
-    crashed_thread = MX_HANDLE_INVALID;
+    crashed_thread = ZX_HANDLE_INVALID;
     crashed_thread_excp_type = 0u;
 
-    mx_handle_close(thread);
-    mx_handle_close(process);
+    zx_handle_close(thread);
+    zx_handle_close(process);
 }
 
 // A small wrapper to provide a useful name to the API call used to effect
 // the request.
 
-mx_status_t bind_system_exception_port(mx_handle_t eport) {
-    return mx_task_bind_exception_port(MX_HANDLE_INVALID, eport, kSysExceptionKey, 0);
+zx_status_t bind_system_exception_port(zx_handle_t eport) {
+    return zx_task_bind_exception_port(ZX_HANDLE_INVALID, eport, kSysExceptionKey, 0);
 }
 
 // A small wrapper to provide a useful name to the API call used to effect
 // the request.
 
-mx_status_t unbind_system_exception_port() {
-    return mx_task_bind_exception_port(MX_HANDLE_INVALID, MX_HANDLE_INVALID,
+zx_status_t unbind_system_exception_port() {
+    return zx_task_bind_exception_port(ZX_HANDLE_INVALID, ZX_HANDLE_INVALID,
                                          kSysExceptionKey, 0);
 }
 
 int self_dump_func(void* arg) {
-    mx_handle_t ex_port = static_cast<mx_handle_t> (reinterpret_cast<uintptr_t> (arg));
+    zx_handle_t ex_port = static_cast<zx_handle_t> (reinterpret_cast<uintptr_t> (arg));
 
     // TODO: There may be exceptions we can recover from, but for now KISS
     // and just terminate on any exception.
 
-    mx_port_packet_t packet;
-    mx_port_wait(ex_port, MX_TIME_INFINITE, &packet, 0);
+    zx_port_packet_t packet;
+    zx_port_wait(ex_port, ZX_TIME_INFINITE, &packet, 0);
     if (packet.key != kSelfExceptionKey) {
         print_error("invalid crash key");
         return 1;
@@ -409,7 +409,7 @@
     // And best do this ASAP in case we ourselves crash.
     // If this was a resumable exception we'll instead kill the process,
     // but we only get here if crashlogger itself crashed.
-    if (crashed_thread != MX_HANDLE_INVALID) {
+    if (crashed_thread != ZX_HANDLE_INVALID) {
         resume_thread_from_exception(crashed_thread, crashed_thread_excp_type, nullptr);
     }
 
@@ -417,8 +417,8 @@
     // terminate until the original crashing thread is "resumed".
     // This could be an assert, but we don't want the check disabled in
     // release builds.
-    if (unbind_status != MX_OK) {
-        print_mx_error("WARNING: unable to unbind system exception port", unbind_status);
+    if (unbind_status != ZX_OK) {
+        print_zx_error("WARNING: unable to unbind system exception port", unbind_status);
         // This "shouldn't happen", safer to just terminate.
         exit(1);
     }
@@ -453,7 +453,7 @@
 }
 
 int main(int argc, char** argv) {
-    mx_status_t status;
+    zx_status_t status;
     bool force = false;
     // Whether to use libunwind or not.
     // If not then we use a simple algorithm that assumes ABI-specific
@@ -503,7 +503,7 @@
     // At debugging level 1 print our dso list (in case we crash in a way
     // that prevents printing it later).
     if (verbosity_level >= 1) {
-        mx_handle_t self = mx_process_self();
+        zx_handle_t self = zx_process_self();
         dsoinfo_t* dso_list = dso_fetch_list(self, "crashlogger");
         printf("Crashlogger dso list:\n");
         dso_print_list(dso_list);
@@ -515,21 +515,21 @@
     // an existing crashlogger with this one.
     if (force) {
         status = unbind_system_exception_port();
-        if (status != MX_OK) {
-            print_mx_error("unable to unbind system exception port", status);
+        if (status != ZX_OK) {
+            print_zx_error("unable to unbind system exception port", status);
             return 1;
         }
     }
 
-    mx_handle_t thread_self = thrd_get_mx_handle(thrd_current());
-    if (thread_self == MX_HANDLE_INVALID) {
-        print_mx_error("unable to get thread self", thread_self);
+    zx_handle_t thread_self = thrd_get_zx_handle(thrd_current());
+    if (thread_self == ZX_HANDLE_INVALID) {
+        print_zx_error("unable to get thread self", thread_self);
         return 1;
     }
 
-    mx_handle_t self_dump_port;
-    if ((status = mx_port_create(0, &self_dump_port)) < 0) {
-        print_mx_error("mx_port_create failed", status);
+    zx_handle_t self_dump_port;
+    if ((status = zx_port_create(0, &self_dump_port)) < 0) {
+        print_zx_error("zx_port_create failed", status);
         return 1;
     }
 
@@ -549,25 +549,25 @@
 
     // Bind this exception handler to the main thread instead of the process
     // so that the crashlogger crash dumper doesn't get its own exceptions.
-    status = mx_task_bind_exception_port(thread_self, self_dump_port,
+    status = zx_task_bind_exception_port(thread_self, self_dump_port,
                                            kSelfExceptionKey, 0);
     if (status < 0) {
-        print_mx_error("unable to set self exception port", status);
+        print_zx_error("unable to set self exception port", status);
         return 1;
     }
 
     // The exception port may be passed in from the parent process.  If it
     // wasn't, we bind the system exception port.
-    mx_handle_t ex_port = mx_get_startup_handle(PA_HND(PA_USER0, 0));
-    if (ex_port == MX_HANDLE_INVALID) {
-        if ((status = mx_port_create(0, &ex_port)) < 0) {
-            print_mx_error("mx_port_create failed", status);
+    zx_handle_t ex_port = zx_get_startup_handle(PA_HND(PA_USER0, 0));
+    if (ex_port == ZX_HANDLE_INVALID) {
+        if ((status = zx_port_create(0, &ex_port)) < 0) {
+            print_zx_error("zx_port_create failed", status);
             return 1;
         }
 
         status = bind_system_exception_port(ex_port);
         if (status < 0) {
-            print_mx_error("unable to bind system exception port", status);
+            print_zx_error("unable to bind system exception port", status);
             return 1;
         }
     }
@@ -575,8 +575,8 @@
     printf("crashlogger service ready\n");
 
     while (true) {
-        mx_port_packet_t packet;
-        mx_port_wait(ex_port, MX_TIME_INFINITE, &packet, 0);
+        zx_port_packet_t packet;
+        zx_port_wait(ex_port, ZX_TIME_INFINITE, &packet, 0);
         if (packet.key != kSysExceptionKey) {
             print_error("invalid crash key");
             return 1;
diff --git a/system/core/crashlogger/dso-list.cpp b/system/core/crashlogger/dso-list.cpp
index 4552bcd..187c3b2 100644
--- a/system/core/crashlogger/dso-list.cpp
+++ b/system/core/crashlogger/dso-list.cpp
@@ -9,9 +9,9 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/assert.h>
-#include <magenta/types.h>
-#include <magenta/syscalls.h>
+#include <zircon/assert.h>
+#include <zircon/types.h>
+#include <zircon/syscalls.h>
 
 #include "dso-list.h"
 #include "utils.h"
@@ -40,7 +40,7 @@
     memset(dso->buildid, 'x', sizeof(dso->buildid) - 1);
     dso->base = base;
     dso->debug_file_tried = false;
-    dso->debug_file_status = MX_ERR_BAD_STATE;
+    dso->debug_file_status = ZX_ERR_BAD_STATE;
     while (*list != nullptr) {
         if ((*list)->base < dso->base) {
             dso->next = *list;
@@ -54,12 +54,12 @@
     return dso;
 }
 
-dsoinfo_t* dso_fetch_list(mx_handle_t h, const char* name) {
+dsoinfo_t* dso_fetch_list(zx_handle_t h, const char* name) {
     uintptr_t lmap, debug_addr;
-    mx_status_t status = mx_object_get_property(h, MX_PROP_PROCESS_DEBUG_ADDR,
+    zx_status_t status = zx_object_get_property(h, ZX_PROP_PROCESS_DEBUG_ADDR,
                                                 &debug_addr, sizeof(debug_addr));
-    if (status != MX_OK) {
-        print_mx_error("mx_object_get_property(MX_PROP_PROCESS_DEBUG_ADDR), unable to fetch dso list", status);
+    if (status != ZX_OK) {
+        print_zx_error("zx_object_get_property(ZX_PROP_PROCESS_DEBUG_ADDR), unable to fetch dso list", status);
         return nullptr;
     }
     if (read_mem(h, debug_addr + rdebug_off_lmap, &lmap, sizeof(lmap))) {
@@ -73,7 +73,7 @@
             return nullptr;
         }
         char dsoname[64];
-        mx_vaddr_t base;
+        zx_vaddr_t base;
         uintptr_t next;
         uintptr_t str;
         if (read_mem(h, lmap + lmap_off_addr, &base, sizeof(base))) {
@@ -107,7 +107,7 @@
     }
 }
 
-dsoinfo_t* dso_lookup(dsoinfo_t* dso_list, mx_vaddr_t pc) {
+dsoinfo_t* dso_lookup(dsoinfo_t* dso_list, zx_vaddr_t pc) {
     for (dsoinfo_t* dso = dso_list; dso != NULL; dso = dso->next) {
         if (pc >= dso->base) {
             return dso;
@@ -124,15 +124,15 @@
     }
 }
 
-mx_status_t dso_find_debug_file(dsoinfo_t* dso, const char** out_debug_file) {
+zx_status_t dso_find_debug_file(dsoinfo_t* dso, const char** out_debug_file) {
     // Have we already tried?
     // Yeah, if we OOM it's possible it'll succeed next time, but
     // it's not worth the extra complexity to avoid printing the debugging
     // messages twice.
     if (dso->debug_file_tried) {
         switch (dso->debug_file_status) {
-        case MX_OK:
-            MX_DEBUG_ASSERT(dso->debug_file != nullptr);
+        case ZX_OK:
+            ZX_DEBUG_ASSERT(dso->debug_file != nullptr);
             *out_debug_file = dso->debug_file;
             // fall through
         default:
@@ -147,7 +147,7 @@
     char* path;
     if (asprintf(&path, "%s/%s%s", kDebugDirectory, dso->buildid, kDebugSuffix) < 0) {
         debugf(1, "OOM building debug file path for dso %s\n", dso->name);
-        dso->debug_file_status = MX_ERR_NO_MEMORY;
+        dso->debug_file_status = ZX_ERR_NO_MEMORY;
         return dso->debug_file_status;
     }
 
@@ -157,13 +157,13 @@
     if (fd < 0) {
         debugf(1, "debug file for dso %s not found: %s\n", dso->name, path);
         free(path);
-        dso->debug_file_status = MX_ERR_NOT_FOUND;
+        dso->debug_file_status = ZX_ERR_NOT_FOUND;
     } else {
         debugf(1, "found debug file for dso %s: %s\n", dso->name, path);
         close(fd);
         dso->debug_file = path;
         *out_debug_file = path;
-        dso->debug_file_status = MX_OK;
+        dso->debug_file_status = ZX_OK;
     }
 
     return dso->debug_file_status;
diff --git a/system/core/crashlogger/dso-list.h b/system/core/crashlogger/dso-list.h
index 959fdae..d807c8f 100644
--- a/system/core/crashlogger/dso-list.h
+++ b/system/core/crashlogger/dso-list.h
@@ -4,26 +4,26 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include "utils.h"
 
 typedef struct dsoinfo {
     struct dsoinfo* next;
-    mx_vaddr_t base;
+    zx_vaddr_t base;
     char buildid[MAX_BUILDID_SIZE * 2 + 1];
     bool debug_file_tried;
-    mx_status_t debug_file_status;
+    zx_status_t debug_file_status;
     char* debug_file;
     char name[];
 } dsoinfo_t;
 
-extern dsoinfo_t* dso_fetch_list(mx_handle_t h, const char* name);
+extern dsoinfo_t* dso_fetch_list(zx_handle_t h, const char* name);
 
 extern void dso_free_list(dsoinfo_t*);
 
-extern dsoinfo_t* dso_lookup (dsoinfo_t* dso_list, mx_vaddr_t pc);
+extern dsoinfo_t* dso_lookup (dsoinfo_t* dso_list, zx_vaddr_t pc);
 
 extern void dso_print_list(dsoinfo_t* dso_list);
 
-extern mx_status_t dso_find_debug_file(dsoinfo_t* dso, const char** out_debug_file);
+extern zx_status_t dso_find_debug_file(dsoinfo_t* dso, const char** out_debug_file);
diff --git a/system/core/crashlogger/dump-pt.cpp b/system/core/crashlogger/dump-pt.cpp
index e37cf60..1744535 100644
--- a/system/core/crashlogger/dump-pt.cpp
+++ b/system/core/crashlogger/dump-pt.cpp
@@ -7,7 +7,7 @@
 #include <unistd.h>
 
 #include <launchpad/launchpad.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 
 #include "utils.h"
@@ -38,7 +38,7 @@
 // Don't wait forever for ipt to run.
 // It may take awhile to dump the data.
 // This seems to be a good number.
-constexpr mx_time_t run_timeout = MX_SEC(10);
+constexpr zx_time_t run_timeout = ZX_SEC(10);
 
 // Return the next sequence number to use or -1 if we've created the maximum
 // number of dumps and can't make any more.
@@ -57,52 +57,52 @@
     return -1;
 }
 
-static mx_status_t crashlogger_run(const char* name, int argc, const char* const* argv) {
+static zx_status_t crashlogger_run(const char* name, int argc, const char* const* argv) {
     launchpad_t *lp;
     const char* executable = argv[0];
-    launchpad_create(MX_HANDLE_INVALID, name, &lp);
+    launchpad_create(ZX_HANDLE_INVALID, name, &lp);
     launchpad_load_from_file(lp, executable);
     launchpad_set_args(lp, argc, argv);
     launchpad_clone(lp, LP_CLONE_ALL);
 
-    mx_handle_t child;
+    zx_handle_t child;
     const char* errmsg;
-    mx_status_t status = launchpad_go(lp, &child, &errmsg);
-    if (status != MX_OK)
+    zx_status_t status = launchpad_go(lp, &child, &errmsg);
+    if (status != ZX_OK)
         return status;
 
-    mx_signals_t signals;
-    status = mx_object_wait_one(child, MX_TASK_TERMINATED, mx_deadline_after(run_timeout),
+    zx_signals_t signals;
+    status = zx_object_wait_one(child, ZX_TASK_TERMINATED, zx_deadline_after(run_timeout),
                                 &signals);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         // Leave reporting the error to the caller.
     } else {
-        if (signals & MX_TASK_TERMINATED) {
-            mx_info_process_t info;
-            status = mx_object_get_info(child, MX_INFO_PROCESS, &info,
+        if (signals & ZX_TASK_TERMINATED) {
+            zx_info_process_t info;
+            status = zx_object_get_info(child, ZX_INFO_PROCESS, &info,
                                         sizeof(info), nullptr, nullptr);
-            if (status == MX_OK && info.exited) {
+            if (status == ZX_OK && info.exited) {
                 if (info.return_code != 0) {
                     // The child should have already printed its own error
                     // message, we just need to return some error code to the
                     // caller
-                    status = MX_ERR_IO;
+                    status = ZX_ERR_IO;
                 }
             } else {
                 // This shouldn't happen, but we don't want to kill crashlogger
                 // because of it. Return some indicative error code and let the
                 // caller report it.
-                status = MX_ERR_BAD_STATE;
+                status = ZX_ERR_BAD_STATE;
             }
         } else {
             // This shouldn't happen, but we don't want to kill crashlogger
             // because of it. Return some indicative error code and let the
             // caller report it.
-            status = MX_ERR_BAD_STATE;
+            status = ZX_ERR_BAD_STATE;
         }
     }
 
-    mx_handle_close(child);
+    zx_handle_close(child);
     return status;
 }
 
@@ -139,13 +139,13 @@
         "dump",
         "start",
     };
-    mx_status_t status = crashlogger_run("ipt-dump",
+    zx_status_t status = crashlogger_run("ipt-dump",
                                          fbl::count_of(argv_pt_dump), argv_pt_dump);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         printf("PT output written to " PT_PATH_FORMAT ".*\n",
                pt_path_prefix, seq_num);
     } else {
-        print_mx_error("Error dumping IPT data", status);
+        print_zx_error("Error dumping IPT data", status);
     }
 
     // TODO(dje): It may be useful to break up the actions.
diff --git a/system/core/crashlogger/dump-pt.h b/system/core/crashlogger/dump-pt.h
index b290604..d2d4be4 100644
--- a/system/core/crashlogger/dump-pt.h
+++ b/system/core/crashlogger/dump-pt.h
@@ -5,6 +5,6 @@
 #pragma once
 
 #include <stddef.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 void try_dump_pt_data();
diff --git a/system/core/crashlogger/rules.mk b/system/core/crashlogger/rules.mk
index 2db5cdb..13d9a1e 100644
--- a/system/core/crashlogger/rules.mk
+++ b/system/core/crashlogger/rules.mk
@@ -19,7 +19,7 @@
 MODULE_NAME := crashlogger
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/pretty \
     system/ulib/runtime
@@ -28,8 +28,8 @@
     third_party/ulib/backtrace \
     third_party/ulib/ngunwind \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 # Compile this with frame pointers so that if we crash
diff --git a/system/core/crashlogger/utils.cpp b/system/core/crashlogger/utils.cpp
index d34e531..1e95c88 100644
--- a/system/core/crashlogger/utils.cpp
+++ b/system/core/crashlogger/utils.cpp
@@ -8,9 +8,9 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/status.h>
 
 #include "utils.h"
 
@@ -54,45 +54,45 @@
     va_end(args);
 }
 
-void do_print_mx_error(const char* file, int line, const char* what, mx_status_t status) {
+void do_print_zx_error(const char* file, int line, const char* what, zx_status_t status) {
     do_print_error(file, line, "%s: %d (%s)",
-                   what, status, mx_status_get_string(status));
+                   what, status, zx_status_get_string(status));
 }
 
 // While this should never fail given a valid handle,
-// returns MX_KOID_INVALID on failure.
+// returns ZX_KOID_INVALID on failure.
 
-mx_koid_t get_koid(mx_handle_t handle) {
-    mx_info_handle_basic_t info;
-    if (mx_object_get_info(handle, MX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL) < 0) {
+zx_koid_t get_koid(zx_handle_t handle) {
+    zx_info_handle_basic_t info;
+    if (zx_object_get_info(handle, ZX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL) < 0) {
         // This shouldn't ever happen, so don't just ignore it.
-        fprintf(stderr, "Eh? MX_INFO_HANDLE_BASIC failed\n");
+        fprintf(stderr, "Eh? ZX_INFO_HANDLE_BASIC failed\n");
         // OTOH we can't just fail, we have to be robust about reporting back
         // to the kernel that we handled the exception.
         // TODO: Provide ability to safely terminate at any point (e.g., for assert
         // failures and such).
-        return MX_KOID_INVALID;
+        return ZX_KOID_INVALID;
     }
     return info.koid;
 }
 
-mx_status_t read_mem(mx_handle_t h, mx_vaddr_t vaddr, void* ptr, size_t len) {
+zx_status_t read_mem(zx_handle_t h, zx_vaddr_t vaddr, void* ptr, size_t len) {
     size_t actual;
-    mx_status_t status = mx_process_read_memory(h, vaddr, ptr, len, &actual);
+    zx_status_t status = zx_process_read_memory(h, vaddr, ptr, len, &actual);
     if (status < 0) {
         printf("read_mem @%p FAILED %zd\n", (void*) vaddr, len);
         return status;
     }
     if (len != actual) {
         printf("read_mem @%p FAILED, short read %zd\n", (void*) vaddr, len);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t fetch_string(mx_handle_t h, mx_vaddr_t vaddr, char* ptr, size_t max) {
+zx_status_t fetch_string(zx_handle_t h, zx_vaddr_t vaddr, char* ptr, size_t max) {
     while (max > 1) {
-        mx_status_t status;
+        zx_status_t status;
         if ((status = read_mem(h, vaddr, ptr, 1)) < 0) {
             *ptr = 0;
             return status;
@@ -102,7 +102,7 @@
         max--;
     }
     *ptr = 0;
-    return MX_OK;
+    return ZX_OK;
 }
 
 #if UINT_MAX == ULONG_MAX
@@ -138,34 +138,34 @@
 
 #endif
 
-mx_status_t fetch_build_id(mx_handle_t h, mx_vaddr_t base, char* buf, size_t buf_size) {
-    mx_vaddr_t vaddr = base;
+zx_status_t fetch_build_id(zx_handle_t h, zx_vaddr_t base, char* buf, size_t buf_size) {
+    zx_vaddr_t vaddr = base;
     uint8_t tmp[4];
-    mx_status_t status;
+    zx_status_t status;
 
     if (buf_size < MAX_BUILDID_SIZE * 2 + 1)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     status = read_mem(h, vaddr, tmp, 4);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     if (memcmp(tmp, ELFMAG, SELFMAG))
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
 
     elf_off_t phoff;
     elf_half_t num;
     status = read_mem(h, vaddr + ehdr_off_phoff, &phoff, sizeof(phoff));
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     status = read_mem(h, vaddr + ehdr_off_phnum, &num, sizeof(num));
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     for (unsigned n = 0; n < num; n++) {
-        mx_vaddr_t phaddr = vaddr + phoff + (n * sizeof(elf_phdr_t));
+        zx_vaddr_t phaddr = vaddr + phoff + (n * sizeof(elf_phdr_t));
         elf_word_t type;
         status = read_mem(h, phaddr + phdr_off_type, &type, sizeof(type));
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         if (type != PT_NOTE)
             continue;
@@ -173,10 +173,10 @@
         elf_off_t off;
         elf_native_word_t size;
         status = read_mem(h, phaddr + phdr_off_offset, &off, sizeof(off));
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         status = read_mem(h, phaddr + phdr_off_filesz, &size, sizeof(size));
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
 
         struct {
@@ -185,14 +185,14 @@
         } hdr;
         while (size > sizeof(hdr)) {
             status = read_mem(h, vaddr + off, &hdr, sizeof(hdr));
-            if (status != MX_OK)
+            if (status != ZX_OK)
                 return status;
             size_t header_size =
                 sizeof(Elf32_Nhdr) + ((hdr.hdr.n_namesz + 3) & -4);
             size_t payload_size = (hdr.hdr.n_descsz + 3) & -4;
             off += header_size;
             size -= header_size;
-            mx_vaddr_t payload_vaddr = vaddr + off;
+            zx_vaddr_t payload_vaddr = vaddr + off;
             off += payload_size;
             size -= payload_size;
             if (hdr.hdr.n_type != NT_GNU_BUILD_ID ||
@@ -206,15 +206,15 @@
             } else {
                 uint8_t buildid[MAX_BUILDID_SIZE];
                 status = read_mem(h, payload_vaddr, buildid, hdr.hdr.n_descsz);
-                if (status != MX_OK)
+                if (status != ZX_OK)
                     return status;
                 for (uint32_t i = 0; i < hdr.hdr.n_descsz; ++i) {
                     snprintf(&buf[i * 2], 3, "%02x", buildid[i]);
                 }
             }
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
diff --git a/system/core/crashlogger/utils.h b/system/core/crashlogger/utils.h
index 65623f8..9c25a2a 100644
--- a/system/core/crashlogger/utils.h
+++ b/system/core/crashlogger/utils.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <stddef.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #define MAX_BUILDID_SIZE 64
 
@@ -24,23 +24,23 @@
 
 extern void do_print_error(const char* file, int line, const char* fmt, ...);
 
-extern void do_print_mx_error(const char* file, int line, const char* what, mx_status_t status);
+extern void do_print_zx_error(const char* file, int line, const char* what, zx_status_t status);
 
 #define print_error(fmt...) \
   do { \
     do_print_error(__FILE__, __LINE__, fmt); \
   } while (0)
 
-#define print_mx_error(what, status) \
+#define print_zx_error(what, status) \
   do { \
-    do_print_mx_error(__FILE__, __LINE__, \
-                      (what), static_cast<mx_status_t>(status)); \
+    do_print_zx_error(__FILE__, __LINE__, \
+                      (what), static_cast<zx_status_t>(status)); \
   } while (0)
 
-extern mx_koid_t get_koid(mx_handle_t handle);
+extern zx_koid_t get_koid(zx_handle_t handle);
 
-extern mx_status_t read_mem(mx_handle_t h, mx_vaddr_t vaddr, void* ptr, size_t len);
+extern zx_status_t read_mem(zx_handle_t h, zx_vaddr_t vaddr, void* ptr, size_t len);
 
-extern mx_status_t fetch_string(mx_handle_t h, mx_vaddr_t vaddr, char* ptr, size_t max);
+extern zx_status_t fetch_string(zx_handle_t h, zx_vaddr_t vaddr, char* ptr, size_t max);
 
-extern mx_status_t fetch_build_id(mx_handle_t h, mx_vaddr_t base, char* buf, size_t buf_size);
+extern zx_status_t fetch_build_id(zx_handle_t h, zx_vaddr_t base, char* buf, size_t buf_size);
diff --git a/system/core/devmgr/acpi.c b/system/core/devmgr/acpi.c
index 1aa99f8..bddcca6 100644
--- a/system/core/devmgr/acpi.c
+++ b/system/core/devmgr/acpi.c
@@ -12,27 +12,27 @@
 #include <launchpad/launchpad.h>
 
 #include <acpisvc/simple.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/io.h>
-#include <mxio/util.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/io.h>
+#include <fdio/util.h>
 
 #include "devmgr.h"
 #include "devhost.h"
 
 static acpi_handle_t acpi_root;
 
-void devhost_acpi_set_rpc(mx_handle_t handle) {
+void devhost_acpi_set_rpc(zx_handle_t handle) {
     acpi_handle_init(&acpi_root, handle);
 }
 
 void devhost_acpi_poweroff(void) {
     acpi_s_state_transition(&acpi_root, ACPI_S_STATE_S5);
-    mx_debug_send_command(get_root_resource(), "poweroff", sizeof("poweroff"));
+    zx_debug_send_command(get_root_resource(), "poweroff", sizeof("poweroff"));
 }
 
 void devhost_acpi_reboot(void) {
     acpi_s_state_transition(&acpi_root, ACPI_S_STATE_REBOOT);
-    mx_debug_send_command(get_root_resource(), "reboot", sizeof("reboot"));
+    zx_debug_send_command(get_root_resource(), "reboot", sizeof("reboot"));
 }
 
diff --git a/system/core/devmgr/acpi.h b/system/core/devmgr/acpi.h
index 9f6f237..a4a6656 100644
--- a/system/core/devmgr/acpi.h
+++ b/system/core/devmgr/acpi.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
-void devhost_acpi_set_rpc(mx_handle_t handle);
+void devhost_acpi_set_rpc(zx_handle_t handle);
 
 void devhost_acpi_reboot(void);
 void devhost_acpi_poweroff(void);
diff --git a/system/core/devmgr/block-watcher.c b/system/core/devmgr/block-watcher.c
index 2cedb8f..ecc8402 100644
--- a/system/core/devmgr/block-watcher.c
+++ b/system/core/devmgr/block-watcher.c
@@ -9,26 +9,26 @@
 
 #include <fs-management/mount.h>
 #include <gpt/gpt.h>
-#include <magenta/device/block.h>
-#include <mxio/watcher.h>
+#include <zircon/device/block.h>
+#include <fdio/watcher.h>
 
 #include "devmgr.h"
 
-static mx_handle_t job;
+static zx_handle_t job;
 
-static mx_status_t launch_blobstore(int argc, const char** argv, mx_handle_t* hnd,
+static zx_status_t launch_blobstore(int argc, const char** argv, zx_handle_t* hnd,
                                     uint32_t* ids, size_t len) {
     return devmgr_launch(job, "blobstore:/blobstore", argc, argv, NULL, -1,
                          hnd, ids, len, NULL);
 }
 
-static mx_status_t launch_minfs(int argc, const char** argv, mx_handle_t* hnd,
+static zx_status_t launch_minfs(int argc, const char** argv, zx_handle_t* hnd,
                                 uint32_t* ids, size_t len) {
     return devmgr_launch(job, "minfs:/data", argc, argv, NULL, -1,
                          hnd, ids, len, NULL);
 }
 
-static mx_status_t launch_fat(int argc, const char** argv, mx_handle_t* hnd,
+static zx_status_t launch_fat(int argc, const char** argv, zx_handle_t* hnd,
                               uint32_t* ids, size_t len) {
     return devmgr_launch(job, "fatfs:/volume", argc, argv, NULL, -1,
                          hnd, ids, len, NULL);
@@ -40,12 +40,12 @@
 /*
  * Attempt to mount the device pointed to be the file descriptor at a known
  * location.
- * Returns MX_ERR_ALREADY_BOUND if the device could be mounted, but something
- * is already mounted at that location. Returns MX_ERR_INVALID_ARGS if the
- * GUID of the device does not match a known valid one. Returns MX_OK if an
+ * Returns ZX_ERR_ALREADY_BOUND if the device could be mounted, but something
+ * is already mounted at that location. Returns ZX_ERR_INVALID_ARGS if the
+ * GUID of the device does not match a known valid one. Returns ZX_OK if an
  * attempt to mount is made, without checking mount success.
  */
-static mx_status_t mount_minfs(int fd, mount_options_t* options) {
+static zx_status_t mount_minfs(int fd, mount_options_t* options) {
     uint8_t type_guid[GPT_GUID_LEN];
 
     // initialize our data for this run
@@ -56,16 +56,16 @@
     if (read_sz == GPT_GUID_LEN) {
         if (gpt_is_sys_guid(type_guid, read_sz)) {
             if (secondary_bootfs_ready()) {
-                return MX_ERR_ALREADY_BOUND;
+                return ZX_ERR_ALREADY_BOUND;
             }
 
-            // TODO(MG-1008): replace getenv with cmdline_bool("magenta.system.writable", false);
-            options->readonly = getenv("magenta.system.writable") == NULL;
+            // TODO(MG-1008): replace getenv with cmdline_bool("zircon.system.writable", false);
+            options->readonly = getenv("zircon.system.writable") == NULL;
             options->wait_until_ready = true;
             options->create_mountpoint = true;
 
-            mx_status_t st = mount(fd, PATH_SYSTEM, DISK_FORMAT_MINFS, options, launch_minfs);
-            if (st != MX_OK) {
+            zx_status_t st = mount(fd, PATH_SYSTEM, DISK_FORMAT_MINFS, options, launch_minfs);
+            if (st != ZX_OK) {
                 printf("devmgr: failed to mount %s, retcode = %d. Run fixfs to restore partition.\n", PATH_SYSTEM, st);
             } else {
                 devmgr_start_appmgr(NULL);
@@ -74,13 +74,13 @@
             return st;
         } else if (gpt_is_data_guid(type_guid, read_sz)) {
             if (data_mounted) {
-                return MX_ERR_ALREADY_BOUND;
+                return ZX_ERR_ALREADY_BOUND;
             }
             data_mounted = true;
             options->wait_until_ready = true;
 
-            mx_status_t st = mount(fd, PATH_DATA, DISK_FORMAT_MINFS, options, launch_minfs);
-            if (st != MX_OK) {
+            zx_status_t st = mount(fd, PATH_DATA, DISK_FORMAT_MINFS, options, launch_minfs);
+            if (st != ZX_OK) {
                 printf("devmgr: failed to mount %s, retcode = %d. Run fixfs to restore partition.\n", PATH_DATA, st);
             }
 
@@ -88,7 +88,7 @@
         }
     }
 
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
 
 #define FVM_DRIVER_LIB "/boot/driver/fvm.so"
@@ -96,10 +96,10 @@
 #define MBR_DRIVER_LIB "/boot/driver/mbr.so"
 #define STRLEN(s) sizeof(s) / sizeof((s)[0])
 
-static mx_status_t block_device_added(int dirfd, int event, const char* name, void* cookie) {
+static zx_status_t block_device_added(int dirfd, int event, const char* name, void* cookie) {
     if (event != WATCH_EVENT_ADD_FILE) {
         printf("devmgr: block watch waiting...\n");
-        return MX_OK;
+        return ZX_OK;
     }
 
     char device_path[PATH_MAX];
@@ -108,7 +108,7 @@
     printf("devmgr: new block device: %s\n", device_path);
     int fd;
     if ((fd = openat(dirfd, name, O_RDWR)) < 0) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     disk_format_t df = detect_disk_format(fd);
@@ -119,42 +119,42 @@
         // probe for partition table
         ioctl_device_bind(fd, FVM_DRIVER_LIB, STRLEN(FVM_DRIVER_LIB));
         close(fd);
-        return MX_OK;
+        return ZX_OK;
     }
     case DISK_FORMAT_GPT: {
         printf("devmgr: %s: GPT?\n", device_path);
         // probe for partition table
         ioctl_device_bind(fd, GPT_DRIVER_LIB, STRLEN(GPT_DRIVER_LIB));
         close(fd);
-        return MX_OK;
+        return ZX_OK;
     }
     case DISK_FORMAT_MBR: {
         printf("devmgr: %s: MBR?\n", device_path);
         // probe for partition table
         ioctl_device_bind(fd, MBR_DRIVER_LIB, STRLEN(MBR_DRIVER_LIB));
         close(fd);
-        return MX_OK;
+        return ZX_OK;
     }
     case DISK_FORMAT_BLOBFS: {
         if (!blobstore_mounted) {
             mount_options_t options = default_mount_options;
             options.create_mountpoint = true;
-            mx_status_t status = mount(fd, PATH_BLOBSTORE, DISK_FORMAT_BLOBFS, &options, launch_blobstore);
-            if (status != MX_OK) {
+            zx_status_t status = mount(fd, PATH_BLOBSTORE, DISK_FORMAT_BLOBFS, &options, launch_blobstore);
+            if (status != ZX_OK) {
                 printf("devmgr: Failed to mount blobstore partition %s at %s: %d. Please run fixfs to reformat.\n", device_path, PATH_BLOBSTORE, status);
             } else {
                 blobstore_mounted = true;
             }
         }
 
-        return MX_OK;
+        return ZX_OK;
     }
     case DISK_FORMAT_MINFS: {
         printf("devmgr: minfs\n");
         mount_options_t options = default_mount_options;
         options.wait_until_ready = false;
         mount_minfs(fd, &options);
-        return MX_OK;
+        return ZX_OK;
     }
     case DISK_FORMAT_FAT: {
         // Use the GUID to avoid auto-mounting the EFI partition
@@ -164,30 +164,30 @@
         if (efi) {
           close(fd);
           printf("devmgr: not automounting efi\n");
-          return MX_OK;
+          return ZX_OK;
         }
         mount_options_t options = default_mount_options;
         options.create_mountpoint = true;
         static int fat_counter = 0;
-        char mountpath[MXIO_MAX_FILENAME + 64];
+        char mountpath[FDIO_MAX_FILENAME + 64];
         snprintf(mountpath, sizeof(mountpath), "%s/fat-%d", PATH_VOLUME, fat_counter++);
         options.wait_until_ready = false;
         printf("devmgr: fatfs\n");
         mount(fd, mountpath, df, &options, launch_fat);
-        return MX_OK;
+        return ZX_OK;
     }
     default:
         close(fd);
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
-void block_device_watcher(mx_handle_t _job) {
+void block_device_watcher(zx_handle_t _job) {
     job = _job;
 
     int dirfd;
     if ((dirfd = open("/dev/class/block", O_DIRECTORY | O_RDONLY)) >= 0) {
-        mxio_watch_directory(dirfd, block_device_added, MX_TIME_INFINITE, &job);
+        fdio_watch_directory(dirfd, block_device_added, ZX_TIME_INFINITE, &job);
     }
     close(dirfd);
 }
diff --git a/system/core/devmgr/devcoordinator.h b/system/core/devmgr/devcoordinator.h
index 0d4502c..eb23b85 100644
--- a/system/core/devmgr/devcoordinator.h
+++ b/system/core/devmgr/devcoordinator.h
@@ -8,8 +8,8 @@
 #include <ddk/binding.h>
 #include <ddk/device.h>
 #include <ddk/driver.h>
-#include <magenta/types.h>
-#include <magenta/listnode.h>
+#include <zircon/types.h>
+#include <zircon/listnode.h>
 
 #include <port/port.h>
 
@@ -37,9 +37,9 @@
 
 struct dc_devhost {
     port_handler_t ph;
-    mx_handle_t hrpc;
-    mx_handle_t proc;
-    mx_koid_t koid;
+    zx_handle_t hrpc;
+    zx_handle_t proc;
+    zx_koid_t koid;
     int32_t refcount;
     uint32_t flags;
 
@@ -50,8 +50,8 @@
 #define DEV_HOST_DYING 1
 
 struct dc_device {
-    mx_handle_t hrpc;
-    mx_handle_t hrsrc;
+    zx_handle_t hrpc;
+    zx_handle_t hrsrc;
     port_handler_t ph;
     devhost_t* host;
     const char* name;
@@ -85,7 +85,7 @@
     // listnode for this device in the all devices list
     list_node_t anode;
 
-    mx_device_prop_t props[];
+    zx_device_prop_t props[];
 };
 
 // This device is never destroyed
@@ -116,7 +116,7 @@
 
 struct dc_driver {
     const char* name;
-    const mx_bind_inst_t* binding;
+    const zx_bind_inst_t* binding;
     uint32_t binding_size;
     uint32_t flags;
     struct list_node node;
@@ -125,10 +125,10 @@
 
 #define DRIVER_NAME_LEN_MAX 64
 
-mx_status_t devfs_publish(device_t* parent, device_t* dev);
+zx_status_t devfs_publish(device_t* parent, device_t* dev);
 void devfs_unpublish(device_t* dev);
 
-device_t* coordinator_init(mx_handle_t root_job);
+device_t* coordinator_init(zx_handle_t root_job);
 void coordinator(void);
 
 void dc_driver_added(driver_t* drv, const char* version);
@@ -137,7 +137,7 @@
 void find_loadable_drivers(const char* path);
 
 bool dc_is_bindable(driver_t* drv, uint32_t protocol_id,
-                    mx_device_prop_t* props, size_t prop_count,
+                    zx_device_prop_t* props, size_t prop_count,
                     bool autobind);
 
 #define DC_MAX_DATA 4096
@@ -147,11 +147,11 @@
 // dedicated channel for forwarding OPEN operations.
 // Our opcodes set the high bit to avoid overlap.
 typedef struct {
-    mx_txid_t txid;
+    zx_txid_t txid;
     uint32_t op;
 
     union {
-        mx_status_t status;
+        zx_status_t status;
         uint32_t protocol_id;
     };
     uint32_t datalen;
@@ -162,8 +162,8 @@
 } dc_msg_t;
 
 typedef struct {
-    mx_txid_t txid;
-    mx_status_t status;
+    zx_txid_t txid;
+    zx_status_t status;
 } dc_status_t;
 
 // Coord->Host Ops
@@ -184,13 +184,13 @@
 #define DC_OP_DM_WATCH           0x80000022
 #define DC_PATH_MAX 1024
 
-mx_status_t dc_msg_pack(dc_msg_t* msg, uint32_t* len_out,
+zx_status_t dc_msg_pack(dc_msg_t* msg, uint32_t* len_out,
                         const void* data, size_t datalen,
                         const char* name, const char* args);
-mx_status_t dc_msg_unpack(dc_msg_t* msg, size_t len, const void** data,
+zx_status_t dc_msg_unpack(dc_msg_t* msg, size_t len, const void** data,
                           const char** name, const char** args);
-mx_status_t dc_msg_rpc(mx_handle_t h, dc_msg_t* msg, size_t msglen,
-                       mx_handle_t* handles, size_t hcount,
+zx_status_t dc_msg_rpc(zx_handle_t h, dc_msg_t* msg, size_t msglen,
+                       zx_handle_t* handles, size_t hcount,
                        dc_status_t* rsp, size_t rsp_len);
 
-void devmgr_set_mdi(mx_handle_t mdi_handle);
+void devmgr_set_mdi(zx_handle_t mdi_handle);
diff --git a/system/core/devmgr/devhost-api.c b/system/core/devmgr/devhost-api.c
index fc00e1a..01edc6e 100644
--- a/system/core/devmgr/devhost-api.c
+++ b/system/core/devmgr/devhost-api.c
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include <ddk/debug.h>
 #include <ddk/device.h>
@@ -19,30 +19,30 @@
 
 // LibDriver Device Interface
 
-__EXPORT mx_status_t device_add_from_driver(mx_driver_t* drv, mx_device_t* parent,
-                                            device_add_args_t* args, mx_device_t** out) {
-    mx_status_t r;
-    mx_device_t* dev = NULL;
+__EXPORT zx_status_t device_add_from_driver(zx_driver_t* drv, zx_device_t* parent,
+                                            device_add_args_t* args, zx_device_t** out) {
+    zx_status_t r;
+    zx_device_t* dev = NULL;
 
     if (!parent) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (!args || args->version != DEVICE_ADD_ARGS_VERSION) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (!args->ops || args->ops->version != DEVICE_OPS_VERSION) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (args->flags & ~(DEVICE_ADD_NON_BINDABLE | DEVICE_ADD_INSTANCE | DEVICE_ADD_BUSDEV)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if ((args->flags & DEVICE_ADD_INSTANCE) && (args->flags & DEVICE_ADD_BUSDEV)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     DM_LOCK();
     r = devhost_device_create(drv, parent, args->name, args->ctx, args->ops, &dev);
-    if (r != MX_OK) {
+    if (r != ZX_OK) {
         DM_UNLOCK();
         return r;
     }
@@ -66,11 +66,11 @@
                                args->rsrc);
     } else if (args->flags & DEVICE_ADD_INSTANCE) {
         dev->flags |= DEV_FLAG_INSTANCE | DEV_FLAG_UNBINDABLE;
-        r = devhost_device_add(dev, parent, NULL, 0, NULL, MX_HANDLE_INVALID);
+        r = devhost_device_add(dev, parent, NULL, 0, NULL, ZX_HANDLE_INVALID);
     } else {
-        r = devhost_device_add(dev, parent, args->props, args->prop_count, NULL, MX_HANDLE_INVALID);
+        r = devhost_device_add(dev, parent, args->props, args->prop_count, NULL, ZX_HANDLE_INVALID);
     }
-    if (r != MX_OK) {
+    if (r != ZX_OK) {
         if (out) {
             *out = NULL;
         }
@@ -81,22 +81,22 @@
     return r;
 }
 
-__EXPORT mx_status_t device_remove(mx_device_t* dev) {
-    mx_status_t r;
+__EXPORT zx_status_t device_remove(zx_device_t* dev) {
+    zx_status_t r;
     DM_LOCK();
     r = devhost_device_remove(dev);
     DM_UNLOCK();
     return r;
 }
 
-__EXPORT void device_unbind(mx_device_t* dev) {
+__EXPORT void device_unbind(zx_device_t* dev) {
     DM_LOCK();
     devhost_device_unbind(dev);
     DM_UNLOCK();
 }
 
-__EXPORT mx_status_t device_rebind(mx_device_t* dev) {
-    mx_status_t r;
+__EXPORT zx_status_t device_rebind(zx_device_t* dev) {
+    zx_status_t r;
     DM_LOCK();
     r = devhost_device_rebind(dev);
     DM_UNLOCK();
@@ -104,11 +104,11 @@
 }
 
 
-__EXPORT const char* device_get_name(mx_device_t* dev) {
+__EXPORT const char* device_get_name(zx_device_t* dev) {
     return dev->name;
 }
 
-__EXPORT mx_device_t* device_get_parent(mx_device_t* dev) {
+__EXPORT zx_device_t* device_get_parent(zx_device_t* dev) {
     return dev->parent;
 }
 
@@ -117,7 +117,7 @@
     void* ctx;
 } generic_protocol_t;
 
-__EXPORT mx_status_t device_get_protocol(mx_device_t* dev, uint32_t proto_id, void* out) {
+__EXPORT zx_status_t device_get_protocol(zx_device_t* dev, uint32_t proto_id, void* out) {
     generic_protocol_t* proto = out;
     if (dev->ops->get_protocol) {
         return dev->ops->get_protocol(dev->ctx, proto_id, out);
@@ -125,67 +125,67 @@
     if ((proto_id == dev->protocol_id) && (dev->protocol_ops != NULL)) {
         proto->ops = dev->protocol_ops;
         proto->ctx = dev->ctx;
-        return MX_OK;
+        return ZX_OK;
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-__EXPORT mx_handle_t device_get_resource(mx_device_t* dev) {
-    mx_handle_t h;
-    if (mx_handle_duplicate(dev->resource, MX_RIGHT_SAME_RIGHTS, &h) < 0) {
-        return MX_HANDLE_INVALID;
+__EXPORT zx_handle_t device_get_resource(zx_device_t* dev) {
+    zx_handle_t h;
+    if (zx_handle_duplicate(dev->resource, ZX_RIGHT_SAME_RIGHTS, &h) < 0) {
+        return ZX_HANDLE_INVALID;
     } else {
         return h;
     }
 }
 
-__EXPORT void device_state_clr_set(mx_device_t* dev, mx_signals_t clearflag, mx_signals_t setflag) {
-    mx_object_signal(dev->event, clearflag, setflag);
+__EXPORT void device_state_clr_set(zx_device_t* dev, zx_signals_t clearflag, zx_signals_t setflag) {
+    zx_object_signal(dev->event, clearflag, setflag);
 }
 
 
-__EXPORT mx_off_t device_get_size(mx_device_t* dev) {
+__EXPORT zx_off_t device_get_size(zx_device_t* dev) {
     return dev->ops->get_size(dev->ctx);
 }
 
-__EXPORT mx_status_t device_read(mx_device_t* dev, void* buf, size_t count,
-                                 mx_off_t off, size_t* actual) {
+__EXPORT zx_status_t device_read(zx_device_t* dev, void* buf, size_t count,
+                                 zx_off_t off, size_t* actual) {
     return dev->ops->read(dev->ctx, buf, count, off, actual);
 }
 
-__EXPORT mx_status_t device_write(mx_device_t* dev, const void* buf, size_t count,
-                                  mx_off_t off, size_t* actual) {
+__EXPORT zx_status_t device_write(zx_device_t* dev, const void* buf, size_t count,
+                                  zx_off_t off, size_t* actual) {
     return dev->ops->write(dev->ctx, buf, count, off, actual);
 }
 
-__EXPORT mx_status_t device_ioctl(mx_device_t* dev, uint32_t op,
+__EXPORT zx_status_t device_ioctl(zx_device_t* dev, uint32_t op,
                                   const void* in_buf, size_t in_len,
                                   void* out_buf, size_t out_len,
                                   size_t* out_actual) {
     return dev->ops->ioctl(dev->ctx, op, in_buf, in_len, out_buf, out_len, out_actual);
 }
 
-__EXPORT mx_status_t device_iotxn_queue(mx_device_t* dev, iotxn_t* txn) {
+__EXPORT zx_status_t device_iotxn_queue(zx_device_t* dev, iotxn_t* txn) {
     if (dev->ops->iotxn_queue != NULL) {
         dev->ops->iotxn_queue(dev->ctx, txn);
-        return MX_OK;
+        return ZX_OK;
     } else {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
 
 // LibDriver Misc Interfaces
 
-extern mx_handle_t root_resource_handle;
+extern zx_handle_t root_resource_handle;
 
-__EXPORT mx_handle_t get_root_resource(void) {
+__EXPORT zx_handle_t get_root_resource(void) {
     return root_resource_handle;
 }
 
-__EXPORT mx_status_t load_firmware(mx_device_t* dev, const char* path,
-                                   mx_handle_t* fw, size_t* size) {
-    mx_status_t r;
+__EXPORT zx_status_t load_firmware(zx_device_t* dev, const char* path,
+                                   zx_handle_t* fw, size_t* size) {
+    zx_status_t r;
     DM_LOCK();
     r = devhost_load_firmware(dev, path, fw, size);
     DM_UNLOCK();
@@ -194,24 +194,24 @@
 
 // Interface Used by DevHost RPC Layer
 
-mx_status_t device_bind(mx_device_t* dev, const char* drv_libname) {
-    mx_status_t r;
+zx_status_t device_bind(zx_device_t* dev, const char* drv_libname) {
+    zx_status_t r;
     DM_LOCK();
     r = devhost_device_bind(dev, drv_libname);
     DM_UNLOCK();
     return r;
 }
 
-mx_status_t device_open_at(mx_device_t* dev, mx_device_t** out, const char* path, uint32_t flags) {
-    mx_status_t r;
+zx_status_t device_open_at(zx_device_t* dev, zx_device_t** out, const char* path, uint32_t flags) {
+    zx_status_t r;
     DM_LOCK();
     r = devhost_device_open_at(dev, out, path, flags);
     DM_UNLOCK();
     return r;
 }
 
-mx_status_t device_close(mx_device_t* dev, uint32_t flags) {
-    mx_status_t r;
+zx_status_t device_close(zx_device_t* dev, uint32_t flags) {
+    zx_status_t r;
     DM_LOCK();
     r = devhost_device_close(dev, flags);
     DM_UNLOCK();
diff --git a/system/core/devmgr/devhost-core.c b/system/core/devmgr/devhost-core.c
index 912ef30..07c6fda 100644
--- a/system/core/devmgr/devhost-core.c
+++ b/system/core/devmgr/devhost-core.c
@@ -18,12 +18,12 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/assert.h>
-#include <magenta/listnode.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/assert.h>
+#include <zircon/listnode.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
-#include <mxio/remoteio.h>
+#include <fdio/remoteio.h>
 
 #define TRACE 0
 
@@ -43,28 +43,28 @@
 bool __dm_locked = false;
 mtx_t __devhost_api_lock = MTX_INIT;
 
-static mx_device_t* dev_create_parent;
-static mx_device_t* dev_create_device;
+static zx_device_t* dev_create_parent;
+static zx_device_t* dev_create_device;
 
-mx_device_t* device_create_setup(mx_device_t* parent) {
+zx_device_t* device_create_setup(zx_device_t* parent) {
     DM_LOCK();
-    mx_device_t* dev = dev_create_device;
+    zx_device_t* dev = dev_create_device;
     dev_create_parent = parent;
     dev_create_device = NULL;
     DM_UNLOCK();
     return dev;
 }
 
-static mx_status_t default_open(void* ctx, mx_device_t** out, uint32_t flags) {
-    return MX_OK;
+static zx_status_t default_open(void* ctx, zx_device_t** out, uint32_t flags) {
+    return ZX_OK;
 }
 
-static mx_status_t default_open_at(void* ctx, mx_device_t** out, const char* path, uint32_t flags) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t default_open_at(void* ctx, zx_device_t** out, const char* path, uint32_t flags) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t default_close(void* ctx, uint32_t flags) {
-    return MX_OK;
+static zx_status_t default_close(void* ctx, uint32_t flags) {
+    return ZX_OK;
 }
 
 static void default_unbind(void* ctx) {
@@ -73,33 +73,33 @@
 static void default_release(void* ctx) {
 }
 
-static mx_status_t default_read(void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t default_read(void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t default_write(void* ctx, const void* buf, size_t count, mx_off_t off, size_t* actual) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t default_write(void* ctx, const void* buf, size_t count, zx_off_t off, size_t* actual) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_off_t default_get_size(void* ctx) {
+static zx_off_t default_get_size(void* ctx) {
     return 0;
 }
 
-static mx_status_t default_ioctl(void* ctx, uint32_t op,
+static zx_status_t default_ioctl(void* ctx, uint32_t op,
                              const void* in_buf, size_t in_len,
                              void* out_buf, size_t out_len, size_t* out_actual) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t default_suspend(void* ctx, uint32_t flags) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t default_suspend(void* ctx, uint32_t flags) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t default_resume(void* ctx, uint32_t flags) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t default_resume(void* ctx, uint32_t flags) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_protocol_device_t device_default_ops = {
+zx_protocol_device_t device_default_ops = {
     .open = default_open,
     .open_at = default_open_at,
     .close = default_close,
@@ -116,11 +116,11 @@
 static struct list_node unmatched_device_list = LIST_INITIAL_VALUE(unmatched_device_list);
 static struct list_node driver_list = LIST_INITIAL_VALUE(driver_list);
 
-static inline bool device_is_bound(mx_device_t* dev) {
+static inline bool device_is_bound(zx_device_t* dev) {
     return dev->owner != NULL;
 }
 
-void dev_ref_release(mx_device_t* dev) {
+void dev_ref_release(zx_device_t* dev) {
     if (dev->refcount < 1) {
         printf("device: %p: REFCOUNT GOING NEGATIVE\n", dev);
         //TODO: probably should assert, but to start with let's
@@ -150,9 +150,9 @@
             printf("device: %p(%s): still has children! not good.\n", dev, dev->name);
         }
 
-        mx_handle_close(dev->event);
-        mx_handle_close(dev->local_event);
-        mx_handle_close(dev->resource);
+        zx_handle_close(dev->event);
+        zx_handle_close(dev->local_event);
+        zx_handle_close(dev->resource);
         DM_UNLOCK();
         dev_op_release(dev);
         DM_LOCK();
@@ -164,21 +164,21 @@
     }
 }
 
-mx_status_t devhost_device_create(mx_driver_t* drv, mx_device_t* parent,
+zx_status_t devhost_device_create(zx_driver_t* drv, zx_device_t* parent,
                                   const char* name, void* ctx,
-                                  mx_protocol_device_t* ops, mx_device_t** out) {
+                                  zx_protocol_device_t* ops, zx_device_t** out) {
 
     if (!drv) {
         printf("devhost: _device_add could not find driver!\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_device_t* dev = malloc(sizeof(mx_device_t));
+    zx_device_t* dev = malloc(sizeof(zx_device_t));
     if (dev == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    memset(dev, 0, sizeof(mx_device_t));
+    memset(dev, 0, sizeof(zx_device_t));
     dev->magic = DEV_MAGIC;
     dev->ops = ops;
     dev->driver = drv;
@@ -192,9 +192,9 @@
     }
 
     size_t len = strlen(name);
-    if (len >= MX_DEVICE_NAME_MAX) {
+    if (len >= ZX_DEVICE_NAME_MAX) {
         printf("devhost: dev=%p name too large '%s'\n", dev, name);
-        len = MX_DEVICE_NAME_MAX - 1;
+        len = ZX_DEVICE_NAME_MAX - 1;
         dev->magic = 0;
     }
 
@@ -202,7 +202,7 @@
     dev->name[len] = 0;
     dev->ctx = ctx ? ctx : dev;
     *out = dev;
-    return MX_OK;
+    return ZX_OK;
 }
 
 #define DEFAULT_IF_NULL(ops,method) \
@@ -210,36 +210,36 @@
         ops->method = default_##method; \
     }
 
-static mx_status_t device_validate(mx_device_t* dev) {
+static zx_status_t device_validate(zx_device_t* dev) {
     if (dev == NULL) {
         printf("INVAL: NULL!\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (dev->flags & DEV_FLAG_ADDED) {
         printf("device already added: %p(%s)\n", dev, dev->name);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (dev->magic != DEV_MAGIC) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (dev->ops == NULL) {
         printf("device add: %p(%s): NULL ops\n", dev, dev->name);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if ((dev->protocol_id == MX_PROTOCOL_MISC_PARENT) ||
-        (dev->protocol_id == MX_PROTOCOL_ROOT)) {
+    if ((dev->protocol_id == ZX_PROTOCOL_MISC_PARENT) ||
+        (dev->protocol_id == ZX_PROTOCOL_ROOT)) {
         // These protocols is only allowed for the special
         // singleton misc or root parent devices.
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     // devices which do not declare a primary protocol
     // are implied to be misc devices
     if (dev->protocol_id == 0) {
-        dev->protocol_id = MX_PROTOCOL_MISC;
+        dev->protocol_id = ZX_PROTOCOL_MISC;
     }
 
     // install default methods if needed
-    mx_protocol_device_t* ops = dev->ops;
+    zx_protocol_device_t* ops = dev->ops;
     DEFAULT_IF_NULL(ops, open);
     DEFAULT_IF_NULL(ops, open_at);
     DEFAULT_IF_NULL(ops, close);
@@ -252,18 +252,18 @@
     DEFAULT_IF_NULL(ops, suspend);
     DEFAULT_IF_NULL(ops, resume);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t devhost_device_install(mx_device_t* dev) {
-    mx_status_t status;
+zx_status_t devhost_device_install(zx_device_t* dev) {
+    zx_status_t status;
     if ((status = device_validate(dev)) < 0) {
         dev->flags |= DEV_FLAG_DEAD | DEV_FLAG_VERY_DEAD;
         return status;
     }
     // Don't create an event handle if we alredy have one
-    if ((dev->event == MX_HANDLE_INVALID) &&
-        ((status = mx_eventpair_create(0, &dev->event, &dev->local_event)) < 0)) {
+    if ((dev->event == ZX_HANDLE_INVALID) &&
+        ((status = zx_eventpair_create(0, &dev->event, &dev->local_event)) < 0)) {
         printf("device add: %p(%s): cannot create event: %d\n",
                dev, dev->name, status);
         dev->flags |= DEV_FLAG_DEAD | DEV_FLAG_VERY_DEAD;
@@ -271,13 +271,13 @@
     }
     dev_ref_acquire(dev);
     dev->flags |= DEV_FLAG_ADDED;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t devhost_device_add(mx_device_t* dev, mx_device_t* parent,
-                               const mx_device_prop_t* props, uint32_t prop_count,
-                               const char* businfo, mx_handle_t resource) {
-    mx_status_t status;
+zx_status_t devhost_device_add(zx_device_t* dev, zx_device_t* parent,
+                               const zx_device_prop_t* props, uint32_t prop_count,
+                               const char* businfo, zx_handle_t resource) {
+    zx_status_t status;
     if ((status = device_validate(dev)) < 0) {
         goto fail;
     }
@@ -287,17 +287,17 @@
         // we don't add more than one shadow device
         // per create() op...
         if (dev_create_device != NULL) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
     } else {
         if (parent == NULL) {
             printf("device_add: cannot add %p(%s) to NULL parent\n", dev, dev->name);
-            status = MX_ERR_NOT_SUPPORTED;
+            status = ZX_ERR_NOT_SUPPORTED;
             goto fail;
         }
         if (parent->flags & DEV_FLAG_DEAD) {
             printf("device add: %p: is dead, cannot add child %p\n", parent, dev);
-            status = MX_ERR_BAD_STATE;
+            status = ZX_ERR_BAD_STATE;
             goto fail;
         }
     }
@@ -307,8 +307,8 @@
 #endif
 
     // Don't create an event handle if we alredy have one
-    if ((dev->event == MX_HANDLE_INVALID) &&
-        ((status = mx_eventpair_create(0, &dev->event, &dev->local_event)) < 0)) {
+    if ((dev->event == ZX_HANDLE_INVALID) &&
+        ((status = zx_eventpair_create(0, &dev->event, &dev->local_event)) < 0)) {
         printf("device add: %p(%s): cannot create event: %d\n",
                dev, dev->name, status);
         goto fail;
@@ -325,7 +325,7 @@
         dev_create_device = dev;
         dev->flags |= DEV_FLAG_ADDED;
         dev->flags &= (~DEV_FLAG_BUSY);
-        return MX_OK;
+        return ZX_OK;
     }
 
     dev_ref_acquire(parent);
@@ -336,8 +336,8 @@
 
         // instanced devices are not remoted and resources
         // attached to them are discarded
-        if (resource != MX_HANDLE_INVALID) {
-            mx_handle_close(resource);
+        if (resource != ZX_HANDLE_INVALID) {
+            zx_handle_close(resource);
         }
     } else {
         // add to the device tree
@@ -358,11 +358,11 @@
     }
     dev->flags |= DEV_FLAG_ADDED;
     dev->flags &= (~DEV_FLAG_BUSY);
-    return MX_OK;
+    return ZX_OK;
 
 fail:
-    if (resource != MX_HANDLE_INVALID) {
-        mx_handle_close(resource);
+    if (resource != ZX_HANDLE_INVALID) {
+        zx_handle_close(resource);
     }
     dev->flags |= DEV_FLAG_DEAD | DEV_FLAG_VERY_DEAD;
     return status;
@@ -388,7 +388,7 @@
     return "?";
 }
 
-static void devhost_unbind_child(mx_device_t* child) {
+static void devhost_unbind_child(zx_device_t* child) {
     // call child's unbind op
     if (child->ops->unbind) {
 #if TRACE_ADD_REMOVE
@@ -403,25 +403,25 @@
     }
 }
 
-static void devhost_unbind_children(mx_device_t* dev) {
-    mx_device_t* child = NULL;
-    mx_device_t* temp = NULL;
+static void devhost_unbind_children(zx_device_t* dev) {
+    zx_device_t* child = NULL;
+    zx_device_t* temp = NULL;
 #if TRACE_ADD_REMOVE
     printf("devhost_unbind_children: %p(%s)\n", dev, dev->name);
 #endif
-    list_for_every_entry_safe(&dev->children, child, temp, mx_device_t, node) {
+    list_for_every_entry_safe(&dev->children, child, temp, zx_device_t, node) {
         devhost_unbind_child(child);
     }
-    list_for_every_entry_safe(&dev->instances, child, temp, mx_device_t, node) {
+    list_for_every_entry_safe(&dev->instances, child, temp, zx_device_t, node) {
         devhost_unbind_child(child);
     }
 }
 
-mx_status_t devhost_device_remove(mx_device_t* dev) {
+zx_status_t devhost_device_remove(zx_device_t* dev) {
     if (dev->flags & REMOVAL_BAD_FLAGS) {
         printf("device: %p(%s): cannot be removed (%s)\n",
                dev, dev->name, removal_problem(dev->flags));
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 #if TRACE_ADD_REMOVE
     printf("device: %p(%s): is being removed\n", dev, dev->name);
@@ -455,16 +455,16 @@
     // this must be last, since it may result in the device structure being destroyed
     dev_ref_release(dev);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t devhost_device_rebind(mx_device_t* dev) {
+zx_status_t devhost_device_rebind(zx_device_t* dev) {
     dev->flags |= DEV_FLAG_BUSY;
 
     // remove children
-    mx_device_t* child;
-    mx_device_t* temp;
-    list_for_every_entry_safe(&dev->children, child, temp, mx_device_t, node) {
+    zx_device_t* child;
+    zx_device_t* temp;
+    list_for_every_entry_safe(&dev->children, child, temp, zx_device_t, node) {
         devhost_device_remove(child);
     }
 
@@ -484,16 +484,16 @@
 
     // ask devcoord to find us a driver if it can
     devhost_device_bind(dev, "");
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t devhost_device_open_at(mx_device_t* dev, mx_device_t** out, const char* path, uint32_t flags) {
+zx_status_t devhost_device_open_at(zx_device_t* dev, zx_device_t** out, const char* path, uint32_t flags) {
     if (dev->flags & DEV_FLAG_DEAD) {
         printf("device open: %p(%s) is dead!\n", dev, dev->name);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     dev_ref_acquire(dev);
-    mx_status_t r;
+    zx_status_t r;
     DM_UNLOCK();
     *out = dev;
     if (path) {
@@ -517,8 +517,8 @@
     return r;
 }
 
-mx_status_t devhost_device_close(mx_device_t* dev, uint32_t flags) {
-    mx_status_t r;
+zx_status_t devhost_device_close(zx_device_t* dev, uint32_t flags) {
+    zx_status_t r;
     DM_UNLOCK();
     r = dev_op_close(dev, flags);
     DM_LOCK();
@@ -526,19 +526,19 @@
     return r;
 }
 
-mx_status_t devhost_device_unbind(mx_device_t* dev) {
+zx_status_t devhost_device_unbind(zx_device_t* dev) {
     if (!dev->owner) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     dev->owner = NULL;
     dev_ref_release(dev);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-void devhost_device_destroy(mx_device_t* dev) {
+void devhost_device_destroy(zx_device_t* dev) {
     // Only destroy devices immediately after device_create() or after they're dead.
-    MX_DEBUG_ASSERT(dev->flags == 0 || dev->flags & DEV_FLAG_VERY_DEAD);
+    ZX_DEBUG_ASSERT(dev->flags == 0 || dev->flags & DEV_FLAG_VERY_DEAD);
     dev->magic = 0xdeaddead;
     dev->ops = NULL;
     free(dev);
@@ -585,17 +585,17 @@
     return -1;
 }
 
-mx_status_t devhost_load_firmware(mx_device_t* dev, const char* path, mx_handle_t* fw,
+zx_status_t devhost_load_firmware(zx_device_t* dev, const char* path, zx_handle_t* fw,
                                   size_t* size) {
     xprintf("devhost: dev=%p path=%s fw=%p\n", dev, path, fw);
 
     int fwfd = devhost_open_firmware(path);
     if (fwfd < 0) {
         switch (errno) {
-        case ENOENT: return MX_ERR_NOT_FOUND;
-        case EACCES: return MX_ERR_ACCESS_DENIED;
-        case ENOMEM: return MX_ERR_NO_MEMORY;
-        default: return MX_ERR_INTERNAL;
+        case ENOENT: return ZX_ERR_NOT_FOUND;
+        case EACCES: return ZX_ERR_ACCESS_DENIED;
+        case ENOMEM: return ZX_ERR_NO_MEMORY;
+        default: return ZX_ERR_INTERNAL;
         }
     }
 
@@ -605,22 +605,22 @@
         int e = errno;
         close(fwfd);
         switch (e) {
-        case EACCES: return MX_ERR_ACCESS_DENIED;
+        case EACCES: return ZX_ERR_ACCESS_DENIED;
         case EBADF:
-        case EFAULT: return MX_ERR_BAD_STATE;
-        default: return MX_ERR_INTERNAL;
+        case EFAULT: return ZX_ERR_BAD_STATE;
+        default: return ZX_ERR_INTERNAL;
         }
     }
 
     if (fwstat.st_size == 0) {
         close(fwfd);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint64_t vmo_size = (fwstat.st_size + 4095) & ~4095;
-    mx_handle_t vmo;
-    mx_status_t status = mx_vmo_create(vmo_size, 0, &vmo);
-    if (status != MX_OK) {
+    zx_handle_t vmo;
+    zx_status_t status = zx_vmo_create(vmo_size, 0, &vmo);
+    if (status != ZX_OK) {
         close(fwfd);
         return status;
     }
@@ -632,18 +632,18 @@
         ssize_t r = read(fwfd, buffer, sizeof(buffer));
         if (r < 0) {
             close(fwfd);
-            mx_handle_close(vmo);
+            zx_handle_close(vmo);
             // Distinguish other errors?
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
         if (r == 0) break;
         size_t actual = 0;
-        status = mx_vmo_write(vmo, (const void*)buffer, off, (size_t)r, &actual);
+        status = zx_vmo_write(vmo, (const void*)buffer, off, (size_t)r, &actual);
         if (actual < (size_t)r) {
             printf("devhost: BUG: wrote %zu < %zu firmware vmo bytes!\n", actual, r);
             close(fwfd);
-            mx_handle_close(vmo);
-            return MX_ERR_BAD_STATE;
+            zx_handle_close(vmo);
+            return ZX_ERR_BAD_STATE;
         }
         off += actual;
         remaining -= actual;
@@ -656,5 +656,5 @@
     *size = fwstat.st_size;
     close(fwfd);
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/core/devmgr/devhost-rpc-server.c b/system/core/devmgr/devhost-rpc-server.c
index c276244..b80d2c7 100644
--- a/system/core/devmgr/devhost-rpc-server.c
+++ b/system/core/devmgr/devhost-rpc-server.c
@@ -18,23 +18,23 @@
 #include <ddk/driver.h>
 
 #include <ddk/iotxn.h>
-#include <magenta/device/device.h>
-#include <magenta/device/vfs.h>
+#include <zircon/device/device.h>
+#include <zircon/device/vfs.h>
 
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
-#include <mxio/debug.h>
-#include <mxio/io.h>
-#include <mxio/vfs.h>
+#include <fdio/debug.h>
+#include <fdio/io.h>
+#include <fdio/vfs.h>
 
 #define MXDEBUG 0
 
 #define CAN_WRITE(ios) (((03 & ios->flags) == O_RDWR) || ((03 & ios->flags) == O_WRONLY))
 #define CAN_READ(ios) (((03 & ios->flags) == O_RDWR) || ((03 & ios->flags) == O_RDONLY))
 
-devhost_iostate_t* create_devhost_iostate(mx_device_t* dev) {
+devhost_iostate_t* create_devhost_iostate(zx_device_t* dev) {
     devhost_iostate_t* ios;
     if ((ios = calloc(1, sizeof(devhost_iostate_t))) == NULL) {
         return NULL;
@@ -43,15 +43,15 @@
     return ios;
 }
 
-static mx_status_t devhost_get_handles(mx_handle_t rh, mx_device_t* dev,
+static zx_status_t devhost_get_handles(zx_handle_t rh, zx_device_t* dev,
                                        const char* path, uint32_t flags) {
-    mx_status_t r;
-    mxrio_object_t obj;
+    zx_status_t r;
+    zxrio_object_t obj;
     devhost_iostate_t* newios;
 
     if ((newios = create_devhost_iostate(dev)) == NULL) {
-        mx_handle_close(rh);
-        return MX_ERR_NO_MEMORY;
+        zx_handle_close(rh);
+        return ZX_ERR_NO_MEMORY;
     }
 
     // detect pipeline directive and discard all other
@@ -75,7 +75,7 @@
     if (!pipeline) {
         if (dev->event > 0) {
             //TODO: read only?
-            if ((r = mx_handle_duplicate(dev->event, MX_RIGHT_SAME_RIGHTS, &obj.handle[0])) < 0) {
+            if ((r = zx_handle_duplicate(dev->event, ZX_RIGHT_SAME_RIGHTS, &obj.handle[0])) < 0) {
                 goto fail_duplicate;
             }
             r = 1;
@@ -92,18 +92,18 @@
             obj.status = r;
             obj.hcount = 0;
         } else {
-            obj.status = MX_OK;
-            obj.type = MXIO_PROTOCOL_REMOTE;
+            obj.status = ZX_OK;
+            obj.type = FDIO_PROTOCOL_REMOTE;
             obj.hcount = r;
         }
-        r = mx_channel_write(rh, 0, &obj, MXRIO_OBJECT_MINSIZE,
+        r = zx_channel_write(rh, 0, &obj, ZXRIO_OBJECT_MINSIZE,
                              obj.handle, obj.hcount);
 
-        // Regardless of obj.status, if the mx_channel_write fails
+        // Regardless of obj.status, if the zx_channel_write fails
         // we must close the handles that didn't get transmitted.
         if (r < 0) {
             for (size_t i = 0; i < obj.hcount; i++) {
-                mx_handle_close(obj.handle[i]);
+                zx_handle_close(obj.handle[i]);
             }
         }
 
@@ -111,7 +111,7 @@
         // the device and destroyed the iostate, so no matter
         // what we close the handle and return
         if (obj.status < 0) {
-            mx_handle_close(rh);
+            zx_handle_close(rh);
             return obj.status;
         }
 
@@ -129,13 +129,13 @@
         printf("devhost_get_handles: failed to start iostate\n");
         goto fail;
     }
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     device_close(dev, flags);
 fail_openat_pipelined:
     free(newios);
-    mx_handle_close(rh);
+    zx_handle_close(rh);
     return r;
 }
 
@@ -143,10 +143,10 @@
     completion_signal((completion_t*)cookie);
 }
 
-static ssize_t do_sync_io(mx_device_t* dev, uint32_t opcode, void* buf, size_t count, mx_off_t off) {
+static ssize_t do_sync_io(zx_device_t* dev, uint32_t opcode, void* buf, size_t count, zx_off_t off) {
     if (dev->ops->iotxn_queue == NULL) {
         size_t actual;
-        mx_status_t r;
+        zx_status_t r;
         if (opcode == IOTXN_OP_READ) {
             r = dev_op_read(dev, buf, count, off, &actual);
         } else {
@@ -159,12 +159,12 @@
         }
     }
     iotxn_t* txn;
-    mx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS | IOTXN_ALLOC_POOL, MXIO_CHUNK_SIZE);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS | IOTXN_ALLOC_POOL, FDIO_CHUNK_SIZE);
+    if (status != ZX_OK) {
         return status;
     }
 
-    assert(count <= MXIO_CHUNK_SIZE);
+    assert(count <= FDIO_CHUNK_SIZE);
 
     completion_t completion = COMPLETION_INIT;
 
@@ -180,9 +180,9 @@
     }
 
     iotxn_queue(dev, txn);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 
-    if (txn->status != MX_OK) {
+    if (txn->status != ZX_OK) {
         size_t txn_status = txn->status;
         iotxn_release(txn);
         return txn_status;
@@ -198,31 +198,31 @@
     return actual;
 }
 
-static ssize_t do_ioctl(mx_device_t* dev, uint32_t op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len) {
-    mx_status_t r;
+static ssize_t do_ioctl(zx_device_t* dev, uint32_t op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len) {
+    zx_status_t r;
     switch (op) {
     case IOCTL_DEVICE_BIND: {
         char* drv_libname = in_len > 0 ? (char*)in_buf : NULL;
         if (in_len > PATH_MAX) {
-            return MX_ERR_BAD_PATH;
+            return ZX_ERR_BAD_PATH;
         }
         drv_libname[in_len] = 0;
         return device_bind(dev, drv_libname);
     }
     case IOCTL_DEVICE_GET_EVENT_HANDLE: {
-        if (out_len < sizeof(mx_handle_t)) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(zx_handle_t)) {
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
-        mx_handle_t* event = out_buf;
-        r = mx_handle_duplicate(dev->event, MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ, event);
-        if (r == MX_OK) {
-            r = sizeof(mx_handle_t);
+        zx_handle_t* event = out_buf;
+        r = zx_handle_duplicate(dev->event, ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ, event);
+        if (r == ZX_OK) {
+            r = sizeof(zx_handle_t);
         }
         return r;
     }
     case IOCTL_DEVICE_GET_DRIVER_NAME: {
         if (!dev->driver) {
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
         const char* name = dev->driver->name;
         if (name == NULL) {
@@ -230,7 +230,7 @@
         }
         r = strlen(name);
         if (out_len < (size_t)r) {
-            r = MX_ERR_BUFFER_TOO_SMALL;
+            r = ZX_ERR_BUFFER_TOO_SMALL;
         } else {
             strncpy(out_buf, name, r);
         }
@@ -239,7 +239,7 @@
     case IOCTL_DEVICE_GET_DEVICE_NAME: {
         r = strlen(dev->name);
         if (out_len < (size_t)r) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         strncpy(out_buf, dev->name, r);
         return r;
@@ -260,7 +260,7 @@
     case IOCTL_VFS_QUERY_FS: {
         const char* devhost_name = "devfs:host";
         if (out_len < sizeof(vfs_query_info_t) + strlen(devhost_name)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         vfs_query_info_t* info = (vfs_query_info_t*) out_buf;
         memset(info, 0, sizeof(*info));
@@ -270,7 +270,7 @@
     default: {
         size_t actual = 0;
         r = dev_op_ioctl(dev, op, in_buf, in_len, out_buf, out_len, &actual);
-        if (r == MX_OK) {
+        if (r == ZX_OK) {
             r = actual;
         }
     }
@@ -278,38 +278,38 @@
     return r;
 }
 
-mx_status_t devhost_rio_handler(mxrio_msg_t* msg, void* cookie) {
+zx_status_t devhost_rio_handler(zxrio_msg_t* msg, void* cookie) {
     devhost_iostate_t* ios = cookie;
-    mx_device_t* dev = ios->dev;
+    zx_device_t* dev = ios->dev;
     uint32_t len = msg->datalen;
     int32_t arg = msg->arg;
     msg->datalen = 0;
 
     // ensure handle count specified by opcode matches reality
-    if (msg->hcount != MXRIO_HC(msg->op)) {
-        return MX_ERR_IO;
+    if (msg->hcount != ZXRIO_HC(msg->op)) {
+        return ZX_ERR_IO;
     }
     msg->hcount = 0;
 
-    switch (MXRIO_OP(msg->op)) {
-    case MXRIO_CLOSE:
+    switch (ZXRIO_OP(msg->op)) {
+    case ZXRIO_CLOSE:
         device_close(dev, ios->flags);
         // The ios released its reference to this device by calling device_close()
         // Put an invalid pointer in its dev field to ensure any use-after-release
         // attempts explode.
         ios->dev = (void*) 0xdead;
-        return MX_OK;
-    case MXRIO_OPEN:
+        return ZX_OK;
+    case ZXRIO_OPEN:
         if ((len < 1) || (len > 1024)) {
-            mx_handle_close(msg->handle[0]);
+            zx_handle_close(msg->handle[0]);
             return ERR_DISPATCHER_INDIRECT;
         }
         msg->data[len] = 0;
         // fallthrough
-    case MXRIO_CLONE: {
+    case ZXRIO_CLONE: {
         char* path = NULL;
         uint32_t flags = arg;
-        if (MXRIO_OP(msg->op) == MXRIO_OPEN) {
+        if (ZXRIO_OP(msg->op) == ZXRIO_OPEN) {
             xprintf("devhost_rio_handler() open dev %p name '%s' at '%s'\n",
                     dev, dev->name, (char*) msg->data);
             if (strcmp((char*)msg->data, ".")) {
@@ -322,11 +322,11 @@
         devhost_get_handles(msg->handle[0], dev, path, flags);
         return ERR_DISPATCHER_INDIRECT;
     }
-    case MXRIO_READ: {
+    case ZXRIO_READ: {
         if (!CAN_READ(ios)) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
-        mx_status_t r = do_sync_io(dev, IOTXN_OP_READ, msg->data, arg, ios->io_off);
+        zx_status_t r = do_sync_io(dev, IOTXN_OP_READ, msg->data, arg, ios->io_off);
         if (r >= 0) {
             ios->io_off += r;
             msg->arg2.off = ios->io_off;
@@ -334,41 +334,41 @@
         }
         return r;
     }
-    case MXRIO_READ_AT: {
+    case ZXRIO_READ_AT: {
         if (!CAN_READ(ios)) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
-        mx_status_t r = do_sync_io(dev, IOTXN_OP_READ, msg->data, arg, msg->arg2.off);
+        zx_status_t r = do_sync_io(dev, IOTXN_OP_READ, msg->data, arg, msg->arg2.off);
         if (r >= 0) {
             msg->datalen = r;
         }
         return r;
     }
-    case MXRIO_WRITE: {
+    case ZXRIO_WRITE: {
         if (!CAN_WRITE(ios)) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
-        mx_status_t r = do_sync_io(dev, IOTXN_OP_WRITE, msg->data, len, ios->io_off);
+        zx_status_t r = do_sync_io(dev, IOTXN_OP_WRITE, msg->data, len, ios->io_off);
         if (r >= 0) {
             ios->io_off += r;
             msg->arg2.off = ios->io_off;
         }
         return r;
     }
-    case MXRIO_WRITE_AT: {
+    case ZXRIO_WRITE_AT: {
         if (!CAN_WRITE(ios)) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
-        mx_status_t r = do_sync_io(dev, IOTXN_OP_WRITE, msg->data, len, msg->arg2.off);
+        zx_status_t r = do_sync_io(dev, IOTXN_OP_WRITE, msg->data, len, msg->arg2.off);
         return r;
     }
-    case MXRIO_SEEK: {
+    case ZXRIO_SEEK: {
         size_t end, n;
         end = dev_op_get_size(dev);
         switch (arg) {
         case SEEK_SET:
             if ((msg->arg2.off < 0) || ((size_t)msg->arg2.off > end)) {
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
             n = msg->arg2.off;
             break;
@@ -380,13 +380,13 @@
                 // if negative seek
                 if (n > ios->io_off) {
                     // wrapped around
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
             } else {
                 // positive seek
                 if (n < ios->io_off) {
                     // wrapped around
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
             }
             break;
@@ -396,27 +396,27 @@
                 // if negative or exact-end seek
                 if (n > end) {
                     // wrapped around
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
             } else {
                 if (n < end) {
                     // wrapped around
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
             }
             break;
         default:
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (n > end) {
             // devices may not seek past the end
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         ios->io_off = n;
         msg->arg2.off = ios->io_off;
-        return MX_OK;
+        return ZX_OK;
     }
-    case MXRIO_STAT: {
+    case ZXRIO_STAT: {
         msg->datalen = sizeof(vnattr_t);
         vnattr_t* attr = (void*)msg->data;
         memset(attr, 0, sizeof(vnattr_t));
@@ -425,62 +425,62 @@
         attr->nlink = 1;
         return msg->datalen;
     }
-    case MXRIO_SYNC: {
+    case ZXRIO_SYNC: {
         return do_ioctl(dev, IOCTL_DEVICE_SYNC, NULL, 0, NULL, 0);
     }
-    case MXRIO_IOCTL_1H: {
-        if ((len > MXIO_IOCTL_MAX_INPUT) ||
+    case ZXRIO_IOCTL_1H: {
+        if ((len > FDIO_IOCTL_MAX_INPUT) ||
             (arg > (ssize_t)sizeof(msg->data)) ||
             (IOCTL_KIND(msg->arg2.op) != IOCTL_KIND_SET_HANDLE)) {
-            mx_handle_close(msg->handle[0]);
-            return MX_ERR_INVALID_ARGS;
+            zx_handle_close(msg->handle[0]);
+            return ZX_ERR_INVALID_ARGS;
         }
-        if (len < sizeof(mx_handle_t)) {
-            len = sizeof(mx_handle_t);
+        if (len < sizeof(zx_handle_t)) {
+            len = sizeof(zx_handle_t);
         }
 
-        char in_buf[MXIO_IOCTL_MAX_INPUT];
+        char in_buf[FDIO_IOCTL_MAX_INPUT];
         // The sending side copied the handle into msg->handle[0]
         // so that it would be sent via channel_write().  Here we
         // copy the local version back into the space in the buffer
         // that the original occupied.
-        memcpy(in_buf, msg->handle, sizeof(mx_handle_t));
-        memcpy(in_buf + sizeof(mx_handle_t), msg->data + sizeof(mx_handle_t),
-               len - sizeof(mx_handle_t));
+        memcpy(in_buf, msg->handle, sizeof(zx_handle_t));
+        memcpy(in_buf + sizeof(zx_handle_t), msg->data + sizeof(zx_handle_t),
+               len - sizeof(zx_handle_t));
 
-        mx_status_t r = do_ioctl(dev, msg->arg2.op, in_buf, len, msg->data, arg);
+        zx_status_t r = do_ioctl(dev, msg->arg2.op, in_buf, len, msg->data, arg);
 
-        if (r == MX_ERR_NOT_SUPPORTED) {
-            mx_handle_close(msg->handle[0]);
+        if (r == ZX_ERR_NOT_SUPPORTED) {
+            zx_handle_close(msg->handle[0]);
         } else if (r >= 0) {
             msg->datalen = r;
         }
         return r;
     }
-    case MXRIO_IOCTL: {
-        if ((len > MXIO_IOCTL_MAX_INPUT) ||
+    case ZXRIO_IOCTL: {
+        if ((len > FDIO_IOCTL_MAX_INPUT) ||
             (arg > (ssize_t)sizeof(msg->data)) ||
             (IOCTL_KIND(msg->arg2.op) == IOCTL_KIND_SET_HANDLE)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
-        char in_buf[MXIO_IOCTL_MAX_INPUT];
+        char in_buf[FDIO_IOCTL_MAX_INPUT];
         memcpy(in_buf, msg->data, len);
 
-        mx_status_t r = do_ioctl(dev, msg->arg2.op, in_buf, len, msg->data, arg);
+        zx_status_t r = do_ioctl(dev, msg->arg2.op, in_buf, len, msg->data, arg);
         if (r >= 0) {
             switch (IOCTL_KIND(msg->arg2.op)) {
             case IOCTL_KIND_GET_HANDLE:
                 msg->hcount = 1;
-                memcpy(msg->handle, msg->data, sizeof(mx_handle_t));
+                memcpy(msg->handle, msg->data, sizeof(zx_handle_t));
                 break;
             case IOCTL_KIND_GET_TWO_HANDLES:
                 msg->hcount = 2;
-                memcpy(msg->handle, msg->data, 2 * sizeof(mx_handle_t));
+                memcpy(msg->handle, msg->data, 2 * sizeof(zx_handle_t));
                 break;
             case IOCTL_KIND_GET_THREE_HANDLES:
                 msg->hcount = 3;
-                memcpy(msg->handle, msg->data, 3 * sizeof(mx_handle_t));
+                memcpy(msg->handle, msg->data, 3 * sizeof(zx_handle_t));
                 break;
             }
             msg->datalen = r;
@@ -490,9 +490,9 @@
     }
     default:
         // close inbound handles so they do not leak
-        for (unsigned i = 0; i < MXRIO_HC(msg->op); i++) {
-            mx_handle_close(msg->handle[i]);
+        for (unsigned i = 0; i < ZXRIO_HC(msg->op); i++) {
+            zx_handle_close(msg->handle[i]);
         }
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
diff --git a/system/core/devmgr/devhost-shared.c b/system/core/devmgr/devhost-shared.c
index f09c9d7..a5e058d 100644
--- a/system/core/devmgr/devhost-shared.c
+++ b/system/core/devmgr/devhost-shared.c
@@ -9,12 +9,12 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 
 #include "devcoordinator.h"
 
-mx_status_t dc_msg_pack(dc_msg_t* msg, uint32_t* len_out,
+zx_status_t dc_msg_pack(dc_msg_t* msg, uint32_t* len_out,
                         const void* data, size_t datalen,
                         const char* name, const char* args) {
     uint32_t max = DC_MAX_DATA;
@@ -22,7 +22,7 @@
 
     if (data) {
         if (datalen > max) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         memcpy(ptr, data, datalen);
         max -= datalen;
@@ -34,7 +34,7 @@
     if (name) {
         datalen = strlen(name) + 1;
         if (datalen > max) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         memcpy(ptr, name, datalen);
         max -= datalen;
@@ -46,7 +46,7 @@
     if (args) {
         datalen = strlen(args) + 1;
         if (datalen > max) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         memcpy(ptr, args, datalen);
         ptr += datalen;
@@ -55,20 +55,20 @@
         msg->argslen = 0;
     }
     *len_out = sizeof(dc_msg_t) - DC_MAX_DATA + (ptr - msg->data);
-    return MX_OK;
+    return ZX_OK;
 }
 
 
-mx_status_t dc_msg_unpack(dc_msg_t* msg, size_t len, const void** data,
+zx_status_t dc_msg_unpack(dc_msg_t* msg, size_t len, const void** data,
                           const char** name, const char** args) {
     if (len < (sizeof(dc_msg_t) - DC_MAX_DATA)) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
     len -= sizeof(dc_msg_t);
     uint8_t* ptr = msg->data;
     if (msg->datalen) {
         if (msg->datalen > len) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         *data = ptr;
         ptr += msg->datalen;
@@ -78,7 +78,7 @@
     }
     if (msg->namelen) {
         if (msg->namelen > len) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         *name = (char*) ptr;
         ptr[msg->namelen - 1] = 0;
@@ -89,20 +89,20 @@
     }
     if (msg->argslen) {
         if (msg->argslen > len) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         *args = (char*) ptr;
         ptr[msg->argslen - 1] = 0;
     } else {
         *args = "";
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t dc_msg_rpc(mx_handle_t h, dc_msg_t* msg, size_t msglen,
-                       mx_handle_t* handles, size_t hcount,
+zx_status_t dc_msg_rpc(zx_handle_t h, dc_msg_t* msg, size_t msglen,
+                       zx_handle_t* handles, size_t hcount,
                        dc_status_t* rsp, size_t rsplen) {
-    mx_channel_call_args_t args = {
+    zx_channel_call_args_t args = {
         .wr_bytes = msg,
         .wr_handles = handles,
         .rd_bytes = rsp,
@@ -115,17 +115,17 @@
 
     //TODO: incrementing txids
     msg->txid = 1;
-    mx_status_t r;
-    if ((r = mx_channel_call(h, 0, MX_TIME_INFINITE,
+    zx_status_t r;
+    if ((r = zx_channel_call(h, 0, ZX_TIME_INFINITE,
                              &args, &args.rd_num_bytes, &args.rd_num_handles,
                              NULL)) < 0) {
         for (size_t n = 0; n < hcount; n++) {
-            mx_handle_close(handles[n]);
+            zx_handle_close(handles[n]);
         }
         return r;
     }
     if (args.rd_num_bytes < sizeof(dc_status_t)) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     return rsp->status;
diff --git a/system/core/devmgr/devhost.c b/system/core/devmgr/devhost.c
index e882b93..de98ea1 100644
--- a/system/core/devmgr/devhost.c
+++ b/system/core/devmgr/devhost.c
@@ -15,14 +15,14 @@
 #include <ddk/driver.h>
 #include <ddk/binding.h>
 
-#include <magenta/dlfcn.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/dlfcn.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
 
-#include <mxio/util.h>
-#include <mxio/remoteio.h>
+#include <fdio/util.h>
+#include <fdio/remoteio.h>
 
 #include "devcoordinator.h"
 #include "devhost.h"
@@ -33,7 +33,7 @@
 
 #define ios_from_ph(ph) containerof(ph, devhost_iostate_t, ph)
 
-static mx_status_t dh_handle_dc_rpc(port_handler_t* ph, mx_signals_t signals, uint32_t evt);
+static zx_status_t dh_handle_dc_rpc(port_handler_t* ph, zx_signals_t signals, uint32_t evt);
 
 static port_t dh_port;
 
@@ -41,14 +41,14 @@
 
 static iostate_t root_ios = {
     .ph = {
-        .waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
+        .waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
         .func = dh_handle_dc_rpc,
     },
 };
 
 static list_node_t dh_drivers = LIST_INITIAL_VALUE(dh_drivers);
 
-static const char* mkdevpath(mx_device_t* dev, char* path, size_t max) {
+static const char* mkdevpath(zx_device_t* dev, char* path, size_t max) {
     if (dev == NULL) {
         return "";
     }
@@ -109,22 +109,22 @@
     }
 }
 
-static mx_status_t dh_find_driver(const char* libname, mx_handle_t vmo, mx_driver_t** out) {
+static zx_status_t dh_find_driver(const char* libname, zx_handle_t vmo, zx_driver_t** out) {
     // check for already-loaded driver first
-    mx_driver_t* drv;
-    list_for_every_entry(&dh_drivers, drv, mx_driver_t, node) {
+    zx_driver_t* drv;
+    list_for_every_entry(&dh_drivers, drv, zx_driver_t, node) {
         if (!strcmp(libname, drv->libname)) {
             *out = drv;
-            mx_handle_close(vmo);
+            zx_handle_close(vmo);
             return drv->status;
         }
     }
 
     int len = strlen(libname) + 1;
-    drv = calloc(1, sizeof(mx_driver_t) + len);
+    drv = calloc(1, sizeof(zx_driver_t) + len);
     if (drv == NULL) {
-        mx_handle_close(vmo);
-        return MX_ERR_NO_MEMORY;
+        zx_handle_close(vmo);
+        return ZX_ERR_NO_MEMORY;
     }
     memcpy((void*) (drv + 1), libname, len);
     drv->libname = (const char*) (drv + 1);
@@ -134,32 +134,32 @@
     void* dl = dlopen_vmo(vmo, RTLD_NOW);
     if (dl == NULL) {
         log(ERROR, "devhost: cannot load '%s': %s\n", libname, dlerror());
-        drv->status = MX_ERR_IO;
+        drv->status = ZX_ERR_IO;
         goto done;
     }
 
-    const magenta_driver_note_t* dn = dlsym(dl, "__magenta_driver_note__");
+    const zircon_driver_note_t* dn = dlsym(dl, "__zircon_driver_note__");
     if (dn == NULL) {
-        log(ERROR, "devhost: driver '%s' missing __magenta_driver_note__ symbol\n", libname);
-        drv->status = MX_ERR_IO;
+        log(ERROR, "devhost: driver '%s' missing __zircon_driver_note__ symbol\n", libname);
+        drv->status = ZX_ERR_IO;
         goto done;
     }
-    mx_driver_rec_t* dr = dlsym(dl, "__magenta_driver_rec__");
+    zx_driver_rec_t* dr = dlsym(dl, "__zircon_driver_rec__");
     if (dr == NULL) {
-        log(ERROR, "devhost: driver '%s' missing __magenta_driver_rec__ symbol\n", libname);
-        drv->status = MX_ERR_IO;
+        log(ERROR, "devhost: driver '%s' missing __zircon_driver_rec__ symbol\n", libname);
+        drv->status = ZX_ERR_IO;
         goto done;
     }
     if (!dr->ops) {
         log(ERROR, "devhost: driver '%s' has NULL ops\n", libname);
-        drv->status = MX_ERR_INVALID_ARGS;
+        drv->status = ZX_ERR_INVALID_ARGS;
         goto done;
     }
     if (dr->ops->version != DRIVER_OPS_VERSION) {
         log(ERROR, "devhost: driver '%s' has bad driver ops version %" PRIx64
             ", expecting %" PRIx64 "\n", libname,
             dr->ops->version, DRIVER_OPS_VERSION);
-        drv->status = MX_ERR_INVALID_ARGS;
+        drv->status = ZX_ERR_INVALID_ARGS;
         goto done;
     }
 
@@ -194,25 +194,25 @@
                 libname, drv->status);
         }
     } else {
-        drv->status = MX_OK;
+        drv->status = ZX_OK;
     }
 
 done:
-    mx_handle_close(vmo);
+    zx_handle_close(vmo);
     return drv->status;
 }
 
-static void dh_handle_open(mxrio_msg_t* msg, size_t len,
-                           mx_handle_t h, iostate_t* ios) {
+static void dh_handle_open(zxrio_msg_t* msg, size_t len,
+                           zx_handle_t h, iostate_t* ios) {
     if ((msg->hcount != 1) ||
-        (msg->datalen != (len - MXRIO_HDR_SZ))) {
-        mx_handle_close(h);
+        (msg->datalen != (len - ZXRIO_HDR_SZ))) {
+        zx_handle_close(h);
         log(ERROR, "devhost: malformed OPEN reques\n");
         return;
     }
     msg->handle[0] = h;
 
-    mx_status_t r;
+    zx_status_t r;
     if ((r = devhost_rio_handler(msg, ios)) < 0) {
         if (r != ERR_DISPATCHER_INDIRECT) {
             log(ERROR, "devhost: OPEN failed: %d\n", r);
@@ -220,14 +220,14 @@
     }
 }
 
-static mx_status_t dh_handle_rpc_read(mx_handle_t h, iostate_t* ios) {
+static zx_status_t dh_handle_rpc_read(zx_handle_t h, iostate_t* ios) {
     dc_msg_t msg;
-    mx_handle_t hin[3];
+    zx_handle_t hin[3];
     uint32_t msize = sizeof(msg);
     uint32_t hcount = 3;
 
-    mx_status_t r;
-    if ((r = mx_channel_read(h, 0, &msg, hin, msize,
+    zx_status_t r;
+    if ((r = zx_channel_read(h, 0, &msg, hin, msize,
                              hcount, &msize, &hcount)) < 0) {
         return r;
     }
@@ -236,14 +236,14 @@
     const char* path = mkdevpath(ios->dev, buffer, sizeof(buffer));
 
     // handle remoteio open messages only
-    if ((msize >= MXRIO_HDR_SZ) && (MXRIO_OP(msg.op) == MXRIO_OPEN)) {
+    if ((msize >= ZXRIO_HDR_SZ) && (ZXRIO_OP(msg.op) == ZXRIO_OPEN)) {
         if (hcount != 1) {
-            r = MX_ERR_INTERNAL;
+            r = ZX_ERR_INTERNAL;
             goto fail;
         }
         log(RPC_RIO, "devhost[%s] remoteio OPEN\n", path);
         dh_handle_open((void*) &msg, msize, hin[0], ios);
-        return MX_OK;
+        return ZX_OK;
     }
 
     const void* data;
@@ -257,34 +257,34 @@
         log(RPC_IN, "devhost[%s] create device stub drv='%s'\n", path, name);
         if (hcount < 1 || hcount > 2) {
             printf("HCOUNT %d\n", hcount);
-            r = MX_ERR_INVALID_ARGS;
+            r = ZX_ERR_INVALID_ARGS;
             goto fail;
         }
         iostate_t* newios = calloc(1, sizeof(iostate_t));
         if (newios == NULL) {
-            r = MX_ERR_NO_MEMORY;
+            r = ZX_ERR_NO_MEMORY;
             break;
         }
 
         //TODO: dev->ops and other lifecycle bits
         // no name means a dummy shadow device
-        if ((newios->dev = calloc(1, sizeof(mx_device_t))) == NULL) {
+        if ((newios->dev = calloc(1, sizeof(zx_device_t))) == NULL) {
             free(newios);
-            r = MX_ERR_NO_MEMORY;
+            r = ZX_ERR_NO_MEMORY;
             break;
         }
-        mx_device_t* dev = newios->dev;
+        zx_device_t* dev = newios->dev;
         memcpy(dev->name, "shadow", 7);
         dev->protocol_id = msg.protocol_id;
         dev->ops = &device_default_ops;
         dev->rpc = hin[0];
-        dev->resource = (hcount == 2 ? hin[1] : MX_HANDLE_INVALID);
+        dev->resource = (hcount == 2 ? hin[1] : ZX_HANDLE_INVALID);
         dev->refcount = 1;
         list_initialize(&dev->children);
         list_initialize(&dev->instances);
 
         newios->ph.handle = hin[0];
-        newios->ph.waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+        newios->ph.waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
         newios->ph.func = dh_handle_dc_rpc;
         if ((r = port_wait(&dh_port, &newios->ph)) < 0) {
             free(newios->dev);
@@ -292,7 +292,7 @@
             break;
         }
         log(RPC_IN, "devhost[%s] created '%s' ios=%p\n", path, name, newios);
-        return MX_OK;
+        return ZX_OK;
 
     case DC_OP_CREATE_DEVICE: {
         // This does not operate under the devhost api lock,
@@ -303,19 +303,19 @@
 
         // hin: rpc, vmo, optional-rsrc
         if (hcount == 2) {
-            hin[2] = MX_HANDLE_INVALID;
+            hin[2] = ZX_HANDLE_INVALID;
         } else if (hcount != 3) {
-            r = MX_ERR_INVALID_ARGS;
+            r = ZX_ERR_INVALID_ARGS;
             break;
         }
         iostate_t* newios = calloc(1, sizeof(iostate_t));
         if (newios == NULL) {
-            r = MX_ERR_NO_MEMORY;
+            r = ZX_ERR_NO_MEMORY;
             break;
         }
 
         // named driver -- ask it to create the device
-        mx_driver_t* drv;
+        zx_driver_t* drv;
         if ((r = dh_find_driver(name, hin[1], &drv)) < 0) {
             free(newios);
             log(ERROR, "devhost[%s] driver load failed: %d\n", path, r);
@@ -323,7 +323,7 @@
         }
         if (drv->ops->create) {
             // magic cookie for device create handshake
-            mx_device_t parent = {
+            zx_device_t parent = {
                 .name = "device_create dummy",
                 .owner = drv,
             };
@@ -335,39 +335,39 @@
             }
             if ((newios->dev = device_create_setup(NULL)) == NULL) {
                 log(ERROR, "devhost[%s] driver create() failed to create a device!", path);
-                r = MX_ERR_BAD_STATE;
+                r = ZX_ERR_BAD_STATE;
                 break;
             }
         } else {
             log(ERROR, "devhost[%s] driver create() not supported\n", path);
-            r = MX_ERR_NOT_SUPPORTED;
+            r = ZX_ERR_NOT_SUPPORTED;
             break;
         }
         //TODO: inform devcoord
 
         newios->dev->rpc = hin[0];
         newios->ph.handle = hin[0];
-        newios->ph.waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+        newios->ph.waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
         newios->ph.func = dh_handle_dc_rpc;
         if ((r = port_wait(&dh_port, &newios->ph)) < 0) {
             free(newios);
             break;
         }
         log(RPC_IN, "devhost[%s] created '%s' ios=%p\n", path, name, newios);
-        return MX_OK;
+        return ZX_OK;
     }
 
     case DC_OP_BIND_DRIVER:
         if (hcount != 1) {
-            r = MX_ERR_INVALID_ARGS;
+            r = ZX_ERR_INVALID_ARGS;
             break;
         }
         //TODO: api lock integration
         log(RPC_IN, "devhost[%s] bind driver '%s'\n", path, name);
-        mx_driver_t* drv;
+        zx_driver_t* drv;
         if (ios->dev->flags & DEV_FLAG_DEAD) {
             log(ERROR, "devhost[%s] bind to removed device disallowed\n", path);
-            r = MX_ERR_IO_NOT_PRESENT;
+            r = ZX_ERR_IO_NOT_PRESENT;
         } else if ((r = dh_find_driver(name, hin[0], &drv)) < 0) {
             log(ERROR, "devhost[%s] driver load failed: %d\n", path, r);
         } else {
@@ -375,7 +375,7 @@
             if (drv->ops->bind) {
                 r = drv->ops->bind(drv->ctx, ios->dev, &cookie);
             } else {
-                r = MX_ERR_NOT_SUPPORTED;
+                r = ZX_ERR_NOT_SUPPORTED;
             }
             if (r < 0) {
                 log(ERROR, "devhost[%s] bind driver '%s' failed: %d\n", path, name, r);
@@ -404,23 +404,23 @@
             .op = DC_OP_STATUS,
             .status = r,
         };
-        mx_channel_write(h, 0, &reply, sizeof(reply), NULL, 0);
-        return MX_OK;
+        zx_channel_write(h, 0, &reply, sizeof(reply), NULL, 0);
+        return ZX_OK;
 
     default:
         log(ERROR, "devhost[%s] invalid rpc op %08x\n", path, msg.op);
-        r = MX_ERR_NOT_SUPPORTED;
+        r = ZX_ERR_NOT_SUPPORTED;
     }
 
 fail:
     while (hcount > 0) {
-        mx_handle_close(hin[--hcount]);
+        zx_handle_close(hin[--hcount]);
     }
     return r;
 }
 
 // handles devcoordinator rpc
-static mx_status_t dh_handle_dc_rpc(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
+static zx_status_t dh_handle_dc_rpc(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
     iostate_t* ios = ios_from_ph(ph);
 
     if (evt != 0) {
@@ -428,66 +428,66 @@
         // of an iostate, to ensure that's the *last*
         // packet about the iostate that we get
         free(ios);
-        return MX_ERR_STOP;
+        return ZX_ERR_STOP;
     }
     if (ios->dead) {
         // ports does not let us cancel packets that are
         // alread in the queue, so the dead flag enables us
         // to ignore them
-        return MX_ERR_STOP;
+        return ZX_ERR_STOP;
     }
-    if (signals & MX_CHANNEL_READABLE) {
-        mx_status_t r = dh_handle_rpc_read(ph->handle, ios);
-        if (r != MX_OK) {
+    if (signals & ZX_CHANNEL_READABLE) {
+        zx_status_t r = dh_handle_rpc_read(ph->handle, ios);
+        if (r != ZX_OK) {
             log(ERROR, "devhost: devmgr rpc unhandleable ios=%p r=%d. fatal.\n", ios, r);
             exit(0);
         }
         return r;
     }
-    if (signals & MX_CHANNEL_PEER_CLOSED) {
+    if (signals & ZX_CHANNEL_PEER_CLOSED) {
         log(ERROR, "devhost: devmgr disconnected! fatal. (ios=%p)\n", ios);
         exit(0);
     }
     log(ERROR, "devhost: no work? %08x\n", signals);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // handles remoteio rpc
-static mx_status_t dh_handle_rio_rpc(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
+static zx_status_t dh_handle_rio_rpc(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
     iostate_t* ios = ios_from_ph(ph);
 
-    mx_status_t r;
-    mxrio_msg_t msg;
-    if (signals & MX_CHANNEL_READABLE) {
-        if ((r = mxrio_handle_rpc(ph->handle, &msg, devhost_rio_handler, ios)) == MX_OK) {
-            return MX_OK;
+    zx_status_t r;
+    zxrio_msg_t msg;
+    if (signals & ZX_CHANNEL_READABLE) {
+        if ((r = zxrio_handle_rpc(ph->handle, &msg, devhost_rio_handler, ios)) == ZX_OK) {
+            return ZX_OK;
         }
-    } else if (signals & MX_CHANNEL_PEER_CLOSED) {
-        mxrio_handle_close(devhost_rio_handler, ios);
-        r = MX_ERR_STOP;
+    } else if (signals & ZX_CHANNEL_PEER_CLOSED) {
+        zxrio_handle_close(devhost_rio_handler, ios);
+        r = ZX_ERR_STOP;
     } else {
         printf("dh_handle_rio_rpc: invalid signals %x\n", signals);
         exit(0);
     }
 
     // We arrive here if handle_rpc was a clean close (ERR_DISPATCHER_DONE),
-    // or close-due-to-error (non-MX_OK), or if the channel was closed
-    // out from under us (MX_ERR_STOP).  In all cases, the ios's reference to
+    // or close-due-to-error (non-ZX_OK), or if the channel was closed
+    // out from under us (ZX_ERR_STOP).  In all cases, the ios's reference to
     // the device was released, and will no longer be used, so we will free
     // it before returning.
-    mx_handle_close(ios->ph.handle);
+    zx_handle_close(ios->ph.handle);
     free(ios);
     return r;
 }
 
-#define LOGBUF_MAX (MX_LOG_RECORD_MAX - sizeof(mx_log_record_t))
+#define LOGBUF_MAX (ZX_LOG_RECORD_MAX - sizeof(zx_log_record_t))
 
-static mx_handle_t devhost_log_handle;
+static zx_handle_t devhost_log_handle;
 
 static ssize_t _devhost_log_write(uint32_t flags, const void* _data, size_t len) {
     static thread_local struct {
         uint32_t next;
-        mx_handle_t handle;
+        zx_handle_t handle;
         char data[LOGBUF_MAX];
     }* ctx = NULL;
 
@@ -506,7 +506,7 @@
         if (c == '\n') {
             if (ctx->next) {
 flush_ctx:
-                mx_log_write(ctx->handle, ctx->next, ctx->data, flags);
+                zx_log_write(ctx->handle, ctx->next, ctx->data, flags);
                 ctx->next = 0;
             }
             continue;
@@ -541,23 +541,23 @@
 }
 
 static void devhost_io_init(void) {
-    if (mx_log_create(0, &devhost_log_handle) < 0) {
+    if (zx_log_create(0, &devhost_log_handle) < 0) {
         return;
     }
-    mxio_t* io;
-    if ((io = mxio_output_create(devhost_log_write, NULL)) == NULL) {
+    fdio_t* io;
+    if ((io = fdio_output_create(devhost_log_write, NULL)) == NULL) {
         return;
     }
     close(1);
-    mxio_bind_to_fd(io, 1, 0);
+    fdio_bind_to_fd(io, 1, 0);
     dup2(1, 2);
 }
 
 // Send message to devcoordinator asking to add child device to
 // parent device.  Called under devhost api lock.
-mx_status_t devhost_add(mx_device_t* parent, mx_device_t* child,
-                        const char* businfo, mx_handle_t resource,
-                        const mx_device_prop_t* props, uint32_t prop_count) {
+zx_status_t devhost_add(zx_device_t* parent, zx_device_t* child,
+                        const char* businfo, zx_handle_t resource,
+                        const zx_device_prop_t* props, uint32_t prop_count) {
     char buffer[512];
     const char* path = mkdevpath(parent, buffer, sizeof(buffer));
     log(RPC_OUT, "devhost[%s] add '%s'\n", path, child->name);
@@ -567,17 +567,17 @@
     char name[namelen];
     snprintf(name, namelen, "%s,%s", libname, child->name);
 
-    mx_status_t r;
+    zx_status_t r;
     iostate_t* ios = calloc(1, sizeof(*ios));
     if (ios == NULL) {
-        r = MX_ERR_NO_MEMORY;
+        r = ZX_ERR_NO_MEMORY;
         goto fail;
     }
 
     dc_msg_t msg;
     uint32_t msglen;
     if ((r = dc_msg_pack(&msg, &msglen,
-                         props, prop_count * sizeof(mx_device_prop_t),
+                         props, prop_count * sizeof(zx_device_prop_t),
                          name, businfo)) < 0) {
         goto fail;
     }
@@ -585,42 +585,42 @@
     msg.protocol_id = child->protocol_id;
 
     // handles: remote endpoint, resource (optional)
-    mx_handle_t hrpc, handle[2];
-    if ((r = mx_channel_create(0, &hrpc, handle)) < 0) {
+    zx_handle_t hrpc, handle[2];
+    if ((r = zx_channel_create(0, &hrpc, handle)) < 0) {
         goto fail;
     }
     handle[1] = resource;
 
     dc_status_t rsp;
     if ((r = dc_msg_rpc(parent->rpc, &msg, msglen,
-                        handle, (resource != MX_HANDLE_INVALID) ? 2 : 1,
+                        handle, (resource != ZX_HANDLE_INVALID) ? 2 : 1,
                         &rsp, sizeof(rsp))) < 0) {
         log(ERROR, "devhost[%s] add '%s': rpc failed: %d\n", path, child->name, r);
     } else {
         ios->dev = child;
         ios->ph.handle = hrpc;
-        ios->ph.waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+        ios->ph.waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
         ios->ph.func = dh_handle_dc_rpc;
-        if ((r = port_wait(&dh_port, &ios->ph)) == MX_OK) {
+        if ((r = port_wait(&dh_port, &ios->ph)) == ZX_OK) {
             child->rpc = hrpc;
             child->ios = ios;
-            return MX_OK;
+            return ZX_OK;
         }
 
     }
-    mx_handle_close(hrpc);
+    zx_handle_close(hrpc);
     free(ios);
     return r;
 
 fail:
-    if (resource != MX_HANDLE_INVALID) {
-        mx_handle_close(resource);
+    if (resource != ZX_HANDLE_INVALID) {
+        zx_handle_close(resource);
     }
     free(ios);
     return r;
 }
 
-static mx_status_t devhost_rpc(mx_device_t* dev, uint32_t op,
+static zx_status_t devhost_rpc(zx_device_t* dev, uint32_t op,
                                const char* args, const char* opname,
                                dc_status_t* rsp, size_t rsp_len) {
     char buffer[512];
@@ -628,7 +628,7 @@
     log(RPC_OUT, "devhost[%s] %s args='%s'\n", path, opname, args ? args : "");
     dc_msg_t msg;
     uint32_t msglen;
-    mx_status_t r;
+    zx_status_t r;
     if ((r = dc_msg_pack(&msg, &msglen, NULL, 0, NULL, args)) < 0) {
         return r;
     }
@@ -642,11 +642,11 @@
 
 // Send message to devcoordinator informing it that this device
 // is being removed.  Called under devhost api lock.
-mx_status_t devhost_remove(mx_device_t* dev) {
+zx_status_t devhost_remove(zx_device_t* dev) {
     devhost_iostate_t* ios = dev->ios;
     if (ios == NULL) {
         log(ERROR, "removing device %p, ios is NULL\n", dev);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     log(DEVLC, "removing device %p, ios %p\n", dev, ios);
@@ -662,28 +662,28 @@
     // ensure we get no further events
     //TODO: this does not work yet, ports limitation
     port_cancel(&dh_port, &ios->ph);
-    ios->ph.handle = MX_HANDLE_INVALID;
+    ios->ph.handle = ZX_HANDLE_INVALID;
     dev->ios = NULL;
 
     dc_status_t rsp;
     devhost_rpc(dev, DC_OP_REMOVE_DEVICE, NULL, "remove-device", &rsp, sizeof(rsp));
 
     // shut down our rpc channel
-    mx_handle_close(dev->rpc);
-    dev->rpc = MX_HANDLE_INVALID;
+    zx_handle_close(dev->rpc);
+    dev->rpc = ZX_HANDLE_INVALID;
 
     // queue an event to destroy the iostate
     port_queue(&dh_port, &ios->ph, 1);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t devhost_get_topo_path(mx_device_t* dev, char* path, size_t max, size_t* actual) {
+zx_status_t devhost_get_topo_path(zx_device_t* dev, char* path, size_t max, size_t* actual) {
     struct {
         dc_status_t rsp;
         char path[DC_PATH_MAX];
     } reply;
-    mx_status_t r;
+    zx_status_t r;
     if ((r = devhost_rpc(dev, DC_OP_GET_TOPO_PATH, NULL, "get-topo-path",
                          &reply.rsp, sizeof(reply))) < 0) {
         return r;
@@ -691,26 +691,26 @@
     reply.path[DC_PATH_MAX - 1] = 0;
     size_t len = strlen(reply.path) + 1;
     if (len > max) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
 
     memcpy(path, reply.path, len);
     *actual = len;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t devhost_device_bind(mx_device_t* dev, const char* drv_libname) {
+zx_status_t devhost_device_bind(zx_device_t* dev, const char* drv_libname) {
     dc_status_t rsp;
     return devhost_rpc(dev, DC_OP_BIND_DEVICE, drv_libname, "bind-device", &rsp, sizeof(rsp));
 }
 
 
-mx_handle_t root_resource_handle;
+zx_handle_t root_resource_handle;
 
 
-mx_status_t devhost_start_iostate(devhost_iostate_t* ios, mx_handle_t h) {
+zx_status_t devhost_start_iostate(devhost_iostate_t* ios, zx_handle_t h) {
     ios->ph.handle = h;
-    ios->ph.waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+    ios->ph.waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
     ios->ph.func = dh_handle_rio_rpc;
     return port_wait(&dh_port, &ios->ph);
 }
@@ -720,18 +720,18 @@
 
     log(TRACE, "devhost: main()\n");
 
-    root_ios.ph.handle = mx_get_startup_handle(PA_HND(PA_USER0, 0));
-    if (root_ios.ph.handle == MX_HANDLE_INVALID) {
+    root_ios.ph.handle = zx_get_startup_handle(PA_HND(PA_USER0, 0));
+    if (root_ios.ph.handle == ZX_HANDLE_INVALID) {
         log(ERROR, "devhost: rpc handle invalid\n");
         return -1;
     }
 
-    root_resource_handle = mx_get_startup_handle(PA_HND(PA_RESOURCE, 0));
-    if (root_resource_handle == MX_HANDLE_INVALID) {
+    root_resource_handle = zx_get_startup_handle(PA_HND(PA_RESOURCE, 0));
+    if (root_resource_handle == ZX_HANDLE_INVALID) {
         log(ERROR, "devhost: no root resource handle!\n");
     }
 
-    mx_status_t r;
+    zx_status_t r;
     if ((r = port_init(&dh_port)) < 0) {
         log(ERROR, "devhost: could not create port: %d\n", r);
         return -1;
@@ -741,7 +741,7 @@
         return -1;
     }
 
-    r = port_dispatch(&dh_port, MX_TIME_INFINITE, false);
+    r = port_dispatch(&dh_port, ZX_TIME_INFINITE, false);
     log(ERROR, "devhost: port dispatch finished: %d\n", r);
 
     return 0;
diff --git a/system/core/devmgr/devhost.h b/system/core/devmgr/devhost.h
index 69c4090..02d0a09 100644
--- a/system/core/devmgr/devhost.h
+++ b/system/core/devmgr/devhost.h
@@ -11,9 +11,9 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <mxio/remoteio.h>
+#include <fdio/remoteio.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <threads.h>
 #include <stdint.h>
@@ -28,69 +28,69 @@
 
 // Safe external APIs are in device.h and device_internal.h
 
-typedef struct mx_driver {
+typedef struct zx_driver {
     const char* name;
-    const mx_driver_ops_t* ops;
+    const zx_driver_ops_t* ops;
     void* ctx;
     const char* libname;
     list_node_t node;
-    mx_status_t status;
-} mx_driver_t;
+    zx_status_t status;
+} zx_driver_t;
 
-extern mx_protocol_device_t device_default_ops;
+extern zx_protocol_device_t device_default_ops;
 
-mx_status_t devhost_device_unbind(mx_device_t* dev);
+zx_status_t devhost_device_unbind(zx_device_t* dev);
 
-mx_status_t devhost_device_add(mx_device_t* dev, mx_device_t* parent,
-                               const mx_device_prop_t* props, uint32_t prop_count,
-                               const char* businfo, mx_handle_t resource);
-mx_status_t devhost_device_install(mx_device_t* dev);
-mx_status_t devhost_device_remove(mx_device_t* dev);
-mx_status_t devhost_device_bind(mx_device_t* dev, const char* drv_libname);
-mx_status_t devhost_device_rebind(mx_device_t* dev);
-mx_status_t devhost_device_create(mx_driver_t* drv, mx_device_t* parent,
+zx_status_t devhost_device_add(zx_device_t* dev, zx_device_t* parent,
+                               const zx_device_prop_t* props, uint32_t prop_count,
+                               const char* businfo, zx_handle_t resource);
+zx_status_t devhost_device_install(zx_device_t* dev);
+zx_status_t devhost_device_remove(zx_device_t* dev);
+zx_status_t devhost_device_bind(zx_device_t* dev, const char* drv_libname);
+zx_status_t devhost_device_rebind(zx_device_t* dev);
+zx_status_t devhost_device_create(zx_driver_t* drv, zx_device_t* parent,
                                   const char* name, void* ctx,
-                                  mx_protocol_device_t* ops, mx_device_t** out);
-mx_status_t devhost_device_open_at(mx_device_t* dev, mx_device_t** out,
+                                  zx_protocol_device_t* ops, zx_device_t** out);
+zx_status_t devhost_device_open_at(zx_device_t* dev, zx_device_t** out,
                                  const char* path, uint32_t flags);
-mx_status_t devhost_device_close(mx_device_t* dev, uint32_t flags);
-void devhost_device_destroy(mx_device_t* dev);
+zx_status_t devhost_device_close(zx_device_t* dev, uint32_t flags);
+void devhost_device_destroy(zx_device_t* dev);
 
-mx_status_t devhost_load_firmware(mx_device_t* dev, const char* path,
-                                  mx_handle_t* fw, size_t* size);
+zx_status_t devhost_load_firmware(zx_device_t* dev, const char* path,
+                                  zx_handle_t* fw, size_t* size);
 
-mx_status_t devhost_get_topo_path(mx_device_t* dev, char* path, size_t max, size_t* actual);
+zx_status_t devhost_get_topo_path(zx_device_t* dev, char* path, size_t max, size_t* actual);
 
 // shared between devhost.c and rpc-device.c
 typedef struct devhost_iostate {
-    mx_device_t* dev;
+    zx_device_t* dev;
     size_t io_off;
     uint32_t flags;
     bool dead;
     port_handler_t ph;
 } devhost_iostate_t;
 
-devhost_iostate_t* create_devhost_iostate(mx_device_t* dev);
-mx_status_t devhost_rio_handler(mxrio_msg_t* msg, void* cookie);
+devhost_iostate_t* create_devhost_iostate(zx_device_t* dev);
+zx_status_t devhost_rio_handler(zxrio_msg_t* msg, void* cookie);
 
-mx_status_t devhost_start_iostate(devhost_iostate_t* ios, mx_handle_t h);
+zx_status_t devhost_start_iostate(devhost_iostate_t* ios, zx_handle_t h);
 
 // routines devhost uses to talk to dev coordinator
-mx_status_t devhost_add(mx_device_t* dev, mx_device_t* child,
-                        const char* businfo, mx_handle_t resource,
-                        const mx_device_prop_t* props, uint32_t prop_count);
-mx_status_t devhost_remove(mx_device_t* dev);
+zx_status_t devhost_add(zx_device_t* dev, zx_device_t* child,
+                        const char* businfo, zx_handle_t resource,
+                        const zx_device_prop_t* props, uint32_t prop_count);
+zx_status_t devhost_remove(zx_device_t* dev);
 
 
 // device refcounts
-void dev_ref_release(mx_device_t* dev);
-static inline void dev_ref_acquire(mx_device_t* dev) {
+void dev_ref_release(zx_device_t* dev);
+static inline void dev_ref_acquire(zx_device_t* dev) {
     dev->refcount++;
 }
 
-mx_handle_t get_root_resource(void);
+zx_handle_t get_root_resource(void);
 
-mx_device_t* device_create_setup(mx_device_t* parent);
+zx_device_t* device_create_setup(zx_device_t* parent);
 
 // locking and lock debugging
 extern mtx_t __devhost_api_lock;
diff --git a/system/core/devmgr/device-internal.h b/system/core/devmgr/device-internal.h
index 34c49b7..12d57f4 100644
--- a/system/core/devmgr/device-internal.h
+++ b/system/core/devmgr/device-internal.h
@@ -6,10 +6,10 @@
 
 #include <ddk/device.h>
 
-struct mx_device {
+struct zx_device {
     uintptr_t magic;
 
-    mx_protocol_device_t* ops;
+    zx_protocol_device_t* ops;
 
     // reserved for driver use; will not be touched by devmgr
     void* ctx;
@@ -17,10 +17,10 @@
     uint32_t flags;
     uint32_t refcount;
 
-    mx_handle_t event;
-    mx_handle_t local_event;
-    mx_handle_t rpc;
-    mx_handle_t resource;
+    zx_handle_t event;
+    zx_handle_t local_event;
+    zx_handle_t rpc;
+    zx_handle_t resource;
 
     // most devices implement a single
     // protocol beyond the base device protocol
@@ -28,13 +28,13 @@
     void* protocol_ops;
 
     // driver that has published this device
-    mx_driver_t* driver;
+    zx_driver_t* driver;
 
     // parent in the device tree
-    mx_device_t* parent;
+    zx_device_t* parent;
 
     // driver that is bound to this device, NULL if unbound
-    mx_driver_t* owner;
+    zx_driver_t* owner;
 
     void* owner_cookie;
 
@@ -50,12 +50,12 @@
     // iostate
     void* ios;
 
-    char name[MX_DEVICE_NAME_MAX + 1];
+    char name[ZX_DEVICE_NAME_MAX + 1];
 };
 
-// mx_device_t objects must be created or initialized by the driver manager's
+// zx_device_t objects must be created or initialized by the driver manager's
 // device_create() function.  Drivers MAY NOT touch any
-// fields in the mx_device_t, except for the protocol_id and protocol_ops
+// fields in the zx_device_t, except for the protocol_id and protocol_ops
 // fields which it may fill out after init and before device_add() is called,
 // and the ctx field which may be used to store driver-specific data.
 
@@ -69,54 +69,54 @@
 
 #define DEV_MAGIC 'MDEV'
 
-mx_status_t device_bind(mx_device_t* dev, const char* drv_libname);
-mx_status_t device_open_at(mx_device_t* dev, mx_device_t** out, const char* path, uint32_t flags);
-mx_status_t device_close(mx_device_t* dev, uint32_t flags);
+zx_status_t device_bind(zx_device_t* dev, const char* drv_libname);
+zx_status_t device_open_at(zx_device_t* dev, zx_device_t** out, const char* path, uint32_t flags);
+zx_status_t device_close(zx_device_t* dev, uint32_t flags);
 
-static inline mx_status_t dev_op_open(mx_device_t* dev, mx_device_t** dev_out, uint32_t flags) {
+static inline zx_status_t dev_op_open(zx_device_t* dev, zx_device_t** dev_out, uint32_t flags) {
     return dev->ops->open(dev->ctx, dev_out, flags);
 }
 
-static inline mx_status_t dev_op_open_at(mx_device_t* dev, mx_device_t** dev_out,
+static inline zx_status_t dev_op_open_at(zx_device_t* dev, zx_device_t** dev_out,
                                            const char* path, uint32_t flags) {
     return dev->ops->open_at(dev->ctx, dev_out, path, flags);
 }
 
-static inline mx_status_t dev_op_close(mx_device_t* dev, uint32_t flags) {
+static inline zx_status_t dev_op_close(zx_device_t* dev, uint32_t flags) {
     return dev->ops->close(dev->ctx, flags);
 }
 
-static inline void dev_op_unbind(mx_device_t* dev) {
+static inline void dev_op_unbind(zx_device_t* dev) {
     dev->ops->unbind(dev->ctx);
 }
 
-static inline void dev_op_release(mx_device_t* dev) {
+static inline void dev_op_release(zx_device_t* dev) {
     dev->ops->release(dev->ctx);
 }
 
-static inline mx_status_t dev_op_suspend(mx_device_t* dev, uint32_t flags) {
+static inline zx_status_t dev_op_suspend(zx_device_t* dev, uint32_t flags) {
     return dev->ops->suspend(dev->ctx, flags);
 }
 
-static inline mx_status_t dev_op_resume(mx_device_t* dev, uint32_t flags) {
+static inline zx_status_t dev_op_resume(zx_device_t* dev, uint32_t flags) {
     return dev->ops->resume(dev->ctx, flags);
 }
 
-static inline mx_status_t dev_op_read(mx_device_t* dev, void* buf, size_t count, mx_off_t off,
+static inline zx_status_t dev_op_read(zx_device_t* dev, void* buf, size_t count, zx_off_t off,
                                          size_t* actual) {
     return dev->ops->read(dev->ctx, buf, count, off, actual);
 }
 
-static inline mx_status_t dev_op_write(mx_device_t* dev, const void* buf, size_t count,
-                                          mx_off_t off, size_t* actual) {
+static inline zx_status_t dev_op_write(zx_device_t* dev, const void* buf, size_t count,
+                                          zx_off_t off, size_t* actual) {
     return dev->ops->write(dev->ctx, buf, count, off, actual);
 }
 
-static inline mx_off_t dev_op_get_size(mx_device_t* dev) {
+static inline zx_off_t dev_op_get_size(zx_device_t* dev) {
     return dev->ops->get_size(dev->ctx);
 }
 
-static inline mx_status_t dev_op_ioctl(mx_device_t* dev, uint32_t op,
+static inline zx_status_t dev_op_ioctl(zx_device_t* dev, uint32_t op,
                                       const void* in_buf, size_t in_len,
                                       void* out_buf, size_t out_len, size_t* out_actual) {
     return dev->ops->ioctl(dev->ctx, op, in_buf, in_len, out_buf, out_len, out_actual);
diff --git a/system/core/devmgr/devmgr-binding.c b/system/core/devmgr/devmgr-binding.c
index 8c48a64..c4f296a 100644
--- a/system/core/devmgr/devmgr-binding.c
+++ b/system/core/devmgr/devmgr-binding.c
@@ -11,18 +11,18 @@
 #include "devcoordinator.h"
 
 typedef struct {
-    const mx_device_prop_t* props;
-    const mx_device_prop_t* end;
+    const zx_device_prop_t* props;
+    const zx_device_prop_t* end;
     uint32_t protocol_id;
     uint32_t binding_size;
-    const mx_bind_inst_t* binding;
+    const zx_bind_inst_t* binding;
     const char* name;
     uint32_t autobind;
 } bpctx_t;
 
 static uint32_t dev_get_prop(bpctx_t* ctx, uint32_t id) {
-    const mx_device_prop_t* props = ctx->props;
-    const mx_device_prop_t* end = ctx->end;
+    const zx_device_prop_t* props = ctx->props;
+    const zx_device_prop_t* end = ctx->end;
 
     while (props < end) {
         if (props->id == id) {
@@ -44,8 +44,8 @@
 }
 
 static bool is_bindable(bpctx_t* ctx) {
-    const mx_bind_inst_t* ip = ctx->binding;
-    const mx_bind_inst_t* end = ip + (ctx->binding_size / sizeof(mx_bind_inst_t));
+    const zx_bind_inst_t* ip = ctx->binding;
+    const zx_bind_inst_t* end = ip + (ctx->binding_size / sizeof(zx_bind_inst_t));
     uint32_t flags = 0;
 
     while (ip < end) {
@@ -139,7 +139,7 @@
 }
 
 bool dc_is_bindable(driver_t* drv, uint32_t protocol_id,
-                    mx_device_prop_t* props, size_t prop_count,
+                    zx_device_prop_t* props, size_t prop_count,
                     bool autobind) {
     if (drv->binding_size == 0) {
         return false;
diff --git a/system/core/devmgr/devmgr-coordinator.c b/system/core/devmgr/devmgr-coordinator.c
index 922ee84..cbddee8 100644
--- a/system/core/devmgr/devmgr-coordinator.c
+++ b/system/core/devmgr/devmgr-coordinator.c
@@ -11,13 +11,13 @@
 #include <ddk/driver.h>
 #include <driver-info/driver-info.h>
 #include <launchpad/launchpad.h>
-#include <magenta/assert.h>
-#include <magenta/ktrace.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/policy.h>
-#include <magenta/device/dmctl.h>
-#include <mxio/io.h>
+#include <zircon/assert.h>
+#include <zircon/ktrace.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/policy.h>
+#include <zircon/device/dmctl.h>
+#include <fdio/io.h>
 
 #include "acpi.h"
 
@@ -26,7 +26,7 @@
 #include "log.h"
 #include "memfs-private.h"
 
-extern mx_handle_t virtcon_open;
+extern zx_handle_t virtcon_open;
 
 uint32_t log_flags = LOG_ERROR | LOG_INFO;
 
@@ -34,10 +34,10 @@
 static void dc_dump_devprops(void);
 static void dc_dump_drivers(void);
 
-static mx_handle_t dmctl_socket;
+static zx_handle_t dmctl_socket;
 
 static void dmprintf(const char* fmt, ...) {
-    if (dmctl_socket == MX_HANDLE_INVALID) {
+    if (dmctl_socket == ZX_HANDLE_INVALID) {
         return;
     }
     char buf[1024];
@@ -46,17 +46,17 @@
     vsnprintf(buf, sizeof(buf), fmt, ap);
     va_end(ap);
     size_t actual;
-    if (mx_socket_write(dmctl_socket, 0, buf, strlen(buf), &actual) < 0) {
-        mx_handle_close(dmctl_socket);
-        dmctl_socket = MX_HANDLE_INVALID;
+    if (zx_socket_write(dmctl_socket, 0, buf, strlen(buf), &actual) < 0) {
+        zx_handle_close(dmctl_socket);
+        dmctl_socket = ZX_HANDLE_INVALID;
     }
 }
 
-static mx_status_t handle_dmctl_write(size_t len, const char* cmd) {
+static zx_status_t handle_dmctl_write(size_t len, const char* cmd) {
     if (len == 4) {
         if (!memcmp(cmd, "dump", 4)) {
             dc_dump_state();
-            return MX_OK;
+            return ZX_OK;
         }
         if (!memcmp(cmd, "help", 4)) {
             dmprintf("dump        - dump device tree\n"
@@ -69,40 +69,40 @@
                      "devprops    - dump published devices and their binding properties\n"
                      "drivers     - list discovered drivers and their properties\n"
                      );
-            return MX_OK;
+            return ZX_OK;
         }
     }
     if ((len == 6) && !memcmp(cmd, "reboot", 6)) {
         devmgr_vfs_exit();
         devhost_acpi_reboot();
-        return MX_OK;
+        return ZX_OK;
     }
     if ((len == 7) && !memcmp(cmd, "drivers", 7)) {
         dc_dump_drivers();
-        return MX_OK;
+        return ZX_OK;
     }
     if (len == 8) {
         if (!memcmp(cmd, "poweroff", 8) || !memcmp(cmd, "shutdown", 8)) {
             devmgr_vfs_exit();
             devhost_acpi_poweroff();
-            return MX_OK;
+            return ZX_OK;
         }
         if (!memcmp(cmd, "ktraceon", 8)) {
-            mx_ktrace_control(get_root_resource(), KTRACE_ACTION_START, KTRACE_GRP_ALL, NULL);
-            return MX_OK;
+            zx_ktrace_control(get_root_resource(), KTRACE_ACTION_START, KTRACE_GRP_ALL, NULL);
+            return ZX_OK;
         }
         if (!memcmp(cmd, "devprops", 8)) {
             dc_dump_devprops();
-            return MX_OK;
+            return ZX_OK;
         }
     }
     if ((len == 9) && (!memcmp(cmd, "ktraceoff", 9))) {
-        mx_ktrace_control(get_root_resource(), KTRACE_ACTION_STOP, 0, NULL);
-        mx_ktrace_control(get_root_resource(), KTRACE_ACTION_REWIND, 0, NULL);
-        return MX_OK;
+        zx_ktrace_control(get_root_resource(), KTRACE_ACTION_STOP, 0, NULL);
+        zx_ktrace_control(get_root_resource(), KTRACE_ACTION_REWIND, 0, NULL);
+        return ZX_OK;
     }
     if ((len > 12) && !memcmp(cmd, "kerneldebug ", 12)) {
-        return mx_debug_send_command(get_root_resource(), cmd + 12, len - 12);
+        return zx_debug_send_command(get_root_resource(), cmd + 12, len - 12);
     }
     if ((len > 11) && !memcmp(cmd, "add-driver:", 11)) {
         len -= 11;
@@ -110,26 +110,26 @@
         memcpy(path, cmd + 11, len);
         path[len] = 0;
         load_driver(path);
-        return MX_OK;
+        return ZX_OK;
     }
     dmprintf("unknown command\n");
     log(ERROR, "dmctl: unknown command '%.*s'\n", (int) len, cmd);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 //TODO: these are copied from devhost.h
 #define ID_HJOBROOT 4
-mx_handle_t get_sysinfo_job_root(void);
+zx_handle_t get_sysinfo_job_root(void);
 
 
-static mx_status_t dc_handle_device(port_handler_t* ph, mx_signals_t signals, uint32_t evt);
-static mx_status_t dc_attempt_bind(driver_t* drv, device_t* dev);
+static zx_status_t dc_handle_device(port_handler_t* ph, zx_signals_t signals, uint32_t evt);
+static zx_status_t dc_attempt_bind(driver_t* drv, device_t* dev);
 
 static bool dc_running;
 
-static mx_handle_t dc_watch_channel;
+static zx_handle_t dc_watch_channel;
 
-static mx_handle_t devhost_job;
+static zx_handle_t devhost_job;
 port_t dc_port;
 
 // All Drivers
@@ -151,18 +151,18 @@
     return NULL;
 }
 
-static mx_status_t libname_to_vmo(const char* libname, mx_handle_t* out) {
+static zx_status_t libname_to_vmo(const char* libname, zx_handle_t* out) {
     driver_t* drv = libname_to_driver(libname);
     if (drv == NULL) {
         log(ERROR, "devcoord: cannot find driver '%s'\n", libname);
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     int fd = open(libname, O_RDONLY);
     if (fd < 0) {
         log(ERROR, "devcoord: cannot open driver '%s'\n", libname);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    mx_status_t r = mxio_get_vmo(fd, out);
+    zx_status_t r = fdio_get_vmo(fd, out);
     close(fd);
     if (r < 0) {
         log(ERROR, "devcoord: cannot get driver vmo '%s'\n", libname);
@@ -172,7 +172,7 @@
 
 static device_t root_device = {
     .flags = DEV_CTX_IMMORTAL | DEV_CTX_BUSDEV | DEV_CTX_MULTI_BIND,
-    .protocol_id = MX_PROTOCOL_ROOT,
+    .protocol_id = ZX_PROTOCOL_ROOT,
     .name = "root",
     .libname = "",
     .args = "root,,",
@@ -183,7 +183,7 @@
 
 static device_t misc_device = {
     .flags = DEV_CTX_IMMORTAL | DEV_CTX_BUSDEV | DEV_CTX_MULTI_BIND,
-    .protocol_id = MX_PROTOCOL_MISC_PARENT,
+    .protocol_id = ZX_PROTOCOL_MISC_PARENT,
     .name = "misc",
     .libname = "",
     .args = "misc,,",
@@ -192,11 +192,11 @@
     .refcount = 1,
 };
 
-static mx_handle_t acpi_rpc[2] = { MX_HANDLE_INVALID, MX_HANDLE_INVALID };
+static zx_handle_t acpi_rpc[2] = { ZX_HANDLE_INVALID, ZX_HANDLE_INVALID };
 
 static device_t acpi_device = {
     .flags = DEV_CTX_IMMORTAL | DEV_CTX_BUSDEV,
-    .protocol_id = MX_PROTOCOL_ACPI_BUS,
+    .protocol_id = ZX_PROTOCOL_ACPI_BUS,
     .name = "acpi",
     .libname = "",
     .args = "acpi,,",
@@ -226,13 +226,13 @@
     .refcount = 1,
 };
 
-void devmgr_set_mdi(mx_handle_t mdi_handle) {
+void devmgr_set_mdi(zx_handle_t mdi_handle) {
     // MDI VMO handle is passed via via the resource handle
     platform_device.hrsrc = mdi_handle;
 }
 
 static void dc_dump_device(device_t* dev, size_t indent) {
-    mx_koid_t pid = dev->host ? dev->host->koid : 0;
+    zx_koid_t pid = dev->host ? dev->host->koid : 0;
     char extra[256];
     if (log_flags & LOG_DEVLC) {
         snprintf(extra, sizeof(extra), " dev=%p ref=%d", dev, dev->refcount);
@@ -264,7 +264,7 @@
     dc_dump_device(&root_device, 0);
     dc_dump_device(&misc_device, 1);
     dc_dump_device(&acpi_device, 1);
-    if (platform_device.hrsrc != MX_HANDLE_INVALID) {
+    if (platform_device.hrsrc != ZX_HANDLE_INVALID) {
         dc_dump_device(&platform_device, 1);
     }
 }
@@ -299,7 +299,7 @@
 
         dmprintf("%u Propert%s\n", dev->prop_count, dev->prop_count == 1 ? "y" : "ies");
         for (uint32_t i = 0; i < dev->prop_count; ++i) {
-            const mx_device_prop_t* p = dev->props + i;
+            const zx_device_prop_t* p = dev->props + i;
             const char* param_name = di_bind_param_name(p->id);
 
             if (param_name) {
@@ -326,7 +326,7 @@
     dc_dump_device_props(&root_device);
     dc_dump_device_props(&misc_device);
     dc_dump_device_props(&acpi_device);
-    if (platform_device.hrsrc != MX_HANDLE_INVALID) {
+    if (platform_device.hrsrc != ZX_HANDLE_INVALID) {
         dc_dump_device_props(&platform_device);
     }
 }
@@ -363,7 +363,7 @@
 static list_node_t list_unbound_devices = LIST_INITIAL_VALUE(list_unbound_devices);
 
 static void queue_work(work_t* work, uint32_t op, uint32_t arg) {
-    MX_ASSERT(work->op == WORK_IDLE);
+    ZX_ASSERT(work->op == WORK_IDLE);
     work->op = op;
     work->arg = arg;
     list_add_tail(&list_pending_work, &work->node);
@@ -397,9 +397,9 @@
 
 static const char* devhost_bin = "/boot/bin/devhost";
 
-mx_handle_t get_service_root(void);
+zx_handle_t get_service_root(void);
 
-static mx_status_t dc_get_topo_path(device_t* dev, char* out, size_t max) {
+static zx_status_t dc_get_topo_path(device_t* dev, char* out, size_t max) {
     char tmp[max];
     char* path = tmp + max - 1;
     *path = 0;
@@ -422,7 +422,7 @@
         }
         size_t len = strlen(name) + 1;
         if (len > (max - total)) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         memcpy(path - len + 1, name, len - 1);
         path -= len;
@@ -432,24 +432,24 @@
     }
 
     memcpy(out, path, total);
-    return MX_OK;
+    return ZX_OK;
 }
 
 //TODO: use a better device identifier
-static mx_status_t dc_notify(device_t* dev, uint32_t op) {
-    if (dc_watch_channel == MX_HANDLE_INVALID) {
-        return MX_ERR_BAD_STATE;
+static zx_status_t dc_notify(device_t* dev, uint32_t op) {
+    if (dc_watch_channel == ZX_HANDLE_INVALID) {
+        return ZX_ERR_BAD_STATE;
     }
-    mx_status_t r;
+    zx_status_t r;
     if (op == DEVMGR_OP_DEVICE_ADDED) {
-        size_t propslen = sizeof(mx_device_prop_t) * dev->prop_count;
+        size_t propslen = sizeof(zx_device_prop_t) * dev->prop_count;
         size_t len = sizeof(devmgr_event_t) + propslen;
         char msg[len + DC_PATH_MAX];
         devmgr_event_t* evt = (void*) msg;
         memset(evt, 0, sizeof(devmgr_event_t));
         memcpy(msg + sizeof(devmgr_event_t), dev->props, propslen);
         if (dc_get_topo_path(dev, msg + len, DC_PATH_MAX) < 0) {
-            return MX_OK;
+            return ZX_OK;
         }
         size_t pathlen = strlen(msg + len);
         len += pathlen;
@@ -461,7 +461,7 @@
         evt->u.add.protocol_id = dev->protocol_id;
         evt->u.add.props_len = propslen;
         evt->u.add.path_len = pathlen;
-        r = mx_channel_write(dc_watch_channel, 0, msg, len, NULL, 0);
+        r = zx_channel_write(dc_watch_channel, 0, msg, len, NULL, 0);
     } else {
         devmgr_event_t evt;
         memset(&evt, 0, sizeof(evt));
@@ -470,18 +470,18 @@
             evt.flags |= DEVMGR_FLAGS_BOUND;
         }
         evt.id = (uintptr_t) dev;
-        r = mx_channel_write(dc_watch_channel, 0, &evt, sizeof(evt), NULL, 0);
+        r = zx_channel_write(dc_watch_channel, 0, &evt, sizeof(evt), NULL, 0);
     }
     if (r < 0) {
-        mx_handle_close(dc_watch_channel);
-        dc_watch_channel = MX_HANDLE_INVALID;
+        zx_handle_close(dc_watch_channel);
+        dc_watch_channel = ZX_HANDLE_INVALID;
     }
     return r;
 }
 
-static void dc_watch(mx_handle_t h) {
-    if (dc_watch_channel != MX_HANDLE_INVALID) {
-        mx_handle_close(dc_watch_channel);
+static void dc_watch(zx_handle_t h) {
+    if (dc_watch_channel != ZX_HANDLE_INVALID) {
+        zx_handle_close(dc_watch_channel);
     }
     dc_watch_channel = h;
     device_t* dev;
@@ -496,8 +496,8 @@
     }
 }
 
-static mx_status_t dc_launch_devhost(devhost_t* host,
-                                     const char* name, mx_handle_t hrpc) {
+static zx_status_t dc_launch_devhost(devhost_t* host,
+                                     const char* name, zx_handle_t hrpc) {
     launchpad_t* lp;
     launchpad_create_with_jobs(devhost_job, 0, name, &lp);
     launchpad_load_from_file(lp, devhost_bin);
@@ -505,9 +505,9 @@
 
     launchpad_add_handle(lp, hrpc, PA_HND(PA_USER0, 0));
 
-    mx_handle_t h;
+    zx_handle_t h;
     //TODO: limit root resource to root devhost only
-    mx_handle_duplicate(get_root_resource(), MX_RIGHT_SAME_RIGHTS, &h);
+    zx_handle_duplicate(get_root_resource(), ZX_RIGHT_SAME_RIGHTS, &h);
     launchpad_add_handle(lp, h, PA_HND(PA_RESOURCE, 0));
 
     // Inherit devmgr's environment (including kernel cmdline)
@@ -521,7 +521,7 @@
                          PA_HND(PA_NS_DIR, name_count++));
 
     //TODO: constrain to /svc/device
-    if ((h = get_service_root()) != MX_HANDLE_INVALID) {
+    if ((h = get_service_root()) != ZX_HANDLE_INVALID) {
         launchpad_add_handle(lp, h, PA_HND(PA_NS_DIR, name_count++));
     }
 
@@ -539,38 +539,38 @@
     }
 
     const char* errmsg;
-    mx_status_t status = launchpad_go(lp, &host->proc, &errmsg);
+    zx_status_t status = launchpad_go(lp, &host->proc, &errmsg);
     if (status < 0) {
         log(ERROR, "devcoord: launch devhost '%s': failed: %d: %s\n",
             name, status, errmsg);
         return status;
     }
-    mx_info_handle_basic_t info;
-    if (mx_object_get_info(host->proc, MX_INFO_HANDLE_BASIC, &info,
-                           sizeof(info), NULL, NULL) == MX_OK) {
+    zx_info_handle_basic_t info;
+    if (zx_object_get_info(host->proc, ZX_INFO_HANDLE_BASIC, &info,
+                           sizeof(info), NULL, NULL) == ZX_OK) {
         host->koid = info.koid;
     }
     log(INFO, "devcoord: launch devhost '%s': pid=%zu\n",
         name, host->koid);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t dc_new_devhost(const char* name, devhost_t** out) {
+static zx_status_t dc_new_devhost(const char* name, devhost_t** out) {
     devhost_t* dh = calloc(1, sizeof(devhost_t));
     if (dh == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_handle_t hrpc;
-    mx_status_t r;
-    if ((r = mx_channel_create(0, &hrpc, &dh->hrpc)) < 0) {
+    zx_handle_t hrpc;
+    zx_status_t r;
+    if ((r = zx_channel_create(0, &hrpc, &dh->hrpc)) < 0) {
         free(dh);
         return r;
     }
 
     if ((r = dc_launch_devhost(dh, name, hrpc)) < 0) {
-        mx_handle_close(dh->hrpc);
+        zx_handle_close(dh->hrpc);
         free(dh);
         return r;
     }
@@ -578,7 +578,7 @@
     list_initialize(&dh->devices);
 
     *out = dh;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void dc_release_devhost(devhost_t* dh) {
@@ -588,9 +588,9 @@
         return;
     }
     log(INFO, "devcoord: destroy host %p\n", dh);
-    mx_handle_close(dh->hrpc);
-    mx_task_kill(dh->proc);
-    mx_handle_close(dh->proc);
+    zx_handle_close(dh->hrpc);
+    zx_task_kill(dh->proc);
+    zx_handle_close(dh->proc);
     free(dh);
 }
 
@@ -612,14 +612,14 @@
 
     devfs_unpublish(dev);
 
-    if (dev->hrpc != MX_HANDLE_INVALID) {
-        mx_handle_close(dev->hrpc);
-        dev->hrpc = MX_HANDLE_INVALID;
-        dev->ph.handle = MX_HANDLE_INVALID;
+    if (dev->hrpc != ZX_HANDLE_INVALID) {
+        zx_handle_close(dev->hrpc);
+        dev->hrpc = ZX_HANDLE_INVALID;
+        dev->ph.handle = ZX_HANDLE_INVALID;
     }
-    if (dev->hrsrc != MX_HANDLE_INVALID) {
-        mx_handle_close(dev->hrsrc);
-        dev->hrsrc = MX_HANDLE_INVALID;
+    if (dev->hrsrc != ZX_HANDLE_INVALID) {
+        zx_handle_close(dev->hrsrc);
+        dev->hrsrc = ZX_HANDLE_INVALID;
     }
     dev->host = NULL;
 
@@ -632,28 +632,28 @@
 // Add a new device to a parent device (same devhost)
 // New device is published in devfs.
 // Caller closes handles on error, so we don't have to.
-static mx_status_t dc_add_device(device_t* parent,
-                                 mx_handle_t* handle, size_t hcount,
+static zx_status_t dc_add_device(device_t* parent,
+                                 zx_handle_t* handle, size_t hcount,
                                  dc_msg_t* msg, const char* name,
                                  const char* args, const void* data) {
     if (hcount == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if (msg->datalen % sizeof(mx_device_prop_t)) {
-        return MX_ERR_INVALID_ARGS;
+    if (msg->datalen % sizeof(zx_device_prop_t)) {
+        return ZX_ERR_INVALID_ARGS;
     }
     device_t* dev;
     // allocate device struct, followed by space for props, followed
     // by space for bus arguments, followed by space for the name
     size_t sz = sizeof(*dev) + msg->datalen + msg->argslen + msg->namelen + 2;
     if ((dev = calloc(1, sz)) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     list_initialize(&dev->children);
     list_initialize(&dev->pending);
     dev->hrpc = handle[0];
-    dev->hrsrc = (hcount > 1) ? handle[1] : MX_HANDLE_INVALID;
-    dev->prop_count = msg->datalen / sizeof(mx_device_prop_t);
+    dev->hrsrc = (hcount > 1) ? handle[1] : ZX_HANDLE_INVALID;
+    dev->prop_count = msg->datalen / sizeof(zx_device_prop_t);
     dev->protocol_id = msg->protocol_id;
 
     char* text = (char*) (dev->props + dev->prop_count);
@@ -675,14 +675,14 @@
 
     memcpy(dev->props, data, msg->datalen);
 
-    if (strlen(dev->name) > MX_DEVICE_NAME_MAX) {
+    if (strlen(dev->name) > ZX_DEVICE_NAME_MAX) {
         free(dev);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // If we have bus device args or resource handle
     // we are, by definition a bus device.
-    if (args[0] || (dev->hrsrc != MX_HANDLE_INVALID)) {
+    if (args[0] || (dev->hrsrc != ZX_HANDLE_INVALID)) {
         dev->flags |= DEV_CTX_BUSDEV;
     }
 
@@ -696,14 +696,14 @@
         parent = parent->parent;
     }
 
-    mx_status_t r;
+    zx_status_t r;
     if ((r = devfs_publish(parent, dev)) < 0) {
         free(dev);
         return r;
     }
 
     dev->ph.handle = handle[0];
-    dev->ph.waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+    dev->ph.waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
     dev->ph.func = dc_handle_device;
     if ((r = port_wait(&dc_port, &dev->ph)) < 0) {
         devfs_unpublish(dev);
@@ -731,31 +731,31 @@
 
     dc_notify(dev, DEVMGR_OP_DEVICE_ADDED);
     queue_work(&dev->work, WORK_DEVICE_ADDED, 0);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Remove device from parent
 // forced indicates this is removal due to a channel close
 // or process exit, which means we should remove all other
 // devices that share the devhost at the same time
-static mx_status_t dc_remove_device(device_t* dev, bool forced) {
+static zx_status_t dc_remove_device(device_t* dev, bool forced) {
     if (dev->flags & DEV_CTX_ZOMBIE) {
         // This device was removed due to its devhost dying
         // (process exit or some other channel on that devhost
         // closing), and is now receiving the final remove call
         dev->flags &= (~DEV_CTX_ZOMBIE);
         dc_release_device(dev);
-        return MX_OK;
+        return ZX_OK;
     }
     if (dev->flags & DEV_CTX_DEAD) {
         // This should not happen
         log(ERROR, "devcoord: cannot remove dev %p name='%s' twice!\n", dev, dev->name);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (dev->flags & DEV_CTX_IMMORTAL) {
         // This too should not happen
         log(ERROR, "devcoord: cannot remove dev %p name='%s' (immortal)\n", dev, dev->name);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     log(DEVLC, "devcoord: remove %p name='%s' parent=%p\n", dev, dev->name, dev->parent);
@@ -847,15 +847,15 @@
         // reference would close the RPC channel.
         dev->flags |= DEV_CTX_ZOMBIE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t dc_bind_device(device_t* dev, const char* drvlibname) {
+static zx_status_t dc_bind_device(device_t* dev, const char* drvlibname) {
      log(INFO, "devcoord: dc_bind_device() '%s'\n", drvlibname);
 
     // shouldn't be possible to get a bind request for a shadow device
     if (dev->flags & DEV_CTX_SHADOW) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // A libname of "" means a general rebind request
@@ -876,22 +876,22 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 };
 
-static mx_status_t dc_handle_device_read(device_t* dev) {
+static zx_status_t dc_handle_device_read(device_t* dev) {
     dc_msg_t msg;
-    mx_handle_t hin[2];
+    zx_handle_t hin[2];
     uint32_t msize = sizeof(msg);
     uint32_t hcount = 2;
 
     if (dev->flags & DEV_CTX_DEAD) {
         log(ERROR, "devcoord: dev %p already dead (in read)\n", dev);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
-    mx_status_t r;
-    if ((r = mx_channel_read(dev->hrpc, 0, &msg, hin,
+    zx_status_t r;
+    if ((r = zx_channel_read(dev->hrpc, 0, &msg, hin,
                              msize, hcount, &msize, &hcount)) < 0) {
         return r;
     }
@@ -901,9 +901,9 @@
     const char* args;
     if ((r = dc_msg_unpack(&msg, msize, &data, &name, &args)) < 0) {
         while (hcount > 0) {
-            mx_handle_close(hin[--hcount]);
+            zx_handle_close(hin[--hcount]);
         }
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     dc_status_t dcs;
@@ -914,7 +914,7 @@
         log(RPC_IN, "devcoord: rpc: add-device '%s' args='%s'\n", name, args);
         if ((r = dc_add_device(dev, hin, hcount, &msg, name, args, data)) < 0) {
             while (hcount > 0) {
-                mx_handle_close(hin[--hcount]);
+                zx_handle_close(hin[--hcount]);
             }
         }
         break;
@@ -943,9 +943,9 @@
             dmctl_socket = hin[0];
         }
         r = handle_dmctl_write(msg.datalen, data);
-        if (dmctl_socket != MX_HANDLE_INVALID) {
-            mx_handle_close(dmctl_socket);
-            dmctl_socket = MX_HANDLE_INVALID;
+        if (dmctl_socket != ZX_HANDLE_INVALID) {
+            zx_handle_close(dmctl_socket);
+            dmctl_socket = ZX_HANDLE_INVALID;
         }
         break;
 
@@ -953,10 +953,10 @@
         if (hcount != 1) {
             goto fail_wrong_hcount;
         }
-        if (mx_channel_write(virtcon_open, 0, NULL, 0, hin, 1) < 0) {
-            mx_handle_close(hin[0]);
+        if (zx_channel_write(virtcon_open, 0, NULL, 0, hin, 1) < 0) {
+            zx_handle_close(hin[0]);
         }
-        r = MX_OK;
+        r = ZX_OK;
         break;
 
     case DC_OP_DM_WATCH:
@@ -964,7 +964,7 @@
             goto fail_wrong_hcount;
         }
         dc_watch(hin[0]);
-        r = MX_OK;
+        r = ZX_OK;
         break;
 
     case DC_OP_GET_TOPO_PATH: {
@@ -978,12 +978,12 @@
         if ((r = dc_get_topo_path(dev, reply.path, DC_PATH_MAX)) < 0) {
             break;
         }
-        reply.rsp.status = MX_OK;
+        reply.rsp.status = ZX_OK;
         reply.rsp.txid = msg.txid;
-        if ((r = mx_channel_write(dev->hrpc, 0, &reply, sizeof(reply), NULL, 0)) < 0) {
+        if ((r = zx_channel_write(dev->hrpc, 0, &reply, sizeof(reply), NULL, 0)) < 0) {
             return r;
         }
-        return MX_OK;
+        return ZX_OK;
     }
     case DC_OP_STATUS: {
         if (hcount != 0) {
@@ -994,11 +994,11 @@
         pending_t* pending = list_remove_tail_type(&dev->pending, pending_t, node);
         if (pending == NULL) {
             log(ERROR, "devcoord: rpc: spurious status message\n");
-            return MX_OK;
+            return ZX_OK;
         }
         switch (pending->op) {
         case PENDING_BIND:
-            if (msg.status != MX_OK) {
+            if (msg.status != ZX_OK) {
                 log(ERROR, "devcoord: rpc: bind-driver '%s' status %d\n",
                     dev->name, msg.status);
             } else {
@@ -1008,32 +1008,32 @@
             break;
         }
         free(pending);
-        return MX_OK;
+        return ZX_OK;
     }
 
     default:
         log(ERROR, "devcoord: invalid rpc op %08x\n", msg.op);
-        r = MX_ERR_NOT_SUPPORTED;
+        r = ZX_ERR_NOT_SUPPORTED;
         goto fail_close_handles;
     }
 
 done:
     dcs.status = r;
-    if ((r = mx_channel_write(dev->hrpc, 0, &dcs, sizeof(dcs), NULL, 0)) < 0) {
+    if ((r = zx_channel_write(dev->hrpc, 0, &dcs, sizeof(dcs), NULL, 0)) < 0) {
         return r;
     }
-    return MX_OK;
+    return ZX_OK;
 
 disconnect:
-    dcs.status = MX_OK;
-    mx_channel_write(dev->hrpc, 0, &dcs, sizeof(dcs), NULL, 0);
-    return MX_ERR_STOP;
+    dcs.status = ZX_OK;
+    zx_channel_write(dev->hrpc, 0, &dcs, sizeof(dcs), NULL, 0);
+    return ZX_ERR_STOP;
 
 fail_wrong_hcount:
-    r = MX_ERR_INVALID_ARGS;
+    r = ZX_ERR_INVALID_ARGS;
 fail_close_handles:
     while (hcount > 0) {
-        mx_handle_close(hin[--hcount]);
+        zx_handle_close(hin[--hcount]);
     }
     goto done;
 }
@@ -1041,36 +1041,36 @@
 #define dev_from_ph(ph) containerof(ph, device_t, ph)
 
 // handle inbound RPCs from devhost to devices
-static mx_status_t dc_handle_device(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
+static zx_status_t dc_handle_device(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
     device_t* dev = dev_from_ph(ph);
 
-    if (signals & MX_CHANNEL_READABLE) {
-        mx_status_t r;
+    if (signals & ZX_CHANNEL_READABLE) {
+        zx_status_t r;
         if ((r = dc_handle_device_read(dev)) < 0) {
-            if (r != MX_ERR_STOP) {
+            if (r != ZX_ERR_STOP) {
                 log(ERROR, "devcoord: device %p name='%s' rpc status: %d\n",
                     dev, dev->name, r);
             }
             dc_remove_device(dev, true);
-            return MX_ERR_STOP;
+            return ZX_ERR_STOP;
         }
-        return MX_OK;
+        return ZX_OK;
     }
-    if (signals & MX_CHANNEL_PEER_CLOSED) {
+    if (signals & ZX_CHANNEL_PEER_CLOSED) {
         log(ERROR, "devcoord: device %p name='%s' disconnected!\n", dev, dev->name);
         dc_remove_device(dev, true);
-        return MX_ERR_STOP;
+        return ZX_ERR_STOP;
     }
     log(ERROR, "devcoord: no work? %08x\n", signals);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // send message to devhost, requesting the creation of a device
-static mx_status_t dh_create_device(device_t* dev, devhost_t* dh,
+static zx_status_t dh_create_device(device_t* dev, devhost_t* dh,
                                     const char* args) {
     dc_msg_t msg;
     uint32_t mlen;
-    mx_status_t r;
+    zx_status_t r;
 
     // Where to get information to send to devhost from?
     // Shadow devices defer to the device they're shadowing,
@@ -1083,8 +1083,8 @@
     }
 
     uint32_t hcount = 0;
-    mx_handle_t handle[3], hrpc;
-    if ((r = mx_channel_create(0, handle, &hrpc)) < 0) {
+    zx_handle_t handle[3], hrpc;
+    if ((r = zx_channel_create(0, handle, &hrpc)) < 0) {
         return r;
     }
     hcount++;
@@ -1099,8 +1099,8 @@
         msg.op = DC_OP_CREATE_DEVICE_STUB;
     }
 
-    if (info->hrsrc != MX_HANDLE_INVALID) {
-        if ((r = mx_handle_duplicate(info->hrsrc, MX_RIGHT_SAME_RIGHTS, handle + hcount)) < 0) {
+    if (info->hrsrc != ZX_HANDLE_INVALID) {
+        if ((r = zx_handle_duplicate(info->hrsrc, ZX_RIGHT_SAME_RIGHTS, handle + hcount)) < 0) {
             goto fail;
         }
         hcount++;
@@ -1109,13 +1109,13 @@
     msg.txid = 0;
     msg.protocol_id = dev->protocol_id;
 
-    if ((r = mx_channel_write(dh->hrpc, 0, &msg, mlen, handle, hcount)) < 0) {
+    if ((r = zx_channel_write(dh->hrpc, 0, &msg, mlen, handle, hcount)) < 0) {
         goto fail;
     }
 
     dev->hrpc = hrpc;
     dev->ph.handle = hrpc;
-    dev->ph.waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+    dev->ph.waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
     dev->ph.func = dc_handle_device;
     if ((r = port_wait(&dc_port, &dev->ph)) < 0) {
         goto fail_watch;
@@ -1123,27 +1123,27 @@
     dev->host = dh;
     dh->refcount++;
     list_add_tail(&dh->devices, &dev->dhnode);
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     while (hcount > 0) {
-        mx_handle_close(handle[--hcount]);
+        zx_handle_close(handle[--hcount]);
     }
 fail_watch:
-    mx_handle_close(hrpc);
+    zx_handle_close(hrpc);
     return r;
 }
 
-static mx_status_t dc_create_shadow(device_t* parent) {
+static zx_status_t dc_create_shadow(device_t* parent) {
     if (parent->shadow != NULL) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     size_t namelen = strlen(parent->name);
     size_t liblen = strlen(parent->libname);
     device_t* dev = calloc(1, sizeof(device_t) + namelen + liblen + 2);
     if (dev == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     char* text = (char*) (dev + 1);
     memcpy(text, parent->name, namelen + 1);
@@ -1162,26 +1162,26 @@
     parent->refcount++;
     log(DEVLC, "devcoord: dev %p name='%s' ++ref=%d (shadow)\n",
         parent, parent->name, parent->refcount);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // send message to devhost, requesting the binding of a driver to a device
-static mx_status_t dh_bind_driver(device_t* dev, const char* libname) {
+static zx_status_t dh_bind_driver(device_t* dev, const char* libname) {
     dc_msg_t msg;
     uint32_t mlen;
 
     pending_t* pending = malloc(sizeof(pending_t));
     if (pending == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t r;
+    zx_status_t r;
     if ((r = dc_msg_pack(&msg, &mlen, NULL, 0, libname, NULL)) < 0) {
         free(pending);
         return r;
     }
 
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     if ((r = libname_to_vmo(libname, &vmo)) < 0) {
         free(pending);
         return r;
@@ -1190,7 +1190,7 @@
     msg.txid = 0;
     msg.op = DC_OP_BIND_DRIVER;
 
-    if ((r = mx_channel_write(dev->hrpc, 0, &msg, mlen, &vmo, 1)) < 0) {
+    if ((r = zx_channel_write(dev->hrpc, 0, &msg, mlen, &vmo, 1)) < 0) {
         free(pending);
         return r;
     }
@@ -1199,19 +1199,19 @@
     pending->op = PENDING_BIND;
     pending->ctx = NULL;
     list_add_tail(&dev->pending, &pending->node);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t dc_attempt_bind(driver_t* drv, device_t* dev) {
+static zx_status_t dc_attempt_bind(driver_t* drv, device_t* dev) {
     // cannot bind driver to already bound device
     if ((dev->flags & DEV_CTX_BOUND) && (!(dev->flags & DEV_CTX_MULTI_BIND))) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (!(dev->flags & DEV_CTX_BUSDEV)) {
         // non-busdev is pretty simple
         if (dev->host == NULL) {
             log(ERROR, "devcoord: can't bind to device without devhost\n");
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
         return dh_bind_driver(dev, drv->libname);
     }
@@ -1220,7 +1220,7 @@
     const char* arg0 = (dev->flags & DEV_CTX_SHADOW) ? dev->parent->args : dev->args;
     const char* arg1 = strchr(arg0, ',');
     if (arg1 == NULL) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     size_t arg0len = arg1 - arg0;
     arg1++;
@@ -1228,7 +1228,7 @@
     char devhostname[32];
     snprintf(devhostname, sizeof(devhostname), "devhost:%.*s", (int) arg0len, arg0);
 
-    mx_status_t r;
+    zx_status_t r;
     if ((r = dc_create_shadow(dev)) < 0) {
         log(ERROR, "devcoord: cannot create shadow device: %d\n", r);
         return r;
@@ -1268,8 +1268,8 @@
 
 // device binding program that pure (parentless)
 // misc devices use to get published in the misc devhost
-static struct mx_bind_inst misc_device_binding =
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT);
+static struct zx_bind_inst misc_device_binding =
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT);
 
 static bool is_misc_driver(driver_t* drv) {
     return (drv->binding_size == sizeof(misc_device_binding)) &&
@@ -1278,8 +1278,8 @@
 
 // device binding program that special root-level
 // devices use to get published in the root devhost
-static struct mx_bind_inst root_device_binding =
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_ROOT);
+static struct zx_bind_inst root_device_binding =
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_ROOT);
 
 static bool is_root_driver(driver_t* drv) {
     return (drv->binding_size == sizeof(root_device_binding)) &&
@@ -1317,22 +1317,22 @@
     }
 }
 
-device_t* coordinator_init(mx_handle_t root_job) {
+device_t* coordinator_init(zx_handle_t root_job) {
     printf("coordinator_init()\n");
 
-    mx_status_t status = mx_job_create(root_job, 0u, &devhost_job);
+    zx_status_t status = zx_job_create(root_job, 0u, &devhost_job);
     if (status < 0) {
         log(ERROR, "devcoord: unable to create devhost job\n");
     }
-    static const mx_policy_basic_t policy[] = {
-        { MX_POL_BAD_HANDLE, MX_POL_ACTION_EXCEPTION },
+    static const zx_policy_basic_t policy[] = {
+        { ZX_POL_BAD_HANDLE, ZX_POL_ACTION_EXCEPTION },
     };
-    status = mx_job_set_policy(devhost_job, MX_JOB_POL_RELATIVE,
-                               MX_JOB_POL_BASIC, &policy, countof(policy));
+    status = zx_job_set_policy(devhost_job, ZX_JOB_POL_RELATIVE,
+                               ZX_JOB_POL_BASIC, &policy, countof(policy));
     if (status < 0) {
-        log(ERROR, "devcoord: mx_job_set_policy() failed\n");
+        log(ERROR, "devcoord: zx_job_set_policy() failed\n");
     }
-    mx_object_set_property(devhost_job, MX_PROP_NAME, "magenta-drivers", 15);
+    zx_object_set_property(devhost_job, ZX_PROP_NAME, "zircon-drivers", 15);
 
     port_init(&dc_port);
 
@@ -1342,8 +1342,8 @@
 //TODO: The acpisvc needs to become the acpi bus device
 //      For now, we launch it manually here so PCI can work
 static void acpi_init(void) {
-    mx_status_t status = mx_channel_create(0, &acpi_rpc[0], &acpi_rpc[1]);
-    if (status != MX_OK) {
+    zx_status_t status = zx_channel_create(0, &acpi_rpc[0], &acpi_rpc[1]);
+    if (status != ZX_OK) {
         return;
     }
     devhost_acpi_set_rpc(acpi_rpc[0]);
@@ -1360,7 +1360,7 @@
     } else if (is_acpi_bus_driver(drv)) {
         dc_attempt_bind(drv, &acpi_device);
     } else if (is_platform_bus_driver(drv) &&
-               (platform_device.hrsrc != MX_HANDLE_INVALID)) {
+               (platform_device.hrsrc != ZX_HANDLE_INVALID)) {
         dc_attempt_bind(drv, &platform_device);
     } else if (dc_running) {
         device_t* dev;
@@ -1393,7 +1393,7 @@
 static bool system_available;
 static bool system_loaded;
 
-static mx_status_t dc_control_event(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
+static zx_status_t dc_control_event(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
     switch (evt) {
     case CTL_SCAN_SYSTEM:
         if (!system_loaded) {
@@ -1403,7 +1403,7 @@
         }
         break;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 static port_handler_t control_handler = {
@@ -1431,7 +1431,7 @@
     devfs_publish(&root_device, &misc_device);
     devfs_publish(&root_device, &socket_device);
     devfs_publish(&root_device, &acpi_device);
-    if (platform_device.hrsrc != MX_HANDLE_INVALID) {
+    if (platform_device.hrsrc != ZX_HANDLE_INVALID) {
         devfs_publish(&root_device, &platform_device);
     }
 
@@ -1456,17 +1456,17 @@
     dc_running = true;
 
     for (;;) {
-        mx_status_t status;
+        zx_status_t status;
         if (list_is_empty(&list_pending_work)) {
-            status = port_dispatch(&dc_port, MX_TIME_INFINITE, true);
+            status = port_dispatch(&dc_port, ZX_TIME_INFINITE, true);
         } else {
             status = port_dispatch(&dc_port, 0, true);
-            if (status == MX_ERR_TIMED_OUT) {
+            if (status == ZX_ERR_TIMED_OUT) {
                 process_work(list_remove_head_type(&list_pending_work, work_t, node));
                 continue;
             }
         }
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             log(ERROR, "devcoord: port dispatch ended: %d\n", status);
         }
     }
diff --git a/system/core/devmgr/devmgr-devfs.c b/system/core/devmgr/devmgr-devfs.c
index 97224df..5165531 100644
--- a/system/core/devmgr/devmgr-devfs.c
+++ b/system/core/devmgr/devmgr-devfs.c
@@ -6,13 +6,13 @@
 #include "devmgr.h"
 #include "memfs-private.h"
 
-#include <magenta/listnode.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/listnode.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
-#include <magenta/device/vfs.h>
+#include <zircon/device/vfs.h>
 
-#include <mxio/remoteio.h>
+#include <fdio/remoteio.h>
 
 #include <fcntl.h>
 #include <stdio.h>
@@ -28,7 +28,7 @@
     watcher_t* next;
     devnode_t* devnode;
     uint32_t mask;
-    mx_handle_t handle;
+    zx_handle_t handle;
 };
 
 struct dc_devnode {
@@ -80,7 +80,7 @@
 
 static devnode_t* class_devnode;
 
-static mx_status_t dc_rio_handler(port_handler_t* ph, mx_signals_t signals, uint32_t evt);
+static zx_status_t dc_rio_handler(port_handler_t* ph, zx_signals_t signals, uint32_t evt);
 static devnode_t* devfs_mkdir(devnode_t* parent, const char* name);
 
 #define PNMAX 16
@@ -125,19 +125,19 @@
     }
 }
 
-static mx_status_t iostate_create(devnode_t* dn, mx_handle_t h) {
+static zx_status_t iostate_create(devnode_t* dn, zx_handle_t h) {
     iostate_t* ios = calloc(1, sizeof(iostate_t));
     if (ios == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     ios->ph.handle = h;
-    ios->ph.waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+    ios->ph.waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
     ios->ph.func = dc_rio_handler;
     ios->devnode = dn;
     list_add_tail(&dn->iostate, &ios->node);
 
-    mx_status_t r;
+    zx_status_t r;
     if ((r = port_wait(&dc_port, &ios->ph)) < 0) {
         list_delete(&ios->node);
         free(ios);
@@ -150,8 +150,8 @@
         list_delete(&ios->node);
         ios->devnode = NULL;
     }
-    mx_handle_close(ios->ph.handle);
-    ios->ph.handle = MX_HANDLE_INVALID;
+    zx_handle_close(ios->ph.handle);
+    ios->ph.handle = ZX_HANDLE_INVALID;
     free(ios);
 }
 
@@ -160,7 +160,7 @@
 // its device has no rpc handle
 static bool devnode_is_dir(devnode_t* dn) {
     if (list_is_empty(&dn->children)) {
-        return (dn->device == NULL) || (dn->device->hrpc == MX_HANDLE_INVALID);
+        return (dn->device == NULL) || (dn->device->hrpc == ZX_HANDLE_INVALID);
     }
     return true;
 }
@@ -171,7 +171,7 @@
     if (dn->device == NULL) {
         return true;
     }
-    if (dn->device->hrpc == MX_HANDLE_INVALID) {
+    if (dn->device->hrpc == ZX_HANDLE_INVALID) {
         return true;
     }
     if (dn->device->flags & DEV_CTX_BUSDEV) {
@@ -206,9 +206,9 @@
         if (!(w->mask & op)) {
             continue;
         }
-        if (mx_channel_write(w->handle, 0, msg, len + 2, NULL, 0) < 0) {
+        if (zx_channel_write(w->handle, 0, msg, len + 2, NULL, 0) < 0) {
             *wp = next;
-            mx_handle_close(w->handle);
+            zx_handle_close(w->handle);
             free(w);
         } else {
             wp = &w->next;
@@ -216,10 +216,10 @@
     }
 }
 
-static mx_status_t devfs_watch(devnode_t* dn, mx_handle_t h, uint32_t mask) {
+static zx_status_t devfs_watch(devnode_t* dn, zx_handle_t h, uint32_t mask) {
     watcher_t* watcher = calloc(1, sizeof(watcher_t));
     if (watcher == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     watcher->devnode = dn;
@@ -241,7 +241,7 @@
     // Don't send EXISTING or IDLE events from now on...
     watcher->mask &= ~(VFS_WATCH_MASK_EXISTING | VFS_WATCH_MASK_IDLE);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // If namelen is nonzero, it is the null-terminator-inclusive length
@@ -285,18 +285,18 @@
     return NULL;
 }
 
-mx_status_t devfs_publish(device_t* parent, device_t* dev) {
+zx_status_t devfs_publish(device_t* parent, device_t* dev) {
     if ((parent->self == NULL) || (dev->self != NULL) || (dev->link != NULL)) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     devnode_t* dnself = devfs_mknode(dev, dev->name, 0);
     if (dnself == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    if ((dev->protocol_id == MX_PROTOCOL_MISC_PARENT) ||
-        (dev->protocol_id == MX_PROTOCOL_MISC)) {
+    if ((dev->protocol_id == ZX_PROTOCOL_MISC_PARENT) ||
+        (dev->protocol_id == ZX_PROTOCOL_MISC)) {
         // misc devices are singletons, not a class
         // in the sense of other device classes.
         // They do not get aliases in /dev/class/misc/...
@@ -312,8 +312,8 @@
         const char* name = dev->name;
         size_t namelen = 0;
 
-        if ((dev->protocol_id != MX_PROTOCOL_MISC) &&
-            (dev->protocol_id != MX_PROTOCOL_CONSOLE)) {
+        if ((dev->protocol_id != ZX_PROTOCOL_MISC) &&
+            (dev->protocol_id != ZX_PROTOCOL_CONSOLE)) {
 
             for (unsigned n = 0; n < 1000; n++) {
                 snprintf(tmp, sizeof(tmp), "%03u", (dir->seqcount++) % 1000);
@@ -324,7 +324,7 @@
                 }
             }
             free(dnself);
-            return MX_ERR_ALREADY_EXISTS;
+            return ZX_ERR_ALREADY_EXISTS;
 got_name:
             ;
         }
@@ -332,7 +332,7 @@
         devnode_t* dnlink = devfs_mknode(dev, name, namelen);
         if (dnlink == NULL) {
             free(dnself);
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
 
         // add link node to class directory
@@ -346,7 +346,7 @@
     list_add_tail(&parent->self->children, &dnself->node);
     dev->self = dnself;
     devfs_notify(parent->self, dnself->name, VFS_WATCH_EVT_ADDED);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void _devfs_remove(devnode_t* dn) {
@@ -369,8 +369,8 @@
     iostate_t* ios;
     list_for_every_entry(&dn->iostate, ios, iostate_t, node) {
         ios->devnode = NULL;
-        mx_handle_close(ios->ph.handle);
-        ios->ph.handle = MX_HANDLE_INVALID;
+        zx_handle_close(ios->ph.handle);
+        ios->ph.handle = ZX_HANDLE_INVALID;
     }
 
     devfs_notify(dn, "", VFS_WATCH_EVT_DELETED);
@@ -380,7 +380,7 @@
     watcher_t* next;
     for (watcher = dn->watchers; watcher != NULL; watcher = next) {
         next = watcher->next;
-        mx_handle_close(watcher->handle);
+        zx_handle_close(watcher->handle);
         free(watcher);
     }
     dn->watchers = NULL;
@@ -403,13 +403,13 @@
     }
 }
 
-static mx_status_t devfs_walk(devnode_t** _dn, char* path, char** pathout) {
+static zx_status_t devfs_walk(devnode_t** _dn, char* path, char** pathout) {
     devnode_t* dn = *_dn;
 
 again:
     if ((path == NULL) || (path[0] == 0)) {
         *_dn = dn;
-        return MX_OK;
+        return ZX_OK;
     }
     char* name = path;
     char* undo = NULL;
@@ -418,7 +418,7 @@
         *path++ = 0;
     }
     if (name[0] == 0) {
-        return MX_ERR_BAD_PATH;
+        return ZX_ERR_BAD_PATH;
     }
     devnode_t* child;
     list_for_every_entry(&dn->children, child, devnode_t, node) {
@@ -428,36 +428,36 @@
         }
     }
     if (dn == *_dn) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     if (undo) {
         *undo = '/';
     }
     *_dn = dn;
     *pathout = name;
-    return MX_ERR_NEXT;
+    return ZX_ERR_NEXT;
 }
 
-static void devfs_open(devnode_t* dirdn, mx_handle_t h, char* path, uint32_t flags) {
+static void devfs_open(devnode_t* dirdn, zx_handle_t h, char* path, uint32_t flags) {
     if (!strcmp(path, ".")) {
         path = NULL;
     }
 
     devnode_t* dn = dirdn;
-    mx_status_t r = devfs_walk(&dn, path, &path);
+    zx_status_t r = devfs_walk(&dn, path, &path);
 
     bool pipeline = flags & O_PIPELINE;
 
-    if (r == MX_ERR_NEXT) {
+    if (r == ZX_ERR_NEXT) {
         // we only partially matched -- there's more path to walk
-        if ((dn->device == NULL) || (dn->device->hrpc == MX_HANDLE_INVALID)) {
+        if ((dn->device == NULL) || (dn->device->hrpc == ZX_HANDLE_INVALID)) {
             // no remote to pass this on to
-            r = MX_ERR_NOT_FOUND;
+            r = ZX_ERR_NOT_FOUND;
         } else if (flags & (O_NOREMOTE | O_DIRECTORY)) {
             // local requested, but this is remote only
-            r = MX_ERR_NOT_SUPPORTED;
+            r = ZX_ERR_NOT_SUPPORTED;
         } else {
-            r = MX_OK;
+            r = ZX_OK;
         }
     } else {
         path = (char*) ".";
@@ -472,12 +472,12 @@
     if (r < 0) {
 fail:
         if (!pipeline) {
-            mxrio_object_t obj;
+            zxrio_object_t obj;
             obj.status = r;
             obj.type = 0;
-            mx_channel_write(h, 0, &obj, MXRIO_OBJECT_MINSIZE, NULL, 0);
+            zx_channel_write(h, 0, &obj, ZXRIO_OBJECT_MINSIZE, NULL, 0);
         }
-        mx_handle_close(h);
+        zx_handle_close(h);
         return;
     }
 
@@ -488,31 +488,31 @@
             goto fail;
         }
         if (!pipeline) {
-            mxrio_object_t obj;
-            obj.status = MX_OK;
-            obj.type = MXIO_PROTOCOL_REMOTE;
-            mx_channel_write(h, 0, &obj, MXRIO_OBJECT_MINSIZE, NULL, 0);
+            zxrio_object_t obj;
+            obj.status = ZX_OK;
+            obj.type = FDIO_PROTOCOL_REMOTE;
+            zx_channel_write(h, 0, &obj, ZXRIO_OBJECT_MINSIZE, NULL, 0);
         }
         return;
     }
 
     // Otherwise we will pass the request on to the remote
-    mxrio_msg_t msg;
-    memset(&msg, 0, MXRIO_HDR_SZ);
-    msg.op = MXRIO_OPEN;
+    zxrio_msg_t msg;
+    memset(&msg, 0, ZXRIO_HDR_SZ);
+    msg.op = ZXRIO_OPEN;
     msg.datalen = strlen(path);
     msg.arg = flags;
     msg.hcount = 1;
     msg.handle[0] = h;
     memcpy(msg.data, path, msg.datalen);
 
-    if ((r = mx_channel_write(dn->device->hrpc, 0, &msg, MXRIO_HDR_SZ + msg.datalen,
+    if ((r = zx_channel_write(dn->device->hrpc, 0, &msg, ZXRIO_HDR_SZ + msg.datalen,
                               msg.handle, 1)) < 0) {
         goto fail;
     }
 }
 
-static mx_status_t fill_dirent(vdirent_t* de, size_t delen,
+static zx_status_t fill_dirent(vdirent_t* de, size_t delen,
                                const char* name, size_t len, uint32_t type) {
     size_t sz = sizeof(vdirent_t) + len + 1;
 
@@ -520,7 +520,7 @@
     if (sz & 3)
         sz = (sz + 3) & (~3);
     if (sz > delen)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     de->size = sz;
     de->type = type;
     memcpy(de->name, name, len);
@@ -528,7 +528,7 @@
     return sz;
 }
 
-static mx_status_t devfs_readdir(devnode_t* dn, uint64_t* _ino, void* data, size_t len) {
+static zx_status_t devfs_readdir(devnode_t* dn, uint64_t* _ino, void* data, size_t len) {
     void* ptr = data;
     uint64_t ino = *_ino;
 
@@ -544,7 +544,7 @@
             continue;
         }
         ino = child->ino;
-        mx_status_t r = fill_dirent(ptr, len, child->name, strlen(child->name),
+        zx_status_t r = fill_dirent(ptr, len, child->name, strlen(child->name),
                                     VTYPE_TO_DTYPE(V_TYPE_DIR));
         if (r < 0) {
             break;
@@ -557,16 +557,16 @@
     return ptr - data;
 }
 
-static mx_status_t devfs_rio_handler(mxrio_msg_t* msg, void* cookie) {
+static zx_status_t devfs_rio_handler(zxrio_msg_t* msg, void* cookie) {
     iostate_t* ios = cookie;
     devnode_t* dn = ios->devnode;
     if (dn == NULL) {
-        return MX_ERR_PEER_CLOSED;
+        return ZX_ERR_PEER_CLOSED;
     }
 
     // ensure handle count specified by opcode matches reality
-    if (msg->hcount != MXRIO_HC(msg->op)) {
-        return MX_ERR_IO;
+    if (msg->hcount != ZXRIO_HC(msg->op)) {
+        return ZX_ERR_IO;
     }
     msg->hcount = 0;
 
@@ -574,20 +574,20 @@
     int32_t arg = msg->arg;
     msg->datalen = 0;
 
-    switch (MXRIO_OP(msg->op)) {
-    case MXRIO_CLONE:
+    switch (ZXRIO_OP(msg->op)) {
+    case ZXRIO_CLONE:
         msg->data[0] = 0;
         devfs_open(dn, msg->handle[0], (char*) msg->data, arg | O_NOREMOTE);
         return ERR_DISPATCHER_INDIRECT;
-    case MXRIO_OPEN:
+    case ZXRIO_OPEN:
         if ((len < 1) || (len > 1024)) {
-            mx_handle_close(msg->handle[0]);
+            zx_handle_close(msg->handle[0]);
         } else {
             msg->data[len] = 0;
             devfs_open(dn, msg->handle[0], (char*) msg->data, arg);
         }
         return ERR_DISPATCHER_INDIRECT;
-    case MXRIO_STAT:
+    case ZXRIO_STAT:
         msg->datalen = sizeof(vnattr_t);
         vnattr_t* attr = (void*)msg->data;
         memset(attr, 0, sizeof(vnattr_t));
@@ -599,35 +599,35 @@
         attr->size = 0;
         attr->nlink = 1;
         return msg->datalen;
-    case MXRIO_READDIR:
-        if (arg > MXIO_CHUNK_SIZE) {
-            return MX_ERR_INVALID_ARGS;
+    case ZXRIO_READDIR:
+        if (arg > FDIO_CHUNK_SIZE) {
+            return ZX_ERR_INVALID_ARGS;
         }
         if (msg->arg2.off == READDIR_CMD_RESET) {
             ios->readdir_ino = 0;
         }
-        mx_status_t r = devfs_readdir(dn, &ios->readdir_ino, msg->data, arg);
+        zx_status_t r = devfs_readdir(dn, &ios->readdir_ino, msg->data, arg);
         if (r >= 0) {
             msg->datalen = r;
         }
         return r;
-    case MXRIO_IOCTL_1H:
+    case ZXRIO_IOCTL_1H:
         switch (msg->arg2.op) {
         case IOCTL_VFS_MOUNT_FS: {
-            mx_status_t r;
-            if (len != sizeof(mx_handle_t)) {
-                r = MX_ERR_INVALID_ARGS;
+            zx_status_t r;
+            if (len != sizeof(zx_handle_t)) {
+                r = ZX_ERR_INVALID_ARGS;
             } else if (dn->device != &socket_device) {
-                r = MX_ERR_NOT_SUPPORTED;
+                r = ZX_ERR_NOT_SUPPORTED;
             } else {
-                if (socket_device.hrpc != MX_HANDLE_INVALID) {
-                    mx_handle_close(socket_device.hrpc);
+                if (socket_device.hrpc != ZX_HANDLE_INVALID) {
+                    zx_handle_close(socket_device.hrpc);
                 }
                 socket_device.hrpc = msg->handle[0];
-                r = MX_OK;
+                r = ZX_OK;
             }
-            if (r != MX_OK) {
-                mx_handle_close(msg->handle[0]);
+            if (r != ZX_OK) {
+                zx_handle_close(msg->handle[0]);
             }
             return r;
         }
@@ -636,23 +636,23 @@
             if ((len != sizeof(vfs_watch_dir_t)) ||
                 (wd->options != 0) ||
                 (wd->mask & (~VFS_WATCH_MASK_ALL))) {
-                r = MX_ERR_INVALID_ARGS;
+                r = ZX_ERR_INVALID_ARGS;
             } else {
                 r = devfs_watch(dn, msg->handle[0], wd->mask);
             }
-            if (r != MX_OK) {
-                mx_handle_close(msg->handle[0]);
+            if (r != ZX_OK) {
+                zx_handle_close(msg->handle[0]);
             }
             return r;
         }
         }
         break;
-    case MXRIO_IOCTL:
+    case ZXRIO_IOCTL:
         switch (msg->arg2.op) {
         case IOCTL_VFS_QUERY_FS: {
             const char* devfs_name = "devfs";
             if (arg < (int32_t) (sizeof(vfs_query_info_t) + strlen(devfs_name))) {
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
             vfs_query_info_t* info = (vfs_query_info_t*) msg->data;
             memset(info, 0, sizeof(*info));
@@ -665,24 +665,24 @@
     }
 
     // close inbound handles so they do not leak
-    for (unsigned i = 0; i < MXRIO_HC(msg->op); i++) {
-        mx_handle_close(msg->handle[i]);
+    for (unsigned i = 0; i < ZXRIO_HC(msg->op); i++) {
+        zx_handle_close(msg->handle[i]);
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t dc_rio_handler(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
+static zx_status_t dc_rio_handler(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
     iostate_t* ios = containerof(ph, iostate_t, ph);
 
-    mx_status_t r;
-    mxrio_msg_t msg;
-    if (signals & MX_CHANNEL_READABLE) {
-        if ((r = mxrio_handle_rpc(ph->handle, &msg, devfs_rio_handler, ios)) == MX_OK) {
-            return MX_OK;
+    zx_status_t r;
+    zxrio_msg_t msg;
+    if (signals & ZX_CHANNEL_READABLE) {
+        if ((r = zxrio_handle_rpc(ph->handle, &msg, devfs_rio_handler, ios)) == ZX_OK) {
+            return ZX_OK;
         }
-    } else if (signals & MX_CHANNEL_PEER_CLOSED) {
-        mxrio_handle_close(devfs_rio_handler, ios);
-        r = MX_ERR_STOP;
+    } else if (signals & ZX_CHANNEL_PEER_CLOSED) {
+        zxrio_handle_close(devfs_rio_handler, ios);
+        r = ZX_ERR_STOP;
     } else {
         printf("dc_rio_handler: invalid signals %x\n", signals);
         exit(0);
@@ -692,7 +692,7 @@
     return r;
 }
 
-void devmgr_init(mx_handle_t root_job) {
+void devmgr_init(zx_handle_t root_job) {
     printf("devmgr: init\n");
 
     prepopulate_protocol_dirs();
@@ -700,16 +700,16 @@
     root_devnode.device = coordinator_init(root_job);
     root_devnode.device->self = &root_devnode;
 
-    mx_handle_t h0, h1;
-    if (mx_channel_create(0, &h0, &h1) != MX_OK) {
+    zx_handle_t h0, h1;
+    if (zx_channel_create(0, &h0, &h1) != ZX_OK) {
         return;
-    } else if (iostate_create(&root_devnode, h0) != MX_OK) {
-        mx_handle_close(h0);
-        mx_handle_close(h1);
+    } else if (iostate_create(&root_devnode, h0) != ZX_OK) {
+        zx_handle_close(h0);
+        zx_handle_close(h1);
         return;
     }
     // set the "fs ready" signal
-    mx_object_signal(h1, 0, MX_USER_SIGNAL_0);
+    zx_object_signal(h1, 0, ZX_USER_SIGNAL_0);
     devfs_mount(h1);
 }
 
diff --git a/system/core/devmgr/devmgr-drivers.c b/system/core/devmgr/devmgr-drivers.c
index 5faee2a..576dda4 100644
--- a/system/core/devmgr/devmgr-drivers.c
+++ b/system/core/devmgr/devmgr-drivers.c
@@ -14,7 +14,7 @@
 
 #include <driver-info/driver-info.h>
 
-#include <magenta/driver/binding.h>
+#include <zircon/driver/binding.h>
 
 static bool is_driver_disabled(const char* name) {
     // driver.<driver_name>.disable
@@ -23,8 +23,8 @@
     return getenv_bool(opt, false);
 }
 
-static void found_driver(magenta_driver_note_payload_t* note,
-                         const mx_bind_inst_t* bi, void* cookie) {
+static void found_driver(zircon_driver_note_payload_t* note,
+                         const zx_bind_inst_t* bi, void* cookie) {
     // ensure strings are terminated
     note->name[sizeof(note->name) - 1] = 0;
     note->vendor[sizeof(note->vendor) - 1] = 0;
@@ -37,7 +37,7 @@
     const char* libname = cookie;
     size_t pathlen = strlen(libname) + 1;
     size_t namelen = strlen(note->name) + 1;
-    size_t bindlen = note->bindcount * sizeof(mx_bind_inst_t);
+    size_t bindlen = note->bindcount * sizeof(zx_bind_inst_t);
     size_t len = sizeof(driver_t) + bindlen + pathlen + namelen;
 
     driver_t* drv;
@@ -93,11 +93,11 @@
         if ((fd = openat(dirfd(dir), de->d_name, O_RDONLY)) < 0) {
             continue;
         }
-        mx_status_t status = di_read_driver_info(fd, libname, found_driver);
+        zx_status_t status = di_read_driver_info(fd, libname, found_driver);
         close(fd);
 
         if (status) {
-            if (status == MX_ERR_NOT_FOUND) {
+            if (status == ZX_ERR_NOT_FOUND) {
                 printf("devcoord: no driver info in '%s'\n", libname);
             } else {
                 printf("devcoord: error reading info from '%s'\n", libname);
@@ -114,11 +114,11 @@
         printf("devcoord: cannot open '%s'\n", path);
         return;
     }
-    mx_status_t status = di_read_driver_info(fd, (void*)path, found_driver);
+    zx_status_t status = di_read_driver_info(fd, (void*)path, found_driver);
     close(fd);
 
     if (status) {
-        if (status == MX_ERR_NOT_FOUND) {
+        if (status == ZX_ERR_NOT_FOUND) {
             printf("devcoord: no driver info in '%s'\n", path);
         } else {
             printf("devcoord: error reading info from '%s'\n", path);
diff --git a/system/core/devmgr/devmgr-mxio.c b/system/core/devmgr/devmgr-fdio.c
similarity index 72%
rename from system/core/devmgr/devmgr-mxio.c
rename to system/core/devmgr/devmgr-fdio.c
index 8d58444..58d7968 100644
--- a/system/core/devmgr/devmgr-mxio.c
+++ b/system/core/devmgr/devmgr-fdio.c
@@ -13,15 +13,15 @@
 
 #include <bootdata/decompress.h>
 
-#include <magenta/boot/bootdata.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
 
-#include <mxio/io.h>
-#include <mxio/remoteio.h>
-#include <mxio/util.h>
+#include <fdio/io.h>
+#include <fdio/remoteio.h>
+#include <fdio/util.h>
 
 #include <fcntl.h>
 #include <limits.h>
@@ -33,41 +33,41 @@
 
 void devmgr_io_init(void) {
     // setup stdout
-    mx_handle_t h;
-    if (mx_log_create(0, &h) < 0) {
+    zx_handle_t h;
+    if (zx_log_create(0, &h) < 0) {
         return;
     }
-    mxio_t* logger;
-    if ((logger = mxio_logger_create(h)) == NULL) {
+    fdio_t* logger;
+    if ((logger = fdio_logger_create(h)) == NULL) {
         return;
     }
     close(1);
-    mxio_bind_to_fd(logger, 1, 0);
+    fdio_bind_to_fd(logger, 1, 0);
 }
 
 struct callback_data {
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     unsigned int file_count;
-    mx_status_t (*add_file)(const char* path, mx_handle_t vmo, mx_off_t off, size_t len);
+    zx_status_t (*add_file)(const char* path, zx_handle_t vmo, zx_off_t off, size_t len);
 };
 
-static mx_status_t callback(void* arg, const bootfs_entry_t* entry) {
+static zx_status_t callback(void* arg, const bootfs_entry_t* entry) {
     struct callback_data* cd = arg;
     //printf("bootfs: %s @%zd (%zd bytes)\n", path, off, len);
     cd->add_file(entry->name, cd->vmo, entry->data_off, entry->data_len);
     ++cd->file_count;
-    return MX_OK;
+    return ZX_OK;
 }
 
 #define USER_MAX_HANDLES 4
 #define MAX_ENVP 16
-#define CHILD_JOB_RIGHTS (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ | MX_RIGHT_WRITE)
+#define CHILD_JOB_RIGHTS (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ | ZX_RIGHT_WRITE)
 
-mx_status_t devmgr_launch(mx_handle_t job, const char* name,
+zx_status_t devmgr_launch(zx_handle_t job, const char* name,
                           int argc, const char* const* argv,
                           const char** _envp, int stdiofd,
-                          mx_handle_t* handles, uint32_t* types, size_t hcount,
-                          mx_handle_t* proc) {
+                          zx_handle_t* handles, uint32_t* types, size_t hcount,
+                          zx_handle_t* proc) {
 
     const char* envp[MAX_ENVP + 1];
     unsigned envn = 0;
@@ -80,8 +80,8 @@
     }
     envp[envn++] = NULL;
 
-    mx_handle_t job_copy = MX_HANDLE_INVALID;
-    mx_handle_duplicate(job, CHILD_JOB_RIGHTS, &job_copy);
+    zx_handle_t job_copy = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(job, CHILD_JOB_RIGHTS, &job_copy);
 
     launchpad_t* lp;
     launchpad_create(job_copy, name, &lp);
@@ -92,32 +92,32 @@
     const char* nametable[2] = { "/", "/svc", };
     size_t name_count = 0;
 
-    mx_handle_t h = vfs_create_global_root_handle();
+    zx_handle_t h = vfs_create_global_root_handle();
     launchpad_add_handle(lp, h, PA_HND(PA_NS_DIR, name_count++));
 
     //TODO: constrain to /svc/debug, or other as appropriate
-    if (strcmp(name, "init") && ((h = get_service_root()) != MX_HANDLE_INVALID)) {
+    if (strcmp(name, "init") && ((h = get_service_root()) != ZX_HANDLE_INVALID)) {
         launchpad_add_handle(lp, h, PA_HND(PA_NS_DIR, name_count++));
     }
 
     launchpad_set_nametable(lp, name_count, nametable);
 
     if (stdiofd < 0) {
-        mx_status_t r;
-        if ((r = mx_log_create(0, &h) < 0)) {
+        zx_status_t r;
+        if ((r = zx_log_create(0, &h) < 0)) {
             launchpad_abort(lp, r, "devmgr: cannot create debuglog handle");
         } else {
-            launchpad_add_handle(lp, h, PA_HND(PA_MXIO_LOGGER, MXIO_FLAG_USE_FOR_STDIO | 0));
+            launchpad_add_handle(lp, h, PA_HND(PA_FDIO_LOGGER, FDIO_FLAG_USE_FOR_STDIO | 0));
         }
     } else {
-        launchpad_clone_fd(lp, stdiofd, MXIO_FLAG_USE_FOR_STDIO | 0);
+        launchpad_clone_fd(lp, stdiofd, FDIO_FLAG_USE_FOR_STDIO | 0);
         close(stdiofd);
     }
 
     launchpad_add_handles(lp, hcount, handles, types);
 
     const char* errmsg;
-    mx_status_t status = launchpad_go(lp, proc, &errmsg);
+    zx_status_t status = launchpad_go(lp, proc, &errmsg);
     if (status < 0) {
         printf("devmgr: launchpad %s (%s) failed: %s: %d\n",
                argv[0], name, errmsg, status);
@@ -136,10 +136,10 @@
 }
 
 static bool has_secondary_bootfs = false;
-static ssize_t setup_bootfs_vmo(uint32_t n, uint32_t type, mx_handle_t vmo) {
+static ssize_t setup_bootfs_vmo(uint32_t n, uint32_t type, zx_handle_t vmo) {
     uint64_t size;
-    mx_status_t status = mx_vmo_get_size(vmo, &size);
-    if (status != MX_OK) {
+    zx_status_t status = zx_vmo_get_size(vmo, &size);
+    if (status != ZX_OK) {
         printf("devmgr: failed to get bootfs#%u size (%d)\n", n, status);
         return status;
     }
@@ -150,7 +150,7 @@
     // map the vmo so that ps will account for it
     // NOTE: will leak the mapping in case the bootfs is thrown away later
     uintptr_t address;
-    mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ, &address);
+    zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ, &address);
 
     struct callback_data cd = {
         .vmo = vmo,
@@ -161,31 +161,31 @@
         memfs_mount(vfs_create_global_root(), systemfs_get_root());
     }
     bootfs_t bfs;
-    if (bootfs_create(&bfs, vmo) == MX_OK) {
+    if (bootfs_create(&bfs, vmo) == ZX_OK) {
         bootfs_parse(&bfs, callback, &cd);
         bootfs_destroy(&bfs);
     }
     return cd.file_count;
 }
 
-static mx_status_t copy_vmo(mx_handle_t src, mx_off_t offset, size_t length, mx_handle_t* out_dest) {
-    mx_handle_t dest;
-    mx_status_t status = mx_vmo_create(length, 0, &dest);
-    if (status != MX_OK) {
+static zx_status_t copy_vmo(zx_handle_t src, zx_off_t offset, size_t length, zx_handle_t* out_dest) {
+    zx_handle_t dest;
+    zx_status_t status = zx_vmo_create(length, 0, &dest);
+    if (status != ZX_OK) {
         return status;
     }
 
     char buffer[PAGE_SIZE];
-    mx_off_t src_offset = offset;
-    mx_off_t dest_offset = 0;
+    zx_off_t src_offset = offset;
+    zx_off_t dest_offset = 0;
 
     while (length > 0) {
         size_t copy = (length > sizeof(buffer) ? sizeof(buffer) : length);
         size_t actual;
-        if ((status = mx_vmo_read(src, buffer, src_offset, copy, &actual)) != MX_OK) {
+        if ((status = zx_vmo_read(src, buffer, src_offset, copy, &actual)) != ZX_OK) {
             goto fail;
         }
-        if ((status = mx_vmo_write(dest, buffer, dest_offset, actual, &actual)) != MX_OK) {
+        if ((status = zx_vmo_write(dest, buffer, dest_offset, actual, &actual)) != ZX_OK) {
             goto fail;
         }
         src_offset += actual;
@@ -194,36 +194,36 @@
     }
 
     *out_dest = dest;
-    return MX_OK;
+    return ZX_OK;
 
 fail:
-    mx_handle_close(dest);
+    zx_handle_close(dest);
     return status;
 }
 
-static void setup_last_crashlog(mx_handle_t vmo_in, uint64_t off_in, size_t sz) {
+static void setup_last_crashlog(zx_handle_t vmo_in, uint64_t off_in, size_t sz) {
     printf("devmgr: last crashlog is %zu bytes\n", sz);
-    mx_handle_t vmo;
-    if (copy_vmo(vmo_in, off_in, sz, &vmo) != MX_OK) {
+    zx_handle_t vmo;
+    if (copy_vmo(vmo_in, off_in, sz, &vmo) != ZX_OK) {
         return;
     }
     bootfs_add_file("log/last-panic.txt", vmo, 0, sz);
 }
 
-static mx_status_t devmgr_read_mdi(mx_handle_t vmo, mx_off_t offset, size_t length) {
-    mx_handle_t mdi_handle;
-    mx_status_t status = copy_vmo(vmo, offset, length, &mdi_handle);
-    if (status != MX_OK) {
+static zx_status_t devmgr_read_mdi(zx_handle_t vmo, zx_off_t offset, size_t length) {
+    zx_handle_t mdi_handle;
+    zx_status_t status = copy_vmo(vmo, offset, length, &mdi_handle);
+    if (status != ZX_OK) {
         printf("devmgr_read_mdi failed to copy MDI data: %d\n", status);
         return status;
     }
 
     devmgr_set_mdi(mdi_handle);
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     printf("devmgr_read_mdi failed %d\n", status);
-    mx_handle_close(mdi_handle);
+    zx_handle_close(mdi_handle);
     return status;
 }
 
@@ -231,19 +231,19 @@
 #define HND_BOOTDATA(n) PA_HND(PA_VMO_BOOTDATA, n)
 
 static void setup_bootfs(void) {
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     unsigned idx = 0;
 
-    if ((vmo = mx_get_startup_handle(HND_BOOTFS(0)))) {
+    if ((vmo = zx_get_startup_handle(HND_BOOTFS(0)))) {
         setup_bootfs_vmo(idx++, BOOTDATA_BOOTFS_BOOT, vmo);
     } else {
         printf("devmgr: missing primary bootfs?!\n");
     }
 
-    for (unsigned n = 0; (vmo = mx_get_startup_handle(HND_BOOTDATA(n))); n++) {
+    for (unsigned n = 0; (vmo = zx_get_startup_handle(HND_BOOTDATA(n))); n++) {
         bootdata_t bootdata;
         size_t actual;
-        mx_status_t status = mx_vmo_read(vmo, &bootdata, 0, sizeof(bootdata), &actual);
+        zx_status_t status = zx_vmo_read(vmo, &bootdata, 0, sizeof(bootdata), &actual);
         if ((status < 0) || (actual != sizeof(bootdata))) {
             goto done;
         }
@@ -259,7 +259,7 @@
         }
 
         while (len > sizeof(bootdata)) {
-            mx_status_t status = mx_vmo_read(vmo, &bootdata, off, sizeof(bootdata), &actual);
+            zx_status_t status = zx_vmo_read(vmo, &bootdata, off, sizeof(bootdata), &actual);
             if ((status < 0) || (actual != sizeof(bootdata))) {
                 break;
             }
@@ -282,8 +282,8 @@
             case BOOTDATA_BOOTFS_BOOT:
             case BOOTDATA_BOOTFS_SYSTEM: {
                 const char* errmsg;
-                mx_handle_t bootfs_vmo;
-                status = decompress_bootdata(mx_vmar_root_self(), vmo,
+                zx_handle_t bootfs_vmo;
+                status = decompress_bootdata(zx_vmar_root_self(), vmo,
                                              off, bootdata.length + hdrsz,
                                              &bootfs_vmo, &errmsg);
                 if (status < 0) {
@@ -319,11 +319,11 @@
             len -= itemlen;
         }
 done:
-        mx_handle_close(vmo);
+        zx_handle_close(vmo);
     }
 }
 
-ssize_t devmgr_add_systemfs_vmo(mx_handle_t vmo) {
+ssize_t devmgr_add_systemfs_vmo(zx_handle_t vmo) {
     ssize_t added = setup_bootfs_vmo(100, BOOTDATA_BOOTFS_SYSTEM, vmo);
     if (added > 0) {
         start_system_init();
@@ -343,8 +343,8 @@
     vfs_global_init(vfs_create_global_root());
 
     // give our own process access to files in the vfs
-    mx_handle_t h = vfs_create_global_root_handle();
+    zx_handle_t h = vfs_create_global_root_handle();
     if (h > 0) {
-        mxio_install_root(mxio_remote_create(h, 0));
+        fdio_install_root(fdio_remote_create(h, 0));
     }
 }
diff --git a/system/core/devmgr/devmgr.c b/system/core/devmgr/devmgr.c
index 0db2730..8d4296b 100644
--- a/system/core/devmgr/devmgr.c
+++ b/system/core/devmgr/devmgr.c
@@ -13,14 +13,14 @@
 
 #include <launchpad/launchpad.h>
 #include <launchpad/loader-service.h>
-#include <magenta/dlfcn.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/status.h>
+#include <zircon/dlfcn.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/status.h>
 
-#include <mxio/util.h>
+#include <fdio/util.h>
 
 #include "devmgr.h"
 #include "memfs-private.h"
@@ -31,13 +31,13 @@
 #define VMO_SUBDIR_LEN (sizeof(VMO_SUBDIR) - 1)
 
 // The handle used to transmit messages to appmgr.
-static mx_handle_t svc_root_handle;
+static zx_handle_t svc_root_handle;
 // The handle used by appmgr to serve incoming requests.
 // If appmgr cannot be launched within a timeout, this handle is closed.
-static mx_handle_t svc_request_handle;
+static zx_handle_t svc_request_handle;
 
-mx_handle_t get_service_root(void) {
-    return mxio_service_clone(svc_root_handle);
+zx_handle_t get_service_root(void) {
+    return fdio_service_clone(svc_root_handle);
 }
 
 bool getenv_bool(const char* key, bool _default) {
@@ -53,22 +53,22 @@
     return true;
 }
 
-static mx_handle_t root_resource_handle;
-static mx_handle_t root_job_handle;
-static mx_handle_t svcs_job_handle;
-static mx_handle_t fuchsia_job_handle;
+static zx_handle_t root_resource_handle;
+static zx_handle_t root_job_handle;
+static zx_handle_t svcs_job_handle;
+static zx_handle_t fuchsia_job_handle;
 
-mx_handle_t virtcon_open;
+zx_handle_t virtcon_open;
 
-mx_handle_t get_root_resource(void) {
+zx_handle_t get_root_resource(void) {
     return root_resource_handle;
 }
 
-mx_handle_t get_sysinfo_job_root(void) {
-    mx_handle_t h;
+zx_handle_t get_sysinfo_job_root(void) {
+    zx_handle_t h;
     //TODO: limit to enumerate rights
-    if (mx_handle_duplicate(root_job_handle, MX_RIGHT_SAME_RIGHTS, &h) < 0) {
-        return MX_HANDLE_INVALID;
+    if (zx_handle_duplicate(root_job_handle, ZX_RIGHT_SAME_RIGHTS, &h) < 0) {
+        return ZX_HANDLE_INVALID;
     } else {
         return h;
     }
@@ -103,14 +103,14 @@
     struct stat s;
     if (!appmgr_started && stat(argv_appmgr[0], &s) == 0) {
         unsigned int appmgr_hnd_count = 0;
-        mx_handle_t appmgr_hnds[2] = {};
+        zx_handle_t appmgr_hnds[2] = {};
         uint32_t appmgr_ids[2] = {};
         if (svc_request_handle) {
             assert(appmgr_hnd_count < countof(appmgr_hnds));
             appmgr_hnds[appmgr_hnd_count] = svc_request_handle;
             appmgr_ids[appmgr_hnd_count] = PA_SERVICE_REQUEST;
             appmgr_hnd_count++;
-            svc_request_handle = MX_HANDLE_INVALID;
+            svc_request_handle = ZX_HANDLE_INVALID;
         }
         devmgr_launch(fuchsia_job_handle, "appmgr", countof(argv_appmgr),
                       argv_appmgr, NULL, -1, appmgr_hnds, appmgr_ids,
@@ -118,7 +118,7 @@
         appmgr_started = true;
     }
     if (!autorun_started) {
-        do_autorun("autorun:system", "magenta.autorun.system");
+        do_autorun("autorun:system", "zircon.autorun.system");
         autorun_started = true;
     }
     mtx_unlock(&appmgr_lock);
@@ -126,11 +126,11 @@
 }
 
 int service_timeout(void* arg) {
-    mx_nanosleep(mx_deadline_after(MX_SEC(10)));
+    zx_nanosleep(zx_deadline_after(ZX_SEC(10)));
     mtx_lock(&appmgr_lock);
-    if (svc_request_handle != MX_HANDLE_INVALID) {
+    if (svc_request_handle != ZX_HANDLE_INVALID) {
         printf("devmgr: appmgr not found, closing service handle\n");
-        mx_handle_close(svc_request_handle);
+        zx_handle_close(svc_request_handle);
     }
     mtx_unlock(&appmgr_lock);
     return 0;
@@ -154,21 +154,21 @@
             vruncmd = true;
         }
 
-        const char* nodename = getenv("magenta.nodename");
+        const char* nodename = getenv("zircon.nodename");
         if (nodename) {
             args[argc++] = nodename;
         }
 
-        mx_handle_t proc;
+        zx_handle_t proc;
         if (devmgr_launch(svcs_job_handle, "netsvc", argc, args,
-                          NULL, -1, NULL, NULL, 0, &proc) == MX_OK) {
+                          NULL, -1, NULL, NULL, 0, &proc) == ZX_OK) {
             if (vruncmd) {
-                mx_info_handle_basic_t info = {
+                zx_info_handle_basic_t info = {
                     .koid = 0,
                 };
-                mx_object_get_info(proc, MX_INFO_HANDLE_BASIC,
+                zx_object_get_info(proc, ZX_INFO_HANDLE_BASIC,
                                    &info, sizeof(info), NULL, NULL);
-                mx_handle_close(proc);
+                zx_handle_close(proc);
                 snprintf(vcmd, sizeof(vcmd), "dlog -f -t -p %zu", info.koid);
             }
         } else {
@@ -190,16 +190,16 @@
         envp[envc] = NULL;
 
         uint32_t type = PA_HND(PA_USER0, 0);
-        mx_handle_t h = MX_HANDLE_INVALID;
-        mx_channel_create(0, &h, &virtcon_open);
+        zx_handle_t h = ZX_HANDLE_INVALID;
+        zx_channel_create(0, &h, &virtcon_open);
         const char* args[] = { "/boot/bin/virtual-console", "--run", vcmd };
         devmgr_launch(svcs_job_handle, "virtual-console",
                       vruncmd ? 3 : 1, args, envp, -1,
-                      &h, &type, (h == MX_HANDLE_INVALID) ? 0 : 1, NULL);
+                      &h, &type, (h == ZX_HANDLE_INVALID) ? 0 : 1, NULL);
     }
 
 
-    do_autorun("autorun:boot", "magenta.autorun.boot");
+    do_autorun("autorun:boot", "zircon.autorun.boot");
     struct stat s;
     if (stat(argv_autorun0[1], &s) == 0) {
         printf("devmgr: starting /boot/autorun ...\n");
@@ -214,7 +214,7 @@
     return 0;
 }
 
-#if !_MX_KERNEL_HAS_SHELL
+#if !_ZX_KERNEL_HAS_SHELL
 static int console_starter(void* arg) {
     // if no kernel shell on serial uart, start a sh there
     printf("devmgr: shell startup\n");
@@ -233,7 +233,7 @@
                           countof(argv_sh), argv_sh, envp, fd, NULL, NULL, 0, NULL);
             break;
         }
-        mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
     }
     return 0;
 }
@@ -252,8 +252,8 @@
 // the filesystem under the path /boot/VMO_SUBDIR_LEN/<vmo-name>.
 static void fetch_vmos(uint_fast8_t type, const char* debug_type_name) {
     for (uint_fast16_t i = 0; true; ++i) {
-        mx_handle_t vmo = mx_get_startup_handle(PA_HND(type, i));
-        if (vmo == MX_HANDLE_INVALID)
+        zx_handle_t vmo = zx_get_startup_handle(PA_HND(type, i));
+        if (vmo == ZX_HANDLE_INVALID)
             break;
 
         if (type == PA_VMO_VDSO && i == 0) {
@@ -265,24 +265,24 @@
 
         // The vDSO VMOs have names like "vdso/default", so those
         // become VMO files at "/boot/kernel/vdso/default".
-        char name[VMO_SUBDIR_LEN + MX_MAX_NAME_LEN] = VMO_SUBDIR;
+        char name[VMO_SUBDIR_LEN + ZX_MAX_NAME_LEN] = VMO_SUBDIR;
         size_t size;
-        mx_status_t status = mx_object_get_property(vmo, MX_PROP_NAME,
+        zx_status_t status = zx_object_get_property(vmo, ZX_PROP_NAME,
                 name + VMO_SUBDIR_LEN, sizeof(name) - VMO_SUBDIR_LEN);
-        if (status != MX_OK) {
-            printf("devmgr: mx_object_get_property on %s %u: %s\n",
-                   debug_type_name, i, mx_status_get_string(status));
+        if (status != ZX_OK) {
+            printf("devmgr: zx_object_get_property on %s %u: %s\n",
+                   debug_type_name, i, zx_status_get_string(status));
             continue;
         }
-        status = mx_vmo_get_size(vmo, &size);
-        if (status != MX_OK) {
-            printf("devmgr: mx_vmo_get_size on %s %u: %s\n",
-                   debug_type_name, i, mx_status_get_string(status));
+        status = zx_vmo_get_size(vmo, &size);
+        if (status != ZX_OK) {
+            printf("devmgr: zx_vmo_get_size on %s %u: %s\n",
+                   debug_type_name, i, zx_status_get_string(status));
             continue;
         }
         if (size == 0) {
             // empty vmos do not get installed
-            mx_handle_close(vmo);
+            zx_handle_close(vmo);
             continue;
         }
         if (!strcmp(name + VMO_SUBDIR_LEN, "crashlog")) {
@@ -290,9 +290,9 @@
             strcpy(name, "log/last-panic.txt");
         }
         status = bootfs_add_file(name, vmo, 0, size);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             printf("devmgr: failed to add %s %u to filesystem: %s\n",
-                   debug_type_name, i, mx_status_get_string(status));
+                   debug_type_name, i, zx_status_get_string(status));
         }
     }
 }
@@ -366,8 +366,8 @@
 int main(int argc, char** argv) {
     // Close the loader-service channel so the service can go away.
     // We won't use it any more (no dlopen calls in this process).
-    mx_handle_t loader_svc = dl_set_loader_service(MX_HANDLE_INVALID);
-    mx_handle_close(loader_svc);
+    zx_handle_t loader_svc = dl_set_loader_service(ZX_HANDLE_INVALID);
+    zx_handle_close(loader_svc);
 
     // Ensure that devmgr doesn't try to connect to the global
     // loader sevice (as this leads to deadlocks in devhost v2)
@@ -375,8 +375,8 @@
 
     devmgr_io_init();
 
-    root_resource_handle = mx_get_startup_handle(PA_HND(PA_RESOURCE, 0));
-    root_job_handle = mx_job_default();
+    root_resource_handle = zx_get_startup_handle(PA_HND(PA_RESOURCE, 0));
+    root_job_handle = zx_job_default();
 
     printf("devmgr: main()\n");
 
@@ -390,27 +390,27 @@
         printf("cmdline: %s\n", *e++);
     }
 
-    mx_object_set_property(root_job_handle, MX_PROP_NAME, "root", 4);
+    zx_object_set_property(root_job_handle, ZX_PROP_NAME, "root", 4);
 
     fetch_vmos(PA_VMO_VDSO, "PA_VMO_VDSO");
     fetch_vmos(PA_VMO_KERNEL_FILE, "PA_VMO_KERNEL_FILE");
 
 
-    mx_status_t status = mx_job_create(root_job_handle, 0u, &svcs_job_handle);
+    zx_status_t status = zx_job_create(root_job_handle, 0u, &svcs_job_handle);
     if (status < 0) {
         printf("unable to create service job\n");
     }
-    mx_object_set_property(svcs_job_handle, MX_PROP_NAME, "magenta-services", 16);
+    zx_object_set_property(svcs_job_handle, ZX_PROP_NAME, "zircon-services", 16);
 
-    status = mx_job_create(root_job_handle, 0u, &fuchsia_job_handle);
+    status = zx_job_create(root_job_handle, 0u, &fuchsia_job_handle);
     if (status < 0) {
         printf("unable to create service job\n");
     }
-    mx_object_set_property(fuchsia_job_handle, MX_PROP_NAME, "fuchsia", 7);
+    zx_object_set_property(fuchsia_job_handle, ZX_PROP_NAME, "fuchsia", 7);
 
     // Features like Intel Processor Trace need a dump of ld.so activity.
     // The output has a specific format, and will eventually be recorded
-    // via a specific mechanism (magenta tracing support), so we use a specific
+    // via a specific mechanism (zircon tracing support), so we use a specific
     // env var (and don't, for example, piggyback on LD_DEBUG).
     // We enable this pretty early so that we get a trace of as many processes
     // as possible.
@@ -439,13 +439,13 @@
         // Bind the exception port now, to avoid missing any crashes that
         // might occur early on before the crashlogger process has finished
         // initializing.
-        mx_handle_t exception_port;
+        zx_handle_t exception_port;
         // This should match the value used by crashlogger.
         const uint64_t kSysExceptionKey = 1166444u;
-        if (mx_port_create(0, &exception_port) == MX_OK &&
-            mx_task_bind_exception_port(MX_HANDLE_INVALID, exception_port,
-                                        kSysExceptionKey, 0) == MX_OK) {
-            mx_handle_t handles[] = { exception_port };
+        if (zx_port_create(0, &exception_port) == ZX_OK &&
+            zx_task_bind_exception_port(ZX_HANDLE_INVALID, exception_port,
+                                        kSysExceptionKey, 0) == ZX_OK) {
+            zx_handle_t handles[] = { exception_port };
             uint32_t handle_types[] = { PA_HND(PA_USER0, 0) };
 
             devmgr_launch(svcs_job_handle, "crashlogger",
@@ -455,7 +455,7 @@
         }
     }
 
-    mx_channel_create(0, &svc_root_handle, &svc_request_handle);
+    zx_channel_create(0, &svc_root_handle, &svc_request_handle);
 
     start_console_shell();
 
diff --git a/system/core/devmgr/devmgr.h b/system/core/devmgr/devmgr.h
index 56e41f4..cdf5df3 100644
--- a/system/core/devmgr/devmgr.h
+++ b/system/core/devmgr/devmgr.h
@@ -5,25 +5,25 @@
 #pragma once
 
 #include <ddk/device.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
-void devmgr_init(mx_handle_t root_job);
+void devmgr_init(zx_handle_t root_job);
 void devmgr_handle_messages(void);
 
 void devmgr_io_init(void);
 void devmgr_vfs_init(void);
-mx_status_t devmgr_launch(mx_handle_t job, const char* name,
+zx_status_t devmgr_launch(zx_handle_t job, const char* name,
                           int argc, const char* const* argv,
                           const char** envp, int stdiofd,
-                          mx_handle_t* handles, uint32_t* types, size_t len,
-                          mx_handle_t* proc_out);
-void devmgr_launch_devhost(mx_handle_t job,
+                          zx_handle_t* handles, uint32_t* types, size_t len,
+                          zx_handle_t* proc_out);
+void devmgr_launch_devhost(zx_handle_t job,
                            const char* name, int argc, char** argv,
-                           mx_handle_t hdevice, mx_handle_t hrpc);
-ssize_t devmgr_add_systemfs_vmo(mx_handle_t vmo);
+                           zx_handle_t hdevice, zx_handle_t hrpc);
+ssize_t devmgr_add_systemfs_vmo(zx_handle_t vmo);
 bool secondary_bootfs_ready(void);
 int devmgr_start_appmgr(void* arg);
 
@@ -35,9 +35,9 @@
 // The env var to set to enable ld.so tracing.
 #define LDSO_TRACE_ENV "LD_TRACE=1"
 
-mx_handle_t get_service_root(void);
+zx_handle_t get_service_root(void);
 
-void block_device_watcher(mx_handle_t job);
+void block_device_watcher(zx_handle_t job);
 
 // getenv_bool looks in the environment for name. If not found, it returns
 // default. If found, it returns false if the found value matches "0", "off", or
diff --git a/system/core/devmgr/dmctl.c b/system/core/devmgr/dmctl.c
index 7809910..223645f 100644
--- a/system/core/devmgr/dmctl.c
+++ b/system/core/devmgr/dmctl.c
@@ -12,60 +12,60 @@
 #include "device-internal.h"
 #include "devcoordinator.h"
 
-#include <magenta/device/dmctl.h>
+#include <zircon/device/dmctl.h>
 #include <launchpad/loader-service.h>
 
-static mx_device_t* dmctl_dev;
+static zx_device_t* dmctl_dev;
 
 static loader_service_t* loader_svc;
 
-static mx_status_t dmctl_cmd(uint32_t op, const char* cmd, size_t cmdlen, mx_handle_t h) {
+static zx_status_t dmctl_cmd(uint32_t op, const char* cmd, size_t cmdlen, zx_handle_t h) {
     dc_msg_t msg;
     uint32_t msglen;
     if (dc_msg_pack(&msg, &msglen, cmd, cmdlen, NULL, NULL) < 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     msg.op = op;
     dc_status_t rsp;
     return dc_msg_rpc(dmctl_dev->rpc, &msg, msglen,
-                      &h, (h != MX_HANDLE_INVALID) ? 1 : 0,
+                      &h, (h != ZX_HANDLE_INVALID) ? 1 : 0,
                       &rsp, sizeof(rsp));
 }
 
-static mx_status_t dmctl_write(void* ctx, const void* buf, size_t count, mx_off_t off,
+static zx_status_t dmctl_write(void* ctx, const void* buf, size_t count, zx_off_t off,
                                size_t* actual) {
-    mx_status_t status = dmctl_cmd(DC_OP_DM_COMMAND, buf, count, MX_HANDLE_INVALID);
+    zx_status_t status = dmctl_cmd(DC_OP_DM_COMMAND, buf, count, ZX_HANDLE_INVALID);
     if (status >= 0) {
         *actual = count;
-        status = MX_OK;
+        status = ZX_OK;
     }
     return status;
 }
 
-static mx_status_t dmctl_ioctl(void* ctx, uint32_t op,
+static zx_status_t dmctl_ioctl(void* ctx, uint32_t op,
                                const void* in_buf, size_t in_len,
                                void* out_buf, size_t out_len, size_t* out_actual) {
     switch (op) {
     case IOCTL_DMCTL_GET_LOADER_SERVICE_CHANNEL:
-        if (in_len != 0 || out_buf == NULL || out_len != sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
+        if (in_len != 0 || out_buf == NULL || out_len != sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
         }
         if (loader_svc == NULL) {
             // The allocation in dmctl_init() failed.
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         // Create a new channel on the multiloader.
-        mx_handle_t out_channel;
-        mx_status_t status = loader_service_connect(loader_svc, &out_channel);
+        zx_handle_t out_channel;
+        zx_status_t status = loader_service_connect(loader_svc, &out_channel);
         if (status < 0) {
             return status;
         }
-        memcpy(out_buf, &out_channel, sizeof(mx_handle_t));
-        *out_actual = sizeof(mx_handle_t);
-        return MX_OK;
+        memcpy(out_buf, &out_channel, sizeof(zx_handle_t));
+        *out_actual = sizeof(zx_handle_t);
+        return ZX_OK;
     case IOCTL_DMCTL_COMMAND:
         if (in_len != sizeof(dmctl_cmd_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         dmctl_cmd_t cmd;
         memcpy(&cmd, in_buf, sizeof(cmd));
@@ -76,35 +76,35 @@
         // ioctls that accept a handle argument, so we have to avoid
         // returning that in this case where the handle has been passed
         // to another process (and effectively closed)
-        if (status == MX_ERR_NOT_SUPPORTED) {
-            status = MX_ERR_INTERNAL;
+        if (status == ZX_ERR_NOT_SUPPORTED) {
+            status = ZX_ERR_INTERNAL;
         }
         return status;
     case IOCTL_DMCTL_OPEN_VIRTCON:
-        if (in_len != sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
+        if (in_len != sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        return dmctl_cmd(DC_OP_DM_OPEN_VIRTCON, NULL, 0, *((mx_handle_t*) in_buf));
+        return dmctl_cmd(DC_OP_DM_OPEN_VIRTCON, NULL, 0, *((zx_handle_t*) in_buf));
     case IOCTL_DMCTL_WATCH_DEVMGR:
-        if (in_len != sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
+        if (in_len != sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        return dmctl_cmd(DC_OP_DM_WATCH, NULL, 0, *((mx_handle_t*) in_buf));
+        return dmctl_cmd(DC_OP_DM_WATCH, NULL, 0, *((zx_handle_t*) in_buf));
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
-static mx_protocol_device_t dmctl_device_ops = {
+static zx_protocol_device_t dmctl_device_ops = {
     .version = DEVICE_OPS_VERSION,
     .write = dmctl_write,
     .ioctl = dmctl_ioctl,
 };
 
-mx_status_t dmctl_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t dmctl_bind(void* ctx, zx_device_t* parent, void** cookie) {
 
     // Don't try to ioctl to ourselves when this process loads libraries.
-    // Call this before the device has been created; mxio_loader_service()
+    // Call this before the device has been created; fdio_loader_service()
     // uses the device's presence as an invitation to use it.
     loader_service_force_local();
 
@@ -114,7 +114,7 @@
         .ops = &dmctl_device_ops,
     };
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = device_add(parent, &args, &dmctl_dev)) < 0) {
         return status;
     }
@@ -127,14 +127,14 @@
         printf("dmctl: cannot create multiloader context: %d\n", status);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t dmctl_driver_ops = {
+static zx_driver_ops_t dmctl_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = dmctl_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(dmctl, dmctl_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(dmctl)
+ZIRCON_DRIVER_BEGIN(dmctl, dmctl_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(dmctl)
diff --git a/system/core/devmgr/dnode.cpp b/system/core/devmgr/dnode.cpp
index 3f4f136..fda1d91 100644
--- a/system/core/devmgr/dnode.cpp
+++ b/system/core/devmgr/dnode.cpp
@@ -40,7 +40,7 @@
 }
 
 void Dnode::RemoveFromParent() {
-    MX_DEBUG_ASSERT(vnode_ != nullptr);
+    ZX_DEBUG_ASSERT(vnode_ != nullptr);
 
     // Detach from parent
     if (parent_) {
@@ -64,7 +64,7 @@
 }
 
 void Dnode::Detach() {
-    MX_DEBUG_ASSERT(children_.is_empty());
+    ZX_DEBUG_ASSERT(children_.is_empty());
     if (vnode_ == nullptr) { // Dnode already detached.
         return;
     }
@@ -76,11 +76,11 @@
 }
 
 void Dnode::AddChild(fbl::RefPtr<Dnode> parent, fbl::RefPtr<Dnode> child) {
-    MX_DEBUG_ASSERT(parent != nullptr);
-    MX_DEBUG_ASSERT(child != nullptr);
-    MX_DEBUG_ASSERT(child->parent_ == nullptr); // Child shouldn't have a parent
-    MX_DEBUG_ASSERT(child != parent);
-    MX_DEBUG_ASSERT(parent->IsDirectory());
+    ZX_DEBUG_ASSERT(parent != nullptr);
+    ZX_DEBUG_ASSERT(child != nullptr);
+    ZX_DEBUG_ASSERT(child->parent_ == nullptr); // Child shouldn't have a parent
+    ZX_DEBUG_ASSERT(child != parent);
+    ZX_DEBUG_ASSERT(parent->IsDirectory());
 
     child->parent_ = parent;
     child->vnode_->link_count_++;
@@ -98,33 +98,33 @@
     parent->vnode_->UpdateModified();
 }
 
-mx_status_t Dnode::Lookup(const char* name, size_t len, fbl::RefPtr<Dnode>* out) const {
+zx_status_t Dnode::Lookup(const char* name, size_t len, fbl::RefPtr<Dnode>* out) const {
     auto dn = children_.find_if([&name, &len](const Dnode& elem) -> bool {
         return elem.NameMatch(name, len);
     });
     if (dn == children_.end()) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     if (out != nullptr) {
         *out = dn.CopyPointer();
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 fbl::RefPtr<VnodeMemfs> Dnode::AcquireVnode() const {
     return vnode_;
 }
 
-mx_status_t Dnode::CanUnlink() const {
+zx_status_t Dnode::CanUnlink() const {
     if (!children_.is_empty()) {
         // Cannot unlink non-empty directory
-        return MX_ERR_NOT_EMPTY;
+        return ZX_ERR_NOT_EMPTY;
     } else if (vnode_->IsRemote()) {
         // Cannot unlink mount points
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 struct dircookie_t {
@@ -136,25 +136,25 @@
 
 // Read the canned "." and ".." entries that should
 // appear at the beginning of a directory.
-mx_status_t Dnode::ReaddirStart(fs::DirentFiller* df, void* cookie) {
+zx_status_t Dnode::ReaddirStart(fs::DirentFiller* df, void* cookie) {
     dircookie_t* c = static_cast<dircookie_t*>(cookie);
-    mx_status_t r;
+    zx_status_t r;
 
     if (c->order == 0) {
-        if ((r = df->Next(".", 1, VTYPE_TO_DTYPE(V_TYPE_DIR))) != MX_OK) {
+        if ((r = df->Next(".", 1, VTYPE_TO_DTYPE(V_TYPE_DIR))) != ZX_OK) {
             return r;
         }
         c->order++;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 void Dnode::Readdir(fs::DirentFiller* df, void* cookie) const {
     dircookie_t* c = static_cast<dircookie_t*>(cookie);
-    mx_status_t r = 0;
+    zx_status_t r = 0;
 
     if (c->order < 1) {
-        if ((r = Dnode::ReaddirStart(df, cookie)) != MX_OK) {
+        if ((r = Dnode::ReaddirStart(df, cookie)) != ZX_OK) {
             return;
         }
     }
@@ -164,7 +164,7 @@
             continue;
         }
         uint32_t vtype = dn.IsDirectory() ? V_TYPE_DIR : V_TYPE_FILE;
-        if ((r = df->Next(dn.name_.get(), dn.NameLen(), VTYPE_TO_DTYPE(vtype))) != MX_OK) {
+        if ((r = df->Next(dn.name_.get(), dn.NameLen(), VTYPE_TO_DTYPE(vtype))) != ZX_OK) {
             return;
         }
         c->order = dn.ordering_token_ + 1;
diff --git a/system/core/devmgr/dnode.h b/system/core/devmgr/dnode.h
index aee9d4e..4c74519 100644
--- a/system/core/devmgr/dnode.h
+++ b/system/core/devmgr/dnode.h
@@ -8,7 +8,7 @@
 #include <string.h>
 
 #include <fs/vfs.h>
-#include <mxio/vfs.h>
+#include <fdio/vfs.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/ref_counted.h>
 #include <fbl/ref_ptr.h>
@@ -62,26 +62,26 @@
     bool HasChildren() const { return !children_.is_empty(); }
 
     // Look up the child dnode (within a parent directory) by name.
-    // Returns MX_OK if the child is found.
+    // Returns ZX_OK if the child is found.
     //
     // If the looked up child is the current node, "out" is nullptr, and
-    // MX_OK is still returned.
+    // ZX_OK is still returned.
     // If "out" is provided as "nullptr", the returned status appears the
     // same, but the "out" argument is not touched.
-    mx_status_t Lookup(const char* name, size_t len, fbl::RefPtr<Dnode>* out) const;
+    zx_status_t Lookup(const char* name, size_t len, fbl::RefPtr<Dnode>* out) const;
 
     // Acquire a pointer to the vnode underneath this dnode.
     // Acquires a reference to the underlying vnode.
     fbl::RefPtr<VnodeMemfs> AcquireVnode() const;
 
-    // Returns MX_OK if the dnode may be unlinked
-    mx_status_t CanUnlink() const;
+    // Returns ZX_OK if the dnode may be unlinked
+    zx_status_t CanUnlink() const;
 
     // Read dirents (up to len bytes worth) into data.
     // ReaddirStart reads the canned "." and ".." entries that should appear
     // at the beginning of a directory.
     // On success, return the number of bytes read.
-    static mx_status_t ReaddirStart(fs::DirentFiller* df, void* cookie);
+    static zx_status_t ReaddirStart(fs::DirentFiller* df, void* cookie);
     void Readdir(fs::DirentFiller* df, void* cookie) const;
 
     // Answers the question: "Is dn a subdirectory of this?"
diff --git a/system/core/devmgr/memfs-private.h b/system/core/devmgr/memfs-private.h
index 11698f7..de8b7a3 100644
--- a/system/core/devmgr/memfs-private.h
+++ b/system/core/devmgr/memfs-private.h
@@ -8,11 +8,11 @@
 
 #include <ddk/device.h>
 #include <fs/vfs.h>
-#include <magenta/compiler.h>
-#include <magenta/thread_annotations.h>
-#include <magenta/types.h>
-#include <mxio/remoteio.h>
-#include <mxio/vfs.h>
+#include <zircon/compiler.h>
+#include <zircon/thread_annotations.h>
+#include <zircon/types.h>
+#include <fdio/remoteio.h>
+#include <fdio/vfs.h>
 
 #ifdef __cplusplus
 
@@ -31,16 +31,16 @@
 
 class VnodeMemfs : public fs::Vnode {
 public:
-    virtual mx_status_t Setattr(vnattr_t* a) final;
-    virtual mx_status_t Sync() final;
+    virtual zx_status_t Setattr(vnattr_t* a) final;
+    virtual zx_status_t Sync() final;
     ssize_t Ioctl(uint32_t op, const void* in_buf,
                   size_t in_len, void* out_buf, size_t out_len) override;
-    mx_status_t AttachRemote(fs::MountChannel h) final;
+    zx_status_t AttachRemote(fs::MountChannel h) final;
 
     // To be more specific: Is this vnode connected into the directory hierarchy?
     // VnodeDirs can be unlinked, and this method will subsequently return false.
     bool IsDirectory() const { return dnode_ != nullptr; }
-    void UpdateModified() { modify_time_ = mx_time_get(MX_CLOCK_UTC); }
+    void UpdateModified() { modify_time_ = zx_time_get(ZX_CLOCK_UTC); }
 
     virtual ~VnodeMemfs();
 
@@ -61,20 +61,20 @@
 class VnodeFile final : public VnodeMemfs {
 public:
     VnodeFile();
-    VnodeFile(mx_handle_t vmo, mx_off_t length);
+    VnodeFile(zx_handle_t vmo, zx_off_t length);
     ~VnodeFile();
 
-    virtual mx_status_t Open(uint32_t flags) final;
+    virtual zx_status_t Open(uint32_t flags) final;
 
 private:
     ssize_t Read(void* data, size_t len, size_t off) final;
     ssize_t Write(const void* data, size_t len, size_t off) final;
-    mx_status_t Truncate(size_t len) final;
-    mx_status_t Getattr(vnattr_t* a) final;
-    mx_status_t Mmap(int flags, size_t len, size_t* off, mx_handle_t* out) final;
+    zx_status_t Truncate(size_t len) final;
+    zx_status_t Getattr(vnattr_t* a) final;
+    zx_status_t Mmap(int flags, size_t len, size_t* off, zx_handle_t* out) final;
 
-    mx_handle_t vmo_;
-    mx_off_t length_;
+    zx_handle_t vmo_;
+    zx_off_t length_;
 };
 
 class VnodeDir : public VnodeMemfs {
@@ -82,48 +82,48 @@
     VnodeDir();
     virtual ~VnodeDir();
 
-    virtual mx_status_t Open(uint32_t flags) final;
-    mx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
-    mx_status_t Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len, uint32_t mode) final;
+    virtual zx_status_t Open(uint32_t flags) final;
+    zx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
+    zx_status_t Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len, uint32_t mode) final;
 
     // Create a vnode from a VMO.
     // Fails if the vnode already exists.
     // Passes the vmo to the Vnode; does not duplicate it.
-    mx_status_t CreateFromVmo(bool vmofile, const char* name, size_t namelen, mx_handle_t vmo,
-                              mx_off_t off, mx_off_t len);
+    zx_status_t CreateFromVmo(bool vmofile, const char* name, size_t namelen, zx_handle_t vmo,
+                              zx_off_t off, zx_off_t len);
 
     // Use the watcher container to implement a directory watcher
     void Notify(const char* name, size_t len, unsigned event) final;
-    mx_status_t WatchDir(mx::channel* out) final;
-    mx_status_t WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) final;
+    zx_status_t WatchDir(zx::channel* out) final;
+    zx_status_t WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) final;
 
     // The vnode is acting as a mount point for a remote filesystem or device.
     virtual bool IsRemote() const final;
-    virtual mx::channel DetachRemote() final;
-    virtual mx_handle_t WaitForRemote() final;
-    virtual mx_handle_t GetRemote() const final;
-    virtual void SetRemote(mx::channel remote) final;
+    virtual zx::channel DetachRemote() final;
+    virtual zx_handle_t WaitForRemote() final;
+    virtual zx_handle_t GetRemote() const final;
+    virtual void SetRemote(zx::channel remote) final;
 
 private:
-    mx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
+    zx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
 
     // Resolves the question, "Can this directory create a child node with the name?"
-    // Returns "MX_OK" on success; otherwise explains failure with error message.
-    mx_status_t CanCreate(const char* name, size_t namelen) const;
+    // Returns "ZX_OK" on success; otherwise explains failure with error message.
+    zx_status_t CanCreate(const char* name, size_t namelen) const;
 
     // Creates a dnode for the Vnode, attaches vnode to dnode, (if directory) attaches
     // dnode to vnode, and adds dnode to parent directory.
-    mx_status_t AttachVnode(fbl::RefPtr<memfs::VnodeMemfs> vn, const char* name, size_t namelen,
+    zx_status_t AttachVnode(fbl::RefPtr<memfs::VnodeMemfs> vn, const char* name, size_t namelen,
                             bool isdir);
 
-    mx_status_t Unlink(const char* name, size_t len, bool must_be_dir) final;
-    mx_status_t Rename(fbl::RefPtr<fs::Vnode> newdir,
+    zx_status_t Unlink(const char* name, size_t len, bool must_be_dir) final;
+    zx_status_t Rename(fbl::RefPtr<fs::Vnode> newdir,
                        const char* oldname, size_t oldlen,
                        const char* newname, size_t newlen,
                        bool src_must_be_dir, bool dst_must_be_dir) final;
-    mx_status_t Link(const char* name, size_t len, fbl::RefPtr<fs::Vnode> target) final;
-    mx_status_t Getattr(vnattr_t* a) final;
-    mx_status_t Mmap(int flags, size_t len, size_t* off, mx_handle_t* out) final;
+    zx_status_t Link(const char* name, size_t len, fbl::RefPtr<fs::Vnode> target) final;
+    zx_status_t Getattr(vnattr_t* a) final;
+    zx_status_t Mmap(int flags, size_t len, size_t* off, zx_handle_t* out) final;
     ssize_t Ioctl(uint32_t op, const void* in_buf,
                   size_t in_len, void* out_buf, size_t out_len) final;
 
@@ -133,21 +133,21 @@
 
 class VnodeVmo final : public VnodeMemfs {
 public:
-    VnodeVmo(mx_handle_t vmo, mx_off_t offset, mx_off_t length);
+    VnodeVmo(zx_handle_t vmo, zx_off_t offset, zx_off_t length);
     ~VnodeVmo();
 
-    virtual mx_status_t Open(uint32_t flags) override;
+    virtual zx_status_t Open(uint32_t flags) override;
 
 private:
-    mx_status_t Serve(fs::Vfs* vfs, mx::channel channel, uint32_t flags) final;
+    zx_status_t Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) final;
     ssize_t Read(void* data, size_t len, size_t off) final;
-    mx_status_t Getattr(vnattr_t* a) final;
-    mx_status_t GetHandles(uint32_t flags, mx_handle_t* hnds,
+    zx_status_t Getattr(vnattr_t* a) final;
+    zx_status_t GetHandles(uint32_t flags, zx_handle_t* hnds,
                            uint32_t* type, void* extra, uint32_t* esize) final;
 
-    mx_handle_t vmo_;
-    mx_off_t offset_;
-    mx_off_t length_;
+    zx_handle_t vmo_;
+    zx_off_t offset_;
+    zx_off_t length_;
     bool have_local_clone_;
 };
 
@@ -173,20 +173,20 @@
 void vfs_global_init(VnodeDir* root);
 
 // generate mxremoteio handles
-mx_handle_t vfs_create_global_root_handle(void);
-mx_status_t vfs_connect_global_root_handle(mx_handle_t h);
-mx_handle_t vfs_create_root_handle(VnodeMemfs* vn);
-mx_status_t vfs_connect_root_handle(VnodeMemfs* vn, mx_handle_t h);
+zx_handle_t vfs_create_global_root_handle(void);
+zx_status_t vfs_connect_global_root_handle(zx_handle_t h);
+zx_handle_t vfs_create_root_handle(VnodeMemfs* vn);
+zx_status_t vfs_connect_root_handle(VnodeMemfs* vn, zx_handle_t h);
 
 // device fs
-mx_status_t devfs_mount(mx_handle_t h);
+zx_status_t devfs_mount(zx_handle_t h);
 
 // boot fs
-mx_status_t bootfs_add_file(const char* path, mx_handle_t vmo, mx_off_t off, size_t len);
+zx_status_t bootfs_add_file(const char* path, zx_handle_t vmo, zx_off_t off, size_t len);
 
 // system fs
 VnodeDir* systemfs_get_root(void);
-mx_status_t systemfs_add_file(const char* path, mx_handle_t vmo, mx_off_t off, size_t len);
+zx_status_t systemfs_add_file(const char* path, zx_handle_t vmo, zx_off_t off, size_t len);
 
 // Create the global root to memfs
 VnodeDir* vfs_create_global_root(void) TA_NO_THREAD_SAFETY_ANALYSIS;
diff --git a/system/core/devmgr/rules.mk b/system/core/devmgr/rules.mk
index b0c514f..a5ba913 100644
--- a/system/core/devmgr/rules.mk
+++ b/system/core/devmgr/rules.mk
@@ -23,7 +23,7 @@
     $(LOCAL_DIR)/devmgr-coordinator.c \
     $(LOCAL_DIR)/devmgr-devfs.c \
     $(LOCAL_DIR)/devmgr-drivers.c \
-    $(LOCAL_DIR)/devmgr-mxio.c \
+    $(LOCAL_DIR)/devmgr-fdio.c \
     $(LOCAL_DIR)/vfs-boot.cpp \
     $(LOCAL_DIR)/vfs-memory.cpp \
     $(LOCAL_DIR)/vfs-rpc.cpp \
@@ -41,10 +41,10 @@
     system/ulib/async \
     system/ulib/async.loop \
     system/ulib/gpt \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/bootdata \
     third_party/ulib/lz4 \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/port \
     system/ulib/acpisvc-client \
@@ -54,8 +54,8 @@
     system/ulib/async.default \
     system/ulib/fs-management \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
@@ -77,7 +77,7 @@
 MODULE_SRCS := \
 	$(LOCAL_DIR)/devhost-main.c
 
-MODULE_LIBS := system/ulib/driver system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/fdio system/ulib/c
 
 include make/module.mk
 
@@ -96,6 +96,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/port
 
-MODULE_LIBS := system/ulib/driver system/ulib/launchpad system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/launchpad system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/core/devmgr/vfs-boot.cpp b/system/core/devmgr/vfs-boot.cpp
index 41b6029..adcf6f2 100644
--- a/system/core/devmgr/vfs-boot.cpp
+++ b/system/core/devmgr/vfs-boot.cpp
@@ -10,9 +10,9 @@
 
 #include <ddk/device.h>
 #include <fs/vfs.h>
-#include <mxio/debug.h>
-#include <mxio/io.h>
-#include <mxio/vfs.h>
+#include <fdio/debug.h>
+#include <fdio/io.h>
+#include <fdio/vfs.h>
 #include <fbl/ref_ptr.h>
 #include <fbl/unique_ptr.h>
 
@@ -23,27 +23,27 @@
 
 namespace memfs {
 
-static mx_status_t add_file(fbl::RefPtr<VnodeDir> vnb, const char* path, mx_handle_t vmo,
-                            mx_off_t off, size_t len) {
-    mx_status_t r;
+static zx_status_t add_file(fbl::RefPtr<VnodeDir> vnb, const char* path, zx_handle_t vmo,
+                            zx_off_t off, size_t len) {
+    zx_status_t r;
     if ((path[0] == '/') || (path[0] == 0))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     for (;;) {
         const char* nextpath = strchr(path, '/');
         if (nextpath == nullptr) {
             if (path[0] == 0) {
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
             bool vmofile = true;
             return vnb->CreateFromVmo(vmofile, path, strlen(path), vmo, off, len);
         } else {
             if (nextpath == path) {
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
 
             fbl::RefPtr<fs::Vnode> out;
             r = vnb->Lookup(&out, path, nextpath - path);
-            if (r == MX_ERR_NOT_FOUND) {
+            if (r == ZX_ERR_NOT_FOUND) {
                 r = vnb->Create(&out, path, nextpath - path, S_IFDIR);
             }
 
@@ -61,10 +61,10 @@
 // The following functions exist outside the memfs namespace so they can
 // be exposed to C:
 
-mx_status_t bootfs_add_file(const char* path, mx_handle_t vmo, mx_off_t off, size_t len) {
+zx_status_t bootfs_add_file(const char* path, zx_handle_t vmo, zx_off_t off, size_t len) {
     return add_file(BootfsRoot(), path, vmo, off, len);
 }
 
-mx_status_t systemfs_add_file(const char* path, mx_handle_t vmo, mx_off_t off, size_t len) {
+zx_status_t systemfs_add_file(const char* path, zx_handle_t vmo, zx_off_t off, size_t len) {
     return add_file(SystemfsRoot(), path, vmo, off, len);
 }
diff --git a/system/core/devmgr/vfs-memory.cpp b/system/core/devmgr/vfs-memory.cpp
index bf1d1ea..5e82882 100644
--- a/system/core/devmgr/vfs-memory.cpp
+++ b/system/core/devmgr/vfs-memory.cpp
@@ -19,10 +19,10 @@
 #include <fbl/unique_ptr.h>
 #include <fs/async-dispatcher.h>
 #include <fs/vfs.h>
-#include <magenta/device/vfs.h>
-#include <magenta/thread_annotations.h>
-#include <mxio/debug.h>
-#include <mxio/vfs.h>
+#include <zircon/device/vfs.h>
+#include <zircon/thread_annotations.h>
+#include <fdio/debug.h>
+#include <fdio/vfs.h>
 
 #include "devmgr.h"
 #include "dnode.h"
@@ -47,11 +47,11 @@
 static fbl::RefPtr<VnodeDir> bootfs_root = nullptr;
 static fbl::RefPtr<VnodeDir> systemfs_root = nullptr;
 
-static bool WindowMatchesVMO(mx_handle_t vmo, mx_off_t offset, mx_off_t length) {
+static bool WindowMatchesVMO(zx_handle_t vmo, zx_off_t offset, zx_off_t length) {
     if (offset != 0)
         return false;
     uint64_t size;
-    if (mx_vmo_get_size(vmo, &size) < 0)
+    if (zx_vmo_get_size(vmo, &size) < 0)
         return false;
     return size == length;
 }
@@ -60,17 +60,17 @@
 
 VnodeMemfs::VnodeMemfs() : dnode_(nullptr), link_count_(0),
     ino_(ino_ctr_.fetch_add(1, fbl::memory_order_relaxed)) {
-    create_time_ = modify_time_ = mx_time_get(MX_CLOCK_UTC);
+    create_time_ = modify_time_ = zx_time_get(ZX_CLOCK_UTC);
 }
 VnodeMemfs::~VnodeMemfs() {
 }
 
-VnodeFile::VnodeFile() : vmo_(MX_HANDLE_INVALID), length_(0) {}
-VnodeFile::VnodeFile(mx_handle_t vmo, mx_off_t length) : vmo_(vmo), length_(length) {}
+VnodeFile::VnodeFile() : vmo_(ZX_HANDLE_INVALID), length_(0) {}
+VnodeFile::VnodeFile(zx_handle_t vmo, zx_off_t length) : vmo_(vmo), length_(length) {}
 
 VnodeFile::~VnodeFile() {
-    if (vmo_ != MX_HANDLE_INVALID) {
-        mx_handle_close(vmo_);
+    if (vmo_ != ZX_HANDLE_INVALID) {
+        zx_handle_close(vmo_);
     }
 }
 
@@ -79,63 +79,63 @@
 }
 VnodeDir::~VnodeDir() {}
 
-VnodeVmo::VnodeVmo(mx_handle_t vmo, mx_off_t offset, mx_off_t length) :
+VnodeVmo::VnodeVmo(zx_handle_t vmo, zx_off_t offset, zx_off_t length) :
     vmo_(vmo), offset_(offset), length_(length), have_local_clone_(false) {}
 VnodeVmo::~VnodeVmo() {
     if (have_local_clone_) {
-        mx_handle_close(vmo_);
+        zx_handle_close(vmo_);
     }
 }
 
-mx_status_t VnodeDir::Open(uint32_t flags) {
+zx_status_t VnodeDir::Open(uint32_t flags) {
     switch (flags & O_ACCMODE) {
     case O_WRONLY:
     case O_RDWR:
-        return MX_ERR_NOT_FILE;
+        return ZX_ERR_NOT_FILE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeFile::Open(uint32_t flags) {
+zx_status_t VnodeFile::Open(uint32_t flags) {
     if (flags & O_DIRECTORY) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeVmo::Open(uint32_t flags) {
+zx_status_t VnodeVmo::Open(uint32_t flags) {
     if (flags & O_DIRECTORY) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     }
     switch (flags & O_ACCMODE) {
     case O_WRONLY:
     case O_RDWR:
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeVmo::Serve(fs::Vfs* vfs, mx::channel channel, uint32_t flags) {
-    return MX_OK;
+zx_status_t VnodeVmo::Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) {
+    return ZX_OK;
 }
 
-mx_status_t VnodeVmo::GetHandles(uint32_t flags, mx_handle_t* hnds,
+zx_status_t VnodeVmo::GetHandles(uint32_t flags, zx_handle_t* hnds,
                                  uint32_t* type, void* extra, uint32_t* esize) {
-    mx_off_t* off = static_cast<mx_off_t*>(extra);
-    mx_off_t* len = off + 1;
-    mx_handle_t vmo;
-    mx_status_t status;
+    zx_off_t* off = static_cast<zx_off_t*>(extra);
+    zx_off_t* len = off + 1;
+    zx_handle_t vmo;
+    zx_status_t status;
     if (!have_local_clone_ && !WindowMatchesVMO(vmo_, offset_, length_)) {
-        status = mx_vmo_clone(vmo_, MX_VMO_CLONE_COPY_ON_WRITE, offset_, length_, &vmo_);
+        status = zx_vmo_clone(vmo_, ZX_VMO_CLONE_COPY_ON_WRITE, offset_, length_, &vmo_);
         if (status < 0)
             return status;
         offset_ = 0;
         have_local_clone_ = true;
     }
-    status = mx_handle_duplicate(
+    status = zx_handle_duplicate(
         vmo_,
-        MX_RIGHT_READ | MX_RIGHT_EXECUTE | MX_RIGHT_MAP |
-        MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_GET_PROPERTY,
+        ZX_RIGHT_READ | ZX_RIGHT_EXECUTE | ZX_RIGHT_MAP |
+        ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_GET_PROPERTY,
         &vmo);
     if (status < 0)
         return status;
@@ -144,21 +144,21 @@
     *off = offset_;
     *len = length_;
     hnds[0] = vmo;
-    *type = MXIO_PROTOCOL_VMOFILE;
-    *esize = sizeof(mx_off_t) * 2;
+    *type = FDIO_PROTOCOL_VMOFILE;
+    *esize = sizeof(zx_off_t) * 2;
     return 1;
 }
 
 ssize_t VnodeFile::Read(void* data, size_t len, size_t off) {
-    if ((off >= length_) || (vmo_ == MX_HANDLE_INVALID)) {
+    if ((off >= length_) || (vmo_ == ZX_HANDLE_INVALID)) {
         return 0;
     } else if (len > length_ - off) {
         len = length_ - off;
     }
 
     size_t actual;
-    mx_status_t status;
-    if ((status = mx_vmo_read(vmo_, data, off, len, &actual)) != MX_OK) {
+    zx_status_t status;
+    if ((status = zx_vmo_read(vmo_, data, off, len, &actual)) != ZX_OK) {
         return status;
     }
     return actual;
@@ -170,7 +170,7 @@
     size_t rlen = length_ - off;
     if (len > rlen)
         len = rlen;
-    mx_status_t r = mx_vmo_read(vmo_, data, offset_ + off, len, &len);
+    zx_status_t r = zx_vmo_read(vmo_, data, offset_ + off, len, &len);
     if (r < 0) {
         return r;
     }
@@ -178,25 +178,25 @@
 }
 
 ssize_t VnodeFile::Write(const void* data, size_t len, size_t off) {
-    mx_status_t status;
+    zx_status_t status;
     size_t newlen = off + len;
     newlen = newlen > kMemfsMaxFileSize ? kMemfsMaxFileSize : newlen;
     size_t alignedLen = fbl::roundup(newlen, static_cast<size_t>(PAGE_SIZE));
 
-    if (vmo_ == MX_HANDLE_INVALID) {
+    if (vmo_ == ZX_HANDLE_INVALID) {
         // First access to the file? Allocate it.
-        if ((status = mx_vmo_create(alignedLen, 0, &vmo_)) != MX_OK) {
+        if ((status = zx_vmo_create(alignedLen, 0, &vmo_)) != ZX_OK) {
             return status;
         }
     } else if (newlen > fbl::roundup(length_, static_cast<size_t>(PAGE_SIZE))) {
         // Accessing beyond the end of the file? Extend it.
-        if ((status = mx_vmo_set_size(vmo_, alignedLen)) != MX_OK) {
+        if ((status = zx_vmo_set_size(vmo_, alignedLen)) != ZX_OK) {
             return status;
         }
     }
 
     size_t actual;
-    if ((status = mx_vmo_write(vmo_, data, off, len, &actual)) != MX_OK) {
+    if ((status = zx_vmo_write(vmo_, data, off, len, &actual)) != ZX_OK) {
         return status;
     }
 
@@ -205,51 +205,51 @@
     }
     if (actual == 0 && off >= kMemfsMaxFileSize) {
         // short write because we're beyond the end of the permissible length
-        return MX_ERR_FILE_BIG;
+        return ZX_ERR_FILE_BIG;
     }
     UpdateModified();
     return actual;
 }
 
 
-mx_status_t VnodeFile::Mmap(int flags, size_t len, size_t* off, mx_handle_t* out) {
-    if (vmo_ == MX_HANDLE_INVALID) {
+zx_status_t VnodeFile::Mmap(int flags, size_t len, size_t* off, zx_handle_t* out) {
+    if (vmo_ == ZX_HANDLE_INVALID) {
         // First access to the file? Allocate it.
-        mx_status_t status;
-        if ((status = mx_vmo_create(0, 0, &vmo_)) != MX_OK) {
+        zx_status_t status;
+        if ((status = zx_vmo_create(0, 0, &vmo_)) != ZX_OK) {
             return status;
         }
     }
 
-    mx_rights_t rights = MX_RIGHT_TRANSFER | MX_RIGHT_MAP;
-    rights |= (flags & MXIO_MMAP_FLAG_READ) ? MX_RIGHT_READ : 0;
-    rights |= (flags & MXIO_MMAP_FLAG_WRITE) ? MX_RIGHT_WRITE : 0;
-    rights |= (flags & MXIO_MMAP_FLAG_EXEC) ? MX_RIGHT_EXECUTE : 0;
-    if (flags & MXIO_MMAP_FLAG_PRIVATE) {
-        return mx_vmo_clone(vmo_, MX_VMO_CLONE_COPY_ON_WRITE, 0, length_, out);
+    zx_rights_t rights = ZX_RIGHT_TRANSFER | ZX_RIGHT_MAP;
+    rights |= (flags & FDIO_MMAP_FLAG_READ) ? ZX_RIGHT_READ : 0;
+    rights |= (flags & FDIO_MMAP_FLAG_WRITE) ? ZX_RIGHT_WRITE : 0;
+    rights |= (flags & FDIO_MMAP_FLAG_EXEC) ? ZX_RIGHT_EXECUTE : 0;
+    if (flags & FDIO_MMAP_FLAG_PRIVATE) {
+        return zx_vmo_clone(vmo_, ZX_VMO_CLONE_COPY_ON_WRITE, 0, length_, out);
     }
 
-    return mx_handle_duplicate(vmo_, rights, out);
+    return zx_handle_duplicate(vmo_, rights, out);
 }
 
-mx_status_t VnodeDir::Mmap(int flags, size_t len, size_t* off, mx_handle_t* out) {
-    return MX_ERR_ACCESS_DENIED;
+zx_status_t VnodeDir::Mmap(int flags, size_t len, size_t* off, zx_handle_t* out) {
+    return ZX_ERR_ACCESS_DENIED;
 }
 
 bool VnodeDir::IsRemote() const { return remoter_.IsRemote(); }
-mx::channel VnodeDir::DetachRemote() { return remoter_.DetachRemote(flags_); }
-mx_handle_t VnodeDir::WaitForRemote() { return remoter_.WaitForRemote(flags_); }
-mx_handle_t VnodeDir::GetRemote() const { return remoter_.GetRemote(); }
-void VnodeDir::SetRemote(mx::channel remote) { return remoter_.SetRemote(fbl::move(remote)); }
+zx::channel VnodeDir::DetachRemote() { return remoter_.DetachRemote(flags_); }
+zx_handle_t VnodeDir::WaitForRemote() { return remoter_.WaitForRemote(flags_); }
+zx_handle_t VnodeDir::GetRemote() const { return remoter_.GetRemote(); }
+void VnodeDir::SetRemote(zx::channel remote) { return remoter_.SetRemote(fbl::move(remote)); }
 
-mx_status_t VnodeDir::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
+zx_status_t VnodeDir::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
     if (!IsDirectory()) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     fbl::RefPtr<Dnode> dn;
-    mx_status_t r = dnode_->Lookup(name, len, &dn);
-    MX_DEBUG_ASSERT(r <= 0);
-    if (r == MX_OK) {
+    zx_status_t r = dnode_->Lookup(name, len, &dn);
+    ZX_DEBUG_ASSERT(r <= 0);
+    if (r == ZX_OK) {
         if (dn == nullptr) {
             // Looking up our own vnode
             *out = fbl::RefPtr<VnodeDir>(this);
@@ -263,7 +263,7 @@
 
 constexpr uint64_t kMemfsBlksize = PAGE_SIZE;
 
-mx_status_t VnodeFile::Getattr(vnattr_t* attr) {
+zx_status_t VnodeFile::Getattr(vnattr_t* attr) {
     memset(attr, 0, sizeof(vnattr_t));
     attr->inode = ino_;
     attr->mode = V_TYPE_FILE | V_IRUSR | V_IWUSR | V_IRGRP | V_IROTH;
@@ -273,10 +273,10 @@
     attr->nlink = link_count_;
     attr->create_time = create_time_;
     attr->modify_time = modify_time_;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeDir::Getattr(vnattr_t* attr) {
+zx_status_t VnodeDir::Getattr(vnattr_t* attr) {
     memset(attr, 0, sizeof(vnattr_t));
     attr->inode = ino_;
     attr->mode = V_TYPE_DIR | V_IRUSR;
@@ -286,10 +286,10 @@
     attr->nlink = link_count_;
     attr->create_time = create_time_;
     attr->modify_time = modify_time_;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeVmo::Getattr(vnattr_t* attr) {
+zx_status_t VnodeVmo::Getattr(vnattr_t* attr) {
     memset(attr, 0, sizeof(vnattr_t));
     attr->inode = ino_;
     attr->mode = V_TYPE_FILE | V_IRUSR;
@@ -299,21 +299,21 @@
     attr->nlink = link_count_;
     attr->create_time = create_time_;
     attr->modify_time = modify_time_;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMemfs::Setattr(vnattr_t* attr) {
+zx_status_t VnodeMemfs::Setattr(vnattr_t* attr) {
     if ((attr->valid & ~(ATTR_MTIME)) != 0) {
         // only attr currently supported
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (attr->valid & ATTR_MTIME) {
         modify_time_ = attr->modify_time;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeDir::Readdir(void* cookie, void* data, size_t len) {
+zx_status_t VnodeDir::Readdir(void* cookie, void* data, size_t len) {
     fs::DirentFiller df(data, len);
     if (!IsDirectory()) {
         // This WAS a directory, but it has been deleted.
@@ -325,9 +325,9 @@
 }
 
 // postcondition: reference taken on vn returned through "out"
-mx_status_t VnodeDir::Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len, uint32_t mode) {
-    mx_status_t status;
-    if ((status = CanCreate(name, len)) != MX_OK) {
+zx_status_t VnodeDir::Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len, uint32_t mode) {
+    zx_status_t status;
+    if ((status = CanCreate(name, len)) != ZX_OK) {
         return status;
     }
 
@@ -340,51 +340,51 @@
     }
 
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    if ((status = AttachVnode(vn, name, len, S_ISDIR(mode))) != MX_OK) {
+    if ((status = AttachVnode(vn, name, len, S_ISDIR(mode))) != ZX_OK) {
         return status;
     }
     *out = fbl::move(vn);
     return status;
 }
 
-mx_status_t VnodeDir::Unlink(const char* name, size_t len, bool must_be_dir) {
+zx_status_t VnodeDir::Unlink(const char* name, size_t len, bool must_be_dir) {
     xprintf("memfs_unlink(%p,'%.*s')\n", this, (int)len, name);
     if (!IsDirectory()) {
         // Calling unlink from unlinked, empty directory
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     fbl::RefPtr<Dnode> dn;
-    mx_status_t r;
-    if ((r = dnode_->Lookup(name, len, &dn)) != MX_OK) {
+    zx_status_t r;
+    if ((r = dnode_->Lookup(name, len, &dn)) != ZX_OK) {
         return r;
     } else if (dn == nullptr) {
         // Cannot unlink directory 'foo' using the argument 'foo/.'
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     } else if (!dn->IsDirectory() && must_be_dir) {
         // Path ending in "/" was requested, implying that the dnode must be a directory
-        return MX_ERR_NOT_DIR;
-    } else if ((r = dn->CanUnlink()) != MX_OK) {
+        return ZX_ERR_NOT_DIR;
+    } else if ((r = dn->CanUnlink()) != ZX_OK) {
         return r;
     }
 
     dn->Detach();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeFile::Truncate(size_t len) {
-    mx_status_t status;
+zx_status_t VnodeFile::Truncate(size_t len) {
+    zx_status_t status;
     if (len > kMemfsMaxFileSize) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     size_t alignedLen = fbl::roundup(len, static_cast<size_t>(PAGE_SIZE));
 
-    if (vmo_ == MX_HANDLE_INVALID) {
+    if (vmo_ == ZX_HANDLE_INVALID) {
         // First access to the file? Allocate it.
-        if ((status = mx_vmo_create(alignedLen, 0, &vmo_)) != MX_OK) {
+        if ((status = zx_vmo_create(alignedLen, 0, &vmo_)) != ZX_OK) {
             return status;
         }
     } else if ((len < length_) && (len % PAGE_SIZE != 0)) {
@@ -397,65 +397,65 @@
         ppage_size = len + ppage_size < length_ ? ppage_size : length_ - len;
         memset(buf, 0, ppage_size);
         size_t actual;
-        status = mx_vmo_write(vmo_, buf, len, ppage_size, &actual);
-        if ((status != MX_OK) || (actual != ppage_size)) {
-            return status != MX_OK ? MX_ERR_IO : status;
-        } else if ((status = mx_vmo_set_size(vmo_, alignedLen)) != MX_OK) {
+        status = zx_vmo_write(vmo_, buf, len, ppage_size, &actual);
+        if ((status != ZX_OK) || (actual != ppage_size)) {
+            return status != ZX_OK ? ZX_ERR_IO : status;
+        } else if ((status = zx_vmo_set_size(vmo_, alignedLen)) != ZX_OK) {
             return status;
         }
-    } else if ((status = mx_vmo_set_size(vmo_, alignedLen)) != MX_OK) {
+    } else if ((status = zx_vmo_set_size(vmo_, alignedLen)) != ZX_OK) {
         return status;
     }
 
     length_ = len;
-    modify_time_ = mx_time_get(MX_CLOCK_UTC);
-    return MX_OK;
+    modify_time_ = zx_time_get(ZX_CLOCK_UTC);
+    return ZX_OK;
 }
 
-mx_status_t VnodeDir::Rename(fbl::RefPtr<fs::Vnode> _newdir, const char* oldname, size_t oldlen,
+zx_status_t VnodeDir::Rename(fbl::RefPtr<fs::Vnode> _newdir, const char* oldname, size_t oldlen,
                              const char* newname, size_t newlen, bool src_must_be_dir,
                              bool dst_must_be_dir) {
     auto newdir = fbl::RefPtr<VnodeMemfs>::Downcast(fbl::move(_newdir));
 
     if (!IsDirectory() || !newdir->IsDirectory())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     fbl::RefPtr<Dnode> olddn;
-    mx_status_t r;
+    zx_status_t r;
     // The source must exist
-    if ((r = dnode_->Lookup(oldname, oldlen, &olddn)) != MX_OK) {
+    if ((r = dnode_->Lookup(oldname, oldlen, &olddn)) != ZX_OK) {
         return r;
     }
-    MX_DEBUG_ASSERT(olddn != nullptr);
+    ZX_DEBUG_ASSERT(olddn != nullptr);
 
     if (!olddn->IsDirectory() && (src_must_be_dir || dst_must_be_dir)) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     }
 
     // Verify that the destination is not a subdirectory of the source (if
     // both are directories).
     if (olddn->IsSubdirectory(newdir->dnode_)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // The destination may or may not exist
     fbl::RefPtr<Dnode> targetdn;
     r = newdir->dnode_->Lookup(newname, newlen, &targetdn);
-    bool target_exists = (r == MX_OK);
+    bool target_exists = (r == ZX_OK);
     if (target_exists) {
-        MX_DEBUG_ASSERT(targetdn != nullptr);
+        ZX_DEBUG_ASSERT(targetdn != nullptr);
         // The target exists. Validate and unlink it.
         if (olddn == targetdn) {
             // Cannot rename node to itself
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (olddn->IsDirectory() != targetdn->IsDirectory()) {
             // Cannot rename files to directories (and vice versa)
-            return MX_ERR_INVALID_ARGS;
-        } else if ((r = targetdn->CanUnlink()) != MX_OK) {
+            return ZX_ERR_INVALID_ARGS;
+        } else if ((r = targetdn->CanUnlink()) != ZX_OK) {
             return r;
         }
-    } else if (r != MX_ERR_NOT_FOUND) {
+    } else if (r != ZX_ERR_NOT_FOUND) {
         return r;
     }
 
@@ -470,7 +470,7 @@
         fbl::AllocChecker ac;
         namebuffer.reset(new (&ac) char[newlen + 1]);
         if (!ac.check()) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         memcpy(namebuffer.get(), newname, newlen);
         namebuffer[newlen] = '\0';
@@ -484,43 +484,43 @@
     olddn->RemoveFromParent();
     olddn->PutName(fbl::move(namebuffer), newlen);
     Dnode::AddChild(newdir->dnode_, fbl::move(olddn));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeDir::Link(const char* name, size_t len, fbl::RefPtr<fs::Vnode> target) {
+zx_status_t VnodeDir::Link(const char* name, size_t len, fbl::RefPtr<fs::Vnode> target) {
     auto vn = fbl::RefPtr<VnodeMemfs>::Downcast(fbl::move(target));
 
     if (!IsDirectory()) {
         // Empty, unlinked parent
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (vn->IsDirectory()) {
         // The target must not be a directory
-        return MX_ERR_NOT_FILE;
+        return ZX_ERR_NOT_FILE;
     }
 
-    if (dnode_->Lookup(name, len, nullptr) == MX_OK) {
+    if (dnode_->Lookup(name, len, nullptr) == ZX_OK) {
         // The destination should not exist
-        return MX_ERR_ALREADY_EXISTS;
+        return ZX_ERR_ALREADY_EXISTS;
     }
 
     // Make a new dnode for the new name, attach the target vnode to it
     fbl::RefPtr<Dnode> targetdn;
     if ((targetdn = Dnode::Create(name, len, vn)) == nullptr) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // Attach the new dnode to its parent
     Dnode::AddChild(dnode_, fbl::move(targetdn));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMemfs::Sync() {
+zx_status_t VnodeMemfs::Sync() {
     // Since this filesystem is in-memory, all data is already up-to-date in
     // the underlying storage
-    return MX_OK;
+    return ZX_OK;
 }
 
 constexpr const char kFsName[] = "memfs";
@@ -529,15 +529,15 @@
                           void* out_buf, size_t out_len) {
     switch (op) {
     case IOCTL_VFS_MOUNT_BOOTFS_VMO: {
-        if (in_len < sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
+        if (in_len < sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        const mx_handle_t* vmo = static_cast<const mx_handle_t*>(in_buf);
+        const zx_handle_t* vmo = static_cast<const zx_handle_t*>(in_buf);
         return devmgr_add_systemfs_vmo(*vmo);
     }
     case IOCTL_VFS_QUERY_FS: {
         if (out_len < sizeof(vfs_query_info_t) + strlen(kFsName)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         vfs_query_info_t* info = static_cast<vfs_query_info_t*>(out_buf);
@@ -550,7 +550,7 @@
         return sizeof(vfs_query_info_t) + strlen(kFsName);
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -563,22 +563,22 @@
         const char* name = config->name;
         if (in_len <= sizeof(vmo_create_config_t) || (namelen > NAME_MAX) ||
             (name[namelen] != 0)) {
-            mx_handle_close(config->vmo);
-            return MX_ERR_INVALID_ARGS;
+            zx_handle_close(config->vmo);
+            return ZX_ERR_INVALID_ARGS;
         }
 
         // Ensure this is the last handle to this VMO; otherwise, the size
         // may change from underneath us.
-        mx_signals_t observed;
-        mx_status_t status = mx_object_wait_one(config->vmo, MX_SIGNAL_LAST_HANDLE, 0u, &observed);
-        if ((status != MX_OK) || (observed != MX_SIGNAL_LAST_HANDLE)) {
-            mx_handle_close(config->vmo);
-            return MX_ERR_INVALID_ARGS;
+        zx_signals_t observed;
+        zx_status_t status = zx_object_wait_one(config->vmo, ZX_SIGNAL_LAST_HANDLE, 0u, &observed);
+        if ((status != ZX_OK) || (observed != ZX_SIGNAL_LAST_HANDLE)) {
+            zx_handle_close(config->vmo);
+            return ZX_ERR_INVALID_ARGS;
         }
 
         uint64_t size;
-        if ((status = mx_vmo_get_size(config->vmo, &size)) != MX_OK) {
-            mx_handle_close(config->vmo);
+        if ((status = zx_vmo_get_size(config->vmo, &size)) != ZX_OK) {
+            zx_handle_close(config->vmo);
             return status;
         }
 
@@ -590,42 +590,42 @@
     }
 }
 
-mx_status_t VnodeMemfs::AttachRemote(fs::MountChannel h) {
+zx_status_t VnodeMemfs::AttachRemote(fs::MountChannel h) {
     if (!IsDirectory()) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     } else if (IsRemote()) {
-        return MX_ERR_ALREADY_BOUND;
+        return ZX_ERR_ALREADY_BOUND;
     }
     SetRemote(fbl::move(h.TakeChannel()));
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t memfs_create_fs(const char* name, fbl::RefPtr<VnodeDir>* out) {
+static zx_status_t memfs_create_fs(const char* name, fbl::RefPtr<VnodeDir>* out) {
     fbl::AllocChecker ac;
     fbl::RefPtr<VnodeDir> fs = fbl::AdoptRef(new (&ac) VnodeDir());
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     fbl::RefPtr<Dnode> dn = Dnode::Create(name, strlen(name), fs);
     if (dn == nullptr) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     fs->dnode_ = dn; // FS root is directory
     *out = fs;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void memfs_mount_locked(fbl::RefPtr<VnodeDir> parent, fbl::RefPtr<VnodeDir> subtree) {
     Dnode::AddChild(parent->dnode_, subtree->dnode_);
 }
 
-mx_status_t VnodeDir::CreateFromVmo(bool vmofile, const char* name, size_t namelen,
-                                    mx_handle_t vmo, mx_off_t off, mx_off_t len) {
+zx_status_t VnodeDir::CreateFromVmo(bool vmofile, const char* name, size_t namelen,
+                                    zx_handle_t vmo, zx_off_t off, zx_off_t len) {
     fbl::AutoLock lock(&memfs::vfs.vfs_lock_);
-    mx_status_t status;
-    if ((status = CanCreate(name, namelen)) != MX_OK) {
+    zx_status_t status;
+    if ((status = CanCreate(name, namelen)) != ZX_OK) {
         return status;
     }
 
@@ -637,34 +637,34 @@
         vn = fbl::AdoptRef(new (&ac) VnodeFile(vmo, len));
     }
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    if ((status = AttachVnode(fbl::move(vn), name, namelen, false)) != MX_OK) {
+    if ((status = AttachVnode(fbl::move(vn), name, namelen, false)) != ZX_OK) {
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeDir::CanCreate(const char* name, size_t namelen) const {
+zx_status_t VnodeDir::CanCreate(const char* name, size_t namelen) const {
     if (!IsDirectory()) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    mx_status_t status;
-    if ((status = dnode_->Lookup(name, namelen, nullptr)) == MX_ERR_NOT_FOUND) {
-        return MX_OK;
-    } else if (status == MX_OK) {
-        return MX_ERR_ALREADY_EXISTS;
+    zx_status_t status;
+    if ((status = dnode_->Lookup(name, namelen, nullptr)) == ZX_ERR_NOT_FOUND) {
+        return ZX_OK;
+    } else if (status == ZX_OK) {
+        return ZX_ERR_ALREADY_EXISTS;
     }
     return status;
 }
 
-mx_status_t VnodeDir::AttachVnode(fbl::RefPtr<VnodeMemfs> vn, const char* name, size_t namelen,
+zx_status_t VnodeDir::AttachVnode(fbl::RefPtr<VnodeMemfs> vn, const char* name, size_t namelen,
                                   bool isdir) {
     // dnode takes a reference to the vnode
     fbl::RefPtr<Dnode> dn;
     if ((dn = Dnode::Create(name, namelen, vn)) == nullptr) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // Identify that the vnode is a directory (vn->dnode_ != nullptr) so that
@@ -676,7 +676,7 @@
 
     // parent takes first reference
     Dnode::AddChild(dnode_, fbl::move(dn));
-    return MX_OK;
+    return ZX_OK;
 }
 
 } // namespace memfs
@@ -688,8 +688,8 @@
 // Should be called exclusively during initialization stages of filesystem,
 // when it cannot be externally manipulated.
 // postcondition: new vnode linked into namespace
-static mx_status_t memfs_create_directory_unsafe(const char* path, uint32_t flags) __TA_NO_THREAD_SAFETY_ANALYSIS {
-    mx_status_t r;
+static zx_status_t memfs_create_directory_unsafe(const char* path, uint32_t flags) __TA_NO_THREAD_SAFETY_ANALYSIS {
+    zx_status_t r;
     const char* pathout;
     fbl::RefPtr<fs::Vnode> parent_vn;
     if ((r = memfs::vfs.Walk(memfs::vfs_root, &parent_vn, path, &pathout)) < 0) {
@@ -699,7 +699,7 @@
             fbl::RefPtr<memfs::VnodeDir>::Downcast(fbl::move(parent_vn));
 
     if (strcmp(pathout, "") == 0) {
-        return MX_ERR_ALREADY_EXISTS;
+        return ZX_ERR_ALREADY_EXISTS;
     }
 
     fbl::RefPtr<fs::Vnode> out;
@@ -712,7 +712,7 @@
 
 fbl::RefPtr<memfs::VnodeDir> SystemfsRoot() {
     if (memfs::systemfs_root == nullptr) {
-        mx_status_t r = memfs_create_fs("system", &memfs::systemfs_root);
+        zx_status_t r = memfs_create_fs("system", &memfs::systemfs_root);
         if (r < 0) {
             printf("fatal error %d allocating 'system' file system\n", r);
             panic();
@@ -723,7 +723,7 @@
 
 fbl::RefPtr<memfs::VnodeDir> MemfsRoot() {
     if (memfs::memfs_root == nullptr) {
-        mx_status_t r = memfs_create_fs("tmp", &memfs::memfs_root);
+        zx_status_t r = memfs_create_fs("tmp", &memfs::memfs_root);
         if (r < 0) {
             printf("fatal error %d allocating 'tmp' file system\n", r);
             panic();
@@ -734,7 +734,7 @@
 
 fbl::RefPtr<memfs::VnodeDir> DevfsRoot() {
     if (memfs::devfs_root == nullptr) {
-        mx_status_t r = memfs_create_fs("dev", &memfs::devfs_root);
+        zx_status_t r = memfs_create_fs("dev", &memfs::devfs_root);
         if (r < 0) {
             printf("fatal error %d allocating 'device' file system\n", r);
             panic();
@@ -745,7 +745,7 @@
 
 fbl::RefPtr<memfs::VnodeDir> BootfsRoot() {
     if (memfs::bootfs_root == nullptr) {
-        mx_status_t r = memfs_create_fs("boot", &memfs::bootfs_root);
+        zx_status_t r = memfs_create_fs("boot", &memfs::bootfs_root);
         if (r < 0) {
             printf("fatal error %d allocating 'boot' file system\n", r);
             panic();
@@ -754,7 +754,7 @@
     return memfs::bootfs_root;
 }
 
-mx_status_t devfs_mount(mx_handle_t h) {
+zx_status_t devfs_mount(zx_handle_t h) {
     return DevfsRoot()->AttachRemote(fs::MountChannel(h));
 }
 
@@ -765,7 +765,7 @@
 // Hardcoded initialization function to create/access global root directory
 VnodeDir* vfs_create_global_root() {
     if (memfs::vfs_root == nullptr) {
-        mx_status_t r = memfs_create_fs("<root>", &memfs::vfs_root);
+        zx_status_t r = memfs_create_fs("<root>", &memfs::vfs_root);
         if (r < 0) {
             printf("fatal error %d allocating root file system\n", r);
             panic();
@@ -788,7 +788,7 @@
 }
 
 void devmgr_vfs_exit() {
-    memfs::vfs.UninstallAll(mx_deadline_after(MX_SEC(5)));
+    memfs::vfs.UninstallAll(zx_deadline_after(ZX_SEC(5)));
 }
 
 void memfs_mount(memfs::VnodeDir* parent, memfs::VnodeDir* subtree) {
@@ -797,20 +797,20 @@
 }
 
 // Acquire the root vnode and return a handle to it through the VFS dispatcher
-mx_handle_t vfs_create_root_handle(VnodeMemfs* vn) {
-    mx_status_t r;
-    mx::channel h1, h2;
-    if ((r = mx::channel::create(0, &h1, &h2)) != MX_OK) {
+zx_handle_t vfs_create_root_handle(VnodeMemfs* vn) {
+    zx_status_t r;
+    zx::channel h1, h2;
+    if ((r = zx::channel::create(0, &h1, &h2)) != ZX_OK) {
         return r;
     }
     if ((r = memfs::vfs.ServeDirectory(fbl::RefPtr<fs::Vnode>(vn),
-                                       fbl::move(h1))) != MX_OK) {
+                                       fbl::move(h1))) != ZX_OK) {
         return r;
     }
     return h2.release();
 }
 
-mx_status_t vfs_connect_root_handle(VnodeMemfs* vn, mx_handle_t h) {
-    mx::channel ch(h);
+zx_status_t vfs_connect_root_handle(VnodeMemfs* vn, zx_handle_t h) {
+    zx::channel ch(h);
     return memfs::vfs.ServeDirectory(fbl::RefPtr<fs::Vnode>(vn), fbl::move(ch));
 }
\ No newline at end of file
diff --git a/system/core/devmgr/vfs-rpc.cpp b/system/core/devmgr/vfs-rpc.cpp
index 21b58fb..dded4aa 100644
--- a/system/core/devmgr/vfs-rpc.cpp
+++ b/system/core/devmgr/vfs-rpc.cpp
@@ -9,14 +9,14 @@
 #include <threads.h>
 
 #include <fs/vfs.h>
-#include <magenta/device/device.h>
-#include <magenta/device/vfs.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/thread_annotations.h>
-#include <mxio/debug.h>
-#include <mxio/io.h>
-#include <mxio/remoteio.h>
+#include <zircon/device/device.h>
+#include <zircon/device/vfs.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/thread_annotations.h>
+#include <fdio/debug.h>
+#include <fdio/io.h>
+#include <fdio/remoteio.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 #include <fbl/unique_ptr.h>
@@ -32,8 +32,8 @@
 static VnodeMemfs* global_vfs_root;
 
 void VnodeDir::Notify(const char* name, size_t len, unsigned event) { watcher_.Notify(name, len, event); }
-mx_status_t VnodeDir::WatchDir(mx::channel* out) { return watcher_.WatchDir(out); }
-mx_status_t VnodeDir::WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) {
+zx_status_t VnodeDir::WatchDir(zx::channel* out) { return watcher_.WatchDir(out); }
+zx_status_t VnodeDir::WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) {
     return watcher_.WatchDirV2(vfs, this, cmd);
 }
 
@@ -48,10 +48,10 @@
 }
 
 // Return a RIO handle to the global root
-mx_handle_t vfs_create_global_root_handle() {
+zx_handle_t vfs_create_global_root_handle() {
     return vfs_create_root_handle(memfs::global_vfs_root);
 }
 
-mx_status_t vfs_connect_global_root_handle(mx_handle_t h) {
+zx_status_t vfs_connect_global_root_handle(zx_handle_t h) {
     return vfs_connect_root_handle(memfs::global_vfs_root, h);
 }
\ No newline at end of file
diff --git a/system/core/netsvc/debuglog.c b/system/core/netsvc/debuglog.c
index 55b3d93..81c59c8 100644
--- a/system/core/netsvc/debuglog.c
+++ b/system/core/netsvc/debuglog.c
@@ -5,32 +5,32 @@
 #include <inttypes.h>
 #include <string.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
 
 #include "netsvc.h"
 
-#define MAX_LOG_LINE (MX_LOG_RECORD_MAX + 32)
+#define MAX_LOG_LINE (ZX_LOG_RECORD_MAX + 32)
 
-static mx_handle_t loghandle;
+static zx_handle_t loghandle;
 static logpacket_t pkt;
 static int pkt_len;
 
 static volatile uint32_t seqno = 1;
 static volatile uint32_t pending = 0;
 
-mx_time_t debuglog_next_timeout = MX_TIME_INFINITE;
+zx_time_t debuglog_next_timeout = ZX_TIME_INFINITE;
 
 static int get_log_line(char* out) {
-    char buf[MX_LOG_RECORD_MAX + 1];
-    mx_log_record_t* rec = (mx_log_record_t*)buf;
+    char buf[ZX_LOG_RECORD_MAX + 1];
+    zx_log_record_t* rec = (zx_log_record_t*)buf;
     for (;;) {
-        if (mx_log_read(loghandle, MX_LOG_RECORD_MAX, rec, 0) > 0) {
+        if (zx_log_read(loghandle, ZX_LOG_RECORD_MAX, rec, 0) > 0) {
             if (rec->datalen && (rec->data[rec->datalen - 1] == '\n')) {
                 rec->datalen--;
             }
             // records flagged for local display are ignored
-            if (rec->flags & MX_LOG_LOCAL) {
+            if (rec->flags & ZX_LOG_LOCAL) {
                 continue;
             }
             rec->data[rec->datalen] = 0;
@@ -46,12 +46,12 @@
 }
 
 int debuglog_init(void) {
-    if (mx_log_create(MX_LOG_FLAG_READABLE, &loghandle) < 0) {
+    if (zx_log_create(ZX_LOG_FLAG_READABLE, &loghandle) < 0) {
         return -1;
     }
 
     // Set up our timeout to expire immediately, so that we check for pending log messages
-    debuglog_next_timeout = mx_time_get(MX_CLOCK_MONOTONIC);
+    debuglog_next_timeout = zx_time_get(ZX_CLOCK_MONOTONIC);
 
     seqno = 1;
     pending = 0;
@@ -85,7 +85,7 @@
     }
     udp6_send(&pkt, pkt_len, &ip6_ll_all_nodes, DEBUGLOG_PORT, DEBUGLOG_ACK_PORT);
 done:
-    debuglog_next_timeout = mx_deadline_after(MX_MSEC(100));
+    debuglog_next_timeout = zx_deadline_after(ZX_MSEC(100));
 }
 
 void debuglog_recv(void* data, size_t len, bool is_mcast) {
diff --git a/system/core/netsvc/netboot.c b/system/core/netsvc/netboot.c
index 86b1e49..c9ca413 100644
--- a/system/core/netsvc/netboot.c
+++ b/system/core/netsvc/netboot.c
@@ -17,11 +17,11 @@
 #include <inet6/netifc.h>
 
 #include <launchpad/launchpad.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 static uint32_t last_cookie = 0;
 static uint32_t last_cmd = 0;
@@ -36,7 +36,7 @@
 
 typedef struct nbfilecontainer {
     nbfile file;
-    mx_handle_t data;   // handle to vmo that backs netbootfile.
+    zx_handle_t data;   // handle to vmo that backs netbootfile.
 } nbfilecontainer_t;
 
 static nbfilecontainer_t nbkernel;
@@ -46,8 +46,8 @@
 // Pointer to the currently active transfer.
 static nbfile* active;
 
-mx_status_t nbfilecontainer_init(size_t size, nbfilecontainer_t* target) {
-    mx_status_t st = MX_OK;
+zx_status_t nbfilecontainer_init(size_t size, nbfilecontainer_t* target) {
+    zx_status_t st = ZX_OK;
 
     assert(target);
 
@@ -60,32 +60,32 @@
         printf("netbootloader: warning, reusing a previously initialized container\n");
 
         // Unmap the vmo from the address space.
-        st = mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)target->file.data, target->file.size);
-        if (st != MX_OK) {
+        st = zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)target->file.data, target->file.size);
+        if (st != ZX_OK) {
             printf("netbootloader: failed to unmap existing vmo, st = %d\n", st);
             return st;
         }
 
-        mx_handle_close(target->data);
+        zx_handle_close(target->data);
 
         target->file.offset = 0;
         target->file.size = 0;
         target->file.data = 0;
     }
 
-    st = mx_vmo_create(size, 0, &target->data);
-    if (st != MX_OK) {
+    st = zx_vmo_create(size, 0, &target->data);
+    if (st != ZX_OK) {
         printf("netbootloader: Could not create a netboot vmo of size = %lu "
                "retcode = %d\n", size, st);
         return st;
     }
 
     uintptr_t buffer;
-    st = mx_vmar_map(mx_vmar_root_self(), 0, target->data, 0, size,
-                     MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &buffer);
-    if (st != MX_OK) {
+    st = zx_vmar_map(zx_vmar_root_self(), 0, target->data, 0, size,
+                     ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &buffer);
+    if (st != ZX_OK) {
         printf("netbootloader: failed to map data vmo for buffer, st = %d\n", st);
-        mx_handle_close(target->data);
+        zx_handle_close(target->data);
         return st;
     }
 
@@ -93,11 +93,11 @@
     target->file.size = size;
     target->file.data = (uint8_t*)buffer;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 nbfile* netboot_get_buffer(const char* name, size_t size) {
-    mx_status_t st = MX_OK;
+    zx_status_t st = ZX_OK;
     nbfilecontainer_t* result;
 
     if (!strcmp(name, NB_KERNEL_FILENAME)) {
@@ -111,7 +111,7 @@
     }
 
     st = nbfilecontainer_init(size, result);
-    if (st != MX_OK) {
+    if (st != ZX_OK) {
         printf("netbootloader: failed to initialize file container for "
                "file = '%s', retcode = %d\n", name, st);
         return NULL;
@@ -320,7 +320,7 @@
     }
 
     if (do_boot) {
-        mx_system_mexec(nbkernel.data, nbbootdata.data, (char*)nbcmdline.file.data,
+        zx_system_mexec(nbkernel.data, nbbootdata.data, (char*)nbcmdline.file.data,
                         nbcmdline.file.size);
     }
 }
diff --git a/system/core/netsvc/netfile.c b/system/core/netsvc/netfile.c
index 051772d..60cc008 100644
--- a/system/core/netsvc/netfile.c
+++ b/system/core/netsvc/netfile.c
@@ -15,11 +15,11 @@
 #include <inet6/inet6.h>
 #include <inet6/netifc.h>
 
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 #include <launchpad/launchpad.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 #define TMP_SUFFIX ".netsvc.tmp"
 
diff --git a/system/core/netsvc/netsvc.c b/system/core/netsvc/netsvc.c
index f6fedae..44a19c3 100644
--- a/system/core/netsvc/netsvc.c
+++ b/system/core/netsvc/netsvc.c
@@ -14,13 +14,13 @@
 #include <inet6/netifc.h>
 
 #include <launchpad/launchpad.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
-#include <mxio/io.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
+#include <fdio/io.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 #include "device_id.h"
 
@@ -28,20 +28,20 @@
 
 bool netbootloader = false;
 
-static void run_program(const char *progname, int argc, const char** argv, mx_handle_t h) {
+static void run_program(const char *progname, int argc, const char** argv, zx_handle_t h) {
 
     launchpad_t* lp;
     launchpad_create(0, progname, &lp);
-    launchpad_clone(lp, LP_CLONE_ALL & (~LP_CLONE_MXIO_STDIO));
+    launchpad_clone(lp, LP_CLONE_ALL & (~LP_CLONE_FDIO_STDIO));
     launchpad_load_from_file(lp, argv[0]);
     launchpad_set_args(lp, argc, argv);
-    mx_handle_t handle = MX_HANDLE_INVALID;
-    mx_log_create(0, &handle);
-    launchpad_add_handle(lp, handle, PA_HND(PA_MXIO_LOGGER, 0 | MXIO_FLAG_USE_FOR_STDIO));
-    if (h != MX_HANDLE_INVALID) {
+    zx_handle_t handle = ZX_HANDLE_INVALID;
+    zx_log_create(0, &handle);
+    launchpad_add_handle(lp, handle, PA_HND(PA_FDIO_LOGGER, 0 | FDIO_FLAG_USE_FOR_STDIO));
+    if (h != ZX_HANDLE_INVALID) {
         launchpad_add_handle(lp, h, PA_HND(PA_USER0, 0));
     }
-    mx_status_t status;
+    zx_status_t status;
     const char* errmsg;
     if ((status = launchpad_go(lp, NULL, &errmsg)) < 0) {
         printf("netsvc: cannot launch %s: %d: %s\n", argv[0], status, errmsg);
@@ -56,11 +56,11 @@
     run_program("net:sh", 3, args, 0);
 }
 
-static void run_server(const char* progname, const char* bin, mx_handle_t h) {
+static void run_server(const char* progname, const char* bin, zx_handle_t h) {
     run_program(progname, 1, &bin, h);
 }
 
-const char* nodename = "magenta";
+const char* nodename = "zircon";
 
 void udp6_recv(void* data, size_t len,
                const ip6_addr_t* daddr, uint16_t dport,
@@ -140,16 +140,16 @@
             if (netbootloader)
                 netboot_advertise(nodename);
 
-            mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
-            mx_time_t next_timeout = (debuglog_next_timeout < tftp_next_timeout) ?
+            zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
+            zx_time_t next_timeout = (debuglog_next_timeout < tftp_next_timeout) ?
                                      debuglog_next_timeout : tftp_next_timeout;
-            if (next_timeout != MX_TIME_INFINITE) {
+            if (next_timeout != ZX_TIME_INFINITE) {
                 netifc_set_timer((next_timeout < now) ? 0 :
-                                 ((next_timeout - now)/MX_MSEC(1)));
+                                 ((next_timeout - now)/ZX_MSEC(1)));
             }
             if (netifc_poll())
                 break;
-            now = mx_time_get(MX_CLOCK_MONOTONIC);
+            now = zx_time_get(ZX_CLOCK_MONOTONIC);
             if (now > debuglog_next_timeout) {
                 debuglog_timeout_expired();
             }
diff --git a/system/core/netsvc/netsvc.h b/system/core/netsvc/netsvc.h
index c7f3580..d075c6e 100644
--- a/system/core/netsvc/netsvc.h
+++ b/system/core/netsvc/netsvc.h
@@ -9,8 +9,8 @@
 
 #include <inet6/inet6.h>
 
-#include <magenta/types.h>
-#include <magenta/boot/netboot.h>
+#include <zircon/types.h>
+#include <zircon/boot/netboot.h>
 
 // netfile interface
 typedef struct netfile_state_t {
@@ -56,7 +56,7 @@
 void netboot_run_cmd(const char* cmd);
 
 // TFTP interface
-extern mx_time_t tftp_next_timeout;
+extern zx_time_t tftp_next_timeout;
 
 void tftp_recv(void *data, size_t len,
                const ip6_addr_t* daddr, uint16_t dport,
@@ -65,7 +65,7 @@
 void tftp_timeout_expired(void);
 
 // debuglog interface
-extern mx_time_t debuglog_next_timeout;
+extern zx_time_t debuglog_next_timeout;
 
 int debuglog_init(void);
 
diff --git a/system/core/netsvc/rules.mk b/system/core/netsvc/rules.mk
index eaf9135..34b59c8 100644
--- a/system/core/netsvc/rules.mk
+++ b/system/core/netsvc/rules.mk
@@ -21,6 +21,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/inet6 system/ulib/tftp
 
-MODULE_LIBS := system/ulib/mxio system/ulib/launchpad system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/launchpad system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/core/netsvc/tftp.c b/system/core/netsvc/tftp.c
index cd866e9..5887f52 100644
--- a/system/core/netsvc/tftp.c
+++ b/system/core/netsvc/tftp.c
@@ -11,8 +11,8 @@
 #include <inet6/inet6.h>
 #include <tftp/tftp.h>
 
-#include <magenta/boot/netboot.h>
-#include <magenta/syscalls.h>
+#include <zircon/boot/netboot.h>
+#include <zircon/syscalls.h>
 
 #include "netsvc.h"
 
@@ -38,7 +38,7 @@
 static file_info_t file_info;
 static transport_info_t transport_info;
 
-mx_time_t tftp_next_timeout = MX_TIME_INFINITE;
+zx_time_t tftp_next_timeout = ZX_TIME_INFINITE;
 
 void file_init(file_info_t *file_info) {
     file_info->is_write = true;
@@ -119,7 +119,7 @@
     // The timeout is relative to sending instead of receiving a packet, since there are some
     // received packets we want to ignore (duplicate ACKs).
     if (transport_info->timeout_ms != 0) {
-        tftp_next_timeout = mx_deadline_after(MX_MSEC(transport_info->timeout_ms));
+        tftp_next_timeout = zx_deadline_after(ZX_MSEC(transport_info->timeout_ms));
     }
     return bytes_sent;
 }
@@ -155,7 +155,7 @@
 
 static void end_connection(void) {
     session = NULL;
-    tftp_next_timeout = MX_TIME_INFINITE;
+    tftp_next_timeout = ZX_TIME_INFINITE;
 }
 
 void tftp_timeout_expired(void) {
diff --git a/system/core/userboot/bootdata.c b/system/core/userboot/bootdata.c
index 44ae0ff..c7d7830 100644
--- a/system/core/userboot/bootdata.c
+++ b/system/core/userboot/bootdata.c
@@ -8,21 +8,21 @@
 #pragma GCC visibility push(hidden)
 
 #include <bootdata/decompress.h>
-#include <magenta/boot/bootdata.h>
-#include <magenta/syscalls.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/syscalls.h>
 #include <string.h>
 
 #pragma GCC visibility pop
 
-mx_handle_t bootdata_get_bootfs(mx_handle_t log, mx_handle_t vmar_self,
-                                mx_handle_t bootdata_vmo) {
+zx_handle_t bootdata_get_bootfs(zx_handle_t log, zx_handle_t vmar_self,
+                                zx_handle_t bootdata_vmo) {
     size_t off = 0;
     for (;;) {
         bootdata_t bootdata;
         size_t actual;
-        mx_status_t status = mx_vmo_read(bootdata_vmo, &bootdata,
+        zx_status_t status = zx_vmo_read(bootdata_vmo, &bootdata,
                                          off, sizeof(bootdata), &actual);
-        check(log, status, "mx_vmo_read failed on bootdata VMO");
+        check(log, status, "zx_vmo_read failed on bootdata VMO");
         if (actual != sizeof(bootdata))
             fail(log, "short read on bootdata VMO");
 
@@ -43,7 +43,7 @@
 
         case BOOTDATA_BOOTFS_BOOT:;
             const char* errmsg;
-            mx_handle_t bootfs_vmo;
+            zx_handle_t bootfs_vmo;
             status = decompress_bootdata(vmar_self, bootdata_vmo, off,
                                          bootdata.length + hdrsz,
                                          &bootfs_vmo, &errmsg);
@@ -51,10 +51,10 @@
 
             // Signal that we've already processed this one.
             bootdata.type = BOOTDATA_BOOTFS_DISCARD;
-            check(log, mx_vmo_write(bootdata_vmo, &bootdata.type,
+            check(log, zx_vmo_write(bootdata_vmo, &bootdata.type,
                                     off + offsetof(bootdata_t, type),
                                     sizeof(bootdata.type), &actual),
-                  "mx_vmo_write failed on bootdata VMO\n");
+                  "zx_vmo_write failed on bootdata VMO\n");
 
             return bootfs_vmo;
         }
diff --git a/system/core/userboot/bootdata.h b/system/core/userboot/bootdata.h
index cb0de4c..1a96dfa 100644
--- a/system/core/userboot/bootdata.h
+++ b/system/core/userboot/bootdata.h
@@ -6,9 +6,9 @@
 
 #pragma GCC visibility push(hidden)
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
-mx_handle_t bootdata_get_bootfs(mx_handle_t log, mx_handle_t vmar_self,
-                                mx_handle_t bootdata_vmo);
+zx_handle_t bootdata_get_bootfs(zx_handle_t log, zx_handle_t vmar_self,
+                                zx_handle_t bootdata_vmo);
 
 #pragma GCC visibility pop
diff --git a/system/core/userboot/bootfs.c b/system/core/userboot/bootfs.c
index 6806305..75273ae 100644
--- a/system/core/userboot/bootfs.c
+++ b/system/core/userboot/bootfs.c
@@ -7,37 +7,37 @@
 
 #pragma GCC visibility push(hidden)
 
-#include <magenta/boot/bootdata.h>
-#include <magenta/syscalls.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/syscalls.h>
 #include <string.h>
 
 #pragma GCC visibility pop
 
-void bootfs_mount(mx_handle_t vmar, mx_handle_t log, mx_handle_t vmo, struct bootfs *fs) {
+void bootfs_mount(zx_handle_t vmar, zx_handle_t log, zx_handle_t vmo, struct bootfs *fs) {
     uint64_t size;
-    mx_status_t status = mx_vmo_get_size(vmo, &size);
-    check(log, status, "mx_vmo_get_size failed on bootfs vmo\n");
+    zx_status_t status = zx_vmo_get_size(vmo, &size);
+    check(log, status, "zx_vmo_get_size failed on bootfs vmo\n");
     uintptr_t addr = 0;
-    status = mx_vmar_map(vmar, 0, vmo, 0, size, MX_VM_FLAG_PERM_READ, &addr);
-    check(log, status, "mx_vmar_map failed on bootfs vmo\n");
+    status = zx_vmar_map(vmar, 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ, &addr);
+    check(log, status, "zx_vmar_map failed on bootfs vmo\n");
     fs->contents = (const void*)addr;
     fs->len = size;
-    status = mx_handle_duplicate(
+    status = zx_handle_duplicate(
         vmo,
-        MX_RIGHT_READ | MX_RIGHT_EXECUTE | MX_RIGHT_MAP |
-        MX_RIGHT_TRANSFER | MX_RIGHT_DUPLICATE | MX_RIGHT_GET_PROPERTY,
+        ZX_RIGHT_READ | ZX_RIGHT_EXECUTE | ZX_RIGHT_MAP |
+        ZX_RIGHT_TRANSFER | ZX_RIGHT_DUPLICATE | ZX_RIGHT_GET_PROPERTY,
         &fs->vmo);
-    check(log, status, "mx_handle_duplicate failed on bootfs VMO handle\n");
+    check(log, status, "zx_handle_duplicate failed on bootfs VMO handle\n");
 }
 
-void bootfs_unmount(mx_handle_t vmar, mx_handle_t log, struct bootfs *fs) {
-    mx_status_t status = mx_vmar_unmap(vmar, (uintptr_t)fs->contents, fs->len);
-    check(log, status, "mx_vmar_unmap failed\n");
-    status = mx_handle_close(fs->vmo);
-    check(log, status, "mx_handle_close failed\n");
+void bootfs_unmount(zx_handle_t vmar, zx_handle_t log, struct bootfs *fs) {
+    zx_status_t status = zx_vmar_unmap(vmar, (uintptr_t)fs->contents, fs->len);
+    check(log, status, "zx_vmar_unmap failed\n");
+    status = zx_handle_close(fs->vmo);
+    check(log, status, "zx_handle_close failed\n");
 }
 
-static const bootfs_entry_t* bootfs_search(mx_handle_t log,
+static const bootfs_entry_t* bootfs_search(zx_handle_t log,
                                            struct bootfs *fs,
                                            const char* filename) {
     const void* p = fs->contents;
@@ -73,14 +73,14 @@
     return NULL;
 }
 
-mx_handle_t bootfs_open(mx_handle_t log, const char* purpose,
+zx_handle_t bootfs_open(zx_handle_t log, const char* purpose,
                         struct bootfs *fs, const char* filename) {
     printl(log, "searching bootfs for '%s'", filename);
 
     const bootfs_entry_t* e = bootfs_search(log, fs, filename);
     if (e == NULL) {
         printl(log, "file not found");
-        return MX_HANDLE_INVALID;
+        return ZX_HANDLE_INVALID;
     }
     if (e->data_off > fs->len)
         fail(log, "bogus offset in bootfs header!");
@@ -90,23 +90,23 @@
     // Clone a private copy of the file's subset of the bootfs VMO.
     // TODO(mcgrathr): Create a plain read-only clone when the feature
     // is implemented in the VM.
-    mx_handle_t vmo;
-    mx_status_t status = mx_vmo_clone(fs->vmo, MX_VMO_CLONE_COPY_ON_WRITE,
+    zx_handle_t vmo;
+    zx_status_t status = zx_vmo_clone(fs->vmo, ZX_VMO_CLONE_COPY_ON_WRITE,
                                       e->data_off, e->data_len, &vmo);
-    if (status != MX_OK)
-        fail(log, "mx_vmo_clone failed: %d", status);
+    if (status != ZX_OK)
+        fail(log, "zx_vmo_clone failed: %d", status);
 
-    mx_object_set_property(vmo, MX_PROP_NAME, filename, strlen(filename));
+    zx_object_set_property(vmo, ZX_PROP_NAME, filename, strlen(filename));
 
-    // Drop unnecessary MX_RIGHT_WRITE rights.
-    // TODO(mcgrathr): Should be superfluous with read-only mx_vmo_clone.
-    status = mx_handle_replace(
+    // Drop unnecessary ZX_RIGHT_WRITE rights.
+    // TODO(mcgrathr): Should be superfluous with read-only zx_vmo_clone.
+    status = zx_handle_replace(
         vmo,
-        MX_RIGHT_READ | MX_RIGHT_EXECUTE | MX_RIGHT_MAP |
-        MX_RIGHT_TRANSFER | MX_RIGHT_DUPLICATE | MX_RIGHT_GET_PROPERTY,
+        ZX_RIGHT_READ | ZX_RIGHT_EXECUTE | ZX_RIGHT_MAP |
+        ZX_RIGHT_TRANSFER | ZX_RIGHT_DUPLICATE | ZX_RIGHT_GET_PROPERTY,
         &vmo);
-    if (status != MX_OK)
-        fail(log, "mx_handle_replace failed: %d", status);
+    if (status != ZX_OK)
+        fail(log, "zx_handle_replace failed: %d", status);
 
     return vmo;
 }
diff --git a/system/core/userboot/bootfs.h b/system/core/userboot/bootfs.h
index 70dfc5c..ae276c2 100644
--- a/system/core/userboot/bootfs.h
+++ b/system/core/userboot/bootfs.h
@@ -6,20 +6,20 @@
 
 #pragma GCC visibility push(hidden)
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stddef.h>
 #include <stdint.h>
 
 struct bootfs {
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     const void* contents;
     size_t len;
 };
 
-void bootfs_mount(mx_handle_t vmar, mx_handle_t log, mx_handle_t vmo, struct bootfs *fs);
-void bootfs_unmount(mx_handle_t vmar, mx_handle_t log, struct bootfs *fs);
+void bootfs_mount(zx_handle_t vmar, zx_handle_t log, zx_handle_t vmo, struct bootfs *fs);
+void bootfs_unmount(zx_handle_t vmar, zx_handle_t log, struct bootfs *fs);
 
-mx_handle_t bootfs_open(mx_handle_t log, const char* purpose,
+zx_handle_t bootfs_open(zx_handle_t log, const char* purpose,
                         struct bootfs *fs, const char* filename);
 
 #pragma GCC visibility pop
diff --git a/system/core/userboot/loader-service.c b/system/core/userboot/loader-service.c
index 5fdce91..3c9858f 100644
--- a/system/core/userboot/loader-service.c
+++ b/system/core/userboot/loader-service.c
@@ -7,8 +7,8 @@
 
 #pragma GCC visibility push(hidden)
 
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 #include <string.h>
 
 #pragma GCC visibility pop
@@ -17,7 +17,7 @@
 #define LOAD_OBJECT_FILE_PREFIX "lib/"
 
 struct loader_state {
-    mx_handle_t log;
+    zx_handle_t log;
     struct bootfs* bootfs;
     char prefix[32];
     size_t prefix_len;
@@ -39,9 +39,9 @@
     state->prefix_len = len;
 }
 
-static mx_handle_t try_load_object(struct loader_state* state,
+static zx_handle_t try_load_object(struct loader_state* state,
                                    const char* name, size_t prefix_len) {
-    char file[LOADER_SVC_MSG_MAX - offsetof(mx_loader_svc_msg_t, data) +
+    char file[LOADER_SVC_MSG_MAX - offsetof(zx_loader_svc_msg_t, data) +
               sizeof(LOAD_OBJECT_FILE_PREFIX) + prefix_len];
     memcpy(file, LOAD_OBJECT_FILE_PREFIX, sizeof(LOAD_OBJECT_FILE_PREFIX) - 1);
     memcpy(&file[sizeof(LOAD_OBJECT_FILE_PREFIX) - 1],
@@ -51,38 +51,38 @@
     return bootfs_open(state->log, "shared library", state->bootfs, file);
 }
 
-static mx_handle_t load_object(struct loader_state* state, const char* name) {
-    mx_handle_t vmo = try_load_object(state, name, state->prefix_len);
-    if (vmo == MX_HANDLE_INVALID && state->prefix_len > 0 && !state->exclusive)
+static zx_handle_t load_object(struct loader_state* state, const char* name) {
+    zx_handle_t vmo = try_load_object(state, name, state->prefix_len);
+    if (vmo == ZX_HANDLE_INVALID && state->prefix_len > 0 && !state->exclusive)
         vmo = try_load_object(state, name, 0);
-    if (vmo == MX_HANDLE_INVALID)
+    if (vmo == ZX_HANDLE_INVALID)
         fail(state->log, "cannot find shared library '%s'", name);
     return vmo;
 }
 
 static bool handle_loader_rpc(struct loader_state* state,
-                              mx_handle_t channel) {
+                              zx_handle_t channel) {
     union {
         uint8_t buffer[1024];
-        mx_loader_svc_msg_t msg;
+        zx_loader_svc_msg_t msg;
     } msgbuf;
-    mx_handle_t reqhandle;
+    zx_handle_t reqhandle;
     const char* const string = (const char*)msgbuf.msg.data;
 
     uint32_t size;
     uint32_t hcount;
-    mx_status_t status = mx_channel_read(
+    zx_status_t status = zx_channel_read(
         channel, 0, &msgbuf, &reqhandle, sizeof(msgbuf), 1, &size, &hcount);
 
     // This is the normal error for the other end going away,
     // which happens when the process dies.
-    if (status == MX_ERR_PEER_CLOSED) {
+    if (status == ZX_ERR_PEER_CLOSED) {
         printl(state->log, "loader-service channel peer closed on read");
         return false;
     }
 
     check(state->log, status,
-          "mx_channel_read on loader-service channel failed");
+          "zx_channel_read on loader-service channel failed");
 
     if (size < sizeof(msgbuf.msg))
         fail(state->log, "loader-service request message too small");
@@ -91,12 +91,12 @@
     // we need to receive (and discard) the handle to politely
     // NAK clone requests
     if (hcount == 1)
-        mx_handle_close(reqhandle);
+        zx_handle_close(reqhandle);
 
     // Forcibly null-terminate the message data argument.
     msgbuf.buffer[sizeof(msgbuf) - 1] = 0;
 
-    mx_handle_t handle = MX_HANDLE_INVALID;
+    zx_handle_t handle = ZX_HANDLE_INVALID;
     switch (msgbuf.msg.opcode) {
     case LOADER_SVC_OP_DONE:
         printl(state->log, "loader-service received DONE request");
@@ -115,7 +115,7 @@
         break;
 
     case LOADER_SVC_OP_CLONE:
-        msgbuf.msg.arg = MX_ERR_NOT_SUPPORTED;
+        msgbuf.msg.arg = ZX_ERR_NOT_SUPPORTED;
         goto error_reply;
 
     case LOADER_SVC_OP_LOAD_SCRIPT_INTERP:
@@ -128,21 +128,21 @@
     }
 
     // txid returned as received from the client.
-    msgbuf.msg.arg = MX_OK;
+    msgbuf.msg.arg = ZX_OK;
 error_reply:
     msgbuf.msg.opcode = LOADER_SVC_OP_STATUS;
     msgbuf.msg.reserved0 = 0;
     msgbuf.msg.reserved1 = 0;
-    status = mx_channel_write(channel, 0, &msgbuf.msg, sizeof(msgbuf.msg),
-                              &handle, handle == MX_HANDLE_INVALID ? 0 : 1);
+    status = zx_channel_write(channel, 0, &msgbuf.msg, sizeof(msgbuf.msg),
+                              &handle, handle == ZX_HANDLE_INVALID ? 0 : 1);
     check(state->log, status,
-          "mx_channel_write on loader-service channel failed");
+          "zx_channel_write on loader-service channel failed");
 
     return true;
 }
 
-void loader_service(mx_handle_t log, struct bootfs* bootfs,
-                    mx_handle_t channel) {
+void loader_service(zx_handle_t log, struct bootfs* bootfs,
+                    zx_handle_t channel) {
     printl(log, "waiting for loader-service requests...");
 
     struct loader_state state = {
@@ -151,26 +151,26 @@
     };
 
     do {
-        mx_signals_t signals;
-        mx_status_t status = mx_object_wait_one(
-            channel, MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-            MX_TIME_INFINITE, &signals);
-        if (status == MX_ERR_BAD_STATE) {
+        zx_signals_t signals;
+        zx_status_t status = zx_object_wait_one(
+            channel, ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+            ZX_TIME_INFINITE, &signals);
+        if (status == ZX_ERR_BAD_STATE) {
             // This is the normal error for the other end going away,
             // which happens when the process dies.
             break;
         }
         check(log, status,
-              "mx_object_wait_one failed on loader-service channel");
-        if (signals & MX_CHANNEL_PEER_CLOSED) {
+              "zx_object_wait_one failed on loader-service channel");
+        if (signals & ZX_CHANNEL_PEER_CLOSED) {
             printl(log, "loader-service channel peer closed");
             break;
         }
-        if (!(signals & MX_CHANNEL_READABLE)) {
+        if (!(signals & ZX_CHANNEL_READABLE)) {
             fail(log, "unexpected signal state on loader-service channel");
         }
     } while (handle_loader_rpc(&state, channel));
 
-    check(log, mx_handle_close(channel),
-          "mx_handle_close failed on loader-service channel");
+    check(log, zx_handle_close(channel),
+          "zx_handle_close failed on loader-service channel");
 }
diff --git a/system/core/userboot/loader-service.h b/system/core/userboot/loader-service.h
index 38a00cb..161f745 100644
--- a/system/core/userboot/loader-service.h
+++ b/system/core/userboot/loader-service.h
@@ -6,13 +6,13 @@
 
 #pragma GCC visibility push(hidden)
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stddef.h>
 
 struct bootfs;
 
 // Handle loader-service RPCs on channel until there are no more.
 // Consumes the channel.
-void loader_service(mx_handle_t log, struct bootfs*, mx_handle_t channel);
+void loader_service(zx_handle_t log, struct bootfs*, zx_handle_t channel);
 
 #pragma GCC visibility pop
diff --git a/system/core/userboot/option.c b/system/core/userboot/option.c
index 2f1181d..5a0bf3e 100644
--- a/system/core/userboot/option.c
+++ b/system/core/userboot/option.c
@@ -52,7 +52,7 @@
     }
 }
 
-void parse_options(mx_handle_t log, struct options *o, char** strings) {
+void parse_options(zx_handle_t log, struct options *o, char** strings) {
     initialize_options(o);
     for (char** sp = strings; *sp != NULL; ++sp) {
         const char* arg = *sp;
diff --git a/system/core/userboot/option.h b/system/core/userboot/option.h
index 499f8a4..79df852 100644
--- a/system/core/userboot/option.h
+++ b/system/core/userboot/option.h
@@ -6,7 +6,7 @@
 
 #pragma GCC visibility push(hidden)
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 enum option {
     OPTION_FILENAME,
@@ -22,6 +22,6 @@
     const char* value[OPTION_MAX];
 };
 
-void parse_options(mx_handle_t log, struct options *o, char** strings);
+void parse_options(zx_handle_t log, struct options *o, char** strings);
 
 #pragma GCC visibility pop
diff --git a/system/core/userboot/rules.mk b/system/core/userboot/rules.mk
index cce1876..3c4baf3 100644
--- a/system/core/userboot/rules.mk
+++ b/system/core/userboot/rules.mk
@@ -53,7 +53,7 @@
 # static libs, because they might be built with safe-stack or other
 # options that can't be supported in the constrained userboot context.
 MODULE_STATIC_LIBS := system/ulib/runtime
-MODULE_HEADER_DEPS := system/ulib/magenta
+MODULE_HEADER_DEPS := system/ulib/zircon
 
 # Fortunately, each of these libraries is just a single source file.
 # So we just use their sources directly rather than getting
@@ -71,7 +71,7 @@
 
 # This generated header lists all the ABI symbols in the vDSO with their
 # addresses.  It's used to generate vdso-syms.ld, below.
-$(BUILDDIR)/$(LOCAL_DIR)/vdso-syms.h: $(BUILDDIR)/system/ulib/magenta/libmagenta.so
+$(BUILDDIR)/$(LOCAL_DIR)/vdso-syms.h: $(BUILDDIR)/system/ulib/zircon/libzircon.so
 	@$(MKDIR)
 	$(call BUILDECHO,generating $@)
 	$(NOECHO)$(SHELLEXEC) scripts/shlib-symbols -a '$(NM)' $< > $@
diff --git a/system/core/userboot/start.c b/system/core/userboot/start.c
index 4651b1b..6bc57d8 100644
--- a/system/core/userboot/start.c
+++ b/system/core/userboot/start.c
@@ -11,9 +11,9 @@
 
 #pragma GCC visibility push(hidden)
 
-#include <magenta/stack.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/stack.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
 #include <runtime/message.h>
 #include <runtime/processargs.h>
 #include <stdalign.h>
@@ -26,21 +26,21 @@
 #define SHUTDOWN_COMMAND "poweroff"
 #define STACK_VMO_NAME "userboot-child-initial-stack"
 
-static noreturn void do_shutdown(mx_handle_t log, mx_handle_t rroot) {
+static noreturn void do_shutdown(zx_handle_t log, zx_handle_t rroot) {
     printl(log, "Process exited.  Executing \"" SHUTDOWN_COMMAND "\".");
-    mx_debug_send_command(rroot, SHUTDOWN_COMMAND, strlen(SHUTDOWN_COMMAND));
+    zx_debug_send_command(rroot, SHUTDOWN_COMMAND, strlen(SHUTDOWN_COMMAND));
     printl(log, "still here after shutdown!");
     while (true)
         __builtin_trap();
 }
 
-static void load_child_process(mx_handle_t log,
+static void load_child_process(zx_handle_t log,
                                const struct options* o, struct bootfs* bootfs,
-                               mx_handle_t vdso_vmo, mx_handle_t proc,
-                               mx_handle_t vmar, mx_handle_t thread,
-                               mx_handle_t to_child,
-                               mx_vaddr_t* entry, mx_vaddr_t* vdso_base,
-                               size_t* stack_size, mx_handle_t* loader_svc) {
+                               zx_handle_t vdso_vmo, zx_handle_t proc,
+                               zx_handle_t vmar, zx_handle_t thread,
+                               zx_handle_t to_child,
+                               zx_vaddr_t* entry, zx_vaddr_t* vdso_base,
+                               size_t* stack_size, zx_handle_t* loader_svc) {
     // Examine the bootfs image and find the requested file in it.
     // This will handle a PT_INTERP by doing a second lookup in bootfs.
     *entry = elf_load_bootfs(log, bootfs, proc, vmar, thread,
@@ -58,23 +58,23 @@
 // allocating the initial stack) stay out of this area, and then destroyed.
 // The process's own allocations can then use the full address space; if
 // it's using a sanitizer, it will set up its shadow memory first thing.
-static mx_handle_t reserve_low_address_space(mx_handle_t log,
-                                             mx_handle_t root_vmar) {
-    mx_info_vmar_t info;
-    check(log, mx_object_get_info(root_vmar, MX_INFO_VMAR,
+static zx_handle_t reserve_low_address_space(zx_handle_t log,
+                                             zx_handle_t root_vmar) {
+    zx_info_vmar_t info;
+    check(log, zx_object_get_info(root_vmar, ZX_INFO_VMAR,
                                   &info, sizeof(info), NULL, NULL),
-          "mx_object_get_info failed on child root VMAR handle");
-    mx_handle_t vmar;
+          "zx_object_get_info failed on child root VMAR handle");
+    zx_handle_t vmar;
     uintptr_t addr;
     size_t reserve_size =
         (((info.base + info.len) / 2) + PAGE_SIZE - 1) & -PAGE_SIZE;
-    mx_status_t status = mx_vmar_allocate(root_vmar, 0,
+    zx_status_t status = zx_vmar_allocate(root_vmar, 0,
                                           reserve_size - info.base,
-                                          MX_VM_FLAG_SPECIFIC, &vmar, &addr);
+                                          ZX_VM_FLAG_SPECIFIC, &vmar, &addr);
     check(log, status,
-          "mx_vmar_allocate failed for low address space reservation");
+          "zx_vmar_allocate failed for low address space reservation");
     if (addr != info.base)
-        fail(log, "mx_vmar_allocate gave wrong address?!?");
+        fail(log, "zx_vmar_allocate gave wrong address?!?");
     return vmar;
 }
 
@@ -87,30 +87,30 @@
 // 1. Read the kernel's bootstrap message.
 // 2. Load up the child process from ELF file(s) on the bootfs.
 // 3. Create the initial thread and allocate a stack for it.
-// 4. Load up a channel with the mx_proc_args_t message for the child.
+// 4. Load up a channel with the zx_proc_args_t message for the child.
 // 5. Start the child process running.
 // 6. Optionally, wait for it to exit and then shut down.
-static noreturn void bootstrap(mx_handle_t log, mx_handle_t bootstrap_pipe) {
+static noreturn void bootstrap(zx_handle_t log, zx_handle_t bootstrap_pipe) {
     // Sample the bootstrap message to see how big it is.
     uint32_t nbytes;
     uint32_t nhandles;
 
-    mx_status_t status = mxr_message_size(bootstrap_pipe, &nbytes, &nhandles);
-    check(log, status, "mxr_message_size failed on bootstrap pipe!");
+    zx_status_t status = zxr_message_size(bootstrap_pipe, &nbytes, &nhandles);
+    check(log, status, "zxr_message_size failed on bootstrap pipe!");
 
     // Read the bootstrap message from the kernel.
-    MXR_PROCESSARGS_BUFFER(buffer,
+    ZXR_PROCESSARGS_BUFFER(buffer,
                            nbytes + EXTRA_HANDLE_COUNT * sizeof(uint32_t));
-    mx_handle_t handles[nhandles + EXTRA_HANDLE_COUNT];
-    mx_proc_args_t* pargs;
+    zx_handle_t handles[nhandles + EXTRA_HANDLE_COUNT];
+    zx_proc_args_t* pargs;
     uint32_t* handle_info;
-    status = mxr_processargs_read(bootstrap_pipe,
+    status = zxr_processargs_read(bootstrap_pipe,
                                   buffer, nbytes, handles, nhandles,
                                   &pargs, &handle_info);
-    check(log, status, "mxr_processargs_read failed on bootstrap message!");
+    check(log, status, "zxr_processargs_read failed on bootstrap message!");
 
     // All done with the channel from the kernel now.  Let it go.
-    mx_handle_close(bootstrap_pipe);
+    zx_handle_close(bootstrap_pipe);
 
     // We're adding some extra handles, so we have to rearrange the
     // incoming message buffer to make space for their info slots.
@@ -130,23 +130,23 @@
 
     // Extract the environment (aka kernel command line) strings.
     char* environ[pargs->environ_num + 1];
-    status = mxr_processargs_strings(buffer, nbytes, NULL, environ, NULL);
+    status = zxr_processargs_strings(buffer, nbytes, NULL, environ, NULL);
     check(log, status,
-          "mxr_processargs_strings failed on bootstrap message");
+          "zxr_processargs_strings failed on bootstrap message");
 
     // Process the kernel command line, which gives us options and also
     // becomes the environment strings for our child.
     struct options o;
     parse_options(log, &o, environ);
 
-    mx_handle_t resource_root = MX_HANDLE_INVALID;
-    mx_handle_t bootdata_vmo = MX_HANDLE_INVALID;
-    mx_handle_t vdso_vmo = MX_HANDLE_INVALID;
-    mx_handle_t job = MX_HANDLE_INVALID;
-    mx_handle_t* proc_handle_loc = NULL;
-    mx_handle_t* vmar_root_handle_loc = NULL;
-    mx_handle_t* thread_handle_loc = NULL;
-    mx_handle_t* stack_vmo_handle_loc = NULL;
+    zx_handle_t resource_root = ZX_HANDLE_INVALID;
+    zx_handle_t bootdata_vmo = ZX_HANDLE_INVALID;
+    zx_handle_t vdso_vmo = ZX_HANDLE_INVALID;
+    zx_handle_t job = ZX_HANDLE_INVALID;
+    zx_handle_t* proc_handle_loc = NULL;
+    zx_handle_t* vmar_root_handle_loc = NULL;
+    zx_handle_t* thread_handle_loc = NULL;
+    zx_handle_t* stack_vmo_handle_loc = NULL;
     for (uint32_t i = 0; i < nhandles; ++i) {
         switch (handle_info[i]) {
         case PA_HND(PA_VMO_VDSO, 0):
@@ -171,40 +171,40 @@
             job = handles[i];
             break;
         case PA_HND(PA_VMO_BOOTDATA, 0):
-            if (bootdata_vmo == MX_HANDLE_INVALID) {
+            if (bootdata_vmo == ZX_HANDLE_INVALID) {
                 bootdata_vmo = handles[i];
-                mx_object_set_property(bootdata_vmo, MX_PROP_NAME, "bootdata", 8);
+                zx_object_set_property(bootdata_vmo, ZX_PROP_NAME, "bootdata", 8);
             }
             break;
         }
     }
-    if (vdso_vmo == MX_HANDLE_INVALID)
+    if (vdso_vmo == ZX_HANDLE_INVALID)
         fail(log, "no vDSO handle in bootstrap message");
-    if (resource_root == MX_HANDLE_INVALID)
+    if (resource_root == ZX_HANDLE_INVALID)
         fail(log, "no resource handle in bootstrap message");
-    if (job == MX_HANDLE_INVALID)
+    if (job == ZX_HANDLE_INVALID)
         fail(log, "no job handle in bootstrap message");
     if (vmar_root_handle_loc == NULL)
         fail(log, "no vmar root handle in bootstrap message");
-    if (bootdata_vmo == MX_HANDLE_INVALID)
+    if (bootdata_vmo == ZX_HANDLE_INVALID)
         fail(log, "no bootdata VMO in bootstrap message");
 
     // Hang on to our own process handle.  If we closed it, our process
     // would be killed.  Exiting will clean it up.
-    __UNUSED const mx_handle_t proc_self = *proc_handle_loc;
-    const mx_handle_t vmar_self = *vmar_root_handle_loc;
+    __UNUSED const zx_handle_t proc_self = *proc_handle_loc;
+    const zx_handle_t vmar_self = *vmar_root_handle_loc;
 
     // Hang on to the resource root handle.
-    mx_handle_t root_resource_handle;
-    status = mx_handle_duplicate(resource_root, MX_RIGHT_SAME_RIGHTS,
+    zx_handle_t root_resource_handle;
+    status = zx_handle_duplicate(resource_root, ZX_RIGHT_SAME_RIGHTS,
                                  &root_resource_handle);
     if (status < 0)
-        fail(log, "mx_handle_duplicate failed: %d", status);
+        fail(log, "zx_handle_duplicate failed: %d", status);
 
     // Locate the first bootfs bootdata section and decompress it.
     // We need it to load devmgr and libc from.
     // Later bootfs sections will be processed by devmgr.
-    mx_handle_t bootfs_vmo = bootdata_get_bootfs(log, vmar_self, bootdata_vmo);
+    zx_handle_t bootfs_vmo = bootdata_get_bootfs(log, vmar_self, bootdata_vmo);
 
     // Pass the decompressed bootfs VMO on.
     handles[nhandles + EXTRA_HANDLE_BOOTFS] = bootfs_vmo;
@@ -216,75 +216,75 @@
     bootfs_mount(vmar_self, log, bootfs_vmo, &bootfs);
 
     // Make the channel for the bootstrap message.
-    mx_handle_t to_child;
-    mx_handle_t child_start_handle;
-    status = mx_channel_create(0, &to_child, &child_start_handle);
-    check(log, status, "mx_channel_create failed");
+    zx_handle_t to_child;
+    zx_handle_t child_start_handle;
+    status = zx_channel_create(0, &to_child, &child_start_handle);
+    check(log, status, "zx_channel_create failed");
 
     const char* filename = o.value[OPTION_FILENAME];
-    mx_handle_t proc;
-    mx_handle_t vmar;
-    status = mx_process_create(job, filename, strlen(filename), 0,
+    zx_handle_t proc;
+    zx_handle_t vmar;
+    status = zx_process_create(job, filename, strlen(filename), 0,
                                &proc, &vmar);
     if (status < 0)
-        fail(log, "mx_process_create failed: %d", status);
+        fail(log, "zx_process_create failed: %d", status);
 
-    mx_handle_t reserve_vmar = reserve_low_address_space(log, vmar);
+    zx_handle_t reserve_vmar = reserve_low_address_space(log, vmar);
 
     // Create the initial thread in the new process
-    mx_handle_t thread;
-    status = mx_thread_create(proc, filename, strlen(filename), 0, &thread);
+    zx_handle_t thread;
+    status = zx_thread_create(proc, filename, strlen(filename), 0, &thread);
     if (status < 0)
-        fail(log, "mx_thread_create failed: %d", status);
+        fail(log, "zx_thread_create failed: %d", status);
 
-    mx_vaddr_t entry, vdso_base;
-    size_t stack_size = MAGENTA_DEFAULT_STACK_SIZE;
-    mx_handle_t loader_service_channel = MX_HANDLE_INVALID;
+    zx_vaddr_t entry, vdso_base;
+    size_t stack_size = ZIRCON_DEFAULT_STACK_SIZE;
+    zx_handle_t loader_service_channel = ZX_HANDLE_INVALID;
     load_child_process(log, &o, &bootfs, vdso_vmo, proc, vmar,
                        thread, to_child, &entry, &vdso_base, &stack_size,
                        &loader_service_channel);
 
     // Allocate the stack for the child.
     stack_size = (stack_size + PAGE_SIZE - 1) & -PAGE_SIZE;
-    mx_handle_t stack_vmo;
-    status = mx_vmo_create(stack_size, 0, &stack_vmo);
+    zx_handle_t stack_vmo;
+    status = zx_vmo_create(stack_size, 0, &stack_vmo);
     if (status < 0)
-        fail(log, "mx_vmo_create failed for child stack: %d", status);
-    mx_object_set_property(stack_vmo, MX_PROP_NAME,
+        fail(log, "zx_vmo_create failed for child stack: %d", status);
+    zx_object_set_property(stack_vmo, ZX_PROP_NAME,
                            STACK_VMO_NAME, sizeof(STACK_VMO_NAME) - 1);
-    mx_vaddr_t stack_base;
-    status = mx_vmar_map(vmar, 0, stack_vmo, 0, stack_size,
-                         MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    zx_vaddr_t stack_base;
+    status = zx_vmar_map(vmar, 0, stack_vmo, 0, stack_size,
+                         ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                          &stack_base);
-    check(log, status, "mx_vmar_map failed for child stack");
+    check(log, status, "zx_vmar_map failed for child stack");
     uintptr_t sp = compute_initial_stack_pointer(stack_base, stack_size);
     if (stack_vmo_handle_loc != NULL) {
         // This is our own stack VMO handle, but we don't need it for anything.
-        if (*stack_vmo_handle_loc != MX_HANDLE_INVALID)
-            mx_handle_close(*stack_vmo_handle_loc);
+        if (*stack_vmo_handle_loc != ZX_HANDLE_INVALID)
+            zx_handle_close(*stack_vmo_handle_loc);
         *stack_vmo_handle_loc = stack_vmo;
     } else {
-        mx_handle_close(stack_vmo);
+        zx_handle_close(stack_vmo);
     }
 
     // We're done doing mappings, so clear out the reservation VMAR.
-    check(log, mx_vmar_destroy(reserve_vmar),
-          "mx_vmar_destroy failed on reservation VMAR handle");
-    check(log, mx_handle_close(reserve_vmar),
-          "mx_handle_close failed on reservation VMAR handle");
+    check(log, zx_vmar_destroy(reserve_vmar),
+          "zx_vmar_destroy failed on reservation VMAR handle");
+    check(log, zx_handle_close(reserve_vmar),
+          "zx_handle_close failed on reservation VMAR handle");
 
     // Reuse the slot for the child's handle.
-    status = mx_handle_duplicate(proc, MX_RIGHT_SAME_RIGHTS, proc_handle_loc);
+    status = zx_handle_duplicate(proc, ZX_RIGHT_SAME_RIGHTS, proc_handle_loc);
     if (status < 0)
-        fail(log, "mx_handle_duplicate failed on child process handle: %d", status);
+        fail(log, "zx_handle_duplicate failed on child process handle: %d", status);
 
     if (thread_handle_loc != NULL) {
         // Reuse the slot for the child's handle.
         // NOTE: Leaks the current thread handle the same way as the process handle.
-        status = mx_handle_duplicate(thread, MX_RIGHT_SAME_RIGHTS,
+        status = zx_handle_duplicate(thread, ZX_RIGHT_SAME_RIGHTS,
                                      thread_handle_loc);
         if (status < 0)
-            fail(log, "mx_handle_duplicate failed on child thread handle: %d", status);
+            fail(log, "zx_handle_duplicate failed on child thread handle: %d", status);
     }
 
     // Reuse the slot for the child's root VMAR handle.  We don't need to hold
@@ -294,23 +294,23 @@
     // Now send the bootstrap message, consuming both our VMO handles. We also
     // send the job handle, which in the future means that we can't create more
     // processes from here on.
-    status = mx_channel_write(to_child, 0, buffer, nbytes,
+    status = zx_channel_write(to_child, 0, buffer, nbytes,
                               handles, nhandles + EXTRA_HANDLE_COUNT);
-    check(log, status, "mx_channel_write to child failed");
-    status = mx_handle_close(to_child);
-    check(log, status, "mx_handle_close failed on channel handle");
+    check(log, status, "zx_channel_write to child failed");
+    status = zx_handle_close(to_child);
+    check(log, status, "zx_handle_close failed on channel handle");
 
     // Start the process going.
-    status = mx_process_start(proc, thread, entry, sp,
+    status = zx_process_start(proc, thread, entry, sp,
                               child_start_handle, vdso_base);
-    check(log, status, "mx_process_start failed");
-    status = mx_handle_close(thread);
-    check(log, status, "mx_handle_close failed on thread handle");
+    check(log, status, "zx_process_start failed");
+    status = zx_handle_close(thread);
+    check(log, status, "zx_handle_close failed on thread handle");
 
     printl(log, "process %s started.", o.value[OPTION_FILENAME]);
 
     // Now become the loader service for as long as that's needed.
-    if (loader_service_channel != MX_HANDLE_INVALID)
+    if (loader_service_channel != ZX_HANDLE_INVALID)
         loader_service(log, &bootfs, loader_service_channel);
 
     // All done with bootfs!
@@ -318,29 +318,29 @@
 
     if (o.value[OPTION_SHUTDOWN] != NULL) {
         printl(log, "Waiting for %s to exit...", o.value[OPTION_FILENAME]);
-        status = mx_object_wait_one(
-            proc, MX_PROCESS_TERMINATED, MX_TIME_INFINITE, NULL);
-        check(log, status, "mx_object_wait_one on process failed");
+        status = zx_object_wait_one(
+            proc, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, NULL);
+        check(log, status, "zx_object_wait_one on process failed");
         do_shutdown(log, root_resource_handle);
     }
 
     // Now we've accomplished our purpose in life, and we can die happy.
 
-    status = mx_handle_close(proc);
-    check(log, status, "mx_handle_close failed on process handle");
+    status = zx_handle_close(proc);
+    check(log, status, "zx_handle_close failed on process handle");
 
     printl(log, "finished!");
-    mx_process_exit(0);
+    zx_process_exit(0);
 }
 
 // This is the entry point for the whole show, the very first bit of code
 // to run in user mode.
 noreturn void _start(void* start_arg) {
-    mx_handle_t log = MX_HANDLE_INVALID;
-    mx_log_create(0, &log);
-    if (log == MX_HANDLE_INVALID)
-        printl(log, "mx_log_create failed, using mx_debug_write instead");
+    zx_handle_t log = ZX_HANDLE_INVALID;
+    zx_log_create(0, &log);
+    if (log == ZX_HANDLE_INVALID)
+        printl(log, "zx_log_create failed, using zx_debug_write instead");
 
-    mx_handle_t bootstrap_pipe = (uintptr_t)start_arg;
+    zx_handle_t bootstrap_pipe = (uintptr_t)start_arg;
     bootstrap(log, bootstrap_pipe);
 }
diff --git a/system/core/userboot/userboot-elf.c b/system/core/userboot/userboot-elf.c
index bb75fe5..57af4d2 100644
--- a/system/core/userboot/userboot-elf.c
+++ b/system/core/userboot/userboot-elf.c
@@ -11,9 +11,9 @@
 
 #include <elf.h>
 #include <elfload/elfload.h>
-#include <magenta/compiler.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 #include <stdbool.h>
 #include <string.h>
 
@@ -21,13 +21,13 @@
 
 #define INTERP_PREFIX "lib/"
 
-static mx_vaddr_t load(mx_handle_t log, mx_handle_t vmar, mx_handle_t vmo,
+static zx_vaddr_t load(zx_handle_t log, zx_handle_t vmar, zx_handle_t vmo,
                        uintptr_t* interp_off, size_t* interp_len,
-                       mx_handle_t* segments_vmar, size_t* stack_size,
+                       zx_handle_t* segments_vmar, size_t* stack_size,
                        bool close_vmo, bool return_entry) {
     elf_load_header_t header;
     uintptr_t phoff;
-    mx_status_t status = elf_load_prepare(vmo, NULL, 0, &header, &phoff);
+    zx_status_t status = elf_load_prepare(vmo, NULL, 0, &header, &phoff);
     check(log, status, "elf_load_prepare failed");
 
     elf_phdr_t phdrs[header.e_phnum];
@@ -45,7 +45,7 @@
         }
     }
 
-    mx_vaddr_t addr;
+    zx_vaddr_t addr;
     status = elf_load_map_segments(vmar, &header, phdrs, vmo,
                                    segments_vmar,
                                    return_entry ? NULL : &addr,
@@ -53,12 +53,12 @@
     check(log, status, "elf_load_map_segments failed");
 
     if (close_vmo)
-        mx_handle_close(vmo);
+        zx_handle_close(vmo);
 
     return addr;
 }
 
-mx_vaddr_t elf_load_vmo(mx_handle_t log, mx_handle_t vmar, mx_handle_t vmo) {
+zx_vaddr_t elf_load_vmo(zx_handle_t log, zx_handle_t vmar, zx_handle_t vmo) {
     return load(log, vmar, vmo, NULL, NULL, NULL, NULL, false, false);
 }
 
@@ -77,22 +77,22 @@
 #define LOADER_BOOTSTRAP_ENVIRON_NUM 1
 
 struct loader_bootstrap_message {
-    mx_proc_args_t header;
+    zx_proc_args_t header;
     uint32_t handle_info[BOOTSTRAP_HANDLES];
     char env[sizeof(LOADER_BOOTSTRAP_ENVIRON)];
 };
 
-static void stuff_loader_bootstrap(mx_handle_t log,
-                                   mx_handle_t proc, mx_handle_t root_vmar,
-                                   mx_handle_t thread,
-                                   mx_handle_t to_child,
-                                   mx_handle_t segments_vmar,
-                                   mx_handle_t vmo,
-                                   mx_handle_t* loader_svc) {
+static void stuff_loader_bootstrap(zx_handle_t log,
+                                   zx_handle_t proc, zx_handle_t root_vmar,
+                                   zx_handle_t thread,
+                                   zx_handle_t to_child,
+                                   zx_handle_t segments_vmar,
+                                   zx_handle_t vmo,
+                                   zx_handle_t* loader_svc) {
     struct loader_bootstrap_message msg = {
         .header = {
-            .protocol = MX_PROCARGS_PROTOCOL,
-            .version = MX_PROCARGS_VERSION,
+            .protocol = ZX_PROCARGS_PROTOCOL,
+            .version = ZX_PROCARGS_VERSION,
             .handle_info_off = offsetof(struct loader_bootstrap_message,
                                         handle_info),
             .environ_num = LOADER_BOOTSTRAP_ENVIRON_NUM,
@@ -100,7 +100,7 @@
         },
         .handle_info = {
             [BOOTSTRAP_EXEC_VMO] = PA_HND(PA_VMO_EXECUTABLE, 0),
-            [BOOTSTRAP_LOGGER] = PA_HND(PA_MXIO_LOGGER, 0),
+            [BOOTSTRAP_LOGGER] = PA_HND(PA_FDIO_LOGGER, 0),
             [BOOTSTRAP_PROC] = PA_HND(PA_PROC_SELF, 0),
             [BOOTSTRAP_ROOT_VMAR] = PA_HND(PA_VMAR_ROOT, 0),
             [BOOTSTRAP_SEGMENTS_VMAR] = PA_HND(PA_VMAR_LOADED, 0),
@@ -109,65 +109,65 @@
         },
         .env = LOADER_BOOTSTRAP_ENVIRON,
     };
-    mx_handle_t handles[] = {
+    zx_handle_t handles[] = {
         [BOOTSTRAP_EXEC_VMO] = vmo,
-        [BOOTSTRAP_LOGGER] = MX_HANDLE_INVALID,
-        [BOOTSTRAP_PROC] = MX_HANDLE_INVALID,
-        [BOOTSTRAP_ROOT_VMAR] = MX_HANDLE_INVALID,
+        [BOOTSTRAP_LOGGER] = ZX_HANDLE_INVALID,
+        [BOOTSTRAP_PROC] = ZX_HANDLE_INVALID,
+        [BOOTSTRAP_ROOT_VMAR] = ZX_HANDLE_INVALID,
         [BOOTSTRAP_SEGMENTS_VMAR] = segments_vmar,
-        [BOOTSTRAP_THREAD] = MX_HANDLE_INVALID,
-        [BOOTSTRAP_LOADER_SVC] = MX_HANDLE_INVALID,
+        [BOOTSTRAP_THREAD] = ZX_HANDLE_INVALID,
+        [BOOTSTRAP_LOADER_SVC] = ZX_HANDLE_INVALID,
     };
-    check(log, mx_handle_duplicate(log, MX_RIGHT_SAME_RIGHTS,
+    check(log, zx_handle_duplicate(log, ZX_RIGHT_SAME_RIGHTS,
                                    &handles[BOOTSTRAP_LOGGER]),
-          "mx_handle_duplicate failed");
-    check(log, mx_handle_duplicate(proc, MX_RIGHT_SAME_RIGHTS,
+          "zx_handle_duplicate failed");
+    check(log, zx_handle_duplicate(proc, ZX_RIGHT_SAME_RIGHTS,
                                    &handles[BOOTSTRAP_PROC]),
-          "mx_handle_duplicate failed");
-    check(log, mx_handle_duplicate(root_vmar, MX_RIGHT_SAME_RIGHTS,
+          "zx_handle_duplicate failed");
+    check(log, zx_handle_duplicate(root_vmar, ZX_RIGHT_SAME_RIGHTS,
                                    &handles[BOOTSTRAP_ROOT_VMAR]),
-          "mx_handle_duplicate failed");
-    check(log, mx_handle_duplicate(thread, MX_RIGHT_SAME_RIGHTS,
+          "zx_handle_duplicate failed");
+    check(log, zx_handle_duplicate(thread, ZX_RIGHT_SAME_RIGHTS,
                                    &handles[BOOTSTRAP_THREAD]),
-          "mx_handle_duplicate failed");
-    check(log, mx_channel_create(0, loader_svc,
+          "zx_handle_duplicate failed");
+    check(log, zx_channel_create(0, loader_svc,
                                  &handles[BOOTSTRAP_LOADER_SVC]),
-          "mx_channel_create failed");
+          "zx_channel_create failed");
 
-    mx_status_t status = mx_channel_write(
+    zx_status_t status = zx_channel_write(
         to_child, 0, &msg, sizeof(msg), handles, countof(handles));
     check(log, status,
-          "mx_channel_write of loader bootstrap message failed");
+          "zx_channel_write of loader bootstrap message failed");
 }
 
-mx_vaddr_t elf_load_bootfs(mx_handle_t log, struct bootfs *fs, mx_handle_t proc,
-                           mx_handle_t vmar, mx_handle_t thread,
-                           const char* filename, mx_handle_t to_child,
-                           size_t* stack_size, mx_handle_t* loader_svc) {
-    mx_handle_t vmo = bootfs_open(log, "program", fs, filename);
+zx_vaddr_t elf_load_bootfs(zx_handle_t log, struct bootfs *fs, zx_handle_t proc,
+                           zx_handle_t vmar, zx_handle_t thread,
+                           const char* filename, zx_handle_t to_child,
+                           size_t* stack_size, zx_handle_t* loader_svc) {
+    zx_handle_t vmo = bootfs_open(log, "program", fs, filename);
 
     uintptr_t interp_off = 0;
     size_t interp_len = 0;
-    mx_vaddr_t entry = load(log, vmar, vmo, &interp_off, &interp_len,
+    zx_vaddr_t entry = load(log, vmar, vmo, &interp_off, &interp_len,
                             NULL, stack_size, true, true);
     if (interp_len > 0) {
         char interp[sizeof(INTERP_PREFIX) + interp_len];
         memcpy(interp, INTERP_PREFIX, sizeof(INTERP_PREFIX) - 1);
         size_t n;
-        mx_status_t status = mx_vmo_read(
+        zx_status_t status = zx_vmo_read(
             vmo, &interp[sizeof(INTERP_PREFIX) - 1],
             interp_off, interp_len, &n);
         if (status < 0)
-            fail(log, "mx_vmo_read failed: %d", status);
+            fail(log, "zx_vmo_read failed: %d", status);
         if (n != interp_len)
-            fail(log, "mx_vmo_read short read");
+            fail(log, "zx_vmo_read short read");
         interp[sizeof(INTERP_PREFIX) - 1 + interp_len] = '\0';
 
         printl(log, "'%s' has PT_INTERP \"%s\"", filename, interp);
 
-        mx_handle_t interp_vmo =
+        zx_handle_t interp_vmo =
             bootfs_open(log, "dynamic linker", fs, interp);
-        mx_handle_t interp_vmar;
+        zx_handle_t interp_vmar;
         entry = load(log, vmar, interp_vmo,
                      NULL, NULL, &interp_vmar, NULL, true, true);
 
diff --git a/system/core/userboot/userboot-elf.h b/system/core/userboot/userboot-elf.h
index 9f630fb..3cb6033 100644
--- a/system/core/userboot/userboot-elf.h
+++ b/system/core/userboot/userboot-elf.h
@@ -6,27 +6,27 @@
 
 #pragma GCC visibility push(hidden)
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stddef.h>
 
 struct bootfs;
 
 // Returns the base address (p_vaddr bias).
-mx_vaddr_t elf_load_vmo(mx_handle_t log, mx_handle_t vmar, mx_handle_t vmo);
+zx_vaddr_t elf_load_vmo(zx_handle_t log, zx_handle_t vmar, zx_handle_t vmo);
 
 // Returns the entry point address in the child, either to the named
 // executable or to the PT_INTERP file loaded instead.  If the main
 // file has a PT_INTERP, that name (with a fixed prefix applied) is
 // also found in the bootfs and loaded instead of the main
-// executable.  In that case, an extra mx_proc_args_t message is
+// executable.  In that case, an extra zx_proc_args_t message is
 // sent down the to_child pipe to prime the interpreter (presumably
 // the dynamic linker) with the given log handle and a VMO for the
 // main executable and a loader-service channel, the other end of
 // which is returned here.
-mx_vaddr_t elf_load_bootfs(mx_handle_t log, struct bootfs *fs,
-                           mx_handle_t proc, mx_handle_t vmar,
-                           mx_handle_t thread,
-                           const char* filename, mx_handle_t to_child,
-                           size_t* stack_size, mx_handle_t* loader_svc);
+zx_vaddr_t elf_load_bootfs(zx_handle_t log, struct bootfs *fs,
+                           zx_handle_t proc, zx_handle_t vmar,
+                           zx_handle_t thread,
+                           const char* filename, zx_handle_t to_child,
+                           size_t* stack_size, zx_handle_t* loader_svc);
 
 #pragma GCC visibility pop
diff --git a/system/core/userboot/util.c b/system/core/userboot/util.c
index 6b84d51..00b836f 100644
--- a/system/core/userboot/util.c
+++ b/system/core/userboot/util.c
@@ -7,8 +7,8 @@
 #pragma GCC visibility push(hidden)
 
 #include <assert.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
 #include <stdarg.h>
 #include <string.h>
 
@@ -59,8 +59,8 @@
     return u64string(s, len, n);
 }
 
-void vprintl(mx_handle_t log, const char* fmt, va_list ap) {
-    char buffer[MX_LOG_RECORD_MAX - sizeof(mx_log_record_t)];
+void vprintl(zx_handle_t log, const char* fmt, va_list ap) {
+    char buffer[ZX_LOG_RECORD_MAX - sizeof(zx_log_record_t)];
     static_assert(sizeof(LOG_PREFIX) < sizeof(buffer), "buffer too small");
 
     memcpy(buffer, LOG_PREFIX, sizeof(LOG_PREFIX) - 1);
@@ -121,32 +121,32 @@
         default:
 bad_format:
             printl(log, "printl: invalid fmt char 0x%x", *fmt);
-            mx_process_exit(-1);
+            zx_process_exit(-1);
         }
         fmt++;
     }
 
 done:
-    if ((log == MX_HANDLE_INVALID) ||
-        (mx_log_write(log, p - buffer, buffer, 0) != MX_OK)) {
-        mx_debug_write(buffer, p - buffer);
-        mx_debug_write("\n", 1);
+    if ((log == ZX_HANDLE_INVALID) ||
+        (zx_log_write(log, p - buffer, buffer, 0) != ZX_OK)) {
+        zx_debug_write(buffer, p - buffer);
+        zx_debug_write("\n", 1);
     }
 }
 
-void printl(mx_handle_t log, const char* fmt, ...) {
+void printl(zx_handle_t log, const char* fmt, ...) {
     va_list ap;
     va_start(ap, fmt);
     vprintl(log, fmt, ap);
     va_end(ap);
 }
 
-void fail(mx_handle_t log, const char* fmt, ...) {
+void fail(zx_handle_t log, const char* fmt, ...) {
     va_list ap;
     va_start(ap, fmt);
     vprintl(log, fmt, ap);
     va_end(ap);
-    mx_process_exit(-1);
+    zx_process_exit(-1);
 }
 
 
diff --git a/system/core/userboot/util.h b/system/core/userboot/util.h
index aaf728f..1475a98 100644
--- a/system/core/userboot/util.h
+++ b/system/core/userboot/util.h
@@ -7,17 +7,17 @@
 #pragma GCC visibility push(hidden)
 
 #include <stdarg.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 // printl() is printf-like, understanding %s %p %d %u %x %zu %zd %zx.
 // No other formatting features are supported.
-void __PRINTFLIKE(2, 3) printl(mx_handle_t log, const char* fmt, ...);
-void vprintl(mx_handle_t log, const char* fmt, va_list ap);
+void __PRINTFLIKE(2, 3) printl(zx_handle_t log, const char* fmt, ...);
+void vprintl(zx_handle_t log, const char* fmt, va_list ap);
 
 // fail() combines printl() with process exit
-_Noreturn void __PRINTFLIKE(2, 3) fail(mx_handle_t log, const char* fmt, ...);
+_Noreturn void __PRINTFLIKE(2, 3) fail(zx_handle_t log, const char* fmt, ...);
 
 #define check(log, status, msg...) \
-    do { if (status != MX_OK) fail(log, msg); } while (0)
+    do { if (status != ZX_OK) fail(log, msg); } while (0)
 
 #pragma GCC visibility pop
diff --git a/system/core/virtcon/keyboard-test.cpp b/system/core/virtcon/keyboard-test.cpp
index 7d7a7b0..0425c8d 100644
--- a/system/core/virtcon/keyboard-test.cpp
+++ b/system/core/virtcon/keyboard-test.cpp
@@ -45,7 +45,7 @@
 class KeyboardInputHelper {
 public:
     KeyboardInputHelper() {
-        EXPECT_EQ(vc_input_create(&vi_, keypress_handler, -1), MX_OK, "");
+        EXPECT_EQ(vc_input_create(&vi_, keypress_handler, -1), ZX_OK, "");
     }
 
     ~KeyboardInputHelper() {
diff --git a/system/core/virtcon/keyboard.cpp b/system/core/virtcon/keyboard.cpp
index 6d4e31f..a322147 100644
--- a/system/core/virtcon/keyboard.cpp
+++ b/system/core/virtcon/keyboard.cpp
@@ -11,8 +11,8 @@
 #include <hid/hid.h>
 #include <hid/usages.h>
 
-#include <magenta/device/input.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/input.h>
+#include <zircon/syscalls.h>
 
 #include <port/port.h>
 
@@ -42,7 +42,7 @@
 static void set_caps_lock_led(int keyboard_fd, bool caps_lock) {
     // The following bit to set is specified in "Device Class Definition
     // for Human Interface Devices (HID)", Version 1.11,
-    // http://www.usb.org/developers/hidpage/HID1_11.pdf.  Magenta leaves
+    // http://www.usb.org/developers/hidpage/HID1_11.pdf.  Zircon leaves
     // USB keyboards in boot mode, so the relevant section is Appendix B,
     // "Boot Interface Descriptors", "B.1 Protocol 1 (Keyboard)".
     const int kUsbCapsLockBit = 1 << 1;
@@ -64,7 +64,7 @@
 struct vc_input {
     port_fd_handler_t fh;
     port_handler_t th;
-    mx_handle_t timer;
+    zx_handle_t timer;
 
     keypress_handler_t handler;
     int fd;
@@ -120,15 +120,15 @@
         port_fd_handler_done(&vi->fh);
         close(vi->fd);
     }
-    mx_handle_close(vi->timer);
+    zx_handle_close(vi->timer);
     free(vi);
 }
 
-static mx_status_t vc_timer_cb(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
+static zx_status_t vc_timer_cb(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
     vc_input_t* vi = containerof(ph, vc_input_t, th);
 
     // if interval is infinite, repeat was canceled
-    if (vi->repeat_interval != MX_TIME_INFINITE) {
+    if (vi->repeat_interval != ZX_TIME_INFINITE) {
         vc_input_process(vi, vi->previous_report_buf);
         vc_input_process(vi, vi->report_buf);
 
@@ -137,48 +137,48 @@
             vi->repeat_interval = HIGH_REPEAT_KEY_FREQ;
         }
 
-        mx_timer_set(vi->timer, mx_deadline_after(vi->repeat_interval), 0);
+        zx_timer_set(vi->timer, zx_deadline_after(vi->repeat_interval), 0);
     }
 
     // We've set this up as repeating so we always
     // return an error to avoid the auto-re-arm behaviour
     // of the port library
-    return MX_ERR_STOP;
+    return ZX_ERR_STOP;
 }
 
-static mx_status_t vc_input_cb(port_fd_handler_t* fh, unsigned pollevt, uint32_t evt) {
+static zx_status_t vc_input_cb(port_fd_handler_t* fh, unsigned pollevt, uint32_t evt) {
     vc_input_t* vi = containerof(fh, vc_input_t, fh);
     ssize_t r;
 
     if (!(pollevt & POLLIN)) {
-        r = MX_ERR_PEER_CLOSED;
+        r = ZX_ERR_PEER_CLOSED;
     } else {
         memcpy(vi->previous_report_buf, vi->report_buf, sizeof(vi->report_buf));
         r = read(vi->fd, vi->report_buf, sizeof(vi->report_buf));
     }
     if (r <= 0) {
         vc_input_destroy(vi);
-        return MX_ERR_STOP;
+        return ZX_ERR_STOP;
     }
     if ((size_t)(r) != sizeof(vi->report_buf)) {
-        vi->repeat_interval = MX_TIME_INFINITE;
-        return MX_OK;
+        vi->repeat_interval = ZX_TIME_INFINITE;
+        return ZX_OK;
     }
 
     if (vc_input_process(vi, vi->report_buf) && vi->repeat_enabled) {
         vi->repeat_interval = LOW_REPEAT_KEY_FREQ;
-        mx_timer_set(vi->timer, mx_deadline_after(vi->repeat_interval), 0);
+        zx_timer_set(vi->timer, zx_deadline_after(vi->repeat_interval), 0);
     } else {
-        vi->repeat_interval = MX_TIME_INFINITE;
+        vi->repeat_interval = ZX_TIME_INFINITE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 #endif
 
-mx_status_t vc_input_create(vc_input_t** out, keypress_handler_t handler, int fd) {
+zx_status_t vc_input_create(vc_input_t** out, keypress_handler_t handler, int fd) {
     vc_input_t* vi = reinterpret_cast<vc_input_t*>(calloc(1, sizeof(vc_input_t)));
     if (vi == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     vi->fd = fd;
@@ -187,7 +187,7 @@
     vi->cur_idx = 0;
     vi->prev_idx = 1;
     vi->modifiers = 0;
-    vi->repeat_interval = MX_TIME_INFINITE;
+    vi->repeat_interval = ZX_TIME_INFINITE;
     vi->repeat_enabled = true;
 
     char* flag = getenv("virtcon.keyrepeat");
@@ -197,48 +197,48 @@
     }
 
 #if !BUILD_FOR_TEST
-    mx_status_t r;
-    if ((r = mx_timer_create(0, MX_CLOCK_MONOTONIC, &vi->timer)) < 0) {
+    zx_status_t r;
+    if ((r = zx_timer_create(0, ZX_CLOCK_MONOTONIC, &vi->timer)) < 0) {
         free(vi);
         return r;
     }
 
     vi->fh.func = vc_input_cb;
     if ((r = port_fd_handler_init(&vi->fh, fd, POLLIN | POLLHUP | POLLRDHUP)) < 0) {
-        mx_handle_close(vi->timer);
+        zx_handle_close(vi->timer);
         free(vi);
         return r;
     }
 
     if ((r = port_wait(&port, &vi->fh.ph)) < 0) {
         port_fd_handler_done(&vi->fh);
-        mx_handle_close(vi->timer);
+        zx_handle_close(vi->timer);
         free(vi);
         return r;
     }
 
     vi->th.handle = vi->timer;
-    vi->th.waitfor = MX_TIMER_SIGNALED;
+    vi->th.waitfor = ZX_TIMER_SIGNALED;
     vi->th.func = vc_timer_cb;
     port_wait_repeating(&port, &vi->th);
 #endif
 
     *out = vi;
-    return MX_OK;
+    return ZX_OK;
 }
 
 #if !BUILD_FOR_TEST
-mx_status_t new_input_device(int fd, keypress_handler_t handler) {
+zx_status_t new_input_device(int fd, keypress_handler_t handler) {
     // test to see if this is a device we can read
     int proto = INPUT_PROTO_NONE;
     ssize_t rc = ioctl_input_get_protocol(fd, &proto);
     if ((rc < 0) || (proto != INPUT_PROTO_KBD)) {
         // skip devices that aren't keyboards
         close(fd);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
-    mx_status_t r;
+    zx_status_t r;
     vc_input_t* vi;
     if ((r = vc_input_create(&vi, handler, fd)) < 0) {
         close(fd);
diff --git a/system/core/virtcon/keyboard.h b/system/core/virtcon/keyboard.h
index 196cd2f..45a305a 100644
--- a/system/core/virtcon/keyboard.h
+++ b/system/core/virtcon/keyboard.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include "vc.h"
 
 #define MOD_LSHIFT (1 << 0)
@@ -22,6 +22,6 @@
 
 typedef struct vc_input vc_input_t;
 
-mx_status_t vc_input_create(vc_input_t** out, keypress_handler_t handler, int fd);
+zx_status_t vc_input_create(vc_input_t** out, keypress_handler_t handler, int fd);
 
 bool vc_input_process(vc_input_t* vi, uint8_t report[8]);
diff --git a/system/core/virtcon/main.cpp b/system/core/virtcon/main.cpp
index ae9ce53..4d28d36 100644
--- a/system/core/virtcon/main.cpp
+++ b/system/core/virtcon/main.cpp
@@ -12,19 +12,19 @@
 
 #include <launchpad/launchpad.h>
 
-#include <magenta/device/pty.h>
-#include <magenta/device/vfs.h>
-#include <magenta/device/display.h>
-#include <magenta/listnode.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/device/pty.h>
+#include <zircon/device/vfs.h>
+#include <zircon/device/display.h>
+#include <zircon/listnode.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
+#include <zircon/syscalls/object.h>
 
-#include <mxio/io.h>
-#include <mxio/util.h>
-#include <mxio/watcher.h>
+#include <fdio/io.h>
+#include <fdio/util.h>
+#include <fdio/watcher.h>
 
 #include <port/port.h>
 
@@ -39,7 +39,7 @@
 static int input_dir_fd;
 
 static vc_t* log_vc;
-static mx_koid_t proc_koid;
+static zx_koid_t proc_koid;
 
 static int g_fb_fd = -1;
 
@@ -51,14 +51,14 @@
     ioctl_display_set_owner(g_fb_fd, &n);
 }
 
-static mx_status_t log_reader_cb(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
-    char buf[MX_LOG_RECORD_MAX];
-    mx_log_record_t* rec = (mx_log_record_t*)buf;
-    mx_status_t status;
+static zx_status_t log_reader_cb(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
+    char buf[ZX_LOG_RECORD_MAX];
+    zx_log_record_t* rec = (zx_log_record_t*)buf;
+    zx_status_t status;
     for (;;) {
-        if ((status = mx_log_read(ph->handle, MX_LOG_RECORD_MAX, rec, 0)) < 0) {
-            if (status == MX_ERR_SHOULD_WAIT) {
-                return MX_OK;
+        if ((status = zx_log_read(ph->handle, ZX_LOG_RECORD_MAX, rec, 0)) < 0) {
+            if (status == ZX_ERR_SHOULD_WAIT) {
+                return ZX_OK;
             }
             break;
         }
@@ -85,18 +85,18 @@
     return status;
 }
 
-static mx_status_t launch_shell(vc_t* vc, int fd, const char* cmd) {
+static zx_status_t launch_shell(vc_t* vc, int fd, const char* cmd) {
     const char* args[] = { "/boot/bin/sh", "-c", cmd };
 
     launchpad_t* lp;
-    launchpad_create(mx_job_default(), "vc:sh", &lp);
+    launchpad_create(zx_job_default(), "vc:sh", &lp);
     launchpad_load_from_file(lp, args[0]);
     launchpad_set_args(lp, cmd ? 3 : 1, args);
-    launchpad_transfer_fd(lp, fd, MXIO_FLAG_USE_FOR_STDIO | 0);
-    launchpad_clone(lp, LP_CLONE_MXIO_NAMESPACE | LP_CLONE_ENVIRON | LP_CLONE_DEFAULT_JOB);
+    launchpad_transfer_fd(lp, fd, FDIO_FLAG_USE_FOR_STDIO | 0);
+    launchpad_clone(lp, LP_CLONE_FDIO_NAMESPACE | LP_CLONE_ENVIRON | LP_CLONE_DEFAULT_JOB);
 
     const char* errmsg;
-    mx_status_t r;
+    zx_status_t r;
     if ((r = launchpad_go(lp, &vc->proc, &errmsg)) < 0) {
         printf("vc: cannot spawn shell: %s: %d\n", errmsg, r);
     }
@@ -108,13 +108,13 @@
         port_fd_handler_done(&vc->fh);
         // vc_destroy() closes the fd
     }
-    if (vc->proc != MX_HANDLE_INVALID) {
-        mx_task_kill(vc->proc);
+    if (vc->proc != ZX_HANDLE_INVALID) {
+        zx_task_kill(vc->proc);
     }
     vc_destroy(vc);
 }
 
-static mx_status_t session_io_cb(port_fd_handler_t* fh, unsigned pollevt, uint32_t evt) {
+static zx_status_t session_io_cb(port_fd_handler_t* fh, unsigned pollevt, uint32_t evt) {
     vc_t* vc = containerof(fh, vc_t, fh);
 
     if (pollevt & POLLIN) {
@@ -122,15 +122,15 @@
         ssize_t r = read(vc->fd, data, sizeof(data));
         if (r > 0) {
             vc_write(vc, data, r, 0);
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
     if (pollevt & (POLLRDHUP | POLLHUP)) {
         // shell sessions get restarted on exit
         if (vc->is_shell) {
-            mx_task_kill(vc->proc);
-            vc->proc = MX_HANDLE_INVALID;
+            zx_task_kill(vc->proc);
+            vc->proc = ZX_HANDLE_INVALID;
 
             int fd = openat(vc->fd, "0", O_RDWR);
             if (fd < 0) {
@@ -140,23 +140,23 @@
             if(launch_shell(vc, fd, NULL) < 0) {
                 goto fail;
             }
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
 fail:
     session_destroy(vc);
-    return MX_ERR_STOP;
+    return ZX_ERR_STOP;
 }
 
-static mx_status_t session_create(vc_t** out, int* out_fd, bool make_active, bool special) {
+static zx_status_t session_create(vc_t** out, int* out_fd, bool make_active, bool special) {
     int fd;
 
     // The ptmx device can start later than these threads
     int retry = 30;
     while ((fd = open("/dev/misc/ptmx", O_RDWR | O_NONBLOCK)) < 0) {
         if (--retry == 0) {
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
         usleep(100000);
     }
@@ -164,16 +164,16 @@
     int client_fd = openat(fd, "0", O_RDWR);
     if (client_fd < 0) {
         close(fd);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     vc_t* vc;
     if (vc_create(&vc, special)) {
         close(fd);
         close(client_fd);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
-    mx_status_t r;
+    zx_status_t r;
     if ((r = port_fd_handler_init(&vc->fh, fd, POLLIN | POLLRDHUP | POLLHUP)) < 0) {
         vc_destroy(vc);
         close(fd);
@@ -196,7 +196,7 @@
 
     *out = vc;
     *out_fd = client_fd;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void start_shell(bool make_active, const char* cmd) {
@@ -216,37 +216,37 @@
     }
 }
 
-static mx_status_t new_vc_cb(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
-    mx_handle_t h;
+static zx_status_t new_vc_cb(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
+    zx_handle_t h;
     uint32_t dcount, hcount;
-    if (mx_channel_read(ph->handle, 0, NULL, &h, 0, 1, &dcount, &hcount) < 0) {
-        return MX_OK;
+    if (zx_channel_read(ph->handle, 0, NULL, &h, 0, 1, &dcount, &hcount) < 0) {
+        return ZX_OK;
     }
     if (hcount != 1) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     vc_t* vc;
     int fd;
     if (session_create(&vc, &fd, true, false) < 0) {
-        mx_handle_close(h);
-        return MX_OK;
+        zx_handle_close(h);
+        return ZX_OK;
     }
 
-    mx_handle_t handles[MXIO_MAX_HANDLES];
-    uint32_t types[MXIO_MAX_HANDLES];
-    mx_status_t r = mxio_transfer_fd(fd, MXIO_FLAG_USE_FOR_STDIO | 0, handles, types);
-    if ((r != 2) || (mx_channel_write(h, 0, types, 2 * sizeof(uint32_t), handles, 2) < 0)) {
+    zx_handle_t handles[FDIO_MAX_HANDLES];
+    uint32_t types[FDIO_MAX_HANDLES];
+    zx_status_t r = fdio_transfer_fd(fd, FDIO_FLAG_USE_FOR_STDIO | 0, handles, types);
+    if ((r != 2) || (zx_channel_write(h, 0, types, 2 * sizeof(uint32_t), handles, 2) < 0)) {
         for (int n = 0; n < r; n++) {
-            mx_handle_close(handles[n]);
+            zx_handle_close(handles[n]);
         }
         session_destroy(vc);
     } else {
         port_wait(&port, &vc->fh.ph);
     }
 
-    mx_handle_close(h);
-    return MX_OK;
+    zx_handle_close(h);
+    return ZX_OK;
 }
 
 static void input_dir_event(unsigned evt, const char* name) {
@@ -264,18 +264,18 @@
     new_input_device(fd, handle_key_press);
 }
 
-static mx_status_t input_cb(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
-    if (!(signals & MX_CHANNEL_READABLE)) {
-        return MX_ERR_STOP;
+static zx_status_t input_cb(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
+    if (!(signals & ZX_CHANNEL_READABLE)) {
+        return ZX_ERR_STOP;
     }
 
     // Buffer contains events { Opcode, Len, Name[Len] }
-    // See magenta/device/vfs.h for more detail
+    // See zircon/device/vfs.h for more detail
     // extra byte is for temporary NUL
     uint8_t buf[VFS_WATCH_MSG_MAX + 1];
     uint32_t len;
-    if (mx_channel_read(ph->handle, 0, buf, NULL, sizeof(buf) - 1, 0, &len, NULL) < 0) {
-        return MX_ERR_STOP;
+    if (zx_channel_read(ph->handle, 0, buf, NULL, sizeof(buf) - 1, 0, &len, NULL) < 0) {
+        return ZX_ERR_STOP;
     }
 
     uint8_t* msg = buf;
@@ -293,25 +293,25 @@
         msg += namelen;
         len -= (namelen + 2u);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ownership_ph_cb(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
+static zx_status_t ownership_ph_cb(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
     // If we owned it, we've been notified of losing it, or the other way 'round
     g_vc_owns_display = !g_vc_owns_display;
 
     // If we've gained it, repaint
     // In both cases adjust waitfor to wait for the opposite
     if (g_vc_owns_display) {
-        ph->waitfor = MX_USER_SIGNAL_1;
+        ph->waitfor = ZX_USER_SIGNAL_1;
         if (g_active_vc) {
             vc_gfx_invalidate_all(g_active_vc);
         }
     } else {
-        ph->waitfor = MX_USER_SIGNAL_0;
+        ph->waitfor = ZX_USER_SIGNAL_0;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 int main(int argc, char** argv) {
@@ -360,7 +360,7 @@
     g_fb_fd = fd;
 
     // create initial console for debug log
-    if (vc_create(&log_vc, false) != MX_OK) {
+    if (vc_create(&log_vc, false) != ZX_OK) {
         return -1;
     }
     g_status_width = log_vc->columns;
@@ -368,25 +368,25 @@
 
     // Get our process koid so the log reader can
     // filter out our own debug messages from the log
-    mx_info_handle_basic_t info;
-    if (mx_object_get_info(mx_process_self(), MX_INFO_HANDLE_BASIC, &info,
-                           sizeof(info), NULL, NULL) == MX_OK) {
+    zx_info_handle_basic_t info;
+    if (zx_object_get_info(zx_process_self(), ZX_INFO_HANDLE_BASIC, &info,
+                           sizeof(info), NULL, NULL) == ZX_OK) {
         proc_koid = info.koid;
     }
 
     // TODO: receive from launching process
-    if (mx_log_create(MX_LOG_FLAG_READABLE, &log_ph.handle) < 0) {
+    if (zx_log_create(ZX_LOG_FLAG_READABLE, &log_ph.handle) < 0) {
         printf("vc log listener: cannot open log\n");
         return -1;
     }
 
     log_ph.func = log_reader_cb;
-    log_ph.waitfor = MX_LOG_READABLE;
+    log_ph.waitfor = ZX_LOG_READABLE;
     port_wait(&port, &log_ph);
 
-    if ((new_vc_ph.handle = mx_get_startup_handle(PA_HND(PA_USER0, 0))) != MX_HANDLE_INVALID) {
+    if ((new_vc_ph.handle = zx_get_startup_handle(PA_HND(PA_USER0, 0))) != ZX_HANDLE_INVALID) {
         new_vc_ph.func = new_vc_cb;
-        new_vc_ph.waitfor = MX_CHANNEL_READABLE;
+        new_vc_ph.waitfor = ZX_CHANNEL_READABLE;
         port_wait(&port, &new_vc_ph);
     }
 
@@ -394,14 +394,14 @@
         vfs_watch_dir_t wd;
         wd.mask = VFS_WATCH_MASK_ALL;
         wd.options = 0;
-        if (mx_channel_create(0, &wd.channel, &input_ph.handle) == MX_OK) {
-            if ((ioctl_vfs_watch_dir(input_dir_fd, &wd)) == MX_OK) {
-                input_ph.waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+        if (zx_channel_create(0, &wd.channel, &input_ph.handle) == ZX_OK) {
+            if ((ioctl_vfs_watch_dir(input_dir_fd, &wd)) == ZX_OK) {
+                input_ph.waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
                 input_ph.func = input_cb;
                 port_wait(&port, &input_ph);
             } else {
-                mx_handle_close(wd.channel);
-                mx_handle_close(input_ph.handle);
+                zx_handle_close(wd.channel);
+                zx_handle_close(input_ph.handle);
                 close(input_dir_fd);
             }
         } else {
@@ -415,17 +415,17 @@
     start_shell(false, NULL);
     start_shell(false, NULL);
 
-    mx_handle_t e = MX_HANDLE_INVALID;
+    zx_handle_t e = ZX_HANDLE_INVALID;
     ioctl_display_get_ownership_change_event(fd, &e);
 
-    if (e != MX_HANDLE_INVALID) {
+    if (e != ZX_HANDLE_INVALID) {
         ownership_ph.func = ownership_ph_cb;
         ownership_ph.handle = e;
-        ownership_ph.waitfor = MX_USER_SIGNAL_1;
+        ownership_ph.waitfor = ZX_USER_SIGNAL_1;
         port_wait(&port, &ownership_ph);
     }
 
-    mx_status_t r = port_dispatch(&port, MX_TIME_INFINITE, false);
+    zx_status_t r = port_dispatch(&port, ZX_TIME_INFINITE, false);
     printf("vc: port failure: %d\n", r);
     return -1;
 }
diff --git a/system/core/virtcon/rules.mk b/system/core/virtcon/rules.mk
index b86fb50..75a8caa 100644
--- a/system/core/virtcon/rules.mk
+++ b/system/core/virtcon/rules.mk
@@ -18,12 +18,12 @@
     system/ulib/gfx \
     system/ulib/hid \
     system/ulib/port \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 LOCAL_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 
diff --git a/system/core/virtcon/textcon-test.cpp b/system/core/virtcon/textcon-test.cpp
index ddb0253..cb9c287 100644
--- a/system/core/virtcon/textcon-test.cpp
+++ b/system/core/virtcon/textcon-test.cpp
@@ -69,11 +69,11 @@
         pixels_y += font->height - 1;
         vc_surface = gfx_create_surface(
             nullptr, pixels_x, pixels_y, /* stride= */ pixels_x,
-            MX_PIXEL_FORMAT_RGB_565, 0);
+            ZX_PIXEL_FORMAT_RGB_565, 0);
         EXPECT_TRUE(vc_surface, "");
         // This takes ownership of vc_surface.
-        EXPECT_EQ(vc_init_gfx(vc_surface), MX_OK, "");
-        EXPECT_EQ(vc_alloc(&vc_dev, false), MX_OK, "");
+        EXPECT_EQ(vc_init_gfx(vc_surface), ZX_OK, "");
+        EXPECT_EQ(vc_alloc(&vc_dev, false), ZX_OK, "");
         EXPECT_EQ(vc_dev->columns, size_x, "");
         EXPECT_EQ(vc_rows(vc_dev), static_cast<int>(size_y), "");
         // Mark the console as active so that display updates get
diff --git a/system/core/virtcon/vc-device.cpp b/system/core/virtcon/vc-device.cpp
index 7a9b4ef..5b28e08 100644
--- a/system/core/virtcon/vc-device.cpp
+++ b/system/core/virtcon/vc-device.cpp
@@ -8,9 +8,9 @@
 #include <string.h>
 #include <sys/param.h>
 
-#include <magenta/device/display.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/display.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 
 #include <fbl/auto_lock.h>
 
@@ -23,7 +23,7 @@
     0xff00aa00, // green
     0xffaa5500, // brown
     0xff0000aa, // blue
-    0xffaa00aa, // magenta
+    0xffaa00aa, // zircon
     0xff00aaaa, // cyan
     0xffaaaaaa, // grey
     // 8-15 Bright/light versions of colors
@@ -32,7 +32,7 @@
     0xff55ff55, // bright green
     0xffffff55, // yellow
     0xff5555ff, // bright blue
-    0xffff55ff, // bright magenta
+    0xffff55ff, // bright zircon
     0xff55ffff, // bright cyan
     0xffffffff, // white
 };
@@ -52,7 +52,7 @@
 extern gfx_surface* vc_tb_gfx;
 extern const gfx_font* vc_font;
 
-static mx_status_t vc_setup(vc_t* vc, bool special) {
+static zx_status_t vc_setup(vc_t* vc, bool special) {
     // calculate how many rows/columns we have
     vc->rows = vc_gfx->height / vc->charh;
     vc->columns = vc_gfx->width / vc->charw;
@@ -64,14 +64,14 @@
     vc->text_buf = reinterpret_cast<vc_char_t*>(
         calloc(1, vc->rows * vc->columns * sizeof(vc_char_t)));
     if (!vc->text_buf)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // allocate the scrollback buffer
     vc->scrollback_buf = reinterpret_cast<vc_char_t*>(
         calloc(1, vc->scrollback_rows_max * vc->columns * sizeof(vc_char_t)));
     if (!vc->scrollback_buf) {
         free(vc->text_buf);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // set up the default palette
@@ -84,7 +84,7 @@
         vc->back_color = DEFAULT_BACK_COLOR;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void vc_invalidate(void* cookie, int x0, int y0, int w, int h) {
@@ -437,11 +437,11 @@
     return &font9x16;
 }
 
-mx_status_t vc_alloc(vc_t** out, bool special) {
+zx_status_t vc_alloc(vc_t** out, bool special) {
     vc_t* vc =
         reinterpret_cast<vc_t*>(calloc(1, sizeof(vc_t)));
     if (!vc) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     vc->fd = -1;
 
@@ -465,7 +465,7 @@
     vc_reset(vc);
 
     *out = vc;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void vc_free(vc_t* vc) {
diff --git a/system/core/virtcon/vc-gfx.cpp b/system/core/virtcon/vc-gfx.cpp
index 96d9da1..33de455 100644
--- a/system/core/virtcon/vc-gfx.cpp
+++ b/system/core/virtcon/vc-gfx.cpp
@@ -4,9 +4,9 @@
 
 #include <gfx/gfx.h>
 
-#include <magenta/device/display.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/display.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 
 #include "vc.h"
 
@@ -34,7 +34,7 @@
 #if BUILD_FOR_TEST
 static gfx_surface* vc_test_gfx;
 
-mx_status_t vc_init_gfx(gfx_surface* test) {
+zx_status_t vc_init_gfx(gfx_surface* test) {
     const gfx_font* font = vc_get_font();
     vc_font = font;
 
@@ -44,7 +44,7 @@
     vc_tb_gfx = gfx_create_surface(NULL, test->width, font->height,
                                    test->stride, test->format, 0);
     if (!vc_tb_gfx) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // init the main surface
@@ -53,10 +53,10 @@
     if (!vc_gfx) {
         gfx_surface_destroy(vc_tb_gfx);
         vc_tb_gfx = NULL;
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void vc_gfx_invalidate_all(vc_t* vc) {
@@ -88,7 +88,7 @@
 }
 #else
 static int vc_gfx_fd = -1;
-static mx_handle_t vc_gfx_vmo = 0;
+static zx_handle_t vc_gfx_vmo = 0;
 static uintptr_t vc_gfx_mem = 0;
 static size_t vc_gfx_size = 0;
 
@@ -102,7 +102,7 @@
         vc_tb_gfx = NULL;
     }
     if (vc_gfx_mem) {
-        mx_vmar_unmap(mx_vmar_root_self(), vc_gfx_mem, vc_gfx_size);
+        zx_vmar_unmap(zx_vmar_root_self(), vc_gfx_mem, vc_gfx_size);
         vc_gfx_mem = 0;
     }
     if (vc_gfx_fd >= 0) {
@@ -111,7 +111,7 @@
     }
 }
 
-mx_status_t vc_init_gfx(int fd) {
+zx_status_t vc_init_gfx(int fd) {
     const gfx_font* font = vc_get_font();
     vc_font = font;
 
@@ -120,22 +120,22 @@
     uintptr_t ptr;
 
 
-    mx_status_t r;
+    zx_status_t r;
     if (ioctl_display_get_fb(fd, &fb) < 0) {
         printf("vc_alloc: cannot get fb from driver instance\n");
-        r = MX_ERR_INTERNAL;
+        r = ZX_ERR_INTERNAL;
         goto fail;
     }
 
     vc_gfx_vmo = fb.vmo;
     vc_gfx_size = fb.info.stride * fb.info.pixelsize * fb.info.height;
 
-    if ((r = mx_vmar_map(mx_vmar_root_self(), 0, vc_gfx_vmo, 0, vc_gfx_size,
-                         MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &vc_gfx_mem)) < 0) {
+    if ((r = zx_vmar_map(zx_vmar_root_self(), 0, vc_gfx_vmo, 0, vc_gfx_size,
+                         ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &vc_gfx_mem)) < 0) {
         goto fail;
     }
 
-    r = MX_ERR_NO_MEMORY;
+    r = ZX_ERR_NO_MEMORY;
     // init the status bar
     if ((vc_tb_gfx = gfx_create_surface((void*) vc_gfx_mem, fb.info.width, font->height,
                                         fb.info.stride, fb.info.format, 0)) == NULL) {
@@ -149,7 +149,7 @@
         goto fail;
     }
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     vc_free_gfx();
diff --git a/system/core/virtcon/vc-input.cpp b/system/core/virtcon/vc-input.cpp
index e5190d3..af10aa9 100644
--- a/system/core/virtcon/vc-input.cpp
+++ b/system/core/virtcon/vc-input.cpp
@@ -109,13 +109,13 @@
     return false;
 }
 
-mx_status_t vc_set_active(int num, vc_t* to_vc) {
+zx_status_t vc_set_active(int num, vc_t* to_vc) {
     vc_t* vc = NULL;
     int i = 0;
     list_for_every_entry (&g_vc_list, vc, vc_t, node) {
         if ((num == i) || (to_vc == vc)) {
             if (vc == g_active_vc) {
-                return MX_OK;
+                return ZX_OK;
             }
             if (g_active_vc) {
                 g_active_vc->active = false;
@@ -127,11 +127,11 @@
             g_active_vc_index = i;
             vc_full_repaint(vc);
             vc_render(vc);
-            return MX_OK;
+            return ZX_OK;
         }
         i++;
     }
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
 void vc_status_update() {
@@ -195,7 +195,7 @@
     }
 }
 
-ssize_t vc_write(vc_t* vc, const void* buf, size_t count, mx_off_t off) {
+ssize_t vc_write(vc_t* vc, const void* buf, size_t count, zx_off_t off) {
     vc->invy0 = vc_rows(vc) + 1;
     vc->invy1 = -1;
     const uint8_t* str = (const uint8_t*)buf;
@@ -220,8 +220,8 @@
 }
 
 // Create a new vc_t and add it to the console list.
-mx_status_t vc_create(vc_t** vc_out, bool special) {
-    mx_status_t status;
+zx_status_t vc_create(vc_t** vc_out, bool special) {
+    zx_status_t status;
     vc_t* vc;
     if ((status = vc_alloc(&vc, special)) < 0) {
         return status;
@@ -239,7 +239,7 @@
     }
 
     *vc_out = vc;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void vc_destroy(vc_t* vc) {
diff --git a/system/core/virtcon/vc.h b/system/core/virtcon/vc.h
index 610dfc2..6dda50c 100644
--- a/system/core/virtcon/vc.h
+++ b/system/core/virtcon/vc.h
@@ -8,9 +8,9 @@
 
 #include <gfx/gfx.h>
 #include <hid/hid.h>
-#include <mxio/vfs.h>
-#include <magenta/listnode.h>
-#include <magenta/thread_annotations.h>
+#include <fdio/vfs.h>
+#include <zircon/listnode.h>
+#include <zircon/thread_annotations.h>
 #include <port/port.h>
 #include <stdbool.h>
 #include <threads.h>
@@ -20,15 +20,15 @@
 #define MAX_COLOR 0xf
 
 #if BUILD_FOR_TEST
-mx_status_t vc_init_gfx(gfx_surface* gfx);
+zx_status_t vc_init_gfx(gfx_surface* gfx);
 #else
-mx_status_t vc_init_gfx(int fd);
+zx_status_t vc_init_gfx(int fd);
 void vc_free_gfx();
 #endif
 
 typedef void (*keypress_handler_t)(uint8_t keycode, int modifiers);
 
-mx_status_t new_input_device(int fd, keypress_handler_t handler);
+zx_status_t new_input_device(int fd, keypress_handler_t handler);
 
 // constraints on status bar tabs
 #define MIN_TAB_WIDTH 16
@@ -45,7 +45,7 @@
     bool active;
     unsigned flags;
 
-    mx_handle_t gfx_vmo;
+    zx_handle_t gfx_vmo;
 
     int fd;
 
@@ -93,7 +93,7 @@
 
 #if !BUILD_FOR_TEST
     port_fd_handler fh;
-    mx_handle_t proc;
+    zx_handle_t proc;
     bool is_shell;
 #endif
 } vc_t;
@@ -105,7 +105,7 @@
 #define VC_FLAG_FULLSCREEN  (1 << 1)
 
 const gfx_font* vc_get_font();
-mx_status_t vc_alloc(vc_t** out, bool special);
+zx_status_t vc_alloc(vc_t** out, bool special);
 void vc_free(vc_t* vc);
 
 // called to re-draw the status bar after
@@ -126,7 +126,7 @@
 void vc_set_fullscreen(vc_t* vc, bool fullscreen);
 
 ssize_t vc_write(vc_t* vc, const void* buf, size_t count,
-                        mx_off_t off);
+                        zx_off_t off);
 
 static inline int vc_rows(vc_t* vc) {
     return vc->flags & VC_FLAG_FULLSCREEN ? vc->rows : vc->rows - 1;
@@ -157,7 +157,7 @@
 void handle_key_press(uint8_t keycode, int modifiers);
 void vc_toggle_framebuffer();
 
-mx_status_t vc_create(vc_t** out, bool special);
+zx_status_t vc_create(vc_t** out, bool special);
 void vc_destroy(vc_t* vc);
-ssize_t vc_write(vc_t* vc, const void* buf, size_t count, mx_off_t off);
-mx_status_t vc_set_active(int num, vc_t* vc);
+ssize_t vc_write(vc_t* vc, const void* buf, size_t count, zx_off_t off);
+zx_status_t vc_set_active(int num, vc_t* vc);
diff --git a/system/dev/audio/bcm-pcm/codec/hifi-berry.c b/system/dev/audio/bcm-pcm/codec/hifi-berry.c
index 9078380..0490c1c 100644
--- a/system/dev/audio/bcm-pcm/codec/hifi-berry.c
+++ b/system/dev/audio/bcm-pcm/codec/hifi-berry.c
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 #include <fcntl.h>
-#include <magenta/device/i2c.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/i2c.h>
+#include <zircon/syscalls.h>
 #include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -31,27 +31,27 @@
 
 static hifiberry_t* hfb = NULL;
 
-static mx_status_t hifiberry_LED_ctl(bool state) {
+static zx_status_t hifiberry_LED_ctl(bool state) {
 
     if (!hfb)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (hfb->i2c_fd < 0)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (hfb->state == HIFIBERRY_STATE_SHUTDOWN)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     // Not using any other GPIO pins, so don't worry about state of other
     //  pins.
     pcm5122_write_reg(hfb->i2c_fd, PCM5122_REG_GPIO_CONTROL,
                      (state) ? (PCM5122_GPIO_HIGH << PCM5122_GPIO4) :
                                (PCM5122_GPIO_LOW  << PCM5122_GPIO4));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t hifiberry_release(void) {
+zx_status_t hifiberry_release(void) {
 
     if (!hfb)
-        return MX_OK;
+        return ZX_OK;
     hifiberry_LED_ctl(false);
 
     if (hfb->i2c_fd >= 0) {
@@ -61,33 +61,33 @@
     free(hfb);
     hfb = NULL;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t hifiberry_start(void) {
+zx_status_t hifiberry_start(void) {
     return hifiberry_LED_ctl(true);
 }
 
-mx_status_t hifiberry_stop(void) {
+zx_status_t hifiberry_stop(void) {
     return hifiberry_LED_ctl(false);
 }
 
-mx_status_t hifiberry_init(void) {
+zx_status_t hifiberry_init(void) {
 
     // Check to see if already initialized
     if ((hfb) && (hfb->state != HIFIBERRY_STATE_SHUTDOWN))
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     if (hfb == NULL) {
         hfb = calloc(1, sizeof(hifiberry_t));
         if (!hfb)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
     }
 
     hfb->i2c_fd = open(DEVNAME, O_RDWR);
     if (hfb->i2c_fd < 0) {
         printf("HIFIBERRY: Control channel not found\n");
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     i2c_ioctl_add_slave_args_t add_slave_args = {
@@ -97,7 +97,7 @@
 
     ssize_t ret = ioctl_i2c_bus_add_slave(hfb->i2c_fd, &add_slave_args);
     if (ret < 0) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     // configure LED GPIO
     pcm5122_write_reg(hfb->i2c_fd, PCM5122_REG_GPIO_ENABLE,
@@ -138,7 +138,7 @@
 
     hfb->state |= HIFIBERRY_STATE_INITIALIZED;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool hifiberry_is_valid_mode(audio_stream_cmd_set_format_req_t req) {
diff --git a/system/dev/audio/bcm-pcm/codec/hifi-berry.h b/system/dev/audio/bcm-pcm/codec/hifi-berry.h
index 111bd40..d5063a0 100644
--- a/system/dev/audio/bcm-pcm/codec/hifi-berry.h
+++ b/system/dev/audio/bcm-pcm/codec/hifi-berry.h
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 #pragma once
-#include <magenta/device/audio.h>
-#include <magenta/types.h>
+#include <zircon/device/audio.h>
+#include <zircon/types.h>
 
 // clang-format off
 #define HIFIBERRY_STATE_SHUTDOWN        (uint32_t)( 0 )
@@ -13,7 +13,7 @@
 
 bool hifiberry_is_valid_mode(audio_stream_cmd_set_format_req_t req);
 
-mx_status_t hifiberry_init(void);
-mx_status_t hifiberry_start(void);
-mx_status_t hifiberry_stop(void);
-mx_status_t hifiberry_release(void);
+zx_status_t hifiberry_init(void);
+zx_status_t hifiberry_start(void);
+zx_status_t hifiberry_stop(void);
+zx_status_t hifiberry_release(void);
diff --git a/system/dev/audio/bcm-pcm/codec/pcm5122.h b/system/dev/audio/bcm-pcm/codec/pcm5122.h
index 1affb1a..77c1e4b 100644
--- a/system/dev/audio/bcm-pcm/codec/pcm5122.h
+++ b/system/dev/audio/bcm-pcm/codec/pcm5122.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/device/audio.h>
-#include <magenta/device/i2c.h>
+#include <zircon/device/audio.h>
+#include <zircon/device/i2c.h>
 
 #pragma once
 // clang-format off
diff --git a/system/dev/audio/bcm-pcm/pcm.c b/system/dev/audio/bcm-pcm/pcm.c
index 503be5b..ddcd3fa 100644
--- a/system/dev/audio/bcm-pcm/pcm.c
+++ b/system/dev/audio/bcm-pcm/pcm.c
@@ -15,13 +15,13 @@
 #include <ddk/driver.h>
 #include <ddk/protocol/platform-device.h>
 
-#include <magenta/assert.h>
-#include <magenta/compiler.h>
-#include <magenta/device/audio.h>
-#include <magenta/device/i2c.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
-#include <magenta/threads.h>
+#include <zircon/assert.h>
+#include <zircon/compiler.h>
+#include <zircon/device/audio.h>
+#include <zircon/device/i2c.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/threads.h>
 
 #include <bcm/bcm28xx.h>
 #include <bcm/clockman.h>
@@ -69,19 +69,19 @@
 
 typedef struct {
    platform_device_protocol_t pdev;
-    mx_device_t* mxdev;
-    mx_device_t* parent;
+    zx_device_t* mxdev;
+    zx_device_t* parent;
     bcm_pcm_regs_t* control_regs;
     bcm_gpio_ctrl_t* gpio_regs;
     volatile void* clock_regs;
 
     bcm_dma_t dma;
 
-    mx_handle_t stream_ch;
-    mx_handle_t buffer_ch;
-    mx_handle_t pcm_port;
+    zx_handle_t stream_ch;
+    zx_handle_t buffer_ch;
+    zx_handle_t pcm_port;
 
-    mx_handle_t buffer_vmo;
+    zx_handle_t buffer_vmo;
     size_t buffer_size; // size of buffer in bytes
     uint32_t buffer_notifications;
 
@@ -102,8 +102,8 @@
 
 } bcm_pcm_t;
 
-static mx_status_t pcm_dma_init(bcm_pcm_t* ctx);
-static mx_status_t pcm_deinit_buffer_locked(bcm_pcm_t* ctx);
+static zx_status_t pcm_dma_init(bcm_pcm_t* ctx);
+static zx_status_t pcm_deinit_buffer_locked(bcm_pcm_t* ctx);
 
 static void set_pcm_clock(bcm_pcm_t* pcm_ctx) {
 
@@ -130,10 +130,10 @@
     hw_wmb();
 }
 
-static void pcm_close_handle(mx_handle_t* handle) {
-    if (*handle != MX_HANDLE_INVALID) {
-        mx_handle_close(*handle);
-        *handle = MX_HANDLE_INVALID;
+static void pcm_close_handle(zx_handle_t* handle) {
+    if (*handle != ZX_HANDLE_INVALID) {
+        zx_handle_close(*handle);
+        *handle = ZX_HANDLE_INVALID;
     }
 }
 
@@ -170,7 +170,7 @@
     uint32_t offset = 0;
     ctx->notify_running = true;
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     double notify_time = (1000000.0 * ctx->buffer_size) /
                          (ctx->sample_rate * ctx->audio_frame_size * ctx->buffer_notifications);
@@ -183,17 +183,17 @@
     xprintf("notifications = %u\n", ctx->buffer_notifications);
 
     while ((ctx->state & BCM_PCM_STATE_RUNNING) && !(ctx->state & BCM_PCM_STATE_SHUTTING_DOWN)) {
-        mx_nanosleep(mx_deadline_after(MX_USEC(notify_period_us)));
+        zx_nanosleep(zx_deadline_after(ZX_USEC(notify_period_us)));
 
-        mx_paddr_t pos = bcm_dma_get_position(&ctx->dma);
+        zx_paddr_t pos = bcm_dma_get_position(&ctx->dma);
         bcm_dma_paddr_to_offset(&ctx->dma, pos, &offset);
 
         audio_rb_position_notify_t resp;
         resp.hdr.cmd = AUDIO_RB_POSITION_NOTIFY;
         resp.ring_buffer_pos = offset;
 
-        status = mx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
-        if (status != MX_OK)
+        status = zx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
+        if (status != ZX_OK)
             break;
     }
     xprintf("notification thread shutting down\n");
@@ -201,20 +201,20 @@
     return 0;
 }
 
-static mx_status_t pcm_get_fifo_depth(bcm_pcm_t* ctx, audio_rb_cmd_get_fifo_depth_req_t req) {
+static zx_status_t pcm_get_fifo_depth(bcm_pcm_t* ctx, audio_rb_cmd_get_fifo_depth_req_t req) {
     audio_rb_cmd_get_fifo_depth_resp_t resp;
     resp.hdr = req.hdr;
-    resp.result = MX_OK;
+    resp.result = ZX_OK;
     resp.fifo_depth = 64;
 
-    return mx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
+    return zx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
 }
 
-static mx_status_t pcm_stop_locked(bcm_pcm_t* ctx) {
-    mx_status_t res;
+static zx_status_t pcm_stop_locked(bcm_pcm_t* ctx) {
+    zx_status_t res;
 
     if (!(ctx->state & BCM_PCM_STATE_RUNNING)) {
-        res = MX_ERR_BAD_STATE;
+        res = ZX_ERR_BAD_STATE;
     } else {
         ctx->state &= ~BCM_PCM_STATE_RUNNING;
         if (ctx->notify_running) {
@@ -223,15 +223,15 @@
         hifiberry_stop();
         bcm_dma_stop(&ctx->dma);
 
-        res = MX_OK;
+        res = ZX_OK;
     }
     return res;
 }
 
-static mx_status_t pcm_stop_req(bcm_pcm_t* ctx, audio_rb_cmd_stop_req_t req) {
+static zx_status_t pcm_stop_req(bcm_pcm_t* ctx, audio_rb_cmd_stop_req_t req) {
 
     mtx_lock(&ctx->pcm_lock);
-    mx_status_t res;
+    zx_status_t res;
 
     res = pcm_stop_locked(ctx);
 
@@ -239,20 +239,20 @@
     resp.result = res;
     resp.hdr = req.hdr;
 
-    res = mx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
+    res = zx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
     mtx_unlock(&ctx->pcm_lock);
     return res;
 }
 
-static mx_status_t pcm_start(bcm_pcm_t* ctx, audio_rb_cmd_start_req_t req) {
+static zx_status_t pcm_start(bcm_pcm_t* ctx, audio_rb_cmd_start_req_t req) {
 
     audio_rb_cmd_start_resp_t resp;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&ctx->pcm_lock);
 
     if (ctx->state & BCM_PCM_STATE_RUNNING) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto pcm_start_out;
     }
     // Enable and clear error flags
@@ -264,7 +264,7 @@
     ctx->control_regs->cs = BCM_PCM_CS_ENABLE | BCM_PCM_CS_DMAEN | BCM_PCM_CS_TXON;
     hw_wmb();
     //i2s is running at this point
-    resp.start_ticks = mx_ticks_get();
+    resp.start_ticks = zx_ticks_get();
     ctx->state |= BCM_PCM_STATE_RUNNING;
 
     hifiberry_start();
@@ -278,7 +278,7 @@
             hifiberry_stop();
             bcm_dma_stop(&ctx->dma);
             ctx->state &= BCM_PCM_STATE_RUNNING;
-            status = thrd_status_to_mx_status(thrd_rc);
+            status = thrd_status_to_zx_status(thrd_rc);
         }
     }
 
@@ -286,12 +286,12 @@
     resp.result = status;
     resp.hdr = req.hdr;
 
-    status = mx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
+    status = zx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
     mtx_unlock(&ctx->pcm_lock);
     return status;
 }
 
-static mx_status_t pcm_deinit_buffer_locked(bcm_pcm_t* ctx) {
+static zx_status_t pcm_deinit_buffer_locked(bcm_pcm_t* ctx) {
 
     ctx->state |= BCM_PCM_STATE_SHUTTING_DOWN;
 
@@ -321,27 +321,27 @@
 
     ctx->state &= ~BCM_PCM_STATE_SHUTTING_DOWN;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t pcm_set_stream_fmt(bcm_pcm_t* ctx, audio_stream_cmd_set_format_req_t req) {
-    mx_status_t status;
+static zx_status_t pcm_set_stream_fmt(bcm_pcm_t* ctx, audio_stream_cmd_set_format_req_t req) {
+    zx_status_t status;
     audio_stream_cmd_set_format_resp_t resp;
-    mx_handle_t ret_handle = MX_HANDLE_INVALID;
+    zx_handle_t ret_handle = ZX_HANDLE_INVALID;
 
     mtx_lock(&ctx->pcm_lock);
 
     if (!hifiberry_is_valid_mode(req)) {
-        status = MX_ERR_NOT_SUPPORTED;
+        status = ZX_ERR_NOT_SUPPORTED;
         xprintf("Mode not supported\n");
         goto set_stream_done;
     }
 
-    if (ctx->buffer_ch != MX_HANDLE_INVALID) {
+    if (ctx->buffer_ch != ZX_HANDLE_INVALID) {
         if (ctx->state & BCM_PCM_STATE_RUNNING) {
             // Currently running a previous configuration, client needs to issue a stop
             //  before attempting a new set_strem_fmt.
-            status = MX_ERR_BAD_STATE;
+            status = ZX_ERR_BAD_STATE;
             xprintf("Already running with valid buffer\n");
             goto set_stream_done;
         } else {
@@ -366,26 +366,26 @@
 
     //Allow pcm state to sync before turning on DMA to prevent frame sync
     // issues.  (only and issue when a frame is > 32-bits, but leaving here for reference)
-    mx_nanosleep(mx_deadline_after(MX_MSEC(10)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(10)));
 
     status = pcm_dma_init(ctx);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         goto set_stream_fail;
 
     // Might make sense to split the codec init vs codec start
     status = hifiberry_init();
-    if (status != MX_OK)
+    if (status != ZX_OK)
         goto set_stream_fail;
 
-    status = mx_channel_create(0, &ctx->buffer_ch, &ret_handle);
-    if (status != MX_OK)
+    status = zx_channel_create(0, &ctx->buffer_ch, &ret_handle);
+    if (status != ZX_OK)
         goto set_stream_fail;
 
-    status = mx_object_wait_async(ctx->buffer_ch, ctx->pcm_port,
+    status = zx_object_wait_async(ctx->buffer_ch, ctx->pcm_port,
                                   (uint64_t)ctx->buffer_ch,
-                                  MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                                  MX_WAIT_ASYNC_REPEATING);
-    if (status == MX_OK)
+                                  ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                                  ZX_WAIT_ASYNC_REPEATING);
+    if (status == ZX_OK)
         goto set_stream_done;
 
 set_stream_fail:
@@ -398,7 +398,7 @@
     resp.hdr.cmd = AUDIO_STREAM_CMD_SET_FORMAT;
     resp.result = status;
 
-    status = mx_channel_write(ctx->stream_ch, 0, &resp, sizeof(resp), &ret_handle, 1);
+    status = zx_channel_write(ctx->stream_ch, 0, &resp, sizeof(resp), &ret_handle, 1);
     mtx_unlock(&ctx->pcm_lock);
     return status;
 }
@@ -419,45 +419,45 @@
     device_remove(pcm->mxdev);
 }
 
-static mx_status_t pcm_get_buffer(bcm_pcm_t* ctx, audio_rb_cmd_get_buffer_req_t req) {
+static zx_status_t pcm_get_buffer(bcm_pcm_t* ctx, audio_rb_cmd_get_buffer_req_t req) {
 
     mtx_lock(&ctx->pcm_lock);
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     audio_rb_cmd_get_buffer_resp_t resp;
     resp.hdr = req.hdr;
 
-    if (ctx->buffer_vmo != MX_HANDLE_INVALID) {
+    if (ctx->buffer_vmo != ZX_HANDLE_INVALID) {
         if (ctx->state & BCM_PCM_STATE_RUNNING) {
-            status = MX_ERR_BAD_STATE;
+            status = ZX_ERR_BAD_STATE;
             goto gb_fail2; // Already running, don't interrupt, but return bad state.
         } else {
             // We already have a buffer configured, need to clean it up.
             pcm_deinit_buffer_locked(ctx);
             status = pcm_dma_init(ctx);
-            if (status != MX_OK)
+            if (status != ZX_OK)
                 goto gb_fail2;
         }
     }
 
     ctx->buffer_size = req.min_ring_buffer_frames * ctx->audio_frame_size;
 
-    status = mx_vmo_create(ctx->buffer_size, 0, &ctx->buffer_vmo);
-    if (status != MX_OK)
+    status = zx_vmo_create(ctx->buffer_size, 0, &ctx->buffer_vmo);
+    if (status != ZX_OK)
         goto gb_fail;
 
-    status = mx_vmo_op_range(ctx->buffer_vmo, MX_VMO_OP_COMMIT, 0, ctx->buffer_size, NULL, 0);
-    if (status != MX_OK)
+    status = zx_vmo_op_range(ctx->buffer_vmo, ZX_VMO_OP_COMMIT, 0, ctx->buffer_size, NULL, 0);
+    if (status != ZX_OK)
         goto gb_fail;
 
-    mx_handle_t ret_handle;
-    status = mx_handle_duplicate(ctx->buffer_vmo, MX_RIGHT_TRANSFER |
-                                                  MX_RIGHT_READ     |
-                                                  MX_RIGHT_WRITE    |
-                                                  MX_RIGHT_MAP,
+    zx_handle_t ret_handle;
+    status = zx_handle_duplicate(ctx->buffer_vmo, ZX_RIGHT_TRANSFER |
+                                                  ZX_RIGHT_READ     |
+                                                  ZX_RIGHT_WRITE    |
+                                                  ZX_RIGHT_MAP,
                                                   &ret_handle);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         goto gb_fail;
 
     xprintf("created %lu byte vmo\n", ctx->buffer_size);
@@ -469,22 +469,22 @@
                              BCM_DMA_TI_SRC_INC |
                              BCM_DMA_TI_WAIT_RESP;
 
-    mx_paddr_t dest_addr = BCM_PERIPH_BASE_BUS |
+    zx_paddr_t dest_addr = BCM_PERIPH_BASE_BUS |
                           (BCM_PERIPH_ADDR_MASK & (uintptr_t)&((bcm_pcm_regs_t*)I2S_BASE)->fifo);
 
     status = bcm_dma_init_vmo_to_fifo_trans(&ctx->dma, ctx->buffer_vmo, transfer_info, dest_addr,
                                             BCM_DMA_FLAGS_USE_MEM_INDEX |
                                                 BCM_DMA_FLAGS_CIRCULAR);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("VMO dma linking failed (%d)\n", status);
-        mx_handle_close(ret_handle);
+        zx_handle_close(ret_handle);
         goto gb_fail;
     }
     resp.result = status;
-    status = mx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), &ret_handle, 1);
+    status = zx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), &ret_handle, 1);
     mtx_unlock(&ctx->pcm_lock);
-    if (status != MX_OK) {
-        mx_handle_close(ret_handle);
+    if (status != ZX_OK) {
+        zx_handle_close(ret_handle);
     }
     return status;
 
@@ -492,7 +492,7 @@
     pcm_close_handle(&ctx->buffer_vmo);
 gb_fail2:
     resp.result = status;
-    status = mx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
+    status = zx_channel_write(ctx->buffer_ch, 0, &resp, sizeof(resp), NULL, 0);
     mtx_unlock(&ctx->pcm_lock);
     return status;
 }
@@ -503,32 +503,32 @@
             printf("Bad " #_payload                 \
                    " reqonse length (%u != %zu)\n", \
                    req_size, sizeof(req._payload)); \
-            return MX_ERR_INVALID_ARGS;                \
+            return ZX_ERR_INVALID_ARGS;                \
         }                                           \
         _handler(ctx, req._payload);                \
         break;
 static int pcm_port_thread(void* arg) {
 
     bcm_pcm_t* ctx = arg;
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_port_packet_t port_out;
+    zx_port_packet_t port_out;
 
     buffer_packet_t req;
     xprintf("Port thread running\n");
-    while ((ctx->stream_ch != MX_HANDLE_INVALID) || (ctx->buffer_ch != MX_HANDLE_INVALID)) {
-        status = mx_port_wait(ctx->pcm_port, MX_TIME_INFINITE, &port_out, 0);
-        if (status != MX_OK)
+    while ((ctx->stream_ch != ZX_HANDLE_INVALID) || (ctx->buffer_ch != ZX_HANDLE_INVALID)) {
+        status = zx_port_wait(ctx->pcm_port, ZX_TIME_INFINITE, &port_out, 0);
+        if (status != ZX_OK)
             break;
 
-        mx_handle_t channel = (mx_handle_t)port_out.key;
+        zx_handle_t channel = (zx_handle_t)port_out.key;
 
         uint32_t req_size;
 
-        if (port_out.signal.observed == MX_CHANNEL_READABLE) {
+        if (port_out.signal.observed == ZX_CHANNEL_READABLE) {
 
-            status = mx_channel_read(channel, 0, &req, NULL, sizeof(req), 0, &req_size, NULL);
-            if (status != MX_OK) {
+            status = zx_channel_read(channel, 0, &req, NULL, sizeof(req), 0, &req_size, NULL);
+            if (status != ZX_OK) {
                 if (channel == ctx->buffer_ch) {
                     xprintf("error reading buffer channel...\n");
                     break;
@@ -557,7 +557,7 @@
                     break;
                 }
             }
-        } else if (port_out.signal.observed== MX_CHANNEL_PEER_CLOSED) {
+        } else if (port_out.signal.observed== ZX_CHANNEL_PEER_CLOSED) {
             if (channel == ctx->stream_ch) {
                 xprintf("stream channel closed by peer\n");
                 pcm_close_handle(&ctx->stream_ch);
@@ -578,52 +578,52 @@
 }
 #undef HANDLE_REQ
 
-static mx_status_t pcm_audio_sink_ioctl(void* ctx, uint32_t op,
+static zx_status_t pcm_audio_sink_ioctl(void* ctx, uint32_t op,
                                          const void* in_buf, size_t in_len,
                                          void* out_buf, size_t out_len, size_t* out_actual) {
 
     bcm_pcm_t* pcm = ctx;
     mtx_lock(&pcm->pcm_lock);
 
-    mx_status_t status = MX_OK;
-    mx_handle_t* reply = out_buf;
+    zx_status_t status = ZX_OK;
+    zx_handle_t* reply = out_buf;
 
     if (op != AUDIO_IOCTL_GET_CHANNEL) {
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
         goto pcm_ioctl_end;
     }
 
     if (pcm->state != BCM_PCM_STATE_SHUTDOWN) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto pcm_ioctl_end;
     }
 
-    MX_DEBUG_ASSERT(pcm->stream_ch == MX_HANDLE_INVALID);
-    MX_DEBUG_ASSERT(pcm->pcm_port == MX_HANDLE_INVALID);
+    ZX_DEBUG_ASSERT(pcm->stream_ch == ZX_HANDLE_INVALID);
+    ZX_DEBUG_ASSERT(pcm->pcm_port == ZX_HANDLE_INVALID);
 
-    mx_handle_t ret_handle;
-    status = mx_channel_create(0, &pcm->stream_ch, &ret_handle);
-    if (status != MX_OK) {
-        status = MX_ERR_INTERNAL;
+    zx_handle_t ret_handle;
+    status = zx_channel_create(0, &pcm->stream_ch, &ret_handle);
+    if (status != ZX_OK) {
+        status = ZX_ERR_INTERNAL;
         goto pcm_ioctl_end;
     }
     *reply = ret_handle;
 
-    status = mx_port_create(0, &pcm->pcm_port);
-    if (status != MX_OK) {
+    status = zx_port_create(0, &pcm->pcm_port);
+    if (status != ZX_OK) {
         xprintf("error creating port\n");
-        mx_handle_close(pcm->stream_ch);
+        zx_handle_close(pcm->stream_ch);
         goto pcm_ioctl_end;
     }
 
-    status = mx_object_wait_async(pcm->stream_ch, pcm->pcm_port,
+    status = zx_object_wait_async(pcm->stream_ch, pcm->pcm_port,
                                   (uint64_t)pcm->stream_ch,
-                                  MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                                  MX_WAIT_ASYNC_REPEATING);
-    if (status != MX_OK) {
+                                  ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                                  ZX_WAIT_ASYNC_REPEATING);
+    if (status != ZX_OK) {
         xprintf("error binding port to stream_ch\n");
-        mx_handle_close(pcm->stream_ch);
-        mx_handle_close(pcm->pcm_port);
+        zx_handle_close(pcm->stream_ch);
+        zx_handle_close(pcm->pcm_port);
         goto pcm_ioctl_end;
     }
 
@@ -631,16 +631,16 @@
                                         pcm_port_thread, pcm,
                                         "pcm_port_thread");
     if (thrd_rc != thrd_success) {
-        mx_handle_close(pcm->stream_ch);
-        mx_handle_close(pcm->pcm_port);
-        status = thrd_status_to_mx_status(thrd_rc);
+        zx_handle_close(pcm->stream_ch);
+        zx_handle_close(pcm->pcm_port);
+        status = thrd_status_to_zx_status(thrd_rc);
         goto pcm_ioctl_end;
     }
     pcm->state |= BCM_PCM_STATE_CLIENT_ACTIVE;
     xprintf("Client request successful...\n");
 pcm_ioctl_end:
     mtx_unlock(&pcm->pcm_lock);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         *out_actual = sizeof(ret_handle);
     } else {
         xprintf("Problem with client request: status=%d\n", status);
@@ -648,16 +648,16 @@
     return status;
 }
 
-static mx_status_t pcm_dma_init(bcm_pcm_t* ctx) {
+static zx_status_t pcm_dma_init(bcm_pcm_t* ctx) {
 
-    mx_status_t status = bcm_dma_init(&ctx->dma, DMA_CHAN);
-    if (status != MX_OK)
+    zx_status_t status = bcm_dma_init(&ctx->dma, DMA_CHAN);
+    if (status != ZX_OK)
         return status;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_protocol_device_t pcm_audio_ctx_device_proto = {
+static zx_protocol_device_t pcm_audio_ctx_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = pcm_audio_sink_unbind,
     .release = pcm_audio_sink_release,
@@ -673,18 +673,18 @@
     // Carve out some address space for the clock control registers
     void* mmio_base;
     size_t mmio_size;
-    mx_handle_t mmio_handle;
-    mx_status_t status = pdev_map_mmio(&pcm_ctx->pdev, CLOCK_MMIO, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_handle_t mmio_handle;
+    zx_status_t status = pdev_map_mmio(&pcm_ctx->pdev, CLOCK_MMIO, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                        &mmio_base, &mmio_size, &mmio_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto pcm_err;
     }
     pcm_ctx->clock_regs = mmio_base;
 
     // Carve out some address space for the device -- it's memory mapped.
-    status = pdev_map_mmio(&pcm_ctx->pdev, GPIO_MMIO, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    status = pdev_map_mmio(&pcm_ctx->pdev, GPIO_MMIO, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                            &mmio_base, &mmio_size, &mmio_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto pcm_err;
     }
     pcm_ctx->gpio_regs = mmio_base;
@@ -695,9 +695,9 @@
     set_gpio_function(pcm_ctx->gpio_regs, BCM_PCM_DIN_ALT0_PIN, FSEL_ALT0);
     set_gpio_function(pcm_ctx->gpio_regs, BCM_PCM_DOUT_ALT0_PIN, FSEL_ALT0);
 
-     status = pdev_map_mmio(&pcm_ctx->pdev, 2, MX_CACHE_POLICY_UNCACHED_DEVICE,
+     status = pdev_map_mmio(&pcm_ctx->pdev, 2, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                            &mmio_base, &mmio_size, &mmio_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto pcm_err;
     }
     pcm_ctx->control_regs = mmio_base;
@@ -707,11 +707,11 @@
         .name = "pcm0",
         .ctx = pcm_ctx,
         .ops = &pcm_audio_ctx_device_proto,
-        .proto_id = MX_PROTOCOL_AUDIO_OUTPUT,
+        .proto_id = ZX_PROTOCOL_AUDIO_OUTPUT,
     };
 
     status = device_add(pcm_ctx->parent, &args, &pcm_ctx->mxdev);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         goto pcm_err;
 
     return 0;
@@ -724,14 +724,14 @@
     return -1;
 }
 
-static mx_status_t bcm_pcm_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t bcm_pcm_bind(void* ctx, zx_device_t* parent, void** cookie) {
     bcm_pcm_t* pcm_ctx = calloc(1, sizeof(*pcm_ctx));
     if (!pcm_ctx)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     pcm_ctx->parent = parent;
-    mx_status_t status = device_get_protocol(parent, MX_PROTOCOL_PLATFORM_DEV, &pcm_ctx->pdev);
-    if (status !=  MX_OK) {
+    zx_status_t status = device_get_protocol(parent, ZX_PROTOCOL_PLATFORM_DEV, &pcm_ctx->pdev);
+    if (status !=  ZX_OK) {
         free(pcm_ctx);
         return status;
     }
@@ -742,21 +742,21 @@
                                         "pcm_bootstrap_thread");
     if (thrd_rc != thrd_success) {
         free(pcm_ctx);
-        return thrd_status_to_mx_status(thrd_rc);
+        return thrd_status_to_zx_status(thrd_rc);
     }
 
     thrd_detach(bootstrap_thrd);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t bcm_pcm_driver_ops = {
+static zx_driver_ops_t bcm_pcm_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = bcm_pcm_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(bcm_pcm, bcm_pcm_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PLATFORM_DEV),
+ZIRCON_DRIVER_BEGIN(bcm_pcm, bcm_pcm_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PLATFORM_DEV),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_VID, PDEV_VID_BROADCOMM),
     BI_MATCH_IF(EQ, BIND_PLATFORM_DEV_DID, PDEV_DID_BROADCOMM_PCM),
-MAGENTA_DRIVER_END(bcm_pcm)
+ZIRCON_DRIVER_END(bcm_pcm)
diff --git a/system/dev/audio/bcm-pcm/pcm.h b/system/dev/audio/bcm-pcm/pcm.h
index 229ef2d..dacf7de 100644
--- a/system/dev/audio/bcm-pcm/pcm.h
+++ b/system/dev/audio/bcm-pcm/pcm.h
@@ -8,7 +8,7 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 typedef volatile struct {
 
diff --git a/system/dev/audio/bcm-pcm/rules.mk b/system/dev/audio/bcm-pcm/rules.mk
index bf7ffbd..3323d74 100644
--- a/system/dev/audio/bcm-pcm/rules.mk
+++ b/system/dev/audio/bcm-pcm/rules.mk
@@ -15,6 +15,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/bcm system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/magenta system/ulib/mxio
+MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/zircon system/ulib/fdio
 
 include make/module.mk
diff --git a/system/dev/bcm/bcm-mailbox/mailbox.c b/system/dev/bcm/bcm-mailbox/mailbox.c
index cd645db..0e5c51b 100644
--- a/system/dev/bcm/bcm-mailbox/mailbox.c
+++ b/system/dev/bcm/bcm-mailbox/mailbox.c
@@ -15,9 +15,9 @@
 #include <ddk/protocol/display.h>
 #include <ddk/protocol/platform-device.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/assert.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/assert.h>
 
 #include <bcm/bcm28xx.h>
 #include <bcm/ioctl.h>
@@ -117,32 +117,32 @@
 // All devices are initially turned off.
 static uint32_t power_state = 0x0;
 
-static mx_status_t mailbox_write(const enum mailbox_channel ch, uint32_t value) {
+static zx_status_t mailbox_write(const enum mailbox_channel ch, uint32_t value) {
     value = value | ch;
 
     // Wait for there to be space in the FIFO.
-    mx_time_t deadline = mx_time_get(MX_CLOCK_MONOTONIC) + MX_MSEC(MAILBOX_IO_DEADLINE_MS);
+    zx_time_t deadline = zx_time_get(ZX_CLOCK_MONOTONIC) + ZX_MSEC(MAILBOX_IO_DEADLINE_MS);
     while (mailbox_regs[MAILBOX_STATUS] & MAILBOX_FULL) {
-        if (mx_time_get(MX_CLOCK_MONOTONIC) > deadline)
-            return MX_ERR_TIMED_OUT;
+        if (zx_time_get(ZX_CLOCK_MONOTONIC) > deadline)
+            return ZX_ERR_TIMED_OUT;
     }
 
     // Write the value to the mailbox.
     mailbox_regs[MAILBOX_WRITE] = value;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t mailbox_read(enum mailbox_channel ch, uint32_t* result) {
+static zx_status_t mailbox_read(enum mailbox_channel ch, uint32_t* result) {
     assert(result);
     uint32_t local_result = 0;
     uint32_t attempts = 0;
 
     do {
-        mx_time_t deadline = mx_time_get(MX_CLOCK_MONOTONIC) + MX_MSEC(MAILBOX_IO_DEADLINE_MS);
+        zx_time_t deadline = zx_time_get(ZX_CLOCK_MONOTONIC) + ZX_MSEC(MAILBOX_IO_DEADLINE_MS);
         while (mailbox_regs[MAILBOX_STATUS] & MAILBOX_EMPTY) {
-            if (mx_time_get(MX_CLOCK_MONOTONIC) > deadline)
-                return MX_ERR_TIMED_OUT;
+            if (zx_time_get(ZX_CLOCK_MONOTONIC) > deadline)
+                return ZX_ERR_TIMED_OUT;
         }
 
         local_result = mailbox_regs[MAILBOX_READ];
@@ -155,42 +155,42 @@
     // result into the ret parameter.
     *result = (local_result >> 4);
 
-    return attempts < MAX_MAILBOX_READ_ATTEMPTS ? MX_OK : MX_ERR_IO;
+    return attempts < MAX_MAILBOX_READ_ATTEMPTS ? ZX_OK : ZX_ERR_IO;
 }
 
 // Use the Videocore to power on/off devices.
-static mx_status_t bcm_vc_poweron(enum bcm_device dev) {
+static zx_status_t bcm_vc_poweron(enum bcm_device dev) {
     const uint32_t bit = 1 << dev;
-    mx_status_t ret = MX_OK;
+    zx_status_t ret = ZX_OK;
     uint32_t new_power_state = power_state | bit;
 
     if (new_power_state == power_state) {
         // The VideoCore won't return an ACK if we try to enable a device that's
         // already enabled, so we should terminate the control flow here.
-        return MX_OK;
+        return ZX_OK;
     }
 
     ret = mailbox_write(ch_power, new_power_state << 4);
-    if (ret != MX_OK)
+    if (ret != ZX_OK)
         return ret;
 
     // The Videocore must acknowledge a successful power on.
     uint32_t ack = 0x0;
     ret = mailbox_read(ch_power, &ack);
-    if (ret != MX_OK)
+    if (ret != ZX_OK)
         return ret;
 
     // Preserve the power state of the peripherals.
     power_state = ack;
 
     if (ack != new_power_state)
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t bcm_get_property_tag(uint8_t* buf, const size_t len) {
-    mx_status_t ret = MX_OK;
+static zx_status_t bcm_get_property_tag(uint8_t* buf, const size_t len) {
+    zx_status_t ret = ZX_OK;
     iotxn_t* txn;
 
     property_tag_header_t header;
@@ -204,8 +204,8 @@
         return ret;
 
     iotxn_physmap(txn);
-    MX_DEBUG_ASSERT(txn->phys_count == 1);
-    mx_paddr_t phys = iotxn_phys(txn);
+    ZX_DEBUG_ASSERT(txn->phys_count == 1);
+    zx_paddr_t phys = iotxn_phys(txn);
 
     uint32_t offset = 0;
 
@@ -219,13 +219,13 @@
     iotxn_cacheop(txn, IOTXN_CACHE_CLEAN, 0, header.buff_size);
 
     ret = mailbox_write(ch_propertytags_tovc, (phys + BCM_SDRAM_BUS_ADDR_BASE));
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         goto cleanup_and_exit;
     }
 
     uint32_t ack = 0x0;
     ret = mailbox_read(ch_propertytags_tovc, &ack);
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         goto cleanup_and_exit;
     }
 
@@ -237,28 +237,28 @@
     return ret;
 }
 
-static mx_status_t bcm_get_macid(void* ctx, uint8_t* mac) {
-    if (!mac) return MX_ERR_INVALID_ARGS;
+static zx_status_t bcm_get_macid(void* ctx, uint8_t* mac) {
+    if (!mac) return ZX_ERR_INVALID_ARGS;
     property_tag_get_macid_t tag = BCM_MAILBOX_TAG_GET_MACID;
 
-    mx_status_t ret = bcm_get_property_tag((uint8_t*)&tag, sizeof(tag));
+    zx_status_t ret = bcm_get_property_tag((uint8_t*)&tag, sizeof(tag));
 
     memcpy(mac, tag.macid, 6);
 
     return ret;
 }
 
-static mx_status_t bcm_get_clock_rate(void* ctx, const uint32_t clockid, uint32_t* res) {
-    if (!res) return MX_ERR_INVALID_ARGS;
+static zx_status_t bcm_get_clock_rate(void* ctx, const uint32_t clockid, uint32_t* res) {
+    if (!res) return ZX_ERR_INVALID_ARGS;
     property_tag_get_clock_rate_t tag = BCM_MAILBOX_TAG_GET_CLOCKRATE;
 
     tag.clockid = clockid;
 
-    mx_status_t ret = bcm_get_property_tag((uint8_t*)&tag, sizeof(tag));
+    zx_status_t ret = bcm_get_property_tag((uint8_t*)&tag, sizeof(tag));
 
     // Make sure that we're getting data back for the clock that we requested.
     if (tag.clockid != clockid) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     // Fill in the return parameter;
@@ -267,25 +267,25 @@
     return ret;
 }
 
-static mx_status_t mailbox_device_ioctl(void* ctx, uint32_t op,
+static zx_status_t mailbox_device_ioctl(void* ctx, uint32_t op,
                                         const void* in_buf, size_t in_len,
                                         void* out_buf, size_t out_len, size_t* out_actual) {
     switch (op) {
     case IOCTL_BCM_POWER_ON_USB:
         return bcm_vc_poweron(bcm_dev_usb);
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-static mx_protocol_device_t mailbox_device_protocol = {
+static zx_protocol_device_t mailbox_device_protocol = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = mailbox_device_ioctl,
 };
 
-static mx_status_t bcm_set_framebuffer(void* ctx, mx_paddr_t addr) {
-    mx_status_t ret = mailbox_write(ch_framebuffer, addr + BCM_SDRAM_BUS_ADDR_BASE);
-    if (ret != MX_OK)
+static zx_status_t bcm_set_framebuffer(void* ctx, zx_paddr_t addr) {
+    zx_status_t ret = mailbox_write(ch_framebuffer, addr + BCM_SDRAM_BUS_ADDR_BASE);
+    if (ret != ZX_OK)
         return ret;
 
     uint32_t ack = 0x0;
@@ -298,20 +298,20 @@
     .set_framebuffer = bcm_set_framebuffer,
 };
 
-static mx_status_t mailbox_get_protocol(void* ctx, uint32_t proto_id, void* out) {
-    if (proto_id == MX_PROTOCOL_BCM_BUS) {
+static zx_status_t mailbox_get_protocol(void* ctx, uint32_t proto_id, void* out) {
+    if (proto_id == ZX_PROTOCOL_BCM_BUS) {
         bcm_bus_protocol_t* proto = out;
         proto->ops = &bus_protocol_ops;
         proto->ctx = ctx;
-        return MX_OK;
+        return ZX_OK;
     } else {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-static mx_status_t mailbox_add_gpios(void* ctx, uint32_t start, uint32_t count, uint32_t mmio_index,
+static zx_status_t mailbox_add_gpios(void* ctx, uint32_t start, uint32_t count, uint32_t mmio_index,
                                      const uint32_t* irqs, uint32_t irq_count) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 }
 
 static pbus_interface_ops_t mailbox_bus_ops = {
@@ -319,19 +319,19 @@
     .add_gpios = mailbox_add_gpios,
 };
 
-static mx_status_t mailbox_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t mailbox_bind(void* ctx, zx_device_t* parent, void** cookie) {
     platform_device_protocol_t pdev;
-    if (device_get_protocol(parent, MX_PROTOCOL_PLATFORM_DEV, &pdev) != MX_OK) {
-        return MX_ERR_NOT_SUPPORTED;
+    if (device_get_protocol(parent, ZX_PROTOCOL_PLATFORM_DEV, &pdev) != ZX_OK) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Carve out some address space for the device -- it's memory mapped.
     uintptr_t mmio_base;
     size_t mmio_size;
-    mx_handle_t mmio_handle;
-    mx_status_t status = pdev_map_mmio(&pdev, MAILBOX_MMIO, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_handle_t mmio_handle;
+    zx_status_t status = pdev_map_mmio(&pdev, MAILBOX_MMIO, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                        (void **)&mmio_base, &mmio_size, &mmio_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("mailbox_bind pdev_map_mmio failed %d\n", status);
         return status;
     }
@@ -349,9 +349,9 @@
     };
 
     status = device_add(parent, &vc_rpc_args, NULL);
-    if (status != MX_OK) {
-        mx_vmar_unmap(mx_vmar_root_self(), mmio_base, mmio_size);
-        mx_handle_close(mmio_handle);
+    if (status != ZX_OK) {
+        zx_vmar_unmap(zx_vmar_root_self(), mmio_base, mmio_size);
+        zx_handle_close(mmio_handle);
         return status;
     }
 
@@ -364,17 +364,17 @@
     intf.ctx = NULL;    // TODO(voydanoff) - add mailbox ctx struct
     pdev_set_interface(&pdev, &intf);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t bcm_mailbox_driver_ops = {
+static zx_driver_ops_t bcm_mailbox_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = mailbox_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(bcm_mailbox, bcm_mailbox_driver_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PLATFORM_DEV),
+ZIRCON_DRIVER_BEGIN(bcm_mailbox, bcm_mailbox_driver_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PLATFORM_DEV),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_VID, PDEV_VID_BROADCOMM),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_PID, PDEV_PID_BROADCOMM_RPI3),
     BI_MATCH_IF(EQ, BIND_PLATFORM_DEV_DID, PDEV_BUS_IMPLEMENTOR_DID),
-MAGENTA_DRIVER_END(bcm_mailbox)
+ZIRCON_DRIVER_END(bcm_mailbox)
diff --git a/system/dev/bcm/bcm-mailbox/rules.mk b/system/dev/bcm/bcm-mailbox/rules.mk
index 78cb9e3..e994d64 100644
--- a/system/dev/bcm/bcm-mailbox/rules.mk
+++ b/system/dev/bcm/bcm-mailbox/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/bcm
 
-MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/magenta
+MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/zircon
 
 include make/module.mk
diff --git a/system/dev/bcm/bcm-mmc/emmc.c b/system/dev/bcm/bcm-mmc/emmc.c
index f4f1a0d..5fc9fe6 100644
--- a/system/dev/bcm/bcm-mmc/emmc.c
+++ b/system/dev/bcm/bcm-mmc/emmc.c
@@ -35,7 +35,7 @@
 #include <ddk/protocol/platform-device.h>
 #include <ddk/protocol/sdhci.h>
 
-#include <magenta/process.h>
+#include <zircon/process.h>
 
 // BCM28xx Specific Includes
 #include <bcm/bcm28xx.h>
@@ -60,47 +60,47 @@
 
 
 typedef struct emmc {
-    mx_device_t* mxdev;
-    mx_device_t* parent;
+    zx_device_t* mxdev;
+    zx_device_t* parent;
    platform_device_protocol_t pdev;
    void* mmio_base;
    size_t mmio_size;
-   mx_handle_t mmio_handle;
+   zx_handle_t mmio_handle;
 } emmc_t;
 
-static mx_handle_t emmc_sdhci_get_interrupt(void* ctx) {
+static zx_handle_t emmc_sdhci_get_interrupt(void* ctx) {
     emmc_t* emmc = ctx;
 
-    mx_handle_t handle;
-    if (pdev_map_interrupt(&emmc->pdev, IRQ_INDEX, &handle) == MX_OK) {
+    zx_handle_t handle;
+    if (pdev_map_interrupt(&emmc->pdev, IRQ_INDEX, &handle) == ZX_OK) {
         return handle;
     } else {
-        return MX_HANDLE_INVALID;
+        return ZX_HANDLE_INVALID;
     }
 }
 
-static mx_status_t emmc_sdhci_get_mmio(void* ctx, volatile sdhci_regs_t** out) {
+static zx_status_t emmc_sdhci_get_mmio(void* ctx, volatile sdhci_regs_t** out) {
     emmc_t* emmc = ctx;
 
     if (!emmc->mmio_base) {
-        mx_status_t status = pdev_map_mmio(&emmc->pdev, MMIO_INDEX, MX_CACHE_POLICY_UNCACHED_DEVICE,
+        zx_status_t status = pdev_map_mmio(&emmc->pdev, MMIO_INDEX, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                            &emmc->mmio_base, &emmc->mmio_size, &emmc->mmio_handle);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
     }
 
     *out = emmc->mmio_base;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static uint32_t emmc_sdhci_get_base_clock(void* ctx) {
     uint32_t base_clock = 0;
     emmc_t* emmc = ctx;
     bcm_bus_protocol_t bus_proto;
-    mx_status_t st = pdev_get_protocol(&emmc->pdev, MX_PROTOCOL_BCM_BUS, (void*)&bus_proto);
-    if (st != MX_OK) {
-        xprintf("emmc: could not find MX_PROTOCOL_BCM_BUS\n");
+    zx_status_t st = pdev_get_protocol(&emmc->pdev, ZX_PROTOCOL_BCM_BUS, (void*)&bus_proto);
+    if (st != ZX_OK) {
+        xprintf("emmc: could not find ZX_PROTOCOL_BCM_BUS\n");
         goto out;
     }
     const uint32_t bcm28xX_core_clock_id = 1;
@@ -112,7 +112,7 @@
      return base_clock;
 }
 
-static mx_paddr_t emmc_sdhci_get_dma_offset(void* ctx) {
+static zx_paddr_t emmc_sdhci_get_dma_offset(void* ctx) {
     return BCM_SDRAM_BUS_ADDR_BASE;
 }
 
@@ -137,25 +137,25 @@
     emmc_t* emmc = ctx;
 
     if (emmc->mmio_base) {
-        mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)emmc->mmio_base, emmc->mmio_size);
-        mx_handle_close(emmc->mmio_handle);
+        zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)emmc->mmio_base, emmc->mmio_size);
+        zx_handle_close(emmc->mmio_handle);
     }
     free(emmc);
 }
 
-static mx_protocol_device_t emmc_device_proto = {
+static zx_protocol_device_t emmc_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = emmc_unbind,
     .release = emmc_release,
 };
 
-static mx_status_t emmc_bind(void* drv_ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t emmc_bind(void* drv_ctx, zx_device_t* dev, void** cookie) {
     emmc_t* emmc = calloc(1, sizeof(emmc_t));
     if (!emmc) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    mx_status_t st = device_get_protocol(dev, MX_PROTOCOL_PLATFORM_DEV, &emmc->pdev);
-    if (st !=  MX_OK) {
+    zx_status_t st = device_get_protocol(dev, ZX_PROTOCOL_PLATFORM_DEV, &emmc->pdev);
+    if (st !=  ZX_OK) {
         free(emmc);
         return st;
     }
@@ -167,29 +167,29 @@
         .name = "bcm-emmc",
         .ctx = emmc,
         .ops = &emmc_device_proto,
-        .proto_id = MX_PROTOCOL_SDHCI,
+        .proto_id = ZX_PROTOCOL_SDHCI,
         .proto_ops = &emmc_sdhci_proto,
     };
     st = device_add(emmc->parent, &args, &emmc->mxdev);
-    if (st != MX_OK) {
+    if (st != ZX_OK) {
         goto fail;
     }
-    return MX_OK;
+    return ZX_OK;
 fail:
     free(emmc);
     return st;
 }
 
-static mx_driver_ops_t emmc_dwc_driver_ops = {
+static zx_driver_ops_t emmc_dwc_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = emmc_bind,
 };
 
 // The formatter does not play nice with these macros.
 // clang-format off
-MAGENTA_DRIVER_BEGIN(bcm_emmc, emmc_dwc_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PLATFORM_DEV),
+ZIRCON_DRIVER_BEGIN(bcm_emmc, emmc_dwc_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PLATFORM_DEV),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_VID, PDEV_VID_BROADCOMM),
     BI_MATCH_IF(EQ, BIND_PLATFORM_DEV_DID, PDEV_DID_BROADCOMM_EMMC),
-MAGENTA_DRIVER_END(bcm_emmc)
+ZIRCON_DRIVER_END(bcm_emmc)
 // clang-format on
diff --git a/system/dev/bcm/bcm-mmc/rules.mk b/system/dev/bcm/bcm-mmc/rules.mk
index 072319b..0f755ca 100644
--- a/system/dev/bcm/bcm-mmc/rules.mk
+++ b/system/dev/bcm/bcm-mmc/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/bcm
 
-MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/magenta
+MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/zircon
 
 include make/module.mk
diff --git a/system/dev/block/ahci/ahci.c b/system/dev/block/ahci/ahci.c
index cf5fa58..465be12 100644
--- a/system/dev/block/ahci/ahci.c
+++ b/system/dev/block/ahci/ahci.c
@@ -9,10 +9,10 @@
 #include <ddk/protocol/pci.h>
 
 #include <assert.h>
-#include <magenta/listnode.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <magenta/assert.h>
+#include <zircon/listnode.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <zircon/assert.h>
 #include <pretty/hexdump.h>
 #include <sync/completion.h>
 #include <inttypes.h>
@@ -68,15 +68,15 @@
 } ahci_port_t;
 
 typedef struct ahci_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     ahci_hba_t* regs;
     uint64_t regs_size;
-    mx_handle_t regs_handle;
+    zx_handle_t regs_handle;
 
     pci_protocol_t pci;
 
-    mx_handle_t irq_handle;
+    zx_handle_t irq_handle;
     thrd_t irq_thread;
 
     thrd_t worker_thread;
@@ -90,26 +90,26 @@
     ahci_port_t ports[AHCI_MAX_PORTS];
 } ahci_device_t;
 
-static inline mx_status_t ahci_wait_for_clear(const volatile uint32_t* reg, uint32_t mask, mx_time_t timeout) {
+static inline zx_status_t ahci_wait_for_clear(const volatile uint32_t* reg, uint32_t mask, zx_time_t timeout) {
     int i = 0;
-    mx_time_t start_time = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t start_time = zx_time_get(ZX_CLOCK_MONOTONIC);
     do {
-        if (!(ahci_read(reg) & mask)) return MX_OK;
+        if (!(ahci_read(reg) & mask)) return ZX_OK;
         usleep(10 * 1000);
         i++;
-    } while (mx_time_get(MX_CLOCK_MONOTONIC) - start_time < timeout);
-    return MX_ERR_TIMED_OUT;
+    } while (zx_time_get(ZX_CLOCK_MONOTONIC) - start_time < timeout);
+    return ZX_ERR_TIMED_OUT;
 }
 
-static inline mx_status_t ahci_wait_for_set(const volatile uint32_t* reg, uint32_t mask, mx_time_t timeout) {
+static inline zx_status_t ahci_wait_for_set(const volatile uint32_t* reg, uint32_t mask, zx_time_t timeout) {
     int i = 0;
-    mx_time_t start_time = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t start_time = zx_time_get(ZX_CLOCK_MONOTONIC);
     do {
-        if (ahci_read(reg) & mask) return MX_OK;
+        if (ahci_read(reg) & mask) return ZX_OK;
         usleep(10 * 1000);
         i++;
-    } while (mx_time_get(MX_CLOCK_MONOTONIC) - start_time < timeout);
-    return MX_ERR_TIMED_OUT;
+    } while (zx_time_get(ZX_CLOCK_MONOTONIC) - start_time < timeout);
+    return ZX_ERR_TIMED_OUT;
 }
 
 static void ahci_port_disable(ahci_port_t* port) {
@@ -117,7 +117,7 @@
     if (!(cmd & AHCI_PORT_CMD_ST)) return;
     cmd &= ~AHCI_PORT_CMD_ST;
     ahci_write(&port->regs->cmd, cmd);
-    mx_status_t status = ahci_wait_for_clear(&port->regs->cmd, AHCI_PORT_CMD_CR, 500 * 1000 * 1000);
+    zx_status_t status = ahci_wait_for_clear(&port->regs->cmd, AHCI_PORT_CMD_CR, 500 * 1000 * 1000);
     if (status) {
         xprintf("ahci.%d: port disable timed out\n", port->nr);
     }
@@ -130,7 +130,7 @@
         xprintf("ahci.%d: cannot enable port without FRE enabled\n", port->nr);
         return;
     }
-    mx_status_t status = ahci_wait_for_clear(&port->regs->cmd, AHCI_PORT_CMD_CR, 500 * 1000 * 1000);
+    zx_status_t status = ahci_wait_for_clear(&port->regs->cmd, AHCI_PORT_CMD_CR, 500 * 1000 * 1000);
     if (status) {
         xprintf("ahci.%d: dma engine still running when enabling port\n", port->nr);
     }
@@ -146,7 +146,7 @@
     ahci_write(&port->regs->serr, ahci_read(&port->regs->serr));
 
     // wait for device idle
-    mx_status_t status = ahci_wait_for_clear(&port->regs->tfd, AHCI_PORT_TFD_BUSY | AHCI_PORT_TFD_DATA_REQUEST, 1000 * 1000 * 1000);
+    zx_status_t status = ahci_wait_for_clear(&port->regs->tfd, AHCI_PORT_TFD_BUSY | AHCI_PORT_TFD_DATA_REQUEST, 1000 * 1000 * 1000);
     if (status < 0) {
         // if busy is not cleared, do a full comreset
         xprintf("ahci.%d: timed out waiting for port idle, resetting\n", port->nr);
@@ -202,26 +202,26 @@
     return (cmd == SATA_CMD_READ_FPDMA_QUEUED) || (cmd == SATA_CMD_WRITE_FPDMA_QUEUED);
 }
 
-static void ahci_port_complete_txn(ahci_device_t* dev, ahci_port_t* port, mx_status_t status) {
+static void ahci_port_complete_txn(ahci_device_t* dev, ahci_port_t* port, zx_status_t status) {
     mtx_lock(&port->lock);
     uint32_t sact = ahci_read(&port->regs->sact);
     uint32_t running = port->running;
     uint32_t done = sact ^ running;
     // assert if a channel without an outstanding transaction is active
-    MX_DEBUG_ASSERT(!(done & sact));
+    ZX_DEBUG_ASSERT(!(done & sact));
     port->completed |= done;
     mtx_unlock(&port->lock);
     // hit the worker thread to complete commands
     completion_signal(&dev->worker_completion);
 }
 
-static mx_status_t ahci_do_txn(ahci_device_t* dev, ahci_port_t* port, int slot, iotxn_t* txn) {
+static zx_status_t ahci_do_txn(ahci_device_t* dev, ahci_port_t* port, int slot, iotxn_t* txn) {
     assert(slot < AHCI_MAX_COMMANDS);
     assert(!ahci_port_cmd_busy(port, slot));
 
     sata_pdata_t* pdata = sata_iotxn_pdata(txn);
-    mx_status_t status = iotxn_physmap(txn);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_physmap(txn);
+    if (status != ZX_OK) {
         iotxn_complete(txn, status, 0);
         completion_signal(&dev->worker_completion);
         return status;
@@ -279,20 +279,20 @@
     cl->prdtl = 0;
     ahci_prd_t* prd = (ahci_prd_t*)((void*)port->ct[slot] + sizeof(ahci_ct_t));
     size_t length;
-    mx_paddr_t paddr;
+    zx_paddr_t paddr;
     for (;;) {
         length = iotxn_phys_iter_next(&iter, &paddr);
         if (length == 0) {
             break;
         } else if (length > AHCI_PRD_MAX_SIZE) {
             printf("ahci.%d: chunk size > %zu is unsupported\n", port->nr, length);
-            status = MX_ERR_NOT_SUPPORTED;
+            status = ZX_ERR_NOT_SUPPORTED;
             iotxn_complete(txn, status, 0);
             completion_signal(&dev->worker_completion);
             return status;
         } else if (cl->prdtl == AHCI_MAX_PRDS) {
             printf("ahci.%d: txn with more than %d chunks is unsupported\n", port->nr, cl->prdtl);
-            status = MX_ERR_NOT_SUPPORTED;
+            status = ZX_ERR_NOT_SUPPORTED;
             iotxn_complete(txn, status, 0);
             completion_signal(&dev->worker_completion);
             return status;
@@ -316,27 +316,27 @@
 
     // set the watchdog
     // TODO: general timeout mechanism
-    pdata->timeout = mx_time_get(MX_CLOCK_MONOTONIC) + MX_SEC(1);
+    pdata->timeout = zx_time_get(ZX_CLOCK_MONOTONIC) + ZX_SEC(1);
     completion_signal(&dev->watchdog_completion);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ahci_port_initialize(ahci_port_t* port) {
+static zx_status_t ahci_port_initialize(ahci_port_t* port) {
     uint32_t cmd = ahci_read(&port->regs->cmd);
     if (cmd & (AHCI_PORT_CMD_ST | AHCI_PORT_CMD_FRE | AHCI_PORT_CMD_CR | AHCI_PORT_CMD_FR)) {
         xprintf("ahci.%d: port busy\n", port->nr);
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     }
 
     // allocate memory for the command list, FIS receive area, command table and PRDT
     size_t mem_sz = sizeof(ahci_fis_t) + sizeof(ahci_cl_t) * AHCI_MAX_COMMANDS
                     + (sizeof(ahci_ct_t) + sizeof(ahci_prd_t) * AHCI_MAX_PRDS) * AHCI_MAX_COMMANDS;
-    mx_status_t status = io_buffer_init(&port->buffer, mem_sz, IO_BUFFER_RW);
+    zx_status_t status = io_buffer_init(&port->buffer, mem_sz, IO_BUFFER_RW);
     if (status < 0) {
         xprintf("ahci.%d: error %d allocating dma memory\n", port->nr, status);
         return status;
     }
-    mx_paddr_t mem_phys = io_buffer_phys(&port->buffer);
+    zx_paddr_t mem_phys = io_buffer_phys(&port->buffer);
     void* mem = io_buffer_virt(&port->buffer);
 
     // clear memory area
@@ -387,7 +387,7 @@
     cmd |= AHCI_PORT_CMD_FRE;
     ahci_write(&port->regs->cmd, cmd);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void ahci_enable_ahci(ahci_device_t* dev) {
@@ -410,7 +410,7 @@
     ghc |= AHCI_GHC_HR;
     ahci_write(&dev->regs->ghc, ghc);
     // reset should complete within 1 second
-    mx_status_t status = ahci_wait_for_clear(&dev->regs->ghc, AHCI_GHC_HR, 1000 * 1000 * 1000);
+    zx_status_t status = ahci_wait_for_clear(&dev->regs->ghc, AHCI_GHC_HR, 1000 * 1000 * 1000);
     if (status) {
         xprintf("ahci: hba reset timed out\n");
     }
@@ -426,7 +426,7 @@
 
     // complete empty txns immediately
     if (txn->length == 0) {
-        iotxn_complete(txn, MX_OK, txn->length);
+        iotxn_complete(txn, ZX_OK, txn->length);
         return;
     }
 
@@ -468,7 +468,7 @@
                     xprintf("ahci.%d: illegal state, completing slot %d but txn == NULL\n", port->nr, slot);
                 } else {
                     mtx_unlock(&port->lock);
-                    iotxn_complete(txn, MX_OK, txn->length);
+                    iotxn_complete(txn, ZX_OK, txn->length);
                     mtx_lock(&port->lock);
                 }
                 port->completed &= ~(1 << slot);
@@ -517,7 +517,7 @@
             mtx_unlock(&port->lock);
         }
         // wait here until more commands are queued, or a port becomes idle
-        completion_wait(&dev->worker_completion, MX_TIME_INFINITE);
+        completion_wait(&dev->worker_completion, ZX_TIME_INFINITE);
         completion_reset(&dev->worker_completion);
     }
     return 0;
@@ -527,7 +527,7 @@
     ahci_device_t* dev = (ahci_device_t*)arg;
     for (;;) {
         bool idle = true;
-        mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+        zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
         for (int i = 0; i < AHCI_MAX_PORTS; i++) {
             ahci_port_t* port = &dev->ports[i];
             if (!(port->flags & (AHCI_PORT_FLAG_IMPLEMENTED | AHCI_PORT_FLAG_PRESENT))) {
@@ -550,7 +550,7 @@
                         port->running &= ~(1 << slot);
                         port->commands[slot] = NULL;
                         mtx_unlock(&port->lock);
-                        iotxn_complete(txn, MX_ERR_TIMED_OUT, 0);
+                        iotxn_complete(txn, ZX_ERR_TIMED_OUT, 0);
                         mtx_lock(&port->lock);
                     }
                 }
@@ -560,7 +560,7 @@
         }
 
         // no need to run the watchdog if there are no active xfers
-        completion_wait(&dev->watchdog_completion, idle ? MX_TIME_INFINITE : 5ULL * 1000 * 1000 * 1000);
+        completion_wait(&dev->watchdog_completion, idle ? ZX_TIME_INFINITE : 5ULL * 1000 * 1000 * 1000);
         completion_reset(&dev->watchdog_completion);
     }
     return 0;
@@ -580,17 +580,17 @@
     }
     if (is & AHCI_PORT_INT_ERROR) { // error
         xprintf("ahci.%d: error is=0x%08x\n", nr, is);
-        ahci_port_complete_txn(dev, port, MX_ERR_INTERNAL);
+        ahci_port_complete_txn(dev, port, ZX_ERR_INTERNAL);
     } else if (is) {
-        ahci_port_complete_txn(dev, port, MX_OK);
+        ahci_port_complete_txn(dev, port, ZX_OK);
     }
 }
 
 static int ahci_irq_thread(void* arg) {
     ahci_device_t* dev = (ahci_device_t*)arg;
-    mx_status_t status;
+    zx_status_t status;
     for (;;) {
-        status = mx_interrupt_wait(dev->irq_handle);
+        status = zx_interrupt_wait(dev->irq_handle);
         if (status) {
             xprintf("ahci: error %d waiting for interrupt\n", status);
             continue;
@@ -598,7 +598,7 @@
         // mask hba interrupts while interrupts are being handled
         uint32_t ghc = ahci_read(&dev->regs->ghc);
         ahci_write(&dev->regs->ghc, ghc & ~AHCI_GHC_IE);
-        mx_interrupt_complete(dev->irq_handle);
+        zx_interrupt_complete(dev->irq_handle);
 
         // handle interrupt for each port
         uint32_t is = ahci_read(&dev->regs->is);
@@ -619,13 +619,13 @@
 
 // implement device protocol:
 
-static mx_protocol_device_t ahci_device_proto = {
+static zx_protocol_device_t ahci_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = ahci_iotxn_queue,
     .release = ahci_release,
 };
 
-extern mx_protocol_device_t ahci_port_device_proto;
+extern zx_protocol_device_t ahci_port_device_proto;
 
 static int ahci_init_thread(void* arg) {
     ahci_device_t* dev = (ahci_device_t*)arg;
@@ -642,7 +642,7 @@
     uint32_t port_map = ahci_read(&dev->regs->pi);
 
     // initialize ports
-    mx_status_t status;
+    zx_status_t status;
     ahci_port_t* port;
     for (int i = 0; i < AHCI_MAX_PORTS; i++) {
         port = &dev->ports[i];
@@ -689,7 +689,7 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 fail:
     free(dev->ports);
     return status;
@@ -697,52 +697,52 @@
 
 // implement driver object:
 
-static mx_status_t ahci_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t ahci_bind(void* ctx, zx_device_t* dev, void** cookie) {
     // map resources and initalize the device
     ahci_device_t* device = calloc(1, sizeof(ahci_device_t));
     if (!device) {
         xprintf("ahci: out of memory\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    if (device_get_protocol(dev, MX_PROTOCOL_PCI, &device->pci)) {
+    if (device_get_protocol(dev, ZX_PROTOCOL_PCI, &device->pci)) {
         free(device);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // map register window
-    mx_status_t status = pci_map_resource(&device->pci,
+    zx_status_t status = pci_map_resource(&device->pci,
                                           PCI_RESOURCE_BAR_5,
-                                          MX_CACHE_POLICY_UNCACHED_DEVICE,
+                                          ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                           (void**)&device->regs,
                                           &device->regs_size,
                                           &device->regs_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("ahci: error %d mapping register window\n", status);
         goto fail;
     }
 
     const pci_config_t* config;
     size_t config_size;
-    mx_handle_t config_handle;
+    zx_handle_t config_handle;
     status = pci_map_resource(&device->pci,
                               PCI_RESOURCE_CONFIG,
-                              MX_CACHE_POLICY_UNCACHED_DEVICE,
+                              ZX_CACHE_POLICY_UNCACHED_DEVICE,
                               (void**)&config,
                               &config_size, &config_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("ahci: error %d getting pci config\n", status);
         goto fail;
     }
 
     if (config->sub_class != 0x06 && config->base_class == 0x01) { // SATA
-        status = MX_ERR_NOT_SUPPORTED;
+        status = ZX_ERR_NOT_SUPPORTED;
         xprintf("ahci: device class 0x%x unsupported!\n", config->sub_class);
-        mx_handle_close(config_handle);
+        zx_handle_close(config_handle);
         goto fail;
     }
     // FIXME intel devices need to set SATA port enable at config + 0x92
-    mx_handle_close(config_handle);
+    zx_handle_close(config_handle);
 
     // ahci controller is bus master
     status = pci_enable_bus_master(&device->pci, true);
@@ -752,7 +752,7 @@
     }
 
     // set msi irq mode
-    status = pci_set_irq_mode(&device->pci, MX_PCIE_IRQ_MODE_MSI, 1);
+    status = pci_set_irq_mode(&device->pci, ZX_PCIE_IRQ_MODE_MSI, 1);
     if (status < 0) {
         xprintf("ahci: error %d setting irq mode\n", status);
         goto fail;
@@ -760,7 +760,7 @@
 
     // get irq handle
     status = pci_map_interrupt(&device->pci, 0, &device->irq_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("ahci: error %d getting irq handle\n", status);
         goto fail;
     }
@@ -794,7 +794,7 @@
     };
 
     status = device_add(dev, &args, &device->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("ahci: error %d in device_add\n", status);
         goto fail;
     }
@@ -807,22 +807,22 @@
         goto fail;
     }
 
-    return MX_OK;
+    return ZX_OK;
 fail:
     // FIXME unmap, and join any threads created above
     free(device);
     return status;
 }
 
-static mx_driver_ops_t ahci_driver_ops = {
+static zx_driver_ops_t ahci_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ahci_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(ahci, ahci_driver_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+ZIRCON_DRIVER_BEGIN(ahci, ahci_driver_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_CLASS, 0x01),
     BI_ABORT_IF(NE, BIND_PCI_SUBCLASS, 0x06),
     BI_MATCH_IF(EQ, BIND_PCI_INTERFACE, 0x01),
-MAGENTA_DRIVER_END(ahci)
+ZIRCON_DRIVER_END(ahci)
diff --git a/system/dev/block/ahci/rules.mk b/system/dev/block/ahci/rules.mk
index 68e94b7..b667ca2 100644
--- a/system/dev/block/ahci/rules.mk
+++ b/system/dev/block/ahci/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/pretty system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/block/ahci/sata.c b/system/dev/block/ahci/sata.c
index a76b1e9..f9978f0 100644
--- a/system/dev/block/ahci/sata.c
+++ b/system/dev/block/ahci/sata.c
@@ -7,7 +7,7 @@
 #include <ddk/binding.h>
 #include <ddk/protocol/block.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <pretty/hexdump.h>
 #include <sync/completion.h>
 #include <sys/param.h>
@@ -38,8 +38,8 @@
 #define SATA_FLAG_LBA48 (1 << 1)
 
 typedef struct sata_device {
-    mx_device_t* mxdev;
-    mx_device_t* parent;
+    zx_device_t* mxdev;
+    zx_device_t* parent;
 
     block_callbacks_t* callbacks;
 
@@ -48,18 +48,18 @@
     int max_cmd; // inclusive
 
     size_t sector_sz;
-    mx_off_t capacity; // bytes
+    zx_off_t capacity; // bytes
 } sata_device_t;
 
 static void sata_device_identify_complete(iotxn_t* txn, void* cookie) {
     completion_signal((completion_t*)cookie);
 }
 
-static mx_status_t sata_device_identify(sata_device_t* dev, mx_device_t* controller, const char* name) {
+static zx_status_t sata_device_identify(sata_device_t* dev, zx_device_t* controller, const char* name) {
     // send IDENTIFY DEVICE
     iotxn_t* txn;
-    mx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, 512);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, 512);
+    if (status != ZX_OK) {
         xprintf("%s: error %d allocating iotxn\n", name, status);
         return status;
     }
@@ -76,9 +76,9 @@
     txn->length = 512;
 
     iotxn_queue(controller, txn);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 
-    if (txn->status != MX_OK) {
+    if (txn->status != ZX_OK) {
         xprintf("%s: error %d in device identify\n", name, txn->status);
         return txn->status;
     }
@@ -149,19 +149,19 @@
     }
     dev->flags = flags;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // implement device protocol:
 
-static mx_protocol_device_t sata_device_proto;
+static zx_protocol_device_t sata_device_proto;
 
 static void sata_iotxn_queue(void* ctx, iotxn_t* txn) {
     sata_device_t* device = ctx;
 
     // offset must be aligned to block size
     if (txn->offset % device->sector_sz) {
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
 
@@ -190,7 +190,7 @@
     info->max_transfer_size = AHCI_MAX_PRDS * PAGE_SIZE; // fully discontiguous
 }
 
-static mx_status_t sata_ioctl(void* ctx, uint32_t op, const void* cmd, size_t cmdlen, void* reply,
+static zx_status_t sata_ioctl(void* ctx, uint32_t op, const void* cmd, size_t cmdlen, void* reply,
                               size_t max, size_t* out_actual) {
     sata_device_t* device = ctx;
     // TODO implement other block ioctls
@@ -198,10 +198,10 @@
     case IOCTL_BLOCK_GET_INFO: {
         block_info_t* info = reply;
         if (max < sizeof(*info))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         sata_get_info(device, info);
         *out_actual = sizeof(*info);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_RR_PART: {
         // rebind to reread the partition table
@@ -209,8 +209,8 @@
     }
     case IOCTL_DEVICE_SYNC: {
         iotxn_t* txn;
-        mx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, 0);
-        if (status != MX_OK) {
+        zx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, 0);
+        if (status != ZX_OK) {
             return status;
         }
         completion_t completion = COMPLETION_INIT;
@@ -221,17 +221,17 @@
         txn->complete_cb = sata_sync_complete;
         txn->cookie = &completion;
         iotxn_queue(device->mxdev, txn);
-        completion_wait(&completion, MX_TIME_INFINITE);
+        completion_wait(&completion, ZX_TIME_INFINITE);
         status = txn->status;
         iotxn_release(txn);
         return status;
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-static mx_off_t sata_getsize(void* ctx) {
+static zx_off_t sata_getsize(void* ctx) {
     sata_device_t* device = ctx;
     return device->capacity;
 }
@@ -241,7 +241,7 @@
     free(device);
 }
 
-static mx_protocol_device_t sata_device_proto = {
+static zx_protocol_device_t sata_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = sata_ioctl,
     .iotxn_queue = sata_iotxn_queue,
@@ -267,21 +267,21 @@
     iotxn_release(txn);
 }
 
-static void sata_block_txn(sata_device_t* dev, uint32_t opcode, mx_handle_t vmo,
+static void sata_block_txn(sata_device_t* dev, uint32_t opcode, zx_handle_t vmo,
                            uint64_t length, uint64_t vmo_offset, uint64_t dev_offset,
                            void* cookie) {
     if ((dev_offset % dev->sector_sz) || (length % dev->sector_sz)) {
-        dev->callbacks->complete(cookie, MX_ERR_INVALID_ARGS);
+        dev->callbacks->complete(cookie, ZX_ERR_INVALID_ARGS);
         return;
     }
     if ((dev_offset >= dev->capacity) || (length >= (dev->capacity - dev_offset))) {
-        dev->callbacks->complete(cookie, MX_ERR_OUT_OF_RANGE);
+        dev->callbacks->complete(cookie, ZX_ERR_OUT_OF_RANGE);
         return;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     iotxn_t* txn;
-    if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length)) != MX_OK) {
+    if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length)) != ZX_OK) {
         dev->callbacks->complete(cookie, status);
         return;
     }
@@ -294,12 +294,12 @@
     iotxn_queue(dev->mxdev, txn);
 }
 
-static void sata_block_read(void* ctx, mx_handle_t vmo, uint64_t length,
+static void sata_block_read(void* ctx, zx_handle_t vmo, uint64_t length,
                            uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     sata_block_txn(ctx, IOTXN_OP_READ, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
-static void sata_block_write(void* ctx, mx_handle_t vmo, uint64_t length,
+static void sata_block_write(void* ctx, zx_handle_t vmo, uint64_t length,
                             uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     sata_block_txn(ctx, IOTXN_OP_WRITE, vmo, length, vmo_offset, dev_offset, cookie);
 }
@@ -311,12 +311,12 @@
     .write = sata_block_write,
 };
 
-mx_status_t sata_bind(mx_device_t* dev, int port) {
+zx_status_t sata_bind(zx_device_t* dev, int port) {
     // initialize the device
     sata_device_t* device = calloc(1, sizeof(sata_device_t));
     if (!device) {
         xprintf("sata: out of memory\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     device->parent = dev;
 
@@ -326,7 +326,7 @@
     snprintf(name, sizeof(name), "sata%d", port);
 
     // send device identify
-    mx_status_t status = sata_device_identify(device, dev, name);
+    zx_status_t status = sata_device_identify(device, dev, name);
     if (status < 0) {
         free(device);
         return status;
@@ -338,7 +338,7 @@
         .name = name,
         .ctx = device,
         .ops = &sata_device_proto,
-        .proto_id = MX_PROTOCOL_BLOCK_CORE,
+        .proto_id = ZX_PROTOCOL_BLOCK_CORE,
         .proto_ops = &sata_block_ops,
     };
 
@@ -348,5 +348,5 @@
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/block/ahci/sata.h b/system/dev/block/ahci/sata.h
index 76db0cf..582c502 100644
--- a/system/dev/block/ahci/sata.h
+++ b/system/dev/block/ahci/sata.h
@@ -33,7 +33,7 @@
 #define SATA_DEVINFO_MODEL_ID_LEN 40
 
 typedef struct sata_pdata {
-    mx_time_t timeout; // for ahci driver watchdog
+    zx_time_t timeout; // for ahci driver watchdog
     uint64_t lba;   // in blocks
     uint16_t count; // in blocks
     uint8_t cmd;
@@ -44,4 +44,4 @@
 
 #define sata_iotxn_pdata(txn) iotxn_pdata(txn, sata_pdata_t)
 
-mx_status_t sata_bind(mx_device_t* dev, int port);
+zx_status_t sata_bind(zx_device_t* dev, int port);
diff --git a/system/dev/block/block/block.c b/system/dev/block/block/block.c
index 40b15c9..1b45917 100644
--- a/system/dev/block/block/block.c
+++ b/system/dev/block/block/block.c
@@ -7,8 +7,8 @@
 #include <ddk/binding.h>
 #include <ddk/protocol/block.h>
 
-#include <magenta/process.h>
-#include <magenta/types.h>
+#include <zircon/process.h>
+#include <zircon/types.h>
 #include <sys/param.h>
 #include <assert.h>
 #include <inttypes.h>
@@ -21,8 +21,8 @@
 #include "server.h"
 
 typedef struct blkdev {
-    mx_device_t* mxdev;
-    mx_device_t* parent;
+    zx_device_t* mxdev;
+    zx_device_t* parent;
     block_protocol_t proto;
 
     mtx_t lock;
@@ -58,19 +58,19 @@
     return 0;
 }
 
-static mx_status_t blkdev_get_fifos(blkdev_t* bdev, void* out_buf, size_t out_len) {
-    if (out_len < sizeof(mx_handle_t)) {
-        return MX_ERR_INVALID_ARGS;
+static zx_status_t blkdev_get_fifos(blkdev_t* bdev, void* out_buf, size_t out_len) {
+    if (out_len < sizeof(zx_handle_t)) {
+        return ZX_ERR_INVALID_ARGS;
     }
-    mx_status_t status;
+    zx_status_t status;
     mtx_lock(&bdev->lock);
     if (bdev->bs != NULL) {
-        status = MX_ERR_ALREADY_BOUND;
+        status = ZX_ERR_ALREADY_BOUND;
         goto done;
     }
 
     BlockServer* bs;
-    if ((status = blockserver_create(out_buf, &bs)) != MX_OK) {
+    if ((status = blockserver_create(out_buf, &bs)) != ZX_OK) {
         goto done;
     }
 
@@ -81,34 +81,34 @@
     if (thrd_create(&thread, blockserver_thread, bdev) != thrd_success) {
         blockserver_free(bs);
         bdev->bs = NULL;
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto done;
     }
     thrd_detach(thread);
 
     // On success, the blockserver thread holds the lock.
-    return sizeof(mx_handle_t);
+    return sizeof(zx_handle_t);
 done:
     mtx_unlock(&bdev->lock);
     return status;
 }
 
-static mx_status_t blkdev_attach_vmo(blkdev_t* bdev,
+static zx_status_t blkdev_attach_vmo(blkdev_t* bdev,
                                  const void* in_buf, size_t in_len,
                                  void* out_buf, size_t out_len, size_t* out_actual) {
-    if ((in_len < sizeof(mx_handle_t)) || (out_len < sizeof(vmoid_t))) {
-        return MX_ERR_INVALID_ARGS;
+    if ((in_len < sizeof(zx_handle_t)) || (out_len < sizeof(vmoid_t))) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     mtx_lock(&bdev->lock);
     if (bdev->bs == NULL) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto done;
     }
 
-    mx_handle_t h = *(mx_handle_t*)in_buf;
-    if ((status = blockserver_attach_vmo(bdev->bs, h, out_buf)) != MX_OK) {
+    zx_handle_t h = *(zx_handle_t*)in_buf;
+    if ((status = blockserver_attach_vmo(bdev->bs, h, out_buf)) != ZX_OK) {
         goto done;
     }
     *out_actual = sizeof(vmoid_t);
@@ -118,21 +118,21 @@
     return status;
 }
 
-static mx_status_t blkdev_alloc_txn(blkdev_t* bdev,
+static zx_status_t blkdev_alloc_txn(blkdev_t* bdev,
                                 const void* in_buf, size_t in_len,
                                 void* out_buf, size_t out_len, size_t* out_actual) {
     if ((in_len != 0) || (out_len < sizeof(txnid_t))) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     mtx_lock(&bdev->lock);
     if (bdev->bs == NULL) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto done;
     }
 
-    if ((status = blockserver_allocate_txn(bdev->bs, out_buf)) != MX_OK) {
+    if ((status = blockserver_allocate_txn(bdev->bs, out_buf)) != ZX_OK) {
         goto done;
     }
     *out_actual = sizeof(vmoid_t);
@@ -142,40 +142,40 @@
     return status;
 }
 
-static mx_status_t blkdev_free_txn(blkdev_t* bdev, const void* in_buf,
+static zx_status_t blkdev_free_txn(blkdev_t* bdev, const void* in_buf,
                                    size_t in_len) {
     if (in_len != sizeof(txnid_t)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     mtx_lock(&bdev->lock);
     if (bdev->bs == NULL) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto done;
     }
 
     txnid_t txnid = *(txnid_t*)in_buf;
     blockserver_free_txn(bdev->bs, txnid);
-    status = MX_OK;
+    status = ZX_OK;
 done:
     mtx_unlock(&bdev->lock);
     return status;
 }
 
-static mx_status_t blkdev_fifo_close_locked(blkdev_t* bdev) {
+static zx_status_t blkdev_fifo_close_locked(blkdev_t* bdev) {
     if (bdev->bs != NULL) {
         blockserver_shutdown(bdev->bs);
         // Ensure that the next thread to call "get_fifos" will
         // not see the previous block server.
         bdev->bs = NULL;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 // implement device protocol:
 
-static mx_status_t blkdev_ioctl(void* ctx, uint32_t op, const void* cmd,
+static zx_status_t blkdev_ioctl(void* ctx, uint32_t op, const void* cmd,
                             size_t cmdlen, void* reply, size_t max, size_t* out_actual) {
     blkdev_t* blkdev = ctx;
     switch (op) {
@@ -189,7 +189,7 @@
         return blkdev_free_txn(blkdev, cmd, cmdlen);
     case IOCTL_BLOCK_FIFO_CLOSE: {
         mtx_lock(&blkdev->lock);
-        mx_status_t status = blkdev_fifo_close_locked(blkdev);
+        zx_status_t status = blkdev_fifo_close_locked(blkdev);
         mtx_unlock(&blkdev->lock);
         return status;
     }
@@ -203,7 +203,7 @@
     iotxn_queue(blkdev->parent, txn);
 }
 
-static mx_off_t blkdev_get_size(void* ctx) {
+static zx_off_t blkdev_get_size(void* ctx) {
     blkdev_t* blkdev = ctx;
     return device_get_size(blkdev->parent);
 }
@@ -230,7 +230,7 @@
     }
 }
 
-static mx_protocol_device_t blkdev_ops = {
+static zx_protocol_device_t blkdev_ops = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = blkdev_ioctl,
     .iotxn_queue = blkdev_iotxn_queue,
@@ -239,18 +239,18 @@
     .release = blkdev_release,
 };
 
-static mx_status_t block_driver_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t block_driver_bind(void* ctx, zx_device_t* dev, void** cookie) {
     blkdev_t* bdev;
     if ((bdev = calloc(1, sizeof(blkdev_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     bdev->threadcount = 0;
     mtx_init(&bdev->lock, mtx_plain);
     bdev->parent = dev;
 
-    mx_status_t status;
-    if (device_get_protocol(dev, MX_PROTOCOL_BLOCK_CORE, &bdev->proto)) {
-        status = MX_ERR_INTERNAL;
+    zx_status_t status;
+    if (device_get_protocol(dev, ZX_PROTOCOL_BLOCK_CORE, &bdev->proto)) {
+        status = ZX_ERR_INTERNAL;
         goto fail;
     }
 
@@ -259,26 +259,26 @@
         .name = "block",
         .ctx = bdev,
         .ops = &blkdev_ops,
-        .proto_id = MX_PROTOCOL_BLOCK,
+        .proto_id = ZX_PROTOCOL_BLOCK,
     };
 
     status = device_add(dev, &args, &bdev->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     free(bdev);
     return status;
 }
 
-static mx_driver_ops_t block_driver_ops = {
+static zx_driver_ops_t block_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = block_driver_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(block, block_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_BLOCK_CORE),
-MAGENTA_DRIVER_END(block)
+ZIRCON_DRIVER_BEGIN(block, block_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_BLOCK_CORE),
+ZIRCON_DRIVER_END(block)
diff --git a/system/dev/block/block/rules.mk b/system/dev/block/block/rules.mk
index 222261d..ad737da8 100644
--- a/system/dev/block/block/rules.mk
+++ b/system/dev/block/block/rules.mk
@@ -15,10 +15,10 @@
 MODULE_STATIC_LIBS := \
     system/ulib/ddk \
     system/ulib/sync \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
-MODULE_LIBS := system/ulib/c system/ulib/driver system/ulib/magenta
+MODULE_LIBS := system/ulib/c system/ulib/driver system/ulib/zircon
 
 include make/module.mk
diff --git a/system/dev/block/block/server.cpp b/system/dev/block/block/server.cpp
index da0fe0b..f81a08c 100644
--- a/system/dev/block/block/server.cpp
+++ b/system/dev/block/block/server.cpp
@@ -7,10 +7,10 @@
 #include <stdbool.h>
 #include <string.h>
 
-#include <magenta/compiler.h>
-#include <magenta/device/block.h>
-#include <magenta/syscalls.h>
-#include <mx/fifo.h>
+#include <zircon/compiler.h>
+#include <zircon/device/block.h>
+#include <zircon/syscalls.h>
+#include <zx/fifo.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
@@ -26,9 +26,9 @@
 //
 // If additional signals are set on the FIFO, it should be noted that
 // block clients will also be able to manipulate them.
-constexpr mx_signals_t kSignalFifoTerminate = MX_USER_SIGNAL_0;
+constexpr zx_signals_t kSignalFifoTerminate = ZX_USER_SIGNAL_0;
 
-static void OutOfBandErrorRespond(const mx::fifo& fifo, mx_status_t status, txnid_t txnid) {
+static void OutOfBandErrorRespond(const zx::fifo& fifo, zx_status_t status, txnid_t txnid) {
     block_fifo_response_t response;
     response.status = status;
     response.txnid = txnid;
@@ -36,12 +36,12 @@
 
     uint32_t actual;
     status = fifo.write(&response, sizeof(block_fifo_response_t), &actual);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "Block Server I/O error: Could not write response\n");
     }
 }
 
-BlockTransaction::BlockTransaction(mx_handle_t fifo, txnid_t txnid) :
+BlockTransaction::BlockTransaction(zx_handle_t fifo, txnid_t txnid) :
     fifo_(fifo), flags_(0), goal_(0) {
     memset(&response_, 0, sizeof(response_));
     response_.txnid = txnid;
@@ -49,7 +49,7 @@
 
 BlockTransaction::~BlockTransaction() {}
 
-mx_status_t BlockTransaction::Enqueue(bool do_respond, block_msg_t** msg_out) {
+zx_status_t BlockTransaction::Enqueue(bool do_respond, block_msg_t** msg_out) {
     fbl::AutoLock lock(&lock_);
     if (flags_ & kTxnFlagRespond) {
         // Can't get more than one response for a txn
@@ -61,24 +61,24 @@
         // clear the current block transaction.
         do_respond = true;
     }
-    MX_DEBUG_ASSERT(goal_ < MAX_TXN_MESSAGES); // Avoid overflowing msgs
+    ZX_DEBUG_ASSERT(goal_ < MAX_TXN_MESSAGES); // Avoid overflowing msgs
     *msg_out = &msgs_[goal_++];
     flags_ |= do_respond ? kTxnFlagRespond : 0;
-    return MX_OK;
+    return ZX_OK;
 fail:
     if (do_respond) {
-        OutOfBandErrorRespond(mx::unowned_fifo::wrap(fifo_), MX_ERR_IO, response_.txnid);
+        OutOfBandErrorRespond(zx::unowned_fifo::wrap(fifo_), ZX_ERR_IO, response_.txnid);
     }
-    return MX_ERR_IO;
+    return ZX_ERR_IO;
 }
 
-void BlockTransaction::Complete(block_msg_t* msg, mx_status_t status) {
+void BlockTransaction::Complete(block_msg_t* msg, zx_status_t status) {
     fbl::AutoLock lock(&lock_);
     response_.count++;
-    MX_DEBUG_ASSERT(goal_ != 0);
-    MX_DEBUG_ASSERT(response_.count <= goal_);
+    ZX_DEBUG_ASSERT(goal_ != 0);
+    ZX_DEBUG_ASSERT(response_.count <= goal_);
 
-    if ((status != MX_OK) && (response_.status == MX_OK)) {
+    if ((status != ZX_OK) && (response_.status == ZX_OK)) {
         response_.status = status;
     }
 
@@ -86,13 +86,13 @@
         // Don't block the block device. Respond if we can (and in the absence
         // of an I/O error or closed remote, this should just work).
         uint32_t actual;
-        mx_status_t status = mx_fifo_write(fifo_, &response_,
+        zx_status_t status = zx_fifo_write(fifo_, &response_,
                                            sizeof(block_fifo_response_t), &actual);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             fprintf(stderr, "Block Server I/O error: Could not write response\n");
         }
         response_.count = 0;
-        response_.status = MX_OK;
+        response_.status = ZX_OK;
         goal_ = 0;
         flags_ &= ~kTxnFlagRespond;
     }
@@ -100,34 +100,34 @@
     msg->iobuf.reset();
 }
 
-IoBuffer::IoBuffer(mx::vmo vmo, vmoid_t id) : io_vmo_(fbl::move(vmo)), vmoid_(id) {}
+IoBuffer::IoBuffer(zx::vmo vmo, vmoid_t id) : io_vmo_(fbl::move(vmo)), vmoid_(id) {}
 
 IoBuffer::~IoBuffer() {}
 
-mx_status_t IoBuffer::ValidateVmoHack(uint64_t length, uint64_t vmo_offset) {
+zx_status_t IoBuffer::ValidateVmoHack(uint64_t length, uint64_t vmo_offset) {
     uint64_t vmo_size;
-    mx_status_t status;
-    if ((status = io_vmo_.get_size(&vmo_size)) != MX_OK) {
+    zx_status_t status;
+    if ((status = io_vmo_.get_size(&vmo_size)) != ZX_OK) {
         return status;
     } else if (length + vmo_offset > vmo_size) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t BlockServer::Read(block_fifo_request_t* requests, uint32_t* count) {
+zx_status_t BlockServer::Read(block_fifo_request_t* requests, uint32_t* count) {
     // Keep trying to read messages from the fifo until we have a reason to
     // terminate
     while (true) {
-        mx_status_t status = fifo_.read(requests, sizeof(block_fifo_request_t), count);
-        if (status == MX_ERR_SHOULD_WAIT) {
-            mx_signals_t waitfor = MX_FIFO_READABLE | MX_FIFO_PEER_CLOSED | kSignalFifoTerminate;
-            mx_signals_t observed;
-            if ((status = fifo_.wait_one(waitfor, MX_TIME_INFINITE, &observed)) != MX_OK) {
+        zx_status_t status = fifo_.read(requests, sizeof(block_fifo_request_t), count);
+        if (status == ZX_ERR_SHOULD_WAIT) {
+            zx_signals_t waitfor = ZX_FIFO_READABLE | ZX_FIFO_PEER_CLOSED | kSignalFifoTerminate;
+            zx_signals_t observed;
+            if ((status = fifo_.wait_one(waitfor, ZX_TIME_INFINITE, &observed)) != ZX_OK) {
                 return status;
             }
-            if ((observed & MX_FIFO_PEER_CLOSED) || (observed & kSignalFifoTerminate)) {
-                return MX_ERR_PEER_CLOSED;
+            if ((observed & ZX_FIFO_PEER_CLOSED) || (observed & kSignalFifoTerminate)) {
+                return ZX_ERR_PEER_CLOSED;
             }
             // Try reading again...
         } else {
@@ -136,43 +136,43 @@
     }
 }
 
-mx_status_t BlockServer::FindVmoIDLocked(vmoid_t* out) {
+zx_status_t BlockServer::FindVmoIDLocked(vmoid_t* out) {
     for (vmoid_t i = last_id; i < fbl::numeric_limits<vmoid_t>::max(); i++) {
         if (!tree_.find(i).IsValid()) {
             *out = i;
             last_id = static_cast<vmoid_t>(i + 1);
-            return MX_OK;
+            return ZX_OK;
         }
     }
     for (vmoid_t i = 0; i < last_id; i++) {
         if (!tree_.find(i).IsValid()) {
             *out = i;
             last_id = static_cast<vmoid_t>(i + 1);
-            return MX_OK;
+            return ZX_OK;
         }
     }
-    return MX_ERR_NO_RESOURCES;
+    return ZX_ERR_NO_RESOURCES;
 }
 
-mx_status_t BlockServer::AttachVmo(mx::vmo vmo, vmoid_t* out) {
-    mx_status_t status;
+zx_status_t BlockServer::AttachVmo(zx::vmo vmo, vmoid_t* out) {
+    zx_status_t status;
     vmoid_t id;
     fbl::AutoLock server_lock(&server_lock_);
-    if ((status = FindVmoIDLocked(&id)) != MX_OK) {
+    if ((status = FindVmoIDLocked(&id)) != ZX_OK) {
         return status;
     }
 
     fbl::AllocChecker ac;
     fbl::RefPtr<IoBuffer> ibuf = fbl::AdoptRef(new (&ac) IoBuffer(fbl::move(vmo), id));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     tree_.insert(fbl::move(ibuf));
     *out = id;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t BlockServer::AllocateTxn(txnid_t* out) {
+zx_status_t BlockServer::AllocateTxn(txnid_t* out) {
     fbl::AutoLock server_lock(&server_lock_);
     for (size_t i = 0; i < fbl::count_of(txns_); i++) {
         if (txns_[i] == nullptr) {
@@ -180,13 +180,13 @@
             fbl::AllocChecker ac;
             txns_[i] = fbl::AdoptRef(new (&ac) BlockTransaction(fifo_.get(), txnid));
             if (!ac.check()) {
-                return MX_ERR_NO_MEMORY;
+                return ZX_ERR_NO_MEMORY;
             }
             *out = txnid;
-            return MX_OK;
+            return ZX_OK;
         }
     }
-    return MX_ERR_NO_RESOURCES;
+    return ZX_ERR_NO_RESOURCES;
 }
 
 void BlockServer::FreeTxn(txnid_t txnid) {
@@ -194,34 +194,34 @@
     if (txnid >= fbl::count_of(txns_)) {
         return;
     }
-    MX_DEBUG_ASSERT(txns_[txnid] != nullptr);
+    ZX_DEBUG_ASSERT(txns_[txnid] != nullptr);
     txns_[txnid] = nullptr;
 }
 
-mx_status_t BlockServer::Create(mx::fifo* fifo_out, BlockServer** out) {
+zx_status_t BlockServer::Create(zx::fifo* fifo_out, BlockServer** out) {
     fbl::AllocChecker ac;
     BlockServer* bs = new (&ac) BlockServer();
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t status;
-    if ((status = mx::fifo::create(BLOCK_FIFO_MAX_DEPTH, BLOCK_FIFO_ESIZE, 0,
-                                   fifo_out, &bs->fifo_)) != MX_OK) {
+    zx_status_t status;
+    if ((status = zx::fifo::create(BLOCK_FIFO_MAX_DEPTH, BLOCK_FIFO_ESIZE, 0,
+                                   fifo_out, &bs->fifo_)) != ZX_OK) {
         delete bs;
         return status;
     }
 
     *out = bs;
-    return MX_OK;
+    return ZX_OK;
 }
 
-void blockserver_fifo_complete(void* cookie, mx_status_t status) {
+void blockserver_fifo_complete(void* cookie, zx_status_t status) {
     block_msg_t* msg = static_cast<block_msg_t*>(cookie);
     // Since iobuf is a RefPtr, it lives at least as long as the txn,
     // and is not discarded underneath the block device driver.
-    MX_DEBUG_ASSERT(msg->iobuf != nullptr);
-    MX_DEBUG_ASSERT(msg->txn != nullptr);
+    ZX_DEBUG_ASSERT(msg->iobuf != nullptr);
+    ZX_DEBUG_ASSERT(msg->txn != nullptr);
     // Hold an extra copy of the 'txn' refptr; if we don't, and 'msg->txn' is
     // the last copy, then when we nullify 'msg->txn' in Complete we end up
     // trying to unlock a lock in a deleted BlockTxn.
@@ -235,14 +235,14 @@
     blockserver_fifo_complete,
 };
 
-mx_status_t BlockServer::Serve(block_protocol_t* proto) {
+zx_status_t BlockServer::Serve(block_protocol_t* proto) {
     block_set_callbacks(proto, &cb);
 
-    mx_status_t status;
+    zx_status_t status;
     block_fifo_request_t requests[BLOCK_FIFO_MAX_DEPTH];
     uint32_t count;
     while (true) {
-        if ((status = Read(requests, &count) != MX_OK)) {
+        if ((status = Read(requests, &count) != ZX_OK)) {
             return status;
         }
 
@@ -256,14 +256,14 @@
             if (!iobuf.IsValid()) {
                 // Operation which is not accessing a valid vmo
                 if (wants_reply) {
-                    OutOfBandErrorRespond(fifo_, MX_ERR_IO, txnid);
+                    OutOfBandErrorRespond(fifo_, ZX_ERR_IO, txnid);
                 }
                 continue;
             }
             if (txnid >= MAX_TXN_COUNT || txns_[txnid] == nullptr) {
                 // Operation which is not accessing a valid txn
                 if (wants_reply) {
-                    OutOfBandErrorRespond(fifo_, MX_ERR_IO, txnid);
+                    OutOfBandErrorRespond(fifo_, ZX_ERR_IO, txnid);
                 }
                 continue;
             }
@@ -273,19 +273,19 @@
             case BLOCKIO_WRITE: {
                 block_msg_t* msg;
                 status = txns_[txnid]->Enqueue(wants_reply, &msg);
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     break;
                 }
-                MX_DEBUG_ASSERT(msg->txn == nullptr);
+                ZX_DEBUG_ASSERT(msg->txn == nullptr);
                 msg->txn = txns_[txnid];
-                MX_DEBUG_ASSERT(msg->iobuf == nullptr);
+                ZX_DEBUG_ASSERT(msg->iobuf == nullptr);
                 msg->iobuf = iobuf.CopyPointer();
 
                 // Hack to ensure that the vmo is valid.
                 // In the future, this code will be responsible for pinning VMO pages,
                 // and the completion will be responsible for un-pinning those same pages.
                 status = iobuf->ValidateVmoHack(requests[i].length, requests[i].vmo_offset);
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     cb.complete(msg, status);
                     break;
                 }
@@ -307,7 +307,7 @@
             case BLOCKIO_CLOSE_VMO: {
                 tree_.erase(*iobuf);
                 if (wants_reply) {
-                    OutOfBandErrorRespond(fifo_, MX_OK, txnid);
+                    OutOfBandErrorRespond(fifo_, ZX_OK, txnid);
                 }
                 break;
             }
@@ -332,9 +332,9 @@
 }
 
 // C declarations
-mx_status_t blockserver_create(mx_handle_t* fifo_out, BlockServer** out) {
-    mx::fifo fifo;
-    mx_status_t status = BlockServer::Create(&fifo, out);
+zx_status_t blockserver_create(zx_handle_t* fifo_out, BlockServer** out) {
+    zx::fifo fifo;
+    zx_status_t status = BlockServer::Create(&fifo, out);
     *fifo_out = fifo.release();
     return status;
 }
@@ -344,14 +344,14 @@
 void blockserver_free(BlockServer* bs) {
     delete bs;
 }
-mx_status_t blockserver_serve(BlockServer* bs, block_protocol_t* proto) {
+zx_status_t blockserver_serve(BlockServer* bs, block_protocol_t* proto) {
     return bs->Serve(proto);
 }
-mx_status_t blockserver_attach_vmo(BlockServer* bs, mx_handle_t raw_vmo, vmoid_t* out) {
-    mx::vmo vmo(raw_vmo);
+zx_status_t blockserver_attach_vmo(BlockServer* bs, zx_handle_t raw_vmo, vmoid_t* out) {
+    zx::vmo vmo(raw_vmo);
     return bs->AttachVmo(fbl::move(vmo), out);
 }
-mx_status_t blockserver_allocate_txn(BlockServer* bs, txnid_t* out) {
+zx_status_t blockserver_allocate_txn(BlockServer* bs, txnid_t* out) {
     return bs->AllocateTxn(out);
 }
 void blockserver_free_txn(BlockServer* bs, txnid_t txnid) {
diff --git a/system/dev/block/block/server.h b/system/dev/block/block/server.h
index b334a53..938ee71 100644
--- a/system/dev/block/block/server.h
+++ b/system/dev/block/block/server.h
@@ -9,14 +9,14 @@
 #include <stdlib.h>
 
 #include <ddk/protocol/block.h>
-#include <magenta/device/block.h>
-#include <magenta/thread_annotations.h>
-#include <magenta/types.h>
+#include <zircon/device/block.h>
+#include <zircon/thread_annotations.h>
+#include <zircon/types.h>
 
 #ifdef __cplusplus
 
-#include <mx/fifo.h>
-#include <mx/vmo.h>
+#include <zx/fifo.h>
+#include <zx/vmo.h>
 #include <fbl/intrusive_wavl_tree.h>
 #include <fbl/mutex.h>
 #include <fbl/ref_counted.h>
@@ -32,9 +32,9 @@
     // TODO(smklein): This function is currently labelled 'hack' since we have
     // no way to ensure that the size of the VMO won't change in between
     // checking it and using it.  This will require a mechanism to "pin" VMO pages.
-    mx_status_t ValidateVmoHack(uint64_t length, uint64_t vmo_offset);
+    zx_status_t ValidateVmoHack(uint64_t length, uint64_t vmo_offset);
 
-    IoBuffer(mx::vmo vmo, vmoid_t vmoid);
+    IoBuffer(zx::vmo vmo, vmoid_t vmoid);
     ~IoBuffer();
 
 private:
@@ -42,7 +42,7 @@
     friend struct TypeWAVLTraits;
     DISALLOW_COPY_ASSIGN_AND_MOVE(IoBuffer);
 
-    const mx::vmo io_vmo_;
+    const zx::vmo io_vmo_;
     const vmoid_t vmoid_;
 };
 
@@ -57,21 +57,21 @@
 
 class BlockTransaction : public fbl::RefCounted<BlockTransaction> {
 public:
-    BlockTransaction(mx_handle_t fifo, txnid_t txnid);
+    BlockTransaction(zx_handle_t fifo, txnid_t txnid);
     ~BlockTransaction();
 
     // Verifies that the incoming txn does not break the Block IO fifo protocol.
     // If it is successful, sets up the response_ with the registered cookie,
     // and adds to the "goal_" counter of number of Completions that must be
     // received before the transaction is identified as successful.
-    mx_status_t Enqueue(bool do_respond, block_msg_t** msg_out);
+    zx_status_t Enqueue(bool do_respond, block_msg_t** msg_out);
 
     // Called once the transaction has completed successfully.
-    void Complete(block_msg_t* msg, mx_status_t status);
+    void Complete(block_msg_t* msg, zx_status_t status);
 private:
     DISALLOW_COPY_ASSIGN_AND_MOVE(BlockTransaction);
 
-    const mx_handle_t fifo_;
+    const zx_handle_t fifo_;
 
     fbl::Mutex lock_;
     block_msg_t msgs_[MAX_TXN_MESSAGES] TA_GUARDED(lock_);
@@ -83,12 +83,12 @@
 class BlockServer {
 public:
     // Creates a new BlockServer
-    static mx_status_t Create(mx::fifo* fifo_out, BlockServer** out);
+    static zx_status_t Create(zx::fifo* fifo_out, BlockServer** out);
 
     // Starts the BlockServer using the current thread
-    mx_status_t Serve(block_protocol_t* proto);
-    mx_status_t AttachVmo(mx::vmo vmo, vmoid_t* out);
-    mx_status_t AllocateTxn(txnid_t* out);
+    zx_status_t Serve(block_protocol_t* proto);
+    zx_status_t AttachVmo(zx::vmo vmo, vmoid_t* out);
+    zx_status_t AllocateTxn(txnid_t* out);
     void FreeTxn(txnid_t txnid);
 
     void ShutDown();
@@ -98,10 +98,10 @@
     DISALLOW_COPY_ASSIGN_AND_MOVE(BlockServer);
     BlockServer();
 
-    mx_status_t Read(block_fifo_request_t* requests, uint32_t* count);
-    mx_status_t FindVmoIDLocked(vmoid_t* out) TA_REQ(server_lock_);
+    zx_status_t Read(block_fifo_request_t* requests, uint32_t* count);
+    zx_status_t FindVmoIDLocked(vmoid_t* out) TA_REQ(server_lock_);
 
-    mx::fifo fifo_;
+    zx::fifo fifo_;
 
     fbl::Mutex server_lock_;
     fbl::WAVLTree<vmoid_t, fbl::RefPtr<IoBuffer>> tree_ TA_GUARDED(server_lock_);
@@ -119,7 +119,7 @@
 __BEGIN_CDECLS
 
 // Allocate a new blockserver + FIFO combo
-mx_status_t blockserver_create(mx_handle_t* fifo_out, BlockServer** out);
+zx_status_t blockserver_create(zx_handle_t* fifo_out, BlockServer** out);
 
 // Shut down the blockserver. It will stop serving requests.
 void blockserver_shutdown(BlockServer* bs);
@@ -128,13 +128,13 @@
 void blockserver_free(BlockServer* bs);
 
 // Use the current thread to block on incoming FIFO requests.
-mx_status_t blockserver_serve(BlockServer* bs, block_protocol_t* ops);
+zx_status_t blockserver_serve(BlockServer* bs, block_protocol_t* ops);
 
 // Attach an IO buffer to the Block Server
-mx_status_t blockserver_attach_vmo(BlockServer* bs, mx_handle_t vmo, vmoid_t* out);
+zx_status_t blockserver_attach_vmo(BlockServer* bs, zx_handle_t vmo, vmoid_t* out);
 
 // Allocate & Free a txn
-mx_status_t blockserver_allocate_txn(BlockServer* bs, txnid_t* out);
+zx_status_t blockserver_allocate_txn(BlockServer* bs, txnid_t* out);
 void blockserver_free_txn(BlockServer* bs, txnid_t txnid);
 
 __END_CDECLS
diff --git a/system/dev/block/fvm/fvm-private.h b/system/dev/block/fvm/fvm-private.h
index 5e30386..bbfc8d1 100644
--- a/system/dev/block/fvm/fvm-private.h
+++ b/system/dev/block/fvm/fvm-private.h
@@ -11,9 +11,9 @@
 #include <ddk/device.h>
 #include <ddk/protocol/block.h>
 #include <fvm/fvm.h>
-#include <magenta/device/block.h>
-#include <magenta/thread_annotations.h>
-#include <magenta/types.h>
+#include <zircon/device/block.h>
+#include <zircon/thread_annotations.h>
+#include <zircon/types.h>
 
 #ifdef __cplusplus
 
@@ -65,7 +65,7 @@
     bool Merge(const SliceExtent& other);
 
     bool push_back(uint32_t pslice) {
-        MX_DEBUG_ASSERT(pslice != PSLICE_UNALLOCATED);
+        ZX_DEBUG_ASSERT(pslice != PSLICE_UNALLOCATED);
         fbl::AllocChecker ac;
         pslices_.push_back(pslice, &ac);
         return ac.check();
@@ -86,58 +86,58 @@
 
 class VPartitionManager : public ManagerDeviceType {
 public:
-    static mx_status_t Create(mx_device_t* dev, fbl::unique_ptr<VPartitionManager>* out);
+    static zx_status_t Create(zx_device_t* dev, fbl::unique_ptr<VPartitionManager>* out);
 
     // Read the underlying block device, initialize the recorded VPartitions.
-    mx_status_t Load();
+    zx_status_t Load();
 
     // Given a VPartition object, add a corresponding ddk device.
-    mx_status_t AddPartition(fbl::unique_ptr<VPartition> vp) const;
+    zx_status_t AddPartition(fbl::unique_ptr<VPartition> vp) const;
 
     // Update, hash, and write back the current copy of the FVM metadata.
     // Automatically handles alternating writes to primary / backup copy of FVM.
-    mx_status_t WriteFvmLocked() TA_REQ(lock_);
+    zx_status_t WriteFvmLocked() TA_REQ(lock_);
 
     // Acquire access to a VPart Entry which has already been modified (and
     // will, as a consequence, not be de-allocated underneath us).
     vpart_entry_t* GetAllocatedVPartEntry(size_t index) const TA_NO_THREAD_SAFETY_ANALYSIS {
         auto entry = GetVPartEntryLocked(index);
-        MX_DEBUG_ASSERT(entry->slices > 0);
+        ZX_DEBUG_ASSERT(entry->slices > 0);
         return entry;
     }
 
     slice_entry_t* GetSliceEntryLocked(size_t index) const TA_REQ(lock_) {
-        MX_DEBUG_ASSERT(index >= 1);
+        ZX_DEBUG_ASSERT(index >= 1);
         uintptr_t metadata_start = reinterpret_cast<uintptr_t>(GetFvmLocked());
         uintptr_t offset = static_cast<uintptr_t>(kAllocTableOffset +
                                                   index * sizeof(slice_entry_t));
-        MX_DEBUG_ASSERT(kAllocTableOffset <= offset);
-        MX_DEBUG_ASSERT(offset < kAllocTableOffset + AllocTableLength(DiskSize(), SliceSize()));
+        ZX_DEBUG_ASSERT(kAllocTableOffset <= offset);
+        ZX_DEBUG_ASSERT(offset < kAllocTableOffset + AllocTableLength(DiskSize(), SliceSize()));
         return reinterpret_cast<slice_entry_t*>(metadata_start + offset);
     }
 
     // Allocate 'count' slices, write back the FVM.
-    mx_status_t AllocateSlices(VPartition* vp, size_t vslice_start, size_t count) TA_EXCL(lock_);
-    mx_status_t AllocateSlicesLocked(VPartition* vp, size_t vslice_start,
+    zx_status_t AllocateSlices(VPartition* vp, size_t vslice_start, size_t count) TA_EXCL(lock_);
+    zx_status_t AllocateSlicesLocked(VPartition* vp, size_t vslice_start,
                                      size_t count) TA_REQ(lock_);
 
     // Deallocate 'count' slices, write back the FVM.
     // If a request is made to remove vslice_count = 0, deallocates the entire
     // VPartition.
-    mx_status_t FreeSlices(VPartition* vp, size_t vslice_start, size_t count) TA_EXCL(lock_);
-    mx_status_t FreeSlicesLocked(VPartition* vp, size_t vslice_start,
+    zx_status_t FreeSlices(VPartition* vp, size_t vslice_start, size_t count) TA_EXCL(lock_);
+    zx_status_t FreeSlicesLocked(VPartition* vp, size_t vslice_start,
                                  size_t count) TA_REQ(lock_);
 
     size_t DiskSize() const { return info_.block_count * info_.block_size; }
     size_t SliceSize() const { return slice_size_; }
     size_t VSliceMax() const { return VSLICE_MAX; }
 
-    mx_status_t DdkIoctl(uint32_t op, const void* cmd, size_t cmdlen,
+    zx_status_t DdkIoctl(uint32_t op, const void* cmd, size_t cmdlen,
                          void* reply, size_t max, size_t* out_actual);
     void DdkUnbind();
     void DdkRelease();
 
-    VPartitionManager(mx_device_t* dev, const block_info_t& info);
+    VPartitionManager(zx_device_t* dev, const block_info_t& info);
     ~VPartitionManager();
     block_info_t info_; // Cached info from parent device
     thrd_t init_;
@@ -145,20 +145,20 @@
 private:
     DISALLOW_COPY_ASSIGN_AND_MOVE(VPartitionManager);
 
-    mx_status_t FindFreeVPartEntryLocked(size_t* out) const TA_REQ(lock_);
-    mx_status_t FindFreeSliceLocked(size_t* out, size_t hint) const TA_REQ(lock_);
+    zx_status_t FindFreeVPartEntryLocked(size_t* out) const TA_REQ(lock_);
+    zx_status_t FindFreeSliceLocked(size_t* out, size_t hint) const TA_REQ(lock_);
 
     fvm_t* GetFvmLocked() const TA_REQ(lock_) {
         return reinterpret_cast<fvm_t*>(metadata_->GetData());
     }
 
     vpart_entry_t* GetVPartEntryLocked(size_t index) const TA_REQ(lock_) {
-        MX_DEBUG_ASSERT(index >= 1);
+        ZX_DEBUG_ASSERT(index >= 1);
         uintptr_t metadata_start = reinterpret_cast<uintptr_t>(GetFvmLocked());
         uintptr_t offset = static_cast<uintptr_t>(kVPartTableOffset +
                                                   index * sizeof(vpart_entry_t));
-        MX_DEBUG_ASSERT(kVPartTableOffset <= offset);
-        MX_DEBUG_ASSERT(offset < kVPartTableOffset + kVPartTableLength);
+        ZX_DEBUG_ASSERT(kVPartTableOffset <= offset);
+        ZX_DEBUG_ASSERT(offset < kVPartTableOffset + kVPartTableLength);
         return reinterpret_cast<vpart_entry_t*>(metadata_start + offset);
     }
 
@@ -183,34 +183,34 @@
 
 class VPartition : public PartitionDeviceType, public ddk::BlockProtocol<VPartition> {
 public:
-    static mx_status_t Create(VPartitionManager* vpm, size_t entry_index,
+    static zx_status_t Create(VPartitionManager* vpm, size_t entry_index,
                               fbl::unique_ptr<VPartition>* out);
     // Device Protocol
-    mx_status_t DdkIoctl(uint32_t op, const void* cmd, size_t cmdlen,
+    zx_status_t DdkIoctl(uint32_t op, const void* cmd, size_t cmdlen,
                          void* reply, size_t max, size_t* out_actual);
     void DdkIotxnQueue(iotxn_t* txn);
-    mx_off_t DdkGetSize();
+    zx_off_t DdkGetSize();
     void DdkUnbind();
     void DdkRelease();
 
     // Block Protocol
-    void Txn(uint32_t opcode, mx_handle_t vmo, uint64_t length,
+    void Txn(uint32_t opcode, zx_handle_t vmo, uint64_t length,
              uint64_t vmo_offset, uint64_t dev_offset, void* cookie);
     void BlockSetCallbacks(block_callbacks_t* cb);
     void BlockGetInfo(block_info_t* info);
-    void BlockRead(mx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
+    void BlockRead(zx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
                    uint64_t dev_offset, void* cookie);
-    void BlockWrite(mx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
+    void BlockWrite(zx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
                     uint64_t dev_offset, void* cookie);
 
     auto ExtentBegin() TA_REQ(lock_) {
         return slice_map_.begin();
     }
     uint32_t SliceGetLocked(size_t vslice) const TA_REQ(lock_);
-    mx_status_t SliceSetUnsafe(size_t vslice, uint32_t pslice) TA_NO_THREAD_SAFETY_ANALYSIS {
+    zx_status_t SliceSetUnsafe(size_t vslice, uint32_t pslice) TA_NO_THREAD_SAFETY_ANALYSIS {
         return SliceSetLocked(vslice, pslice);
     }
-    mx_status_t SliceSetLocked(size_t vslice, uint32_t pslice) TA_REQ(lock_);
+    zx_status_t SliceSetLocked(size_t vslice, uint32_t pslice) TA_REQ(lock_);
 
     bool SliceCanFree(size_t vslice) const TA_REQ(lock_) {
         auto extent = --slice_map_.upper_bound(vslice);
@@ -240,7 +240,7 @@
 private:
     DISALLOW_COPY_ASSIGN_AND_MOVE(VPartition);
 
-    mx_device_t* GetParent() const { return mgr_->parent(); }
+    zx_device_t* GetParent() const { return mgr_->parent(); }
 
     VPartitionManager* mgr_;
     size_t entry_index_;
@@ -268,12 +268,12 @@
 //
 // Modifies "completion_cb" and "cookie" fields of txn; doesn't free or
 // allocate any memory.
-void iotxn_synchronous_op(mx_device_t* dev, iotxn_t* txn);
+void iotxn_synchronous_op(zx_device_t* dev, iotxn_t* txn);
 
 /////////////////// C-compatibility definitions (Provided to C from C++)
 
 // Binds FVM driver to a device; loads the VPartition devices asynchronously in
 // a background thread.
-mx_status_t fvm_bind(mx_device_t* dev);
+zx_status_t fvm_bind(zx_device_t* dev);
 
 __END_CDECLS
diff --git a/system/dev/block/fvm/fvm.c b/system/dev/block/fvm/fvm.c
index 0359c90..2636be7 100644
--- a/system/dev/block/fvm/fvm.c
+++ b/system/dev/block/fvm/fvm.c
@@ -8,7 +8,7 @@
 #include <ddk/protocol/block.h>
 
 #include <limits.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sync/completion.h>
@@ -20,25 +20,25 @@
     completion_signal((completion_t*)cookie);
 }
 
-void iotxn_synchronous_op(mx_device_t* dev, iotxn_t* txn) {
+void iotxn_synchronous_op(zx_device_t* dev, iotxn_t* txn) {
     completion_t completion = COMPLETION_INIT;
     txn->complete_cb = fvm_read_sync_complete;
     txn->cookie = &completion;
 
     iotxn_queue(dev, txn);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 }
 
-static mx_status_t fvm_bind_c(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t fvm_bind_c(void* ctx, zx_device_t* dev, void** cookie) {
     return fvm_bind(dev);
 }
 
-static mx_driver_ops_t fvm_driver_ops = {
+static zx_driver_ops_t fvm_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = fvm_bind_c,
 };
 
-MAGENTA_DRIVER_BEGIN(fvm, fvm_driver_ops, "magenta", "0.1", 2)
+ZIRCON_DRIVER_BEGIN(fvm, fvm_driver_ops, "zircon", "0.1", 2)
 BI_ABORT_IF_AUTOBIND,
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_BLOCK),
-    MAGENTA_DRIVER_END(fvm)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_BLOCK),
+    ZIRCON_DRIVER_END(fvm)
diff --git a/system/dev/block/fvm/fvm.cpp b/system/dev/block/fvm/fvm.cpp
index 0d00934..1de1a9f 100644
--- a/system/dev/block/fvm/fvm.cpp
+++ b/system/dev/block/fvm/fvm.cpp
@@ -7,10 +7,10 @@
 #include <unistd.h>
 
 #include <fs/mapped-vmo.h>
-#include <magenta/compiler.h>
-#include <magenta/device/block.h>
-#include <magenta/syscalls.h>
-#include <magenta/thread_annotations.h>
+#include <zircon/compiler.h>
+#include <zircon/device/block.h>
+#include <zircon/syscalls.h>
+#include <zircon/thread_annotations.h>
 #include <fbl/auto_call.h>
 #include <fbl/auto_lock.h>
 #include <fbl/limits.h>
@@ -22,8 +22,8 @@
 namespace fvm {
 
 fbl::unique_ptr<SliceExtent> SliceExtent::Split(size_t vslice) {
-    MX_DEBUG_ASSERT(start() <= vslice);
-    MX_DEBUG_ASSERT(vslice < end());
+    ZX_DEBUG_ASSERT(start() <= vslice);
+    ZX_DEBUG_ASSERT(vslice < end());
     fbl::AllocChecker ac;
     fbl::unique_ptr<SliceExtent> new_extent(new (&ac) SliceExtent(vslice + 1));
     if (!ac.check()) {
@@ -34,7 +34,7 @@
         return nullptr;
     }
     for (size_t vs = vslice + 1; vs < end(); vs++) {
-        MX_ASSERT(new_extent->push_back(get(vs)));
+        ZX_ASSERT(new_extent->push_back(get(vs)));
     }
     while (!is_empty() && vslice + 1 != end()) {
         pop_back();
@@ -44,7 +44,7 @@
 
 
 bool SliceExtent::Merge(const SliceExtent& other) {
-    MX_DEBUG_ASSERT(end() == other.start());
+    ZX_DEBUG_ASSERT(end() == other.start());
     fbl::AllocChecker ac;
     pslices_.reserve(other.size(), &ac);
     if (!ac.check()) {
@@ -52,53 +52,53 @@
     }
 
     for (size_t vs = other.start(); vs < other.end(); vs++) {
-        MX_ASSERT(push_back(other.get(vs)));
+        ZX_ASSERT(push_back(other.get(vs)));
     }
     return true;
 }
 
-VPartitionManager::VPartitionManager(mx_device_t* parent, const block_info_t& info)
+VPartitionManager::VPartitionManager(zx_device_t* parent, const block_info_t& info)
     : ManagerDeviceType(parent), info_(info), metadata_(nullptr), metadata_size_(0),
       slice_size_(0) {}
 
 VPartitionManager::~VPartitionManager() = default;
 
-mx_status_t VPartitionManager::Create(mx_device_t* dev, fbl::unique_ptr<VPartitionManager>* out) {
+zx_status_t VPartitionManager::Create(zx_device_t* dev, fbl::unique_ptr<VPartitionManager>* out) {
     block_info_t block_info;
     size_t actual = 0;
     ssize_t rc = device_ioctl(dev, IOCTL_BLOCK_GET_INFO, nullptr, 0, &block_info,
                               sizeof(block_info), &actual);
     if (rc < 0) {
-        return static_cast<mx_status_t>(rc);
+        return static_cast<zx_status_t>(rc);
     } else if (actual != sizeof(block_info)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     } else if (block_info.block_size == 0) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     fbl::AllocChecker ac;
     auto vpm = fbl::make_unique_checked<VPartitionManager>(&ac, dev, block_info);
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     *out = fbl::move(vpm);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VPartitionManager::AddPartition(fbl::unique_ptr<VPartition> vp) const {
+zx_status_t VPartitionManager::AddPartition(fbl::unique_ptr<VPartition> vp) const {
     auto ename = reinterpret_cast<const char*>(GetAllocatedVPartEntry(vp->GetEntryIndex())->name);
     char name[FVM_NAME_LEN + 32];
     snprintf(name, sizeof(name), "%.*s-p-%zu", FVM_NAME_LEN, ename, vp->GetEntryIndex());
 
-    mx_status_t status;
-    if ((status = vp->DdkAdd(name)) != MX_OK) {
+    zx_status_t status;
+    if ((status = vp->DdkAdd(name)) != ZX_OK) {
         return status;
     }
     vp.release();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VPartitionManager::Load() {
+zx_status_t VPartitionManager::Load() {
     fbl::AutoLock lock(&lock_);
 
     auto auto_detach = fbl::MakeAutoCall([&]() TA_NO_THREAD_SAFETY_ANALYSIS {
@@ -118,15 +118,15 @@
 
     // Read the superblock first, to determine the slice sice
     iotxn_t* txn = nullptr;
-    mx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_POOL, FVM_BLOCK_SIZE);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_POOL, FVM_BLOCK_SIZE);
+    if (status != ZX_OK) {
         return status;
     }
     txn->opcode = IOTXN_OP_READ;
     txn->offset = 0;
     txn->length = FVM_BLOCK_SIZE;
     iotxn_synchronous_op(parent(), txn);
-    if (txn->status != MX_OK) {
+    if (txn->status != ZX_OK) {
         status = txn->status;
         iotxn_release(txn);
         return status;
@@ -139,11 +139,11 @@
     // Validate the superblock, confirm the slice size
     slice_size_ = sb.slice_size;
     if (info_.block_size == 0 || SliceSize() % info_.block_size) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     } else if (sb.vpartition_table_size != kVPartTableLength) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     } else if (sb.allocation_table_size != AllocTableLength(DiskSize(), SliceSize())) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     metadata_size_ = fvm::MetadataSize(DiskSize(), SliceSize());
@@ -151,20 +151,20 @@
     size_t dual_metadata_size = 2 * MetadataSize();
     fbl::unique_ptr<MappedVmo> mvmo;
     status = MappedVmo::Create(dual_metadata_size, "fvm-meta", &mvmo);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     // Read both copies of metadata, ensure at least one is valid
     status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, mvmo->GetVmo(), 0, dual_metadata_size);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     txn->opcode = IOTXN_OP_READ;
     txn->offset = 0;
     txn->length = dual_metadata_size;
     iotxn_synchronous_op(parent(), txn);
-    if (txn->status != MX_OK) {
+    if (txn->status != ZX_OK) {
         status = txn->status;
         iotxn_release(txn);
         return status;
@@ -176,21 +176,21 @@
 
     const void* metadata;
     if ((status = fvm_validate_header(mvmo->GetData(), backup, MetadataSize(),
-                                      &metadata)) != MX_OK) {
+                                      &metadata)) != ZX_OK) {
         return status;
     }
     // TODO(smklein): Compare the performance of the current reading behavior
     // (read into VMO, map into VMAR, cut VMAR in half) with an alternative
-    // which waits to map the VMO by using mx_vmo_read twice beforehand instead.
+    // which waits to map the VMO by using zx_vmo_read twice beforehand instead.
     first_metadata_is_primary_ = (metadata == mvmo->GetData());
-    if ((status = mvmo->Shrink(PrimaryOffsetLocked(), MetadataSize())) != MX_OK) {
+    if ((status = mvmo->Shrink(PrimaryOffsetLocked(), MetadataSize())) != ZX_OK) {
         return status;
     }
 
     // Begin initializing the underlying partitions
     metadata_ = fbl::move(mvmo);
 
-    if ((status = DdkAdd("fvm")) != MX_OK) {
+    if ((status = DdkAdd("fvm")) != ZX_OK) {
         return status;
     }
     auto_detach.cancel();
@@ -203,7 +203,7 @@
     for (size_t i = 1; i < FVM_MAX_ENTRIES; i++) {
         if (GetVPartEntryLocked(i)->slices == 0) {
             continue;
-        } else if ((status = VPartition::Create(this, i, &vpartitions[i])) != MX_OK) {
+        } else if ((status = VPartition::Create(this, i, &vpartitions[i])) != ZX_OK) {
             return status;
         }
     }
@@ -216,7 +216,7 @@
             continue;
         }
         if (vpartitions[entry->vpart] == nullptr) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
 
         // It's fine to load the slices while not holding the vpartition
@@ -238,16 +238,16 @@
         device_count++;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VPartitionManager::WriteFvmLocked() {
+zx_status_t VPartitionManager::WriteFvmLocked() {
     iotxn_t* txn = nullptr;
 
-    mx_status_t status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL,
+    zx_status_t status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL,
                                          metadata_->GetVmo(), 0,
                                          MetadataSize());
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     txn->opcode = IOTXN_OP_WRITE;
@@ -261,73 +261,73 @@
     iotxn_synchronous_op(parent_, txn);
     status = txn->status;
     iotxn_release(txn);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     // We only allow the switch of "write to the other copy of metadata"
     // once a valid version has been written entirely.
     first_metadata_is_primary_ = !first_metadata_is_primary_;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VPartitionManager::FindFreeVPartEntryLocked(size_t* out) const {
+zx_status_t VPartitionManager::FindFreeVPartEntryLocked(size_t* out) const {
     for (size_t i = 1; i < FVM_MAX_ENTRIES; i++) {
         const vpart_entry_t* entry = GetVPartEntryLocked(i);
         if (entry->slices == 0) {
             *out = i;
-            return MX_OK;
+            return ZX_OK;
         }
     }
-    return MX_ERR_NO_SPACE;
+    return ZX_ERR_NO_SPACE;
 }
 
-mx_status_t VPartitionManager::FindFreeSliceLocked(size_t* out, size_t hint) const {
+zx_status_t VPartitionManager::FindFreeSliceLocked(size_t* out, size_t hint) const {
     const size_t maxSlices = UsableSlicesCount(DiskSize(), SliceSize());
     hint = fbl::max(hint, 1lu);
     for (size_t i = hint; i <= maxSlices; i++) {
         if (GetSliceEntryLocked(i)->vpart == 0) {
             *out = i;
-            return MX_OK;
+            return ZX_OK;
         }
     }
     for (size_t i = 1; i < hint; i++) {
         if (GetSliceEntryLocked(i)->vpart == 0) {
             *out = i;
-            return MX_OK;
+            return ZX_OK;
         }
     }
-    return MX_ERR_NO_SPACE;
+    return ZX_ERR_NO_SPACE;
 }
 
-mx_status_t VPartitionManager::AllocateSlices(VPartition* vp, size_t vslice_start,
+zx_status_t VPartitionManager::AllocateSlices(VPartition* vp, size_t vslice_start,
                                               size_t count) {
     fbl::AutoLock lock(&lock_);
     return AllocateSlicesLocked(vp, vslice_start, count);
 }
 
-mx_status_t VPartitionManager::AllocateSlicesLocked(VPartition* vp, size_t vslice_start,
+zx_status_t VPartitionManager::AllocateSlicesLocked(VPartition* vp, size_t vslice_start,
                                                     size_t count) {
     if (vslice_start + count > VSliceMax()) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     size_t hint = 0;
 
     {
         fbl::AutoLock lock(&vp->lock_);
         if (vp->IsKilledLocked())
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         for (size_t i = 0; i < count; i++) {
             size_t pslice;
             auto vslice = vslice_start + i;
             if (vp->SliceGetLocked(vslice) != PSLICE_UNALLOCATED) {
-                status = MX_ERR_INVALID_ARGS;
+                status = ZX_ERR_INVALID_ARGS;
             }
-            if ((status != MX_OK) ||
-                ((status = FindFreeSliceLocked(&pslice, hint)) != MX_OK) ||
-                ((status = vp->SliceSetLocked(vslice, static_cast<uint32_t>(pslice)) != MX_OK))) {
+            if ((status != ZX_OK) ||
+                ((status = FindFreeSliceLocked(&pslice, hint)) != ZX_OK) ||
+                ((status = vp->SliceSetLocked(vslice, static_cast<uint32_t>(pslice)) != ZX_OK))) {
                 for (int j = static_cast<int>(i - 1); j >= 0; j--) {
                     vslice = vslice_start + j;
                     GetSliceEntryLocked(vp->SliceGetLocked(vslice))->vpart = PSLICE_UNALLOCATED;
@@ -338,15 +338,15 @@
             }
             slice_entry_t* alloc_entry = GetSliceEntryLocked(pslice);
             auto vpart = vp->GetEntryIndex();
-            MX_DEBUG_ASSERT(vpart <= VPART_MAX);
-            MX_DEBUG_ASSERT(vslice <= VSLICE_MAX);
+            ZX_DEBUG_ASSERT(vpart <= VPART_MAX);
+            ZX_DEBUG_ASSERT(vslice <= VSLICE_MAX);
             alloc_entry->vpart = vpart & VPART_MAX;
             alloc_entry->vslice = vslice & VSLICE_MAX;
             hint = pslice + 1;
         }
     }
 
-    if ((status = WriteFvmLocked()) != MX_OK) {
+    if ((status = WriteFvmLocked()) != ZX_OK) {
         // Undo allocation in the event of failure; avoid holding VPartition
         // lock while writing to fvm.
         fbl::AutoLock lock(&vp->lock_);
@@ -359,29 +359,29 @@
     return status;
 }
 
-mx_status_t VPartitionManager::FreeSlices(VPartition* vp, size_t vslice_start,
+zx_status_t VPartitionManager::FreeSlices(VPartition* vp, size_t vslice_start,
                                           size_t count) {
     fbl::AutoLock lock(&lock_);
     return FreeSlicesLocked(vp, vslice_start, count);
 }
 
-mx_status_t VPartitionManager::FreeSlicesLocked(VPartition* vp, size_t vslice_start,
+zx_status_t VPartitionManager::FreeSlicesLocked(VPartition* vp, size_t vslice_start,
                                                 size_t count) {
     if (vslice_start + count > VSliceMax() || count > VSliceMax()) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     bool freed_something = false;
     {
         fbl::AutoLock lock(&vp->lock_);
         if (vp->IsKilledLocked())
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         // Sync first, before removing slices, so iotxns in-flight cannot
         // operate on 'unowned' slices.
-        mx_status_t status;
+        zx_status_t status;
         status = device_ioctl(parent(), IOCTL_DEVICE_SYNC, nullptr, 0, nullptr, 0, nullptr);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
 
@@ -391,7 +391,7 @@
                 while (!extent->is_empty()) {
                     auto vslice = extent->end() - 1;
                     GetSliceEntryLocked(vp->SliceGetLocked(vslice))->vpart = PSLICE_UNALLOCATED;
-                    MX_ASSERT(vp->SliceFreeLocked(vslice));
+                    ZX_ASSERT(vp->SliceFreeLocked(vslice));
                 }
             }
 
@@ -411,10 +411,10 @@
                         // has the potential to split extents, which may require
                         // memory allocation.
                         if (!vp->SliceFreeLocked(vslice)) {
-                            return MX_ERR_NO_MEMORY;
+                            return ZX_ERR_NO_MEMORY;
                         }
                     } else {
-                        MX_ASSERT(vp->SliceFreeLocked(vslice));
+                        ZX_ASSERT(vp->SliceFreeLocked(vslice));
                     }
                     GetSliceEntryLocked(pslice)->vpart = 0;
                     freed_something = true;
@@ -424,38 +424,38 @@
     }
 
     if (!freed_something) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     return WriteFvmLocked();
 }
 
 // Device protocol (FVM)
 
-mx_status_t VPartitionManager::DdkIoctl(uint32_t op, const void* cmd,
+zx_status_t VPartitionManager::DdkIoctl(uint32_t op, const void* cmd,
                                         size_t cmdlen, void* reply, size_t max,
                                         size_t* out_actual) {
     switch (op) {
     case IOCTL_BLOCK_FVM_ALLOC: {
         if (cmdlen < sizeof(alloc_req_t))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         const alloc_req_t* request = static_cast<const alloc_req_t*>(cmd);
 
         if (request->slice_count >= fbl::numeric_limits<uint32_t>::max()) {
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         } else if (request->slice_count == 0) {
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         }
 
-        mx_status_t status;
+        zx_status_t status;
         fbl::unique_ptr<VPartition> vpart;
         {
             fbl::AutoLock lock(&lock_);
             size_t vpart_entry;
-            if ((status = FindFreeVPartEntryLocked(&vpart_entry)) != MX_OK) {
+            if ((status = FindFreeVPartEntryLocked(&vpart_entry)) != ZX_OK) {
                 return status;
             }
 
-            if ((status = VPartition::Create(this, vpart_entry, &vpart)) != MX_OK) {
+            if ((status = VPartition::Create(this, vpart_entry, &vpart)) != ZX_OK) {
                 return status;
             }
 
@@ -465,30 +465,30 @@
                         request->name);
 
             if ((status = AllocateSlicesLocked(vpart.get(), 0,
-                                               request->slice_count)) != MX_OK) {
+                                               request->slice_count)) != ZX_OK) {
                 entry->slices = 0; // Undo VPartition allocation
                 return status;
             }
         }
-        if ((status = AddPartition(fbl::move(vpart))) != MX_OK) {
+        if ((status = AddPartition(fbl::move(vpart))) != ZX_OK) {
             return status;
         }
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_FVM_QUERY: {
         if (max < sizeof(fvm_info_t))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         fvm_info_t* info = static_cast<fvm_info_t*>(reply);
         info->slice_size = SliceSize();
         info->vslice_count = VSliceMax();
         *out_actual = sizeof(fvm_info_t);
-        return MX_OK;
+        return ZX_OK;
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 void VPartitionManager::DdkUnbind() {
@@ -509,18 +509,18 @@
 
 VPartition::~VPartition() = default;
 
-mx_status_t VPartition::Create(VPartitionManager* vpm, size_t entry_index,
+zx_status_t VPartition::Create(VPartitionManager* vpm, size_t entry_index,
                                fbl::unique_ptr<VPartition>* out) {
-    MX_DEBUG_ASSERT(entry_index != 0);
+    ZX_DEBUG_ASSERT(entry_index != 0);
 
     fbl::AllocChecker ac;
     auto vp = fbl::make_unique_checked<VPartition>(&ac, vpm, entry_index);
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     *out = fbl::move(vp);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void vpart_block_complete(iotxn_t* txn, void* cookie) {
@@ -531,27 +531,27 @@
 }
 
 uint32_t VPartition::SliceGetLocked(size_t vslice) const {
-    MX_DEBUG_ASSERT(vslice < mgr_->VSliceMax());
+    ZX_DEBUG_ASSERT(vslice < mgr_->VSliceMax());
     auto extent = --slice_map_.upper_bound(vslice);
     if (!extent.IsValid()) {
         return 0;
     }
-    MX_DEBUG_ASSERT(extent->start() <= vslice);
+    ZX_DEBUG_ASSERT(extent->start() <= vslice);
     return extent->get(vslice);
 }
 
-mx_status_t VPartition::SliceSetLocked(size_t vslice, uint32_t pslice) {
-    MX_DEBUG_ASSERT(vslice < mgr_->VSliceMax());
+zx_status_t VPartition::SliceSetLocked(size_t vslice, uint32_t pslice) {
+    ZX_DEBUG_ASSERT(vslice < mgr_->VSliceMax());
     auto extent = --slice_map_.upper_bound(vslice);
-    MX_DEBUG_ASSERT(!extent.IsValid() || extent->get(vslice) == PSLICE_UNALLOCATED);
+    ZX_DEBUG_ASSERT(!extent.IsValid() || extent->get(vslice) == PSLICE_UNALLOCATED);
     if (extent.IsValid() && (vslice == extent->end())) {
         // Easy case: append to existing slice
         if (!extent->push_back(pslice)) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
-        MX_DEBUG_ASSERT(SliceGetLocked(vslice) == pslice);
+        ZX_DEBUG_ASSERT(SliceGetLocked(vslice) == pslice);
         AddBlocksLocked((mgr_->SliceSize() / info_.block_size));
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Longer case: there is no extent for this vslice, so we should make
@@ -559,12 +559,12 @@
     fbl::AllocChecker ac;
     fbl::unique_ptr<SliceExtent> new_extent(new (&ac) SliceExtent(vslice));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     } else if (!new_extent->push_back(pslice)) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    MX_DEBUG_ASSERT(new_extent->GetKey() == vslice);
-    MX_DEBUG_ASSERT(new_extent->get(vslice) == pslice);
+    ZX_DEBUG_ASSERT(new_extent->GetKey() == vslice);
+    ZX_DEBUG_ASSERT(new_extent->get(vslice) == pslice);
     slice_map_.insert(fbl::move(new_extent));
 
     auto nextExtent = --slice_map_.upper_bound(vslice + 1);
@@ -576,14 +576,14 @@
         }
     }
 
-    MX_DEBUG_ASSERT(SliceGetLocked(vslice) == pslice);
+    ZX_DEBUG_ASSERT(SliceGetLocked(vslice) == pslice);
     AddBlocksLocked((mgr_->SliceSize() / info_.block_size));
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool VPartition::SliceFreeLocked(size_t vslice) TA_REQ(lock_) {
-    MX_DEBUG_ASSERT(vslice < mgr_->VSliceMax());
-    MX_DEBUG_ASSERT(SliceCanFree(vslice));
+    ZX_DEBUG_ASSERT(vslice < mgr_->VSliceMax());
+    ZX_DEBUG_ASSERT(SliceCanFree(vslice));
     auto extent = --slice_map_.upper_bound(vslice);
     if (vslice != extent->end() - 1) {
         // Removing from the middle of an extent; this splits the extent in
@@ -604,12 +604,12 @@
     return true;
 }
 
-void VPartition::Txn(uint32_t opcode, mx_handle_t vmo, uint64_t length,
+void VPartition::Txn(uint32_t opcode, zx_handle_t vmo, uint64_t length,
                      uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
-    mx_status_t status;
+    zx_status_t status;
     iotxn_t* txn;
     if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset,
-                                  length)) != MX_OK) {
+                                  length)) != ZX_OK) {
         callbacks_->complete(cookie, status);
         return;
     }
@@ -621,77 +621,77 @@
     iotxn_queue(mxdev(), txn);
 }
 
-static mx_status_t RequestBoundCheck(const extend_request_t* request,
+static zx_status_t RequestBoundCheck(const extend_request_t* request,
                                      size_t vslice_max) {
     if (request->offset == 0 || request->offset > vslice_max) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     } else if (request->length > vslice_max) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     } else if (request->offset + request->length < request->offset ||
                request->offset + request->length > vslice_max) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Device protocol (VPartition)
 
-mx_status_t VPartition::DdkIoctl(uint32_t op, const void* cmd, size_t cmdlen,
+zx_status_t VPartition::DdkIoctl(uint32_t op, const void* cmd, size_t cmdlen,
                                  void* reply, size_t max, size_t* out_actual) {
     switch (op) {
     case IOCTL_BLOCK_GET_INFO: {
         block_info_t* info = static_cast<block_info_t*>(reply);
         if (max < sizeof(*info))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         fbl::AutoLock lock(&lock_);
         if (IsKilledLocked())
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         memcpy(info, &info_, sizeof(*info));
         *out_actual = sizeof(*info);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_FVM_QUERY: {
         if (max < sizeof(fvm_info_t))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         fvm_info_t* info = static_cast<fvm_info_t*>(reply);
         info->slice_size = mgr_->SliceSize();
         info->vslice_count = mgr_->VSliceMax();
         *out_actual = sizeof(fvm_info_t);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_GET_TYPE_GUID: {
         char* guid = static_cast<char*>(reply);
         if (max < FVM_GUID_LEN)
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         fbl::AutoLock lock(&lock_);
         if (IsKilledLocked())
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         memcpy(guid, mgr_->GetAllocatedVPartEntry(entry_index_)->type, FVM_GUID_LEN);
         *out_actual = FVM_GUID_LEN;
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_GET_PARTITION_GUID: {
         char* guid = static_cast<char*>(reply);
         if (max < FVM_GUID_LEN)
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         fbl::AutoLock lock(&lock_);
         if (IsKilledLocked())
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         memcpy(guid, mgr_->GetAllocatedVPartEntry(entry_index_)->guid, FVM_GUID_LEN);
         *out_actual = FVM_GUID_LEN;
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_GET_NAME: {
         char* name = static_cast<char*>(reply);
         if (max < FVM_NAME_LEN + 1)
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         fbl::AutoLock lock(&lock_);
         if (IsKilledLocked())
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         memcpy(name, mgr_->GetAllocatedVPartEntry(entry_index_)->name, FVM_NAME_LEN);
         name[FVM_NAME_LEN] = 0;
         *out_actual = strlen(name);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_DEVICE_SYNC: {
         // Propagate sync to parent device
@@ -699,25 +699,25 @@
     }
     case IOCTL_BLOCK_FVM_EXTEND: {
         if (cmdlen < sizeof(extend_request_t))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         const extend_request_t* request = static_cast<const extend_request_t*>(cmd);
-        mx_status_t status;
-        if ((status = RequestBoundCheck(request, mgr_->VSliceMax())) != MX_OK) {
+        zx_status_t status;
+        if ((status = RequestBoundCheck(request, mgr_->VSliceMax())) != ZX_OK) {
             return status;
         } else if (request->length == 0) {
-            return MX_OK;
+            return ZX_OK;
         }
         return mgr_->AllocateSlices(this, request->offset, request->length);
     }
     case IOCTL_BLOCK_FVM_SHRINK: {
         if (cmdlen < sizeof(extend_request_t))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         const extend_request_t* request = static_cast<const extend_request_t*>(cmd);
-        mx_status_t status;
-        if ((status = RequestBoundCheck(request, mgr_->VSliceMax())) != MX_OK) {
+        zx_status_t status;
+        if ((status = RequestBoundCheck(request, mgr_->VSliceMax())) != ZX_OK) {
             return status;
         } else if (request->length == 0) {
-            return MX_OK;
+            return ZX_OK;
         }
         return mgr_->FreeSlices(this, request->offset, request->length);
     }
@@ -725,18 +725,18 @@
         return mgr_->FreeSlices(this, 0, mgr_->VSliceMax());
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
 typedef struct multi_iotxn_state {
     multi_iotxn_state(size_t total, iotxn_t* txn)
-        : txns_completed(0), txns_total(total), status(MX_OK), original(txn) {}
+        : txns_completed(0), txns_total(total), status(ZX_OK), original(txn) {}
 
     fbl::Mutex lock;
     size_t txns_completed TA_GUARDED(lock);
     size_t txns_total TA_GUARDED(lock);
-    mx_status_t status TA_GUARDED(lock);
+    zx_status_t status TA_GUARDED(lock);
     iotxn_t* original TA_GUARDED(lock);
 } multi_iotxn_state_t;
 
@@ -746,7 +746,7 @@
     {
         fbl::AutoLock lock(&state->lock);
         state->txns_completed++;
-        if (state->status == MX_OK && txn->status != MX_OK) {
+        if (state->status == ZX_OK && txn->status != ZX_OK) {
             state->status = txn->status;
         }
         if (state->txns_completed == state->txns_total) {
@@ -763,13 +763,13 @@
 
 void VPartition::DdkIotxnQueue(iotxn_t* txn) {
     if (txn->offset % BlockSize()) {
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
     // transactions from read()/write() may be truncated
     txn->length = ROUNDDOWN(txn->length, BlockSize());
     if (txn->length == 0) {
-        iotxn_complete(txn, MX_OK, 0);
+        iotxn_complete(txn, ZX_OK, 0);
         return;
     }
 
@@ -783,7 +783,7 @@
         // Common case: iotxn occurs within one slice
         uint32_t pslice = SliceGetLocked(vslice_start);
         if (pslice == FVM_SLICE_FREE) {
-            iotxn_complete(txn, MX_ERR_OUT_OF_RANGE, 0);
+            iotxn_complete(txn, ZX_ERR_OUT_OF_RANGE, 0);
             return;
         }
         txn->offset = SliceStart(disk_size, slice_size, pslice) +
@@ -799,7 +799,7 @@
     bool contiguous = true;
     for (size_t vslice = vslice_start; vslice <= vslice_end; vslice++) {
         if (SliceGetLocked(vslice) == FVM_SLICE_FREE) {
-            iotxn_complete(txn, MX_ERR_OUT_OF_RANGE, 0);
+            iotxn_complete(txn, ZX_ERR_OUT_OF_RANGE, 0);
             return;
         }
         if (vslice != vslice_start && SliceGetLocked(vslice - 1) + 1 != SliceGetLocked(vslice)) {
@@ -821,14 +821,14 @@
     iotxn_t* txns[kMaxSlices];
     const size_t txn_count = vslice_end - vslice_start + 1;
     if (kMaxSlices < (txn_count)) {
-        iotxn_complete(txn, MX_ERR_OUT_OF_RANGE, 0);
+        iotxn_complete(txn, ZX_ERR_OUT_OF_RANGE, 0);
         return;
     }
 
     fbl::AllocChecker ac;
     fbl::unique_ptr<multi_iotxn_state_t> state(new (&ac) multi_iotxn_state_t(txn_count, txn));
     if (!ac.check()) {
-        iotxn_complete(txn, MX_ERR_NO_MEMORY, 0);
+        iotxn_complete(txn, ZX_ERR_NO_MEMORY, 0);
         return;
     }
 
@@ -838,7 +838,7 @@
         uint32_t pslice = SliceGetLocked(vslice);
 
         uint64_t vmo_offset;
-        mx_off_t length;
+        zx_off_t length;
         if (vslice == vslice_start) {
             length = fbl::roundup(txn->offset + 1, slice_size) - txn->offset;
             vmo_offset = 0;
@@ -849,11 +849,11 @@
             length = slice_size;
             vmo_offset = txns[0]->length + slice_size * (i - 1);
         }
-        MX_DEBUG_ASSERT(length <= slice_size);
+        ZX_DEBUG_ASSERT(length <= slice_size);
 
-        mx_status_t status;
+        zx_status_t status;
         txns[i] = nullptr;
-        if ((status = iotxn_clone_partial(txn, vmo_offset, length, &txns[i])) != MX_OK) {
+        if ((status = iotxn_clone_partial(txn, vmo_offset, length, &txns[i])) != ZX_OK) {
             while (i-- > 0) {
                 iotxn_release(txns[i]);
             }
@@ -868,7 +868,7 @@
         txns[i]->complete_cb = multi_iotxn_completion;
         txns[i]->cookie = state.get();
     }
-    MX_DEBUG_ASSERT(length_remaining == 0);
+    ZX_DEBUG_ASSERT(length_remaining == 0);
 
     for (size_t i = 0; i < txn_count; i++) {
         iotxn_queue(GetParent(), txns[i]);
@@ -876,10 +876,10 @@
     state.release();
 }
 
-mx_off_t VPartition::DdkGetSize() {
-    const mx_off_t size = mgr_->DiskSize() * mgr_->SliceSize();
+zx_off_t VPartition::DdkGetSize() {
+    const zx_off_t size = mgr_->DiskSize() * mgr_->SliceSize();
     if (size / mgr_->SliceSize() != size) {
-        return fbl::numeric_limits<mx_off_t>::max();
+        return fbl::numeric_limits<zx_off_t>::max();
     }
     return size;
 }
@@ -903,12 +903,12 @@
     *info = info_;
 }
 
-void VPartition::BlockRead(mx_handle_t vmo, uint64_t length,
+void VPartition::BlockRead(zx_handle_t vmo, uint64_t length,
                            uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     Txn(IOTXN_OP_READ, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
-void VPartition::BlockWrite(mx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
+void VPartition::BlockWrite(zx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
                             uint64_t dev_offset, void* cookie) {
     Txn(IOTXN_OP_WRITE, vmo, length, vmo_offset, dev_offset, cookie);
 }
@@ -917,14 +917,14 @@
 
 // C-compatibility definitions
 
-static mx_status_t fvm_load_thread(void* arg) {
+static zx_status_t fvm_load_thread(void* arg) {
     return reinterpret_cast<fvm::VPartitionManager*>(arg)->Load();
 }
 
-mx_status_t fvm_bind(mx_device_t* parent) {
+zx_status_t fvm_bind(zx_device_t* parent) {
     fbl::unique_ptr<fvm::VPartitionManager> vpm;
-    mx_status_t status = fvm::VPartitionManager::Create(parent, &vpm);
-    if (status != MX_OK) {
+    zx_status_t status = fvm::VPartitionManager::Create(parent, &vpm);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -934,5 +934,5 @@
         return status;
     }
     vpm.release();
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/block/fvm/rules.mk b/system/dev/block/fvm/rules.mk
index e758575..6eff6dc 100644
--- a/system/dev/block/fvm/rules.mk
+++ b/system/dev/block/fvm/rules.mk
@@ -19,7 +19,7 @@
     system/ulib/fvm \
     system/ulib/gpt \
     system/ulib/digest \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/sync \
     third_party/ulib/cryptolib \
@@ -27,7 +27,7 @@
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/driver \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/dev/block/gpt/gpt.c b/system/dev/block/gpt/gpt.c
index 1720410..30e524c 100644
--- a/system/dev/block/gpt/gpt.c
+++ b/system/dev/block/gpt/gpt.c
@@ -7,9 +7,9 @@
 #include <ddk/binding.h>
 #include <ddk/protocol/block.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <magenta/listnode.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <zircon/listnode.h>
 #include <sys/param.h>
 #include <sync/completion.h>
 #include <lib/cksum.h>
@@ -38,8 +38,8 @@
 #define TXN_SIZE 0x4000 // 128 partition entries
 
 typedef struct gptpart_device {
-    mx_device_t* mxdev;
-    mx_device_t* parent;
+    zx_device_t* mxdev;
+    zx_device_t* parent;
 
     gpt_entry_t gpt_entry;
 
@@ -75,7 +75,7 @@
     return lbacount * dev->info.block_size;
 }
 
-static mx_off_t to_parent_offset(gptpart_device_t* dev, mx_off_t offset) {
+static zx_off_t to_parent_offset(gptpart_device_t* dev, zx_off_t offset) {
     return offset + dev->gpt_entry.first_lba * dev->info.block_size;
 }
 
@@ -105,32 +105,32 @@
 
 // implement device protocol:
 
-static mx_status_t gpt_ioctl(void* ctx, uint32_t op, const void* cmd, size_t cmdlen,
+static zx_status_t gpt_ioctl(void* ctx, uint32_t op, const void* cmd, size_t cmdlen,
                          void* reply, size_t max, size_t* out_actual) {
     gptpart_device_t* device = ctx;
     switch (op) {
     case IOCTL_BLOCK_GET_INFO: {
         block_info_t* info = reply;
         if (max < sizeof(*info))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         memcpy(info, &device->info, sizeof(*info));
         *out_actual = sizeof(*info);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_GET_TYPE_GUID: {
         char* guid = reply;
-        if (max < GPT_GUID_LEN) return MX_ERR_BUFFER_TOO_SMALL;
+        if (max < GPT_GUID_LEN) return ZX_ERR_BUFFER_TOO_SMALL;
         memcpy(guid, device->gpt_entry.type, GPT_GUID_LEN);
         return GPT_GUID_LEN;
         *out_actual = GPT_GUID_LEN;
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_GET_PARTITION_GUID: {
         char* guid = reply;
-        if (max < GPT_GUID_LEN) return MX_ERR_BUFFER_TOO_SMALL;
+        if (max < GPT_GUID_LEN) return ZX_ERR_BUFFER_TOO_SMALL;
         memcpy(guid, device->gpt_entry.guid, GPT_GUID_LEN);
         *out_actual = GPT_GUID_LEN;
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_GET_NAME: {
         char* name = reply;
@@ -138,25 +138,25 @@
         // save room for the null terminator
         utf16_to_cstring(name, device->gpt_entry.name, MIN((max - 1) * 2, GPT_NAME_LEN));
         *out_actual = strnlen(name, GPT_NAME_LEN / 2);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_DEVICE_SYNC: {
         // Propagate sync to parent device
         return device_ioctl(device->parent, IOCTL_DEVICE_SYNC, NULL, 0, NULL, 0, NULL);
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
 static void gpt_iotxn_queue(void* ctx, iotxn_t* txn) {
     gptpart_device_t* device = ctx;
     if (txn->offset % device->info.block_size) {
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
     if (txn->offset > getsize(device)) {
-        iotxn_complete(txn, MX_ERR_OUT_OF_RANGE, 0);
+        iotxn_complete(txn, ZX_ERR_OUT_OF_RANGE, 0);
         return;
     }
     // transactions from read()/write() may be truncated
@@ -164,13 +164,13 @@
     txn->length = MIN(txn->length, getsize(device) - txn->offset);
     txn->offset = to_parent_offset(device, txn->offset);
     if (txn->length == 0) {
-        iotxn_complete(txn, MX_OK, 0);
+        iotxn_complete(txn, ZX_OK, 0);
     } else {
         iotxn_queue(device->parent, txn);
     }
 }
 
-static mx_off_t gpt_getsize(void* ctx) {
+static zx_off_t gpt_getsize(void* ctx) {
     gptpart_device_t* device = ctx;
     return getsize(device);
 }
@@ -189,25 +189,25 @@
     return (flags & O_RDWR || flags & O_WRONLY);
 }
 
-static mx_status_t gpt_open(void* ctx, mx_device_t** dev_out, uint32_t flags) {
+static zx_status_t gpt_open(void* ctx, zx_device_t** dev_out, uint32_t flags) {
     gptpart_device_t* device = ctx;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     if (is_writer(flags) && (atomic_exchange(&device->writercount, 1) == 1)) {
         printf("Partition cannot be opened as writable (open elsewhere)\n");
-        status = MX_ERR_ALREADY_BOUND;
+        status = ZX_ERR_ALREADY_BOUND;
     }
     return status;
 }
 
-static mx_status_t gpt_close(void* ctx, uint32_t flags) {
+static zx_status_t gpt_close(void* ctx, uint32_t flags) {
     gptpart_device_t* device = ctx;
     if (is_writer(flags)) {
         atomic_fetch_sub(&device->writercount, 1);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_protocol_device_t gpt_proto = {
+static zx_protocol_device_t gpt_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = gpt_ioctl,
     .iotxn_queue = gpt_iotxn_queue,
@@ -235,21 +235,21 @@
     iotxn_release(txn);
 }
 
-static void block_do_txn(gptpart_device_t* dev, uint32_t opcode, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
+static void block_do_txn(gptpart_device_t* dev, uint32_t opcode, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block_info_t* info = &dev->info;
     if ((dev_offset % info->block_size) || (length % info->block_size)) {
-        dev->callbacks->complete(cookie, MX_ERR_INVALID_ARGS);
+        dev->callbacks->complete(cookie, ZX_ERR_INVALID_ARGS);
         return;
     }
     uint64_t size = getsize(dev);
     if ((dev_offset >= size) || (length >= (size - dev_offset))) {
-        dev->callbacks->complete(cookie, MX_ERR_OUT_OF_RANGE);
+        dev->callbacks->complete(cookie, ZX_ERR_OUT_OF_RANGE);
         return;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     iotxn_t* txn;
-    if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length)) != MX_OK) {
+    if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length)) != ZX_OK) {
         dev->callbacks->complete(cookie, status);
         return;
     }
@@ -262,11 +262,11 @@
     iotxn_queue(dev->parent, txn);
 }
 
-static void gpt_block_read(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
+static void gpt_block_read(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block_do_txn(ctx, IOTXN_OP_READ, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
-static void gpt_block_write(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
+static void gpt_block_write(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block_do_txn(ctx, IOTXN_OP_WRITE, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
@@ -282,12 +282,12 @@
 }
 
 typedef struct gpt_bind_info {
-    mx_device_t* dev;
+    zx_device_t* dev;
 } gpt_bind_info_t;
 
 static int gpt_bind_thread(void* arg) {
     gpt_bind_info_t* info = (gpt_bind_info_t*)arg;
-    mx_device_t* dev = info->dev;
+    zx_device_t* dev = info->dev;
     free(info);
 
     iotxn_t* txn = NULL;
@@ -308,8 +308,8 @@
     }
 
     // allocate an iotxn to read the partition table
-    mx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, TXN_SIZE);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, TXN_SIZE);
+    if (status != ZX_OK) {
         xprintf("gpt: error %d allocating iotxn\n", status);
         goto unbind;
     }
@@ -324,9 +324,9 @@
     txn->cookie = &completion;
 
     iotxn_queue(dev, txn);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 
-    if (txn->status != MX_OK) {
+    if (txn->status != ZX_OK) {
         xprintf("gpt: error %d reading partition header\n", txn->status);
         goto unbind;
     }
@@ -361,7 +361,7 @@
 
     completion_reset(&completion);
     iotxn_queue(dev, txn);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 
     uint8_t entries[TXN_SIZE];
     iotxn_copyfrom(txn, entries, txn->actual, 0);
@@ -420,11 +420,11 @@
             .name = name,
             .ctx = device,
             .ops = &gpt_proto,
-            .proto_id = MX_PROTOCOL_BLOCK_CORE,
+            .proto_id = ZX_PROTOCOL_BLOCK_CORE,
             .proto_ops = &gpt_block_ops,
         };
 
-        if (device_add(dev, &args, &device->mxdev) != MX_OK) {
+        if (device_add(dev, &args, &device->mxdev) != ZX_OK) {
             printf("gpt device_add failed\n");
             free(device);
             continue;
@@ -433,7 +433,7 @@
 
     iotxn_release(txn);
 
-    return MX_OK;
+    return ZX_OK;
 unbind:
     if (txn != NULL) {
         iotxn_release(txn);
@@ -441,29 +441,29 @@
     if (partitions == 0) {
         device_unbind(dev);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t gpt_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t gpt_bind(void* ctx, zx_device_t* dev, void** cookie) {
     gpt_bind_info_t* info = malloc(sizeof(gpt_bind_info_t));
     info->dev = dev;
 
     // read partition table asynchronously
     thrd_t t;
-    mx_status_t status = thrd_create_with_name(&t, gpt_bind_thread, info, "gpt-init");
+    zx_status_t status = thrd_create_with_name(&t, gpt_bind_thread, info, "gpt-init");
     if (status < 0) {
         free(info);
         return status;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t gpt_driver_ops = {
+static zx_driver_ops_t gpt_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = gpt_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(gpt, gpt_driver_ops, "magenta", "0.1", 2)
+ZIRCON_DRIVER_BEGIN(gpt, gpt_driver_ops, "zircon", "0.1", 2)
     BI_ABORT_IF_AUTOBIND,
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_BLOCK),
-MAGENTA_DRIVER_END(gpt)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_BLOCK),
+ZIRCON_DRIVER_END(gpt)
diff --git a/system/dev/block/gpt/rules.mk b/system/dev/block/gpt/rules.mk
index 0849c53..b8dd0e9 100644
--- a/system/dev/block/gpt/rules.mk
+++ b/system/dev/block/gpt/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync third_party/ulib/cksum
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/block/mbr/mbr.c b/system/dev/block/mbr/mbr.c
index c378af5..e025d71 100644
--- a/system/dev/block/mbr/mbr.c
+++ b/system/dev/block/mbr/mbr.c
@@ -17,7 +17,7 @@
 #include <ddk/driver.h>
 #include <ddk/protocol/block.h>
 
-#include <magenta/threads.h>
+#include <zircon/threads.h>
 #include <sync/completion.h>
 
 #include <gpt/gpt.h>
@@ -39,7 +39,7 @@
 #endif
 
 // ATTN: MBR supports 8 bit partition types instead of GUIDs. Here we define
-// mappings between partition type and GUIDs that magenta understands. When
+// mappings between partition type and GUIDs that zircon understands. When
 // the MBR driver receives a request for the type GUID, we lie and return the
 // a mapping from partition type to type GUID.
 static const uint8_t data_guid[GPT_GUID_LEN] = GUID_DATA_VALUE;
@@ -64,8 +64,8 @@
 } mbr_t;
 
 typedef struct mbrpart_device {
-    mx_device_t* mxdev;
-    mx_device_t* parent;
+    zx_device_t* mxdev;
+    zx_device_t* parent;
     mbr_partition_entry_t partition;
     block_info_t info;
     block_callbacks_t* callbacks;
@@ -87,7 +87,7 @@
     return dev->partition.sector_partition_length * ((uint64_t) dev->info.block_size);
 }
 
-static mx_status_t mbr_ioctl(void* ctx, uint32_t op, const void* cmd,
+static zx_status_t mbr_ioctl(void* ctx, uint32_t op, const void* cmd,
                              size_t cmdlen, void* reply, size_t max,
                              size_t* out_actual) {
     mbrpart_device_t* device = ctx;
@@ -95,47 +95,47 @@
     case IOCTL_BLOCK_GET_INFO: {
         block_info_t* info = reply;
         if (max < sizeof(*info))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         memcpy(info, &device->info, sizeof(*info));
         *out_actual = sizeof(*info);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_GET_TYPE_GUID: {
         char* guid = reply;
         if (max < GPT_GUID_LEN)
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         if (device->partition.type == PARTITION_TYPE_DATA) {
             memcpy(guid, data_guid, GPT_GUID_LEN);
             *out_actual = GPT_GUID_LEN;
-            return MX_OK;
+            return ZX_OK;
         } else if (device->partition.type == PARTITION_TYPE_SYS) {
             memcpy(guid, sys_guid, GPT_GUID_LEN);
             *out_actual = GPT_GUID_LEN;
-            return MX_OK;
+            return ZX_OK;
         } else {
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
         }
     }
     case IOCTL_BLOCK_GET_PARTITION_GUID: {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     case IOCTL_BLOCK_GET_NAME: {
         char* name = reply;
         memset(name, 0, max);
         strncpy(name, device_get_name(device->mxdev), max);
         *out_actual = strnlen(name, max);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_DEVICE_SYNC: {
         // Propagate sync to parent device
         return device_ioctl(device->parent, IOCTL_DEVICE_SYNC, NULL, 0, NULL, 0, NULL);
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-static mx_off_t to_parent_offset(mbrpart_device_t* dev, mx_off_t offset) {
+static zx_off_t to_parent_offset(mbrpart_device_t* dev, zx_off_t offset) {
     return offset + (uint64_t)(dev->partition.start_sector_lba) *
            (uint64_t)dev->info.block_size;
 }
@@ -143,11 +143,11 @@
 static void mbr_iotxn_queue(void* ctx, iotxn_t* txn) {
     mbrpart_device_t* dev = ctx;
     if (txn->offset % dev->info.block_size) {
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
     if (txn->offset > getsize(dev)) {
-        iotxn_complete(txn, MX_ERR_OUT_OF_RANGE, 0);
+        iotxn_complete(txn, ZX_ERR_OUT_OF_RANGE, 0);
         return;
     }
     // transactions from read()/write() may be truncated
@@ -155,13 +155,13 @@
     txn->length = MIN(txn->length, getsize(dev) - txn->offset);
     txn->offset = to_parent_offset(dev, txn->offset);
     if (txn->length == 0) {
-        iotxn_complete(txn, MX_OK, 0);
+        iotxn_complete(txn, ZX_OK, 0);
     } else {
         iotxn_queue(dev->parent, txn);
     }
 }
 
-static mx_off_t mbr_getsize(void* ctx) {
+static zx_off_t mbr_getsize(void* ctx) {
     return getsize(ctx);
 }
 
@@ -175,26 +175,26 @@
     free(device);
 }
 
-static mx_status_t mbr_open(void* ctx, mx_device_t** dev_out,
+static zx_status_t mbr_open(void* ctx, zx_device_t** dev_out,
                             uint32_t flags) {
     mbrpart_device_t* device = ctx;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     if (is_writer(flags) && (atomic_exchange(&device->writercount, 1) == 1)) {
         xprintf("Partition cannot be opened as writable (open elsewhere)\n");
-        status = MX_ERR_ALREADY_BOUND;
+        status = ZX_ERR_ALREADY_BOUND;
     }
     return status;
 }
 
-static mx_status_t mbr_close(void* ctx, uint32_t flags) {
+static zx_status_t mbr_close(void* ctx, uint32_t flags) {
     mbrpart_device_t* device = ctx;
     if (is_writer(flags)) {
         atomic_fetch_sub(&device->writercount, 1);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_protocol_device_t mbr_proto = {
+static zx_protocol_device_t mbr_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = mbr_ioctl,
     .iotxn_queue = mbr_iotxn_queue,
@@ -222,21 +222,21 @@
     iotxn_release(txn);
 }
 
-static void block_do_txn(mbrpart_device_t* dev, uint32_t opcode, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
+static void block_do_txn(mbrpart_device_t* dev, uint32_t opcode, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block_info_t* info = &dev->info;
     if ((dev_offset % info->block_size) || (length % info->block_size)) {
-        dev->callbacks->complete(cookie, MX_ERR_INVALID_ARGS);
+        dev->callbacks->complete(cookie, ZX_ERR_INVALID_ARGS);
         return;
     }
     uint64_t size = getsize(dev);
     if ((dev_offset >= size) || (length >= (size - dev_offset))) {
-        dev->callbacks->complete(cookie, MX_ERR_OUT_OF_RANGE);
+        dev->callbacks->complete(cookie, ZX_ERR_OUT_OF_RANGE);
         return;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     iotxn_t* txn;
-    if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length)) != MX_OK) {
+    if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length)) != ZX_OK) {
         dev->callbacks->complete(cookie, status);
         return;
     }
@@ -249,11 +249,11 @@
     iotxn_queue(dev->parent, txn);
 }
 
-static void mbr_block_read(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
+static void mbr_block_read(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block_do_txn(ctx, IOTXN_OP_READ, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
-static void mbr_block_write(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
+static void mbr_block_write(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block_do_txn(ctx, IOTXN_OP_WRITE, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
@@ -265,7 +265,7 @@
 };
 
 static int mbr_bind_thread(void* arg) {
-    mx_device_t* dev = arg;
+    zx_device_t* dev = arg;
 
     // Classic MBR supports 4 partitions.
     uint8_t partition_count = 0;
@@ -291,8 +291,8 @@
         iotxn_size = DIV_ROUND_UP(MBR_SIZE, block_info.block_size) * block_info.block_size;
     }
 
-    mx_status_t st = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, iotxn_size);
-    if (st != MX_OK) {
+    zx_status_t st = iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, iotxn_size);
+    if (st != ZX_OK) {
         xprintf("mbr: failed to allocate iotxn, retcode = %d\n", st);
         goto unbind;
     }
@@ -305,9 +305,9 @@
     txn->cookie = &cplt;
 
     iotxn_queue(dev, txn);
-    completion_wait(&cplt, MX_TIME_INFINITE);
+    completion_wait(&cplt, ZX_TIME_INFINITE);
 
-    if (txn->status != MX_OK) {
+    if (txn->status != ZX_OK) {
         xprintf("mbr: could not read mbr from device, retcode = %d\n",
                 txn->status);
         goto unbind;
@@ -363,11 +363,11 @@
             .name = name,
             .ctx = pdev,
             .ops = &mbr_proto,
-            .proto_id = MX_PROTOCOL_BLOCK_CORE,
+            .proto_id = ZX_PROTOCOL_BLOCK_CORE,
             .proto_ops = &mbr_block_ops,
         };
 
-        if ((st = device_add(dev, &args, &pdev->mxdev)) != MX_OK) {
+        if ((st = device_add(dev, &args, &pdev->mxdev)) != ZX_OK) {
             xprintf("mbr: device_add failed, retcode = %d\n", st);
             free(pdev);
             continue;
@@ -390,7 +390,7 @@
     return -1;
 }
 
-static mx_status_t mbr_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t mbr_bind(void* ctx, zx_device_t* dev, void** cookie) {
     // Make sure the MBR structs are the right size.
     static_assert(sizeof(mbr_t) == MBR_SIZE, "mbr_t is the wrong size");
     static_assert(sizeof(mbr_partition_entry_t) == MBR_PARTITION_ENTRY_SIZE,
@@ -400,19 +400,19 @@
     thrd_t t;
     int thrd_rc = thrd_create_with_name(&t, mbr_bind_thread, dev, "mbr-init");
     if (thrd_rc != thrd_success) {
-        return thrd_status_to_mx_status(thrd_rc);
+        return thrd_status_to_zx_status(thrd_rc);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t mbr_driver_ops = {
+static zx_driver_ops_t mbr_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = mbr_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(mbr, mbr_driver_ops, "magenta", "0.1", 2)
+ZIRCON_DRIVER_BEGIN(mbr, mbr_driver_ops, "zircon", "0.1", 2)
     BI_ABORT_IF_AUTOBIND,
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_BLOCK),
-MAGENTA_DRIVER_END(mbr)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_BLOCK),
+ZIRCON_DRIVER_END(mbr)
 // clang-format on
diff --git a/system/dev/block/mbr/rules.mk b/system/dev/block/mbr/rules.mk
index 6a3e713..e71a695 100644
--- a/system/dev/block/mbr/rules.mk
+++ b/system/dev/block/mbr/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/gpt system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/block/pci-sdhci/pci-sdhci.c b/system/dev/block/pci-sdhci/pci-sdhci.c
index a6aae60..23defcd 100644
--- a/system/dev/block/pci-sdhci/pci-sdhci.c
+++ b/system/dev/block/pci-sdhci/pci-sdhci.c
@@ -19,30 +19,30 @@
 #include <unistd.h>
 
 typedef struct pci_sdhci_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     pci_protocol_t pci;
 
     volatile sdhci_regs_t* regs;
     uint64_t regs_size;
-    mx_handle_t regs_handle;
+    zx_handle_t regs_handle;
 } pci_sdhci_device_t;
 
-static mx_handle_t pci_sdhci_get_interrupt(void* ctx) {
+static zx_handle_t pci_sdhci_get_interrupt(void* ctx) {
     pci_sdhci_device_t* dev = ctx;
     // select irq mode
-    mx_status_t status = dev->pci.ops->set_irq_mode(dev->pci.ctx, MX_PCIE_IRQ_MODE_MSI, 1);
+    zx_status_t status = dev->pci.ops->set_irq_mode(dev->pci.ctx, ZX_PCIE_IRQ_MODE_MSI, 1);
     if (status < 0) {
-        status = dev->pci.ops->set_irq_mode(dev->pci.ctx, MX_PCIE_IRQ_MODE_LEGACY, 1);
+        status = dev->pci.ops->set_irq_mode(dev->pci.ctx, ZX_PCIE_IRQ_MODE_LEGACY, 1);
         if (status < 0) {
             printf("pci-sdhci: error %d setting irq mode\n", status);
             return status;
         }
         printf("pci-sdhci: selected legacy irq mode\n");
     }
-    mx_handle_t irq_handle = MX_HANDLE_INVALID;
+    zx_handle_t irq_handle = ZX_HANDLE_INVALID;
     // get irq handle
     status = dev->pci.ops->map_interrupt(dev->pci.ctx, 0, &irq_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("pci-sdhci: error %d getting irq handle\n", status);
         return status;
     } else {
@@ -50,26 +50,26 @@
     }
 }
 
-static mx_status_t pci_sdhci_get_mmio(void* ctx, volatile sdhci_regs_t** out) {
+static zx_status_t pci_sdhci_get_mmio(void* ctx, volatile sdhci_regs_t** out) {
     pci_sdhci_device_t* dev = ctx;
     if (dev->regs == NULL) {
-        mx_status_t status = dev->pci.ops->map_resource(dev->pci.ctx, PCI_RESOURCE_BAR_0,
-                MX_CACHE_POLICY_UNCACHED_DEVICE, (void**)&dev->regs,
+        zx_status_t status = dev->pci.ops->map_resource(dev->pci.ctx, PCI_RESOURCE_BAR_0,
+                ZX_CACHE_POLICY_UNCACHED_DEVICE, (void**)&dev->regs,
                 &dev->regs_size, &dev->regs_handle);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             printf("pci-sdhci: error %d mapping register window\n", status);
             return status;
         }
     }
     *out = dev->regs;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static uint32_t pci_sdhci_get_base_clock(void* ctx) {
     return 0;
 }
 
-static mx_paddr_t pci_sdhci_get_dma_offset(void* ctx) {
+static zx_paddr_t pci_sdhci_get_dma_offset(void* ctx) {
     return 0;
 }
 
@@ -86,11 +86,11 @@
     val |= SDHCI_EMMC_HW_RESET;
     dev->regs->ctrl0 = val;
     // minimum is 1us but wait 9us for good measure
-    mx_nanosleep(mx_deadline_after(MX_USEC(9)));
+    zx_nanosleep(zx_deadline_after(ZX_USEC(9)));
     val &= ~SDHCI_EMMC_HW_RESET;
     dev->regs->ctrl0 = val;
     // minimum is 200us but wait 300us for good measure
-    mx_nanosleep(mx_deadline_after(MX_USEC(300)));
+    zx_nanosleep(zx_deadline_after(ZX_USEC(300)));
 }
 
 static sdhci_protocol_ops_t pci_sdhci_sdhci_proto = {
@@ -110,28 +110,28 @@
 static void pci_sdhci_release(void* ctx) {
     pci_sdhci_device_t* dev = ctx;
     if (dev->regs != NULL) {
-        mx_handle_close(dev->regs_handle);
+        zx_handle_close(dev->regs_handle);
     }
     free(dev);
 }
 
-static mx_protocol_device_t pci_sdhci_device_proto = {
+static zx_protocol_device_t pci_sdhci_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = pci_sdhci_unbind,
     .release = pci_sdhci_release,
 };
 
-static mx_status_t pci_sdhci_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t pci_sdhci_bind(void* ctx, zx_device_t* parent, void** cookie) {
     printf("pci-sdhci: bind\n");
     pci_sdhci_device_t* dev = calloc(1, sizeof(pci_sdhci_device_t));
     if (!dev) {
         printf("pci-sdhci: out of memory\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t status = MX_OK;
-    if (device_get_protocol(parent, MX_PROTOCOL_PCI, (void*)&dev->pci)) {
-        status = MX_ERR_NOT_SUPPORTED;
+    zx_status_t status = ZX_OK;
+    if (device_get_protocol(parent, ZX_PROTOCOL_PCI, (void*)&dev->pci)) {
+        status = ZX_ERR_NOT_SUPPORTED;
         goto fail;
     }
 
@@ -146,30 +146,30 @@
         .name = "pci-sdhci",
         .ctx = dev,
         .ops = &pci_sdhci_device_proto,
-        .proto_id = MX_PROTOCOL_SDHCI,
+        .proto_id = ZX_PROTOCOL_SDHCI,
         .proto_ops = &pci_sdhci_sdhci_proto,
     };
 
     status = device_add(parent, &args, &dev->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
-    return MX_OK;
+    return ZX_OK;
 fail:
     free(dev);
     return status;
 }
 
-static mx_driver_ops_t pci_sdhci_driver_ops = {
+static zx_driver_ops_t pci_sdhci_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = pci_sdhci_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(pci_sdhci, pci_sdhci_driver_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+ZIRCON_DRIVER_BEGIN(pci_sdhci, pci_sdhci_driver_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_CLASS, 0x08),
     BI_ABORT_IF(NE, BIND_PCI_SUBCLASS, 0x05),
     BI_MATCH_IF(EQ, BIND_PCI_INTERFACE, 0x01),
-MAGENTA_DRIVER_END(pci_sdhci)
+ZIRCON_DRIVER_END(pci_sdhci)
diff --git a/system/dev/block/pci-sdhci/rules.mk b/system/dev/block/pci-sdhci/rules.mk
index 42ef62d..a0ebaa2 100644
--- a/system/dev/block/pci-sdhci/rules.mk
+++ b/system/dev/block/pci-sdhci/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/block/ramdisk/ramdisk.c b/system/dev/block/ramdisk/ramdisk.c
index b2dd101..acd36b7 100644
--- a/system/dev/block/ramdisk/ramdisk.c
+++ b/system/dev/block/ramdisk/ramdisk.c
@@ -6,13 +6,13 @@
 #include <ddk/driver.h>
 #include <ddk/binding.h>
 #include <ddk/protocol/block.h>
-#include <magenta/device/ramdisk.h>
+#include <zircon/device/ramdisk.h>
 #include <sync/completion.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <magenta/listnode.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <zircon/listnode.h>
 #include <sys/param.h>
 #include <assert.h>
 #include <inttypes.h>
@@ -23,14 +23,14 @@
 #include <threads.h>
 
 typedef struct {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 } ramctl_device_t;
 
 typedef struct ramdisk_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     uint64_t blk_size;
     uint64_t blk_count;
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     uintptr_t mapped_addr;
     block_callbacks_t* cb;
     char name[NAME_MAX];
@@ -46,11 +46,11 @@
     return rdev->blk_size * rdev->blk_count;
 }
 
-static mx_status_t constrain_args(ramdisk_device_t* ramdev,
-                                  mx_off_t* offset, mx_off_t* length) {
+static zx_status_t constrain_args(ramdisk_device_t* ramdev,
+                                  zx_off_t* offset, zx_off_t* length) {
     // Offset must be aligned
     if (*offset % ramdev->blk_size != 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Constrain to device capacity
@@ -58,10 +58,10 @@
 
     // Length must be aligned
     if (*length % ramdev->blk_size != 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void ramdisk_get_info(void* ctx, block_info_t* info) {
@@ -76,46 +76,46 @@
     rdev->cb = cb;
 }
 
-static void ramdisk_fifo_read(void* ctx, mx_handle_t vmo, uint64_t length,
+static void ramdisk_fifo_read(void* ctx, zx_handle_t vmo, uint64_t length,
                               uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     ramdisk_device_t* rdev = ctx;
-    mx_off_t len = length;
-    mx_status_t status = constrain_args(rdev, &dev_offset, &len);
-    if (status != MX_OK) {
+    zx_off_t len = length;
+    zx_status_t status = constrain_args(rdev, &dev_offset, &len);
+    if (status != ZX_OK) {
         rdev->cb->complete(cookie, status);
         return;
     }
 
     mtx_lock(&rdev->lock);
     if (rdev->dead) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     } else {
         size_t actual;
         // Reading from disk --> Write to file VMO
-        status = mx_vmo_write(vmo, (void*)rdev->mapped_addr + dev_offset,
+        status = zx_vmo_write(vmo, (void*)rdev->mapped_addr + dev_offset,
                               vmo_offset, len, &actual);
     }
     mtx_unlock(&rdev->lock);
     rdev->cb->complete(cookie, status);
 }
 
-static void ramdisk_fifo_write(void* ctx, mx_handle_t vmo, uint64_t length,
+static void ramdisk_fifo_write(void* ctx, zx_handle_t vmo, uint64_t length,
                                uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     ramdisk_device_t* rdev = ctx;
-    mx_off_t len = length;
-    mx_status_t status = constrain_args(rdev, &dev_offset, &len);
-    if (status != MX_OK) {
+    zx_off_t len = length;
+    zx_status_t status = constrain_args(rdev, &dev_offset, &len);
+    if (status != ZX_OK) {
         rdev->cb->complete(cookie, status);
         return;
     }
 
     mtx_lock(&rdev->lock);
     if (rdev->dead) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     } else {
         size_t actual = 0;
         // Writing to disk --> Read from file VMO
-        status = mx_vmo_read(vmo, (void*)rdev->mapped_addr + dev_offset,
+        status = zx_vmo_read(vmo, (void*)rdev->mapped_addr + dev_offset,
                              vmo_offset, len, &actual);
     }
     mtx_unlock(&rdev->lock);
@@ -139,17 +139,17 @@
     device_remove(ramdev->mxdev);
 }
 
-static mx_status_t ramdisk_ioctl(void* ctx, uint32_t op, const void* cmd,
+static zx_status_t ramdisk_ioctl(void* ctx, uint32_t op, const void* cmd,
                              size_t cmdlen, void* reply, size_t max, size_t* out_actual) {
     ramdisk_device_t* ramdev = ctx;
     if (ramdev->dead) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     switch (op) {
     case IOCTL_RAMDISK_UNLINK: {
         ramdisk_unbind(ramdev);
-        return MX_OK;
+        return ZX_OK;
     }
     // Block Protocol
     case IOCTL_BLOCK_GET_NAME: {
@@ -157,36 +157,36 @@
         memset(name, 0, max);
         strncpy(name, ramdev->name, max);
         *out_actual = strnlen(name, max);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_GET_INFO: {
         block_info_t* info = reply;
         if (max < sizeof(*info))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         ramdisk_get_info(ramdev, info);
         *out_actual = sizeof(*info);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_RR_PART: {
         return device_rebind(ramdev->mxdev);
     }
     case IOCTL_DEVICE_SYNC: {
         // Wow, we sync so quickly!
-        return MX_OK;
+        return ZX_OK;
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
 static void ramdisk_iotxn_queue(void* ctx, iotxn_t* txn) {
     ramdisk_device_t* ramdev = ctx;
     if (ramdev->dead) {
-        iotxn_complete(txn, MX_ERR_BAD_STATE, 0);
+        iotxn_complete(txn, ZX_ERR_BAD_STATE, 0);
         return;
     }
-    mx_status_t status = constrain_args(ramdev, &txn->offset, &txn->length);
-    if (status != MX_OK) {
+    zx_status_t status = constrain_args(ramdev, &txn->offset, &txn->length);
+    if (status != ZX_OK) {
         iotxn_complete(txn, status, 0);
         return;
     }
@@ -194,35 +194,35 @@
     switch (txn->opcode) {
         case IOTXN_OP_READ: {
             iotxn_copyto(txn, (void*) ramdev->mapped_addr + txn->offset, txn->length, 0);
-            iotxn_complete(txn, MX_OK, txn->length);
+            iotxn_complete(txn, ZX_OK, txn->length);
             return;
         }
         case IOTXN_OP_WRITE: {
             iotxn_copyfrom(txn, (void*) ramdev->mapped_addr + txn->offset, txn->length, 0);
-            iotxn_complete(txn, MX_OK, txn->length);
+            iotxn_complete(txn, ZX_OK, txn->length);
             return;
         }
         default: {
-            iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+            iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
             return;
         }
     }
 }
 
-static mx_off_t ramdisk_getsize(void* ctx) {
+static zx_off_t ramdisk_getsize(void* ctx) {
     return sizebytes(ctx);
 }
 
 static void ramdisk_release(void* ctx) {
     ramdisk_device_t* ramdev = ctx;
-    if (ramdev->vmo != MX_HANDLE_INVALID) {
-        mx_vmar_unmap(mx_vmar_root_self(), ramdev->mapped_addr, sizebytes(ramdev));
-        mx_handle_close(ramdev->vmo);
+    if (ramdev->vmo != ZX_HANDLE_INVALID) {
+        zx_vmar_unmap(zx_vmar_root_self(), ramdev->mapped_addr, sizebytes(ramdev));
+        zx_handle_close(ramdev->vmo);
     }
     free(ramdev);
 }
 
-static mx_protocol_device_t ramdisk_instance_proto = {
+static zx_protocol_device_t ramdisk_instance_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = ramdisk_ioctl,
     .iotxn_queue = ramdisk_iotxn_queue,
@@ -235,37 +235,37 @@
 
 static uint64_t ramdisk_count = 0;
 
-static mx_status_t ramctl_ioctl(void* ctx, uint32_t op, const void* cmd,
+static zx_status_t ramctl_ioctl(void* ctx, uint32_t op, const void* cmd,
                                 size_t cmdlen, void* reply, size_t max, size_t* out_actual) {
     ramctl_device_t* ramctl = ctx;
 
     switch (op) {
     case IOCTL_RAMDISK_CONFIG: {
         if (cmdlen != sizeof(ramdisk_ioctl_config_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (max < 32) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         ramdisk_ioctl_config_t* config = (ramdisk_ioctl_config_t*)cmd;
 
         ramdisk_device_t* ramdev = calloc(1, sizeof(ramdisk_device_t));
         if (!ramdev) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         ramdev->blk_size = config->blk_size;
         ramdev->blk_count = config->blk_count;
         mtx_init(&ramdev->lock, mtx_plain);
         sprintf(ramdev->name, "ramdisk-%lu", ramdisk_count++);
-        mx_status_t status;
-        if ((status = mx_vmo_create(sizebytes(ramdev), 0, &ramdev->vmo)) != MX_OK) {
+        zx_status_t status;
+        if ((status = zx_vmo_create(sizebytes(ramdev), 0, &ramdev->vmo)) != ZX_OK) {
             free(ramdev);
             return status;
         }
-        if ((status = mx_vmar_map(mx_vmar_root_self(), 0, ramdev->vmo, 0, sizebytes(ramdev),
-                                  MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
-                                  &ramdev->mapped_addr)) != MX_OK) {
-            mx_handle_close(ramdev->vmo);
+        if ((status = zx_vmar_map(zx_vmar_root_self(), 0, ramdev->vmo, 0, sizebytes(ramdev),
+                                  ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
+                                  &ramdev->mapped_addr)) != ZX_OK) {
+            zx_handle_close(ramdev->vmo);
             free(ramdev);
             return status;
         }
@@ -275,34 +275,34 @@
             .name = ramdev->name,
             .ctx = ramdev,
             .ops = &ramdisk_instance_proto,
-            .proto_id = MX_PROTOCOL_BLOCK_CORE,
+            .proto_id = ZX_PROTOCOL_BLOCK_CORE,
             .proto_ops = &ramdisk_block_ops,
         };
 
-        if ((status = device_add(ramctl->mxdev, &args, &ramdev->mxdev)) != MX_OK) {
-            mx_vmar_unmap(mx_vmar_root_self(), ramdev->mapped_addr, sizebytes(ramdev));
-            mx_handle_close(ramdev->vmo);
+        if ((status = device_add(ramctl->mxdev, &args, &ramdev->mxdev)) != ZX_OK) {
+            zx_vmar_unmap(zx_vmar_root_self(), ramdev->mapped_addr, sizebytes(ramdev));
+            zx_handle_close(ramdev->vmo);
             free(ramdev);
             return status;
         }
         strcpy(reply, ramdev->name);
         *out_actual = strlen(reply);
-        return MX_OK;
+        return ZX_OK;
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-static mx_protocol_device_t ramdisk_ctl_proto = {
+static zx_protocol_device_t ramdisk_ctl_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = ramctl_ioctl,
 };
 
-static mx_status_t ramdisk_driver_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t ramdisk_driver_bind(void* ctx, zx_device_t* parent, void** cookie) {
     ramctl_device_t* ramctl = calloc(1, sizeof(ramctl_device_t));
     if (ramctl == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     device_add_args_t args = {
@@ -315,11 +315,11 @@
     return device_add(parent, &args, &ramctl->mxdev);
 }
 
-static mx_driver_ops_t ramdisk_driver_ops = {
+static zx_driver_ops_t ramdisk_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ramdisk_driver_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(ramdisk, ramdisk_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(ramdisk)
+ZIRCON_DRIVER_BEGIN(ramdisk, ramdisk_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(ramdisk)
diff --git a/system/dev/block/ramdisk/rules.mk b/system/dev/block/ramdisk/rules.mk
index f2d47a0..04e3ddc 100644
--- a/system/dev/block/ramdisk/rules.mk
+++ b/system/dev/block/ramdisk/rules.mk
@@ -13,9 +13,9 @@
 MODULE_STATIC_LIBS := \
     system/ulib/ddk \
     system/ulib/sync \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/block/sdhci/rules.mk b/system/dev/block/sdhci/rules.mk
index bcd01ad..0b13097 100644
--- a/system/dev/block/sdhci/rules.mk
+++ b/system/dev/block/sdhci/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync system/ulib/pretty
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c system/ulib/mxio
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c system/ulib/fdio
 
 include make/module.mk
diff --git a/system/dev/block/sdhci/sdhci.c b/system/dev/block/sdhci/sdhci.c
index 84355b9..3c38b8d 100644
--- a/system/dev/block/sdhci/sdhci.c
+++ b/system/dev/block/sdhci/sdhci.c
@@ -27,10 +27,10 @@
 #include <ddk/protocol/sdhci.h>
 #include <hw/sdmmc.h>
 
-// Magenta Includes
-#include <mxio/watcher.h>
-#include <magenta/threads.h>
-#include <magenta/assert.h>
+// Zircon Includes
+#include <fdio/watcher.h>
+#include <zircon/threads.h>
+#include <zircon/assert.h>
 #include <sync/completion.h>
 #include <pretty/hexdump.h>
 
@@ -75,7 +75,7 @@
 
 typedef struct sdhci_device {
     // Interrupts mapped here.
-    mx_handle_t irq_handle;
+    zx_handle_t irq_handle;
     // Used to signal that a command has completed.
     completion_t irq_completion;
 
@@ -83,8 +83,8 @@
     volatile sdhci_regs_t* regs;
 
     // Device heirarchy
-    mx_device_t* mxdev;
-    mx_device_t* parent;
+    zx_device_t* mxdev;
+    zx_device_t* parent;
 
     // Protocol ops
     sdhci_protocol_t sdhci;
@@ -110,7 +110,7 @@
     uint32_t base_clock;
     // Offset to DMA address
     // XXX temporary (see ddk/protocol/sdhci.h)
-    mx_paddr_t dma_offset;
+    zx_paddr_t dma_offset;
 } sdhci_device_t;
 
 // If any of these interrupts is asserted in the SDHCI irq register, it means
@@ -144,21 +144,21 @@
            !(dev->quirks & SDHCI_QUIRK_NO_DMA);
 }
 
-static mx_status_t sdhci_wait_for_reset(sdhci_device_t* dev, const uint32_t mask, mx_time_t timeout) {
-    mx_time_t deadline = mx_time_get(MX_CLOCK_MONOTONIC) + timeout;
+static zx_status_t sdhci_wait_for_reset(sdhci_device_t* dev, const uint32_t mask, zx_time_t timeout) {
+    zx_time_t deadline = zx_time_get(ZX_CLOCK_MONOTONIC) + timeout;
     while (true) {
         if (((dev->regs->ctrl1) & mask) == 0) {
             break;
         }
-        if (mx_time_get(MX_CLOCK_MONOTONIC) > deadline) {
+        if (zx_time_get(ZX_CLOCK_MONOTONIC) > deadline) {
             printf("sdhci: timed out while waiting for reset\n");
-            return MX_ERR_TIMED_OUT;
+            return ZX_ERR_TIMED_OUT;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static void sdhci_complete_pending_locked(sdhci_device_t* dev, mx_status_t status, uint64_t actual) {
+static void sdhci_complete_pending_locked(sdhci_device_t* dev, zx_status_t status, uint64_t actual) {
     // Disable irqs when no pending iotxn
     dev->regs->irqen = 0;
 
@@ -216,7 +216,7 @@
             }
         }
     } else {
-        sdhci_complete_pending_locked(dev, MX_OK, 0);
+        sdhci_complete_pending_locked(dev, ZX_OK, 0);
     }
 }
 
@@ -239,7 +239,7 @@
     }
     pdata->blockid += 1;
     if (pdata->blockid == pdata->blockcount) {
-        sdhci_complete_pending_locked(dev, MX_OK, txn->actual);
+        sdhci_complete_pending_locked(dev, ZX_OK, txn->actual);
     }
 }
 
@@ -262,7 +262,7 @@
     }
     pdata->blockid += 1;
     if (pdata->blockid == pdata->blockcount) {
-        sdhci_complete_pending_locked(dev, MX_OK, txn->actual);
+        sdhci_complete_pending_locked(dev, ZX_OK, txn->actual);
     }
 }
 
@@ -271,21 +271,21 @@
         xprintf("sdhci: spurious XFER_CPLT interrupt!\n");
         return;
     }
-    sdhci_complete_pending_locked(dev, MX_OK, dev->pending->length);
+    sdhci_complete_pending_locked(dev, ZX_OK, dev->pending->length);
 }
 
 static void sdhci_error_recovery_locked(sdhci_device_t* dev) {
     // Reset internal state machines
     dev->regs->ctrl1 |= SDHCI_SOFTWARE_RESET_CMD;
-    sdhci_wait_for_reset(dev, SDHCI_SOFTWARE_RESET_CMD, MX_SEC(1));
+    sdhci_wait_for_reset(dev, SDHCI_SOFTWARE_RESET_CMD, ZX_SEC(1));
     dev->regs->ctrl1 |= SDHCI_SOFTWARE_RESET_DAT;
-    sdhci_wait_for_reset(dev, SDHCI_SOFTWARE_RESET_DAT, MX_SEC(1));
+    sdhci_wait_for_reset(dev, SDHCI_SOFTWARE_RESET_DAT, ZX_SEC(1));
 
     // TODO data stage abort
 
     // Complete any pending txn with error status
     if (dev->pending != NULL) {
-        sdhci_complete_pending_locked(dev, MX_ERR_IO, 0);
+        sdhci_complete_pending_locked(dev, ZX_ERR_IO, 0);
     }
 }
 
@@ -306,14 +306,14 @@
 }
 
 static int sdhci_irq_thread(void *arg) {
-    mx_status_t wait_res;
+    zx_status_t wait_res;
     sdhci_device_t* dev = (sdhci_device_t*)arg;
     volatile struct sdhci_regs* regs = dev->regs;
-    mx_handle_t irq_handle = dev->irq_handle;
+    zx_handle_t irq_handle = dev->irq_handle;
 
     while (true) {
-        wait_res = mx_interrupt_wait(irq_handle);
-        if (wait_res != MX_OK) {
+        wait_res = zx_interrupt_wait(irq_handle);
+        if (wait_res != ZX_OK) {
             printf("sdhci: interrupt wait failed with retcode = %d\n", wait_res);
             break;
         }
@@ -344,12 +344,12 @@
         mtx_unlock(&dev->mtx);
 
         // Mark this interrupt as completed.
-        mx_interrupt_complete(irq_handle);
+        zx_interrupt_complete(irq_handle);
     }
     return 0;
 }
 
-static mx_status_t sdhci_start_txn_locked(sdhci_device_t* dev, iotxn_t* txn) {
+static zx_status_t sdhci_start_txn_locked(sdhci_device_t* dev, iotxn_t* txn) {
     sdmmc_protocol_data_t* pdata = iotxn_pdata(txn, sdmmc_protocol_data_t);
 
     volatile struct sdhci_regs* regs = dev->regs;
@@ -358,7 +358,7 @@
     const uint16_t blksiz = pdata->blocksize;
     uint32_t cmd = pdata->cmd;
 
-    mx_status_t st = MX_OK;
+    zx_status_t st = ZX_OK;
 
 #if 1
     xprintf("sdhci: start_txn cmd=0x%08x (data %d) blkcnt %u blksiz %u length %" PRIu64 "\n",
@@ -380,14 +380,14 @@
     // Wait for the inhibit masks from above to become 0 before issuing the
     // command.
     while (regs->state & inhibit_mask)
-        mx_nanosleep(mx_deadline_after(MX_MSEC(1)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(1)));
 
     // This command has a data phase?
     bool has_data = cmd & SDMMC_RESP_DATA_PRESENT;
     bool use_dma = sdhci_supports_adma2_64bit(dev);
     if (has_data) {
         st = iotxn_physmap(txn);
-        if (st != MX_OK) {
+        if (st != ZX_OK) {
             goto err;
         }
         iotxn_cacheop(txn, IOTXN_CACHE_CLEAN, 0, blkcnt * blksiz);
@@ -398,7 +398,7 @@
 
             int count = 0;
             size_t length;
-            mx_paddr_t paddr;
+            zx_paddr_t paddr;
             sdhci_adma64_desc_t* desc = dev->descs;
             for (;;) {
                 length = iotxn_phys_iter_next(&iter, &paddr);
@@ -409,16 +409,16 @@
                         break;
                     } else {
                         xprintf("sdhci: empty descriptor list!\n");
-                        st = MX_ERR_NOT_SUPPORTED;
+                        st = ZX_ERR_NOT_SUPPORTED;
                         goto err;
                     }
                 } else if (length > ADMA2_DESC_MAX_LENGTH) {
                     xprintf("sdhci: chunk size > %zu is unsupported\n", length);
-                    st = MX_ERR_NOT_SUPPORTED;
+                    st = ZX_ERR_NOT_SUPPORTED;
                     goto err;
                 } else if ((++count) > DMA_DESC_COUNT) {
                     xprintf("sdhci: txn with more than %zd chunks is unsupported\n", length);
-                    st = MX_ERR_NOT_SUPPORTED;
+                    st = ZX_ERR_NOT_SUPPORTED;
                     goto err;
                 }
                 desc->length = length & 0xffff; // 0 = 0x10000 bytes
@@ -436,14 +436,14 @@
             } while (!(desc++)->end);
 #endif
 
-            mx_paddr_t desc_phys = io_buffer_phys(&dev->iobuf);
+            zx_paddr_t desc_phys = io_buffer_phys(&dev->iobuf);
             dev->regs->admaaddr0 = LO32(desc_phys);
             dev->regs->admaaddr1 = HI32(desc_phys);
 
             cmd |= SDHCI_XFERMODE_DMA_ENABLE;
 
         } else {
-            MX_DEBUG_ASSERT(txn->phys_count == 1);
+            ZX_DEBUG_ASSERT(txn->phys_count == 1);
             regs->arg2 = iotxn_phys(txn) + dev->dma_offset;
         }
 
@@ -465,7 +465,7 @@
 
     // And we're off to the races!
     regs->cmd = cmd;
-    return MX_OK;
+    return ZX_OK;
 err:
     return st;
 }
@@ -476,7 +476,7 @@
     if (txn->offset % SDHC_BLOCK_SIZE) {
         printf("sdhci: iotxn offset not aligned to block boundary, "
                "offset =%" PRIu64", block size = %d\n", txn->offset, SDHC_BLOCK_SIZE);
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
 
@@ -484,7 +484,7 @@
     if (txn->length % SDHC_BLOCK_SIZE) {
         printf("sdhci: iotxn length not aligned to block boundary, "
                "offset =%" PRIu64", block size = %d\n", txn->length, SDHC_BLOCK_SIZE);
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
 
@@ -495,17 +495,17 @@
     if (dev->pending != NULL) {
         mtx_unlock(&dev->mtx);
         printf("sdhci: only one outstanding iotxn is allowed\n");
-        iotxn_complete(txn, MX_ERR_NO_RESOURCES, 0);
+        iotxn_complete(txn, ZX_ERR_NO_RESOURCES, 0);
         return;
     }
 
     // Start the txn
     dev->pending = txn;
-    mx_status_t st;
-    if ((st = sdhci_start_txn_locked(dev, txn)) != MX_OK) {
+    zx_status_t st;
+    if ((st = sdhci_start_txn_locked(dev, txn)) != ZX_OK) {
         dev->pending = NULL;
         mtx_unlock(&dev->mtx);
-        iotxn_complete(txn, MX_ERR_NO_RESOURCES, 0);
+        iotxn_complete(txn, ZX_ERR_NO_RESOURCES, 0);
         return;
     }
 
@@ -513,7 +513,7 @@
 
     // Wait for completion
     do {
-        completion_wait(&dev->pending_completion, MX_TIME_INFINITE);
+        completion_wait(&dev->pending_completion, ZX_TIME_INFINITE);
         completion_reset(&dev->pending_completion);
 
         mtx_lock(&dev->mtx);
@@ -533,7 +533,7 @@
     iotxn_complete(txn, txn->status, txn->actual);
 }
 
-static mx_status_t sdhci_set_bus_frequency(sdhci_device_t* dev, uint32_t target_freq) {
+static zx_status_t sdhci_set_bus_frequency(sdhci_device_t* dev, uint32_t target_freq) {
     const uint32_t divider = get_clock_divider(dev->base_clock, target_freq);
     const uint8_t divider_lo = divider & 0xff;
     const uint8_t divider_hi = (divider >> 8) & 0x3;
@@ -543,30 +543,30 @@
     uint32_t iterations = 0;
     while (regs->state & (SDHCI_STATE_CMD_INHIBIT | SDHCI_STATE_DAT_INHIBIT)) {
         if (++iterations > 1000)
-            return MX_ERR_TIMED_OUT;
+            return ZX_ERR_TIMED_OUT;
 
-        mx_nanosleep(mx_deadline_after(MX_MSEC(1)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(1)));
     }
 
     // Turn off the SD clock before messing with the clock rate.
     regs->ctrl1 &= ~SDHCI_SD_CLOCK_ENABLE;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(2)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(2)));
 
     // Write the new divider into the control register.
     uint32_t ctrl1 = regs->ctrl1;
     ctrl1 &= ~0xffe0;
     ctrl1 |= ((divider_lo << 8) | (divider_hi << 6));
     regs->ctrl1 = ctrl1;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(2)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(2)));
 
     // Turn the SD clock back on.
     regs->ctrl1 |= SDHCI_SD_CLOCK_ENABLE;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(2)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(2)));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t sdhci_set_timing(sdhci_device_t* dev, uint32_t timing) {
+static zx_status_t sdhci_set_timing(sdhci_device_t* dev, uint32_t timing) {
     // Toggle high-speed
     if (timing != SDMMC_TIMING_LEGACY) {
         dev->regs->ctrl0 |= SDHCI_HOSTCTRL_HIGHSPEED_ENABLE;
@@ -576,7 +576,7 @@
 
     // Disable SD clock before changing UHS timing
     dev->regs->ctrl1 &= ~SDHCI_SD_CLOCK_ENABLE;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(2)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(2)));
 
     uint32_t ctrl2 = dev->regs->ctrl2 & ~SDHCI_HOSTCTRL2_UHS_MODE_SELECT_MASK;
     if (timing == SDMMC_TIMING_HS200) {
@@ -588,9 +588,9 @@
 
     // Turn the SD clock back on.
     dev->regs->ctrl1 |= SDHCI_SD_CLOCK_ENABLE;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(2)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(2)));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void sdhci_hw_reset(sdhci_device_t* dev) {
@@ -599,10 +599,10 @@
     }
 }
 
-static mx_status_t sdhci_set_bus_width(sdhci_device_t* dev, const uint32_t new_bus_width) {
+static zx_status_t sdhci_set_bus_width(sdhci_device_t* dev, const uint32_t new_bus_width) {
     if ((new_bus_width == SDMMC_BUS_WIDTH_8) &&
         !(dev->regs->caps0 & SDHCI_CORECFG_8_BIT_SUPPORT)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     switch (new_bus_width) {
@@ -618,32 +618,32 @@
         dev->regs->ctrl0 |= SDHCI_HOSTCTRL_EXT_DATA_WIDTH;
         break;
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t sdhci_set_signal_voltage(sdhci_device_t* dev, uint32_t new_voltage) {
+static zx_status_t sdhci_set_signal_voltage(sdhci_device_t* dev, uint32_t new_voltage) {
 
     switch (new_voltage) {
         case SDMMC_SIGNAL_VOLTAGE_330:
         case SDMMC_SIGNAL_VOLTAGE_180:
             break;
         default:
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
     }
 
     volatile struct sdhci_regs* regs = dev->regs;
 
     // Disable the SD clock before messing with the voltage.
     regs->ctrl1 &= ~SDHCI_SD_CLOCK_ENABLE;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(2)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(2)));
 
     if (new_voltage == SDMMC_SIGNAL_VOLTAGE_180) {
         regs->ctrl2 |= SDHCI_HOSTCTRL2_1P8V_SIGNALLING_ENA;
         // 1.8V regulator out should be stable within 5ms
-        mx_nanosleep(mx_deadline_after(MX_MSEC(5)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(5)));
 #if TRACE
         if (!(regs->ctrl2 & SDHCI_HOSTCTRL2_1P8V_SIGNALLING_ENA)) {
             xprintf("sdhci: 1.8V regulator output did not become stable\n");
@@ -652,7 +652,7 @@
     } else {
         regs->ctrl2 &= ~SDHCI_HOSTCTRL2_1P8V_SIGNALLING_ENA;
         // 3.3V regulator out should be stable within 5ms
-        mx_nanosleep(mx_deadline_after(MX_MSEC(5)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(5)));
 #if TRACE
         if (regs->ctrl2 & SDHCI_HOSTCTRL2_1P8V_SIGNALLING_ENA) {
             xprintf("sdhci: 3.3V regulator output did not become stable\n");
@@ -669,17 +669,17 @@
     }
     if ((regs->ctrl0 & expected_mask) != expected_mask) {
         xprintf("sdhci: after voltage switch ctrl0=0x%08x, expected=0x%08x\n", regs->ctrl0, expected_mask);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     // Turn the clock back on
     regs->ctrl1 |= SDHCI_SD_CLOCK_ENABLE;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(2)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(2)));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t sdhci_ioctl(void* ctx, uint32_t op,
+static zx_status_t sdhci_ioctl(void* ctx, uint32_t op,
                           const void* in_buf, size_t in_len,
                           void* out_buf, size_t out_len, size_t* out_actual) {
     sdhci_device_t* dev = ctx;
@@ -688,34 +688,34 @@
     switch (op) {
     case IOCTL_SDMMC_SET_SIGNAL_VOLTAGE:
         if (in_len < sizeof(*arg)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else {
             return sdhci_set_signal_voltage(dev, *arg);
         }
     case IOCTL_SDMMC_SET_BUS_WIDTH:
         if (in_len < sizeof(*arg)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else {
             return sdhci_set_bus_width(dev, *arg);
         }
     case IOCTL_SDMMC_SET_BUS_FREQ:
         if (in_len < sizeof(*arg)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else {
             return sdhci_set_bus_frequency(dev, *arg);
         }
     case IOCTL_SDMMC_SET_TIMING:
         if (in_len < sizeof(*arg)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else {
             return sdhci_set_timing(dev, *arg);
         }
     case IOCTL_SDMMC_HW_RESET:
         sdhci_hw_reset(dev);
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static void sdhci_unbind(void* ctx) {
@@ -728,7 +728,7 @@
     free(dev);
 }
 
-static mx_protocol_device_t sdhci_device_proto = {
+static zx_protocol_device_t sdhci_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = sdhci_iotxn_queue,
     .ioctl = sdhci_ioctl,
@@ -736,7 +736,7 @@
     .release = sdhci_release,
 };
 
-static mx_status_t sdhci_controller_init(sdhci_device_t* dev) {
+static zx_status_t sdhci_controller_init(sdhci_device_t* dev) {
     // Reset the controller.
     uint32_t ctrl1 = dev->regs->ctrl1;
 
@@ -754,15 +754,15 @@
     const uint32_t target_mask = (SDHCI_SOFTWARE_RESET_ALL |
                                   SDHCI_SOFTWARE_RESET_CMD |
                                   SDHCI_SOFTWARE_RESET_DAT);
-    mx_status_t status = MX_OK;
-    if ((status = sdhci_wait_for_reset(dev, target_mask, MX_SEC(1))) != MX_OK) {
+    zx_status_t status = ZX_OK;
+    if ((status = sdhci_wait_for_reset(dev, target_mask, ZX_SEC(1))) != ZX_OK) {
         goto fail;
     }
 
     // allocate and setup DMA descriptor
     if (sdhci_supports_adma2_64bit(dev)) {
         status = io_buffer_init(&dev->iobuf, DMA_DESC_COUNT * sizeof(sdhci_adma64_desc_t), IO_BUFFER_RW);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             xprintf("sdhci: error allocating DMA descriptors\n");
             goto fail;
         }
@@ -794,24 +794,24 @@
     dev->regs->ctrl1 = ctrl1;
 
     // Wait for the clock to stabilize.
-    mx_time_t deadline = mx_time_get(MX_CLOCK_MONOTONIC) + MX_SEC(1);
+    zx_time_t deadline = zx_time_get(ZX_CLOCK_MONOTONIC) + ZX_SEC(1);
     while (true) {
         if (((dev->regs->ctrl1) & SDHCI_INTERNAL_CLOCK_STABLE) != 0)
             break;
 
-        if (mx_time_get(MX_CLOCK_MONOTONIC) > deadline) {
+        if (zx_time_get(ZX_CLOCK_MONOTONIC) > deadline) {
             xprintf("sdhci: Clock did not stabilize in time\n");
-            status = MX_ERR_TIMED_OUT;
+            status = ZX_ERR_TIMED_OUT;
             goto fail;
         }
     }
 
     // Enable the SD clock.
-    mx_nanosleep(mx_deadline_after(MX_MSEC(2)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(2)));
     ctrl1 |= dev->regs->ctrl1;
     ctrl1 |= SDHCI_SD_CLOCK_ENABLE;
     dev->regs->ctrl1 = ctrl1;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(2)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(2)));
 
     // Cut voltage to the card
     dev->regs->ctrl0 &= ~SDHCI_PWRCTRL_SD_BUS_POWER;
@@ -835,26 +835,26 @@
     dev->regs->irqen = 0;
     dev->regs->irq = 0xffffffff;
 
-    return MX_OK;
+    return ZX_OK;
 fail:
     return status;
 }
 
-static mx_status_t sdhci_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t sdhci_bind(void* ctx, zx_device_t* parent, void** cookie) {
     sdhci_device_t* dev = calloc(1, sizeof(sdhci_device_t));
     if (!dev) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t status = MX_OK;
-    if (device_get_protocol(parent, MX_PROTOCOL_SDHCI, (void*)&dev->sdhci)) {
-        status = MX_ERR_NOT_SUPPORTED;
+    zx_status_t status = ZX_OK;
+    if (device_get_protocol(parent, ZX_PROTOCOL_SDHCI, (void*)&dev->sdhci)) {
+        status = ZX_ERR_NOT_SUPPORTED;
         goto fail;
     }
 
     // Map the Device Registers so that we can perform MMIO against the device.
     status = dev->sdhci.ops->get_mmio(dev->sdhci.ctx, &dev->regs);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("sdhci: error %d in get_mmio\n", status);
         goto fail;
     }
@@ -882,7 +882,7 @@
     if (vrsn < SDHCI_VERSION_3) {
         xprintf("sdhci: SD version is %u, only version %u and above are "
                 "supported\n", vrsn, SDHCI_VERSION_3);
-        status = MX_ERR_NOT_SUPPORTED;
+        status = ZX_ERR_NOT_SUPPORTED;
         goto fail;
     }
     xprintf("sdhci: controller version %d\n", vrsn);
@@ -894,7 +894,7 @@
     }
     if (dev->base_clock == 0) {
         xprintf("sdhci: base clock is 0!\n");
-        status = MX_ERR_INTERNAL;
+        status = ZX_ERR_INTERNAL;
         goto fail;
     }
     dev->dma_offset = dev->sdhci.ops->get_dma_offset(dev->sdhci.ctx);
@@ -902,7 +902,7 @@
 
     // initialize the controller
     status = sdhci_controller_init(dev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
@@ -912,35 +912,35 @@
         .name = "sdhci",
         .ctx = dev,
         .ops = &sdhci_device_proto,
-        .proto_id = MX_PROTOCOL_SDMMC,
+        .proto_id = ZX_PROTOCOL_SDMMC,
     };
 
     status = device_add(parent, &args, &dev->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
-    return MX_OK;
+    return ZX_OK;
 fail:
     if (dev) {
-        if (dev->irq_handle != MX_HANDLE_INVALID) {
-            mx_handle_close(dev->irq_handle);
+        if (dev->irq_handle != ZX_HANDLE_INVALID) {
+            zx_handle_close(dev->irq_handle);
         }
-        if (dev->iobuf.vmo_handle != MX_HANDLE_INVALID) {
-            mx_handle_close(dev->iobuf.vmo_handle);
+        if (dev->iobuf.vmo_handle != ZX_HANDLE_INVALID) {
+            zx_handle_close(dev->iobuf.vmo_handle);
         }
         free(dev);
     }
     return status;
 }
 
-static mx_driver_ops_t sdhci_driver_ops = {
+static zx_driver_ops_t sdhci_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = sdhci_bind,
 };
 
 // The formatter does not play nice with these macros.
 // clang-format off
-MAGENTA_DRIVER_BEGIN(sdhci, sdhci_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_SDHCI),
-MAGENTA_DRIVER_END(sdhci)
+ZIRCON_DRIVER_BEGIN(sdhci, sdhci_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_SDHCI),
+ZIRCON_DRIVER_END(sdhci)
 // clang-format on
diff --git a/system/dev/block/sdmmc/mmc.c b/system/dev/block/sdmmc/mmc.c
index c920681..f433d59 100644
--- a/system/dev/block/sdmmc/mmc.c
+++ b/system/dev/block/sdmmc/mmc.c
@@ -24,13 +24,13 @@
     } while (0)
 #endif
 
-static mx_status_t mmc_send_op_cond(sdmmc_t* sdmmc, iotxn_t* txn, uint32_t ocr, uint32_t* rocr) {
+static zx_status_t mmc_send_op_cond(sdmmc_t* sdmmc, iotxn_t* txn, uint32_t ocr, uint32_t* rocr) {
     sdmmc_protocol_data_t* pdata = iotxn_pdata(txn, sdmmc_protocol_data_t);
-    mx_status_t st;
+    zx_status_t st;
     // Request sector addressing if not probing
     uint32_t arg = (ocr == 0) ? ocr : ((1 << 30) | ocr);
     for (int i = 100; i; i--) {
-        if ((st = sdmmc_do_command(sdmmc->host_mxdev, MMC_SEND_OP_COND, arg, txn)) != MX_OK) {
+        if ((st = sdmmc_do_command(sdmmc->host_mxdev, MMC_SEND_OP_COND, arg, txn)) != ZX_OK) {
             // fail on txn error
             break;
         }
@@ -39,15 +39,15 @@
             *rocr = pdata->response[0];
             break;
         }
-        mx_nanosleep(mx_deadline_after(MX_MSEC(10)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(10)));
     }
     return st;
 }
 
-static mx_status_t mmc_all_send_cid(sdmmc_t* sdmmc, iotxn_t* txn, uint32_t cid[4]) {
+static zx_status_t mmc_all_send_cid(sdmmc_t* sdmmc, iotxn_t* txn, uint32_t cid[4]) {
     sdmmc_protocol_data_t* pdata = iotxn_pdata(txn, sdmmc_protocol_data_t);
-    mx_status_t st;
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, MMC_ALL_SEND_CID, 0, txn)) == MX_OK) {
+    zx_status_t st;
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, MMC_ALL_SEND_CID, 0, txn)) == ZX_OK) {
         cid[0] = pdata->response[0];
         cid[1] = pdata->response[1];
         cid[2] = pdata->response[2];
@@ -56,14 +56,14 @@
     return st;
 }
 
-static mx_status_t mmc_set_relative_addr(sdmmc_t* sdmmc, iotxn_t* txn, uint16_t rca) {
+static zx_status_t mmc_set_relative_addr(sdmmc_t* sdmmc, iotxn_t* txn, uint16_t rca) {
     return sdmmc_do_command(sdmmc->host_mxdev, MMC_SET_RELATIVE_ADDR, (rca << 16), txn);
 }
 
-static mx_status_t mmc_send_csd(sdmmc_t* sdmmc, iotxn_t* txn, uint32_t csd[4]) {
+static zx_status_t mmc_send_csd(sdmmc_t* sdmmc, iotxn_t* txn, uint32_t csd[4]) {
     sdmmc_protocol_data_t* pdata = iotxn_pdata(txn, sdmmc_protocol_data_t);
-    mx_status_t st;
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, MMC_SEND_CSD, sdmmc->rca << 16, txn)) == MX_OK) {
+    zx_status_t st;
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, MMC_SEND_CSD, sdmmc->rca << 16, txn)) == ZX_OK) {
         csd[0] = pdata->response[0];
         csd[1] = pdata->response[1];
         csd[2] = pdata->response[2];
@@ -72,14 +72,14 @@
     return st;
 }
 
-static mx_status_t mmc_send_ext_csd(sdmmc_t* sdmmc, iotxn_t* txn, uint8_t ext_csd[512]) {
+static zx_status_t mmc_send_ext_csd(sdmmc_t* sdmmc, iotxn_t* txn, uint8_t ext_csd[512]) {
     sdmmc_protocol_data_t* pdata = iotxn_pdata(txn, sdmmc_protocol_data_t);
-    mx_status_t st;
+    zx_status_t st;
     // EXT_CSD is send in a data stage
     pdata->blockcount = 1;
     pdata->blocksize = 512;
     txn->length = 512;
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, MMC_SEND_EXT_CSD, 0, txn)) == MX_OK) {
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, MMC_SEND_EXT_CSD, 0, txn)) == ZX_OK) {
         iotxn_copyfrom(txn, ext_csd, 512, 0);
 #if 0
         xprintf("EXT_CSD:\n");
@@ -92,40 +92,40 @@
     return st;
 }
 
-static mx_status_t mmc_select_card(sdmmc_t* sdmmc, iotxn_t* txn) {
+static zx_status_t mmc_select_card(sdmmc_t* sdmmc, iotxn_t* txn) {
     return sdmmc_do_command(sdmmc->host_mxdev, MMC_SELECT_CARD, sdmmc->rca << 16, txn);
 }
 
-static mx_status_t mmc_switch(sdmmc_t* sdmmc, iotxn_t* txn, uint8_t index, uint8_t value) {
+static zx_status_t mmc_switch(sdmmc_t* sdmmc, iotxn_t* txn, uint8_t index, uint8_t value) {
     uint32_t arg = (3 << 24) |  // write byte
                    (index << 16) | (value << 8);
     return sdmmc_do_command(sdmmc->host_mxdev, MMC_SWITCH, arg, txn);
 }
 
-static mx_status_t mmc_send_status(sdmmc_t* sdmmc, iotxn_t* txn, uint32_t* status) {
+static zx_status_t mmc_send_status(sdmmc_t* sdmmc, iotxn_t* txn, uint32_t* status) {
     sdmmc_protocol_data_t* pdata = iotxn_pdata(txn, sdmmc_protocol_data_t);
-    mx_status_t st = sdmmc_do_command(sdmmc->host_mxdev, MMC_SEND_STATUS, sdmmc->rca << 16, txn);
-    if (st == MX_OK) {
+    zx_status_t st = sdmmc_do_command(sdmmc->host_mxdev, MMC_SEND_STATUS, sdmmc->rca << 16, txn);
+    if (st == ZX_OK) {
         *status = pdata->response[0];
     }
     return st;
 }
 
 static uint8_t mmc_select_bus_width(sdmmc_t* sdmmc, iotxn_t* txn) {
-    mx_status_t st;
+    zx_status_t st;
     // TODO verify host 8-bit support
     unsigned bus_widths[] = { SDMMC_BUS_WIDTH_8, MMC_EXT_CSD_BUS_WIDTH_8,
                               SDMMC_BUS_WIDTH_4, MMC_EXT_CSD_BUS_WIDTH_4 };
     for (unsigned i = 0; i < sizeof(bus_widths)/sizeof(unsigned); i += 2) {
         // Switch the card to the new bus width
-        if ((st = mmc_switch(sdmmc, txn, MMC_EXT_CSD_BUS_WIDTH, bus_widths[i+1])) != MX_OK) {
+        if ((st = mmc_switch(sdmmc, txn, MMC_EXT_CSD_BUS_WIDTH, bus_widths[i+1])) != ZX_OK) {
             xprintf("sdmmc: failed to MMC_SWITCH bus width to EXT_CSD %d, retcode = %d\n", bus_widths[i+1], st);
             continue;
         }
 
         // Check status after MMC_SWITCH
         uint32_t status;
-        if ((st = mmc_send_status(sdmmc, txn, &status)) != MX_OK) {
+        if ((st = mmc_send_status(sdmmc, txn, &status)) != ZX_OK) {
             xprintf("sdmmc: failed to MMC_SEND_STATUS (bus width %d), retcode = %d\n", bus_widths[i], st);
             continue;
         }
@@ -136,14 +136,14 @@
 
         // Switch the host to the new bus width
         uint32_t new_bus_width = bus_widths[i];
-        if ((st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_BUS_WIDTH, &new_bus_width, sizeof(new_bus_width), NULL, 0, NULL)) != MX_OK) {
+        if ((st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_BUS_WIDTH, &new_bus_width, sizeof(new_bus_width), NULL, 0, NULL)) != ZX_OK) {
             xprintf("sdmmc: failed to switch the host bus width to %d, retcode = %d\n", bus_widths[i], st);
             continue;
         }
 
         // Read EXT_CSD again with the new bus width and compare
         uint8_t new_ext_csd[512];
-        if ((st = mmc_send_ext_csd(sdmmc, txn, new_ext_csd)) != MX_OK) {
+        if ((st = mmc_send_ext_csd(sdmmc, txn, new_ext_csd)) != ZX_OK) {
             xprintf("sdmmc: failed to get EXT_CSD after switching bus width to %d, retcode = %d\n", bus_widths[i], st);
             continue;
         }
@@ -170,9 +170,9 @@
     return sdmmc->bus_width;
 }
 
-static mx_status_t mmc_switch_timing(sdmmc_t* sdmmc, iotxn_t* txn, uint8_t new_timing) {
+static zx_status_t mmc_switch_timing(sdmmc_t* sdmmc, iotxn_t* txn, uint8_t new_timing) {
     if (new_timing > MMC_EXT_CSD_HS_TIMING_HS400) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Switch the device timing
@@ -182,46 +182,46 @@
         MMC_EXT_CSD_HS_TIMING_HS200,
         MMC_EXT_CSD_HS_TIMING_HS400
     };
-    mx_status_t st = mmc_switch(sdmmc, txn, MMC_EXT_CSD_HS_TIMING, ext_csd_timing[new_timing]);
-    if (st != MX_OK) {
+    zx_status_t st = mmc_switch(sdmmc, txn, MMC_EXT_CSD_HS_TIMING, ext_csd_timing[new_timing]);
+    if (st != ZX_OK) {
         xprintf("sdmmc: failed to switch device timing to %d\n", new_timing);
         return st;
     }
 
     // Switch the host timing
     uint32_t arg = new_timing;
-    if ((st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_TIMING, &arg, sizeof(arg), NULL, 0, NULL)) != MX_OK) {
+    if ((st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_TIMING, &arg, sizeof(arg), NULL, 0, NULL)) != ZX_OK) {
         xprintf("sdmmc: failed to switch host timing to %d\n", new_timing);
         return st;
     }
 
     // Check status after MMC_SWITCH
     uint32_t status;
-    if ((st = mmc_send_status(sdmmc, txn, &status)) != MX_OK) {
+    if ((st = mmc_send_status(sdmmc, txn, &status)) != ZX_OK) {
         return st;
     }
     if (status & MMC_STATUS_SWITCH_ERR) {
         xprintf("sdmmc: mmc status error after MMC_SWITCH, status = 0x%08x\n", status);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     sdmmc->timing = new_timing;
     return st;
 }
 
-static mx_status_t mmc_decode_cid(sdmmc_t* sdmmc, const uint8_t* raw_cid) {
+static zx_status_t mmc_decode_cid(sdmmc_t* sdmmc, const uint8_t* raw_cid) {
     printf("sdmmc: product name=%c%c%c%c%c%c\n",
             raw_cid[6], raw_cid[7], raw_cid[8], raw_cid[9], raw_cid[10], raw_cid[11]);
     printf("       revision=%u.%u\n", (raw_cid[5] >> 4) & 0xf, raw_cid[5] & 0xf);
     printf("       serial=%u\n", *((uint32_t*)&raw_cid[1]));
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t mmc_decode_csd(sdmmc_t* sdmmc, const uint8_t* raw_csd) {
+static zx_status_t mmc_decode_csd(sdmmc_t* sdmmc, const uint8_t* raw_csd) {
     uint8_t spec_vrsn = (raw_csd[14] >> 2) & 0xf;
     // Only support spec version > 4.0
     if (spec_vrsn < MMC_CID_SPEC_VRSN_40) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     xprintf("sdmmc: CSD version %u spec version %u\n", (raw_csd[14] >> 6) & 0x3, spec_vrsn);
@@ -236,12 +236,12 @@
                       ((raw_csd[8] & 0x3) << 10);
     if (c_size != 0xfff) {
         xprintf("sdmmc: unsupported C_SIZE 0x%04x\n", c_size);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t mmc_decode_ext_csd(sdmmc_t* sdmmc, const uint8_t* raw_ext_csd) {
+static zx_status_t mmc_decode_ext_csd(sdmmc_t* sdmmc, const uint8_t* raw_ext_csd) {
     xprintf("sdmmc: EXT_CSD version %u CSD version %u\n", raw_ext_csd[192], raw_ext_csd[194]);
 
     // Get the capacity for the card
@@ -250,7 +250,7 @@
 
     printf("sdmmc: found card with capacity = %" PRIu64 "B\n", sdmmc->capacity);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static bool mmc_supports_hs(sdmmc_t* sdmmc) {
@@ -270,26 +270,26 @@
     return (device_type & (1 << 4));
 }
 
-mx_status_t sdmmc_probe_mmc(sdmmc_t* sdmmc, iotxn_t* setup_txn) {
-    mx_status_t st;
+zx_status_t sdmmc_probe_mmc(sdmmc_t* sdmmc, iotxn_t* setup_txn) {
+    zx_status_t st;
 
     // Query OCR
     uint32_t ocr = 0;
-    if ((st = mmc_send_op_cond(sdmmc, setup_txn, ocr, &ocr)) != MX_OK) {
+    if ((st = mmc_send_op_cond(sdmmc, setup_txn, ocr, &ocr)) != ZX_OK) {
         xprintf("sdmmc: MMC_SEND_OP_COND failed, retcode = %d\n", st);
         goto err;
     }
 
     // Check if the card matches the host's supported voltages and indicate sector mode
     // TODO check with host
-    if ((st = mmc_send_op_cond(sdmmc, setup_txn, ocr, &ocr)) != MX_OK) {
+    if ((st = mmc_send_op_cond(sdmmc, setup_txn, ocr, &ocr)) != ZX_OK) {
         xprintf("sdmmc: MMC_SEND_OP_COND failed, retcode = %d\n", st);
         goto err;
     }
 
     // Get CID from card
     // Only 1 card on eve so no need to loop
-    if ((st = mmc_all_send_cid(sdmmc, setup_txn, sdmmc->raw_cid)) != MX_OK) {
+    if ((st = mmc_all_send_cid(sdmmc, setup_txn, sdmmc->raw_cid)) != ZX_OK) {
         xprintf("sdmmc: MMC_ALL_SEND_CID failed, retcode = %d\n", st);
         goto err;
     }
@@ -303,34 +303,34 @@
 
     // Set relative card address
     sdmmc->rca = 1;
-    if ((st = mmc_set_relative_addr(sdmmc, setup_txn, sdmmc->rca)) != MX_OK) {
+    if ((st = mmc_set_relative_addr(sdmmc, setup_txn, sdmmc->rca)) != ZX_OK) {
         xprintf("sdmmc: MMC_SET_RELATIVE_ADDR failed, retcode = %d\n", st);
         goto err;
     }
 
     // Read CSD register
-    if ((st = mmc_send_csd(sdmmc, setup_txn, sdmmc->raw_csd)) != MX_OK) {
+    if ((st = mmc_send_csd(sdmmc, setup_txn, sdmmc->raw_csd)) != ZX_OK) {
         xprintf("sdmmc: MMC_SEND_CSD failed, retcode = %d\n", st);
         goto err;
     }
 
-    if ((st = mmc_decode_csd(sdmmc, (const uint8_t*)sdmmc->raw_csd)) != MX_OK) {
+    if ((st = mmc_decode_csd(sdmmc, (const uint8_t*)sdmmc->raw_csd)) != ZX_OK) {
         goto err;
     }
 
     // Select the card
-    if ((st = mmc_select_card(sdmmc, setup_txn)) != MX_OK) {
+    if ((st = mmc_select_card(sdmmc, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: MMC_SELECT_CARD failed, retcode = %d\n", st);
         goto err;
     }
 
     // Read extended CSD register
-    if ((st = mmc_send_ext_csd(sdmmc, setup_txn, sdmmc->raw_ext_csd)) != MX_OK) {
+    if ((st = mmc_send_ext_csd(sdmmc, setup_txn, sdmmc->raw_ext_csd)) != ZX_OK) {
         xprintf("sdmmc: MMC_SEND_EXT_CSD failed, retcode = %d\n", st);
         goto err;
     }
 
-    if ((st = mmc_decode_ext_csd(sdmmc, (const uint8_t*)sdmmc->raw_ext_csd)) != MX_OK) {
+    if ((st = mmc_decode_ext_csd(sdmmc, (const uint8_t*)sdmmc->raw_ext_csd)) != ZX_OK) {
         goto err;
     }
 
@@ -343,7 +343,7 @@
         // Switch to 1.8V signal voltage
         const uint32_t new_voltage = SDMMC_SIGNAL_VOLTAGE_180;
         if ((st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_SIGNAL_VOLTAGE, &new_voltage,
-                               sizeof(new_voltage), NULL, 0, NULL)) != MX_OK) {
+                               sizeof(new_voltage), NULL, 0, NULL)) != ZX_OK) {
             xprintf("sdmmc: failed to switch to 1.8V signalling, retcode = %d\n", st);
             goto err;
         }
@@ -357,14 +357,14 @@
         }
 
         // If successfully switched to 4- or 8-bit bus, switch to high-speed timing
-        if ((st = mmc_switch_timing(sdmmc, setup_txn, SDMMC_TIMING_HS)) != MX_OK) {
+        if ((st = mmc_switch_timing(sdmmc, setup_txn, SDMMC_TIMING_HS)) != ZX_OK) {
             xprintf("sdmmc: failed to switch to high-speed timing\n");
             goto err;
         }
 
         // Set the bus frequency to high-speed timing
         uint32_t hs_freq = 52000000; // 52 mhz
-        if ((st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_BUS_FREQ, &hs_freq, sizeof(hs_freq), NULL, 0, NULL)) != MX_OK) {
+        if ((st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_BUS_FREQ, &hs_freq, sizeof(hs_freq), NULL, 0, NULL)) != ZX_OK) {
             xprintf("sdmmc: failed to set host bus frequency, retcode = %d\n", st);
             goto err;
         }
@@ -372,7 +372,7 @@
     } else {
         // Set the bus frequency to legacy timing
         uint32_t bus_freq = 25000000; // 25 mhz
-        if ((st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_BUS_FREQ, &bus_freq, sizeof(bus_freq), NULL, 0, NULL)) != MX_OK) {
+        if ((st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_BUS_FREQ, &bus_freq, sizeof(bus_freq), NULL, 0, NULL)) != ZX_OK) {
             xprintf("sdmmc: failed to set host bus frequency, retcode = %d\n", st);
             goto err;
         }
diff --git a/system/dev/block/sdmmc/rules.mk b/system/dev/block/sdmmc/rules.mk
index ac34d32..815cae2 100644
--- a/system/dev/block/sdmmc/rules.mk
+++ b/system/dev/block/sdmmc/rules.mk
@@ -15,6 +15,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync system/ulib/pretty
 
-MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/magenta system/ulib/mxio
+MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/zircon system/ulib/fdio
 
 include make/module.mk
diff --git a/system/dev/block/sdmmc/sd.c b/system/dev/block/sdmmc/sd.c
index e640bf7..010fe3e 100644
--- a/system/dev/block/sdmmc/sd.c
+++ b/system/dev/block/sdmmc/sd.c
@@ -31,8 +31,8 @@
 #define CSD_STRUCT_V1 0x0
 #define CSD_STRUCT_V2 0x1
 
-mx_status_t sdmmc_probe_sd(sdmmc_t* sdmmc, iotxn_t* setup_txn) {
-    mx_status_t st;
+zx_status_t sdmmc_probe_sd(sdmmc_t* sdmmc, iotxn_t* setup_txn) {
+    zx_status_t st;
 
     // Get the protocol data from the iotxn. We use this to pass the command
     // type and command arguments to the EMMC driver.
@@ -42,7 +42,7 @@
     // Issue the SEND_IF_COND command, this will tell us that we can talk to
     // the card correctly and it will also tell us if the voltage range that we
     // have supplied has been accepted.
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SEND_IF_COND, 0x1aa, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SEND_IF_COND, 0x1aa, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: SDMMC_SEND_IF_COND failed, retcode = %d\n", st);
         goto err;
     }
@@ -54,11 +54,11 @@
     }
 
     // Get the operating conditions from the card.
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_APP_CMD, 0, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_APP_CMD, 0, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: SDMMC_APP_CMD failed, retcode = %d\n", st);
         goto err;
     }
-    if ((sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SD_SEND_OP_COND, 0, setup_txn)) != MX_OK) {
+    if ((sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SD_SEND_OP_COND, 0, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: SDMMC_SD_SEND_OP_COND failed, retcode = %d\n", st);
         goto err;
     }
@@ -69,11 +69,11 @@
     while (true) {
         // Ask for high speed.
         const uint32_t flags = (1 << 30)  | 0x00ff8000 | (1 << 24);
-        if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_APP_CMD, 0, setup_txn)) != MX_OK) {
+        if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_APP_CMD, 0, setup_txn)) != ZX_OK) {
             xprintf("sdmmc: APP_CMD failed with retcode = %d\n", st);
             goto err;
         }
-        if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SD_SEND_OP_COND, flags, setup_txn)) != MX_OK) {
+        if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SD_SEND_OP_COND, flags, setup_txn)) != ZX_OK) {
             xprintf("sdmmc: SD_SEND_OP_COND failed with retcode = %d\n", st);
             goto err;
         }
@@ -94,20 +94,20 @@
             goto err;
         }
 
-        mx_nanosleep(mx_deadline_after(MX_MSEC(5)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(5)));
     }
 
     uint32_t new_bus_frequency = 25000000;
     st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_BUS_FREQ, &new_bus_frequency,
                       sizeof(new_bus_frequency), NULL, 0, NULL);
-    if (st != MX_OK) {
+    if (st != ZX_OK) {
         // This is non-fatal but the card will run slowly.
         xprintf("sdmmc: failed to increase bus frequency.\n");
     }
 
     // Try to switch the bus voltage to 1.8v
     if (card_supports_18v_signalling) {
-        if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_VOLTAGE_SWITCH, 0, setup_txn)) != MX_OK) {
+        if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_VOLTAGE_SWITCH, 0, setup_txn)) != ZX_OK) {
             xprintf("sdmmc: failed to send switch voltage command to card, "
                     "retcode = %d\n", st);
             goto err;
@@ -116,19 +116,19 @@
         const uint32_t new_voltage = SDMMC_SIGNAL_VOLTAGE_180;
         st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_SIGNAL_VOLTAGE, &new_voltage,
                           sizeof(new_voltage), NULL, 0, NULL);
-        if (st != MX_OK) {
+        if (st != ZX_OK) {
             xprintf("sdmmc: Card supports 1.8v signalling but was unable to "
                     "switch to 1.8v mode, retcode = %d\n", st);
             goto err;
         }
     }
 
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_ALL_SEND_CID, 0, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_ALL_SEND_CID, 0, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: ALL_SEND_CID failed with retcode = %d\n", st);
         goto err;
     }
 
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SEND_RELATIVE_ADDR, 0, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SEND_RELATIVE_ADDR, 0, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: SEND_RELATIVE_ADDR failed with retcode = %d\n", st);
         goto err;
     }
@@ -138,17 +138,17 @@
     if (pdata->response[0] & 0xe000) {
         xprintf("sdmmc: SEND_RELATIVE_ADDR failed with resp = %d\n",
                 (pdata->response[0] & 0xe000));
-        st = MX_ERR_INTERNAL;
+        st = ZX_ERR_INTERNAL;
         goto err;
     }
     if ((pdata->response[0] & (1u << 8)) == 0) {
         xprintf("sdmmc: SEND_RELATIVE_ADDR failed. Card not ready.\n");
-        st = MX_ERR_INTERNAL;
+        st = ZX_ERR_INTERNAL;
         goto err;
     }
 
     // Determine the size of the card.
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SEND_CSD, sdmmc->rca << 16, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SEND_CSD, sdmmc->rca << 16, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: failed to send app cmd, retcode = %d\n", st);
         goto err;
     }
@@ -167,18 +167,18 @@
     sdmmc->capacity = (c_size + 1ul) * 512ul * 1024ul;
     printf("sdmmc: found card with capacity = %"PRIu64"B\n", sdmmc->capacity);
 
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SELECT_CARD, sdmmc->rca << 16, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SELECT_CARD, sdmmc->rca << 16, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: SELECT_CARD failed with retcode = %d\n", st);
         goto err;
     }
 
     pdata->blockcount = 1;
     pdata->blocksize = 8;
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_APP_CMD, sdmmc->rca << 16, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_APP_CMD, sdmmc->rca << 16, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: APP_CMD failed with retcode = %d\n", st);
         goto err;
     }
-    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SEND_SCR, 0, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SEND_SCR, 0, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: SEND_SCR failed with retcode = %d\n", st);
         goto err;
     }
@@ -195,11 +195,11 @@
 
         do {
             // First tell the card to go into four bit mode:
-            if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_APP_CMD, sdmmc->rca << 16, setup_txn)) != MX_OK) {
+            if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_APP_CMD, sdmmc->rca << 16, setup_txn)) != ZX_OK) {
                 xprintf("sdmmc: failed to send app cmd, retcode = %d\n", st);
                 break;
             }
-            if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SET_BUS_WIDTH, 2, setup_txn)) != MX_OK) {
+            if ((st = sdmmc_do_command(sdmmc->host_mxdev, SDMMC_SET_BUS_WIDTH, 2, setup_txn)) != ZX_OK) {
                 xprintf("sdmmc: failed to set card bus width, retcode = %d\n", st);
                 break;
             }
@@ -207,7 +207,7 @@
             // FIXME(yky) use #define
             st = device_ioctl(sdmmc->host_mxdev, IOCTL_SDMMC_SET_BUS_WIDTH, &new_bus_width,
                               sizeof(new_bus_width), NULL, 0, NULL);
-            if (st != MX_OK) {
+            if (st != ZX_OK) {
                 xprintf("sdmmc: failed to set host bus width, retcode = %d\n", st);
             }
         } while (false);
diff --git a/system/dev/block/sdmmc/sdmmc.c b/system/dev/block/sdmmc/sdmmc.c
index 8bd326e..cf4aa00 100644
--- a/system/dev/block/sdmmc/sdmmc.c
+++ b/system/dev/block/sdmmc/sdmmc.c
@@ -17,8 +17,8 @@
 #include <ddk/iotxn.h>
 #include <ddk/protocol/sdmmc.h>
 
-// Magenta Includes
-#include <magenta/threads.h>
+// Zircon Includes
+#include <zircon/threads.h>
 #include <sync/completion.h>
 #include <pretty/hexdump.h>
 
@@ -47,7 +47,7 @@
     completion_signal((completion_t*)cookie);
 };
 
-mx_status_t sdmmc_do_command(mx_device_t* dev, const uint32_t cmd,
+zx_status_t sdmmc_do_command(zx_device_t* dev, const uint32_t cmd,
                                     const uint32_t arg, iotxn_t* txn) {
     sdmmc_protocol_data_t* pdata = iotxn_pdata(txn, sdmmc_protocol_data_t);
     pdata->cmd = cmd;
@@ -59,12 +59,12 @@
 
     iotxn_queue(dev, txn);
 
-    completion_wait(&cplt, MX_TIME_INFINITE);
+    completion_wait(&cplt, ZX_TIME_INFINITE);
 
     return txn->status;
 }
 
-static mx_off_t sdmmc_get_size(void* ctx) {
+static zx_off_t sdmmc_get_size(void* ctx) {
     sdmmc_t* sdmmc = ctx;
     return sdmmc->capacity;
 }
@@ -77,25 +77,25 @@
     info->block_count = sdmmc_get_size(ctx) / SDHC_BLOCK_SIZE;
 }
 
-static mx_status_t sdmmc_ioctl(void* ctx, uint32_t op, const void* cmd,
+static zx_status_t sdmmc_ioctl(void* ctx, uint32_t op, const void* cmd,
                                size_t cmdlen, void* reply, size_t max, size_t* out_actual) {
     switch (op) {
     case IOCTL_BLOCK_GET_INFO: {
         block_info_t* info = reply;
         if (max < sizeof(*info))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         sdmmc_get_info(info, ctx);
         *out_actual = sizeof(*info);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_GET_NAME: {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     case IOCTL_DEVICE_SYNC: {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     return 0;
 }
@@ -115,7 +115,7 @@
         xprintf("sdmmc: iotxn offset not aligned to block boundary, "
                 "offset =%" PRIu64 ", block size = %d\n",
                 txn->offset, SDHC_BLOCK_SIZE);
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
 
@@ -123,13 +123,13 @@
         xprintf("sdmmc: iotxn length not aligned to block boundary, "
                 "offset =%" PRIu64 ", block size = %d\n",
                 txn->length, SDHC_BLOCK_SIZE);
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
 
     iotxn_t* emmc_txn = NULL;
     sdmmc_t* sdmmc = ctx;
-    mx_device_t* sdmmc_mxdev = sdmmc->host_mxdev;
+    zx_device_t* sdmmc_mxdev = sdmmc->host_mxdev;
     uint32_t cmd = 0;
 
     // Figure out which SD command we need to issue.
@@ -150,29 +150,29 @@
             break;
         default:
             // Invalid opcode?
-            iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+            iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
             return;
     }
 
-    if (iotxn_alloc(&emmc_txn, IOTXN_ALLOC_CONTIGUOUS | IOTXN_ALLOC_POOL, txn->length) != MX_OK) {
+    if (iotxn_alloc(&emmc_txn, IOTXN_ALLOC_CONTIGUOUS | IOTXN_ALLOC_POOL, txn->length) != ZX_OK) {
         xprintf("sdmmc: error allocating emmc iotxn\n");
-        iotxn_complete(txn, MX_ERR_INTERNAL, 0);
+        iotxn_complete(txn, ZX_ERR_INTERNAL, 0);
         return;
     }
     emmc_txn->opcode = txn->opcode;
     emmc_txn->flags = txn->flags;
     emmc_txn->offset = txn->offset;
     emmc_txn->length = txn->length;
-    emmc_txn->protocol = MX_PROTOCOL_SDMMC;
+    emmc_txn->protocol = ZX_PROTOCOL_SDMMC;
     sdmmc_protocol_data_t* pdata = iotxn_pdata(emmc_txn, sdmmc_protocol_data_t);
 
     uint8_t current_state;
     const size_t max_attempts = 10;
     size_t attempt = 0;
     for (; attempt <= max_attempts; attempt++) {
-        mx_status_t rc = sdmmc_do_command(sdmmc_mxdev, SDMMC_SEND_STATUS,
+        zx_status_t rc = sdmmc_do_command(sdmmc_mxdev, SDMMC_SEND_STATUS,
                                           sdmmc->rca << 16, emmc_txn);
-        if (rc != MX_OK) {
+        if (rc != ZX_OK) {
             iotxn_complete(txn, rc, 0);
             goto out;
         }
@@ -186,12 +186,12 @@
             break;
         }
 
-        mx_nanosleep(mx_deadline_after(MX_MSEC(10)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(10)));
     }
 
     if (attempt == max_attempts) {
         // Too many retries, fail.
-        iotxn_complete(txn, MX_ERR_BAD_STATE, 0);
+        iotxn_complete(txn, ZX_ERR_BAD_STATE, 0);
         goto out;
     }
 
@@ -209,8 +209,8 @@
         bytes_processed = txn->length;
     }
 
-    mx_status_t rc = sdmmc_do_command(sdmmc_mxdev, cmd, blkid, emmc_txn);
-    if (rc != MX_OK) {
+    zx_status_t rc = sdmmc_do_command(sdmmc_mxdev, cmd, blkid, emmc_txn);
+    if (rc != ZX_OK) {
         iotxn_complete(txn, rc, 0);
     }
 
@@ -220,7 +220,7 @@
         iotxn_copyto(txn, buffer, bytes_processed, 0);
     }
 
-    iotxn_complete(txn, MX_OK, bytes_processed);
+    iotxn_complete(txn, ZX_OK, bytes_processed);
 
 out:
     if (emmc_txn)
@@ -228,7 +228,7 @@
 }
 
 // Block device protocol.
-static mx_protocol_device_t sdmmc_device_proto = {
+static zx_protocol_device_t sdmmc_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = sdmmc_ioctl,
     .unbind = sdmmc_unbind,
@@ -254,23 +254,23 @@
     iotxn_release(txn);
 }
 
-static void block_do_txn(sdmmc_t* dev, uint32_t opcode, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
+static void block_do_txn(sdmmc_t* dev, uint32_t opcode, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block_info_t info;
     sdmmc_get_info(&info, dev);
 
     if ((dev_offset % info.block_size) || (length % info.block_size)) {
-        dev->callbacks->complete(cookie, MX_ERR_INVALID_ARGS);
+        dev->callbacks->complete(cookie, ZX_ERR_INVALID_ARGS);
         return;
     }
     uint64_t size = info.block_size * info.block_count;
     if ((dev_offset >= size) || (length >= (size - dev_offset))) {
-        dev->callbacks->complete(cookie, MX_ERR_OUT_OF_RANGE);
+        dev->callbacks->complete(cookie, ZX_ERR_OUT_OF_RANGE);
         return;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     iotxn_t* txn;
-    if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length)) != MX_OK) {
+    if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length)) != ZX_OK) {
         dev->callbacks->complete(cookie, status);
         return;
     }
@@ -283,11 +283,11 @@
     iotxn_queue(dev->mxdev, txn);
 }
 
-static void sdmmc_block_read(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
+static void sdmmc_block_read(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block_do_txn(ctx, IOTXN_OP_READ, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
-static void sdmmc_block_write(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
+static void sdmmc_block_write(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block_do_txn(ctx, IOTXN_OP_WRITE, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
@@ -301,9 +301,9 @@
 
 static int sdmmc_bootstrap_thread(void* arg) {
     xprintf("sdmmc: bootstrap\n");
-    mx_device_t* dev = arg;
+    zx_device_t* dev = arg;
 
-    mx_status_t st;
+    zx_status_t st;
     sdmmc_t* sdmmc = NULL;
     iotxn_t* setup_txn = NULL;
 
@@ -316,7 +316,7 @@
     sdmmc->host_mxdev = dev;
 
     // Allocate a single iotxn that we use to bootstrap the card with.
-    if ((st = iotxn_alloc(&setup_txn, IOTXN_ALLOC_CONTIGUOUS, SDHC_BLOCK_SIZE)) != MX_OK) {
+    if ((st = iotxn_alloc(&setup_txn, IOTXN_ALLOC_CONTIGUOUS, SDHC_BLOCK_SIZE)) != ZX_OK) {
         xprintf("sdmmc: failed to allocate iotxn for setup, rc = %d\n", st);
         goto err;
     }
@@ -326,14 +326,14 @@
 
     // No matter what state the card is in, issuing the GO_IDLE_STATE command will
     // put the card into the idle state.
-    if ((st = sdmmc_do_command(dev, SDMMC_GO_IDLE_STATE, 0, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_do_command(dev, SDMMC_GO_IDLE_STATE, 0, setup_txn)) != ZX_OK) {
         xprintf("sdmmc: SDMMC_GO_IDLE_STATE failed, retcode = %d\n", st);
         goto err;
     }
 
     // Probe for SD, then MMC
-    if ((st = sdmmc_probe_sd(sdmmc, setup_txn)) != MX_OK) {
-        if ((st = sdmmc_probe_mmc(sdmmc, setup_txn)) != MX_OK) {
+    if ((st = sdmmc_probe_sd(sdmmc, setup_txn)) != ZX_OK) {
+        if ((st = sdmmc_probe_mmc(sdmmc, setup_txn)) != ZX_OK) {
             xprintf("sdmmc: failed to probe\n");
             goto err;
         }
@@ -344,12 +344,12 @@
         .name = (sdmmc->type == SDMMC_TYPE_SD) ? "sd" : "mmc",
         .ctx = sdmmc,
         .ops = &sdmmc_device_proto,
-        .proto_id = MX_PROTOCOL_BLOCK_CORE,
+        .proto_id = ZX_PROTOCOL_BLOCK_CORE,
         .proto_ops = &sdmmc_block_ops,
     };
 
     st = device_add(dev, &args, &sdmmc->mxdev);
-    if (st != MX_OK) {
+    if (st != ZX_OK) {
          goto err;
     }
 
@@ -367,28 +367,28 @@
     return -1;
 }
 
-static mx_status_t sdmmc_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t sdmmc_bind(void* ctx, zx_device_t* dev, void** cookie) {
     // Create a bootstrap thread.
     thrd_t bootstrap_thrd;
     int thrd_rc = thrd_create_with_name(&bootstrap_thrd,
                                         sdmmc_bootstrap_thread, dev,
                                         "sdmmc_bootstrap_thread");
     if (thrd_rc != thrd_success) {
-        return thrd_status_to_mx_status(thrd_rc);
+        return thrd_status_to_zx_status(thrd_rc);
     }
 
     thrd_detach(bootstrap_thrd);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t sdmmc_driver_ops = {
+static zx_driver_ops_t sdmmc_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = sdmmc_bind,
 };
 
 // The formatter does not play nice with these macros.
 // clang-format off
-MAGENTA_DRIVER_BEGIN(sdmmc, sdmmc_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_SDMMC),
-MAGENTA_DRIVER_END(sdmmc)
+ZIRCON_DRIVER_BEGIN(sdmmc, sdmmc_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_SDMMC),
+ZIRCON_DRIVER_END(sdmmc)
 // clang-format on
diff --git a/system/dev/block/sdmmc/sdmmc.h b/system/dev/block/sdmmc/sdmmc.h
index 1fdacd7..2797626 100644
--- a/system/dev/block/sdmmc/sdmmc.h
+++ b/system/dev/block/sdmmc/sdmmc.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include <ddk/device.h>
 #include <ddk/protocol/block.h>
@@ -13,8 +13,8 @@
 __BEGIN_CDECLS;
 
 typedef struct sdmmc {
-    mx_device_t* mxdev;
-    mx_device_t* host_mxdev;
+    zx_device_t* mxdev;
+    zx_device_t* host_mxdev;
 
     uint8_t type;
 #define SDMMC_TYPE_SD   0
@@ -42,9 +42,9 @@
 } sdmmc_t;
 
 // Issue a command to the host controller
-mx_status_t sdmmc_do_command(mx_device_t* dev, const uint32_t cmd, const uint32_t arg, iotxn_t* txn);
+zx_status_t sdmmc_do_command(zx_device_t* dev, const uint32_t cmd, const uint32_t arg, iotxn_t* txn);
 
-mx_status_t sdmmc_probe_sd(sdmmc_t* sdmmc, iotxn_t* setup_txn);
-mx_status_t sdmmc_probe_mmc(sdmmc_t* sdmmc, iotxn_t* setup_txn);
+zx_status_t sdmmc_probe_sd(sdmmc_t* sdmmc, iotxn_t* setup_txn);
+zx_status_t sdmmc_probe_mmc(sdmmc_t* sdmmc, iotxn_t* setup_txn);
 
 __END_CDECLS;
diff --git a/system/dev/block/usb-mass-storage/block.c b/system/dev/block/usb-mass-storage/block.c
index d6d0d40..edf5e0f 100644
--- a/system/dev/block/usb-mass-storage/block.c
+++ b/system/dev/block/usb-mass-storage/block.c
@@ -11,11 +11,11 @@
     ums_block_t* dev = ctx;
 
     if (txn->offset % dev->block_size) {
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
     if (txn->length % dev->block_size) {
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
     txn->context = dev;
@@ -35,7 +35,7 @@
     info->flags = dev->flags;
 }
 
-static mx_status_t ums_block_ioctl(void* ctx, uint32_t op, const void* cmd, size_t cmdlen,
+static zx_status_t ums_block_ioctl(void* ctx, uint32_t op, const void* cmd, size_t cmdlen,
                                    void* reply, size_t max, size_t* out_actual) {
     ums_block_t* dev = ctx;
 
@@ -44,10 +44,10 @@
     case IOCTL_BLOCK_GET_INFO: {
         block_info_t* info = reply;
         if (max < sizeof(*info))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         ums_get_info(dev, info);
         *out_actual = sizeof(*info);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_RR_PART: {
         // rebind to reread the partition table
@@ -64,7 +64,7 @@
         }
         if (!txn) {
             mtx_unlock(&ums->iotxn_lock);
-            return MX_OK;
+            return ZX_OK;
         }
         // queue a stack allocated sync node on ums_t.sync_nodes
         node.iotxn = txn;
@@ -72,19 +72,19 @@
         list_add_head(&ums->sync_nodes, &node.node);
         mtx_unlock(&ums->iotxn_lock);
 
-        return completion_wait(&node.completion, MX_TIME_INFINITE);
+        return completion_wait(&node.completion, ZX_TIME_INFINITE);
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-static mx_off_t ums_block_get_size(void* ctx) {
+static zx_off_t ums_block_get_size(void* ctx) {
     ums_block_t* dev = ctx;
     return dev->block_size * dev->total_blocks;
 }
 
-static mx_protocol_device_t ums_block_proto = {
+static zx_protocol_device_t ums_block_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = ums_block_queue,
     .ioctl = ums_block_ioctl,
@@ -102,13 +102,13 @@
     iotxn_release(txn);
 }
 
-static void ums_async_read(void* ctx, mx_handle_t vmo, uint64_t length,
+static void ums_async_read(void* ctx, zx_handle_t vmo, uint64_t length,
                            uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     ums_block_t* dev = ctx;
 
     iotxn_t* txn;
-    mx_status_t status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length);
+    if (status != ZX_OK) {
         dev->cb->complete(cookie, status);
         return;
     }
@@ -120,13 +120,13 @@
     iotxn_queue(dev->mxdev, txn);
 }
 
-static void ums_async_write(void* ctx, mx_handle_t vmo, uint64_t length,
+static void ums_async_write(void* ctx, zx_handle_t vmo, uint64_t length,
                             uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     ums_block_t* dev = ctx;
 
     iotxn_t* txn;
-    mx_status_t status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL, vmo, vmo_offset, length);
+    if (status != ZX_OK) {
         dev->cb->complete(cookie, status);
         return;
     }
@@ -145,7 +145,7 @@
     .write = ums_async_write,
 };
 
-mx_status_t ums_block_add_device(ums_t* ums, ums_block_t* dev) {
+zx_status_t ums_block_add_device(ums_t* ums, ums_block_t* dev) {
     dev->cb = NULL;
 
     char name[16];
@@ -156,7 +156,7 @@
         .name = name,
         .ctx = dev,
         .ops = &ums_block_proto,
-        .proto_id = MX_PROTOCOL_BLOCK_CORE,
+        .proto_id = ZX_PROTOCOL_BLOCK_CORE,
         .proto_ops = &ums_block_ops,
     };
 
diff --git a/system/dev/block/usb-mass-storage/rules.mk b/system/dev/block/usb-mass-storage/rules.mk
index d7f07c1..4fddb35 100644
--- a/system/dev/block/usb-mass-storage/rules.mk
+++ b/system/dev/block/usb-mass-storage/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/block/usb-mass-storage/usb-mass-storage.c b/system/dev/block/usb-mass-storage/usb-mass-storage.c
index e211d58..53a20f0 100644
--- a/system/dev/block/usb-mass-storage/usb-mass-storage.c
+++ b/system/dev/block/usb-mass-storage/usb-mass-storage.c
@@ -5,9 +5,9 @@
 #include <ddk/driver.h>
 #include <ddk/binding.h>
 #include <driver/usb.h>
-#include <magenta/assert.h>
-#include <magenta/hw/usb.h>
-#include <magenta/hw/usb-mass-storage.h>
+#include <zircon/assert.h>
+#include <zircon/hw/usb.h>
+#include <zircon/hw/usb-mass-storage.h>
 
 #include <endian.h>
 #include <stdio.h>
@@ -26,19 +26,19 @@
 static csw_status_t ums_verify_csw(ums_t* ums, iotxn_t* csw_request, uint32_t* out_residue);
 
 
-static mx_status_t ums_reset(ums_t* ums) {
+static zx_status_t ums_reset(ums_t* ums) {
     // for all these control requests, data is null, length is 0 because nothing is passed back
     // value and index not used for first command, though index is supposed to be set to interface number
     // TODO: check interface number, see if index needs to be set
     DEBUG_PRINT(("UMS: performing reset recovery\n"));
-    mx_status_t status = usb_control(&ums->usb, USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
-                                     USB_REQ_RESET, 0x00, 0x00, NULL, 0, MX_TIME_INFINITE);
+    zx_status_t status = usb_control(&ums->usb, USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+                                     USB_REQ_RESET, 0x00, 0x00, NULL, 0, ZX_TIME_INFINITE);
     status = usb_control(&ums->usb, USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
                          USB_REQ_CLEAR_FEATURE, FS_ENDPOINT_HALT, ums->bulk_in_addr, NULL, 0,
-                         MX_TIME_INFINITE);
+                         ZX_TIME_INFINITE);
     status = usb_control(&ums->usb, USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
                          USB_REQ_CLEAR_FEATURE, FS_ENDPOINT_HALT, ums->bulk_out_addr, NULL, 0,
-                         MX_TIME_INFINITE);
+                         ZX_TIME_INFINITE);
     return status;
 }
 
@@ -73,28 +73,28 @@
     completion_t completion = COMPLETION_INIT;
     txn->cookie = &completion;
     ums_queue_request(ums, txn);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 }
 
-static mx_status_t ums_read_csw(ums_t* ums, uint32_t* out_residue) {
+static zx_status_t ums_read_csw(ums_t* ums, uint32_t* out_residue) {
     completion_t completion = COMPLETION_INIT;
     iotxn_t* csw_request = ums->csw_iotxn;
     csw_request->cookie = &completion;
     ums_queue_request(ums, csw_request);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 
     csw_status_t csw_error = ums_verify_csw(ums, csw_request, out_residue);
 
     if (csw_error == CSW_SUCCESS) {
-        return MX_OK;
+        return ZX_OK;
     } else if (csw_error == CSW_FAILED) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     } else {
         // FIXME - best way to handle this?
         // print error and then reset device due to it
         DEBUG_PRINT(("UMS: CSW verify returned error. Check ums-hw.h csw_status_t for enum = %d\n", csw_error));
         ums_reset(ums);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 }
 
@@ -134,7 +134,7 @@
     ums_queue_request(ums, read_request);
 }
 
-static mx_status_t ums_inquiry(ums_t* ums, uint8_t lun, uint8_t* out_data) {
+static zx_status_t ums_inquiry(ums_t* ums, uint8_t lun, uint8_t* out_data) {
     // CBW Configuration
     scsi_command6_t command;
     memset(&command, 0, sizeof(command));
@@ -146,14 +146,14 @@
     ums_queue_read(ums, UMS_INQUIRY_TRANSFER_LENGTH);
 
     // wait for CSW
-    mx_status_t status = ums_read_csw(ums, NULL);
-    if (status == MX_OK) {
+    zx_status_t status = ums_read_csw(ums, NULL);
+    if (status == ZX_OK) {
         iotxn_copyfrom(ums->data_iotxn, out_data, UMS_INQUIRY_TRANSFER_LENGTH, 0);
     }
     return status;
 }
 
-static mx_status_t ums_test_unit_ready(ums_t* ums, uint8_t lun) {
+static zx_status_t ums_test_unit_ready(ums_t* ums, uint8_t lun) {
     // CBW Configuration
     scsi_command6_t command;
     memset(&command, 0, sizeof(command));
@@ -164,7 +164,7 @@
     return ums_read_csw(ums, NULL);
 }
 
-static mx_status_t ums_request_sense(ums_t* ums, uint8_t lun, uint8_t* out_data) {
+static zx_status_t ums_request_sense(ums_t* ums, uint8_t lun, uint8_t* out_data) {
     // CBW Configuration
     scsi_command6_t command;
     memset(&command, 0, sizeof(command));
@@ -176,14 +176,14 @@
     ums_queue_read(ums, UMS_REQUEST_SENSE_TRANSFER_LENGTH);
 
     // wait for CSW
-    mx_status_t status = ums_read_csw(ums, NULL);
-    if (status == MX_OK) {
+    zx_status_t status = ums_read_csw(ums, NULL);
+    if (status == ZX_OK) {
         iotxn_copyfrom(ums->data_iotxn, out_data, UMS_REQUEST_SENSE_TRANSFER_LENGTH, 0);
     }
     return status;
 }
 
-static mx_status_t ums_read_capacity10(ums_t* ums, uint8_t lun, scsi_read_capacity_10_t* out_data) {
+static zx_status_t ums_read_capacity10(ums_t* ums, uint8_t lun, scsi_read_capacity_10_t* out_data) {
     // CBW Configuration
     scsi_command10_t command;
     memset(&command, 0, sizeof(command));
@@ -193,14 +193,14 @@
     // read capacity10 response
     ums_queue_read(ums, sizeof(*out_data));
 
-    mx_status_t status = ums_read_csw(ums, NULL);
-    if (status == MX_OK) {
+    zx_status_t status = ums_read_csw(ums, NULL);
+    if (status == ZX_OK) {
         iotxn_copyfrom(ums->data_iotxn, out_data, sizeof(*out_data), 0);
     }
     return status;
 }
 
-static mx_status_t ums_read_capacity16(ums_t* ums, uint8_t lun, scsi_read_capacity_16_t* out_data) {
+static zx_status_t ums_read_capacity16(ums_t* ums, uint8_t lun, scsi_read_capacity_16_t* out_data) {
     // CBW Configuration
     scsi_command16_t command;
     memset(&command, 0, sizeof(command));
@@ -213,14 +213,14 @@
     // read capacity16 response
     ums_queue_read(ums, sizeof(*out_data));
 
-    mx_status_t status = ums_read_csw(ums, NULL);
-    if (status == MX_OK) {
+    zx_status_t status = ums_read_csw(ums, NULL);
+    if (status == ZX_OK) {
         iotxn_copyfrom(ums->data_iotxn, out_data, sizeof(*out_data), 0);
     }
     return status;
 }
 
-static mx_status_t ums_mode_sense6(ums_t* ums, uint8_t lun, scsi_mode_sense_6_data_t* out_data) {
+static zx_status_t ums_mode_sense6(ums_t* ums, uint8_t lun, scsi_mode_sense_6_data_t* out_data) {
     // CBW Configuration
     scsi_mode_sense_6_command_t command;
     memset(&command, 0, sizeof(command));
@@ -233,18 +233,18 @@
     // read mode sense response
     ums_queue_read(ums, sizeof(*out_data));
 
-    mx_status_t status = ums_read_csw(ums, NULL);
-    if (status == MX_OK) {
+    zx_status_t status = ums_read_csw(ums, NULL);
+    if (status == ZX_OK) {
         iotxn_copyfrom(ums->data_iotxn, out_data, sizeof(*out_data), 0);
     }
     return status;
 }
 
-static mx_status_t ums_data_transfer(ums_t* ums, iotxn_t* txn, mx_off_t offset, size_t length,
+static zx_status_t ums_data_transfer(ums_t* ums, iotxn_t* txn, zx_off_t offset, size_t length,
                                      uint8_t ep_address) {
     iotxn_t* clone = NULL;
-    mx_status_t status = iotxn_clone_partial(txn, txn->vmo_offset + offset, length, &clone);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_clone_partial(txn, txn->vmo_offset + offset, length, &clone);
+    if (status != ZX_OK) {
         return status;
     }
     clone->complete_cb = ums_txn_complete;
@@ -255,13 +255,13 @@
 
     completion_t completion = COMPLETION_INIT;
     clone->cookie = &completion;
-    clone->protocol = MX_PROTOCOL_USB;
+    clone->protocol = ZX_PROTOCOL_USB;
     ums_queue_request(ums, clone);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 
     status = clone->status;
-    if (status == MX_OK && clone->actual != length) {
-        status = MX_ERR_IO;
+    if (status == ZX_OK && clone->actual != length) {
+        status = ZX_ERR_IO;
     }
 
     iotxn_release(clone);
@@ -273,7 +273,7 @@
 
     uint64_t lba = txn->offset / dev->block_size;
     if (lba > dev->total_blocks) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     uint32_t num_blocks = txn->length / dev->block_size;
     if (lba + num_blocks >= dev->total_blocks) {
@@ -285,9 +285,9 @@
 
     size_t blocks_transferred = 0;
     size_t max_blocks = ums->max_transfer / dev->block_size;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
-    while (status == MX_OK && blocks_transferred < num_blocks) {
+    while (status == ZX_OK && blocks_transferred < num_blocks) {
         size_t blocks = num_blocks - blocks_transferred;
         if (blocks > max_blocks) {
             blocks = max_blocks;
@@ -327,13 +327,13 @@
         // receive CSW
         uint32_t residue;
         status = ums_read_csw(ums, &residue);
-        if (status == MX_OK && residue) {
+        if (status == ZX_OK && residue) {
             printf("unexpected residue in ums_read\n");
-            status = MX_ERR_IO;
+            status = ZX_ERR_IO;
         }
     }
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         return num_blocks * dev->block_size;
     } else {
         return status;
@@ -345,7 +345,7 @@
 
     uint64_t lba = txn->offset / dev->block_size;
     if (lba > dev->total_blocks) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     uint32_t num_blocks = txn->length / dev->block_size;
     if (lba + num_blocks >= dev->total_blocks) {
@@ -357,9 +357,9 @@
 
     size_t blocks_transferred = 0;
     size_t max_blocks = ums->max_transfer / dev->block_size;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
-    while (status == MX_OK && blocks_transferred < num_blocks) {
+    while (status == ZX_OK && blocks_transferred < num_blocks) {
         size_t blocks = num_blocks - blocks_transferred;
         if (blocks > max_blocks) {
             blocks = max_blocks;
@@ -398,13 +398,13 @@
         // receive CSW
         uint32_t residue;
         status = ums_read_csw(ums, &residue);
-        if (status == MX_OK && residue) {
+        if (status == ZX_OK && residue) {
             printf("unexpected residue in ums_write\n");
-            status = MX_ERR_IO;
+            status = ZX_ERR_IO;
         }
     }
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         return num_blocks * dev->block_size;
     } else {
         return status;
@@ -451,12 +451,12 @@
     free(ums);
 }
 
-static mx_status_t ums_add_block_device(ums_block_t* dev) {
+static zx_status_t ums_add_block_device(ums_block_t* dev) {
     ums_t* ums = block_to_ums(dev);
     uint8_t lun = dev->lun;
 
     scsi_read_capacity_10_t data;
-    mx_status_t status = ums_read_capacity10(ums, lun, &data);
+    zx_status_t status = ums_read_capacity10(ums, lun, &data);
     if (status < 0) {
         printf("read_capacity10 failed: %d\n", status);
         return status;
@@ -478,7 +478,7 @@
     }
     if (dev->block_size == 0) {
         printf("UMS zero block size\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // +1 because this returns the address of the final block, and blocks are zero indexed
@@ -487,7 +487,7 @@
     // determine if LUN is read-only
     scsi_mode_sense_6_data_t ms_data;
     status = ums_mode_sense6(ums, lun, &ms_data);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("ums_mode_sense6 failed: %d\n", status);
         return status;
     }
@@ -507,30 +507,30 @@
     return ums_block_add_device(ums, dev);
 }
 
-static mx_status_t ums_check_luns_ready(ums_t* ums) {
-    mx_status_t status = MX_OK;
+static zx_status_t ums_check_luns_ready(ums_t* ums) {
+    zx_status_t status = ZX_OK;
 
-    for (uint8_t lun = 0; lun <= ums->max_lun && status == MX_OK; lun++) {
+    for (uint8_t lun = 0; lun <= ums->max_lun && status == ZX_OK; lun++) {
         ums_block_t* dev = &ums->block_devs[lun];
         bool ready;
 
         status = ums_test_unit_ready(ums, lun);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             ready = true;
-        } if (status == MX_ERR_BAD_STATE) {
+        } if (status == ZX_ERR_BAD_STATE) {
             ready = false;
             // command returned CSW_FAILED. device is there but media is not ready.
             uint8_t request_sense_data[UMS_REQUEST_SENSE_TRANSFER_LENGTH];
             status = ums_request_sense(ums, lun, request_sense_data);
         }
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             break;
         }
 
         if (ready && !dev->device_added) {
             // this will set ums_block_t.device_added if it succeeds
             status = ums_add_block_device(dev);
-            if (status == MX_OK) {
+            if (status == ZX_OK) {
                 dev->device_added = true;
             } else {
                 printf("UMS: device_add for block device failed %d\n", status);
@@ -544,7 +544,7 @@
     return status;
 }
 
-static mx_protocol_device_t ums_device_proto = {
+static zx_protocol_device_t ums_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = ums_unbind,
     .release = ums_release,
@@ -552,7 +552,7 @@
 
 static int ums_worker_thread(void* arg) {
     ums_t* ums = (ums_t*)arg;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     for (uint8_t lun = 0; lun <= ums->max_lun; lun++) {
         uint8_t inquiry_data[UMS_INQUIRY_TRANSFER_LENGTH];
@@ -577,16 +577,16 @@
     };
 
     status = device_add(ums->usb_mxdev, &args, &ums->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
     bool wait = true;
     while (1) {
         if (wait) {
-            status = completion_wait(&ums->iotxn_completion, MX_SEC(1));
-            if (status == MX_ERR_TIMED_OUT) {
-                if (ums_check_luns_ready(ums) != MX_OK) {
+            status = completion_wait(&ums->iotxn_completion, ZX_SEC(1));
+            if (status == ZX_ERR_TIMED_OUT) {
+                if (ums_check_luns_ready(ums) != ZX_OK) {
                     return status;
                 }
                 continue;
@@ -610,13 +610,13 @@
 
         ums_block_t* dev = txn->context;
 
-        mx_status_t status;
+        zx_status_t status;
         if (txn->opcode == IOTXN_OP_READ) {
             status = ums_read(dev, txn);
         }else if (txn->opcode == IOTXN_OP_WRITE) {
             status = ums_write(dev, txn);
         } else {
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
         }
 
         mtx_lock(&ums->iotxn_lock);
@@ -635,7 +635,7 @@
         mtx_unlock(&ums->iotxn_lock);
 
         if (status >= 0) {
-            iotxn_complete(txn, MX_OK, txn->length);
+            iotxn_complete(txn, ZX_OK, txn->length);
         } else {
             iotxn_complete(txn, status, 0);
         }
@@ -649,10 +649,10 @@
 
     iotxn_t* txn;
     while ((txn = list_remove_head_type(&ums->queued_iotxns, iotxn_t, node)) != NULL) {
-        iotxn_complete(txn, MX_ERR_IO_NOT_PRESENT, 0);
+        iotxn_complete(txn, ZX_ERR_IO_NOT_PRESENT, 0);
     }
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     printf("ums_worker_thread failed\n");
@@ -660,26 +660,26 @@
     return status;
 }
 
-static mx_status_t ums_bind(void* ctx, mx_device_t* device, void** cookie) {
+static zx_status_t ums_bind(void* ctx, zx_device_t* device, void** cookie) {
     usb_protocol_t usb;
-    if (device_get_protocol(device, MX_PROTOCOL_USB, &usb)) {
+    if (device_get_protocol(device, ZX_PROTOCOL_USB, &usb)) {
         return 0;
     }
 
     // find our endpoints
     usb_desc_iter_t iter;
-    mx_status_t result = usb_desc_iter_init(&usb, &iter);
+    zx_status_t result = usb_desc_iter_init(&usb, &iter);
     if (result < 0) return result;
 
     usb_interface_descriptor_t* intf = usb_desc_iter_next_interface(&iter, true);
     if (!intf) {
         usb_desc_iter_release(&iter);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     if (intf->bNumEndpoints < 2) {
         DEBUG_PRINT(("UMS:ums_bind wrong number of endpoints: %d\n", intf->bNumEndpoints));
         usb_desc_iter_release(&iter);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint8_t bulk_in_addr = 0;
@@ -706,13 +706,13 @@
 
     if (!bulk_in_addr || !bulk_out_addr) {
         DEBUG_PRINT(("UMS:ums_bind could not find endpoints\n"));
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint8_t max_lun;
-    mx_status_t status = usb_control(&usb, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+    zx_status_t status = usb_control(&usb, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
                                      USB_REQ_GET_MAX_LUN, 0x00, 0x00, &max_lun, sizeof(max_lun),
-                                     MX_TIME_INFINITE);
+                                     ZX_TIME_INFINITE);
     if (status != sizeof(max_lun)) {
         return status;
     }
@@ -720,7 +720,7 @@
     ums_t* ums = calloc(1, sizeof(ums_t) + (max_lun + 1) * sizeof(ums_block_t));
     if (!ums) {
         DEBUG_PRINT(("UMS:Not enough memory for ums_t\n"));
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     DEBUG_PRINT(("UMS:Max lun is: %u\n", max_lun));
@@ -749,17 +749,17 @@
 
     ums->cbw_iotxn = usb_alloc_iotxn(bulk_out_addr, sizeof(ums_cbw_t));
     if (!ums->cbw_iotxn) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto fail;
     }
     ums->data_iotxn = usb_alloc_iotxn(bulk_in_addr, PAGE_SIZE);
     if (!ums->data_iotxn) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto fail;
     }
     ums->csw_iotxn = usb_alloc_iotxn(bulk_in_addr, sizeof(ums_csw_t));
     if (!ums->csw_iotxn) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto fail;
     }
 
@@ -781,14 +781,14 @@
     return status;
 }
 
-static mx_driver_ops_t usb_mass_storage_driver_ops = {
+static zx_driver_ops_t usb_mass_storage_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ums_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(usb_mass_storage, usb_mass_storage_driver_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB),
+ZIRCON_DRIVER_BEGIN(usb_mass_storage, usb_mass_storage_driver_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB),
     BI_ABORT_IF(NE, BIND_USB_CLASS, USB_CLASS_MSC),
     BI_ABORT_IF(NE, BIND_USB_SUBCLASS, USB_SUBCLASS_MSC_SCSI),
     BI_MATCH_IF(EQ, BIND_USB_PROTOCOL, USB_PROTOCOL_MSC_BULK_ONLY),
-MAGENTA_DRIVER_END(usb_mass_storage)
+ZIRCON_DRIVER_END(usb_mass_storage)
diff --git a/system/dev/block/usb-mass-storage/usb-mass-storage.h b/system/dev/block/usb-mass-storage/usb-mass-storage.h
index 0727d67..fb9263d 100644
--- a/system/dev/block/usb-mass-storage/usb-mass-storage.h
+++ b/system/dev/block/usb-mass-storage/usb-mass-storage.h
@@ -9,7 +9,7 @@
 #include <ddk/iotxn.h>
 #include <ddk/protocol/block.h>
 #include <ddk/protocol/usb.h>
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 #include <sync/completion.h>
 
 #include <threads.h>
@@ -23,7 +23,7 @@
 
 // struct representing a block device for a logical unit
 typedef struct {
-    mx_device_t* mxdev;         // block device we publish
+    zx_device_t* mxdev;         // block device we publish
     block_callbacks_t* cb;      // callbacks for async block protocol
 
     uint64_t total_blocks;
@@ -36,8 +36,8 @@
 
 // main struct for the UMS driver
 typedef struct {
-    mx_device_t* mxdev;         // root device we publish
-    mx_device_t* usb_mxdev;     // USB device we are bound to
+    zx_device_t* mxdev;         // root device we publish
+    zx_device_t* usb_mxdev;     // USB device we are bound to
     usb_protocol_t usb;
 
     uint32_t tag_send;          // next tag to send in CBW
@@ -72,4 +72,4 @@
 } ums_t;
 #define block_to_ums(block) containerof(block - block->lun, ums_t, block_devs)
 
-mx_status_t ums_block_add_device(ums_t* ums, ums_block_t* dev);
+zx_status_t ums_block_add_device(ums_t* ums, ums_block_t* dev);
diff --git a/system/dev/bus/acpi/bus-acpi.c b/system/dev/bus/acpi/bus-acpi.c
index 8232b40..554496b 100644
--- a/system/dev/bus/acpi/bus-acpi.c
+++ b/system/dev/bus/acpi/bus-acpi.c
@@ -14,11 +14,11 @@
 #include <string.h>
 #include <sys/stat.h>
 
-#include <magenta/compiler.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/debug.h>
+#include <zircon/compiler.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/debug.h>
 
 #include "init.h"
 #include "dev.h"
@@ -34,20 +34,20 @@
 #define HID_LENGTH 8
 
 typedef struct acpi_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     // handle to the corresponding ACPI node
     ACPI_HANDLE ns_node;
 } acpi_device_t;
 
-mx_handle_t root_resource_handle;
-mx_handle_t rpc_handle;
+zx_handle_t root_resource_handle;
+zx_handle_t rpc_handle;
 
 static int acpi_rpc_thread(void* arg) {
     xprintf("bus-acpi: rpc thread starting\n");
-    mx_status_t status = begin_processing(rpc_handle);
+    zx_status_t status = begin_processing(rpc_handle);
     xprintf("bus-acpi: rpc thread returned %d\n", status);
-    return (status == MX_OK) ? 0 : -1;
+    return (status == ZX_OK) ? 0 : -1;
 }
 
 static void acpi_device_release(void* ctx) {
@@ -55,7 +55,7 @@
     free(dev);
 }
 
-static mx_protocol_device_t acpi_device_proto = {
+static zx_protocol_device_t acpi_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .release = acpi_device_release,
 };
@@ -73,7 +73,7 @@
     return hid;
 }
 
-static mx_device_t* publish_device(mx_device_t* parent,
+static zx_device_t* publish_device(zx_device_t* parent,
                                    ACPI_HANDLE handle,
                                    ACPI_DEVICE_INFO* info,
                                    uint32_t protocol_id,
@@ -88,7 +88,7 @@
     char name[5] = { 0 };
     memcpy(name, &info->Name, sizeof(name) - 1);
 
-    mx_device_prop_t props[4];
+    zx_device_prop_t props[4];
     int propcount = 0;
 
     // Publish HID in device props
@@ -157,8 +157,8 @@
         .prop_count = propcount,
     };
 
-    mx_status_t status;
-    if ((status = device_add(parent, &args, &dev->mxdev)) != MX_OK) {
+    zx_status_t status;
+    if ((status = device_add(parent, &args, &dev->mxdev)) != ZX_OK) {
         xprintf("acpi-bus: error %d in device_add, parent=%s(%p)\n", status, device_get_name(parent), parent);
         free(dev);
         return NULL;
@@ -190,14 +190,14 @@
     xprintf("acpi-bus: handle %p nesting level %d\n", (void*)object, nesting_level);
 
     // Only publish PCIE/PCI roots
-    mx_device_t* parent = (mx_device_t*)context;
+    zx_device_t* parent = (zx_device_t*)context;
     const char* hid = hid_from_acpi_devinfo(info);
     if (hid == 0) {
         goto out;
     }
     if (!memcmp(hid, PCI_EXPRESS_ROOT_HID_STRING, HID_LENGTH) ||
                 !memcmp(hid, PCI_ROOT_HID_STRING, HID_LENGTH)) {
-        publish_device(parent, object, info, MX_PROTOCOL_PCIROOT, &pciroot_proto);
+        publish_device(parent, object, info, ZX_PROTOCOL_PCIROOT, &pciroot_proto);
     } else if (!memcmp(hid, BATTERY_HID_STRING, HID_LENGTH)) {
         battery_init(parent, object);
     } else if (!memcmp(hid, PWRSRC_HID_STRING, HID_LENGTH)) {
@@ -212,7 +212,7 @@
     return AE_OK;
 }
 
-static mx_status_t publish_pci_roots(mx_device_t* parent) {
+static zx_status_t publish_pci_roots(zx_device_t* parent) {
     // Walk the ACPI namespace for devices and publish them
     ACPI_STATUS acpi_status = AcpiWalkNamespace(ACPI_TYPE_DEVICE,
                                                 ACPI_ROOT_OBJECT,
@@ -220,55 +220,55 @@
                                                 acpi_ns_walk_callback,
                                                 NULL, parent, NULL);
     if (acpi_status != AE_OK) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     } else {
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
-static mx_status_t acpi_drv_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t acpi_drv_bind(void* ctx, zx_device_t* parent, void** cookie) {
     // ACPI is the root driver for its devhost so run init in the bind thread.
     xprintf("bus-acpi: bind to %s %p\n", device_get_name(parent), parent);
     root_resource_handle = get_root_resource();
 
     // Get RPC channel
-    rpc_handle = mx_get_startup_handle(PA_HND(PA_USER0, 10));
-    if (rpc_handle == MX_HANDLE_INVALID) {
+    rpc_handle = zx_get_startup_handle(PA_HND(PA_USER0, 10));
+    if (rpc_handle == ZX_HANDLE_INVALID) {
         xprintf("bus-acpi: no acpi rpc handle\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    if (init() != MX_OK) {
+    if (init() != ZX_OK) {
         xprintf("bus_acpi: failed to initialize ACPI\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     printf("acpi-bus: initialized\n");
 
-    mx_status_t status = install_powerbtn_handlers();
-    if (status != MX_OK) {
+    zx_status_t status = install_powerbtn_handlers();
+    if (status != ZX_OK) {
         xprintf("acpi-bus: error %d in install_powerbtn_handlers\n", status);
         return status;
     }
 
     // Report current resources to kernel PCI driver
     status = pci_report_current_resources(get_root_resource());
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("acpi-bus: WARNING: ACPI failed to report all current resources!\n");
     }
 
     // Initialize kernel PCI driver
-    mx_pci_init_arg_t* arg;
+    zx_pci_init_arg_t* arg;
     uint32_t arg_size;
     status = get_pci_init_arg(&arg, &arg_size);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("acpi-bus: erorr %d in get_pci_init_arg\n", status);
         return status;
     }
 
-    status = mx_pci_init(get_root_resource(), arg, arg_size);
-    if (status != MX_OK) {
-        xprintf("acpi-bus: error %d in mx_pci_init\n", status);
+    status = zx_pci_init(get_root_resource(), arg, arg_size);
+    if (status != ZX_OK) {
+        xprintf("acpi-bus: error %d in zx_pci_init\n", status);
         return status;
     }
 
@@ -280,20 +280,20 @@
     int rc = thrd_create_with_name(&rpc_thrd, acpi_rpc_thread, NULL, "acpi-rpc");
     if (rc != thrd_success) {
         xprintf("acpi-bus: error %d in rpc thrd_create\n", rc);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     // only publish the pci root. ACPI devices are managed by this driver.
     publish_pci_roots(parent);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t acpi_driver_ops = {
+static zx_driver_ops_t acpi_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = acpi_drv_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(acpi, acpi_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_ACPI_BUS),
-MAGENTA_DRIVER_END(acpi)
+ZIRCON_DRIVER_BEGIN(acpi, acpi_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_ACPI_BUS),
+ZIRCON_DRIVER_END(acpi)
diff --git a/system/dev/bus/acpi/dev-battery.c b/system/dev/bus/acpi/dev-battery.c
index 9c08eda..a897142 100644
--- a/system/dev/bus/acpi/dev-battery.c
+++ b/system/dev/bus/acpi/dev-battery.c
@@ -6,10 +6,10 @@
 #include <ddk/driver.h>
 #include <ddk/binding.h>
 
-#include <magenta/types.h>
-#include <magenta/syscalls.h>
-#include <magenta/device/power.h>
-#include <mxio/debug.h>
+#include <zircon/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/device/power.h>
+#include <fdio/debug.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <threads.h>
@@ -26,7 +26,7 @@
 #define ACPI_BATTERY_STATE_CRITICAL    (1 << 2)
 
 typedef struct acpi_battery_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     ACPI_HANDLE acpi_handle;
 
@@ -39,7 +39,7 @@
     mtx_t lock;
 
     // event to notify on
-    mx_handle_t event;
+    zx_handle_t event;
 
     power_info_t power_info;
     battery_info_t battery_info;
@@ -51,7 +51,7 @@
     uint32_t capacity_remaining;
 } acpi_battery_device_t;
 
-static mx_status_t call_STA(acpi_battery_device_t* dev) {
+static zx_status_t call_STA(acpi_battery_device_t* dev) {
     ACPI_OBJECT obj = {
         .Type = ACPI_TYPE_INTEGER,
     };
@@ -61,7 +61,7 @@
     };
     ACPI_STATUS acpi_status = AcpiEvaluateObject(dev->acpi_handle, (char*)"_STA", NULL, &buffer);
     if (acpi_status != AE_OK) {
-        return acpi_to_mx_status(acpi_status);
+        return acpi_to_zx_status(acpi_status);
     }
 
     xprintf("acpi_battery: _STA returned 0x%llx\n", obj.Integer.Value);
@@ -75,13 +75,13 @@
     }
 
     if (old != dev->power_info.state) {
-        mx_object_signal(dev->event, 0, MX_USER_SIGNAL_0);
+        zx_object_signal(dev->event, 0, ZX_USER_SIGNAL_0);
     }
     mtx_unlock(&dev->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t call_BIF(acpi_battery_device_t* dev) {
+static zx_status_t call_BIF(acpi_battery_device_t* dev) {
     mtx_lock(&dev->lock);
 
     ACPI_STATUS acpi_status = AcpiEvaluateObject(dev->acpi_handle,
@@ -121,13 +121,13 @@
 
     mtx_unlock(&dev->lock);
 
-    return MX_OK;
+    return ZX_OK;
 err:
     mtx_unlock(&dev->lock);
-    return acpi_to_mx_status(acpi_status);
+    return acpi_to_zx_status(acpi_status);
 }
 
-static mx_status_t call_BST(acpi_battery_device_t* dev) {
+static zx_status_t call_BST(acpi_battery_device_t* dev) {
     mtx_lock(&dev->lock);
 
     ACPI_STATUS acpi_status = AcpiEvaluateObject(dev->acpi_handle,
@@ -181,15 +181,15 @@
     binfo->present_voltage = bst_elem[3].Integer.Value;
 
     if (old != pinfo->state) {
-        mx_object_signal(dev->event, 0, MX_USER_SIGNAL_0);
+        zx_object_signal(dev->event, 0, ZX_USER_SIGNAL_0);
     }
 
     mtx_unlock(&dev->lock);
 
-    return MX_OK;
+    return ZX_OK;
 err:
     mtx_unlock(&dev->lock);
-    return acpi_to_mx_status(acpi_status);
+    return acpi_to_zx_status(acpi_status);
 }
 
 static void acpi_battery_notify(ACPI_HANDLE handle, UINT32 value, void* ctx) {
@@ -208,7 +208,7 @@
     }
 }
 
-static mx_status_t acpi_battery_read(void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t acpi_battery_read(void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
     acpi_battery_device_t* device = ctx;
     mtx_lock(&device->lock);
     ssize_t rc = 0;
@@ -231,34 +231,34 @@
         return rc;
     }
     *actual = rc;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t acpi_battery_ioctl(void* ctx, uint32_t op,
+static zx_status_t acpi_battery_ioctl(void* ctx, uint32_t op,
                                       const void* in_buf, size_t in_len,
                                       void* out_buf, size_t out_len, size_t* out_actual) {
     acpi_battery_device_t* dev = ctx;
-    mx_status_t status = MX_ERR_NOT_SUPPORTED;
+    zx_status_t status = ZX_ERR_NOT_SUPPORTED;
     switch (op) {
     case IOCTL_POWER_GET_INFO: {
         if (out_len != sizeof(power_info_t)) {
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             goto err;
         }
 
         // reading state clears the signal
-        mx_object_signal(dev->event, MX_USER_SIGNAL_0, 0);
+        zx_object_signal(dev->event, ZX_USER_SIGNAL_0, 0);
 
         power_info_t* info = (power_info_t*)out_buf;
         mtx_lock(&dev->lock);
         memcpy(info, &dev->power_info, sizeof(power_info_t));
         mtx_unlock(&dev->lock);
         *out_actual = sizeof(power_info_t);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_POWER_GET_BATTERY_INFO: {
         if (out_len != sizeof(battery_info_t)) {
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             goto err;
         }
         call_BST(dev);
@@ -267,28 +267,28 @@
         memcpy(info, &dev->battery_info, sizeof(battery_info_t));
         mtx_unlock(&dev->lock);
         *out_actual = sizeof(battery_info_t);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_POWER_GET_STATE_CHANGE_EVENT: {
-        if (out_len != sizeof(mx_handle_t)) {
-            status = MX_ERR_INVALID_ARGS;
+        if (out_len != sizeof(zx_handle_t)) {
+            status = ZX_ERR_INVALID_ARGS;
             goto err;
         }
-        mx_handle_t* out = (mx_handle_t*)out_buf;
-        mx_status_t status = mx_handle_duplicate(dev->event,
-                                                 MX_RIGHT_READ | MX_RIGHT_TRANSFER,
+        zx_handle_t* out = (zx_handle_t*)out_buf;
+        zx_status_t status = zx_handle_duplicate(dev->event,
+                                                 ZX_RIGHT_READ | ZX_RIGHT_TRANSFER,
                                                  out);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             goto err;
         }
 
         // clear the signal before returning
-        mx_object_signal(dev->event, MX_USER_SIGNAL_0, 0);
-        *out_actual = sizeof(mx_handle_t);
-        return MX_OK;
+        zx_object_signal(dev->event, ZX_USER_SIGNAL_0, 0);
+        *out_actual = sizeof(zx_handle_t);
+        return ZX_OK;
     }
     default:
-        status = MX_ERR_NOT_SUPPORTED;
+        status = ZX_ERR_NOT_SUPPORTED;
     }
 err:
     *out_actual = 0;
@@ -304,13 +304,13 @@
     if (dev->bif_buffer.Length != ACPI_ALLOCATE_BUFFER) {
         AcpiOsFree(dev->bif_buffer.Pointer);
     }
-    if (dev->event != MX_HANDLE_INVALID) {
-        mx_handle_close(dev->event);
+    if (dev->event != ZX_HANDLE_INVALID) {
+        zx_handle_close(dev->event);
     }
     free(dev);
 }
 
-static mx_protocol_device_t acpi_battery_device_proto = {
+static zx_protocol_device_t acpi_battery_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .read = acpi_battery_read,
     .ioctl = acpi_battery_ioctl,
@@ -320,13 +320,13 @@
 static int acpi_battery_poll_thread(void* arg) {
     acpi_battery_device_t* dev = arg;
     for (;;) {
-        mx_status_t status = call_BST(dev);
-        if (status != MX_OK) {
+        zx_status_t status = call_BST(dev);
+        if (status != ZX_OK) {
             goto out;
         }
 
         status = call_BIF(dev);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             goto out;
         }
 
@@ -351,26 +351,26 @@
         dev->capacity_full = dev->battery_info.last_full_capacity;
         mtx_unlock(&dev->lock);
 
-        mx_nanosleep(mx_deadline_after(MX_MSEC(1000)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(1000)));
     }
 out:
     printf("acpi-battery: poll thread exiting\n");
     return 0;
 }
 
-mx_status_t battery_init(mx_device_t* parent, ACPI_HANDLE acpi_handle) {
+zx_status_t battery_init(zx_device_t* parent, ACPI_HANDLE acpi_handle) {
     xprintf("acpi-battery: init\n");
 
     acpi_battery_device_t* dev = calloc(1, sizeof(acpi_battery_device_t));
     if (!dev) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     dev->acpi_handle = acpi_handle;
     mtx_init(&dev->lock, mtx_plain);
 
-    mx_status_t status = mx_event_create(0, &dev->event);
-    if (status != MX_OK) {
+    zx_status_t status = zx_event_create(0, &dev->event);
+    if (status != ZX_OK) {
         free(dev);
         return status;
     }
@@ -394,7 +394,7 @@
     if (acpi_status != AE_OK) {
         xprintf("acpi-battery: could not install notify handler\n");
         acpi_battery_release(dev);
-        return acpi_to_mx_status(acpi_status);
+        return acpi_to_zx_status(acpi_status);
     }
 
     // deprecated - create polling thread
@@ -411,11 +411,11 @@
         .name = "acpi-battery",
         .ctx = dev,
         .ops = &acpi_battery_device_proto,
-        .proto_id = MX_PROTOCOL_POWER,
+        .proto_id = ZX_PROTOCOL_POWER,
     };
 
     status = device_add(parent, &args, &dev->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("acpi-battery: could not add device! err=%d\n", status);
         acpi_battery_release(dev);
         return status;
@@ -427,15 +427,15 @@
         .name = "acpi-battery",
         .ctx = dev,
         .ops = &acpi_battery_device_proto,
-        .proto_id = MX_PROTOCOL_BATTERY,
+        .proto_id = ZX_PROTOCOL_BATTERY,
     };
 
     status = device_add(parent, &args2, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("acpi-battery: could not add deprecated device! err=%d\n", status);
     }
 
     printf("acpi-battery: initialized\n");
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/bus/acpi/dev-ec.c b/system/dev/bus/acpi/dev-ec.c
index 1a16768..80411ae 100644
--- a/system/dev/bus/acpi/dev-ec.c
+++ b/system/dev/bus/acpi/dev-ec.c
@@ -5,9 +5,9 @@
 #include "dev.h"
 
 #include <hw/inout.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <mxio/debug.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <fdio/debug.h>
 
 #include "errors.h"
 
@@ -22,11 +22,11 @@
 #define EC_SC_OBF (1 << 0)
 
 /* Thread shutdown signals */
-#define EC_THREAD_SHUTDOWN MX_USER_SIGNAL_0
-#define EC_THREAD_SHUTDOWN_DONE MX_USER_SIGNAL_1
+#define EC_THREAD_SHUTDOWN ZX_USER_SIGNAL_0
+#define EC_THREAD_SHUTDOWN_DONE ZX_USER_SIGNAL_1
 
 typedef struct acpi_ec_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     ACPI_HANDLE acpi_handle;
 
@@ -40,7 +40,7 @@
 
     // thread for processing System Control Interrupts
     thrd_t sci_thread;
-    mx_handle_t pending_sci_evt;
+    zx_handle_t pending_sci_evt;
 
     bool gpe_setup : 1;
     bool thread_setup : 1;
@@ -55,21 +55,21 @@
 
     while (1) {
         uint32_t pending;
-        mx_status_t mx_status = mx_object_wait_one(dev->pending_sci_evt,
-                                                   MX_EVENT_SIGNALED | EC_THREAD_SHUTDOWN,
-                                                   MX_TIME_INFINITE,
+        zx_status_t zx_status = zx_object_wait_one(dev->pending_sci_evt,
+                                                   ZX_EVENT_SIGNALED | EC_THREAD_SHUTDOWN,
+                                                   ZX_TIME_INFINITE,
                                                    &pending);
-        if (mx_status != MX_OK) {
-            printf("acpi-ec: thread wait failed: %d\n", mx_status);
+        if (zx_status != ZX_OK) {
+            printf("acpi-ec: thread wait failed: %d\n", zx_status);
             break;
         }
 
         if (pending & EC_THREAD_SHUTDOWN) {
-            mx_object_signal(dev->pending_sci_evt, 0, EC_THREAD_SHUTDOWN_DONE);
+            zx_object_signal(dev->pending_sci_evt, 0, EC_THREAD_SHUTDOWN_DONE);
             break;
         }
 
-        mx_object_signal(dev->pending_sci_evt, MX_EVENT_SIGNALED, 0);
+        zx_object_signal(dev->pending_sci_evt, ZX_EVENT_SIGNALED, 0);
 
         UINT32 global_lock;
         while (AcpiAcquireGlobalLock(0xFFFF, &global_lock) != AE_OK)
@@ -114,7 +114,7 @@
 
 static uint32_t raw_ec_event_gpe_handler(ACPI_HANDLE gpe_dev, uint32_t gpe_num, void* ctx) {
     acpi_ec_device_t* dev = ctx;
-    mx_object_signal(dev->pending_sci_evt, 0, MX_EVENT_SIGNALED);
+    zx_object_signal(dev->pending_sci_evt, 0, ZX_EVENT_SIGNALED);
     return ACPI_REENABLE_GPE;
 }
 
@@ -233,15 +233,15 @@
 static void acpi_ec_release(void* ctx) {
     acpi_ec_device_t* dev = ctx;
 
-    if (dev->pending_sci_evt != MX_HANDLE_INVALID) {
+    if (dev->pending_sci_evt != ZX_HANDLE_INVALID) {
         if (dev->thread_setup) {
             /* Shutdown the EC thread */
-            mx_object_signal(dev->pending_sci_evt, 0, EC_THREAD_SHUTDOWN);
-            mx_object_wait_one(dev->pending_sci_evt, EC_THREAD_SHUTDOWN_DONE, MX_TIME_INFINITE, NULL);
+            zx_object_signal(dev->pending_sci_evt, 0, EC_THREAD_SHUTDOWN);
+            zx_object_wait_one(dev->pending_sci_evt, EC_THREAD_SHUTDOWN_DONE, ZX_TIME_INFINITE, NULL);
             thrd_join(dev->sci_thread, NULL);
         }
 
-        mx_handle_close(dev->pending_sci_evt);
+        zx_handle_close(dev->pending_sci_evt);
     }
 
     if (dev->gpe_setup) {
@@ -252,22 +252,22 @@
     free(dev);
 }
 
-static mx_protocol_device_t acpi_ec_device_proto = {
+static zx_protocol_device_t acpi_ec_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .release = acpi_ec_release,
 };
 
-mx_status_t ec_init(mx_device_t* parent, ACPI_HANDLE acpi_handle) {
+zx_status_t ec_init(zx_device_t* parent, ACPI_HANDLE acpi_handle) {
     xprintf("acpi-ec: init\n");
 
     acpi_ec_device_t* dev = calloc(1, sizeof(acpi_ec_device_t));
     if (!dev) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     dev->acpi_handle = acpi_handle;
 
-    mx_status_t err = mx_event_create(0, &dev->pending_sci_evt);
-    if (err != MX_OK) {
+    zx_status_t err = zx_event_create(0, &dev->pending_sci_evt);
+    if (err != ZX_OK) {
         xprintf("acpi-ec: Failed to create event: %d\n", err);
         acpi_ec_release(dev);
         return err;
@@ -306,7 +306,7 @@
     if (ret != thrd_success) {
         xprintf("acpi-ec: Failed to create thread\n");
         acpi_ec_release(dev);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     dev->thread_setup = true;
 
@@ -315,20 +315,20 @@
         .name = "acpi-ec",
         .ctx = dev,
         .ops = &acpi_ec_device_proto,
-        .proto_id = MX_PROTOCOL_MISC,
+        .proto_id = ZX_PROTOCOL_MISC,
     };
 
     status = device_add(parent, &args, &dev->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("acpi-ec: could not add device! err=%d\n", status);
         acpi_ec_release(dev);
         return status;
     }
 
     printf("acpi-ec: initialized\n");
-    return MX_OK;
+    return ZX_OK;
 
 acpi_error:
     acpi_ec_release(dev);
-    return acpi_to_mx_status(status);
+    return acpi_to_zx_status(status);
 }
diff --git a/system/dev/bus/acpi/dev-pwrsrc.c b/system/dev/bus/acpi/dev-pwrsrc.c
index 53480c4..4850224 100644
--- a/system/dev/bus/acpi/dev-pwrsrc.c
+++ b/system/dev/bus/acpi/dev-pwrsrc.c
@@ -6,15 +6,15 @@
 #include <ddk/driver.h>
 #include <ddk/binding.h>
 
-#include <magenta/types.h>
-#include <magenta/syscalls.h>
-#include <mxio/debug.h>
+#include <zircon/types.h>
+#include <zircon/syscalls.h>
+#include <fdio/debug.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <threads.h>
 
 #include <acpica/acpi.h>
-#include <magenta/device/power.h>
+#include <zircon/device/power.h>
 
 #include "dev.h"
 #include "errors.h"
@@ -22,19 +22,19 @@
 #define MXDEBUG 0
 
 typedef struct acpi_pwrsrc_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     ACPI_HANDLE acpi_handle;
 
     // event to notify on
-    mx_handle_t event;
+    zx_handle_t event;
 
     power_info_t info;
 
     mtx_t lock;
 } acpi_pwrsrc_device_t;
 
-static mx_status_t call_PSR(acpi_pwrsrc_device_t* dev, bool notify) {
+static zx_status_t call_PSR(acpi_pwrsrc_device_t* dev, bool notify) {
     ACPI_OBJECT obj = {
         .Type = ACPI_TYPE_INTEGER,
     };
@@ -52,11 +52,11 @@
             dev->info.state &= ~POWER_STATE_ONLINE;
         }
         if (notify && (state != dev->info.state)) {
-            mx_object_signal(dev->event, 0, MX_USER_SIGNAL_0);
+            zx_object_signal(dev->event, 0, ZX_USER_SIGNAL_0);
         }
         mtx_unlock(&dev->lock);
     }
-    return acpi_to_mx_status(acpi_status);
+    return acpi_to_zx_status(acpi_status);
 }
 
 static void acpi_pwrsrc_notify(ACPI_HANDLE handle, UINT32 value, void* ctx) {
@@ -65,43 +65,43 @@
     call_PSR(dev, true);
 }
 
-static mx_status_t acpi_pwrsrc_ioctl(void* ctx, uint32_t op,
+static zx_status_t acpi_pwrsrc_ioctl(void* ctx, uint32_t op,
                                      const void* in_buf, size_t in_len,
                                      void* out_buf, size_t out_len, size_t* out_actual) {
     acpi_pwrsrc_device_t* dev = ctx;
-    mx_status_t status = MX_ERR_NOT_SUPPORTED;
+    zx_status_t status = ZX_ERR_NOT_SUPPORTED;
     switch (op) {
     case IOCTL_POWER_GET_INFO: {
         if (out_len != sizeof(power_info_t)) {
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             goto err;
         }
 
         // reading state clears the signal
-        mx_object_signal(dev->event, MX_USER_SIGNAL_0, 0);
+        zx_object_signal(dev->event, ZX_USER_SIGNAL_0, 0);
 
         power_info_t* info = (power_info_t*)out_buf;
         mtx_lock(&dev->lock);
         memcpy(info, &dev->info, sizeof(power_info_t));
         mtx_unlock(&dev->lock);
         *out_actual = sizeof(power_info_t);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_POWER_GET_STATE_CHANGE_EVENT: {
-        if (out_len != sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
+        if (out_len != sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        mx_handle_t* out = (mx_handle_t*)out_buf;
-        mx_status_t status = mx_handle_duplicate(dev->event,
-                                                 MX_RIGHT_READ | MX_RIGHT_TRANSFER,
+        zx_handle_t* out = (zx_handle_t*)out_buf;
+        zx_status_t status = zx_handle_duplicate(dev->event,
+                                                 ZX_RIGHT_READ | ZX_RIGHT_TRANSFER,
                                                  out);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             goto err;
         }
         // clear the signal before returning
-        mx_object_signal(dev->event, MX_USER_SIGNAL_0, 0);
-        *out_actual = sizeof(mx_handle_t);
-        return MX_OK;
+        zx_object_signal(dev->event, ZX_USER_SIGNAL_0, 0);
+        *out_actual = sizeof(zx_handle_t);
+        return ZX_OK;
     }
     }
 err:
@@ -112,29 +112,29 @@
 static void acpi_pwrsrc_release(void* ctx) {
     acpi_pwrsrc_device_t* dev = ctx;
     AcpiRemoveNotifyHandler(dev->acpi_handle, ACPI_DEVICE_NOTIFY, acpi_pwrsrc_notify);
-    if (dev->event != MX_HANDLE_INVALID) {
-        mx_handle_close(dev->event);
+    if (dev->event != ZX_HANDLE_INVALID) {
+        zx_handle_close(dev->event);
     }
     free(dev);
 }
 
-static mx_protocol_device_t acpi_pwrsrc_device_proto = {
+static zx_protocol_device_t acpi_pwrsrc_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = acpi_pwrsrc_ioctl,
     .release = acpi_pwrsrc_release,
 };
 
-mx_status_t pwrsrc_init(mx_device_t* parent, ACPI_HANDLE acpi_handle) {
+zx_status_t pwrsrc_init(zx_device_t* parent, ACPI_HANDLE acpi_handle) {
     acpi_pwrsrc_device_t* dev = calloc(1, sizeof(acpi_pwrsrc_device_t));
     if (!dev) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     dev->acpi_handle = acpi_handle;
     mtx_init(&dev->lock, mtx_plain);
 
-    mx_status_t status = mx_event_create(0, &dev->event);
-    if (status != MX_OK) {
+    zx_status_t status = zx_event_create(0, &dev->event);
+    if (status != ZX_OK) {
         free(dev);
         return status;
     }
@@ -147,7 +147,7 @@
     if (acpi_status != AE_OK) {
         xprintf("acpi-pwrsrc: could not install notify handler\n");
         acpi_pwrsrc_release(dev);
-        return acpi_to_mx_status(acpi_status);
+        return acpi_to_zx_status(acpi_status);
     }
 
     // read initial value
@@ -158,11 +158,11 @@
         .name = "acpi-pwrsrc",
         .ctx = dev,
         .ops = &acpi_pwrsrc_device_proto,
-        .proto_id = MX_PROTOCOL_POWER,
+        .proto_id = ZX_PROTOCOL_POWER,
     };
 
     status = device_add(parent, &args, &dev->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("acpi-pwrsrc: could not add device! err=%d\n", status);
         acpi_pwrsrc_release(dev);
         return status;
@@ -170,5 +170,5 @@
 
     xprintf("acpi-pwrsrc: initialized\n");
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/bus/acpi/dev.h b/system/dev/bus/acpi/dev.h
index c76de6b..e3291f5 100644
--- a/system/dev/bus/acpi/dev.h
+++ b/system/dev/bus/acpi/dev.h
@@ -11,6 +11,6 @@
 #define EC_HID_STRING      "PNP0C09"
 #define PWRSRC_HID_STRING  "ACPI0003"
 
-mx_status_t battery_init(mx_device_t* parent, ACPI_HANDLE acpi_handle);
-mx_status_t ec_init(mx_device_t* parent, ACPI_HANDLE acpi_handle);
-mx_status_t pwrsrc_init(mx_device_t* parent, ACPI_HANDLE acpi_handle);
+zx_status_t battery_init(zx_device_t* parent, ACPI_HANDLE acpi_handle);
+zx_status_t ec_init(zx_device_t* parent, ACPI_HANDLE acpi_handle);
+zx_status_t pwrsrc_init(zx_device_t* parent, ACPI_HANDLE acpi_handle);
diff --git a/system/dev/bus/acpi/dummy.c b/system/dev/bus/acpi/dummy.c
index c3349d1..1e90843 100644
--- a/system/dev/bus/acpi/dummy.c
+++ b/system/dev/bus/acpi/dummy.c
@@ -8,9 +8,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/util.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/util.h>
 
 int main(int argc, char** argv) {
     // The devmgr handles will autoclose, which will signal the
diff --git a/system/dev/bus/acpi/errors.h b/system/dev/bus/acpi/errors.h
index fdb4814..ff2a1d1 100644
--- a/system/dev/bus/acpi/errors.h
+++ b/system/dev/bus/acpi/errors.h
@@ -6,58 +6,58 @@
 
 #include <acpica/acpi.h>
 
-static inline mx_status_t acpi_to_mx_status(ACPI_STATUS acpi_status) {
+static inline zx_status_t acpi_to_zx_status(ACPI_STATUS acpi_status) {
     switch (acpi_status) {
     case AE_ERROR:
     case AE_NO_ACPI_TABLES:
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     case AE_NO_NAMESPACE:
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     case AE_NO_MEMORY:
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     case AE_NOT_EXIST:
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     case AE_ALREADY_EXISTS:
-        return MX_ERR_ALREADY_EXISTS;
+        return ZX_ERR_ALREADY_EXISTS;
     case AE_TYPE:
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     case AE_NULL_OBJECT:
     case AE_NULL_ENTRY:
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     case AE_BUFFER_OVERFLOW:
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     case AE_STACK_OVERFLOW:
     case AE_STACK_UNDERFLOW:
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     case AE_NOT_IMPLEMENTED:
     case AE_SUPPORT:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     case AE_LIMIT:
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     case AE_TIME:
-        return MX_ERR_TIMED_OUT;
+        return ZX_ERR_TIMED_OUT;
     case AE_ACQUIRE_DEADLOCK:
     case AE_RELEASE_DEADLOCK:
     case AE_NOT_ACQUIRED:
     case AE_ALREADY_ACQUIRED:
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     case AE_NO_HARDWARE_RESPONSE:
-        return MX_ERR_TIMED_OUT;
+        return ZX_ERR_TIMED_OUT;
     case AE_NO_GLOBAL_LOCK:
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     case AE_ABORT_METHOD:
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     case AE_SAME_HANDLER:
-        return MX_ERR_ALREADY_EXISTS;
+        return ZX_ERR_ALREADY_EXISTS;
     case AE_OWNER_ID_LIMIT:
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     case AE_NOT_CONFIGURED:
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     case AE_ACCESS:
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     case AE_IO_ERROR:
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     default:
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 }
diff --git a/system/dev/bus/acpi/main.c b/system/dev/bus/acpi/main.c
index a524d20..ac3802d 100644
--- a/system/dev/bus/acpi/main.c
+++ b/system/dev/bus/acpi/main.c
@@ -5,10 +5,10 @@
 #include <stdio.h>
 
 #include <acpica/acpi.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 
 #include "init.h"
 #include "ec.h"
@@ -16,24 +16,24 @@
 #include "powerbtn.h"
 #include "processor.h"
 
-mx_handle_t root_resource_handle;
+zx_handle_t root_resource_handle;
 
 int main(int argc, char** argv) {
-    root_resource_handle = mx_get_startup_handle(PA_HND(PA_USER0, 0));
+    root_resource_handle = zx_get_startup_handle(PA_HND(PA_USER0, 0));
     if (root_resource_handle <= 0) {
         printf("Failed to find root resource handle\n");
         return 1;
     }
 
     // Get handle from devmgr to serve as the ACPI root handle
-    mx_handle_t acpi_root = mx_get_startup_handle(PA_HND(PA_USER1, 0));
+    zx_handle_t acpi_root = zx_get_startup_handle(PA_HND(PA_USER1, 0));
     if (acpi_root <= 0) {
         printf("Failed to find acpi root handle\n");
         return 1;
     }
 
     ACPI_STATUS status = init();
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("Failed to initialize ACPI\n");
         return 3;
     }
@@ -41,13 +41,13 @@
 
     ec_init();
 
-    mx_status_t mx_status = install_powerbtn_handlers();
-    if (mx_status != MX_OK) {
+    zx_status_t zx_status = install_powerbtn_handlers();
+    if (zx_status != ZX_OK) {
         printf("Failed to install powerbtn handler\n");
     }
 
-    mx_status = pci_report_current_resources(root_resource_handle);
-    if (mx_status != MX_OK) {
+    zx_status = pci_report_current_resources(root_resource_handle);
+    if (zx_status != ZX_OK) {
         printf("WARNING: ACPI failed to report all current resources!\n");
     }
 
diff --git a/system/dev/bus/acpi/pci.c b/system/dev/bus/acpi/pci.c
index b8dd5ed..171b24b 100644
--- a/system/dev/bus/acpi/pci.c
+++ b/system/dev/bus/acpi/pci.c
@@ -5,7 +5,7 @@
 #include "pci.h"
 
 #include <assert.h>
-#include <mxio/debug.h>
+#include <fdio/debug.h>
 #include <stdio.h>
 
 #include <acpica/acpi.h>
@@ -33,7 +33,7 @@
  */
 static ACPI_STATUS handle_prt(
     ACPI_HANDLE object,
-    mx_pci_init_arg_t* arg,
+    zx_pci_init_arg_t* arg,
     uint8_t port_dev_id,
     uint8_t port_func_id) {
     assert((port_dev_id == UINT8_MAX && port_func_id == UINT8_MAX) ||
@@ -76,7 +76,7 @@
             continue;
         }
 
-        uint32_t global_irq = MX_PCI_NO_IRQ_MAPPING;
+        uint32_t global_irq = ZX_PCI_NO_IRQ_MAPPING;
         bool level_triggered = true;
         bool active_high = false;
         if (entry->Source[0]) {
@@ -97,7 +97,7 @@
             while (res->Type != ACPI_RESOURCE_TYPE_END_TAG) {
                 if (res->Type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
                     ACPI_RESOURCE_EXTENDED_IRQ* irq = &res->Data.ExtendedIrq;
-                    if (global_irq != MX_PCI_NO_IRQ_MAPPING) {
+                    if (global_irq != ZX_PCI_NO_IRQ_MAPPING) {
                         // TODO: Handle finding two allocated IRQs.  Shouldn't
                         // happen?
                         PANIC_UNIMPLEMENTED;
@@ -119,7 +119,7 @@
                 crs_entry_addr += res->Length;
                 res = (ACPI_RESOURCE*)crs_entry_addr;
             }
-            if (global_irq == MX_PCI_NO_IRQ_MAPPING) {
+            if (global_irq == ZX_PCI_NO_IRQ_MAPPING) {
                 // TODO: Invoke PRS to find what is allocatable and allocate it with SRS
                 PANIC_UNIMPLEMENTED;
             }
@@ -180,14 +180,14 @@
  *
  * @param arg The structure to populate
  *
- * @return MX_OK on success.
+ * @return ZX_OK on success.
  */
-static mx_status_t find_pcie_config(mx_pci_init_arg_t* arg) {
+static zx_status_t find_pcie_config(zx_pci_init_arg_t* arg) {
     ACPI_TABLE_HEADER* raw_table = NULL;
     ACPI_STATUS status = AcpiGetTable((char*)ACPI_SIG_MCFG, 1, &raw_table);
     if (status != AE_OK) {
         xprintf("could not find MCFG\n");
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     ACPI_TABLE_MCFG* mcfg = (ACPI_TABLE_MCFG*)raw_table;
     ACPI_MCFG_ALLOCATION* table_start = ((void*)mcfg) + sizeof(*mcfg);
@@ -195,12 +195,12 @@
     uintptr_t table_bytes = (uintptr_t)table_end - (uintptr_t)table_start;
     if (table_bytes % sizeof(*table_start) != 0) {
         xprintf("MCFG has unexpected size\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     int num_entries = table_end - table_start;
     if (num_entries == 0) {
         xprintf("MCFG has no entries\n");
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     if (num_entries > 1) {
         xprintf("MCFG has more than one entry, just taking the first\n");
@@ -212,7 +212,7 @@
 
     if (table_start->PciSegment != 0) {
         xprintf("Non-zero segment found\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     arg->addr_windows[0].is_mmio = true;
@@ -233,7 +233,7 @@
     // big enough for all of the buses in this config.
     arg->addr_windows[0].size = size_per_bus * num_buses;
     arg->addr_window_count = 1;
-    return MX_OK;
+    return ZX_OK;
 }
 
 
@@ -243,7 +243,7 @@
     UINT32 nesting_level,
     void* context,
     void** ret) {
-    mx_pci_init_arg_t* arg = context;
+    zx_pci_init_arg_t* arg = context;
     ACPI_STATUS status = handle_prt(
         object,
         arg,
@@ -293,13 +293,13 @@
  *
  * @param arg The structure to populate
  *
- * @return MX_OK on success
+ * @return ZX_OK on success
  */
-static mx_status_t find_pci_legacy_irq_mapping(mx_pci_init_arg_t* arg) {
+static zx_status_t find_pci_legacy_irq_mapping(zx_pci_init_arg_t* arg) {
     unsigned int map_len = sizeof(arg->dev_pin_to_global_irq) / sizeof(uint32_t);
     for (unsigned int i = 0; i < map_len; ++i) {
         uint32_t* flat_map = (uint32_t*)&arg->dev_pin_to_global_irq;
-        flat_map[i] = MX_PCI_NO_IRQ_MAPPING;
+        flat_map[i] = ZX_PCI_NO_IRQ_MAPPING;
     }
     arg->num_irqs = 0;
 
@@ -309,9 +309,9 @@
         arg,
         NULL);
     if (status != AE_OK) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 static ACPI_STATUS find_pci_configs_cb(
@@ -320,7 +320,7 @@
 
     size_t size_per_bus = PCI_CONFIG_SIZE *
                           PCIE_MAX_DEVICES_PER_BUS * PCIE_MAX_FUNCTIONS_PER_DEVICE;
-    mx_pci_init_arg_t* arg = (mx_pci_init_arg_t*)_ctx;
+    zx_pci_init_arg_t* arg = (zx_pci_init_arg_t*)_ctx;
 
     // TODO(cja): This is essentially a hacky solution to deal with
     // legacy PCI on Virtualbox and GCE. When the ACPI bus driver
@@ -345,9 +345,9 @@
  *
  * @param arg The structure to populate
  *
- * @return MX_OK on success.
+ * @return ZX_OK on success.
  */
-static mx_status_t find_pci_config(mx_pci_init_arg_t* arg) {
+static zx_status_t find_pci_config(zx_pci_init_arg_t* arg) {
     // TODO: Although this will find every PCI legacy root, we're presently
     // hardcoding to just use the first at bus 0 dev 0 func 0 segment 0.
     return AcpiGetDevices(PCI_HID, find_pci_configs_cb, arg, NULL);
@@ -359,44 +359,44 @@
  *
  * @param arg Pointer to store the initialization information into
  *
- * @return MX_OK on success
+ * @return ZX_OK on success
  */
-mx_status_t get_pci_init_arg(mx_pci_init_arg_t** arg, uint32_t* size) {
-    mx_pci_init_arg_t* res = NULL;
+zx_status_t get_pci_init_arg(zx_pci_init_arg_t** arg, uint32_t* size) {
+    zx_pci_init_arg_t* res = NULL;
 
     // TODO(teisenbe): We assume only one ECAM window right now...
     size_t obj_size = sizeof(*res) + sizeof(res->addr_windows[0]) * 1;
     res = calloc(1, obj_size);
     if (!res) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // First look for a PCIe root complex. If none is found, try legacy PCI.
     // This presently only cares about the first root found, multiple roots
     // will be handled when the PCI bus driver binds to roots via ACPI.
-    mx_status_t status = find_pcie_config(res);
-    if (status != MX_OK) {
+    zx_status_t status = find_pcie_config(res);
+    if (status != ZX_OK) {
         status = find_pci_config(res);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             goto fail;
         }
     }
 
     status = find_pci_legacy_irq_mapping(res);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
     *arg = res;
     *size = sizeof(*res) + sizeof(res->addr_windows[0]) * res->addr_window_count;
-    return MX_OK;
+    return ZX_OK;
 fail:
     free(res);
     return status;
 }
 
 struct report_current_resources_ctx {
-    mx_handle_t pci_handle;
+    zx_handle_t pci_handle;
     bool device_is_root_bridge;
     bool add_pass;
 };
@@ -411,8 +411,8 @@
 
     if (resource_is_memory(res)) {
         resource_memory_t mem;
-        mx_status_t status = resource_parse_memory(res, &mem);
-        if (status != MX_OK || mem.minimum != mem.maximum) {
+        zx_status_t status = resource_parse_memory(res, &mem);
+        if (status != ZX_OK || mem.minimum != mem.maximum) {
             return AE_ERROR;
         }
 
@@ -421,8 +421,8 @@
         len = mem.address_length;
     } else if (resource_is_address(res)) {
         resource_address_t addr;
-        mx_status_t status = resource_parse_address(res, &addr);
-        if (status != MX_OK) {
+        zx_status_t status = resource_parse_address(res, &addr);
+        if (status != ZX_OK) {
             return AE_ERROR;
         }
 
@@ -452,8 +452,8 @@
         }
     } else if (resource_is_io(res)) {
         resource_io_t io;
-        mx_status_t status = resource_parse_io(res, &io);
-        if (status != MX_OK) {
+        zx_status_t status = resource_parse_io(res, &io);
+        if (status != ZX_OK) {
             return AE_ERROR;
         }
 
@@ -485,9 +485,9 @@
     xprintf("ACPI range modification: %sing %s %016lx %016lx\n",
             add_range ? "add" : "subtract", is_mmio ? "MMIO" : "PIO", base, len);
 
-    mx_status_t status = mx_pci_add_subtract_io_range(
+    zx_status_t status = zx_pci_add_subtract_io_range(
             ctx->pci_handle, is_mmio, base, len, add_range);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         if (add_range) {
             xprintf("Failed to add range: %d\n", status);
         } else {
@@ -527,9 +527,9 @@
  * @param root_resource_handle The handle to pass to the kernel when talking
  * to the PCI driver.
  *
- * @return MX_OK on success
+ * @return ZX_OK on success
  */
-mx_status_t pci_report_current_resources(mx_handle_t root_resource_handle) {
+zx_status_t pci_report_current_resources(zx_handle_t root_resource_handle) {
     // First we search for resources to add, then we subtract out things that
     // are being consumed elsewhere.  This forces an ordering on the
     // operations so that it should be consistent, and should protect against
@@ -544,7 +544,7 @@
     };
     ACPI_STATUS status = AcpiGetDevices(NULL, report_current_resources_device_cb, &ctx, NULL);
     if (status != AE_OK) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     // Removes resources we believe are in use by other parts of the platform
@@ -555,9 +555,9 @@
     };
     status = AcpiGetDevices(NULL, report_current_resources_device_cb, &ctx, NULL);
     if (status != AE_OK) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/bus/acpi/pci.h b/system/dev/bus/acpi/pci.h
index 8791ee4..5362966 100644
--- a/system/dev/bus/acpi/pci.h
+++ b/system/dev/bus/acpi/pci.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/syscalls/pci.h>
+#include <zircon/syscalls/pci.h>
 
-mx_status_t get_pci_init_arg(mx_pci_init_arg_t** arg, uint32_t* size);
-mx_status_t pci_report_current_resources(mx_handle_t root_resource_handle);
+zx_status_t get_pci_init_arg(zx_pci_init_arg_t** arg, uint32_t* size);
+zx_status_t pci_report_current_resources(zx_handle_t root_resource_handle);
diff --git a/system/dev/bus/acpi/powerbtn.c b/system/dev/bus/acpi/powerbtn.c
index 7976a0a..7298770 100644
--- a/system/dev/bus/acpi/powerbtn.c
+++ b/system/dev/bus/acpi/powerbtn.c
@@ -8,7 +8,7 @@
 #include <threads.h>
 
 #include <acpica/acpi.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include "power.h"
 
@@ -19,8 +19,8 @@
  * this event and take action.
  */
 static uint32_t power_button_object_handler(void* ctx) {
-    mx_handle_t event = (mx_handle_t)(uintptr_t)ctx;
-    mx_object_signal(event, 0, MX_EVENT_SIGNALED);
+    zx_handle_t event = (zx_handle_t)(uintptr_t)ctx;
+    zx_object_signal(event, 0, ZX_EVENT_SIGNALED);
     // Note that the spec indicates to return 0. The code in the
     // Intel implementation (AcpiEvFixedEventDetect) reads differently.
     return ACPI_INTERRUPT_HANDLED;
@@ -36,7 +36,7 @@
         return;
     }
 
-    mx_handle_t event = (mx_handle_t)(uintptr_t)Context;
+    zx_handle_t event = (zx_handle_t)(uintptr_t)Context;
 
     // Handle powerbutton events via the notify interface
     bool power_btn = false;
@@ -53,21 +53,21 @@
     }
 
     if (power_btn) {
-        mx_object_signal(event, 0, MX_EVENT_SIGNALED);
+        zx_object_signal(event, 0, ZX_EVENT_SIGNALED);
     }
 
     ACPI_FREE(info);
 }
 
 static int power_button_thread(void* arg) {
-    mx_handle_t event = (mx_handle_t)(uintptr_t)arg;
+    zx_handle_t event = (zx_handle_t)(uintptr_t)arg;
 
     for (;;) {
-        mx_status_t status = mx_object_wait_one(event,
-                                                MX_EVENT_SIGNALED,
-                                                MX_TIME_INFINITE,
+        zx_status_t status = zx_object_wait_one(event,
+                                                ZX_EVENT_SIGNALED,
+                                                ZX_TIME_INFINITE,
                                                 NULL);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             break;
         }
 
@@ -78,11 +78,11 @@
     return 0;
 }
 
-mx_status_t install_powerbtn_handlers(void) {
+zx_status_t install_powerbtn_handlers(void) {
     // Hacks to make the power button power off the machine
 
-    mx_handle_t power_button_event;
-    mx_status_t err = mx_event_create(0, &power_button_event);
+    zx_handle_t power_button_event;
+    zx_status_t err = zx_event_create(0, &power_button_event);
     if (err < 0) {
         return err;
     }
@@ -91,7 +91,7 @@
                                                       power_button_object_handler,
                                                       (void*)(uintptr_t)power_button_event);
     if (status != AE_OK) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     AcpiInstallNotifyHandler(ACPI_ROOT_OBJECT,
@@ -102,8 +102,8 @@
     thrd_t thread;
     int ret = thrd_create(&thread, power_button_thread, (void*)(uintptr_t)power_button_event);
     if (ret != thrd_success) {
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     }
     thrd_detach(thread);
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/bus/acpi/powerbtn.h b/system/dev/bus/acpi/powerbtn.h
index 8e78c50..c9830f7 100644
--- a/system/dev/bus/acpi/powerbtn.h
+++ b/system/dev/bus/acpi/powerbtn.h
@@ -4,6 +4,6 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
-mx_status_t install_powerbtn_handlers(void);
+zx_status_t install_powerbtn_handlers(void);
diff --git a/system/dev/bus/acpi/processor.c b/system/dev/bus/acpi/processor.c
index 0fc9b03..6b30453 100644
--- a/system/dev/bus/acpi/processor.c
+++ b/system/dev/bus/acpi/processor.c
@@ -11,8 +11,8 @@
 
 #include <acpica/acpi.h>
 #include <acpisvc/protocol.h>
-#include <magenta/syscalls.h>
-#include <mxio/dispatcher.h>
+#include <zircon/syscalls.h>
+#include <fdio/dispatcher.h>
 
 #include "pci.h"
 #include "power.h"
@@ -24,24 +24,24 @@
     // the namespace tree.
     ACPI_HANDLE ns_node;
     bool root_node;
-    mx_handle_t notify;    // event port
+    zx_handle_t notify;    // event port
     uint32_t event_mask;
     uint64_t event_key;
 } acpi_handle_ctx_t;
 
 // Command functions.  These should return an error only if the connection
 // should be aborted.  Otherwise they should send their own replies.
-static mx_status_t cmd_list_children(mx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
-static mx_status_t cmd_get_child_handle(mx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
-static mx_status_t cmd_get_pci_init_arg(mx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
-static mx_status_t cmd_s_state_transition(mx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
-static mx_status_t cmd_ps0(mx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
-static mx_status_t cmd_bst(mx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
-static mx_status_t cmd_bif(mx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
-static mx_status_t cmd_enable_event(mx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
-static mx_status_t cmd_new_connection(mx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
+static zx_status_t cmd_list_children(zx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
+static zx_status_t cmd_get_child_handle(zx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
+static zx_status_t cmd_get_pci_init_arg(zx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
+static zx_status_t cmd_s_state_transition(zx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
+static zx_status_t cmd_ps0(zx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
+static zx_status_t cmd_bst(zx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
+static zx_status_t cmd_bif(zx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
+static zx_status_t cmd_enable_event(zx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
+static zx_status_t cmd_new_connection(zx_handle_t h, acpi_handle_ctx_t* ctx, void* cmd);
 
-typedef mx_status_t (*cmd_handler_t)(mx_handle_t, acpi_handle_ctx_t*, void*);
+typedef zx_status_t (*cmd_handler_t)(zx_handle_t, acpi_handle_ctx_t*, void*);
 static const cmd_handler_t cmd_table[] = {
         [ACPI_CMD_LIST_CHILDREN] = cmd_list_children,
         [ACPI_CMD_GET_CHILD_HANDLE] = cmd_get_child_handle,
@@ -54,7 +54,7 @@
         [ACPI_CMD_NEW_CONNECTION] = cmd_new_connection,
 };
 
-static mx_status_t send_error(mx_handle_t h, uint32_t req_id, mx_status_t status);
+static zx_status_t send_error(zx_handle_t h, uint32_t req_id, zx_status_t status);
 
 static inline uint32_t acpi_event_type(uint16_t events) {
     if ((events & ACPI_EVENT_SYSTEM_NOTIFY) && (events & ACPI_EVENT_DEVICE_NOTIFY)) {
@@ -87,89 +87,89 @@
         .type = type,
         .arg = value,
     };
-    mx_port_queue(ctx->notify, &pkt, 0);
+    zx_port_queue(ctx->notify, &pkt, 0);
 }
 
-static mxio_dispatcher_t* dispatcher;
-static mx_status_t dispatch(mx_handle_t h, void* _ctx, void* cookie) {
+static fdio_dispatcher_t* dispatcher;
+static zx_status_t dispatch(zx_handle_t h, void* _ctx, void* cookie) {
     acpi_handle_ctx_t* ctx = _ctx;
 
     // Check if handle is closed
     if (h == 0) {
-        if (ctx->notify != MX_HANDLE_INVALID) {
+        if (ctx->notify != ZX_HANDLE_INVALID) {
             AcpiRemoveNotifyHandler(ctx->ns_node, acpi_event_type(ctx->event_mask), notify_handler);
-            mx_handle_close(ctx->notify);
+            zx_handle_close(ctx->notify);
         }
         free(ctx);
-        return MX_OK;
+        return ZX_OK;
     }
 
     uint32_t num_bytes = 0;
     uint32_t num_handles = 0;
-    mx_status_t status = mx_channel_read(h, 0, NULL, NULL, 0, 0, &num_bytes, &num_handles);
-    if (status == MX_ERR_BAD_STATE) {
+    zx_status_t status = zx_channel_read(h, 0, NULL, NULL, 0, 0, &num_bytes, &num_handles);
+    if (status == ZX_ERR_BAD_STATE) {
         return ERR_DISPATCHER_NO_WORK;
-    } else if (status != MX_ERR_BUFFER_TOO_SMALL ||
+    } else if (status != ZX_ERR_BUFFER_TOO_SMALL ||
                num_handles > 1 ||
                num_bytes > ACPI_MAX_REQUEST_SIZE) {
         // Trigger a close on our end
         return status;
     }
 
-    mx_handle_t cmd_handle = 0;
+    zx_handle_t cmd_handle = 0;
     uint8_t buf[ACPI_MAX_REQUEST_SIZE];
-    status = mx_channel_read(h, 0, buf, &cmd_handle, num_bytes,
+    status = zx_channel_read(h, 0, buf, &cmd_handle, num_bytes,
             num_handles, &num_bytes, &num_handles);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup;
     }
 
     // Validate we have at least a command header
     if (num_bytes < sizeof(acpi_cmd_hdr_t)) {
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
         goto cleanup;
     }
 
     acpi_cmd_hdr_t* hdr = (acpi_cmd_hdr_t*)buf;
     if (hdr->version != 0) {
-        status = send_error(h, hdr->request_id, MX_ERR_NOT_SUPPORTED);
+        status = send_error(h, hdr->request_id, ZX_ERR_NOT_SUPPORTED);
         goto cleanup;
     }
     if (hdr->len != num_bytes) {
-        status = send_error(h, hdr->request_id, MX_ERR_INVALID_ARGS);
+        status = send_error(h, hdr->request_id, ZX_ERR_INVALID_ARGS);
         goto cleanup;
     }
 
     // Dispatch the actual command
     if (hdr->cmd >= countof(cmd_table) || cmd_table[hdr->cmd] == NULL) {
-        status = send_error(h, hdr->request_id, MX_ERR_NOT_SUPPORTED);
+        status = send_error(h, hdr->request_id, ZX_ERR_NOT_SUPPORTED);
         goto cleanup;
     }
     if (hdr->cmd == ACPI_CMD_ENABLE_EVENT && num_handles == 0) {
-        status = send_error(h, hdr->request_id, MX_ERR_INVALID_ARGS);
+        status = send_error(h, hdr->request_id, ZX_ERR_INVALID_ARGS);
         goto cleanup;
     }
     if (num_handles > 0) {
         if (hdr->cmd == ACPI_CMD_NEW_CONNECTION) {
             acpi_handle_ctx_t* context = calloc(1, sizeof(acpi_handle_ctx_t));
             if (context == NULL) {
-                status = MX_ERR_NO_MEMORY;
+                status = ZX_ERR_NO_MEMORY;
                 goto cleanup;
             }
             context->root_node = ctx->root_node;
             context->ns_node = ctx->ns_node;
-            if ((status = mxio_dispatcher_add(dispatcher, cmd_handle, context, NULL)) < 0) {
+            if ((status = fdio_dispatcher_add(dispatcher, cmd_handle, context, NULL)) < 0) {
                 free(context);
                 goto cleanup;
             }
             acpi_rsp_hdr_t rsp;
-            rsp.status = MX_OK;
+            rsp.status = ZX_OK;
             rsp.len = sizeof(rsp);
             rsp.request_id = hdr->request_id;
-            return mx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
+            return zx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
         } else if (hdr->cmd == ACPI_CMD_ENABLE_EVENT) {
-            if (ctx->notify != MX_HANDLE_INVALID) {
-                status = MX_ERR_ALREADY_EXISTS;
+            if (ctx->notify != ZX_HANDLE_INVALID) {
+                status = ZX_ERR_ALREADY_EXISTS;
                 goto cleanup;
             }
             // Set the notify handle here because the command table doesn't accept a handle
@@ -177,7 +177,7 @@
             ctx->notify = cmd_handle;
             // Fall through to call the command table
         } else {
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             goto cleanup;
         }
     }
@@ -185,41 +185,41 @@
 
 cleanup:
     if (cmd_handle > 0) {
-        mx_handle_close(cmd_handle);
+        zx_handle_close(cmd_handle);
     }
     return status;
 }
 
 // Launch the main event loop
-mx_status_t begin_processing(mx_handle_t acpi_root) {
+zx_status_t begin_processing(zx_handle_t acpi_root) {
     acpi_handle_ctx_t* root_context = calloc(1, sizeof(acpi_handle_ctx_t));
     if (!root_context) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t status = MX_ERR_BAD_STATE;
+    zx_status_t status = ZX_ERR_BAD_STATE;
     ACPI_STATUS acpi_status = AcpiGetHandle(NULL,
                                             (char*)"\\_SB",
                                             &root_context->ns_node);
     if (acpi_status != AE_OK) {
-        status = MX_ERR_NOT_FOUND;
+        status = ZX_ERR_NOT_FOUND;
         goto fail;
     }
     root_context->root_node = true;
 
-    status = mxio_dispatcher_create(&dispatcher, dispatch);
-    if (status != MX_OK) {
+    status = fdio_dispatcher_create(&dispatcher, dispatch);
+    if (status != ZX_OK) {
         goto fail;
     }
 
-    status = mxio_dispatcher_add(dispatcher, acpi_root, root_context, NULL);
-    if (status != MX_OK) {
+    status = fdio_dispatcher_add(dispatcher, acpi_root, root_context, NULL);
+    if (status != ZX_OK) {
         goto fail;
     }
 
-    mxio_dispatcher_run(dispatcher);
-    // mxio_dispatcher_run should not return
-    return MX_ERR_BAD_STATE;
+    fdio_dispatcher_run(dispatcher);
+    // fdio_dispatcher_run should not return
+    return ZX_ERR_BAD_STATE;
 
 fail:
     free(root_context);
@@ -257,22 +257,22 @@
 }
 
 // Send an error response.
-static mx_status_t send_error(mx_handle_t h, uint32_t req_id, mx_status_t status) {
+static zx_status_t send_error(zx_handle_t h, uint32_t req_id, zx_status_t status) {
     acpi_rsp_hdr_t rsp = {
         .status = status,
         .len = sizeof(rsp),
         .request_id = req_id,
     };
 
-    return mx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
+    return zx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
 }
 
-static mx_status_t cmd_list_children(mx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
-    mx_status_t status = MX_OK;
+static zx_status_t cmd_list_children(zx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
+    zx_status_t status = ZX_OK;
 
     acpi_cmd_list_children_t* cmd = _cmd;
     if (cmd->hdr.len != sizeof(*cmd)) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INVALID_ARGS);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INVALID_ARGS);
     }
 
     // Begin by finding the number of children
@@ -285,7 +285,7 @@
             break;
         }
         if (acpi_status != AE_OK) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
         num_children++;
     }
@@ -295,10 +295,10 @@
     const uint32_t rsp_size = sizeof(*rsp) + sizeof(rsp->children[0]) * num_children;
     rsp = calloc(1, rsp_size);
     if (!rsp) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_NO_MEMORY);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_NO_MEMORY);
     }
 
-    rsp->hdr.status = MX_OK;
+    rsp->hdr.status = ZX_OK;
     rsp->hdr.len = rsp_size;
     rsp->hdr.request_id = cmd->hdr.request_id,
     rsp->num_children = num_children;
@@ -311,17 +311,17 @@
         if (acpi_status == AE_NOT_FOUND) {
             break;
         } else if (acpi_status != AE_OK) {
-            status = MX_ERR_BAD_STATE;
+            status = ZX_ERR_BAD_STATE;
             goto cleanup;
         }
 
         ACPI_DEVICE_INFO* info = NULL;
         acpi_status = AcpiGetObjectInfo(child, &info);
         if (acpi_status == AE_NO_MEMORY) {
-            status = send_error(h, cmd->hdr.request_id, MX_ERR_NO_MEMORY);
+            status = send_error(h, cmd->hdr.request_id, ZX_ERR_NO_MEMORY);
             goto cleanup;
         } else if (acpi_status != AE_OK) {
-            status = MX_ERR_BAD_STATE;
+            status = ZX_ERR_BAD_STATE;
             goto cleanup;
         }
 
@@ -369,23 +369,23 @@
 
     // Sanity check that we enumerated the same number as we started with
     if (num_children != rsp->num_children) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto cleanup;
     }
 
-    status = mx_channel_write(h, 0, rsp, rsp_size, NULL, 0);
+    status = zx_channel_write(h, 0, rsp, rsp_size, NULL, 0);
 
 cleanup:
     free(rsp);
     return status;
 }
 
-static mx_status_t cmd_get_child_handle(mx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
-    mx_status_t status = MX_OK;
+static zx_status_t cmd_get_child_handle(zx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
+    zx_status_t status = ZX_OK;
 
     acpi_cmd_get_child_handle_t* cmd = _cmd;
     if (cmd->hdr.len != sizeof(*cmd) || !is_valid_name(cmd->name)) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INVALID_ARGS);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INVALID_ARGS);
     }
 
     // Search for child
@@ -394,81 +394,81 @@
     ACPI_HANDLE child_ns_node;
     ACPI_STATUS acpi_status = AcpiGetHandle(ctx->ns_node, name, &child_ns_node);
     if (acpi_status != AE_OK) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_NOT_FOUND);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_NOT_FOUND);
     }
 
     // Build a context for the child handle
     acpi_handle_ctx_t* child_ctx = calloc(1, sizeof(*child_ctx));
     if (!child_ctx) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_NO_MEMORY);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_NO_MEMORY);
     }
     child_ctx->ns_node = child_ns_node;
     child_ctx->root_node = false;
 
-    mx_handle_t msg_pipe[2];
-    status = mx_channel_create(0, &msg_pipe[0], &msg_pipe[1]);
-    if (status != MX_OK) {
+    zx_handle_t msg_pipe[2];
+    status = zx_channel_create(0, &msg_pipe[0], &msg_pipe[1]);
+    if (status != ZX_OK) {
         free(child_ctx);
         return send_error(h, cmd->hdr.request_id, status);
     }
 
-    status = mxio_dispatcher_add(dispatcher, msg_pipe[1], child_ctx, NULL);
-    if (status != MX_OK) {
+    status = fdio_dispatcher_add(dispatcher, msg_pipe[1], child_ctx, NULL);
+    if (status != ZX_OK) {
         status = send_error(h, cmd->hdr.request_id, status);
         goto cleanup;
     }
 
     acpi_rsp_get_child_handle_t rsp = {
         .hdr = {
-            .status = MX_OK,
+            .status = ZX_OK,
             .len = sizeof(rsp),
             .request_id = cmd->hdr.request_id,
         },
     };
 
-    status = mx_channel_write(h, 0, &rsp, sizeof(rsp), msg_pipe, 1);
-    if (status != MX_OK) {
+    status = zx_channel_write(h, 0, &rsp, sizeof(rsp), msg_pipe, 1);
+    if (status != ZX_OK) {
         goto cleanup;
     }
 
-    return MX_OK;
+    return ZX_OK;
 cleanup:
-    mx_handle_close(msg_pipe[0]);
-    mx_handle_close(msg_pipe[1]);
+    zx_handle_close(msg_pipe[0]);
+    zx_handle_close(msg_pipe[1]);
     free(child_ctx);
     return status;
 }
 
-static mx_status_t cmd_get_pci_init_arg(mx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
-    mx_status_t status = MX_OK;
+static zx_status_t cmd_get_pci_init_arg(zx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
+    zx_status_t status = ZX_OK;
 
     acpi_cmd_get_pci_init_arg_t* cmd = _cmd;
     if (cmd->hdr.len != sizeof(*cmd)) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INVALID_ARGS);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INVALID_ARGS);
     }
 
     acpi_rsp_get_pci_init_arg_t* rsp = NULL;
 
-    mx_pci_init_arg_t* arg = NULL;
+    zx_pci_init_arg_t* arg = NULL;
     uint32_t arg_size;
     status = get_pci_init_arg(&arg, &arg_size);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return send_error(h, cmd->hdr.request_id, status);
     }
 
     uint32_t len = arg_size + offsetof(acpi_rsp_get_pci_init_arg_t, arg);
     rsp = malloc(len);
     if (!rsp) {
-        status = send_error(h, cmd->hdr.request_id, MX_ERR_NO_MEMORY);
+        status = send_error(h, cmd->hdr.request_id, ZX_ERR_NO_MEMORY);
         goto cleanup;
     }
 
-    rsp->hdr.status = MX_OK;
+    rsp->hdr.status = ZX_OK;
     rsp->hdr.len = len;
     rsp->hdr.request_id = cmd->hdr.request_id,
     memcpy(&rsp->arg, arg, arg_size);
 
-    status = mx_channel_write(h, 0, rsp, len, NULL, 0);
+    status = zx_channel_write(h, 0, rsp, len, NULL, 0);
 
 cleanup:
     free(arg);
@@ -476,14 +476,14 @@
     return status;
 }
 
-static mx_status_t cmd_s_state_transition(mx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
+static zx_status_t cmd_s_state_transition(zx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
     acpi_cmd_s_state_transition_t* cmd = _cmd;
     if (cmd->hdr.len != sizeof(*cmd)) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INVALID_ARGS);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INVALID_ARGS);
     }
 
     if (!ctx->root_node) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_ACCESS_DENIED);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_ACCESS_DENIED);
     }
 
     switch (cmd->target_state) {
@@ -495,19 +495,19 @@
         break;
     case ACPI_S_STATE_S3: // fall-through since suspend-to-RAM is not yet supported
     default:
-        return send_error(h, cmd->hdr.request_id, MX_ERR_NOT_SUPPORTED);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_NOT_SUPPORTED);
     }
-    return send_error(h, cmd->hdr.request_id, MX_ERR_INTERNAL);
+    return send_error(h, cmd->hdr.request_id, ZX_ERR_INTERNAL);
 }
 
-static mx_status_t cmd_ps0(mx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
+static zx_status_t cmd_ps0(zx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
     acpi_cmd_ps0_t* cmd = _cmd;
     if (cmd->hdr.len != sizeof(*cmd)) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INVALID_ARGS);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INVALID_ARGS);
     }
 
     if (!ctx->root_node) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_ACCESS_DENIED);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_ACCESS_DENIED);
     }
 
     cmd->name[sizeof(cmd->name) - 1] = '\0';
@@ -515,58 +515,58 @@
     ACPI_STATUS status = AcpiGetHandle(NULL, cmd->name, &dev);
     if (status != AE_OK) {
         printf("Failed to find path %s\n", cmd->name);
-        return send_error(h, cmd->hdr.request_id, MX_ERR_NOT_FOUND);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_NOT_FOUND);
     }
 
     status = AcpiEvaluateObject(dev, (char*)"_PS0", NULL, NULL);
     if (status != AE_OK) {
         printf("Failed to find object's PS0 method\n");
-        return send_error(h, cmd->hdr.request_id, MX_ERR_NOT_FOUND);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_NOT_FOUND);
     }
 
     acpi_rsp_ps0_t rsp = {
         .hdr = {
-            .status = MX_OK,
+            .status = ZX_OK,
             .len = sizeof(rsp),
             .request_id = cmd->hdr.request_id,
         },
     };
 
-    return mx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
+    return zx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
 }
 
-static mx_status_t cmd_bst(mx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
+static zx_status_t cmd_bst(zx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
     acpi_cmd_bst_t* cmd = _cmd;
     if (cmd->hdr.len != sizeof(*cmd)) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INVALID_ARGS);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INVALID_ARGS);
     }
 
     ACPI_BUFFER buffer = {
         .Length = ACPI_ALLOCATE_BUFFER,
         .Pointer = NULL,
     };
-    mx_status_t status = AcpiEvaluateObject(ctx->ns_node, (char*)"_BST", NULL, &buffer);
+    zx_status_t status = AcpiEvaluateObject(ctx->ns_node, (char*)"_BST", NULL, &buffer);
     if (status != AE_OK) {
         printf("Failed to find object's BST method\n");
-        return send_error(h, cmd->hdr.request_id, MX_ERR_NOT_FOUND);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_NOT_FOUND);
     }
 
     ACPI_OBJECT* obj = (ACPI_OBJECT*)buffer.Pointer;
     if (obj->Type != ACPI_TYPE_PACKAGE || obj->Package.Count != 4) {
         ACPI_FREE(obj);
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INTERNAL);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INTERNAL);
     }
     ACPI_OBJECT* elem = obj->Package.Elements;
     for (int i = 0; i < 4; i++) {
         if (elem[i].Type != ACPI_TYPE_INTEGER) {
             ACPI_FREE(obj);
-            return send_error(h, cmd->hdr.request_id, MX_ERR_INTERNAL);
+            return send_error(h, cmd->hdr.request_id, ZX_ERR_INTERNAL);
         }
     }
 
     acpi_rsp_bst_t rsp = {
         .hdr = {
-            .status = MX_OK,
+            .status = ZX_OK,
             .len = sizeof(rsp),
             .request_id = cmd->hdr.request_id,
         },
@@ -577,47 +577,47 @@
     };
     ACPI_FREE(obj);
 
-    return mx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
+    return zx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
 }
 
-static mx_status_t cmd_bif(mx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
+static zx_status_t cmd_bif(zx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
     acpi_cmd_bif_t* cmd = _cmd;
     if (cmd->hdr.len != sizeof(*cmd)) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INVALID_ARGS);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INVALID_ARGS);
     }
 
     ACPI_BUFFER buffer = {
         .Length = ACPI_ALLOCATE_BUFFER,
         .Pointer = NULL,
     };
-    mx_status_t status = AcpiEvaluateObject(ctx->ns_node, (char*)"_BIF", NULL, &buffer);
+    zx_status_t status = AcpiEvaluateObject(ctx->ns_node, (char*)"_BIF", NULL, &buffer);
     if (status != AE_OK) {
         printf("Failed to find object's BIF method\n");
-        return send_error(h, cmd->hdr.request_id, MX_ERR_NOT_FOUND);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_NOT_FOUND);
     }
 
     ACPI_OBJECT* obj = (ACPI_OBJECT*)buffer.Pointer;
     if (obj->Type != ACPI_TYPE_PACKAGE || obj->Package.Count != 13) {
         ACPI_FREE(obj);
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INTERNAL);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INTERNAL);
     }
     ACPI_OBJECT* elem = obj->Package.Elements;
     for (int i = 0; i < 9; i++) {
         if (elem[i].Type != ACPI_TYPE_INTEGER) {
             ACPI_FREE(obj);
-            return send_error(h, cmd->hdr.request_id, MX_ERR_INTERNAL);
+            return send_error(h, cmd->hdr.request_id, ZX_ERR_INTERNAL);
         }
     }
     for (int i = 9; i < 13; i++) {
         if (elem[i].Type != ACPI_TYPE_STRING) {
             ACPI_FREE(obj);
-            return send_error(h, cmd->hdr.request_id, MX_ERR_INTERNAL);
+            return send_error(h, cmd->hdr.request_id, ZX_ERR_INTERNAL);
         }
     }
 
     acpi_rsp_bif_t rsp = {
         .hdr = {
-            .status = MX_OK,
+            .status = ZX_OK,
             .len = sizeof(rsp),
             .request_id = cmd->hdr.request_id,
         },
@@ -641,23 +641,23 @@
     rsp.oem[sizeof(rsp.oem)-1] = '\0';
     ACPI_FREE(obj);
 
-    return mx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
+    return zx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
 }
 
-static mx_status_t cmd_enable_event(mx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
+static zx_status_t cmd_enable_event(zx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
     acpi_cmd_enable_event_t* cmd = _cmd;
     if (cmd->hdr.len != sizeof(*cmd)) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_INVALID_ARGS);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_INVALID_ARGS);
     }
 
-    if (ctx->notify == MX_HANDLE_INVALID) {
-        return send_error(h, cmd->hdr.request_id, MX_ERR_BAD_STATE);
+    if (ctx->notify == ZX_HANDLE_INVALID) {
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_BAD_STATE);
     }
 
     uint32_t type;
     if ((type = acpi_event_type(cmd->type)) == 0) {
         // FIXME(yky): other ACPI event types
-        return send_error(h, cmd->hdr.request_id, MX_ERR_NOT_SUPPORTED);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_NOT_SUPPORTED);
     }
 
     uint16_t old_mask = ctx->event_mask;
@@ -669,21 +669,21 @@
     if (acpi_status != AE_OK) {
         ctx->event_mask = old_mask;
         ctx->event_key = old_key;
-        return send_error(h, cmd->hdr.request_id, MX_ERR_BAD_STATE);
+        return send_error(h, cmd->hdr.request_id, ZX_ERR_BAD_STATE);
     }
 
     acpi_rsp_enable_event_t rsp = {
         .hdr = {
-            .status = MX_OK,
+            .status = ZX_OK,
             .len = sizeof(rsp),
             .request_id = cmd->hdr.request_id,
         },
     };
-    return mx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
+    return zx_channel_write(h, 0, &rsp, sizeof(rsp), NULL, 0);
 }
 
-static mx_status_t cmd_new_connection(mx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
+static zx_status_t cmd_new_connection(zx_handle_t h, acpi_handle_ctx_t* ctx, void* _cmd) {
     // if a handle was passed with this, as it should be
     // this command would have been handled without calling this function
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
diff --git a/system/dev/bus/acpi/processor.h b/system/dev/bus/acpi/processor.h
index 006ee16..c00e335 100644
--- a/system/dev/bus/acpi/processor.h
+++ b/system/dev/bus/acpi/processor.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 // Check if *buf* is a valid PNP or ACPI id.  *len* does not include a null byte
 bool is_pnp_acpi_id(char* buf, unsigned int len);
 
-mx_status_t begin_processing(mx_handle_t acpi_root);
+zx_status_t begin_processing(zx_handle_t acpi_root);
diff --git a/system/dev/bus/acpi/resources.c b/system/dev/bus/acpi/resources.c
index cb1e1da..c4e4c16 100644
--- a/system/dev/bus/acpi/resources.c
+++ b/system/dev/bus/acpi/resources.c
@@ -4,7 +4,7 @@
 
 #include "resources.h"
 
-mx_status_t resource_parse_memory(ACPI_RESOURCE* res, resource_memory_t* out) {
+zx_status_t resource_parse_memory(ACPI_RESOURCE* res, resource_memory_t* out) {
     switch (res->Type) {
         case ACPI_RESOURCE_TYPE_MEMORY24: {
             ACPI_RESOURCE_MEMORY24* m24 = &res->Data.Memory24;
@@ -33,10 +33,10 @@
             out->address_length = m32->AddressLength;
             break;
         }
-        default: return MX_ERR_INVALID_ARGS;
+        default: return ZX_ERR_INVALID_ARGS;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 #define EXTRACT_ADDRESS_FIELDS(src, out) do { \
@@ -51,7 +51,7 @@
             (out)->max_address_fixed = (src)->MaxAddressFixed; \
 } while (0)
 
-mx_status_t resource_parse_address(ACPI_RESOURCE* res, resource_address_t* out) {
+zx_status_t resource_parse_address(ACPI_RESOURCE* res, resource_address_t* out) {
     uint8_t resource_type;
     switch (res->Type) {
         case ACPI_RESOURCE_TYPE_ADDRESS16: {
@@ -78,7 +78,7 @@
             resource_type = a64->ResourceType;
             break;
         }
-        default: return MX_ERR_INVALID_ARGS;
+        default: return ZX_ERR_INVALID_ARGS;
     }
 
     switch (resource_type) {
@@ -88,10 +88,10 @@
         default: out->resource_type = RESOURCE_ADDRESS_UNKNOWN;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t resource_parse_io(ACPI_RESOURCE* res, resource_io_t* out) {
+zx_status_t resource_parse_io(ACPI_RESOURCE* res, resource_io_t* out) {
     switch (res->Type) {
         case ACPI_RESOURCE_TYPE_IO: {
             ACPI_RESOURCE_IO* io = &res->Data.Io;
@@ -111,8 +111,8 @@
             out->maximum = io->Address;
             break;
         }
-        default: return MX_ERR_INVALID_ARGS;
+        default: return ZX_ERR_INVALID_ARGS;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/bus/acpi/resources.h b/system/dev/bus/acpi/resources.h
index 50a98e8..751a292 100644
--- a/system/dev/bus/acpi/resources.h
+++ b/system/dev/bus/acpi/resources.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <acpica/acpi.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 enum resource_address_type {
     RESOURCE_ADDRESS_MEMORY,
@@ -67,6 +67,6 @@
             res->Type == ACPI_RESOURCE_TYPE_FIXED_IO;
 }
 
-mx_status_t resource_parse_memory(ACPI_RESOURCE* res, resource_memory_t* out);
-mx_status_t resource_parse_address(ACPI_RESOURCE* res, resource_address_t* out);
-mx_status_t resource_parse_io(ACPI_RESOURCE* res, resource_io_t* out);
+zx_status_t resource_parse_memory(ACPI_RESOURCE* res, resource_memory_t* out);
+zx_status_t resource_parse_address(ACPI_RESOURCE* res, resource_address_t* out);
+zx_status_t resource_parse_io(ACPI_RESOURCE* res, resource_io_t* out);
diff --git a/system/dev/bus/acpi/rules.mk b/system/dev/bus/acpi/rules.mk
index b13ee43..dad8a87 100644
--- a/system/dev/bus/acpi/rules.mk
+++ b/system/dev/bus/acpi/rules.mk
@@ -33,13 +33,13 @@
     system/ulib/ddk \
     system/ulib/acpisvc-client \
     third_party/ulib/acpica \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
 
 MODULE_LIBS := \
     system/ulib/driver \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
 
 else # !ARCH=x86
 
@@ -50,9 +50,9 @@
 MODULE_SRCS += $(LOCAL_DIR)/dummy.c
 
 MODULE_LIBS := \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
 
 endif # ARCH=x86
 
diff --git a/system/dev/bus/pci/kpci-private.h b/system/dev/bus/pci/kpci-private.h
index 9657c18..934f1fa 100644
--- a/system/dev/bus/pci/kpci-private.h
+++ b/system/dev/bus/pci/kpci-private.h
@@ -6,12 +6,12 @@
 
 #include <ddk/device.h>
 #include <ddk/binding.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 typedef struct kpci_device {
-    mx_device_t* mxdev;
-    mx_handle_t handle;
+    zx_device_t* mxdev;
+    zx_handle_t handle;
     uint32_t index;
-    mx_pcie_device_info_t info;
-    mx_device_prop_t props[8];
+    zx_pcie_device_info_t info;
+    zx_device_prop_t props[8];
 } kpci_device_t;
diff --git a/system/dev/bus/pci/kpci.c b/system/dev/bus/pci/kpci.c
index 4495c62..de07a95 100644
--- a/system/dev/bus/pci/kpci.c
+++ b/system/dev/bus/pci/kpci.c
@@ -9,13 +9,13 @@
 #include <ddk/protocol/platform-devices.h>
 
 #include <hw/pci.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include "kpci-private.h"
 
@@ -25,33 +25,33 @@
 
 static void kpci_release(void* ctx) {
     kpci_device_t* device = ctx;
-    if (device->handle != MX_HANDLE_INVALID) {
-        mx_handle_close(device->handle);
+    if (device->handle != ZX_HANDLE_INVALID) {
+        zx_handle_close(device->handle);
     }
     free(device);
 }
 
-static mx_protocol_device_t kpci_device_proto = {
+static zx_protocol_device_t kpci_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .release = kpci_release,
 };
 
 // initializes and optionally adds a new child device
 // device will be added if parent is not NULL
-static mx_status_t kpci_init_child(mx_device_t* parent, uint32_t index, bool save_handle,
-                                   mx_device_t** out) {
-    mx_pcie_device_info_t info;
-    mx_handle_t handle;
+static zx_status_t kpci_init_child(zx_device_t* parent, uint32_t index, bool save_handle,
+                                   zx_device_t** out) {
+    zx_pcie_device_info_t info;
+    zx_handle_t handle;
 
-    mx_status_t status = mx_pci_get_nth_device(get_root_resource(), index, &info, &handle);
-    if (status != MX_OK) {
+    zx_status_t status = zx_pci_get_nth_device(get_root_resource(), index, &info, &handle);
+    if (status != ZX_OK) {
         return status;
     }
 
     kpci_device_t* device = calloc(1, sizeof(kpci_device_t));
     if (!device) {
-        mx_handle_close(handle);
-        return MX_ERR_NO_MEMORY;
+        zx_handle_close(handle);
+        return ZX_ERR_NO_MEMORY;
     }
     memcpy(&device->info, &info, sizeof(info));
     if (save_handle) {
@@ -61,22 +61,22 @@
         // causes bus mastering on the device to be disabled via the dispatcher
         // dtor.  This causes problems for devices that the BIOS owns and a driver
         // needs to execute a protocol with the BIOS in order to claim ownership.
-        handle = MX_HANDLE_INVALID;
+        handle = ZX_HANDLE_INVALID;
     }
     device->index = index;
 
     char name[20];
     snprintf(name, sizeof(name), "%02x:%02x:%02x", info.bus_id, info.dev_id, info.func_id);
 
-    mx_device_prop_t device_props[] = {
-        (mx_device_prop_t){ BIND_PROTOCOL, 0, MX_PROTOCOL_PCI },
-        (mx_device_prop_t){ BIND_PCI_VID, 0, info.vendor_id },
-        (mx_device_prop_t){ BIND_PCI_DID, 0, info.device_id },
-        (mx_device_prop_t){ BIND_PCI_CLASS, 0, info.base_class },
-        (mx_device_prop_t){ BIND_PCI_SUBCLASS, 0, info.sub_class },
-        (mx_device_prop_t){ BIND_PCI_INTERFACE, 0, info.program_interface },
-        (mx_device_prop_t){ BIND_PCI_REVISION, 0, info.revision_id },
-        (mx_device_prop_t){ BIND_PCI_BDF_ADDR, 0, BIND_PCI_BDF_PACK(info.bus_id,
+    zx_device_prop_t device_props[] = {
+        (zx_device_prop_t){ BIND_PROTOCOL, 0, ZX_PROTOCOL_PCI },
+        (zx_device_prop_t){ BIND_PCI_VID, 0, info.vendor_id },
+        (zx_device_prop_t){ BIND_PCI_DID, 0, info.device_id },
+        (zx_device_prop_t){ BIND_PCI_CLASS, 0, info.base_class },
+        (zx_device_prop_t){ BIND_PCI_SUBCLASS, 0, info.sub_class },
+        (zx_device_prop_t){ BIND_PCI_INTERFACE, 0, info.program_interface },
+        (zx_device_prop_t){ BIND_PCI_REVISION, 0, info.revision_id },
+        (zx_device_prop_t){ BIND_PCI_BDF_ADDR, 0, BIND_PCI_BDF_PACK(info.bus_id,
                                                                     info.dev_id,
                                                                     info.func_id) },
     };
@@ -97,25 +97,25 @@
             .name = name,
             .ctx = device,
             .ops = &kpci_device_proto,
-            .proto_id = MX_PROTOCOL_PCI,
+            .proto_id = ZX_PROTOCOL_PCI,
             .proto_ops = &_pci_protocol,
             .props = device->props,
             .prop_count = countof(device->props),
             .busdev_args = busdev_args,
-            .rsrc = MX_HANDLE_INVALID,
+            .rsrc = ZX_HANDLE_INVALID,
             .flags = DEVICE_ADD_BUSDEV,
         };
 
         status = device_add(parent, &args, &device->mxdev);
     } else {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         *out = device->mxdev;
     } else {
-        if (handle != MX_HANDLE_INVALID) {
-            mx_handle_close(handle);
+        if (handle != ZX_HANDLE_INVALID) {
+            zx_handle_close(handle);
         }
         free(device);
     }
@@ -123,9 +123,9 @@
     return status;
 }
 
-static mx_status_t kpci_drv_bind(void* ctx, mx_device_t* parent, void** cookie) {
-    mx_status_t status;
-    mx_device_t* pcidev;
+static zx_status_t kpci_drv_bind(void* ctx, zx_device_t* parent, void** cookie) {
+    zx_status_t status;
+    zx_device_t* pcidev;
 
     device_add_args_t args = {
         .version = DEVICE_ADD_ARGS_VERSION,
@@ -138,36 +138,36 @@
         return status;
     }
     for (uint32_t index = 0;; index++) {
-        mx_device_t* dev;
+        zx_device_t* dev;
         // don't hang onto the PCI handle - we don't need it any more
-        if (kpci_init_child(pcidev, index, false, &dev) != MX_OK) {
+        if (kpci_init_child(pcidev, index, false, &dev) != ZX_OK) {
             break;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t kpci_drv_create(void* ctx, mx_device_t* parent,
-                                   const char* name, const char* args, mx_handle_t resource) {
-    if (resource != MX_HANDLE_INVALID) {
-        mx_handle_close(resource);
+static zx_status_t kpci_drv_create(void* ctx, zx_device_t* parent,
+                                   const char* name, const char* args, zx_handle_t resource) {
+    if (resource != ZX_HANDLE_INVALID) {
+        zx_handle_close(resource);
     }
     uint32_t index = strtoul(args, NULL, 10);
-    mx_device_t* dev;
+    zx_device_t* dev;
     return kpci_init_child(parent, index, true, &dev);
 }
 
-static mx_driver_ops_t kpci_driver_ops = {
+static zx_driver_ops_t kpci_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = kpci_drv_bind,
     .create = kpci_drv_create,
 };
 
-// TODO(voydanoff): mdi driver should publish a device with MX_PROTOCOL_PCIROOT
-MAGENTA_DRIVER_BEGIN(pci, kpci_driver_ops, "magenta", "0.1", 5)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_PCIROOT),
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PLATFORM_DEV),
+// TODO(voydanoff): mdi driver should publish a device with ZX_PROTOCOL_PCIROOT
+ZIRCON_DRIVER_BEGIN(pci, kpci_driver_ops, "zircon", "0.1", 5)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_PCIROOT),
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PLATFORM_DEV),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_VID, PDEV_VID_GENERIC),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_PID, PDEV_PID_GENERIC),
     BI_MATCH_IF(EQ, BIND_PLATFORM_DEV_DID, PDEV_DID_KPCI),
-MAGENTA_DRIVER_END(pci)
+ZIRCON_DRIVER_END(pci)
diff --git a/system/dev/bus/pci/protocol.c b/system/dev/bus/pci/protocol.c
index 3e53480..6b2d904 100644
--- a/system/dev/bus/pci/protocol.c
+++ b/system/dev/bus/pci/protocol.c
@@ -6,56 +6,56 @@
 
 #include <assert.h>
 #include <limits.h>
-#include <magenta/process.h>
+#include <zircon/process.h>
 
 #include "kpci-private.h"
 
-static mx_status_t kpci_enable_bus_master(void* ctx, bool enable) {
+static zx_status_t kpci_enable_bus_master(void* ctx, bool enable) {
     kpci_device_t* device = ctx;
-    return mx_pci_enable_bus_master(device->handle, enable);
+    return zx_pci_enable_bus_master(device->handle, enable);
 }
 
-static mx_status_t kpci_enable_pio(void* ctx, bool enable) {
+static zx_status_t kpci_enable_pio(void* ctx, bool enable) {
     kpci_device_t* device = ctx;
-    return mx_pci_enable_pio(device->handle, enable);
+    return zx_pci_enable_pio(device->handle, enable);
 }
 
-static mx_status_t kpci_reset_device(void* ctx) {
+static zx_status_t kpci_reset_device(void* ctx) {
     kpci_device_t* device = ctx;
-    return mx_pci_reset_device(device->handle);
+    return zx_pci_reset_device(device->handle);
 }
 
 // TODO(cja): Figure out how to handle passing PIO privileges to other
 // processes in the future when PCI is moved out of the kernel into
 // userspace.
-static mx_status_t do_resource_bookkeeping(mx_pci_resource_t* res) {
-    mx_status_t status;
+static zx_status_t do_resource_bookkeeping(zx_pci_resource_t* res) {
+    zx_status_t status;
 
     if (!res) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     switch(res->type) {
     case PCI_RESOURCE_TYPE_PIO:
 #if __x86_64__
             // x86 PIO space access requires permission in the I/O bitmap
-        status = mx_mmap_device_io(get_root_resource(), res->pio_addr, res->size);
+        status = zx_mmap_device_io(get_root_resource(), res->pio_addr, res->size);
 #else
-        status = MX_ERR_NOT_SUPPORTED;
+        status = ZX_ERR_NOT_SUPPORTED;
 #endif
         break;
     default:
-        status = MX_OK;
+        status = ZX_OK;
     }
 
     return status;
 }
 
-static mx_status_t pci_get_resource(void* ctx, uint32_t res_id, mx_pci_resource_t* out_res) {
-    mx_status_t status = MX_OK;
+static zx_status_t pci_get_resource(void* ctx, uint32_t res_id, zx_pci_resource_t* out_res) {
+    zx_status_t status = ZX_OK;
 
     if (!out_res || res_id >= PCI_RESOURCE_COUNT) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     kpci_device_t* device = ctx;
@@ -67,14 +67,14 @@
         case PCI_RESOURCE_BAR_3:
         case PCI_RESOURCE_BAR_4:
         case PCI_RESOURCE_BAR_5:
-            status = mx_pci_get_bar(device->handle, res_id, out_res);
+            status = zx_pci_get_bar(device->handle, res_id, out_res);
             break;
         case PCI_RESOURCE_CONFIG:
-            status = mx_pci_get_config(device->handle, out_res);
+            status = zx_pci_get_config(device->handle, out_res);
             break;
     }
 
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -87,36 +87,36 @@
 static_assert(PCI_RESOURCE_CONFIG > PCI_RESOURCE_BAR_5, "resource order in the enum is wrong");
 
 /* Get a resource from the pci bus driver and map for the driver. */
-static mx_status_t kpci_map_resource(void* ctx,
+static zx_status_t kpci_map_resource(void* ctx,
                                     uint32_t res_id,
-                                    mx_cache_policy_t cache_policy,
+                                    zx_cache_policy_t cache_policy,
                                     void** vaddr,
                                     size_t* size,
-                                    mx_handle_t* out_handle) {
+                                    zx_handle_t* out_handle) {
     if (!vaddr || !size || !out_handle) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_pci_resource_t resource;
-    mx_status_t status = pci_get_resource(ctx, res_id, &resource);
-    if (status != MX_OK) {
+    zx_pci_resource_t resource;
+    zx_status_t status = pci_get_resource(ctx, res_id, &resource);
+    if (status != ZX_OK) {
         return status;
     }
 
     // TODO(cja): PIO may be mappable on non-x86 architectures
     if (resource.type == PCI_RESOURCE_TYPE_PIO) {
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
 
-    uint32_t map_flags = MX_VM_FLAG_PERM_READ | MX_VM_FLAG_MAP_RANGE;
+    uint32_t map_flags = ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_MAP_RANGE;
     if (res_id <= PCI_RESOURCE_BAR_5) {
         // Writes to bar resources are allowed.
-        map_flags |= MX_VM_FLAG_PERM_WRITE;
+        map_flags |= ZX_VM_FLAG_PERM_WRITE;
 
         // Bar cache policy can be controlled by the driver.
-        status = mx_vmo_set_cache_policy(resource.mmio_handle, cache_policy);
-        if (status != MX_OK) {
-            mx_handle_close(resource.mmio_handle);
+        status = zx_vmo_set_cache_policy(resource.mmio_handle, cache_policy);
+        if (status != ZX_OK) {
+            zx_handle_close(resource.mmio_handle);
             return status;
         }
     }
@@ -124,12 +124,12 @@
     // Map the config/bar passed in. Mappings require PAGE_SIZE alignment for
     // both base and size
     void* vaddr_tmp;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, resource.mmio_handle, 0,
+    status = zx_vmar_map(zx_vmar_root_self(), 0, resource.mmio_handle, 0,
                             ROUNDUP(resource.size, PAGE_SIZE),
                             map_flags, (uintptr_t*)&vaddr_tmp);
 
-    if (status != MX_OK) {
-        mx_handle_close(resource.mmio_handle);
+    if (status != ZX_OK) {
+        zx_handle_close(resource.mmio_handle);
         return status;
     }
 
@@ -140,48 +140,48 @@
     return status;
 }
 
-static mx_status_t kpci_map_interrupt(void* ctx, int which_irq, mx_handle_t* out_handle) {
-    mx_status_t status = MX_OK;
+static zx_status_t kpci_map_interrupt(void* ctx, int which_irq, zx_handle_t* out_handle) {
+    zx_status_t status = ZX_OK;
 
     if (!out_handle) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     kpci_device_t* device = ctx;
-    if (device->handle == MX_HANDLE_INVALID) {
-        return MX_ERR_BAD_HANDLE;
+    if (device->handle == ZX_HANDLE_INVALID) {
+        return ZX_ERR_BAD_HANDLE;
     }
 
-    status = mx_pci_map_interrupt(device->handle, which_irq, out_handle);
-    if (status != MX_OK) {
-        *out_handle = MX_HANDLE_INVALID;
+    status = zx_pci_map_interrupt(device->handle, which_irq, out_handle);
+    if (status != ZX_OK) {
+        *out_handle = ZX_HANDLE_INVALID;
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t kpci_query_irq_mode_caps(void* ctx,
-                                           mx_pci_irq_mode_t mode,
+static zx_status_t kpci_query_irq_mode_caps(void* ctx,
+                                           zx_pci_irq_mode_t mode,
                                            uint32_t* out_max_irqs) {
     kpci_device_t* device = ctx;
-    return mx_pci_query_irq_mode_caps(device->handle, mode, out_max_irqs);
+    return zx_pci_query_irq_mode_caps(device->handle, mode, out_max_irqs);
 }
 
-static mx_status_t kpci_set_irq_mode(void* ctx, mx_pci_irq_mode_t mode,
+static zx_status_t kpci_set_irq_mode(void* ctx, zx_pci_irq_mode_t mode,
                                     uint32_t requested_irq_count) {
     kpci_device_t* device = ctx;
-    return mx_pci_set_irq_mode(device->handle, mode, requested_irq_count);
+    return zx_pci_set_irq_mode(device->handle, mode, requested_irq_count);
 }
 
-static mx_status_t kpci_get_device_info(void* ctx, mx_pcie_device_info_t* out_info) {
+static zx_status_t kpci_get_device_info(void* ctx, zx_pcie_device_info_t* out_info) {
     if (out_info == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     kpci_device_t* device = ctx;
     *out_info = device->info;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static pci_protocol_ops_t _pci_protocol = {
diff --git a/system/dev/bus/pci/rules.mk b/system/dev/bus/pci/rules.mk
index a65345b..cd3fcbc 100644
--- a/system/dev/bus/pci/rules.mk
+++ b/system/dev/bus/pci/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/bus/platform/platform-bus.c b/system/dev/bus/platform/platform-bus.c
index fe9a15c..b4f46cb 100644
--- a/system/dev/bus/platform/platform-bus.c
+++ b/system/dev/bus/platform/platform-bus.c
@@ -11,38 +11,38 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 #include <ddk/binding.h>
-#include <magenta/process.h>
+#include <zircon/process.h>
 
 #include "platform-bus.h"
 
 static void platform_bus_release_mdi(platform_bus_t* bus) {
     if (bus->mdi_addr) {
-        mx_vmar_unmap(mx_vmar_root_self(), bus->mdi_addr, bus->mdi_size);
+        zx_vmar_unmap(zx_vmar_root_self(), bus->mdi_addr, bus->mdi_size);
         bus->mdi_addr = 0;
     }
-    if (bus->mdi_handle != MX_HANDLE_INVALID) {
-        mx_handle_close(bus->mdi_handle);
-        bus->mdi_handle = MX_HANDLE_INVALID;
+    if (bus->mdi_handle != ZX_HANDLE_INVALID) {
+        zx_handle_close(bus->mdi_handle);
+        bus->mdi_handle = ZX_HANDLE_INVALID;
     }
 }
 
 static void platform_bus_add_gpios(platform_bus_t* bus) {
     mdi_node_ref_t  gpios, gpio_node, node;
-    if (mdi_find_node(&bus->bus_node, MDI_PLATFORM_BUS_GPIOS, &gpios) == MX_OK) {
+    if (mdi_find_node(&bus->bus_node, MDI_PLATFORM_BUS_GPIOS, &gpios) == ZX_OK) {
         mdi_each_child(&gpios, &gpio_node) {
             uint32_t start, count, mmio_index;
 
-            if (mdi_find_node(&gpio_node, MDI_PLATFORM_BUS_GPIOS_START, &node) != MX_OK) {
+            if (mdi_find_node(&gpio_node, MDI_PLATFORM_BUS_GPIOS_START, &node) != ZX_OK) {
                 printf("platform_bus_add_gpios: could not find MDI_PLATFORM_BUS_GPIOS_START\n");
                 continue;
             }
             mdi_node_uint32(&node, &start);
-            if (mdi_find_node(&gpio_node, MDI_PLATFORM_BUS_GPIOS_COUNT, &node) != MX_OK) {
+            if (mdi_find_node(&gpio_node, MDI_PLATFORM_BUS_GPIOS_COUNT, &node) != ZX_OK) {
                 printf("platform_bus_add_gpios: could not find MDI_PLATFORM_BUS_GPIOS_COUNT\n");
                 continue;
             }
             mdi_node_uint32(&node, &count);
-            if (mdi_find_node(&gpio_node, MDI_PLATFORM_BUS_GPIOS_MMIO_INDEX, &node) != MX_OK) {
+            if (mdi_find_node(&gpio_node, MDI_PLATFORM_BUS_GPIOS_MMIO_INDEX, &node) != ZX_OK) {
                 printf("platform_bus_add_gpios: could not find MDI_PLATFORM_BUS_GPIOS_MMIO_INDEX\n");
                 continue;
             }
@@ -50,7 +50,7 @@
 
             const uint32_t* irqs = NULL;
             uint32_t irq_count = 0;
-            if (mdi_find_node(&gpio_node, MDI_PLATFORM_IRQS, &node) == MX_OK) {
+            if (mdi_find_node(&gpio_node, MDI_PLATFORM_IRQS, &node) == ZX_OK) {
                 irqs = mdi_array_values(&node);
                 irq_count = mdi_array_length(&node);
             }
@@ -69,34 +69,34 @@
     }
 }
 
-mx_status_t platform_bus_set_interface(void* ctx, pbus_interface_t* interface) {
+zx_status_t platform_bus_set_interface(void* ctx, pbus_interface_t* interface) {
     if (!interface) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     platform_bus_t* bus = ctx;
     memcpy(&bus->interface, interface, sizeof(bus->interface));
 
     platform_bus_add_gpios(bus);
     platform_bus_publish_devices(bus);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t platform_bus_get_protocol(void* ctx, uint32_t proto_id, void* out) {
+static zx_status_t platform_bus_get_protocol(void* ctx, uint32_t proto_id, void* out) {
     platform_bus_t* bus = ctx;
 
     if (bus->interface.ops == NULL) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     return pbus_interface_get_protocol(&bus->interface, proto_id, out);
 }
 
-static mx_status_t platform_bus_map_mmio(void* ctx, uint32_t index, uint32_t cache_policy,
-                                         void** vaddr, size_t* size, mx_handle_t* out_handle) {
+static zx_status_t platform_bus_map_mmio(void* ctx, uint32_t index, uint32_t cache_policy,
+                                         void** vaddr, size_t* size, zx_handle_t* out_handle) {
     platform_bus_t* bus = ctx;
     return platform_map_mmio(&bus->resources, index, cache_policy, vaddr, size, out_handle);
 }
 
-static mx_status_t platform_bus_map_interrupt(void* ctx, uint32_t index, mx_handle_t* out_handle) {
+static zx_status_t platform_bus_map_interrupt(void* ctx, uint32_t index, zx_handle_t* out_handle) {
     platform_bus_t* bus = ctx;
     return platform_map_interrupt(&bus->resources, index, out_handle);
 }
@@ -116,56 +116,56 @@
     free(bus);
 }
 
-static mx_protocol_device_t platform_bus_proto = {
+static zx_protocol_device_t platform_bus_proto = {
     .version = DEVICE_OPS_VERSION,
     .release = platform_bus_release,
 };
 
-static mx_status_t platform_bus_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t platform_bus_bind(void* ctx, zx_device_t* parent, void** cookie) {
     platform_bus_t* bus = NULL;
 
-    mx_handle_t mdi_handle = device_get_resource(parent);
-    if (mdi_handle == MX_HANDLE_INVALID) {
+    zx_handle_t mdi_handle = device_get_resource(parent);
+    if (mdi_handle == ZX_HANDLE_INVALID) {
         printf("platform_bus_bind: mdi_handle invalid\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uintptr_t mdi_addr = 0;
     size_t mdi_size = 0;
-    mx_status_t status = mx_vmo_get_size(mdi_handle, &mdi_size);
-    if (status != MX_OK) {
-        printf("platform_bus_bind: mx_vmo_get_size failed %d\n", status);
+    zx_status_t status = zx_vmo_get_size(mdi_handle, &mdi_size);
+    if (status != ZX_OK) {
+        printf("platform_bus_bind: zx_vmo_get_size failed %d\n", status);
         goto fail;
     }
 
-    status = mx_vmar_map(mx_vmar_root_self(), 0, mdi_handle, 0, mdi_size,
-                         MX_VM_FLAG_PERM_READ, &mdi_addr);
-    if (status != MX_OK) {
-        printf("platform_bus_bind: mx_vmar_map failed %d\n", status);
+    status = zx_vmar_map(zx_vmar_root_self(), 0, mdi_handle, 0, mdi_size,
+                         ZX_VM_FLAG_PERM_READ, &mdi_addr);
+    if (status != ZX_OK) {
+        printf("platform_bus_bind: zx_vmar_map failed %d\n", status);
         goto fail;
     }
 
     mdi_node_ref_t root_node;
     status = mdi_init((void *)mdi_addr, mdi_size, &root_node);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("platform_bus_bind: mdi_init failed %d\n", status);
         goto fail;
     }
 
     mdi_node_ref_t  platform_node, bus_node;
-    if (mdi_find_node(&root_node, MDI_PLATFORM, &platform_node) != MX_OK) {
+    if (mdi_find_node(&root_node, MDI_PLATFORM, &platform_node) != ZX_OK) {
         printf("platform_bus_bind: couldn't find MDI_PLATFORM\n");
         goto fail;
     }
 
     mdi_node_ref_t  node;
     uint32_t vid, pid;
-    if (mdi_find_node(&platform_node, MDI_PLATFORM_VID, &node) != MX_OK) {
+    if (mdi_find_node(&platform_node, MDI_PLATFORM_VID, &node) != ZX_OK) {
         printf("platform_bus_bind: couldn't find MDI_PLATFORM_VID\n");
         goto fail;
     }
     mdi_node_uint32(&node, &vid);
-    if (mdi_find_node(&platform_node, MDI_PLATFORM_PID, &node) != MX_OK) {
+    if (mdi_find_node(&platform_node, MDI_PLATFORM_PID, &node) != ZX_OK) {
         printf("platform_bus_bind: couldn't find MDI_PLATFORM_PID\n");
         goto fail;
     }
@@ -175,13 +175,13 @@
     uint32_t mmio_count = 0;
     uint32_t irq_count = 0;
     bool has_platform_bus_node = false;
-    if (mdi_find_node(&platform_node, MDI_PLATFORM_BUS, &bus_node) == MX_OK) {
+    if (mdi_find_node(&platform_node, MDI_PLATFORM_BUS, &bus_node) == ZX_OK) {
         has_platform_bus_node = true;
 
-        if (mdi_find_node(&bus_node, MDI_PLATFORM_MMIOS, &node) == MX_OK) {
+        if (mdi_find_node(&bus_node, MDI_PLATFORM_MMIOS, &node) == ZX_OK) {
             mmio_count = mdi_child_count(&node);
         }
-        if (mdi_find_node(&bus_node, MDI_PLATFORM_IRQS, &node) == MX_OK) {
+        if (mdi_find_node(&bus_node, MDI_PLATFORM_IRQS, &node) == ZX_OK) {
             irq_count = mdi_array_length(&node);
         }
      }
@@ -189,7 +189,7 @@
     bus = calloc(1, sizeof(platform_bus_t) + mmio_count * sizeof(platform_mmio_t)
                  + irq_count * sizeof(platform_irq_t));
     if (!bus) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto fail;
     }
 
@@ -205,13 +205,13 @@
 
     platform_init_resources(&bus->resources, mmio_count, irq_count);
     if (mmio_count || irq_count) {
-        mx_status_t status = platform_add_resources(bus, &bus->resources, &bus_node);
-        if (status != MX_OK) {
+        zx_status_t status = platform_add_resources(bus, &bus->resources, &bus_node);
+        if (status != ZX_OK) {
             goto fail;
         }
     }
 
-    mx_device_prop_t props[] = {
+    zx_device_prop_t props[] = {
         {BIND_PLATFORM_DEV_VID, 0, bus->vid},
         {BIND_PLATFORM_DEV_PID, 0, bus->pid},
         {BIND_PLATFORM_DEV_DID, 0, PDEV_BUS_IMPLEMENTOR_DID},
@@ -222,14 +222,14 @@
         .name = "platform-bus",
         .ctx = bus,
         .ops = &platform_bus_proto,
-        .proto_id = MX_PROTOCOL_PLATFORM_DEV,
+        .proto_id = ZX_PROTOCOL_PLATFORM_DEV,
         .proto_ops = &platform_bus_proto_ops,
         .props = props,
         .prop_count = countof(props),
     };
 
     status = device_add(parent, &add_args, &bus->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
@@ -238,24 +238,24 @@
         platform_bus_publish_devices(bus);
     }
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     if (mdi_addr) {
-        mx_vmar_unmap(mx_vmar_root_self(), mdi_addr, mdi_size);
+        zx_vmar_unmap(zx_vmar_root_self(), mdi_addr, mdi_size);
     }
-    mx_handle_close(mdi_handle);
+    zx_handle_close(mdi_handle);
     free(bus);
 
     return status;
 }
 
-static mx_driver_ops_t platform_bus_driver_ops = {
+static zx_driver_ops_t platform_bus_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = platform_bus_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(platform_bus, platform_bus_driver_ops, "magenta", "0.1", 1)
+ZIRCON_DRIVER_BEGIN(platform_bus, platform_bus_driver_ops, "zircon", "0.1", 1)
     // devmgr loads us directly, so we need no binding information here
     BI_ABORT_IF_AUTOBIND,
-MAGENTA_DRIVER_END(platform_bus)
+ZIRCON_DRIVER_END(platform_bus)
diff --git a/system/dev/bus/platform/platform-bus.h b/system/dev/bus/platform/platform-bus.h
index c8b45af..1cb8a73 100644
--- a/system/dev/bus/platform/platform-bus.h
+++ b/system/dev/bus/platform/platform-bus.h
@@ -9,19 +9,19 @@
 #include <ddk/protocol/platform-device.h>
 #include <mdi/mdi.h>
 #include <mdi/mdi-defs.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 // represents an MMIO resource
 typedef struct {
-    mx_paddr_t base;
+    zx_paddr_t base;
     size_t length;
-    mx_handle_t resource;
+    zx_handle_t resource;
 } platform_mmio_t;
 
 // represents an IRQ resource
 typedef struct {
     uint32_t irq;
-    mx_handle_t resource;
+    zx_handle_t resource;
 } platform_irq_t;
 
 // collection of resources, embedded in both the platform_bus_t and platform_dev_t structs
@@ -35,14 +35,14 @@
 
 // context structure for the platform bus
 typedef struct {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     pbus_interface_t interface;
-    mx_handle_t resource;   // root resource for platform bus
+    zx_handle_t resource;   // root resource for platform bus
     mdi_node_ref_t  platform_node;
     mdi_node_ref_t  bus_node;
     uintptr_t mdi_addr;
     size_t mdi_size;
-    mx_handle_t mdi_handle;
+    zx_handle_t mdi_handle;
     uint32_t vid;
     uint32_t pid;
     // resources must be last
@@ -51,23 +51,23 @@
 
 // context structure for a platform device
 typedef struct {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     platform_bus_t* bus;
     // resources must be last
     platform_resources_t resources;
 } platform_dev_t;
 
 // platform-device.c
-mx_status_t platform_bus_publish_device(platform_bus_t* bus, mdi_node_ref_t* device_node);
+zx_status_t platform_bus_publish_device(platform_bus_t* bus, mdi_node_ref_t* device_node);
 
 // platform-resources.c
 void platform_release_resources(platform_resources_t* resources);
-mx_status_t platform_map_mmio(platform_resources_t* resources, uint32_t index,
+zx_status_t platform_map_mmio(platform_resources_t* resources, uint32_t index,
                               uint32_t cache_policy, void** vaddr, size_t* size,
-                                     mx_handle_t* out_handle);
-mx_status_t platform_map_interrupt(platform_resources_t* resources, uint32_t index,
-                                   mx_handle_t* out_handle);
+                                     zx_handle_t* out_handle);
+zx_status_t platform_map_interrupt(platform_resources_t* resources, uint32_t index,
+                                   zx_handle_t* out_handle);
 void platform_init_resources(platform_resources_t* resources, uint32_t mmio_count,
                              uint32_t irq_count);
-mx_status_t platform_add_resources(platform_bus_t* bus, platform_resources_t* resources,
+zx_status_t platform_add_resources(platform_bus_t* bus, platform_resources_t* resources,
                                    mdi_node_ref_t* node);
diff --git a/system/dev/bus/platform/platform-device.c b/system/dev/bus/platform/platform-device.c
index cbebafa..d5f4150 100644
--- a/system/dev/bus/platform/platform-device.c
+++ b/system/dev/bus/platform/platform-device.c
@@ -12,27 +12,27 @@
 
 #include "platform-bus.h"
 
-mx_status_t platform_dev_set_interface(void* ctx, pbus_interface_t* interface) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t platform_dev_set_interface(void* ctx, pbus_interface_t* interface) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t platform_dev_get_protocol(void* ctx, uint32_t proto_id, void* out) {
+static zx_status_t platform_dev_get_protocol(void* ctx, uint32_t proto_id, void* out) {
     platform_dev_t* pdev = ctx;
     platform_bus_t* bus = pdev->bus;
 
     if (bus->interface.ops == NULL) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     return pbus_interface_get_protocol(&bus->interface, proto_id, out);
 }
 
-static mx_status_t platform_dev_map_mmio(void* ctx, uint32_t index, uint32_t cache_policy,
-                                         void** vaddr, size_t* size, mx_handle_t* out_handle) {
+static zx_status_t platform_dev_map_mmio(void* ctx, uint32_t index, uint32_t cache_policy,
+                                         void** vaddr, size_t* size, zx_handle_t* out_handle) {
     platform_dev_t* pdev = ctx;
     return platform_map_mmio(&pdev->resources, index, cache_policy, vaddr, size, out_handle);
 }
 
-static mx_status_t platform_dev_map_interrupt(void* ctx, uint32_t index, mx_handle_t* out_handle) {
+static zx_status_t platform_dev_map_interrupt(void* ctx, uint32_t index, zx_handle_t* out_handle) {
     platform_dev_t* pdev = ctx;
     return platform_map_interrupt(&pdev->resources, index, out_handle);
 }
@@ -51,12 +51,12 @@
     free(dev);
 }
 
-static mx_protocol_device_t platform_dev_proto = {
+static zx_protocol_device_t platform_dev_proto = {
     .version = DEVICE_OPS_VERSION,
     .release = platform_dev_release,
 };
 
-mx_status_t platform_bus_publish_device(platform_bus_t* bus, mdi_node_ref_t* device_node) {
+zx_status_t platform_bus_publish_device(platform_bus_t* bus, mdi_node_ref_t* device_node) {
     uint32_t vid = bus->vid;
     uint32_t pid = bus->pid;
     uint32_t did = 0;
@@ -91,30 +91,30 @@
 
     if (!name || !did) {
         printf("platform_bus_publish_device: missing name or did\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (did == PDEV_BUS_IMPLEMENTOR_DID) {
         printf("platform_bus_publish_device: PDEV_BUS_IMPLEMENTOR_DID not allowed\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     platform_dev_t* dev = calloc(1, sizeof(platform_dev_t) + mmio_count * sizeof(platform_mmio_t)
                                  + irq_count * sizeof(platform_irq_t));
     if (!dev) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     dev->bus = bus;
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     platform_init_resources(&dev->resources, mmio_count, irq_count);
     if (mmio_count || irq_count) {
         status = platform_add_resources(bus, &dev->resources, device_node);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             goto fail;
         }
     }
 
-    mx_device_prop_t props[] = {
+    zx_device_prop_t props[] = {
         {BIND_PLATFORM_DEV_VID, 0, vid},
         {BIND_PLATFORM_DEV_PID, 0, pid},
         {BIND_PLATFORM_DEV_DID, 0, did},
@@ -125,7 +125,7 @@
         .name = name,
         .ctx = dev,
         .ops = &platform_dev_proto,
-        .proto_id = MX_PROTOCOL_PLATFORM_DEV,
+        .proto_id = ZX_PROTOCOL_PLATFORM_DEV,
         .proto_ops = &platform_dev_proto_ops,
         .props = props,
         .prop_count = countof(props),
@@ -134,7 +134,7 @@
     status = device_add(bus->mxdev, &args, &dev->mxdev);
 
 fail:
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         platform_dev_release(dev);
     }
 
diff --git a/system/dev/bus/platform/platform-resources.c b/system/dev/bus/platform/platform-resources.c
index 1f1ae1f..e02f51b 100644
--- a/system/dev/bus/platform/platform-resources.c
+++ b/system/dev/bus/platform/platform-resources.c
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/process.h>
-#include <magenta/syscalls/resource.h>
+#include <zircon/process.h>
+#include <zircon/syscalls/resource.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -12,70 +12,70 @@
 
 void platform_release_resources(platform_resources_t* resources) {
     for (uint32_t i = 0; i < resources->mmio_count; i++) {
-        mx_handle_close(resources->mmios[i].resource);
+        zx_handle_close(resources->mmios[i].resource);
     }
     for (uint32_t i = 0; i < resources->irq_count; i++) {
-        mx_handle_close(resources->irqs[i].resource);
+        zx_handle_close(resources->irqs[i].resource);
     }
 }
 
-mx_status_t platform_map_mmio(platform_resources_t* resources, uint32_t index,
+zx_status_t platform_map_mmio(platform_resources_t* resources, uint32_t index,
                               uint32_t cache_policy, void** vaddr, size_t* size,
-                              mx_handle_t* out_handle) {
+                              zx_handle_t* out_handle) {
     if (index >= resources->mmio_count) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     platform_mmio_t* mmio = &resources->mmios[index];
-    mx_handle_t vmo_handle;
-    mx_status_t status = mx_vmo_create_physical(mmio->resource, mmio->base, mmio->length,
+    zx_handle_t vmo_handle;
+    zx_status_t status = zx_vmo_create_physical(mmio->resource, mmio->base, mmio->length,
                                                 &vmo_handle);
-    if (status != MX_OK) {
-        printf("platform_dev_map_mmio: mx_vmo_create_physical failed %d\n", status);
+    if (status != ZX_OK) {
+        printf("platform_dev_map_mmio: zx_vmo_create_physical failed %d\n", status);
         return status;
     }
 
     size_t vmo_size;
-    status = mx_vmo_get_size(vmo_handle, &vmo_size);
-    if (status != MX_OK) {
-        printf("platform_dev_map_mmio: mx_vmo_get_size failed %d\n", status);
+    status = zx_vmo_get_size(vmo_handle, &vmo_size);
+    if (status != ZX_OK) {
+        printf("platform_dev_map_mmio: zx_vmo_get_size failed %d\n", status);
         goto fail;
     }
 
-    status = mx_vmo_set_cache_policy(vmo_handle, cache_policy);
-    if (status != MX_OK) {
-        printf("platform_dev_map_mmio: mx_vmo_set_cache_policy failed %d\n", status);
+    status = zx_vmo_set_cache_policy(vmo_handle, cache_policy);
+    if (status != ZX_OK) {
+        printf("platform_dev_map_mmio: zx_vmo_set_cache_policy failed %d\n", status);
         goto fail;
     }
 
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo_handle, 0, vmo_size,
-                         MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_MAP_RANGE,
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo_handle, 0, vmo_size,
+                         ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_MAP_RANGE,
                          (uintptr_t*)vaddr);
-    if (status != MX_OK) {
-        printf("platform_dev_map_mmio: mx_vmar_map failed %d\n", status);
+    if (status != ZX_OK) {
+        printf("platform_dev_map_mmio: zx_vmar_map failed %d\n", status);
         goto fail;
     }
 
     *size = vmo_size;
     *out_handle = vmo_handle;
-    return MX_OK;
+    return ZX_OK;
 
 fail:
-    mx_handle_close(vmo_handle);
+    zx_handle_close(vmo_handle);
     return status;
 }
 
-mx_status_t platform_map_interrupt(platform_resources_t* resources, uint32_t index,
-                                   mx_handle_t* out_handle) {
+zx_status_t platform_map_interrupt(platform_resources_t* resources, uint32_t index,
+                                   zx_handle_t* out_handle) {
     if (index >= resources->irq_count || !out_handle) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     platform_irq_t* irq = &resources->irqs[index];
 
-    return mx_interrupt_create(irq->resource, irq->irq, MX_FLAG_REMAP_IRQ, out_handle);
+    return zx_interrupt_create(irq->resource, irq->irq, ZX_FLAG_REMAP_IRQ, out_handle);
 }
 
-static mx_status_t platform_add_mmios(platform_bus_t* bus, mdi_node_ref_t* list_node,
+static zx_status_t platform_add_mmios(platform_bus_t* bus, mdi_node_ref_t* list_node,
                                       platform_resources_t* resources) {
     mdi_node_ref_t node;
     platform_mmio_t* mmios = resources->mmios;
@@ -97,44 +97,44 @@
 
         if (!base || !length) {
             printf("platform_add_mmios: missing base or length\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         mmios->base = base;
         mmios->length = length;
-        mx_status_t status = mx_resource_create(bus->resource, MX_RSRC_KIND_MMIO, base,
+        zx_status_t status = zx_resource_create(bus->resource, ZX_RSRC_KIND_MMIO, base,
                                                 base + length - 1, &mmios->resource);
-        if (status != MX_OK) {
-            printf("platform_add_mmios: mx_resource_create failed %d\n", status);
+        if (status != ZX_OK) {
+            printf("platform_add_mmios: zx_resource_create failed %d\n", status);
             return status;
         }
         mmios++;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t platform_add_irqs(platform_bus_t* bus, mdi_node_ref_t* array_node,
+static zx_status_t platform_add_irqs(platform_bus_t* bus, mdi_node_ref_t* array_node,
                                      platform_resources_t* resources) {
     uint32_t count = mdi_array_length(array_node);
     platform_irq_t* irqs = resources->irqs;
 
     for (uint32_t i = 0; i < count; i++) {
         uint32_t irq;
-        mx_status_t status = mdi_array_uint32(array_node, i, &irq);
-        if (status != MX_OK) {
+        zx_status_t status = mdi_array_uint32(array_node, i, &irq);
+        if (status != ZX_OK) {
             return status;
         }
         irqs->irq = irq;
-        status = mx_resource_create(bus->resource, MX_RSRC_KIND_IRQ, irq, irq, &irqs->resource);
-        if (status != MX_OK) {
-            printf("platform_add_irqs: mx_resource_create failed %d\n", status);
+        status = zx_resource_create(bus->resource, ZX_RSRC_KIND_IRQ, irq, irq, &irqs->resource);
+        if (status != ZX_OK) {
+            printf("platform_add_irqs: zx_resource_create failed %d\n", status);
             return status;
         }
         irqs++;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void platform_init_resources(platform_resources_t* resources, uint32_t mmio_count,
@@ -154,25 +154,25 @@
     }
 }
 
-mx_status_t platform_add_resources(platform_bus_t* bus, platform_resources_t* resources,
+zx_status_t platform_add_resources(platform_bus_t* bus, platform_resources_t* resources,
                                    mdi_node_ref_t* node) {
     mdi_node_ref_t child;
-    mx_status_t status;
+    zx_status_t status;
 
     mdi_each_child(node, &child) {
         switch (mdi_id(&child)) {
         case MDI_PLATFORM_MMIOS:
-            if ((status = platform_add_mmios(bus, &child, resources)) != MX_OK) {
+            if ((status = platform_add_mmios(bus, &child, resources)) != ZX_OK) {
                 return status;
             }
             break;
         case MDI_PLATFORM_IRQS:
-            if ((status = platform_add_irqs(bus, &child, resources)) != MX_OK) {
+            if ((status = platform_add_irqs(bus, &child, resources)) != ZX_OK) {
                 return status;
             }
             break;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/bus/platform/rules.mk b/system/dev/bus/platform/rules.mk
index f7f7880..cb727a3 100644
--- a/system/dev/bus/platform/rules.mk
+++ b/system/dev/bus/platform/rules.mk
@@ -17,6 +17,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/mdi system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/mdi system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/bus/virtio/block.cpp b/system/dev/bus/virtio/block.cpp
index 6284e4c..110dcdd 100644
--- a/system/dev/bus/virtio/block.cpp
+++ b/system/dev/bus/virtio/block.cpp
@@ -6,7 +6,7 @@
 
 #include <ddk/protocol/block.h>
 #include <inttypes.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/algorithm.h>
 #include <fbl/auto_lock.h>
 #include <pretty/hexdump.h>
@@ -48,7 +48,7 @@
 
 // optional: return the size (in bytes) of the readable/writable space
 // of the device.  Will default to 0 (non-seekable) if this is unimplemented
-mx_off_t BlockDevice::virtio_block_get_size(void* ctx) {
+zx_off_t BlockDevice::virtio_block_get_size(void* ctx) {
     LTRACEF("ctx %p\n", ctx);
 
     BlockDevice* bd = static_cast<BlockDevice*>(ctx);
@@ -63,7 +63,7 @@
     info->max_transfer_size = (uint32_t)(PAGE_SIZE * (ring_size - 2));
 }
 
-mx_status_t BlockDevice::virtio_block_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
+zx_status_t BlockDevice::virtio_block_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
                                         void* reply, size_t max, size_t* out_actual) {
     LTRACEF("ctx %p, op %u\n", ctx, op);
 
@@ -73,21 +73,21 @@
     case IOCTL_BLOCK_GET_INFO: {
         block_info_t* info = reinterpret_cast<block_info_t*>(reply);
         if (max < sizeof(*info))
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         bd->GetInfo(info);
         *out_actual = sizeof(*info);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_BLOCK_RR_PART: {
         // rebind to reread the partition table
         return device_rebind(bd->device());
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-BlockDevice::BlockDevice(mx_device_t* bus_device)
+BlockDevice::BlockDevice(zx_device_t* bus_device)
     : Device(bus_device) {
     // so that Bind() knows how much io space to allocate
     bar0_size_ = 0x40;
@@ -114,23 +114,23 @@
 }
 
 void BlockDevice::block_do_txn(BlockDevice* dev, uint32_t opcode,
-                               mx_handle_t vmo, uint64_t length,
+                               zx_handle_t vmo, uint64_t length,
                                uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     LTRACEF("vmo offset %#lx dev_offset %#lx length %#lx\n", vmo_offset, dev_offset, length);
     if ((dev_offset % dev->GetBlockSize()) || (length % dev->GetBlockSize())) {
-        dev->callbacks_->complete(cookie, MX_ERR_INVALID_ARGS);
+        dev->callbacks_->complete(cookie, ZX_ERR_INVALID_ARGS);
         return;
     }
     uint64_t size = dev->GetSize();
     if ((dev_offset >= size) || (length >= (size - dev_offset))) {
-        dev->callbacks_->complete(cookie, MX_ERR_OUT_OF_RANGE);
+        dev->callbacks_->complete(cookie, ZX_ERR_OUT_OF_RANGE);
         return;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     iotxn_t* txn;
     if ((status = iotxn_alloc_vmo(&txn, IOTXN_ALLOC_POOL,
-                    vmo, vmo_offset, length)) != MX_OK) {
+                    vmo, vmo_offset, length)) != ZX_OK) {
         dev->callbacks_->complete(cookie, status);
         return;
     }
@@ -144,19 +144,19 @@
     iotxn_queue(dev->device_, txn);
 }
 
-void BlockDevice::virtio_block_read(void* ctx, mx_handle_t vmo,
+void BlockDevice::virtio_block_read(void* ctx, zx_handle_t vmo,
                                     uint64_t length, uint64_t vmo_offset,
                                     uint64_t dev_offset, void* cookie) {
     block_do_txn((BlockDevice*)ctx, IOTXN_OP_READ, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
-void BlockDevice::virtio_block_write(void* ctx, mx_handle_t vmo,
+void BlockDevice::virtio_block_write(void* ctx, zx_handle_t vmo,
                                      uint64_t length, uint64_t vmo_offset,
                                      uint64_t dev_offset, void* cookie) {
     block_do_txn((BlockDevice*)ctx, IOTXN_OP_WRITE, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
-mx_status_t BlockDevice::Init() {
+zx_status_t BlockDevice::Init() {
     LTRACE_ENTRY;
 
     // reset the device
@@ -185,7 +185,7 @@
     // allocate a queue of block requests
     size_t size = sizeof(virtio_blk_req_t) * blk_req_count + sizeof(uint8_t) * blk_req_count;
 
-    mx_status_t r = map_contiguous_memory(size, (uintptr_t*)&blk_req_, &blk_req_pa_);
+    zx_status_t r = map_contiguous_memory(size, (uintptr_t*)&blk_req_, &blk_req_pa_);
     if (r < 0) {
         VIRTIO_ERROR("cannot alloc blk_req buffers %d\n", r);
         return r;
@@ -205,7 +205,7 @@
     // set DRIVER_OK
     StatusDriverOK();
 
-    // initialize the mx_device and publish us
+    // initialize the zx_device and publish us
     // point the ctx of our DDK device at ourself
     device_ops_.iotxn_queue = &virtio_block_iotxn_queue;
     device_ops_.get_size = &virtio_block_get_size;
@@ -221,7 +221,7 @@
     args.name = "virtio-block";
     args.ctx = this;
     args.ops = &device_ops_;
-    args.proto_id = MX_PROTOCOL_BLOCK_CORE;
+    args.proto_id = ZX_PROTOCOL_BLOCK_CORE;
     args.proto_ops = &device_block_ops_;
 
     auto status = device_add(bus_device_, &args, &device_);
@@ -230,7 +230,7 @@
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void BlockDevice::IrqRingUpdate() {
@@ -266,7 +266,7 @@
                 LTRACEF("completes txn %p\n", txn);
                 free_blk_req((unsigned int)txn->extra[1]);
                 list_delete(&txn->node);
-                iotxn_complete(txn, MX_OK, txn->length);
+                iotxn_complete(txn, ZX_OK, txn->length);
                 break;
             }
         }
@@ -326,7 +326,7 @@
     // offset must be aligned to block size
     if (txn->offset % config_.blk_size) {
         LTRACEF("offset %#" PRIx64 " is not aligned to sector size %u!\n", txn->offset, config_.blk_size);
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
 
@@ -338,7 +338,7 @@
     // constrain to device capacity
     txn->length = fbl::min(txn->length, GetSize() - txn->offset);
     if (txn->length == 0) {
-        iotxn_complete(txn, MX_OK, 0);
+        iotxn_complete(txn, ZX_OK, 0);
         return;
     }
 
@@ -346,7 +346,7 @@
     auto index = alloc_blk_req();
     if (index >= blk_req_count) {
         TRACEF("too many block requests queued (%zu)!\n", index);
-        iotxn_complete(txn, MX_ERR_NO_RESOURCES, 0);
+        iotxn_complete(txn, ZX_ERR_NO_RESOURCES, 0);
         return;
     }
 
@@ -391,7 +391,7 @@
     if (!desc) {
         TRACEF("failed to allocate descriptor chain of length %zu\n", 2u + run_count);
         // TODO: handle this scenario by requeing the transfer in smaller runs
-        iotxn_complete(txn, MX_ERR_NO_RESOURCES, 0);
+        iotxn_complete(txn, ZX_ERR_NO_RESOURCES, 0);
         return;
     }
 
diff --git a/system/dev/bus/virtio/block.h b/system/dev/bus/virtio/block.h
index 14ac961..abde13e 100644
--- a/system/dev/bus/virtio/block.h
+++ b/system/dev/bus/virtio/block.h
@@ -6,7 +6,7 @@
 #include "device.h"
 #include "ring.h"
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdlib.h>
 
 #include <ddk/protocol/block.h>
@@ -18,10 +18,10 @@
 
 class BlockDevice : public Device {
 public:
-    BlockDevice(mx_device_t* device);
+    BlockDevice(zx_device_t* device);
     virtual ~BlockDevice();
 
-    virtual mx_status_t Init();
+    virtual zx_status_t Init();
 
     virtual void IrqRingUpdate();
     virtual void IrqConfigChange();
@@ -33,20 +33,20 @@
 private:
     // DDK driver hooks
     static void virtio_block_iotxn_queue(void* ctx, iotxn_t* txn);
-    static mx_off_t virtio_block_get_size(void* ctx);
-    static mx_status_t virtio_block_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
+    static zx_off_t virtio_block_get_size(void* ctx);
+    static zx_status_t virtio_block_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
                                       void* out_buf, size_t out_len, size_t* out_actual);
 
     static void virtio_block_set_callbacks(void* ctx, block_callbacks_t* cb);
     static void virtio_block_get_info(void* ctx, block_info_t* info);
     static void virtio_block_complete(iotxn_t* txn, void* cookie);
-    static void virtio_block_read(void* ctx, mx_handle_t vmo,
+    static void virtio_block_read(void* ctx, zx_handle_t vmo,
                                   uint64_t length, uint64_t vmo_offset,
                                   uint64_t dev_offset, void* cookie);
-    static void virtio_block_write(void* ctx, mx_handle_t vmo,
+    static void virtio_block_write(void* ctx, zx_handle_t vmo,
                                    uint64_t length, uint64_t vmo_offset,
                                    uint64_t dev_offset, void* cookie);
-    static void block_do_txn(BlockDevice* dev, uint32_t opcode, mx_handle_t vmo,
+    static void block_do_txn(BlockDevice* dev, uint32_t opcode, zx_handle_t vmo,
                              uint64_t length, uint64_t vmo_offset,
                              uint64_t dev_offset, void* cookie);
 
@@ -65,10 +65,10 @@
     // a queue of block request/responses
     static const size_t blk_req_count = 32;
 
-    mx_paddr_t blk_req_pa_ = 0;
+    zx_paddr_t blk_req_pa_ = 0;
     virtio_blk_req_t* blk_req_ = nullptr;
 
-    mx_paddr_t blk_res_pa_ = 0;
+    zx_paddr_t blk_res_pa_ = 0;
     uint8_t* blk_res_ = nullptr;
 
     uint32_t blk_req_bitmap_ = 0;
diff --git a/system/dev/bus/virtio/device.cpp b/system/dev/bus/virtio/device.cpp
index 8e07a4f..9009f02 100644
--- a/system/dev/bus/virtio/device.cpp
+++ b/system/dev/bus/virtio/device.cpp
@@ -11,7 +11,7 @@
 #include <string.h>
 
 #include <hw/inout.h>
-#include <magenta/status.h>
+#include <zircon/status.h>
 #include <fbl/auto_lock.h>
 #include <pretty/hexdump.h>
 
@@ -21,7 +21,7 @@
 
 namespace virtio {
 
-Device::Device(mx_device_t* bus_device)
+Device::Device(zx_device_t* bus_device)
     : bus_device_(bus_device) {
     LTRACE_ENTRY;
     device_ops_.version = DEVICE_OPS_VERSION;
@@ -31,31 +31,31 @@
     LTRACE_ENTRY;
 }
 
-mx_status_t Device::MapBar(uint8_t i) {
-    if (bar_[i].mmio_handle != MX_HANDLE_INVALID)
-        return MX_OK;
+zx_status_t Device::MapBar(uint8_t i) {
+    if (bar_[i].mmio_handle != ZX_HANDLE_INVALID)
+        return ZX_OK;
 
     uint64_t sz;
-    mx_handle_t tmp_handle;
+    zx_handle_t tmp_handle;
 
-    mx_status_t r = pci_map_resource(&pci_, PCI_RESOURCE_BAR_0 + i, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_status_t r = pci_map_resource(&pci_, PCI_RESOURCE_BAR_0 + i, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                      (void**)&bar_[i].mmio_base, &sz, &tmp_handle);
-    if (r != MX_OK) {
+    if (r != ZX_OK) {
         VIRTIO_ERROR("cannot map io %d\n", bar_[i].mmio_handle.get());
         return r;
     }
     bar_[i].mmio_handle.reset(tmp_handle);
     LTRACEF("bar %hhu mmio_base %p, sz %#" PRIx64 "\n", i, bar_[i].mmio_base, sz);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Device::Bind(pci_protocol_t* pci,
-                         mx_handle_t pci_config_handle, const pci_config_t* pci_config) {
+zx_status_t Device::Bind(pci_protocol_t* pci,
+                         zx_handle_t pci_config_handle, const pci_config_t* pci_config) {
     LTRACE_ENTRY;
 
     fbl::AutoLock lock(&lock_);
-    mx_handle_t tmp_handle;
+    zx_handle_t tmp_handle;
 
     // save off handles to things
     memcpy(&pci_, pci, sizeof(pci_protocol_t));
@@ -63,15 +63,15 @@
     pci_config_ = pci_config;
 
     // enable bus mastering
-    mx_status_t r;
-    if ((r = pci_enable_bus_master(&pci_, true)) != MX_OK) {
+    zx_status_t r;
+    if ((r = pci_enable_bus_master(&pci_, true)) != ZX_OK) {
         VIRTIO_ERROR("cannot enable bus master %d\n", r);
         return r;
     }
 
     // try to set up our IRQ mode
-    if (pci_set_irq_mode(&pci_, MX_PCIE_IRQ_MODE_MSI, 1)) {
-        if (pci_set_irq_mode(&pci_, MX_PCIE_IRQ_MODE_LEGACY, 1)) {
+    if (pci_set_irq_mode(&pci_, ZX_PCIE_IRQ_MODE_MSI, 1)) {
+        if (pci_set_irq_mode(&pci_, ZX_PCIE_IRQ_MODE_LEGACY, 1)) {
             VIRTIO_ERROR("failed to set irq mode\n");
             return -1;
         } else {
@@ -80,7 +80,7 @@
     }
 
     r = pci_map_interrupt(&pci_, 0, &tmp_handle);
-    if (r != MX_OK) {
+    if (r != ZX_OK) {
         VIRTIO_ERROR("failed to map irq %d\n", r);
         return r;
     }
@@ -98,7 +98,7 @@
 
             if (off > PAGE_SIZE) {
                 VIRTIO_ERROR("capability pointer is out of whack %zu\n", off);
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
 
             cap = (virtio_pci_cap *)(((uintptr_t)pci_config_) + off);
@@ -164,7 +164,7 @@
                 bar0_pio_base_ = 0;
 
                 r = MapBar(0);
-                if (r != MX_OK) {
+                if (r != ZX_OK) {
                     VIRTIO_ERROR("cannot mmap io %d\n", r);
                     return r;
                 }
@@ -172,8 +172,8 @@
                 LTRACEF("bar_[0].mmio_base %p\n", bar_[0].mmio_base);
             } else {
                 // this is probably PIO
-                r = mx_mmap_device_io(get_root_resource(), bar0_pio_base_, bar0_size_);
-                if (r != MX_OK) {
+                r = zx_mmap_device_io(get_root_resource(), bar0_pio_base_, bar0_size_);
+                if (r != ZX_OK) {
                     VIRTIO_ERROR("failed to access PIO range %#x, length %#xw\n", bar0_pio_base_, bar0_size_);
                     return r;
                 }
@@ -189,7 +189,7 @@
 
     LTRACE_EXIT;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void Device::Unbind() {
@@ -202,13 +202,13 @@
 
 void Device::IrqWorker() {
     LTRACEF("started\n");
-    mx_status_t rc;
+    zx_status_t rc;
     assert(irq_handle_);
 
     while (irq_handle_) {
-        if ((rc = mx_interrupt_wait(irq_handle_.get())) < 0) {
+        if ((rc = zx_interrupt_wait(irq_handle_.get())) < 0) {
             printf("virtio: error while waiting for interrupt: %s\n",
-                mx_status_get_string(rc));
+                zx_status_get_string(rc));
             continue;
         }
 
@@ -221,9 +221,9 @@
 
         LTRACEF_LEVEL(2, "irq_status %#x\n", irq_status);
 
-        if ((rc = mx_interrupt_complete(irq_handle_.get())) < 0) {
+        if ((rc = zx_interrupt_complete(irq_handle_.get())) < 0) {
             printf("virtio: error while completing interrupt: %s\n",
-                mx_status_get_string(rc));
+                zx_status_get_string(rc));
             continue;
         }
 
@@ -302,7 +302,7 @@
     }
 }
 
-mx_status_t Device::CopyDeviceConfig(void* _buf, size_t len) {
+zx_status_t Device::CopyDeviceConfig(void* _buf, size_t len) {
     if (mmio_regs_.device_config) {
         memcpy(_buf, (void *)mmio_regs_.device_config, len);
     } else {
@@ -315,7 +315,7 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 uint16_t Device::GetRingSize(uint16_t index) {
@@ -336,7 +336,7 @@
     }
 }
 
-void Device::SetRing(uint16_t index, uint16_t count, mx_paddr_t pa_desc, mx_paddr_t pa_avail, mx_paddr_t pa_used) {
+void Device::SetRing(uint16_t index, uint16_t count, zx_paddr_t pa_desc, zx_paddr_t pa_avail, zx_paddr_t pa_used) {
     LTRACEF("index %u, count %u, pa_desc %#" PRIxPTR ", pa_avail %#" PRIxPTR ", pa_used %#" PRIxPTR "\n",
             index, count, pa_desc, pa_avail, pa_used);
 
diff --git a/system/dev/bus/virtio/device.h b/system/dev/bus/virtio/device.h
index 3b03e70..7c5cf2d 100644
--- a/system/dev/bus/virtio/device.h
+++ b/system/dev/bus/virtio/device.h
@@ -3,12 +3,12 @@
 // found in the LICENSE file.
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <ddk/device.h>
 #include <ddk/driver.h>
 #include <ddk/protocol/pci.h>
-#include <mx/handle.h>
+#include <zx/handle.h>
 #include <fbl/mutex.h>
 #include <threads.h>
 #include <virtio/virtio.h>
@@ -17,14 +17,14 @@
 
 class Device {
 public:
-    Device(mx_device_t* bus_device);
+    Device(zx_device_t* bus_device);
     virtual ~Device();
 
-    mx_device_t* bus_device() { return bus_device_; }
-    mx_device_t* device() { return device_; }
+    zx_device_t* bus_device() { return bus_device_; }
+    zx_device_t* device() { return device_; }
 
-    virtual mx_status_t Bind(pci_protocol_t*, mx_handle_t pci_config_handle, const pci_config_t*);
-    virtual mx_status_t Init() = 0;
+    virtual zx_status_t Bind(pci_protocol_t*, zx_handle_t pci_config_handle, const pci_config_t*);
+    virtual zx_status_t Init() = 0;
     virtual void Unbind();
     virtual void Release();
 
@@ -35,7 +35,7 @@
     virtual void IrqConfigChange() {}
 
     // used by Ring class to manipulate config registers
-    void SetRing(uint16_t index, uint16_t count, mx_paddr_t pa_desc, mx_paddr_t pa_avail, mx_paddr_t pa_used);
+    void SetRing(uint16_t index, uint16_t count, zx_paddr_t pa_desc, zx_paddr_t pa_avail, zx_paddr_t pa_used);
     uint16_t GetRingSize(uint16_t index);
     void RingKick(uint16_t ring_index);
 
@@ -43,7 +43,7 @@
     // read bytes out of BAR 0's config space
     template <typename T> T ReadConfigBar(uint16_t offset);
     template <typename T> void WriteConfigBar(uint16_t offset, T val);
-    mx_status_t CopyDeviceConfig(void* _buf, size_t len);
+    zx_status_t CopyDeviceConfig(void* _buf, size_t len);
 
     void Reset();
     void StatusAcknowledgeDriver();
@@ -52,17 +52,17 @@
     static int IrqThreadEntry(void* arg);
     void IrqWorker();
 
-    mx_status_t MapBar(uint8_t bar);
+    zx_status_t MapBar(uint8_t bar);
 
     // members
-    mx_device_t* bus_device_ = nullptr;
+    zx_device_t* bus_device_ = nullptr;
     fbl::Mutex lock_;
 
     // handles to pci bits
     pci_protocol_t pci_ = { nullptr, nullptr };
-    mx::handle pci_config_handle_ = {};
+    zx::handle pci_config_handle_ = {};
     const pci_config_t* pci_config_ = nullptr;
-    mx::handle irq_handle_ = {};
+    zx::handle irq_handle_ = {};
 
     // bar0 memory map or PIO
     uint32_t bar0_pio_base_ = 0;
@@ -71,7 +71,7 @@
     // based on the capability descriptions multiple bars may need to be mapped
     struct bar {
         volatile void* mmio_base;
-        mx::handle mmio_handle;
+        zx::handle mmio_handle;
     } bar_[6] = {};
     struct {
         volatile virtio_pci_common_cfg* common_config;
@@ -85,8 +85,8 @@
     thrd_t irq_thread_ = {};
 
     // DDK device
-    mx_device_t* device_ = nullptr;
-    mx_protocol_device_t device_ops_ = {};
+    zx_device_t* device_ = nullptr;
+    zx_protocol_device_t device_ops_ = {};
 };
 
 } // namespace virtio
diff --git a/system/dev/bus/virtio/ethernet.cpp b/system/dev/bus/virtio/ethernet.cpp
index 7a9f3d6..6a2ff5f 100644
--- a/system/dev/bus/virtio/ethernet.cpp
+++ b/system/dev/bus/virtio/ethernet.cpp
@@ -10,9 +10,9 @@
 
 #include <ddk/io-buffer.h>
 #include <ddk/protocol/ethernet.h>
-#include <magenta/assert.h>
-#include <magenta/status.h>
-#include <magenta/types.h>
+#include <zircon/assert.h>
+#include <zircon/status.h>
+#include <zircon/types.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_call.h>
@@ -64,7 +64,7 @@
     eth->Release();
 }
 
-mx_protocol_device_t kDeviceOps = {
+zx_protocol_device_t kDeviceOps = {
     DEVICE_OPS_VERSION,
     nullptr, // get_protocol
     nullptr, // open
@@ -82,7 +82,7 @@
 };
 
 // Protocol bridge helpers
-mx_status_t virtio_net_query(void* ctx, uint32_t options, ethmac_info_t* info) {
+zx_status_t virtio_net_query(void* ctx, uint32_t options, ethmac_info_t* info) {
     virtio::EthernetDevice* eth = static_cast<virtio::EthernetDevice*>(ctx);
     return eth->Query(options, info);
 }
@@ -92,7 +92,7 @@
     eth->Stop();
 }
 
-mx_status_t virtio_net_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
+zx_status_t virtio_net_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
     virtio::EthernetDevice* eth = static_cast<virtio::EthernetDevice*>(ctx);
     return eth->Start(ifc, cookie);
 }
@@ -109,24 +109,24 @@
 };
 
 // I/O buffer helpers
-mx_status_t InitBuffers(fbl::unique_ptr<io_buffer_t[]>* out) {
-    mx_status_t rc;
+zx_status_t InitBuffers(fbl::unique_ptr<io_buffer_t[]>* out) {
+    zx_status_t rc;
     fbl::AllocChecker ac;
     fbl::unique_ptr<io_buffer_t[]> bufs(new (&ac) io_buffer_t[kNumIoBufs]);
     if (!ac.check()) {
         VIRTIO_ERROR("out of memory!\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     memset(bufs.get(), 0, sizeof(io_buffer_t) * kNumIoBufs);
     size_t buf_size = kFrameSize * kFramesInBuf;
     for (uint16_t id = 0; id < kNumIoBufs; ++id) {
-        if ((rc = io_buffer_init(&bufs[id], buf_size, IO_BUFFER_RW)) != MX_OK) {
-            VIRTIO_ERROR("failed to allocate I/O buffers: %s\n", mx_status_get_string(rc));
+        if ((rc = io_buffer_init(&bufs[id], buf_size, IO_BUFFER_RW)) != ZX_OK) {
+            VIRTIO_ERROR("failed to allocate I/O buffers: %s\n", zx_status_get_string(rc));
             return rc;
         }
     }
     *out = fbl::move(bufs);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void ReleaseBuffers(fbl::unique_ptr<io_buffer_t[]> bufs) {
@@ -141,20 +141,20 @@
 }
 
 // Frame access helpers
-mx_off_t GetFrame(io_buffer_t** bufs, uint16_t ring_id, uint16_t desc_id) {
+zx_off_t GetFrame(io_buffer_t** bufs, uint16_t ring_id, uint16_t desc_id) {
     uint16_t i = static_cast<uint16_t>(desc_id + ring_id * kBacklog);
     *bufs = &((*bufs)[i / kFramesInBuf]);
     return (i % kFramesInBuf) * kFrameSize;
 }
 
 void* GetFrameVirt(io_buffer_t* bufs, uint16_t ring_id, uint16_t desc_id) {
-    mx_off_t offset = GetFrame(&bufs, ring_id, desc_id);
+    zx_off_t offset = GetFrame(&bufs, ring_id, desc_id);
     uintptr_t vaddr = reinterpret_cast<uintptr_t>(io_buffer_virt(bufs));
     return reinterpret_cast<void*>(vaddr + offset);
 }
 
-mx_paddr_t GetFramePhys(io_buffer_t* bufs, uint16_t ring_id, uint16_t desc_id) {
-    mx_off_t offset = GetFrame(&bufs, ring_id, desc_id);
+zx_paddr_t GetFramePhys(io_buffer_t* bufs, uint16_t ring_id, uint16_t desc_id) {
+    zx_off_t offset = GetFrame(&bufs, ring_id, desc_id);
     return io_buffer_phys(bufs) + offset;
 }
 
@@ -169,7 +169,7 @@
 
 } // namespace
 
-EthernetDevice::EthernetDevice(mx_device_t* bus_device)
+EthernetDevice::EthernetDevice(zx_device_t* bus_device)
     : Device(bus_device), rx_(this), tx_(this), bufs_(nullptr), unkicked_(0), ifc_(nullptr),
       cookie_(nullptr) {
     LTRACE_ENTRY;
@@ -181,12 +181,12 @@
     LTRACE_ENTRY;
 }
 
-mx_status_t EthernetDevice::Init() {
+zx_status_t EthernetDevice::Init() {
     LTRACE_ENTRY;
-    mx_status_t rc;
+    zx_status_t rc;
     if (mtx_init(&state_lock_, mtx_plain) != thrd_success ||
         mtx_init(&tx_lock_, mtx_plain) != thrd_success) {
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     }
     fbl::AutoLock lock(&state_lock_);
 
@@ -208,9 +208,9 @@
 
     // Allocate I/O buffers and virtqueues.
     uint16_t num_descs = static_cast<uint16_t>(kBacklog & 0xffff);
-    if ((rc = InitBuffers(&bufs_)) != MX_OK || (rc = rx_.Init(kRxId, num_descs)) != MX_OK ||
-        (rc = tx_.Init(kTxId, num_descs)) != MX_OK) {
-        VIRTIO_ERROR("failed to allocate virtqueue: %s\n", mx_status_get_string(rc));
+    if ((rc = InitBuffers(&bufs_)) != ZX_OK || (rc = rx_.Init(kRxId, num_descs)) != ZX_OK ||
+        (rc = tx_.Init(kTxId, num_descs)) != ZX_OK) {
+        VIRTIO_ERROR("failed to allocate virtqueue: %s\n", zx_status_get_string(rc));
         return rc;
     }
 
@@ -241,17 +241,17 @@
     // Start the interrupt thread and set the driver OK status
     StartIrqThread();
 
-    // Initialize the mx_device and publish us
+    // Initialize the zx_device and publish us
     device_add_args_t args;
     memset(&args, 0, sizeof(args));
     args.version = DEVICE_ADD_ARGS_VERSION;
     args.name = "virtio-net";
     args.ctx = this;
     args.ops = &kDeviceOps;
-    args.proto_id = MX_PROTOCOL_ETHERMAC;
+    args.proto_id = ZX_PROTOCOL_ETHERMAC;
     args.proto_ops = &kProtoOps;
-    if ((rc = device_add(bus_device_, &args, &device_)) != MX_OK) {
-        VIRTIO_ERROR("failed to add device: %s\n", mx_status_get_string(rc));
+    if ((rc = device_add(bus_device_, &args, &device_)) != ZX_OK) {
+        VIRTIO_ERROR("failed to add device: %s\n", zx_status_get_string(rc));
         return rc;
     }
     // Give the rx buffers to the host
@@ -260,7 +260,7 @@
     // Woohoo! Driver should be ready.
     cleanup.cancel();
     StatusDriverOK();
-    return MX_OK;
+    return ZX_OK;
 }
 
 void EthernetDevice::Release() {
@@ -335,10 +335,10 @@
     ifc_->status(cookie_, (config_.status & VIRTIO_NET_S_LINK_UP) ? ETH_STATUS_ONLINE : 0);
 }
 
-mx_status_t EthernetDevice::Query(uint32_t options, ethmac_info_t* info) {
+zx_status_t EthernetDevice::Query(uint32_t options, ethmac_info_t* info) {
     LTRACE_ENTRY;
     if (options) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     fbl::AutoLock lock(&state_lock_);
     if (info) {
@@ -346,7 +346,7 @@
         info->mtu = kVirtioMtu;
         memcpy(info->mac, config_.mac, sizeof(info->mac));
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 void EthernetDevice::Stop() {
@@ -355,19 +355,19 @@
     ifc_ = nullptr;
 }
 
-mx_status_t EthernetDevice::Start(ethmac_ifc_t* ifc, void* cookie) {
+zx_status_t EthernetDevice::Start(ethmac_ifc_t* ifc, void* cookie) {
     LTRACE_ENTRY;
     if (!ifc) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     fbl::AutoLock lock(&state_lock_);
     if (!bufs_ || ifc_) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     ifc_ = ifc;
     cookie_ = cookie;
     ifc_->status(cookie_, (config_.status & VIRTIO_NET_S_LINK_UP) ? ETH_STATUS_ONLINE : 0);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void EthernetDevice::Send(uint32_t options, void* data, size_t length) {
diff --git a/system/dev/bus/virtio/ethernet.h b/system/dev/bus/virtio/ethernet.h
index 0ada94e..039bae6 100644
--- a/system/dev/bus/virtio/ethernet.h
+++ b/system/dev/bus/virtio/ethernet.h
@@ -13,10 +13,10 @@
 
 #include <ddk/io-buffer.h>
 #include <ddk/protocol/ethernet.h>
-#include <magenta/compiler.h>
-#include <magenta/device/ethernet.h>
-#include <magenta/thread_annotations.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/thread_annotations.h>
+#include <zircon/types.h>
 #include <fbl/macros.h>
 #include <fbl/unique_ptr.h>
 #include <virtio/net.h>
@@ -25,10 +25,10 @@
 
 class EthernetDevice : public Device {
 public:
-    explicit EthernetDevice(mx_device_t* device);
+    explicit EthernetDevice(zx_device_t* device);
     virtual ~EthernetDevice();
 
-    mx_status_t Init() override TA_EXCL(state_lock_);
+    zx_status_t Init() override TA_EXCL(state_lock_);
     void Release() override TA_EXCL(state_lock_);
 
     // VirtIO callbacks
@@ -36,9 +36,9 @@
     void IrqConfigChange() override TA_EXCL(state_lock_);
 
     // DDK protocol hooks; see ddk/protocol/ethernet.h
-    mx_status_t Query(uint32_t options, ethmac_info_t* info) TA_EXCL(state_lock_);
+    zx_status_t Query(uint32_t options, ethmac_info_t* info) TA_EXCL(state_lock_);
     void Stop() TA_EXCL(state_lock_);
-    mx_status_t Start(ethmac_ifc_t* ifc, void* cookie) TA_EXCL(state_lock_);
+    zx_status_t Start(ethmac_ifc_t* ifc, void* cookie) TA_EXCL(state_lock_);
     void Send(uint32_t options, void* data, size_t length) TA_EXCL(state_lock_);
 
 private:
diff --git a/system/dev/bus/virtio/gpu.cpp b/system/dev/bus/virtio/gpu.cpp
index 6056faa..9c3c615 100644
--- a/system/dev/bus/virtio/gpu.cpp
+++ b/system/dev/bus/virtio/gpu.cpp
@@ -6,7 +6,7 @@
 
 #include <assert.h>
 #include <inttypes.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/auto_lock.h>
 #include <pretty/hexdump.h>
 #include <stdint.h>
@@ -26,15 +26,15 @@
 // DDK level ops
 
 // queue an iotxn. iotxn's are always completed by its complete() op
-mx_status_t GpuDevice::virtio_gpu_set_mode(void* ctx, mx_display_info_t* info) {
+zx_status_t GpuDevice::virtio_gpu_set_mode(void* ctx, zx_display_info_t* info) {
     GpuDevice* gd = static_cast<GpuDevice*>(ctx);
 
     LTRACEF("dev %p, info %p\n", gd, info);
 
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t GpuDevice::virtio_gpu_get_mode(void* ctx, mx_display_info_t* info) {
+zx_status_t GpuDevice::virtio_gpu_get_mode(void* ctx, zx_display_info_t* info) {
     GpuDevice* gd = static_cast<GpuDevice*>(ctx);
 
     LTRACEF("dev %p, info %p\n", gd, info);
@@ -43,27 +43,27 @@
 
     auto pmode = gd->pmode();
 
-    info->format = MX_PIXEL_FORMAT_RGB_x888;
+    info->format = ZX_PIXEL_FORMAT_RGB_x888;
     info->width = pmode->r.width;
     info->height = pmode->r.height;
     info->stride = pmode->r.width;
     info->pixelsize = 4;
-    info->flags = MX_DISPLAY_FLAG_HW_FRAMEBUFFER;
+    info->flags = ZX_DISPLAY_FLAG_HW_FRAMEBUFFER;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t GpuDevice::virtio_gpu_get_framebuffer(void* ctx, void** framebuffer) {
+zx_status_t GpuDevice::virtio_gpu_get_framebuffer(void* ctx, void** framebuffer) {
     GpuDevice* gd = static_cast<GpuDevice*>(ctx);
 
     LTRACEF("dev %p, framebuffer %p\n", gd, framebuffer);
 
     void* fb = gd->framebuffer();
     if (!fb)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     *framebuffer = fb;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void GpuDevice::virtio_gpu_flush(void* ctx) {
@@ -74,7 +74,7 @@
     gd->Flush();
 }
 
-GpuDevice::GpuDevice(mx_device_t* bus_device)
+GpuDevice::GpuDevice(zx_device_t* bus_device)
     : Device(bus_device) {
 
     cnd_init(&request_cond_);
@@ -94,7 +94,7 @@
     LTRACEF("reserved 0x%x\n", config->reserved);
 }
 
-mx_status_t GpuDevice::send_command_response(const void* cmd, size_t cmd_len, void** _res, size_t res_len) {
+zx_status_t GpuDevice::send_command_response(const void* cmd, size_t cmd_len, void** _res, size_t res_len) {
     LTRACEF("dev %p, cmd %p, cmd_len %zu, res %p, res_len %zu\n", this, cmd, cmd_len, _res, res_len);
 
     uint16_t i;
@@ -113,7 +113,7 @@
 
     void* res = (void*)((uint8_t*)gpu_req_ + cmd_len);
     *_res = res;
-    mx_paddr_t res_phys = gpu_req_pa_ + cmd_len;
+    zx_paddr_t res_phys = gpu_req_pa_ + cmd_len;
     memset(res, 0, res_len);
 
     desc->addr = res_phys;
@@ -129,10 +129,10 @@
     /* wait for result */
     cnd_wait(&request_cond_, request_lock_.GetInternal());
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t GpuDevice::get_display_info() {
+zx_status_t GpuDevice::get_display_info() {
     LTRACEF("dev %p\n", this);
 
     /* grab a lock to keep this single message at a time */
@@ -146,13 +146,13 @@
     /* send the message and get a response */
     virtio_gpu_resp_display_info* info;
     auto err = send_command_response(&req, sizeof(req), (void**)&info, sizeof(*info));
-    if (err < MX_OK) {
-        return MX_ERR_NOT_FOUND;
+    if (err < ZX_OK) {
+        return ZX_ERR_NOT_FOUND;
     }
 
     /* we got response */
     if (info->hdr.type != VIRTIO_GPU_RESP_OK_DISPLAY_INFO) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     LTRACEF("response:\n");
@@ -169,10 +169,10 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t GpuDevice::allocate_2d_resource(uint32_t* resource_id, uint32_t width, uint32_t height) {
+zx_status_t GpuDevice::allocate_2d_resource(uint32_t* resource_id, uint32_t width, uint32_t height) {
     LTRACEF("dev %p\n", this);
 
     assert(resource_id);
@@ -194,16 +194,16 @@
     /* send the command and get a response */
     struct virtio_gpu_ctrl_hdr* res;
     auto err = send_command_response(&req, sizeof(req), (void**)&res, sizeof(*res));
-    assert(err == MX_OK);
+    assert(err == ZX_OK);
 
     /* see if we got a valid response */
     LTRACEF("response type 0x%x\n", res->type);
-    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? MX_OK : MX_ERR_NO_MEMORY;
+    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? ZX_OK : ZX_ERR_NO_MEMORY;
 
     return err;
 }
 
-mx_status_t GpuDevice::attach_backing(uint32_t resource_id, mx_paddr_t ptr, size_t buf_len) {
+zx_status_t GpuDevice::attach_backing(uint32_t resource_id, zx_paddr_t ptr, size_t buf_len) {
     LTRACEF("dev %p, resource_id %u, ptr %#" PRIxPTR ", buf_len %zu\n", this, resource_id, ptr, buf_len);
 
     assert(ptr);
@@ -228,16 +228,16 @@
     /* send the command and get a response */
     struct virtio_gpu_ctrl_hdr* res;
     auto err = send_command_response(&req, sizeof(req), (void**)&res, sizeof(*res));
-    assert(err == MX_OK);
+    assert(err == ZX_OK);
 
     /* see if we got a valid response */
     LTRACEF("response type 0x%x\n", res->type);
-    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? MX_OK : MX_ERR_NO_MEMORY;
+    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? ZX_OK : ZX_ERR_NO_MEMORY;
 
     return err;
 }
 
-mx_status_t GpuDevice::set_scanout(uint32_t scanout_id, uint32_t resource_id, uint32_t width, uint32_t height) {
+zx_status_t GpuDevice::set_scanout(uint32_t scanout_id, uint32_t resource_id, uint32_t width, uint32_t height) {
     LTRACEF("dev %p, scanout_id %u, resource_id %u, width %u, height %u\n", this, scanout_id, resource_id, width, height);
 
     /* grab a lock to keep this single message at a time */
@@ -257,16 +257,16 @@
     /* send the command and get a response */
     virtio_gpu_ctrl_hdr* res;
     auto err = send_command_response(&req, sizeof(req), (void**)&res, sizeof(*res));
-    assert(err == MX_OK);
+    assert(err == ZX_OK);
 
     /* see if we got a valid response */
     LTRACEF("response type 0x%x\n", res->type);
-    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? MX_OK : MX_ERR_NO_MEMORY;
+    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? ZX_OK : ZX_ERR_NO_MEMORY;
 
     return err;
 }
 
-mx_status_t GpuDevice::flush_resource(uint32_t resource_id, uint32_t width, uint32_t height) {
+zx_status_t GpuDevice::flush_resource(uint32_t resource_id, uint32_t width, uint32_t height) {
     LTRACEF("dev %p, resource_id %u, width %u, height %u\n", this, resource_id, width, height);
 
     /* grab a lock to keep this single message at a time */
@@ -285,16 +285,16 @@
     /* send the command and get a response */
     virtio_gpu_ctrl_hdr* res;
     auto err = send_command_response(&req, sizeof(req), (void**)&res, sizeof(*res));
-    assert(err == MX_OK);
+    assert(err == ZX_OK);
 
     /* see if we got a valid response */
     LTRACEF("response type 0x%x\n", res->type);
-    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? MX_OK : MX_ERR_NO_MEMORY;
+    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? ZX_OK : ZX_ERR_NO_MEMORY;
 
     return err;
 }
 
-mx_status_t GpuDevice::transfer_to_host_2d(uint32_t resource_id, uint32_t width, uint32_t height) {
+zx_status_t GpuDevice::transfer_to_host_2d(uint32_t resource_id, uint32_t width, uint32_t height) {
     LTRACEF("dev %p, resource_id %u, width %u, height %u\n", this, resource_id, width, height);
 
     /* grab a lock to keep this single message at a time */
@@ -314,11 +314,11 @@
     /* send the command and get a response */
     virtio_gpu_ctrl_hdr* res;
     auto err = send_command_response(&req, sizeof(req), (void**)&res, sizeof(*res));
-    assert(err == MX_OK);
+    assert(err == ZX_OK);
 
     /* see if we got a valid response */
     LTRACEF("response type 0x%x\n", res->type);
-    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? MX_OK : MX_ERR_NO_MEMORY;
+    err = (res->type == VIRTIO_GPU_RESP_OK_NODATA) ? ZX_OK : ZX_ERR_NO_MEMORY;
 
     return err;
 }
@@ -365,8 +365,8 @@
     return 0;
 }
 
-mx_status_t GpuDevice::virtio_gpu_start() {
-    mx_status_t err;
+zx_status_t GpuDevice::virtio_gpu_start() {
+    zx_status_t err;
 
     LTRACEF("dev %p\n", this);
 
@@ -379,7 +379,7 @@
 
     if (pmode_id_ < 0) {
         VIRTIO_ERROR("we failed to find a pmode, exiting\n");
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     printf("virtio-gpu: found display x %u y %u w %u h %u flags 0x%x\n",
@@ -399,7 +399,7 @@
     err = map_contiguous_memory(len, (uintptr_t*)&fb_, &fb_pa_);
     if (err < 0) {
         VIRTIO_ERROR("failed to allocate framebuffer, wanted 0x%zx bytes\n", len);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     LTRACEF("framebuffer at %p, 0x%zx bytes\n", fb_, len);
@@ -428,7 +428,7 @@
     display_proto_ops_.get_framebuffer = virtio_gpu_get_framebuffer;
     display_proto_ops_.flush = virtio_gpu_flush;
 
-    // initialize the mx_device and publish us
+    // initialize the zx_device and publish us
     // point the ctx of our DDK device at ourself
 
     device_add_args_t args = {};
@@ -436,7 +436,7 @@
     args.name = "virtio-gpu";
     args.ctx = this;
     args.ops = &device_ops_;
-    args.proto_id = MX_PROTOCOL_DISPLAY;
+    args.proto_id = ZX_PROTOCOL_DISPLAY;
     args.proto_ops = &display_proto_ops_;
 
     auto status = device_add(bus_device_, &args, &bus_device_);
@@ -447,7 +447,7 @@
 
     LTRACE_EXIT;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 int GpuDevice::virtio_gpu_start_entry(void* arg) {
@@ -459,7 +459,7 @@
     return 0;
 }
 
-mx_status_t GpuDevice::Init() {
+zx_status_t GpuDevice::Init() {
     LTRACE_ENTRY;
 
     // reset the device
@@ -499,7 +499,7 @@
     thrd_create_with_name(&start_thread_, virtio_gpu_start_entry, this, "virtio-gpu-starter");
     thrd_detach(start_thread_);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void GpuDevice::IrqRingUpdate() {
diff --git a/system/dev/bus/virtio/gpu.h b/system/dev/bus/virtio/gpu.h
index 9eacc87..d944c0e 100644
--- a/system/dev/bus/virtio/gpu.h
+++ b/system/dev/bus/virtio/gpu.h
@@ -7,7 +7,7 @@
 #include "ring.h"
 #include "virtio_gpu.h"
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdlib.h>
 
 #include <ddk/protocol/display.h>
@@ -18,10 +18,10 @@
 
 class GpuDevice : public Device {
 public:
-    GpuDevice(mx_device_t* device);
+    GpuDevice(zx_device_t* device);
     virtual ~GpuDevice();
 
-    virtual mx_status_t Init();
+    virtual zx_status_t Init();
 
     virtual void IrqRingUpdate();
     virtual void IrqConfigChange();
@@ -33,21 +33,21 @@
 
 private:
     // DDK driver hooks
-    static mx_status_t virtio_gpu_set_mode(void* ctx, mx_display_info_t* info);
-    static mx_status_t virtio_gpu_get_mode(void* ctx, mx_display_info_t* info);
-    static mx_status_t virtio_gpu_get_framebuffer(void* ctx, void** framebuffer);
+    static zx_status_t virtio_gpu_set_mode(void* ctx, zx_display_info_t* info);
+    static zx_status_t virtio_gpu_get_mode(void* ctx, zx_display_info_t* info);
+    static zx_status_t virtio_gpu_get_framebuffer(void* ctx, void** framebuffer);
     static void virtio_gpu_flush(void* ctx);
 
     // internal routines
-    mx_status_t send_command_response(const void* cmd, size_t cmd_len, void** _res, size_t res_len);
-    mx_status_t get_display_info();
-    mx_status_t allocate_2d_resource(uint32_t* resource_id, uint32_t width, uint32_t height);
-    mx_status_t attach_backing(uint32_t resource_id, mx_paddr_t ptr, size_t buf_len);
-    mx_status_t set_scanout(uint32_t scanout_id, uint32_t resource_id, uint32_t width, uint32_t height);
-    mx_status_t flush_resource(uint32_t resource_id, uint32_t width, uint32_t height);
-    mx_status_t transfer_to_host_2d(uint32_t resource_id, uint32_t width, uint32_t height);
+    zx_status_t send_command_response(const void* cmd, size_t cmd_len, void** _res, size_t res_len);
+    zx_status_t get_display_info();
+    zx_status_t allocate_2d_resource(uint32_t* resource_id, uint32_t width, uint32_t height);
+    zx_status_t attach_backing(uint32_t resource_id, zx_paddr_t ptr, size_t buf_len);
+    zx_status_t set_scanout(uint32_t scanout_id, uint32_t resource_id, uint32_t width, uint32_t height);
+    zx_status_t flush_resource(uint32_t resource_id, uint32_t width, uint32_t height);
+    zx_status_t transfer_to_host_2d(uint32_t resource_id, uint32_t width, uint32_t height);
 
-    mx_status_t virtio_gpu_start();
+    zx_status_t virtio_gpu_start();
     static int virtio_gpu_start_entry(void* arg);
     thrd_t start_thread_ = {};
 
@@ -59,7 +59,7 @@
 
     // gpu op
     void* gpu_req_ = nullptr;
-    mx_paddr_t gpu_req_pa_ = 0;
+    zx_paddr_t gpu_req_pa_ = 0;
 
     // a saved copy of the display
     virtio_gpu_resp_display_info::virtio_gpu_display_one pmode_ = {};
@@ -73,7 +73,7 @@
 
     // framebuffer
     void* fb_ = nullptr;
-    mx_paddr_t fb_pa_ = 0;
+    zx_paddr_t fb_pa_ = 0;
 
     // request condition
     fbl::Mutex request_lock_;
diff --git a/system/dev/bus/virtio/mmio.h b/system/dev/bus/virtio/mmio.h
index 9a2f8a0..2392b09 100644
--- a/system/dev/bus/virtio/mmio.h
+++ b/system/dev/bus/virtio/mmio.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 // clang-format off
 
diff --git a/system/dev/bus/virtio/ring.cpp b/system/dev/bus/virtio/ring.cpp
index d605ec8..4c38ed4 100644
--- a/system/dev/bus/virtio/ring.cpp
+++ b/system/dev/bus/virtio/ring.cpp
@@ -10,7 +10,7 @@
 #include <stdint.h>
 
 #include <ddk/driver.h>
-#include <mx/vmar.h>
+#include <zx/vmar.h>
 
 #include "device.h"
 #include "trace.h"
@@ -32,10 +32,10 @@
     : device_(device) {}
 
 Ring::~Ring() {
-    mx::vmar::root_self().unmap(ring_va_, ring_va_len_);
+    zx::vmar::root_self().unmap(ring_va_, ring_va_len_);
 }
 
-mx_status_t Ring::Init(uint16_t index, uint16_t count) {
+zx_status_t Ring::Init(uint16_t index, uint16_t count) {
     LTRACEF("index %u, count %u\n", index, count);
 
     // XXX check that count is a power of 2
@@ -46,14 +46,14 @@
     uint16_t max_ring_size = device_->GetRingSize(index);
     if (count > max_ring_size) {
         VIRTIO_ERROR("ring init count too big for hardware %u > %u\n", count, max_ring_size);
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
 
     // allocate a ring
     size_t size = vring_size(count, PAGE_SIZE);
     LTRACEF("need %zu bytes\n", size);
 
-    mx_status_t r = map_contiguous_memory(size, &ring_va_, &ring_pa_);
+    zx_status_t r = map_contiguous_memory(size, &ring_va_, &ring_pa_);
     if (r) {
         VIRTIO_ERROR("map_contiguous_memory failed %d\n", r);
         return r;
@@ -73,12 +73,12 @@
     }
 
     /* register the ring with the device */
-    mx_paddr_t pa_desc = ring_pa_;
-    mx_paddr_t pa_avail = ring_pa_ + ((uintptr_t)ring_.avail - (uintptr_t)ring_.desc);
-    mx_paddr_t pa_used = ring_pa_ + ((uintptr_t)ring_.used - (uintptr_t)ring_.desc);
+    zx_paddr_t pa_desc = ring_pa_;
+    zx_paddr_t pa_avail = ring_pa_ + ((uintptr_t)ring_.avail - (uintptr_t)ring_.desc);
+    zx_paddr_t pa_used = ring_pa_ + ((uintptr_t)ring_.used - (uintptr_t)ring_.desc);
     device_->SetRing(index_, count, pa_desc, pa_avail, pa_used);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void Ring::FreeDesc(uint16_t desc_index) {
diff --git a/system/dev/bus/virtio/ring.h b/system/dev/bus/virtio/ring.h
index aef1e0d..fa5457e 100644
--- a/system/dev/bus/virtio/ring.h
+++ b/system/dev/bus/virtio/ring.h
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <virtio/virtio_ring.h>
 
 #include "trace.h"
@@ -17,7 +17,7 @@
     Ring(Device* device);
     ~Ring();
 
-    mx_status_t Init(uint16_t index, uint16_t count);
+    zx_status_t Init(uint16_t index, uint16_t count);
 
     void FreeDesc(uint16_t desc_index);
     struct vring_desc* AllocDescChain(uint16_t count, uint16_t* start_index);
@@ -34,7 +34,7 @@
 private:
     Device* device_ = nullptr;
 
-    mx_paddr_t ring_pa_ = 0;
+    zx_paddr_t ring_pa_ = 0;
     uintptr_t ring_va_ = 0;
     size_t ring_va_len_ = 0;
 
diff --git a/system/dev/bus/virtio/rng.cpp b/system/dev/bus/virtio/rng.cpp
index 040ea50..19ae6ec 100644
--- a/system/dev/bus/virtio/rng.cpp
+++ b/system/dev/bus/virtio/rng.cpp
@@ -10,7 +10,7 @@
 
 namespace virtio {
 
-RngDevice::RngDevice(mx_device_t* bus_device)
+RngDevice::RngDevice(zx_device_t* bus_device)
     : Device(bus_device) {
 }
 
@@ -18,7 +18,7 @@
     // TODO: clean up allocated physical memory
 }
 
-mx_status_t RngDevice::Init() {
+zx_status_t RngDevice::Init() {
     // reset the device
     Reset();
 
@@ -33,8 +33,8 @@
     }
 
     // allocate the entropy buffer
-    mx_status_t rc = io_buffer_init(&buf_, kBufferSize, IO_BUFFER_RO);
-    if (rc != MX_OK) {
+    zx_status_t rc = io_buffer_init(&buf_, kBufferSize, IO_BUFFER_RO);
+    if (rc != ZX_OK) {
         dprintf(ERROR, "virtio-rng: cannot allocate entropy buffer: %d\n", rc);
         return rc;
     }
@@ -70,7 +70,7 @@
 
     dprintf(INFO, "virtio-rng: initialization succeeded\n");
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void RngDevice::IrqRingUpdate() {
@@ -85,8 +85,8 @@
             dprintf(ERROR, "virtio-rng: entropy response with unexpected buffer\n");
         } else {
             dprintf(SPEW, "virtio-rng: received entropy; adding to kernel pool\n");
-            mx_status_t rc = mx_cprng_add_entropy(io_buffer_virt(&buf_), kBufferSize);
-            if (rc != MX_OK) {
+            zx_status_t rc = zx_cprng_add_entropy(io_buffer_virt(&buf_), kBufferSize);
+            if (rc != ZX_OK) {
                 dprintf(ERROR, "virtio-rng: add_entropy failed (%d)\n", rc);
             }
         }
@@ -105,20 +105,20 @@
 int RngDevice::SeedThreadEntry(void* arg) {
     RngDevice* d = static_cast<RngDevice*>(arg);
     for(;;) {
-        mx_status_t rc = d->Request();
+        zx_status_t rc = d->Request();
         dprintf(SPEW, "virtio-rng-seed-thread: RngDevice::Request() returned %d\n", rc);
-        mx_nanosleep(mx_deadline_after(MX_SEC(300)));
+        zx_nanosleep(zx_deadline_after(ZX_SEC(300)));
     }
 }
 
-mx_status_t RngDevice::Request() {
+zx_status_t RngDevice::Request() {
     dprintf(TRACE, "virtio-rng: sending entropy request\n");
     fbl::AutoLock lock(&lock_);
     uint16_t i;
     vring_desc* desc = vring_.AllocDescChain(1, &i);
     if (!desc) {
         dprintf(ERROR, "virtio-rng: failed to allocate descriptor chain of length 1\n");
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     }
 
     desc->addr = io_buffer_phys(&buf_);
@@ -134,7 +134,7 @@
 
     dprintf(SPEW, "virtio-rng: kicked off entropy request\n");
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 } // namespace virtio
diff --git a/system/dev/bus/virtio/rng.h b/system/dev/bus/virtio/rng.h
index 60ddd41..ac64a8f 100644
--- a/system/dev/bus/virtio/rng.h
+++ b/system/dev/bus/virtio/rng.h
@@ -7,7 +7,7 @@
 #include "ring.h"
 
 #include <ddk/io-buffer.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdlib.h>
 
 namespace virtio {
@@ -16,10 +16,10 @@
 
 class RngDevice : public Device {
 public:
-    RngDevice(mx_device_t* device);
+    RngDevice(zx_device_t* device);
     virtual ~RngDevice();
 
-    virtual mx_status_t Init();
+    virtual zx_status_t Init();
 
     virtual void IrqRingUpdate();
     virtual void IrqConfigChange();
@@ -34,7 +34,7 @@
     static int SeedThreadEntry(void* arg);
 
     // the method called by SeedThreadEntry() to actually launch a request
-    mx_status_t Request();
+    zx_status_t Request();
 
     // the thread that seeds the system CPRNG periodically
     thrd_t seed_thread_;
@@ -45,7 +45,7 @@
     Ring vring_ = {this};
 
     // the buffer used to receive entropy
-    static constexpr size_t kBufferSize = MX_CPRNG_ADD_ENTROPY_MAX_LEN;
+    static constexpr size_t kBufferSize = ZX_CPRNG_ADD_ENTROPY_MAX_LEN;
     io_buffer_t buf_;
 
 };
diff --git a/system/dev/bus/virtio/rules.mk b/system/dev/bus/virtio/rules.mk
index 8d26a44..83dfc3b 100644
--- a/system/dev/bus/virtio/rules.mk
+++ b/system/dev/bus/virtio/rules.mk
@@ -22,11 +22,11 @@
 MODULE_STATIC_LIBS := \
     system/ulib/ddk \
     system/ulib/pretty \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/virtio \
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/bus/virtio/utils.cpp b/system/dev/bus/virtio/utils.cpp
index e624dea..a868457 100644
--- a/system/dev/bus/virtio/utils.cpp
+++ b/system/dev/bus/virtio/utils.cpp
@@ -6,52 +6,52 @@
 
 #include <ddk/driver.h>
 #include <limits.h>
-#include <magenta/types.h>
-#include <mx/process.h>
-#include <mx/vmar.h>
-#include <mx/vmo.h>
+#include <zircon/types.h>
+#include <zx/process.h>
+#include <zx/vmar.h>
+#include <zx/vmo.h>
 #include <fbl/auto_call.h>
 
 #include "trace.h"
 
 namespace virtio {
 
-mx_status_t map_contiguous_memory(size_t size, uintptr_t* _va, mx_paddr_t* _pa) {
+zx_status_t map_contiguous_memory(size_t size, uintptr_t* _va, zx_paddr_t* _pa) {
 
-    mx_handle_t vmo_handle;
-    mx_status_t r = mx_vmo_create_contiguous(get_root_resource(), size, 0, &vmo_handle);
+    zx_handle_t vmo_handle;
+    zx_status_t r = zx_vmo_create_contiguous(get_root_resource(), size, 0, &vmo_handle);
     if (r) {
-        VIRTIO_ERROR("mx_vmo_create_contiguous failed %d\n", r);
+        VIRTIO_ERROR("zx_vmo_create_contiguous failed %d\n", r);
         return r;
     }
 
-    mx::vmo vmo(vmo_handle);
+    zx::vmo vmo(vmo_handle);
 
     uintptr_t va;
-    const uint32_t flags = MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE;
-    r = mx::vmar::root_self().map(0, vmo, 0, size, flags, &va);
+    const uint32_t flags = ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE;
+    r = zx::vmar::root_self().map(0, vmo, 0, size, flags, &va);
     if (r) {
-        VIRTIO_ERROR("mx_process_map_vm failed %d size: %zu\n", r, size);
+        VIRTIO_ERROR("zx_process_map_vm failed %d size: %zu\n", r, size);
         return r;
     }
 
     auto ac = fbl::MakeAutoCall([va, size]() {
-        mx::vmar::root_self().unmap(va, size);
+        zx::vmar::root_self().unmap(va, size);
     });
 
 // TODO: add when LOCK operation implemented in kernel
 #if 0
-    r = vmo.op_range(MX_VMO_OP_LOCK, 0, size, nullptr, 0);
+    r = vmo.op_range(ZX_VMO_OP_LOCK, 0, size, nullptr, 0);
     if (r) {
-        VIRTIO_ERROR("mx_vmo_op_range LOCK failed %d\n", r);
+        VIRTIO_ERROR("zx_vmo_op_range LOCK failed %d\n", r);
         return r;
     }
 #endif
 
-    mx_paddr_t pa;
-    r = vmo.op_range(MX_VMO_OP_LOOKUP, 0, PAGE_SIZE, &pa, sizeof(pa));
+    zx_paddr_t pa;
+    r = vmo.op_range(ZX_VMO_OP_LOOKUP, 0, PAGE_SIZE, &pa, sizeof(pa));
     if (r) {
-        VIRTIO_ERROR("mx_vmo_op_range LOOKUP failed %d\n", r);
+        VIRTIO_ERROR("zx_vmo_op_range LOOKUP failed %d\n", r);
         return r;
     }
 
@@ -60,7 +60,7 @@
     *_va = va;
     *_pa = pa;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 } // namespace virtio
diff --git a/system/dev/bus/virtio/utils.h b/system/dev/bus/virtio/utils.h
index ce23516..43630e3 100644
--- a/system/dev/bus/virtio/utils.h
+++ b/system/dev/bus/virtio/utils.h
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <sys/types.h>
 
 // collection of utility routines for virtio
@@ -11,6 +11,6 @@
 namespace virtio {
 
 // helper routine to create a contiguous vmo, map it, and return the virtual and physical address
-mx_status_t map_contiguous_memory(size_t size, uintptr_t* va, mx_paddr_t* pa);
+zx_status_t map_contiguous_memory(size_t size, uintptr_t* va, zx_paddr_t* pa);
 
 } // namespace virtio
diff --git a/system/dev/bus/virtio/virtio_c.c b/system/dev/bus/virtio/virtio_c.c
index 2dff13d..4c274f1 100644
--- a/system/dev/bus/virtio/virtio_c.c
+++ b/system/dev/bus/virtio/virtio_c.c
@@ -6,22 +6,22 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 // implemented in virtio_driver.cpp
-extern mx_status_t virtio_bind(void* ctx, mx_device_t* device, void** cookie);
+extern zx_status_t virtio_bind(void* ctx, zx_device_t* device, void** cookie);
 
-static mx_driver_ops_t virtio_driver_ops = {
+static zx_driver_ops_t virtio_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = virtio_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(virtio, virtio_driver_ops, "magenta", "0.1", 9)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+ZIRCON_DRIVER_BEGIN(virtio, virtio_driver_ops, "zircon", "0.1", 9)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_VID, 0x1af4),
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x1000), // Network device (transitional)
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x1001), // Block device (transitional)
@@ -30,4 +30,4 @@
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x1044), // RNG device
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x1050), // GPU device
     BI_ABORT(),
-MAGENTA_DRIVER_END(virtio)
+ZIRCON_DRIVER_END(virtio)
diff --git a/system/dev/bus/virtio/virtio_driver.cpp b/system/dev/bus/virtio/virtio_driver.cpp
index 5baedee..1e2e59c 100644
--- a/system/dev/bus/virtio/virtio_driver.cpp
+++ b/system/dev/bus/virtio/virtio_driver.cpp
@@ -14,8 +14,8 @@
 #include <fbl/alloc_checker.h>
 #include <fbl/unique_ptr.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 #include "block.h"
 #include "device.h"
@@ -28,23 +28,23 @@
 
 // implement driver object:
 
-extern "C" mx_status_t virtio_bind(void* ctx, mx_device_t* device, void** cookie) {
+extern "C" zx_status_t virtio_bind(void* ctx, zx_device_t* device, void** cookie) {
     LTRACEF("device %p\n", device);
-    mx_status_t status;
+    zx_status_t status;
     pci_protocol_t pci;
 
     /* grab the pci device and configuration */
-    if (device_get_protocol(device, MX_PROTOCOL_PCI, &pci)) {
+    if (device_get_protocol(device, ZX_PROTOCOL_PCI, &pci)) {
         TRACEF("no pci protocol\n");
         return -1;
     }
 
     const pci_config_t* config;
     size_t config_size;
-    mx_handle_t config_handle = MX_HANDLE_INVALID;
-    status = pci_map_resource(&pci, PCI_RESOURCE_CONFIG, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_handle_t config_handle = ZX_HANDLE_INVALID;
+    status = pci_map_resource(&pci, PCI_RESOURCE_CONFIG, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                    (void**)&config, &config_size, &config_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         TRACEF("failed to grab config handle\n");
         return status;
     }
@@ -80,11 +80,11 @@
 
     LTRACEF("calling Bind on driver\n");
     status = vd->Bind(&pci, config_handle, config);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     status = vd->Init();
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // if we're here, we're successful so drop the unique ptr ref to the object and let it live on
@@ -92,5 +92,5 @@
 
     LTRACE_EXIT;
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/display/amd-kaveri/kaveri-disp.c b/system/dev/display/amd-kaveri/kaveri-disp.c
index cc1bb7e..54e151b 100644
--- a/system/dev/display/amd-kaveri/kaveri-disp.c
+++ b/system/dev/display/amd-kaveri/kaveri-disp.c
@@ -11,8 +11,8 @@
 
 #include <assert.h>
 #include <inttypes.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -25,34 +25,34 @@
 typedef struct kaveri_disp_device {
     void* regs;
     uint64_t regs_size;
-    mx_handle_t regs_handle;
+    zx_handle_t regs_handle;
 
     void* framebuffer;
     uint64_t framebuffer_size;
-    mx_handle_t framebuffer_handle;
+    zx_handle_t framebuffer_handle;
 
-    mx_display_info_t info;
+    zx_display_info_t info;
 } kaveri_disp_device_t;
 
 // implement display protocol
-static mx_status_t kaveri_disp_set_mode(void* ctx, mx_display_info_t* info) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t kaveri_disp_set_mode(void* ctx, zx_display_info_t* info) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t kaveri_disp_get_mode(void* ctx, mx_display_info_t* info) {
+static zx_status_t kaveri_disp_get_mode(void* ctx, zx_display_info_t* info) {
     assert(info);
     kaveri_disp_device_t* device = ctx;
 
-    memcpy(info, &device->info, sizeof(mx_display_info_t));
-    return MX_OK;
+    memcpy(info, &device->info, sizeof(zx_display_info_t));
+    return ZX_OK;
 }
 
-static mx_status_t kaveri_disp_get_framebuffer(void* ctx, void** framebuffer) {
+static zx_status_t kaveri_disp_get_framebuffer(void* ctx, void** framebuffer) {
     assert(framebuffer);
     kaveri_disp_device_t* device = ctx;
 
     (*framebuffer) = device->framebuffer;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static display_protocol_ops_t kaveri_disp_display_proto = {
@@ -67,72 +67,72 @@
     kaveri_disp_device_t* device = ctx;
 
     if (device->regs) {
-        mx_handle_close(device->regs_handle);
+        zx_handle_close(device->regs_handle);
         device->regs_handle = -1;
     }
 
     if (device->framebuffer) {
-        mx_handle_close(device->framebuffer_handle);
+        zx_handle_close(device->framebuffer_handle);
         device->framebuffer_handle = -1;
     }
 
     free(device);
 }
 
-static mx_protocol_device_t kaveri_disp_device_proto = {
+static zx_protocol_device_t kaveri_disp_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .release = kaveri_disp_release,
 };
 
 // implement driver object:
 
-static mx_status_t kaveri_disp_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t kaveri_disp_bind(void* ctx, zx_device_t* dev, void** cookie) {
     pci_protocol_t pci;
-    mx_status_t status;
+    zx_status_t status;
 
-    if (device_get_protocol(dev, MX_PROTOCOL_PCI, &pci))
-        return MX_ERR_NOT_SUPPORTED;
+    if (device_get_protocol(dev, ZX_PROTOCOL_PCI, &pci))
+        return ZX_ERR_NOT_SUPPORTED;
 
     // map resources and initialize the device
     kaveri_disp_device_t* device = calloc(1, sizeof(kaveri_disp_device_t));
     if (!device)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // map register window
     // seems to be bar 5
-    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_5, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_5, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                               &device->regs, &device->regs_size, &device->regs_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("kaveri: failed to map pci bar 5: %d\n", status);
         goto fail;
     }
 
     // map framebuffer window
     // seems to be bar 0
-    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0, MX_CACHE_POLICY_WRITE_COMBINING,
+    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0, ZX_CACHE_POLICY_WRITE_COMBINING,
                               &device->framebuffer,
                               &device->framebuffer_size,
                               &device->framebuffer_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("kaveri-disp: failed to map pci bar 0: %d\n", status);
         goto fail;
     }
 
-    mx_display_info_t* di = &device->info;
+    zx_display_info_t* di = &device->info;
     uint32_t format, width, height, stride;
-    status = mx_bootloader_fb_get_info(&format, &width, &height, &stride);
-    if (status == MX_OK) {
+    status = zx_bootloader_fb_get_info(&format, &width, &height, &stride);
+    if (status == ZX_OK) {
         di->format = format;
         di->width = width;
         di->height = height;
         di->stride = stride;
     } else {
-        status = MX_ERR_NOT_SUPPORTED;
+        status = ZX_ERR_NOT_SUPPORTED;
         goto fail;
     }
-    di->flags = MX_DISPLAY_FLAG_HW_FRAMEBUFFER;
+    di->flags = ZX_DISPLAY_FLAG_HW_FRAMEBUFFER;
 
-    mx_set_framebuffer(get_root_resource(), device->framebuffer, device->framebuffer_size,
+    zx_set_framebuffer(get_root_resource(), device->framebuffer, device->framebuffer_size,
                        format, width, height, stride);
 
 
@@ -142,12 +142,12 @@
         .name = "amd_kaveri_disp",
         .ctx = device,
         .ops = &kaveri_disp_device_proto,
-        .proto_id = MX_PROTOCOL_DISPLAY,
+        .proto_id = ZX_PROTOCOL_DISPLAY,
         .proto_ops = &kaveri_disp_display_proto,
     };
 
     status = device_add(dev, &args, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
@@ -156,21 +156,21 @@
     printf("\twidth %u height %u stride %u format %u\n",
            device->info.width, device->info.height, device->info.stride, device->info.format);
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     free(device);
     return status;
 }
 
-static mx_driver_ops_t kaveri_disp_driver_ops = {
+static zx_driver_ops_t kaveri_disp_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = kaveri_disp_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(kaveri_disp, kaveri_disp_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+ZIRCON_DRIVER_BEGIN(kaveri_disp, kaveri_disp_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_VID, AMD_GFX_VID),
     BI_MATCH_IF(EQ, BIND_PCI_DID, AMD_KAVERI_R7_DID),
-MAGENTA_DRIVER_END(kaveri_disp)
+ZIRCON_DRIVER_END(kaveri_disp)
diff --git a/system/dev/display/amd-kaveri/rules.mk b/system/dev/display/amd-kaveri/rules.mk
index 020cbbe..995aee3 100644
--- a/system/dev/display/amd-kaveri/rules.mk
+++ b/system/dev/display/amd-kaveri/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/display/bcm-display/bcm-display.c b/system/dev/display/bcm-display/bcm-display.c
index 47f9076..d875be9 100644
--- a/system/dev/display/bcm-display/bcm-display.c
+++ b/system/dev/display/bcm-display/bcm-display.c
@@ -16,8 +16,8 @@
 #include <ddk/protocol/display.h>
 #include <ddk/protocol/platform-device.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/assert.h>
+#include <zircon/syscalls.h>
+#include <zircon/assert.h>
 
 #include <bcm/bcm28xx.h>
 #include <bcm/ioctl.h>
@@ -37,33 +37,33 @@
 
 typedef struct {
     bcm_bus_protocol_t bus_proto;
-    mx_display_info_t disp_info;
+    zx_display_info_t disp_info;
     bcm_fb_desc_t fb_desc;
     io_buffer_t buffer;
     uint8_t* framebuffer;
 } bcm_display_t;
 
-static mx_status_t vc_set_mode(void* ctx, mx_display_info_t* info) {
-    return MX_OK;
+static zx_status_t vc_set_mode(void* ctx, zx_display_info_t* info) {
+    return ZX_OK;
 }
 
-static mx_status_t vc_get_mode(void* ctx, mx_display_info_t* info) {
-    if (!info) return MX_ERR_INVALID_ARGS;
+static zx_status_t vc_get_mode(void* ctx, zx_display_info_t* info) {
+    if (!info) return ZX_ERR_INVALID_ARGS;
     bcm_display_t* display = ctx;
-    memcpy(info, &display->disp_info, sizeof(mx_display_info_t));
-    return MX_OK;
+    memcpy(info, &display->disp_info, sizeof(zx_display_info_t));
+    return ZX_OK;
 }
 
-static mx_status_t vc_get_framebuffer(void* ctx, void** framebuffer) {
-    if (!framebuffer) return MX_ERR_INVALID_ARGS;
+static zx_status_t vc_get_framebuffer(void* ctx, void** framebuffer) {
+    if (!framebuffer) return ZX_ERR_INVALID_ARGS;
     bcm_display_t* display = ctx;
     (*framebuffer) = display->framebuffer;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void vc_flush_framebuffer(void* ctx) {
     bcm_display_t* display = ctx;
-    mx_cache_flush(display->framebuffer, display->fb_desc.fb_size, MX_CACHE_FLUSH_DATA);
+    zx_cache_flush(display->framebuffer, display->fb_desc.fb_size, ZX_CACHE_FLUSH_DATA);
 }
 
 static display_protocol_ops_t vc_display_proto = {
@@ -73,12 +73,12 @@
     .flush = vc_flush_framebuffer
 };
 
-static mx_protocol_device_t empty_device_proto = {
+static zx_protocol_device_t empty_device_proto = {
     .version = DEVICE_OPS_VERSION,
 };
 
-static mx_status_t bcm_vc_get_framebuffer(bcm_display_t* display, bcm_fb_desc_t* fb_desc) {
-    mx_status_t ret = MX_OK;
+static zx_status_t bcm_vc_get_framebuffer(bcm_display_t* display, bcm_fb_desc_t* fb_desc) {
+    zx_status_t ret = ZX_OK;
     iotxn_t* txn;
 
     if (!display->framebuffer) {
@@ -89,8 +89,8 @@
             return ret;
 
         iotxn_physmap(txn);
-        MX_DEBUG_ASSERT(txn->phys_count == 1);
-        mx_paddr_t phys = iotxn_phys(txn);
+        ZX_DEBUG_ASSERT(txn->phys_count == 1);
+        zx_paddr_t phys = iotxn_phys(txn);
 
         // calculate offset in buffer that will provide 16 byte alignment (physical)
         uint32_t offset = (16 - (phys % 16)) % 16;
@@ -99,7 +99,7 @@
         iotxn_cacheop(txn, IOTXN_CACHE_CLEAN, 0, txnsize);
 
         ret = bcm_bus_set_framebuffer(&display->bus_proto, phys + offset);
-        if (ret != MX_OK) {
+        if (ret != ZX_OK) {
             printf("bcm_bus_set_framebuffer failed %d\n", ret);
             return ret;
         }
@@ -110,10 +110,10 @@
         // map framebuffer into userspace
         ret = io_buffer_init_physical(&display->buffer, display->fb_desc.fb_p & 0x3fffffff,
                                       display->fb_desc.fb_size, get_root_resource(),
-                                      MX_CACHE_POLICY_CACHED);
+                                      ZX_CACHE_POLICY_CACHED);
         iotxn_release(txn);
 
-        if (ret != MX_OK) {
+        if (ret != ZX_OK) {
             printf("bcm_vc_get_framebuffer: io_buffer_init_physical failed %d\n", ret);
             return ret;
         }
@@ -121,25 +121,25 @@
         memset(display->framebuffer, 0x00, display->fb_desc.fb_size);
     }
     memcpy(fb_desc, &display->fb_desc, sizeof(bcm_fb_desc_t));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t bcm_display_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t bcm_display_bind(void* ctx, zx_device_t* parent, void** cookie) {
     bcm_display_t* display = calloc(1, sizeof(bcm_display_t));
     if (!display) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
    platform_device_protocol_t pdev;
-    mx_status_t status = device_get_protocol(parent, MX_PROTOCOL_PLATFORM_DEV, &pdev);
-    if (status !=  MX_OK) {
+    zx_status_t status = device_get_protocol(parent, ZX_PROTOCOL_PLATFORM_DEV, &pdev);
+    if (status !=  ZX_OK) {
         free(display);
         return status;
     }
 
-    status = pdev_get_protocol(&pdev, MX_PROTOCOL_BCM_BUS, &display->bus_proto);
-    if (status != MX_OK) {
-        printf("bcm_display_bind can't find MX_PROTOCOL_BCM_BUS\n");
+    status = pdev_get_protocol(&pdev, ZX_PROTOCOL_BCM_BUS, &display->bus_proto);
+    if (status != ZX_OK) {
+        printf("bcm_display_bind can't find ZX_PROTOCOL_BCM_BUS\n");
         free(display);
         return status;
     }
@@ -160,17 +160,17 @@
     framebuff_descriptor.fb_p = 0;
     framebuff_descriptor.fb_size = 0;
 
-    if (bcm_vc_get_framebuffer(display, &framebuff_descriptor) != MX_OK) {
+    if (bcm_vc_get_framebuffer(display, &framebuff_descriptor) != ZX_OK) {
         free(display);
         return status;
     }
 
-    display->disp_info.format = MX_PIXEL_FORMAT_ARGB_8888;
+    display->disp_info.format = ZX_PIXEL_FORMAT_ARGB_8888;
     display->disp_info.width = 800;
     display->disp_info.height = 480;
     display->disp_info.stride = 800;
 
-    mx_set_framebuffer(get_root_resource(), display->framebuffer,
+    zx_set_framebuffer(get_root_resource(), display->framebuffer,
                        display->fb_desc.fb_size, display->disp_info.format,
                        display->disp_info.width, display->disp_info.height,
                        display->disp_info.stride);
@@ -180,24 +180,24 @@
         .name = "bcm-vc-fbuff",
         .ctx = display,
         .ops = &empty_device_proto,
-        .proto_id = MX_PROTOCOL_DISPLAY,
+        .proto_id = ZX_PROTOCOL_DISPLAY,
         .proto_ops = &vc_display_proto,
     };
 
     status = device_add(parent, &vc_fbuff_args, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         free(display);
     }
     return status;
 }
 
-static mx_driver_ops_t bcm_display_driver_ops = {
+static zx_driver_ops_t bcm_display_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = bcm_display_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(bcm_display, bcm_display_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PLATFORM_DEV),
+ZIRCON_DRIVER_BEGIN(bcm_display, bcm_display_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PLATFORM_DEV),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_VID, PDEV_VID_BROADCOMM),
     BI_MATCH_IF(EQ, BIND_PLATFORM_DEV_DID, PDEV_DID_BROADCOMM_DISPLAY),
-MAGENTA_DRIVER_END(bcm_display)
+ZIRCON_DRIVER_END(bcm_display)
diff --git a/system/dev/display/bcm-display/rules.mk b/system/dev/display/bcm-display/rules.mk
index e29ba4e..8b33f9f 100644
--- a/system/dev/display/bcm-display/rules.mk
+++ b/system/dev/display/bcm-display/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync system/ulib/bcm
 
-MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/magenta system/ulib/mxio
+MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/zircon system/ulib/fdio
 
 include make/module.mk
diff --git a/system/dev/display/bochs-vbe/bochs-vbe.c b/system/dev/display/bochs-vbe/bochs-vbe.c
index 587ab09..d1fe79d 100644
--- a/system/dev/display/bochs-vbe/bochs-vbe.c
+++ b/system/dev/display/bochs-vbe/bochs-vbe.c
@@ -10,8 +10,8 @@
 #include <hw/pci.h>
 
 #include <assert.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -33,13 +33,13 @@
 typedef struct bochs_vbe_device {
     void* regs;
     uint64_t regs_size;
-    mx_handle_t regs_handle;
+    zx_handle_t regs_handle;
 
     void* framebuffer;
     uint64_t framebuffer_size;
-    mx_handle_t framebuffer_handle;
+    zx_handle_t framebuffer_handle;
 
-    mx_display_info_t info;
+    zx_display_info_t info;
 } bochs_vbe_device_t;
 
 #define bochs_vbe_dispi_read(base, reg) pcie_read16(base + (0x500 + (reg << 1)))
@@ -57,28 +57,28 @@
 #define BOCHS_VBE_DISPI_Y_OFFSET 0x9
 #define BOCHS_VBE_DISPI_VIDEO_MEMORY_64K 0xa
 
-static int mx_display_format_to_bpp(unsigned format) {
+static int zx_display_format_to_bpp(unsigned format) {
     unsigned bpp;
     switch (format) {
-    case MX_PIXEL_FORMAT_RGB_565:
+    case ZX_PIXEL_FORMAT_RGB_565:
         bpp = 16;
         break;
-    case MX_PIXEL_FORMAT_RGB_332:
+    case ZX_PIXEL_FORMAT_RGB_332:
         bpp = 8;
         break;
-    case MX_PIXEL_FORMAT_RGB_2220:
+    case ZX_PIXEL_FORMAT_RGB_2220:
         bpp = 6;
         break;
-    case MX_PIXEL_FORMAT_ARGB_8888:
+    case ZX_PIXEL_FORMAT_ARGB_8888:
         bpp = 32;
         break;
-    case MX_PIXEL_FORMAT_RGB_x888:
+    case ZX_PIXEL_FORMAT_RGB_x888:
         bpp = 24;
         break;
-    case MX_PIXEL_FORMAT_MONO_1:
+    case ZX_PIXEL_FORMAT_MONO_1:
         bpp = 1;
         break;
-    case MX_PIXEL_FORMAT_MONO_8:
+    case ZX_PIXEL_FORMAT_MONO_8:
         bpp = 8;
         break;
     default:
@@ -92,7 +92,7 @@
 static void set_hw_mode(bochs_vbe_device_t* dev) {
     xprintf("id: 0x%x\n", bochs_vbe_dispi_read(dev->regs, BOCHS_VBE_DISPI_ID));
 
-    int bpp = mx_display_format_to_bpp(dev->info.format);
+    int bpp = zx_display_format_to_bpp(dev->info.format);
     assert(bpp >= 0);
 
     bochs_vbe_dispi_write(dev->regs, BOCHS_VBE_DISPI_ENABLE, 0);
@@ -106,7 +106,7 @@
     bochs_vbe_dispi_write(dev->regs, BOCHS_VBE_DISPI_Y_OFFSET, 0);
     bochs_vbe_dispi_write(dev->regs, BOCHS_VBE_DISPI_ENABLE, 0x41);
 
-    mx_set_framebuffer(get_root_resource(), dev->framebuffer,
+    zx_set_framebuffer(get_root_resource(), dev->framebuffer,
                        dev->framebuffer_size, dev->info.format,
                        dev->info.width, dev->info.height, dev->info.stride);
 
@@ -128,26 +128,26 @@
 
 // implement display protocol
 
-static mx_status_t bochs_vbe_set_mode(void* ctx, mx_display_info_t* info) {
+static zx_status_t bochs_vbe_set_mode(void* ctx, zx_display_info_t* info) {
     assert(info);
     bochs_vbe_device_t* vdev = ctx;
-    memcpy(&vdev->info, info, sizeof(mx_display_info_t));
+    memcpy(&vdev->info, info, sizeof(zx_display_info_t));
     set_hw_mode(vdev);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t bochs_vbe_get_mode(void* ctx, mx_display_info_t* info) {
+static zx_status_t bochs_vbe_get_mode(void* ctx, zx_display_info_t* info) {
     assert(info);
     bochs_vbe_device_t* vdev = ctx;
-    memcpy(info, &vdev->info, sizeof(mx_display_info_t));
-    return MX_OK;
+    memcpy(info, &vdev->info, sizeof(zx_display_info_t));
+    return ZX_OK;
 }
 
-static mx_status_t bochs_vbe_get_framebuffer(void* ctx, void** framebuffer) {
+static zx_status_t bochs_vbe_get_framebuffer(void* ctx, void** framebuffer) {
     assert(framebuffer);
     bochs_vbe_device_t* vdev = ctx;
     (*framebuffer) = vdev->framebuffer;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static display_protocol_ops_t bochs_vbe_display_proto = {
@@ -162,57 +162,57 @@
     bochs_vbe_device_t* vdev = ctx;
 
     if (vdev->regs) {
-        mx_handle_close(vdev->regs_handle);
+        zx_handle_close(vdev->regs_handle);
         vdev->regs_handle = -1;
     }
 
     if (vdev->framebuffer) {
-        mx_handle_close(vdev->framebuffer_handle);
+        zx_handle_close(vdev->framebuffer_handle);
         vdev->framebuffer_handle = -1;
     }
 
     free(vdev);
 }
 
-static mx_protocol_device_t bochs_vbe_device_proto = {
+static zx_protocol_device_t bochs_vbe_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .release = bochs_vbe_release,
 };
 
 // implement driver object:
 
-static mx_status_t bochs_vbe_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t bochs_vbe_bind(void* ctx, zx_device_t* dev, void** cookie) {
     pci_protocol_t pci;
-    mx_status_t status;
+    zx_status_t status;
 
-    if (device_get_protocol(dev, MX_PROTOCOL_PCI, &pci))
-        return MX_ERR_NOT_SUPPORTED;
+    if (device_get_protocol(dev, ZX_PROTOCOL_PCI, &pci))
+        return ZX_ERR_NOT_SUPPORTED;
 
     // map resources and initialize the device
     bochs_vbe_device_t* device = calloc(1, sizeof(bochs_vbe_device_t));
     if (!device)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // map register window
-    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_2, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_2, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                               &device->regs, &device->regs_size,
                               &device->regs_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("bochs-vbe: failed to map pci config: %d\n", status);
         goto fail;
     }
 
     // map framebuffer window
-    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0,  MX_CACHE_POLICY_WRITE_COMBINING,
+    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0,  ZX_CACHE_POLICY_WRITE_COMBINING,
                               &device->framebuffer,
                               &device->framebuffer_size,
                               &device->framebuffer_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("bochs-vbe: failed to map pci config: %d\n", status);
         goto fail;
     }
 
-    device->info.format = MX_PIXEL_FORMAT_RGB_565;
+    device->info.format = ZX_PIXEL_FORMAT_RGB_565;
     device->info.width = 1024;
     device->info.height = 768;
     device->info.stride = 1024;
@@ -224,33 +224,33 @@
         .name = "bochs_vbe",
         .ctx = device,
         .ops = &bochs_vbe_device_proto,
-        .proto_id = MX_PROTOCOL_DISPLAY,
+        .proto_id = ZX_PROTOCOL_DISPLAY,
         .proto_ops = &bochs_vbe_display_proto,
     };
 
     status = device_add(dev, &args, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
     xprintf("initialized bochs_vbe display driver, reg=0x%x regsize=0x%x fb=0x%x fbsize=0x%x\n",
             device->regs, device->regs_size, device->framebuffer, device->framebuffer_size);
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     free(device);
     return status;
 }
 
-static mx_driver_ops_t bochs_vbe_driver_ops = {
+static zx_driver_ops_t bochs_vbe_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = bochs_vbe_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(bochs_vbe, bochs_vbe_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+ZIRCON_DRIVER_BEGIN(bochs_vbe, bochs_vbe_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_VID, QEMU_VGA_VID),
     BI_MATCH_IF(EQ, BIND_PCI_DID, QEMU_VGA_DID),
-MAGENTA_DRIVER_END(bochs_vbe)
+ZIRCON_DRIVER_END(bochs_vbe)
diff --git a/system/dev/display/bochs-vbe/rules.mk b/system/dev/display/bochs-vbe/rules.mk
index 4c2eb05..da739ee 100644
--- a/system/dev/display/bochs-vbe/rules.mk
+++ b/system/dev/display/bochs-vbe/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/display/framebuffer/framebuffer.c b/system/dev/display/framebuffer/framebuffer.c
index 99e1120..dc1e1fe 100644
--- a/system/dev/display/framebuffer/framebuffer.c
+++ b/system/dev/display/framebuffer/framebuffer.c
@@ -12,11 +12,11 @@
 #include <ddk/binding.h>
 #include <ddk/protocol/display.h>
 
-#include <magenta/listnode.h>
-#include <magenta/process.h>
+#include <zircon/listnode.h>
+#include <zircon/process.h>
 
-#include <magenta/device/console.h>
-#include <magenta/device/display.h>
+#include <zircon/device/console.h>
+#include <zircon/device/display.h>
 
 typedef struct fbi fbi_t;
 typedef struct fb fb_t;
@@ -25,9 +25,9 @@
 #define GROUP_FULLSCREEN 1
 
 struct fb {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     display_protocol_t dpy;
-    mx_display_info_t info;
+    zx_display_info_t info;
     size_t bufsz;
     void* buffer;
     mtx_t lock;
@@ -36,7 +36,7 @@
     uint32_t active;
 
     // event to notify which group is active
-    mx_handle_t event;
+    zx_handle_t event;
 
     // only one fullscreen client may exist at a time
     // and we keep track of it here
@@ -55,7 +55,7 @@
 struct fbi {
     fb_t* fb;
     void* buffer;
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     uint32_t group;
 };
 
@@ -64,31 +64,31 @@
     mtx_lock(&fb->lock);
     if (acquired) {
         fb->active = GROUP_VIRTCON;
-        mx_object_signal(fb->event, MX_USER_SIGNAL_1, MX_USER_SIGNAL_0);
+        zx_object_signal(fb->event, ZX_USER_SIGNAL_1, ZX_USER_SIGNAL_0);
     } else {
         fb->active = GROUP_FULLSCREEN;
-        mx_object_signal(fb->event, MX_USER_SIGNAL_0, MX_USER_SIGNAL_1);
+        zx_object_signal(fb->event, ZX_USER_SIGNAL_0, ZX_USER_SIGNAL_1);
     }
     mtx_unlock(&fb->lock);
 }
 
-static mx_status_t fbi_get_vmo(fbi_t* fbi, mx_handle_t* vmo) {
+static zx_status_t fbi_get_vmo(fbi_t* fbi, zx_handle_t* vmo) {
     mtx_lock(&fbi->fb->lock);
-    mx_status_t r;
-    if (fbi->vmo != MX_HANDLE_INVALID) {
-        r = MX_OK;
+    zx_status_t r;
+    if (fbi->vmo != ZX_HANDLE_INVALID) {
+        r = ZX_OK;
         goto done;
     }
-    if ((r = mx_vmo_create(fbi->fb->bufsz, 0, &fbi->vmo)) < 0) {
+    if ((r = zx_vmo_create(fbi->fb->bufsz, 0, &fbi->vmo)) < 0) {
         printf("fb: cannot create vmo (%zu bytes): %d\n", fbi->fb->bufsz, r);
         goto done;
     }
-    if ((r = mx_vmar_map(mx_vmar_root_self(), 0, fbi->vmo, 0, fbi->fb->bufsz,
-                MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    if ((r = zx_vmar_map(zx_vmar_root_self(), 0, fbi->vmo, 0, fbi->fb->bufsz,
+                ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                 (uintptr_t*) &fbi->buffer)) < 0) {
         printf("fb: cannot map buffer: %d\n", r);
-        mx_handle_close(fbi->vmo);
-        fbi->vmo = MX_HANDLE_INVALID;
+        zx_handle_close(fbi->vmo);
+        fbi->vmo = ZX_HANDLE_INVALID;
         goto done;
     }
 done:
@@ -97,32 +97,32 @@
     return r;
 }
 
-static mx_status_t fbi_ioctl(void* ctx, uint32_t op,
+static zx_status_t fbi_ioctl(void* ctx, uint32_t op,
                              const void* in_buf, size_t in_len,
                              void* out_buf, size_t out_len, size_t* out_actual) {
     fbi_t* fbi = ctx;
     fb_t* fb = fbi->fb;
-    mx_status_t r;
+    zx_status_t r;
 
     switch (op) {
     case IOCTL_DISPLAY_SET_FULLSCREEN:
         //TODO: remove compat stub once no longer needed
-        return MX_OK;
+        return ZX_OK;
 
     case IOCTL_CONSOLE_SET_ACTIVE_VC:
         //TODO: remove compat stub once no longer needed
-        return MX_OK;
+        return ZX_OK;
 
     case IOCTL_DISPLAY_FLUSH_FB_REGION: {
         if (in_len != sizeof(ioctl_display_region_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         const ioctl_display_region_t* r = in_buf;
         uint32_t y = r->y;
         uint32_t h = r->height;
         if ((y >= fb->info.height) ||
             (h > (fb->info.height - y))) {
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         }
         uint32_t linesize = fb->info.stride * fb->info.pixelsize;
         mtx_lock(&fb->lock);
@@ -131,7 +131,7 @@
             FB_FLUSH(fb);
         }
         mtx_unlock(&fb->lock);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_DISPLAY_FLUSH_FB:
         mtx_lock(&fb->lock);
@@ -140,38 +140,38 @@
             FB_FLUSH(fb);
         }
         mtx_unlock(&fb->lock);
-        return MX_OK;
+        return ZX_OK;
 
     case IOCTL_DISPLAY_GET_FB: {
         if ((fbi->group == GROUP_FULLSCREEN) && FB_HAS_GPU(fb)) {
             printf("fb: fullscreen soft framebuffer not supported (GPU)\n");
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
 
         if (out_len < sizeof(ioctl_display_get_fb_t)) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         ioctl_display_get_fb_t* out = out_buf;
-        memcpy(&out->info, &fb->info, sizeof(mx_display_info_t));
+        memcpy(&out->info, &fb->info, sizeof(zx_display_info_t));
         out->info.flags = 0;
 
-        mx_handle_t vmo;
+        zx_handle_t vmo;
         if ((r = fbi_get_vmo(fbi, &vmo)) < 0) {
             return r;
         }
-        if ((r = mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &out->vmo)) < 0) {
+        if ((r = zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &out->vmo)) < 0) {
             return r;
         } else {
             *out_actual = sizeof(ioctl_display_get_fb_t);
-            return MX_OK;
+            return ZX_OK;
         }
     }
     case IOCTL_DISPLAY_SET_OWNER: {
         if (in_len != sizeof(uint32_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (fbi->group != GROUP_VIRTCON) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
         const uint32_t* n = (const uint32_t*) in_buf;
         if (FB_HAS_GPU(fb)) {
@@ -182,15 +182,15 @@
                     FB_RELEASE(fb);
                 }
             }
-            return MX_OK;
+            return ZX_OK;
         }
         mtx_lock(&fb->lock);
         if ((*n == GROUP_VIRTCON) || (fb->fullscreen == NULL)) {
             fb->active = GROUP_VIRTCON;
-            mx_object_signal(fb->event, MX_USER_SIGNAL_1, MX_USER_SIGNAL_0);
+            zx_object_signal(fb->event, ZX_USER_SIGNAL_1, ZX_USER_SIGNAL_0);
         } else {
             fb->active = GROUP_FULLSCREEN;
-            mx_object_signal(fb->event, MX_USER_SIGNAL_0, MX_USER_SIGNAL_1);
+            zx_object_signal(fb->event, ZX_USER_SIGNAL_0, ZX_USER_SIGNAL_1);
             if (fb->fullscreen->buffer) {
                 memcpy(fb->buffer, fb->fullscreen->buffer, fb->bufsz);
             } else {
@@ -199,23 +199,23 @@
             FB_FLUSH(fb);
         }
         mtx_unlock(&fb->lock);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_DISPLAY_GET_OWNERSHIP_CHANGE_EVENT: {
-        if (out_len != sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
+        if (out_len != sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        mx_handle_t* out = (mx_handle_t*) out_buf;
-        if ((r = mx_handle_duplicate(fb->event, MX_RIGHT_READ | MX_RIGHT_TRANSFER | MX_RIGHT_DUPLICATE, out)) < 0) {
+        zx_handle_t* out = (zx_handle_t*) out_buf;
+        if ((r = zx_handle_duplicate(fb->event, ZX_RIGHT_READ | ZX_RIGHT_TRANSFER | ZX_RIGHT_DUPLICATE, out)) < 0) {
             return r;
         } else {
-            *out_actual = sizeof(mx_handle_t);
-            return MX_OK;
+            *out_actual = sizeof(zx_handle_t);
+            return ZX_OK;
         }
     }
 
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -231,27 +231,27 @@
         fb->fullscreen = NULL;
         if (fb->active == GROUP_FULLSCREEN) {
             fb->active = GROUP_VIRTCON;
-            mx_object_signal(fb->event, MX_USER_SIGNAL_1, MX_USER_SIGNAL_0);
+            zx_object_signal(fb->event, ZX_USER_SIGNAL_1, ZX_USER_SIGNAL_0);
         }
     }
     mtx_unlock(&fb->lock);
 
     if (fbi->buffer) {
-        mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t) fbi->buffer, fbi->fb->bufsz);
+        zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t) fbi->buffer, fbi->fb->bufsz);
     }
-    if (fbi->vmo != MX_HANDLE_INVALID) {
-        mx_handle_close(fbi->vmo);
+    if (fbi->vmo != ZX_HANDLE_INVALID) {
+        zx_handle_close(fbi->vmo);
     }
     free(fbi);
 }
 
-mx_protocol_device_t fbi_ops = {
+zx_protocol_device_t fbi_ops = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = fbi_ioctl,
     .release = fbi_release,
 };
 
-static mx_status_t fb_open_at(void* ctx, mx_device_t** out, const char* path, uint32_t flags) {
+static zx_status_t fb_open_at(void* ctx, zx_device_t** out, const char* path, uint32_t flags) {
     fb_t* fb = ctx;
 
     uint32_t group;
@@ -263,7 +263,7 @@
 
     fbi_t* fbi;
     if ((fbi = calloc(1, sizeof(fbi_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     fbi->fb = fb;
     fbi->group = group;
@@ -273,7 +273,7 @@
         .name = "framebuffer",
         .ctx = fbi,
         .ops = &fbi_ops,
-        .proto_id = MX_PROTOCOL_DISPLAY,
+        .proto_id = ZX_PROTOCOL_DISPLAY,
         .flags = DEVICE_ADD_INSTANCE,
     };
 
@@ -286,49 +286,49 @@
             if (fb->fullscreen != NULL) {
                 mtx_unlock(&fb->lock);
                 free(fbi);
-                return MX_ERR_ALREADY_BOUND;
+                return ZX_ERR_ALREADY_BOUND;
             }
             fb->fullscreen = fbi;
             fb->active = GROUP_FULLSCREEN;
-            mx_object_signal(fb->event, MX_USER_SIGNAL_0, MX_USER_SIGNAL_1);
+            zx_object_signal(fb->event, ZX_USER_SIGNAL_0, ZX_USER_SIGNAL_1);
         }
         mtx_unlock(&fb->lock);
     }
 
-    mx_status_t r;
+    zx_status_t r;
     if ((r = device_add(fb->mxdev, &args, out)) < 0) {
         fbi_release(fbi);
         return r;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t fb_open(void* ctx, mx_device_t** out, uint32_t flags) {
+static zx_status_t fb_open(void* ctx, zx_device_t** out, uint32_t flags) {
     return fb_open_at(ctx, out, "", flags);
 }
 
 static void fb_release(void* ctx) {
     fb_t* fb = ctx;
-    mx_handle_close(fb->event);
+    zx_handle_close(fb->event);
     free(fb);
 }
 
-static mx_protocol_device_t fb_ops = {
+static zx_protocol_device_t fb_ops = {
     .version = DEVICE_OPS_VERSION,
     .open = fb_open,
     .open_at = fb_open_at,
     .release = fb_release,
 };
 
-static mx_status_t fb_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t fb_bind(void* ctx, zx_device_t* dev, void** cookie) {
     fb_t* fb;
     if ((fb = calloc(1, sizeof(fb_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t r;
-    if ((r = device_get_protocol(dev, MX_PROTOCOL_DISPLAY, &fb->dpy)) < 0) {
+    zx_status_t r;
+    if ((r = device_get_protocol(dev, ZX_PROTOCOL_DISPLAY, &fb->dpy)) < 0) {
         printf("fb: display does not support display protocol: %d\n", r);
         goto fail;
     }
@@ -341,30 +341,30 @@
         goto fail;
     }
 
-    if ((r = mx_event_create(0, &fb->event)) < 0) {
+    if ((r = zx_event_create(0, &fb->event)) < 0) {
         goto fail;
     }
-    mx_object_signal(fb->event, 0, MX_USER_SIGNAL_0);
+    zx_object_signal(fb->event, 0, ZX_USER_SIGNAL_0);
 
     // Our display drivers do not initialize pixelsize
     // Determine it based on pixel format
     switch (fb->info.format) {
-    case MX_PIXEL_FORMAT_RGB_565:
+    case ZX_PIXEL_FORMAT_RGB_565:
         fb->info.pixelsize = 2;
         break;
-    case MX_PIXEL_FORMAT_RGB_x888:
-    case MX_PIXEL_FORMAT_ARGB_8888:
+    case ZX_PIXEL_FORMAT_RGB_x888:
+    case ZX_PIXEL_FORMAT_ARGB_8888:
         fb->info.pixelsize = 4;
         break;
-    case MX_PIXEL_FORMAT_RGB_332:
+    case ZX_PIXEL_FORMAT_RGB_332:
         fb->info.pixelsize = 1;
         break;
-    case MX_PIXEL_FORMAT_RGB_2220:
+    case ZX_PIXEL_FORMAT_RGB_2220:
         fb->info.pixelsize = 1;
         break;
     default:
         printf("fb: unknown format %u\n", fb->info.format);
-        r = MX_ERR_NOT_SUPPORTED;
+        r = ZX_ERR_NOT_SUPPORTED;
         goto fail;
     }
 
@@ -383,7 +383,7 @@
         .name = "framebuffer",
         .ctx = fb,
         .ops = &fb_ops,
-        .proto_id = MX_PROTOCOL_FRAMEBUFFER,
+        .proto_id = ZX_PROTOCOL_FRAMEBUFFER,
     };
 
     if ((r = device_add(dev, &args, &fb->mxdev)) < 0) {
@@ -394,19 +394,19 @@
         fb->dpy.ops->set_ownership_change_callback(fb->dpy.ctx, fb_callback, fb);
         FB_ACQUIRE(fb);
     }
-    return MX_OK;
+    return ZX_OK;
 
 fail:
-    mx_handle_close(fb->event);
+    zx_handle_close(fb->event);
     free(fb);
     return r;
 }
 
-static mx_driver_ops_t fb_driver_ops = {
+static zx_driver_ops_t fb_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = fb_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(framebuffer, fb_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_DISPLAY),
-MAGENTA_DRIVER_END(framebuffer)
\ No newline at end of file
+ZIRCON_DRIVER_BEGIN(framebuffer, fb_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_DISPLAY),
+ZIRCON_DRIVER_END(framebuffer)
\ No newline at end of file
diff --git a/system/dev/display/framebuffer/rules.mk b/system/dev/display/framebuffer/rules.mk
index 5031d98..8b13bfd 100644
--- a/system/dev/display/framebuffer/rules.mk
+++ b/system/dev/display/framebuffer/rules.mk
@@ -14,7 +14,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/display/intel-i915/intel-i915.c b/system/dev/display/intel-i915/intel-i915.c
index c20b069..3c332e8 100644
--- a/system/dev/display/intel-i915/intel-i915.c
+++ b/system/dev/display/intel-i915/intel-i915.c
@@ -10,8 +10,8 @@
 #include <hw/pci.h>
 
 #include <assert.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -38,13 +38,13 @@
 typedef struct intel_i915_device {
     void* regs;
     uint64_t regs_size;
-    mx_handle_t regs_handle;
+    zx_handle_t regs_handle;
 
     void* framebuffer;
     uint64_t framebuffer_size;
-    mx_handle_t framebuffer_handle;
+    zx_handle_t framebuffer_handle;
 
-    mx_display_info_t info;
+    zx_display_info_t info;
     uint32_t flags;
 } intel_i915_device_t;
 
@@ -66,22 +66,22 @@
 
 // implement display protocol
 
-static mx_status_t intel_i915_set_mode(void* ctx, mx_display_info_t* info) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t intel_i915_set_mode(void* ctx, zx_display_info_t* info) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t intel_i915_get_mode(void* ctx, mx_display_info_t* info) {
+static zx_status_t intel_i915_get_mode(void* ctx, zx_display_info_t* info) {
     assert(info);
     intel_i915_device_t* device = ctx;
-    memcpy(info, &device->info, sizeof(mx_display_info_t));
-    return MX_OK;
+    memcpy(info, &device->info, sizeof(zx_display_info_t));
+    return ZX_OK;
 }
 
-static mx_status_t intel_i915_get_framebuffer(void* ctx, void** framebuffer) {
+static zx_status_t intel_i915_get_framebuffer(void* ctx, void** framebuffer) {
     assert(framebuffer);
     intel_i915_device_t* device = ctx;
     (*framebuffer) = device->framebuffer;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static display_protocol_ops_t intel_i915_display_proto = {
@@ -92,14 +92,14 @@
 
 // implement device protocol
 
-static mx_status_t intel_i915_open(void* ctx, mx_device_t** out, uint32_t flags) {
+static zx_status_t intel_i915_open(void* ctx, zx_device_t** out, uint32_t flags) {
     intel_i915_device_t* device = ctx;
     intel_i915_enable_backlight(device, true);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t intel_i915_close(void* ctx, uint32_t flags) {
-    return MX_OK;
+static zx_status_t intel_i915_close(void* ctx, uint32_t flags) {
+    return ZX_OK;
 }
 
 static void intel_i915_release(void* ctx) {
@@ -107,19 +107,19 @@
     intel_i915_enable_backlight(device, false);
 
     if (device->regs) {
-        mx_handle_close(device->regs_handle);
+        zx_handle_close(device->regs_handle);
         device->regs_handle = -1;
     }
 
     if (device->framebuffer) {
-        mx_handle_close(device->framebuffer_handle);
+        zx_handle_close(device->framebuffer_handle);
         device->framebuffer_handle = -1;
     }
 
     free(device);
 }
 
-static mx_protocol_device_t intel_i915_device_proto = {
+static zx_protocol_device_t intel_i915_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .open = intel_i915_open,
     .close = intel_i915_close,
@@ -128,68 +128,68 @@
 
 // implement driver object:
 
-static mx_status_t intel_i915_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t intel_i915_bind(void* ctx, zx_device_t* dev, void** cookie) {
     pci_protocol_t pci;
-    if (device_get_protocol(dev, MX_PROTOCOL_PCI, &pci))
-        return MX_ERR_NOT_SUPPORTED;
+    if (device_get_protocol(dev, ZX_PROTOCOL_PCI, &pci))
+        return ZX_ERR_NOT_SUPPORTED;
 
     // map resources and initialize the device
     intel_i915_device_t* device = calloc(1, sizeof(intel_i915_device_t));
     if (!device)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     const pci_config_t* pci_config;
     size_t config_size;
-    mx_handle_t cfg_handle = MX_HANDLE_INVALID;
-    mx_status_t status = pci_map_resource(&pci, PCI_RESOURCE_CONFIG,
-                                          MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_handle_t cfg_handle = ZX_HANDLE_INVALID;
+    zx_status_t status = pci_map_resource(&pci, PCI_RESOURCE_CONFIG,
+                                          ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                           (void**)&pci_config,
                                           &config_size, &cfg_handle);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         if (pci_config->device_id == INTEL_I915_BROADWELL_DID) {
             // TODO: this should be based on the specific target
             device->flags |= FLAGS_BACKLIGHT;
         }
-        mx_handle_close(cfg_handle);
+        zx_handle_close(cfg_handle);
     }
 
     // map register window
-    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                               &device->regs, &device->regs_size, &device->regs_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("i915: failed to map bar 0: %d\n", status);
         goto fail;
     }
 
     // map framebuffer window
-    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_2, MX_CACHE_POLICY_WRITE_COMBINING,
+    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_2, ZX_CACHE_POLICY_WRITE_COMBINING,
                               &device->framebuffer,
                               &device->framebuffer_size,
                               &device->framebuffer_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("i915: failed to map bar 2: %d\n", status);
         goto fail;
     }
 
-    mx_display_info_t* di = &device->info;
+    zx_display_info_t* di = &device->info;
     uint32_t format, width, height, stride;
-    status = mx_bootloader_fb_get_info(&format, &width, &height, &stride);
-    if (status == MX_OK) {
+    status = zx_bootloader_fb_get_info(&format, &width, &height, &stride);
+    if (status == ZX_OK) {
         di->format = format;
         di->width = width;
         di->height = height;
         di->stride = stride;
     } else {
-        di->format = MX_PIXEL_FORMAT_RGB_565;
+        di->format = ZX_PIXEL_FORMAT_RGB_565;
         di->width = 2560 / 2;
         di->height = 1700 / 2;
         di->stride = 2560 / 2;
     }
-    di->flags = MX_DISPLAY_FLAG_HW_FRAMEBUFFER;
+    di->flags = ZX_DISPLAY_FLAG_HW_FRAMEBUFFER;
 
     // TODO remove when the gfxconsole moves to user space
     intel_i915_enable_backlight(device, true);
-    mx_set_framebuffer(get_root_resource(), device->framebuffer, device->framebuffer_size,
+    zx_set_framebuffer(get_root_resource(), device->framebuffer, device->framebuffer_size,
                        format, width, height, stride);
 
     // create and add the display (char) device
@@ -198,33 +198,33 @@
         .name = "intel_i915_disp",
         .ctx = device,
         .ops = &intel_i915_device_proto,
-        .proto_id = MX_PROTOCOL_DISPLAY,
+        .proto_id = ZX_PROTOCOL_DISPLAY,
         .proto_ops = &intel_i915_display_proto,
     };
 
     status = device_add(dev, &args, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
     xprintf("initialized intel i915 display driver, reg=%p regsize=0x%llx fb=%p fbsize=0x%llx\n",
             device->regs, device->regs_size, device->framebuffer, device->framebuffer_size);
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     free(device);
     return status;
 }
 
-static mx_driver_ops_t intel_i915_driver_ops = {
+static zx_driver_ops_t intel_i915_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = intel_i915_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(intel_i915, intel_i915_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+ZIRCON_DRIVER_BEGIN(intel_i915, intel_i915_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_VID, INTEL_I915_VID),
     BI_MATCH_IF(EQ, BIND_PCI_CLASS, 0x3), // Display class
-MAGENTA_DRIVER_END(intel_i915)
+ZIRCON_DRIVER_END(intel_i915)
diff --git a/system/dev/display/intel-i915/rules.mk b/system/dev/display/intel-i915/rules.mk
index c880a6f..ce40d58 100644
--- a/system/dev/display/intel-i915/rules.mk
+++ b/system/dev/display/intel-i915/rules.mk
@@ -14,7 +14,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/ethernet/asix-88179/asix-88179.c b/system/dev/ethernet/asix-88179/asix-88179.c
index b3d263f..6aabe76 100644
--- a/system/dev/ethernet/asix-88179/asix-88179.c
+++ b/system/dev/ethernet/asix-88179/asix-88179.c
@@ -8,9 +8,9 @@
 #include <ddk/driver.h>
 #include <ddk/protocol/ethernet.h>
 #include <driver/usb.h>
-#include <magenta/assert.h>
-#include <magenta/device/ethernet.h>
-#include <magenta/listnode.h>
+#include <zircon/assert.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/listnode.h>
 #include <pretty/hexdump.h>
 #include <sync/completion.h>
 
@@ -33,8 +33,8 @@
 #define MAX_ETH_HDRS 26
 
 typedef struct {
-    mx_device_t* device;
-    mx_device_t* usb_device;
+    zx_device_t* device;
+    zx_device_t* usb_device;
     usb_protocol_t usb;
 
     uint8_t mac_addr[6];
@@ -79,10 +79,10 @@
     // TODO: support additional tx header fields
 } ax88179_tx_hdr_t;
 
-static mx_status_t ax88179_read_mac(ax88179_t* eth, uint8_t reg_addr, uint8_t reg_len, void* data) {
-    mx_status_t status = usb_control(&eth->usb, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+static zx_status_t ax88179_read_mac(ax88179_t* eth, uint8_t reg_addr, uint8_t reg_len, void* data) {
+    zx_status_t status = usb_control(&eth->usb, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                                      AX88179_REQ_MAC, reg_addr, reg_len, data, reg_len,
-                                     MX_TIME_INFINITE);
+                                     ZX_TIME_INFINITE);
     if (driver_get_log_flags() & DDK_LOG_SPEW) {
         dprintf(SPEW, "read mac %#x:\n", reg_addr);
         if (status > 0) {
@@ -92,29 +92,29 @@
     return status;
 }
 
-static mx_status_t ax88179_write_mac(ax88179_t* eth, uint8_t reg_addr, uint8_t reg_len, void* data) {
+static zx_status_t ax88179_write_mac(ax88179_t* eth, uint8_t reg_addr, uint8_t reg_len, void* data) {
     if (driver_get_log_flags() & DDK_LOG_SPEW) {
         dprintf(SPEW, "write mac %#x:\n", reg_addr);
         hexdump8(data, reg_len);
     }
     return usb_control(&eth->usb, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, AX88179_REQ_MAC,
-                       reg_addr, reg_len, data, reg_len, MX_TIME_INFINITE);
+                       reg_addr, reg_len, data, reg_len, ZX_TIME_INFINITE);
 }
 
-static mx_status_t ax88179_read_phy(ax88179_t* eth, uint8_t reg_addr, uint16_t* data) {
-    mx_status_t status = usb_control(&eth->usb, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+static zx_status_t ax88179_read_phy(ax88179_t* eth, uint8_t reg_addr, uint16_t* data) {
+    zx_status_t status = usb_control(&eth->usb, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                                      AX88179_REQ_PHY, AX88179_PHY_ID, reg_addr, data, sizeof(*data),
-                                     MX_TIME_INFINITE);
+                                     ZX_TIME_INFINITE);
     if (status == sizeof(*data)) {
         dprintf(SPEW, "read phy %#x: %#x\n", reg_addr, *data);
     }
     return status;
 }
 
-static mx_status_t ax88179_write_phy(ax88179_t* eth, uint8_t reg_addr, uint16_t data) {
+static zx_status_t ax88179_write_phy(ax88179_t* eth, uint8_t reg_addr, uint16_t data) {
     dprintf(SPEW, "write phy %#x: %#x\n", reg_addr, data);
     return usb_control(&eth->usb, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, AX88179_REQ_PHY,
-                       AX88179_PHY_ID, reg_addr, &data, sizeof(data), MX_TIME_INFINITE);
+                       AX88179_PHY_ID, reg_addr, &data, sizeof(data), ZX_TIME_INFINITE);
 }
 
 static uint8_t ax88179_media_mode[6][2] = {
@@ -154,11 +154,11 @@
     },
 };
 
-static mx_status_t ax88179_configure_bulk_in(ax88179_t* eth, uint8_t plsr) {
+static zx_status_t ax88179_configure_bulk_in(ax88179_t* eth, uint8_t plsr) {
     uint8_t usb_mode = plsr & AX88179_PLSR_USB_MASK;
     if (usb_mode & (usb_mode-1)) {
         dprintf(ERROR, "ax88179: invalid usb mode: %#x\n", usb_mode);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uint8_t speed = plsr & AX88179_PLSR_EPHY_MASK;
@@ -166,7 +166,7 @@
         dprintf(ERROR, "ax88179: invalid eth speed: %#x\n", speed);
     }
 
-    mx_status_t status = ax88179_write_mac(eth, AX88179_MAC_RQCR, 5,
+    zx_status_t status = ax88179_write_mac(eth, AX88179_MAC_RQCR, 5,
             ax88179_bulk_in_config[usb_mode][speed >> 4]);
     if (status < 0) {
         dprintf(ERROR, "ax88179_write_mac to %#x failed: %d\n", AX88179_MAC_RQCR, status);
@@ -174,9 +174,9 @@
     return status;
 }
 
-static mx_status_t ax88179_configure_medium_mode(ax88179_t* eth) {
+static zx_status_t ax88179_configure_medium_mode(ax88179_t* eth) {
     uint16_t data = 0;
-    mx_status_t status = ax88179_read_phy(eth, AX88179_PHY_PHYSR, &data);
+    zx_status_t status = ax88179_read_phy(eth, AX88179_PHY_PHYSR, &data);
     if (status < 0) {
         dprintf(ERROR, "ax88179_read_phy to %#x failed: %d\n", AX88179_PHY_PHYSR, status);
         return status;
@@ -186,7 +186,7 @@
     dprintf(TRACE, "ax88179 medium mode: %#x\n", mode);
     if (mode == 4 || mode > 5) {
         dprintf(ERROR, "ax88179 mode invalid (mode=%u)\n", mode);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     status = ax88179_write_mac(eth, AX88179_MAC_MSR, 2, ax88179_media_mode[mode]);
     if (status < 0) {
@@ -205,12 +205,12 @@
     return status;
 }
 
-static mx_status_t ax88179_recv(ax88179_t* eth, iotxn_t* request) {
+static zx_status_t ax88179_recv(ax88179_t* eth, iotxn_t* request) {
     dprintf(SPEW, "request len %" PRIu64"\n", request->actual);
 
     if (request->actual < 4) {
         dprintf(ERROR, "ax88179_recv short packet\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     uint8_t* read_data = NULL;
@@ -221,7 +221,7 @@
     dprintf(SPEW, "rxhdr offset %u, num %u\n", rxhdr->pkt_hdr_off, rxhdr->num_pkts);
     if (rxhdr->num_pkts < 1 || rxhdr->pkt_hdr_off >= rxhdr_off) {
         dprintf(ERROR, "%s bad packet\n", __func__);
-        return MX_ERR_IO_DATA_INTEGRITY;
+        return ZX_ERR_IO_DATA_INTEGRITY;
     }
 
     size_t offset = 0;
@@ -234,18 +234,18 @@
         if ((uintptr_t)pkt_hdr >= (uintptr_t)rxhdr) {
             dprintf(ERROR, "%s packet header out of bounds, packet header=%p rx header=%p\n",
                     __func__, pkt_hdr, rxhdr);
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         }
         uint16_t pkt_len = le16toh((*pkt_hdr & AX88179_RX_PKTLEN) >> 16);
         dprintf(SPEW, "pkt_hdr: %0#x pkt_len: %u\n", *pkt_hdr, pkt_len);
         if (pkt_len < 2) {
             dprintf(ERROR, "%s short packet (len=%u)\n", __func__,  pkt_len);
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         }
         if (offset + pkt_len > rxhdr->pkt_hdr_off) {
             dprintf(ERROR, "%s invalid packet length %u > %lu bytes remaining\n",
                     __func__, pkt_len, rxhdr->pkt_hdr_off - offset);
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         }
 
         bool drop = false;
@@ -275,22 +275,22 @@
         offset = ALIGN(offset, 8);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void ax88179_read_complete(iotxn_t* request, void* cookie) {
     ax88179_t* eth = (ax88179_t*)cookie;
 
-    if (request->status == MX_ERR_IO_NOT_PRESENT) {
+    if (request->status == ZX_ERR_IO_NOT_PRESENT) {
         iotxn_release(request);
         return;
     }
 
     mtx_lock(&eth->mutex);
-    if (request->status == MX_ERR_IO_REFUSED) {
+    if (request->status == ZX_ERR_IO_REFUSED) {
         dprintf(TRACE, "ax88179_read_complete usb_reset_endpoint\n");
         usb_reset_endpoint(&eth->usb, eth->bulk_in_addr);
-    } else if ((request->status == MX_OK) && eth->ifc) {
+    } else if ((request->status == ZX_OK) && eth->ifc) {
         ax88179_recv(eth, request);
     }
 
@@ -306,15 +306,15 @@
     dprintf(DEBUG1, "ax88179: write complete\n");
     ax88179_t* eth = (ax88179_t*)cookie;
 
-    if (request->status == MX_ERR_IO_NOT_PRESENT) {
+    if (request->status == ZX_ERR_IO_NOT_PRESENT) {
         iotxn_release(request);
         return;
     }
 
     mtx_lock(&eth->tx_lock);
-    MX_DEBUG_ASSERT(eth->tx_in_flight <= MAX_TX_IN_FLIGHT);
+    ZX_DEBUG_ASSERT(eth->tx_in_flight <= MAX_TX_IN_FLIGHT);
     list_add_tail(&eth->free_write_reqs, &request->node);
-    if (request->status == MX_ERR_IO_REFUSED) {
+    if (request->status == ZX_ERR_IO_REFUSED) {
         dprintf(TRACE, "ax88179_write_complete usb_reset_endpoint\n");
         usb_reset_endpoint(&eth->usb, eth->bulk_out_addr);
     }
@@ -328,7 +328,7 @@
                  next, next->length, eth->tx_in_flight);
         iotxn_queue(eth->usb_device, next);
     }
-    MX_DEBUG_ASSERT(eth->tx_in_flight <= MAX_TX_IN_FLIGHT);
+    ZX_DEBUG_ASSERT(eth->tx_in_flight <= MAX_TX_IN_FLIGHT);
     mtx_unlock(&eth->tx_lock);
 }
 
@@ -339,7 +339,7 @@
 
 static void ax88179_handle_interrupt(ax88179_t* eth, iotxn_t* request) {
     mtx_lock(&eth->mutex);
-    if (request->status == MX_OK && request->actual == sizeof(eth->status)) {
+    if (request->status == ZX_OK && request->actual == sizeof(eth->status)) {
         uint8_t status[INTR_REQ_SIZE];
 
         iotxn_copyfrom(request, status, sizeof(status), 0);
@@ -385,7 +385,7 @@
     ax88179_t* eth = ctx;
 
     mtx_lock(&eth->tx_lock);
-    MX_DEBUG_ASSERT(eth->tx_in_flight <= MAX_TX_IN_FLIGHT);
+    ZX_DEBUG_ASSERT(eth->tx_in_flight <= MAX_TX_IN_FLIGHT);
     // 1. Find the iotxn we will be writing into.
     //   a) If pending_tx is empty, grab an iotxn from free_write_reqs.
     //   b) Else take the tail of pending_tx.
@@ -412,7 +412,7 @@
         dprintf(DEBUG1, "ax88179: got tail iotxn (%p)\n", txn);
     }
 
-    mx_off_t txn_len = ALIGN(txn->length, 4);
+    zx_off_t txn_len = ALIGN(txn->length, 4);
     dprintf(DEBUG1, "ax88179: current iotxn len=%lu, next packet len=%zu\n", txn_len, length);
     if (length > USB_BUF_SIZE - sizeof(ax88179_tx_hdr_t) - txn_len) {
         dprintf(DEBUG1, "ax88179: getting new write req\n");
@@ -450,7 +450,7 @@
              txn, txn->length, eth->tx_in_flight);
     iotxn_queue(eth->usb_device, txn);
     eth->tx_in_flight++;
-    MX_DEBUG_ASSERT(eth->tx_in_flight <= MAX_TX_IN_FLIGHT);
+    ZX_DEBUG_ASSERT(eth->tx_in_flight <= MAX_TX_IN_FLIGHT);
     mtx_unlock(&eth->tx_lock);
 }
 
@@ -484,25 +484,25 @@
     ax88179_free(eth);
 }
 
-static mx_protocol_device_t ax88179_device_proto = {
+static zx_protocol_device_t ax88179_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = ax88179_unbind,
     .release = ax88179_release,
 };
 
 
-static mx_status_t ax88179_query(void* ctx, uint32_t options, ethmac_info_t* info) {
+static zx_status_t ax88179_query(void* ctx, uint32_t options, ethmac_info_t* info) {
     ax88179_t* eth = ctx;
 
     if (options) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     memset(info, 0, sizeof(*info));
     info->mtu = 1500;
     memcpy(info->mac, eth->mac_addr, sizeof(eth->mac_addr));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void ax88179_stop(void* ctx) {
@@ -512,13 +512,13 @@
     mtx_unlock(&eth->mutex);
 }
 
-static mx_status_t ax88179_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
+static zx_status_t ax88179_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
     ax88179_t* eth = ctx;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&eth->mutex);
     if (eth->ifc) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     } else {
         eth->ifc = ifc;
         eth->cookie = cookie;
@@ -540,7 +540,7 @@
 #define READ_REG(r, len) \
     do { \
         reg = 0; \
-        mx_status_t status = ax88179_read_mac(eth, r, len, &reg); \
+        zx_status_t status = ax88179_read_mac(eth, r, len, &reg); \
         if (status < 0) { \
             dprintf(ERROR, "ax88179: could not read reg " #r ": %d\n", status); \
         } else { \
@@ -566,19 +566,19 @@
 
     uint32_t data = 0;
     // Enable embedded PHY
-    mx_status_t status = ax88179_write_mac(eth, AX88179_MAC_EPPRCR, 2, &data);
+    zx_status_t status = ax88179_write_mac(eth, AX88179_MAC_EPPRCR, 2, &data);
     if (status < 0) {
         dprintf(ERROR, "ax88179_write_mac to %#x failed: %d\n", AX88179_MAC_EPPRCR, status);
         goto fail;
     }
-    mx_nanosleep(mx_deadline_after(MX_MSEC(1)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(1)));
     data = 0x0020;
     status = ax88179_write_mac(eth, AX88179_MAC_EPPRCR, 2, &data);
     if (status < 0) {
         dprintf(ERROR, "ax88179_write_mac to %#x failed: %d\n", AX88179_MAC_EPPRCR, status);
         goto fail;
     }
-    mx_nanosleep(mx_deadline_after(MX_MSEC(200)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(200)));
 
     // Switch clock to normal speed
     data = 0x03;
@@ -587,7 +587,7 @@
         dprintf(ERROR, "ax88179_write_mac to %#x failed: %d\n", AX88179_MAC_CLKSR, status);
         goto fail;
     }
-    mx_nanosleep(mx_deadline_after(MX_MSEC(1)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(1)));
 
     // Read the MAC addr
     status = ax88179_read_mac(eth, AX88179_MAC_NIDR, 6, eth->mac_addr);
@@ -682,7 +682,7 @@
         .name = "ax88179",
         .ctx = eth,
         .ops = &ax88179_device_proto,
-        .proto_id = MX_PROTOCOL_ETHERMAC,
+        .proto_id = ZX_PROTOCOL_ETHERMAC,
         .proto_ops = &ethmac_ops,
     };
 
@@ -697,8 +697,8 @@
     while (true) {
         completion_reset(&eth->completion);
         iotxn_queue(eth->usb_device, txn);
-        completion_wait(&eth->completion, MX_TIME_INFINITE);
-        if (txn->status != MX_OK) {
+        completion_wait(&eth->completion, ZX_TIME_INFINITE);
+        if (txn->status != ZX_OK) {
             return txn->status;
         }
         count++;
@@ -715,12 +715,12 @@
     return status;
 }
 
-static mx_status_t ax88179_bind(void* ctx, mx_device_t* device, void** cookie) {
+static zx_status_t ax88179_bind(void* ctx, zx_device_t* device, void** cookie) {
     dprintf(TRACE, "ax88179_bind\n");
 
     usb_protocol_t usb;
-    mx_status_t result = device_get_protocol(device, MX_PROTOCOL_USB, &usb);
-    if (result != MX_OK) {
+    zx_status_t result = device_get_protocol(device, ZX_PROTOCOL_USB, &usb);
+    if (result != ZX_OK) {
         return result;
     }
 
@@ -732,7 +732,7 @@
     usb_interface_descriptor_t* intf = usb_desc_iter_next_interface(&iter, true);
     if (!intf || intf->bNumEndpoints != 3) {
         usb_desc_iter_release(&iter);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint8_t bulk_in_addr = 0;
@@ -758,13 +758,13 @@
 
     if (!bulk_in_addr || !bulk_out_addr || !intr_addr) {
         dprintf(ERROR, "ax88179_bind could not find endpoints\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     ax88179_t* eth = calloc(1, sizeof(ax88179_t));
     if (!eth) {
         dprintf(ERROR, "Not enough memory for ax88179_t\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     list_initialize(&eth->free_read_reqs);
@@ -778,11 +778,11 @@
     eth->bulk_in_addr = bulk_in_addr;
     eth->bulk_out_addr = bulk_out_addr;
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     for (int i = 0; i < READ_REQ_COUNT; i++) {
         iotxn_t* req = usb_alloc_iotxn(bulk_in_addr, USB_BUF_SIZE);
         if (!req) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         req->length = USB_BUF_SIZE;
@@ -793,7 +793,7 @@
     for (int i = 0; i < WRITE_REQ_COUNT; i++) {
         iotxn_t* req = usb_alloc_iotxn(bulk_out_addr, USB_BUF_SIZE);
         if (!req) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         req->length = USB_BUF_SIZE;
@@ -803,7 +803,7 @@
     }
     iotxn_t* int_req = usb_alloc_iotxn(intr_addr, INTR_REQ_SIZE);
     if (!int_req) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto fail;
     }
     int_req->length = INTR_REQ_SIZE;
@@ -815,7 +815,7 @@
     status = usb_set_configuration(device, 1);
     if (status < 0) {
         dprintf(ERROR, "aax88179_bind could not set configuration: %d\n", status);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     */
 
@@ -823,7 +823,7 @@
     if (ret != thrd_success) {
         goto fail;
     }
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     dprintf(ERROR, "ax88179_bind failed: %d\n", status);
@@ -831,13 +831,13 @@
     return status;
 }
 
-static mx_driver_ops_t ax88179_driver_ops = {
+static zx_driver_ops_t ax88179_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ax88179_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(ethernet_ax88179, ax88179_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB),
+ZIRCON_DRIVER_BEGIN(ethernet_ax88179, ax88179_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB),
     BI_ABORT_IF(NE, BIND_USB_VID, ASIX_VID),
     BI_MATCH_IF(EQ, BIND_USB_PID, AX88179_PID),
-MAGENTA_DRIVER_END(ethernet_ax88179)
+ZIRCON_DRIVER_END(ethernet_ax88179)
diff --git a/system/dev/ethernet/asix-88179/rules.mk b/system/dev/ethernet/asix-88179/rules.mk
index 00fcc41..4e00e68 100644
--- a/system/dev/ethernet/asix-88179/rules.mk
+++ b/system/dev/ethernet/asix-88179/rules.mk
@@ -8,7 +8,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/pretty system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 MODULE := $(LOCAL_DIR)
 
diff --git a/system/dev/ethernet/asix-88772b/asix-88772b.c b/system/dev/ethernet/asix-88772b/asix-88772b.c
index 72b113c..56db320 100644
--- a/system/dev/ethernet/asix-88772b/asix-88772b.c
+++ b/system/dev/ethernet/asix-88772b/asix-88772b.c
@@ -7,8 +7,8 @@
 #include <ddk/binding.h>
 #include <ddk/protocol/ethernet.h>
 #include <driver/usb.h>
-#include <magenta/device/ethernet.h>
-#include <magenta/listnode.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/listnode.h>
 
 #include <inttypes.h>
 #include <stdio.h>
@@ -27,8 +27,8 @@
 #define ETH_HEADER_SIZE 4
 
 typedef struct {
-    mx_device_t* device;
-    mx_device_t* usb_device;
+    zx_device_t* device;
+    zx_device_t* usb_device;
     usb_protocol_t usb;
 
     uint8_t phy_id;
@@ -49,21 +49,21 @@
     mtx_t mutex;
 } ax88772b_t;
 
-static mx_status_t ax88772b_set_value(ax88772b_t* eth, uint8_t request, uint16_t value) {
+static zx_status_t ax88772b_set_value(ax88772b_t* eth, uint8_t request, uint16_t value) {
     return usb_control(&eth->usb, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-                       request, value, 0, NULL, 0, MX_TIME_INFINITE);
+                       request, value, 0, NULL, 0, ZX_TIME_INFINITE);
 }
 
-static mx_status_t ax88772b_mdio_read(ax88772b_t* eth, uint8_t offset, uint16_t* value) {
+static zx_status_t ax88772b_mdio_read(ax88772b_t* eth, uint8_t offset, uint16_t* value) {
 
-    mx_status_t status = ax88772b_set_value(eth, ASIX_REQ_SW_SERIAL_MGMT_CTRL, 0);
+    zx_status_t status = ax88772b_set_value(eth, ASIX_REQ_SW_SERIAL_MGMT_CTRL, 0);
     if (status < 0) {
         printf("ASIX_REQ_SW_SERIAL_MGMT_CTRL failed\n");
         return status;
     }
     status = usb_control(&eth->usb, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                          ASIX_REQ_PHY_READ, eth->phy_id, offset,
-                         value, sizeof(*value), MX_TIME_INFINITE);
+                         value, sizeof(*value), ZX_TIME_INFINITE);
     if (status < 0) {
         printf("ASIX_REQ_PHY_READ failed\n");
         return status;
@@ -74,19 +74,19 @@
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ax88772b_mdio_write(ax88772b_t* eth, uint8_t offset, uint16_t value) {
+static zx_status_t ax88772b_mdio_write(ax88772b_t* eth, uint8_t offset, uint16_t value) {
 
-    mx_status_t status = ax88772b_set_value(eth, ASIX_REQ_SW_SERIAL_MGMT_CTRL, 0);
+    zx_status_t status = ax88772b_set_value(eth, ASIX_REQ_SW_SERIAL_MGMT_CTRL, 0);
     if (status < 0) {
         printf("ASIX_REQ_SW_SERIAL_MGMT_CTRL failed\n");
         return status;
     }
     status = usb_control(&eth->usb, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                          ASIX_REQ_PHY_WRITE, eth->phy_id, offset,
-                         &value, sizeof(value), MX_TIME_INFINITE);
+                         &value, sizeof(value), ZX_TIME_INFINITE);
     if (status < 0) {
         printf("ASIX_REQ_PHY_READ failed\n");
         return status;
@@ -97,25 +97,25 @@
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ax88772b_wait_for_phy(ax88772b_t* eth) {
+static zx_status_t ax88772b_wait_for_phy(ax88772b_t* eth) {
 
     for (int i = 0; i < 100; i++) {
         uint16_t bmsr;
-        mx_status_t status = ax88772b_mdio_read(eth, ASIX_PHY_BMSR, &bmsr);
+        zx_status_t status = ax88772b_mdio_read(eth, ASIX_PHY_BMSR, &bmsr);
         if (status < 0) {
             printf("ax88772b_mdio_read failed\n");
             return status;
         }
         if (bmsr)
-            return MX_OK;
+            return ZX_OK;
         usleep(50);
     }
 
     printf("ax88772b_wait_for_phy timeout\n");
-    return MX_ERR_TIMED_OUT;
+    return ZX_ERR_TIMED_OUT;
 }
 
 static void queue_interrupt_requests_locked(ax88772b_t* eth) {
@@ -164,13 +164,13 @@
 static void ax88772b_read_complete(iotxn_t* request, void* cookie) {
     ax88772b_t* eth = (ax88772b_t*)cookie;
 
-    if (request->status == MX_ERR_IO_NOT_PRESENT) {
+    if (request->status == ZX_ERR_IO_NOT_PRESENT) {
         iotxn_release(request);
         return;
     }
 
     mtx_lock(&eth->mutex);
-    if ((request->status == MX_OK) && eth->ifc) {
+    if ((request->status == ZX_OK) && eth->ifc) {
         ax88772b_recv(eth, request);
     }
 
@@ -185,7 +185,7 @@
 static void ax88772b_write_complete(iotxn_t* request, void* cookie) {
     ax88772b_t* eth = (ax88772b_t*)cookie;
 
-    if (request->status == MX_ERR_IO_NOT_PRESENT) {
+    if (request->status == ZX_ERR_IO_NOT_PRESENT) {
         iotxn_release(request);
         return;
     }
@@ -198,13 +198,13 @@
 static void ax88772b_interrupt_complete(iotxn_t* request, void* cookie) {
     ax88772b_t* eth = (ax88772b_t*)cookie;
 
-    if (request->status == MX_ERR_IO_NOT_PRESENT) {
+    if (request->status == ZX_ERR_IO_NOT_PRESENT) {
         iotxn_release(request);
         return;
     }
 
     mtx_lock(&eth->mutex);
-    if (request->status == MX_OK && request->actual == sizeof(eth->status)) {
+    if (request->status == ZX_OK && request->actual == sizeof(eth->status)) {
         uint8_t status[INTR_REQ_SIZE];
 
         iotxn_copyfrom(request, status, sizeof(status), 0);
@@ -245,27 +245,27 @@
     mtx_unlock(&eth->mutex);
 }
 
-static mx_status_t _ax88772b_send(void* ctx, const void* buffer, size_t length) {
+static zx_status_t _ax88772b_send(void* ctx, const void* buffer, size_t length) {
     ax88772b_t* eth = ctx;
 
     if (eth->dead) {
-        return MX_ERR_PEER_CLOSED;
+        return ZX_ERR_PEER_CLOSED;
     }
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&eth->mutex);
 
     list_node_t* node = list_remove_head(&eth->free_write_reqs);
     if (!node) {
         //TODO: block
-        status = MX_ERR_BUFFER_TOO_SMALL;
+        status = ZX_ERR_BUFFER_TOO_SMALL;
         goto out;
     }
     iotxn_t* request = containerof(node, iotxn_t, node);
 
     if (length + ETH_HEADER_SIZE > USB_BUF_SIZE) {
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
         goto out;
     }
 
@@ -318,24 +318,24 @@
     ax88772b_free(eth);
 }
 
-static mx_protocol_device_t ax88772b_device_proto = {
+static zx_protocol_device_t ax88772b_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = ax88772b_unbind,
     .release = ax88772b_release,
 };
 
-static mx_status_t ax88772b_query(void* ctx, uint32_t options, ethmac_info_t* info) {
+static zx_status_t ax88772b_query(void* ctx, uint32_t options, ethmac_info_t* info) {
     ax88772b_t* eth = ctx;
 
     if (options) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     memset(info, 0, sizeof(*info));
     info->mtu = USB_BUF_SIZE - ETH_HEADER_SIZE;
     memcpy(info->mac, eth->mac_addr, sizeof(eth->mac_addr));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void ax88772b_stop(void* ctx) {
@@ -345,13 +345,13 @@
     mtx_unlock(&eth->mutex);
 }
 
-static mx_status_t ax88772b_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
+static zx_status_t ax88772b_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
     ax88772b_t* eth = ctx;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&eth->mutex);
     if (eth->ifc) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     } else {
         eth->ifc = ifc;
         eth->cookie = cookie;
@@ -377,7 +377,7 @@
     ax88772b_t* eth = (ax88772b_t*)arg;
 
     // set some GPIOs
-    mx_status_t status = ax88772b_set_value(eth, ASIX_REQ_GPIOS,
+    zx_status_t status = ax88772b_set_value(eth, ASIX_REQ_GPIOS,
                                                 ASIX_GPIO_GPO2EN | ASIX_GPIO_GPO_2 | ASIX_GPIO_RSE);
     if (status < 0) {
         printf("ASIX_REQ_WRITE_GPIOS failed\n");
@@ -387,7 +387,7 @@
     // select the PHY
     uint8_t phy_addr[2];
     status = usb_control(&eth->usb, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-                         ASIX_REQ_PHY_ADDR, 0, 0, &phy_addr, sizeof(phy_addr), MX_TIME_INFINITE);
+                         ASIX_REQ_PHY_ADDR, 0, 0, &phy_addr, sizeof(phy_addr), ZX_TIME_INFINITE);
     if (status < 0) {
         printf("ASIX_REQ_READ_PHY_ADDR failed\n");
         goto fail;
@@ -437,7 +437,7 @@
 
     status = usb_control(&eth->usb, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                          ASIX_REQ_IPG_WRITE, ASIX_IPG_DEFAULT | (ASIX_IPG1_DEFAULT << 8),
-                         ASIX_IPG2_DEFAULT, NULL, 0, MX_TIME_INFINITE);
+                         ASIX_IPG2_DEFAULT, NULL, 0, ZX_TIME_INFINITE);
     if (status < 0) {
         printf("ASIX_REQ_IPG_WRITE failed\n");
         goto fail;
@@ -451,7 +451,7 @@
 
     status = usb_control(&eth->usb, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                          ASIX_REQ_NODE_ID_READ, 0, 0, eth->mac_addr, sizeof(eth->mac_addr),
-                         MX_TIME_INFINITE);
+                         ZX_TIME_INFINITE);
     if (status < 0) {
         printf("ASIX_REQ_NODE_ID_READ failed\n");
         goto fail;
@@ -465,7 +465,7 @@
         .name = "ax88772b",
         .ctx = eth,
         .ops = &ax88772b_device_proto,
-        .proto_id = MX_PROTOCOL_ETHERMAC,
+        .proto_id = ZX_PROTOCOL_ETHERMAC,
         .proto_ops = &ethmac_ops,
     };
 
@@ -478,17 +478,17 @@
     mtx_lock(&eth->mutex);
     queue_interrupt_requests_locked(eth);
     mtx_unlock(&eth->mutex);
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     ax88772b_free(eth);
     return status;
 }
 
-static mx_status_t ax88772b_bind(void* ctx, mx_device_t* device, void** cookie) {
+static zx_status_t ax88772b_bind(void* ctx, zx_device_t* device, void** cookie) {
     usb_protocol_t usb;
-    mx_status_t result = device_get_protocol(device, MX_PROTOCOL_USB, &usb);
-    if (result != MX_OK) {
+    zx_status_t result = device_get_protocol(device, ZX_PROTOCOL_USB, &usb);
+    if (result != ZX_OK) {
         return result;
     }
 
@@ -500,7 +500,7 @@
     usb_interface_descriptor_t* intf = usb_desc_iter_next_interface(&iter, true);
     if (!intf || intf->bNumEndpoints != 3) {
         usb_desc_iter_release(&iter);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint8_t bulk_in_addr = 0;
@@ -526,13 +526,13 @@
 
     if (!bulk_in_addr || !bulk_out_addr || !intr_addr) {
         printf("ax88772b_bind could not find endpoints\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     ax88772b_t* eth = calloc(1, sizeof(ax88772b_t));
     if (!eth) {
         printf("Not enough memory for ax88772b_t\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     list_initialize(&eth->free_read_reqs);
@@ -542,11 +542,11 @@
     eth->usb_device = device;
     memcpy(&eth->usb, &usb, sizeof(eth->usb));
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     for (int i = 0; i < READ_REQ_COUNT; i++) {
         iotxn_t* req = usb_alloc_iotxn(bulk_in_addr, USB_BUF_SIZE);
         if (!req) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         req->length = USB_BUF_SIZE;
@@ -557,7 +557,7 @@
     for (int i = 0; i < WRITE_REQ_COUNT; i++) {
         iotxn_t* req = usb_alloc_iotxn(bulk_out_addr, USB_BUF_SIZE);
         if (!req) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         req->length = USB_BUF_SIZE;
@@ -568,7 +568,7 @@
     for (int i = 0; i < INTR_REQ_COUNT; i++) {
         iotxn_t* req = usb_alloc_iotxn(intr_addr, INTR_REQ_SIZE);
         if (!req) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         req->length = INTR_REQ_SIZE;
@@ -581,7 +581,7 @@
     thrd_create_with_name(&thread, ax88772b_start_thread, eth, "ax88772b_start_thread");
     thrd_detach(thread);
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     printf("ax88772b_bind failed: %d\n", status);
@@ -589,13 +589,13 @@
     return status;
 }
 
-static mx_driver_ops_t ax88772b_driver_ops = {
+static zx_driver_ops_t ax88772b_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ax88772b_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(ethernet_ax88772b, ax88772b_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB),
+ZIRCON_DRIVER_BEGIN(ethernet_ax88772b, ax88772b_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB),
     BI_ABORT_IF(NE, BIND_USB_VID, ASIX_VID),
     BI_MATCH_IF(EQ, BIND_USB_PID, ASIX_PID),
-MAGENTA_DRIVER_END(ethernet_ax88772b)
+ZIRCON_DRIVER_END(ethernet_ax88772b)
diff --git a/system/dev/ethernet/asix-88772b/rules.mk b/system/dev/ethernet/asix-88772b/rules.mk
index 2e68316..3948273 100644
--- a/system/dev/ethernet/asix-88772b/rules.mk
+++ b/system/dev/ethernet/asix-88772b/rules.mk
@@ -8,7 +8,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/pretty system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 MODULE := $(LOCAL_DIR)
 
diff --git a/system/dev/ethernet/ethernet/ethernet.c b/system/dev/ethernet/ethernet/ethernet.c
index 032a9a6..ee15add 100644
--- a/system/dev/ethernet/ethernet/ethernet.c
+++ b/system/dev/ethernet/ethernet/ethernet.c
@@ -8,11 +8,11 @@
 #include <ddk/driver.h>
 #include <ddk/protocol/ethernet.h>
 
-#include <magenta/device/ethernet.h>
-#include <magenta/listnode.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/listnode.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -24,7 +24,7 @@
 #define DEVICE_NAME_LEN 16
 
 // This is used for signaling that eth_tx_thread() should exit.
-static const mx_signals_t kSignalFifoTerminate = MX_USER_SIGNAL_0;
+static const zx_signals_t kSignalFifoTerminate = ZX_USER_SIGNAL_0;
 
 // ensure that we will not exceed fifo capacity
 static_assert((FIFO_DEPTH * FIFO_ESIZE) <= 4096, "");
@@ -32,7 +32,7 @@
 // ethernet device
 typedef struct ethdev0 {
     // shared state
-    mx_device_t* macdev;
+    zx_device_t* macdev;
     ethmac_protocol_t mac;
     uint32_t state;
 
@@ -44,7 +44,7 @@
 
     ethmac_info_t info;
     uint32_t status;
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 } ethdev0_t;
 
 // transmit thread has been created
@@ -77,20 +77,20 @@
     // fifos are named from the perspective
     // of the packet from from the client
     // to the network interface
-    mx_handle_t tx_fifo;
+    zx_handle_t tx_fifo;
     uint32_t tx_depth;
-    mx_handle_t rx_fifo;
+    zx_handle_t rx_fifo;
     uint32_t rx_depth;
 
     // io buffer
-    mx_handle_t io_vmo;
+    zx_handle_t io_vmo;
     void* io_buf;
     size_t io_size;
 
     // fifo thread
     thrd_t tx_thr;
 
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     uint32_t fail_rx_read;
     uint32_t fail_rx_write;
@@ -101,12 +101,12 @@
 
 static void eth_handle_rx(ethdev_t* edev, const void* data, size_t len, uint32_t extra) {
     eth_fifo_entry_t e;
-    mx_status_t status;
+    zx_status_t status;
     uint32_t count;
 
     // TODO: read multiple and cache locally to reduce syscalls
-    if ((status = mx_fifo_read(edev->rx_fifo, &e, sizeof(e), &count)) < 0) {
-        if (status == MX_ERR_SHOULD_WAIT) {
+    if ((status = zx_fifo_read(edev->rx_fifo, &e, sizeof(e), &count)) < 0) {
+        if (status == ZX_ERR_SHOULD_WAIT) {
             if ((edev->fail_rx_read++ % FAIL_REPORT_RATE) == 0) {
                 dprintf(ERROR, "eth [%s]: no rx buffers available (%u times)\n",
                        edev->name, edev->fail_rx_read);
@@ -132,8 +132,8 @@
         e.flags = ETH_FIFO_RX_OK | extra;
     }
 
-    if ((status = mx_fifo_write(edev->rx_fifo, &e, sizeof(e), &count)) < 0) {
-        if (status == MX_ERR_SHOULD_WAIT) {
+    if ((status = zx_fifo_write(edev->rx_fifo, &e, sizeof(e), &count)) < 0) {
+        if (status == ZX_ERR_SHOULD_WAIT) {
             if ((edev->fail_rx_write++ % FAIL_REPORT_RATE) == 0) {
                 dprintf(ERROR, "eth [%s]: no rx_fifo space available (%u times)\n",
                        edev->name, edev->fail_rx_write);
@@ -155,7 +155,7 @@
 
     ethdev_t* edev;
     list_for_every_entry(&edev0->list_active, edev, ethdev_t, node) {
-        mx_object_signal_peer(edev->rx_fifo, 0, ETH_SIGNAL_STATUS);
+        zx_object_signal_peer(edev->rx_fifo, 0, ETH_SIGNAL_STATUS);
     }
     mtx_unlock(&edev0->lock);
 }
@@ -189,7 +189,7 @@
     mtx_unlock(&edev0->lock);
 }
 
-static mx_status_t eth_tx_listen_locked(ethdev_t* edev, bool yes) {
+static zx_status_t eth_tx_listen_locked(ethdev_t* edev, bool yes) {
     ethdev0_t* edev0 = edev->edev0;
 
     // update our state
@@ -216,25 +216,25 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static int eth_tx_thread(void* arg) {
     ethdev_t* edev = (ethdev_t*)arg;
     ethdev0_t* edev0 = edev->edev0;
     eth_fifo_entry_t entries[FIFO_DEPTH / 2];
-    mx_status_t status;
+    zx_status_t status;
     uint32_t count;
 
     for (;;) {
-        if ((status = mx_fifo_read(edev->tx_fifo, entries, sizeof(entries), &count)) < 0) {
-            if (status == MX_ERR_SHOULD_WAIT) {
-                mx_signals_t observed;
-                if ((status = mx_object_wait_one(edev->tx_fifo,
-                                                 MX_FIFO_READABLE |
-                                                 MX_FIFO_PEER_CLOSED |
+        if ((status = zx_fifo_read(edev->tx_fifo, entries, sizeof(entries), &count)) < 0) {
+            if (status == ZX_ERR_SHOULD_WAIT) {
+                zx_signals_t observed;
+                if ((status = zx_object_wait_one(edev->tx_fifo,
+                                                 ZX_FIFO_READABLE |
+                                                 ZX_FIFO_PEER_CLOSED |
                                                  kSignalFifoTerminate,
-                                                 MX_TIME_INFINITE,
+                                                 ZX_TIME_INFINITE,
                                                  &observed)) < 0) {
                     dprintf(ERROR, "eth [%s]: tx_fifo: error waiting: %d\n", edev->name, status);
                     break;
@@ -266,8 +266,8 @@
             count--;
         }
 
-        if ((status = mx_fifo_write(edev->tx_fifo, entries, sizeof(eth_fifo_entry_t) * n, &count)) < 0) {
-            if (status == MX_ERR_SHOULD_WAIT) {
+        if ((status = zx_fifo_write(edev->tx_fifo, entries, sizeof(eth_fifo_entry_t) * n, &count)) < 0) {
+            if (status == ZX_ERR_SHOULD_WAIT) {
                 if ((edev->fail_tx_write++ % FAIL_REPORT_RATE) == 0) {
                     dprintf(ERROR, "eth [%s]: no tx_fifo space available (%u times)\n",
                            edev->name, edev->fail_tx_write);
@@ -286,27 +286,27 @@
     return 0;
 }
 
-static mx_status_t eth_get_fifos_locked(ethdev_t* edev, void* out_buf, size_t out_len,
+static zx_status_t eth_get_fifos_locked(ethdev_t* edev, void* out_buf, size_t out_len,
                                         size_t* out_actual) {
     if (out_len < sizeof(eth_fifos_t)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if (edev->tx_fifo != MX_HANDLE_INVALID) {
-        return MX_ERR_ALREADY_BOUND;
+    if (edev->tx_fifo != ZX_HANDLE_INVALID) {
+        return ZX_ERR_ALREADY_BOUND;
     }
 
     eth_fifos_t* fifos = out_buf;
 
-    mx_status_t status;
-    if ((status = mx_fifo_create(FIFO_DEPTH, FIFO_ESIZE, 0, &fifos->tx_fifo, &edev->tx_fifo)) < 0) {
+    zx_status_t status;
+    if ((status = zx_fifo_create(FIFO_DEPTH, FIFO_ESIZE, 0, &fifos->tx_fifo, &edev->tx_fifo)) < 0) {
         dprintf(ERROR, "eth_create  [%s]: failed to create tx fifo: %d\n", edev->name, status);
         return status;
     }
-    if ((status = mx_fifo_create(FIFO_DEPTH, FIFO_ESIZE, 0, &fifos->rx_fifo, &edev->rx_fifo)) < 0) {
+    if ((status = zx_fifo_create(FIFO_DEPTH, FIFO_ESIZE, 0, &fifos->rx_fifo, &edev->rx_fifo)) < 0) {
         dprintf(ERROR, "eth_create  [%s]: failed to create rx fifo: %d\n", edev->name, status);
-        mx_handle_close(fifos->rx_fifo);
-        mx_handle_close(edev->tx_fifo);
-        edev->tx_fifo = MX_HANDLE_INVALID;
+        zx_handle_close(fifos->rx_fifo);
+        zx_handle_close(edev->tx_fifo);
+        edev->tx_fifo = ZX_HANDLE_INVALID;
         return status;
     }
 
@@ -316,29 +316,29 @@
     fifos->rx_depth = FIFO_DEPTH;
 
     *out_actual = sizeof(*fifos);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static ssize_t eth_set_iobuf_locked(ethdev_t* edev, const void* in_buf, size_t in_len) {
-    if (in_len < sizeof(mx_handle_t)) {
-        return MX_ERR_INVALID_ARGS;
+    if (in_len < sizeof(zx_handle_t)) {
+        return ZX_ERR_INVALID_ARGS;
     }
-    if (edev->io_vmo != MX_HANDLE_INVALID) {
-        return MX_ERR_ALREADY_BOUND;
+    if (edev->io_vmo != ZX_HANDLE_INVALID) {
+        return ZX_ERR_ALREADY_BOUND;
     }
 
-    mx_handle_t vmo = *((mx_handle_t*)in_buf);
+    zx_handle_t vmo = *((zx_handle_t*)in_buf);
 
     size_t size;
-    mx_status_t status;
+    zx_status_t status;
 
-    if ((status = mx_vmo_get_size(vmo, &size)) < 0) {
+    if ((status = zx_vmo_get_size(vmo, &size)) < 0) {
         dprintf(ERROR, "eth [%s]: could not get io_buf size: %d\n", edev->name, status);
         goto fail;
     }
 
-    if ((status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    if ((status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                               (uintptr_t*)&edev->io_buf)) < 0) {
         dprintf(ERROR, "eth [%s]: could not map io_buf: %d\n", edev->name, status);
         goto fail;
@@ -347,25 +347,25 @@
     edev->io_vmo = vmo;
     edev->io_size = size;
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
-    mx_handle_close(vmo);
+    zx_handle_close(vmo);
     return status;
 }
 
-static mx_status_t eth_start_locked(ethdev_t* edev) {
+static zx_status_t eth_start_locked(ethdev_t* edev) {
     ethdev0_t* edev0 = edev->edev0;
 
     // Cannot start unless tx/rx rings are configured
-    if ((edev->io_vmo == MX_HANDLE_INVALID) ||
-        (edev->tx_fifo == MX_HANDLE_INVALID) ||
-        (edev->rx_fifo == MX_HANDLE_INVALID)) {
-        return MX_ERR_BAD_STATE;
+    if ((edev->io_vmo == ZX_HANDLE_INVALID) ||
+        (edev->tx_fifo == ZX_HANDLE_INVALID) ||
+        (edev->rx_fifo == ZX_HANDLE_INVALID)) {
+        return ZX_ERR_BAD_STATE;
     }
 
     if (edev->state & ETHDEV_RUNNING) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     if (!(edev->state & ETHDEV_TX_THREAD)) {
@@ -373,12 +373,12 @@
                                       edev, "eth-tx-thread");
         if (r != thrd_success) {
             dprintf(ERROR, "eth [%s]: failed to start tx thread: %d\n", edev->name, r);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
         edev->state |= ETHDEV_TX_THREAD;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     if (list_is_empty(&edev0->list_active)) {
         // Release the lock to allow other device operations in callback routine.
         // Re-acquire lock afterwards. Set busy to prevent problems with other ioctls.
@@ -388,10 +388,10 @@
         mtx_lock(&edev0->lock);
         edev0->state &= ~ETHDEV0_BUSY;
     } else {
-        status = MX_OK;
+        status = ZX_OK;
     }
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         edev->state |= ETHDEV_RUNNING;
         list_delete(&edev->node);
         list_add_tail(&edev0->list_active, &edev->node);
@@ -402,7 +402,7 @@
     return status;
 }
 
-static mx_status_t eth_stop_locked(ethdev_t* edev) {
+static zx_status_t eth_stop_locked(ethdev_t* edev) {
     ethdev0_t* edev0 = edev->edev0;
 
     if (edev->state & ETHDEV_RUNNING) {
@@ -422,7 +422,7 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static ssize_t eth_set_client_name_locked(ethdev_t* edev, const void* in_buf, size_t in_len) {
@@ -431,50 +431,50 @@
     }
     memcpy(edev->name, in_buf, in_len);
     edev->name[in_len] = '\0';
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t eth_get_status_locked(ethdev_t* edev, void* out_buf, size_t out_len,
+static zx_status_t eth_get_status_locked(ethdev_t* edev, void* out_buf, size_t out_len,
                                   size_t* out_actual) {
     if (out_len < sizeof(uint32_t)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if (edev->rx_fifo == MX_HANDLE_INVALID) {
-        return MX_ERR_BAD_STATE;
+    if (edev->rx_fifo == ZX_HANDLE_INVALID) {
+        return ZX_ERR_BAD_STATE;
     }
-    if (mx_object_signal_peer(edev->rx_fifo, ETH_SIGNAL_STATUS, 0) != MX_OK) {
-        return MX_ERR_INTERNAL;
+    if (zx_object_signal_peer(edev->rx_fifo, ETH_SIGNAL_STATUS, 0) != ZX_OK) {
+        return ZX_ERR_INTERNAL;
     }
 
     uint32_t* status = out_buf;
     *status = edev->edev0->status;
     *out_actual = sizeof(status);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t eth_ioctl(void* ctx, uint32_t op,
+static zx_status_t eth_ioctl(void* ctx, uint32_t op,
                              const void* in_buf, size_t in_len,
                              void* out_buf, size_t out_len, size_t* out_actual) {
 
     ethdev_t* edev = ctx;
     mtx_lock(&edev->edev0->lock);
-    mx_status_t status;
+    zx_status_t status;
     if (edev->edev0->state & ETHDEV0_BUSY) {
         dprintf(ERROR, "eth [%s]: cannot perform ioctl while device is busy. ioctl: %u\n",
                edev->name, IOCTL_NUMBER(op));
-        status = MX_ERR_SHOULD_WAIT;
+        status = ZX_ERR_SHOULD_WAIT;
         goto done;
     }
 
     if (edev->state & ETHDEV_DEAD) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto done;
     }
 
     switch (op) {
     case IOCTL_ETHERNET_GET_INFO: {
         if (out_len < sizeof(eth_info_t)) {
-            status = MX_ERR_BUFFER_TOO_SMALL;
+            status = ZX_ERR_BUFFER_TOO_SMALL;
         } else {
             eth_info_t* info = out_buf;
             memset(info, 0, sizeof(*info));
@@ -487,7 +487,7 @@
             }
             info->mtu = edev->edev0->info.mtu;
             *out_actual = sizeof(*info);
-            status = MX_OK;
+            status = ZX_OK;
         }
         break;
     }
@@ -542,16 +542,16 @@
 
     // try to convince clients to close us
     if (edev->rx_fifo) {
-        mx_handle_close(edev->rx_fifo);
-        edev->rx_fifo = MX_HANDLE_INVALID;
+        zx_handle_close(edev->rx_fifo);
+        edev->rx_fifo = ZX_HANDLE_INVALID;
     }
     if (edev->tx_fifo) {
         // Ask the TX thread to exit.
-        mx_object_signal(edev->tx_fifo, 0, kSignalFifoTerminate);
+        zx_object_signal(edev->tx_fifo, 0, kSignalFifoTerminate);
     }
     if (edev->io_vmo) {
-        mx_handle_close(edev->io_vmo);
-        edev->io_vmo = MX_HANDLE_INVALID;
+        zx_handle_close(edev->io_vmo);
+        edev->io_vmo = ZX_HANDLE_INVALID;
     }
 
     if (edev->state & ETHDEV_TX_THREAD) {
@@ -562,12 +562,12 @@
     }
 
     if (edev->tx_fifo) {
-        mx_handle_close(edev->tx_fifo);
-        edev->tx_fifo = MX_HANDLE_INVALID;
+        zx_handle_close(edev->tx_fifo);
+        edev->tx_fifo = ZX_HANDLE_INVALID;
     }
 
     if (edev->io_buf) {
-        mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)edev->io_buf, 0);
+        zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)edev->io_buf, 0);
         edev->io_buf = NULL;
     }
     dprintf(TRACE, "eth [%s]: all resources released\n", edev->name);
@@ -578,7 +578,7 @@
     free(edev);
 }
 
-static mx_status_t eth_close(void* ctx, uint32_t flags) {
+static zx_status_t eth_close(void* ctx, uint32_t flags) {
     ethdev_t* edev = ctx;
 
     mtx_lock(&edev->edev0->lock);
@@ -587,22 +587,22 @@
     list_delete(&edev->node);
     mtx_unlock(&edev->edev0->lock);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_protocol_device_t ethdev_ops = {
+static zx_protocol_device_t ethdev_ops = {
     .version = DEVICE_OPS_VERSION,
     .close = eth_close,
     .ioctl = eth_ioctl,
     .release = eth_release,
 };
 
-static mx_status_t eth0_open(void* ctx, mx_device_t** out, uint32_t flags) {
+static zx_status_t eth0_open(void* ctx, zx_device_t** out, uint32_t flags) {
     ethdev0_t* edev0 = ctx;
 
     ethdev_t* edev;
     if ((edev = calloc(1, sizeof(ethdev_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     edev->edev0 = edev0;
 
@@ -611,11 +611,11 @@
         .name = "ethernet",
         .ctx = edev,
         .ops = &ethdev_ops,
-        .proto_id = MX_PROTOCOL_ETHERNET,
+        .proto_id = ZX_PROTOCOL_ETHERNET,
         .flags = DEVICE_ADD_INSTANCE,
     };
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = device_add(edev0->mxdev, &args, &edev->mxdev)) < 0) {
         free(edev);
         return status;
@@ -626,7 +626,7 @@
     mtx_unlock(&edev0->lock);
 
     *out = edev->mxdev;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void eth0_unbind(void* ctx) {
@@ -654,7 +654,7 @@
     free(edev0);
 }
 
-static mx_protocol_device_t ethdev0_ops = {
+static zx_protocol_device_t ethdev0_ops = {
     .version = DEVICE_OPS_VERSION,
     .open = eth0_open,
     .unbind = eth0_unbind,
@@ -663,16 +663,16 @@
 
 #define BAD_FEATURES (ETHMAC_FEATURE_RX_QUEUE | ETHMAC_FEATURE_TX_QUEUE)
 
-static mx_status_t eth_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t eth_bind(void* ctx, zx_device_t* dev, void** cookie) {
     ethdev0_t* edev0;
     if ((edev0 = calloc(1, sizeof(ethdev0_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t status;
-    if (device_get_protocol(dev, MX_PROTOCOL_ETHERMAC, &edev0->mac)) {
+    zx_status_t status;
+    if (device_get_protocol(dev, ZX_PROTOCOL_ETHERMAC, &edev0->mac)) {
         dprintf(ERROR, "eth: bind: no ethermac protocol\n");
-        status = MX_ERR_INTERNAL;
+        status = ZX_ERR_INTERNAL;
         goto fail;
     }
 
@@ -684,7 +684,7 @@
     if (edev0->info.features & BAD_FEATURES) {
         dprintf(ERROR, "eth: bind: ethermac requires unsupported features: %08x\n",
                edev0->info.features & BAD_FEATURES);
-        status = MX_ERR_NOT_SUPPORTED;
+        status = ZX_ERR_NOT_SUPPORTED;
         goto fail;
     }
 
@@ -699,25 +699,25 @@
         .name = "ethernet",
         .ctx = edev0,
         .ops = &ethdev0_ops,
-        .proto_id = MX_PROTOCOL_ETHERNET,
+        .proto_id = ZX_PROTOCOL_ETHERNET,
     };
 
     if ((status = device_add(dev, &args, &edev0->mxdev)) < 0) {
         goto fail;
     }
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     free(edev0);
     return status;
 }
 
-static mx_driver_ops_t eth_driver_ops = {
+static zx_driver_ops_t eth_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = eth_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(ethernet, eth_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_ETHERMAC),
-MAGENTA_DRIVER_END(ethernet)
+ZIRCON_DRIVER_BEGIN(ethernet, eth_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_ETHERMAC),
+ZIRCON_DRIVER_END(ethernet)
diff --git a/system/dev/ethernet/ethernet/rules.mk b/system/dev/ethernet/ethernet/rules.mk
index fdadded..8350f4e 100644
--- a/system/dev/ethernet/ethernet/rules.mk
+++ b/system/dev/ethernet/ethernet/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/ethernet/ethertap/binding.c b/system/dev/ethernet/ethertap/binding.c
index 41cfd0e..7a36e1e 100644
--- a/system/dev/ethernet/ethertap/binding.c
+++ b/system/dev/ethernet/ethertap/binding.c
@@ -6,15 +6,15 @@
 #include <ddk/driver.h>
 #include <ddk/binding.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
-extern mx_status_t tapctl_bind(void* ctx, mx_device_t* device, void** cookie);
+extern zx_status_t tapctl_bind(void* ctx, zx_device_t* device, void** cookie);
 
-static mx_driver_ops_t tapctl_driver_ops = {
+static zx_driver_ops_t tapctl_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = tapctl_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(tapctl, tapctl_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(tapctl)
+ZIRCON_DRIVER_BEGIN(tapctl, tapctl_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(tapctl)
diff --git a/system/dev/ethernet/ethertap/ethertap.cpp b/system/dev/ethernet/ethertap/ethertap.cpp
index 2d1a27d..cc9f5e3 100644
--- a/system/dev/ethernet/ethertap/ethertap.cpp
+++ b/system/dev/ethernet/ethertap/ethertap.cpp
@@ -5,7 +5,7 @@
 #include "ethertap.h"
 
 #include <ddk/debug.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/auto_lock.h>
 #include <fbl/type_support.h>
 #include <pretty/hexdump.h>
@@ -20,24 +20,24 @@
 
 namespace eth {
 
-TapCtl::TapCtl(mx_device_t* device) : ddk::Device<TapCtl, ddk::Ioctlable>(device) {}
+TapCtl::TapCtl(zx_device_t* device) : ddk::Device<TapCtl, ddk::Ioctlable>(device) {}
 
 void TapCtl::DdkRelease() {
     delete this;
 }
 
-mx_status_t TapCtl::DdkIoctl(uint32_t op, const void* in_buf, size_t in_len, void* out_buf,
+zx_status_t TapCtl::DdkIoctl(uint32_t op, const void* in_buf, size_t in_len, void* out_buf,
                              size_t out_len, size_t* out_actual) {
     switch (op) {
     case IOCTL_ETHERTAP_CONFIG: {
         if (in_buf == NULL || in_len != sizeof(ethertap_ioctl_config_t) ||
-            out_buf == NULL || out_len != sizeof(mx_handle_t) || out_actual == NULL) {
-            return MX_ERR_INVALID_ARGS;
+            out_buf == NULL || out_len != sizeof(zx_handle_t) || out_actual == NULL) {
+            return ZX_ERR_INVALID_ARGS;
         }
 
-        mx::socket local, remote;
-        mx_status_t status = mx::socket::create(MX_SOCKET_DATAGRAM, &local, &remote);
-        if (status != MX_OK) {
+        zx::socket local, remote;
+        zx_status_t status = zx::socket::create(ZX_SOCKET_DATAGRAM, &local, &remote);
+        if (status != ZX_OK) {
             return status;
         }
 
@@ -49,21 +49,21 @@
                 new eth::TapDevice(mxdev(), &config, fbl::move(local)));
 
         status = tap->DdkAdd(config.name);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             dprintf(ERROR, "tapctl: could not add tap device: %d\n", status);
         } else {
             // devmgr owns the memory until release is called
             tap.release();
 
-            mx_handle_t* out = reinterpret_cast<mx_handle_t*>(out_buf);
+            zx_handle_t* out = reinterpret_cast<zx_handle_t*>(out_buf);
             *out = remote.release();
-            *out_actual = sizeof(mx_handle_t);
+            *out_actual = sizeof(zx_handle_t);
             dprintf(INFO, "tapctl: created ethertap device '%s'\n", config.name);
         }
         return status;
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -72,19 +72,19 @@
     return device->Thread();
 }
 
-#define TAP_SHUTDOWN MX_USER_SIGNAL_7
+#define TAP_SHUTDOWN ZX_USER_SIGNAL_7
 
-TapDevice::TapDevice(mx_device_t* device, const ethertap_ioctl_config* config, mx::socket data)
+TapDevice::TapDevice(zx_device_t* device, const ethertap_ioctl_config* config, zx::socket data)
   : ddk::Device<TapDevice, ddk::Unbindable>(device),
     options_(config->options),
     features_(config->features | ETHMAC_FEATURE_SYNTH),
     mtu_(config->mtu),
     data_(fbl::move(data)) {
-    MX_DEBUG_ASSERT(data_.is_valid());
+    ZX_DEBUG_ASSERT(data_.is_valid());
     memcpy(mac_, config->mac, 6);
     int ret = thrd_create_with_name(&thread_, tap_device_thread, reinterpret_cast<void*>(this),
                                     "ethertap-thread");
-    MX_DEBUG_ASSERT(ret == thrd_success);
+    ZX_DEBUG_ASSERT(ret == thrd_success);
 }
 
 void TapDevice::DdkRelease() {
@@ -97,17 +97,17 @@
 void TapDevice::DdkUnbind() {
     ethertap_trace("DdkUnbind\n");
     fbl::AutoLock lock(&lock_);
-    mx_status_t status = data_.signal(0, TAP_SHUTDOWN);
-    MX_DEBUG_ASSERT(status == MX_OK);
+    zx_status_t status = data_.signal(0, TAP_SHUTDOWN);
+    ZX_DEBUG_ASSERT(status == ZX_OK);
     // When the thread exits after the channel is closed, it will call DdkRemove.
 }
 
-mx_status_t TapDevice::EthmacQuery(uint32_t options, ethmac_info_t* info) {
+zx_status_t TapDevice::EthmacQuery(uint32_t options, ethmac_info_t* info) {
     memset(info, 0, sizeof(*info));
     info->features = features_;
     info->mtu = mtu_;
     memcpy(info->mac, mac_, 6);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void TapDevice::EthmacStop() {
@@ -116,60 +116,60 @@
     ethmac_proxy_.reset();
 }
 
-mx_status_t TapDevice::EthmacStart(fbl::unique_ptr<ddk::EthmacIfcProxy> proxy) {
+zx_status_t TapDevice::EthmacStart(fbl::unique_ptr<ddk::EthmacIfcProxy> proxy) {
     ethertap_trace("EthmacStart\n");
     fbl::AutoLock lock(&lock_);
     if (ethmac_proxy_ != nullptr) {
-        return MX_ERR_ALREADY_BOUND;
+        return ZX_ERR_ALREADY_BOUND;
     } else {
         ethmac_proxy_.swap(proxy);
         ethmac_proxy_->Status(online_ ? ETH_STATUS_ONLINE : 0u);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 void TapDevice::EthmacSend(uint32_t options, void* data, size_t length) {
-    MX_DEBUG_ASSERT(length <= mtu_);
+    ZX_DEBUG_ASSERT(length <= mtu_);
     if (unlikely(options_ & ETHERTAP_OPT_TRACE_PACKETS)) {
         fbl::AutoLock lock(&lock_);
         ethertap_trace("sending %zu bytes\n", length);
         hexdump8_ex(data, length, 0);
     }
-    mx_status_t status = data_.write(0u, data, length, nullptr);
-    if (status != MX_OK) {
+    zx_status_t status = data_.write(0u, data, length, nullptr);
+    if (status != ZX_OK) {
         dprintf(ERROR, "ethertap: EthmacSend error writing: %d\n", status);
     }
 }
 
 int TapDevice::Thread() {
     ethertap_trace("starting main thread\n");
-    mx_signals_t pending;
+    zx_signals_t pending;
     fbl::unique_ptr<uint8_t[]> buf(new uint8_t[mtu_]);
 
-    mx_status_t status = MX_OK;
-    const mx_signals_t wait = MX_SOCKET_READABLE | MX_SOCKET_PEER_CLOSED | ETHERTAP_SIGNAL_ONLINE
+    zx_status_t status = ZX_OK;
+    const zx_signals_t wait = ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED | ETHERTAP_SIGNAL_ONLINE
         | ETHERTAP_SIGNAL_OFFLINE | TAP_SHUTDOWN;
     while (true) {
-        status = data_.wait_one(wait, MX_TIME_INFINITE, &pending);
-        if (status != MX_OK) {
+        status = data_.wait_one(wait, ZX_TIME_INFINITE, &pending);
+        if (status != ZX_OK) {
             ethertap_trace("error waiting on data: %d\n", status);
             break;
         }
 
         if (pending & (ETHERTAP_SIGNAL_OFFLINE|ETHERTAP_SIGNAL_ONLINE)) {
             status = UpdateLinkStatus(pending);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 break;
             }
         }
 
-        if (pending & MX_SOCKET_READABLE) {
+        if (pending & ZX_SOCKET_READABLE) {
             status = Recv(buf.get(), mtu_);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 break;
             }
         }
-        if (pending & MX_SOCKET_PEER_CLOSED) {
+        if (pending & ZX_SOCKET_PEER_CLOSED) {
             ethertap_trace("socket closed (peer)\n");
             break;
         }
@@ -186,21 +186,21 @@
     return static_cast<int>(status);
 }
 
-static inline bool observed_online(mx_signals_t obs) {
+static inline bool observed_online(zx_signals_t obs) {
     return obs & ETHERTAP_SIGNAL_ONLINE;
 }
 
-static inline bool observed_offline(mx_signals_t obs) {
+static inline bool observed_offline(zx_signals_t obs) {
     return obs & ETHERTAP_SIGNAL_OFFLINE;
 }
 
-mx_status_t TapDevice::UpdateLinkStatus(mx_signals_t observed) {
+zx_status_t TapDevice::UpdateLinkStatus(zx_signals_t observed) {
     bool was_online = online_;
-    mx_signals_t clear = 0;
+    zx_signals_t clear = 0;
 
     if (observed_online(observed) && observed_offline(observed)) {
         dprintf(ERROR, "ethertap: error asserting both online and offline\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (observed_offline(observed)) {
@@ -222,19 +222,19 @@
         ethertap_trace("device '%s' is now %s\n", name(), online_ ? "online" : "offline");
     }
     if (clear) {
-        mx_status_t status = data_.signal(clear, 0);
-        if (status != MX_OK) {
+        zx_status_t status = data_.signal(clear, 0);
+        if (status != ZX_OK) {
             dprintf(ERROR, "ethertap: could not clear status signals: %d\n", status);
             return status;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t TapDevice::Recv(uint8_t* buffer, uint32_t capacity) {
+zx_status_t TapDevice::Recv(uint8_t* buffer, uint32_t capacity) {
     size_t actual = 0;
-    mx_status_t status = data_.read(0u, buffer, capacity, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = data_.read(0u, buffer, capacity, &actual);
+    if (status != ZX_OK) {
         dprintf(ERROR, "ethertap: error reading data: %d\n", status);
         return status;
     }
@@ -247,15 +247,15 @@
     if (ethmac_proxy_ != nullptr) {
         ethmac_proxy_->Recv(buffer, actual, 0u);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 }  // namespace eth
 
-extern "C" mx_status_t tapctl_bind(void* ctx, mx_device_t* device, void** cookie) {
+extern "C" zx_status_t tapctl_bind(void* ctx, zx_device_t* device, void** cookie) {
     auto dev = fbl::unique_ptr<eth::TapCtl>(new eth::TapCtl(device));
-    mx_status_t status = dev->DdkAdd("tapctl");
-    if (status != MX_OK) {
+    zx_status_t status = dev->DdkAdd("tapctl");
+    if (status != ZX_OK) {
         dprintf(ERROR, "%s: could not add device: %d\n", __func__, status);
     } else {
         // devmgr owns the memory now
diff --git a/system/dev/ethernet/ethertap/ethertap.h b/system/dev/ethernet/ethertap/ethertap.h
index 123e148..4b396c1 100644
--- a/system/dev/ethernet/ethertap/ethertap.h
+++ b/system/dev/ethernet/ethertap/ethertap.h
@@ -9,10 +9,10 @@
 #include <ddktl/device.h>
 #include <ddktl/protocol/ethernet.h>
 #include <ddktl/protocol/test.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/device/ethertap.h>
-#include <mx/socket.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/device/ethertap.h>
+#include <zx/socket.h>
 #include <fbl/mutex.h>
 #include <fbl/unique_ptr.h>
 #include <threads.h>
@@ -21,31 +21,31 @@
 
 class TapCtl : public ddk::Device<TapCtl, ddk::Ioctlable> {
   public:
-    TapCtl(mx_device_t* device);
+    TapCtl(zx_device_t* device);
 
     void DdkRelease();
-    mx_status_t DdkIoctl(uint32_t op, const void* in_buf, size_t in_len, void* out_buf,
+    zx_status_t DdkIoctl(uint32_t op, const void* in_buf, size_t in_len, void* out_buf,
                          size_t out_len, size_t* out_actual);
 };
 
 class TapDevice : public ddk::Device<TapDevice, ddk::Unbindable>,
                   public ddk::EthmacProtocol<TapDevice> {
   public:
-    TapDevice(mx_device_t* device, const ethertap_ioctl_config* config, mx::socket data);
+    TapDevice(zx_device_t* device, const ethertap_ioctl_config* config, zx::socket data);
 
     void DdkRelease();
     void DdkUnbind();
 
-    mx_status_t EthmacQuery(uint32_t options, ethmac_info_t* info);
+    zx_status_t EthmacQuery(uint32_t options, ethmac_info_t* info);
     void EthmacStop();
-    mx_status_t EthmacStart(fbl::unique_ptr<ddk::EthmacIfcProxy> proxy);
+    zx_status_t EthmacStart(fbl::unique_ptr<ddk::EthmacIfcProxy> proxy);
     void EthmacSend(uint32_t options, void* data, size_t length);
 
     int Thread();
 
   private:
-    mx_status_t UpdateLinkStatus(mx_signals_t observed);
-    mx_status_t Recv(uint8_t* buffer, uint32_t capacity);
+    zx_status_t UpdateLinkStatus(zx_signals_t observed);
+    zx_status_t Recv(uint8_t* buffer, uint32_t capacity);
 
     // ethertap options
     uint32_t options_ = 0;
@@ -60,7 +60,7 @@
 
     // Only accessed from Thread, so not locked.
     bool online_ = false;
-    mx::socket data_;
+    zx::socket data_;
 
     thrd_t thread_;
 };
diff --git a/system/dev/ethernet/ethertap/rules.mk b/system/dev/ethernet/ethertap/rules.mk
index 3b46c30..c496aca 100644
--- a/system/dev/ethernet/ethertap/rules.mk
+++ b/system/dev/ethernet/ethertap/rules.mk
@@ -15,14 +15,14 @@
 MODULE_STATIC_LIBS := \
     system/ulib/ddk \
     system/ulib/ddktl \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/pretty \
 
 MODULE_LIBS := \
     system/ulib/driver \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/ethernet/intel-ethernet/ethernet.c b/system/dev/ethernet/intel-ethernet/ethernet.c
index 570b7b4..19514c0 100644
--- a/system/dev/ethernet/intel-ethernet/ethernet.c
+++ b/system/dev/ethernet/intel-ethernet/ethernet.c
@@ -10,24 +10,24 @@
 #include <ddk/protocol/pci.h>
 #include <hw/pci.h>
 
-#include <magenta/device/ethernet.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <threads.h>
 
-typedef mx_status_t status_t;
+typedef zx_status_t status_t;
 #include "ie.h"
 
 typedef struct ethernet_device {
     ethdev_t eth;
     mtx_t lock;
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     pci_protocol_t pci;
-    mx_handle_t ioh;
-    mx_handle_t irqh;
+    zx_handle_t ioh;
+    zx_handle_t irqh;
     bool edge_triggered_irq;
     thrd_t thread;
     io_buffer_t buffer;
@@ -41,15 +41,15 @@
 static int irq_thread(void* arg) {
     ethernet_device_t* edev = arg;
     for (;;) {
-        mx_status_t r;
-        if ((r = mx_interrupt_wait(edev->irqh)) < 0) {
+        zx_status_t r;
+        if ((r = zx_interrupt_wait(edev->irqh)) < 0) {
             printf("eth: irq wait failed? %d\n", r);
-            mx_interrupt_complete(edev->irqh);
+            zx_interrupt_complete(edev->irqh);
             break;
         }
 
         if (edev->edge_triggered_irq)
-            mx_interrupt_complete(edev->irqh);
+            zx_interrupt_complete(edev->irqh);
 
         mtx_lock(&edev->lock);
         unsigned irq = eth_handle_irq(&edev->eth);
@@ -57,7 +57,7 @@
             void* data;
             size_t len;
 
-            while (eth_rx(&edev->eth, &data, &len) == MX_OK) {
+            while (eth_rx(&edev->eth, &data, &len) == ZX_OK) {
                 if (edev->ifc) {
                     edev->ifc->recv(edev->cookie, data, len, 0);
                 }
@@ -78,23 +78,23 @@
         mtx_unlock(&edev->lock);
 
         if (!edev->edge_triggered_irq)
-            mx_interrupt_complete(edev->irqh);
+            zx_interrupt_complete(edev->irqh);
     }
     return 0;
 }
 
-static mx_status_t eth_query(void* ctx, uint32_t options, ethmac_info_t* info) {
+static zx_status_t eth_query(void* ctx, uint32_t options, ethmac_info_t* info) {
     ethernet_device_t* edev = ctx;
 
     if (options) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     memset(info, 0, sizeof(*info));
     info->mtu = ETH_RXBUF_SIZE; //TODO: not actually the mtu!
     memcpy(info->mac, edev->eth.mac, sizeof(edev->eth.mac));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void eth_stop(void* ctx) {
@@ -104,13 +104,13 @@
     mtx_unlock(&edev->lock);
 }
 
-static mx_status_t eth_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
+static zx_status_t eth_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
     ethernet_device_t* edev = ctx;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&edev->lock);
     if (edev->ifc) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     } else {
         edev->ifc = ifc;
         edev->cookie = cookie;
@@ -137,37 +137,37 @@
     ethernet_device_t* edev = ctx;
     eth_reset_hw(&edev->eth);
     pci_enable_bus_master(&edev->pci, true);
-    mx_handle_close(edev->irqh);
-    mx_handle_close(edev->ioh);
+    zx_handle_close(edev->irqh);
+    zx_handle_close(edev->ioh);
     free(edev);
 }
 
-static mx_protocol_device_t device_ops = {
+static zx_protocol_device_t device_ops = {
     .version = DEVICE_OPS_VERSION,
     .release = eth_release,
 };
 
-static mx_status_t eth_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t eth_bind(void* ctx, zx_device_t* dev, void** cookie) {
     ethernet_device_t* edev;
     if ((edev = calloc(1, sizeof(ethernet_device_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     mtx_init(&edev->lock, mtx_plain);
     mtx_init(&edev->eth.send_lock, mtx_plain);
 
-    if (device_get_protocol(dev, MX_PROTOCOL_PCI, &edev->pci)) {
+    if (device_get_protocol(dev, ZX_PROTOCOL_PCI, &edev->pci)) {
         printf("no pci protocol\n");
         goto fail;
     }
 
     // Query whether we have MSI or Legacy interrupts.
     uint32_t irq_cnt = 0;
-    if ((pci_query_irq_mode_caps(&edev->pci, MX_PCIE_IRQ_MODE_MSI, &irq_cnt) == MX_OK) &&
-        (pci_set_irq_mode(&edev->pci, MX_PCIE_IRQ_MODE_MSI, 1) == MX_OK)) {
+    if ((pci_query_irq_mode_caps(&edev->pci, ZX_PCIE_IRQ_MODE_MSI, &irq_cnt) == ZX_OK) &&
+        (pci_set_irq_mode(&edev->pci, ZX_PCIE_IRQ_MODE_MSI, 1) == ZX_OK)) {
         edev->edge_triggered_irq = true;
         printf("eth: using MSI mode\n");
-    } else if ((pci_query_irq_mode_caps(&edev->pci, MX_PCIE_IRQ_MODE_LEGACY, &irq_cnt) == MX_OK) &&
-               (pci_set_irq_mode(&edev->pci, MX_PCIE_IRQ_MODE_LEGACY, 1) == MX_OK)) {
+    } else if ((pci_query_irq_mode_caps(&edev->pci, ZX_PCIE_IRQ_MODE_LEGACY, &irq_cnt) == ZX_OK) &&
+               (pci_set_irq_mode(&edev->pci, ZX_PCIE_IRQ_MODE_LEGACY, 1) == ZX_OK)) {
         edev->edge_triggered_irq = false;
         printf("eth: using legacy irq mode\n");
     } else {
@@ -175,18 +175,18 @@
         goto fail;
     }
 
-    mx_status_t r = pci_map_interrupt(&edev->pci, 0, &edev->irqh);
-    if (r != MX_OK) {
+    zx_status_t r = pci_map_interrupt(&edev->pci, 0, &edev->irqh);
+    if (r != ZX_OK) {
         printf("eth: failed to map irq\n");
         goto fail;
     }
 
     // map iomem
     uint64_t sz;
-    mx_handle_t h;
+    zx_handle_t h;
     void* io;
-    r = pci_map_resource(&edev->pci, PCI_RESOURCE_BAR_0, MX_CACHE_POLICY_UNCACHED_DEVICE, &io, &sz, &h);
-    if (r != MX_OK) {
+    r = pci_map_resource(&edev->pci, PCI_RESOURCE_BAR_0, ZX_CACHE_POLICY_UNCACHED_DEVICE, &io, &sz, &h);
+    if (r != ZX_OK) {
         printf("eth: cannot map io %d\n", h);
         goto fail;
     }
@@ -216,7 +216,7 @@
         .name = "intel-ethernet",
         .ctx = edev,
         .ops = &device_ops,
-        .proto_id = MX_PROTOCOL_ETHERMAC,
+        .proto_id = ZX_PROTOCOL_ETHERMAC,
         .proto_ops = &ethmac_ops,
     };
 
@@ -229,27 +229,27 @@
 
     printf("eth: intel-ethernet online\n");
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     io_buffer_release(&edev->buffer);
     if (edev->ioh) {
         pci_enable_bus_master(&edev->pci, true);
-        mx_handle_close(edev->irqh);
-        mx_handle_close(edev->ioh);
+        zx_handle_close(edev->irqh);
+        zx_handle_close(edev->ioh);
     }
     free(edev);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_driver_ops_t intel_ethernet_driver_ops = {
+static zx_driver_ops_t intel_ethernet_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = eth_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(intel_ethernet, intel_ethernet_driver_ops, "magenta", "0.1", 9)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+ZIRCON_DRIVER_BEGIN(intel_ethernet, intel_ethernet_driver_ops, "zircon", "0.1", 9)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_VID, 0x8086),
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x100E), // Qemu
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x15A3), // Broadwell
@@ -258,4 +258,4 @@
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x15b7), // Skull Canyon NUC
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x15b8), // I219
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x15d8), // Kaby Lake NUC
-MAGENTA_DRIVER_END(intel_ethernet)
+ZIRCON_DRIVER_END(intel_ethernet)
diff --git a/system/dev/ethernet/intel-ethernet/ie.c b/system/dev/ethernet/intel-ethernet/ie.c
index 27b8ec8..1570fab 100644
--- a/system/dev/ethernet/intel-ethernet/ie.c
+++ b/system/dev/ethernet/intel-ethernet/ie.c
@@ -4,7 +4,7 @@
 
 #include <inttypes.h>
 #include <stdint.h>
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -15,11 +15,11 @@
 //TODO: proper includes/defines kernel driver
 #else
 // includes and defines for userspace driver
-#include <magenta/types.h>
-#include <magenta/syscalls.h>
+#include <zircon/types.h>
+#include <zircon/syscalls.h>
 #include <ddk/driver.h>
 typedef int status_t;
-#define __nanosleep(x) mx_nanosleep(mx_deadline_after(x));
+#define __nanosleep(x) zx_nanosleep(zx_deadline_after(x));
 #define REG32(addr) ((volatile uint32_t *)(uintptr_t)(addr))
 #define writel(v, a) (*REG32(eth->iobase + (a)) = (v))
 #define readl(a) (*REG32(eth->iobase + (a)))
@@ -54,16 +54,16 @@
     uint64_t info = eth->rxd[n].info;
 
     if (!(info & IE_RXD_DONE)) {
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
     }
 
     // copy out packet
-    mx_status_t r = IE_RXD_LEN(info);
+    zx_status_t r = IE_RXD_LEN(info);
 
     *data = eth->rxb + ETH_RXBUF_SIZE * n;
     *len = r;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void eth_rx_ack(ethdev_t* eth) {
@@ -78,10 +78,10 @@
 
 status_t eth_tx(ethdev_t* eth, const void* data, size_t len) {
     if ((len < 60) || (len > ETH_TXBUF_DSIZE)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&eth->send_lock);
 
@@ -106,7 +106,7 @@
     // obtain buffer, copy into it, setup descriptor
     framebuf_t *frame = list_remove_head_type(&eth->free_frames, framebuf_t, node);
     if (frame == NULL) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto out;
     }
 
@@ -143,11 +143,11 @@
 
     if (readl(IE_CTRL) & IE_CTRL_RST) {
         printf("eth: reset failed\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     writel(IE_CTRL_ASDE | IE_CTRL_SLU, IE_CTRL);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void eth_init_hw(ethdev_t* eth) {
@@ -182,7 +182,7 @@
     writel(IE_INT_LSC, IE_IMS);
 }
 
-void eth_setup_buffers(ethdev_t* eth, void* iomem, mx_paddr_t iophys) {
+void eth_setup_buffers(ethdev_t* eth, void* iomem, zx_paddr_t iophys) {
     printf("eth: iomem @%p (phys %" PRIxPTR ")\n", iomem, iophys);
 
     list_initialize(&eth->free_frames);
diff --git a/system/dev/ethernet/intel-ethernet/rules.mk b/system/dev/ethernet/intel-ethernet/rules.mk
index 93f45e0..0689ba3 100644
--- a/system/dev/ethernet/intel-ethernet/rules.mk
+++ b/system/dev/ethernet/intel-ethernet/rules.mk
@@ -14,7 +14,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/ethernet/smsc-lan9514/rules.mk b/system/dev/ethernet/smsc-lan9514/rules.mk
index fd5f5d7..4edef74 100644
--- a/system/dev/ethernet/smsc-lan9514/rules.mk
+++ b/system/dev/ethernet/smsc-lan9514/rules.mk
@@ -8,7 +8,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/pretty system/ulib/sync system/ulib/bcm
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c system/ulib/mxio
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c system/ulib/fdio
 
 MODULE := $(LOCAL_DIR)
 
diff --git a/system/dev/ethernet/smsc-lan9514/smsc-lan9514.c b/system/dev/ethernet/smsc-lan9514/smsc-lan9514.c
index 5b76227..f3cd855 100644
--- a/system/dev/ethernet/smsc-lan9514/smsc-lan9514.c
+++ b/system/dev/ethernet/smsc-lan9514/smsc-lan9514.c
@@ -9,8 +9,8 @@
 #include <ddk/protocol/ethernet.h>
 #include <ddk/protocol/platform-device.h>
 #include <driver/usb.h>
-#include <magenta/device/ethernet.h>
-#include <magenta/listnode.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/listnode.h>
 #include <sync/completion.h>
 #include <bcm/ioctl.h>
 
@@ -35,8 +35,8 @@
 //#define ETH_HEADER_SIZE 4
 
 typedef struct {
-    mx_device_t* device;
-    mx_device_t* usb_device;
+    zx_device_t* device;
+    zx_device_t* usb_device;
     usb_protocol_t usb;
 
     uint8_t phy_id;
@@ -60,53 +60,53 @@
     mtx_t control_ep_mutex;
 } lan9514_t;
 
-static mx_status_t lan9514_write_register_locked(lan9514_t* eth, uint16_t reg, uint32_t value) {
+static zx_status_t lan9514_write_register_locked(lan9514_t* eth, uint16_t reg, uint32_t value) {
 
     return usb_control(&eth->usb, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-                       LAN9514_REQ_REG_WRITE, 0, reg, &value, sizeof(value), MX_TIME_INFINITE);
+                       LAN9514_REQ_REG_WRITE, 0, reg, &value, sizeof(value), ZX_TIME_INFINITE);
 }
 
-static mx_status_t lan9514_read_register_locked(lan9514_t* eth, uint16_t reg, uint32_t* value) {
+static zx_status_t lan9514_read_register_locked(lan9514_t* eth, uint16_t reg, uint32_t* value) {
 
     return usb_control(&eth->usb, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-                       LAN9514_REQ_REG_READ, 0, reg, value, sizeof(*value), MX_TIME_INFINITE);
+                       LAN9514_REQ_REG_READ, 0, reg, value, sizeof(*value), ZX_TIME_INFINITE);
 }
 
-static mx_status_t lan9514_write_register(lan9514_t* eth, uint16_t reg, uint32_t value) {
+static zx_status_t lan9514_write_register(lan9514_t* eth, uint16_t reg, uint32_t value) {
     mtx_lock(&eth->control_ep_mutex);
 
-    mx_status_t status = lan9514_write_register_locked(eth, reg, value);
+    zx_status_t status = lan9514_write_register_locked(eth, reg, value);
 
     mtx_unlock(&eth->control_ep_mutex);
 
     return status;
 }
 
-static mx_status_t lan9514_read_register(lan9514_t* eth, uint16_t reg, uint32_t* value) {
+static zx_status_t lan9514_read_register(lan9514_t* eth, uint16_t reg, uint32_t* value) {
     mtx_lock(&eth->control_ep_mutex);
 
-    mx_status_t status = lan9514_read_register_locked(eth, reg, value);
+    zx_status_t status = lan9514_read_register_locked(eth, reg, value);
 
     mtx_unlock(&eth->control_ep_mutex);
 
     return status;
 }
 
-static mx_status_t lan9514_mdio_wait_not_busy_locked(lan9514_t* eth) {
+static zx_status_t lan9514_mdio_wait_not_busy_locked(lan9514_t* eth) {
     uint32_t retval;
-    mx_time_t timecheck = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t timecheck = zx_time_get(ZX_CLOCK_MONOTONIC);
     do {
-        mx_status_t status = lan9514_read_register_locked(eth, LAN9514_MII_ACCESS_REG, &retval);
+        zx_status_t status = lan9514_read_register_locked(eth, LAN9514_MII_ACCESS_REG, &retval);
         if (status < 0)
             return status;
-        if ((mx_time_get(MX_CLOCK_MONOTONIC) - timecheck) > MX_SEC(1))
-            return MX_ERR_TIMED_OUT;
+        if ((zx_time_get(ZX_CLOCK_MONOTONIC) - timecheck) > ZX_SEC(1))
+            return ZX_ERR_TIMED_OUT;
     } while (retval & LAN9514_MII_ACCESS_MIIBZY);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t lan9514_mdio_read(lan9514_t* eth, uint8_t idx, uint16_t* retval) {
-    mx_status_t status;
+static zx_status_t lan9514_mdio_read(lan9514_t* eth, uint8_t idx, uint16_t* retval) {
+    zx_status_t status;
     uint32_t value;
 
     mtx_lock(&eth->control_ep_mutex);
@@ -132,8 +132,8 @@
     return status;
 }
 
-static mx_status_t lan9514_mdio_write(lan9514_t* eth, uint8_t idx, uint16_t value) {
-    mx_status_t status;
+static zx_status_t lan9514_mdio_write(lan9514_t* eth, uint8_t idx, uint16_t value) {
+    zx_status_t status;
     uint32_t writeval;
 
     mtx_lock(&eth->control_ep_mutex);
@@ -158,8 +158,8 @@
     return status;
 }
 
-mx_status_t lan9514_nway_restart(lan9514_t* eth) {
-    mx_status_t status;
+zx_status_t lan9514_nway_restart(lan9514_t* eth) {
+    zx_status_t status;
     uint16_t value;
 
     status = lan9514_mdio_read(eth, MII_PHY_BMCR_REG, &value);
@@ -173,8 +173,8 @@
     return -1;
 }
 
-mx_status_t lan9514_multicast_init(lan9514_t* eth) {
-    mx_status_t status;
+zx_status_t lan9514_multicast_init(lan9514_t* eth) {
+    zx_status_t status;
     uint32_t value;
 
     status = lan9514_read_register(eth, LAN9514_MAC_CR_REG, &value);
@@ -191,8 +191,8 @@
     return status;
 }
 
-mx_status_t lan9514_phy_init(lan9514_t* eth) {
-    mx_status_t status;
+zx_status_t lan9514_phy_init(lan9514_t* eth) {
+    zx_status_t status;
     uint16_t value;
 
     status = lan9514_mdio_write(eth, MII_PHY_BMCR_REG, MII_PHY_BMCR_RESET);
@@ -237,9 +237,9 @@
     return status;
 }
 
-mx_status_t lan9514_read_mac_address(lan9514_t* eth) {
+zx_status_t lan9514_read_mac_address(lan9514_t* eth) {
     uint32_t holder_lo, holder_hi;
-    mx_status_t status;
+    zx_status_t status;
 
     status = lan9514_read_register(eth, LAN9514_ADDR_HI_REG, &holder_hi);
     if (status < 0)
@@ -255,7 +255,7 @@
     eth->mac_addr[2] = (holder_lo >> 16) & 0xff;
     eth->mac_addr[1] = (holder_lo >> 8) & 0xff;
     eth->mac_addr[0] = (holder_lo >> 0) & 0xff;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void queue_interrupt_requests_locked(lan9514_t* eth) {
@@ -266,10 +266,10 @@
     }
 }
 
-mx_status_t lan9514_recv(lan9514_t* eth, iotxn_t* request) {
+zx_status_t lan9514_recv(lan9514_t* eth, iotxn_t* request) {
     if (eth->dead) {
         printf("lan9514_recv dead\n");
-        return MX_ERR_PEER_CLOSED;
+        return ZX_ERR_PEER_CLOSED;
     }
 
     size_t len = request->actual;
@@ -278,7 +278,7 @@
 
     uint32_t rx_status;
     if (len < sizeof(rx_status)) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     memcpy(&rx_status, pkt, sizeof(rx_status));
 
@@ -286,15 +286,15 @@
 
     if (rx_status & LAN9514_RXSTATUS_ERROR_MASK) {
         printf("invalid header: 0x%08x\n", rx_status);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     if (frame_len > (len - sizeof(rx_status))) {
         printf("LAN9514 recv - buffer too small\n)");
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
 
     eth->ifc->recv(eth->cookie, pkt + sizeof(rx_status), frame_len, 0);
-    return MX_OK;
+    return ZX_OK;
 }
 
 
@@ -302,13 +302,13 @@
     lan9514_t* eth = (lan9514_t*)cookie;
     //printf("lan9514 read complete\n");
 
-    if (request->status == MX_ERR_IO_NOT_PRESENT) {
+    if (request->status == ZX_ERR_IO_NOT_PRESENT) {
         iotxn_release(request);
         return;
     }
 
     mtx_lock(&eth->mutex);
-    if ((request->status == MX_OK) && eth->ifc) {
+    if ((request->status == ZX_OK) && eth->ifc) {
         lan9514_recv(eth, request);
     }
 
@@ -322,7 +322,7 @@
 
 static void lan9514_write_complete(iotxn_t* request, void* cookie) {
     lan9514_t* eth = (lan9514_t*)cookie;
-    if (request->status == MX_ERR_IO_NOT_PRESENT) {
+    if (request->status == ZX_ERR_IO_NOT_PRESENT) {
         iotxn_release(request);
         return;
     }
@@ -334,13 +334,13 @@
 
 static void lan9514_interrupt_complete(iotxn_t* request, void* cookie) {
     lan9514_t* eth = (lan9514_t*)cookie;
-    if ((request->status == MX_ERR_IO_NOT_PRESENT) || (request->status == MX_ERR_IO)) { // MX_ERR_IO = NACK (no status change)
+    if ((request->status == ZX_ERR_IO_NOT_PRESENT) || (request->status == ZX_ERR_IO)) { // ZX_ERR_IO = NACK (no status change)
         iotxn_release(request);
         return;
     }
 
     mtx_lock(&eth->mutex);
-    if (request->status == MX_OK && request->actual == sizeof(eth->status)) {
+    if (request->status == ZX_OK && request->actual == sizeof(eth->status)) {
         uint8_t status[INTR_REQ_SIZE];
         iotxn_copyfrom(request, status, sizeof(status), 0);
         memcpy(eth->status, status, sizeof(eth->status));
@@ -394,9 +394,9 @@
     mtx_unlock(&eth->mutex);
 }
 
-static mx_status_t lan9514_stop_xcvr(lan9514_t* eth) {
+static zx_status_t lan9514_stop_xcvr(lan9514_t* eth) {
 
-    mx_status_t status;
+    zx_status_t status;
     uint32_t value;
 
     status = lan9514_read_register(eth, LAN9514_MAC_CR_REG, &value);
@@ -408,9 +408,9 @@
     return lan9514_write_register(eth, LAN9514_MAC_CR_REG, value);
 }
 
-static mx_status_t lan9514_start_xcvr(lan9514_t* eth) {
+static zx_status_t lan9514_start_xcvr(lan9514_t* eth) {
 
-    mx_status_t status;
+    zx_status_t status;
     uint32_t value;
 
     status = lan9514_read_register(eth, LAN9514_MAC_CR_REG, &value);
@@ -466,24 +466,24 @@
     device_remove(eth->device);
 }
 
-static mx_protocol_device_t lan9514_device_proto = {
+static zx_protocol_device_t lan9514_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = lan9514_unbind,
     .release = lan9514_release,
 };
 
-static mx_status_t lan9514_query(void* ctx, uint32_t options, ethmac_info_t* info) {
+static zx_status_t lan9514_query(void* ctx, uint32_t options, ethmac_info_t* info) {
     lan9514_t* eth = ctx;
 
     if (options) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     memset(info, 0, sizeof(*info));
     info->mtu = USB_BUF_SIZE - ETH_HEADER_SIZE;
     memcpy(info->mac, eth->mac_addr, sizeof(eth->mac_addr));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void lan9514_stop(void* ctx) {
@@ -493,13 +493,13 @@
     mtx_unlock(&eth->mutex);
 }
 
-static mx_status_t lan9514_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
+static zx_status_t lan9514_start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
     lan9514_t* eth = ctx;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&eth->mutex);
     if (eth->ifc) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     } else {
         eth->ifc = ifc;
         eth->cookie = cookie;
@@ -517,8 +517,8 @@
     .send = lan9514_send,
 };
 
-static mx_status_t lan9514_reset(lan9514_t* eth) {
-    mx_status_t status = 0;
+static zx_status_t lan9514_reset(lan9514_t* eth) {
+    zx_status_t status = 0;
     uint32_t retval = 0;
 
     status = lan9514_write_register(eth, LAN9514_HW_CFG_REG, LAN9514_HW_CFG_LRST);
@@ -539,13 +539,13 @@
 
     // if we are on rpi, then try to find BCM bus device to fetch MAC address
     // TODO(voydanoff) come up with a better way of accessing the bus protocol
-    mx_device_t* dev = eth->usb_device;
+    zx_device_t* dev = eth->usb_device;
     bcm_bus_protocol_t bus_proto = { NULL, NULL };
     while (dev) {
         platform_device_protocol_t pdev;
 
-        if (device_get_protocol(dev, MX_PROTOCOL_PLATFORM_DEV, &pdev) == MX_OK &&
-                pdev_get_protocol(&pdev, MX_PROTOCOL_BCM_BUS, &bus_proto) == MX_OK) {
+        if (device_get_protocol(dev, ZX_PROTOCOL_PLATFORM_DEV, &pdev) == ZX_OK &&
+                pdev_get_protocol(&pdev, ZX_PROTOCOL_BCM_BUS, &bus_proto) == ZX_OK) {
             break;
         }
         dev = device_get_parent(dev);
@@ -553,7 +553,7 @@
 
     if (bus_proto.ops) {
         uint8_t temp_mac[6];
-        if (bcm_bus_get_macid(&bus_proto, temp_mac) == MX_OK) {
+        if (bcm_bus_get_macid(&bus_proto, temp_mac) == ZX_OK) {
             uint32_t macword = (temp_mac[5] << 8) + temp_mac[4];
             if (lan9514_write_register(eth, LAN9514_ADDR_HI_REG, macword) < 0)
                 goto fail;
@@ -565,7 +565,7 @@
                 goto fail;
         }
     } else {
-        printf("lan9514_reset could not find MX_PROTOCOL_BCM_BUS\n");
+        printf("lan9514_reset could not find ZX_PROTOCOL_BCM_BUS\n");
     }
 
     if (lan9514_read_mac_address(eth) < 0) {
@@ -624,7 +624,7 @@
     lan9514_mdio_read(eth, MII_PHY_BMCR_REG, &bcr);
 
     printf("LAN9514 Initialized! bmcr=%04x  bsr=%04x\n", bcr, inval);
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     lan9514_free(eth);
@@ -634,7 +634,7 @@
 
 static int lan9514_start_thread(void* arg) {
     lan9514_t* eth = (lan9514_t*)arg;
-    mx_status_t status = 0;
+    zx_status_t status = 0;
     printf("Initializing LAN9514...\n");
 
     lan9514_reset(eth);
@@ -644,7 +644,7 @@
         .name = "smsc-lan9514",
         .ctx = eth,
         .ops = &lan9514_device_proto,
-        .proto_id = MX_PROTOCOL_ETHERMAC,
+        .proto_id = ZX_PROTOCOL_ETHERMAC,
         .proto_ops = &ethmac_ops,
     };
 
@@ -661,8 +661,8 @@
 
     while (true) {
         uint16_t temp;
-        status = completion_wait(&eth->phy_state_completion, MX_MSEC(500)); //MX_TIME_INFINITE);
-        if (status == MX_ERR_TIMED_OUT) {
+        status = completion_wait(&eth->phy_state_completion, ZX_MSEC(500)); //ZX_TIME_INFINITE);
+        if (status == ZX_ERR_TIMED_OUT) {
             // do background maintenance and statistics work here
         } else {
             // do interrupt servicing here
@@ -688,12 +688,12 @@
             } else {
                 lan9514_mdio_read(eth, MII_PHY_BSR_REG, &temp);
                 // Wait for link up, catches condition where there may be delay between aneg and link status change
-                mx_time_t timecheck = mx_time_get(MX_CLOCK_MONOTONIC);
+                zx_time_t timecheck = zx_time_get(ZX_CLOCK_MONOTONIC);
                 while (!(temp & MII_PHY_BSR_LINK_UP)) {
                     lan9514_mdio_read(eth, MII_PHY_BSR_REG, &temp);
-                    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
-                    if ((mx_time_get(MX_CLOCK_MONOTONIC - timecheck) > MX_SEC(1))) {
-                        status = MX_ERR_TIMED_OUT;
+                    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
+                    if ((zx_time_get(ZX_CLOCK_MONOTONIC - timecheck) > ZX_SEC(1))) {
+                        status = ZX_ERR_TIMED_OUT;
                         goto teardown;
                     }
                 }
@@ -725,19 +725,19 @@
     return status;
 }
 
-static mx_status_t lan9514_bind(void* ctx, mx_device_t* device, void** cookie) {
+static zx_status_t lan9514_bind(void* ctx, zx_device_t* device, void** cookie) {
     printf("LAN9514 - attempting to bind\n");
 
     usb_protocol_t usb;
 
-    mx_status_t status = device_get_protocol(device, MX_PROTOCOL_USB, &usb);
-    if (status != MX_OK) {
+    zx_status_t status = device_get_protocol(device, ZX_PROTOCOL_USB, &usb);
+    if (status != ZX_OK) {
         return status;
     }
 
     // find our endpoints
     usb_desc_iter_t iter;
-    mx_status_t result = usb_desc_iter_init(&usb, &iter);
+    zx_status_t result = usb_desc_iter_init(&usb, &iter);
     if (result < 0)
         return result;
 
@@ -745,7 +745,7 @@
     printf("lan9514 returned %d endpoints\n", intf->bNumEndpoints);
     if (!intf || intf->bNumEndpoints != 3) {
         usb_desc_iter_release(&iter);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint8_t bulk_in_addr = 0;
@@ -774,14 +774,14 @@
 
     if (!bulk_in_addr || !bulk_out_addr || !intr_addr) {
         printf("lan9514_bind could not find endpoints\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     lan9514_t* eth = calloc(1, sizeof(lan9514_t));
     if (!eth) {
         printf("Not enough memory for lan9514_t\n");
         printf("lan9514_bind failed!\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     list_initialize(&eth->free_read_reqs);
@@ -794,7 +794,7 @@
     for (int i = 0; i < READ_REQ_COUNT; i++) {
         iotxn_t* req = usb_alloc_iotxn(bulk_in_addr, USB_BUF_SIZE);
         if (!req) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         req->length = USB_BUF_SIZE;
@@ -805,7 +805,7 @@
     for (int i = 0; i < WRITE_REQ_COUNT; i++) {
         iotxn_t* req = usb_alloc_iotxn(bulk_out_addr, USB_BUF_SIZE);
         if (!req) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         req->length = USB_BUF_SIZE;
@@ -817,7 +817,7 @@
     for (int i = 0; i < INTR_REQ_COUNT; i++) {
         iotxn_t* req = usb_alloc_iotxn(intr_addr, INTR_REQ_SIZE);
         if (!req) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         req->length = INTR_REQ_SIZE;
@@ -828,7 +828,7 @@
     thrd_t thread;
     thrd_create_with_name(&thread, lan9514_start_thread, eth, "lan9514_start_thread");
     thrd_detach(thread);
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     printf("lan9514_bind failed: %d\n", status);
@@ -836,13 +836,13 @@
     return status;
 }
 
-static mx_driver_ops_t lan9514_driver_ops = {
+static zx_driver_ops_t lan9514_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = lan9514_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(ethernet_lan9514, lan9514_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB),
+ZIRCON_DRIVER_BEGIN(ethernet_lan9514, lan9514_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB),
     BI_ABORT_IF(NE, BIND_USB_VID, SMSC_VID),
     BI_MATCH_IF(EQ, BIND_USB_PID, SMSC_9514_LAN_PID),
-MAGENTA_DRIVER_END(ethernet_lan9514)
+ZIRCON_DRIVER_END(ethernet_lan9514)
diff --git a/system/dev/ethernet/usb-cdc-ecm/rules.mk b/system/dev/ethernet/usb-cdc-ecm/rules.mk
index 44ad705..a547234 100644
--- a/system/dev/ethernet/usb-cdc-ecm/rules.mk
+++ b/system/dev/ethernet/usb-cdc-ecm/rules.mk
@@ -8,7 +8,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/pretty system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 MODULE := $(LOCAL_DIR)
 
diff --git a/system/dev/ethernet/usb-cdc-ecm/usb-cdc-ecm.c b/system/dev/ethernet/usb-cdc-ecm/usb-cdc-ecm.c
index 6019e9f..3f5df24 100644
--- a/system/dev/ethernet/usb-cdc-ecm/usb-cdc-ecm.c
+++ b/system/dev/ethernet/usb-cdc-ecm/usb-cdc-ecm.c
@@ -7,7 +7,7 @@
 #include <ddk/driver.h>
 #include <ddk/protocol/ethernet.h>
 #include <driver/usb.h>
-#include <magenta/hw/usb-cdc.h>
+#include <zircon/hw/usb-cdc.h>
 #include <sync/completion.h>
 
 #include <inttypes.h>
@@ -37,8 +37,8 @@
 } ecm_endpoint_t;
 
 typedef struct {
-    mx_device_t* mxdev;
-    mx_device_t* usb_device;
+    zx_device_t* mxdev;
+    zx_device_t* usb_device;
     usb_protocol_t usb;
 
     mtx_t ethmac_mutex;
@@ -96,7 +96,7 @@
     ecm_free(eth);
 }
 
-static mx_protocol_device_t ecm_device_proto = {
+static zx_protocol_device_t ecm_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = ecm_unbind,
     .release = ecm_release,
@@ -128,7 +128,7 @@
     mtx_unlock(&ctx->ethmac_mutex);
 }
 
-static mx_status_t ethmac_query(void* ctx, uint32_t options, ethmac_info_t* info) {
+static zx_status_t ethmac_query(void* ctx, uint32_t options, ethmac_info_t* info) {
     ecm_ctx_t* eth = ctx;
 
     xprintf("%s: ethmac_query called\n", module_name);
@@ -136,14 +136,14 @@
     // No options are supported
     if (options) {
         printf("%s: unexpected options (0x%"PRIx32") to ethmac_query\n", module_name, options);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     memset(info, 0, sizeof(*info));
     info->mtu = eth->mtu;
     memcpy(info->mac, eth->mac_addr, sizeof(eth->mac_addr));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void ethmac_stop(void* cookie) {
@@ -154,14 +154,14 @@
     mtx_unlock(&ctx->ethmac_mutex);
 }
 
-static mx_status_t ethmac_start(void* ctx_cookie, ethmac_ifc_t* ifc, void* ethmac_cookie) {
+static zx_status_t ethmac_start(void* ctx_cookie, ethmac_ifc_t* ifc, void* ethmac_cookie) {
     xprintf("%s: ethmac_start called\n", module_name);
     ecm_ctx_t* ctx = ctx_cookie;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&ctx->ethmac_mutex);
     if (ctx->ethmac_ifc) {
-        status = MX_ERR_ALREADY_BOUND;
+        status = ZX_ERR_ALREADY_BOUND;
     } else {
         ctx->ethmac_ifc = ifc;
         ctx->ethmac_cookie = ethmac_cookie;
@@ -175,7 +175,7 @@
 static void usb_write_complete(iotxn_t* request, void* cookie) {
     ecm_ctx_t* ctx = cookie;
 
-    if (request->status == MX_ERR_IO_NOT_PRESENT) {
+    if (request->status == ZX_ERR_IO_NOT_PRESENT) {
         iotxn_release(request);
         return;
     }
@@ -185,7 +185,7 @@
     // Return transmission buffer to pool
     list_add_tail(&ctx->tx_txn_bufs, &request->node);
 
-    if (request->status == MX_ERR_IO_REFUSED) {
+    if (request->status == ZX_ERR_IO_REFUSED) {
         xprintf("%s: resetting transmit endpoint\n", module_name);
         usb_reset_endpoint(&ctx->usb, ctx->tx_endpoint.addr);
     }
@@ -193,7 +193,7 @@
     mtx_unlock(&ctx->tx_mutex);
 
     // When the interface is offline, the transaction will complete with status set to
-    // MX_ERR_IO_NOT_PRESENT. There's not much we can do except ignore it.
+    // ZX_ERR_IO_NOT_PRESENT. There's not much we can do except ignore it.
 }
 
 // Note: the assumption made here is that no rx transmissions will be processed in parallel,
@@ -214,20 +214,20 @@
 static void usb_read_complete(iotxn_t* request, void* cookie) {
     ecm_ctx_t* ctx = cookie;
 
-    if (request->status != MX_OK) {
+    if (request->status != ZX_OK) {
         xprintf("%s: usb_read_complete called with status %d\n",
                 module_name, (int)request->status);
     }
 
-    if (request->status == MX_ERR_IO_NOT_PRESENT) {
+    if (request->status == ZX_ERR_IO_NOT_PRESENT) {
         iotxn_release(request);
         return;
     }
 
-    if (request->status == MX_ERR_IO_REFUSED) {
+    if (request->status == ZX_ERR_IO_REFUSED) {
         xprintf("%s: resetting receive endpoint\n", module_name);
         usb_reset_endpoint(&ctx->usb, ctx->rx_endpoint.addr);
-    } else if (request->status == MX_OK) {
+    } else if (request->status == ZX_OK) {
         usb_recv(ctx, request);
     }
 
@@ -359,13 +359,13 @@
     while (true) {
         completion_reset(&ctx->completion);
         iotxn_queue(ctx->usb_device, txn);
-        completion_wait(&ctx->completion, MX_TIME_INFINITE);
-        if (txn->status == MX_OK) {
+        completion_wait(&ctx->completion, ZX_TIME_INFINITE);
+        if (txn->status == ZX_OK) {
             ecm_handle_interrupt(ctx, txn);
-        } else if (txn->status == MX_ERR_PEER_CLOSED || txn->status == MX_ERR_IO_NOT_PRESENT) {
+        } else if (txn->status == ZX_ERR_PEER_CLOSED || txn->status == ZX_ERR_IO_NOT_PRESENT) {
             xprintf("%s: terminating interrupt handling thread\n", module_name);
             return txn->status;
-        } else if (txn->status == MX_ERR_IO_REFUSED) {
+        } else if (txn->status == ZX_ERR_IO_REFUSED) {
             xprintf("%s: resetting interrupt endpoint\n", module_name);
             usb_reset_endpoint(&ctx->usb, ctx->int_endpoint.addr);
         } else {
@@ -391,8 +391,8 @@
     char str_desc_buf[expected_str_size];
 
     // Read string descriptor for MAC address (string index is in iMACAddress field)
-    mx_status_t result = usb_get_descriptor(&ctx->usb, 0, USB_DT_STRING, desc->iMACAddress,
-                                            str_desc_buf, sizeof(str_desc_buf), MX_TIME_INFINITE);
+    zx_status_t result = usb_get_descriptor(&ctx->usb, 0, USB_DT_STRING, desc->iMACAddress,
+                                            str_desc_buf, sizeof(str_desc_buf), ZX_TIME_INFINITE);
     if (result < 0) {
         printf("%s: error reading MAC address\n", module_name);
         return false;
@@ -446,12 +446,12 @@
     return intf->bInterfaceClass == USB_CLASS_CDC;
 }
 
-static mx_status_t ecm_bind(void* ctx, mx_device_t* device, void** cookie) {
+static zx_status_t ecm_bind(void* ctx, zx_device_t* device, void** cookie) {
     xprintf("%s: starting ecm_bind\n", module_name);
 
     usb_protocol_t usb;
-    mx_status_t result = device_get_protocol(device, MX_PROTOCOL_USB, &usb);
-    if (result != MX_OK) {
+    zx_status_t result = device_get_protocol(device, ZX_PROTOCOL_USB, &usb);
+    if (result != ZX_OK) {
         return result;
     }
 
@@ -459,11 +459,11 @@
     ecm_ctx_t* ecm_ctx = calloc(1, sizeof(ecm_ctx_t));
     if (!ecm_ctx) {
         printf("%s: failed to allocate memory for USB CDC ECM driver\n", module_name);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     result = usb_claim_additional_interfaces(&usb, want_interface, NULL);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         goto fail;
     }
     // Initialize context
@@ -475,10 +475,10 @@
 
     usb_desc_iter_t iter;
     result = usb_desc_iter_init(&usb, &iter);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         goto fail;
     }
-    result = MX_ERR_NOT_SUPPORTED;
+    result = ZX_ERR_NOT_SUPPORTED;
 
     // Find the CDC descriptors and endpoints
     usb_descriptor_header_t* desc = usb_desc_iter_next(&iter);
@@ -592,7 +592,7 @@
     iotxn_t* int_buf = usb_alloc_iotxn(ecm_ctx->int_endpoint.addr,
                                        ecm_ctx->int_endpoint.max_packet_size);
     if (!int_buf) {
-        result = MX_ERR_NO_MEMORY;
+        result = ZX_ERR_NO_MEMORY;
         goto fail;
     }
     int_buf->length = ecm_ctx->int_endpoint.max_packet_size;
@@ -610,7 +610,7 @@
     while (tx_buf_remain >= tx_buf_sz) {
         iotxn_t* tx_buf = usb_alloc_iotxn(ecm_ctx->tx_endpoint.addr, tx_buf_sz);
         if (!tx_buf) {
-            result = MX_ERR_NO_MEMORY;
+            result = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         tx_buf->complete_cb = usb_write_complete;
@@ -629,7 +629,7 @@
     while (rx_buf_remain >= rx_buf_sz) {
         iotxn_t* rx_buf = usb_alloc_iotxn(ecm_ctx->rx_endpoint.addr, rx_buf_sz);
         if (!rx_buf) {
-            result = MX_ERR_NO_MEMORY;
+            result = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         rx_buf->complete_cb = usb_read_complete;
@@ -653,7 +653,7 @@
         .name = "usb-cdc-ecm",
         .ctx = ecm_ctx,
         .ops = &ecm_device_proto,
-        .proto_id = MX_PROTOCOL_ETHERMAC,
+        .proto_id = ZX_PROTOCOL_ETHERMAC,
         .proto_ops = &ethmac_ops,
     };
     result = device_add(ecm_ctx->usb_device, &args, &ecm_ctx->mxdev);
@@ -663,7 +663,7 @@
     }
 
     usb_desc_iter_release(&iter);
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     usb_desc_iter_release(&iter);
@@ -672,14 +672,14 @@
     return result;
 }
 
-static mx_driver_ops_t ecm_driver_ops = {
+static zx_driver_ops_t ecm_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ecm_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(ethernet_usb_cdc_ecm, ecm_driver_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB),
+ZIRCON_DRIVER_BEGIN(ethernet_usb_cdc_ecm, ecm_driver_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB),
     BI_ABORT_IF(NE, BIND_USB_CLASS, USB_CLASS_COMM),
     BI_ABORT_IF(NE, BIND_USB_SUBCLASS, USB_CDC_SUBCLASS_ETHERNET),
     BI_MATCH_IF(EQ, BIND_USB_PROTOCOL, 0),
-MAGENTA_DRIVER_END(ethernet_usb_cdc_ecm)
+ZIRCON_DRIVER_END(ethernet_usb_cdc_ecm)
diff --git a/system/dev/input/hid/hid-fifo.c b/system/dev/input/hid/hid-fifo.c
index 4d0a1f7..6efb471 100644
--- a/system/dev/input/hid/hid-fifo.c
+++ b/system/dev/input/hid/hid-fifo.c
@@ -10,41 +10,41 @@
 
 #define min(a,b) ((a) < (b) ? (a) : (b))
 
-mx_status_t mx_hid_fifo_create(mx_hid_fifo_t** fifo) {
-    *fifo = malloc(sizeof(mx_hid_fifo_t));
+zx_status_t zx_hid_fifo_create(zx_hid_fifo_t** fifo) {
+    *fifo = malloc(sizeof(zx_hid_fifo_t));
     if (*fifo == NULL)
-        return MX_ERR_NO_MEMORY;
-    mx_hid_fifo_init(*fifo);
-    return MX_OK;
+        return ZX_ERR_NO_MEMORY;
+    zx_hid_fifo_init(*fifo);
+    return ZX_OK;
 }
 
-void mx_hid_fifo_init(mx_hid_fifo_t* fifo) {
+void zx_hid_fifo_init(zx_hid_fifo_t* fifo) {
     memset(fifo->buf, 0, HID_FIFO_SIZE);
     fifo->head = fifo->tail = 0;
     fifo->empty = true;
     mtx_init(&fifo->lock, mtx_plain);
 }
 
-size_t mx_hid_fifo_size(mx_hid_fifo_t* fifo) {
+size_t zx_hid_fifo_size(zx_hid_fifo_t* fifo) {
     if (fifo->empty) return 0;
     if (fifo->head > fifo->tail)
         return fifo->head - fifo->tail;
     return HID_FIFO_SIZE - fifo->tail + fifo->head;
 }
 
-ssize_t mx_hid_fifo_peek(mx_hid_fifo_t* fifo, void* out) {
+ssize_t zx_hid_fifo_peek(zx_hid_fifo_t* fifo, void* out) {
     if (fifo->empty)
         return 0;
     *(uint8_t*)out = fifo->buf[fifo->tail];
     return 1;
 }
 
-ssize_t mx_hid_fifo_read(mx_hid_fifo_t* fifo, void* buf, size_t len) {
-    if (!buf) return MX_ERR_INVALID_ARGS;
+ssize_t zx_hid_fifo_read(zx_hid_fifo_t* fifo, void* buf, size_t len) {
+    if (!buf) return ZX_ERR_INVALID_ARGS;
     if (fifo->empty) return 0;
     if (!len) return 0;
 
-    len = min(mx_hid_fifo_size(fifo), len);
+    len = min(zx_hid_fifo_size(fifo), len);
     for (size_t c = len; c > 0; c--, fifo->tail = (fifo->tail + 1) & HID_FIFO_MASK) {
         *(uint8_t*)buf++ = fifo->buf[fifo->tail];
     }
@@ -52,9 +52,9 @@
     return len;
 }
 
-ssize_t mx_hid_fifo_write(mx_hid_fifo_t* fifo, const void* buf, size_t len) {
-    if (!fifo->empty && fifo->tail == fifo->head) return MX_ERR_BUFFER_TOO_SMALL;
-    if (len > HID_FIFO_SIZE - mx_hid_fifo_size(fifo)) return MX_ERR_BUFFER_TOO_SMALL;
+ssize_t zx_hid_fifo_write(zx_hid_fifo_t* fifo, const void* buf, size_t len) {
+    if (!fifo->empty && fifo->tail == fifo->head) return ZX_ERR_BUFFER_TOO_SMALL;
+    if (len > HID_FIFO_SIZE - zx_hid_fifo_size(fifo)) return ZX_ERR_BUFFER_TOO_SMALL;
 
     for (size_t c = len; c > 0; c--, fifo->head = (fifo->head + 1) & HID_FIFO_MASK) {
         fifo->buf[fifo->head] = *(uint8_t*)buf++;
@@ -63,8 +63,8 @@
     return len;
 }
 
-void mx_hid_fifo_dump(mx_hid_fifo_t* fifo) {
-    printf("mx_hid_fifo_dump %p\n", fifo);
+void zx_hid_fifo_dump(zx_hid_fifo_t* fifo) {
+    printf("zx_hid_fifo_dump %p\n", fifo);
     printf("head: %u  tail: %u  empty: %s\n", fifo->head, fifo->tail, fifo->empty ? "Y" : "N");
     if (fifo->empty) {
         return;
diff --git a/system/dev/input/hid/hid-fifo.h b/system/dev/input/hid/hid-fifo.h
index 0a8daac..024eba9 100644
--- a/system/dev/input/hid/hid-fifo.h
+++ b/system/dev/input/hid/hid-fifo.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 #include <stdbool.h>
 #include <stddef.h>
@@ -26,15 +26,15 @@
     uint32_t tail;
     bool empty;
     mtx_t lock;
-} mx_hid_fifo_t;
+} zx_hid_fifo_t;
 
-mx_status_t mx_hid_fifo_create(mx_hid_fifo_t** fifo);
-void mx_hid_fifo_init(mx_hid_fifo_t* fifo);
-size_t mx_hid_fifo_size(mx_hid_fifo_t* fifo);
-ssize_t mx_hid_fifo_peek(mx_hid_fifo_t* fifo, void* out);
-ssize_t mx_hid_fifo_read(mx_hid_fifo_t* fifo, void* buf, size_t len);
-ssize_t mx_hid_fifo_write(mx_hid_fifo_t* fifo, const void* buf, size_t len);
+zx_status_t zx_hid_fifo_create(zx_hid_fifo_t** fifo);
+void zx_hid_fifo_init(zx_hid_fifo_t* fifo);
+size_t zx_hid_fifo_size(zx_hid_fifo_t* fifo);
+ssize_t zx_hid_fifo_peek(zx_hid_fifo_t* fifo, void* out);
+ssize_t zx_hid_fifo_read(zx_hid_fifo_t* fifo, void* buf, size_t len);
+ssize_t zx_hid_fifo_write(zx_hid_fifo_t* fifo, const void* buf, size_t len);
 
-void mx_hid_fifo_dump(mx_hid_fifo_t* fifo);
+void zx_hid_fifo_dump(zx_hid_fifo_t* fifo);
 
 __END_CDECLS;
diff --git a/system/dev/input/hid/hid.c b/system/dev/input/hid/hid.c
index b6fdb1b..850dd2c 100644
--- a/system/dev/input/hid/hid.c
+++ b/system/dev/input/hid/hid.c
@@ -9,10 +9,10 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 #include <ddk/protocol/hidbus.h>
-#include <magenta/device/input.h>
+#include <zircon/device/input.h>
 
-#include <magenta/assert.h>
-#include <magenta/listnode.h>
+#include <zircon/assert.h>
+#include <zircon/listnode.h>
 
 #include <assert.h>
 #include <stdlib.h>
@@ -47,7 +47,7 @@
 } hid_report_size_t;
 
 typedef struct hid_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     hid_info_t info;
     hidbus_protocol_t hid;
@@ -70,27 +70,27 @@
     struct list_node instance_list;
     mtx_t instance_lock;
 
-    char name[MX_DEVICE_NAME_MAX + 1];
+    char name[ZX_DEVICE_NAME_MAX + 1];
 } hid_device_t;
 
 typedef struct hid_instance {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     hid_device_t* base;
 
     uint32_t flags;
 
-    mx_hid_fifo_t fifo;
+    zx_hid_fifo_t fifo;
 
     struct list_node node;
 } hid_instance_t;
 
 // Convenience functions for calling hidbus protocol functions
 
-static inline mx_status_t hid_op_query(hid_device_t* hid, uint32_t options, hid_info_t* info) {
+static inline zx_status_t hid_op_query(hid_device_t* hid, uint32_t options, hid_info_t* info) {
     return hid->hid.ops->query(hid->hid.ctx, options, info);
 }
 
-static inline mx_status_t hid_op_start(hid_device_t* hid, hidbus_ifc_t* ifc, void* cookie) {
+static inline zx_status_t hid_op_start(hid_device_t* hid, hidbus_ifc_t* ifc, void* cookie) {
     return hid->hid.ops->start(hid->hid.ctx, ifc, cookie);
 }
 
@@ -98,34 +98,34 @@
     hid->hid.ops->stop(hid->hid.ctx);
 }
 
-static inline mx_status_t hid_op_get_descriptor(hid_device_t* hid, uint8_t desc_type,
+static inline zx_status_t hid_op_get_descriptor(hid_device_t* hid, uint8_t desc_type,
                                                 void** data, size_t* len) {
     return hid->hid.ops->get_descriptor(hid->hid.ctx, desc_type, data, len);
 }
 
-static inline mx_status_t hid_op_get_report(hid_device_t* hid, uint8_t rpt_type, uint8_t rpt_id,
+static inline zx_status_t hid_op_get_report(hid_device_t* hid, uint8_t rpt_type, uint8_t rpt_id,
                                             void* data, size_t len) {
     return hid->hid.ops->get_report(hid->hid.ctx, rpt_type, rpt_id, data, len);
 }
 
-static inline mx_status_t hid_op_set_report(hid_device_t* hid, uint8_t rpt_type, uint8_t rpt_id,
+static inline zx_status_t hid_op_set_report(hid_device_t* hid, uint8_t rpt_type, uint8_t rpt_id,
                                             void* data, size_t len) {
     return hid->hid.ops->set_report(hid->hid.ctx, rpt_type, rpt_id, data, len);
 }
 
-static inline mx_status_t hid_op_get_idle(hid_device_t* hid, uint8_t rpt_id, uint8_t* duration) {
+static inline zx_status_t hid_op_get_idle(hid_device_t* hid, uint8_t rpt_id, uint8_t* duration) {
     return hid->hid.ops->get_idle(hid->hid.ctx, rpt_id, duration);
 }
 
-static inline mx_status_t hid_op_set_idle(hid_device_t* hid, uint8_t rpt_id, uint8_t duration) {
+static inline zx_status_t hid_op_set_idle(hid_device_t* hid, uint8_t rpt_id, uint8_t duration) {
     return hid->hid.ops->set_idle(hid->hid.ctx, rpt_id, duration);
 }
 
-static inline mx_status_t hid_op_get_protocol(hid_device_t* hid, uint8_t* protocol) {
+static inline zx_status_t hid_op_get_protocol(hid_device_t* hid, uint8_t* protocol) {
     return hid->hid.ops->get_protocol(hid->hid.ctx, protocol);
 }
 
-static inline mx_status_t hid_op_set_protocol(hid_device_t* hid, uint8_t protocol) {
+static inline zx_status_t hid_op_set_protocol(hid_device_t* hid, uint8_t protocol) {
     return hid->hid.ops->set_protocol(hid->hid.ctx, protocol);
 }
 
@@ -149,9 +149,9 @@
     return 0;
 }
 
-static mx_status_t hid_get_protocol(hid_device_t* hid, void* out_buf, size_t out_len,
+static zx_status_t hid_get_protocol(hid_device_t* hid, void* out_buf, size_t out_len,
                                     size_t* out_actual) {
-    if (out_len < sizeof(int)) return MX_ERR_INVALID_ARGS;
+    if (out_len < sizeof(int)) return ZX_ERR_INVALID_ARGS;
 
     int* reply = out_buf;
     *reply = INPUT_PROTO_NONE;
@@ -161,71 +161,71 @@
         *reply = INPUT_PROTO_MOUSE;
     }
     *out_actual = sizeof(*reply);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t hid_get_hid_desc_size(hid_device_t* hid, void* out_buf, size_t out_len,
+static zx_status_t hid_get_hid_desc_size(hid_device_t* hid, void* out_buf, size_t out_len,
                                          size_t* out_actual) {
-    if (out_len < sizeof(size_t)) return MX_ERR_INVALID_ARGS;
+    if (out_len < sizeof(size_t)) return ZX_ERR_INVALID_ARGS;
 
     size_t* reply = out_buf;
     *reply = hid->hid_report_desc_len;
     *out_actual = sizeof(*reply);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t hid_get_hid_desc(hid_device_t* hid, void* out_buf, size_t out_len,
+static zx_status_t hid_get_hid_desc(hid_device_t* hid, void* out_buf, size_t out_len,
                                     size_t* out_actual) {
-    if (out_len < hid->hid_report_desc_len) return MX_ERR_INVALID_ARGS;
+    if (out_len < hid->hid_report_desc_len) return ZX_ERR_INVALID_ARGS;
 
     memcpy(out_buf, hid->hid_report_desc, hid->hid_report_desc_len);
     *out_actual = hid->hid_report_desc_len;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t hid_get_num_reports(hid_device_t* hid, void* out_buf, size_t out_len,
+static zx_status_t hid_get_num_reports(hid_device_t* hid, void* out_buf, size_t out_len,
                                        size_t* out_actual) {
-    if (out_len < sizeof(size_t)) return MX_ERR_INVALID_ARGS;
+    if (out_len < sizeof(size_t)) return ZX_ERR_INVALID_ARGS;
 
     size_t* reply = out_buf;
     *reply = hid->num_reports;
     *out_actual = sizeof(*reply);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t hid_get_report_ids(hid_device_t* hid, void* out_buf, size_t out_len,
+static zx_status_t hid_get_report_ids(hid_device_t* hid, void* out_buf, size_t out_len,
                                       size_t* out_actual) {
     if (out_len < hid->num_reports * sizeof(input_report_id_t))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     input_report_id_t* reply = out_buf;
     for (size_t i = 0; i < hid->num_reports; i++) {
         *reply++ = (input_report_id_t)hid->sizes[i].id;
     }
     *out_actual =  hid->num_reports * sizeof(input_report_id_t);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t hid_get_report_size(hid_device_t* hid, const void* in_buf, size_t in_len,
+static zx_status_t hid_get_report_size(hid_device_t* hid, const void* in_buf, size_t in_len,
                                        void* out_buf, size_t out_len, size_t* out_actual) {
-    if (in_len < sizeof(input_get_report_size_t)) return MX_ERR_INVALID_ARGS;
-    if (out_len < sizeof(input_report_size_t)) return MX_ERR_INVALID_ARGS;
+    if (in_len < sizeof(input_get_report_size_t)) return ZX_ERR_INVALID_ARGS;
+    if (out_len < sizeof(input_report_size_t)) return ZX_ERR_INVALID_ARGS;
 
     const input_get_report_size_t* inp = in_buf;
 
     input_report_size_t* reply = out_buf;
     *reply = hid_get_report_size_by_id(hid, inp->id, inp->type);
     if (*reply == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     *out_actual = sizeof(*reply);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static ssize_t hid_get_max_input_reportsize(hid_device_t* hid, void* out_buf, size_t out_len,
                                             size_t* out_actual) {
-    if (out_len < sizeof(input_report_size_t)) return MX_ERR_INVALID_ARGS;
+    if (out_len < sizeof(input_report_size_t)) return ZX_ERR_INVALID_ARGS;
 
     input_report_size_t* reply = out_buf;
 
@@ -237,91 +237,91 @@
 
     *reply = bits_to_bytes(*reply);
     *out_actual = sizeof(*reply);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t hid_get_report(hid_device_t* hid, const void* in_buf, size_t in_len,
+static zx_status_t hid_get_report(hid_device_t* hid, const void* in_buf, size_t in_len,
                                   void* out_buf, size_t out_len, size_t* out_actual) {
-    if (in_len < sizeof(input_get_report_t)) return MX_ERR_INVALID_ARGS;
+    if (in_len < sizeof(input_get_report_t)) return ZX_ERR_INVALID_ARGS;
     const input_get_report_t* inp = in_buf;
 
     input_report_size_t needed = hid_get_report_size_by_id(hid, inp->id, inp->type);
-    if (needed == 0) return MX_ERR_INVALID_ARGS;
-    if (out_len < (size_t)needed) return MX_ERR_BUFFER_TOO_SMALL;
+    if (needed == 0) return ZX_ERR_INVALID_ARGS;
+    if (out_len < (size_t)needed) return ZX_ERR_BUFFER_TOO_SMALL;
 
-    mx_status_t status = hid_op_get_report(hid, inp->type, inp->id, out_buf, out_len);
+    zx_status_t status = hid_op_get_report(hid, inp->type, inp->id, out_buf, out_len);
     if (status >= 0) {
         *out_actual = status;
-        status = MX_OK;
+        status = ZX_OK;
     }
     return status;
 }
 
-static mx_status_t hid_set_report(hid_device_t* hid, const void* in_buf, size_t in_len) {
+static zx_status_t hid_set_report(hid_device_t* hid, const void* in_buf, size_t in_len) {
 
-    if (in_len < sizeof(input_set_report_t)) return MX_ERR_INVALID_ARGS;
+    if (in_len < sizeof(input_set_report_t)) return ZX_ERR_INVALID_ARGS;
     const input_set_report_t* inp = in_buf;
 
     input_report_size_t needed = hid_get_report_size_by_id(hid, inp->id, inp->type);
-    if (needed == 0) return MX_ERR_INVALID_ARGS;
-    if (in_len - sizeof(input_set_report_t) < (size_t)needed) return MX_ERR_INVALID_ARGS;
+    if (needed == 0) return ZX_ERR_INVALID_ARGS;
+    if (in_len - sizeof(input_set_report_t) < (size_t)needed) return ZX_ERR_INVALID_ARGS;
 
     return hid_op_set_report(hid, inp->type, inp->id, (void*)inp->data,
                              in_len - sizeof(input_set_report_t));
 }
 
 
-static mx_status_t hid_read_instance(void* ctx, void* buf, size_t count, mx_off_t off,
+static zx_status_t hid_read_instance(void* ctx, void* buf, size_t count, zx_off_t off,
                                      size_t* actual) {
     hid_instance_t* hid = ctx;
 
     if (hid->flags & HID_FLAGS_DEAD) {
-        return MX_ERR_PEER_CLOSED;
+        return ZX_ERR_PEER_CLOSED;
     }
 
     size_t left;
     mtx_lock(&hid->fifo.lock);
     size_t xfer;
     uint8_t rpt_id;
-    ssize_t r = mx_hid_fifo_peek(&hid->fifo, &rpt_id);
+    ssize_t r = zx_hid_fifo_peek(&hid->fifo, &rpt_id);
     if (r < 1) {
         // fifo is empty
         mtx_unlock(&hid->fifo.lock);
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
     }
 
     xfer = hid_get_report_size_by_id(hid->base, rpt_id, INPUT_REPORT_INPUT);
     if (xfer == 0) {
         dprintf(ERROR, "error reading hid device: unknown report id (%u)!\n", rpt_id);
         mtx_unlock(&hid->fifo.lock);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (xfer > count) {
         dprintf(SPEW, "next report: %zd, read count: %zd\n", xfer, count);
         mtx_unlock(&hid->fifo.lock);
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
 
-    r = mx_hid_fifo_read(&hid->fifo, buf, xfer);
-    left = mx_hid_fifo_size(&hid->fifo);
+    r = zx_hid_fifo_read(&hid->fifo, buf, xfer);
+    left = zx_hid_fifo_size(&hid->fifo);
     if (left == 0) {
         device_state_clr(hid->mxdev, DEV_STATE_READABLE);
     }
     mtx_unlock(&hid->fifo.lock);
     if (r > 0) {
         *actual = r;
-        r = MX_OK;
+        r = ZX_OK;
     } else if (r == 0) {
-        r = MX_ERR_SHOULD_WAIT;
+        r = ZX_ERR_SHOULD_WAIT;
     }
     return r;
 }
 
-static mx_status_t hid_ioctl_instance(void* ctx, uint32_t op,
+static zx_status_t hid_ioctl_instance(void* ctx, uint32_t op,
         const void* in_buf, size_t in_len, void* out_buf, size_t out_len, size_t* out_actual) {
     hid_instance_t* hid = ctx;
-    if (hid->flags & HID_FLAGS_DEAD) return MX_ERR_PEER_CLOSED;
+    if (hid->flags & HID_FLAGS_DEAD) return ZX_ERR_PEER_CLOSED;
 
     switch (op) {
     case IOCTL_INPUT_GET_PROTOCOL:
@@ -343,17 +343,17 @@
     case IOCTL_INPUT_SET_REPORT:
         return hid_set_report(hid->base, in_buf, in_len);
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t hid_close_instance(void* ctx, uint32_t flags) {
+static zx_status_t hid_close_instance(void* ctx, uint32_t flags) {
     hid_instance_t* hid = ctx;
     hid->flags |= HID_FLAGS_DEAD;
     mtx_lock(&hid->base->instance_lock);
     // TODO: refcount the base device and call stop if no instances are open
     list_delete(&hid->node);
     mtx_unlock(&hid->base->instance_lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void hid_release_reassembly_buffer(hid_device_t* dev);
@@ -363,7 +363,7 @@
     free(hid);
 }
 
-mx_protocol_device_t hid_instance_proto = {
+zx_protocol_device_t hid_instance_proto = {
     .version = DEVICE_OPS_VERSION,
     .read = hid_read_instance,
     .ioctl = hid_ioctl_instance,
@@ -447,7 +447,7 @@
 }
 
 static int hid_fetch_or_alloc_report_ndx(input_report_id_t report_id, hid_device_t* dev) {
-    MX_DEBUG_ASSERT(dev->num_reports <= countof(dev->sizes));
+    ZX_DEBUG_ASSERT(dev->num_reports <= countof(dev->sizes));
     for (size_t i = 0; i < dev->num_reports; i++) {
         if (dev->sizes[i].id == report_id)
             return i;
@@ -455,9 +455,9 @@
 
     if (dev->num_reports < countof(dev->sizes)) {
         dev->sizes[dev->num_reports].id = report_id;
-        MX_DEBUG_ASSERT(dev->sizes[dev->num_reports].in_size == 0);
-        MX_DEBUG_ASSERT(dev->sizes[dev->num_reports].out_size == 0);
-        MX_DEBUG_ASSERT(dev->sizes[dev->num_reports].feat_size == 0);
+        ZX_DEBUG_ASSERT(dev->sizes[dev->num_reports].in_size == 0);
+        ZX_DEBUG_ASSERT(dev->sizes[dev->num_reports].out_size == 0);
+        ZX_DEBUG_ASSERT(dev->sizes[dev->num_reports].feat_size == 0);
         return dev->num_reports++;
     } else {
         return -1;
@@ -472,28 +472,28 @@
     list_node_t node;
 } hid_global_state_t;
 
-static mx_status_t hid_push_global_state(list_node_t* stack, hid_global_state_t* state) {
+static zx_status_t hid_push_global_state(list_node_t* stack, hid_global_state_t* state) {
     hid_global_state_t* entry = malloc(sizeof(*entry));
     if (entry == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     entry->rpt_size = state->rpt_size;
     entry->rpt_count = state->rpt_count;
     entry->rpt_id = state->rpt_id;
     list_add_tail(stack, &entry->node);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t hid_pop_global_state(list_node_t* stack, hid_global_state_t* state) {
+static zx_status_t hid_pop_global_state(list_node_t* stack, hid_global_state_t* state) {
     hid_global_state_t* entry = list_remove_tail_type(stack, hid_global_state_t, node);
     if (entry == NULL) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     state->rpt_size = entry->rpt_size;
     state->rpt_count = entry->rpt_count;
     state->rpt_id = entry->rpt_id;
     free(entry);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void hid_clear_global_state(list_node_t* stack) {
@@ -504,10 +504,10 @@
     }
 }
 
-static mx_status_t hid_process_hid_report_desc(hid_device_t* dev) {
+static zx_status_t hid_process_hid_report_desc(hid_device_t* dev) {
     const uint8_t* buf = dev->hid_report_desc;
     const uint8_t* end = buf + dev->hid_report_desc_len;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     hid_item_t item;
 
     bool has_rpt_id = false;
@@ -525,7 +525,7 @@
             case HID_ITEM_MAIN_TAG_INPUT:
                 idx = hid_fetch_or_alloc_report_ndx(state.rpt_id, dev);
                 if (idx < 0) {
-                    status = MX_ERR_NOT_SUPPORTED;
+                    status = ZX_ERR_NOT_SUPPORTED;
                     goto done;
                 }
                 dev->sizes[idx].in_size += inc;
@@ -533,7 +533,7 @@
             case HID_ITEM_MAIN_TAG_OUTPUT:
                 idx = hid_fetch_or_alloc_report_ndx(state.rpt_id, dev);
                 if (idx < 0) {
-                    status = MX_ERR_NOT_SUPPORTED;
+                    status = ZX_ERR_NOT_SUPPORTED;
                     goto done;
                 }
                 dev->sizes[idx].out_size += inc;
@@ -541,7 +541,7 @@
             case HID_ITEM_MAIN_TAG_FEATURE:
                 idx = hid_fetch_or_alloc_report_ndx(state.rpt_id, dev);
                 if (idx < 0) {
-                    status = MX_ERR_NOT_SUPPORTED;
+                    status = ZX_ERR_NOT_SUPPORTED;
                     goto done;
                 }
                 dev->sizes[idx].feat_size += inc;
@@ -565,13 +565,13 @@
                 break;
             case HID_ITEM_GLOBAL_TAG_PUSH:
                 status = hid_push_global_state(&global_stack, &state);
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     goto done;
                 }
                 break;
             case HID_ITEM_GLOBAL_TAG_POP:
                 status = hid_pop_global_state(&global_stack, &state);
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     goto done;
                 }
                 break;
@@ -587,7 +587,7 @@
 done:
     hid_clear_global_state(&global_stack);
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
 #if BOOT_MOUSE_HACK
         // Ignore the HID report descriptor from the device, since we're putting
         // the device into boot protocol mode.
@@ -615,7 +615,7 @@
 #endif
         // If we saw a report ID, adjust the expected report sizes to reflect
         // the fact that we expect a report ID to be prepended to each report.
-        MX_DEBUG_ASSERT(dev->num_reports <= countof(dev->sizes));
+        ZX_DEBUG_ASSERT(dev->num_reports <= countof(dev->sizes));
         if (has_rpt_id) {
             for (size_t i = 0; i < dev->num_reports; ++i) {
                 if (dev->sizes[i].in_size)   dev->sizes[i].in_size   += 8;
@@ -639,11 +639,11 @@
     dev->rbuf_needed =  0;
 }
 
-static mx_status_t hid_init_reassembly_buffer(hid_device_t* dev) {
-    MX_DEBUG_ASSERT(dev->rbuf == NULL);
-    MX_DEBUG_ASSERT(dev->rbuf_size == 0);
-    MX_DEBUG_ASSERT(dev->rbuf_filled == 0);
-    MX_DEBUG_ASSERT(dev->rbuf_needed == 0);
+static zx_status_t hid_init_reassembly_buffer(hid_device_t* dev) {
+    ZX_DEBUG_ASSERT(dev->rbuf == NULL);
+    ZX_DEBUG_ASSERT(dev->rbuf_size == 0);
+    ZX_DEBUG_ASSERT(dev->rbuf_filled == 0);
+    ZX_DEBUG_ASSERT(dev->rbuf_needed == 0);
 
     // TODO(johngro) : Take into account the underlying transport's ability to
     // deliver payloads.  For example, if this is a USB HID device operating at
@@ -652,21 +652,21 @@
     // reassembly buffer.
     input_report_size_t max_report_size = 0;
     size_t actual = 0;
-    mx_status_t res = hid_get_max_input_reportsize(dev, &max_report_size, sizeof(max_report_size),
+    zx_status_t res = hid_get_max_input_reportsize(dev, &max_report_size, sizeof(max_report_size),
                                                    &actual);
     if (res < 0) {
         return res;
     } else if (!max_report_size || actual != sizeof(max_report_size)) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     dev->rbuf = malloc(max_report_size);
     if (dev->rbuf == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     dev->rbuf_size = max_report_size;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void hid_release_device(void* ctx) {
@@ -681,26 +681,26 @@
     free(hid);
 }
 
-static mx_status_t hid_open_device(void* ctx, mx_device_t** dev_out, uint32_t flags) {
+static zx_status_t hid_open_device(void* ctx, zx_device_t** dev_out, uint32_t flags) {
     hid_device_t* hid = ctx;
 
     hid_instance_t* inst = calloc(1, sizeof(hid_instance_t));
     if (inst == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    mx_hid_fifo_init(&inst->fifo);
+    zx_hid_fifo_init(&inst->fifo);
 
     device_add_args_t args = {
         .version = DEVICE_ADD_ARGS_VERSION,
         .name = "hid",
         .ctx = inst,
         .ops = &hid_instance_proto,
-        .proto_id = MX_PROTOCOL_INPUT,
+        .proto_id = ZX_PROTOCOL_INPUT,
         .flags = DEVICE_ADD_INSTANCE,
     };
 
-    mx_status_t status = status = device_add(hid->mxdev, &args, &inst->mxdev);
-    if (status != MX_OK) {
+    zx_status_t status = status = device_add(hid->mxdev, &args, &inst->mxdev);
+    if (status != ZX_OK) {
         dprintf(ERROR, "hid: error creating instance %d\n", status);
         free(inst);
         return status;
@@ -712,7 +712,7 @@
     mtx_unlock(&hid->instance_lock);
 
     *dev_out = inst->mxdev;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void hid_unbind_device(void* ctx) {
@@ -727,7 +727,7 @@
     device_remove(hid->mxdev);
 }
 
-mx_protocol_device_t hid_device_proto = {
+zx_protocol_device_t hid_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .open = hid_open_device,
     .unbind = hid_unbind_device,
@@ -750,8 +750,8 @@
         if (hid->rbuf_needed) {
             // Reassembly is in progress, just continue the process.
             consumed = MIN(len, hid->rbuf_needed);
-            MX_DEBUG_ASSERT (hid->rbuf_size >= hid->rbuf_filled);
-            MX_DEBUG_ASSERT((hid->rbuf_size - hid->rbuf_filled) >= consumed);
+            ZX_DEBUG_ASSERT (hid->rbuf_size >= hid->rbuf_filled);
+            ZX_DEBUG_ASSERT((hid->rbuf_size - hid->rbuf_filled) >= consumed);
 
             memcpy(hid->rbuf + hid->rbuf_filled, buf, consumed);
 
@@ -791,8 +791,8 @@
             } else {
                 // Looks likes our report is fragmented over multiple buffers.
                 // Start the process of reassembly and get out.
-                MX_DEBUG_ASSERT(hid->rbuf != NULL);
-                MX_DEBUG_ASSERT(hid->rbuf_size >= rpt_sz);
+                ZX_DEBUG_ASSERT(hid->rbuf != NULL);
+                ZX_DEBUG_ASSERT(hid->rbuf_size >= rpt_sz);
                 memcpy(hid->rbuf, buf, len);
                 hid->rbuf_filled = len;
                 hid->rbuf_needed = rpt_sz - len;
@@ -800,16 +800,16 @@
             }
         }
 
-        MX_DEBUG_ASSERT(rbuf != NULL);
-        MX_DEBUG_ASSERT(consumed <= len);
+        ZX_DEBUG_ASSERT(rbuf != NULL);
+        ZX_DEBUG_ASSERT(consumed <= len);
         buf += consumed;
         len -= consumed;
 
         hid_instance_t* instance;
         foreach_instance(hid, instance) {
             mtx_lock(&instance->fifo.lock);
-            bool was_empty = mx_hid_fifo_size(&instance->fifo) == 0;
-            ssize_t wrote = mx_hid_fifo_write(&instance->fifo, rbuf, rlen);
+            bool was_empty = zx_hid_fifo_size(&instance->fifo) == 0;
+            ssize_t wrote = zx_hid_fifo_write(&instance->fifo, rbuf, rlen);
 
             if (wrote <= 0) {
                 if (!(instance->flags & HID_FLAGS_WRITE_FAILED)) {
@@ -834,16 +834,16 @@
     .io_queue = hid_io_queue,
 };
 
-static mx_status_t hid_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t hid_bind(void* ctx, zx_device_t* parent, void** cookie) {
     hid_device_t* hiddev;
     if ((hiddev = calloc(1, sizeof(hid_device_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t status;
-    if (device_get_protocol(parent, MX_PROTOCOL_HIDBUS, &hiddev->hid)) {
+    zx_status_t status;
+    if (device_get_protocol(parent, ZX_PROTOCOL_HIDBUS, &hiddev->hid)) {
         dprintf(ERROR, "hid: bind: no hidbus protocol\n");
-        status = MX_ERR_INTERNAL;
+        status = ZX_ERR_INTERNAL;
         goto fail;
     }
 
@@ -856,11 +856,11 @@
     list_initialize(&hiddev->instance_list);
 
     snprintf(hiddev->name, sizeof(hiddev->name), "hid-device-%03d", hiddev->info.dev_num);
-    hiddev->name[MX_DEVICE_NAME_MAX] = 0;
+    hiddev->name[ZX_DEVICE_NAME_MAX] = 0;
 
     if (hiddev->info.boot_device) {
         status = hid_op_set_protocol(hiddev, HID_PROTOCOL_BOOT);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             dprintf(ERROR, "hid: could not put HID device into boot protocol: %d\n", status);
             goto fail;
         }
@@ -875,20 +875,20 @@
 
     status = hid_op_get_descriptor(hiddev, HID_DESC_TYPE_REPORT,
             (void**)&hiddev->hid_report_desc, &hiddev->hid_report_desc_len);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "hid: could not retrieve HID report descriptor: %d\n", status);
         goto fail;
     }
 
     status = hid_process_hid_report_desc(hiddev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "hid: could not parse hid report descriptor: %d\n", status);
         goto fail;
     }
     hid_dump_hid_report_desc(hiddev);
 
     status = hid_init_reassembly_buffer(hiddev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "hid: failed to initialize reassembly buffer: %d\n", status);
         goto fail;
     }
@@ -898,18 +898,18 @@
         .name = hiddev->name,
         .ctx = hiddev,
         .ops = &hid_device_proto,
-        .proto_id = MX_PROTOCOL_INPUT,
+        .proto_id = ZX_PROTOCOL_INPUT,
     };
 
     status = device_add(parent, &args, &hiddev->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "hid: device_add failed for HID device: %d\n", status);
         goto fail;
     }
 
     // TODO: delay calling start until we've been opened by someone
     status = hid_op_start(hiddev, &hid_ifc, hiddev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "hid: could not start hid device: %d\n", status);
         device_remove(hiddev->mxdev);
         // Don't fail, since we've been added. Need to let devmgr clean us up.
@@ -917,11 +917,11 @@
     }
 
     status = hid_op_set_idle(hiddev, 0, 0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(TRACE, "hid: [W] set_idle failed for %s: %d\n", hiddev->name, status);
         // continue anyway
     }
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     hid_release_reassembly_buffer(hiddev);
@@ -929,11 +929,11 @@
     return status;
 }
 
-static mx_driver_ops_t hid_driver_ops = {
+static zx_driver_ops_t hid_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = hid_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(hid, hid_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_HIDBUS),
-MAGENTA_DRIVER_END(hid)
+ZIRCON_DRIVER_BEGIN(hid, hid_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_HIDBUS),
+ZIRCON_DRIVER_END(hid)
diff --git a/system/dev/input/hid/rules.mk b/system/dev/input/hid/rules.mk
index e1aaa2a..e2b190e 100644
--- a/system/dev/input/hid/rules.mk
+++ b/system/dev/input/hid/rules.mk
@@ -16,7 +16,7 @@
 
 MODULE_LIBS := \
     system/ulib/driver \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/input/hidctl/hidctl.c b/system/dev/input/hidctl/hidctl.c
index 7832af6..317a2bd 100644
--- a/system/dev/input/hidctl/hidctl.c
+++ b/system/dev/input/hidctl/hidctl.c
@@ -7,8 +7,8 @@
 #include <ddk/driver.h>
 #include <ddk/common/hid.h>
 
-#include <magenta/device/hidctl.h>
-#include <magenta/types.h>
+#include <zircon/device/hidctl.h>
+#include <zircon/types.h>
 
 #include <stdint.h>
 #include <stdio.h>
@@ -18,51 +18,51 @@
 #define from_hid_device(d) containerof(d, hidctl_instance_t, hiddev)
 
 typedef struct hidctl_instance {
-    mx_device_t* mxdev;
-    mx_device_t* parent;
-    mx_hid_device_t hiddev;
+    zx_device_t* mxdev;
+    zx_device_t* parent;
+    zx_hid_device_t hiddev;
 
     uint8_t* hid_report_desc;
     size_t hid_report_desc_len;
 } hidctl_instance_t;
 
 typedef struct hidctl_root {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 } hidctl_root_t;
 
-mx_status_t hidctl_get_descriptor(mx_hid_device_t* dev, uint8_t desc_type, void** data, size_t* len) {
+zx_status_t hidctl_get_descriptor(zx_hid_device_t* dev, uint8_t desc_type, void** data, size_t* len) {
     if (desc_type != HID_DESC_TYPE_REPORT) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     hidctl_instance_t* inst = from_hid_device(dev);
     *data = malloc(inst->hid_report_desc_len);
     memcpy(*data, inst->hid_report_desc, inst->hid_report_desc_len);
     *len = inst->hid_report_desc_len;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t hidctl_get_report(mx_hid_device_t* dev, uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t hidctl_get_report(zx_hid_device_t* dev, uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t hidctl_set_report(mx_hid_device_t* dev, uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t hidctl_set_report(zx_hid_device_t* dev, uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t hidctl_get_idle(mx_hid_device_t* dev, uint8_t rpt_id, uint8_t* duration) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t hidctl_get_idle(zx_hid_device_t* dev, uint8_t rpt_id, uint8_t* duration) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t hidctl_set_idle(mx_hid_device_t* dev, uint8_t rpt_id, uint8_t duration) {
-    return MX_OK;
+zx_status_t hidctl_set_idle(zx_hid_device_t* dev, uint8_t rpt_id, uint8_t duration) {
+    return ZX_OK;
 }
 
-mx_status_t hidctl_get_protocol(mx_hid_device_t* dev, uint8_t* protocol) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t hidctl_get_protocol(zx_hid_device_t* dev, uint8_t* protocol) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t hidctl_set_protocol(mx_hid_device_t* dev, uint8_t protocol) {
-    return MX_OK;
+zx_status_t hidctl_set_protocol(zx_hid_device_t* dev, uint8_t protocol) {
+    return ZX_OK;
 }
 
 static hid_bus_ops_t hidctl_hid_ops = {
@@ -78,11 +78,11 @@
 static ssize_t hidctl_set_config(hidctl_instance_t* dev, const void* in_buf, size_t in_len) {
     const hid_ioctl_config_t* cfg = in_buf;
     if (in_len < sizeof(hid_ioctl_config_t) || in_len != sizeof(hid_ioctl_config_t) + cfg->rpt_desc_len) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (cfg->dev_class > HID_DEV_CLASS_LAST) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     hid_init_device(&dev->hiddev, &hidctl_hid_ops, cfg->dev_num, cfg->boot_device, cfg->dev_class);
@@ -91,8 +91,8 @@
     dev->hid_report_desc = malloc(cfg->rpt_desc_len);
     memcpy(dev->hid_report_desc, cfg->rpt_desc, cfg->rpt_desc_len);
 
-    mx_status_t status = hid_add_device(&_driver_hidctl, &dev->hiddev, dev->parent);
-    if (status != MX_OK) {
+    zx_status_t status = hid_add_device(&_driver_hidctl, &dev->hiddev, dev->parent);
+    if (status != ZX_OK) {
         hid_release_device(&dev->hiddev);
         free(dev->hid_report_desc);
         dev->hid_report_desc = NULL;
@@ -102,11 +102,11 @@
     return status;
 }
 
-static ssize_t hidctl_read(void* ctx, void* buf, size_t count, mx_off_t off) {
+static ssize_t hidctl_read(void* ctx, void* buf, size_t count, zx_off_t off) {
     return 0;
 }
 
-static ssize_t hidctl_write(void* ctx, const void* buf, size_t count, mx_off_t off) {
+static ssize_t hidctl_write(void* ctx, const void* buf, size_t count, zx_off_t off) {
     hidctl_instance_t* inst = ctx;
     hid_io_queue(&inst->hiddev, buf, count);
     return count;
@@ -120,7 +120,7 @@
         return hidctl_set_config(inst, in_buf, in_len);
         break;
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static void hidctl_release(void* ctx) {
@@ -133,22 +133,22 @@
     free(inst);
 }
 
-mx_protocol_device_t hidctl_instance_proto = {
+zx_protocol_device_t hidctl_instance_proto = {
     .read = hidctl_read,
     .write = hidctl_write,
     .ioctl = hidctl_ioctl,
     .release = hidctl_release,
 };
 
-static mx_status_t hidctl_open(void* ctx, mx_device_t** dev_out, uint32_t flags) {
+static zx_status_t hidctl_open(void* ctx, zx_device_t** dev_out, uint32_t flags) {
     hidctl_root_t* root = ctx;
     hidctl_instance_t* inst = calloc(1, sizeof(hidctl_instance_t));
     if (inst == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     inst->parent = root->mxdev;
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = device_create("hidctl-inst", inst, &hidctl_instance_proto, &_driver_hidctl,
                                 &inst->mxdev)) < 0) {
         free(inst);
@@ -156,14 +156,14 @@
     }
 
     status = device_add_instance(inst->mxdev, root->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("hidctl: could not open instance: %d\n", status);
         device_destroy(inst->mxdev);
         free(inst);
         return status;
     }
     *dev_out = inst->mxdev;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void hidctl_root_release(void* ctx) {
@@ -172,18 +172,18 @@
     free(root);
 }
 
-static mx_protocol_device_t hidctl_device_proto = {
+static zx_protocol_device_t hidctl_device_proto = {
     .open = hidctl_open,
     .release = hidctl_root_release,
 };
 
-static mx_status_t hidctl_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t hidctl_bind(void* ctx, zx_device_t* parent, void** cookie) {
     hidctl_root_t* root = calloc(1, sizeof(hidctl_root_t));
     if (!root) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = device_create("hidctl", root, &hidctl_device_proto, driver, &root->mxdev)) < 0) {
         free(root);
         return status;
@@ -194,14 +194,14 @@
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t hidctl_driver_ops = {
+static zx_driver_ops_t hidctl_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = hidctl_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(hidctl, hidctl_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(hidctl)
+ZIRCON_DRIVER_BEGIN(hidctl, hidctl_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(hidctl)
diff --git a/system/dev/input/hidctl/rules.mk b/system/dev/input/hidctl/rules.mk
index c1cdec4..e8c22b4 100644
--- a/system/dev/input/hidctl/rules.mk
+++ b/system/dev/input/hidctl/rules.mk
@@ -6,7 +6,7 @@
 #
 # TODO(tkilbourn)
 # This driver is disabled until we can update it to use the new
-# MX_PROTOCOL_HIDBUS protocol, which requires rationalizing all of the device
+# ZX_PROTOCOL_HIDBUS protocol, which requires rationalizing all of the device
 # lifecycle events.
 #
 ################################################################################
@@ -21,7 +21,7 @@
 #
 #MODULE_STATIC_LIBS := system/ulib/ddk
 #
-#MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+#MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 #
 #include make/module.mk
 
diff --git a/system/dev/input/i2c-hid/i2c-hid.c b/system/dev/input/i2c-hid/i2c-hid.c
index 7c15cb8..41a6be5 100644
--- a/system/dev/input/i2c-hid/i2c-hid.c
+++ b/system/dev/input/i2c-hid/i2c-hid.c
@@ -8,9 +8,9 @@
 #include <ddk/binding.h>
 #include <ddk/protocol/hidbus.h>
 
-#include <magenta/assert.h>
-#include <magenta/types.h>
-#include <magenta/device/i2c.h>
+#include <zircon/assert.h>
+#include <zircon/types.h>
+#include <zircon/device/i2c.h>
 
 #include <endian.h>
 #include <stdbool.h>
@@ -44,7 +44,7 @@
 } __PACKED i2c_hid_desc_t;
 
 typedef struct i2c_hid_device {
-    mx_device_t* i2cdev;
+    zx_device_t* i2cdev;
 
     mtx_t lock;
     hidbus_ifc_t* ifc;
@@ -65,27 +65,27 @@
     return buf + 3 * sizeof(i2c_slave_ioctl_segment_t);
 }
 
-static mx_status_t i2c_hid_query(void* ctx, uint32_t options, hid_info_t* info) {
+static zx_status_t i2c_hid_query(void* ctx, uint32_t options, hid_info_t* info) {
     if (!info) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     info->dev_num = 0;
     info->dev_class = HID_DEV_CLASS_OTHER;
     info->boot_device = false;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t i2c_hid_start(void* ctx, hidbus_ifc_t* ifc, void* cookie) {
+static zx_status_t i2c_hid_start(void* ctx, hidbus_ifc_t* ifc, void* cookie) {
     i2c_hid_device_t* hid = ctx;
     mtx_lock(&hid->lock);
     if (hid->ifc) {
         mtx_unlock(&hid->lock);
-        return MX_ERR_ALREADY_BOUND;
+        return ZX_ERR_ALREADY_BOUND;
     }
     hid->ifc = ifc;
     hid->cookie = cookie;
     mtx_unlock(&hid->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void i2c_hid_stop(void* ctx) {
@@ -96,10 +96,10 @@
     mtx_unlock(&hid->lock);
 }
 
-static mx_status_t i2c_hid_get_descriptor(void* ctx, uint8_t desc_type,
+static zx_status_t i2c_hid_get_descriptor(void* ctx, uint8_t desc_type,
         void** data, size_t* len) {
     if (desc_type != HID_DESC_TYPE_REPORT) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     i2c_hid_device_t* hid = ctx;
@@ -113,47 +113,47 @@
 
     uint8_t* out = malloc(desc_len);
     if (out == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     size_t actual = 0;
-    mx_status_t status = device_ioctl(hid->i2cdev, IOCTL_I2C_SLAVE_TRANSFER,
+    zx_status_t status = device_ioctl(hid->i2cdev, IOCTL_I2C_SLAVE_TRANSFER,
                                       buf, sizeof(buf), out, desc_len, &actual);
     if (status < 0) {
         dprintf(ERROR, "i2c-hid: could not read HID report descriptor: %d\n", status);
         free(out);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     *data = out;
     *len = actual;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // TODO: implement the rest of the HID protocol
-static mx_status_t i2c_hid_get_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
+static zx_status_t i2c_hid_get_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
         void* data, size_t len) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t i2c_hid_set_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
+static zx_status_t i2c_hid_set_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
         void* data, size_t len) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t i2c_hid_get_idle(void* ctx, uint8_t rpt_id, uint8_t* duration) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t i2c_hid_get_idle(void* ctx, uint8_t rpt_id, uint8_t* duration) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t i2c_hid_set_idle(void* ctx, uint8_t rpt_id, uint8_t duration) {
-    return MX_OK;
+static zx_status_t i2c_hid_set_idle(void* ctx, uint8_t rpt_id, uint8_t duration) {
+    return ZX_OK;
 }
 
-static mx_status_t i2c_hid_get_protocol(void* ctx, uint8_t* protocol) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t i2c_hid_get_protocol(void* ctx, uint8_t* protocol) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t i2c_hid_set_protocol(void* ctx, uint8_t protocol) {
-    return MX_OK;
+static zx_status_t i2c_hid_set_protocol(void* ctx, uint8_t protocol) {
+    return ZX_OK;
 }
 
 
@@ -188,18 +188,18 @@
     uint16_t len = letoh16(dev->hiddesc->wMaxInputLength);
     uint8_t* buf = malloc(len);
 
-    mx_time_t last_timeout_warning = 0;
-    const mx_duration_t kMinTimeBetweenWarnings = MX_SEC(10);
+    zx_time_t last_timeout_warning = 0;
+    const zx_duration_t kMinTimeBetweenWarnings = ZX_SEC(10);
 
     // Until we have a way to map the GPIO associated with an i2c slave to an
     // IRQ, we just poll.
     while (true) {
         usleep(I2C_POLL_INTERVAL_USEC);
         size_t actual = 0;
-        mx_status_t status = device_read(dev->i2cdev, buf, len, 0, &actual);
-        if (status != MX_OK) {
-            if (status == MX_ERR_TIMED_OUT) {
-                mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+        zx_status_t status = device_read(dev->i2cdev, buf, len, 0, &actual);
+        if (status != ZX_OK) {
+            if (status == ZX_ERR_TIMED_OUT) {
+                zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
                 if (now - last_timeout_warning > kMinTimeBetweenWarnings) {
                     dprintf(TRACE, "i2c-hid: device_read timed out\n");
                     last_timeout_warning = now;
@@ -237,15 +237,15 @@
 }
 
 static void i2c_hid_release(void* ctx) {
-    MX_PANIC("cannot release an i2c hid device yet!\n");
+    ZX_PANIC("cannot release an i2c hid device yet!\n");
 }
 
-static mx_protocol_device_t i2c_hid_dev_ops = {
+static zx_protocol_device_t i2c_hid_dev_ops = {
     .version = DEVICE_OPS_VERSION,
     .release = i2c_hid_release,
 };
 
-static mx_status_t i2c_hid_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t i2c_hid_bind(void* ctx, zx_device_t* dev, void** cookie) {
     dprintf(TRACE, "i2c_hid_bind\n");
 
     // Read the i2c HID descriptor
@@ -256,17 +256,17 @@
     *data++ = 0x00;
     uint8_t out[4];
     size_t actual = 0;
-    mx_status_t ret = device_ioctl(dev, IOCTL_I2C_SLAVE_TRANSFER, buf, sizeof(buf), out, sizeof(out), &actual);
+    zx_status_t ret = device_ioctl(dev, IOCTL_I2C_SLAVE_TRANSFER, buf, sizeof(buf), out, sizeof(out), &actual);
     if (ret < 0 || actual != sizeof(out)) {
         dprintf(ERROR, "i2c-hid: could not read HID descriptor: %d\n", ret);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     i2c_hid_desc_t* i2c_hid_desc_hdr = (i2c_hid_desc_t*)out;
     uint16_t desc_len = letoh16(i2c_hid_desc_hdr->wHIDDescLength);
 
     i2c_hid_device_t* i2chid = calloc(1, sizeof(i2c_hid_device_t));
     if (i2chid == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     i2chid->i2cdev = dev;
     i2chid->hiddesc = malloc(desc_len);
@@ -278,7 +278,7 @@
         dprintf(ERROR, "i2c-hid: could not read HID descriptor: %d\n", ret);
         free(i2chid->hiddesc);
         free(i2chid);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     dprintf(TRACE, "i2c-hid: desc:\n");
@@ -299,12 +299,12 @@
         .name = "i2c-hid",
         .ctx = i2chid,
         .ops = &i2c_hid_dev_ops,
-        .proto_id = MX_PROTOCOL_HIDBUS,
+        .proto_id = ZX_PROTOCOL_HIDBUS,
         .proto_ops = &i2c_hidbus_ops,
     };
 
-    mx_status_t status = device_add(i2chid->i2cdev, &args, NULL);
-    if (status != MX_OK) {
+    zx_status_t status = device_add(i2chid->i2cdev, &args, NULL);
+    if (status != ZX_OK) {
         dprintf(ERROR, "i2c-hid: could not add device: %d\n", status);
         free(i2chid->hiddesc);
         free(i2chid);
@@ -316,19 +316,19 @@
         dprintf(ERROR, "i2c-hid: could not create irq thread: %d\n", ret);
         free(i2chid->hiddesc);
         free(i2chid);
-        // TODO: map thrd_* status codes to MX_ERR_* status codes
-        return MX_ERR_INTERNAL;
+        // TODO: map thrd_* status codes to ZX_ERR_* status codes
+        return ZX_ERR_INTERNAL;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t i2c_hid_driver_ops = {
+static zx_driver_ops_t i2c_hid_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = i2c_hid_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(i2c_hid, i2c_hid_driver_ops, "magenta", "0.1", 9)
+ZIRCON_DRIVER_BEGIN(i2c_hid, i2c_hid_driver_ops, "zircon", "0.1", 9)
     BI_ABORT_IF(NE, BIND_PCI_VID, 0x8086),
 
     // Acer12
@@ -343,4 +343,4 @@
     BI_ABORT_IF(NE, BIND_PCI_DID, 0x9d62),
     BI_MATCH_IF(EQ, BIND_I2C_ADDR, 0x0049),
 
-MAGENTA_DRIVER_END(i2c_hid)
+ZIRCON_DRIVER_END(i2c_hid)
diff --git a/system/dev/input/i2c-hid/rules.mk b/system/dev/input/i2c-hid/rules.mk
index 721c8e2..99aab1f 100644
--- a/system/dev/input/i2c-hid/rules.mk
+++ b/system/dev/input/i2c-hid/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/hid
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/input/pc-ps2/i8042.c b/system/dev/input/pc-ps2/i8042.c
index 1ced8ac..6d52724 100644
--- a/system/dev/input/pc-ps2/i8042.c
+++ b/system/dev/input/pc-ps2/i8042.c
@@ -6,11 +6,11 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 #include <ddk/protocol/hidbus.h>
-#include <magenta/device/input.h>
+#include <zircon/device/input.h>
 #include <hw/inout.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #include <hid/usages.h>
 
@@ -27,7 +27,7 @@
     hidbus_ifc_t* ifc;
     void* cookie;
 
-    mx_handle_t irq;
+    zx_handle_t irq;
     thrd_t irq_thread;
 
     int last_code;
@@ -498,20 +498,20 @@
 
     // enable I/O port access
     // TODO
-    mx_status_t status;
-    status = mx_mmap_device_io(get_root_resource(), I8042_COMMAND_REG, 1);
+    zx_status_t status;
+    status = zx_mmap_device_io(get_root_resource(), I8042_COMMAND_REG, 1);
     if (status)
         return 0;
-    status = mx_mmap_device_io(get_root_resource(), I8042_DATA_REG, 1);
+    status = zx_mmap_device_io(get_root_resource(), I8042_DATA_REG, 1);
     if (status)
         return 0;
 
     for (;;) {
-        status = mx_interrupt_wait(device->irq);
-        if (status == MX_OK) {
+        status = zx_interrupt_wait(device->irq);
+        if (status == ZX_OK) {
             // ack IRQ so we don't lose any IRQs that arrive while processing
             // (as this is an edge-triggered IRQ)
-            mx_interrupt_complete(device->irq);
+            zx_interrupt_complete(device->irq);
 
             // keep handling status on the controller until no bits are set we care about
             bool retry;
@@ -542,12 +542,12 @@
     return 0;
 }
 
-static mx_status_t i8042_setup(uint8_t* ctr) {
+static zx_status_t i8042_setup(uint8_t* ctr) {
     // enable I/O port access
-    mx_status_t status = mx_mmap_device_io(get_root_resource(), I8042_COMMAND_REG, 1);
+    zx_status_t status = zx_mmap_device_io(get_root_resource(), I8042_COMMAND_REG, 1);
     if (status)
         return status;
-    status = mx_mmap_device_io(get_root_resource(), I8042_DATA_REG, 1);
+    status = zx_mmap_device_io(get_root_resource(), I8042_DATA_REG, 1);
     if (status)
         return status;
 
@@ -587,7 +587,7 @@
             return -1;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void i8042_identify(int (*cmd)(uint8_t* param, int command)) {
@@ -614,25 +614,25 @@
     cmd(resp, I8042_CMD_SCAN_EN);
 }
 
-static mx_status_t i8042_query(void* ctx, uint32_t options, hid_info_t* info) {
+static zx_status_t i8042_query(void* ctx, uint32_t options, hid_info_t* info) {
     i8042_device_t* i8042 = ctx;
     info->dev_num = i8042->type;  // use the type for the device number for now
     info->dev_class = i8042->type;
     info->boot_device = true;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t i8042_start(void* ctx, hidbus_ifc_t* ifc, void* cookie) {
+static zx_status_t i8042_start(void* ctx, hidbus_ifc_t* ifc, void* cookie) {
     i8042_device_t* i8042 = ctx;
     mtx_lock(&i8042->lock);
     if (i8042->ifc != NULL) {
         mtx_unlock(&i8042->lock);
-        return MX_ERR_ALREADY_BOUND;
+        return ZX_ERR_ALREADY_BOUND;
     }
     i8042->ifc = ifc;
     i8042->cookie = cookie;
     mtx_unlock(&i8042->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void i8042_stop(void* ctx) {
@@ -643,14 +643,14 @@
     mtx_unlock(&i8042->lock);
 }
 
-static mx_status_t i8042_get_descriptor(void* ctx, uint8_t desc_type,
+static zx_status_t i8042_get_descriptor(void* ctx, uint8_t desc_type,
         void** data, size_t* len) {
     if (data == NULL || len == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (desc_type != HID_DESC_TYPE_REPORT) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     i8042_device_t* device = ctx;
@@ -663,39 +663,39 @@
         buf = (void*)&mouse_hid_report_desc;
         buflen = sizeof(mouse_hid_report_desc);
     } else {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     *data = malloc(buflen);
     *len = buflen;
     memcpy(*data, buf, buflen);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t i8042_get_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
+static zx_status_t i8042_get_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
         void* data, size_t len) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t i8042_set_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
+static zx_status_t i8042_set_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
         void* data, size_t len) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t i8042_get_idle(void* ctx, uint8_t rpt_type, uint8_t* duration) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t i8042_get_idle(void* ctx, uint8_t rpt_type, uint8_t* duration) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t i8042_set_idle(void* ctx, uint8_t rpt_type, uint8_t duration) {
-    return MX_OK;
+static zx_status_t i8042_set_idle(void* ctx, uint8_t rpt_type, uint8_t duration) {
+    return ZX_OK;
 }
 
-static mx_status_t i8042_get_protocol(void* ctx, uint8_t* protocol) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t i8042_get_protocol(void* ctx, uint8_t* protocol) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t i8042_set_protocol(void* ctx, uint8_t protocol) {
-    return MX_OK;
+static zx_status_t i8042_set_protocol(void* ctx, uint8_t protocol) {
+    return ZX_OK;
 }
 
 static hidbus_protocol_ops_t hidbus_ops = {
@@ -716,12 +716,12 @@
     free(i8042);
 }
 
-static mx_protocol_device_t i8042_dev_proto = {
+static zx_protocol_device_t i8042_dev_proto = {
      .version = DEVICE_OPS_VERSION,
    .release = i8042_release,
 };
 
-static mx_status_t i8042_dev_init(i8042_device_t* dev, const char* name, mx_device_t* parent) {
+static zx_status_t i8042_dev_init(i8042_device_t* dev, const char* name, zx_device_t* parent) {
     // enable device port
     int cmd = dev->type == INPUT_PROTO_KBD ?
         I8042_CMD_CTL_KBD_DIS : I8042_CMD_CTL_MOUSE_DIS;
@@ -738,9 +738,9 @@
 
     uint32_t interrupt = dev->type == INPUT_PROTO_KBD ?
         ISA_IRQ_KEYBOARD : ISA_IRQ_MOUSE;
-    mx_status_t status = mx_interrupt_create(get_root_resource(), interrupt, MX_FLAG_REMAP_IRQ,
+    zx_status_t status = zx_interrupt_create(get_root_resource(), interrupt, ZX_FLAG_REMAP_IRQ,
                                              &(dev->irq));
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -749,7 +749,7 @@
         "i8042-kbd-irq" : "i8042-mouse-irq";
     int ret = thrd_create_with_name(&dev->irq_thread, i8042_irq_thread, dev, tname);
     if (ret != thrd_success) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     device_add_args_t args = {
@@ -757,7 +757,7 @@
         .name = name,
         .ctx = dev,
         .ops = &i8042_dev_proto,
-        .proto_id = MX_PROTOCOL_HIDBUS,
+        .proto_id = ZX_PROTOCOL_HIDBUS,
         .proto_ops = &hidbus_ops,
     };
 
@@ -765,10 +765,10 @@
 }
 
 static int i8042_init_thread(void* arg) {
-    mx_device_t* parent = arg;
+    zx_device_t* parent = arg;
     uint8_t ctr = 0;
-    mx_status_t status = i8042_setup(&ctr);
-    if (status != MX_OK) {
+    zx_status_t status = i8042_setup(&ctr);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -791,12 +791,12 @@
     // create keyboard device
     i8042_device_t* kbd_device = calloc(1, sizeof(i8042_device_t));
     if (!kbd_device)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     mtx_init(&kbd_device->lock, mtx_plain);
     kbd_device->type = INPUT_PROTO_KBD;
     status = i8042_dev_init(kbd_device, "i8042-keyboard", parent);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         free(kbd_device);
     }
 
@@ -808,7 +808,7 @@
             mtx_init(&mouse_device->lock, mtx_plain);
             mouse_device->type = INPUT_PROTO_MOUSE;
             status = i8042_dev_init(mouse_device, "i8042-mouse", parent);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 free(mouse_device);
             }
         }
@@ -816,21 +816,21 @@
 
     xprintf("initialized i8042 driver\n");
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t i8042_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t i8042_bind(void* ctx, zx_device_t* parent, void** cookie) {
     thrd_t t;
     int rc = thrd_create_with_name(&t, i8042_init_thread, parent, "i8042-init");
     return rc;
 }
 
-static mx_driver_ops_t i8042_driver_ops = {
+static zx_driver_ops_t i8042_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = i8042_bind,
 };
 
 //TODO: should bind against PC/ACPI instead of misc
-MAGENTA_DRIVER_BEGIN(i8042, i8042_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(i8042)
+ZIRCON_DRIVER_BEGIN(i8042, i8042_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(i8042)
diff --git a/system/dev/input/pc-ps2/rules.mk b/system/dev/input/pc-ps2/rules.mk
index ff9db10..185bf2b 100644
--- a/system/dev/input/pc-ps2/rules.mk
+++ b/system/dev/input/pc-ps2/rules.mk
@@ -14,7 +14,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/hid
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/input/usb-hid/rules.mk b/system/dev/input/usb-hid/rules.mk
index 0da2b7e..befdb9d 100644
--- a/system/dev/input/usb-hid/rules.mk
+++ b/system/dev/input/usb-hid/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/pretty system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/input/usb-hid/usb-hid.c b/system/dev/input/usb-hid/usb-hid.c
index a824710..fc46fb5 100644
--- a/system/dev/input/usb-hid/usb-hid.c
+++ b/system/dev/input/usb-hid/usb-hid.c
@@ -8,9 +8,9 @@
 #include <ddk/iotxn.h>
 #include <ddk/protocol/hidbus.h>
 #include <driver/usb.h>
-#include <magenta/hw/usb-hid.h>
+#include <zircon/hw/usb-hid.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <pretty/hexdump.h>
 
 #include <stdio.h>
@@ -26,8 +26,8 @@
 #define to_usb_hid(d) containerof(d, usb_hid_device_t, hiddev)
 
 typedef struct usb_hid_device {
-    mx_device_t* mxdev;
-    mx_device_t* usbdev;
+    zx_device_t* mxdev;
+    zx_device_t* usbdev;
     usb_protocol_t usb;
 
     hid_info_t info;
@@ -54,10 +54,10 @@
 
     bool requeue = true;
     switch (txn->status) {
-    case MX_ERR_IO_NOT_PRESENT:
+    case ZX_ERR_IO_NOT_PRESENT:
         requeue = false;
         break;
-    case MX_OK:
+    case ZX_OK:
         mtx_lock(&hid->lock);
         if (hid->ifc) {
             hid->ifc->io_queue(hid->cookie, buffer, txn->actual);
@@ -77,23 +77,23 @@
     }
 }
 
-static mx_status_t usb_hid_query(void* ctx, uint32_t options, hid_info_t* info) {
+static zx_status_t usb_hid_query(void* ctx, uint32_t options, hid_info_t* info) {
     if (!info) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     usb_hid_device_t* hid = ctx;
     info->dev_num = hid->info.dev_num;
     info->dev_class = hid->info.dev_class;
     info->boot_device = hid->info.boot_device;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_hid_start(void* ctx, hidbus_ifc_t* ifc, void* cookie) {
+static zx_status_t usb_hid_start(void* ctx, hidbus_ifc_t* ifc, void* cookie) {
     usb_hid_device_t* hid = ctx;
     mtx_lock(&hid->lock);
     if (hid->ifc) {
         mtx_unlock(&hid->lock);
-        return MX_ERR_ALREADY_BOUND;
+        return ZX_ERR_ALREADY_BOUND;
     }
     hid->ifc = ifc;
     hid->cookie = cookie;
@@ -102,7 +102,7 @@
         iotxn_queue(hid->usbdev, hid->txn);
     }
     mtx_unlock(&hid->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void usb_hid_stop(void* ctx) {
@@ -115,7 +115,7 @@
     mtx_unlock(&hid->lock);
 }
 
-static mx_status_t usb_hid_get_descriptor(void* ctx, uint8_t desc_type,
+static zx_status_t usb_hid_get_descriptor(void* ctx, uint8_t desc_type,
                                           void** data, size_t* len) {
     usb_hid_device_t* hid = ctx;
     int desc_idx = -1;
@@ -126,15 +126,15 @@
         }
     }
     if (desc_idx < 0) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     size_t desc_len = hid->hid_desc->descriptors[desc_idx].wDescriptorLength;
     uint8_t* desc_buf = malloc(desc_len);
-    mx_status_t status = usb_control(&hid->usb,
+    zx_status_t status = usb_control(&hid->usb,
                                      (USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE),
                                      USB_REQ_GET_DESCRIPTOR, desc_type << 8, hid->interface,
-                                     desc_buf, desc_len, MX_TIME_INFINITE);
+                                     desc_buf, desc_len, ZX_TIME_INFINITE);
     if (status < 0) {
         printf("usb-hid: error reading report descriptor 0x%02x: %d\n", desc_type, status);
         free(desc_buf);
@@ -143,39 +143,39 @@
         *data = desc_buf;
         *len = desc_len;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_hid_get_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
+static zx_status_t usb_hid_get_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
                                       void* data, size_t len) {
     usb_hid_device_t* hid = ctx;
     return usb_control(&hid->usb, (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE),
             USB_HID_GET_REPORT, (rpt_type << 8 | rpt_id), hid->interface, data, len,
-            MX_TIME_INFINITE);
+            ZX_TIME_INFINITE);
 }
 
-static mx_status_t usb_hid_set_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
+static zx_status_t usb_hid_set_report(void* ctx, uint8_t rpt_type, uint8_t rpt_id,
                                       void* data, size_t len) {
     usb_hid_device_t* hid = ctx;
     return usb_control(&hid->usb, (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE),
             USB_HID_SET_REPORT, (rpt_type << 8 | rpt_id), hid->interface, data, len,
-            MX_TIME_INFINITE);
+            ZX_TIME_INFINITE);
 }
 
-static mx_status_t usb_hid_get_idle(void* ctx, uint8_t rpt_id, uint8_t* duration) {
+static zx_status_t usb_hid_get_idle(void* ctx, uint8_t rpt_id, uint8_t* duration) {
     usb_hid_device_t* hid = ctx;
     return usb_control(&hid->usb, (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE),
             USB_HID_GET_IDLE, rpt_id, hid->interface, duration, sizeof(*duration),
-            MX_TIME_INFINITE);
+            ZX_TIME_INFINITE);
 }
 
-static mx_status_t usb_hid_set_idle(void* ctx, uint8_t rpt_id, uint8_t duration) {
-    mx_status_t status;
+static zx_status_t usb_hid_set_idle(void* ctx, uint8_t rpt_id, uint8_t duration) {
+    zx_status_t status;
     usb_hid_device_t* hid = ctx;
     status = usb_control(&hid->usb, (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE),
             USB_HID_SET_IDLE, (duration << 8) | rpt_id, hid->interface, NULL, 0,
-            MX_TIME_INFINITE);
-    if (status == MX_ERR_IO_REFUSED) {
+            ZX_TIME_INFINITE);
+    if (status == ZX_ERR_IO_REFUSED) {
         // The SET_IDLE command is optional, so this may stall.
         // If that occurs, reset the endpoint and ignore the error
         status = usb_reset_endpoint(&hid->usb, 0);
@@ -183,17 +183,17 @@
     return status;
 }
 
-static mx_status_t usb_hid_get_protocol(void* ctx, uint8_t* protocol) {
+static zx_status_t usb_hid_get_protocol(void* ctx, uint8_t* protocol) {
     usb_hid_device_t* hid = ctx;
     return usb_control(&hid->usb, (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE),
             USB_HID_GET_PROTOCOL, 0, hid->interface, protocol, sizeof(*protocol),
-            MX_TIME_INFINITE);
+            ZX_TIME_INFINITE);
 }
 
-static mx_status_t usb_hid_set_protocol(void* ctx, uint8_t protocol) {
+static zx_status_t usb_hid_set_protocol(void* ctx, uint8_t protocol) {
     usb_hid_device_t* hid = ctx;
     return usb_control(&hid->usb, (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE),
-            USB_HID_SET_PROTOCOL, protocol, hid->interface, NULL, 0,MX_TIME_INFINITE);
+            USB_HID_SET_PROTOCOL, protocol, hid->interface, NULL, 0,ZX_TIME_INFINITE);
 }
 
 static hidbus_protocol_ops_t usb_hid_bus_ops = {
@@ -220,28 +220,28 @@
     free(hid);
 }
 
-static mx_protocol_device_t usb_hid_dev_ops = {
+static zx_protocol_device_t usb_hid_dev_ops = {
     .version = DEVICE_OPS_VERSION,
     .unbind = usb_hid_unbind,
     .release = usb_hid_release,
 };
 
-static mx_status_t usb_hid_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t usb_hid_bind(void* ctx, zx_device_t* dev, void** cookie) {
     usb_protocol_t usb;
 
-    mx_status_t status = device_get_protocol(dev, MX_PROTOCOL_USB, &usb);
-    if (status != MX_OK) {
+    zx_status_t status = device_get_protocol(dev, ZX_PROTOCOL_USB, &usb);
+    if (status != ZX_OK) {
         return status;
     }
 
     usb_desc_iter_t iter;
-    mx_status_t result = usb_desc_iter_init(&usb, &iter);
+    zx_status_t result = usb_desc_iter_init(&usb, &iter);
     if (result < 0) return result;
 
     usb_interface_descriptor_t* intf = usb_desc_iter_next_interface(&iter, true);
      if (!intf) {
         usb_desc_iter_release(&iter);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // One usb-hid device per HID interface
@@ -278,7 +278,7 @@
         usb_hid_device_t* usbhid = calloc(1, sizeof(usb_hid_device_t));
         if (usbhid == NULL) {
             usb_desc_iter_release(&iter);
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
 
         usbhid->usbdev = dev;
@@ -298,7 +298,7 @@
         if (usbhid->txn == NULL) {
             usb_desc_iter_release(&iter);
             free(usbhid);
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         usbhid->txn->length = usb_ep_max_packet(endpt);
         usbhid->txn->complete_cb = usb_interrupt_callback;
@@ -309,12 +309,12 @@
             .name = "usb-hid",
             .ctx = usbhid,
             .ops = &usb_hid_dev_ops,
-            .proto_id = MX_PROTOCOL_HIDBUS,
+            .proto_id = ZX_PROTOCOL_HIDBUS,
             .proto_ops = &usb_hid_bus_ops,
         };
 
         status = device_add(dev, &args, &usbhid->mxdev);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             usb_desc_iter_release(&iter);
             iotxn_release(usbhid->txn);
             free(usbhid);
@@ -331,15 +331,15 @@
     }
     usb_desc_iter_release(&iter);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t usb_hid_driver_ops = {
+static zx_driver_ops_t usb_hid_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = usb_hid_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(usb_hid, usb_hid_driver_ops, "magenta", "0.1", 2)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB),
+ZIRCON_DRIVER_BEGIN(usb_hid, usb_hid_driver_ops, "zircon", "0.1", 2)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB),
     BI_MATCH_IF(EQ, BIND_USB_CLASS, USB_CLASS_HID),
-MAGENTA_DRIVER_END(usb_hid)
+ZIRCON_DRIVER_END(usb_hid)
diff --git a/system/dev/misc/builtin/null.c b/system/dev/misc/builtin/null.c
index 5475f4b..394f898 100644
--- a/system/dev/misc/builtin/null.c
+++ b/system/dev/misc/builtin/null.c
@@ -6,36 +6,36 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 // null is the /dev/null device.
 
-static mx_status_t null_read(void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t null_read(void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
     *actual = 0;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t null_write(void* ctx, const void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t null_write(void* ctx, const void* buf, size_t count, zx_off_t off, size_t* actual) {
     *actual = count;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_protocol_device_t null_device_proto = {
+static zx_protocol_device_t null_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .read = null_read,
     .write = null_write,
 };
 
-mx_status_t null_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t null_bind(void* ctx, zx_device_t* parent, void** cookie) {
     device_add_args_t args = {
         .version = DEVICE_ADD_ARGS_VERSION,
         .name = "null",
         .ops = &null_device_proto,
     };
 
-    mx_device_t* dev;
+    zx_device_t* dev;
     return device_add(parent, &args, &dev);
 }
diff --git a/system/dev/misc/builtin/root.c b/system/dev/misc/builtin/root.c
index 40f9cd8..9d58614 100644
--- a/system/dev/misc/builtin/root.c
+++ b/system/dev/misc/builtin/root.c
@@ -6,20 +6,20 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-mx_status_t null_bind(void* ctx, mx_device_t* parent, void** cookie);
-mx_status_t zero_bind(void* ctx, mx_device_t* parent, void** cookie);
+zx_status_t null_bind(void* ctx, zx_device_t* parent, void** cookie);
+zx_status_t zero_bind(void* ctx, zx_device_t* parent, void** cookie);
 
-mx_status_t root_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t root_bind(void* ctx, zx_device_t* parent, void** cookie) {
     null_bind(ctx, parent, cookie);
     zero_bind(ctx, parent, cookie);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t root_driver_ops = {
+static zx_driver_ops_t root_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = root_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(root_drivers, root_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_ROOT),
-MAGENTA_DRIVER_END(root_drivers)
+ZIRCON_DRIVER_BEGIN(root_drivers, root_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_ROOT),
+ZIRCON_DRIVER_END(root_drivers)
diff --git a/system/dev/misc/builtin/rules.mk b/system/dev/misc/builtin/rules.mk
index 6133f81..15a007d 100644
--- a/system/dev/misc/builtin/rules.mk
+++ b/system/dev/misc/builtin/rules.mk
@@ -15,6 +15,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/misc/builtin/zero.c b/system/dev/misc/builtin/zero.c
index 3c676ec..ca655d7 100644
--- a/system/dev/misc/builtin/zero.c
+++ b/system/dev/misc/builtin/zero.c
@@ -6,35 +6,35 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-static mx_status_t zero_read(void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t zero_read(void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
     memset(buf, 0, count);
     *actual = count;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t zero_write(void* ctx, const void* buf, size_t count, mx_off_t off,
+static zx_status_t zero_write(void* ctx, const void* buf, size_t count, zx_off_t off,
                               size_t* actual) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_protocol_device_t zero_device_proto = {
+static zx_protocol_device_t zero_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .read = zero_read,
     .write = zero_write,
 };
 
-mx_status_t zero_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t zero_bind(void* ctx, zx_device_t* parent, void** cookie) {
     device_add_args_t args = {
         .version = DEVICE_ADD_ARGS_VERSION,
         .name = "zero",
         .ops = &zero_device_proto,
     };
 
-    mx_device_t* dev;
+    zx_device_t* dev;
     return device_add(parent, &args, &dev);
 }
diff --git a/system/dev/misc/console/console.c b/system/dev/misc/console/console.c
index f6fbe3f..e4636ef 100644
--- a/system/dev/misc/console/console.c
+++ b/system/dev/misc/console/console.c
@@ -6,8 +6,8 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -18,7 +18,7 @@
 #define FIFOMASK (FIFOSIZE - 1)
 
 typedef struct console_ctx {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 } console_device_t;
 
 static struct {
@@ -30,13 +30,13 @@
     .lock = MTX_INIT,
 };
 
-static mx_status_t fifo_read(uint8_t* out) {
+static zx_status_t fifo_read(uint8_t* out) {
     if (fifo.head == fifo.tail) {
         return -1;
     }
     *out = fifo.data[fifo.tail];
     fifo.tail = (fifo.tail + 1) & FIFOMASK;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void fifo_write(uint8_t x) {
@@ -48,10 +48,10 @@
 }
 
 static int debug_reader(void* arg) {
-    mx_device_t* dev = arg;
+    zx_device_t* dev = arg;
     uint8_t ch;
     for (;;) {
-        if (mx_debug_read(get_root_resource(), (void*)&ch, 1) == 1) {
+        if (zx_debug_read(get_root_resource(), (void*)&ch, 1) == 1) {
             mtx_lock(&fifo.lock);
             if (fifo.head == fifo.tail) {
                 device_state_set(dev, DEV_STATE_READABLE);
@@ -63,7 +63,7 @@
     return 0;
 }
 
-static mx_status_t console_read(void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t console_read(void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
     console_device_t* console = ctx;
 
     uint8_t* data = buf;
@@ -79,21 +79,21 @@
     mtx_unlock(&fifo.lock);
     ssize_t length = data - (uint8_t*)buf;
     if (length == 0) {
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
     }
     *actual = length;
-    return MX_OK;
+    return ZX_OK;
 }
 
 #define MAX_WRITE_SIZE 256
 
-static mx_status_t console_write(void* ctx, const void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t console_write(void* ctx, const void* buf, size_t count, zx_off_t off, size_t* actual) {
     const void* ptr = buf;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     size_t total = 0;
     while (count > 0) {
         size_t xfer = (count > MAX_WRITE_SIZE) ? MAX_WRITE_SIZE : count;
-        if ((status = mx_debug_write(ptr, xfer)) < 0) {
+        if ((status = zx_debug_write(ptr, xfer)) < 0) {
             break;
         }
         ptr += xfer;
@@ -102,7 +102,7 @@
     }
     if (total > 0) {
         *actual = total;
-        status = MX_OK;
+        status = ZX_OK;
      }
      return status;
 }
@@ -112,17 +112,17 @@
     free(console);
 }
 
-static mx_protocol_device_t console_device_proto = {
+static zx_protocol_device_t console_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .read = console_read,
     .write = console_write,
     .release = console_release,
 };
 
-static mx_status_t console_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t console_bind(void* ctx, zx_device_t* parent, void** cookie) {
     console_device_t* console = calloc(1, sizeof(console_device_t));
     if (!console) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     device_add_args_t args = {
         .version = DEVICE_ADD_ARGS_VERSION,
@@ -131,8 +131,8 @@
         .ops = &console_device_proto,
     };
 
-    mx_status_t status = device_add(parent, &args, &console->mxdev);
-    if (status != MX_OK) {
+    zx_status_t status = device_add(parent, &args, &console->mxdev);
+    if (status != ZX_OK) {
         printf("console: device_add() failed\n");
         free(console);
         return status;
@@ -141,14 +141,14 @@
     thrd_t t;
     thrd_create_with_name(&t, debug_reader, console->mxdev, "debug-reader");
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t console_driver_ops = {
+static zx_driver_ops_t console_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = console_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(console, console_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(console)
+ZIRCON_DRIVER_BEGIN(console, console_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(console)
diff --git a/system/dev/misc/console/rules.mk b/system/dev/misc/console/rules.mk
index bd04736..5a04419 100644
--- a/system/dev/misc/console/rules.mk
+++ b/system/dev/misc/console/rules.mk
@@ -12,7 +12,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/misc/intel-pt/README.md b/system/dev/misc/intel-pt/README.md
index 41a9a4d..311d591 100644
--- a/system/dev/misc/intel-pt/README.md
+++ b/system/dev/misc/intel-pt/README.md
@@ -86,7 +86,7 @@
 ```
 ssize_t ioctl_ipt_get_buffer_handle(int fd,
                                     const ioctl_ipt_buffer_handle_req_t* req,
-                                    mx_handle_t* out_handle);
+                                    zx_handle_t* out_handle);
 ```
 
 Return the handle of the requested VMO with buffer data.
diff --git a/system/dev/misc/intel-pt/intel-pt.c b/system/dev/misc/intel-pt/intel-pt.c
index d021dc4..b449395 100644
--- a/system/dev/misc/intel-pt/intel-pt.c
+++ b/system/dev/misc/intel-pt/intel-pt.c
@@ -9,11 +9,11 @@
 #include <ddk/driver.h>
 #include <ddk/io-buffer.h>
 
-#include <magenta/device/intel-pt.h>
-#include <magenta/mtrace.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/resource.h>
-#include <magenta/types.h>
+#include <zircon/device/intel-pt.h>
+#include <zircon/mtrace.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/resource.h>
+#include <zircon/types.h>
 
 #include <assert.h>
 #include <cpuid.h>
@@ -46,7 +46,7 @@
     // Which value to use is determined by the trace mode.
     union {
         uint32_t cpuno;
-        mx_handle_t thread;
+        zx_handle_t thread;
     } owner;
 
     // number of buffers, each 2^|buffer_order| pages in size
@@ -145,7 +145,7 @@
 
 #define BIT(x, b) ((x) & (1u << (b)))
 
-static mx_status_t x86_pt_free(ipt_device_t* ipt_dev);
+static zx_status_t x86_pt_free(ipt_device_t* ipt_dev);
 
 
 // The userspace side of the driver
@@ -219,24 +219,24 @@
 
 // Set the tracing mode to one of cpus or threads.
 // |mode| is one of IPT_MODE_{CPUS,THREADS}.
-static mx_status_t x86_pt_set_mode(ipt_device_t* ipt_dev, uint32_t mode) {
+static zx_status_t x86_pt_set_mode(ipt_device_t* ipt_dev, uint32_t mode) {
     // TODO(dje): Only change the mode when tracing is fully off in all
     // threads?
     if (ipt_dev->active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     switch (mode) {
     case IPT_MODE_CPUS:
     case IPT_MODE_THREADS:
         break;
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_handle_t resource = get_root_resource();
-    mx_status_t status =
-        mx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_SET_MODE, 0, &mode, sizeof(mode));
-    if (status != MX_OK)
+    zx_handle_t resource = get_root_resource();
+    zx_status_t status =
+        zx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_SET_MODE, 0, &mode, sizeof(mode));
+    if (status != ZX_OK)
         return status;
 
     switch (mode) {
@@ -250,7 +250,7 @@
         assert(false);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Create the ToPA for the configured number of pages for |cpu|.
@@ -272,7 +272,7 @@
     for (uint32_t i = 0; i < per_trace->num_buffers; ++i) {
         io_buffer_t* buffer = &per_trace->buffers[i];
         io_buffer_t* topa = &per_trace->topas[curr_table];
-        mx_paddr_t pa = io_buffer_phys(buffer);
+        zx_paddr_t pa = io_buffer_phys(buffer);
 
         uint64_t val = IPT_TOPA_ENTRY_PHYS_ADDR(pa) |
             IPT_TOPA_ENTRY_SIZE(run_len_log2 + PAGE_SIZE_SHIFT);
@@ -305,7 +305,7 @@
             next_table = &per_trace->topas[i + 1];
         }
 
-        mx_paddr_t next_table_pa = io_buffer_phys(next_table);
+        zx_paddr_t next_table_pa = io_buffer_phys(next_table);
         uint64_t val = IPT_TOPA_ENTRY_PHYS_ADDR(next_table_pa) | IPT_TOPA_ENTRY_END;
         uint64_t* table = io_buffer_virt(this_table);
         table[IPT_TOPA_MAX_TABLE_ENTRIES - 1] = val;
@@ -315,7 +315,7 @@
     if (curr_table < per_trace->num_tables) {
         io_buffer_t* this_table = &per_trace->topas[curr_table];
         io_buffer_t* first_table = &per_trace->topas[0];
-        mx_paddr_t first_table_pa = io_buffer_phys(first_table);
+        zx_paddr_t first_table_pa = io_buffer_phys(first_table);
         uint64_t val = IPT_TOPA_ENTRY_PHYS_ADDR(first_table_pa) | IPT_TOPA_ENTRY_END;
         uint64_t* table = io_buffer_virt(this_table);
         table[curr_idx] = val;
@@ -358,7 +358,7 @@
     for (uint32_t table = 0; table < per_trace->num_tables; ++table) {
         // Get the physical address so that we can compare it with the value
         // in output_base.
-        mx_paddr_t table_paddr = io_buffer_phys(&per_trace->topas[table]);
+        zx_paddr_t table_paddr = io_buffer_phys(&per_trace->topas[table]);
 
         for (uint32_t entry = 0; entry < IPT_TOPA_MAX_TABLE_ENTRIES - 1; ++entry) {
             if (table_paddr == curr_table_paddr && entry >= curr_table_entry_idx) {
@@ -377,22 +377,22 @@
     return 0;
 }
 
-static mx_status_t x86_pt_alloc_buffer1(ipt_device_t* ipt_dev, ipt_per_trace_state_t* per_trace,
+static zx_status_t x86_pt_alloc_buffer1(ipt_device_t* ipt_dev, ipt_per_trace_state_t* per_trace,
                                         uint32_t num, uint32_t order, bool is_circular) {
-    mx_status_t status;
+    zx_status_t status;
     size_t buffer_pages = 1 << order;
 
     memset(per_trace, 0, sizeof(*per_trace));
 
     per_trace->buffers = calloc(num, sizeof(io_buffer_t));
     if (per_trace->buffers == NULL)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     for (uint32_t i = 0; i < num; ++i) {
         // ToPA entries of size N must be aligned to N, too.
         uint32_t alignment_log2 = PAGE_SIZE_SHIFT + order;
         status = io_buffer_init_aligned(&per_trace->buffers[i], buffer_pages * PAGE_SIZE, alignment_log2, IO_BUFFER_RW);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         // Keep track of allocated buffers as we go in case we later fail:
         // we want to be able to free those that got allocated.
@@ -410,24 +410,24 @@
 
     if (entry_count < 2) {
         xprintf("IPT: INVALID ENTRY COUNT: %u\n", entry_count);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Some early Processor Trace implementations only supported having a
     // table with a single real entry and an END.
     if (!ipt_config_output_topa_multi && entry_count > 2)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // Allocate Table(s) of Physical Addresses (ToPA) for each cpu.
 
     per_trace->topas = calloc(table_count, sizeof(io_buffer_t));
     if (per_trace->topas == NULL)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     for (uint32_t i = 0; i < table_count; ++i) {
         status = io_buffer_init(&per_trace->topas[i], sizeof(uint64_t) * IPT_TOPA_MAX_TABLE_ENTRIES, IO_BUFFER_RW);
-        if (status != MX_OK)
-            return MX_ERR_NO_MEMORY;
+        if (status != ZX_OK)
+            return ZX_ERR_NO_MEMORY;
         // Keep track of allocated tables as we go in case we later fail:
         // we want to be able to free those that got allocated.
         ++per_trace->num_tables;
@@ -436,7 +436,7 @@
 
     make_topa(ipt_dev, per_trace);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void x86_pt_free_buffer1(ipt_device_t* ipt_dev, ipt_per_trace_state_t* per_trace) {
@@ -455,18 +455,18 @@
     per_trace->allocated = false;
 }
 
-static mx_status_t x86_pt_alloc_buffer(ipt_device_t* ipt_dev,
+static zx_status_t x86_pt_alloc_buffer(ipt_device_t* ipt_dev,
                                        const ioctl_ipt_buffer_config_t* config,
                                        uint32_t* out_index) {
     if (config->num_buffers == 0 || config->num_buffers > MAX_NUM_BUFFERS)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (config->buffer_order > MAX_BUFFER_ORDER)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     size_t buffer_pages = 1 << config->buffer_order;
     size_t nr_pages = config->num_buffers * buffer_pages;
     size_t total_per_trace = nr_pages * PAGE_SIZE;
     if (total_per_trace > MAX_PER_TRACE_SPACE)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     uint64_t settable_ctl_mask = (
         IPT_CTL_OS_ALLOWED_MASK |
@@ -500,26 +500,26 @@
     if ((config->ctl & ~settable_ctl_mask) != 0) {
         xprintf("bad ctl, requested 0x%" PRIx64 ", valid 0x%" PRIx64 "\n",
                 config->ctl, settable_ctl_mask);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uint32_t mtc_freq = (uint32_t) ((config->ctl & IPT_CTL_MTC_FREQ_MASK) >> IPT_CTL_MTC_FREQ_SHIFT);
     if (mtc_freq != 0 && ((1 << mtc_freq) & ipt_config_mtc_freq_mask) == 0) {
         xprintf("bad mtc_freq value, requested 0x%x, valid mask 0x%x\n",
                 mtc_freq, ipt_config_mtc_freq_mask);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     uint32_t cyc_thresh = (uint32_t) ((config->ctl & IPT_CTL_CYC_THRESH_MASK) >> IPT_CTL_CYC_THRESH_SHIFT);
     if (cyc_thresh != 0 && ((1 << cyc_thresh) & ipt_config_cyc_thresh_mask) == 0) {
         xprintf("bad cyc_thresh value, requested 0x%x, valid mask 0x%x\n",
                 cyc_thresh, ipt_config_cyc_thresh_mask);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     uint32_t psb_freq = (uint32_t) ((config->ctl & IPT_CTL_PSB_FREQ_MASK) >> IPT_CTL_PSB_FREQ_SHIFT);
     if (psb_freq != 0 && ((1 << psb_freq) & ipt_config_psb_freq_mask) == 0) {
         xprintf("bad psb_freq value, requested 0x%x, valid mask 0x%x\n",
                 psb_freq, ipt_config_psb_freq_mask);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uint32_t index;
@@ -528,13 +528,13 @@
             break;
     }
     if (index == ipt_dev->num_traces)
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
 
     ipt_per_trace_state_t* per_trace = &ipt_dev->per_trace_state[index];
     memset(per_trace, 0, sizeof(*per_trace));
-    mx_status_t status = x86_pt_alloc_buffer1(ipt_dev, per_trace,
+    zx_status_t status = x86_pt_alloc_buffer1(ipt_dev, per_trace,
                                               config->num_buffers, config->buffer_order, config->is_circular);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         x86_pt_free_buffer1(ipt_dev, per_trace);
         return status;
     }
@@ -549,68 +549,68 @@
     memcpy(per_trace->addr_ranges, config->addr_ranges, sizeof(config->addr_ranges));
     per_trace->allocated = true;
     *out_index = index;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t x86_pt_assign_buffer_thread(ipt_device_t* ipt_dev, uint32_t index, mx_handle_t thread) {
-    mx_handle_close(thread);
+static zx_status_t x86_pt_assign_buffer_thread(ipt_device_t* ipt_dev, uint32_t index, zx_handle_t thread) {
+    zx_handle_close(thread);
     // TODO(dje): Thread support is still work-in-progress.
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t x86_pt_release_buffer_thread(ipt_device_t* ipt_dev, uint32_t index, mx_handle_t thread) {
-    mx_handle_close(thread);
+static zx_status_t x86_pt_release_buffer_thread(ipt_device_t* ipt_dev, uint32_t index, zx_handle_t thread) {
+    zx_handle_close(thread);
     // TODO(dje): Thread support is still work-in-progress.
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t x86_pt_free_buffer(ipt_device_t* ipt_dev, uint32_t index) {
+static zx_status_t x86_pt_free_buffer(ipt_device_t* ipt_dev, uint32_t index) {
     if (ipt_dev->active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (index >= ipt_dev->num_traces)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     assert(ipt_dev->per_trace_state);
     ipt_per_trace_state_t* per_trace = &ipt_dev->per_trace_state[index];
     if (!per_trace->allocated)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     x86_pt_free_buffer1(ipt_dev, per_trace);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Allocate space for the trace buffers, for each cpu,
 // and do any other initialization needed prior to starting a trace.
-static mx_status_t x86_pt_cpu_mode_alloc(ipt_device_t* ipt_dev) {
+static zx_status_t x86_pt_cpu_mode_alloc(ipt_device_t* ipt_dev) {
     if (ipt_dev->active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (ipt_dev->mode != IPT_TRACE_CPUS)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
-    mx_handle_t resource = get_root_resource();
-    return mx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_CPU_MODE_ALLOC, 0, NULL, 0);
+    zx_handle_t resource = get_root_resource();
+    return zx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_CPU_MODE_ALLOC, 0, NULL, 0);
 }
 
 // Begin tracing, cpu mode.
-static mx_status_t x86_pt_cpu_mode_start(ipt_device_t* ipt_dev) {
+static zx_status_t x86_pt_cpu_mode_start(ipt_device_t* ipt_dev) {
     if (ipt_dev->active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (ipt_dev->mode != IPT_TRACE_CPUS)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     assert(ipt_dev->per_trace_state);
 
-    mx_handle_t resource = get_root_resource();
-    mx_status_t status;
+    zx_handle_t resource = get_root_resource();
+    zx_status_t status;
 
     // First verify a buffer has been allocated for each cpu.
     for (uint32_t cpu = 0; cpu < ipt_dev->num_traces; ++cpu) {
         const ipt_per_trace_state_t* per_trace = &ipt_dev->per_trace_state[cpu];
         if (!per_trace->allocated)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
     }
 
     for (uint32_t cpu = 0; cpu < ipt_dev->num_traces; ++cpu) {
         const ipt_per_trace_state_t* per_trace = &ipt_dev->per_trace_state[cpu];
 
-        mx_x86_pt_regs_t regs;
+        zx_x86_pt_regs_t regs;
         regs.ctl = per_trace->ctl;
         regs.ctl |= IPT_CTL_TOPA_MASK | IPT_CTL_TRACE_EN_MASK;
         regs.status = per_trace->status;
@@ -621,41 +621,41 @@
                       "addr range size mismatch");
         memcpy(regs.addr_ranges, per_trace->addr_ranges, sizeof(per_trace->addr_ranges));
 
-        status = mx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_STAGE_CPU_DATA,
+        status = zx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_STAGE_CPU_DATA,
                                    cpu, &regs, sizeof(regs));
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
     }
 
-    status = mx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_CPU_MODE_START,
+    status = zx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_CPU_MODE_START,
                                0, NULL, 0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     ipt_dev->active = true;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Stop tracing.
-static mx_status_t x86_pt_cpu_mode_stop(ipt_device_t* ipt_dev) {
+static zx_status_t x86_pt_cpu_mode_stop(ipt_device_t* ipt_dev) {
     if (!ipt_dev->active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     assert(ipt_dev->per_trace_state);
 
-    mx_handle_t resource = get_root_resource();
+    zx_handle_t resource = get_root_resource();
 
-    mx_status_t status = mx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_CPU_MODE_STOP,
+    zx_status_t status = zx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_CPU_MODE_STOP,
                                            0, NULL, 0);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     ipt_dev->active = false;
 
     for (uint32_t cpu = 0; cpu < ipt_dev->num_traces; ++cpu) {
         ipt_per_trace_state_t* per_trace = &ipt_dev->per_trace_state[cpu];
 
-        mx_x86_pt_regs_t regs;
-        status = mx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_GET_CPU_DATA,
+        zx_x86_pt_regs_t regs;
+        status = zx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_GET_CPU_DATA,
                                    cpu, &regs, sizeof(regs));
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         per_trace->ctl = regs.ctl;
         per_trace->status = regs.status;
@@ -667,22 +667,22 @@
         memcpy(per_trace->addr_ranges, regs.addr_ranges, sizeof(regs.addr_ranges));
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Release resources acquired by x86_pt_cpu_mode_alloc.
 // Also free any buffers allocated.
-static mx_status_t x86_pt_cpu_mode_free(ipt_device_t* ipt_dev) {
+static zx_status_t x86_pt_cpu_mode_free(ipt_device_t* ipt_dev) {
     if (ipt_dev->active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
-    mx_handle_t resource = get_root_resource();
-    mx_status_t status =
-        mx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_CPU_MODE_FREE, 0, NULL, 0);
+    zx_handle_t resource = get_root_resource();
+    zx_status_t status =
+        zx_mtrace_control(resource, MTRACE_KIND_IPT, MTRACE_IPT_CPU_MODE_FREE, 0, NULL, 0);
     // TODO(dje): This really shouldn't fail. What to do?
     // For now flag things as busted and prevent further use.
-    if (status != MX_OK)
-        return MX_OK;
+    if (status != ZX_OK)
+        return ZX_OK;
 
     for (uint32_t i = 0; i < ipt_dev->num_traces; ++i) {
         ipt_per_trace_state_t* per_trace = &ipt_dev->per_trace_state[i];
@@ -690,120 +690,120 @@
             x86_pt_free_buffer1(ipt_dev, per_trace);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 
 // The DDK interface
 
-static mx_status_t ipt_open(void* ctx, mx_device_t** dev_out, uint32_t flags) {
+static zx_status_t ipt_open(void* ctx, zx_device_t** dev_out, uint32_t flags) {
     // TODO(dje): For now we only support ToPA.
     if (!ipt_config_output_topa)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // TODO(dje): What's the best way to allow only one open at a time?
     // [We could allow multiple, but multiple clients trying to control
     // tracing is problematic so just punt for now..]
     ipt_device_t* ipt_dev = ctx;
     if (ipt_dev->opened)
-        return MX_ERR_ALREADY_BOUND;
+        return ZX_ERR_ALREADY_BOUND;
 
     if (ipt_dev->active)
         assert(ipt_dev->per_trace_state);
 
     if (!ipt_dev->per_trace_state) {
-        ipt_dev->num_traces = mx_system_get_num_cpus();
+        ipt_dev->num_traces = zx_system_get_num_cpus();
 
         ipt_dev->per_trace_state = calloc(ipt_dev->num_traces, sizeof(ipt_dev->per_trace_state[0]));
         if (!ipt_dev->per_trace_state)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         // reset values that have defaults
         ipt_dev->mode = IPT_TRACE_CPUS;
     }
 
     ipt_dev->opened = true;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ipt_close(void* ctx, uint32_t flags) {
+static zx_status_t ipt_close(void* ctx, uint32_t flags) {
     ipt_device_t* ipt_dev = ctx;
 
     ipt_dev->opened = false;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ipt_set_mode(ipt_device_t* ipt_dev,
+static zx_status_t ipt_set_mode(ipt_device_t* ipt_dev,
                             const void* cmd, size_t cmdlen,
                             void* reply, size_t max) {
     if (max != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     uint32_t mode;
     if (cmdlen != sizeof(mode))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     memcpy(&mode, cmd, sizeof(mode));
     return x86_pt_set_mode(ipt_dev, mode);
 }
 
-static mx_status_t ipt_alloc_buffer(ipt_device_t* ipt_dev,
+static zx_status_t ipt_alloc_buffer(ipt_device_t* ipt_dev,
                                 const void* cmd, size_t cmdlen,
                                 void* reply, size_t max, size_t* out_actual) {
     ioctl_ipt_buffer_config_t config;
     if (cmdlen != sizeof(config))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     memcpy(&config, cmd, sizeof(config));
     uint32_t index;
     if (max < sizeof(index))
-        return MX_ERR_BUFFER_TOO_SMALL;
-    mx_status_t status = x86_pt_alloc_buffer(ipt_dev, &config, &index);
-    if (status != MX_OK)
+        return ZX_ERR_BUFFER_TOO_SMALL;
+    zx_status_t status = x86_pt_alloc_buffer(ipt_dev, &config, &index);
+    if (status != ZX_OK)
         return status;
     memcpy(reply, &index, sizeof(index));
     *out_actual = sizeof(index);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ipt_assign_buffer_thread(ipt_device_t* ipt_dev,
+static zx_status_t ipt_assign_buffer_thread(ipt_device_t* ipt_dev,
                                         const void* cmd, size_t cmdlen,
                                         void* reply, size_t max) {
     ioctl_ipt_assign_buffer_thread_t assign;
     if (cmdlen != sizeof(assign))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (max != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     memcpy(&assign, cmd, sizeof(assign));
     return x86_pt_assign_buffer_thread(ipt_dev, assign.descriptor, assign.thread);
 }
 
-static mx_status_t ipt_release_buffer_thread(ipt_device_t* ipt_dev,
+static zx_status_t ipt_release_buffer_thread(ipt_device_t* ipt_dev,
                                          const void* cmd, size_t cmdlen,
                                          void* reply, size_t max) {
     ioctl_ipt_assign_buffer_thread_t assign;
     if (cmdlen != sizeof(assign))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (max != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     memcpy(&assign, cmd, sizeof(assign));
     return x86_pt_release_buffer_thread(ipt_dev, assign.descriptor, assign.thread);
 }
 
-static mx_status_t ipt_get_buffer_config(ipt_device_t* ipt_dev,
+static zx_status_t ipt_get_buffer_config(ipt_device_t* ipt_dev,
                                      const void* cmd, size_t cmdlen,
                                      void* reply, size_t max, size_t* out_actual) {
     uint32_t index;
     ioctl_ipt_buffer_config_t config;
 
     if (cmdlen != sizeof(index))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (max < sizeof(config))
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     memcpy(&index, cmd, sizeof(index));
     if (index >= ipt_dev->num_traces)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     const ipt_per_trace_state_t* per_trace = &ipt_dev->per_trace_state[index];
     if (!per_trace->allocated)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     config.num_buffers = per_trace->num_buffers;
     config.buffer_order = per_trace->buffer_order;
@@ -815,79 +815,79 @@
     memcpy(config.addr_ranges, per_trace->addr_ranges, sizeof(per_trace->addr_ranges));
     memcpy(reply, &config, sizeof(config));
     *out_actual = sizeof(config);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ipt_get_buffer_info(ipt_device_t* ipt_dev,
+static zx_status_t ipt_get_buffer_info(ipt_device_t* ipt_dev,
                                    const void* cmd, size_t cmdlen,
                                    void* reply, size_t max, size_t* out_actual) {
     if (ipt_dev->active)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     uint32_t index;
     if (cmdlen != sizeof(index))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     memcpy(&index, cmd, sizeof(index));
     if (index >= ipt_dev->num_traces)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     const ipt_per_trace_state_t* per_trace = &ipt_dev->per_trace_state[index];
     if (!per_trace->allocated)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     ioctl_ipt_buffer_info_t data;
     if (max < sizeof(data))
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     // Note: If this is a circular buffer this is just where tracing stopped.
     data.capture_end = compute_capture_size(ipt_dev, per_trace);
     memcpy(reply, &data, sizeof(data));
     *out_actual = sizeof(data);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ipt_get_buffer_handle(ipt_device_t* ipt_dev,
+static zx_status_t ipt_get_buffer_handle(ipt_device_t* ipt_dev,
                                      const void* cmd, size_t cmdlen,
                                      void* reply, size_t max, size_t* out_actual) {
     ioctl_ipt_buffer_handle_req_t req;
-    mx_handle_t h;
+    zx_handle_t h;
 
     if (cmdlen != sizeof(req))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (max < sizeof(h))
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     memcpy(&req, cmd, sizeof(req));
     if (req.descriptor >= ipt_dev->num_traces)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     const ipt_per_trace_state_t* per_trace = &ipt_dev->per_trace_state[req.descriptor];
     if (!per_trace->allocated)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (req.buffer_num >= per_trace->num_buffers)
-        return MX_ERR_INVALID_ARGS;
-    mx_status_t status = mx_handle_duplicate(per_trace->buffers[req.buffer_num].vmo_handle, MX_RIGHT_SAME_RIGHTS, &h);
+        return ZX_ERR_INVALID_ARGS;
+    zx_status_t status = zx_handle_duplicate(per_trace->buffers[req.buffer_num].vmo_handle, ZX_RIGHT_SAME_RIGHTS, &h);
     if (status < 0)
         return status;
     memcpy(reply, &h, sizeof(h));
     *out_actual = sizeof(h);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ipt_free_buffer(ipt_device_t* ipt_dev,
+static zx_status_t ipt_free_buffer(ipt_device_t* ipt_dev,
                                const void* cmd, size_t cmdlen,
                                void* reply, size_t max) {
     uint32_t index;
 
     if (cmdlen != sizeof(index))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (max != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     memcpy(&index, cmd, sizeof(index));
     x86_pt_free_buffer(ipt_dev, index);
     return 0;
 }
 
-static mx_status_t ipt_ioctl1(ipt_device_t* ipt_dev, uint32_t op,
+static zx_status_t ipt_ioctl1(ipt_device_t* ipt_dev, uint32_t op,
                           const void* cmd, size_t cmdlen,
                           void* reply, size_t max, size_t* out_actual) {
     switch (op) {
@@ -910,27 +910,27 @@
 
     case IOCTL_IPT_CPU_MODE_ALLOC:
         if (cmdlen != 0 || max != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return x86_pt_cpu_mode_alloc(ipt_dev);
     case IOCTL_IPT_CPU_MODE_START:
         if (cmdlen != 0 || max != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return x86_pt_cpu_mode_start(ipt_dev);
     case IOCTL_IPT_CPU_MODE_STOP:
         if (cmdlen != 0 || max != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return x86_pt_cpu_mode_stop(ipt_dev);
     case IOCTL_IPT_CPU_MODE_FREE:
         if (cmdlen != 0 || max != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         return x86_pt_cpu_mode_free(ipt_dev);
 
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
-static mx_status_t ipt_ioctl(void* ctx, uint32_t op,
+static zx_status_t ipt_ioctl(void* ctx, uint32_t op,
                          const void* cmd, size_t cmdlen,
                          void* reply, size_t max, size_t* out_actual) {
     ipt_device_t* ipt_dev = ctx;
@@ -954,7 +954,7 @@
     free(ipt_dev);
 }
 
-static mx_protocol_device_t ipt_device_proto = {
+static zx_protocol_device_t ipt_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .open = ipt_open,
     .close = ipt_close,
@@ -962,14 +962,14 @@
     .release = ipt_release,
 };
 
-static mx_status_t ipt_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t ipt_bind(void* ctx, zx_device_t* parent, void** cookie) {
     x86_pt_init();
     if (!ipt_config_supported)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     ipt_device_t* ipt_dev = calloc(1, sizeof(*ipt_dev));
     if (!ipt_dev)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     device_add_args_t args = {
         .version = DEVICE_ADD_ARGS_VERSION,
@@ -978,20 +978,20 @@
         .ops = &ipt_device_proto,
     };
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = device_add(parent, &args, NULL)) < 0) {
         free(ipt_dev);
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t ipt_driver_ops = {
+static zx_driver_ops_t ipt_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ipt_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(intel_pt, ipt_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(intel_pt)
+ZIRCON_DRIVER_BEGIN(intel_pt, ipt_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(intel_pt)
diff --git a/system/dev/misc/intel-pt/rules.mk b/system/dev/misc/intel-pt/rules.mk
index c025799..d519b92 100644
--- a/system/dev/misc/intel-pt/rules.mk
+++ b/system/dev/misc/intel-pt/rules.mk
@@ -14,7 +14,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/misc/intel-rtc/intel-rtc.c b/system/dev/misc/intel-rtc/intel-rtc.c
index a07deff..8eec459 100644
--- a/system/dev/misc/intel-rtc/intel-rtc.c
+++ b/system/dev/misc/intel-rtc/intel-rtc.c
@@ -5,11 +5,11 @@
 #include <ddk/binding.h>
 #include <ddk/device.h>
 #include <ddk/driver.h>
-#include <magenta/device/rtc.h>
+#include <zircon/device/rtc.h>
 #include <hw/inout.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -77,11 +77,11 @@
     uint64_t rtc_seconds = seconds_to_new_year + seconds_this_year;
     uint64_t rtc_nanoseconds = rtc_seconds * 1000000000;
 
-    uint64_t monotonic_nanoseconds = mx_time_get(MX_CLOCK_MONOTONIC);
+    uint64_t monotonic_nanoseconds = zx_time_get(ZX_CLOCK_MONOTONIC);
     int64_t offset = rtc_nanoseconds - monotonic_nanoseconds;
 
-    mx_status_t status = mx_clock_adjust(get_root_resource(), MX_CLOCK_UTC, offset);
-    if (status != MX_OK) {
+    zx_status_t status = zx_clock_adjust(get_root_resource(), ZX_CLOCK_UTC, offset);
+    if (status != ZX_OK) {
         fprintf(stderr, "The RTC driver was unable to set the UTC clock!\n");
     }
 }
@@ -250,7 +250,7 @@
 
 static ssize_t intel_rtc_get(void* buf, size_t count) {
     if (count < sizeof(rtc_t)) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
 
     // Ensure we have a consistent time.
@@ -277,14 +277,14 @@
 
 static ssize_t intel_rtc_set(const void* buf, size_t count) {
     if (count < sizeof(rtc_t)) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
     rtc_t rtc;
     memcpy(&rtc, buf, sizeof(rtc_t));
 
     // An invalid time was supplied.
     if (rtc_is_invalid(&rtc)) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
 
     write_time(&rtc);
@@ -311,7 +311,7 @@
 }
 
 // Implement ioctl protocol.
-static mx_status_t intel_rtc_ioctl(void* ctx, uint32_t op,
+static zx_status_t intel_rtc_ioctl(void* ctx, uint32_t op,
                                    const void* in_buf, size_t in_len,
                                    void* out_buf, size_t out_len, size_t* out_actual) {
     switch (op) {
@@ -321,27 +321,27 @@
             return ret;
         }
         *out_actual = ret;
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_RTC_SET:
         return intel_rtc_set(in_buf, in_len);
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_protocol_device_t intel_rtc_device_proto __UNUSED = {
+static zx_protocol_device_t intel_rtc_device_proto __UNUSED = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = intel_rtc_ioctl,
 };
 
 //TODO: bind against hw, not misc
-static mx_status_t intel_rtc_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t intel_rtc_bind(void* ctx, zx_device_t* parent, void** cookie) {
 #if defined(__x86_64__) || defined(__i386__)
     // TODO(teisenbe): This should be probed via the ACPI pseudo bus whenever it
     // exists.
 
-    mx_status_t status = mx_mmap_device_io(get_root_resource(), RTC_IO_BASE, RTC_NUM_IO_REGISTERS);
-    if (status != MX_OK) {
+    zx_status_t status = zx_mmap_device_io(get_root_resource(), RTC_IO_BASE, RTC_NUM_IO_REGISTERS);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -351,9 +351,9 @@
         .ops = &intel_rtc_device_proto,
     };
 
-    mx_device_t* dev;
+    zx_device_t* dev;
     status = device_add(parent, &args, &dev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -361,17 +361,17 @@
     sanitize_rtc(&rtc);
     set_utc_offset(&rtc);
 
-    return MX_OK;
+    return ZX_OK;
 #else
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif
 }
 
-static mx_driver_ops_t intel_rtc_driver_ops = {
+static zx_driver_ops_t intel_rtc_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = intel_rtc_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(intel_rtc, intel_rtc_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(intel_rtc)
+ZIRCON_DRIVER_BEGIN(intel_rtc, intel_rtc_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(intel_rtc)
diff --git a/system/dev/misc/intel-rtc/rules.mk b/system/dev/misc/intel-rtc/rules.mk
index 15dfb65..70f701a 100644
--- a/system/dev/misc/intel-rtc/rules.mk
+++ b/system/dev/misc/intel-rtc/rules.mk
@@ -14,7 +14,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/misc/ktrace/ktrace.c b/system/dev/misc/ktrace/ktrace.c
index 5222d64..dc8116b 100644
--- a/system/dev/misc/ktrace/ktrace.c
+++ b/system/dev/misc/ktrace/ktrace.c
@@ -6,105 +6,105 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/ktrace.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/ktrace.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
-#include <magenta/device/ktrace.h>
+#include <zircon/device/ktrace.h>
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <threads.h>
 
-static mx_status_t ktrace_read(void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t ktrace_read(void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
     uint32_t length;
-    mx_status_t status = mx_ktrace_read(get_root_resource(), buf, off, count, &length);
-    if (status == MX_OK) {
+    zx_status_t status = zx_ktrace_read(get_root_resource(), buf, off, count, &length);
+    if (status == ZX_OK) {
         *actual = length;
     }
     return status;
 }
 
-static mx_off_t ktrace_get_size(void* ctx) {
+static zx_off_t ktrace_get_size(void* ctx) {
     uint32_t size;
-    mx_status_t status = mx_ktrace_read(get_root_resource(), NULL, 0, 0, &size);
-    return status != MX_OK ? (mx_off_t)status : (mx_off_t)size;
+    zx_status_t status = zx_ktrace_read(get_root_resource(), NULL, 0, 0, &size);
+    return status != ZX_OK ? (zx_off_t)status : (zx_off_t)size;
 }
 
-static mx_status_t ktrace_ioctl(void* ctx, uint32_t op,
+static zx_status_t ktrace_ioctl(void* ctx, uint32_t op,
                             const void* cmd, size_t cmdlen,
                             void* reply, size_t max, size_t* out_actual) {
     switch (op) {
     case IOCTL_KTRACE_GET_HANDLE: {
-        if (max < sizeof(mx_handle_t)) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+        if (max < sizeof(zx_handle_t)) {
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         //TODO: ktrace-only handle once resources are further along
-        mx_handle_t h;
-        mx_status_t status = mx_handle_duplicate(get_root_resource(), MX_RIGHT_SAME_RIGHTS, &h);
+        zx_handle_t h;
+        zx_status_t status = zx_handle_duplicate(get_root_resource(), ZX_RIGHT_SAME_RIGHTS, &h);
         if (status < 0) {
             return status;
         }
-        *((mx_handle_t*) reply) = h;
-        *out_actual = sizeof(mx_handle_t);
-        return MX_OK;
+        *((zx_handle_t*) reply) = h;
+        *out_actual = sizeof(zx_handle_t);
+        return ZX_OK;
     }
     case IOCTL_KTRACE_ADD_PROBE: {
-        char name[MX_MAX_NAME_LEN];
-        if ((cmdlen >= MX_MAX_NAME_LEN) || (cmdlen < 1) || (max != sizeof(uint32_t))) {
-            return MX_ERR_INVALID_ARGS;
+        char name[ZX_MAX_NAME_LEN];
+        if ((cmdlen >= ZX_MAX_NAME_LEN) || (cmdlen < 1) || (max != sizeof(uint32_t))) {
+            return ZX_ERR_INVALID_ARGS;
         }
         memcpy(name, cmd, cmdlen);
         name[cmdlen] = 0;
-        mx_status_t status = mx_ktrace_control(get_root_resource(), KTRACE_ACTION_NEW_PROBE, 0, name);
+        zx_status_t status = zx_ktrace_control(get_root_resource(), KTRACE_ACTION_NEW_PROBE, 0, name);
         if (status < 0) {
             return status;
         }
         *((uint32_t*) reply) = status;
         *out_actual = sizeof(uint32_t);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_KTRACE_START: {
         if (cmdlen != sizeof(uint32_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         uint32_t group_mask = *(uint32_t *)cmd;
-        return mx_ktrace_control(get_root_resource(), KTRACE_ACTION_START, group_mask, NULL);
+        return zx_ktrace_control(get_root_resource(), KTRACE_ACTION_START, group_mask, NULL);
     }
     case IOCTL_KTRACE_STOP: {
-        mx_ktrace_control(get_root_resource(), KTRACE_ACTION_STOP, 0, NULL);
-        mx_ktrace_control(get_root_resource(), KTRACE_ACTION_REWIND, 0, NULL);
-        return MX_OK;
+        zx_ktrace_control(get_root_resource(), KTRACE_ACTION_STOP, 0, NULL);
+        zx_ktrace_control(get_root_resource(), KTRACE_ACTION_REWIND, 0, NULL);
+        return ZX_OK;
     }
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
-static mx_protocol_device_t ktrace_device_proto = {
+static zx_protocol_device_t ktrace_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .read = ktrace_read,
     .ioctl = ktrace_ioctl,
     .get_size = ktrace_get_size,
 };
 
-static mx_status_t ktrace_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t ktrace_bind(void* ctx, zx_device_t* parent, void** cookie) {
     device_add_args_t args = {
         .version = DEVICE_ADD_ARGS_VERSION,
         .name = "ktrace",
         .ops = &ktrace_device_proto,
     };
 
-    mx_device_t* dev;
+    zx_device_t* dev;
     return device_add(parent, &args, &dev);
 }
 
-static mx_driver_ops_t ktrace_driver_ops = {
+static zx_driver_ops_t ktrace_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ktrace_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(ktrace, ktrace_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(ktrace)
+ZIRCON_DRIVER_BEGIN(ktrace, ktrace_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(ktrace)
diff --git a/system/dev/misc/ktrace/rules.mk b/system/dev/misc/ktrace/rules.mk
index 4c22952..fdfae1a 100644
--- a/system/dev/misc/ktrace/rules.mk
+++ b/system/dev/misc/ktrace/rules.mk
@@ -12,7 +12,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/misc/pty/pty-core.c b/system/dev/misc/pty/pty-core.c
index 6946ab7..0710863 100644
--- a/system/dev/misc/pty/pty-core.c
+++ b/system/dev/misc/pty/pty-core.c
@@ -10,9 +10,9 @@
 #include "pty-core.h"
 #include "pty-fifo.h"
 
-#include <magenta/errors.h>
-#include <magenta/device/pty.h>
-#include <magenta/device/console.h>
+#include <zircon/errors.h>
+#include <zircon/device/pty.h>
+#include <zircon/device/console.h>
 
 #if 0
 #define xprintf(fmt...) printf(fmt)
@@ -33,7 +33,7 @@
 #define PTY_CLI_PEER_CLOSED (0x00040000u)
 
 struct pty_client {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     pty_server_t* srv;
     uint32_t id;
     uint32_t flags;
@@ -41,13 +41,13 @@
     list_node_t node;
 };
 
-static mx_status_t pty_openat(pty_server_t* ps, mx_device_t** out, uint32_t id, uint32_t flags);
+static zx_status_t pty_openat(pty_server_t* ps, zx_device_t** out, uint32_t id, uint32_t flags);
 
 
 
 // pty client device operations
 
-static mx_status_t pty_client_read(void* ctx, void* buf, size_t count, mx_off_t off,
+static zx_status_t pty_client_read(void* ctx, void* buf, size_t count, zx_off_t off,
                                    size_t* actual) {
     pty_client_t* pc = ctx;
     pty_server_t* ps = pc->srv;
@@ -65,13 +65,13 @@
 
     if (length > 0) {
         *actual =length;
-        return MX_OK;
+        return ZX_OK;
     } else {
-        return (pc->flags & PTY_CLI_PEER_CLOSED) ? MX_ERR_PEER_CLOSED : MX_ERR_SHOULD_WAIT;
+        return (pc->flags & PTY_CLI_PEER_CLOSED) ? ZX_ERR_PEER_CLOSED : ZX_ERR_SHOULD_WAIT;
     }
 }
 
-static mx_status_t pty_client_write(void* ctx, const void* buf, size_t count, mx_off_t off,
+static zx_status_t pty_client_write(void* ctx, const void* buf, size_t count, zx_off_t off,
                                     size_t* actual) {
     pty_client_t* pc = ctx;
     pty_server_t* ps = pc->srv;
@@ -82,13 +82,13 @@
     if (pc->flags & PTY_CLI_ACTIVE) {
         size_t length;
         r = ps->recv(ps, buf, count, &length);
-        if (r == MX_OK) {
+        if (r == ZX_OK) {
             *actual = length;
-        } else if (r == MX_ERR_SHOULD_WAIT) {
+        } else if (r == ZX_ERR_SHOULD_WAIT) {
             device_state_clr(pc->mxdev, DEV_STATE_WRITABLE);
         }
     } else {
-        r = (pc->flags & PTY_CLI_PEER_CLOSED) ? MX_ERR_PEER_CLOSED : MX_ERR_SHOULD_WAIT;
+        r = (pc->flags & PTY_CLI_PEER_CLOSED) ? ZX_ERR_PEER_CLOSED : ZX_ERR_SHOULD_WAIT;
     }
     mtx_unlock(&ps->lock);
 
@@ -133,7 +133,7 @@
 }
 
 
-static mx_status_t pty_client_ioctl(void* ctx, uint32_t op,
+static zx_status_t pty_client_ioctl(void* ctx, uint32_t op,
                                 const void* in_buf, size_t in_len,
                                 void* out_buf, size_t out_len, size_t* out_actual) {
     pty_client_t* pc = ctx;
@@ -145,43 +145,43 @@
         if ((in_len != sizeof(pty_clr_set_t)) ||
             (cs->clr & PTY_FEATURE_BAD) ||
             (cs->set & PTY_FEATURE_BAD)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         mtx_lock(&ps->lock);
         pc->flags = (pc->flags & (~cs->clr)) | cs->set;
         mtx_unlock(&ps->lock);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_CONSOLE_GET_DIMENSIONS: {
         ioctl_console_dimensions_t* dims = out_buf;
         if (out_len != sizeof(ioctl_console_dimensions_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         mtx_lock(&ps->lock);
         dims->width = ps->width;
         dims->height = ps->height;
         mtx_unlock(&ps->lock);
         *out_actual = sizeof(pty_window_size_t);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_PTY_GET_WINDOW_SIZE: {
         pty_window_size_t* wsz = out_buf;
         if (out_len != sizeof(pty_window_size_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         mtx_lock(&ps->lock);
         wsz->width = ps->width;
         wsz->height = ps->height;
         mtx_unlock(&ps->lock);
         *out_actual = sizeof(pty_window_size_t);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_PTY_MAKE_ACTIVE: {
         if (in_len != sizeof(uint32_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (!(pc->flags & PTY_CLI_CONTROL)) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
         uint32_t id = *((uint32_t*)in_buf);
         mtx_lock(&ps->lock);
@@ -190,18 +190,18 @@
             if (c->id == id) {
                 pty_make_active_locked(ps, c);
                 mtx_unlock(&ps->lock);
-                return MX_OK;
+                return ZX_OK;
             }
         }
         mtx_unlock(&ps->lock);
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     case IOCTL_PTY_READ_EVENTS: {
         if (!(pc->flags & PTY_CLI_CONTROL)) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
         if (out_len != sizeof(uint32_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         mtx_lock(&ps->lock);
         uint32_t events = ps->events;
@@ -213,13 +213,13 @@
         device_state_clr(pc->mxdev, PTY_SIGNAL_EVENT);
         mtx_unlock(&ps->lock);
         *out_actual = sizeof(uint32_t);
-        return MX_OK;
+        return ZX_OK;
     }
     default:
         if (ps->ioctl != NULL) {
             return ps->ioctl(ps, op, in_buf, in_len, out_buf, out_len, out_actual);
         } else {
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
     }
 }
@@ -264,22 +264,22 @@
     free(pc);
 }
 
-mx_status_t pty_client_openat(void* ctx, mx_device_t** out, const char* path, uint32_t flags) {
+zx_status_t pty_client_openat(void* ctx, zx_device_t** out, const char* path, uint32_t flags) {
     pty_client_t* pc = ctx;
     pty_server_t* ps = pc->srv;
     uint32_t id = strtoul(path, NULL, 0);
     // only controlling clients may create additional clients
     if (!(pc->flags & PTY_CLI_CONTROL)) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
     // clients may not create controlling clients
     if (id == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     return pty_openat(ps, out, id, flags);
 }
 
-mx_protocol_device_t pc_ops = {
+zx_protocol_device_t pc_ops = {
     .version = DEVICE_OPS_VERSION,
     // .open = default, allow cloning
     .open_at = pty_client_openat,
@@ -291,17 +291,17 @@
 
 // used by both client and server ptys to create new client ptys
 
-static mx_status_t pty_openat(pty_server_t* ps, mx_device_t** out, uint32_t id, uint32_t flags) {
+static zx_status_t pty_openat(pty_server_t* ps, zx_device_t** out, uint32_t id, uint32_t flags) {
     pty_client_t* pc;
     if ((pc = calloc(1, sizeof(pty_client_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     pc->id = id;
     pc->flags = 0;
     pc->fifo.head = 0;
     pc->fifo.tail = 0;
-    mx_status_t status;
+    zx_status_t status;
 
     unsigned num_clients = 0;
     mtx_lock(&ps->lock);
@@ -311,7 +311,7 @@
         if (c->id == id) {
             mtx_unlock(&ps->lock);
             free(pc);
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         num_clients++;
     }
@@ -356,7 +356,7 @@
     mtx_unlock(&ps->lock);
 
     *out = pc->mxdev;
-    return MX_OK;
+    return ZX_OK;
 }
 
 
@@ -368,9 +368,9 @@
     }
 }
 
-mx_status_t pty_server_send(pty_server_t* ps, const void* data, size_t len, bool atomic, size_t* actual) {
+zx_status_t pty_server_send(pty_server_t* ps, const void* data, size_t len, bool atomic, size_t* actual) {
     //TODO: rw signals
-    mx_status_t status;
+    zx_status_t status;
     mtx_lock(&ps->lock);
     if (ps->active) {
         pty_client_t* pc = ps->active;
@@ -409,10 +409,10 @@
         if (pty_fifo_is_full(&pc->fifo)) {
             device_state_clr(ps->mxdev, DEV_STATE_WRITABLE);
         }
-        status = MX_OK;
+        status = ZX_OK;
     } else {
         *actual = 0;
-        status = MX_ERR_PEER_CLOSED;
+        status = ZX_ERR_PEER_CLOSED;
     }
     mtx_unlock(&ps->lock);
     return status;
@@ -426,7 +426,7 @@
     mtx_unlock(&ps->lock);
 }
 
-mx_status_t pty_server_openat(void* ctx, mx_device_t** out, const char* path, uint32_t flags) {
+zx_status_t pty_server_openat(void* ctx, zx_device_t** out, const char* path, uint32_t flags) {
     pty_server_t* ps = ctx;
     uint32_t id = strtoul(path, NULL, 0);
     return pty_openat(ps, out, id, flags);
diff --git a/system/dev/misc/pty/pty-core.h b/system/dev/misc/pty/pty-core.h
index c761dcf..2d2eead 100644
--- a/system/dev/misc/pty/pty-core.h
+++ b/system/dev/misc/pty/pty-core.h
@@ -9,8 +9,8 @@
 
 #include <ddk/device.h>
 
-#include <magenta/compiler.h>
-#include <magenta/listnode.h>
+#include <zircon/compiler.h>
+#include <zircon/listnode.h>
 
 __BEGIN_CDECLS;
 
@@ -18,7 +18,7 @@
 typedef struct pty_client pty_client_t;
 
 struct pty_server {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     // lock covers server and all its clients
     mtx_t lock;
@@ -41,11 +41,11 @@
     // called when data is written by active client
     // pty_server's lock is held across this call
     // (it is not legal to call back into any pty_server_*() functions)
-    mx_status_t (*recv)(pty_server_t* ps, const void* data, size_t len, size_t* actual);
+    zx_status_t (*recv)(pty_server_t* ps, const void* data, size_t len, size_t* actual);
 
     // if non-null, called for unhandled client ioctl ops
     // no lock is held across this call
-    mx_status_t (*ioctl)(pty_server_t* ps, uint32_t op,
+    zx_status_t (*ioctl)(pty_server_t* ps, uint32_t op,
                      const void* cmd, size_t cmdlen,
                      void* out, size_t outlen, size_t* out_actual);
 
@@ -58,15 +58,15 @@
     uint32_t height;
 };
 
-// this initializes everything *except* the embedded mx_device_t
+// this initializes everything *except* the embedded zx_device_t
 void pty_server_init(pty_server_t* ps);
 
 // write data through to active client
 // if atomic is true, the send will be all-or-nothing
 // if atomic is true ^c, etc processing is not done
-mx_status_t pty_server_send(pty_server_t* ps, const void* data, size_t len, bool atomic, size_t* actual);
+zx_status_t pty_server_send(pty_server_t* ps, const void* data, size_t len, bool atomic, size_t* actual);
 
-// If the recv callback returns MX_ERR_SHOULD_WAIT, pty_server_resume()
+// If the recv callback returns ZX_ERR_SHOULD_WAIT, pty_server_resume()
 // must be called when it is possible to call it successfully again.
 // ps->lock must be held.
 void pty_server_resume_locked(pty_server_t* ps);
@@ -74,8 +74,8 @@
 void pty_server_set_window_size(pty_server_t* ps, uint32_t w, uint32_t h);
 
 // device ops for pty_server
-// the mx_device_t here must be the one embedded in pty_server_t
-mx_status_t pty_server_openat(void* ctx, mx_device_t** out, const char* path, uint32_t flags);
+// the zx_device_t here must be the one embedded in pty_server_t
+zx_status_t pty_server_openat(void* ctx, zx_device_t** out, const char* path, uint32_t flags);
 void pty_server_release(void* ctx);
 
 __END_CDECLS;
diff --git a/system/dev/misc/pty/pty-driver.c b/system/dev/misc/pty/pty-driver.c
index 5b86a0f..2af07c3 100644
--- a/system/dev/misc/pty/pty-driver.c
+++ b/system/dev/misc/pty/pty-driver.c
@@ -14,7 +14,7 @@
 #include "pty-core.h"
 #include "pty-fifo.h"
 
-#include <magenta/device/pty.h>
+#include <zircon/device/pty.h>
 
 typedef struct pty_server_dev {
     pty_server_t srv;
@@ -23,11 +23,11 @@
     pty_fifo_t fifo;
 } pty_server_dev_t;
 
-static mx_device_t* pty_root;
+static zx_device_t* pty_root;
 
 #define psd_from_ps(ps) containerof(ps, pty_server_dev_t, srv)
 
-static mx_status_t psd_recv(pty_server_t* ps, const void* data, size_t len, size_t* actual) {
+static zx_status_t psd_recv(pty_server_t* ps, const void* data, size_t len, size_t* actual) {
     if (len == 0) {
         return 0;
     }
@@ -41,13 +41,13 @@
     }
 
     if (*actual == 0) {
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
     } else {
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
-static mx_status_t psd_read(void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t psd_read(void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
     pty_server_dev_t* psd = ctx;
 
     bool eof = false;
@@ -69,30 +69,30 @@
 
     if (length > 0) {
         *actual = length;
-        return MX_OK;
+        return ZX_OK;
     } else if (eof) {
         *actual = 0;
-        return MX_OK;
+        return ZX_OK;
     } else {
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
     }
 }
 
-static mx_status_t psd_write(void* ctx, const void* buf, size_t count, mx_off_t off,
+static zx_status_t psd_write(void* ctx, const void* buf, size_t count, zx_off_t off,
                              size_t* actual) {
     pty_server_dev_t* psd = ctx;
     size_t length;
-    mx_status_t status;
+    zx_status_t status;
 
     if ((status = pty_server_send(&psd->srv, buf, count, false, &length)) < 0) {
         return status;
     } else {
         *actual = length;
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
-static mx_status_t psd_ioctl(void* ctx, uint32_t op,
+static zx_status_t psd_ioctl(void* ctx, uint32_t op,
                   const void* in_buf, size_t in_len,
                   void* out_buf, size_t out_len, size_t* out_actual) {
     pty_server_dev_t* psd = ctx;
@@ -101,20 +101,20 @@
     case IOCTL_PTY_SET_WINDOW_SIZE: {
         const pty_window_size_t* wsz = in_buf;
         if (in_len != sizeof(pty_window_size_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         pty_server_set_window_size(&psd->srv, wsz->width, wsz->height);
-        return MX_OK;
+        return ZX_OK;
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
 // Since we have no special functionality,
 // we just use the implementations from pty-core
 // directly.
-static mx_protocol_device_t psd_ops = {
+static zx_protocol_device_t psd_ops = {
     .version = DEVICE_OPS_VERSION,
     // .open = default, allow cloning
     .open_at = pty_server_openat,
@@ -127,10 +127,10 @@
 
 // ptmx device - used to obtain the pty server of a new pty instance
 
-static mx_status_t ptmx_open(void* ctx, mx_device_t** out, uint32_t flags) {
+static zx_status_t ptmx_open(void* ctx, zx_device_t** out, uint32_t flags) {
     pty_server_dev_t* psd;
     if ((psd = calloc(1, sizeof(pty_server_dev_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     pty_server_init(&psd->srv);
@@ -144,26 +144,26 @@
         .name = "pty",
         .ctx = psd,
         .ops = &psd_ops,
-        .proto_id = MX_PROTOCOL_PTY,
+        .proto_id = ZX_PROTOCOL_PTY,
         .flags = DEVICE_ADD_INSTANCE,
     };
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = device_add(pty_root, &args, &psd->srv.mxdev)) < 0) {
         free(psd);
         return status;
     }
 
     *out = psd->srv.mxdev;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_protocol_device_t ptmx_ops = {
+static zx_protocol_device_t ptmx_ops = {
     .version = DEVICE_OPS_VERSION,
     .open = ptmx_open,
 };
 
-static mx_status_t ptmx_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t ptmx_bind(void* ctx, zx_device_t* parent, void** cookie) {
     device_add_args_t args = {
         .version = DEVICE_ADD_ARGS_VERSION,
         .name = "ptmx",
@@ -173,11 +173,11 @@
     return device_add(parent, &args, &pty_root);
 }
 
-static mx_driver_ops_t ptmx_driver_ops = {
+static zx_driver_ops_t ptmx_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ptmx_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(ptmx, ptmx_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(ptmx)
+ZIRCON_DRIVER_BEGIN(ptmx, ptmx_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(ptzx)
diff --git a/system/dev/misc/pty/pty-fifo.h b/system/dev/misc/pty/pty-fifo.h
index d34e0ac..38a9759 100644
--- a/system/dev/misc/pty/pty-fifo.h
+++ b/system/dev/misc/pty/pty-fifo.h
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/dev/misc/pty/rules.mk b/system/dev/misc/pty/rules.mk
index ea7c621..888a775 100644
--- a/system/dev/misc/pty/rules.mk
+++ b/system/dev/misc/pty/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/misc/sysinfo/rules.mk b/system/dev/misc/sysinfo/rules.mk
index 8683468..ac68999 100644
--- a/system/dev/misc/sysinfo/rules.mk
+++ b/system/dev/misc/sysinfo/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/misc/sysinfo/sysinfo.c b/system/dev/misc/sysinfo/sysinfo.c
index f1ee52f..01c77f4 100644
--- a/system/dev/misc/sysinfo/sysinfo.c
+++ b/system/dev/misc/sysinfo/sysinfo.c
@@ -6,12 +6,12 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/types.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
+#include <zircon/types.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
 
-#include <magenta/device/sysinfo.h>
-#include <magenta/syscalls/resource.h>
+#include <zircon/device/sysinfo.h>
+#include <zircon/syscalls/resource.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -21,97 +21,97 @@
 
 #define ID_HJOBROOT 4
 static mtx_t sysinfo_lock = MTX_INIT;
-static mx_handle_t sysinfo_job_root;
+static zx_handle_t sysinfo_job_root;
 
-static mx_handle_t get_sysinfo_job_root(void) {
+static zx_handle_t get_sysinfo_job_root(void) {
     mtx_lock(&sysinfo_lock);
-    if (sysinfo_job_root == MX_HANDLE_INVALID) {
-        sysinfo_job_root = mx_get_startup_handle(PA_HND(PA_USER0, ID_HJOBROOT));
+    if (sysinfo_job_root == ZX_HANDLE_INVALID) {
+        sysinfo_job_root = zx_get_startup_handle(PA_HND(PA_USER0, ID_HJOBROOT));
     }
     mtx_unlock(&sysinfo_lock);
 
-    mx_handle_t h;
-    if ((sysinfo_job_root != MX_HANDLE_INVALID) &&
-        (mx_handle_duplicate(sysinfo_job_root, MX_RIGHT_SAME_RIGHTS, &h) == MX_OK)) {
+    zx_handle_t h;
+    if ((sysinfo_job_root != ZX_HANDLE_INVALID) &&
+        (zx_handle_duplicate(sysinfo_job_root, ZX_RIGHT_SAME_RIGHTS, &h) == ZX_OK)) {
         return h;
     }
 
-    return MX_HANDLE_INVALID;
+    return ZX_HANDLE_INVALID;
 }
 
-static mx_status_t sysinfo_ioctl(void* ctx, uint32_t op, const void* cmd, size_t cmdlen,
+static zx_status_t sysinfo_ioctl(void* ctx, uint32_t op, const void* cmd, size_t cmdlen,
                              void* reply, size_t max, size_t* out_actual) {
     switch (op) {
     case IOCTL_SYSINFO_GET_ROOT_JOB: {
-        if ((cmdlen != 0) || (max < sizeof(mx_handle_t))) {
-            return MX_ERR_INVALID_ARGS;
+        if ((cmdlen != 0) || (max < sizeof(zx_handle_t))) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        mx_handle_t h = get_sysinfo_job_root();
-        if (h == MX_HANDLE_INVALID) {
-            return MX_ERR_NOT_SUPPORTED;
+        zx_handle_t h = get_sysinfo_job_root();
+        if (h == ZX_HANDLE_INVALID) {
+            return ZX_ERR_NOT_SUPPORTED;
         } else {
-            memcpy(reply, &h, sizeof(mx_handle_t));
-            *out_actual = sizeof(mx_handle_t);
-            return MX_OK;
+            memcpy(reply, &h, sizeof(zx_handle_t));
+            *out_actual = sizeof(zx_handle_t);
+            return ZX_OK;
         }
     }
     case IOCTL_SYSINFO_GET_ROOT_RESOURCE: {
-        if ((cmdlen != 0) || (max < sizeof(mx_handle_t))) {
-            return MX_ERR_INVALID_ARGS;
+        if ((cmdlen != 0) || (max < sizeof(zx_handle_t))) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        mx_handle_t h = get_root_resource();
-        if (h == MX_HANDLE_INVALID) {
-            return MX_ERR_NOT_SUPPORTED;
+        zx_handle_t h = get_root_resource();
+        if (h == ZX_HANDLE_INVALID) {
+            return ZX_ERR_NOT_SUPPORTED;
         }
-        mx_status_t status = mx_handle_duplicate(h, MX_RIGHT_TRANSFER, &h);
+        zx_status_t status = zx_handle_duplicate(h, ZX_RIGHT_TRANSFER, &h);
         if (status < 0) {
             return status;
         }
-        memcpy(reply, &h, sizeof(mx_handle_t));
-        *out_actual = sizeof(mx_handle_t);
-        return MX_OK;
+        memcpy(reply, &h, sizeof(zx_handle_t));
+        *out_actual = sizeof(zx_handle_t);
+        return ZX_OK;
     }
     case IOCTL_SYSINFO_GET_HYPERVISOR_RESOURCE: {
-        if ((cmdlen != 0) || (max < sizeof(mx_handle_t))) {
-            return MX_ERR_INVALID_ARGS;
+        if ((cmdlen != 0) || (max < sizeof(zx_handle_t))) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        mx_handle_t h;
-        mx_status_t status = mx_resource_create(get_root_resource(),
-                                                MX_RSRC_KIND_HYPERVISOR,
+        zx_handle_t h;
+        zx_status_t status = zx_resource_create(get_root_resource(),
+                                                ZX_RSRC_KIND_HYPERVISOR,
                                                 0, 0, &h);
         if (status < 0) {
             return status;
         }
-        memcpy(reply, &h, sizeof(mx_handle_t));
-        *out_actual = sizeof(mx_handle_t);
-        return MX_OK;
+        memcpy(reply, &h, sizeof(zx_handle_t));
+        *out_actual = sizeof(zx_handle_t);
+        return ZX_OK;
     }
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
-static mx_protocol_device_t sysinfo_ops = {
+static zx_protocol_device_t sysinfo_ops = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = sysinfo_ioctl,
 };
 
-mx_status_t sysinfo_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t sysinfo_bind(void* ctx, zx_device_t* parent, void** cookie) {
     device_add_args_t args = {
         .version = DEVICE_ADD_ARGS_VERSION,
         .name = "sysinfo",
         .ops = &sysinfo_ops,
     };
 
-    mx_device_t* dev;
+    zx_device_t* dev;
     return device_add(parent, &args, &dev);
 }
 
-static mx_driver_ops_t sysinfo_driver_ops = {
+static zx_driver_ops_t sysinfo_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = sysinfo_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(sysinfo, sysinfo_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(sysinfo)
+ZIRCON_DRIVER_BEGIN(sysinfo, sysinfo_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(sysinfo)
diff --git a/system/dev/misc/test/rules.mk b/system/dev/misc/test/rules.mk
index 09e6cb6..7871527 100644
--- a/system/dev/misc/test/rules.mk
+++ b/system/dev/misc/test/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/misc/test/test.c b/system/dev/misc/test/test.c
index b1607cd..616000c 100644
--- a/system/dev/misc/test/test.c
+++ b/system/dev/misc/test/test.c
@@ -10,42 +10,42 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 
 typedef struct test_device {
-    mx_device_t* mxdev;
-    mx_handle_t output;
-    mx_handle_t control;
+    zx_device_t* mxdev;
+    zx_handle_t output;
+    zx_handle_t control;
     test_func_t test_func;
     void* cookie;
 } test_device_t;
 
 typedef struct test_root {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 } test_root_t;
 
-static void test_device_set_output_socket(void* ctx, mx_handle_t handle) {
+static void test_device_set_output_socket(void* ctx, zx_handle_t handle) {
     test_device_t* device = ctx;
-    if (device->output != MX_HANDLE_INVALID) {
-        mx_handle_close(device->output);
+    if (device->output != ZX_HANDLE_INVALID) {
+        zx_handle_close(device->output);
     }
     device->output = handle;
 }
 
-static mx_handle_t test_device_get_output_socket(void* ctx) {
+static zx_handle_t test_device_get_output_socket(void* ctx) {
     test_device_t* device = ctx;
     return device->output;
 }
 
-static void test_device_set_control_channel(void* ctx, mx_handle_t handle) {
+static void test_device_set_control_channel(void* ctx, zx_handle_t handle) {
     test_device_t* device = ctx;
-    if (device->control != MX_HANDLE_INVALID) {
-        mx_handle_close(device->control);
+    if (device->control != ZX_HANDLE_INVALID) {
+        zx_handle_close(device->control);
     }
     device->control = handle;
 }
 
-static mx_handle_t test_device_get_control_channel(void* ctx) {
+static zx_handle_t test_device_get_control_channel(void* ctx) {
     test_device_t* device = ctx;
     return device->control;
 }
@@ -56,12 +56,12 @@
     device->cookie = cookie;
 }
 
-static mx_status_t test_device_run_tests(void *ctx, test_report_t* report, const void* arg, size_t arglen) {
+static zx_status_t test_device_run_tests(void *ctx, test_report_t* report, const void* arg, size_t arglen) {
     test_device_t* device = ctx;
     if (device->test_func != NULL) {
         return device->test_func(device->cookie, report, arg, arglen);
     } else {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -80,29 +80,29 @@
     .destroy = test_device_destroy,
 };
 
-static mx_status_t test_device_ioctl(void* ctx, uint32_t op, const void* in, size_t inlen, void* out,
+static zx_status_t test_device_ioctl(void* ctx, uint32_t op, const void* in, size_t inlen, void* out,
                                     size_t outlen, size_t* out_actual) {
     test_device_t* dev = ctx;
     switch (op) {
     case IOCTL_TEST_SET_OUTPUT_SOCKET:
-        if (inlen != sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
+        if (inlen != sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        test_device_set_output_socket(dev, *(mx_handle_t*)in);
-        return MX_OK;
+        test_device_set_output_socket(dev, *(zx_handle_t*)in);
+        return ZX_OK;
 
     case IOCTL_TEST_SET_CONTROL_CHANNEL:
-        if (inlen != sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
+        if (inlen != sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        test_device_set_control_channel(dev, *(mx_handle_t*)in);
-        return MX_OK;
+        test_device_set_control_channel(dev, *(zx_handle_t*)in);
+        return ZX_OK;
 
     case IOCTL_TEST_RUN_TESTS:
         if (outlen != sizeof(test_report_t)) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
-        mx_status_t status = test_device_run_tests(dev, (test_report_t*)out, in, inlen);
+        zx_status_t status = test_device_run_tests(dev, (test_report_t*)out, in, inlen);
         *out_actual = sizeof(test_report_t);
         return status;
 
@@ -111,22 +111,22 @@
         return 0;
 
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
 static void test_device_release(void* ctx) {
     test_device_t* device = ctx;
-    if (device->output != MX_HANDLE_INVALID) {
-        mx_handle_close(device->output);
+    if (device->output != ZX_HANDLE_INVALID) {
+        zx_handle_close(device->output);
     }
-    if (device->control != MX_HANDLE_INVALID) {
-        mx_handle_close(device->control);
+    if (device->control != ZX_HANDLE_INVALID) {
+        zx_handle_close(device->control);
     }
     free(device);
 }
 
-static mx_protocol_device_t test_device_proto = {
+static zx_protocol_device_t test_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = test_device_ioctl,
     .release = test_device_release,
@@ -135,15 +135,15 @@
 
 #define DEV_TEST "/dev/misc/test"
 
-static mx_status_t test_ioctl(void* ctx, uint32_t op, const void* in, size_t inlen,
+static zx_status_t test_ioctl(void* ctx, uint32_t op, const void* in, size_t inlen,
                               void* out, size_t outlen, size_t* out_actual) {
     test_root_t* root = ctx;
 
     if (op != IOCTL_TEST_CREATE_DEVICE) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
-    char devname[MX_DEVICE_NAME_MAX + 1];
+    char devname[ZX_DEVICE_NAME_MAX + 1];
     if (inlen > 0) {
         strncpy(devname, in, sizeof(devname));
     } else {
@@ -151,12 +151,12 @@
     }
 
     if (outlen < strlen(devname) + sizeof(DEV_TEST) + 1) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
 
     test_device_t* device = calloc(1, sizeof(test_device_t));
     if (device == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     device_add_args_t args = {
@@ -164,30 +164,30 @@
         .name = devname,
         .ctx = device,
         .ops = &test_device_proto,
-        .proto_id = MX_PROTOCOL_TEST,
+        .proto_id = ZX_PROTOCOL_TEST,
         .proto_ops = &test_test_proto,
     };
 
-    mx_status_t status;
-    if ((status = device_add(root->mxdev, &args, &device->mxdev)) != MX_OK) {
+    zx_status_t status;
+    if ((status = device_add(root->mxdev, &args, &device->mxdev)) != ZX_OK) {
         free(device);
         return status;
     }
 
     int length = snprintf(out, outlen,"%s/%s", DEV_TEST, devname) + 1;
     *out_actual = length;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_protocol_device_t test_root_proto = {
+static zx_protocol_device_t test_root_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = test_ioctl,
 };
 
-static mx_status_t test_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t test_bind(void* ctx, zx_device_t* dev, void** cookie) {
     test_root_t* root = calloc(1, sizeof(test_root_t));
     if (!root) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     device_add_args_t args = {
        .version = DEVICE_ADD_ARGS_VERSION,
@@ -199,11 +199,11 @@
     return device_add(dev, &args, &root->mxdev);
 }
 
-static mx_driver_ops_t test_driver_ops = {
+static zx_driver_ops_t test_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = test_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(test, test_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(test)
+ZIRCON_DRIVER_BEGIN(test, test_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(test)
diff --git a/system/dev/misc/tpm/rules.mk b/system/dev/misc/tpm/rules.mk
index ba3addd..02d992c 100644
--- a/system/dev/misc/tpm/rules.mk
+++ b/system/dev/misc/tpm/rules.mk
@@ -14,7 +14,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/misc/tpm/tpm-commands.h b/system/dev/misc/tpm/tpm-commands.h
index fa2df32..1b93ccf 100644
--- a/system/dev/misc/tpm/tpm-commands.h
+++ b/system/dev/misc/tpm/tpm-commands.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #define TPM_TAG_RQU_COMMAND 193
 #define TPM_TAG_RSP_COMMAND 196
diff --git a/system/dev/misc/tpm/tpm-proto.c b/system/dev/misc/tpm/tpm-proto.c
index 9a54005..60f63dc 100644
--- a/system/dev/misc/tpm/tpm-proto.c
+++ b/system/dev/misc/tpm/tpm-proto.c
@@ -6,7 +6,7 @@
 #include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include "tpm.h"
 
 #define TPM_LOCALITY_BASE(locality) ((uintptr_t)(tpm_base) + ((uintptr_t)(locality) << 12))
@@ -70,9 +70,9 @@
 #define TIMEOUT_C 200000  //  200 ms
 #define TIMEOUT_D 30000   //   30 ms
 
-mx_status_t tpm_set_irq(enum locality loc, uint8_t vector) {
+zx_status_t tpm_set_irq(enum locality loc, uint8_t vector) {
     if (vector < 1 || vector > 15) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     *TPM_INT_VECTOR(loc) = vector;
     // Enable TPM interrupts (top-level mask bit)
@@ -81,161 +81,161 @@
     // This is not doable yet, since our interrupt syscalls do not allow
     // configuring signaling modes yet.
     *TPM_INT_ENABLE(loc) |= TPM_INT_ENABLE_RISING_EDGE;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t tpm_is_supported(enum locality loc) {
+zx_status_t tpm_is_supported(enum locality loc) {
     const uint32_t iface_id = *TPM_INTERFACE_ID(loc);
     switch (iface_id & TPM_INTERFACE_ID_TYPE_MASK) {
         case TPM_INTERFACE_ID_TYPE_FIFO_1_3: {
             const uint32_t iface_ver = *TPM_INTF_CAP(loc) & TPM_INTF_CAP_IFACE_VER_MASK;
             if (iface_ver == TPM_INTF_CAP_IFACE_VER_1_2) {
-                return MX_OK;
+                return ZX_OK;
             }
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
         case TPM_INTERFACE_ID_TYPE_FIFO_2_0:
         case TPM_INTERFACE_ID_TYPE_CRB:
         default:
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-mx_status_t tpm_request_use(enum locality loc) {
+zx_status_t tpm_request_use(enum locality loc) {
     uint8_t val;
     if (!((val = *TPM_ACCESS(loc)) & TPM_ACCESS_REG_VALID)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     if (val & TPM_ACCESS_REQUEST_USE) {
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     }
 
     if (val & TPM_ACCESS_ACTIVE_LOCALITY) {
         // We're already the active locality
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
-    mx_status_t status = tpm_enable_irq_type(loc, IRQ_LOCALITY_CHANGE);
-    if (status != MX_OK) {
+    zx_status_t status = tpm_enable_irq_type(loc, IRQ_LOCALITY_CHANGE);
+    if (status != ZX_OK) {
         return status;
     }
     *TPM_ACCESS(loc) = TPM_ACCESS_REQUEST_USE;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t tpm_wait_for_locality(enum locality loc) {
+zx_status_t tpm_wait_for_locality(enum locality loc) {
     uint8_t val;
     if (!((val = *TPM_ACCESS(loc)) & TPM_ACCESS_REG_VALID)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (val & TPM_ACCESS_ACTIVE_LOCALITY) {
-        return MX_OK;
+        return ZX_OK;
     }
     if (!(val & TPM_ACCESS_REQUEST_USE)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     // We assume we're the only one using the TPM, so we need to wait at most
     // TIMEOUT_A
-    mx_nanosleep(mx_deadline_after(TIMEOUT_A));
+    zx_nanosleep(zx_deadline_after(TIMEOUT_A));
 
     if (!((val = *TPM_ACCESS(loc)) & TPM_ACCESS_REG_VALID)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (val & TPM_ACCESS_ACTIVE_LOCALITY) {
-        return MX_OK;
+        return ZX_OK;
     }
     if (val & TPM_ACCESS_REQUEST_USE) {
-        return MX_ERR_TIMED_OUT;
+        return ZX_ERR_TIMED_OUT;
     }
-    return MX_ERR_BAD_STATE;
+    return ZX_ERR_BAD_STATE;
 }
 
-mx_status_t tpm_enable_irq_type(enum locality loc, enum irq_type type) {
+zx_status_t tpm_enable_irq_type(enum locality loc, enum irq_type type) {
     if (!(*TPM_INTF_CAP(loc) & type)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     *TPM_INT_ENABLE(loc) |= (uint32_t)type;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t tpm_disable_irq_type(enum locality loc, enum irq_type type) {
+zx_status_t tpm_disable_irq_type(enum locality loc, enum irq_type type) {
     if (!(*TPM_INTF_CAP(loc) & type)) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     *TPM_INT_ENABLE(loc) &= ~(uint32_t)type;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t get_status_field(enum locality loc, uint32_t *val) {
+static zx_status_t get_status_field(enum locality loc, uint32_t *val) {
     for (int attempt = 0; attempt < 2; ++attempt) {
         if (attempt) {
-            mx_nanosleep(mx_deadline_after(TIMEOUT_A));
+            zx_nanosleep(zx_deadline_after(TIMEOUT_A));
         }
 
         uint32_t status = *TPM_STS(loc);
         if (status & TPM_STS_VALID) {
             *val = status;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
-    return MX_ERR_TIMED_OUT;
+    return ZX_ERR_TIMED_OUT;
 }
 
-static mx_status_t get_burst_count(enum locality loc, uint16_t *val) {
+static zx_status_t get_burst_count(enum locality loc, uint16_t *val) {
     for (int attempt = 0; attempt < 2; ++attempt) {
         if (attempt) {
-            mx_nanosleep(mx_deadline_after(TIMEOUT_A));
+            zx_nanosleep(zx_deadline_after(TIMEOUT_A));
         }
 
         uint32_t status = *TPM_STS(loc);
         uint16_t burst = TPM_STS_EXTRACT_BURST_COUNT(status);
         if (burst > 0) {
             *val = burst;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
-    return MX_ERR_TIMED_OUT;
+    return ZX_ERR_TIMED_OUT;
 }
 
 // Returns the true/false value of the the STS.EXPECT bit, or < 0 on error
-static mx_status_t get_status_expect(enum locality loc, bool* expect) {
+static zx_status_t get_status_expect(enum locality loc, bool* expect) {
     uint32_t status_field;
-    mx_status_t status = get_status_field(loc, &status_field);
-    if (status != MX_OK) {
+    zx_status_t status = get_status_field(loc, &status_field);
+    if (status != ZX_OK) {
         return status;
     }
     *expect = !!(status_field & TPM_STS_EXPECT);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Returns the true/false value of the the STS.DATA_AVAIL bit, or < 0 on error
-static mx_status_t get_status_data_avail(enum locality loc, bool* data_avail) {
+static zx_status_t get_status_data_avail(enum locality loc, bool* data_avail) {
     uint32_t status_field;
-    mx_status_t status = get_status_field(loc, &status_field);
-    if (status != MX_OK) {
+    zx_status_t status = get_status_field(loc, &status_field);
+    if (status != ZX_OK) {
         return status;
     }
     *data_avail = !!(status_field & TPM_STS_DATA_AVAIL);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t wait_for_data_avail(enum locality loc) {
+static zx_status_t wait_for_data_avail(enum locality loc) {
     // TODO(teisenbe): Add a timeout to this?
     while (1) {
         bool data_avail = false;
-        mx_status_t st = get_status_data_avail(loc, &data_avail);
+        zx_status_t st = get_status_data_avail(loc, &data_avail);
         if (st < 0) {
             return st;
         }
         if (data_avail) {
-            return MX_OK;
+            return ZX_OK;
         }
 
-        st = mx_interrupt_wait(irq_handle);
+        st = zx_interrupt_wait(irq_handle);
         if (st < 0) {
             return st;
         }
@@ -247,10 +247,10 @@
             *TPM_INT_STATUS(loc) = IRQ_LOCALITY_CHANGE;
             // If locality changed, whatever operation we're in the middle of
             // is no longer valid..
-            mx_interrupt_complete(irq_handle);
-            return MX_ERR_INTERNAL;
+            zx_interrupt_complete(irq_handle);
+            return ZX_ERR_INTERNAL;
         }
-        mx_interrupt_complete(irq_handle);
+        zx_interrupt_complete(irq_handle);
     }
 }
 
@@ -259,36 +259,36 @@
 }
 
 // Returns the true/false value of the the ACCESS.ACTIVE bit, or < 0 on error
-static mx_status_t get_active_locality(enum locality loc, bool* active) {
+static zx_status_t get_active_locality(enum locality loc, bool* active) {
     uint8_t val;
     if (!((val = *TPM_ACCESS(loc)) & TPM_ACCESS_REG_VALID)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     *active = !!(val & TPM_ACCESS_ACTIVE_LOCALITY);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t check_expected_state(
-        mx_status_t status, bool actual, bool expected) {
+static zx_status_t check_expected_state(
+        zx_status_t status, bool actual, bool expected) {
     if (status < 0) {
         return status;
     }
     if (actual != expected) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t tpm_send_cmd(enum locality loc, uint8_t* cmd, size_t len) {
+zx_status_t tpm_send_cmd(enum locality loc, uint8_t* cmd, size_t len) {
     bool active = false;
-    mx_status_t st = get_active_locality(loc, &active);
+    zx_status_t st = get_active_locality(loc, &active);
     st = check_expected_state(st, active, true);
     if (st < 0) {
         return st;
     }
 
     if (!(*TPM_STS(loc) & TPM_STS_CMD_RDY)) {
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     }
 
     // This procedure is described in section 5.5.2.2.1 of the TCG PC Client
@@ -301,7 +301,7 @@
     while (bytes_sent < len) {
         uint16_t burst_count;
         st = get_burst_count(loc, &burst_count);
-        if (st != MX_OK) {
+        if (st != ZX_OK) {
             abort_command(loc);
             return st;
         }
@@ -339,12 +339,12 @@
 
     // Run the command
     *TPM_STS(loc) = TPM_STS_TPM_GO;
-    return MX_OK;
+    return ZX_OK;
 }
 
 ssize_t tpm_recv_resp(enum locality loc, uint8_t* resp, size_t max_len) {
     bool active = false;
-    mx_status_t st = get_active_locality(loc, &active);
+    zx_status_t st = get_active_locality(loc, &active);
     st = check_expected_state(st, active, true);
     if (st < 0) {
         abort_command(loc);
@@ -356,7 +356,7 @@
 
     // Wait for data to be available
     st = wait_for_data_avail(loc);
-    if (st != MX_OK) {
+    if (st != ZX_OK) {
         abort_command(loc);
         return st;
     }
@@ -366,7 +366,7 @@
     while (more_data) {
         uint16_t burst_count;
         st = get_burst_count(loc, &burst_count);
-        if (st != MX_OK) {
+        if (st != ZX_OK) {
             abort_command(loc);
             return st;
         }
diff --git a/system/dev/misc/tpm/tpm.c b/system/dev/misc/tpm/tpm.c
index 8851b43..8e2f80c 100644
--- a/system/dev/misc/tpm/tpm.c
+++ b/system/dev/misc/tpm/tpm.c
@@ -18,9 +18,9 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 #include <ddk/io-buffer.h>
-#include <magenta/device/tpm.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/device/tpm.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -38,12 +38,12 @@
 
 static mtx_t tpm_lock = MTX_INIT;
 void *tpm_base;
-mx_handle_t irq_handle;
+zx_handle_t irq_handle;
 static io_buffer_t io_buffer;
 
 // implement tpm protocol:
 
-static ssize_t tpm_get_random(mx_device_t* dev, void* buf, size_t count) {
+static ssize_t tpm_get_random(zx_device_t* dev, void* buf, size_t count) {
     if (count > MAX_RAND_BYTES) {
         count = MAX_RAND_BYTES;
     }
@@ -51,13 +51,13 @@
     uint32_t resp_len = tpm_init_getrandom(&cmd, count);
     struct tpm_getrandom_resp *resp = malloc(resp_len);
     if (!resp) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     mtx_lock(&tpm_lock);
 
-    mx_status_t status = tpm_send_cmd(LOCALITY0, (uint8_t*)&cmd, sizeof(cmd));
-    if (status != MX_OK) {
+    zx_status_t status = tpm_send_cmd(LOCALITY0, (uint8_t*)&cmd, sizeof(cmd));
+    if (status != ZX_OK) {
         goto cleanup;
     }
     status = tpm_recv_resp(LOCALITY0, (uint8_t*)resp, resp_len);
@@ -67,7 +67,7 @@
     if ((uint32_t)status < sizeof(*resp) ||
         (uint32_t)status != betoh32(resp->hdr.total_len)) {
 
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto cleanup;
     }
     uint32_t bytes_returned = betoh32(resp->bytes_returned);
@@ -76,7 +76,7 @@
         bytes_returned > count ||
         resp->hdr.return_code != htobe32(TPM_SUCCESS)) {
 
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto cleanup;
     }
     memcpy(buf, resp->bytes, bytes_returned);
@@ -88,15 +88,15 @@
     return status;
 }
 
-static mx_status_t tpm_save_state(void) {
+static zx_status_t tpm_save_state(void) {
     struct tpm_savestate_cmd cmd;
     uint32_t resp_len = tpm_init_savestate(&cmd);
     struct tpm_savestate_resp resp;
 
     mtx_lock(&tpm_lock);
 
-    mx_status_t status = tpm_send_cmd(LOCALITY0, (uint8_t*)&cmd, sizeof(cmd));
-    if (status != MX_OK) {
+    zx_status_t status = tpm_send_cmd(LOCALITY0, (uint8_t*)&cmd, sizeof(cmd));
+    if (status != ZX_OK) {
         goto cleanup;
     }
     status = tpm_recv_resp(LOCALITY0, (uint8_t*)&resp, resp_len);
@@ -108,43 +108,43 @@
         resp.hdr.tag != htobe16(TPM_TAG_RSP_COMMAND) ||
         resp.hdr.return_code != htobe32(TPM_SUCCESS)) {
 
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto cleanup;
     }
-    status = MX_OK;
+    status = ZX_OK;
 cleanup:
     mtx_unlock(&tpm_lock);
     return status;
 }
 
-static mx_status_t tpm_device_ioctl(void* ctx, uint32_t op,
+static zx_status_t tpm_device_ioctl(void* ctx, uint32_t op,
                                     const void* in_buf, size_t in_len,
                                     void* out_buf, size_t out_len, size_t* out_actual) {
     switch (op) {
         case IOCTL_TPM_SAVE_STATE: return tpm_save_state();
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 // implement device protocol:
-static mx_protocol_device_t tpm_device_proto __UNUSED = {
+static zx_protocol_device_t tpm_device_proto __UNUSED = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = tpm_device_ioctl,
 };
 
 
 //TODO: bind against hw, not misc
-mx_status_t tpm_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t tpm_bind(void* ctx, zx_device_t* parent, void** cookie) {
 #if defined(__x86_64__) || defined(__i386__)
-    mx_status_t status = io_buffer_init_physical(&io_buffer, TPM_PHYS_ADDRESS, TPM_PHYS_LENGTH,
-                                                 get_root_resource(), MX_CACHE_POLICY_UNCACHED);
-    if (status != MX_OK) {
+    zx_status_t status = io_buffer_init_physical(&io_buffer, TPM_PHYS_ADDRESS, TPM_PHYS_LENGTH,
+                                                 get_root_resource(), ZX_CACHE_POLICY_UNCACHED);
+    if (status != ZX_OK) {
         return status;
     }
     tpm_base = io_buffer_virt(&io_buffer);
 
     status = tpm_is_supported(LOCALITY0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -152,12 +152,12 @@
         .version = DEVICE_ADD_ARGS_VERSION,
         .name = "tpm",
         .ops = &tpm_device_proto,
-        .proto_id = MX_PROTOCOL_TPM,
+        .proto_id = ZX_PROTOCOL_TPM,
     };
 
-    mx_device_t* dev;
+    zx_device_t* dev;
     status =  device_add(parent, &args, &dev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -166,23 +166,23 @@
     // is 30 ms past.  If we're on systems where we need to do init,
     // we need to wait up to 30ms for the TPM_ACCESS register to be valid.
     status = tpm_request_use(LOCALITY0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup_device;
     }
 
     status = tpm_wait_for_locality(LOCALITY0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup_device;
     }
 
     // Configure interrupts
     status = tpm_set_irq(LOCALITY0, 10);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup_device;
     }
 
-    status = mx_interrupt_create(get_root_resource(), 10, MX_FLAG_REMAP_IRQ, &irq_handle);
-    if (status != MX_OK) {
+    status = zx_interrupt_create(get_root_resource(), 10, ZX_FLAG_REMAP_IRQ, &irq_handle);
+    if (status != ZX_OK) {
         goto cleanup_device;
     }
 
@@ -200,28 +200,28 @@
     uint8_t buf[32] = { 0 };
     ssize_t bytes_read = tpm_get_random(dev, buf, sizeof(buf));
     if (bytes_read > 0) {
-        mx_cprng_add_entropy(buf, bytes_read);
+        zx_cprng_add_entropy(buf, bytes_read);
         memset(buf, 0, sizeof(buf));
     }
 
-    return MX_OK;
+    return ZX_OK;
 
 cleanup_device:
     if (irq_handle > 0) {
-        mx_handle_close(irq_handle);
+        zx_handle_close(irq_handle);
     }
     device_remove(dev);
     return status;
 #else
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif
 }
 
-static mx_driver_ops_t tpm_driver_ops = {
+static zx_driver_ops_t tpm_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = tpm_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(tpm, tpm_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(tpm)
+ZIRCON_DRIVER_BEGIN(tpm, tpm_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(tpm)
diff --git a/system/dev/misc/tpm/tpm.h b/system/dev/misc/tpm/tpm.h
index c320aae..e70fc98 100644
--- a/system/dev/misc/tpm/tpm.h
+++ b/system/dev/misc/tpm/tpm.h
@@ -4,12 +4,12 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stddef.h>
 #include <stdint.h>
 
 extern void *tpm_base;
-extern mx_handle_t irq_handle;
+extern zx_handle_t irq_handle;
 
 enum locality {
     LOCALITY0,
@@ -35,20 +35,20 @@
     TPM_RETRY = 0x800,
 };
 
-mx_status_t tpm_set_irq(enum locality loc, uint8_t vector);
-mx_status_t tpm_enable_irq_type(enum locality loc, enum irq_type type);
-mx_status_t tpm_disable_irq_type(enum locality loc, enum irq_type type);
+zx_status_t tpm_set_irq(enum locality loc, uint8_t vector);
+zx_status_t tpm_enable_irq_type(enum locality loc, enum irq_type type);
+zx_status_t tpm_disable_irq_type(enum locality loc, enum irq_type type);
 
-// Returns MX_OK if this TPM is supported and returns MX_NOT_SUPPORTED if it is not.
+// Returns ZX_OK if this TPM is supported and returns ZX_NOT_SUPPORTED if it is not.
 // Any other error indicates an issue occurred during detection.
-mx_status_t tpm_is_supported(enum locality loc);
+zx_status_t tpm_is_supported(enum locality loc);
 
 // Request use of the given locality
-mx_status_t tpm_request_use(enum locality loc);
+zx_status_t tpm_request_use(enum locality loc);
 // Wait for actual access to the locality
-mx_status_t tpm_wait_for_locality(enum locality loc);
+zx_status_t tpm_wait_for_locality(enum locality loc);
 
-mx_status_t tpm_send_cmd(enum locality loc, uint8_t* cmd, size_t len);
+zx_status_t tpm_send_cmd(enum locality loc, uint8_t* cmd, size_t len);
 // Returns the total number of bytes in the response, may be less than max_len.
 // If negative, the return value is an error code
 ssize_t tpm_recv_resp(enum locality loc, uint8_t* resp, size_t max_len);
diff --git a/system/dev/serial/bcm-i2c/i2c.c b/system/dev/serial/bcm-i2c/i2c.c
index fee2a01..fed9fce 100644
--- a/system/dev/serial/bcm-i2c/i2c.c
+++ b/system/dev/serial/bcm-i2c/i2c.c
@@ -13,9 +13,9 @@
 #include <ddk/binding.h>
 #include <ddk/protocol/platform-device.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/threads.h>
-#include <magenta/device/i2c.h>
+#include <zircon/syscalls.h>
+#include <zircon/threads.h>
+#include <zircon/device/i2c.h>
 
 #include <bcm/gpio.h>
 #include <bcm/bcm28xx.h>
@@ -29,7 +29,7 @@
 #define GPIO_MMIO   0
 
 typedef struct {
-    mx_device_t*                parent;
+    zx_device_t*                parent;
     platform_device_protocol_t  pdev_proto;
     bcm_i2c_regs_t*             control_regs;
     uint32_t                    dev_id;
@@ -45,57 +45,57 @@
         are a reasonable tradeoff at this time.
 
 */
-static mx_status_t bcm_write_fifo(bcm_i2c_t* ctx, uint8_t* data, uint32_t len){
+static zx_status_t bcm_write_fifo(bcm_i2c_t* ctx, uint8_t* data, uint32_t len){
 
     if (len > BCM_BSC_FIFO_SIZE)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     ctx->control_regs->dlen = (uint32_t)len;
     ctx->control_regs->control = BCM_BSC_CONTROL_ENABLE | BCM_BSC_CONTROL_START;
     for (uint32_t i = 0; i < len; i++)
         ctx->control_regs->fifo = data[i];
 
-    mx_time_t deadline = mx_time_get(MX_CLOCK_MONOTONIC) + MX_MSEC(BCM_FIFO_DEADLINE_MS);
+    zx_time_t deadline = zx_time_get(ZX_CLOCK_MONOTONIC) + ZX_MSEC(BCM_FIFO_DEADLINE_MS);
 
     while( !(ctx->control_regs->status & BCM_BSC_STATUS_DONE) ) {
-        if (mx_time_get(MX_CLOCK_MONOTONIC) > deadline) {
+        if (zx_time_get(ZX_CLOCK_MONOTONIC) > deadline) {
             printf("FIFO write timed out\n");
-            return MX_ERR_TIMED_OUT;
+            return ZX_ERR_TIMED_OUT;
         }
     }
 
     if (ctx->control_regs->status & BCM_BSC_STATUS_ERR) {
         ctx->control_regs->status |= (BCM_BSC_STATUS_ERR | BCM_BSC_STATUS_DONE);
-        return MX_ERR_TIMED_OUT;
+        return ZX_ERR_TIMED_OUT;
     }
 
     ctx->control_regs->status |= BCM_BSC_STATUS_DONE;   //clear the done status
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t bcm_read_fifo(bcm_i2c_t* ctx, uint8_t* data, uint32_t len){
+static zx_status_t bcm_read_fifo(bcm_i2c_t* ctx, uint8_t* data, uint32_t len){
 
     if (len > BCM_BSC_FIFO_SIZE)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     ctx->control_regs->dlen = (uint32_t)len;
     ctx->control_regs->control = BCM_BSC_CONTROL_ENABLE | BCM_BSC_CONTROL_START |
                                  BCM_BSC_CONTROL_READ;
 
-    mx_time_t deadline = mx_time_get(MX_CLOCK_MONOTONIC) + MX_MSEC(BCM_FIFO_DEADLINE_MS);
+    zx_time_t deadline = zx_time_get(ZX_CLOCK_MONOTONIC) + ZX_MSEC(BCM_FIFO_DEADLINE_MS);
 
     while( !(ctx->control_regs->status & BCM_BSC_STATUS_DONE) ){
-        if (mx_time_get(MX_CLOCK_MONOTONIC) > deadline){
+        if (zx_time_get(ZX_CLOCK_MONOTONIC) > deadline){
             printf("FIFO read timed out\n");
-            return MX_ERR_TIMED_OUT;
+            return ZX_ERR_TIMED_OUT;
         }
     }
     if (ctx->control_regs->status & BCM_BSC_STATUS_ERR) {
         for (uint32_t i = 0; i < len; i++)
             data[i] = (uint8_t)0;
         ctx->control_regs->status |= (BCM_BSC_STATUS_ERR | BCM_BSC_STATUS_DONE);
-        return MX_ERR_TIMED_OUT;
+        return ZX_ERR_TIMED_OUT;
     }
 
     ctx->control_regs->status |= BCM_BSC_STATUS_DONE;   //clear the done status
@@ -103,44 +103,44 @@
 
     for (uint32_t i = 0; i < len; i++)
         data[i] = (uint8_t)ctx->control_regs->fifo;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t bcm_i2c_read(void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t bcm_i2c_read(void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
 
     bcm_i2c_t* i2c_ctx = ctx;
-    mx_status_t status = bcm_read_fifo(i2c_ctx,(uint8_t*)buf,(uint32_t)count);
-    if (status == MX_OK) {
+    zx_status_t status = bcm_read_fifo(i2c_ctx,(uint8_t*)buf,(uint32_t)count);
+    if (status == ZX_OK) {
         *actual = count;
     }
     return status;
 }
 
-static mx_status_t bcm_i2c_write(void* ctx, const void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t bcm_i2c_write(void* ctx, const void* buf, size_t count, zx_off_t off, size_t* actual) {
 
     bcm_i2c_t* i2c_ctx = ctx;
 
-    mx_status_t status = bcm_write_fifo(i2c_ctx,(uint8_t*)buf,(uint32_t)count);
+    zx_status_t status = bcm_write_fifo(i2c_ctx,(uint8_t*)buf,(uint32_t)count);
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         *actual = count;
-        return MX_OK;
+        return ZX_OK;
     } else {
         return -1;
     }
 }
 
-static mx_status_t bcm_i2c_set_slave_addr(bcm_i2c_t* ctx, uint16_t address){
+static zx_status_t bcm_i2c_set_slave_addr(bcm_i2c_t* ctx, uint16_t address){
 
     ctx->control_regs->slave_addr = (uint32_t)address;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t bcm_i2c_slave_transfer(bcm_i2c_t* ctx, const void* in_buf, size_t in_len,
+static zx_status_t bcm_i2c_slave_transfer(bcm_i2c_t* ctx, const void* in_buf, size_t in_len,
     void* out_buf, size_t out_len) {
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     uint32_t num_segments=0;
 
 
@@ -151,7 +151,7 @@
         num_segments++;
     }
     if (num_segments >= BCM_MAX_SEGMENTS)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     uint8_t* data =(uint8_t*)&segments[num_segments + 1];   // +1 to skip the end marker
     uint32_t num_writes = 0;
@@ -159,21 +159,21 @@
     for (uint32_t i = 0; i < num_segments; i++ ){
         if (segments[i].type == I2C_SEGMENT_TYPE_WRITE) {
             status = bcm_write_fifo(ctx, &data[num_writes], segments[i].len);
-            if (status != MX_OK)
+            if (status != ZX_OK)
                 return status;
             num_writes += segments[i].len;
         } else if (segments[i].type == I2C_SEGMENT_TYPE_READ) {
             status = bcm_read_fifo(ctx, &((uint8_t*)out_buf)[num_reads], segments[i].len);
-            if (status != MX_OK)
+            if (status != ZX_OK)
                 return status;
             num_reads += segments[i].len;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t bcm_i2c_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
+static zx_status_t bcm_i2c_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
                              void* out_buf, size_t out_len, size_t* out_actual) {
     bcm_i2c_t* i2c_ctx = ctx;
     int ret;
@@ -183,17 +183,17 @@
 
         const i2c_ioctl_add_slave_args_t* args = in_buf;
         if (in_len < sizeof(*args))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
 
         if (args->chip_address_width == 7) {
             ret =  bcm_i2c_set_slave_addr(i2c_ctx,args->chip_address);
         } else {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         break;
     }
     case IOCTL_I2C_BUS_REMOVE_SLAVE: {
-        ret = MX_OK;
+        ret = ZX_OK;
         break;
     }
     case IOCTL_I2C_SLAVE_TRANSFER: {
@@ -201,20 +201,20 @@
         break;
     }
     case IOCTL_I2C_BUS_SET_FREQUENCY: {
-        ret = MX_OK;
+        ret = ZX_OK;
         break;
     }
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    if (ret == MX_OK && out_len > 0 && out_actual) {
+    if (ret == ZX_OK && out_len > 0 && out_actual) {
         *out_actual = out_len;
     }
     return ret;
 }
 
-static mx_protocol_device_t i2c_device_proto = {
+static zx_protocol_device_t i2c_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .read = bcm_i2c_read,
     .write = bcm_i2c_write,
@@ -228,12 +228,12 @@
     bcm_i2c_t* i2c_ctx = (bcm_i2c_t*)arg;
 
     size_t mmio_size;
-    mx_handle_t mmio_handle = MX_HANDLE_INVALID;
-    mx_status_t status = pdev_map_mmio(&i2c_ctx->pdev_proto, i2c_ctx->dev_id,
-                                              MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_handle_t mmio_handle = ZX_HANDLE_INVALID;
+    zx_status_t status = pdev_map_mmio(&i2c_ctx->pdev_proto, i2c_ctx->dev_id,
+                                              ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                               (void **)&i2c_ctx->control_regs, &mmio_size,
                                               &mmio_handle);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         goto i2c_err;
 
     i2c_ctx->control_regs->control = BCM_BSC_CONTROL_ENABLE | BCM_BSC_CONTROL_FIFO_CLEAR;
@@ -252,7 +252,7 @@
 
     status = device_add(i2c_ctx->parent, &args, NULL);
 
-    if (status == MX_OK) return 0;
+    if (status == ZX_OK) return 0;
 
 i2c_err:
     free(i2c_ctx);
@@ -260,12 +260,12 @@
     return -1;
 }
 
-static mx_status_t bootstrap_i2c(mx_device_t* parent, platform_device_protocol_t* pdev_proto,
+static zx_status_t bootstrap_i2c(zx_device_t* parent, platform_device_protocol_t* pdev_proto,
                                  uint32_t dev_id) {
 
     bcm_i2c_t* i2c_ctx = calloc(1, sizeof(*i2c_ctx));
     if (!i2c_ctx)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     i2c_ctx->parent     = parent;
     i2c_ctx->dev_id     = dev_id;
@@ -279,29 +279,29 @@
                                         i2c_bootstrap_thread, i2c_ctx, tid);
     if (thrd_rc != thrd_success) {
         free(i2c_ctx);
-        return thrd_status_to_mx_status(thrd_rc);
+        return thrd_status_to_zx_status(thrd_rc);
     }
     thrd_detach(bootstrap_thrd);
-    return MX_OK;
+    return ZX_OK;
 }
 
 
-static mx_status_t i2c_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t i2c_bind(void* ctx, zx_device_t* parent, void** cookie) {
     platform_device_protocol_t pdev;
 
-    mx_status_t ret = device_get_protocol(parent, MX_PROTOCOL_PLATFORM_DEV, &pdev);
-    if (ret != MX_OK) {
-        printf("i2c_bind can't find MX_PROTOCOL_PLATFORM_DEV\n");
+    zx_status_t ret = device_get_protocol(parent, ZX_PROTOCOL_PLATFORM_DEV, &pdev);
+    if (ret != ZX_OK) {
+        printf("i2c_bind can't find ZX_PROTOCOL_PLATFORM_DEV\n");
         return ret;
     }
 
     bcm_gpio_ctrl_t* gpio_regs;
     // Carve out some address space for the device -- it's memory mapped.
     size_t mmio_size;
-    mx_handle_t mmio_handle = MX_HANDLE_INVALID;
-    mx_status_t status = pdev_map_mmio(&pdev, GPIO_MMIO, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_handle_t mmio_handle = ZX_HANDLE_INVALID;
+    zx_status_t status = pdev_map_mmio(&pdev, GPIO_MMIO, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                             (void **)&gpio_regs, &mmio_size, &mmio_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("i2c_bind: pdev_map_mmio failed: %d\n", status);
         return status;
     }
@@ -315,13 +315,13 @@
 
 
     status = bootstrap_i2c(parent, &pdev, 0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         ret = status;
         printf("Failed to initialize i2c0\n");
     }
 
     status = bootstrap_i2c(parent, &pdev, 1);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         ret = status;
         printf("Failed to initialize i2c1\n");
     }
@@ -329,13 +329,13 @@
     return ret;
 }
 
-static mx_driver_ops_t bcm_i2c_driver_ops = {
+static zx_driver_ops_t bcm_i2c_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = i2c_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(bcm_i2c, bcm_i2c_driver_ops, "magenta", "0.1", 3)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PLATFORM_DEV),
+ZIRCON_DRIVER_BEGIN(bcm_i2c, bcm_i2c_driver_ops, "zircon", "0.1", 3)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PLATFORM_DEV),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_VID, PDEV_VID_BROADCOMM),
     BI_MATCH_IF(EQ, BIND_PLATFORM_DEV_DID, PDEV_DID_BROADCOMM_I2C),
-MAGENTA_DRIVER_END(bcm_i2c)
+ZIRCON_DRIVER_END(bcm_i2c)
diff --git a/system/dev/serial/bcm-i2c/rules.mk b/system/dev/serial/bcm-i2c/rules.mk
index 9f7f234..b039498 100644
--- a/system/dev/serial/bcm-i2c/rules.mk
+++ b/system/dev/serial/bcm-i2c/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/bcm
 
-MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/magenta system/ulib/mxio
+MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/zircon system/ulib/fdio
 
 include make/module.mk
diff --git a/system/dev/serial/intel-serialio/dma/dma.c b/system/dev/serial/intel-serialio/dma/dma.c
index ca06efd..0426bcd 100644
--- a/system/dev/serial/intel-serialio/dma/dma.c
+++ b/system/dev/serial/intel-serialio/dma/dma.c
@@ -5,11 +5,11 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <intel-serialio/serialio.h>
 
-mx_status_t intel_serialio_bind_dma(mx_device_t* dev) {
+zx_status_t intel_serialio_bind_dma(zx_device_t* dev) {
     // Not implemented yet.
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
diff --git a/system/dev/serial/intel-serialio/i2c/controller.c b/system/dev/serial/intel-serialio/i2c/controller.c
index d2e1472..5cc73a9 100644
--- a/system/dev/serial/intel-serialio/i2c/controller.c
+++ b/system/dev/serial/intel-serialio/i2c/controller.c
@@ -11,10 +11,10 @@
 #include <hw/pci.h>
 #include <intel-serialio/reg.h>
 #include <intel-serialio/serialio.h>
-#include <magenta/device/i2c.h>
-#include <magenta/listnode.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/device/i2c.h>
+#include <zircon/listnode.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -36,9 +36,9 @@
 #define DEFAULT_TX_FIFO_TRIGGER_LEVEL 8
 
 // Signals used on the controller's event_handle
-#define RX_FULL_SIGNAL MX_USER_SIGNAL_0
-#define TX_EMPTY_SIGNAL MX_USER_SIGNAL_1
-#define STOP_DETECT_SIGNAL MX_USER_SIGNAL_2
+#define RX_FULL_SIGNAL ZX_USER_SIGNAL_0
+#define TX_EMPTY_SIGNAL ZX_USER_SIGNAL_1
+#define STOP_DETECT_SIGNAL ZX_USER_SIGNAL_2
 
 // Implement the functionality of the i2c bus device.
 
@@ -46,7 +46,7 @@
     return ((1 << width) - 1);
 }
 
-static mx_status_t intel_serialio_i2c_find_slave(
+static zx_status_t intel_serialio_i2c_find_slave(
     intel_serialio_i2c_slave_device_t** slave,
     intel_serialio_i2c_device_t* device, uint16_t address) {
     assert(slave);
@@ -55,19 +55,19 @@
                           intel_serialio_i2c_slave_device_t,
                           slave_list_node) {
         if ((*slave)->chip_address == address)
-            return MX_OK;
+            return ZX_OK;
     }
 
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
-static mx_status_t intel_serialio_i2c_add_slave(
+static zx_status_t intel_serialio_i2c_add_slave(
     intel_serialio_i2c_device_t* device, uint8_t width, uint16_t address) {
-    mx_status_t status;
+    zx_status_t status;
 
     if ((width != I2C_7BIT_ADDRESS && width != I2C_10BIT_ADDRESS) ||
         (address & ~chip_addr_mask(width)) != 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     intel_serialio_i2c_slave_device_t* slave;
@@ -76,17 +76,17 @@
 
     // Make sure a slave with the given address doesn't already exist.
     status = intel_serialio_i2c_find_slave(&slave, device, address);
-    if (status == MX_OK) {
-        status = MX_ERR_ALREADY_EXISTS;
+    if (status == ZX_OK) {
+        status = ZX_ERR_ALREADY_EXISTS;
     }
-    if (status != MX_ERR_NOT_FOUND) {
+    if (status != ZX_ERR_NOT_FOUND) {
         mtx_unlock(&device->mutex);
         return status;
     }
 
     slave = calloc(1, sizeof(*slave));
     if (!slave) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         mtx_unlock(&device->mutex);
         return status;
     }
@@ -103,25 +103,25 @@
 
     // Retrieve pci_config (again)
     pci_protocol_t pci;
-    status = device_get_protocol(device->pcidev, MX_PROTOCOL_PCI, &pci);
-    if (status != MX_OK) {
+    status = device_get_protocol(device->pcidev, ZX_PROTOCOL_PCI, &pci);
+    if (status != ZX_OK) {
         goto fail2;
     }
 
     const pci_config_t* pci_config;
     size_t config_size;
-    mx_handle_t config_handle;
-    status = pci_map_resource(&pci, PCI_RESOURCE_CONFIG, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_handle_t config_handle;
+    status = pci_map_resource(&pci, PCI_RESOURCE_CONFIG, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                               (void**)&pci_config, &config_size, &config_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("i2c: failed to map pci config: %d\n", status);
         goto fail2;
     }
 
     int count = 0;
-    slave->props[count++] = (mx_device_prop_t){BIND_PCI_VID, 0, pci_config->vendor_id};
-    slave->props[count++] = (mx_device_prop_t){BIND_PCI_DID, 0, pci_config->device_id};
-    slave->props[count++] = (mx_device_prop_t){BIND_I2C_ADDR, 0, address};
+    slave->props[count++] = (zx_device_prop_t){BIND_PCI_VID, 0, pci_config->vendor_id};
+    slave->props[count++] = (zx_device_prop_t){BIND_PCI_DID, 0, pci_config->device_id};
+    slave->props[count++] = (zx_device_prop_t){BIND_I2C_ADDR, 0, address};
 
     char name[sizeof(address) * 2 + 2] = {
             [sizeof(name) - 1] = '\0',
@@ -138,14 +138,14 @@
     };
 
     status = device_add(device->mxdev, &args, &slave->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail1;
     }
 
-    return MX_OK;
+    return ZX_OK;
 
 fail1:
-    mx_handle_close(config_handle);
+    zx_handle_close(config_handle);
 fail2:
     mtx_lock(&device->mutex);
     list_delete(&slave->slave_list_node);
@@ -154,13 +154,13 @@
     return status;
 }
 
-static mx_status_t intel_serialio_i2c_remove_slave(
+static zx_status_t intel_serialio_i2c_remove_slave(
     intel_serialio_i2c_device_t* device, uint8_t width, uint16_t address) {
-    mx_status_t status;
+    zx_status_t status;
 
     if ((width != I2C_7BIT_ADDRESS && width != I2C_10BIT_ADDRESS) ||
         (address & ~chip_addr_mask(width)) != 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     intel_serialio_i2c_slave_device_t* slave;
@@ -173,7 +173,7 @@
         goto remove_slave_finish;
     if (slave->chip_address_width != width) {
         xprintf("Chip address width mismatch.\n");
-        status = MX_ERR_NOT_FOUND;
+        status = ZX_ERR_NOT_FOUND;
         goto remove_slave_finish;
     }
 
@@ -225,7 +225,7 @@
     return low_count / 1000000 - 1;
 }
 
-static mx_status_t intel_serialio_configure_bus_timing(
+static zx_status_t intel_serialio_configure_bus_timing(
     intel_serialio_i2c_device_t* device) {
 
     uint32_t clock_frequency = device->controller_freq;
@@ -243,25 +243,25 @@
     // Make sure the counts are within bounds.
     if (fs_hcnt >= (1 << 16) || fs_hcnt < 6 ||
         fs_lcnt >= (1 << 16) || fs_lcnt < 8) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     if (ss_hcnt >= (1 << 16) || ss_hcnt < 6 ||
         ss_lcnt >= (1 << 16) || ss_lcnt < 8) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
 
     RMWREG32(&device->regs->fs_scl_hcnt, 0, 16, fs_hcnt);
     RMWREG32(&device->regs->fs_scl_lcnt, 0, 16, fs_lcnt);
     RMWREG32(&device->regs->ss_scl_hcnt, 0, 16, ss_hcnt);
     RMWREG32(&device->regs->ss_scl_lcnt, 0, 16, ss_lcnt);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t intel_serialio_i2c_set_bus_frequency(intel_serialio_i2c_device_t* device,
+static zx_status_t intel_serialio_i2c_set_bus_frequency(intel_serialio_i2c_device_t* device,
                                                         uint32_t frequency) {
     if (frequency != I2C_MAX_FAST_SPEED_HZ &&
         frequency != I2C_MAX_STANDARD_SPEED_HZ) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     mtx_lock(&device->mutex);
@@ -274,10 +274,10 @@
     RMWREG32(&device->regs->ctl, CTL_SPEED, 2, speed);
     mtx_unlock(&device->mutex);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t intel_serialio_i2c_ioctl(
+static zx_status_t intel_serialio_i2c_ioctl(
     void* ctx, uint32_t op, const void* in_buf, size_t in_len,
     void* out_buf, size_t out_len, size_t* out_actual) {
     intel_serialio_i2c_device_t* device = ctx;
@@ -285,7 +285,7 @@
     case IOCTL_I2C_BUS_ADD_SLAVE: {
         const i2c_ioctl_add_slave_args_t* args = in_buf;
         if (in_len < sizeof(*args))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
 
         return intel_serialio_i2c_add_slave(device, args->chip_address_width,
                                             args->chip_address);
@@ -293,7 +293,7 @@
     case IOCTL_I2C_BUS_REMOVE_SLAVE: {
         const i2c_ioctl_remove_slave_args_t* args = in_buf;
         if (in_len < sizeof(*args))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
 
         return intel_serialio_i2c_remove_slave(device, args->chip_address_width,
                                               args->chip_address);
@@ -301,21 +301,21 @@
     case IOCTL_I2C_BUS_SET_FREQUENCY: {
         const i2c_ioctl_set_bus_frequency_args_t* args = in_buf;
         if (in_len < sizeof(*args)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         intel_serialio_i2c_set_bus_frequency(device, args->frequency);
     }
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
 static int intel_serialio_i2c_irq_thread(void* arg) {
     intel_serialio_i2c_device_t* dev = (intel_serialio_i2c_device_t*)arg;
-    mx_status_t status;
+    zx_status_t status;
     for (;;) {
-        status = mx_interrupt_wait(dev->irq_handle);
-        if (status != MX_OK) {
+        status = zx_interrupt_wait(dev->irq_handle);
+        if (status != ZX_OK) {
             xprintf("i2c: error waiting for interrupt: %d\n", status);
             continue;
         }
@@ -334,7 +334,7 @@
         }
         if (intr_stat & (1u << INTR_RX_FULL)) {
             mtx_lock(&dev->irq_mask_mutex);
-            mx_object_signal(dev->event_handle, 0, RX_FULL_SIGNAL);
+            zx_object_signal(dev->event_handle, 0, RX_FULL_SIGNAL);
             RMWREG32(&dev->regs->intr_mask, INTR_RX_FULL, 1, 0);
             mtx_unlock(&dev->irq_mask_mutex);
         }
@@ -345,7 +345,7 @@
         }
         if (intr_stat & (1u << INTR_TX_EMPTY)) {
             mtx_lock(&dev->irq_mask_mutex);
-            mx_object_signal(dev->event_handle, 0, TX_EMPTY_SIGNAL);
+            zx_object_signal(dev->event_handle, 0, TX_EMPTY_SIGNAL);
             RMWREG32(&dev->regs->intr_mask, INTR_TX_EMPTY, 1, 0);
             mtx_unlock(&dev->irq_mask_mutex);
         }
@@ -357,7 +357,7 @@
             __builtin_trap();
         }
         if (intr_stat & (1u << INTR_STOP_DETECTION)) {
-            mx_object_signal(dev->event_handle, 0, STOP_DETECT_SIGNAL);
+            zx_object_signal(dev->event_handle, 0, STOP_DETECT_SIGNAL);
             *REG32(&dev->regs->clr_stop_det);
         }
         if (intr_stat & (1u << INTR_START_DETECTION)) {
@@ -368,48 +368,48 @@
             __builtin_trap();
         }
 
-        mx_interrupt_complete(dev->irq_handle);
+        zx_interrupt_complete(dev->irq_handle);
     }
     return 0;
 }
 
-mx_status_t intel_serialio_i2c_wait_for_rx_full(
+zx_status_t intel_serialio_i2c_wait_for_rx_full(
     intel_serialio_i2c_device_t* controller,
-    mx_time_t deadline) {
+    zx_time_t deadline) {
 
-    return mx_object_wait_one(controller->event_handle, RX_FULL_SIGNAL, deadline, NULL);
+    return zx_object_wait_one(controller->event_handle, RX_FULL_SIGNAL, deadline, NULL);
 }
 
-mx_status_t intel_serialio_i2c_wait_for_tx_empty(
+zx_status_t intel_serialio_i2c_wait_for_tx_empty(
     intel_serialio_i2c_device_t* controller,
-    mx_time_t deadline) {
+    zx_time_t deadline) {
 
-    return mx_object_wait_one(controller->event_handle, TX_EMPTY_SIGNAL, deadline, NULL);
+    return zx_object_wait_one(controller->event_handle, TX_EMPTY_SIGNAL, deadline, NULL);
 }
 
-mx_status_t intel_serialio_i2c_wait_for_stop_detect(
+zx_status_t intel_serialio_i2c_wait_for_stop_detect(
     intel_serialio_i2c_device_t* controller,
-    mx_time_t deadline) {
+    zx_time_t deadline) {
 
-    return mx_object_wait_one(controller->event_handle, STOP_DETECT_SIGNAL,
+    return zx_object_wait_one(controller->event_handle, STOP_DETECT_SIGNAL,
                               deadline, NULL);
 }
 
-mx_status_t intel_serialio_i2c_clear_stop_detect(intel_serialio_i2c_device_t* controller) {
-    return mx_object_signal(controller->event_handle, STOP_DETECT_SIGNAL, 0);
+zx_status_t intel_serialio_i2c_clear_stop_detect(intel_serialio_i2c_device_t* controller) {
+    return zx_object_signal(controller->event_handle, STOP_DETECT_SIGNAL, 0);
 }
 
 // Perform a write to the DATA_CMD register, and clear
 // interrupt masks as appropriate
-mx_status_t intel_serialio_i2c_issue_rx(
+zx_status_t intel_serialio_i2c_issue_rx(
     intel_serialio_i2c_device_t* controller,
     uint32_t data_cmd) {
 
     *REG32(&controller->regs->data_cmd) = data_cmd;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t intel_serialio_i2c_read_rx(
+zx_status_t intel_serialio_i2c_read_rx(
     intel_serialio_i2c_device_t* controller,
     uint8_t* data) {
 
@@ -422,15 +422,15 @@
     // and unmask the interrupt.
     if (rxflr < rx_tl) {
         mtx_lock(&controller->irq_mask_mutex);
-        mx_status_t status = mx_object_signal(controller->event_handle, RX_FULL_SIGNAL, 0);
+        zx_status_t status = zx_object_signal(controller->event_handle, RX_FULL_SIGNAL, 0);
         RMWREG32(&controller->regs->intr_mask, INTR_RX_FULL, 1, 1);
         mtx_unlock(&controller->irq_mask_mutex);
         return status;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t intel_serialio_i2c_issue_tx(
+zx_status_t intel_serialio_i2c_issue_tx(
     intel_serialio_i2c_device_t* controller,
     uint32_t data_cmd) {
 
@@ -442,12 +442,12 @@
     // and unmask the interrupt.
     if (txflr > tx_tl) {
         mtx_lock(&controller->irq_mask_mutex);
-        mx_status_t status = mx_object_signal(controller->event_handle, TX_EMPTY_SIGNAL, 0);
+        zx_status_t status = zx_object_signal(controller->event_handle, TX_EMPTY_SIGNAL, 0);
         RMWREG32(&controller->regs->intr_mask, INTR_TX_EMPTY, 1, 1);
         mtx_unlock(&controller->irq_mask_mutex);
         return status;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 void intel_serialio_i2c_get_rx_fifo_threshold(
@@ -458,16 +458,16 @@
 }
 
 // Get an RX interrupt whenever the RX FIFO size is >= the threshold.
-mx_status_t intel_serialio_i2c_set_rx_fifo_threshold(
+zx_status_t intel_serialio_i2c_set_rx_fifo_threshold(
     intel_serialio_i2c_device_t* controller,
     uint32_t threshold) {
 
     if (threshold - 1 > UINT8_MAX) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     RMWREG32(&controller->regs->rx_tl, 0, 8, threshold - 1);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void intel_serialio_i2c_get_tx_fifo_threshold(
@@ -478,38 +478,38 @@
 }
 
 // Get a TX interrupt whenever the TX FIFO size is <= the threshold.
-mx_status_t intel_serialio_i2c_set_tx_fifo_threshold(
+zx_status_t intel_serialio_i2c_set_tx_fifo_threshold(
     intel_serialio_i2c_device_t* controller,
     uint32_t threshold) {
 
     if (threshold - 1 > UINT8_MAX) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     RMWREG32(&controller->regs->tx_tl, 0, 8, threshold - 1);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void intel_serialio_i2c_release(void* ctx) {
     intel_serialio_i2c_device_t* dev = ctx;
-    mx_handle_close(dev->regs_handle);
-    mx_handle_close(dev->irq_handle);
-    mx_handle_close(dev->event_handle);
+    zx_handle_close(dev->regs_handle);
+    zx_handle_close(dev->irq_handle);
+    zx_handle_close(dev->event_handle);
 
     // TODO: Handle joining the irq thread
     free(dev);
 }
 
-static mx_protocol_device_t intel_serialio_i2c_device_proto = {
+static zx_protocol_device_t intel_serialio_i2c_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = intel_serialio_i2c_ioctl,
     .release = intel_serialio_i2c_release,
 };
 
 // The controller lock should already be held when entering this function.
-mx_status_t intel_serialio_i2c_reset_controller(
+zx_status_t intel_serialio_i2c_reset_controller(
     intel_serialio_i2c_device_t* device) {
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     // The register will only return valid values if the ACPI _PS0 has been
     // evaluated.
@@ -525,7 +525,7 @@
         }
         if (!retry) {
             printf("i2c-controller: timed out waiting for device idle\n");
-            return MX_ERR_TIMED_OUT;
+            return ZX_ERR_TIMED_OUT;
         }
     }
 
@@ -560,18 +560,18 @@
     *REG32(&device->regs->intr_mask) = 0;
 
     status = intel_serialio_i2c_set_rx_fifo_threshold(device, DEFAULT_RX_FIFO_TRIGGER_LEVEL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup;
     }
     status = intel_serialio_i2c_set_tx_fifo_threshold(device, DEFAULT_TX_FIFO_TRIGGER_LEVEL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup;
     }
 
     // Clear the signals
-    status = mx_object_signal(device->event_handle,
+    status = zx_object_signal(device->event_handle,
                               RX_FULL_SIGNAL | TX_EMPTY_SIGNAL | STOP_DETECT_SIGNAL, 0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto cleanup;
     }
 
@@ -588,7 +588,7 @@
     return status;
 }
 
-static mx_status_t intel_serialio_i2c_device_specific_init(
+static zx_status_t intel_serialio_i2c_device_specific_init(
     intel_serialio_i2c_device_t* device,
     const pci_config_t* pci_config) {
 
@@ -633,21 +633,21 @@
             device->controller_freq = dev_props[i].controller_clock_frequency;
             device->soft_reset = (void*)device->regs +
                                  dev_props[i].reset_offset;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t intel_serialio_bind_i2c(mx_device_t* dev) {
+zx_status_t intel_serialio_bind_i2c(zx_device_t* dev) {
     pci_protocol_t pci;
-    if (device_get_protocol(dev, MX_PROTOCOL_PCI, &pci))
-        return MX_ERR_NOT_SUPPORTED;
+    if (device_get_protocol(dev, ZX_PROTOCOL_PCI, &pci))
+        return ZX_ERR_NOT_SUPPORTED;
 
     intel_serialio_i2c_device_t* device = calloc(1, sizeof(*device));
     if (!device)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     list_initialize(&device->slave_list);
     mtx_init(&device->mutex, mtx_plain);
@@ -656,25 +656,25 @@
 
     const pci_config_t* pci_config;
     size_t config_size;
-    mx_handle_t config_handle;
-    mx_status_t status = pci_map_resource(&pci, PCI_RESOURCE_CONFIG,
-                                          MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_handle_t config_handle;
+    zx_status_t status = pci_map_resource(&pci, PCI_RESOURCE_CONFIG,
+                                          ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                           (void**)&pci_config, &config_size,
                                           &config_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("i2c: failed to map pci config: %d\n", status);
         goto fail;
     }
 
-    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                               (void**)&device->regs, &device->regs_size, &device->regs_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("i2c: failed to mape pci bar 0: %d\n", status);
         goto fail;
     }
 
     // set msi irq mode
-    status = pci_set_irq_mode(&pci, MX_PCIE_IRQ_MODE_LEGACY, 1);
+    status = pci_set_irq_mode(&pci, ZX_PCIE_IRQ_MODE_LEGACY, 1);
     if (status < 0) {
         xprintf("i2c: failed to set irq mode: %d\n", status);
         goto fail;
@@ -682,13 +682,13 @@
 
     // get irq handle
     status = pci_map_interrupt(&pci, 0, &device->irq_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("i2c: failed to get irq handle: %d\n", status);
         goto fail;
     }
 
-    status = mx_event_create(0, &device->event_handle);
-    if (status != MX_OK) {
+    status = zx_event_create(0, &device->event_handle);
+    if (status != ZX_OK) {
         xprintf("i2c: failed to create event handle: %d\n", status);
         goto fail;
     }
@@ -713,7 +713,7 @@
     if (status < 0)
         goto fail;
 
-    char name[MX_DEVICE_NAME_MAX];
+    char name[ZX_DEVICE_NAME_MAX];
     snprintf(name, sizeof(name), "i2c-bus-%04x", pci_config->device_id);
 
    device_add_args_t args = {
@@ -754,19 +754,19 @@
         intel_serialio_i2c_add_slave(device, I2C_7BIT_ADDRESS, 0x0049);
     }
 
-    mx_handle_close(config_handle);
-    return MX_OK;
+    zx_handle_close(config_handle);
+    return ZX_OK;
 
 fail:
     // TODO: Handle joining the irq thread
-    if (device->regs_handle != MX_HANDLE_INVALID)
-        mx_handle_close(device->regs_handle);
-    if (device->irq_handle != MX_HANDLE_INVALID)
-        mx_handle_close(device->irq_handle);
-    if (device->event_handle != MX_HANDLE_INVALID)
-        mx_handle_close(device->event_handle);
+    if (device->regs_handle != ZX_HANDLE_INVALID)
+        zx_handle_close(device->regs_handle);
+    if (device->irq_handle != ZX_HANDLE_INVALID)
+        zx_handle_close(device->irq_handle);
+    if (device->event_handle != ZX_HANDLE_INVALID)
+        zx_handle_close(device->event_handle);
     if (config_handle)
-        mx_handle_close(config_handle);
+        zx_handle_close(config_handle);
     free(device);
 
     return status;
diff --git a/system/dev/serial/intel-serialio/i2c/controller.h b/system/dev/serial/intel-serialio/i2c/controller.h
index 01ba9d2..033f056 100644
--- a/system/dev/serial/intel-serialio/i2c/controller.h
+++ b/system/dev/serial/intel-serialio/i2c/controller.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stdint.h>
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 #include <threads.h>
 
 typedef struct __attribute__((packed)) intel_serialio_i2c_regs {
@@ -124,18 +124,18 @@
 };
 
 typedef struct intel_serialio_i2c_device {
-    mx_device_t* mxdev;
-    mx_device_t* pcidev;
+    zx_device_t* mxdev;
+    zx_device_t* pcidev;
 
     intel_serialio_i2c_regs* regs;
     volatile uint32_t* soft_reset;
 
     uint64_t regs_size;
-    mx_handle_t regs_handle;
+    zx_handle_t regs_handle;
 
     thrd_t irq_thread;
-    mx_handle_t irq_handle;
-    mx_handle_t event_handle;
+    zx_handle_t irq_handle;
+    zx_handle_t event_handle;
 
     uint32_t controller_freq;
     uint32_t bus_freq;
@@ -146,43 +146,43 @@
     mtx_t irq_mask_mutex;
 } intel_serialio_i2c_device_t;
 
-mx_status_t intel_serialio_i2c_reset_controller(
+zx_status_t intel_serialio_i2c_reset_controller(
     intel_serialio_i2c_device_t* controller);
 
-mx_status_t intel_serialio_i2c_wait_for_rx_full(
+zx_status_t intel_serialio_i2c_wait_for_rx_full(
     intel_serialio_i2c_device_t* controller,
-    mx_time_t deadline);
-mx_status_t intel_serialio_i2c_wait_for_tx_empty(
+    zx_time_t deadline);
+zx_status_t intel_serialio_i2c_wait_for_tx_empty(
     intel_serialio_i2c_device_t* controller,
-    mx_time_t deadline);
-mx_status_t intel_serialio_i2c_wait_for_stop_detect(
+    zx_time_t deadline);
+zx_status_t intel_serialio_i2c_wait_for_stop_detect(
     intel_serialio_i2c_device_t* controller,
-    mx_time_t deadline);
+    zx_time_t deadline);
 
 // Acts on the DATA_CMD register, and clear
 // interrupt masks as appropriate
-mx_status_t intel_serialio_i2c_issue_rx(
+zx_status_t intel_serialio_i2c_issue_rx(
     intel_serialio_i2c_device_t* controller,
     uint32_t data_cmd);
-mx_status_t intel_serialio_i2c_read_rx(
+zx_status_t intel_serialio_i2c_read_rx(
     intel_serialio_i2c_device_t* controller,
     uint8_t* data);
-mx_status_t intel_serialio_i2c_issue_tx(
+zx_status_t intel_serialio_i2c_issue_tx(
     intel_serialio_i2c_device_t* controller,
     uint32_t data_cmd);
-mx_status_t intel_serialio_i2c_clear_stop_detect(
+zx_status_t intel_serialio_i2c_clear_stop_detect(
     intel_serialio_i2c_device_t* controller);
 
 void intel_serialio_i2c_get_rx_fifo_threshold(
     intel_serialio_i2c_device_t* controller,
     uint32_t* threshold);
-mx_status_t intel_serialio_i2c_set_rx_fifo_threshold(
+zx_status_t intel_serialio_i2c_set_rx_fifo_threshold(
     intel_serialio_i2c_device_t* controller,
     uint32_t threshold);
 
 void intel_serialio_i2c_get_tx_fifo_threshold(
     intel_serialio_i2c_device_t* controller,
     uint32_t* threshold);
-mx_status_t intel_serialio_i2c_set_tx_fifo_threshold(
+zx_status_t intel_serialio_i2c_set_tx_fifo_threshold(
     intel_serialio_i2c_device_t* controller,
     uint32_t threshold);
diff --git a/system/dev/serial/intel-serialio/i2c/slave.c b/system/dev/serial/intel-serialio/i2c/slave.c
index 15c61b8..6251c33 100644
--- a/system/dev/serial/intel-serialio/i2c/slave.c
+++ b/system/dev/serial/intel-serialio/i2c/slave.c
@@ -5,9 +5,9 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 #include <intel-serialio/reg.h>
-#include <magenta/types.h>
-#include <magenta/device/i2c.h>
-#include <magenta/listnode.h>
+#include <zircon/types.h>
+#include <zircon/device/i2c.h>
+#include <zircon/listnode.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -17,20 +17,20 @@
 #include "slave.h"
 
 // Time out after 2 seconds.
-static const mx_duration_t timeout_ns = MX_SEC(2);
+static const zx_duration_t timeout_ns = ZX_SEC(2);
 
 //TODO We should be using interrupts during long operations, but
 //the plumbing isn't all there for that apparently.
 #define DO_UNTIL(condition, action, poll_interval)                            \
     ({                                                                        \
-        const mx_time_t deadline = mx_deadline_after(timeout_ns);             \
+        const zx_time_t deadline = zx_deadline_after(timeout_ns);             \
         int wait_for_condition_value;                                         \
         while (!(wait_for_condition_value = !!(condition))) {                 \
-            mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);                  \
+            zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);                  \
             if (now >= deadline)                                              \
                 break;                                                        \
             if (poll_interval)                                                \
-                mx_nanosleep(mx_deadline_after(poll_interval));               \
+                zx_nanosleep(zx_deadline_after(poll_interval));               \
             {action;}                                                         \
         }                                                                     \
         wait_for_condition_value;                                             \
@@ -60,14 +60,14 @@
     return !(*REG32(&controller->regs->i2c_sta) & (0x1 << I2C_STA_RFNE));
 }
 
-static mx_status_t intel_serialio_i2c_slave_transfer(
+static zx_status_t intel_serialio_i2c_slave_transfer(
     intel_serialio_i2c_slave_device_t* slave, i2c_slave_segment_t *segments, int segment_count) {
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     for (int i = 0; i < segment_count; i++) {
         if (segments[i].type != I2C_SEGMENT_TYPE_READ &&
             segments[i].type != I2C_SEGMENT_TYPE_WRITE) {
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             goto transfer_finish_2;
         }
     }
@@ -84,14 +84,14 @@
         tar_add_addr_mode_bit = TAR_ADD_WIDTH_10BIT;
     } else {
         printf("Bad address width.\n");
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
         goto transfer_finish_2;
     }
 
     mtx_lock(&slave->controller->mutex);
 
-    if (!WAIT_FOR(bus_is_idle(controller), MX_USEC(50))) {
-        status = MX_ERR_TIMED_OUT;
+    if (!WAIT_FOR(bus_is_idle(controller), ZX_USEC(50))) {
+        status = ZX_ERR_TIMED_OUT;
         goto transfer_finish_1;
     }
 
@@ -127,8 +127,8 @@
                 // Wait if the TX FIFO is full
                 if (!(*REG32(&controller->regs->i2c_sta) & (0x1 << I2C_STA_TFNF))) {
                     status = intel_serialio_i2c_wait_for_tx_empty(controller,
-                                                                  mx_deadline_after(timeout_ns));
-                    if (status != MX_OK) {
+                                                                  zx_deadline_after(timeout_ns));
+                    if (status != ZX_OK) {
                         goto transfer_finish_1;
                     }
                 }
@@ -142,7 +142,7 @@
             default:
                 // shouldn't be reachable
                 printf("invalid i2c segment type: %d\n", segments->type);
-                status = MX_ERR_INVALID_ARGS;
+                status = ZX_ERR_INVALID_ARGS;
                 goto transfer_finish_1;
             }
 
@@ -158,7 +158,7 @@
             } else {
                 __builtin_trap();
             }
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 goto transfer_finish_1;
             }
 
@@ -179,29 +179,29 @@
                         if (len == 0 && outstanding_reads < rx_threshold) {
                             status = intel_serialio_i2c_set_rx_fifo_threshold(controller,
                                                                               outstanding_reads);
-                            if (status != MX_OK) {
+                            if (status != ZX_OK) {
                                 goto transfer_finish_1;
                             }
                         }
 
                         // Wait for the FIFO to get some data.
                         status = intel_serialio_i2c_wait_for_rx_full(controller,
-                                                                     mx_deadline_after(timeout_ns));
-                        if (status != MX_OK) {
+                                                                     zx_deadline_after(timeout_ns));
+                        if (status != ZX_OK) {
                             goto transfer_finish_1;
                         }
 
                         // Restore the RX threshold in case we changed it
                         status = intel_serialio_i2c_set_rx_fifo_threshold(controller,
                                                                           rx_threshold);
-                        if (status != MX_OK) {
+                        if (status != ZX_OK) {
                             goto transfer_finish_1;
                         }
                     }
                 }
 
                 status = intel_serialio_i2c_read_rx(controller, buf);
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     goto transfer_finish_1;
                 }
                 buf++;
@@ -217,24 +217,24 @@
     }
 
     // Clear out the stop detect interrupt signal.
-    status = intel_serialio_i2c_wait_for_stop_detect(controller, mx_deadline_after(timeout_ns));
-    if (status != MX_OK) {
+    status = intel_serialio_i2c_wait_for_stop_detect(controller, zx_deadline_after(timeout_ns));
+    if (status != ZX_OK) {
         goto transfer_finish_1;
     }
     status = intel_serialio_i2c_clear_stop_detect(controller);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto transfer_finish_1;
     }
 
-    if (!WAIT_FOR(bus_is_idle(controller), MX_USEC(50))) {
-        status = MX_ERR_TIMED_OUT;
+    if (!WAIT_FOR(bus_is_idle(controller), ZX_USEC(50))) {
+        status = ZX_ERR_TIMED_OUT;
         goto transfer_finish_1;
     }
 
     // Read the data_cmd register to pull data out of the RX FIFO.
     if (!DO_UNTIL(rx_fifo_empty(controller),
                   *REG32(&controller->regs->data_cmd), 0)) {
-        status = MX_ERR_TIMED_OUT;
+        status = ZX_ERR_TIMED_OUT;
         goto transfer_finish_1;
     }
 
@@ -249,40 +249,40 @@
 
 // Implement the char protocol for the slave devices.
 
-static mx_status_t intel_serialio_i2c_slave_read(
-    void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t intel_serialio_i2c_slave_read(
+    void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
     intel_serialio_i2c_slave_device_t* slave = ctx;
     i2c_slave_segment_t segment = {
         .type = I2C_SEGMENT_TYPE_READ,
         .buf = buf,
         .len = count,
     };
-    mx_status_t status = intel_serialio_i2c_slave_transfer(slave, &segment, 1);
-    if (status == MX_OK) {
+    zx_status_t status = intel_serialio_i2c_slave_transfer(slave, &segment, 1);
+    if (status == ZX_OK) {
         *actual = count;
     }
     return status;
 }
 
-static mx_status_t intel_serialio_i2c_slave_write(
-    void* ctx, const void* buf, size_t count, mx_off_t off, size_t* actual) {
+static zx_status_t intel_serialio_i2c_slave_write(
+    void* ctx, const void* buf, size_t count, zx_off_t off, size_t* actual) {
     intel_serialio_i2c_slave_device_t* slave = ctx;
     i2c_slave_segment_t segment = {
         .type = I2C_SEGMENT_TYPE_WRITE,
         .buf = (void*)buf,
         .len = count,
     };
-    mx_status_t status = intel_serialio_i2c_slave_transfer(slave, &segment, 1);
-    if (status == MX_OK) {
+    zx_status_t status = intel_serialio_i2c_slave_transfer(slave, &segment, 1);
+    if (status == ZX_OK) {
         *actual = count;
     }
     return status;
 }
 
-static mx_status_t intel_serialio_i2c_slave_transfer_ioctl(
+static zx_status_t intel_serialio_i2c_slave_transfer_ioctl(
     intel_serialio_i2c_slave_device_t* slave, uint32_t op, const void* in_buf, size_t in_len,
     void* out_buf, size_t out_len, size_t* out_actual) {
-    mx_status_t status;
+    zx_status_t status;
     const size_t base_size = sizeof(i2c_slave_ioctl_segment_t);
 
     size_t read_len = 0;
@@ -299,7 +299,7 @@
             break;
         }
         if ((void*)((uint8_t*)ioctl_segment + base_size) > end) {
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             goto slave_transfer_ioctl_finish_2;
         }
 
@@ -317,11 +317,11 @@
         segment_count++;
     }
     if ((void*)((uint8_t*)ioctl_segment + write_len) != end) {
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
         goto slave_transfer_ioctl_finish_2;
     }
     if (out_len < read_len) {
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
         goto slave_transfer_ioctl_finish_2;
     }
     uint8_t* data = (uint8_t*)ioctl_segment;
@@ -330,7 +330,7 @@
     i2c_slave_segment_t* segments =
         calloc(segment_count, sizeof(*segments));
     if (!segments) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto slave_transfer_ioctl_finish_2;
     }
     i2c_slave_segment_t* cur_segment = segments;
@@ -354,7 +354,7 @@
             break;
         default:
             // invalid segment type
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             goto slave_transfer_ioctl_finish_1;
             break;
         }
@@ -364,7 +364,7 @@
     }
 
     status = intel_serialio_i2c_slave_transfer(slave, segments, segment_count);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         *out_actual = read_len;
     }
 
@@ -374,7 +374,7 @@
     return status;
 }
 
-static mx_status_t intel_serialio_i2c_slave_ioctl(
+static zx_status_t intel_serialio_i2c_slave_ioctl(
     void* ctx, uint32_t op, const void* in_buf, size_t in_len,
     void* out_buf, size_t out_len, size_t* out_actual) {
     intel_serialio_i2c_slave_device_t* slave = ctx;
@@ -384,7 +384,7 @@
             slave, op, in_buf, in_len, out_buf, out_len, out_actual);
         break;
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
@@ -395,7 +395,7 @@
 
 // Implement the device protocol for the slave devices.
 
-mx_protocol_device_t intel_serialio_i2c_slave_device_proto = {
+zx_protocol_device_t intel_serialio_i2c_slave_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .read = intel_serialio_i2c_slave_read,
     .write = intel_serialio_i2c_slave_write,
diff --git a/system/dev/serial/intel-serialio/i2c/slave.h b/system/dev/serial/intel-serialio/i2c/slave.h
index bb3faec..5324690 100644
--- a/system/dev/serial/intel-serialio/i2c/slave.h
+++ b/system/dev/serial/intel-serialio/i2c/slave.h
@@ -6,21 +6,21 @@
 
 #include <ddk/binding.h>
 #include <ddk/device.h>
-#include <magenta/types.h>
-#include <magenta/listnode.h>
+#include <zircon/types.h>
+#include <zircon/listnode.h>
 #include <stdint.h>
 
 typedef struct intel_serialio_i2c_slave_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     struct intel_serialio_i2c_device* controller;
 
     uint8_t chip_address_width;
     uint16_t chip_address;
 
-    mx_device_prop_t props[3];
+    zx_device_prop_t props[3];
 
     struct list_node slave_list_node;
 } intel_serialio_i2c_slave_device_t;
 
 // device protocol for a slave device
-extern mx_protocol_device_t intel_serialio_i2c_slave_device_proto;
+extern zx_protocol_device_t intel_serialio_i2c_slave_device_proto;
diff --git a/system/dev/serial/intel-serialio/intel-serialio-include/intel-serialio/serialio.h b/system/dev/serial/intel-serialio/intel-serialio-include/intel-serialio/serialio.h
index 1a3b788..a20d02b 100644
--- a/system/dev/serial/intel-serialio/intel-serialio-include/intel-serialio/serialio.h
+++ b/system/dev/serial/intel-serialio/intel-serialio-include/intel-serialio/serialio.h
@@ -7,7 +7,7 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #define INTEL_VID (0x8086)
 #define INTEL_WILDCAT_POINT_SERIALIO_DMA_DID (0x9ce0)
@@ -34,8 +34,8 @@
     } while (0)
 #endif
 
-mx_status_t intel_serialio_bind_dma(mx_device_t* dev);
-mx_status_t intel_serialio_bind_i2c(mx_device_t* dev);
-mx_status_t intel_serialio_bind_sdio(mx_device_t* dev);
-mx_status_t intel_serialio_bind_spi(mx_device_t* dev);
-mx_status_t intel_serialio_bind_uart(mx_device_t* dev);
+zx_status_t intel_serialio_bind_dma(zx_device_t* dev);
+zx_status_t intel_serialio_bind_i2c(zx_device_t* dev);
+zx_status_t intel_serialio_bind_sdio(zx_device_t* dev);
+zx_status_t intel_serialio_bind_spi(zx_device_t* dev);
+zx_status_t intel_serialio_bind_uart(zx_device_t* dev);
diff --git a/system/dev/serial/intel-serialio/rules.mk b/system/dev/serial/intel-serialio/rules.mk
index 1012ced..cb6d300 100644
--- a/system/dev/serial/intel-serialio/rules.mk
+++ b/system/dev/serial/intel-serialio/rules.mk
@@ -23,7 +23,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/dev/serial/intel-serialio/sdio/sdio.c b/system/dev/serial/intel-serialio/sdio/sdio.c
index 23242af..17bbda9 100644
--- a/system/dev/serial/intel-serialio/sdio/sdio.c
+++ b/system/dev/serial/intel-serialio/sdio/sdio.c
@@ -5,11 +5,11 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <intel-serialio/serialio.h>
 
-mx_status_t intel_serialio_bind_sdio(mx_device_t* dev) {
+zx_status_t intel_serialio_bind_sdio(zx_device_t* dev) {
     // Not implemented yet.
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
diff --git a/system/dev/serial/intel-serialio/serialio.c b/system/dev/serial/intel-serialio/serialio.c
index f4583fd..d7321ed 100644
--- a/system/dev/serial/intel-serialio/serialio.c
+++ b/system/dev/serial/intel-serialio/serialio.c
@@ -6,29 +6,29 @@
 #include <ddk/protocol/pci.h>
 #include <hw/pci.h>
 
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #include <stdio.h>
 
 #include <intel-serialio/serialio.h>
 
-static mx_status_t intel_serialio_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t intel_serialio_bind(void* ctx, zx_device_t* dev, void** cookie) {
     pci_protocol_t pci;
-    mx_status_t res;
+    zx_status_t res;
 
-    if (device_get_protocol(dev, MX_PROTOCOL_PCI, &pci))
-        return MX_ERR_NOT_SUPPORTED;
+    if (device_get_protocol(dev, ZX_PROTOCOL_PCI, &pci))
+        return ZX_ERR_NOT_SUPPORTED;
 
     const pci_config_t* pci_config;
     size_t config_size;
-    mx_handle_t config_handle = MX_HANDLE_INVALID;
-    res = pci_map_resource(&pci, PCI_RESOURCE_CONFIG, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    zx_handle_t config_handle = ZX_HANDLE_INVALID;
+    res = pci_map_resource(&pci, PCI_RESOURCE_CONFIG, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                            (void**)&pci_config, &config_size, &config_handle);
 
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         xprintf("serialio: failed to map pci config: %d\n", res);
         return res;
     }
@@ -61,22 +61,22 @@
         res = intel_serialio_bind_uart(dev);
         break;
     default:
-        res = MX_ERR_NOT_SUPPORTED;
+        res = ZX_ERR_NOT_SUPPORTED;
         break;
     }
 
-    mx_handle_close(config_handle);
+    zx_handle_close(config_handle);
     return res;
 }
 
-static mx_driver_ops_t intel_serialio_driver_ops = {
+static zx_driver_ops_t intel_serialio_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = intel_serialio_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(intel_serialio, intel_serialio_driver_ops, "magenta", "0.1", 14)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+ZIRCON_DRIVER_BEGIN(intel_serialio, intel_serialio_driver_ops, "zircon", "0.1", 14)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_VID, INTEL_VID),
     BI_MATCH_IF(EQ, BIND_PCI_DID, INTEL_WILDCAT_POINT_SERIALIO_DMA_DID),
     BI_MATCH_IF(EQ, BIND_PCI_DID, INTEL_WILDCAT_POINT_SERIALIO_I2C0_DID),
@@ -90,4 +90,4 @@
     BI_MATCH_IF(EQ, BIND_PCI_DID, INTEL_SUNRISE_POINT_SERIALIO_I2C1_DID),
     BI_MATCH_IF(EQ, BIND_PCI_DID, INTEL_SUNRISE_POINT_SERIALIO_I2C2_DID),
     BI_MATCH_IF(EQ, BIND_PCI_DID, INTEL_SUNRISE_POINT_SERIALIO_I2C3_DID),
-MAGENTA_DRIVER_END(intel_serialio)
+ZIRCON_DRIVER_END(intel_serialio)
diff --git a/system/dev/serial/intel-serialio/spi/spi.c b/system/dev/serial/intel-serialio/spi/spi.c
index 0007727..e189c3e 100644
--- a/system/dev/serial/intel-serialio/spi/spi.c
+++ b/system/dev/serial/intel-serialio/spi/spi.c
@@ -5,11 +5,11 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <intel-serialio/serialio.h>
 
-mx_status_t intel_serialio_bind_spi(mx_device_t* dev) {
+zx_status_t intel_serialio_bind_spi(zx_device_t* dev) {
     // Not implemented yet.
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
diff --git a/system/dev/serial/intel-serialio/uart/uart.c b/system/dev/serial/intel-serialio/uart/uart.c
index ae3a0b0..7c05b14 100644
--- a/system/dev/serial/intel-serialio/uart/uart.c
+++ b/system/dev/serial/intel-serialio/uart/uart.c
@@ -5,11 +5,11 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <intel-serialio/serialio.h>
 
-mx_status_t intel_serialio_bind_uart(mx_device_t* dev) {
+zx_status_t intel_serialio_bind_uart(zx_device_t* dev) {
     // Not implemented yet.
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
diff --git a/system/dev/soc/hi3660/hi3660-bus.c b/system/dev/soc/hi3660/hi3660-bus.c
index de92b82..964a4cb 100644
--- a/system/dev/soc/hi3660/hi3660-bus.c
+++ b/system/dev/soc/hi3660/hi3660-bus.c
@@ -15,9 +15,9 @@
 #include <ddk/binding.h>
 #include <ddk/protocol/gpio.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/assert.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/assert.h>
 
 #include "pl061.h"
 #include "hi3660-bus.h"
@@ -42,56 +42,56 @@
     return NULL;
 }
 
-static mx_status_t hi3660_gpio_config(void* ctx, unsigned pin, gpio_config_flags_t flags) {
+static zx_status_t hi3660_gpio_config(void* ctx, unsigned pin, gpio_config_flags_t flags) {
     hi3660_bus_t* bus = ctx;
     pl061_gpios_t* gpios = find_gpio(bus, pin);
     if (!gpios) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     return pl061_proto_ops.config(gpios, pin, flags);
 }
 
-static mx_status_t hi3660_gpio_read(void* ctx, unsigned pin, unsigned* out_value) {
+static zx_status_t hi3660_gpio_read(void* ctx, unsigned pin, unsigned* out_value) {
     hi3660_bus_t* bus = ctx;
     pl061_gpios_t* gpios = find_gpio(bus, pin);
     if (!gpios) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     return pl061_proto_ops.read(gpios, pin, out_value);
 }
 
-static mx_status_t hi3660_gpio_write(void* ctx, unsigned pin, unsigned value) {
+static zx_status_t hi3660_gpio_write(void* ctx, unsigned pin, unsigned value) {
     hi3660_bus_t* bus = ctx;
     pl061_gpios_t* gpios = find_gpio(bus, pin);
     if (!gpios) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     return pl061_proto_ops.write(gpios, pin, value);
 }
 
-static mx_status_t hi3660_gpio_int_enable(void* ctx, unsigned pin, bool enable) {
+static zx_status_t hi3660_gpio_int_enable(void* ctx, unsigned pin, bool enable) {
     hi3660_bus_t* bus = ctx;
     pl061_gpios_t* gpios = find_gpio(bus, pin);
     if (!gpios) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     return pl061_proto_ops.int_enable(gpios, pin, enable);
 }
 
-static mx_status_t hi3660_gpio_get_int_status(void* ctx, unsigned pin, bool* out_status) {
+static zx_status_t hi3660_gpio_get_int_status(void* ctx, unsigned pin, bool* out_status) {
     hi3660_bus_t* bus = ctx;
     pl061_gpios_t* gpios = find_gpio(bus, pin);
     if (!gpios) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     return pl061_proto_ops.get_int_status(gpios, pin, out_status);
 }
 
-static mx_status_t hi3660_gpio_int_clear(void* ctx, unsigned pin) {
+static zx_status_t hi3660_gpio_int_clear(void* ctx, unsigned pin) {
     hi3660_bus_t* bus = ctx;
     pl061_gpios_t* gpios = find_gpio(bus, pin);
     if (!gpios) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     return pl061_proto_ops.int_clear(gpios, pin);
 }
@@ -105,28 +105,28 @@
     .int_clear = hi3660_gpio_int_clear,
 };
 
-static mx_status_t hi3660_get_protocol(void* ctx, uint32_t proto_id, void* out) {
-    if (proto_id == MX_PROTOCOL_GPIO) {
+static zx_status_t hi3660_get_protocol(void* ctx, uint32_t proto_id, void* out) {
+    if (proto_id == ZX_PROTOCOL_GPIO) {
         gpio_protocol_t* proto = out;
         proto->ctx = ctx;
         proto->ops = &gpio_ops;
-        return MX_OK;
+        return ZX_OK;
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t hi3660_add_gpios(void* ctx, uint32_t start, uint32_t count, uint32_t mmio_index,
+static zx_status_t hi3660_add_gpios(void* ctx, uint32_t start, uint32_t count, uint32_t mmio_index,
                                     const uint32_t* irqs, uint32_t irq_count) {
     hi3660_bus_t* bus = ctx;
 
     pl061_gpios_t* gpios = calloc(1, sizeof(pl061_gpios_t));
     if (!gpios) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t status = pdev_map_mmio_buffer(&bus->pdev, mmio_index,
-                                              MX_CACHE_POLICY_UNCACHED_DEVICE, &gpios->buffer);
-    if (status != MX_OK) {
+    zx_status_t status = pdev_map_mmio_buffer(&bus->pdev, mmio_index,
+                                              ZX_CACHE_POLICY_UNCACHED_DEVICE, &gpios->buffer);
+    if (status != ZX_OK) {
         free(gpios);
         return status;
     }
@@ -138,7 +138,7 @@
     gpios->irq_count = irq_count;
     list_add_tail(&bus->gpios, &gpios->node);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static pbus_interface_ops_t hi3660_bus_ops = {
@@ -162,25 +162,25 @@
     free(bus);
 }
 
-static mx_protocol_device_t hi3660_device_protocol = {
+static zx_protocol_device_t hi3660_device_protocol = {
     .version = DEVICE_OPS_VERSION,
     .release = hi3660_release,
 };
 
 // test thread that cycles the 4 LEDs on the hikey 960 board
 static int led_test_thread(void *arg) {
-    mx_device_t* parent = arg;
+    zx_device_t* parent = arg;
 
     platform_device_protocol_t pdev;
-    if (device_get_protocol(parent, MX_PROTOCOL_PLATFORM_DEV, &pdev) != MX_OK) {
+    if (device_get_protocol(parent, ZX_PROTOCOL_PLATFORM_DEV, &pdev) != ZX_OK) {
         printf("led_test_thread: could not get pdev protocol!\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     gpio_protocol_t gpio;
-    if (pdev_get_protocol(&pdev, MX_PROTOCOL_GPIO, &gpio) != MX_OK) {
+    if (pdev_get_protocol(&pdev, ZX_PROTOCOL_GPIO, &gpio) != ZX_OK) {
         printf("led_test_thread: could not get GPIO protocol!\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     uint32_t led_gpios[] = { 150, 151, 190, 189 };
@@ -200,27 +200,27 @@
     return 0;
 }
 
-static mx_status_t hi3660_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t hi3660_bind(void* ctx, zx_device_t* parent, void** cookie) {
     platform_device_protocol_t pdev;
-    if (device_get_protocol(parent, MX_PROTOCOL_PLATFORM_DEV, &pdev) != MX_OK) {
-        return MX_ERR_NOT_SUPPORTED;
+    if (device_get_protocol(parent, ZX_PROTOCOL_PLATFORM_DEV, &pdev) != ZX_OK) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     hi3660_bus_t* bus = calloc(1, sizeof(hi3660_bus_t));
     if (!bus) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     list_initialize(&bus->gpios);
     memcpy(&bus->pdev, &pdev, sizeof(bus->pdev));
 
-    mx_status_t status;
-    if ((status = pdev_map_mmio_buffer(&pdev, MMIO_USB3OTG_BC, MX_CACHE_POLICY_UNCACHED_DEVICE,
-                                       &bus->usb3otg_bc)) != MX_OK ||
-         (status = pdev_map_mmio_buffer(&pdev, MMIO_PERI_CRG, MX_CACHE_POLICY_UNCACHED_DEVICE,
-                                       &bus->peri_crg)) != MX_OK ||
-         (status = pdev_map_mmio_buffer(&pdev, MMIO_PCTRL, MX_CACHE_POLICY_UNCACHED_DEVICE,
-                                       &bus->pctrl)) != MX_OK) {
+    zx_status_t status;
+    if ((status = pdev_map_mmio_buffer(&pdev, MMIO_USB3OTG_BC, ZX_CACHE_POLICY_UNCACHED_DEVICE,
+                                       &bus->usb3otg_bc)) != ZX_OK ||
+         (status = pdev_map_mmio_buffer(&pdev, MMIO_PERI_CRG, ZX_CACHE_POLICY_UNCACHED_DEVICE,
+                                       &bus->peri_crg)) != ZX_OK ||
+         (status = pdev_map_mmio_buffer(&pdev, MMIO_PCTRL, ZX_CACHE_POLICY_UNCACHED_DEVICE,
+                                       &bus->pctrl)) != ZX_OK) {
         goto fail;
     }
 
@@ -234,7 +234,7 @@
     };
 
     status = device_add(parent, &args, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
@@ -249,11 +249,11 @@
 #endif
 
     // must be after pdev_set_interface
-    if ((status = hi3360_usb_init(bus)) != MX_OK) {
+    if ((status = hi3360_usb_init(bus)) != ZX_OK) {
         printf("hi3660_bind: hi3360_usb_init failed!\n");;
     }
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     printf("hi3660_bind failed %d\n", status);
@@ -261,14 +261,14 @@
     return status;
 }
 
-static mx_driver_ops_t hi3660_driver_ops = {
+static zx_driver_ops_t hi3660_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = hi3660_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(hi3660, hi3660_driver_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PLATFORM_DEV),
+ZIRCON_DRIVER_BEGIN(hi3660, hi3660_driver_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PLATFORM_DEV),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_VID, 0x12D1),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_PID, 0x0960),
     BI_MATCH_IF(EQ, BIND_PLATFORM_DEV_DID, PDEV_BUS_IMPLEMENTOR_DID),
-MAGENTA_DRIVER_END(hi3660)
+ZIRCON_DRIVER_END(hi3660)
diff --git a/system/dev/soc/hi3660/hi3660-bus.h b/system/dev/soc/hi3660/hi3660-bus.h
index 2556ca4..57850b3 100644
--- a/system/dev/soc/hi3660/hi3660-bus.h
+++ b/system/dev/soc/hi3660/hi3660-bus.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <ddk/protocol/platform-device.h>
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 
 typedef struct {
     list_node_t gpios;
@@ -15,4 +15,4 @@
     pdev_mmio_buffer_t pctrl;
 } hi3660_bus_t;
 
-mx_status_t hi3360_usb_init(hi3660_bus_t* bus);
+zx_status_t hi3360_usb_init(hi3660_bus_t* bus);
diff --git a/system/dev/soc/hi3660/hi3660-usb.c b/system/dev/soc/hi3660/hi3660-usb.c
index fa08ebd..6c3b895 100644
--- a/system/dev/soc/hi3660/hi3660-usb.c
+++ b/system/dev/soc/hi3660/hi3660-usb.c
@@ -8,7 +8,7 @@
 #include "hi3660-bus.h"
 #include "hi3660-regs.h"
 
-mx_status_t hi3360_usb_init(hi3660_bus_t* bus) {
+zx_status_t hi3360_usb_init(hi3660_bus_t* bus) {
     volatile void* usb3otg_bc = bus->usb3otg_bc.vaddr;
     volatile void* peri_crg = bus->peri_crg.vaddr;
     volatile void* pctrl = bus->pctrl.vaddr;
@@ -19,9 +19,9 @@
     // GPIOs when switching between host and device mode
 
     gpio_protocol_t gpio;
-    if (pdev_get_protocol(&bus->pdev, MX_PROTOCOL_GPIO, &gpio) != MX_OK) {
+    if (pdev_get_protocol(&bus->pdev, ZX_PROTOCOL_GPIO, &gpio) != ZX_OK) {
         printf("hi3360_usb_init: could not get GPIO protocol!\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     // disable host vbus
@@ -58,16 +58,16 @@
     temp = readl(usb3otg_bc + USB3OTG_CTRL2);
     temp &= ~(USB3OTG_CTRL2_POWERDOWN_HSP | USB3OTG_CTRL2_POWERDOWN_SSP);
     writel(temp, usb3otg_bc + USB3OTG_CTRL2);
-    mx_nanosleep(mx_deadline_after(MX_USEC(100)));
+    zx_nanosleep(zx_deadline_after(ZX_USEC(100)));
 
     writel(PERI_CRG_IP_RST_USB3OTGPHY_POR, peri_crg + PERI_CRG_RSTDIS4);
     writel(PERI_CRG_IP_RST_USB3OTG, peri_crg + PERI_CRG_RSTDIS4);
-    mx_nanosleep(mx_deadline_after(MX_MSEC(20)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(20)));
 
     temp = readl(usb3otg_bc + USB3OTG_CTRL3);
     temp |= (USB3OTG_CTRL3_VBUSVLDEXT | USB3OTG_CTRL3_VBUSVLDEXTSEL);
     writel(temp, usb3otg_bc + USB3OTG_CTRL3);
-    mx_nanosleep(mx_deadline_after(MX_USEC(100)));
+    zx_nanosleep(zx_deadline_after(ZX_USEC(100)));
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/soc/hi3660/pl061.c b/system/dev/soc/hi3660/pl061.c
index c1d1dc0..d8f43ec 100644
--- a/system/dev/soc/hi3660/pl061.c
+++ b/system/dev/soc/hi3660/pl061.c
@@ -22,7 +22,7 @@
 
 #define GPIOS_PER_PAGE  8
 
-static mx_status_t pl061_gpio_config(void* ctx, unsigned pin, gpio_config_flags_t flags) {
+static zx_status_t pl061_gpio_config(void* ctx, unsigned pin, gpio_config_flags_t flags) {
     pl061_gpios_t* gpios = ctx;
     pin -= gpios->gpio_start;
     volatile uint8_t* regs = gpios->buffer.vaddr + PAGE_SIZE * (pin / GPIOS_PER_PAGE);
@@ -65,30 +65,30 @@
     writeb(iev, regs + GPIOIEV);
 
     mtx_unlock(&gpios->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t pl061_gpio_read(void* ctx, unsigned pin, unsigned* out_value) {
+static zx_status_t pl061_gpio_read(void* ctx, unsigned pin, unsigned* out_value) {
     pl061_gpios_t* gpios = ctx;
     pin -= gpios->gpio_start;
     volatile uint8_t* regs = gpios->buffer.vaddr + PAGE_SIZE * (pin / GPIOS_PER_PAGE);
     uint8_t bit = 1 << (pin % GPIOS_PER_PAGE);
 
     *out_value = !!(readb(regs + GPIODATA(0)) & bit);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t pl061_gpio_write(void* ctx, unsigned pin, unsigned value) {
+static zx_status_t pl061_gpio_write(void* ctx, unsigned pin, unsigned value) {
     pl061_gpios_t* gpios = ctx;
     pin -= gpios->gpio_start;
     volatile uint8_t* regs = gpios->buffer.vaddr + PAGE_SIZE * (pin / GPIOS_PER_PAGE);
     uint8_t bit = 1 << (pin % GPIOS_PER_PAGE);
 
     writeb((value ? bit : 0), regs + GPIODATA(bit));
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t pl061_gpio_int_enable(void* ctx, unsigned pin, bool enable) {
+static zx_status_t pl061_gpio_int_enable(void* ctx, unsigned pin, bool enable) {
     pl061_gpios_t* gpios = ctx;
     pin -= gpios->gpio_start;
     volatile uint8_t* regs = gpios->buffer.vaddr + PAGE_SIZE * (pin / GPIOS_PER_PAGE);
@@ -103,20 +103,20 @@
     }
     writeb(ie, regs + GPIOIE);
     mtx_unlock(&gpios->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t pl061_gpio_get_int_status(void* ctx, unsigned pin, bool* out_status) {
+static zx_status_t pl061_gpio_get_int_status(void* ctx, unsigned pin, bool* out_status) {
     pl061_gpios_t* gpios = ctx;
     pin -= gpios->gpio_start;
     volatile uint8_t* regs = gpios->buffer.vaddr + PAGE_SIZE * (pin / GPIOS_PER_PAGE);
     uint8_t bit = 1 << (pin % GPIOS_PER_PAGE);
 
     *out_status = !!(readb(regs + GPIOMIS) & bit);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t pl061_gpio_int_clear(void* ctx, unsigned pin) {
+static zx_status_t pl061_gpio_int_clear(void* ctx, unsigned pin) {
     pl061_gpios_t* gpios = ctx;
     pin -= gpios->gpio_start;
     volatile uint8_t* regs = gpios->buffer.vaddr + PAGE_SIZE * (pin / GPIOS_PER_PAGE);
@@ -127,7 +127,7 @@
     ic |= bit;
     writeb(ic, regs + GPIOIC);
     mtx_unlock(&gpios->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
 gpio_protocol_ops_t pl061_proto_ops = {
diff --git a/system/dev/soc/hi3660/pl061.h b/system/dev/soc/hi3660/pl061.h
index 0ae9795..6936ac7 100644
--- a/system/dev/soc/hi3660/pl061.h
+++ b/system/dev/soc/hi3660/pl061.h
@@ -6,8 +6,8 @@
 
 #include <ddk/protocol/gpio.h>
 #include <ddk/protocol/platform-device.h>
-#include <magenta/listnode.h>
-#include <magenta/types.h>
+#include <zircon/listnode.h>
+#include <zircon/types.h>
 #include <threads.h>
 
 typedef struct {
diff --git a/system/dev/soc/hi3660/rules.mk b/system/dev/soc/hi3660/rules.mk
index 541634f..c7c4d7f 100644
--- a/system/dev/soc/hi3660/rules.mk
+++ b/system/dev/soc/hi3660/rules.mk
@@ -15,6 +15,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk
 
-MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/magenta
+MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/zircon
 
 include make/module.mk
diff --git a/system/dev/usb-function/cdc-ethernet/cdc-eth-function.c b/system/dev/usb-function/cdc-ethernet/cdc-eth-function.c
index 2e296e4..0be1d9b 100644
--- a/system/dev/usb-function/cdc-ethernet/cdc-eth-function.c
+++ b/system/dev/usb-function/cdc-ethernet/cdc-eth-function.c
@@ -18,11 +18,11 @@
 #include <ddk/protocol/ethernet.h>
 #include <ddk/protocol/usb-function.h>
 #include <inet6/inet6.h>
-#include <magenta/listnode.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/device/usb-device.h>
-#include <magenta/hw/usb-cdc.h>
+#include <zircon/listnode.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/device/usb-device.h>
+#include <zircon/hw/usb-cdc.h>
 
 #define BULK_TXN_SIZE   2048
 #define BULK_TX_COUNT   16
@@ -34,7 +34,7 @@
 #define CDC_BITRATE         1000000000  // say we are gigabit
 
 typedef struct {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     usb_function_protocol_t function;
 
     list_node_t bulk_out_txns;
@@ -150,11 +150,11 @@
     },
 };
 
-static mx_status_t cdc_generate_mac_address(usb_cdc_t* cdc) {
+static zx_status_t cdc_generate_mac_address(usb_cdc_t* cdc) {
     size_t actual;
-    mx_status_t status = mx_cprng_draw(cdc->mac_addr, sizeof(cdc->mac_addr), &actual);
-    if (status != MX_OK) {
-        dprintf(ERROR, "%s: cdc_generate_mac_address: mx_cprng_draw failed\n", __FUNCTION__);
+    zx_status_t status = zx_cprng_draw(cdc->mac_addr, sizeof(cdc->mac_addr), &actual);
+    if (status != ZX_OK) {
+        dprintf(ERROR, "%s: cdc_generate_mac_address: zx_cprng_draw failed\n", __FUNCTION__);
         return status;
     }
 
@@ -169,7 +169,7 @@
     return usb_function_alloc_string_desc(&cdc->function, buffer, &descriptors.cdc_eth.iMACAddress);
 }
 
-static mx_status_t cdc_ethmac_query(void* ctx, uint32_t options, ethmac_info_t* info) {
+static zx_status_t cdc_ethmac_query(void* ctx, uint32_t options, ethmac_info_t* info) {
     dprintf(TRACE, "%s:\n", __FUNCTION__);
     usb_cdc_t* cdc = ctx;
 
@@ -177,14 +177,14 @@
     if (options) {
         dprintf(ERROR, "%s: unexpected options (0x%"PRIx32") to ethmac_query\n", __FUNCTION__,
                 options);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     memset(info, 0, sizeof(*info));
     info->mtu = ETH_MTU;
     memcpy(info->mac, cdc->mac_addr, sizeof(cdc->mac_addr));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void cdc_ethmac_stop(void* cookie) {
@@ -195,14 +195,14 @@
     mtx_unlock(&cdc->ethmac_mutex);
 }
 
-static mx_status_t cdc_ethmac_start(void* ctx_cookie, ethmac_ifc_t* ifc, void* ethmac_cookie) {
+static zx_status_t cdc_ethmac_start(void* ctx_cookie, ethmac_ifc_t* ifc, void* ethmac_cookie) {
     dprintf(TRACE, "%s:\n", __FUNCTION__);
     usb_cdc_t* cdc = ctx_cookie;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&cdc->ethmac_mutex);
     if (cdc->ethmac_ifc) {
-        status = MX_ERR_ALREADY_BOUND;
+        status = ZX_ERR_ALREADY_BOUND;
     } else {
         cdc->ethmac_ifc = ifc;
         cdc->ethmac_cookie = ethmac_cookie;
@@ -283,25 +283,25 @@
     iotxn_release(txn);
 }
 
-static mx_status_t cdc_alloc_interrupt_txn(usb_cdc_t* cdc, iotxn_t** out_txn) {
+static zx_status_t cdc_alloc_interrupt_txn(usb_cdc_t* cdc, iotxn_t** out_txn) {
     iotxn_t* txn;
-    mx_status_t status = iotxn_alloc(&txn, 0, INTR_MAX_PACKET);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc(&txn, 0, INTR_MAX_PACKET);
+    if (status != ZX_OK) {
         dprintf(ERROR, "%s: iotxn_alloc failed %d\n", __FUNCTION__, status);
         return status;
     }
     txn->complete_cb = cdc_intr_complete;
     txn->cookie = cdc;
     *out_txn = txn;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // sends network connection and speed change notifications on the interrupt endpoint
 // we only do this once per USB connect, so instead of pooling iotxns we just allocate
 // them here and release them when they complete.
-static mx_status_t cdc_send_notifications(usb_cdc_t* cdc) {
+static zx_status_t cdc_send_notifications(usb_cdc_t* cdc) {
     iotxn_t* txn;
-    mx_status_t status;
+    zx_status_t status;
 
     usb_cdc_notification_t network_notification = {
         .bmRequestType = USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
@@ -324,18 +324,18 @@
     };
 
     status = cdc_alloc_interrupt_txn(cdc, &txn);
-    if (status != MX_OK) return status;
+    if (status != ZX_OK) return status;
     iotxn_copyto(txn, &network_notification, sizeof(network_notification), 0);
     txn->length = sizeof(network_notification);
     usb_function_queue(&cdc->function, txn, cdc->intr_addr);
 
     status = cdc_alloc_interrupt_txn(cdc, &txn);
-    if (status != MX_OK) return status;
+    if (status != ZX_OK) return status;
     iotxn_copyto(txn, &speed_notification, sizeof(speed_notification), 0);
     txn->length = sizeof(speed_notification);
     usb_function_queue(&cdc->function, txn, cdc->intr_addr);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void cdc_rx_complete(iotxn_t* txn, void* cookie) {
@@ -343,17 +343,17 @@
 
     dprintf(LTRACE, "%s %d %ld\n", __FUNCTION__, txn->status, txn->actual);
 
-    if (txn->status == MX_ERR_IO_NOT_PRESENT) {
+    if (txn->status == ZX_ERR_IO_NOT_PRESENT) {
         mtx_lock(&cdc->rx_mutex);
         list_add_head(&cdc->bulk_out_txns, &txn->node);
         mtx_unlock(&cdc->rx_mutex);
         return;
     }
-    if (txn->status != MX_OK) {
+    if (txn->status != ZX_OK) {
         dprintf(ERROR, "%s: usb_read_complete called with status %d\n", __FUNCTION__, txn->status);
     }
 
-    if (txn->status == MX_OK) {
+    if (txn->status == ZX_OK) {
         mtx_lock(&cdc->ethmac_mutex);
         if (cdc->ethmac_ifc) {
             uint8_t* data = NULL;
@@ -381,7 +381,7 @@
     return (const usb_descriptor_header_t *)&descriptors;
 }
 
-static mx_status_t cdc_control(void* ctx, const usb_setup_t* setup, void* buffer,
+static zx_status_t cdc_control(void* ctx, const usb_setup_t* setup, void* buffer,
                                size_t length, size_t* out_actual) {
     *out_actual = 0;
 
@@ -392,16 +392,16 @@
         setup->bRequest == USB_CDC_SET_ETHERNET_PACKET_FILTER) {
         dprintf(TRACE, "%s: USB_CDC_SET_ETHERNET_PACKET_FILTER\n", __FUNCTION__);
         // TODO(voydanoff) implement the requested packet filtering
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t cdc_set_configured(void* ctx, bool configured, usb_speed_t speed) {
+static zx_status_t cdc_set_configured(void* ctx, bool configured, usb_speed_t speed) {
     dprintf(TRACE, "%s: %d %d\n", __FUNCTION__, configured, speed);
     usb_cdc_t* cdc = ctx;
-    mx_status_t status;
+    zx_status_t status;
 
     mtx_lock(&cdc->ethmac_mutex);
     cdc->online = false;
@@ -411,7 +411,7 @@
     mtx_unlock(&cdc->ethmac_mutex);
 
     if (configured) {
-        if ((status = usb_function_config_ep(&cdc->function, &descriptors.intr_ep, NULL)) != MX_OK) {
+        if ((status = usb_function_config_ep(&cdc->function, &descriptors.intr_ep, NULL)) != ZX_OK) {
             dprintf(ERROR, "%s: usb_function_config_ep failed\n", __FUNCTION__);
             return status;
         }
@@ -421,35 +421,35 @@
         usb_function_disable_ep(&cdc->function, cdc->intr_addr);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t cdc_set_interface(void* ctx, unsigned interface, unsigned alt_setting) {
+static zx_status_t cdc_set_interface(void* ctx, unsigned interface, unsigned alt_setting) {
     dprintf(TRACE, "%s: %d %d\n", __FUNCTION__, interface, alt_setting);
     usb_cdc_t* cdc = ctx;
-    mx_status_t status;
+    zx_status_t status;
 
     if (interface != descriptors.cdc_intf_0.bInterfaceNumber || alt_setting > 1) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // TODO(voydanoff) fullspeed and superspeed support
     if (alt_setting) {
         if ((status = usb_function_config_ep(&cdc->function, &descriptors.bulk_out_ep, NULL))
-                != MX_OK ||
+                != ZX_OK ||
             (status = usb_function_config_ep(&cdc->function, &descriptors.bulk_in_ep, NULL))
-                != MX_OK) {
+                != ZX_OK) {
             dprintf(ERROR, "%s: usb_function_config_ep failed\n", __FUNCTION__);
         }
     } else {
-        if ((status = usb_function_disable_ep(&cdc->function, cdc->bulk_out_addr)) != MX_OK ||
-            (status = usb_function_disable_ep(&cdc->function, cdc->bulk_in_addr)) != MX_OK) {
+        if ((status = usb_function_disable_ep(&cdc->function, cdc->bulk_out_addr)) != ZX_OK ||
+            (status = usb_function_disable_ep(&cdc->function, cdc->bulk_in_addr)) != ZX_OK) {
             dprintf(ERROR, "%s: usb_function_disable_ep failed\n", __FUNCTION__);
         }
     }
 
     bool online = false;
-    if (alt_setting && status == MX_OK) {
+    if (alt_setting && status == ZX_OK) {
         online = true;
 
         // queue our OUT txns
@@ -504,22 +504,22 @@
     free(cdc);
 }
 
-static mx_protocol_device_t usb_cdc_proto = {
+static zx_protocol_device_t usb_cdc_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = usb_cdc_unbind,
     .release = usb_cdc_release,
 };
 
-mx_status_t usb_cdc_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t usb_cdc_bind(void* ctx, zx_device_t* parent, void** cookie) {
     dprintf(INFO, "%s\n", __FUNCTION__);
 
     usb_cdc_t* cdc = calloc(1, sizeof(usb_cdc_t));
     if (!cdc) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_status_t status = device_get_protocol(parent, MX_PROTOCOL_USB_FUNCTION, &cdc->function);
-    if (status != MX_OK) {
+    zx_status_t status = device_get_protocol(parent, ZX_PROTOCOL_USB_FUNCTION, &cdc->function);
+    if (status != ZX_OK) {
         free(cdc);
         return status;
     }
@@ -533,12 +533,12 @@
     cdc->bulk_max_packet = BULK_MAX_PACKET; // FIXME(voydanoff) USB 3.0 support
 
     status = usb_function_alloc_interface(&cdc->function, &descriptors.comm_intf.bInterfaceNumber);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "%s: usb_function_alloc_interface failed\n", __FUNCTION__);
         goto fail;
     }
     status = usb_function_alloc_interface(&cdc->function, &descriptors.cdc_intf_0.bInterfaceNumber);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "%s: usb_function_alloc_interface failed\n", __FUNCTION__);
         goto fail;
     }
@@ -547,17 +547,17 @@
     descriptors.cdc_union.bSubordinateInterface = descriptors.cdc_intf_0.bInterfaceNumber;
 
     status = usb_function_alloc_ep(&cdc->function, USB_DIR_OUT, &cdc->bulk_out_addr);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "%s: usb_function_alloc_ep failed\n", __FUNCTION__);
         goto fail;
     }
     status = usb_function_alloc_ep(&cdc->function, USB_DIR_IN, &cdc->bulk_in_addr);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "%s: usb_function_alloc_ep failed\n", __FUNCTION__);
         goto fail;
     }
     status = usb_function_alloc_ep(&cdc->function, USB_DIR_IN, &cdc->intr_addr);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "%s: usb_function_alloc_ep failed\n", __FUNCTION__);
         goto fail;
     }
@@ -567,7 +567,7 @@
     descriptors.intr_ep.bEndpointAddress = cdc->intr_addr;
 
     status = cdc_generate_mac_address(cdc);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
@@ -575,7 +575,7 @@
     iotxn_t* txn;
     for (int i = 0; i < BULK_TX_COUNT; i++) {
         status = iotxn_alloc(&txn, 0, BULK_TXN_SIZE);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             goto fail;
         }
         txn->length = BULK_TXN_SIZE;
@@ -586,7 +586,7 @@
     // allocate bulk in iotxns
     for (int i = 0; i < BULK_RX_COUNT; i++) {
         status = iotxn_alloc(&txn, 0, BULK_TXN_SIZE);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             goto fail;
         }
         txn->complete_cb = cdc_tx_complete;
@@ -599,12 +599,12 @@
         .name = "cdc-eth-function",
         .ctx = cdc,
         .ops = &usb_cdc_proto,
-        .proto_id = MX_PROTOCOL_ETHERMAC,
+        .proto_id = ZX_PROTOCOL_ETHERMAC,
         .proto_ops = &ethmac_ops,
     };
 
     status = device_add(parent, &args, &cdc->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "%s: add_device failed %d\n", __FUNCTION__, status);
         goto fail;
     }
@@ -615,22 +615,22 @@
     };
     usb_function_register(&cdc->function, &intf);
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     usb_cdc_release(cdc);
     return status;
 }
 
-static mx_driver_ops_t usb_cdc_ops = {
+static zx_driver_ops_t usb_cdc_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = usb_cdc_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(usb_cdc, usb_cdc_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB_FUNCTION),
+ZIRCON_DRIVER_BEGIN(usb_cdc, usb_cdc_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB_FUNCTION),
     BI_ABORT_IF(NE, BIND_USB_CLASS, USB_CLASS_COMM),
     BI_ABORT_IF(NE, BIND_USB_SUBCLASS, USB_CDC_SUBCLASS_ETHERNET),
     BI_MATCH_IF(EQ, BIND_USB_PROTOCOL, 0),
-MAGENTA_DRIVER_END(usb_cdc)
+ZIRCON_DRIVER_END(usb_cdc)
diff --git a/system/dev/usb-function/cdc-ethernet/rules.mk b/system/dev/usb-function/cdc-ethernet/rules.mk
index 868028f..3e27b46 100644
--- a/system/dev/usb-function/cdc-ethernet/rules.mk
+++ b/system/dev/usb-function/cdc-ethernet/rules.mk
@@ -13,7 +13,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 MODULE_HEADER_DEPS := system/ulib/inet6
 
diff --git a/system/dev/usb-function/ums-function/rules.mk b/system/dev/usb-function/ums-function/rules.mk
index de41ab7..c178384 100644
--- a/system/dev/usb-function/ums-function/rules.mk
+++ b/system/dev/usb-function/ums-function/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/usb-function/ums-function/ums-function.c b/system/dev/usb-function/ums-function/ums-function.c
index 54a2d9a..6c7a174 100644
--- a/system/dev/usb-function/ums-function/ums-function.c
+++ b/system/dev/usb-function/ums-function/ums-function.c
@@ -14,10 +14,10 @@
 #include <ddk/driver.h>
 #include <ddk/iotxn.h>
 #include <ddk/protocol/usb-function.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/device/usb-device.h>
-#include <magenta/hw/usb-mass-storage.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/device/usb-device.h>
+#include <zircon/hw/usb-mass-storage.h>
 
 #define BLOCK_SIZE      512
 #define STORAGE_SIZE    (10 * 1024 * 1024)
@@ -66,14 +66,14 @@
 };
 
 typedef struct {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     usb_function_protocol_t function;
     iotxn_t* cbw_iotxn;
     iotxn_t* data_iotxn;
     iotxn_t* csw_iotxn;
 
     // vmo for backing storage
-    mx_handle_t storage_handle;
+    zx_handle_t storage_handle;
     void* storage;
 
     // command we are currently handling
@@ -84,7 +84,7 @@
     // state for data transfers
     ums_data_state_t    data_state;
     // state for reads and writes
-    mx_off_t data_offset;
+    zx_off_t data_offset;
     size_t data_remaining;
 
     uint8_t bulk_out_addr;
@@ -136,7 +136,7 @@
 
 static void ums_start_transfer(usb_ums_t* ums, ums_data_state_t state, uint64_t lba,
                                uint32_t blocks) {
-    mx_off_t offset = lba * BLOCK_SIZE;
+    zx_off_t offset = lba * BLOCK_SIZE;
     size_t length = blocks * BLOCK_SIZE;
 
     if (offset + length > STORAGE_SIZE) {
@@ -372,7 +372,7 @@
 
     dprintf(TRACE, "ums_cbw_complete %d %ld\n", txn->status, txn->actual);
 
-    if (txn->status == MX_OK && txn->actual == sizeof(ums_cbw_t)) {
+    if (txn->status == ZX_OK && txn->actual == sizeof(ums_cbw_t)) {
         ums_cbw_t* cbw = &ums->current_cbw;
         iotxn_copyfrom(txn, cbw, sizeof(*cbw), 0);
         ums_handle_cbw(ums, cbw);
@@ -414,46 +414,46 @@
     return (const usb_descriptor_header_t *)&descriptors;
 }
 
-static mx_status_t ums_control(void* ctx, const usb_setup_t* setup, void* buffer,
+static zx_status_t ums_control(void* ctx, const usb_setup_t* setup, void* buffer,
                                          size_t length, size_t* out_actual) {
     if (setup->bmRequestType == (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) &&
         setup->bRequest == USB_REQ_GET_MAX_LUN && setup->wValue == 0 && setup->wIndex == 0 &&
         setup->wLength >= sizeof(uint8_t)) {
         *((uint8_t *)buffer) = 0;
         *out_actual = sizeof(uint8_t);
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t ums_set_configured(void* ctx, bool configured, usb_speed_t speed) {
+static zx_status_t ums_set_configured(void* ctx, bool configured, usb_speed_t speed) {
     dprintf(TRACE, "ums_set_configured %d %d\n", configured, speed);
     usb_ums_t* ums = ctx;
-    mx_status_t status;
+    zx_status_t status;
 
     // TODO(voydanoff) fullspeed and superspeed support
     if (configured) {
-        if ((status = usb_function_config_ep(&ums->function, &descriptors.out_ep, NULL)) != MX_OK ||
-            (status = usb_function_config_ep(&ums->function, &descriptors.in_ep, NULL)) != MX_OK) {
+        if ((status = usb_function_config_ep(&ums->function, &descriptors.out_ep, NULL)) != ZX_OK ||
+            (status = usb_function_config_ep(&ums->function, &descriptors.in_ep, NULL)) != ZX_OK) {
             dprintf(ERROR, "ums_set_configured: usb_function_config_ep failed\n");
         }
     } else {
-        if ((status = usb_function_disable_ep(&ums->function, ums->bulk_out_addr)) != MX_OK ||
-            (status = usb_function_disable_ep(&ums->function, ums->bulk_in_addr)) != MX_OK) {
+        if ((status = usb_function_disable_ep(&ums->function, ums->bulk_out_addr)) != ZX_OK ||
+            (status = usb_function_disable_ep(&ums->function, ums->bulk_in_addr)) != ZX_OK) {
             dprintf(ERROR, "ums_set_configured: usb_function_disable_ep failed\n");
         }
     }
 
-    if (configured && status == MX_OK) {
+    if (configured && status == ZX_OK) {
         // queue first read on OUT endpoint
         usb_function_queue(&ums->function, ums->cbw_iotxn, ums->bulk_out_addr);
     }
     return status;
 }
 
-static mx_status_t ums_set_interface(void* ctx, unsigned interface, unsigned alt_setting) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t ums_set_interface(void* ctx, unsigned interface, unsigned alt_setting) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 usb_function_interface_ops_t ums_device_ops = {
@@ -474,9 +474,9 @@
     usb_ums_t* ums = ctx;
 
     if (ums->storage) {
-        mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)ums->storage, STORAGE_SIZE);
+        zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)ums->storage, STORAGE_SIZE);
     }
-    mx_handle_close(ums->storage_handle);
+    zx_handle_close(ums->storage_handle);
 
     if (ums->cbw_iotxn) {
         iotxn_release(ums->cbw_iotxn);
@@ -490,47 +490,47 @@
     free(ums);
 }
 
-static mx_protocol_device_t usb_ums_proto = {
+static zx_protocol_device_t usb_ums_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = usb_ums_unbind,
     .release = usb_ums_release,
 };
 
-mx_status_t usb_ums_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t usb_ums_bind(void* ctx, zx_device_t* parent, void** cookie) {
     dprintf(INFO, "usb_ums_bind\n");
 
     usb_ums_t* ums = calloc(1, sizeof(usb_ums_t));
     if (!ums) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     ums->data_state = DATA_STATE_NONE;
 
-    mx_status_t status = device_get_protocol(parent, MX_PROTOCOL_USB_FUNCTION, &ums->function);
-    if (status != MX_OK) {
+    zx_status_t status = device_get_protocol(parent, ZX_PROTOCOL_USB_FUNCTION, &ums->function);
+    if (status != ZX_OK) {
         goto fail;
     }
 
     status = iotxn_alloc(&ums->cbw_iotxn, 0, BULK_MAX_PACKET);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
     status = iotxn_alloc(&ums->data_iotxn, 0, DATA_TXN_SIZE);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
     status = iotxn_alloc(&ums->csw_iotxn, 0, BULK_MAX_PACKET);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
     // create and map a VMO
-    status = mx_vmo_create(STORAGE_SIZE, 0, &ums->storage_handle);
-    if (status != MX_OK) {
+    status = zx_vmo_create(STORAGE_SIZE, 0, &ums->storage_handle);
+    if (status != ZX_OK) {
         goto fail;
     }
-    status = mx_vmar_map(mx_vmar_root_self(), 0, ums->storage_handle, 0, STORAGE_SIZE,
-                         MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, (mx_vaddr_t *)&ums->storage);
-    if (status != MX_OK) {
+    status = zx_vmar_map(zx_vmar_root_self(), 0, ums->storage_handle, 0, STORAGE_SIZE,
+                         ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, (zx_vaddr_t *)&ums->storage);
+    if (status != ZX_OK) {
         goto fail;
     }
 
@@ -544,17 +544,17 @@
     ums->csw_iotxn->cookie = ums;
 
     status = usb_function_alloc_interface(&ums->function, &descriptors.intf.bInterfaceNumber);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "usb_ums_bind: usb_function_alloc_interface failed\n");
         goto fail;
     }
     status = usb_function_alloc_ep(&ums->function, USB_DIR_OUT, &ums->bulk_out_addr);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "usb_ums_bind: usb_function_alloc_ep failed\n");
         goto fail;
     }
     status = usb_function_alloc_ep(&ums->function, USB_DIR_IN, &ums->bulk_in_addr);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "usb_ums_bind: usb_function_alloc_ep failed\n");
         goto fail;
     }
@@ -570,7 +570,7 @@
     };
 
     status = device_add(parent, &args, &ums->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "usb_device_bind add_device failed %d\n", status);
         goto fail;
     }
@@ -581,22 +581,22 @@
     };
     usb_function_register(&ums->function, &intf);
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     usb_ums_release(ums);
     return status;
 }
 
-static mx_driver_ops_t usb_ums_ops = {
+static zx_driver_ops_t usb_ums_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = usb_ums_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(usb_ums, usb_ums_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB_FUNCTION),
+ZIRCON_DRIVER_BEGIN(usb_ums, usb_ums_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB_FUNCTION),
     BI_ABORT_IF(NE, BIND_USB_CLASS, USB_CLASS_MSC),
     BI_ABORT_IF(NE, BIND_USB_SUBCLASS, USB_SUBCLASS_MSC_SCSI),
     BI_MATCH_IF(EQ, BIND_USB_PROTOCOL, USB_PROTOCOL_MSC_BULK_ONLY),
-MAGENTA_DRIVER_END(usb_ums)
+ZIRCON_DRIVER_END(usb_ums)
diff --git a/system/dev/usb-function/usb-device/rules.mk b/system/dev/usb-function/usb-device/rules.mk
index 517b5f2..53792a0 100644
--- a/system/dev/usb-function/usb-device/rules.mk
+++ b/system/dev/usb-function/usb-device/rules.mk
@@ -15,7 +15,7 @@
 
 MODULE_LIBS := \
     system/ulib/driver \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c
 
 
diff --git a/system/dev/usb-function/usb-device/usb-device.c b/system/dev/usb-function/usb-device/usb-device.c
index be18c95..e446fe6 100644
--- a/system/dev/usb-function/usb-device/usb-device.c
+++ b/system/dev/usb-function/usb-device/usb-device.c
@@ -15,16 +15,16 @@
 #include <ddk/driver.h>
 #include <ddk/protocol/usb-dci.h>
 #include <ddk/protocol/usb-function.h>
-#include <magenta/listnode.h>
-#include <magenta/device/usb-device.h>
-#include <magenta/hw/usb-cdc.h>
-#include <magenta/hw/usb.h>
+#include <zircon/listnode.h>
+#include <zircon/device/usb-device.h>
+#include <zircon/hw/usb-cdc.h>
+#include <zircon/hw/usb.h>
 
 #define MAX_INTERFACES 32
 
 typedef struct {
-    mx_device_t* mxdev;
-    mx_device_t* dci_dev;
+    zx_device_t* mxdev;
+    zx_device_t* dci_dev;
     struct usb_device* dev;
     list_node_t node;
     usb_function_interface_t interface;
@@ -35,8 +35,8 @@
 } usb_function_t;
 
 typedef struct usb_device {
-    mx_device_t* mxdev;
-    mx_device_t* dci_dev;
+    zx_device_t* mxdev;
+    zx_device_t* dci_dev;
     usb_dci_protocol_t usb_dci;
     usb_device_descriptor_t device_desc;
     usb_configuration_descriptor_t* config_desc;
@@ -60,7 +60,7 @@
 #define IN_EP_START     17
 #define IN_EP_END       31
 
-static mx_status_t usb_device_alloc_string_desc(usb_device_t* dev, const char* string,
+static zx_status_t usb_device_alloc_string_desc(usb_device_t* dev, const char* string,
                                                 uint8_t* out_index) {
     unsigned i;
     for (i = 1; i < countof(dev->strings); i++) {
@@ -69,15 +69,15 @@
         }
     }
     if (i == countof(dev->strings)) {
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     }
 
     dev->strings[i] = strdup(string);
     if (!dev->strings[i]) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     *out_index = i;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void usb_function_iotxn_queue(void* ctx, iotxn_t* txn) {
@@ -93,19 +93,19 @@
     free(function);
 }
 
-static mx_protocol_device_t function_proto = {
+static zx_protocol_device_t function_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = usb_function_iotxn_queue,
     .release = usb_function_release,
 };
 
-static mx_status_t usb_device_function_registered(usb_device_t* dev) {
+static zx_status_t usb_device_function_registered(usb_device_t* dev) {
     mtx_lock(&dev->lock);
 
     if (dev->config_desc) {
         dprintf(ERROR, "usb_device_function_registered: already have configuration descriptor!\n");
         mtx_unlock(&dev->lock);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // check to see if we have all our functions registered
@@ -118,7 +118,7 @@
         } else {
             // need to wait for more functions to register
             mtx_unlock(&dev->lock);
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
@@ -126,7 +126,7 @@
     usb_configuration_descriptor_t* config_desc = malloc(length);
     if (!config_desc) {
         mtx_unlock(&dev->lock);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     config_desc->bLength = sizeof(*config_desc);
@@ -153,7 +153,7 @@
     return usb_dci_set_enabled(&dev->usb_dci, true);
 }
 
-static mx_status_t usb_func_register(void* ctx, usb_function_interface_t* interface) {
+static zx_status_t usb_func_register(void* ctx, usb_function_interface_t* interface) {
     usb_function_t* function = ctx;
     usb_device_t* dev = function->dev;
     usb_function_t** endpoint_map = dev->endpoint_map;
@@ -163,14 +163,14 @@
 
     // validate the descriptor list
     if (!descriptors || length < sizeof(usb_interface_descriptor_t)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     usb_interface_descriptor_t* intf_desc = (usb_interface_descriptor_t *)descriptors;
     if (intf_desc->bDescriptorType != USB_DT_INTERFACE ||
             intf_desc->bLength != sizeof(usb_interface_descriptor_t)) {
         dprintf(ERROR, "usb_func_register: first descriptor not an interface descriptor\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     const usb_descriptor_header_t* end = (void *)descriptors + length;
@@ -183,7 +183,7 @@
                 dev->interface_map[desc->bInterfaceNumber] != function) {
                 dprintf(ERROR, "usb_func_register: bInterfaceNumber %u\n",
                        desc->bInterfaceNumber);
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
             if (desc->bAlternateSetting == 0) {
                 function->num_interfaces++;
@@ -195,20 +195,20 @@
                 endpoint_map[index] != function) {
                 dprintf(ERROR, "usb_func_register: bad endpoint address 0x%X\n",
                        desc->bEndpointAddress);
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
         }
 
         if (header->bLength == 0) {
             dprintf(ERROR, "usb_func_register: zero length descriptor\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         header = (void *)header + header->bLength;
     }
 
     function->descriptors = malloc(length);
     if (!function->descriptors) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     memcpy(function->descriptors, descriptors, length);
     function->descriptors_length = length;
@@ -217,7 +217,7 @@
     return usb_device_function_registered(function->dev);
 }
 
-static mx_status_t usb_func_alloc_interface(void* ctx, uint8_t* out_intf_num) {
+static zx_status_t usb_func_alloc_interface(void* ctx, uint8_t* out_intf_num) {
     usb_function_t* function = ctx;
     usb_device_t* dev = function->dev;
 
@@ -225,13 +225,13 @@
         if (dev->interface_map[i] == NULL) {
             dev->interface_map[i] = function;
             *out_intf_num = i;
-            return MX_OK;
+            return ZX_OK;
         }
     }
-    return MX_ERR_NO_RESOURCES;
+    return ZX_ERR_NO_RESOURCES;
 }
 
-static mx_status_t usb_func_alloc_ep(void* ctx, uint8_t direction, uint8_t* out_address) {
+static zx_status_t usb_func_alloc_ep(void* ctx, uint8_t direction, uint8_t* out_address) {
     unsigned start, end;
 
     if (direction == USB_DIR_OUT) {
@@ -241,7 +241,7 @@
         start = IN_EP_START;
         end = IN_EP_END;
     } else {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     usb_function_t* function = ctx;
@@ -254,45 +254,45 @@
             endpoint_map[index] = function;
             mtx_unlock(&dev->lock);
             *out_address = ep_index_to_address(index);
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
     mtx_unlock(&dev->lock);
-    return MX_ERR_NO_RESOURCES;
+    return ZX_ERR_NO_RESOURCES;
 }
 
-static mx_status_t usb_func_config_ep(void* ctx, usb_endpoint_descriptor_t* ep_desc,
+static zx_status_t usb_func_config_ep(void* ctx, usb_endpoint_descriptor_t* ep_desc,
                                       usb_ss_ep_comp_descriptor_t* ss_comp_desc) {
     usb_function_t* function = ctx;
     return usb_dci_config_ep(&function->dev->usb_dci, ep_desc, ss_comp_desc);
 }
 
-static mx_status_t usb_func_disable_ep(void* ctx, uint8_t ep_addr) {
+static zx_status_t usb_func_disable_ep(void* ctx, uint8_t ep_addr) {
     dprintf(TRACE, "usb_func_disable_ep\n");
     usb_function_t* function = ctx;
     return usb_dci_disable_ep(&function->dev->usb_dci, ep_addr);
 }
 
-static mx_status_t usb_func_alloc_string_desc(void* ctx, const char* string, uint8_t* out_index) {
+static zx_status_t usb_func_alloc_string_desc(void* ctx, const char* string, uint8_t* out_index) {
     usb_function_t* function = ctx;
     return usb_device_alloc_string_desc(function->dev, string, out_index);
 }
 
 static void usb_func_queue(void* ctx, iotxn_t* txn, uint8_t ep_address) {
     usb_function_t* function = ctx;
-    txn->protocol = MX_PROTOCOL_USB_FUNCTION;
+    txn->protocol = ZX_PROTOCOL_USB_FUNCTION;
     usb_function_protocol_data_t* data = iotxn_pdata(txn, usb_function_protocol_data_t);
     data->ep_address = ep_address;
     iotxn_queue(function->dci_dev, txn);
 }
 
-static mx_status_t usb_func_ep_set_stall(void* ctx, uint8_t ep_address) {
+static zx_status_t usb_func_ep_set_stall(void* ctx, uint8_t ep_address) {
     usb_function_t* function = ctx;
     return usb_dci_ep_set_stall(&function->dev->usb_dci, ep_address);
 }
 
-static mx_status_t usb_func_ep_clear_stall(void* ctx, uint8_t ep_address) {
+static zx_status_t usb_func_ep_clear_stall(void* ctx, uint8_t ep_address) {
     usb_function_t* function = ctx;
     return usb_dci_ep_clear_stall(&function->dev->usb_dci, ep_address);
 }
@@ -309,7 +309,7 @@
     .ep_clear_stall = usb_func_ep_clear_stall,
 };
 
-static mx_status_t usb_dev_get_descriptor(usb_device_t* dev, uint8_t request_type,
+static zx_status_t usb_dev_get_descriptor(usb_device_t* dev, uint8_t request_type,
                                           uint16_t value, uint16_t index, void* buffer,
                                           size_t length, size_t* out_actual) {
     uint8_t type = request_type & USB_TYPE_MASK;
@@ -320,23 +320,23 @@
             const usb_device_descriptor_t* desc = &dev->device_desc;
             if (desc->bLength == 0) {
                 dprintf(ERROR, "usb_dev_get_descriptor: device descriptor not set\n");
-                return MX_ERR_INTERNAL;
+                return ZX_ERR_INTERNAL;
             }
             if (length > sizeof(*desc)) length = sizeof(*desc);
             memcpy(buffer, desc, length);
             *out_actual = length;
-            return MX_OK;
+            return ZX_OK;
         } else if (desc_type == USB_DT_CONFIG && index == 0) {
             const usb_configuration_descriptor_t* desc = dev->config_desc;
             if (!desc) {
                 dprintf(ERROR, "usb_dev_get_descriptor: configuration descriptor not set\n");
-                return MX_ERR_INTERNAL;
+                return ZX_ERR_INTERNAL;
             }
             uint16_t desc_length = letoh16(desc->wTotalLength);
             if (length > desc_length) length =desc_length;
             memcpy(buffer, desc, length);
             *out_actual = length;
-            return MX_OK;
+            return ZX_OK;
         }
         else if (value >> 8 == USB_DT_STRING) {
             uint8_t desc[255];
@@ -352,7 +352,7 @@
             } else {
                 char* string = dev->strings[string_index];
                 if (!string) {
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
                 unsigned index = 2;
 
@@ -372,16 +372,16 @@
             if (header->bLength < length) length = header->bLength;
             memcpy(buffer, desc, length);
             *out_actual = length;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
     dprintf(ERROR, "usb_device_get_descriptor unsupported value: %d index: %d\n", value, index);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t usb_dev_set_configuration(usb_device_t* dev, uint8_t configuration) {
-    mx_status_t status = MX_OK;
+static zx_status_t usb_dev_set_configuration(usb_device_t* dev, uint8_t configuration) {
+    zx_status_t status = ZX_OK;
     bool configured = configuration > 0;
 
     mtx_lock(&dev->lock);
@@ -390,7 +390,7 @@
     list_for_every_entry(&dev->functions, function, usb_function_t, node) {
         if (function->interface.ops) {
             status = usb_function_set_configured(&function->interface, configured, dev->speed);
-            if (status != MX_OK && configured) {
+            if (status != ZX_OK && configured) {
                 goto fail;
             }
         }
@@ -403,16 +403,16 @@
     return status;
 }
 
-static mx_status_t usb_dev_set_interface(usb_device_t* dev, unsigned interface,
+static zx_status_t usb_dev_set_interface(usb_device_t* dev, unsigned interface,
                                          unsigned alt_setting) {
     usb_function_t* function = dev->interface_map[interface];
     if (function && function->interface.ops) {
         return usb_function_set_interface(&function->interface, interface, alt_setting);
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t usb_dev_control(void* ctx, const usb_setup_t* setup, void* buffer,
+static zx_status_t usb_dev_control(void* ctx, const usb_setup_t* setup, void* buffer,
                                    size_t buffer_length, size_t* out_actual) {
     usb_device_t* dev = ctx;
     uint8_t request_type = setup->bmRequestType;
@@ -439,7 +439,7 @@
                    request == USB_REQ_GET_CONFIGURATION && length > 0) {
             *((uint8_t *)buffer) = dev->configuration;
             *out_actual = sizeof(uint8_t);
-            return MX_OK;
+            return ZX_OK;
         }
         break;
     case USB_RECIP_INTERFACE: {
@@ -460,7 +460,7 @@
         // delegate to the function driver for the endpoint
         index = ep_address_to_index(index);
         if (index == 0 || index >= USB_MAX_EPS) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         usb_function_t* function = dev->endpoint_map[index];
         if (function && function->interface.ops) {
@@ -475,7 +475,7 @@
         break;
     }
 
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static void usb_dev_set_connected(void* ctx, bool connected) {
@@ -505,78 +505,78 @@
     .set_speed = usb_dev_set_speed,
 };
 
-static mx_status_t usb_dev_set_device_desc(usb_device_t* dev, const void* in_buf, size_t in_len) {
+static zx_status_t usb_dev_set_device_desc(usb_device_t* dev, const void* in_buf, size_t in_len) {
     if (in_len != sizeof(dev->device_desc)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     const usb_device_descriptor_t* desc = in_buf;
     if (desc->bLength != sizeof(*desc) ||
         desc->bDescriptorType != USB_DT_DEVICE) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (desc->bNumConfigurations != 1) {
         dprintf(ERROR, "usb_device_ioctl: bNumConfigurations: %u, only 1 supported\n",
                 desc->bNumConfigurations);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     memcpy(&dev->device_desc, desc, sizeof(dev->device_desc));
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_dev_alloc_string_desc(usb_device_t* dev, const void* in_buf, size_t in_len,
+static zx_status_t usb_dev_alloc_string_desc(usb_device_t* dev, const void* in_buf, size_t in_len,
                                              void* out_buf, size_t out_len, size_t* out_actual) {
     if (in_len < 2 || out_len < sizeof(uint8_t)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // make sure string is zero terminated
     *((char *)in_buf + in_len - 1) = 0;
 
     uint8_t index;
-    mx_status_t status = usb_device_alloc_string_desc(dev, in_buf, &index);
-    if (status != MX_OK) {
+    zx_status_t status = usb_device_alloc_string_desc(dev, in_buf, &index);
+    if (status != ZX_OK) {
         return status;
      }
 
     *((uint8_t *)out_buf) = index;
     *out_actual = sizeof(index);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_dev_add_function(usb_device_t* dev, const void* in_buf, size_t in_len) {
+static zx_status_t usb_dev_add_function(usb_device_t* dev, const void* in_buf, size_t in_len) {
     if (in_len != sizeof(usb_function_descriptor_t)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (dev->functions_bound) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     usb_function_t* function = calloc(1, sizeof(usb_function_t));
     if (!function) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     function->dci_dev = dev->dci_dev;
     function->dev = dev;
     memcpy(&function->desc, in_buf, sizeof(function->desc));
     list_add_tail(&dev->functions, &function->node);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_dev_bind_functions(usb_device_t* dev) {
+static zx_status_t usb_dev_bind_functions(usb_device_t* dev) {
     if (dev->functions_bound) {
         dprintf(ERROR, "usb_dev_bind_functions: already bound!\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     usb_device_descriptor_t* device_desc = &dev->device_desc;
     if (device_desc->bLength == 0) {
         dprintf(ERROR, "usb_dev_bind_functions: device descriptor not set\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (list_is_empty(&dev->functions)) {
         dprintf(ERROR, "usb_dev_bind_functions: no functions to bind\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     int index = 0;
@@ -587,8 +587,8 @@
 
         usb_function_descriptor_t* desc = &function->desc;
 
-        mx_device_prop_t props[] = {
-            { BIND_PROTOCOL, 0, MX_PROTOCOL_USB_FUNCTION },
+        zx_device_prop_t props[] = {
+            { BIND_PROTOCOL, 0, ZX_PROTOCOL_USB_FUNCTION },
             { BIND_USB_CLASS, 0, desc->interface_class },
             { BIND_USB_SUBCLASS, 0, desc->interface_subclass },
             { BIND_USB_PROTOCOL, 0, desc->interface_protocol },
@@ -601,14 +601,14 @@
             .name = name,
             .ctx = function,
             .ops = &function_proto,
-            .proto_id = MX_PROTOCOL_USB_FUNCTION,
+            .proto_id = ZX_PROTOCOL_USB_FUNCTION,
             .proto_ops = &usb_function_proto,
             .props = props,
             .prop_count = countof(props),
         };
 
-        mx_status_t status = device_add(dev->mxdev, &args, &function->mxdev);
-        if (status != MX_OK) {
+        zx_status_t status = device_add(dev->mxdev, &args, &function->mxdev);
+        if (status != ZX_OK) {
             dprintf(ERROR, "usb_dev_bind_functions add_device failed %d\n", status);
             return status;
         }
@@ -618,10 +618,10 @@
 
     dev->functions_bound = true;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_dev_clear_functions(usb_device_t* dev) {
+static zx_status_t usb_dev_clear_functions(usb_device_t* dev) {
     usb_function_t* function;
     while ((function = list_remove_head_type(&dev->functions, usb_function_t, node)) != NULL) {
         device_remove(function->mxdev);
@@ -635,10 +635,10 @@
         free(dev->strings[i]);
         dev->strings[i] = NULL;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_dev_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
+static zx_status_t usb_dev_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
                                  void* out_buf, size_t out_len, size_t* out_actual) {
     dprintf(TRACE, "usb_dev_ioctl %x\n", op);
     usb_device_t* dev = ctx;
@@ -655,7 +655,7 @@
     case IOCTL_USB_DEVICE_CLEAR_FUNCTIONS:
         return usb_dev_clear_functions(dev);
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -676,7 +676,7 @@
     free(dev);
 }
 
-static mx_protocol_device_t device_proto = {
+static zx_protocol_device_t device_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = usb_dev_ioctl,
     .unbind = usb_dev_unbind,
@@ -684,7 +684,7 @@
 };
 
 #if defined(USB_DEVICE_VID) && defined(USB_DEVICE_PID) && defined(USB_DEVICE_FUNCTIONS)
-static mx_status_t usb_dev_set_default_config(usb_device_t* dev) {
+static zx_status_t usb_dev_set_default_config(usb_device_t* dev) {
     usb_device_descriptor_t device_desc = {
         .bLength = sizeof(usb_device_descriptor_t),
         .bDescriptorType = USB_DT_DEVICE,
@@ -699,23 +699,23 @@
         .bNumConfigurations = 1,
     };
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
 #ifdef USB_DEVICE_MANUFACTURER
     status = usb_device_alloc_string_desc(dev, USB_DEVICE_MANUFACTURER, &device_desc.iManufacturer);
-    if (status != MX_OK) return status;
+    if (status != ZX_OK) return status;
 #endif
 #ifdef USB_DEVICE_PRODUCT
     usb_device_alloc_string_desc(dev, USB_DEVICE_PRODUCT, &device_desc.iProduct);
-    if (status != MX_OK) return status;
+    if (status != ZX_OK) return status;
 #endif
 #ifdef USB_DEVICE_SERIAL
     usb_device_alloc_string_desc(dev, USB_DEVICE_SERIAL, &device_desc.iSerialNumber);
-    if (status != MX_OK) return status;
+    if (status != ZX_OK) return status;
 #endif
 
     status = usb_dev_set_device_desc(dev, &device_desc, sizeof(device_desc));
-    if (status != MX_OK) return status;
+    if (status != ZX_OK) return status;
 
     usb_function_descriptor_t function_desc;
     if (strcasecmp(USB_DEVICE_FUNCTIONS, "cdc") == 0) {
@@ -728,30 +728,30 @@
         function_desc.interface_protocol = USB_PROTOCOL_MSC_BULK_ONLY;
     } else {
         dprintf(ERROR, "usb_dev_set_default_config: unknown function %s\n", USB_DEVICE_FUNCTIONS);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     status = usb_dev_add_function(dev, &function_desc, sizeof(function_desc));
-    if (status != MX_OK) return status;
+    if (status != ZX_OK) return status;
 
     return usb_dev_bind_functions(dev);
 }
 #endif // defined(USB_DEVICE_VID) && defined(USB_DEVICE_PID) && defined(USB_DEVICE_FUNCTIONS)
 
-mx_status_t usb_dev_bind(void* ctx, mx_device_t* parent, void** cookie) {
+zx_status_t usb_dev_bind(void* ctx, zx_device_t* parent, void** cookie) {
     dprintf(INFO, "usb_dev_bind\n");
 
     usb_device_t* dev = calloc(1, sizeof(usb_device_t));
     if (!dev) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     list_initialize(&dev->functions);
     mtx_init(&dev->lock, mtx_plain);
     dev->dci_dev = parent;
 
-    if (device_get_protocol(parent, MX_PROTOCOL_USB_DCI, &dev->usb_dci)) {
+    if (device_get_protocol(parent, ZX_PROTOCOL_USB_DCI, &dev->usb_dci)) {
         free(dev);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     device_add_args_t args = {
@@ -759,12 +759,12 @@
         .name = "usb-device",
         .ctx = dev,
         .ops = &device_proto,
-        .proto_id = MX_PROTOCOL_USB_DEVICE,
+        .proto_id = ZX_PROTOCOL_USB_DEVICE,
         .flags = DEVICE_ADD_NON_BINDABLE,
     };
 
-    mx_status_t status = device_add(parent, &args, &dev->mxdev);
-    if (status != MX_OK) {
+    zx_status_t status = device_add(parent, &args, &dev->mxdev);
+    if (status != ZX_OK) {
         dprintf(ERROR, "usb_device_bind add_device failed %d\n", status);
         free(dev);
         return status;
@@ -781,15 +781,15 @@
     usb_dev_set_default_config(dev);
 #endif
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t usb_device_ops = {
+static zx_driver_ops_t usb_device_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = usb_dev_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(usb_device, usb_device_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_USB_DCI),
-MAGENTA_DRIVER_END(usb_device)
+ZIRCON_DRIVER_BEGIN(usb_device, usb_device_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_USB_DCI),
+ZIRCON_DRIVER_END(usb_device)
diff --git a/system/dev/usb/bcm-usb-dwc/bcm-usb-dwc.c b/system/dev/usb/bcm-usb-dwc/bcm-usb-dwc.c
index 9124238..fb14457 100644
--- a/system/dev/usb/bcm-usb-dwc/bcm-usb-dwc.c
+++ b/system/dev/usb/bcm-usb-dwc/bcm-usb-dwc.c
@@ -18,9 +18,9 @@
 #include <ddk/protocol/usb-hci.h>
 #include <ddk/protocol/usb.h>
 
-// Magenta USB includes
-#include <magenta/hw/usb-hub.h>
-#include <magenta/hw/usb.h>
+// Zircon USB includes
+#include <zircon/hw/usb-hub.h>
+#include <zircon/hw/usb.h>
 #include <sync/completion.h>
 
 // BCM28xx Specific Includes
@@ -28,7 +28,7 @@
 #include <bcm/ioctl.h>
 #include <bcm28xx/usb_dwc_regs.h>
 
-#include <magenta/process.h>
+#include <zircon/process.h>
 
 #define NUM_HOST_CHANNELS 8
 #define PAGE_MASK_4K (0xFFF)
@@ -115,11 +115,11 @@
 } dwc_usb_device_t;
 
 typedef struct dwc_usb {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     usb_bus_interface_t bus;
-    mx_handle_t irq_handle;
+    zx_handle_t irq_handle;
     thrd_t irq_thread;
-    mx_device_t* parent;
+    zx_device_t* parent;
 
     // Pertaining to root hub transactions.
     mtx_t rh_txn_mtx;
@@ -189,7 +189,7 @@
 
 static const uint8_t dwc_language_list[] =
     {4, /* bLength */ USB_DT_STRING, 0x09, 0x04, /* language ID */};
-static const uint8_t dwc_manufacturer_string[] = // "Magenta"
+static const uint8_t dwc_manufacturer_string[] = // "Zircon"
     {18, /* bLength */ USB_DT_STRING, 'M', 0, 'a', 0, 'g', 0, 'e', 0, 'n', 0, 't', 0, 'a', 0, 0, 0};
 static const uint8_t dwc_product_string_2[] = // "USB 2.0 Root Hub"
     {
@@ -276,7 +276,7 @@
 // Completes the iotxn associated with a request then cleans up the request.
 static void complete_request(
     dwc_usb_transfer_request_t* req,
-    mx_status_t status,
+    zx_status_t status,
     size_t length,
     dwc_usb_t* dwc) {
     if (req->setuptxn) {
@@ -290,7 +290,7 @@
 
     // Invalidate caches over this region since the DMA engine may have moved
     // data below us.
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         iotxn_cacheop(txn, IOTXN_CACHE_INVALIDATE, txn->offset, length);
     }
 
@@ -321,7 +321,7 @@
             iotxn_t* txn = dwc->rh_intr_req->txn;
             uint16_t val = 0x2;
             iotxn_copyto(txn, (void*)&val, sizeof(val), 0);
-            complete_request(dwc->rh_intr_req, MX_OK, sizeof(val), dwc);
+            complete_request(dwc->rh_intr_req, ZX_OK, sizeof(val), dwc);
             dwc->rh_intr_req = NULL;
         }
     }
@@ -340,7 +340,7 @@
 
     // Spec defines that we must wait this long for a host port reset to settle
     // in.
-    mx_nanosleep(mx_deadline_after(MX_MSEC(60)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(60)));
 
     hw_status.reset = 0;
     regs->host_port_ctrlstatus = hw_status;
@@ -357,7 +357,7 @@
     regs->host_port_ctrlstatus = hw_status;
 }
 
-static mx_status_t usb_dwc_softreset_core(void) {
+static zx_status_t usb_dwc_softreset_core(void) {
     while (!(regs->core_reset & DWC_AHB_MASTER_IDLE))
         ;
 
@@ -365,10 +365,10 @@
     while (regs->core_reset & DWC_SOFT_RESET)
         ;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_dwc_setupcontroller(void) {
+static zx_status_t usb_dwc_setupcontroller(void) {
     const uint32_t rx_words = 1024;
     const uint32_t tx_words = 1024;
     const uint32_t ptx_words = 1024;
@@ -391,7 +391,7 @@
 
     regs->ahb_configuration |= DWC_AHB_INTERRUPT_ENABLE;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Queue a transaction on the DWC root hub.
@@ -490,7 +490,7 @@
     if (!req) {
         // If we can't allocate memory for the request, complete the iotxn with
         // a failure.
-        iotxn_complete(txn, MX_ERR_NO_MEMORY, 0);
+        iotxn_complete(txn, ZX_ERR_NO_MEMORY, 0);
         return;
     }
 
@@ -511,8 +511,8 @@
     return PAGE_SIZE;
 }
 
-static mx_status_t dwc_cancel_all(void* ctx, uint32_t device_id, uint8_t ep_address) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t dwc_cancel_all(void* ctx, uint32_t device_id, uint8_t ep_address) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static void dwc_iotxn_queue(void* ctx, iotxn_t* txn) {
@@ -520,7 +520,7 @@
     usb_protocol_data_t* data = iotxn_pdata(txn, usb_protocol_data_t);
 
     if (txn->length > dwc_get_max_transfer_size(usb_dwc->mxdev, data->device_id, data->ep_address)) {
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
     } else {
         dwc_usb_t* dwc = ctx;
         do_dwc_iotxn_queue(dwc, txn);
@@ -535,7 +535,7 @@
     dprintf(ERROR, "dwc_usb: dwc_release not implemented\n");
 }
 
-static mx_protocol_device_t dwc_device_proto = {
+static zx_protocol_device_t dwc_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = dwc_iotxn_queue,
     .unbind = dwc_unbind,
@@ -557,7 +557,7 @@
     return MAX_DEVICE_COUNT;
 }
 
-static mx_status_t dwc_enable_ep(void* _ctx, uint32_t device_id,
+static zx_status_t dwc_enable_ep(void* _ctx, uint32_t device_id,
                                  usb_endpoint_descriptor_t* ep_desc,
                                  usb_ss_ep_comp_descriptor_t* ss_comp_desc,
                                  bool enable) {
@@ -568,7 +568,7 @@
 
     if (device_id == ROOT_HUB_DEVICE_ID) {
         // Nothing to be done for root hub.
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Disabling endpoints not supported at this time.
@@ -597,25 +597,25 @@
     list_add_tail(&dev->endpoints, &ep->node);
     mtx_unlock(&dev->devmtx);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static uint64_t dwc_get_frame(void* ctx) {
     dprintf(ERROR, "dwc_usb: dwc_get_frame not implemented\n");
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t dwc_config_hub(void* ctx, uint32_t device_id, usb_speed_t speed,
+zx_status_t dwc_config_hub(void* ctx, uint32_t device_id, usb_speed_t speed,
                            usb_hub_descriptor_t* descriptor) {
     // Not sure if DWC controller has to take any specific action here.
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void usb_control_complete(iotxn_t* txn, void* cookie) {
     completion_signal((completion_t*)cookie);
 }
 
-mx_status_t dwc_hub_device_added(void* _ctx, uint32_t hub_address, int port,
+zx_status_t dwc_hub_device_added(void* _ctx, uint32_t hub_address, int port,
                                  usb_speed_t speed) {
     // Since a new device was just added it has a device address of 0 on the
     // bus until it is enumerated.
@@ -650,12 +650,12 @@
     ep0->desc.wMaxPacketSize = 8;
 
     iotxn_t* get_desc;
-    mx_status_t status = iotxn_alloc(&get_desc, IOTXN_ALLOC_CONTIGUOUS | IOTXN_ALLOC_POOL, 64);
-    assert(status == MX_OK);
+    zx_status_t status = iotxn_alloc(&get_desc, IOTXN_ALLOC_CONTIGUOUS | IOTXN_ALLOC_POOL, 64);
+    assert(status == ZX_OK);
 
     completion_t completion = COMPLETION_INIT;
 
-    get_desc->protocol = MX_PROTOCOL_USB;
+    get_desc->protocol = ZX_PROTOCOL_USB;
     get_desc->complete_cb = usb_control_complete;
     get_desc->cookie = &completion;
     get_desc->length = 8;
@@ -672,7 +672,7 @@
     pdata->setup.wLength = 8;
 
     iotxn_queue(dwc->mxdev, get_desc);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 
     usb_device_descriptor_t short_descriptor;
     iotxn_copyfrom(get_desc, &short_descriptor, get_desc->actual, 0);
@@ -683,11 +683,11 @@
     // Set the Device ID of the newly added device.
     iotxn_t* set_addr;
     status = iotxn_alloc(&set_addr, IOTXN_ALLOC_CONTIGUOUS | IOTXN_ALLOC_POOL, 64);
-    assert(status == MX_OK);
+    assert(status == ZX_OK);
 
     completion_reset(&completion);
 
-    set_addr->protocol = MX_PROTOCOL_USB;
+    set_addr->protocol = ZX_PROTOCOL_USB;
     set_addr->complete_cb = usb_control_complete;
     set_addr->cookie = &completion;
     set_addr->length = 0;
@@ -704,9 +704,9 @@
     pdata->setup.wLength = 0;
 
     iotxn_queue(dwc->mxdev, set_addr);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(10)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(10)));
 
     iotxn_release(set_addr);
     iotxn_release(get_desc);
@@ -748,15 +748,15 @@
 
     dwc->next_device_address++;
 
-    return MX_OK;
+    return ZX_OK;
 }
-mx_status_t dwc_hub_device_removed(void* ctx, uint32_t hub_address, int port) {
+zx_status_t dwc_hub_device_removed(void* ctx, uint32_t hub_address, int port) {
     dprintf(ERROR, "dwc_usb: dwc_hub_device_removed not implemented\n");
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t dwc_reset_endpoint(void* ctx, uint32_t device_id, uint8_t ep_address) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t dwc_reset_endpoint(void* ctx, uint32_t device_id, uint8_t ep_address) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static usb_hci_protocol_ops_t dwc_hci_protocol = {
@@ -855,31 +855,31 @@
     dwc_usb_t* dwc = (dwc_usb_t*)arg;
 
     while (1) {
-        mx_status_t wait_res;
+        zx_status_t wait_res;
 
-        wait_res = mx_interrupt_wait(dwc->irq_handle);
-        if (wait_res != MX_OK)
+        wait_res = zx_interrupt_wait(dwc->irq_handle);
+        if (wait_res != ZX_OK)
             dprintf(ERROR, "dwc_usb: irq wait failed, retcode = %d\n", wait_res);
 
         dwc_handle_irq(dwc);
 
-        mx_interrupt_complete(dwc->irq_handle);
+        zx_interrupt_complete(dwc->irq_handle);
     }
 
     dprintf(INFO, "dwc_usb: irq thread finished\n");
     return 0;
 }
 
-static mx_status_t dwc_host_port_set_feature(uint16_t feature) {
+static zx_status_t dwc_host_port_set_feature(uint16_t feature) {
     if (feature == USB_FEATURE_PORT_POWER) {
         dwc_host_port_power_on();
-        return MX_OK;
+        return ZX_OK;
     } else if (feature == USB_FEATURE_PORT_RESET) {
         dwc_reset_host_port();
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static void dwc_root_hub_get_descriptor(dwc_usb_transfer_request_t* req,
@@ -897,7 +897,7 @@
         if (length > sizeof(usb_device_descriptor_t))
             length = sizeof(usb_device_descriptor_t);
         iotxn_copyto(txn, &dwc_rh_descriptor, length, 0);
-        complete_request(req, MX_OK, length, dwc);
+        complete_request(req, ZX_OK, length, dwc);
     } else if (desc_type == USB_DT_CONFIG && index == 0) {
         usb_configuration_descriptor_t* config_desc =
             (usb_configuration_descriptor_t*)&dwc_rh_config_descriptor;
@@ -905,7 +905,7 @@
         if (length > desc_length)
             length = desc_length;
         iotxn_copyto(txn, &dwc_rh_config_descriptor, length, 0);
-        complete_request(req, MX_OK, length, dwc);
+        complete_request(req, ZX_OK, length, dwc);
     } else if (value >> 8 == USB_DT_STRING) {
         uint8_t string_index = value & 0xFF;
         if (string_index < countof(dwc_rh_string_table)) {
@@ -914,9 +914,9 @@
                 length = string[0];
 
             iotxn_copyto(txn, string, length, 0);
-            complete_request(req, MX_OK, length, dwc);
+            complete_request(req, ZX_OK, length, dwc);
         } else {
-            complete_request(req, MX_ERR_NOT_SUPPORTED, 0, dwc);
+            complete_request(req, ZX_ERR_NOT_SUPPORTED, 0, dwc);
         }
     }
 }
@@ -930,13 +930,13 @@
     uint8_t request = setup->bRequest;
 
     if (request == USB_REQ_SET_ADDRESS) {
-        complete_request(req, MX_OK, 0, dwc);
+        complete_request(req, ZX_OK, 0, dwc);
     } else if (request == USB_REQ_GET_DESCRIPTOR) {
         dwc_root_hub_get_descriptor(req, dwc);
     } else if (request == USB_REQ_SET_CONFIGURATION) {
-        complete_request(req, MX_OK, 0, dwc);
+        complete_request(req, ZX_OK, 0, dwc);
     } else {
-        complete_request(req, MX_ERR_NOT_SUPPORTED, 0, dwc);
+        complete_request(req, ZX_ERR_NOT_SUPPORTED, 0, dwc);
     }
 }
 
@@ -963,11 +963,11 @@
             if (length > sizeof(desc))
                 length = sizeof(desc);
             iotxn_copyto(txn, &desc, length, 0);
-            complete_request(req, MX_OK, length, dwc);
+            complete_request(req, ZX_OK, length, dwc);
             return;
         }
     } else if (request == USB_REQ_SET_FEATURE) {
-        mx_status_t res = dwc_host_port_set_feature(value);
+        zx_status_t res = dwc_host_port_set_feature(value);
         complete_request(req, res, 0, dwc);
     } else if (request == USB_REQ_CLEAR_FEATURE) {
         mtx_lock(&dwc->rh_status_mtx);
@@ -990,7 +990,7 @@
             break;
         }
         mtx_unlock(&dwc->rh_status_mtx);
-        complete_request(req, MX_OK, 0, dwc);
+        complete_request(req, ZX_OK, 0, dwc);
     } else if (request == USB_REQ_GET_STATUS) {
         size_t length = txn->length;
         if (length > sizeof(dwc->root_port_status)) {
@@ -1001,9 +1001,9 @@
         iotxn_copyto(txn, &dwc->root_port_status, length, 0);
         mtx_unlock(&dwc->rh_status_mtx);
 
-        complete_request(req, MX_OK, length, dwc);
+        complete_request(req, ZX_OK, length, dwc);
     } else {
-        complete_request(req, MX_ERR_NOT_SUPPORTED, 0, dwc);
+        complete_request(req, ZX_ERR_NOT_SUPPORTED, 0, dwc);
     }
 }
 
@@ -1044,7 +1044,7 @@
     dwc->rh_txn_completion = COMPLETION_INIT;
 
     while (true) {
-        completion_wait(&dwc->rh_txn_completion, MX_TIME_INFINITE);
+        completion_wait(&dwc->rh_txn_completion, ZX_TIME_INFINITE);
 
         mtx_lock(&dwc->rh_txn_mtx);
 
@@ -1096,7 +1096,7 @@
 
         // We couldn't find a free channel, wait for somebody to tell us to
         // wake up and attempt to acquire a channel again.
-        completion_wait(&dwc->free_channel_completion, MX_TIME_INFINITE);
+        completion_wait(&dwc->free_channel_completion, ZX_TIME_INFINITE);
     }
 
     __UNREACHABLE;
@@ -1146,7 +1146,7 @@
 }
 
 static union dwc_host_channel_interrupts dwc_await_channel_complete(uint32_t channel, dwc_usb_t* dwc) {
-    completion_wait(&dwc->channel_complete[channel], MX_TIME_INFINITE);
+    completion_wait(&dwc->channel_complete[channel], ZX_TIME_INFINITE);
     completion_reset(&dwc->channel_complete[channel]);
     return dwc->channel_interrupts[channel];
 }
@@ -1306,7 +1306,7 @@
         // Block until we get a sof interrupt.
 
         completion_reset(&dwc->sof_waiters[channel]);
-        completion_wait(&dwc->sof_waiters[channel], MX_TIME_INFINITE);
+        completion_wait(&dwc->sof_waiters[channel], ZX_TIME_INFINITE);
 
         mtx_lock(&dwc->sof_waiters_mtx);
 
@@ -1372,7 +1372,7 @@
 
                 release_channel(channel, dwc);
 
-                complete_request(req, MX_ERR_IO, 0, dwc);
+                complete_request(req, ZX_ERR_IO, 0, dwc);
 
                 return true;
             }
@@ -1417,7 +1417,7 @@
             }
 
             release_channel(channel, dwc);
-            complete_request(req, MX_OK, req->bytes_transferred, dwc);
+            complete_request(req, ZX_OK, req->bytes_transferred, dwc);
             return true;
         } else {
             if (chanptr->split_control.split_enable) {
@@ -1436,7 +1436,7 @@
             return false;
         } else {
             release_channel(channel, dwc);
-            complete_request(req, MX_ERR_IO, 0, dwc);
+            complete_request(req, ZX_ERR_IO, 0, dwc);
             return true;
         }
     }
@@ -1468,7 +1468,7 @@
         release_channel(channel, dwc);
 
         // Complete the request with a failure.
-        complete_request(req, MX_ERR_IO, 0, dwc);
+        complete_request(req, ZX_ERR_IO, 0, dwc);
 
         return true;
     } else if (interrupts.frame_overrun) {
@@ -1489,7 +1489,7 @@
     } else if (interrupts.nak_response_received) {
         // Wait a defined period of time
         uint8_t bInterval = ep->desc.bInterval;
-        mx_duration_t sleep_ns;
+        zx_duration_t sleep_ns;
 
         req->next_data_toggle = chanptr->transfer.packet_id;
 
@@ -1506,14 +1506,14 @@
         if (ep->parent->speed == USB_SPEED_HIGH) {
             sleep_ns = (1 << (bInterval - 1)) * 125000;
         } else {
-            sleep_ns = MX_MSEC(bInterval);
+            sleep_ns = ZX_MSEC(bInterval);
         }
 
         if (!sleep_ns) {
-            sleep_ns = MX_MSEC(1);
+            sleep_ns = ZX_MSEC(1);
         }
 
-        mx_nanosleep(mx_deadline_after(sleep_ns));
+        zx_nanosleep(zx_deadline_after(sleep_ns));
         await_sof_if_necessary(channel, req, ep, dwc);
 
         req->complete_split = false;
@@ -1532,7 +1532,7 @@
         // Wait half a microframe to retry a NYET, otherwise wait for the start
         // of the next frame.
         if (usb_ep_type(&ep->desc) != USB_ENDPOINT_INTERRUPT) {
-            mx_nanosleep(mx_deadline_after(62500));
+            zx_nanosleep(zx_deadline_after(62500));
         }
         await_sof_if_necessary(channel, req, ep, dwc);
         dprintf(TRACE, "dwc_usb: requeue nyet on ep = %u, devid = %u\n",
@@ -1562,9 +1562,9 @@
     dwc_usb_data_toggle_t next_data_toggle = 0;
     uint channel = NUM_HOST_CHANNELS + 1;
     while (true) {
-        mx_status_t res =
-            completion_wait(&self->request_pending_completion, MX_TIME_INFINITE);
-        if (res != MX_OK) {
+        zx_status_t res =
+            completion_wait(&self->request_pending_completion, ZX_TIME_INFINITE);
+        if (res != ZX_OK) {
             dprintf(ERROR, "dwc_usb: completion wait failed, retcode = %d, "
                     "device_id = %u, ep = %u\n", res, self->parent->device_id,
                     self->ep_address);
@@ -1594,9 +1594,9 @@
                 channel = acquire_channel_blocking(dwc);
 
                 // Allocate an iotxn for the SETUP packet.
-                mx_status_t status =
+                zx_status_t status =
                     iotxn_alloc(&req->setuptxn, IOTXN_ALLOC_CONTIGUOUS | IOTXN_ALLOC_POOL, sizeof(usb_setup_t));
-                assert(status == MX_OK);
+                assert(status == ZX_OK);
 
                 usb_protocol_data_t* pdata =
                     iotxn_pdata(req->txn, usb_protocol_data_t);
@@ -1649,8 +1649,8 @@
     return -1;
 }
 
-static mx_status_t create_default_device(dwc_usb_t* dwc) {
-    mx_status_t retval = MX_OK;
+static zx_status_t create_default_device(dwc_usb_t* dwc) {
+    zx_status_t retval = ZX_OK;
 
     dwc_usb_device_t* default_device = &dwc->usb_devices[0];
 
@@ -1667,7 +1667,7 @@
     // Create a control endpoint for the default device.
     dwc_usb_endpoint_t* ep0 = calloc(1, sizeof(*ep0));
     if (!ep0) {
-        retval = MX_ERR_NO_MEMORY;
+        retval = ZX_ERR_NO_MEMORY;
     }
 
     ep0->ep_address = 0;
@@ -1702,14 +1702,14 @@
 }
 
 // Bind is the entry point for this driver.
-static mx_status_t usb_dwc_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t usb_dwc_bind(void* ctx, zx_device_t* dev, void** cookie) {
     dprintf(TRACE, "usb_dwc: bind dev = %p\n", dev);
 
     dwc_usb_t* usb_dwc = NULL;
 
     platform_device_protocol_t proto;
-    mx_status_t st = device_get_protocol(dev, MX_PROTOCOL_PLATFORM_DEV, &proto);
-    if (st != MX_OK) {
+    zx_status_t st = device_get_protocol(dev, ZX_PROTOCOL_PLATFORM_DEV, &proto);
+    if (st != ZX_OK) {
         return st;
     }
 
@@ -1717,7 +1717,7 @@
     usb_dwc = calloc(1, sizeof(*usb_dwc));
     if (!usb_dwc) {
         dprintf(ERROR, "usb_dwc: bind failed to allocate usb_dwc struct\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     usb_dwc->free_channel_completion = COMPLETION_INIT;
@@ -1727,17 +1727,17 @@
 
     // Carve out some address space for this device.
     size_t mmio_size;
-    mx_handle_t mmio_handle = MX_HANDLE_INVALID;
-    st = pdev_map_mmio(&proto, MMIO_INDEX, MX_CACHE_POLICY_UNCACHED_DEVICE, (void **)&regs,
+    zx_handle_t mmio_handle = ZX_HANDLE_INVALID;
+    st = pdev_map_mmio(&proto, MMIO_INDEX, ZX_CACHE_POLICY_UNCACHED_DEVICE, (void **)&regs,
                        &mmio_size, &mmio_handle);
-    if (st != MX_OK) {
+    if (st != ZX_OK) {
         dprintf(ERROR, "usb_dwc: bind failed to pdev_map_mmio.\n");
         goto error_return;
     }
 
     // Create an IRQ Handle for this device.
     st = pdev_map_interrupt(&proto, IRQ_INDEX, &usb_dwc->irq_handle);
-    if (st != MX_OK) {
+    if (st != ZX_OK) {
         dprintf(ERROR, "usb_dwc: bind failed to map usb irq.\n");
         goto error_return;
     }
@@ -1754,12 +1754,12 @@
     // The BCM Mailbox Driver currently turns on USB power but it should be
     // done here instead.
 
-    if ((st = usb_dwc_softreset_core()) != MX_OK) {
+    if ((st = usb_dwc_softreset_core()) != ZX_OK) {
         dprintf(ERROR, "usb_dwc: failed to reset core.\n");
         goto error_return;
     }
 
-    if ((st = usb_dwc_setupcontroller()) != MX_OK) {
+    if ((st = usb_dwc_setupcontroller()) != ZX_OK) {
         dprintf(ERROR, "usb_dwc: failed setup controller.\n");
         goto error_return;
     }
@@ -1773,7 +1773,7 @@
     // We create a mock device at device_id = 0 for enumeration purposes.
     // Any new device that connects to the bus is assigned this ID until we
     // set its address.
-    if ((st = create_default_device(usb_dwc)) != MX_OK) {
+    if ((st = create_default_device(usb_dwc)) != ZX_OK) {
         dprintf(ERROR, "usb_dwc: failed to create default device. "
                 "retcode = %d\n", st);
         goto error_return;
@@ -1784,11 +1784,11 @@
         .name = "bcm-usb-dwc",
         .ctx = usb_dwc,
         .ops = &dwc_device_proto,
-        .proto_id = MX_PROTOCOL_USB_HCI,
+        .proto_id = ZX_PROTOCOL_USB_HCI,
         .proto_ops = &dwc_hci_protocol,
     };
 
-    if ((st = device_add(dev, &args, &usb_dwc->mxdev)) != MX_OK) {
+    if ((st = device_add(dev, &args, &usb_dwc->mxdev)) != ZX_OK) {
         free(usb_dwc);
         return st;
     }
@@ -1805,30 +1805,30 @@
     thrd_detach(irq_thread);
 
     dprintf(TRACE, "usb_dwc: bind success!\n");
-    return MX_OK;
+    return ZX_OK;
 
 error_return:
     if (regs) {
-        mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)regs, mmio_size);
+        zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)regs, mmio_size);
     }
-    mx_handle_close(mmio_handle);
+    zx_handle_close(mmio_handle);
     if (usb_dwc) {
-        mx_handle_close(usb_dwc->irq_handle);
+        zx_handle_close(usb_dwc->irq_handle);
         free(usb_dwc);
     }
 
     return st;
 }
 
-static mx_driver_ops_t usb_dwc_driver_ops = {
+static zx_driver_ops_t usb_dwc_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = usb_dwc_bind,
 };
 
 // The formatter does not play nice with these macros.
 // clang-format off
-MAGENTA_DRIVER_BEGIN(bcm_usb_dwc, usb_dwc_driver_ops, "magenta", "0.1", 3)
+ZIRCON_DRIVER_BEGIN(bcm_usb_dwc, usb_dwc_driver_ops, "zircon", "0.1", 3)
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_VID, PDEV_VID_BROADCOMM),
     BI_MATCH_IF(EQ, BIND_PLATFORM_DEV_DID, PDEV_DID_BROADCOMM_USB),
-MAGENTA_DRIVER_END(bcm_usb_dwc)
+ZIRCON_DRIVER_END(bcm_usb_dwc)
 // clang-format on
diff --git a/system/dev/usb/bcm-usb-dwc/rules.mk b/system/dev/usb/bcm-usb-dwc/rules.mk
index 5239ac5..a352920 100644
--- a/system/dev/usb/bcm-usb-dwc/rules.mk
+++ b/system/dev/usb/bcm-usb-dwc/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/pretty third_party/udev/bcm-usb-dwc-regs system/ulib/sync system/ulib/bcm
 
-MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/magenta system/ulib/mxio
+MODULE_LIBS := system/ulib/driver system/ulib/c system/ulib/zircon system/ulib/fdio
 
 include make/module.mk
diff --git a/system/dev/usb/dwc3/dwc3-commands.c b/system/dev/usb/dwc3/dwc3-commands.c
index e994052..1939937 100644
--- a/system/dev/usb/dwc3/dwc3-commands.c
+++ b/system/dev/usb/dwc3/dwc3-commands.c
@@ -51,7 +51,7 @@
     dwc3_ep_cmd(dwc, ep_num, DEPXFERCFG, 1, 0, 0, 0);
 }
 
-void dwc3_cmd_ep_start_transfer(dwc3_t* dwc, unsigned ep_num, mx_paddr_t trb_phys) {
+void dwc3_cmd_ep_start_transfer(dwc3_t* dwc, unsigned ep_num, zx_paddr_t trb_phys) {
     dwc3_ep_cmd(dwc, ep_num, DEPSTRTXFER, (uint32_t)(trb_phys >> 32),
                 (uint32_t)trb_phys, 0, DEPCMD_CMDIOC);
 }
diff --git a/system/dev/usb/dwc3/dwc3-endpoints.c b/system/dev/usb/dwc3/dwc3-endpoints.c
index fbd5865..527232b 100644
--- a/system/dev/usb/dwc3/dwc3-endpoints.c
+++ b/system/dev/usb/dwc3/dwc3-endpoints.c
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include <ddk/debug.h>
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 #include "dwc3.h"
 #include "dwc3-regs.h"
@@ -14,7 +14,7 @@
 
 #define EP_FIFO_SIZE    PAGE_SIZE
 
-static mx_paddr_t dwc3_ep_trb_phys(dwc3_endpoint_t* ep, dwc3_trb_t* trb) {
+static zx_paddr_t dwc3_ep_trb_phys(dwc3_endpoint_t* ep, dwc3_trb_t* trb) {
     return io_buffer_phys(&ep->fifo.buffer) + ((void *)trb - (void *)ep->fifo.first);
 }
 
@@ -36,13 +36,13 @@
     mtx_unlock(&dwc->lock);
 }
 
-mx_status_t dwc3_ep_fifo_init(dwc3_t* dwc, unsigned ep_num) {
-    MX_DEBUG_ASSERT(ep_num < countof(dwc->eps));
+zx_status_t dwc3_ep_fifo_init(dwc3_t* dwc, unsigned ep_num) {
+    ZX_DEBUG_ASSERT(ep_num < countof(dwc->eps));
     dwc3_endpoint_t* ep = &dwc->eps[ep_num];
     dwc3_fifo_t* fifo = &ep->fifo;
 
-    mx_status_t status = io_buffer_init(&fifo->buffer, EP_FIFO_SIZE, IO_BUFFER_RW);
-    if (status != MX_OK) {
+    zx_status_t status = io_buffer_init(&fifo->buffer, EP_FIFO_SIZE, IO_BUFFER_RW);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -53,25 +53,25 @@
 
     // set up link TRB pointing back to the start of the fifo
     dwc3_trb_t* trb = fifo->last;
-    mx_paddr_t trb_phys = io_buffer_phys(&fifo->buffer);
+    zx_paddr_t trb_phys = io_buffer_phys(&fifo->buffer);
     trb->ptr_low = (uint32_t)trb_phys;
     trb->ptr_high = (uint32_t)(trb_phys >> 32);
     trb->status = 0;
     trb->control = TRB_TRBCTL_LINK | TRB_HWO;
-    io_buffer_cache_op(&ep->fifo.buffer, MX_VMO_OP_CACHE_CLEAN,
+    io_buffer_cache_op(&ep->fifo.buffer, ZX_VMO_OP_CACHE_CLEAN,
                            (trb - ep->fifo.first) * sizeof(*trb), sizeof(*trb));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void dwc3_ep_fifo_release(dwc3_t* dwc, unsigned ep_num) {
-    MX_DEBUG_ASSERT(ep_num < countof(dwc->eps));
+    ZX_DEBUG_ASSERT(ep_num < countof(dwc->eps));
     dwc3_endpoint_t* ep = &dwc->eps[ep_num];
 
     io_buffer_release(&ep->fifo.buffer);
 }
 
-void dwc3_ep_start_transfer(dwc3_t* dwc, unsigned ep_num, unsigned type, mx_paddr_t buffer,
+void dwc3_ep_start_transfer(dwc3_t* dwc, unsigned ep_num, unsigned type, zx_paddr_t buffer,
                             size_t length) {
     dprintf(LTRACE, "dwc3_ep_start_transfer ep %u type %u length %zu\n", ep_num, type, length);
 
@@ -90,7 +90,7 @@
     trb->ptr_high = (uint32_t)(buffer >> 32);
     trb->status = TRB_BUFSIZ(length);
     trb->control = type | TRB_LST | TRB_IOC | TRB_HWO;
-    io_buffer_cache_op(&ep->fifo.buffer, MX_VMO_OP_CACHE_CLEAN,
+    io_buffer_cache_op(&ep->fifo.buffer, ZX_VMO_OP_CACHE_CLEAN,
                            (trb - ep->fifo.first) * sizeof(*trb), sizeof(*trb));
 
     dwc3_cmd_ep_start_transfer(dwc, ep_num, dwc3_ep_trb_phys(ep, trb));
@@ -109,32 +109,32 @@
 
         // TODO(voydanoff) scatter/gather support
         iotxn_physmap(txn);
-        mx_paddr_t phys = iotxn_phys(txn);
+        zx_paddr_t phys = iotxn_phys(txn);
         dwc3_ep_start_transfer(dwc, ep->ep_num, TRB_TRBCTL_NORMAL, phys, txn->length);
     }
 }
 
-mx_status_t dwc3_ep_config(dwc3_t* dwc, usb_endpoint_descriptor_t* ep_desc,
+zx_status_t dwc3_ep_config(dwc3_t* dwc, usb_endpoint_descriptor_t* ep_desc,
                                   usb_ss_ep_comp_descriptor_t* ss_comp_desc) {
     // convert address to index in range 0 - 31
     // low bit is IN/OUT
     unsigned ep_num = dwc3_ep_num(ep_desc->bEndpointAddress);
     if (ep_num < 2) {
         // index 0 and 1 are for endpoint zero
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     unsigned ep_type = usb_ep_type(ep_desc);
     if (ep_type == USB_ENDPOINT_ISOCHRONOUS) {
         dprintf(ERROR, "dwc3_ep_config: isochronous endpoints are not supported\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     dwc3_endpoint_t* ep = &dwc->eps[ep_num];
 
     mtx_lock(&ep->lock);
-    mx_status_t status = dwc3_ep_fifo_init(dwc, ep_num);
-    if (status != MX_OK) {
+    zx_status_t status = dwc3_ep_fifo_init(dwc, ep_num);
+    if (status != ZX_OK) {
         dprintf(ERROR, "dwc3_config_ep: dwc3_ep_fifo_init failed %d\n", status);
         mtx_unlock(&ep->lock);
         return status;
@@ -152,16 +152,16 @@
 
     mtx_unlock(&ep->lock);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t dwc3_ep_disable(dwc3_t* dwc, uint8_t ep_addr) {
+zx_status_t dwc3_ep_disable(dwc3_t* dwc, uint8_t ep_addr) {
     // convert address to index in range 0 - 31
     // low bit is IN/OUT
     unsigned ep_num = dwc3_ep_num(ep_addr);
     if (ep_num < 2) {
         // index 0 and 1 are for endpoint zero
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     dwc3_endpoint_t* ep = &dwc->eps[ep_num];
@@ -170,7 +170,7 @@
     ep->enabled = false;
     mtx_unlock(&ep->lock);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void dwc3_ep_queue(dwc3_t* dwc, unsigned ep_num, iotxn_t* txn) {
@@ -180,7 +180,7 @@
     if (EP_OUT(ep_num)) {
         if (txn->length == 0 || txn->length % ep->max_packet_size != 0) {
             dprintf(ERROR, "dwc3_ep_queue: OUT transfers must be multiple of max packet size\n");
-            iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+            iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
             return;
         }
     }
@@ -189,7 +189,7 @@
 
     if (!ep->enabled) {
         mtx_unlock(&ep->lock);
-        iotxn_complete(txn, MX_ERR_BAD_STATE, 0);
+        iotxn_complete(txn, ZX_ERR_BAD_STATE, 0);
         return;
     }
 
@@ -237,7 +237,7 @@
 
 static void dwc_ep_read_trb(dwc3_endpoint_t* ep, dwc3_trb_t* trb, dwc3_trb_t* out_trb) {
     if (trb >= ep->fifo.first && trb < ep->fifo.last) {
-        io_buffer_cache_op(&ep->fifo.buffer, MX_VMO_OP_CACHE_INVALIDATE,
+        io_buffer_cache_op(&ep->fifo.buffer, ZX_VMO_OP_CACHE_INVALIDATE,
                            (trb - ep->fifo.first) * sizeof(*trb), sizeof(*trb));
         memcpy((void *)out_trb, (void *)trb, sizeof(*trb));
     } else {
@@ -292,15 +292,15 @@
                 dprintf(ERROR, "TRB_HWO still set in dwc3_ep_xfer_complete\n");
             }
 
-            mx_off_t actual = txn->length - TRB_BUFSIZ(trb.status);
+            zx_off_t actual = txn->length - TRB_BUFSIZ(trb.status);
 //            dwc3_ep_queue_next_locked(dwc, ep);
 
             mtx_unlock(&ep->lock);
 
             if (EP_OUT(ep_num)) {
-                iotxn_cacheop(txn, MX_VMO_OP_CACHE_INVALIDATE, 0, actual);
+                iotxn_cacheop(txn, ZX_VMO_OP_CACHE_INVALIDATE, 0, actual);
             }
-            iotxn_complete(txn, MX_OK, actual);
+            iotxn_complete(txn, ZX_OK, actual);
         } else {
             mtx_unlock(&ep->lock);
             dprintf(ERROR, "dwc3_ep_xfer_complete: no iotxn found to complete!\n");
@@ -308,9 +308,9 @@
     }
 }
 
-mx_status_t dwc3_ep_set_stall(dwc3_t* dwc, unsigned ep_num, bool stall) {
+zx_status_t dwc3_ep_set_stall(dwc3_t* dwc, unsigned ep_num, bool stall) {
     if (ep_num >= countof(dwc->eps)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     dwc3_endpoint_t* ep = &dwc->eps[ep_num];
@@ -318,7 +318,7 @@
 
     if (!ep->enabled) {
         mtx_unlock(&ep->lock);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (stall && !ep->stalled) {
         dwc3_cmd_ep_set_stall(dwc, ep_num);
@@ -328,10 +328,10 @@
     ep->stalled = stall;
     mtx_unlock(&ep->lock);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-void dwc3_ep_end_transfers(dwc3_t* dwc, unsigned ep_num, mx_status_t reason) {
+void dwc3_ep_end_transfers(dwc3_t* dwc, unsigned ep_num, zx_status_t reason) {
     dwc3_endpoint_t* ep = &dwc->eps[ep_num];
     mtx_lock(&ep->lock);
 
diff --git a/system/dev/usb/dwc3/dwc3-ep0.c b/system/dev/usb/dwc3/dwc3-ep0.c
index 8bb09cd..471ea96 100644
--- a/system/dev/usb/dwc3/dwc3-ep0.c
+++ b/system/dev/usb/dwc3/dwc3-ep0.c
@@ -19,10 +19,10 @@
     dwc->ep0_state = EP0_STATE_SETUP;
 }
 
-mx_status_t dwc3_ep0_init(dwc3_t* dwc) {
+zx_status_t dwc3_ep0_init(dwc3_t* dwc) {
     // fifo only needed for physical endpoint 0
-    mx_status_t status = dwc3_ep_fifo_init(dwc, EP0_OUT);
-    if (status != MX_OK) {
+    zx_status_t status = dwc3_ep_fifo_init(dwc, EP0_OUT);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -34,7 +34,7 @@
         ep->interval = 0;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void dwc3_ep0_reset(dwc3_t* dwc) {
@@ -54,9 +54,9 @@
     mtx_unlock(EP0_LOCK(dwc));
 }
 
-static mx_status_t dwc3_handle_setup(dwc3_t* dwc, usb_setup_t* setup, void* buffer, size_t length,
+static zx_status_t dwc3_handle_setup(dwc3_t* dwc, usb_setup_t* setup, void* buffer, size_t length,
                                      size_t* out_actual) {
-    mx_status_t status;
+    zx_status_t status;
 
     if (setup->bmRequestType == (USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE)) {
         // handle some special setup requests in this driver
@@ -65,13 +65,13 @@
             dprintf(TRACE, "SET_ADDRESS %d\n", setup->wValue);
             dwc3_set_address(dwc, setup->wValue);
             *out_actual = 0;
-            return MX_OK;
+            return ZX_OK;
         case USB_REQ_SET_CONFIGURATION:
             dprintf(TRACE, "SET_CONFIGURATION %d\n", setup->wValue);
             dwc3_reset_configuration(dwc);
             dwc->configured = false;
             status = usb_dci_control(&dwc->dci_intf, setup, buffer, length, out_actual);
-            if (status == MX_OK && setup->wValue) {
+            if (status == ZX_OK && setup->wValue) {
                 dwc->configured = true;
                 dwc3_start_eps(dwc);
             }
@@ -86,7 +86,7 @@
         dwc3_reset_configuration(dwc);
         dwc->configured = false;
         status = usb_dci_control(&dwc->dci_intf, setup, buffer, length, out_actual);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             dwc->configured = true;
             dwc3_start_eps(dwc);
         }
@@ -159,7 +159,7 @@
     case EP0_STATE_SETUP: {
         usb_setup_t* setup = &dwc->cur_setup;
 
-        io_buffer_cache_op(&dwc->ep0_buffer, MX_VMO_OP_CACHE_INVALIDATE, 0, sizeof(*setup));
+        io_buffer_cache_op(&dwc->ep0_buffer, ZX_VMO_OP_CACHE_INVALIDATE, 0, sizeof(*setup));
         memcpy(setup, io_buffer_virt(&dwc->ep0_buffer), sizeof(*setup));
 
         dprintf(TRACE, "got setup: type: 0x%02X req: %d value: %d index: %d length: %d\n",
@@ -174,10 +174,10 @@
             dwc->ep0_state = EP0_STATE_DATA_OUT;
         } else {
             size_t actual;
-            mx_status_t status = dwc3_handle_setup(dwc, setup, io_buffer_virt(&dwc->ep0_buffer),
+            zx_status_t status = dwc3_handle_setup(dwc, setup, io_buffer_virt(&dwc->ep0_buffer),
                                                    dwc->ep0_buffer.size, &actual);
             dprintf(TRACE, "dwc3_handle_setup returned %d actual %zu\n", status, actual);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 dwc3_cmd_ep_set_stall(dwc, EP0_OUT);
                 dwc3_queue_setup_locked(dwc);
                 break;
@@ -185,7 +185,7 @@
 
             if (setup->wLength > 0) {
                 // queue a write for the data phase
-                io_buffer_cache_op(&dwc->ep0_buffer, MX_VMO_OP_CACHE_CLEAN, 0, actual);
+                io_buffer_cache_op(&dwc->ep0_buffer, ZX_VMO_OP_CACHE_CLEAN, 0, actual);
                 dwc3_ep_start_transfer(dwc, EP0_IN, TRB_TRBCTL_CONTROL_DATA,
                                        io_buffer_phys(&dwc->ep0_buffer), actual);
                 dwc->ep0_state = EP0_STATE_DATA_IN;
diff --git a/system/dev/usb/dwc3/dwc3-events.c b/system/dev/usb/dwc3/dwc3-events.c
index 06e1a5a..7ee0157 100644
--- a/system/dev/usb/dwc3/dwc3-events.c
+++ b/system/dev/usb/dwc3/dwc3-events.c
@@ -185,10 +185,10 @@
     volatile uint32_t* ring_cur = ring_start;
 
     while (1) {
-        mx_status_t status = mx_interrupt_wait(dwc->irq_handle);
-        mx_interrupt_complete(dwc->irq_handle);
-        if (status != MX_OK) {
-            dprintf(ERROR, "dwc3_irq_thread: mx_interrupt_wait returned %d\n", status);
+        zx_status_t status = zx_interrupt_wait(dwc->irq_handle);
+        zx_interrupt_complete(dwc->irq_handle);
+        if (status != ZX_OK) {
+            dprintf(ERROR, "dwc3_irq_thread: zx_interrupt_wait returned %d\n", status);
             break;
         }
 
@@ -196,7 +196,7 @@
         uint32_t event_count;
         while ((event_count = DWC3_READ32(mmio + GEVNTCOUNT(0)) & GEVNTCOUNT_EVNTCOUNT_MASK) > 0) {
             // invalidate cache so we can read fresh events
-            io_buffer_cache_op(&dwc->event_buffer, MX_VMO_OP_CACHE_INVALIDATE, 0,
+            io_buffer_cache_op(&dwc->event_buffer, ZX_VMO_OP_CACHE_INVALIDATE, 0,
                                EVENT_BUFFER_SIZE);
 
             for (unsigned i = 0; i < event_count; i += sizeof(uint32_t)) {
@@ -221,7 +221,7 @@
 
     // set event buffer pointer and size
     // keep interrupts masked until we are ready
-    mx_paddr_t paddr = io_buffer_phys(&dwc->event_buffer);
+    zx_paddr_t paddr = io_buffer_phys(&dwc->event_buffer);
     DWC3_WRITE32(mmio + GEVNTADRLO(0), (uint32_t)paddr);
     DWC3_WRITE32(mmio + GEVNTADRHI(0), (uint32_t)(paddr >> 32));
     DWC3_WRITE32(mmio + GEVNTSIZ(0), EVENT_BUFFER_SIZE | GEVNTSIZ_EVNTINTRPTMASK);
diff --git a/system/dev/usb/dwc3/dwc3.c b/system/dev/usb/dwc3/dwc3.c
index 834f8b2..26b97e5 100644
--- a/system/dev/usb/dwc3/dwc3.c
+++ b/system/dev/usb/dwc3/dwc3.c
@@ -67,7 +67,7 @@
     dprintf(TRACE, "\n");
 }
 
-static mx_status_t dwc3_start(dwc3_t* dwc) {
+static zx_status_t dwc3_start(dwc3_t* dwc) {
     volatile void* mmio = dwc3_mmio(dwc);
     uint32_t temp;
 
@@ -116,7 +116,7 @@
 
     mtx_unlock(&dwc->lock);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void dwc3_usb_reset(dwc3_t* dwc) {
@@ -125,7 +125,7 @@
     dwc3_ep0_reset(dwc);
 
     for (unsigned i = 2; i < countof(dwc->eps); i++) {
-        dwc3_ep_end_transfers(dwc, i, MX_ERR_IO_NOT_PRESENT);
+        dwc3_ep_end_transfers(dwc, i, ZX_ERR_IO_NOT_PRESENT);
         dwc3_ep_set_stall(dwc, i, false);
     }
 
@@ -145,7 +145,7 @@
     }
 
     for (unsigned i = 2; i < countof(dwc->eps); i++) {
-        dwc3_ep_end_transfers(dwc, i, MX_ERR_IO_NOT_PRESENT);
+        dwc3_ep_end_transfers(dwc, i, ZX_ERR_IO_NOT_PRESENT);
         dwc3_ep_set_stall(dwc, i, false);
     }
 }
@@ -208,29 +208,29 @@
     mtx_unlock(&dwc->lock);
 
     for (unsigned i = 2; i < countof(dwc->eps); i++) {
-        dwc3_ep_end_transfers(dwc, i, MX_ERR_IO_NOT_PRESENT);
+        dwc3_ep_end_transfers(dwc, i, ZX_ERR_IO_NOT_PRESENT);
         dwc3_ep_set_stall(dwc, i, false);
     }
 }
 
-static mx_status_t dwc3_set_interface(void* ctx, usb_dci_interface_t* dci_intf) {
+static zx_status_t dwc3_set_interface(void* ctx, usb_dci_interface_t* dci_intf) {
     dwc3_t* dwc = ctx;
     memcpy(&dwc->dci_intf, dci_intf, sizeof(dwc->dci_intf));
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t dwc3_config_ep(void* ctx, usb_endpoint_descriptor_t* ep_desc,
+static zx_status_t dwc3_config_ep(void* ctx, usb_endpoint_descriptor_t* ep_desc,
                                   usb_ss_ep_comp_descriptor_t* ss_comp_desc) {
     dwc3_t* dwc = ctx;
     return dwc3_ep_config(dwc, ep_desc, ss_comp_desc);
 }
 
-static mx_status_t dwc3_disable_ep(void* ctx, uint8_t ep_addr) {
+static zx_status_t dwc3_disable_ep(void* ctx, uint8_t ep_addr) {
     dwc3_t* dwc = ctx;
     return dwc3_ep_disable(dwc, ep_addr);
 }
 
-static mx_status_t dwc_set_enabled(void* ctx, bool enabled) {
+static zx_status_t dwc_set_enabled(void* ctx, bool enabled) {
     dwc3_t* dwc = ctx;
 
     if (enabled) {
@@ -238,16 +238,16 @@
     } else {
         // TODO(voydanoff) more cleanup to do here?
         dwc3_disconnected(dwc);
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
-static mx_status_t dwc3_set_stall(void* ctx, uint8_t ep_address) {
+static zx_status_t dwc3_set_stall(void* ctx, uint8_t ep_address) {
     dwc3_t* dwc = ctx;
     return dwc3_ep_set_stall(dwc, dwc3_ep_num(ep_address), true);
 }
 
-static mx_status_t dwc3_clear_stall(void* ctx, uint8_t ep_address) {
+static zx_status_t dwc3_clear_stall(void* ctx, uint8_t ep_address) {
     dwc3_t* dwc = ctx;
     return dwc3_ep_set_stall(dwc, dwc3_ep_num(ep_address), false);
 }
@@ -264,7 +264,7 @@
 static void dwc3_unbind(void* ctx) {
     dwc3_t* dwc = ctx;
 
-    mx_interrupt_signal(dwc->irq_handle);
+    zx_interrupt_signal(dwc->irq_handle);
     thrd_join(dwc->irq_thread, NULL);
     device_remove(dwc->mxdev);
 }
@@ -272,8 +272,8 @@
 static void dwc3_iotxn_queue(void* ctx, iotxn_t* txn) {
     dwc3_t* dwc = ctx;
 
-    if (txn->protocol != MX_PROTOCOL_USB_FUNCTION) {
-        iotxn_complete(txn, MX_ERR_NOT_SUPPORTED, 0);
+    if (txn->protocol != ZX_PROTOCOL_USB_FUNCTION) {
+        iotxn_complete(txn, ZX_ERR_NOT_SUPPORTED, 0);
         return;
     }
     usb_function_protocol_data_t* data = iotxn_pdata(txn, usb_function_protocol_data_t);
@@ -281,7 +281,7 @@
     unsigned ep_num = dwc3_ep_num(data->ep_address);
     if (ep_num < 2 || ep_num >= countof(dwc->eps)) {
         dprintf(ERROR, "dwc3_iotxn_queue: bad ep address 0x%02X\n", data->ep_address);
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
         return;
     }
 
@@ -298,27 +298,27 @@
     io_buffer_release(&dwc->ep0_buffer);
 
     pdev_mmio_buffer_release(&dwc->mmio);
-    mx_handle_close(dwc->irq_handle);
+    zx_handle_close(dwc->irq_handle);
     free(dwc);
 }
 
-static mx_protocol_device_t dwc3_device_proto = {
+static zx_protocol_device_t dwc3_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = dwc3_iotxn_queue,
     .release = dwc3_release,
 };
 
-static mx_status_t dwc3_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t dwc3_bind(void* ctx, zx_device_t* dev, void** cookie) {
     dprintf(INFO, "dwc3_bind\n");
 
     dwc3_t* dwc = calloc(1, sizeof(dwc3_t));
     if (!dwc) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     platform_device_protocol_t pdev;
-    mx_status_t status = device_get_protocol(dev, MX_PROTOCOL_PLATFORM_DEV, &pdev);
-    if (status != MX_OK) {
+    zx_status_t status = device_get_protocol(dev, ZX_PROTOCOL_PLATFORM_DEV, &pdev);
+    if (status != ZX_OK) {
         goto fail;
     }
 
@@ -330,34 +330,34 @@
         list_initialize(&ep->queued_txns);
     }
 
-    status = pdev_map_mmio_buffer(&pdev, MMIO_USB3OTG, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    status = pdev_map_mmio_buffer(&pdev, MMIO_USB3OTG, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                                   &dwc->mmio);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "dwc3_bind: pdev_map_mmio_buffer failed\n");
         goto fail;
     }
 
     status = pdev_map_interrupt(&pdev, IRQ_USB3, &dwc->irq_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "dwc3_bind: pdev_map_interrupt failed\n");
         goto fail;
     }
 
     status = io_buffer_init(&dwc->event_buffer, EVENT_BUFFER_SIZE, IO_BUFFER_RO);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "dwc3_bind: io_buffer_init failed\n");
         goto fail;
     }
-    io_buffer_cache_op(&dwc->event_buffer, MX_VMO_OP_CACHE_CLEAN, 0, EVENT_BUFFER_SIZE);
+    io_buffer_cache_op(&dwc->event_buffer, ZX_VMO_OP_CACHE_CLEAN, 0, EVENT_BUFFER_SIZE);
 
     status = io_buffer_init(&dwc->ep0_buffer, 65536, IO_BUFFER_RW);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "dwc3_bind: io_buffer_init failed\n");
         goto fail;
     }
 
     status = dwc3_ep0_init(dwc);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "dwc3_bind: dwc3_ep_init failed\n");
         goto fail;
     }
@@ -367,16 +367,16 @@
         .name = "dwc3",
         .ctx = dwc,
         .ops = &dwc3_device_proto,
-        .proto_id = MX_PROTOCOL_USB_DCI,
+        .proto_id = ZX_PROTOCOL_USB_DCI,
         .proto_ops = &dwc_dci_protocol,
     };
 
     status = device_add(dev, &args, &dwc->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto fail;
     }
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     dprintf(ERROR, "dwc3_bind failed %d\n", status);
@@ -384,16 +384,16 @@
     return status;
 }
 
-static mx_driver_ops_t dwc3_driver_ops = {
+static zx_driver_ops_t dwc3_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = dwc3_bind,
 };
 
 // The formatter does not play nice with these macros.
 // clang-format off
-MAGENTA_DRIVER_BEGIN(dwc3, dwc3_driver_ops, "magenta", "0.1", 3)
+ZIRCON_DRIVER_BEGIN(dwc3, dwc3_driver_ops, "zircon", "0.1", 3)
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_VID, PDEV_VID_GENERIC),
     BI_ABORT_IF(NE, BIND_PLATFORM_DEV_PID, PDEV_PID_GENERIC),
     BI_MATCH_IF(EQ, BIND_PLATFORM_DEV_DID, PDEV_DID_USB_DWC3),
-MAGENTA_DRIVER_END(dwc3)
+ZIRCON_DRIVER_END(dwc3)
 // clang-format on
diff --git a/system/dev/usb/dwc3/dwc3.h b/system/dev/usb/dwc3/dwc3.h
index f64cc96..186a21b 100644
--- a/system/dev/usb/dwc3/dwc3.h
+++ b/system/dev/usb/dwc3/dwc3.h
@@ -8,9 +8,9 @@
 #include <ddk/io-buffer.h>
 #include <ddk/protocol/platform-device.h>
 #include <ddk/protocol/usb-dci.h>
-#include <magenta/listnode.h>
-#include <magenta/types.h>
-#include <magenta/hw/usb.h>
+#include <zircon/listnode.h>
+#include <zircon/types.h>
+#include <zircon/hw/usb.h>
 
 #include <threads.h>
 
@@ -73,13 +73,13 @@
 } dwc3_endpoint_t;
 
 typedef struct {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     usb_dci_interface_t dci_intf;
     pdev_mmio_buffer_t mmio;
 
     // event stuff
     io_buffer_t event_buffer;
-    mx_handle_t irq_handle;
+    zx_handle_t irq_handle;
     thrd_t irq_thread;
 
     dwc3_endpoint_t eps[DWC3_MAX_EPS];
@@ -115,30 +115,30 @@
 void dwc3_cmd_ep_set_config(dwc3_t* dwc, unsigned ep_num, unsigned ep_type,
                             unsigned max_packet_size, unsigned interval, bool modify);
 void dwc3_cmd_ep_transfer_config(dwc3_t* dwc, unsigned ep_num);
-void dwc3_cmd_ep_start_transfer(dwc3_t* dwc, unsigned ep_num, mx_paddr_t trb_phys);
+void dwc3_cmd_ep_start_transfer(dwc3_t* dwc, unsigned ep_num, zx_paddr_t trb_phys);
 void dwc3_cmd_ep_end_transfer(dwc3_t* dwc, unsigned ep_num);
 void dwc3_cmd_ep_set_stall(dwc3_t* dwc, unsigned ep_num);
 void dwc3_cmd_ep_clear_stall(dwc3_t* dwc, unsigned ep_num);
 
 // Endpoints
-mx_status_t dwc3_ep_fifo_init(dwc3_t* dwc, unsigned ep_num);
+zx_status_t dwc3_ep_fifo_init(dwc3_t* dwc, unsigned ep_num);
 void dwc3_ep_fifo_release(dwc3_t* dwc, unsigned ep_num);
-mx_status_t dwc3_ep_config(dwc3_t* dwc, usb_endpoint_descriptor_t* ep_desc,
+zx_status_t dwc3_ep_config(dwc3_t* dwc, usb_endpoint_descriptor_t* ep_desc,
                                   usb_ss_ep_comp_descriptor_t* ss_comp_desc);
 void dwc3_ep_set_config(dwc3_t* dwc, unsigned ep_num, bool enable);
-mx_status_t dwc3_ep_disable(dwc3_t* dwc, uint8_t ep_addr);
+zx_status_t dwc3_ep_disable(dwc3_t* dwc, uint8_t ep_addr);
 void dwc3_start_eps(dwc3_t* dwc);
 void dwc3_ep_queue(dwc3_t* dwc, unsigned ep_num, iotxn_t* txn);
-void dwc3_ep_start_transfer(dwc3_t* dwc, unsigned ep_num, unsigned type, mx_paddr_t buffer,
+void dwc3_ep_start_transfer(dwc3_t* dwc, unsigned ep_num, unsigned type, zx_paddr_t buffer,
                             size_t length);
 void dwc3_ep_xfer_started(dwc3_t* dwc, unsigned ep_num, unsigned rsrc_id);
 void dwc3_ep_xfer_complete(dwc3_t* dwc, unsigned ep_num);
 void dwc3_ep_xfer_not_ready(dwc3_t* dwc, unsigned ep_num, unsigned stage);
-mx_status_t dwc3_ep_set_stall(dwc3_t* dwc, unsigned ep_num, bool stall);
-void dwc3_ep_end_transfers(dwc3_t* dwc, unsigned ep_num, mx_status_t reason);
+zx_status_t dwc3_ep_set_stall(dwc3_t* dwc, unsigned ep_num, bool stall);
+void dwc3_ep_end_transfers(dwc3_t* dwc, unsigned ep_num, zx_status_t reason);
 
 // Endpoint 0
-mx_status_t dwc3_ep0_init(dwc3_t* dwc);
+zx_status_t dwc3_ep0_init(dwc3_t* dwc);
 void dwc3_ep0_reset(dwc3_t* dwc);
 void dwc3_ep0_start(dwc3_t* dwc);
 void dwc3_ep0_xfer_not_ready(dwc3_t* dwc, unsigned ep_num, unsigned stage);
diff --git a/system/dev/usb/dwc3/rules.mk b/system/dev/usb/dwc3/rules.mk
index 5c9d7af..4af3e5b 100644
--- a/system/dev/usb/dwc3/rules.mk
+++ b/system/dev/usb/dwc3/rules.mk
@@ -17,6 +17,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync system/ulib/pretty
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/usb/usb-bt-hci/rules.mk b/system/dev/usb/usb-bt-hci/rules.mk
index 8b2fdad..783be76 100644
--- a/system/dev/usb/usb-bt-hci/rules.mk
+++ b/system/dev/usb/usb-bt-hci/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/usb/usb-bt-hci/usb-bt-hci.c b/system/dev/usb/usb-bt-hci/usb-bt-hci.c
index 27521ae..39f59af 100644
--- a/system/dev/usb/usb-bt-hci/usb-bt-hci.c
+++ b/system/dev/usb/usb-bt-hci/usb-bt-hci.c
@@ -6,9 +6,9 @@
 #include <ddk/device.h>
 #include <ddk/driver.h>
 #include <driver/usb.h>
-#include <magenta/device/bt-hci.h>
-#include <magenta/listnode.h>
-#include <magenta/status.h>
+#include <zircon/device/bt-hci.h>
+#include <zircon/listnode.h>
+#include <zircon/status.h>
 
 #include <assert.h>
 #include <stdio.h>
@@ -36,15 +36,15 @@
 // #define USB_PID 0x0001
 
 typedef struct {
-    mx_device_t* mxdev;
-    mx_device_t* usb_mxdev;
+    zx_device_t* mxdev;
+    zx_device_t* usb_mxdev;
     usb_protocol_t usb;
 
-    mx_handle_t cmd_channel;
-    mx_handle_t acl_channel;
-    mx_handle_t snoop_channel;
+    zx_handle_t cmd_channel;
+    zx_handle_t acl_channel;
+    zx_handle_t snoop_channel;
 
-    mx_wait_item_t read_wait_items[NUM_CHANNELS];
+    zx_wait_item_t read_wait_items[NUM_CHANNELS];
     uint32_t read_wait_item_count;
 
     bool read_thread_running;
@@ -81,37 +81,37 @@
 }
 
 static void cmd_channel_cleanup_locked(hci_t* hci) {
-    if (hci->cmd_channel == MX_HANDLE_INVALID) return;
+    if (hci->cmd_channel == ZX_HANDLE_INVALID) return;
 
-    mx_handle_close(hci->cmd_channel);
-    hci->cmd_channel = MX_HANDLE_INVALID;
+    zx_handle_close(hci->cmd_channel);
+    hci->cmd_channel = ZX_HANDLE_INVALID;
 }
 
 static void acl_channel_cleanup_locked(hci_t* hci) {
-    if (hci->acl_channel == MX_HANDLE_INVALID) return;
+    if (hci->acl_channel == ZX_HANDLE_INVALID) return;
 
-    mx_handle_close(hci->acl_channel);
-    hci->acl_channel = MX_HANDLE_INVALID;
+    zx_handle_close(hci->acl_channel);
+    hci->acl_channel = ZX_HANDLE_INVALID;
 }
 
 static void snoop_channel_cleanup_locked(hci_t* hci) {
-    if (hci->snoop_channel == MX_HANDLE_INVALID) return;
+    if (hci->snoop_channel == ZX_HANDLE_INVALID) return;
 
-    mx_handle_close(hci->snoop_channel);
-    hci->snoop_channel = MX_HANDLE_INVALID;
+    zx_handle_close(hci->snoop_channel);
+    hci->snoop_channel = ZX_HANDLE_INVALID;
 }
 
 static void snoop_channel_write_locked(hci_t* hci, uint8_t flags, uint8_t* bytes, size_t length) {
-    if (hci->snoop_channel == MX_HANDLE_INVALID)
+    if (hci->snoop_channel == ZX_HANDLE_INVALID)
         return;
 
     // We tack on a flags byte to the beginning of the payload.
     uint8_t snoop_buffer[length + 1];
     snoop_buffer[0] = flags;
     memcpy(snoop_buffer + 1, bytes, length);
-    mx_status_t status = mx_channel_write(hci->snoop_channel, 0, snoop_buffer, length + 1, NULL, 0);
+    zx_status_t status = zx_channel_write(hci->snoop_channel, 0, snoop_buffer, length + 1, NULL, 0);
     if (status < 0) {
-        printf("usb-bt-hci: failed to write to snoop channel: %s\n", mx_status_get_string(status));
+        printf("usb-bt-hci: failed to write to snoop channel: %s\n", zx_status_get_string(status));
         snoop_channel_cleanup_locked(hci);
     }
 }
@@ -122,10 +122,10 @@
 
     // Handle the interrupt as long as either the command channel or the snoop
     // channel is open.
-    if (hci->cmd_channel == MX_HANDLE_INVALID && hci->snoop_channel == MX_HANDLE_INVALID)
+    if (hci->cmd_channel == ZX_HANDLE_INVALID && hci->snoop_channel == ZX_HANDLE_INVALID)
         goto out2;
 
-    if (txn->status == MX_OK) {
+    if (txn->status == ZX_OK) {
         uint8_t* buffer;
         iotxn_mmap(txn, (void **)&buffer);
         size_t length = txn->actual;
@@ -134,10 +134,10 @@
         // simple case - packet fits in received data
         if (hci->event_buffer_offset == 0 && length >= 2) {
             if (packet_size == length) {
-                if (hci->cmd_channel != MX_HANDLE_INVALID) {
-                    mx_status_t status = mx_channel_write(hci->cmd_channel, 0, buffer, length, NULL, 0);
+                if (hci->cmd_channel != ZX_HANDLE_INVALID) {
+                    zx_status_t status = zx_channel_write(hci->cmd_channel, 0, buffer, length, NULL, 0);
                     if (status < 0) {
-                        printf("hci_interrupt failed to write: %s\n", mx_status_get_string(status));
+                        printf("hci_interrupt failed to write: %s\n", zx_status_get_string(status));
                     }
                 }
                 snoop_channel_write_locked(hci, BT_HCI_SNOOP_FLAG_RECEIVED, buffer, length);
@@ -162,10 +162,10 @@
 
         // check to see if we have a full packet
         if (packet_size <= hci->event_buffer_offset) {
-            mx_status_t status = mx_channel_write(hci->cmd_channel, 0, hci->event_buffer,
+            zx_status_t status = zx_channel_write(hci->cmd_channel, 0, hci->event_buffer,
                                                   packet_size, NULL, 0);
             if (status < 0) {
-                printf("hci_interrupt failed to write: %s\n", mx_status_get_string(status));
+                printf("hci_interrupt failed to write: %s\n", zx_status_get_string(status));
             }
 
             snoop_channel_write_locked(hci, BT_HCI_SNOOP_FLAG_RECEIVED, hci->event_buffer, packet_size);
@@ -189,17 +189,17 @@
 
     mtx_lock(&hci->mutex);
 
-    if (txn->status == MX_OK) {
+    if (txn->status == ZX_OK) {
         void* buffer;
         iotxn_mmap(txn, &buffer);
 
         // The channel handle could be invalid here (e.g. if no process called
         // the ioctl or they closed their endpoint). Instead of explicitly
-        // checking we let mx_channel_write fail with MX_ERR_BAD_HANDLE or
-        // MX_ERR_PEER_CLOSED.
-        mx_status_t status = mx_channel_write(hci->acl_channel, 0, buffer, txn->actual, NULL, 0);
+        // checking we let zx_channel_write fail with ZX_ERR_BAD_HANDLE or
+        // ZX_ERR_PEER_CLOSED.
+        zx_status_t status = zx_channel_write(hci->acl_channel, 0, buffer, txn->actual, NULL, 0);
         if (status < 0) {
-            printf("hci_acl_read_complete failed to write: %s\n", mx_status_get_string(status));
+            printf("hci_acl_read_complete failed to write: %s\n", zx_status_get_string(status));
         }
 
         // If the snoop channel is open then try to write the packet even if acl_channel was closed.
@@ -231,19 +231,19 @@
 }
 
 static void hci_build_read_wait_items_locked(hci_t* hci) {
-    mx_wait_item_t* items = hci->read_wait_items;
+    zx_wait_item_t* items = hci->read_wait_items;
     memset(items, 0, sizeof(hci->read_wait_items));
     uint32_t count = 0;
 
-    if (hci->cmd_channel != MX_HANDLE_INVALID) {
+    if (hci->cmd_channel != ZX_HANDLE_INVALID) {
         items[count].handle = hci->cmd_channel;
-        items[count].waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+        items[count].waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
         count++;
     }
 
-    if (hci->acl_channel != MX_HANDLE_INVALID) {
+    if (hci->acl_channel != ZX_HANDLE_INVALID) {
         items[count].handle = hci->acl_channel;
-        items[count].waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+        items[count].waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
         count++;
     }
 
@@ -258,22 +258,22 @@
 
 // Returns false if there's an error while sending the packet to the hardware or
 // if the channel peer closed its endpoint.
-static bool hci_handle_cmd_read_events(hci_t* hci, mx_wait_item_t* cmd_item) {
-    if (cmd_item->pending & (MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED)) {
+static bool hci_handle_cmd_read_events(hci_t* hci, zx_wait_item_t* cmd_item) {
+    if (cmd_item->pending & (ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED)) {
         uint8_t buf[CMD_BUF_SIZE];
         uint32_t length = sizeof(buf);
-        mx_status_t status =
-            mx_channel_read(cmd_item->handle, 0, buf, NULL, length, 0, &length, NULL);
+        zx_status_t status =
+            zx_channel_read(cmd_item->handle, 0, buf, NULL, length, 0, &length, NULL);
         if (status < 0) {
             printf("hci_read_thread: failed to read from command channel %s\n",
-                   mx_status_get_string(status));
+                   zx_status_get_string(status));
             goto fail;
         }
 
         status = usb_control(&hci->usb, USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_DEVICE,
-                             0, 0, 0, buf, length, MX_TIME_INFINITE);
+                             0, 0, 0, buf, length, ZX_TIME_INFINITE);
         if (status < 0) {
-            printf("hci_read_thread: usb_control failed: %s\n", mx_status_get_string(status));
+            printf("hci_read_thread: usb_control failed: %s\n", zx_status_get_string(status));
             goto fail;
         }
 
@@ -292,8 +292,8 @@
     return false;
 }
 
-static bool hci_handle_acl_read_events(hci_t* hci, mx_wait_item_t* acl_item) {
-    if (acl_item->pending & (MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED)) {
+static bool hci_handle_acl_read_events(hci_t* hci, zx_wait_item_t* acl_item) {
+    if (acl_item->pending & (ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED)) {
         mtx_lock(&hci->mutex);
         list_node_t* node = list_peek_head(&hci->free_acl_write_reqs);
         mtx_unlock(&hci->mutex);
@@ -303,11 +303,11 @@
 
         uint8_t buf[BT_HCI_MAX_FRAME_SIZE];
         uint32_t length = sizeof(buf);
-        mx_status_t status =
-            mx_channel_read(acl_item->handle, 0, buf, NULL, length, 0, &length, NULL);
+        zx_status_t status =
+            zx_channel_read(acl_item->handle, 0, buf, NULL, length, 0, &length, NULL);
         if (status < 0) {
             printf("hci_read_thread: failed to read from ACL channel %s\n",
-                   mx_status_get_string(status));
+                   zx_status_get_string(status));
             goto fail;
         }
 
@@ -349,11 +349,11 @@
     mtx_unlock(&hci->mutex);
 
     while (1) {
-        mx_status_t status = mx_object_wait_many(
-            hci->read_wait_items, hci->read_wait_item_count, MX_TIME_INFINITE);
+        zx_status_t status = zx_object_wait_many(
+            hci->read_wait_items, hci->read_wait_item_count, ZX_TIME_INFINITE);
         if (status < 0) {
-            printf("hci_read_thread: mx_object_wait_many failed: %s\n",
-                   mx_status_get_string(status));
+            printf("hci_read_thread: zx_object_wait_many failed: %s\n",
+                   zx_status_get_string(status));
             mtx_lock(&hci->mutex);
             cmd_channel_cleanup_locked(hci);
             acl_channel_cleanup_locked(hci);
@@ -363,10 +363,10 @@
 
         for (unsigned i = 0; i < NUM_CHANNELS; ++i) {
             mtx_lock(&hci->mutex);
-            mx_wait_item_t item = hci->read_wait_items[i];
+            zx_wait_item_t item = hci->read_wait_items[i];
             mtx_unlock(&hci->mutex);
 
-            mx_handle_t handle = hci->read_wait_items[i].handle;
+            zx_handle_t handle = hci->read_wait_items[i].handle;
             if ((handle == hci->cmd_channel && !hci_handle_cmd_read_events(hci, &item)) ||
                 (handle == hci->acl_channel && !hci_handle_acl_read_events(hci, &item))) {
                 // There was an error while handling the read events. Rebuild the
@@ -390,91 +390,91 @@
     return 0;
 }
 
-static mx_status_t hci_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
+static zx_status_t hci_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
                             void* out_buf, size_t out_len, size_t* out_actual) {
-    ssize_t result = MX_ERR_NOT_SUPPORTED;
+    ssize_t result = ZX_ERR_NOT_SUPPORTED;
     hci_t* hci = ctx;
 
     mtx_lock(&hci->mutex);
 
     if (op == IOCTL_BT_HCI_GET_COMMAND_CHANNEL) {
-        mx_handle_t* reply = out_buf;
+        zx_handle_t* reply = out_buf;
         if (out_len < sizeof(*reply)) {
-            result = MX_ERR_BUFFER_TOO_SMALL;
+            result = ZX_ERR_BUFFER_TOO_SMALL;
             goto done;
         }
 
-        if (hci->cmd_channel != MX_HANDLE_INVALID) {
-            result = MX_ERR_ALREADY_BOUND;
+        if (hci->cmd_channel != ZX_HANDLE_INVALID) {
+            result = ZX_ERR_ALREADY_BOUND;
             goto done;
         }
 
-        mx_handle_t remote_end;
-        mx_status_t status = mx_channel_create(0, &hci->cmd_channel, &remote_end);
+        zx_handle_t remote_end;
+        zx_status_t status = zx_channel_create(0, &hci->cmd_channel, &remote_end);
         if (status < 0) {
             printf("hci_ioctl: Failed to create command channel: %s\n",
-                   mx_status_get_string(status));
-            result = MX_ERR_INTERNAL;
+                   zx_status_get_string(status));
+            result = ZX_ERR_INTERNAL;
             goto done;
         }
 
         *reply = remote_end;
         *out_actual = sizeof(*reply);
-        result = MX_OK;
+        result = ZX_OK;
     } else if (op == IOCTL_BT_HCI_GET_ACL_DATA_CHANNEL) {
-        mx_handle_t* reply = out_buf;
+        zx_handle_t* reply = out_buf;
         if (out_len < sizeof(*reply)) {
-            result = MX_ERR_BUFFER_TOO_SMALL;
+            result = ZX_ERR_BUFFER_TOO_SMALL;
             goto done;
         }
 
-        if (hci->acl_channel != MX_HANDLE_INVALID) {
-            result = MX_ERR_ALREADY_BOUND;
+        if (hci->acl_channel != ZX_HANDLE_INVALID) {
+            result = ZX_ERR_ALREADY_BOUND;
             goto done;
         }
 
-        mx_handle_t remote_end;
-        mx_status_t status = mx_channel_create(0, &hci->acl_channel, &remote_end);
+        zx_handle_t remote_end;
+        zx_status_t status = zx_channel_create(0, &hci->acl_channel, &remote_end);
         if (status < 0) {
             printf("hci_ioctl: Failed to create ACL data channel: %s\n",
-                   mx_status_get_string(status));
-            result = MX_ERR_INTERNAL;
+                   zx_status_get_string(status));
+            result = ZX_ERR_INTERNAL;
             goto done;
         }
 
         *reply = remote_end;
         *out_actual = sizeof(*reply);
-        result = MX_OK;
+        result = ZX_OK;
     } else if (op == IOCTL_BT_HCI_GET_SNOOP_CHANNEL) {
-        mx_handle_t* reply = out_buf;
+        zx_handle_t* reply = out_buf;
         if (out_len < sizeof(*reply)) {
-            result = MX_ERR_BUFFER_TOO_SMALL;
+            result = ZX_ERR_BUFFER_TOO_SMALL;
             goto done;
         }
 
-        if (hci->snoop_channel != MX_HANDLE_INVALID) {
-            result = MX_ERR_ALREADY_BOUND;
+        if (hci->snoop_channel != ZX_HANDLE_INVALID) {
+            result = ZX_ERR_ALREADY_BOUND;
             goto done;
         }
 
-        mx_handle_t remote_end;
-        mx_status_t status = mx_channel_create(0, &hci->snoop_channel, &remote_end);
+        zx_handle_t remote_end;
+        zx_status_t status = zx_channel_create(0, &hci->snoop_channel, &remote_end);
         if (status < 0) {
             printf("hci_ioctl: Failed to create snoop channel: %s\n",
-                   mx_status_get_string(status));
-            result = MX_ERR_INTERNAL;
+                   zx_status_get_string(status));
+            result = ZX_ERR_INTERNAL;
             goto done;
         }
 
         *reply = remote_end;
         *out_actual = sizeof(*reply);
-        result = MX_OK;
+        result = ZX_OK;
     }
 
     hci_build_read_wait_items_locked(hci);
 
     // Kick off the hci_read_thread if it's not already running.
-    if (result == MX_OK && !hci->read_thread_running) {
+    if (result == ZX_OK && !hci->read_thread_running) {
         thrd_t read_thread;
         thrd_create_with_name(&read_thread, hci_read_thread, hci, "hci_read_thread");
         hci->read_thread_running = true;
@@ -522,30 +522,30 @@
     free(hci);
 }
 
-static mx_protocol_device_t hci_device_proto = {
+static zx_protocol_device_t hci_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = hci_ioctl,
     .unbind = hci_unbind,
     .release = hci_release,
 };
 
-static mx_status_t hci_bind(void* ctx, mx_device_t* device, void** cookie) {
+static zx_status_t hci_bind(void* ctx, zx_device_t* device, void** cookie) {
     usb_protocol_t usb;
 
-    mx_status_t status = device_get_protocol(device, MX_PROTOCOL_USB, &usb);
-    if (status != MX_OK) {
+    zx_status_t status = device_get_protocol(device, ZX_PROTOCOL_USB, &usb);
+    if (status != ZX_OK) {
         return status;
     }
 
     // find our endpoints
     usb_desc_iter_t iter;
-    mx_status_t result = usb_desc_iter_init(&usb, &iter);
+    zx_status_t result = usb_desc_iter_init(&usb, &iter);
     if (result < 0) return result;
 
     usb_interface_descriptor_t* intf = usb_desc_iter_next_interface(&iter, true);
     if (!intf || intf->bNumEndpoints != 3) {
         usb_desc_iter_release(&iter);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint8_t bulk_in_addr = 0;
@@ -573,13 +573,13 @@
 
     if (!bulk_in_addr || !bulk_out_addr || !intr_addr) {
         printf("hci_bind could not find endpoints\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     hci_t* hci = calloc(1, sizeof(hci_t));
     if (!hci) {
         printf("Not enough memory for hci_t\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     list_initialize(&hci->free_event_reqs);
@@ -594,7 +594,7 @@
     for (int i = 0; i < EVENT_REQ_COUNT; i++) {
         iotxn_t* txn = usb_alloc_iotxn(intr_addr, intr_max_packet);
         if (!txn) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         txn->length = intr_max_packet;
@@ -605,7 +605,7 @@
     for (int i = 0; i < ACL_READ_REQ_COUNT; i++) {
         iotxn_t* txn = usb_alloc_iotxn(bulk_in_addr, BT_HCI_MAX_FRAME_SIZE);
         if (!txn) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         txn->length = BT_HCI_MAX_FRAME_SIZE;
@@ -616,7 +616,7 @@
     for (int i = 0; i < ACL_WRITE_REQ_COUNT; i++) {
         iotxn_t* txn = usb_alloc_iotxn(bulk_out_addr, BT_HCI_MAX_FRAME_SIZE);
         if (!txn) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto fail;
         }
         txn->length = BT_HCI_MAX_FRAME_SIZE;
@@ -635,25 +635,25 @@
         .name = "usb_bt_hci",
         .ctx = hci,
         .ops = &hci_device_proto,
-        .proto_id = MX_PROTOCOL_BLUETOOTH_HCI,
+        .proto_id = ZX_PROTOCOL_BLUETOOTH_HCI,
     };
 
     status = device_add(device, &args, &hci->mxdev);
-    if (status == MX_OK) return MX_OK;
+    if (status == ZX_OK) return ZX_OK;
 
 fail:
-    printf("hci_bind failed: %s\n", mx_status_get_string(status));
+    printf("hci_bind failed: %s\n", zx_status_get_string(status));
     hci_release(hci);
     return status;
 }
 
-static mx_driver_ops_t usb_bt_hci_driver_ops = {
+static zx_driver_ops_t usb_bt_hci_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = hci_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(usb_bt_hci, usb_bt_hci_driver_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB),
+ZIRCON_DRIVER_BEGIN(usb_bt_hci, usb_bt_hci_driver_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB),
 #if defined(USB_VID) && defined(USB_PID)
     BI_ABORT_IF(NE, BIND_USB_VID, USB_VID),
     BI_MATCH_IF(EQ, BIND_USB_PID, USB_PID),
@@ -663,4 +663,4 @@
     BI_ABORT_IF(NE, BIND_USB_SUBCLASS, 1),
     BI_MATCH_IF(EQ, BIND_USB_PROTOCOL, 1),
 #endif
-MAGENTA_DRIVER_END(usb_bt_hci)
+ZIRCON_DRIVER_END(usb_bt_hci)
diff --git a/system/dev/usb/usb-bus/rules.mk b/system/dev/usb/usb-bus/rules.mk
index 84b7d2e..e510d63 100644
--- a/system/dev/usb/usb-bus/rules.mk
+++ b/system/dev/usb/usb-bus/rules.mk
@@ -16,6 +16,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/usb/usb-bus/usb-bus.c b/system/dev/usb/usb-bus/usb-bus.c
index 296f843..434f207 100644
--- a/system/dev/usb/usb-bus/usb-bus.c
+++ b/system/dev/usb/usb-bus/usb-bus.c
@@ -16,8 +16,8 @@
 
 // Represents a USB bus, which manages all devices for a USB host controller
 typedef struct usb_bus {
-    mx_device_t* mxdev;
-    mx_device_t* hci_mxdev;
+    zx_device_t* mxdev;
+    zx_device_t* hci_mxdev;
     usb_hci_protocol_t hci;
 
     // top-level USB devices, indexed by device_id
@@ -25,16 +25,16 @@
     size_t max_device_count;
 } usb_bus_t;
 
-static mx_status_t bus_add_device(void* ctx, uint32_t device_id, uint32_t hub_id,
+static zx_status_t bus_add_device(void* ctx, uint32_t device_id, uint32_t hub_id,
                                       usb_speed_t speed) {
     usb_bus_t* bus = ctx;
 
-    if (device_id >= bus->max_device_count) return MX_ERR_INVALID_ARGS;
+    if (device_id >= bus->max_device_count) return ZX_ERR_INVALID_ARGS;
 
     usb_device_t* usb_device;
-    mx_status_t result = usb_device_add(bus->hci_mxdev, &bus->hci, bus->mxdev, device_id,
+    zx_status_t result = usb_device_add(bus->hci_mxdev, &bus->hci, bus->mxdev, device_id,
                                         hub_id, speed, &usb_device);
-    if (result == MX_OK) {
+    if (result == ZX_OK) {
         bus->devices[device_id] = usb_device;
     }
     return result;
@@ -58,30 +58,30 @@
     .remove_device = bus_remove_device,
 };
 
-static mx_status_t bus_configure_hub(void* ctx, mx_device_t* hub_device, usb_speed_t speed,
+static zx_status_t bus_configure_hub(void* ctx, zx_device_t* hub_device, usb_speed_t speed,
                                          usb_hub_descriptor_t* descriptor) {
     usb_bus_t* bus = ctx;
     uint32_t hub_id;
-    if (usb_interface_get_device_id(hub_device, &hub_id) != MX_OK) {
-        return MX_ERR_INTERNAL;
+    if (usb_interface_get_device_id(hub_device, &hub_id) != ZX_OK) {
+        return ZX_ERR_INTERNAL;
     }
     return usb_hci_configure_hub(&bus->hci, hub_id, speed, descriptor);
 }
 
-static mx_status_t bus_device_added(void* ctx, mx_device_t* hub_device, int port, usb_speed_t speed) {
+static zx_status_t bus_device_added(void* ctx, zx_device_t* hub_device, int port, usb_speed_t speed) {
     usb_bus_t* bus = ctx;
     uint32_t hub_id;
-    if (usb_interface_get_device_id(hub_device, &hub_id) != MX_OK) {
-        return MX_ERR_INTERNAL;
+    if (usb_interface_get_device_id(hub_device, &hub_id) != ZX_OK) {
+        return ZX_ERR_INTERNAL;
     }
     return usb_hci_hub_device_added(&bus->hci, hub_id, port, speed);
 }
 
-static mx_status_t bus_device_removed(void* ctx, mx_device_t* hub_device, int port) {
+static zx_status_t bus_device_removed(void* ctx, zx_device_t* hub_device, int port) {
     usb_bus_t* bus = ctx;
     uint32_t hub_id;
-    if (usb_interface_get_device_id(hub_device, &hub_id) != MX_OK) {
-        return MX_ERR_INTERNAL;
+    if (usb_interface_get_device_id(hub_device, &hub_id) != ZX_OK) {
+        return ZX_ERR_INTERNAL;
     }
     return usb_hci_hub_device_removed(&bus->hci, hub_id, port);
 }
@@ -112,22 +112,22 @@
     free(bus);
 }
 
-static mx_protocol_device_t usb_bus_device_proto = {
+static zx_protocol_device_t usb_bus_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = usb_bus_unbind,
     .release = usb_bus_release,
 };
 
-static mx_status_t usb_bus_bind(void* ctx, mx_device_t* device, void** cookie) {
+static zx_status_t usb_bus_bind(void* ctx, zx_device_t* device, void** cookie) {
     usb_bus_t* bus = calloc(1, sizeof(usb_bus_t));
     if (!bus) {
         dprintf(ERROR, "Not enough memory for usb_bus_t.\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    if (device_get_protocol(device, MX_PROTOCOL_USB_HCI, &bus->hci)) {
+    if (device_get_protocol(device, ZX_PROTOCOL_USB_HCI, &bus->hci)) {
         free(bus);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     bus->hci_mxdev = device;
@@ -137,7 +137,7 @@
         dprintf(ERROR, "Not enough memory for usb_bus_t->devices. max_device_count: %zu\n",
                bus->max_device_count);
         free(bus);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     device_add_args_t args = {
@@ -145,13 +145,13 @@
         .name = "usb",
         .ctx = bus,
         .ops = &usb_bus_device_proto,
-        .proto_id = MX_PROTOCOL_USB_BUS,
+        .proto_id = ZX_PROTOCOL_USB_BUS,
         .proto_ops = &_bus_protocol,
         .flags = DEVICE_ADD_NON_BINDABLE,
     };
 
-    mx_status_t status = device_add(device, &args, &bus->mxdev);
-    if (status == MX_OK) {
+    zx_status_t status = device_add(device, &args, &bus->mxdev);
+    if (status == ZX_OK) {
         static usb_bus_interface_t bus_intf;
         bus_intf.ops = &_bus_interface;
         bus_intf.ctx = bus;
@@ -164,11 +164,11 @@
     return status;
 }
 
-static mx_driver_ops_t usb_bus_driver_ops = {
+static zx_driver_ops_t usb_bus_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = usb_bus_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(usb_bus, usb_bus_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_USB_HCI),
-MAGENTA_DRIVER_END(usb_bus)
+ZIRCON_DRIVER_BEGIN(usb_bus, usb_bus_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_USB_HCI),
+ZIRCON_DRIVER_END(usb_bus)
diff --git a/system/dev/usb/usb-bus/usb-device.c b/system/dev/usb/usb-bus/usb-device.c
index 77b3f4d..a453341 100644
--- a/system/dev/usb/usb-bus/usb-device.c
+++ b/system/dev/usb/usb-bus/usb-device.c
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include <ddk/debug.h>
-#include <magenta/hw/usb-audio.h>
+#include <zircon/hw/usb-audio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -34,10 +34,10 @@
     { 0, 0, 0 },
 };
 
-static mx_status_t usb_device_add_interfaces(usb_device_t* parent,
+static zx_status_t usb_device_add_interfaces(usb_device_t* parent,
                                              usb_configuration_descriptor_t* config);
 
-mx_status_t usb_device_set_interface(usb_device_t* device, uint8_t interface_id,
+zx_status_t usb_device_set_interface(usb_device_t* device, uint8_t interface_id,
                                      uint8_t alt_setting) {
     mtx_lock(&device->interface_mutex);
     usb_interface_t* intf;
@@ -48,7 +48,7 @@
         }
     }
     mtx_unlock(&device->interface_mutex);
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
 
 static usb_configuration_descriptor_t* get_config_desc(usb_device_t* dev, int config) {
@@ -62,29 +62,29 @@
     return NULL;
 }
 
-mx_status_t usb_device_claim_interface(usb_device_t* device, uint8_t interface_id) {
+zx_status_t usb_device_claim_interface(usb_device_t* device, uint8_t interface_id) {
     mtx_lock(&device->interface_mutex);
 
     interface_status_t status = device->interface_statuses[interface_id];
     if (status == CLAIMED) {
         // The interface has already been claimed by a different interface.
         mtx_unlock(&device->interface_mutex);
-        return MX_ERR_ALREADY_BOUND;
+        return ZX_ERR_ALREADY_BOUND;
     } else if (status == CHILD_DEVICE) {
         bool removed = usb_device_remove_interface_by_id_locked(device, interface_id);
         if (!removed) {
             mtx_unlock(&device->interface_mutex);
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
     }
     device->interface_statuses[interface_id] = CLAIMED;
 
     mtx_unlock(&device->interface_mutex);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t usb_device_set_configuration(usb_device_t* dev, int config) {
+zx_status_t usb_device_set_configuration(usb_device_t* dev, int config) {
     int num_configurations = dev->device_desc.bNumConfigurations;
     usb_configuration_descriptor_t* config_desc = NULL;
     int config_index = -1;
@@ -98,10 +98,10 @@
             break;
         }
     }
-    if (!config_desc) return MX_ERR_INVALID_ARGS;
+    if (!config_desc) return ZX_ERR_INVALID_ARGS;
 
     // set configuration
-    mx_status_t status = usb_device_control(dev->hci_mxdev, dev->device_id,
+    zx_status_t status = usb_device_control(dev->hci_mxdev, dev->device_id,
                              USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
                              USB_REQ_SET_CONFIGURATION, config, 0,
                              NULL, 0);
@@ -119,80 +119,80 @@
     return usb_device_add_interfaces(dev, config_desc);
 }
 
-static mx_status_t usb_device_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
+static zx_status_t usb_device_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
                                     void* out_buf, size_t out_len, size_t* out_actual) {
     usb_device_t* dev = ctx;
 
     switch (op) {
     case IOCTL_USB_GET_DEVICE_TYPE: {
         int* reply = out_buf;
-        if (out_len < sizeof(*reply)) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(*reply)) return ZX_ERR_BUFFER_TOO_SMALL;
         *reply = USB_DEVICE_TYPE_DEVICE;
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_DEVICE_SPEED: {
         int* reply = out_buf;
-        if (out_len < sizeof(*reply)) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(*reply)) return ZX_ERR_BUFFER_TOO_SMALL;
         *reply = dev->speed;
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_DEVICE_DESC: {
         usb_device_descriptor_t* descriptor = &dev->device_desc;
-        if (out_len < sizeof(*descriptor)) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(*descriptor)) return ZX_ERR_BUFFER_TOO_SMALL;
         memcpy(out_buf, descriptor, sizeof(*descriptor));
         *out_actual = sizeof(*descriptor);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_CONFIG_DESC_SIZE: {
-        if (in_len != sizeof(int)) return MX_ERR_INVALID_ARGS;
+        if (in_len != sizeof(int)) return ZX_ERR_INVALID_ARGS;
         int config = *((int *)in_buf);
         int* reply = out_buf;
         usb_configuration_descriptor_t* descriptor = get_config_desc(dev, config);
         if (!descriptor) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         *reply = le16toh(descriptor->wTotalLength);
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_DESCRIPTORS_SIZE: {
         usb_configuration_descriptor_t* descriptor = dev->config_descs[dev->current_config_index];
         int* reply = out_buf;
-        if (out_len < sizeof(*reply)) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(*reply)) return ZX_ERR_BUFFER_TOO_SMALL;
         *reply = le16toh(descriptor->wTotalLength);
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_CONFIG_DESC: {
-        if (in_len != sizeof(int)) return MX_ERR_INVALID_ARGS;
+        if (in_len != sizeof(int)) return ZX_ERR_INVALID_ARGS;
         int config = *((int *)in_buf);
         usb_configuration_descriptor_t* descriptor = get_config_desc(dev, config);
         if (!descriptor) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         size_t desc_length = le16toh(descriptor->wTotalLength);
-        if (out_len < desc_length) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < desc_length) return ZX_ERR_BUFFER_TOO_SMALL;
         memcpy(out_buf, descriptor, desc_length);
         return desc_length;
         *out_actual = desc_length;
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_DESCRIPTORS: {
         usb_configuration_descriptor_t* descriptor = dev->config_descs[dev->current_config_index];
         size_t desc_length = le16toh(descriptor->wTotalLength);
-        if (out_len < desc_length) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < desc_length) return ZX_ERR_BUFFER_TOO_SMALL;
         memcpy(out_buf, descriptor, desc_length);
         *out_actual = desc_length;
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_STRING_DESC: {
-        if (in_len != sizeof(int)) return MX_ERR_INVALID_ARGS;
+        if (in_len != sizeof(int)) return ZX_ERR_INVALID_ARGS;
         if (out_len == 0) return 0;
         int id = *((int *)in_buf);
         char string[MAX_USB_STRING_LEN];
-        mx_status_t result = usb_device_get_string_descriptor(dev->hci_mxdev, dev->device_id, id,
+        zx_status_t result = usb_device_get_string_descriptor(dev->hci_mxdev, dev->device_id, id,
                                                               string, sizeof(string));
         if (result < 0) return result;
         size_t length = strlen(string) + 1;
@@ -205,50 +205,50 @@
             memcpy(out_buf, string, length);
         }
         *out_actual = length;
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_SET_INTERFACE: {
-        if (in_len != 2 * sizeof(int)) return MX_ERR_INVALID_ARGS;
+        if (in_len != 2 * sizeof(int)) return ZX_ERR_INVALID_ARGS;
         int* args = (int *)in_buf;
         return usb_device_set_interface(dev, args[0], args[1]);
     }
     case IOCTL_USB_GET_CURRENT_FRAME: {
         uint64_t* reply = out_buf;
-        if (out_len < sizeof(*reply)) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(*reply)) return ZX_ERR_BUFFER_TOO_SMALL;
         *reply = usb_hci_get_current_frame(&dev->hci);
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_DEVICE_ID: {
         uint64_t* reply = out_buf;
-        if (out_len < sizeof(*reply)) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(*reply)) return ZX_ERR_BUFFER_TOO_SMALL;
         *reply = dev->device_id;
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_DEVICE_HUB_ID: {
         uint64_t* reply = out_buf;
-        if (out_len < sizeof(*reply)) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(*reply)) return ZX_ERR_BUFFER_TOO_SMALL;
         *reply = dev->hub_id;
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_CONFIGURATION: {
         int* reply = out_buf;
-        if (out_len != sizeof(*reply)) return MX_ERR_INVALID_ARGS;
+        if (out_len != sizeof(*reply)) return ZX_ERR_INVALID_ARGS;
         usb_configuration_descriptor_t* descriptor = dev->config_descs[dev->current_config_index];
         *reply = descriptor->bConfigurationValue;
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_SET_CONFIGURATION: {
-        if (in_len != sizeof(int)) return MX_ERR_INVALID_ARGS;
+        if (in_len != sizeof(int)) return ZX_ERR_INVALID_ARGS;
         int config = *((int *)in_buf);
         dprintf(TRACE, "IOCTL_USB_SET_CONFIGURATION %d\n", config);
         return usb_device_set_configuration(dev, config);
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -271,7 +271,7 @@
     free(dev);
 }
 
-static mx_protocol_device_t usb_device_proto = {
+static zx_protocol_device_t usb_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .ioctl = usb_device_ioctl,
     .release = usb_device_release,
@@ -279,10 +279,10 @@
 
 #define NEXT_DESCRIPTOR(header) ((usb_descriptor_header_t*)((void*)header + header->bLength))
 
-static mx_status_t usb_device_add_interfaces(usb_device_t* parent,
+static zx_status_t usb_device_add_interfaces(usb_device_t* parent,
                                              usb_configuration_descriptor_t* config) {
     usb_device_descriptor_t* device_desc = &parent->device_desc;
-    mx_status_t result = MX_OK;
+    zx_status_t result = ZX_OK;
 
     // Iterate through interfaces in first configuration and create devices for them
     usb_descriptor_header_t* header = NEXT_DESCRIPTOR(config);
@@ -313,11 +313,11 @@
 
             size_t length = (void *)next - (void *)assoc_desc;
             usb_interface_assoc_descriptor_t* assoc_copy = malloc(length);
-            if (!assoc_copy) return MX_ERR_NO_MEMORY;
+            if (!assoc_copy) return ZX_ERR_NO_MEMORY;
             memcpy(assoc_copy, assoc_desc, length);
 
-            mx_status_t status = usb_device_add_interface_association(parent, device_desc, assoc_copy, length);
-            if (status != MX_OK) {
+            zx_status_t status = usb_device_add_interface_association(parent, device_desc, assoc_copy, length);
+            if (status != ZX_OK) {
                 result = status;
             }
 
@@ -346,11 +346,11 @@
             size_t length = (void *)next - (void *)intf_desc;
             if (intf_status == AVAILABLE) {
                 usb_interface_descriptor_t* intf_copy = malloc(length);
-                if (!intf_copy) return MX_ERR_NO_MEMORY;
+                if (!intf_copy) return ZX_ERR_NO_MEMORY;
                 memcpy(intf_copy, intf_desc, length);
-                mx_status_t status = usb_device_add_interface(parent, device_desc,
+                zx_status_t status = usb_device_add_interface(parent, device_desc,
                                                               intf_copy, length);
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     result = status;
                 }
                 // The interface may have been claimed in the meanwhile, so we need to
@@ -361,7 +361,7 @@
                                                                             intf_desc->bInterfaceNumber);
                     if (!removed) {
                         mtx_unlock(&parent->interface_mutex);
-                        return MX_ERR_BAD_STATE;
+                        return ZX_ERR_BAD_STATE;
                     }
                 } else {
                     parent->interface_statuses[intf_desc->bInterfaceNumber] = CHILD_DEVICE;
@@ -377,17 +377,17 @@
     return result;
 }
 
-mx_status_t usb_device_add(mx_device_t* hci_mxdev, usb_hci_protocol_t* hci_protocol,
-                           mx_device_t* parent,  uint32_t device_id, uint32_t hub_id,
+zx_status_t usb_device_add(zx_device_t* hci_mxdev, usb_hci_protocol_t* hci_protocol,
+                           zx_device_t* parent,  uint32_t device_id, uint32_t hub_id,
                            usb_speed_t speed, usb_device_t** out_device) {
 
     usb_device_t* dev = calloc(1, sizeof(usb_device_t));
     if (!dev)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // read device descriptor
     usb_device_descriptor_t* device_desc = &dev->device_desc;
-    mx_status_t status = usb_device_get_descriptor(hci_mxdev, device_id, USB_DT_DEVICE, 0, 0,
+    zx_status_t status = usb_device_get_descriptor(hci_mxdev, device_id, USB_DT_DEVICE, 0, 0,
                                                    device_desc, sizeof(*device_desc));
     if (status != sizeof(*device_desc)) {
         dprintf(ERROR, "usb_device_add: usb_device_get_descriptor failed\n");
@@ -399,7 +399,7 @@
     usb_configuration_descriptor_t** configs = calloc(num_configurations,
                                                       sizeof(usb_configuration_descriptor_t*));
     if (!configs) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto error_exit;
     }
 
@@ -415,7 +415,7 @@
         uint16_t config_desc_size = letoh16(config_desc_header.wTotalLength);
         usb_configuration_descriptor_t* config_desc = malloc(config_desc_size);
         if (!config_desc) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto error_exit;
         }
         configs[config] = config_desc;
@@ -442,7 +442,7 @@
     }
     if (configuration > num_configurations) {
         dprintf(ERROR, "usb_device_add: override configuration number out of range\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     dev->current_config_index = configuration - 1;
 
@@ -474,7 +474,7 @@
     dev->interface_statuses = calloc(cur_config->bNumInterfaces,
                                      sizeof(interface_status_t));
     if (!dev->interface_statuses) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto error_exit;
     }
 
@@ -486,14 +486,14 @@
         .name = name,
         .ctx = dev,
         .ops = &usb_device_proto,
-        .proto_id = MX_PROTOCOL_USB,
+        .proto_id = ZX_PROTOCOL_USB,
         // Do not allow binding to root of a composite device.
         // Clients will bind to the child interfaces instead.
         .flags = DEVICE_ADD_NON_BINDABLE,
     };
 
     status = device_add(parent, &args, &dev->mxdev);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         *out_device = dev;
     } else {
         goto error_exit;
diff --git a/system/dev/usb/usb-bus/usb-device.h b/system/dev/usb/usb-bus/usb-device.h
index 2907162..db100ed 100644
--- a/system/dev/usb/usb-bus/usb-device.h
+++ b/system/dev/usb/usb-bus/usb-device.h
@@ -7,7 +7,7 @@
 #include <ddk/binding.h>
 #include <ddk/device.h>
 #include <ddk/protocol/usb-hci.h>
-#include <magenta/hw/usb.h>
+#include <zircon/hw/usb.h>
 
 #include <threads.h>
 
@@ -22,8 +22,8 @@
 
 // Represents a USB top-level device
 typedef struct usb_device {
-    mx_device_t* mxdev;
-    mx_device_t* hci_mxdev;
+    zx_device_t* mxdev;
+    zx_device_t* hci_mxdev;
     usb_hci_protocol_t hci;
 
     // ID assigned by host controller
@@ -46,17 +46,17 @@
     list_node_t node;
 } usb_device_t;
 
-mx_status_t usb_device_add(mx_device_t* hci_device, usb_hci_protocol_t* hci_protocol,
-                           mx_device_t* parent,  uint32_t device_id, uint32_t hub_id,
+zx_status_t usb_device_add(zx_device_t* hci_device, usb_hci_protocol_t* hci_protocol,
+                           zx_device_t* parent,  uint32_t device_id, uint32_t hub_id,
                            usb_speed_t speed, usb_device_t** out_device);
 
 void usb_device_remove(usb_device_t* dev);
 
-mx_status_t usb_device_set_interface(usb_device_t* device, uint8_t interface_id,
+zx_status_t usb_device_set_interface(usb_device_t* device, uint8_t interface_id,
                                      uint8_t alt_setting);
 
 // Marks the interface as claimed, removing the device if it exists.
 // Returns an error if the interface was already claimed by another interface.
-mx_status_t usb_device_claim_interface(usb_device_t* dev, uint8_t interface_id);
+zx_status_t usb_device_claim_interface(usb_device_t* dev, uint8_t interface_id);
 
-mx_status_t usb_device_set_configuration(usb_device_t* dev, int config);
+zx_status_t usb_device_set_configuration(usb_device_t* dev, int config);
diff --git a/system/dev/usb/usb-bus/usb-interface.c b/system/dev/usb/usb-bus/usb-interface.c
index 14bb6ea..ce24680 100644
--- a/system/dev/usb/usb-bus/usb-interface.c
+++ b/system/dev/usb/usb-bus/usb-interface.c
@@ -22,7 +22,7 @@
 
     while (!done) {
         // wait for new txns to complete or for signal to exit this thread
-        completion_wait(&intf->callback_thread_completion, MX_TIME_INFINITE);
+        completion_wait(&intf->callback_thread_completion, ZX_TIME_INFINITE);
 
         mtx_lock(&intf->callback_lock);
 
@@ -81,8 +81,8 @@
 
     // clone the txn and pass it down to the HCI driver
     iotxn_t* clone = NULL;
-    mx_status_t status = iotxn_clone(txn, &clone);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_clone(txn, &clone);
+    if (status != ZX_OK) {
         iotxn_complete(txn, status, 0);
         return;
     }
@@ -96,7 +96,7 @@
     iotxn_queue(intf->hci_mxdev, clone);
 }
 
-static mx_status_t usb_interface_ioctl(void* ctx, uint32_t op, const void* in_buf,
+static zx_status_t usb_interface_ioctl(void* ctx, uint32_t op, const void* in_buf,
                                        size_t in_len, void* out_buf, size_t out_len,
                                        size_t* out_actual) {
     usb_interface_t* intf = ctx;
@@ -104,25 +104,25 @@
     switch (op) {
     case IOCTL_USB_GET_DEVICE_TYPE: {
         int* reply = out_buf;
-        if (out_len < sizeof(*reply)) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(*reply)) return ZX_ERR_BUFFER_TOO_SMALL;
         *reply = USB_DEVICE_TYPE_INTERFACE;
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_DESCRIPTORS_SIZE: {
         int* reply = out_buf;
-        if (out_len < sizeof(*reply)) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < sizeof(*reply)) return ZX_ERR_BUFFER_TOO_SMALL;
         *reply = intf->descriptor_length;
         *out_actual = sizeof(*reply);
-        return MX_OK;
+        return ZX_OK;
     }
     case IOCTL_USB_GET_DESCRIPTORS: {
         void* descriptors = intf->descriptor;
         size_t desc_length = intf->descriptor_length;
-        if (out_len < desc_length) return MX_ERR_BUFFER_TOO_SMALL;
+        if (out_len < desc_length) return ZX_ERR_BUFFER_TOO_SMALL;
         memcpy(out_buf, descriptors, desc_length);
         *out_actual = desc_length;
-        return MX_OK;
+        return ZX_OK;
     }
     default:
         // other ioctls are handled by top level device
@@ -139,7 +139,7 @@
     free(intf);
 }
 
-static mx_protocol_device_t usb_interface_proto = {
+static zx_protocol_device_t usb_interface_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = usb_interface_iotxn_queue,
     .ioctl = usb_interface_ioctl,
@@ -148,23 +148,23 @@
 
 #define NEXT_DESCRIPTOR(header) ((usb_descriptor_header_t*)((void*)header + header->bLength))
 
-static mx_status_t usb_interface_enable_endpoint(usb_interface_t* intf,
+static zx_status_t usb_interface_enable_endpoint(usb_interface_t* intf,
                                                  usb_endpoint_descriptor_t* ep,
                                                  usb_ss_ep_comp_descriptor_t* ss_comp_desc,
                                                  bool enable) {
-    mx_status_t status = usb_hci_enable_endpoint(&intf->hci, intf->device_id, ep, ss_comp_desc,
+    zx_status_t status = usb_hci_enable_endpoint(&intf->hci, intf->device_id, ep, ss_comp_desc,
                                                  enable);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "usb_interface_enable_endpoint failed: %d\n", status);
     }
     return status;
 }
 
-static mx_status_t usb_interface_configure_endpoints(usb_interface_t* intf, uint8_t interface_id,
+static zx_status_t usb_interface_configure_endpoints(usb_interface_t* intf, uint8_t interface_id,
                                                      uint8_t alt_setting) {
     usb_endpoint_descriptor_t* new_endpoints[USB_MAX_EPS] = {};
     bool interface_endpoints[USB_MAX_EPS] = {};
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     // iterate through our descriptors to find which endpoints should be active
     usb_descriptor_header_t* header = intf->descriptor;
@@ -196,8 +196,8 @@
             usb_endpoint_descriptor_t* new_ep = new_endpoints[i];
             if (old_ep != new_ep) {
                 if (old_ep) {
-                    mx_status_t ret = usb_interface_enable_endpoint(intf, old_ep, NULL, false);
-                    if (ret != MX_OK) status = ret;
+                    zx_status_t ret = usb_interface_enable_endpoint(intf, old_ep, NULL, false);
+                    if (ret != ZX_OK) status = ret;
                 }
                 if (new_ep) {
                     usb_ss_ep_comp_descriptor_t* ss_comp_desc = NULL;
@@ -207,8 +207,8 @@
                         && next->bDescriptorType == USB_DT_SS_EP_COMPANION) {
                         ss_comp_desc = (usb_ss_ep_comp_descriptor_t *)next;
                     }
-                    mx_status_t ret = usb_interface_enable_endpoint(intf, new_ep, ss_comp_desc, true);
-                    if (ret != MX_OK) status = ret;
+                    zx_status_t ret = usb_interface_enable_endpoint(intf, new_ep, ss_comp_desc, true);
+                    if (ret != ZX_OK) status = ret;
                 }
                 intf->active_endpoints[i] = new_ep;
             }
@@ -221,18 +221,18 @@
     completion_signal((completion_t*)cookie);
 }
 
-static mx_status_t usb_interface_control(void* ctx, uint8_t request_type, uint8_t request,
+static zx_status_t usb_interface_control(void* ctx, uint8_t request_type, uint8_t request,
                                          uint16_t value, uint16_t index, void* data,
-                                         size_t length, mx_time_t timeout) {
+                                         size_t length, zx_time_t timeout) {
     usb_interface_t* intf = ctx;
     iotxn_t* txn;
 
     uint32_t flags = (length == 0 ? IOTXN_ALLOC_POOL : 0);
-    mx_status_t status = iotxn_alloc(&txn, flags, length);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc(&txn, flags, length);
+    if (status != ZX_OK) {
         return status;
     }
-    txn->protocol = MX_PROTOCOL_USB;
+    txn->protocol = ZX_PROTOCOL_USB;
 
     static_assert(sizeof(usb_protocol_data_t) <= sizeof(iotxn_proto_data_t), "");
     usb_protocol_data_t* proto_data = iotxn_pdata(txn, usb_protocol_data_t);
@@ -260,18 +260,18 @@
     iotxn_queue(intf->mxdev, txn);
     status = completion_wait(&completion, timeout);
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         status = txn->status;
-    } else if (status == MX_ERR_TIMED_OUT) {
+    } else if (status == ZX_ERR_TIMED_OUT) {
         // cancel transactions and wait for txn to be completed
         completion_reset(&completion);
         status = usb_hci_cancel_all(&intf->hci, intf->device_id, 0);
-        if (status == MX_OK) {
-            completion_wait(&completion, MX_TIME_INFINITE);
-            status = MX_ERR_TIMED_OUT;
+        if (status == ZX_OK) {
+            completion_wait(&completion, ZX_TIME_INFINITE);
+            status = ZX_ERR_TIMED_OUT;
         }
     }
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         status = txn->actual;
 
         if (length > 0 && !out) {
@@ -284,7 +284,7 @@
 
 static void usb_interface_queue(void* ctx, iotxn_t* txn, uint8_t ep_address, uint64_t frame) {
     usb_interface_t* intf = ctx;
-    txn->protocol = MX_PROTOCOL_USB;
+    txn->protocol = ZX_PROTOCOL_USB;
     usb_protocol_data_t* data = iotxn_pdata(txn, usb_protocol_data_t);
 
     memset(data, 0, sizeof(*data));
@@ -298,17 +298,17 @@
     return intf->device->speed;
 }
 
-static mx_status_t usb_interface_set_interface(void* ctx, int interface_number, int alt_setting) {
+static zx_status_t usb_interface_set_interface(void* ctx, int interface_number, int alt_setting) {
     usb_interface_t* intf = ctx;
     return usb_device_set_interface(intf->device, interface_number, alt_setting);
 }
 
-static mx_status_t usb_interface_set_configuration(void* ctx, int configuration) {
+static zx_status_t usb_interface_set_configuration(void* ctx, int configuration) {
     usb_interface_t* intf = ctx;
     return usb_device_set_configuration(intf->device, configuration);
 }
 
-static mx_status_t usb_interface_reset_endpoint(void* ctx, uint8_t ep_address) {
+static zx_status_t usb_interface_reset_endpoint(void* ctx, uint8_t ep_address) {
     usb_interface_t* intf = ctx;
     return usb_hci_reset_endpoint(&intf->hci, intf->device_id, ep_address);
 }
@@ -323,22 +323,22 @@
     return intf->device_id;
 }
 
-static mx_status_t usb_interface_get_descriptor_list(void* ctx, void** out_descriptors,
+static zx_status_t usb_interface_get_descriptor_list(void* ctx, void** out_descriptors,
                                                      size_t* out_length) {
     usb_interface_t* intf = ctx;
     void* descriptors = malloc(intf->descriptor_length);
     if (!descriptors) {
         *out_descriptors = NULL;
         *out_length = 0;
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     memcpy(descriptors, intf->descriptor, intf->descriptor_length);
     *out_descriptors = descriptors;
     *out_length = intf->descriptor_length;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_interface_get_additional_descriptor_list(void* ctx, void** out_descriptors,
+static zx_status_t usb_interface_get_additional_descriptor_list(void* ctx, void** out_descriptors,
                                                                 size_t* out_length) {
     usb_interface_t* intf = ctx;
 
@@ -364,36 +364,36 @@
     if (!result) {
         *out_descriptors = NULL;
         *out_length = 0;
-        return MX_OK;
+        return ZX_OK;
     }
     size_t length = (void*)end - (void*)result;
     void* descriptors = malloc(length);
     if (!descriptors) {
         *out_descriptors = NULL;
         *out_length = 0;
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     memcpy(descriptors, result, length);
     *out_descriptors = descriptors;
     *out_length = length;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_interface_claim_device_interface(void* ctx,
+static zx_status_t usb_interface_claim_device_interface(void* ctx,
                                                         usb_interface_descriptor_t* claim_intf,
                                                         size_t claim_length) {
     usb_interface_t* intf = ctx;
 
-    mx_status_t status = usb_device_claim_interface(intf->device,
+    zx_status_t status = usb_device_claim_interface(intf->device,
                                                     claim_intf->bInterfaceNumber);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     // Copy claimed interface descriptors to end of descriptor array.
     void* descriptors = realloc(intf->descriptor,
                                 intf->descriptor_length + claim_length);
     if (!descriptors) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     memcpy(descriptors + intf->descriptor_length, claim_intf, claim_length);
     intf->descriptor = descriptors;
@@ -402,10 +402,10 @@
     if (claim_intf->bInterfaceNumber > intf->last_interface_id) {
         intf->last_interface_id = claim_intf->bInterfaceNumber;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_interface_cancel_all(void* ctx, uint8_t ep_address) {
+static zx_status_t usb_interface_cancel_all(void* ctx, uint8_t ep_address) {
     usb_interface_t* intf = ctx;
     return usb_hci_cancel_all(&intf->hci, intf->device_id, ep_address);
 }
@@ -425,13 +425,13 @@
     .cancel_all = usb_interface_cancel_all,
 };
 
-mx_status_t usb_device_add_interface(usb_device_t* device,
+zx_status_t usb_device_add_interface(usb_device_t* device,
                                      usb_device_descriptor_t* device_desc,
                                      usb_interface_descriptor_t* interface_desc,
                                      size_t interface_desc_length) {
     usb_interface_t* intf = calloc(1, sizeof(usb_interface_t));
     if (!intf)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     mtx_init(&intf->callback_lock, mtx_plain);
     completion_reset(&intf->callback_thread_completion);
@@ -457,8 +457,8 @@
         usb_protocol = interface_desc->bInterfaceProtocol;
    }
 
-    mx_status_t status = usb_interface_configure_endpoints(intf, interface_desc->bInterfaceNumber, 0);
-    if (status != MX_OK) {
+    zx_status_t status = usb_interface_configure_endpoints(intf, interface_desc->bInterfaceNumber, 0);
+    if (status != ZX_OK) {
         free(intf);
         return status;
     }
@@ -475,8 +475,8 @@
     char name[20];
     snprintf(name, sizeof(name), "ifc-%03d", interface_desc->bInterfaceNumber);
 
-    mx_device_prop_t props[] = {
-        { BIND_PROTOCOL, 0, MX_PROTOCOL_USB },
+    zx_device_prop_t props[] = {
+        { BIND_PROTOCOL, 0, ZX_PROTOCOL_USB },
         { BIND_USB_VID, 0, device_desc->idVendor },
         { BIND_USB_PID, 0, device_desc->idProduct },
         { BIND_USB_CLASS, 0, usb_class },
@@ -489,14 +489,14 @@
         .name = name,
         .ctx = intf,
         .ops = &usb_interface_proto,
-        .proto_id = MX_PROTOCOL_USB,
+        .proto_id = ZX_PROTOCOL_USB,
         .proto_ops = &_usb_protocol,
         .props = props,
         .prop_count = countof(props),
     };
 
     status = device_add(device->mxdev, &args, &intf->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         stop_callback_thread(intf);
         list_delete(&intf->node);
         free(interface_desc);
@@ -505,13 +505,13 @@
     return status;
 }
 
-mx_status_t usb_device_add_interface_association(usb_device_t* device,
+zx_status_t usb_device_add_interface_association(usb_device_t* device,
                                                  usb_device_descriptor_t* device_desc,
                                                  usb_interface_assoc_descriptor_t* assoc_desc,
                                                  size_t assoc_desc_length) {
     usb_interface_t* intf = calloc(1, sizeof(usb_interface_t));
     if (!intf)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     mtx_init(&intf->callback_lock, mtx_plain);
     completion_reset(&intf->callback_thread_completion);
@@ -544,8 +544,8 @@
         if (header->bDescriptorType == USB_DT_INTERFACE) {
             usb_interface_descriptor_t* intf_desc = (usb_interface_descriptor_t*)header;
             if (intf_desc->bAlternateSetting == 0) {
-                mx_status_t status = usb_interface_configure_endpoints(intf, intf_desc->bInterfaceNumber, 0);
-                if (status != MX_OK) return status;
+                zx_status_t status = usb_interface_configure_endpoints(intf, intf_desc->bInterfaceNumber, 0);
+                if (status != ZX_OK) return status;
             }
         }
         header = NEXT_DESCRIPTOR(header);
@@ -563,8 +563,8 @@
     char name[20];
     snprintf(name, sizeof(name), "asc-%03d", assoc_desc->iFunction);
 
-    mx_device_prop_t props[] = {
-        { BIND_PROTOCOL, 0, MX_PROTOCOL_USB },
+    zx_device_prop_t props[] = {
+        { BIND_PROTOCOL, 0, ZX_PROTOCOL_USB },
         { BIND_USB_VID, 0, device_desc->idVendor },
         { BIND_USB_PID, 0, device_desc->idProduct },
         { BIND_USB_CLASS, 0, usb_class },
@@ -577,14 +577,14 @@
         .name = name,
         .ctx = intf,
         .ops = &usb_interface_proto,
-        .proto_id = MX_PROTOCOL_USB,
+        .proto_id = ZX_PROTOCOL_USB,
         .proto_ops = &_usb_protocol,
         .props = props,
         .prop_count = countof(props),
     };
 
-    mx_status_t status = device_add(device->mxdev, &args, &intf->mxdev);
-    if (status != MX_OK) {
+    zx_status_t status = device_add(device->mxdev, &args, &intf->mxdev);
+    if (status != ZX_OK) {
         stop_callback_thread(intf);
         list_delete(&intf->node);
         free(assoc_desc);
@@ -619,13 +619,13 @@
     return false;
 }
 
-mx_status_t usb_interface_get_device_id(mx_device_t* device, uint32_t* out) {
+zx_status_t usb_interface_get_device_id(zx_device_t* device, uint32_t* out) {
     usb_protocol_t usb;
-    if (device_get_protocol(device, MX_PROTOCOL_USB, &usb) != MX_OK) {
-        return MX_ERR_INTERNAL;
+    if (device_get_protocol(device, ZX_PROTOCOL_USB, &usb) != ZX_OK) {
+        return ZX_ERR_INTERNAL;
     }
     *out = usb_get_device_id(&usb);
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool usb_interface_contains_interface(usb_interface_t* intf, uint8_t interface_id) {
@@ -644,10 +644,10 @@
     return false;
 }
 
-mx_status_t usb_interface_set_alt_setting(usb_interface_t* intf, uint8_t interface_id,
+zx_status_t usb_interface_set_alt_setting(usb_interface_t* intf, uint8_t interface_id,
                                           uint8_t alt_setting) {
-    mx_status_t status = usb_interface_configure_endpoints(intf, interface_id, alt_setting);
-    if (status != MX_OK) return status;
+    zx_status_t status = usb_interface_configure_endpoints(intf, interface_id, alt_setting);
+    if (status != ZX_OK) return status;
 
     return usb_device_control(intf->hci_mxdev, intf->device_id,
                               USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_INTERFACE,
diff --git a/system/dev/usb/usb-bus/usb-interface.h b/system/dev/usb/usb-bus/usb-interface.h
index d325a32..cc45367 100644
--- a/system/dev/usb/usb-bus/usb-interface.h
+++ b/system/dev/usb/usb-bus/usb-interface.h
@@ -5,16 +5,16 @@
 #pragma once
 
 #include <ddk/device.h>
-#include <magenta/device/usb.h>
-#include <magenta/hw/usb.h>
+#include <zircon/device/usb.h>
+#include <zircon/hw/usb.h>
 #include <sync/completion.h>
 #include <threads.h>
 
 // Represents an interface within a composite device
 typedef struct {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     usb_device_t* device;
-    mx_device_t* hci_mxdev;
+    zx_device_t* hci_mxdev;
     usb_hci_protocol_t hci;
     uint32_t device_id;
 
@@ -47,12 +47,12 @@
 
 typedef struct usb_device usb_device_t;
 
-mx_status_t usb_device_add_interface(usb_device_t* device,
+zx_status_t usb_device_add_interface(usb_device_t* device,
                                      usb_device_descriptor_t* device_descriptor,
                                      usb_interface_descriptor_t* interface_desc,
                                      size_t interface_desc_length);
 
-mx_status_t usb_device_add_interface_association(usb_device_t* device,
+zx_status_t usb_device_add_interface_association(usb_device_t* device,
                                                  usb_device_descriptor_t* device_desc,
                                                  usb_interface_assoc_descriptor_t* assoc_desc,
                                                  size_t assoc_desc_length);
@@ -62,9 +62,9 @@
 // returns whether the interface with the given id was removed.
 bool usb_device_remove_interface_by_id_locked(usb_device_t* device, uint8_t interface_id);
 
-mx_status_t usb_interface_get_device_id(mx_device_t* device, uint32_t* id);
+zx_status_t usb_interface_get_device_id(zx_device_t* device, uint32_t* id);
 
 bool usb_interface_contains_interface(usb_interface_t* intf, uint8_t interface_id);
 
-mx_status_t usb_interface_set_alt_setting(usb_interface_t* intf, uint8_t interface_id,
+zx_status_t usb_interface_set_alt_setting(usb_interface_t* intf, uint8_t interface_id,
                                           uint8_t alt_setting);
diff --git a/system/dev/usb/usb-bus/util.c b/system/dev/usb/usb-bus/util.c
index 37e6115..9d5aea6 100644
--- a/system/dev/usb/usb-bus/util.c
+++ b/system/dev/usb/usb-bus/util.c
@@ -14,15 +14,15 @@
     completion_signal((completion_t*)cookie);
 }
 
-mx_status_t usb_device_control(mx_device_t* hci_device, uint32_t device_id,
+zx_status_t usb_device_control(zx_device_t* hci_device, uint32_t device_id,
                                uint8_t request_type,  uint8_t request, uint16_t value,
                                uint16_t index, void* data, size_t length) {
     iotxn_t* txn;
 
     uint32_t flags = (length == 0 ? IOTXN_ALLOC_POOL : 0);
-    mx_status_t status = iotxn_alloc(&txn, flags, length);
-    if (status != MX_OK) return status;
-    txn->protocol = MX_PROTOCOL_USB;
+    zx_status_t status = iotxn_alloc(&txn, flags, length);
+    if (status != ZX_OK) return status;
+    txn->protocol = ZX_PROTOCOL_USB;
     usb_protocol_data_t* proto_data = iotxn_pdata(txn, usb_protocol_data_t);
     memset(proto_data, 0, sizeof(*proto_data));
 
@@ -47,10 +47,10 @@
     txn->complete_cb = usb_device_control_complete;
     txn->cookie = &completion;
     iotxn_queue(hci_device, txn);
-    completion_wait(&completion, MX_TIME_INFINITE);
+    completion_wait(&completion, ZX_TIME_INFINITE);
 
     status = txn->status;
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         status = txn->actual;
 
         if (length > 0 && !out) {
@@ -61,13 +61,13 @@
     return status;
 }
 
-mx_status_t usb_device_get_descriptor(mx_device_t* hci_device, uint32_t device_id, uint16_t type,
+zx_status_t usb_device_get_descriptor(zx_device_t* hci_device, uint32_t device_id, uint16_t type,
                                       uint16_t index, uint16_t language, void* data, size_t length) {
     return usb_device_control(hci_device, device_id, USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
                            USB_REQ_GET_DESCRIPTOR, type << 8 | index, language, data, length);
 }
 
-mx_status_t usb_device_get_string_descriptor(mx_device_t* hci_device, uint32_t device_id, uint8_t id,
+zx_status_t usb_device_get_string_descriptor(zx_device_t* hci_device, uint32_t device_id, uint8_t id,
                                              char* buf, size_t buflen) {
     uint16_t buffer[128];
     uint16_t languages[128];
@@ -77,7 +77,7 @@
     memset(languages, 0, sizeof(languages));
 
     // read list of supported languages
-    mx_status_t result = usb_device_get_descriptor(hci_device, device_id, USB_DT_STRING, 0, 0,
+    zx_status_t result = usb_device_get_descriptor(hci_device, device_id, USB_DT_STRING, 0, 0,
                                                    languages, sizeof(languages));
     if (result < 0) {
         return result;
diff --git a/system/dev/usb/usb-bus/util.h b/system/dev/usb/usb-bus/util.h
index 2450840..a1cb8e5 100644
--- a/system/dev/usb/usb-bus/util.h
+++ b/system/dev/usb/usb-bus/util.h
@@ -6,16 +6,16 @@
 
 #include <ddk/device.h>
 
-mx_status_t usb_device_control(mx_device_t* hci_device, uint32_t device_id,
+zx_status_t usb_device_control(zx_device_t* hci_device, uint32_t device_id,
                                uint8_t request_type,  uint8_t request, uint16_t value,
                                uint16_t index, void* data, size_t length);
 
-mx_status_t usb_device_get_descriptor(mx_device_t* hci_device, uint32_t device_id, uint16_t type,
+zx_status_t usb_device_get_descriptor(zx_device_t* hci_device, uint32_t device_id, uint16_t type,
                                       uint16_t index, uint16_t language, void* data, size_t length);
 
 // maximum length of a USB string after conversion to UTF8
 #define MAX_USB_STRING_LEN  ((((UINT8_MAX - sizeof(usb_descriptor_header_t)) / sizeof(uint16_t)) * 3) + 1)
 
 // returns length of string returned (including zero termination) or an error
-mx_status_t usb_device_get_string_descriptor(mx_device_t* hci_device, uint32_t device_id, uint8_t id,
+zx_status_t usb_device_get_string_descriptor(zx_device_t* hci_device, uint32_t device_id, uint8_t id,
                                              char* buf, size_t buflen);
diff --git a/system/dev/usb/usb-hub/rules.mk b/system/dev/usb/usb-hub/rules.mk
index aa2200a..f3731c3 100644
--- a/system/dev/usb/usb-hub/rules.mk
+++ b/system/dev/usb/usb-hub/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/usb/usb-hub/usb-hub.c b/system/dev/usb/usb-hub/usb-hub.c
index 1d6d455..39a2041 100644
--- a/system/dev/usb/usb-hub/usb-hub.c
+++ b/system/dev/usb/usb-hub/usb-hub.c
@@ -8,13 +8,13 @@
 #include <ddk/protocol/usb.h>
 #include <ddk/protocol/usb-bus.h>
 #include <driver/usb.h>
-#include <magenta/hw/usb-hub.h>
+#include <zircon/hw/usb-hub.h>
 #include <sync/completion.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 #include <threads.h>
 #include <unistd.h>
 
@@ -32,19 +32,19 @@
 
 typedef struct usb_hub {
     // the device we are publishing
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     // Underlying USB device
-    mx_device_t* usb_device;
+    zx_device_t* usb_device;
     usb_protocol_t usb;
 
-    mx_device_t* bus_device;
+    zx_device_t* bus_device;
     usb_bus_protocol_t bus;
 
     usb_speed_t hub_speed;
     int num_ports;
     // delay after port power in microseconds
-    mx_time_t power_on_delay;
+    zx_time_t power_on_delay;
 
     iotxn_t* status_request;
     completion_t completion;
@@ -72,11 +72,11 @@
     }
 }
 
-static mx_status_t usb_hub_get_port_status(usb_hub_t* hub, int port, port_status_t* out_status) {
+static zx_status_t usb_hub_get_port_status(usb_hub_t* hub, int port, port_status_t* out_status) {
     usb_port_status_t status;
 
-    mx_status_t result = usb_get_status(&hub->usb, USB_RECIP_PORT, port, &status, sizeof(status),
-                                        MX_TIME_INFINITE);
+    zx_status_t result = usb_get_status(&hub->usb, USB_RECIP_PORT, port, &status, sizeof(status),
+                                        ZX_TIME_INFINITE);
     if (result != sizeof(status)) {
         return result;
     }
@@ -87,63 +87,63 @@
     if (port_change & USB_C_PORT_CONNECTION) {
         xprintf("USB_C_PORT_CONNECTION ");
         usb_clear_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_C_PORT_CONNECTION, port,
-                          MX_TIME_INFINITE);
+                          ZX_TIME_INFINITE);
     }
     if (port_change & USB_C_PORT_ENABLE) {
         xprintf("USB_C_PORT_ENABLE ");
         usb_clear_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_C_PORT_ENABLE, port,
-                          MX_TIME_INFINITE);
+                          ZX_TIME_INFINITE);
     }
     if (port_change & USB_C_PORT_SUSPEND) {
         xprintf("USB_C_PORT_SUSPEND ");
         usb_clear_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_C_PORT_SUSPEND, port,
-                          MX_TIME_INFINITE);
+                          ZX_TIME_INFINITE);
     }
     if (port_change & USB_C_PORT_OVER_CURRENT) {
         xprintf("USB_C_PORT_OVER_CURRENT ");
         usb_clear_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_C_PORT_OVER_CURRENT, port,
-                          MX_TIME_INFINITE);
+                          ZX_TIME_INFINITE);
     }
     if (port_change & USB_C_PORT_RESET) {
         xprintf("USB_C_PORT_RESET");
         usb_clear_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_C_PORT_RESET, port,
-                          MX_TIME_INFINITE);
+                          ZX_TIME_INFINITE);
     }
     if (port_change & USB_C_BH_PORT_RESET) {
         xprintf("USB_C_BH_PORT_RESET");
         usb_clear_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_C_BH_PORT_RESET, port,
-                          MX_TIME_INFINITE);
+                          ZX_TIME_INFINITE);
     }
     if (port_change & USB_C_PORT_LINK_STATE) {
         xprintf("USB_C_PORT_LINK_STATE");
         usb_clear_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_C_PORT_LINK_STATE, port,
-                          MX_TIME_INFINITE);
+                          ZX_TIME_INFINITE);
     }
     if (port_change & USB_C_PORT_CONFIG_ERROR) {
         xprintf("USB_C_PORT_CONFIG_ERROR");
         usb_clear_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_C_PORT_CONFIG_ERROR, port,
-                          MX_TIME_INFINITE);
+                          ZX_TIME_INFINITE);
     }
     xprintf("\n");
 
     *out_status = status.wPortStatus;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_hub_wait_for_port(usb_hub_t* hub, int port, port_status_t* out_status,
+static zx_status_t usb_hub_wait_for_port(usb_hub_t* hub, int port, port_status_t* out_status,
                                          port_status_t status_bits, port_status_t status_mask,
-                                         mx_time_t stable_time) {
-    const mx_time_t timeout = MX_SEC(2);        // 2 second total timeout
-    const mx_time_t poll_delay = MX_MSEC(25);   // poll every 25 milliseconds
-    mx_time_t total = 0;
-    mx_time_t stable = 0;
+                                         zx_time_t stable_time) {
+    const zx_time_t timeout = ZX_SEC(2);        // 2 second total timeout
+    const zx_time_t poll_delay = ZX_MSEC(25);   // poll every 25 milliseconds
+    zx_time_t total = 0;
+    zx_time_t stable = 0;
 
     while (total < timeout) {
-        mx_nanosleep(mx_deadline_after(poll_delay));
+        zx_nanosleep(zx_deadline_after(poll_delay));
         total += poll_delay;
 
-        mx_status_t result = usb_hub_get_port_status(hub, port, out_status);
-        if (result != MX_OK) {
+        zx_status_t result = usb_hub_get_port_status(hub, port, out_status);
+        if (result != ZX_OK) {
             return result;
         }
         hub->port_status[port] = *out_status;
@@ -151,14 +151,14 @@
         if ((*out_status & status_mask) == status_bits) {
             stable += poll_delay;
             if (stable >= stable_time) {
-                return MX_OK;
+                return ZX_OK;
             }
         } else {
             stable = 0;
         }
     }
 
-    return MX_ERR_TIMED_OUT;
+    return ZX_ERR_TIMED_OUT;
 }
 
 static void usb_hub_interrupt_complete(iotxn_t* txn, void* cookie) {
@@ -168,7 +168,7 @@
 }
 
 static void usb_hub_power_on_port(usb_hub_t* hub, int port) {
-    usb_set_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_PORT_POWER, port, MX_TIME_INFINITE);
+    usb_set_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_PORT_POWER, port, ZX_TIME_INFINITE);
     usleep(hub->power_on_delay);
 }
 
@@ -180,7 +180,7 @@
     // USB 2.0 spec section 9.1.2 recommends 100ms delay before enumerating
     // wait for USB_PORT_ENABLE == 1 and USB_PORT_RESET == 0
     if (usb_hub_wait_for_port(hub, port, &status, USB_PORT_ENABLE, USB_PORT_ENABLE | USB_PORT_RESET,
-                              MX_MSEC(100)) != MX_OK) {
+                              ZX_MSEC(100)) != ZX_OK) {
         printf("usb_hub_wait_for_port USB_PORT_RESET failed for USB hub, port %d\n", port);
         return;
     }
@@ -208,12 +208,12 @@
 
     // USB 2.0 spec section 7.1.7.3 recommends 100ms between connect and reset
     if (usb_hub_wait_for_port(hub, port, &status, USB_PORT_CONNECTION, USB_PORT_CONNECTION,
-                              MX_MSEC(100)) != MX_OK) {
+                              ZX_MSEC(100)) != ZX_OK) {
         printf("usb_hub_wait_for_port USB_PORT_CONNECTION failed for USB hub, port %d\n", port);
         return;
     }
 
-    usb_set_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_PORT_RESET, port, MX_TIME_INFINITE);
+    usb_set_feature(&hub->usb, USB_RECIP_PORT, USB_FEATURE_PORT_RESET, port, ZX_TIME_INFINITE);
     usb_hub_port_enabled(hub, port);
 }
 
@@ -260,11 +260,11 @@
     device_remove(hub->mxdev);
 }
 
-static mx_status_t usb_hub_free(usb_hub_t* hub) {
+static zx_status_t usb_hub_free(usb_hub_t* hub) {
     iotxn_release(hub->status_request);
     free(hub->port_status);
     free(hub);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void usb_hub_release(void* ctx) {
@@ -276,7 +276,7 @@
     usb_hub_free(hub);
 }
 
-static mx_protocol_device_t usb_hub_device_proto = {
+static zx_protocol_device_t usb_hub_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .unbind = usb_hub_unbind,
     .release = usb_hub_release,
@@ -288,8 +288,8 @@
 
     usb_hub_descriptor_t desc;
     int desc_type = (hub->hub_speed == USB_SPEED_SUPER ? USB_HUB_DESC_TYPE_SS : USB_HUB_DESC_TYPE);
-    mx_status_t result = usb_get_descriptor(&hub->usb, USB_TYPE_CLASS | USB_RECIP_DEVICE,
-                                            desc_type, 0, &desc, sizeof(desc), MX_TIME_INFINITE);
+    zx_status_t result = usb_get_descriptor(&hub->usb, USB_TYPE_CLASS | USB_RECIP_DEVICE,
+                                            desc_type, 0, &desc, sizeof(desc), ZX_TIME_INFINITE);
     if (result < 0) {
         printf("get hub descriptor failed: %d\n", result);
         return result;
@@ -305,7 +305,7 @@
     hub->num_ports = num_ports;
     hub->port_status = calloc(num_ports + 1, sizeof(port_status_t));
     if (!hub->port_status) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // power on delay in microseconds
@@ -328,7 +328,7 @@
     };
 
     result = device_add(hub->usb_device, &args, &hub->mxdev);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         usb_hub_free(hub);
         return result;
     }
@@ -341,8 +341,8 @@
     while (1) {
         completion_reset(&hub->completion);
         iotxn_queue(hub->usb_device, txn);
-        completion_wait(&hub->completion, MX_TIME_INFINITE);
-        if (txn->status != MX_OK || hub->thread_done) {
+        completion_wait(&hub->completion, ZX_TIME_INFINITE);
+        if (txn->status != ZX_OK || hub->thread_done) {
             break;
         }
 
@@ -361,8 +361,8 @@
         while (bitmap < bitmap_end && port <= num_ports) {
             if (*bitmap & (1 << bit)) {
                 port_status_t status;
-                mx_status_t result = usb_hub_get_port_status(hub, port, &status);
-                if (result == MX_OK) {
+                zx_status_t result = usb_hub_get_port_status(hub, port, &status);
+                if (result == ZX_OK) {
                     usb_hub_handle_port_status(hub, port, status);
                 }
             }
@@ -374,39 +374,39 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t usb_hub_bind(void* ctx, mx_device_t* device, void** cookie) {
+static zx_status_t usb_hub_bind(void* ctx, zx_device_t* device, void** cookie) {
     usb_protocol_t usb;
-    mx_status_t status = device_get_protocol(device, MX_PROTOCOL_USB, &usb);
-    if (status != MX_OK) {
+    zx_status_t status = device_get_protocol(device, ZX_PROTOCOL_USB, &usb);
+    if (status != ZX_OK) {
         return status;
     }
 
     // search for the bus device
-    mx_device_t* bus_device = device_get_parent(device);
+    zx_device_t* bus_device = device_get_parent(device);
     usb_bus_protocol_t bus = { NULL, NULL };
     while (bus_device != NULL && bus.ops == NULL) {
-        if (device_get_protocol(bus_device, MX_PROTOCOL_USB_BUS, &bus) == MX_OK) {
+        if (device_get_protocol(bus_device, ZX_PROTOCOL_USB_BUS, &bus) == ZX_OK) {
             break;
         }
         bus_device = device_get_parent(bus_device);
     }
     if (!bus_device || !bus.ops) {
         printf("usb_hub_bind could not find bus device\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // find our interrupt endpoint
     usb_desc_iter_t iter;
-    mx_status_t result = usb_desc_iter_init(&usb, &iter);
+    zx_status_t result = usb_desc_iter_init(&usb, &iter);
     if (result < 0) return result;
 
     usb_interface_descriptor_t* intf = usb_desc_iter_next_interface(&iter, true);
     if (!intf || intf->bNumEndpoints != 1) {
         usb_desc_iter_release(&iter);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint8_t ep_addr = 0;
@@ -419,13 +419,13 @@
     usb_desc_iter_release(&iter);
 
     if (!ep_addr) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     usb_hub_t* hub = calloc(1, sizeof(usb_hub_t));
     if (!hub) {
         printf("Not enough memory for usb_hub_t.\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     hub->usb_device = device;
@@ -436,7 +436,7 @@
 
     iotxn_t* txn = usb_alloc_iotxn(ep_addr, max_packet_size);
     if (!txn) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto fail;
     }
     txn->length = max_packet_size;
@@ -446,22 +446,22 @@
 
     int ret = thrd_create_with_name(&hub->thread, usb_hub_thread, hub, "usb_hub_thread");
     if (ret != thrd_success) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto fail;
     }
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     usb_hub_free(hub);
     return status;
 }
 
-static mx_driver_ops_t usb_hub_driver_ops = {
+static zx_driver_ops_t usb_hub_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = usb_hub_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(usb_hub, usb_hub_driver_ops, "magenta", "0.1", 2)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_USB),
+ZIRCON_DRIVER_BEGIN(usb_hub, usb_hub_driver_ops, "zircon", "0.1", 2)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_USB),
     BI_MATCH_IF(EQ, BIND_USB_CLASS, USB_CLASS_HUB),
-MAGENTA_DRIVER_END(usb_hub)
+ZIRCON_DRIVER_END(usb_hub)
diff --git a/system/dev/usb/usb-virtual-bus/rules.mk b/system/dev/usb/usb-virtual-bus/rules.mk
index 4d36984..3bf8fb5 100644
--- a/system/dev/usb/usb-virtual-bus/rules.mk
+++ b/system/dev/usb/usb-virtual-bus/rules.mk
@@ -19,7 +19,7 @@
 
 MODULE_LIBS := \
     system/ulib/driver \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/usb/usb-virtual-bus/usb-virtual-bus.c b/system/dev/usb/usb-virtual-bus/usb-virtual-bus.c
index 9b73aa9..f8a3353 100644
--- a/system/dev/usb/usb-virtual-bus/usb-virtual-bus.c
+++ b/system/dev/usb/usb-virtual-bus/usb-virtual-bus.c
@@ -8,7 +8,7 @@
 #include <ddk/protocol/usb.h>
 #include <ddk/protocol/usb-dci.h>
 #include <ddk/protocol/usb-function.h>
-#include <magenta/device/usb-virt-bus.h>
+#include <zircon/device/usb-virt-bus.h>
 #include <stdlib.h>
 #include <stdio.h>
 
@@ -28,7 +28,7 @@
 
     // FIXME how to exit this thread
     while (1) {
-        completion_wait(&bus->completion, MX_TIME_INFINITE);
+        completion_wait(&bus->completion, ZX_TIME_INFINITE);
         completion_reset(&bus->completion);
 
         mtx_lock(&bus->lock);
@@ -47,7 +47,7 @@
                 iotxn_t* device_txn = list_remove_head_type(&ep->device_txns, iotxn_t, node);
 
                 if (device_txn) {
-                    mx_off_t offset = ep->txn_offset;
+                    zx_off_t offset = ep->txn_offset;
                     size_t length = txn->length - offset;
                     if (length > device_txn->length) {
                         length = device_txn->length;
@@ -61,14 +61,14 @@
                     } else {
                         iotxn_copyto(txn, device_buffer, length, offset);
                     }
-                    iotxn_complete(device_txn, MX_OK, length);
+                    iotxn_complete(device_txn, ZX_OK, length);
 
                     offset += length;
                     if (offset < txn->length) {
                         ep->txn_offset = offset;
                     } else {
                         list_delete(&txn->node);
-                        iotxn_complete(txn, MX_OK, length);
+                        iotxn_complete(txn, ZX_OK, length);
                         ep->txn_offset = 0;
                     }
                 } else {
@@ -82,7 +82,7 @@
     return 0;
 }
 
-mx_status_t usb_virtual_bus_set_device_enabled(usb_virtual_bus_t* bus, bool enabled) {
+zx_status_t usb_virtual_bus_set_device_enabled(usb_virtual_bus_t* bus, bool enabled) {
     mtx_lock(&bus->lock);
     bool old_connect = bus->device_enabled && bus->connected;
     bus->device_enabled = enabled;
@@ -93,13 +93,13 @@
         usb_virtual_host_set_connected(bus->host, connect);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t usb_virtual_bus_set_stall(usb_virtual_bus_t* bus, uint8_t ep_address, bool stall) {
+zx_status_t usb_virtual_bus_set_stall(usb_virtual_bus_t* bus, uint8_t ep_address, bool stall) {
     uint8_t index = ep_address_to_index(ep_address);
     if (index >= USB_MAX_EPS) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     mtx_lock(&bus->lock);
@@ -113,37 +113,37 @@
     mtx_unlock(&bus->lock);
 
     if (txn) {
-        iotxn_complete(txn, MX_ERR_IO_REFUSED, 0);
+        iotxn_complete(txn, ZX_ERR_IO_REFUSED, 0);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void usb_bus_iotxn_queue(void* ctx, iotxn_t* txn) {
     usb_virtual_bus_t* bus = ctx;
 
-    if (txn->protocol == MX_PROTOCOL_USB) {
+    if (txn->protocol == ZX_PROTOCOL_USB) {
         usb_protocol_data_t* data = iotxn_pdata(txn, usb_protocol_data_t);
         uint8_t index = ep_address_to_index(data->ep_address);
         if (index >= USB_MAX_EPS) {
             printf("usb_bus_iotxn_queue bad endpoint %u\n", data->ep_address);
-            iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+            iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
             return;
         }
         usb_virtual_ep_t* ep = &bus->eps[index];
 
         if (ep->stalled) {
-            iotxn_complete(txn, MX_ERR_IO_REFUSED, 0);
+            iotxn_complete(txn, ZX_ERR_IO_REFUSED, 0);
             return;
         }
         list_add_tail(&ep->host_txns, &txn->node);
         completion_signal(&bus->completion);
-    } else if (txn->protocol == MX_PROTOCOL_USB_FUNCTION) {
+    } else if (txn->protocol == ZX_PROTOCOL_USB_FUNCTION) {
         usb_function_protocol_data_t* data = iotxn_pdata(txn, usb_function_protocol_data_t);
         uint8_t index = ep_address_to_index(data->ep_address);
         if (index == 0 || index >= USB_MAX_EPS) {
             printf("usb_bus_iotxn_queue bad endpoint %u\n", data->ep_address);
-            iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+            iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
             return;
         }
         usb_virtual_ep_t* ep = &bus->eps[index];
@@ -152,31 +152,31 @@
         completion_signal(&bus->completion);
     } else {
         printf("usb_bus_iotxn_queue bad protocol 0x%x\n", txn->protocol);
-        iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
+        iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
     }
 }
 
-static mx_status_t usb_bus_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
+static zx_status_t usb_bus_ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
                                  void* out_buf, size_t out_len, size_t* out_actual) {
     usb_virtual_bus_t* bus = ctx;
-    mx_status_t status;
+    zx_status_t status;
 
     if (op == IOCTL_USB_VIRT_BUS_ENABLE) {
         if (!in_buf || in_len != sizeof(int)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         bool enable = !!*((int *)in_buf);
 
         if (enable) {
             if (!bus->host) {
                 status = usb_virtual_host_add(bus, &bus->host);
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     return status;
                 }
             }
             if (!bus->device) {
                 status = usb_virtual_device_add(bus, &bus->device);
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     return status;
                 }
             }
@@ -191,13 +191,13 @@
             }
         }
 
-        return MX_OK;
+        return ZX_OK;
     } else if (op == IOCTL_USB_VIRT_BUS_SET_CONNECTED) {
         if (!in_buf || in_len != sizeof(int)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (!bus->host || !bus->device) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
         int connected = *((int *)in_buf);
 
@@ -211,9 +211,9 @@
             usb_virtual_host_set_connected(bus->host, connect);
         }
 
-        return MX_OK;
+        return ZX_OK;
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static void usb_bus_unbind(void* ctx) {
@@ -226,7 +226,7 @@
     free(bus);
 }
 
-static mx_protocol_device_t usb_virtual_bus_proto = {
+static zx_protocol_device_t usb_virtual_bus_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = usb_bus_iotxn_queue,
     .ioctl = usb_bus_ioctl,
@@ -234,11 +234,11 @@
     .release = usb_bus_release,
 };
 
-static mx_status_t usb_virtual_bus_bind(void* ctx, mx_device_t* parent, void** cookie) {
+static zx_status_t usb_virtual_bus_bind(void* ctx, zx_device_t* parent, void** cookie) {
 printf("usb_virtual_bus_bind\n");
     usb_virtual_bus_t* bus = calloc(1, sizeof(usb_virtual_bus_t));
     if (!bus) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     for (unsigned i = 0; i < USB_MAX_EPS; i++) {
@@ -257,8 +257,8 @@
         .flags = DEVICE_ADD_NON_BINDABLE,
     };
 
-    mx_status_t status = device_add(parent, &args, &bus->mxdev);
-    if (status != MX_OK) {
+    zx_status_t status = device_add(parent, &args, &bus->mxdev);
+    if (status != ZX_OK) {
         free(bus);
         return status;
     }
@@ -268,15 +268,15 @@
     thrd_detach(thread);
 
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t bus_driver_ops = {
+static zx_driver_ops_t bus_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = usb_virtual_bus_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(usb_virtual_bus, bus_driver_ops, "magenta", "0.1", 1)
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_MISC_PARENT),
-MAGENTA_DRIVER_END(usb_virtual_bus)
+ZIRCON_DRIVER_BEGIN(usb_virtual_bus, bus_driver_ops, "zircon", "0.1", 1)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_MISC_PARENT),
+ZIRCON_DRIVER_END(usb_virtual_bus)
diff --git a/system/dev/usb/usb-virtual-bus/usb-virtual-bus.h b/system/dev/usb/usb-virtual-bus/usb-virtual-bus.h
index 87ee583..e0b8235 100644
--- a/system/dev/usb/usb-virtual-bus/usb-virtual-bus.h
+++ b/system/dev/usb/usb-virtual-bus/usb-virtual-bus.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include <ddk/iotxn.h>
-#include <magenta/types.h>
-#include <magenta/hw/usb.h>
+#include <zircon/types.h>
+#include <zircon/hw/usb.h>
 #include <sync/completion.h>
 #include <threads.h>
 
@@ -18,12 +18,12 @@
     list_node_t device_txns;
     // offset into current host txn, for dealing with host txns that are bigger than
     // their matching device txn
-    mx_off_t txn_offset;
+    zx_off_t txn_offset;
     bool stalled;
 } usb_virtual_ep_t;
 
 typedef struct {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     usb_virtual_host_t* host;
     usb_virtual_device_t* device;
 
@@ -35,13 +35,13 @@
     bool connected;
 } usb_virtual_bus_t;
 
-mx_status_t usb_virtual_bus_set_device_enabled(usb_virtual_bus_t* bus, bool enabled);
-mx_status_t usb_virtual_bus_set_stall(usb_virtual_bus_t* bus, uint8_t ep_address, bool stall);
+zx_status_t usb_virtual_bus_set_device_enabled(usb_virtual_bus_t* bus, bool enabled);
+zx_status_t usb_virtual_bus_set_stall(usb_virtual_bus_t* bus, uint8_t ep_address, bool stall);
 
-mx_status_t usb_virtual_host_add(usb_virtual_bus_t* bus, usb_virtual_host_t** out_host);
+zx_status_t usb_virtual_host_add(usb_virtual_bus_t* bus, usb_virtual_host_t** out_host);
 void usb_virtual_host_release(usb_virtual_host_t* host);
 void usb_virtual_host_set_connected(usb_virtual_host_t* host, bool connected);
 
-mx_status_t usb_virtual_device_add(usb_virtual_bus_t* bus, usb_virtual_device_t** out_device);
+zx_status_t usb_virtual_device_add(usb_virtual_bus_t* bus, usb_virtual_device_t** out_device);
 void usb_virtual_device_release(usb_virtual_device_t* host);
 void usb_virtual_device_control(usb_virtual_device_t* device, iotxn_t* txn);
diff --git a/system/dev/usb/usb-virtual-bus/usb-virtual-device.c b/system/dev/usb/usb-virtual-bus/usb-virtual-device.c
index e1585fe..6c0e7b1 100644
--- a/system/dev/usb/usb-virtual-bus/usb-virtual-device.c
+++ b/system/dev/usb/usb-virtual-bus/usb-virtual-device.c
@@ -8,7 +8,7 @@
 #include <ddk/protocol/usb.h>
 #include <ddk/protocol/usb-dci.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -17,7 +17,7 @@
 #include "usb-virtual-bus.h"
 
 typedef struct usb_virtual_device {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     usb_virtual_bus_t* bus;
     usb_dci_interface_t dci_intf;
 } usb_virtual_device_t;
@@ -25,7 +25,7 @@
 void usb_virtual_device_control(usb_virtual_device_t* device, iotxn_t* txn) {
     usb_protocol_data_t* data = iotxn_pdata(txn, usb_protocol_data_t);
     usb_setup_t* setup = &data->setup;
-    mx_status_t status;
+    zx_status_t status;
     size_t length = le16toh(setup->wLength);
     size_t actual = 0;
 
@@ -42,38 +42,38 @@
 
         status = usb_dci_control(&device->dci_intf, setup, buffer, length, &actual);
     } else {
-        status = MX_ERR_UNAVAILABLE;
+        status = ZX_ERR_UNAVAILABLE;
     }
 
     iotxn_complete(txn, status, actual);
 }
 
-static mx_status_t device_set_interface(void* ctx, usb_dci_interface_t* dci_intf) {
+static zx_status_t device_set_interface(void* ctx, usb_dci_interface_t* dci_intf) {
     usb_virtual_device_t* device = ctx;
     memcpy(&device->dci_intf, dci_intf, sizeof(device->dci_intf));
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t device_config_ep(void* ctx, usb_endpoint_descriptor_t* ep_desc,
+static zx_status_t device_config_ep(void* ctx, usb_endpoint_descriptor_t* ep_desc,
                                     usb_ss_ep_comp_descriptor_t* ss_comp_desc) {
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t device_disable_ep(void* ctx, uint8_t ep_addr) {
-    return MX_OK;
+static zx_status_t device_disable_ep(void* ctx, uint8_t ep_addr) {
+    return ZX_OK;
 }
 
-static mx_status_t device_set_enabled(void* ctx, bool enabled) {
+static zx_status_t device_set_enabled(void* ctx, bool enabled) {
     usb_virtual_device_t* device = ctx;
     return usb_virtual_bus_set_device_enabled(device->bus, enabled);
 }
 
-static mx_status_t device_ep_set_stall(void* ctx, uint8_t ep_address) {
+static zx_status_t device_ep_set_stall(void* ctx, uint8_t ep_address) {
     usb_virtual_device_t* device = ctx;
     return usb_virtual_bus_set_stall(device->bus, ep_address, true);
 }
 
-static mx_status_t device_ep_clear_stall(void* ctx, uint8_t ep_address) {
+static zx_status_t device_ep_clear_stall(void* ctx, uint8_t ep_address) {
     usb_virtual_device_t* device = ctx;
     return usb_virtual_bus_set_stall(device->bus, ep_address, false);
 }
@@ -87,9 +87,9 @@
     .ep_clear_stall = device_ep_clear_stall,
 };
 
-static mx_status_t virt_device_open(void* ctx, mx_device_t** dev_out, uint32_t flags) {
+static zx_status_t virt_device_open(void* ctx, zx_device_t** dev_out, uint32_t flags) {
 printf("device_open\n");
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void virt_device_iotxn_queue(void* ctx, iotxn_t* txn) {
@@ -108,7 +108,7 @@
     free(device);
 }
 
-static mx_protocol_device_t usb_virtual_device_device_proto = {
+static zx_protocol_device_t usb_virtual_device_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .open = virt_device_open,
     .iotxn_queue = virt_device_iotxn_queue,
@@ -116,10 +116,10 @@
     .release = virt_device_release,
 };
 
-mx_status_t usb_virtual_device_add(usb_virtual_bus_t* bus, usb_virtual_device_t** out_device) {
+zx_status_t usb_virtual_device_add(usb_virtual_bus_t* bus, usb_virtual_device_t** out_device) {
     usb_virtual_device_t* device = calloc(1, sizeof(usb_virtual_device_t));
     if (!device) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     device->bus = bus;
 
@@ -128,19 +128,19 @@
         .name = "usb-virtual-device",
         .ctx = device,
         .ops = &usb_virtual_device_device_proto,
-        .proto_id = MX_PROTOCOL_USB_DCI,
+        .proto_id = ZX_PROTOCOL_USB_DCI,
         .proto_ops = &virtual_device_protocol,
     };
 
-    mx_status_t status = device_add(device->bus->mxdev, &args, &device->mxdev);
+    zx_status_t status = device_add(device->bus->mxdev, &args, &device->mxdev);
 
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         free(device);
         return status;
     }
 
     *out_device = device;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void usb_virtual_device_release(usb_virtual_device_t* device) {
diff --git a/system/dev/usb/usb-virtual-bus/usb-virtual-host.c b/system/dev/usb/usb-virtual-bus/usb-virtual-host.c
index 3eb86d8..d070fe6 100644
--- a/system/dev/usb/usb-virtual-bus/usb-virtual-host.c
+++ b/system/dev/usb/usb-virtual-bus/usb-virtual-host.c
@@ -8,8 +8,8 @@
 #include <ddk/protocol/usb-hci.h>
 #include <ddk/protocol/usb.h>
 
-#include <magenta/listnode.h>
-#include <magenta/types.h>
+#include <zircon/listnode.h>
+#include <zircon/types.h>
 #include <sync/completion.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -23,7 +23,7 @@
 #define CLIENT_SPEED    USB_SPEED_HIGH
 
 typedef struct usb_virtual_host {
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
     usb_virtual_bus_t* bus;
     usb_bus_interface_t bus_intf;
 
@@ -54,32 +54,32 @@
     return 1;
 }
 
-static mx_status_t virt_host_enable_ep(void* ctx, uint32_t device_id,
+static zx_status_t virt_host_enable_ep(void* ctx, uint32_t device_id,
                                        usb_endpoint_descriptor_t* ep_desc,
                                        usb_ss_ep_comp_descriptor_t* ss_comp_desc, bool enable) {
-    return MX_OK;
+    return ZX_OK;
 }
 
 static uint64_t virt_host_get_frame(void* ctx) {
     return 0;
 }
 
-mx_status_t virt_host_config_hub(void* ctx, uint32_t device_id, usb_speed_t speed,
+zx_status_t virt_host_config_hub(void* ctx, uint32_t device_id, usb_speed_t speed,
                                  usb_hub_descriptor_t* descriptor) {
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t virt_host_hub_device_added(void* ctx, uint32_t hub_address, int port,
+zx_status_t virt_host_hub_device_added(void* ctx, uint32_t hub_address, int port,
                                        usb_speed_t speed) {
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t virt_host_hub_device_removed(void* ctx, uint32_t hub_address, int port) {
-    return MX_OK;
+zx_status_t virt_host_hub_device_removed(void* ctx, uint32_t hub_address, int port) {
+    return ZX_OK;
 }
 
-mx_status_t virt_host_reset_endpoint(void* ctx, uint32_t device_id, uint8_t ep_address) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t virt_host_reset_endpoint(void* ctx, uint32_t device_id, uint8_t ep_address) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 size_t virt_host_get_max_transfer_size(void* ctx, uint32_t device_id, uint8_t ep_address) {
@@ -117,17 +117,17 @@
     free(host);
 }
 
-static mx_protocol_device_t virt_host_device_proto = {
+static zx_protocol_device_t virt_host_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = virt_host_iotxn_queue,
     .unbind = virt_host_unbind,
     .release = virt_host_release,
 };
 
-mx_status_t usb_virtual_host_add(usb_virtual_bus_t* bus, usb_virtual_host_t** out_host) {
+zx_status_t usb_virtual_host_add(usb_virtual_bus_t* bus, usb_virtual_host_t** out_host) {
     usb_virtual_host_t* host = calloc(1, sizeof(usb_virtual_host_t));
     if (!host) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     mtx_init(&host->lock, mtx_plain);
@@ -139,18 +139,18 @@
         .name = "usb-virtual-host",
         .ctx = host,
         .ops = &virt_host_device_proto,
-        .proto_id = MX_PROTOCOL_USB_HCI,
+        .proto_id = ZX_PROTOCOL_USB_HCI,
         .proto_ops = &virtual_host_protocol,
     };
 
-    mx_status_t status = device_add(host->bus->mxdev, &args, &host->mxdev);
-    if (status != MX_OK) {
+    zx_status_t status = device_add(host->bus->mxdev, &args, &host->mxdev);
+    if (status != ZX_OK) {
         free(host);
         return status;
     }
 
     *out_host = host;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void usb_virtual_host_release(usb_virtual_host_t* host) {
diff --git a/system/dev/usb/xhci/rules.mk b/system/dev/usb/xhci/rules.mk
index 12e9da5..0c906b3 100644
--- a/system/dev/usb/xhci/rules.mk
+++ b/system/dev/usb/xhci/rules.mk
@@ -19,6 +19,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync
 
-MODULE_LIBS := system/ulib/driver system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/driver system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/dev/usb/xhci/usb-xhci.c b/system/dev/usb/xhci/usb-xhci.c
index cf1de67..bfdb559 100644
--- a/system/dev/usb/xhci/usb-xhci.c
+++ b/system/dev/usb/xhci/usb-xhci.c
@@ -9,8 +9,8 @@
 #include <ddk/protocol/usb.h>
 
 #include <hw/reg.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -26,12 +26,12 @@
 #define DEFAULT_PRIORITY 16
 #define HIGH_PRIORITY    24
 
-mx_status_t xhci_add_device(xhci_t* xhci, int slot_id, int hub_address, int speed) {
+zx_status_t xhci_add_device(xhci_t* xhci, int slot_id, int hub_address, int speed) {
     dprintf(TRACE, "xhci_add_new_device\n");
 
     if (!xhci->bus.ops) {
         dprintf(ERROR, "no bus device in xhci_add_device\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     return usb_bus_add_device(&xhci->bus, slot_id, hub_address, speed);
@@ -66,7 +66,7 @@
     return xhci->max_slots + XHCI_RH_COUNT + 1;
 }
 
-static mx_status_t xhci_enable_ep(void* ctx, uint32_t device_id,
+static zx_status_t xhci_enable_ep(void* ctx, uint32_t device_id,
                                   usb_endpoint_descriptor_t* ep_desc,
                                   usb_ss_ep_comp_descriptor_t* ss_comp_desc, bool enable) {
     xhci_t* xhci = ctx;
@@ -78,25 +78,25 @@
     return xhci_get_current_frame(xhci);
 }
 
-static mx_status_t xhci_config_hub(void* ctx, uint32_t device_id, usb_speed_t speed,
+static zx_status_t xhci_config_hub(void* ctx, uint32_t device_id, usb_speed_t speed,
                             usb_hub_descriptor_t* descriptor) {
     xhci_t* xhci = ctx;
     return xhci_configure_hub(xhci, device_id, speed, descriptor);
 }
 
-static mx_status_t xhci_hub_device_added(void* ctx, uint32_t hub_address, int port,
+static zx_status_t xhci_hub_device_added(void* ctx, uint32_t hub_address, int port,
                                   usb_speed_t speed) {
     xhci_t* xhci = ctx;
     return xhci_enumerate_device(xhci, hub_address, port, speed);
 }
 
-static mx_status_t xhci_hub_device_removed(void* ctx, uint32_t hub_address, int port) {
+static zx_status_t xhci_hub_device_removed(void* ctx, uint32_t hub_address, int port) {
     xhci_t* xhci = ctx;
     xhci_device_disconnected(xhci, hub_address, port);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t xhci_reset_ep(void* ctx, uint32_t device_id, uint8_t ep_address) {
+static zx_status_t xhci_reset_ep(void* ctx, uint32_t device_id, uint8_t ep_address) {
     xhci_t* xhci = ctx;
     uint8_t ep_index = xhci_endpoint_index(ep_address);
     return xhci_reset_endpoint(xhci, device_id, ep_index);
@@ -115,7 +115,7 @@
     return PAGE_SIZE * (TRANSFER_RING_SIZE - 2);
 }
 
-static mx_status_t xhci_cancel_all(void* ctx, uint32_t device_id, uint8_t ep_address) {
+static zx_status_t xhci_cancel_all(void* ctx, uint32_t device_id, uint8_t ep_address) {
     xhci_t* xhci = ctx;
     return xhci_cancel_transfers(xhci, device_id, ep_address);
 }
@@ -136,15 +136,15 @@
 static void xhci_iotxn_queue(void* ctx, iotxn_t* txn) {
     xhci_t* xhci = ctx;
     usb_protocol_data_t* data = iotxn_pdata(txn, usb_protocol_data_t);
-    mx_status_t status;
+    zx_status_t status;
 
     if (txn->length > xhci_get_max_transfer_size(xhci->mxdev, data->device_id, data->ep_address)) {
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
     } else {
         status = xhci_queue_transfer(xhci, txn);
     }
 
-    if (status != MX_OK && status != MX_ERR_BUFFER_TOO_SMALL) {
+    if (status != ZX_OK && status != ZX_ERR_BUFFER_TOO_SMALL) {
         iotxn_complete(txn, status, 0);
     }
 }
@@ -163,7 +163,7 @@
     free(xhci);
 }
 
-static mx_protocol_device_t xhci_device_proto = {
+static zx_protocol_device_t xhci_device_proto = {
     .version = DEVICE_OPS_VERSION,
     .iotxn_queue = xhci_iotxn_queue,
     .unbind = xhci_unbind,
@@ -178,23 +178,23 @@
 
 static int completer_thread(void *arg) {
     completer_t* completer = (completer_t*)arg;
-    mx_handle_t irq_handle = completer->xhci->irq_handles[completer->interrupter];
+    zx_handle_t irq_handle = completer->xhci->irq_handles[completer->interrupter];
 
     // TODO(johngro) : See MG-940.  Get rid of this.  For now we need thread
     // priorities so that realtime transactions use the completer which ends
     // up getting realtime latency guarantees.
-    mx_thread_set_priority(completer->priority);
+    zx_thread_set_priority(completer->priority);
 
     while (1) {
-        mx_status_t wait_res;
+        zx_status_t wait_res;
 
-        wait_res = mx_interrupt_wait(irq_handle);
-        if (wait_res != MX_OK) {
+        wait_res = zx_interrupt_wait(irq_handle);
+        if (wait_res != ZX_OK) {
             dprintf(ERROR, "unexpected pci_wait_interrupt failure (%d)\n", wait_res);
-            mx_interrupt_complete(irq_handle);
+            zx_interrupt_complete(irq_handle);
             break;
         }
-        mx_interrupt_complete(irq_handle);
+        zx_interrupt_complete(irq_handle);
         xhci_handle_interrupt(completer->xhci, completer->xhci->legacy_irq_mode,
                               completer->interrupter);
     }
@@ -207,13 +207,13 @@
     xhci_t* xhci = (xhci_t*)arg;
     dprintf(TRACE, "xhci_start_thread start\n");
 
-    mx_status_t status;
+    zx_status_t status;
     completer_t* completers[xhci->num_interrupts];
     uint32_t num_completers_initialized = 0;
     for (uint32_t i = 0; i < xhci->num_interrupts; i++) {
         completer_t *completer = calloc(1, sizeof(completer_t));
         if (completer == NULL) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
             goto error_return;
         }
         completers[i] = completer;
@@ -229,7 +229,7 @@
 
     // xhci_start will block, so do this part here instead of in usb_xhci_bind
     status = xhci_start(xhci);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto error_return;
     }
 
@@ -238,12 +238,12 @@
         .name = "xhci",
         .ctx = xhci,
         .ops = &xhci_device_proto,
-        .proto_id = MX_PROTOCOL_USB_HCI,
+        .proto_id = ZX_PROTOCOL_USB_HCI,
         .proto_ops = &xhci_hci_protocol,
     };
 
     status = device_add(xhci->parent, &args, &xhci->mxdev);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto error_return;
     }
 
@@ -264,22 +264,22 @@
     return status;
 }
 
-static mx_status_t usb_xhci_bind(void* ctx, mx_device_t* dev, void** cookie) {
-    mx_handle_t mmio_handle = MX_HANDLE_INVALID;
-    mx_handle_t cfg_handle = MX_HANDLE_INVALID;
+static zx_status_t usb_xhci_bind(void* ctx, zx_device_t* dev, void** cookie) {
+    zx_handle_t mmio_handle = ZX_HANDLE_INVALID;
+    zx_handle_t cfg_handle = ZX_HANDLE_INVALID;
     xhci_t* xhci = NULL;
     uint32_t num_irq_handles_initialized = 0;
-    mx_status_t status;
+    zx_status_t status;
 
     pci_protocol_t pci;
-    if (device_get_protocol(dev, MX_PROTOCOL_PCI, &pci)) {
-        status = MX_ERR_NOT_SUPPORTED;
+    if (device_get_protocol(dev, ZX_PROTOCOL_PCI, &pci)) {
+        status = ZX_ERR_NOT_SUPPORTED;
         goto error_return;
     }
 
     xhci = calloc(1, sizeof(xhci_t));
     if (!xhci) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto error_return;
     }
 
@@ -289,26 +289,26 @@
      * eXtensible Host Controller Interface revision 1.1, section 5, xhci
      * should only use BARs 0 and 1. 0 for 32 bit addressing, and 0+1 for 64 bit addressing.
      */
-    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0, MX_CACHE_POLICY_UNCACHED_DEVICE,
+    status = pci_map_resource(&pci, PCI_RESOURCE_BAR_0, ZX_CACHE_POLICY_UNCACHED_DEVICE,
                               &mmio, &mmio_len, &mmio_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "usb_xhci_bind could not find bar\n");
-        status = MX_ERR_INTERNAL;
+        status = ZX_ERR_INTERNAL;
          goto error_return;
     }
 
     uint32_t irq_cnt = 0;
-    status = pci_query_irq_mode_caps(&pci, MX_PCIE_IRQ_MODE_MSI, &irq_cnt);
-    if (status != MX_OK) {
+    status = pci_query_irq_mode_caps(&pci, ZX_PCIE_IRQ_MODE_MSI, &irq_cnt);
+    if (status != ZX_OK) {
         dprintf(ERROR, "pci_query_irq_mode_caps failed %d\n", status);
         goto error_return;
     }
     xhci_num_interrupts_init(xhci, mmio, irq_cnt);
 
     // select our IRQ mode
-    status = pci_set_irq_mode(&pci, MX_PCIE_IRQ_MODE_MSI, xhci->num_interrupts);
+    status = pci_set_irq_mode(&pci, ZX_PCIE_IRQ_MODE_MSI, xhci->num_interrupts);
     if (status < 0) {
-        mx_status_t status_legacy = pci_set_irq_mode(&pci, MX_PCIE_IRQ_MODE_LEGACY, 1);
+        zx_status_t status_legacy = pci_set_irq_mode(&pci, ZX_PCIE_IRQ_MODE_LEGACY, 1);
 
         if (status_legacy < 0) {
             dprintf(ERROR, "usb_xhci_bind Failed to set IRQ mode to either MSI "
@@ -324,7 +324,7 @@
     for (uint32_t i = 0; i < xhci->num_interrupts; i++) {
         // register for interrupts
         status = pci_map_interrupt(&pci, i, &xhci->irq_handles[i]);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             dprintf(ERROR, "usb_xhci_bind map_interrupt failed %d\n", status);
             goto error_return;
         }
@@ -339,7 +339,7 @@
     memcpy(&xhci->pci, &pci, sizeof(pci_protocol_t));
 
     status = xhci_init(xhci, mmio);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto error_return;
     }
 
@@ -347,33 +347,33 @@
     thrd_create_with_name(&thread, xhci_start_thread, xhci, "xhci_start_thread");
     thrd_detach(thread);
 
-    return MX_OK;
+    return ZX_OK;
 
 error_return:
     if (xhci) {
         free(xhci);
     }
     for (uint32_t i = 0; i < num_irq_handles_initialized; i++) {
-        mx_handle_close(xhci->irq_handles[i]);
+        zx_handle_close(xhci->irq_handles[i]);
     }
-    if (mmio_handle != MX_HANDLE_INVALID) {
-        mx_handle_close(mmio_handle);
+    if (mmio_handle != ZX_HANDLE_INVALID) {
+        zx_handle_close(mmio_handle);
     }
-    if (cfg_handle != MX_HANDLE_INVALID) {
-        mx_handle_close(cfg_handle);
+    if (cfg_handle != ZX_HANDLE_INVALID) {
+        zx_handle_close(cfg_handle);
     }
     return status;
 }
 
-static mx_driver_ops_t xhci_driver_ops = {
+static zx_driver_ops_t xhci_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = usb_xhci_bind,
 };
 
 // clang-format off
-MAGENTA_DRIVER_BEGIN(usb_xhci, xhci_driver_ops, "magenta", "0.1", 4)
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+ZIRCON_DRIVER_BEGIN(usb_xhci, xhci_driver_ops, "zircon", "0.1", 4)
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_CLASS, 0x0C),
     BI_ABORT_IF(NE, BIND_PCI_SUBCLASS, 0x03),
     BI_MATCH_IF(EQ, BIND_PCI_INTERFACE, 0x30),
-MAGENTA_DRIVER_END(usb_xhci)
+ZIRCON_DRIVER_END(usb_xhci)
diff --git a/system/dev/usb/xhci/xhci-device-manager.c b/system/dev/usb/xhci/xhci-device-manager.c
index 7419ed7..03f5283 100644
--- a/system/dev/usb/xhci/xhci-device-manager.c
+++ b/system/dev/usb/xhci/xhci-device-manager.c
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 #include <ddk/debug.h>
-#include <magenta/hw/usb.h>
-#include <magenta/hw/usb-hub.h>
+#include <zircon/hw/usb.h>
+#include <zircon/hw/usb-hub.h>
 #include <endian.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -48,7 +48,7 @@
     return route;
 }
 
-static mx_status_t xhci_address_device(xhci_t* xhci, uint32_t slot_id, uint32_t hub_address,
+static zx_status_t xhci_address_device(xhci_t* xhci, uint32_t slot_id, uint32_t hub_address,
                                        uint32_t port, usb_speed_t speed) {
     dprintf(TRACE, "xhci_address_device slot_id: %d port: %d hub_address: %d speed: %d\n",
             slot_id, port, hub_address, speed);
@@ -63,15 +63,15 @@
 
     xhci_slot_t* slot = &xhci->slots[slot_id];
     if (slot->sc)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     slot->hub_address = hub_address;
     slot->port = port;
     slot->rh_port = (hub_address == 0 ? port : xhci->slots[hub_address].rh_port);
     slot->speed = speed;
 
     // allocate DMA memory for device context
-    mx_status_t status = io_buffer_init(&slot->buffer, xhci->context_size * XHCI_NUM_EPS, IO_BUFFER_RW);
-    if (status != MX_OK) {
+    zx_status_t status = io_buffer_init(&slot->buffer, xhci->context_size * XHCI_NUM_EPS, IO_BUFFER_RW);
+    if (status != ZX_OK) {
         dprintf(ERROR, "xhci_address_device: failed to allocate io_buffer for slot\n");
         return status;
     }
@@ -82,13 +82,13 @@
     if (status < 0) return status;
     ep->transfer_state = calloc(1, sizeof(xhci_transfer_state_t));
     if (!ep->transfer_state) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     xhci_transfer_ring_t* transfer_ring = &ep->transfer_ring;
 
     mtx_lock(&xhci->input_context_lock);
     xhci_input_control_context_t* icc = (xhci_input_control_context_t*)xhci->input_context;
-    mx_paddr_t icc_phys = xhci->input_context_phys;
+    zx_paddr_t icc_phys = xhci->input_context_phys;
     xhci_slot_context_t* sc = (xhci_slot_context_t*)&xhci->input_context[1 * xhci->context_size];
     xhci_endpoint_context_t* ep0c = (xhci_endpoint_context_t*)&xhci->input_context[2 * xhci->context_size];
     memset((void*)icc, 0, xhci->context_size);
@@ -128,7 +128,7 @@
     XHCI_SET_BITS32(&sc->sc2, SLOT_CTX_TT_PORT_NUM_START, SLOT_CTX_TT_PORT_NUM_BITS, tt_port_number);
 
     // Setup endpoint context for ep0
-    mx_paddr_t tr_dequeue = xhci_transfer_ring_start_phys(transfer_ring);
+    zx_paddr_t tr_dequeue = xhci_transfer_ring_start_phys(transfer_ring);
 
     XHCI_SET_BITS32(&ep0c->epc1, EP_CTX_CERR_START, EP_CTX_CERR_BITS, 3); // ???
     XHCI_SET_BITS32(&ep0c->epc1, EP_CTX_EP_TYPE_START, EP_CTX_EP_TYPE_BITS, EP_CTX_EP_TYPE_CONTROL);
@@ -144,13 +144,13 @@
     for (int i = 0; i < 5; i++) {
         status = xhci_send_command(xhci, TRB_CMD_ADDRESS_DEVICE, icc_phys,
                                    (slot_id << TRB_SLOT_ID_START));
-        if (status != MX_ERR_TIMED_OUT) {
+        if (status != ZX_ERR_TIMED_OUT) {
             break;
         }
     }
     mtx_unlock(&xhci->input_context_lock);
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         ep->state = EP_STATE_RUNNING;
     }
     return status;
@@ -216,10 +216,10 @@
     slot->port = USB_SPEED_UNDEFINED;
 }
 
-static mx_status_t xhci_handle_enumerate_device(xhci_t* xhci, uint32_t hub_address, uint32_t port,
+static zx_status_t xhci_handle_enumerate_device(xhci_t* xhci, uint32_t hub_address, uint32_t port,
                                                 usb_speed_t speed) {
     dprintf(TRACE, "xhci_handle_enumerate_device\n");
-    mx_status_t result = MX_OK;
+    zx_status_t result = ZX_OK;
     uint32_t slot_id = 0;
 
     xhci_sync_command_t command;
@@ -230,11 +230,11 @@
         slot_id = xhci_sync_command_slot_id(&command);
     } else {
         dprintf(ERROR, "xhci_handle_enumerate_device: unable to get a slot\n");
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     }
 
     result = xhci_address_device(xhci, slot_id, hub_address, port, speed);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         goto disable_slot_exit;
     }
 
@@ -243,7 +243,7 @@
     for (int i = 0; i < 5; i++) {
         result = xhci_get_descriptor(xhci, slot_id, USB_TYPE_STANDARD, USB_DT_DEVICE << 8, 0,
                                      &device_descriptor, 8);
-        if (result == MX_ERR_IO_REFUSED) {
+        if (result == ZX_ERR_IO_REFUSED) {
             xhci_reset_endpoint(xhci, slot_id, 0);
         } else {
             break;
@@ -279,7 +279,7 @@
     // update the max packet size in our device context
     mtx_lock(&xhci->input_context_lock);
     xhci_input_control_context_t* icc = (xhci_input_control_context_t*)xhci->input_context;
-    mx_paddr_t icc_phys = xhci->input_context_phys;
+    zx_paddr_t icc_phys = xhci->input_context_phys;
     xhci_endpoint_context_t* ep0c = (xhci_endpoint_context_t*)
                                             &xhci->input_context[2 * xhci->context_size];
     memset((void*)icc, 0, xhci->context_size);
@@ -291,13 +291,13 @@
     result = xhci_send_command(xhci, TRB_CMD_EVAL_CONTEXT, icc_phys,
                                (slot_id << TRB_SLOT_ID_START));
     mtx_unlock(&xhci->input_context_lock);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         dprintf(ERROR, "xhci_handle_enumerate_device: TRB_CMD_EVAL_CONTEXT failed\n");
         goto disable_slot_exit;
     }
 
     xhci_add_device(xhci, slot_id, hub_address, speed);
-    return MX_OK;
+    return ZX_OK;
 
 disable_slot_exit:
     xhci_disable_slot(xhci, slot_id);
@@ -305,20 +305,20 @@
     return result;
 }
 
-static mx_status_t xhci_stop_endpoint(xhci_t* xhci, uint32_t slot_id, int ep_index,
-                                      xhci_ep_state_t new_state, mx_status_t complete_status) {
+static zx_status_t xhci_stop_endpoint(xhci_t* xhci, uint32_t slot_id, int ep_index,
+                                      xhci_ep_state_t new_state, zx_status_t complete_status) {
     xhci_slot_t* slot = &xhci->slots[slot_id];
     xhci_endpoint_t* ep =  &slot->eps[ep_index];
     xhci_transfer_ring_t* transfer_ring = &ep->transfer_ring;
 
     if (new_state == EP_STATE_RUNNING) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     mtx_lock(&ep->lock);
     if (ep->state != EP_STATE_RUNNING) {
         mtx_unlock(&ep->lock);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     ep->state = new_state;
     mtx_unlock(&ep->lock);
@@ -333,7 +333,7 @@
         // TRB_CC_CONTEXT_STATE_ERROR is normal here in the case of a disconnected device,
         // since by then the endpoint would already be in error state.
         dprintf(ERROR, "xhci_stop_endpoint: TRB_CMD_STOP_ENDPOINT failed cc: %d\n", cc);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     free(ep->transfer_state);
@@ -349,10 +349,10 @@
         iotxn_complete(txn, complete_status, 0);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t xhci_handle_disconnect_device(xhci_t* xhci, uint32_t hub_address, uint32_t port) {
+static zx_status_t xhci_handle_disconnect_device(xhci_t* xhci, uint32_t hub_address, uint32_t port) {
     dprintf(TRACE, "xhci_handle_disconnect_device\n");
     xhci_slot_t* slot = NULL;
     uint32_t slot_id;
@@ -374,15 +374,15 @@
     }
     if (!slot) {
         dprintf(ERROR, "slot not found in xhci_handle_disconnect_device\n");
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     uint32_t drop_flags = 0;
     for (int i = 0; i < XHCI_NUM_EPS; i++) {
         if (slot->eps[i].state != EP_STATE_DEAD) {
-            mx_status_t status = xhci_stop_endpoint(xhci, slot_id, i, EP_STATE_DEAD,
-                                                    MX_ERR_IO_NOT_PRESENT);
-            if (status != MX_OK) {
+            zx_status_t status = xhci_stop_endpoint(xhci, slot_id, i, EP_STATE_DEAD,
+                                                    ZX_ERR_IO_NOT_PRESENT);
+            if (status != ZX_OK) {
                 dprintf(ERROR, "xhci_handle_disconnect_device: xhci_stop_endpoint failed: %d\n", status);
             }
             drop_flags |= XHCI_ICC_EP_FLAG(i);
@@ -393,20 +393,20 @@
 
     mtx_lock(&xhci->input_context_lock);
     xhci_input_control_context_t* icc = (xhci_input_control_context_t*)xhci->input_context;
-    mx_paddr_t icc_phys = xhci->input_context_phys;
+    zx_paddr_t icc_phys = xhci->input_context_phys;
     memset((void*)icc, 0, xhci->context_size);
     XHCI_WRITE32(&icc->drop_context_flags, drop_flags);
 
-    mx_status_t status = xhci_send_command(xhci, TRB_CMD_CONFIGURE_EP, icc_phys,
+    zx_status_t status = xhci_send_command(xhci, TRB_CMD_CONFIGURE_EP, icc_phys,
                                            (slot_id << TRB_SLOT_ID_START));
     mtx_unlock(&xhci->input_context_lock);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "xhci_handle_disconnect_device: TRB_CMD_CONFIGURE_EP failed\n");
     }
 
     xhci_disable_slot(xhci, slot_id);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static int xhci_device_thread(void* arg) {
@@ -415,7 +415,7 @@
     while (1) {
         dprintf(TRACE, "xhci_device_thread top of loop\n");
         // wait for a device to enumerate
-        completion_wait(&xhci->command_queue_completion, MX_TIME_INFINITE);
+        completion_wait(&xhci->command_queue_completion, ZX_TIME_INFINITE);
 
         mtx_lock(&xhci->command_queue_mutex);
         list_node_t* node = list_remove_head(&xhci->command_queue);
@@ -450,11 +450,11 @@
     thrd_create_with_name(&xhci->device_thread, xhci_device_thread, xhci, "xhci_device_thread");
 }
 
-static mx_status_t xhci_queue_command(xhci_t* xhci, int command, uint32_t hub_address,
+static zx_status_t xhci_queue_command(xhci_t* xhci, int command, uint32_t hub_address,
                                       uint32_t port, usb_speed_t speed) {
     xhci_device_command_t* device_command = calloc(1, sizeof(xhci_device_command_t));
     if (!device_command) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     device_command->command = command;
     device_command->hub_address = hub_address;
@@ -466,15 +466,15 @@
     completion_signal(&xhci->command_queue_completion);
     mtx_unlock(&xhci->command_queue_mutex);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t xhci_enumerate_device(xhci_t* xhci, uint32_t hub_address, uint32_t port,
+zx_status_t xhci_enumerate_device(xhci_t* xhci, uint32_t hub_address, uint32_t port,
                                   usb_speed_t speed) {
     return xhci_queue_command(xhci, ENUMERATE_DEVICE, hub_address, port, speed);
 }
 
-mx_status_t xhci_device_disconnected(xhci_t* xhci, uint32_t hub_address, uint32_t port) {
+zx_status_t xhci_device_disconnected(xhci_t* xhci, uint32_t hub_address, uint32_t port) {
     dprintf(TRACE, "xhci_device_disconnected %d %d\n", hub_address, port);
     mtx_lock(&xhci->command_queue_mutex);
     // check pending device list first
@@ -485,7 +485,7 @@
             dprintf(TRACE, "found on pending list\n");
             list_delete(&command->node);
             mtx_unlock(&xhci->command_queue_mutex);
-            return MX_OK;
+            return ZX_OK;
         }
     }
     mtx_unlock(&xhci->command_queue_mutex);
@@ -493,15 +493,15 @@
     return xhci_queue_command(xhci, DISCONNECT_DEVICE, hub_address, port, USB_SPEED_UNDEFINED);
 }
 
-mx_status_t xhci_queue_start_root_hubs(xhci_t* xhci) {
+zx_status_t xhci_queue_start_root_hubs(xhci_t* xhci) {
     return xhci_queue_command(xhci, START_ROOT_HUBS, 0, 0, USB_SPEED_UNDEFINED);
 }
 
-mx_status_t xhci_enable_endpoint(xhci_t* xhci, uint32_t slot_id, usb_endpoint_descriptor_t* ep_desc,
+zx_status_t xhci_enable_endpoint(xhci_t* xhci, uint32_t slot_id, usb_endpoint_descriptor_t* ep_desc,
                                  usb_ss_ep_comp_descriptor_t* ss_comp_desc, bool enable) {
     if (xhci_is_root_hub(xhci, slot_id)) {
         // nothing to do for root hubs
-        return MX_OK;
+        return ZX_OK;
     }
 
     xhci_slot_t* slot = &xhci->slots[slot_id];
@@ -513,12 +513,12 @@
 
     if ((enable && ep->state == EP_STATE_RUNNING) || (!enable && ep->state == EP_STATE_DISABLED)) {
         mtx_unlock(&ep->lock);
-        return MX_OK;
+        return ZX_OK;
     }
 
     mtx_lock(&xhci->input_context_lock);
     xhci_input_control_context_t* icc = (xhci_input_control_context_t*)xhci->input_context;
-    mx_paddr_t icc_phys = xhci->input_context_phys;
+    zx_paddr_t icc_phys = xhci->input_context_phys;
     xhci_slot_context_t* sc = (xhci_slot_context_t*)&xhci->input_context[1 * xhci->context_size];
     memset((void*)icc, 0, xhci->context_size);
 
@@ -556,14 +556,14 @@
         xhci_endpoint_context_t* epc = (xhci_endpoint_context_t*)&xhci->input_context[(index + 2) * xhci->context_size];
         memset((void*)epc, 0, xhci->context_size);
         // allocate a transfer ring for the endpoint
-        mx_status_t status = xhci_transfer_ring_init(&ep->transfer_ring, TRANSFER_RING_SIZE);
+        zx_status_t status = xhci_transfer_ring_init(&ep->transfer_ring, TRANSFER_RING_SIZE);
         if (status < 0) {
             mtx_unlock(&xhci->input_context_lock);
             mtx_unlock(&ep->lock);
             return status;
         }
 
-        mx_paddr_t tr_dequeue = xhci_transfer_ring_start_phys(&slot->eps[index].transfer_ring);
+        zx_paddr_t tr_dequeue = xhci_transfer_ring_start_phys(&slot->eps[index].transfer_ring);
 
         XHCI_SET_BITS32(&epc->epc0, EP_CTX_INTERVAL_START, EP_CTX_INTERVAL_BITS,
                         compute_interval(ep_desc, speed));
@@ -589,19 +589,19 @@
         XHCI_SET_BITS32(&sc->sc0, SLOT_CTX_CONTEXT_ENTRIES_START, SLOT_CTX_CONTEXT_ENTRIES_BITS,
                         index + 1);
     } else {
-        xhci_stop_endpoint(xhci, slot_id, index, EP_STATE_DISABLED, MX_ERR_BAD_STATE);
+        xhci_stop_endpoint(xhci, slot_id, index, EP_STATE_DISABLED, ZX_ERR_BAD_STATE);
         XHCI_WRITE32(&icc->drop_context_flags, XHCI_ICC_EP_FLAG(index));
     }
 
-    mx_status_t status = xhci_send_command(xhci, TRB_CMD_CONFIGURE_EP, icc_phys,
+    zx_status_t status = xhci_send_command(xhci, TRB_CMD_CONFIGURE_EP, icc_phys,
                                            (slot_id << TRB_SLOT_ID_START));
     mtx_unlock(&xhci->input_context_lock);
 
     // xhci_stop_endpoint() will handle the !enable case
-    if (status == MX_OK && enable) {
+    if (status == ZX_OK && enable) {
         ep->transfer_state = calloc(1, sizeof(xhci_transfer_state_t));
         if (!ep->transfer_state) {
-            status = MX_ERR_NO_MEMORY;
+            status = ZX_ERR_NO_MEMORY;
         } else {
             ep->state = EP_STATE_RUNNING;
         }
@@ -611,14 +611,14 @@
     return status;
 }
 
-mx_status_t xhci_configure_hub(xhci_t* xhci, uint32_t slot_id, usb_speed_t speed,
+zx_status_t xhci_configure_hub(xhci_t* xhci, uint32_t slot_id, usb_speed_t speed,
                                usb_hub_descriptor_t* descriptor) {
     dprintf(TRACE, "xhci_configure_hub slot_id: %d speed: %d\n", slot_id, speed);
     if (xhci_is_root_hub(xhci, slot_id)) {
         // nothing to do for root hubs
-        return MX_OK;
+        return ZX_OK;
     }
-    if (slot_id > xhci->max_slots) return MX_ERR_INVALID_ARGS;
+    if (slot_id > xhci->max_slots) return ZX_ERR_INVALID_ARGS;
 
     xhci_slot_t* slot = &xhci->slots[slot_id];
     uint32_t num_ports = descriptor->bNbrPorts;
@@ -629,7 +629,7 @@
 
     mtx_lock(&xhci->input_context_lock);
     xhci_input_control_context_t* icc = (xhci_input_control_context_t*)xhci->input_context;
-    mx_paddr_t icc_phys = xhci->input_context_phys;
+    zx_paddr_t icc_phys = xhci->input_context_phys;
     xhci_slot_context_t* sc = (xhci_slot_context_t*)&xhci->input_context[1 * xhci->context_size];
     memset((void*)icc, 0, xhci->context_size);
     memset((void*)sc, 0, xhci->context_size);
@@ -644,11 +644,11 @@
     XHCI_SET_BITS32(&sc->sc2, SLOT_CTX_TTT_START, SLOT_CTX_TTT_BITS, ttt);
 
 
-    mx_status_t status = xhci_send_command(xhci, TRB_CMD_EVAL_CONTEXT, icc_phys,
+    zx_status_t status = xhci_send_command(xhci, TRB_CMD_EVAL_CONTEXT, icc_phys,
                                            (slot_id << TRB_SLOT_ID_START));
     mtx_unlock(&xhci->input_context_lock);
 
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "xhci_configure_hub: TRB_CMD_EVAL_CONTEXT failed\n");
         return status;
     }
@@ -662,7 +662,7 @@
         }
 
         dprintf(TRACE, "USB_HUB_SET_DEPTH %d\n", depth);
-        mx_status_t result = xhci_control_request(xhci, slot_id,
+        zx_status_t result = xhci_control_request(xhci, slot_id,
                                       USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_DEVICE,
                                       USB_HUB_SET_DEPTH, depth, 0, NULL, 0);
         if (result < 0) {
@@ -670,5 +670,5 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/dev/usb/xhci/xhci-device-manager.h b/system/dev/usb/xhci/xhci-device-manager.h
index 578f811..6ad7cd9 100644
--- a/system/dev/usb/xhci/xhci-device-manager.h
+++ b/system/dev/usb/xhci/xhci-device-manager.h
@@ -4,18 +4,18 @@
 
 #pragma once
 
-#include <magenta/hw/usb-hub.h>
-#include <magenta/types.h>
+#include <zircon/hw/usb-hub.h>
+#include <zircon/types.h>
 #include <stdbool.h>
 
 typedef struct xhci xhci_t;
 
-mx_status_t xhci_enumerate_device(xhci_t* xhci, uint32_t hub_address, uint32_t port,
+zx_status_t xhci_enumerate_device(xhci_t* xhci, uint32_t hub_address, uint32_t port,
                                   usb_speed_t speed);
-mx_status_t xhci_device_disconnected(xhci_t* xhci, uint32_t hub_address, uint32_t port);
+zx_status_t xhci_device_disconnected(xhci_t* xhci, uint32_t hub_address, uint32_t port);
 void xhci_start_device_thread(xhci_t* xhci);
-mx_status_t xhci_queue_start_root_hubs(xhci_t* xhci);
-mx_status_t xhci_enable_endpoint(xhci_t* xhci, uint32_t slot_id, usb_endpoint_descriptor_t* ep_desc,
+zx_status_t xhci_queue_start_root_hubs(xhci_t* xhci);
+zx_status_t xhci_enable_endpoint(xhci_t* xhci, uint32_t slot_id, usb_endpoint_descriptor_t* ep_desc,
                                  usb_ss_ep_comp_descriptor_t* ss_comp_desc, bool enable);
-mx_status_t xhci_configure_hub(xhci_t* xhci, uint32_t slot_id, usb_speed_t speed,
+zx_status_t xhci_configure_hub(xhci_t* xhci, uint32_t slot_id, usb_speed_t speed,
                                usb_hub_descriptor_t* descriptor);
diff --git a/system/dev/usb/xhci/xhci-root-hub.c b/system/dev/usb/xhci/xhci-root-hub.c
index a86c51f..d0b0ec6 100644
--- a/system/dev/usb/xhci/xhci-root-hub.c
+++ b/system/dev/usb/xhci/xhci-root-hub.c
@@ -19,7 +19,7 @@
 
 static const uint8_t xhci_language_list[] =
     { 4, /* bLength */ USB_DT_STRING, 0x09, 0x04, /* language ID */ };
-static const uint8_t xhci_manufacturer_string [] = // "Magenta"
+static const uint8_t xhci_manufacturer_string [] = // "Zircon"
     { 18, /* bLength */ USB_DT_STRING, 'M', 0, 'a', 0, 'g', 0, 'e', 0, 'n', 0, 't', 0, 'a', 0, 0, 0 };
 static const uint8_t xhci_product_string_2 [] = // "USB 2.0 Root Hub"
     { 36, /* bLength */ USB_DT_STRING, 'U', 0, 'S', 0, 'B', 0, ' ', 0, '2', 0, '.', 0, '0', 0,' ', 0,
@@ -222,7 +222,7 @@
     status->wPortChange |= USB_C_PORT_RESET;
 }
 
-mx_status_t xhci_root_hub_init(xhci_t* xhci, int rh_index) {
+zx_status_t xhci_root_hub_init(xhci_t* xhci, int rh_index) {
     xhci_root_hub_t* rh = &xhci->root_hubs[rh_index];
     const uint8_t* rh_port_map = xhci->rh_map;
     size_t rh_ports = xhci->rh_num_ports;
@@ -242,10 +242,10 @@
     rh->num_ports = port_count;
 
     rh->port_status = (usb_port_status_t *)calloc(port_count, sizeof(usb_port_status_t));
-    if (!rh->port_status) return MX_ERR_NO_MEMORY;
+    if (!rh->port_status) return ZX_ERR_NO_MEMORY;
 
     rh->port_map = calloc(port_count, sizeof(uint8_t));
-    if (!rh->port_map) return MX_ERR_NO_MEMORY;
+    if (!rh->port_map) return ZX_ERR_NO_MEMORY;
 
     // build map from virtual port index to actual port index
     int port_index = 0;
@@ -257,7 +257,7 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void xhci_root_hub_free(xhci_root_hub_t* rh) {
@@ -265,16 +265,16 @@
     free(rh->port_status);
 }
 
-static mx_status_t xhci_start_root_hub(xhci_t* xhci, xhci_root_hub_t* rh, int rh_index) {
+static zx_status_t xhci_start_root_hub(xhci_t* xhci, xhci_root_hub_t* rh, int rh_index) {
     usb_device_descriptor_t* device_desc = malloc(sizeof(usb_device_descriptor_t));
     if (!device_desc) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     usb_configuration_descriptor_t* config_desc =
                         (usb_configuration_descriptor_t *)malloc(sizeof(xhci_rh_config_desc));
     if (!config_desc) {
         free(device_desc);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     memcpy(device_desc, rh->device_desc, sizeof(usb_device_descriptor_t));
@@ -285,21 +285,21 @@
     return xhci_add_device(xhci, xhci->max_slots + rh_index + 1, 0, rh->speed);
 }
 
-mx_status_t xhci_start_root_hubs(xhci_t* xhci) {
+zx_status_t xhci_start_root_hubs(xhci_t* xhci) {
     dprintf(TRACE, "xhci_start_root_hubs\n");
 
     for (int i = 0; i < XHCI_RH_COUNT; i++) {
-        mx_status_t status = xhci_start_root_hub(xhci, &xhci->root_hubs[i], i);
-        if (status != MX_OK) {
+        zx_status_t status = xhci_start_root_hub(xhci, &xhci->root_hubs[i], i);
+        if (status != ZX_OK) {
             dprintf(ERROR, "xhci_start_root_hub(%d) failed: %d\n", i, status);
             return status;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t xhci_rh_get_descriptor(uint8_t request_type, xhci_root_hub_t* rh, uint16_t value,
+static zx_status_t xhci_rh_get_descriptor(uint8_t request_type, xhci_root_hub_t* rh, uint16_t value,
                                           uint16_t index, size_t length, iotxn_t* txn) {
     uint8_t type = request_type & USB_TYPE_MASK;
     uint8_t recipient = request_type & USB_RECIP_MASK;
@@ -309,14 +309,14 @@
         if (desc_type == USB_DT_DEVICE && index == 0) {
             if (length > sizeof(usb_device_descriptor_t)) length = sizeof(usb_device_descriptor_t);
             iotxn_copyto(txn, rh->device_desc, length, 0);
-            iotxn_complete(txn, MX_OK, length);
-            return MX_OK;
+            iotxn_complete(txn, ZX_OK, length);
+            return ZX_OK;
         } else if (desc_type == USB_DT_CONFIG && index == 0) {
             uint16_t desc_length = le16toh(rh->config_desc->wTotalLength);
             if (length > desc_length) length = desc_length;
             iotxn_copyto(txn, rh->config_desc, length, 0);
-            iotxn_complete(txn, MX_OK, length);
-            return MX_OK;
+            iotxn_complete(txn, ZX_OK, length);
+            return ZX_OK;
         } else if (value >> 8 == USB_DT_STRING) {
             uint8_t string_index = value & 0xFF;
             if (string_index < countof(xhci_rh_string_table)) {
@@ -324,8 +324,8 @@
                 if (length > string[0]) length = string[0];
 
                 iotxn_copyto(txn, string, length, 0);
-                iotxn_complete(txn, MX_OK, length);
-                return MX_OK;
+                iotxn_complete(txn, ZX_OK, length);
+                return ZX_OK;
             }
         }
     }
@@ -342,18 +342,18 @@
 
             if (length > sizeof(desc)) length = sizeof(desc);
             iotxn_copyto(txn, &desc, length, 0);
-            iotxn_complete(txn, MX_OK, length);
-            return MX_OK;
+            iotxn_complete(txn, ZX_OK, length);
+            return ZX_OK;
         }
     }
 
     dprintf(ERROR, "xhci_rh_get_descriptor unsupported value: %d index: %d\n", value, index);
-    iotxn_complete(txn, MX_ERR_NOT_SUPPORTED, 0);
-    return MX_ERR_NOT_SUPPORTED;
+    iotxn_complete(txn, ZX_ERR_NOT_SUPPORTED, 0);
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 // handles control requests for virtual root hub devices
-static mx_status_t xhci_rh_control(xhci_t* xhci, xhci_root_hub_t* rh, usb_setup_t* setup, iotxn_t* txn) {
+static zx_status_t xhci_rh_control(xhci_t* xhci, xhci_root_hub_t* rh, usb_setup_t* setup, iotxn_t* txn) {
     uint8_t request_type = setup->bmRequestType;
     uint8_t request = setup->bRequest;
     uint16_t value = le16toh(setup->wValue);
@@ -367,8 +367,8 @@
     } else if ((request_type & ~USB_DIR_MASK) == (USB_TYPE_CLASS | USB_RECIP_PORT)) {
         // index is 1-based port number
         if (index < 1 || index > rh->num_ports) {
-            iotxn_complete(txn, MX_ERR_INVALID_ARGS, 0);
-            return MX_OK;
+            iotxn_complete(txn, ZX_ERR_INVALID_ARGS, 0);
+            return ZX_OK;
         }
         int rh_port_index = rh->port_map[index - 1];
         int port_index = index - 1;
@@ -376,12 +376,12 @@
         if (request == USB_REQ_SET_FEATURE) {
             if (value == USB_FEATURE_PORT_POWER) {
                 // nothing to do - root hub ports are already powered
-                iotxn_complete(txn, MX_OK, 0);
-                return MX_OK;
+                iotxn_complete(txn, ZX_OK, 0);
+                return ZX_OK;
             } else if (value == USB_FEATURE_PORT_RESET) {
                 xhci_reset_port(xhci, rh, rh_port_index);
-                iotxn_complete(txn, MX_OK, 0);
-                return MX_OK;
+                iotxn_complete(txn, ZX_OK, 0);
+                return ZX_OK;
             }
         } else if (request == USB_REQ_CLEAR_FEATURE) {
             uint16_t* change_bits = &rh->port_status[port_index].wPortChange;
@@ -404,29 +404,29 @@
                     break;
             }
 
-            iotxn_complete(txn, MX_OK, 0);
-            return MX_OK;
+            iotxn_complete(txn, ZX_OK, 0);
+            return ZX_OK;
         } else if ((request_type & USB_DIR_MASK) == USB_DIR_IN &&
                    request == USB_REQ_GET_STATUS && value == 0) {
             usb_port_status_t* status = &rh->port_status[port_index];
             size_t length = txn->length;
             if (length > sizeof(*status)) length = sizeof(*status);
             iotxn_copyto(txn, status, length, 0);
-            iotxn_complete(txn, MX_OK, length);
-            return MX_OK;
+            iotxn_complete(txn, ZX_OK, length);
+            return ZX_OK;
         }
     } else if (request_type == (USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE) &&
                request == USB_REQ_SET_CONFIGURATION && txn->length == 0) {
         // nothing to do here
-        iotxn_complete(txn, MX_OK, 0);
-        return MX_OK;
+        iotxn_complete(txn, ZX_OK, 0);
+        return ZX_OK;
     }
 
     dprintf(ERROR, "unsupported root hub control request type: 0x%02X req: %d value: %d index: %d\n",
            request_type, request, value, index);
 
-    iotxn_complete(txn, MX_ERR_NOT_SUPPORTED, 0);
-    return MX_ERR_NOT_SUPPORTED;
+    iotxn_complete(txn, ZX_ERR_NOT_SUPPORTED, 0);
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static void xhci_rh_handle_intr_req(xhci_root_hub_t* rh, iotxn_t* txn) {
@@ -454,14 +454,14 @@
         size_t length = txn->length;
         if (length > sizeof(status_bits)) length = sizeof(status_bits);
         iotxn_copyto(txn, status_bits, length, 0);
-        iotxn_complete(txn, MX_OK, length);
+        iotxn_complete(txn, ZX_OK, length);
     } else {
         // queue transaction until we have something to report
         list_add_tail(&rh->pending_intr_reqs, &txn->node);
     }
 }
 
-mx_status_t xhci_rh_iotxn_queue(xhci_t* xhci, iotxn_t* txn, int rh_index) {
+zx_status_t xhci_rh_iotxn_queue(xhci_t* xhci, iotxn_t* txn, int rh_index) {
     dprintf(TRACE, "xhci_rh_iotxn_queue rh_index: %d\n", rh_index);
 
     usb_protocol_data_t* data = iotxn_pdata(txn, usb_protocol_data_t);
@@ -472,11 +472,11 @@
         return xhci_rh_control(xhci, rh, &data->setup, txn);
     } else if (ep_index == 2) {
         xhci_rh_handle_intr_req(rh, txn);
-        return MX_OK;
+        return ZX_OK;
     }
 
-    iotxn_complete(txn, MX_ERR_NOT_SUPPORTED, 0);
-    return MX_ERR_NOT_SUPPORTED;
+    iotxn_complete(txn, ZX_ERR_NOT_SUPPORTED, 0);
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 void xhci_handle_root_hub_change(xhci_t* xhci) {
diff --git a/system/dev/usb/xhci/xhci-root-hub.h b/system/dev/usb/xhci/xhci-root-hub.h
index 4fee17b..8218e35 100644
--- a/system/dev/usb/xhci/xhci-root-hub.h
+++ b/system/dev/usb/xhci/xhci-root-hub.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <ddk/iotxn.h>
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 
 #include "xhci-trb.h"
 
@@ -27,8 +27,8 @@
     usb_speed_t speed;
 } xhci_root_hub_t;
 
-mx_status_t xhci_root_hub_init(xhci_t* xhci, int rh_index);
+zx_status_t xhci_root_hub_init(xhci_t* xhci, int rh_index);
 void xhci_root_hub_free(xhci_root_hub_t* rh);
-mx_status_t xhci_start_root_hubs(xhci_t* xhci);
-mx_status_t xhci_rh_iotxn_queue(xhci_t* xhci, iotxn_t* txn, int rh_index);
+zx_status_t xhci_start_root_hubs(xhci_t* xhci);
+zx_status_t xhci_rh_iotxn_queue(xhci_t* xhci, iotxn_t* txn, int rh_index);
 void xhci_handle_root_hub_change(xhci_t* xhci);
diff --git a/system/dev/usb/xhci/xhci-transfer.c b/system/dev/usb/xhci/xhci-transfer.c
index 808d049..171e6ab 100644
--- a/system/dev/usb/xhci/xhci-transfer.c
+++ b/system/dev/usb/xhci/xhci-transfer.c
@@ -4,8 +4,8 @@
 
 #include <ddk/debug.h>
 #include <ddk/protocol/usb.h>
-#include <magenta/assert.h>
-#include <magenta/hw/usb.h>
+#include <zircon/assert.h>
+#include <zircon/hw/usb.h>
 #include <stdio.h>
 #include <string.h>
 #include <threads.h>
@@ -26,7 +26,7 @@
 
 // This resets the transfer ring's dequeue pointer just past the last completed transfer.
 // This can only be called when the endpoint is stopped and we are locked on ep->lock.
-static mx_status_t xhci_reset_dequeue_ptr_locked(xhci_t* xhci, uint32_t slot_id,
+static zx_status_t xhci_reset_dequeue_ptr_locked(xhci_t* xhci, uint32_t slot_id,
                                                  uint32_t endpoint) {
     xhci_slot_t* slot = &xhci->slots[slot_id];
     xhci_endpoint_t* ep = &slot->eps[endpoint];
@@ -43,17 +43,17 @@
     int cc = xhci_sync_command_wait(&command);
     if (cc != TRB_CC_SUCCESS) {
         dprintf(ERROR, "TRB_CMD_SET_TR_DEQUEUE failed cc: %d\n", cc);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     transfer_ring->dequeue_ptr = transfer_ring->current;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void xhci_process_transactions_locked(xhci_t* xhci, xhci_endpoint_t* ep,
                                              list_node_t* completed_txns);
 
-mx_status_t xhci_reset_endpoint(xhci_t* xhci, uint32_t slot_id, uint32_t endpoint) {
+zx_status_t xhci_reset_endpoint(xhci_t* xhci, uint32_t slot_id, uint32_t endpoint) {
     xhci_slot_t* slot = &xhci->slots[slot_id];
     xhci_endpoint_t* ep = &slot->eps[endpoint];
     iotxn_t* txn;
@@ -64,7 +64,7 @@
 
     if (ep->state != EP_STATE_HALTED) {
         mtx_unlock(&ep->lock);
-        return MX_OK;
+        return ZX_OK;
     }
 
     int ep_ctx_state = xhci_get_ep_ctx_state(ep);
@@ -73,7 +73,7 @@
     if (ep_ctx_state == EP_CTX_STATE_STOPPED || ep_ctx_state == EP_CTX_STATE_RUNNING) {
         ep->state = EP_STATE_RUNNING;
         mtx_unlock(&ep->lock);
-        return MX_OK;
+        return ZX_OK;
     }
     if (ep_ctx_state == EP_CTX_STATE_HALTED) {
         // reset the endpoint to move from Halted to Stopped state
@@ -87,7 +87,7 @@
         if (cc != TRB_CC_SUCCESS) {
             dprintf(ERROR, "xhci_reset_endpoint: TRB_CMD_RESET_ENDPOINT failed cc: %d\n", cc);
             mtx_unlock(&ep->lock);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
     }
 
@@ -95,8 +95,8 @@
     // after TRB_CMD_RESET_ENDPOINT.
     if (ep_ctx_state == EP_CTX_STATE_ERROR || ep_ctx_state == EP_CTX_STATE_HALTED) {
         // move transfer ring's dequeue pointer passed the failed transaction
-        mx_status_t status = xhci_reset_dequeue_ptr_locked(xhci, slot_id, endpoint);
-        if (status != MX_OK) {
+        zx_status_t status = xhci_reset_dequeue_ptr_locked(xhci, slot_id, endpoint);
+        if (status != ZX_OK) {
             mtx_unlock(&ep->lock);
             return status;
         }
@@ -104,32 +104,32 @@
 
     // xhci_reset_dequeue_ptr_locked will skip past all pending transactions,
     // so move them all to the queued list so they will be requeued
-    // Completed these with MX_ERR_CANCELED out of the lock.
+    // Completed these with ZX_ERR_CANCELED out of the lock.
     // Remove from tail and add to head to preserve the ordering
     while ((txn = list_remove_tail_type(&ep->pending_txns, iotxn_t, node)) != NULL) {
         list_add_head(&ep->queued_txns, &txn->node);
     }
 
     ep_ctx_state = xhci_get_ep_ctx_state(ep);
-    mx_status_t status;
+    zx_status_t status;
     switch (ep_ctx_state) {
     case EP_CTX_STATE_DISABLED:
         ep->state = EP_STATE_DEAD;
-        status = MX_ERR_IO_NOT_PRESENT;
+        status = ZX_ERR_IO_NOT_PRESENT;
         break;
     case EP_CTX_STATE_RUNNING:
     case EP_CTX_STATE_STOPPED:
         ep->state = EP_STATE_RUNNING;
-        status = MX_OK;
+        status = ZX_OK;
         break;
     case EP_CTX_STATE_HALTED:
     case EP_CTX_STATE_ERROR:
         ep->state = EP_STATE_HALTED;
-        status = MX_ERR_IO_REFUSED;
+        status = ZX_ERR_IO_REFUSED;
         break;
     default:
         ep->state = EP_STATE_HALTED;
-        status = MX_ERR_INTERNAL;
+        status = ZX_ERR_INTERNAL;
         break;
     }
 
@@ -150,11 +150,11 @@
 }
 
 // locked on ep->lock
-static mx_status_t xhci_start_transfer_locked(xhci_t* xhci, xhci_endpoint_t* ep, iotxn_t* txn) {
+static zx_status_t xhci_start_transfer_locked(xhci_t* xhci, xhci_endpoint_t* ep, iotxn_t* txn) {
     xhci_transfer_ring_t* ring = &ep->transfer_ring;
     if (ep->state != EP_STATE_RUNNING) {
         dprintf(ERROR, "xhci_start_transfer_locked bad ep->state %d\n", ep->state);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     usb_protocol_data_t* proto_data = iotxn_pdata(txn, usb_protocol_data_t);
@@ -162,8 +162,8 @@
     memset(state, 0, sizeof(*state));
 
     if (txn->length > 0) {
-        mx_status_t status = iotxn_physmap(txn);
-        if (status != MX_OK) {
+        zx_status_t status = iotxn_physmap(txn);
+        if (status != ZX_OK) {
             dprintf(ERROR, "%s: iotxn_physmap failed: %d\n", __FUNCTION__, status);
             return status;
         }
@@ -172,7 +172,7 @@
     // compute number of packets needed for this transaction
     if (txn->length > 0) {
         iotxn_phys_iter_init(&state->phys_iter, txn, XHCI_MAX_DATA_BUFFER);
-        mx_paddr_t dummy_paddr;
+        zx_paddr_t dummy_paddr;
         while (iotxn_phys_iter_next(&state->phys_iter, &dummy_paddr) > 0) {
             state->packet_count++;
         }
@@ -223,13 +223,13 @@
         xhci_increment_ring(ring);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-// returns MX_OK if txn has been successfully queued,
-// MX_ERR_SHOULD_WAIT if we ran out of TRBs and need to try again later,
+// returns ZX_OK if txn has been successfully queued,
+// ZX_ERR_SHOULD_WAIT if we ran out of TRBs and need to try again later,
 // or other error for a hard failure.
-static mx_status_t xhci_continue_transfer_locked(xhci_t* xhci, xhci_endpoint_t* ep, iotxn_t* txn) {
+static zx_status_t xhci_continue_transfer_locked(xhci_t* xhci, xhci_endpoint_t* ep, iotxn_t* txn) {
     xhci_transfer_ring_t* ring = &ep->transfer_ring;
 
     usb_protocol_data_t* proto_data = iotxn_pdata(txn, usb_protocol_data_t);
@@ -244,7 +244,7 @@
     uint32_t interrupter_target = 0;
 
     if (isochronous) {
-        if (length == 0) return MX_ERR_INVALID_ARGS;
+        if (length == 0) return ZX_ERR_INVALID_ARGS;
         if (xhci->num_interrupts > 1) {
             interrupter_target = ISOCH_INTERRUPTER;
         }
@@ -253,22 +253,22 @@
     if (frame != 0) {
         if (!isochronous) {
             dprintf(ERROR, "frame scheduling only supported for isochronous transfers\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         uint64_t current_frame = xhci_get_current_frame(xhci);
         if (frame < current_frame) {
             dprintf(ERROR, "can't schedule transfer into the past\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (frame - current_frame >= 895) {
             // See XHCI spec, section 4.11.2.5
             dprintf(ERROR, "can't schedule transfer more than 895ms into the future\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     }
 
     // Data Stage
-    mx_paddr_t paddr;
+    zx_paddr_t paddr;
     size_t transfer_size = 0;
     bool first_packet = (state->phys_iter.offset == 0);
     while (free_trbs > 0 && (((transfer_size = iotxn_phys_iter_next(&state->phys_iter, &paddr)) > 0) ||
@@ -317,14 +317,14 @@
     if (state->phys_iter.offset < txn->length) {
         // still more data to queue, but we are out of TRBs.
         // come back and finish later.
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
     }
 
     // if data length is zero, we queue event data after the status TRB
     if (state->needs_data_event && txn->length > 0) {
         if (free_trbs == 0) {
             // will need to do this later
-            return MX_ERR_SHOULD_WAIT;
+            return ZX_ERR_SHOULD_WAIT;
         }
 
         // Queue event data TRB
@@ -344,7 +344,7 @@
     if (state->needs_status) {
         if (free_trbs == 0) {
             // will need to do this later
-            return MX_ERR_SHOULD_WAIT;
+            return ZX_ERR_SHOULD_WAIT;
         }
 
         // Status Stage
@@ -368,7 +368,7 @@
     if (state->needs_data_event && txn->length == 0) {
         if (free_trbs == 0) {
             // will need to do this later
-            return MX_ERR_SHOULD_WAIT;
+            return ZX_ERR_SHOULD_WAIT;
         }
 
         // Queue event data TRB
@@ -391,11 +391,11 @@
     XHCI_WRITE32(&xhci->doorbells[proto_data->device_id], ep_index + 1);
     // it seems we need to ring the doorbell a second time when transitioning from STOPPED
     while (xhci_get_ep_ctx_state(ep) == EP_CTX_STATE_STOPPED) {
-        mx_nanosleep(mx_deadline_after(MX_MSEC(1)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(1)));
         XHCI_WRITE32(&xhci->doorbells[proto_data->device_id], ep_index + 1);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void xhci_process_transactions_locked(xhci_t* xhci, xhci_endpoint_t* ep,
@@ -415,8 +415,8 @@
                 return;
             }
 
-            mx_status_t status = xhci_start_transfer_locked(xhci, ep, txn);
-            if (status == MX_OK) {
+            zx_status_t status = xhci_start_transfer_locked(xhci, ep, txn);
+            if (status == ZX_OK) {
                 list_add_tail(&ep->pending_txns, &txn->node);
                 ep->current_txn = txn;
             } else {
@@ -428,12 +428,12 @@
 
         if (ep->current_txn) {
             iotxn_t* txn = ep->current_txn;
-            mx_status_t status = xhci_continue_transfer_locked(xhci, ep, txn);
-            if (status == MX_ERR_SHOULD_WAIT) {
+            zx_status_t status = xhci_continue_transfer_locked(xhci, ep, txn);
+            if (status == ZX_ERR_SHOULD_WAIT) {
                 // no available TRBs - need to wait for some complete
                 return;
             } else {
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     txn->status = status;
                     txn->actual = 0;
                     list_delete(&txn->node);
@@ -445,7 +445,7 @@
     }
 }
 
-mx_status_t xhci_queue_transfer(xhci_t* xhci, iotxn_t* txn) {
+zx_status_t xhci_queue_transfer(xhci_t* xhci, iotxn_t* txn) {
     usb_protocol_data_t* proto_data = iotxn_pdata(txn, usb_protocol_data_t);
     uint32_t slot_id = proto_data->device_id;
     uint8_t ep_index = xhci_endpoint_index(proto_data->ep_address);
@@ -460,42 +460,42 @@
     }
 
     if (slot_id < 1 || slot_id > xhci->max_slots) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (ep_index >= XHCI_NUM_EPS) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     xhci_slot_t* slot = &xhci->slots[slot_id];
     xhci_endpoint_t* ep = &slot->eps[ep_index];
     if (!slot->sc) {
         // slot no longer enabled
-        return MX_ERR_IO_NOT_PRESENT;
+        return ZX_ERR_IO_NOT_PRESENT;
     }
 
     mtx_lock(&ep->lock);
 
-    mx_status_t status;
+    zx_status_t status;
     switch (ep->state) {
     case EP_STATE_DEAD:
-        status = MX_ERR_IO_NOT_PRESENT;
+        status = ZX_ERR_IO_NOT_PRESENT;
         break;
     case EP_STATE_RUNNING:
     case EP_STATE_PAUSED:
-        status = MX_OK;
+        status = ZX_OK;
         break;
     case EP_STATE_HALTED:
-        status = MX_ERR_IO_REFUSED;
+        status = ZX_ERR_IO_REFUSED;
         break;
     case EP_STATE_DISABLED:
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         break;
     default:
-        status = MX_ERR_INTERNAL;
+        status = ZX_ERR_INTERNAL;
         break;
     }
 
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         mtx_unlock(&ep->lock);
         return status;
     }
@@ -512,17 +512,17 @@
         iotxn_complete(txn, txn->status, txn->actual);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t xhci_cancel_transfers(xhci_t* xhci, uint32_t slot_id, uint32_t endpoint) {
+zx_status_t xhci_cancel_transfers(xhci_t* xhci, uint32_t slot_id, uint32_t endpoint) {
     dprintf(TRACE, "xhci_cancel_transfers slot_id: %d ep_index: %d\n", slot_id, endpoint);
 
     if (slot_id < 1 || slot_id > xhci->max_slots) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (endpoint >= XHCI_NUM_EPS) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     xhci_slot_t* slot = &xhci->slots[slot_id];
@@ -530,7 +530,7 @@
     list_node_t completed_txns = LIST_INITIAL_VALUE(completed_txns);
     iotxn_t* txn;
     iotxn_t* temp;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     mtx_lock(&ep->lock);
 
@@ -555,7 +555,7 @@
             // TRB_CC_CONTEXT_STATE_ERROR is normal here in the case of a disconnected device,
             // since by then the endpoint would already be in error state.
             dprintf(ERROR, "xhci_cancel_transfers: TRB_CMD_STOP_ENDPOINT failed cc: %d\n", cc);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
         mtx_lock(&ep->lock);
 
@@ -564,13 +564,13 @@
         // will set the dequeue pointer after the last completed txn.
         list_for_every_entry_safe(&ep->pending_txns, txn, temp, iotxn_t, node) {
             list_delete(&txn->node);
-            txn->status = MX_ERR_CANCELED;
+            txn->status = ZX_ERR_CANCELED;
             txn->actual = 0;
             list_add_head(&completed_txns, &txn->node);
         }
 
         status = xhci_reset_dequeue_ptr_locked(xhci, slot_id, endpoint);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             ep->state = EP_STATE_RUNNING;
         }
     }
@@ -578,7 +578,7 @@
     // elements of the queued_txns list can simply be removed and completed.
     list_for_every_entry_safe(&ep->queued_txns, txn, temp, iotxn_t, node) {
         list_delete(&txn->node);
-        txn->status = MX_ERR_CANCELED;
+        txn->status = ZX_ERR_CANCELED;
         txn->actual = 0;
         list_add_head(&completed_txns, &txn->node);
     }
@@ -607,9 +607,9 @@
 
     // xhci_control_request is only used for reading first 8 bytes of the device descriptor,
     // so using IOTXN_ALLOC_POOL makes sense here.
-    mx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_POOL, length);
-    if (status != MX_OK) return status;
-    txn->protocol = MX_PROTOCOL_USB;
+    zx_status_t status = iotxn_alloc(&txn, IOTXN_ALLOC_POOL, length);
+    if (status != ZX_OK) return status;
+    txn->protocol = ZX_PROTOCOL_USB;
 
     usb_protocol_data_t* proto_data = iotxn_pdata(txn, usb_protocol_data_t);
 
@@ -634,20 +634,20 @@
     txn->complete_cb = xhci_control_complete;
     txn->cookie = &completion;
     iotxn_queue(xhci->mxdev, txn);
-    status = completion_wait(&completion, MX_SEC(1));
-    if (status == MX_OK) {
+    status = completion_wait(&completion, ZX_SEC(1));
+    if (status == ZX_OK) {
         status = txn->status;
-    } else if (status == MX_ERR_TIMED_OUT) {
-        dprintf(ERROR, "xhci_control_request MX_ERR_TIMED_OUT\n");
+    } else if (status == ZX_ERR_TIMED_OUT) {
+        dprintf(ERROR, "xhci_control_request ZX_ERR_TIMED_OUT\n");
         completion_reset(&completion);
         status = xhci_cancel_transfers(xhci, slot_id, 0);
-        if (status == MX_OK) {
-            completion_wait(&completion, MX_TIME_INFINITE);
-            status = MX_ERR_TIMED_OUT;
+        if (status == ZX_OK) {
+            completion_wait(&completion, ZX_TIME_INFINITE);
+            status = ZX_ERR_TIMED_OUT;
         }
     }
     dprintf(TRACE, "xhci_cancel_transfer got %d\n", status);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         status = txn->actual;
 
         if (length > 0 && !out) {
@@ -659,7 +659,7 @@
     return status;
 }
 
-mx_status_t xhci_get_descriptor(xhci_t* xhci, uint32_t slot_id, uint8_t type, uint16_t value,
+zx_status_t xhci_get_descriptor(xhci_t* xhci, uint32_t slot_id, uint8_t type, uint16_t value,
                                 uint16_t index, void* data, uint16_t length) {
     return xhci_control_request(xhci, slot_id, USB_DIR_IN | type | USB_RECIP_DEVICE,
                                 USB_REQ_GET_DESCRIPTOR, value, index, data, length);
@@ -684,7 +684,7 @@
 
     mtx_lock(&ep->lock);
 
-    mx_status_t result;
+    zx_status_t result;
     switch (cc) {
         case TRB_CC_SUCCESS:
         case TRB_CC_SHORT_PACKET:
@@ -692,7 +692,7 @@
             break;
         case TRB_CC_BABBLE_DETECTED_ERROR:
             dprintf(TRACE, "xhci_handle_transfer_event: TRB_CC_BABBLE_DETECTED_ERROR\n");
-            result = MX_ERR_IO_OVERRUN;
+            result = ZX_ERR_IO_OVERRUN;
             break;
         case TRB_CC_USB_TRANSACTION_ERROR:
         case TRB_CC_TRB_ERROR:
@@ -700,9 +700,9 @@
             int ep_ctx_state = xhci_get_ep_ctx_state(ep);
             dprintf(TRACE, "xhci_handle_transfer_event: cc %d ep_ctx_state %d\n", cc, ep_ctx_state);
             if (ep_ctx_state == EP_CTX_STATE_HALTED || ep_ctx_state == EP_CTX_STATE_ERROR) {
-                result = MX_ERR_IO_REFUSED;
+                result = ZX_ERR_IO_REFUSED;
             } else {
-                result = MX_ERR_IO;
+                result = ZX_ERR_IO;
             }
             break;
         }
@@ -718,24 +718,24 @@
             return;
        case TRB_CC_MISSED_SERVICE_ERROR:
             dprintf(TRACE, "xhci_handle_transfer_event: TRB_CC_MISSED_SERVICE_ERROR\n");
-            result = MX_ERR_IO_MISSED_DEADLINE;
+            result = ZX_ERR_IO_MISSED_DEADLINE;
             break;
         case TRB_CC_STOPPED:
         case TRB_CC_STOPPED_LENGTH_INVALID:
         case TRB_CC_STOPPED_SHORT_PACKET:
             switch (ep->state) {
             case EP_STATE_PAUSED:
-                result = MX_ERR_CANCELED;
+                result = ZX_ERR_CANCELED;
                 break;
             case EP_STATE_DISABLED:
-                result = MX_ERR_BAD_STATE;
+                result = ZX_ERR_BAD_STATE;
                 break;
             case EP_STATE_DEAD:
-                result = MX_ERR_IO_NOT_PRESENT;
+                result = ZX_ERR_IO_NOT_PRESENT;
                 break;
             default:
                 dprintf(ERROR, "xhci_handle_transfer_event: bad state for stopped txn: %d\n", ep->state);
-                result = MX_ERR_INTERNAL;
+                result = ZX_ERR_INTERNAL;
             }
             break;
         default: {
@@ -744,9 +744,9 @@
                    "ep_ctx_state %d:  %08X %08X %08X %08X\n", cc, ep_ctx_state,
                     ((uint32_t*)trb)[0], ((uint32_t*)trb)[1], ((uint32_t*)trb)[2], ((uint32_t*)trb)[3]);
             if (ep_ctx_state == EP_CTX_STATE_HALTED || ep_ctx_state == EP_CTX_STATE_ERROR) {
-                result = MX_ERR_IO_REFUSED;
+                result = ZX_ERR_IO_REFUSED;
             } else {
-                result = MX_ERR_IO;
+                result = ZX_ERR_IO;
             }
             break;
         }
@@ -815,7 +815,7 @@
     list_node_t completed_txns = LIST_INITIAL_VALUE(completed_txns);
     list_add_head(&completed_txns, &txn->node);
 
-    if (result == MX_ERR_IO_REFUSED && ep->state != EP_STATE_DEAD) {
+    if (result == ZX_ERR_IO_REFUSED && ep->state != EP_STATE_DEAD) {
         ep->state = EP_STATE_HALTED;
     } else if (ep->state == EP_STATE_RUNNING) {
         xhci_process_transactions_locked(xhci, ep, &completed_txns);
diff --git a/system/dev/usb/xhci/xhci-transfer.h b/system/dev/usb/xhci/xhci-transfer.h
index f447a56..20b84a7 100644
--- a/system/dev/usb/xhci/xhci-transfer.h
+++ b/system/dev/usb/xhci/xhci-transfer.h
@@ -4,20 +4,20 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include "xhci.h"
 
 typedef struct xhci xhci_t;
 
-typedef void (*xhci_transfer_complete_cb)(mx_status_t result, void* data);
+typedef void (*xhci_transfer_complete_cb)(zx_status_t result, void* data);
 
-mx_status_t xhci_queue_transfer(xhci_t* xhci, iotxn_t* txn);
+zx_status_t xhci_queue_transfer(xhci_t* xhci, iotxn_t* txn);
 int xhci_control_request(xhci_t* xhci, uint32_t slot_id, uint8_t request_type, uint8_t request,
                          uint16_t value, uint16_t index, void* data, uint16_t length);
-mx_status_t xhci_get_descriptor(xhci_t* xhci, uint32_t slot_id, uint8_t type, uint16_t value,
+zx_status_t xhci_get_descriptor(xhci_t* xhci, uint32_t slot_id, uint8_t type, uint16_t value,
                                 uint16_t index, void* data, uint16_t length);
 void xhci_handle_transfer_event(xhci_t* xhci, xhci_trb_t* trb);
 
-mx_status_t xhci_reset_endpoint(xhci_t* xhci, uint32_t slot_id, uint32_t endpoint);
-mx_status_t xhci_cancel_transfers(xhci_t* xhci, uint32_t slot_id, uint32_t endpoint);
+zx_status_t xhci_reset_endpoint(xhci_t* xhci, uint32_t slot_id, uint32_t endpoint);
+zx_status_t xhci_cancel_transfers(xhci_t* xhci, uint32_t slot_id, uint32_t endpoint);
diff --git a/system/dev/usb/xhci/xhci-trb.c b/system/dev/usb/xhci/xhci-trb.c
index b614675..2494e7e 100644
--- a/system/dev/usb/xhci/xhci-trb.c
+++ b/system/dev/usb/xhci/xhci-trb.c
@@ -4,9 +4,9 @@
 
 #include "xhci.h"
 
-mx_status_t xhci_transfer_ring_init(xhci_transfer_ring_t* ring, int count) {
-    mx_status_t status = io_buffer_init(&ring->buffer, count * sizeof(xhci_trb_t), IO_BUFFER_RW);
-    if (status != MX_OK) return status;
+zx_status_t xhci_transfer_ring_init(xhci_transfer_ring_t* ring, int count) {
+    zx_status_t status = io_buffer_init(&ring->buffer, count * sizeof(xhci_trb_t), IO_BUFFER_RW);
+    if (status != ZX_OK) return status;
 
     ring->start = io_buffer_virt(&ring->buffer);
     ring->current = ring->start;
@@ -17,7 +17,7 @@
     // set link TRB at end to point back to the beginning
     trb_set_ptr(&ring->start[count - 1], (void *)io_buffer_phys(&ring->buffer));
     trb_set_control(&ring->start[count - 1], TRB_LINK, TRB_TC);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void xhci_transfer_ring_free(xhci_transfer_ring_t* ring) {
@@ -38,11 +38,11 @@
     return size - busy_count;
 }
 
-mx_status_t xhci_event_ring_init(xhci_t* xhci, int interrupter, int count) {
+zx_status_t xhci_event_ring_init(xhci_t* xhci, int interrupter, int count) {
     xhci_event_ring_t* ring = &xhci->event_rings[interrupter];
     // allocate buffer for TRBs
-    mx_status_t status = io_buffer_init(&ring->buffer, count * sizeof(xhci_trb_t), IO_BUFFER_RW);
-    if (status != MX_OK) return status;
+    zx_status_t status = io_buffer_init(&ring->buffer, count * sizeof(xhci_trb_t), IO_BUFFER_RW);
+    if (status != ZX_OK) return status;
 
     ring->start = io_buffer_virt(&ring->buffer);
     erst_entry_t* erst_array = xhci->erst_arrays[interrupter];
@@ -52,7 +52,7 @@
     ring->current = ring->start;
     ring->end = ring->start + count;
     ring->ccs = TRB_C;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void xhci_event_ring_free(xhci_t* xhci, int interrupter) {
diff --git a/system/dev/usb/xhci/xhci-trb.h b/system/dev/usb/xhci/xhci-trb.h
index 05eb7c5..82b3d58 100644
--- a/system/dev/usb/xhci/xhci-trb.h
+++ b/system/dev/usb/xhci/xhci-trb.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <ddk/io-buffer.h>
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 
 #include "xhci-hw.h"
 
@@ -30,28 +30,28 @@
 
 typedef struct xhci xhci_t;
 
-mx_status_t xhci_transfer_ring_init(xhci_transfer_ring_t* tr, int count);
+zx_status_t xhci_transfer_ring_init(xhci_transfer_ring_t* tr, int count);
 void xhci_transfer_ring_free(xhci_transfer_ring_t* ring);
 size_t xhci_transfer_ring_free_trbs(xhci_transfer_ring_t* ring);
-mx_status_t xhci_event_ring_init(xhci_t* xhci, int interrupter, int count);
+zx_status_t xhci_event_ring_init(xhci_t* xhci, int interrupter, int count);
 void xhci_event_ring_free(xhci_t* xhci, int interrupter);
 void xhci_clear_trb(xhci_trb_t* trb);
 void* xhci_read_trb_ptr(xhci_transfer_ring_t* ring, xhci_trb_t* trb);
 xhci_trb_t* xhci_get_next_trb(xhci_transfer_ring_t* ring, xhci_trb_t* trb);
 void xhci_increment_ring(xhci_transfer_ring_t* ring);
 
-static inline mx_paddr_t xhci_transfer_ring_start_phys(xhci_transfer_ring_t* ring) {
+static inline zx_paddr_t xhci_transfer_ring_start_phys(xhci_transfer_ring_t* ring) {
     return io_buffer_phys(&ring->buffer);
 }
 
-static inline mx_paddr_t xhci_transfer_ring_current_phys(xhci_transfer_ring_t* ring) {
+static inline zx_paddr_t xhci_transfer_ring_current_phys(xhci_transfer_ring_t* ring) {
     return io_buffer_phys(&ring->buffer) + ((ring->current - ring->start) * sizeof(xhci_trb_t));
 }
 
-static inline mx_paddr_t xhci_event_ring_start_phys(xhci_event_ring_t* ring) {
+static inline zx_paddr_t xhci_event_ring_start_phys(xhci_event_ring_t* ring) {
     return io_buffer_phys(&ring->buffer);
 }
 
-static inline mx_paddr_t xhci_event_ring_current_phys(xhci_event_ring_t* ring) {
+static inline zx_paddr_t xhci_event_ring_current_phys(xhci_event_ring_t* ring) {
     return io_buffer_phys(&ring->buffer) + ((ring->current - ring->start) * sizeof(xhci_trb_t));
 }
diff --git a/system/dev/usb/xhci/xhci-util.c b/system/dev/usb/xhci/xhci-util.c
index b15eb79..96ba14b 100644
--- a/system/dev/usb/xhci/xhci-util.c
+++ b/system/dev/usb/xhci/xhci-util.c
@@ -23,12 +23,12 @@
 
 // returns condition code
 int xhci_sync_command_wait(xhci_sync_command_t* command) {
-    completion_wait(&command->completion, MX_TIME_INFINITE);
+    completion_wait(&command->completion, ZX_TIME_INFINITE);
 
     return (command->status & XHCI_MASK(EVT_TRB_CC_START, EVT_TRB_CC_BITS)) >> EVT_TRB_CC_START;
 }
 
-mx_status_t xhci_send_command(xhci_t* xhci, uint32_t cmd, uint64_t ptr, uint32_t control_bits) {
+zx_status_t xhci_send_command(xhci_t* xhci, uint32_t cmd, uint64_t ptr, uint32_t control_bits) {
     xhci_sync_command_t command;
     int cc;
 
@@ -37,15 +37,15 @@
 
     // Wait for one second (arbitrarily chosen timeout)
     // TODO(voydanoff) consider making the timeout a parameter to this function
-    mx_status_t status = completion_wait(&command.completion, MX_SEC(1));
-    if (status == MX_OK) {
+    zx_status_t status = completion_wait(&command.completion, ZX_SEC(1));
+    if (status == ZX_OK) {
         cc = (command.status & XHCI_MASK(EVT_TRB_CC_START, EVT_TRB_CC_BITS)) >> EVT_TRB_CC_START;
          if (cc == TRB_CC_SUCCESS) {
-            return MX_OK;
+            return ZX_OK;
         }
         dprintf(ERROR, "xhci_send_command %u failed, cc: %d\n", cmd, cc);
-        return MX_ERR_INTERNAL;
-    } else if (status == MX_ERR_TIMED_OUT) {
+        return ZX_ERR_INTERNAL;
+    } else if (status == ZX_ERR_TIMED_OUT) {
         completion_reset(&command.completion);
 
         // abort the command
@@ -53,11 +53,11 @@
         XHCI_WRITE64(crcr_ptr, CRCR_CA);
 
         // wait for TRB_CC_COMMAND_ABORTED
-        completion_wait(&command.completion, MX_TIME_INFINITE);
+        completion_wait(&command.completion, ZX_TIME_INFINITE);
         cc = (command.status & XHCI_MASK(EVT_TRB_CC_START, EVT_TRB_CC_BITS)) >> EVT_TRB_CC_START;
         if (cc == TRB_CC_SUCCESS) {
             // command must have completed while we were trying to abort it
-            status = MX_OK;
+            status = ZX_OK;
         }
 
         // ring doorbell to restart command ring
diff --git a/system/dev/usb/xhci/xhci-util.h b/system/dev/usb/xhci/xhci-util.h
index 5f3f22d..73876a1 100644
--- a/system/dev/usb/xhci/xhci-util.h
+++ b/system/dev/usb/xhci/xhci-util.h
@@ -27,4 +27,4 @@
 }
 
 // executes a command with a 1 second timeout
-mx_status_t xhci_send_command(xhci_t* xhci, uint32_t command, uint64_t ptr, uint32_t control_bits);
+zx_status_t xhci_send_command(xhci_t* xhci, uint32_t command, uint64_t ptr, uint32_t control_bits);
diff --git a/system/dev/usb/xhci/xhci.c b/system/dev/usb/xhci/xhci.c
index be97906..9275f2d 100644
--- a/system/dev/usb/xhci/xhci.c
+++ b/system/dev/usb/xhci/xhci.c
@@ -4,9 +4,9 @@
 
 #include <ddk/debug.h>
 #include <hw/reg.h>
-#include <magenta/types.h>
-#include <magenta/syscalls.h>
-#include <magenta/process.h>
+#include <zircon/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/process.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -116,10 +116,10 @@
     }
 }
 
-static mx_status_t xhci_claim_ownership(xhci_t* xhci) {
+static zx_status_t xhci_claim_ownership(xhci_t* xhci) {
     xhci_usb_legacy_support_cap_t* cap = xhci->usb_legacy_support_cap;
     if (cap == NULL) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     // The XHCI spec defines this handoff protocol.  We need to wait at most one
@@ -130,62 +130,62 @@
     // BIOS semaphore.  Additionally, all bits besides bit 0 in the OS semaphore
     // are RsvdP, so we need to preserve them on modification.
     cap->os_owned_sem |= 1;
-    mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
-    mx_time_t deadline = now + MX_SEC(1);
+    zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
+    zx_time_t deadline = now + ZX_SEC(1);
     while ((cap->bios_owned_sem & 1) && now < deadline) {
-        mx_nanosleep(mx_deadline_after(MX_MSEC(10)));
-        now = mx_time_get(MX_CLOCK_MONOTONIC);
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(10)));
+        now = zx_time_get(ZX_CLOCK_MONOTONIC);
     }
 
     if (cap->bios_owned_sem & 1) {
         cap->os_owned_sem &= ~1;
-        return MX_ERR_TIMED_OUT;
+        return ZX_ERR_TIMED_OUT;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t xhci_vmo_init(size_t size, mx_handle_t* out_handle, mx_vaddr_t* out_virt,
+static zx_status_t xhci_vmo_init(size_t size, zx_handle_t* out_handle, zx_vaddr_t* out_virt,
                                  bool contiguous) {
-    mx_status_t status;
-    mx_handle_t handle;
+    zx_status_t status;
+    zx_handle_t handle;
 
     if (contiguous) {
-        status = mx_vmo_create_contiguous(get_root_resource(), size, 0, &handle);
+        status = zx_vmo_create_contiguous(get_root_resource(), size, 0, &handle);
     } else {
-        status = mx_vmo_create(size, 0, &handle);
+        status = zx_vmo_create(size, 0, &handle);
     }
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         dprintf(ERROR, "xhci_vmo_init: vmo_create failed: %d\n", status);
         return status;
     }
 
     if (!contiguous) {
-        // needs to be done before MX_VMO_OP_LOOKUP for non-contiguous VMOs
-        status = mx_vmo_op_range(handle, MX_VMO_OP_COMMIT, 0, size, NULL, 0);
-        if (status != MX_OK) {
-            dprintf(ERROR, "xhci_vmo_init: mx_vmo_op_range(MX_VMO_OP_COMMIT) failed %d\n", status);
-            mx_handle_close(handle);
+        // needs to be done before ZX_VMO_OP_LOOKUP for non-contiguous VMOs
+        status = zx_vmo_op_range(handle, ZX_VMO_OP_COMMIT, 0, size, NULL, 0);
+        if (status != ZX_OK) {
+            dprintf(ERROR, "xhci_vmo_init: zx_vmo_op_range(ZX_VMO_OP_COMMIT) failed %d\n", status);
+            zx_handle_close(handle);
             return status;
         }
     }
 
-    status = mx_vmar_map(mx_vmar_root_self(), 0, handle, 0, size,
-                         MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, out_virt);
-    if (status != MX_OK) {
-        dprintf(ERROR, "xhci_vmo_init: mx_vmar_map failed: %d\n", status);
-        mx_handle_close(handle);
+    status = zx_vmar_map(zx_vmar_root_self(), 0, handle, 0, size,
+                         ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, out_virt);
+    if (status != ZX_OK) {
+        dprintf(ERROR, "xhci_vmo_init: zx_vmar_map failed: %d\n", status);
+        zx_handle_close(handle);
         return status;
     }
 
     *out_handle = handle;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static void xhci_vmo_release(mx_handle_t handle, mx_vaddr_t virt) {
+static void xhci_vmo_release(zx_handle_t handle, zx_vaddr_t virt) {
     uint64_t size;
-    mx_vmo_get_size(handle, &size);
-    mx_vmar_unmap(mx_vmar_root_self(), virt, size);
-    mx_handle_close(handle);
+    zx_vmo_get_size(handle, &size);
+    zx_vmar_unmap(zx_vmar_root_self(), virt, size);
+    zx_handle_close(handle);
 }
 
 void xhci_num_interrupts_init(xhci_t* xhci, void* mmio, uint32_t num_msi_interrupts) {
@@ -198,9 +198,9 @@
                                MIN(INTERRUPTER_COUNT, max_interrupters));
 }
 
-mx_status_t xhci_init(xhci_t* xhci, void* mmio) {
-    mx_status_t result = MX_OK;
-    mx_paddr_t* phys_addrs = NULL;
+zx_status_t xhci_init(xhci_t* xhci, void* mmio) {
+    zx_status_t result = ZX_OK;
+    zx_paddr_t* phys_addrs = NULL;
 
     list_initialize(&xhci->command_queue);
     mtx_init(&xhci->usbsts_lock, mtx_plain);
@@ -237,18 +237,18 @@
     // add 1 to allow 1-based indexing of slots
     xhci->slots = (xhci_slot_t*)calloc(xhci->max_slots + 1, sizeof(xhci_slot_t));
     if (!xhci->slots) {
-        result = MX_ERR_NO_MEMORY;
+        result = ZX_ERR_NO_MEMORY;
         goto fail;
     }
 
     xhci->rh_map = (uint8_t *)calloc(xhci->rh_num_ports, sizeof(uint8_t));
     if (!xhci->rh_map) {
-        result = MX_ERR_NO_MEMORY;
+        result = ZX_ERR_NO_MEMORY;
         goto fail;
     }
     xhci->rh_port_map = (uint8_t *)calloc(xhci->rh_num_ports, sizeof(uint8_t));
     if (!xhci->rh_port_map) {
-        result = MX_ERR_NO_MEMORY;
+        result = ZX_ERR_NO_MEMORY;
         goto fail;
     }
     xhci_read_extended_caps(xhci, mmio, hccparams1);
@@ -256,19 +256,19 @@
     // We need to claim before we write to any other registers on the
     // controller, but after we've read the extended capabilities.
     result = xhci_claim_ownership(xhci);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         dprintf(ERROR, "xhci_claim_ownership failed\n");
         goto fail;
     }
 
     // Allocate DMA memory for various things
     result = xhci_vmo_init(PAGE_SIZE, &xhci->dcbaa_erst_handle, &xhci->dcbaa_erst_virt, false);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         dprintf(ERROR, "xhci_vmo_init failed for xhci->dcbaa_erst_handle\n");
         goto fail;
     }
     result = xhci_vmo_init(PAGE_SIZE, &xhci->input_context_handle, &xhci->input_context_virt, false);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         dprintf(ERROR, "xhci_vmo_init failed for xhci->input_context_handle\n");
         goto fail;
     }
@@ -277,14 +277,14 @@
         size_t scratch_pad_pages_size = scratch_pad_bufs * xhci->page_size;
         result = xhci_vmo_init(scratch_pad_pages_size, &xhci->scratch_pad_pages_handle,
                                &xhci->scratch_pad_pages_virt, xhci->page_size > PAGE_SIZE);
-        if (result != MX_OK) {
+        if (result != ZX_OK) {
             dprintf(ERROR, "xhci_vmo_init failed for xhci->scratch_pad_pages_handle\n");
             goto fail;
         }
         size_t scratch_pad_index_size = PAGE_ROUNDUP(scratch_pad_bufs * sizeof(uint64_t));
         result = xhci_vmo_init(scratch_pad_index_size, &xhci->scratch_pad_index_handle,
                                &xhci->scratch_pad_index_virt, scratch_pad_index_size > PAGE_SIZE);
-        if (result != MX_OK) {
+        if (result != ZX_OK) {
             dprintf(ERROR, "xhci_vmo_init failed for xhci->scratch_pad_index_handle\n");
             goto fail;
         }
@@ -292,22 +292,22 @@
 
     // set up DCBAA, ERST array and input context
     xhci->dcbaa = (uint64_t *)xhci->dcbaa_erst_virt;
-    result = mx_vmo_op_range(xhci->dcbaa_erst_handle, MX_VMO_OP_LOOKUP, 0, PAGE_SIZE,
+    result = zx_vmo_op_range(xhci->dcbaa_erst_handle, ZX_VMO_OP_LOOKUP, 0, PAGE_SIZE,
                              &xhci->dcbaa_phys, sizeof(xhci->dcbaa_phys));
-    if (result != MX_OK) {
-        dprintf(ERROR, "mx_vmo_op_range failed for xhci->dcbaa_erst_handle\n");
+    if (result != ZX_OK) {
+        dprintf(ERROR, "zx_vmo_op_range failed for xhci->dcbaa_erst_handle\n");
         goto fail;
     }
     xhci->input_context = (uint8_t *)xhci->input_context_virt;
-    result = mx_vmo_op_range(xhci->input_context_handle, MX_VMO_OP_LOOKUP, 0, PAGE_SIZE,
+    result = zx_vmo_op_range(xhci->input_context_handle, ZX_VMO_OP_LOOKUP, 0, PAGE_SIZE,
                              &xhci->input_context_phys, sizeof(xhci->input_context_phys));
-    if (result != MX_OK) {
-        dprintf(ERROR, "mx_vmo_op_range failed for xhci->input_context_handle\n");
+    if (result != ZX_OK) {
+        dprintf(ERROR, "zx_vmo_op_range failed for xhci->input_context_handle\n");
         goto fail;
     }
 
     // DCBAA can only be 256 * sizeof(uint64_t) = 2048 bytes, so we have room for ERST array after DCBAA
-    mx_off_t erst_offset = 256 * sizeof(uint64_t);
+    zx_off_t erst_offset = 256 * sizeof(uint64_t);
 
     size_t array_bytes = ERST_ARRAY_SIZE * sizeof(erst_entry_t);
     // MSI only supports up to 32 interupts, so the required ERST arrays will fit
@@ -330,22 +330,22 @@
         uint64_t* scratch_pad_index = (uint64_t *)xhci->scratch_pad_index_virt;
         off_t offset = 0;
         for (uint32_t i = 0; i < scratch_pad_bufs; i++) {
-            mx_paddr_t scratch_pad_phys;
-            result = mx_vmo_op_range(xhci->scratch_pad_pages_handle, MX_VMO_OP_LOOKUP, offset,
+            zx_paddr_t scratch_pad_phys;
+            result = zx_vmo_op_range(xhci->scratch_pad_pages_handle, ZX_VMO_OP_LOOKUP, offset,
                                      PAGE_SIZE, &scratch_pad_phys, sizeof(scratch_pad_phys));
-            if (result != MX_OK) {
-                dprintf(ERROR, "mx_vmo_op_range failed for xhci->scratch_pad_pages_handle\n");
+            if (result != ZX_OK) {
+                dprintf(ERROR, "zx_vmo_op_range failed for xhci->scratch_pad_pages_handle\n");
                 goto fail;
             }
             scratch_pad_index[i] = scratch_pad_phys;
             offset += xhci->page_size;
         }
 
-        mx_paddr_t scratch_pad_index_phys;
-        result = mx_vmo_op_range(xhci->scratch_pad_index_handle, MX_VMO_OP_LOOKUP, 0, PAGE_SIZE,
+        zx_paddr_t scratch_pad_index_phys;
+        result = zx_vmo_op_range(xhci->scratch_pad_index_handle, ZX_VMO_OP_LOOKUP, 0, PAGE_SIZE,
                                   &scratch_pad_index_phys, sizeof(scratch_pad_index_phys));
-        if (result != MX_OK) {
-            dprintf(ERROR, "mx_vmo_op_range failed for xhci->scratch_pad_index_handle\n");
+        if (result != ZX_OK) {
+            dprintf(ERROR, "zx_vmo_op_range failed for xhci->scratch_pad_index_handle\n");
             goto fail;
         }
 
@@ -355,14 +355,14 @@
     }
 
     result = xhci_transfer_ring_init(&xhci->command_ring, COMMAND_RING_SIZE);
-    if (result != MX_OK) {
+    if (result != ZX_OK) {
         dprintf(ERROR, "xhci_command_ring_init failed\n");
         goto fail;
     }
 
     for (uint32_t i = 0; i < xhci->num_interrupts; i++) {
         result = xhci_event_ring_init(xhci, i, EVENT_RING_SIZE);
-        if (result != MX_OK) {
+        if (result != ZX_OK) {
             dprintf(ERROR, "xhci_event_ring_init failed\n");
             goto fail;
         }
@@ -384,12 +384,12 @@
     // initialize virtual root hub devices
     for (int i = 0; i < XHCI_RH_COUNT; i++) {
         result = xhci_root_hub_init(xhci, i);
-        if (result != MX_OK) goto fail;
+        if (result != ZX_OK) goto fail;
     }
 
     free(phys_addrs);
 
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     for (int i = 0; i < XHCI_RH_COUNT; i++) {
@@ -453,7 +453,7 @@
     }
 }
 
-mx_status_t xhci_start(xhci_t* xhci) {
+zx_status_t xhci_start(xhci_t* xhci) {
     volatile uint32_t* usbcmd = &xhci->op_regs->usbcmd;
     volatile uint32_t* usbsts = &xhci->op_regs->usbsts;
 
@@ -469,7 +469,7 @@
     xhci_wait_bits(usbsts, USBSTS_CNR, 0);
 
     // enable bus master
-    mx_status_t status = pci_enable_bus_master(&xhci->pci, true);
+    zx_status_t status = pci_enable_bus_master(&xhci->pci, true);
     if (status < 0) {
         dprintf(ERROR, "usb_xhci_bind enable_bus_master failed %d\n", status);
         return status;
@@ -499,7 +499,7 @@
     xhci_wait_bits(usbsts, USBSTS_HCH, 0);
 
     xhci_start_device_thread(xhci);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void xhci_post_command(xhci_t* xhci, uint32_t command, uint64_t ptr, uint32_t control_bits,
@@ -549,7 +549,7 @@
 static void xhci_handle_mfindex_wrap(xhci_t* xhci) {
     mtx_lock(&xhci->mfindex_mutex);
     xhci->mfindex_wrap_count++;
-    xhci->last_mfindex_wrap = mx_time_get(MX_CLOCK_MONOTONIC);
+    xhci->last_mfindex_wrap = zx_time_get(ZX_CLOCK_MONOTONIC);
     mtx_unlock(&xhci->mfindex_mutex);
 }
 
@@ -560,7 +560,7 @@
     uint64_t wrap_count = xhci->mfindex_wrap_count;
     // try to detect race condition where mfindex has wrapped but we haven't processed wrap event yet
     if (mfindex < 500) {
-        if (mx_time_get(MX_CLOCK_MONOTONIC) - xhci->last_mfindex_wrap > MX_MSEC(1000)) {
+        if (zx_time_get(ZX_CLOCK_MONOTONIC) - xhci->last_mfindex_wrap > ZX_MSEC(1000)) {
             dprintf(TRACE, "woah, mfindex wrapped before we got the event!\n");
             wrap_count++;
         }
diff --git a/system/dev/usb/xhci/xhci.h b/system/dev/usb/xhci/xhci.h
index 71270f3..6ec0eae 100644
--- a/system/dev/usb/xhci/xhci.h
+++ b/system/dev/usb/xhci/xhci.h
@@ -4,10 +4,10 @@
 
 #pragma once
 
-#include <magenta/hw/usb.h>
-#include <magenta/hw/usb-hub.h>
-#include <magenta/types.h>
-#include <magenta/listnode.h>
+#include <zircon/hw/usb.h>
+#include <zircon/hw/usb-hub.h>
+#include <zircon/types.h>
+#include <zircon/listnode.h>
 #include <sync/completion.h>
 #include <limits.h>
 #include <stdbool.h>
@@ -87,7 +87,7 @@
 
 struct xhci {
     // the device we implement
-    mx_device_t* mxdev;
+    zx_device_t* mxdev;
 
     // interface for calling back to usb bus driver
     usb_bus_interface_t bus;
@@ -97,13 +97,13 @@
     // supported by hardware. The actual number of interrupts configured
     // will not exceed this, and is stored in num_interrupts.
 #define INTERRUPTER_COUNT 2
-    mx_handle_t irq_handles[INTERRUPTER_COUNT];
-    mx_handle_t mmio_handle;
-    mx_handle_t cfg_handle;
+    zx_handle_t irq_handles[INTERRUPTER_COUNT];
+    zx_handle_t mmio_handle;
+    zx_handle_t cfg_handle;
     thrd_t irq_thread;
 
     // used by the start thread
-    mx_device_t* parent;
+    zx_device_t* parent;
     pci_protocol_t pci;
 
     // MMIO data structures
@@ -114,7 +114,7 @@
 
     // DMA data structures
     uint64_t* dcbaa;
-    mx_paddr_t dcbaa_phys;
+    zx_paddr_t dcbaa_phys;
 
     xhci_transfer_ring_t command_ring;
     mtx_t command_ring_lock;
@@ -124,7 +124,7 @@
     // Only indices up to num_interrupts will be populated.
     xhci_event_ring_t event_rings[INTERRUPTER_COUNT];
     erst_entry_t* erst_arrays[INTERRUPTER_COUNT];
-    mx_paddr_t erst_arrays_phys[INTERRUPTER_COUNT];
+    zx_paddr_t erst_arrays_phys[INTERRUPTER_COUNT];
 
     size_t page_size;
     size_t max_slots;
@@ -163,7 +163,7 @@
 
     // DMA buffers used by xhci_device_thread in xhci-device-manager.c
     uint8_t* input_context;
-    mx_paddr_t input_context_phys;
+    zx_paddr_t input_context_phys;
     mtx_t input_context_lock;
 
     // for xhci_get_current_frame()
@@ -171,29 +171,29 @@
     // number of times mfindex has wrapped
     uint64_t mfindex_wrap_count;
    // time of last mfindex wrap
-    mx_time_t last_mfindex_wrap;
+    zx_time_t last_mfindex_wrap;
 
     // VMO buffer for DCBAA and ERST array
-    mx_handle_t dcbaa_erst_handle;
-    mx_vaddr_t dcbaa_erst_virt;
+    zx_handle_t dcbaa_erst_handle;
+    zx_vaddr_t dcbaa_erst_virt;
     // VMO buffer for input context
-    mx_handle_t input_context_handle;
-    mx_vaddr_t input_context_virt;
+    zx_handle_t input_context_handle;
+    zx_vaddr_t input_context_virt;
     // VMO buffer for scratch pad pages
-    mx_handle_t scratch_pad_pages_handle;
-    mx_vaddr_t scratch_pad_pages_virt;
+    zx_handle_t scratch_pad_pages_handle;
+    zx_vaddr_t scratch_pad_pages_virt;
     // VMO buffer for scratch pad index
-    mx_handle_t scratch_pad_index_handle;
-    mx_vaddr_t scratch_pad_index_virt;
+    zx_handle_t scratch_pad_index_handle;
+    zx_vaddr_t scratch_pad_index_virt;
 };
 
 // Initializes num_interrupts field of xhci. The number of interrupts
 // is constrained by the number of interrupters supported by XHCI,
 // number of interrupts supported by MSI, and INTERRUPTER_COUNT.
 void xhci_num_interrupts_init(xhci_t* xhci, void* mmio, uint32_t num_msi_interrupts);
-mx_status_t xhci_init(xhci_t* xhci, void* mmio);
+zx_status_t xhci_init(xhci_t* xhci, void* mmio);
 int xhci_get_ep_ctx_state(xhci_endpoint_t* ep);
-mx_status_t xhci_start(xhci_t* xhci);
+zx_status_t xhci_start(xhci_t* xhci);
 void xhci_handle_interrupt(xhci_t* xhci, bool legacy, uint32_t interrupter);
 void xhci_post_command(xhci_t* xhci, uint32_t command, uint64_t ptr, uint32_t control_bits,
                        xhci_command_context_t* context);
@@ -213,5 +213,5 @@
 }
 
 // upper layer routines in usb-xhci.c
-mx_status_t xhci_add_device(xhci_t* xhci, int slot_id, int hub_address, int speed);
+zx_status_t xhci_add_device(xhci_t* xhci, int slot_id, int hub_address, int speed);
 void xhci_remove_device(xhci_t* xhci, int slot_id);
diff --git a/system/host/bootserver/bootserver.c b/system/host/bootserver/bootserver.c
index 1676440..419bce3 100644
--- a/system/host/bootserver/bootserver.c
+++ b/system/host/bootserver/bootserver.c
@@ -21,7 +21,7 @@
 #include <sys/time.h>
 #include <unistd.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 #include "bootserver.h"
 
@@ -293,7 +293,7 @@
         usage();
     }
     if (!nodename) {
-        nodename = getenv("MAGENTA_NODENAME");
+        nodename = getenv("ZIRCON_NODENAME");
     }
     if (nodename) {
         fprintf(stderr, "%s: Will only boot nodename '%s'\n", appname, nodename);
diff --git a/system/host/bootserver/netboot.c b/system/host/bootserver/netboot.c
index dc1a555..1cc3600 100644
--- a/system/host/bootserver/netboot.c
+++ b/system/host/bootserver/netboot.c
@@ -20,7 +20,7 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 #include "bootserver.h"
 
diff --git a/system/host/bootserver/tftp.c b/system/host/bootserver/tftp.c
index 50aff6d..7dcfadd 100644
--- a/system/host/bootserver/tftp.c
+++ b/system/host/bootserver/tftp.c
@@ -18,7 +18,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 #include <tftp/tftp.h>
 
 #include "bootserver.h"
diff --git a/system/host/loglistener/loglistener.c b/system/host/loglistener/loglistener.c
index 234494d..33be8e2 100644
--- a/system/host/loglistener/loglistener.c
+++ b/system/host/loglistener/loglistener.c
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 #ifdef _DARWIN_C_SOURCE
 #define REUSEPORT SO_REUSEPORT
@@ -47,7 +47,7 @@
     if ((argc > 1) && (argv[1][0])) {
         nodename = argv[1];
     } else {
-        char* envname = getenv("MAGENTA_NODENAME");
+        char* envname = getenv("ZIRCON_NODENAME");
         if (envname) {
             nodename = envname;
         }
diff --git a/system/host/mdi/mdidump.cpp b/system/host/mdi/mdidump.cpp
index c174874..40f6beb 100644
--- a/system/host/mdi/mdidump.cpp
+++ b/system/host/mdi/mdidump.cpp
@@ -10,8 +10,8 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#include <magenta/boot/bootdata.h>
-#include <magenta/mdi.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/mdi.h>
 
 static void dump_node(int fd, int level);
 
diff --git a/system/host/mdi/mdigen.cpp b/system/host/mdi/mdigen.cpp
index 6812e3b..7d96a72 100644
--- a/system/host/mdi/mdigen.cpp
+++ b/system/host/mdi/mdigen.cpp
@@ -13,7 +13,7 @@
 #include <string>
 #include <vector>
 
-#include <magenta/boot/bootdata.h>
+#include <zircon/boot/bootdata.h>
 
 #include "node.h"
 #include "parser.h"
diff --git a/system/host/mdi/node.h b/system/host/mdi/node.h
index 3e61c6c..a42acea 100644
--- a/system/host/mdi/node.h
+++ b/system/host/mdi/node.h
@@ -8,7 +8,7 @@
 #include <string>
 #include <vector>
 
-#include <magenta/mdi.h>
+#include <zircon/mdi.h>
 
 class Node {
 private:
diff --git a/system/host/mdi/tokens.h b/system/host/mdi/tokens.h
index b6dab76..e65ae3f 100644
--- a/system/host/mdi/tokens.h
+++ b/system/host/mdi/tokens.h
@@ -9,7 +9,7 @@
 #include <fstream>
 #include <string>
 
-#include <magenta/mdi.h>
+#include <zircon/mdi.h>
 
 enum TokenType {
     TOKEN_INVALID = 0,
diff --git a/system/host/merkleroot/merkleroot.cpp b/system/host/merkleroot/merkleroot.cpp
index efc01a5..e4e65a9 100644
--- a/system/host/merkleroot/merkleroot.cpp
+++ b/system/host/merkleroot/merkleroot.cpp
@@ -68,19 +68,19 @@
             fprintf(stderr, "[-] Failed to mmap '%s.\n", arg);
             return 1;
         }
-        mx_status_t rc =
+        zx_status_t rc =
             MerkleTree::Create(data, info.st_size, tree.get(), len, &digest);
         if (info.st_size != 0 && munmap(data, info.st_size) != 0) {
             perror("munmap");
             fprintf(stderr, "[-] Failed to munmap '%s.\n", arg);
             return 1;
         }
-        if (rc != MX_OK) {
+        if (rc != ZX_OK) {
             fprintf(stderr, "[-] Merkle tree creation failed: %d\n", rc);
             return 1;
         }
         rc = digest.ToString(strbuf, sizeof(strbuf));
-        if (rc != MX_OK) {
+        if (rc != ZX_OK) {
             fprintf(stderr, "[-] Unable to print Merkle tree root: %d\n", rc);
             return 1;
         }
diff --git a/system/host/merkleroot/rules.mk b/system/host/merkleroot/rules.mk
index 550dfca..5342c41 100644
--- a/system/host/merkleroot/rules.mk
+++ b/system/host/merkleroot/rules.mk
@@ -15,7 +15,7 @@
 
 MODULE_COMPILEFLAGS += \
 	-Isystem/ulib/digest/include \
-	-Isystem/ulib/mxcpp/include \
+	-Isystem/ulib/zxcpp/include \
 	-Isystem/ulib/fbl/include
 
 MODULE_SRCS += \
diff --git a/system/host/mkbootfs/mkbootfs.c b/system/host/mkbootfs/mkbootfs.c
index 8152927..a4b3b9e 100644
--- a/system/host/mkbootfs/mkbootfs.c
+++ b/system/host/mkbootfs/mkbootfs.c
@@ -21,7 +21,7 @@
 #include <lz4frame.h>
 #include <lib/cksum.h>
 
-#include <magenta/boot/bootdata.h>
+#include <zircon/boot/bootdata.h>
 
 #define MAXBUFFER (1024*1024)
 
diff --git a/system/host/netprotocol/netcp.c b/system/host/netprotocol/netcp.c
index 2190f1c..7e13ca3 100644
--- a/system/host/netprotocol/netcp.c
+++ b/system/host/netprotocol/netcp.c
@@ -26,7 +26,7 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 #include <tftp/tftp.h>
 
 #define TFTP_BUF_SZ 2048
diff --git a/system/host/netprotocol/netprotocol.c b/system/host/netprotocol/netprotocol.c
index 0393a88..fe02a36 100644
--- a/system/host/netprotocol/netprotocol.c
+++ b/system/host/netprotocol/netprotocol.c
@@ -8,7 +8,7 @@
 
 #include "netprotocol.h"
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 #include <arpa/inet.h>
 #include <ifaddrs.h>
@@ -306,7 +306,7 @@
 int netboot_open(const char* hostname, const char* ifname,
                  struct sockaddr_in6* addr, bool make_connection) {
     if ((hostname == NULL) || (hostname[0] == 0)) {
-        char* envname = getenv("MAGENTA_NODENAME");
+        char* envname = getenv("ZIRCON_NODENAME");
         hostname = envname && envname[0] != 0 ? envname : "*";
     }
     size_t hostname_len = strlen(hostname) + 1;
diff --git a/system/host/netprotocol/netprotocol.h b/system/host/netprotocol/netprotocol.h
index 33d288a..041015e 100644
--- a/system/host/netprotocol/netprotocol.h
+++ b/system/host/netprotocol/netprotocol.h
@@ -9,7 +9,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 #define MAXSIZE 1024
 
diff --git a/system/host/netprotocol/netruncmd.c b/system/host/netprotocol/netruncmd.c
index 46b1dc8..b930cda 100644
--- a/system/host/netprotocol/netruncmd.c
+++ b/system/host/netprotocol/netruncmd.c
@@ -13,7 +13,7 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <magenta/boot/netboot.h>
+#include <zircon/boot/netboot.h>
 
 static const char* appname;
 
@@ -65,8 +65,8 @@
         if (errno == ETIMEDOUT) {
             fprintf(stderr, "%s: lookup timed out\n", appname);
             // TODO(jimbe): Remove this transitional code after May 1, 2017.
-            if (!strcmp(hostname, "magenta")) {
-                fprintf(stderr, "WARNING: The \"magenta\" hostname is obsolete. "
+            if (!strcmp(hostname, "zircon")) {
+                fprintf(stderr, "WARNING: The \"zircon\" hostname is obsolete. "
                     "Use \":\" or see loglistener.\n");
             }
         }
diff --git a/system/host/sysgen/generator.cpp b/system/host/sysgen/generator.cpp
index c108fb0..915867b 100644
--- a/system/host/sysgen/generator.cpp
+++ b/system/host/sysgen/generator.cpp
@@ -11,7 +11,7 @@
 using std::string;
 
 static constexpr char kAuthors[] = "The Fuchsia Authors";
-static constexpr char kWrapMacro[] = "MX_SYSCALL_PARAM_ATTR";
+static constexpr char kWrapMacro[] = "ZX_SYSCALL_PARAM_ATTR";
 static constexpr char kDefaultHandleAnnotation[] = "handle_use";
 bool is_identifier_keyword(const string& iden);
 
@@ -21,7 +21,7 @@
 
     os << "// Copyright " << ltime->tm_year + 1900
        << " " << kAuthors << ". All rights reserved.\n";
-    os << "// This is a GENERATED file, see //magenta/system/host/sysgen.\n";
+    os << "// This is a GENERATED file, see //zircon/system/host/sysgen.\n";
     os << "// The license governing this file can be found in the LICENSE file.\n\n";
 
     return os.good();
@@ -183,7 +183,7 @@
         }
     }
     // If arg type is a handle (not an array) and no annotation is present, use default annotation
-    if (!has_annotation && arg.type == "mx_handle_t" && arg.arr_spec == nullptr) {
+    if (!has_annotation && arg.type == "zx_handle_t" && arg.arr_spec == nullptr) {
         os << kWrapMacro << "(" << kDefaultHandleAnnotation << ") ";
     }
 }
diff --git a/system/host/sysgen/kernel_wrapper_generator.cpp b/system/host/sysgen/kernel_wrapper_generator.cpp
index dc0c6be..430a869 100644
--- a/system/host/sysgen/kernel_wrapper_generator.cpp
+++ b/system/host/sysgen/kernel_wrapper_generator.cpp
@@ -84,7 +84,7 @@
     if (sc.is_noreturn()) {
         os << "; // __noreturn__\n";
         os << inin << "/* NOTREACHED */\n";
-        os << inin << "return MX_ERR_BAD_STATE;\n";
+        os << inin << "return ZX_ERR_BAD_STATE;\n";
     } else {
         os << ";\n";
     }
diff --git a/system/host/sysgen/rust_binding_generator.cpp b/system/host/sysgen/rust_binding_generator.cpp
index ed357cb..c291c4a 100644
--- a/system/host/sysgen/rust_binding_generator.cpp
+++ b/system/host/sysgen/rust_binding_generator.cpp
@@ -8,7 +8,7 @@
     if (!Generator::header(os)) {
         return false;
     }
-    os << "#[link(name = \"magenta\")]\n";
+    os << "#[link(name = \"zircon\")]\n";
     os << "extern {\n";
     return os.good();
 }
@@ -22,7 +22,7 @@
 }
 
 bool RustBindingGenerator::syscall(std::ofstream& os, const Syscall& sc) {
-    os << "    pub fn mx_" << sc.name << "(";
+    os << "    pub fn zx_" << sc.name << "(";
 
     // Writes all arguments.
     sc.for_each_kernel_arg([&](const TypeSpec& arg) {
diff --git a/system/host/sysgen/sysgen_generator.cpp b/system/host/sysgen/sysgen_generator.cpp
index 6198cb1..a1a78a5 100644
--- a/system/host/sysgen/sysgen_generator.cpp
+++ b/system/host/sysgen/sysgen_generator.cpp
@@ -36,8 +36,8 @@
 static vector<CallWrapper*> wrappers = {&test_wrapper, &blocking_wrapper};
 
 static VdsoWrapperGenerator vdso_wrapper_generator(
-    "_mx_",        // wrapper function name
-    "SYSCALL_mx_", // syscall implementation name
+    "_zx_",        // wrapper function name
+    "SYSCALL_zx_", // syscall implementation name
     wrappers);
 
 static KernelBranchGenerator kernel_branch;
@@ -51,7 +51,7 @@
 static KernelWrapperGenerator kernel_wrappers(
     "sys_",     // function prefix
     "wrapper_", // wrapper prefix
-    "MX_SYS_"); // syscall numbers constant prefix
+    "ZX_SYS_"); // syscall numbers constant prefix
 
 static bool skip_nothing(const Syscall&) {
     return false;
@@ -68,8 +68,8 @@
 static HeaderGenerator user_header(
     "extern ",                       // function prefix
     {
-        {"mx_", skip_internal},
-        {"_mx_", skip_internal},
+        {"zx_", skip_internal},
+        {"_zx_", skip_internal},
     },
     "void",                          // no-args special type
     false,                           // wrap pointers
@@ -78,8 +78,8 @@
 static HeaderGenerator vdso_header(
     "__LOCAL extern ", // function prefix
     {
-        {"VDSO_mx_", skip_nothing},
-        {"SYSCALL_mx_", skip_vdso},
+        {"VDSO_zx_", skip_nothing},
+        {"SYSCALL_zx_", skip_vdso},
     },
     "void",                                            // no-args special type
     false,
@@ -96,10 +96,10 @@
 
 static VDsoAsmGenerator vdso_asm_generator(
     "m_syscall", // syscall macro name
-    "mx_",       // syscall name prefix
+    "zx_",       // syscall name prefix
     wrappers);
 
-static SyscallNumbersGenerator syscall_num_generator("#define MX_SYS_");
+static SyscallNumbersGenerator syscall_num_generator("#define ZX_SYS_");
 
 static RustBindingGenerator rust_binding_generator;
 static TraceInfoGenerator trace_generator;
@@ -130,7 +130,7 @@
     //  The assembly include file for ARM64.
     {"arm-asm", vdso_asm_generator},
 
-    // A C header defining MX_SYS_* syscall number macros.
+    // A C header defining ZX_SYS_* syscall number macros.
     {"numbers", syscall_num_generator},
 
     // The trace subsystem data, to be interpreted as an array of structs.
diff --git a/system/host/sysgen/types.cpp b/system/host/sysgen/types.cpp
index 0e1e917..7808642 100644
--- a/system/host/sysgen/types.cpp
+++ b/system/host/sysgen/types.cpp
@@ -193,8 +193,8 @@
     }
 
     if (is_blocking() &&
-        (ret_spec.size() == 0 || ret_spec[0].type != "mx_status_t")) {
-        print_error("blocking must have first return be of type mx_status_t");
+        (ret_spec.size() == 0 || ret_spec[0].type != "zx_status_t")) {
+        print_error("blocking must have first return be of type zx_status_t");
         return false;
     }
 
diff --git a/system/host/sysgen/vdso_wrapper_generator.cpp b/system/host/sysgen/vdso_wrapper_generator.cpp
index df85791..a04cf8d 100644
--- a/system/host/sysgen/vdso_wrapper_generator.cpp
+++ b/system/host/sysgen/vdso_wrapper_generator.cpp
@@ -45,7 +45,7 @@
     os << "}\n\n";
 
     // Now put the wrapper into the public interface.
-    os << "VDSO_INTERFACE_FUNCTION(mx_" << sc.name << ");\n\n";
+    os << "VDSO_INTERFACE_FUNCTION(zx_" << sc.name << ");\n\n";
 
     return os.good();
 }
@@ -72,11 +72,11 @@
 }
 
 void TestWrapper::preCall(ofstream& os, const Syscall& sc) const {
-    os << in << "if (a < 0 || b < 0 || c < 0) return MX_ERR_INVALID_ARGS;\n";
+    os << in << "if (a < 0 || b < 0 || c < 0) return ZX_ERR_INVALID_ARGS;\n";
 }
 
 void TestWrapper::postCall(ofstream& os, const Syscall& sc, string return_var) const {
-    os << in << "if (" << return_var << " > 50) return MX_ERR_OUT_OF_RANGE;\n";
+    os << in << "if (" << return_var << " > 50) return ZX_ERR_OUT_OF_RANGE;\n";
 }
 
 bool BlockingRetryWrapper::applies(const Syscall& sc) const {
@@ -89,5 +89,5 @@
 
 void BlockingRetryWrapper::postCall(
     ofstream& os, const Syscall& sc, string return_var) const {
-    os << in << "} while (unlikely(" << return_var << " == MX_ERR_INTERNAL_INTR_RETRY));\n";
+    os << in << "} while (unlikely(" << return_var << " == ZX_ERR_INTERNAL_INTR_RETRY));\n";
 }
diff --git a/system/private/README.md b/system/private/README.md
index 76344ef..14c10d9 100644
--- a/system/private/README.md
+++ b/system/private/README.md
@@ -1,11 +1,11 @@
-## Magenta Private Headers
+## Zircon Private Headers
 
 This directory is in the include path for all kernel and system
-modules in Magenta, but unlike system/public, it is *not* exported
+modules in Zircon, but unlike system/public, it is *not* exported
 into the include directory of the generated sysroot.
 
 Most headers should live with their respective libraries.  These
 headers are ones that need to be global because they define protocols
 or utilities shared between user and kernel or between user modules,
-that *are not* publicly visible outside of Magenta.
+that *are not* publicly visible outside of Zircon.
 
diff --git a/system/private/efi/protocol/simple-text-output.h b/system/private/efi/protocol/simple-text-output.h
index ac93167..6ff0816 100644
--- a/system/private/efi/protocol/simple-text-output.h
+++ b/system/private/efi/protocol/simple-text-output.h
@@ -91,7 +91,7 @@
 #define EFI_GREEN 0x02
 #define EFI_CYAN 0x03
 #define EFI_RED 0x04
-#define EFI_MAGENTA 0x05
+#define EFI_ZIRCON 0x05
 #define EFI_BROWN 0x06
 #define EFI_LIGHTGRAY 0x07
 #define EFI_BRIGHT 0x08
@@ -100,7 +100,7 @@
 #define EFI_LIGHTGREEN 0x0A
 #define EFI_LIGHTCYAN 0x0B
 #define EFI_LIGHTRED 0x0C
-#define EFI_LIGHTMAGENTA 0x0D
+#define EFI_LIGHTZIRCON 0x0D
 #define EFI_YELLOW 0x0E
 #define EFI_WHITE 0x0F
 #define EFI_BACKGROUND_BLACK 0x00
@@ -108,7 +108,7 @@
 #define EFI_BACKGROUND_GREEN 0x20
 #define EFI_BACKGROUND_CYAN 0x30
 #define EFI_BACKGROUND_RED 0x40
-#define EFI_BACKGROUND_MAGENTA 0x50
+#define EFI_BACKGROUND_ZIRCON 0x50
 #define EFI_BACKGROUND_BROWN 0x60
 #define EFI_BACKGROUND_LIGHTGRAY 0x70
 
diff --git a/system/private/magenta/font/font-18x32.h b/system/private/zircon/font/font-18x32.h
similarity index 100%
rename from system/private/magenta/font/font-18x32.h
rename to system/private/zircon/font/font-18x32.h
diff --git a/system/private/magenta/font/font-9x16.h b/system/private/zircon/font/font-9x16.h
similarity index 100%
rename from system/private/magenta/font/font-9x16.h
rename to system/private/zircon/font/font-9x16.h
diff --git a/system/private/magenta/initializer_list.h b/system/private/zircon/initializer_list.h
similarity index 87%
rename from system/private/magenta/initializer_list.h
rename to system/private/zircon/initializer_list.h
index 711a1af..c7d8581 100644
--- a/system/private/magenta/initializer_list.h
+++ b/system/private/zircon/initializer_list.h
@@ -3,14 +3,14 @@
 // found in the LICENSE file.
 
 //
-// Provides std::initializer_list<T> on behalf of the Magenta toolchain
+// Provides std::initializer_list<T> on behalf of the Zircon toolchain
 // when compiling without the C++ standard library.
 //
 
 #pragma once
 
-#ifndef MAGENTA_TOOLCHAIN
-#error "This header must only be included when using the magenta toolchain."
+#ifndef ZIRCON_TOOLCHAIN
+#error "This header must only be included when using the zircon toolchain."
 #endif
 
 // This implementation is known to be compatible with our GCC and Clang toolchains.
diff --git a/system/private/magenta/stack.h b/system/private/zircon/stack.h
similarity index 95%
rename from system/private/magenta/stack.h
rename to system/private/zircon/stack.h
index 3b791d5..1a397bb 100644
--- a/system/private/magenta/stack.h
+++ b/system/private/zircon/stack.h
@@ -6,7 +6,7 @@
 
 #include <stdint.h>
 
-#define MAGENTA_DEFAULT_STACK_SIZE (256 << 10)
+#define ZIRCON_DEFAULT_STACK_SIZE (256 << 10)
 
 // Given the base and size of the stack block, compute the appropriate
 // initial SP value for an initial thread according to the C calling
diff --git a/system/private/magenta/thread_annotations.h b/system/private/zircon/thread_annotations.h
similarity index 92%
rename from system/private/magenta/thread_annotations.h
rename to system/private/zircon/thread_annotations.h
index a8316e9..a231b2e 100644
--- a/system/private/magenta/thread_annotations.h
+++ b/system/private/zircon/thread_annotations.h
@@ -4,12 +4,12 @@
 
 #pragma once
 
-// This header defines thread annotation macros to be used everywhere in Magenta
-// outside of publicly exposed headers. See system/public/magenta/compiler.h for
+// This header defines thread annotation macros to be used everywhere in Zircon
+// outside of publicly exposed headers. See system/public/zircon/compiler.h for
 // the publicly exported macros.
 
 // The thread safety analysis system is documented at http://clang.llvm.org/docs/ThreadSafetyAnalysis.html
-// and its use in Magenta is documented at docs/thread_annotations.md.  The macros we
+// and its use in Zircon is documented at docs/thread_annotations.md.  The macros we
 // use are:
 //
 // TA_CAP(x)                    |x| is the capability this type represents, e.g. "mutex".
diff --git a/system/public/BUILD.gn b/system/public/BUILD.gn
index fed30c5..0f1f527 100644
--- a/system/public/BUILD.gn
+++ b/system/public/BUILD.gn
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 # If not building for Fuchsia (e.g., linux, macos) then binaries need to get
-# magenta headers directly from source. Otherwise they come from sysroot.
+# zircon headers directly from source. Otherwise they come from sysroot.
 config("public_config") {
   include_dirs = [ "." ]
   visibility = [ ":*" ]
@@ -12,12 +12,12 @@
 # These headers are exported for use in building non-fuchsia-host binaries.
 source_set("public") {
   public = [
-    "magenta/compiler.h",
-    "magenta/errors.h",
-    "magenta/ktrace-def.h",
-    "magenta/ktrace.h",
-    "magenta/syscalls/object.h",
-    "magenta/types.h",
+    "zircon/compiler.h",
+    "zircon/errors.h",
+    "zircon/ktrace-def.h",
+    "zircon/ktrace.h",
+    "zircon/syscalls/object.h",
+    "zircon/types.h",
   ]
 
   public_configs = [ ":public_config" ]
diff --git a/system/public/README.md b/system/public/README.md
index 7149a0b..d425479 100644
--- a/system/public/README.md
+++ b/system/public/README.md
@@ -1,13 +1,13 @@
-## Magenta Public Headers
+## Zircon Public Headers
 
 This directory is in the include path for all kernel and system
-modules in Magenta, and is also exported into the include directory
+modules in Zircon, and is also exported into the include directory
 of the generate sysroot.
 
 Most headers should live with their respective libraries.  These
 headers are ones that need to be global because they're a public
 API/ABI surface or a header needed by a large number of public
-headers (eg, magenta/compiler.h)
+headers (eg, zircon/compiler.h)
 
 Headers in this directory are also used building Fuchsia host tools.
 These builds cannot get these headers from sysroot: sysroot is for target
@@ -17,7 +17,7 @@
 executable("foo") {
   deps = [ ... ]
   if (!is_fuchsia) {
-    deps += [ "//magenta/system/public" ]
+    deps += [ "//zircon/system/public" ]
   }
 }
 ```
diff --git a/system/public/magenta/assert.h b/system/public/magenta/assert.h
deleted file mode 100644
index 9a40e48..0000000
--- a/system/public/magenta/assert.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#ifdef _KERNEL
-#include <assert.h>
-#define MX_PANIC(args...) PANIC(args)
-#define MX_ASSERT(args...) ASSERT(args)
-#define MX_ASSERT_MSG(args...) ASSERT_MSG(args)
-#define MX_DEBUG_ASSERT(args...) DEBUG_ASSERT(args)
-#define MX_DEBUG_ASSERT_MSG(args...) DEBUG_ASSERT_MSG(args)
-#define MX_DEBUG_ASSERT_COND(args...) DEBUG_ASSERT_COND(args)
-#define MX_DEBUG_ASSERT_MSG_COND(args...) DEBUG_ASSERT_MSG_COND(args)
-#define MX_DEBUG_ASSERT_IMPLEMENTED DEBUG_ASSERT_IMPLEMENTED
-
-#ifdef MX_DEBUGLEVEL
-#undef MX_DEBUGLEVEL
-#endif
-#define MX_DEBUGLEVEL LK_DEBUGLEVEL
-
-#else // #ifdef _KERNEL
-
-#include <stdio.h> // for printf
-#include <stdlib.h> // for abort
-
-#include <magenta/compiler.h>
-
-#define MX_PANIC(fmt, ...)          \
-    do {                            \
-        printf(fmt, ##__VA_ARGS__); \
-        abort();                    \
-    } while (0)
-
-#define MX_ASSERT(x)                                                            \
-    do {                                                                        \
-        if (unlikely(!(x))) {                                                   \
-            MX_PANIC("ASSERT FAILED at (%s:%d): %s\n", __FILE__, __LINE__, #x); \
-        }                                                                       \
-    } while (0)
-
-#define MX_ASSERT_MSG(x, msg, msgargs...)                                                           \
-    do {                                                                                            \
-        if (unlikely(!(x))) {                                                                       \
-            MX_PANIC("ASSERT FAILED at (%s:%d): %s\n" msg "\n", __FILE__, __LINE__, #x, ##msgargs); \
-        }                                                                                           \
-    } while (0)
-
-// conditionally implement DEBUG_ASSERT based on MX_DEBUGLEVEL in kernel space
-// user space does not currently implement DEBUG_ASSERT
-#ifdef MX_DEBUGLEVEL
-#define MX_DEBUG_ASSERT_IMPLEMENTED (MX_DEBUGLEVEL > 1)
-#else
-#define MX_DEBUG_ASSERT_IMPLEMENTED 0
-#endif
-
-#define MX_DEBUG_ASSERT(x)                                                            \
-    do {                                                                              \
-        if (MX_DEBUG_ASSERT_IMPLEMENTED && unlikely(!(x))) {                          \
-            MX_PANIC("DEBUG ASSERT FAILED at (%s:%d): %s\n", __FILE__, __LINE__, #x); \
-        }                                                                             \
-    } while (0)
-
-#define MX_DEBUG_ASSERT_MSG(x, msg, msgargs...)                       \
-    do {                                                              \
-        if (MX_DEBUG_ASSERT_IMPLEMENTED && unlikely(!(x))) {          \
-            MX_PANIC("DEBUG ASSERT FAILED at (%s:%d): %s\n" msg "\n", \
-                     __FILE__, __LINE__, #x, ##msgargs);              \
-        }                                                             \
-    } while (0)
-
-// implement _COND versions of MX_DEBUG_ASSERT which only emit the body if
-// MX_DEBUG_ASSERT_IMPLEMENTED is set
-#if MX_DEBUG_ASSERT_IMPLEMENTED
-#define MX_DEBUG_ASSERT_COND(x) MX_DEBUG_ASSERT(x)
-#define MX_DEBUG_ASSERT_MSG_COND(x, msg, msgargs...) MX_DEBUG_ASSERT_MSG(x, msg, msgargs)
-#else
-#define MX_DEBUG_ASSERT_COND(x) do { } while (0)
-#define MX_DEBUG_ASSERT_MSG_COND(x, msg, msgargs...) do { } while (0)
-#endif
-#endif // #ifdef _KERNEL
diff --git a/system/public/magenta/device/sysinfo.h b/system/public/magenta/device/sysinfo.h
deleted file mode 100644
index 21af7ab..0000000
--- a/system/public/magenta/device/sysinfo.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
-
-
-// Return the root job handle
-//   in: none
-//   out: mx_handle_t
-#define IOCTL_SYSINFO_GET_ROOT_JOB \
-    IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_SYSINFO, 1)
-
-// Return the root resource (with only MX_RIGHT_ENUMERATE and MX_RIGHT_TRANSFER)
-//   in: none
-//   out: mx_handle_t
-#define IOCTL_SYSINFO_GET_ROOT_RESOURCE \
-    IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_SYSINFO, 2)
-
-// Return the hypervisor resource (with only MX_RIGHT_TRANSFER)
-//   in: none
-//   out: mx_handle_t
-#define IOCTL_SYSINFO_GET_HYPERVISOR_RESOURCE \
-    IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_SYSINFO, 3)
-
-// ssize_t ioctl_sysinfo_get_root_job(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_sysinfo_get_root_job, IOCTL_SYSINFO_GET_ROOT_JOB, mx_handle_t);
-
-// ssize_t ioctl_sysinfo_get_root_resource(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_sysinfo_get_root_resource, IOCTL_SYSINFO_GET_ROOT_RESOURCE, mx_handle_t);
-
-// ssize_t ioctl_sysinfo_get_hypervisor_resource(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_sysinfo_get_hypervisor_resource, IOCTL_SYSINFO_GET_HYPERVISOR_RESOURCE, mx_handle_t);
diff --git a/system/public/magenta/errors.h b/system/public/magenta/errors.h
deleted file mode 100644
index 3ccc22d..0000000
--- a/system/public/magenta/errors.h
+++ /dev/null
@@ -1,209 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#define MX_OK (0)
-
-// ======= Internal failures =======
-// MX_ERR_INTERNAL: The system encountered an otherwise unspecified error
-// while performing the operation.
-#define MX_ERR_INTERNAL (-1)
-
-// MX_ERR_NOT_SUPPORTED: The operation is not implemented, supported,
-// or enabled.
-#define MX_ERR_NOT_SUPPORTED (-2)
-
-// MX_ERR_NO_RESOURCES: The system was not able to allocate some resource
-// needed for the operation.
-#define MX_ERR_NO_RESOURCES (-3)
-
-// MX_ERR_NO_MEMORY: The system was not able to allocate memory needed
-// for the operation.
-#define MX_ERR_NO_MEMORY (-4)
-
-// MX_ERR_CALL_FAILED: The second phase of mx_channel_call() did not complete
-// successfully.
-#define MX_ERR_CALL_FAILED (-5)
-
-// MX_ERR_INTERNAL_INTR_RETRY: The system call was interrupted, but should be
-// retried.  This should not be seen outside of the VDSO.
-#define MX_ERR_INTERNAL_INTR_RETRY (-6)
-
-// ======= Parameter errors =======
-// MX_ERR_INVALID_ARGS: an argument is invalid, ex. null pointer
-#define MX_ERR_INVALID_ARGS (-10)
-
-// MX_ERR_BAD_HANDLE: A specified handle value does not refer to a handle.
-#define MX_ERR_BAD_HANDLE (-11)
-
-// MX_ERR_WRONG_TYPE: The subject of the operation is the wrong type to
-// perform the operation.
-// Example: Attempting a message_read on a thread handle.
-#define MX_ERR_WRONG_TYPE (-12)
-
-// MX_ERR_BAD_SYSCALL: The specified syscall number is invalid.
-#define MX_ERR_BAD_SYSCALL (-13)
-
-// MX_ERR_OUT_OF_RANGE: An argument is outside the valid range for this
-// operation.
-#define MX_ERR_OUT_OF_RANGE (-14)
-
-// MX_ERR_BUFFER_TOO_SMALL: A caller provided buffer is too small for
-// this operation.
-#define MX_ERR_BUFFER_TOO_SMALL (-15)
-
-// ======= Precondition or state errors =======
-// MX_ERR_BAD_STATE: operation failed because the current state of the
-// object does not allow it, or a precondition of the operation is
-// not satisfied
-#define MX_ERR_BAD_STATE (-20)
-
-// MX_ERR_TIMED_OUT: The time limit for the operation elapsed before
-// the operation completed.
-#define MX_ERR_TIMED_OUT (-21)
-
-// MX_ERR_SHOULD_WAIT: The operation cannot be performed currently but
-// potentially could succeed if the caller waits for a prerequisite
-// to be satisfied, for example waiting for a handle to be readable
-// or writable.
-// Example: Attempting to read from a channel that has no
-// messages waiting but has an open remote will return MX_ERR_SHOULD_WAIT.
-// Attempting to read from a channel that has no messages waiting
-// and has a closed remote end will return MX_ERR_PEER_CLOSED.
-#define MX_ERR_SHOULD_WAIT (-22)
-
-// MX_ERR_CANCELED: The in-progress operation (e.g. a wait) has been
-// canceled.
-#define MX_ERR_CANCELED (-23)
-
-// MX_ERR_PEER_CLOSED: The operation failed because the remote end of the
-// subject of the operation was closed.
-#define MX_ERR_PEER_CLOSED (-24)
-
-// MX_ERR_NOT_FOUND: The requested entity is not found.
-#define MX_ERR_NOT_FOUND (-25)
-
-// MX_ERR_ALREADY_EXISTS: An object with the specified identifier
-// already exists.
-// Example: Attempting to create a file when a file already exists
-// with that name.
-#define MX_ERR_ALREADY_EXISTS (-26)
-
-// MX_ERR_ALREADY_BOUND: The operation failed because the named entity
-// is already owned or controlled by another entity. The operation
-// could succeed later if the current owner releases the entity.
-#define MX_ERR_ALREADY_BOUND (-27)
-
-// MX_ERR_UNAVAILABLE: The subject of the operation is currently unable
-// to perform the operation.
-// Note: This is used when there's no direct way for the caller to
-// observe when the subject will be able to perform the operation
-// and should thus retry.
-#define MX_ERR_UNAVAILABLE (-28)
-
-
-// ======= Permission check errors =======
-// MX_ERR_ACCESS_DENIED: The caller did not have permission to perform
-// the specified operation.
-#define MX_ERR_ACCESS_DENIED (-30)
-
-// ======= Input-output errors =======
-// MX_ERR_IO: Otherwise unspecified error occurred during I/O.
-#define MX_ERR_IO (-40)
-
-// MX_ERR_REFUSED: The entity the I/O operation is being performed on
-// rejected the operation.
-// Example: an I2C device NAK'ing a transaction or a disk controller
-// rejecting an invalid command, or a stalled USB endpoint.
-#define MX_ERR_IO_REFUSED (-41)
-
-// MX_ERR_IO_DATA_INTEGRITY: The data in the operation failed an integrity
-// check and is possibly corrupted.
-// Example: CRC or Parity error.
-#define MX_ERR_IO_DATA_INTEGRITY (-42)
-
-// MX_ERR_IO_DATA_LOSS: The data in the operation is currently unavailable
-// and may be permanently lost.
-// Example: A disk block is irrecoverably damaged.
-#define MX_ERR_IO_DATA_LOSS (-43)
-
-// MX_ERR_IO_NOT_PRESENT: The device is no longer available (has been
-// unplugged from the system, powered down, or the driver has been
-// unloaded)
-#define MX_ERR_IO_NOT_PRESENT (-44)
-
-// MX_ERR_IO_OVERRUN: More data was received from the device than expected.
-// Example: a USB "babble" error due to a device sending more data than
-// the host queued to receive.
-#define MX_ERR_IO_OVERRUN (-45)
-
-// MX_ERR_IO_MISSED_DEADLINE: An operation did not complete within the required timeframe.
-// Example: A USB isochronous transfer that failed to complete due to an overrun or underrun.
-#define MX_ERR_IO_MISSED_DEADLINE (-46)
-
-// ======== Filesystem Errors ========
-// MX_ERR_BAD_PATH: Path name is too long.
-#define MX_ERR_BAD_PATH (-50)
-
-// MX_ERR_NOT_DIR: Object is not a directory or does not support
-// directory operations.
-// Example: Attempted to open a file as a directory or
-// attempted to do directory operations on a file.
-#define MX_ERR_NOT_DIR (-51)
-
-// MX_ERR_NOT_FILE: Object is not a regular file.
-#define MX_ERR_NOT_FILE (-52)
-
-// MX_ERR_FILE_BIG: This operation would cause a file to exceed a
-// filesystem-specific size limit
-#define MX_ERR_FILE_BIG (-53)
-
-// MX_ERR_NO_SPACE: Filesystem or device space is exhausted.
-#define MX_ERR_NO_SPACE (-54)
-
-// MX_ERR_NOT_EMPTY: Directory is not empty.
-#define MX_ERR_NOT_EMPTY (-55)
-
-// ======== Flow Control ========
-// These are not errors, as such, and will never be returned
-// by a syscall or public API.  They exist to allow callbacks
-// to request changes in operation.
-//
-// MX_ERR_STOP: Do not call again.
-// Example: A notification callback will be called on every
-// event until it returns something other than MX_OK.
-// This status allows differentiation between "stop due to
-// an error" and "stop because the work is done."
-#define MX_ERR_STOP (-60)
-
-// MX_ERR_NEXT: Advance to the next item.
-// Example: A notification callback will use this response
-// to indicate it did not "consume" an item passed to it,
-// but by choice, not due to an error condition.
-#define MX_ERR_NEXT (-61)
-
-// ======== Network-related errors ========
-
-// MX_ERR_PROTOCOL_NOT_SUPPORTED: Specified protocol is not
-// supported.
-#define MX_ERR_PROTOCOL_NOT_SUPPORTED (-70)
-
-// MX_ERR_ADDRESS_UNREACHABLE: Host is unreachable.
-#define MX_ERR_ADDRESS_UNREACHABLE (-71)
-
-// MX_ERR_ADDRESS_IN_USE: Address is being used by someone else.
-#define MX_ERR_ADDRESS_IN_USE (-72)
-
-// MX_ERR_NOT_CONNECTED: Socket is not connected.
-#define MX_ERR_NOT_CONNECTED (-73)
-
-// MX_ERR_CONNECTION_REFUSED: Remote peer rejected the connection.
-#define MX_ERR_CONNECTION_REFUSED (-74)
-
-// MX_ERR_CONNECTION_RESET: Connection was reset.
-#define MX_ERR_CONNECTION_RESET (-75)
-
-// MX_ERR_CONNECTION_ABORTED: Connection was aborted.
-#define MX_ERR_CONNECTION_ABORTED (-76)
diff --git a/system/public/magenta/pixelformat.h b/system/public/magenta/pixelformat.h
deleted file mode 100644
index 85c635b..0000000
--- a/system/public/magenta/pixelformat.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-// clang-format off
-
-#define MX_PIXEL_FORMAT_NONE       (0)
-
-#define MX_PIXEL_FORMAT_RGB_565    (1)
-#define MX_PIXEL_FORMAT_RGB_332    (2)
-#define MX_PIXEL_FORMAT_RGB_2220   (3)
-#define MX_PIXEL_FORMAT_ARGB_8888  (4)
-#define MX_PIXEL_FORMAT_RGB_x888   (5)
-#define MX_PIXEL_FORMAT_MONO_1     (6)
-#define MX_PIXEL_FORMAT_MONO_8     (7)
diff --git a/system/public/magenta/process.h b/system/public/magenta/process.h
deleted file mode 100644
index 57c18b1..0000000
--- a/system/public/magenta/process.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-#include <stdint.h>
-
-__BEGIN_CDECLS
-
-// Accessors for Magenta-specific state maintained by the language runtime
-
-// Examines the set of handles received at process startup for one matching
-// |hnd_info|.  If one is found, atomically returns it and removes it from the
-// set available to future calls.
-// |hnd_info| is a value returned by PA_HND().
-mx_handle_t mx_get_startup_handle(uint32_t hnd_info);
-
-mx_handle_t _mx_thread_self(void);
-mx_handle_t mx_thread_self(void);
-
-mx_handle_t _mx_process_self(void);
-mx_handle_t mx_process_self(void);
-
-mx_handle_t _mx_vmar_root_self(void);
-mx_handle_t mx_vmar_root_self(void);
-
-mx_handle_t _mx_job_default(void);
-mx_handle_t mx_job_default(void);
-
-__END_CDECLS
diff --git a/system/public/magenta/rights.h b/system/public/magenta/rights.h
deleted file mode 100644
index 9419b61..0000000
--- a/system/public/magenta/rights.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-
-// Default rights for objects.
-#define MX_DEFAULT_CHANNEL_RIGHTS \
-  (MX_RIGHT_TRANSFER | MX_RIGHT_READ | MX_RIGHT_WRITE | \
-   MX_RIGHT_SIGNAL | MX_RIGHT_SIGNAL_PEER)
-
-#define MX_DEFAULT_EVENT_RIGHTS \
-  (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ | MX_RIGHT_WRITE |\
-   MX_RIGHT_SIGNAL)
-
-#define MX_DEFAULT_EVENT_PAIR_RIGHTS \
-  (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ | MX_RIGHT_WRITE |\
-   MX_RIGHT_SIGNAL | MX_RIGHT_SIGNAL_PEER)
-
-#define MX_DEFAULT_FIFO_RIGHTS \
-  (MX_RIGHT_TRANSFER | MX_RIGHT_DUPLICATE | MX_RIGHT_READ | MX_RIGHT_WRITE |\
-   MX_RIGHT_SIGNAL | MX_RIGHT_SIGNAL_PEER)
-
-#define MX_DEFAULT_GUEST_RIGHTS \
-  (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_WRITE)
-
-#define MX_DEFAULT_INTERRUPT_RIGHTS \
-  (MX_RIGHT_TRANSFER | MX_RIGHT_READ | MX_RIGHT_WRITE)
-
-#define MX_DEFAULT_IO_MAPPING_RIGHTS MX_RIGHT_READ
-
-#define MX_DEFAULT_JOB_RIGHTS                                                \
-  (MX_RIGHT_TRANSFER | MX_RIGHT_DUPLICATE | MX_RIGHT_READ | MX_RIGHT_WRITE | \
-   MX_RIGHT_ENUMERATE | MX_RIGHT_DESTROY | MX_RIGHT_GET_PROPERTY |           \
-   MX_RIGHT_SET_PROPERTY | MX_RIGHT_SET_POLICY | MX_RIGHT_GET_POLICY |       \
-   MX_RIGHT_SIGNAL)
-
-#define MX_DEFAULT_LOG_RIGHTS \
-  (MX_RIGHT_TRANSFER | MX_RIGHT_WRITE | MX_RIGHT_DUPLICATE | MX_RIGHT_SIGNAL)
-
-#define MX_DEFAULT_PCI_DEVICE_RIGHTS \
-  (MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER)
-#define MX_DEFAULT_PCI_INTERRUPT_RIGHTS \
-  (MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_TRANSFER)
-
-#define MX_DEFAULT_PORT_RIGHTS \
-  (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ | MX_RIGHT_WRITE)
-
-#define MX_DEFAULT_PROCESS_RIGHTS                                            \
-  (MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | \
-   MX_RIGHT_ENUMERATE | MX_RIGHT_DESTROY | MX_RIGHT_GET_PROPERTY |           \
-   MX_RIGHT_SET_PROPERTY | MX_RIGHT_SIGNAL)
-
-#define MX_DEFAULT_RESOURCE_RIGHTS \
-  (MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER |\
-   MX_RIGHT_SIGNAL)
-
-#define MX_DEFAULT_SOCKET_RIGHTS \
-  (MX_RIGHT_TRANSFER | MX_RIGHT_DUPLICATE | MX_RIGHT_READ | MX_RIGHT_WRITE |\
-   MX_RIGHT_SIGNAL | MX_RIGHT_SIGNAL_PEER)
-
-#define MX_DEFAULT_THREAD_RIGHTS                                             \
-  (MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | \
-   MX_RIGHT_DESTROY | MX_RIGHT_GET_PROPERTY | MX_RIGHT_SET_PROPERTY |        \
-   MX_RIGHT_SIGNAL)
-
-#define MX_DEFAULT_TIMERS_RIGHTS \
-  (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ | MX_RIGHT_WRITE |\
-   MX_RIGHT_SIGNAL)
-
-#define MX_DEFAULT_VCPU_RIGHTS \
-  (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ | MX_RIGHT_WRITE |\
-   MX_RIGHT_EXECUTE | MX_RIGHT_SIGNAL)
-
-#define MX_DEFAULT_VMAR_RIGHTS (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER)
-
-#define MX_DEFAULT_VMO_RIGHTS                                                \
-  (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ | MX_RIGHT_WRITE | \
-   MX_RIGHT_EXECUTE | MX_RIGHT_MAP | MX_RIGHT_GET_PROPERTY |                 \
-   MX_RIGHT_SET_PROPERTY | MX_RIGHT_SIGNAL)
diff --git a/system/public/magenta/syscalls.h b/system/public/magenta/syscalls.h
deleted file mode 100644
index 152fef4..0000000
--- a/system/public/magenta/syscalls.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-#include <magenta/syscalls/types.h>
-
-#include <magenta/syscalls/pci.h>
-#include <magenta/syscalls/object.h>
-
-__BEGIN_CDECLS
-
-#if defined(__clang__)
-#define MX_SYSCALL_PARAM_ATTR(x)   __attribute__((annotate("mx_" #x)))
-#else
-#define MX_SYSCALL_PARAM_ATTR(x)   // no-op
-#endif
-
-#include <magenta/syscalls/definitions.h>
-
-// Compatibility wrappers for deprecated syscalls also go here, when
-// there are any.
-
-__END_CDECLS
diff --git a/system/public/magenta/syscalls.sysgen b/system/public/magenta/syscalls.sysgen
deleted file mode 100644
index a45db04..0000000
--- a/system/public/magenta/syscalls.sysgen
+++ /dev/null
@@ -1,695 +0,0 @@
-# Copyright 2016 The Fuchsia Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-#
-# The syntax of each line is
-#     syscall <name> [attributes] ([args])
-#         [returns (<type> [attributes] [args])];
-#
-# with '[]' being optional and '<>' being required input.
-#
-# <name> is the syscall function name. It must be a valid C identifier.
-#
-# [attributes] can be empty or is a space separated list of words with
-# meaning for a particular generator.
-#
-# [args] can be empty or is a comma separated list of
-# '<aname>: <type> [attributes] [ctr]'
-#
-# <aname> is the argument name. It must be a valid C indentifier.
-#
-# <type> is the argument type. It must be a valid C indentifer with an optional
-# array-spec which when present it must be "[number]" or "[aname]", with the
-# number being an integer and aname the name of the argument that controls the
-# array size.
-#
-# [ctr] can be empty or is an all-caps word to specify a argument constraint
-# with valid values being one of: 'IN', 'OUT', 'INOUT'
-#
-# The 'returns (<type>)' is expected unless one of the attributes is 'noreturn'.
-#
-#
-# To help the clang static analyzer identify handle related syscalls, 3
-# attributes are available to describe handle behaviors. Which are
-# handle_acquire, handle_release and handle_release_always.
-#
-#  handle_acquire        The handle will be allocated when this call is
-#                        successful.
-#
-#  handle_release        The handle will be released/destroyed when this
-#                        call is successful.
-#
-#  handle_release_always The handle will be released/destroyed; the only failure
-#                        possible is for an invalid handle.
-#
-#
-
-# Time
-
-syscall time_get
-    (clock_id: uint32_t)
-    returns (mx_time_t);
-
-syscall nanosleep blocking
-    (deadline: mx_time_t)
-    returns (mx_status_t);
-
-syscall ticks_get vdsocall
-    ()
-    returns (uint64_t);
-
-syscall ticks_per_second vdsocall const
-    ()
-    returns (uint64_t);
-
-syscall deadline_after vdsocall
-    (nanoseconds: mx_duration_t)
-    returns (mx_time_t);
-
-syscall clock_adjust
-    (handle: mx_handle_t, clock_id: uint32_t, offset: int64_t)
-    returns (mx_status_t);
-
-# Global system information
-
-syscall system_get_num_cpus vdsocall const
-    ()
-    returns (uint32_t);
-
-syscall system_get_version vdsocall
-    (version: char[version_len] OUT, version_len: uint32_t)
-    returns (mx_status_t);
-
-syscall system_get_physmem vdsocall
-    ()
-    returns (uint64_t);
-
-# Abstraction of machine operations
-
-syscall cache_flush vdsocall
-    (addr: any[len] IN, len: size_t, options: uint32_t)
-    returns (mx_status_t);
-
-# Generic handle operations
-
-syscall handle_close
-    (handle: mx_handle_t handle_release_always)
-    returns (mx_status_t);
-
-syscall handle_duplicate
-    (handle: mx_handle_t, rights: mx_rights_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall handle_replace
-    (handle: mx_handle_t handle_release, rights: mx_rights_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-# Generic object operations
-
-syscall object_wait_one blocking
-    (handle: mx_handle_t, waitfor: mx_signals_t, deadline: mx_time_t)
-    returns (mx_status_t, observed: mx_signals_t optional);
-
-syscall object_wait_many blocking
-    (items: mx_wait_item_t[count] INOUT, count: uint32_t, deadline: mx_time_t)
-    returns (mx_status_t);
-
-syscall object_wait_async
-    (handle: mx_handle_t, port_handle: mx_handle_t, key: uint64_t,
-        signals: mx_signals_t, options: uint32_t)
-    returns (mx_status_t);
-
-syscall object_signal
-    (handle: mx_handle_t, clear_mask: uint32_t, set_mask: uint32_t)
-    returns (mx_status_t);
-
-syscall object_signal_peer
-    (handle: mx_handle_t, clear_mask: uint32_t, set_mask: uint32_t)
-    returns (mx_status_t);
-
-syscall object_get_property
-    (handle: mx_handle_t, property: uint32_t, value: any[size] OUT, size: size_t)
-    returns (mx_status_t);
-
-syscall object_set_property
-    (handle: mx_handle_t, property: uint32_t, value: any[size] IN, size: size_t)
-    returns (mx_status_t);
-
-syscall object_set_cookie
-    (handle: mx_handle_t, scope: mx_handle_t, cookie: uint64_t)
-    returns (mx_status_t);
-
-syscall object_get_cookie
-    (handle: mx_handle_t, scope: mx_handle_t)
-    returns (mx_status_t, cookie: uint64_t);
-
-syscall object_get_info
-    (handle: mx_handle_t, topic: uint32_t,
-        buffer: any[buffer_size] OUT, buffer_size: size_t)
-    returns (mx_status_t, actual_count: size_t optional, avail_count: size_t optional);
-
-syscall object_get_child
-    (handle: mx_handle_t, koid: uint64_t, rights: mx_rights_t)
-    returns (mx_status_t, out: mx_handle_t);
-
-# IPC: Channels
-
-syscall channel_create
-    (options: uint32_t)
-    returns (mx_status_t, out0: mx_handle_t handle_acquire,
-        out1: mx_handle_t handle_acquire);
-
-syscall channel_read
-    (handle: mx_handle_t, options: uint32_t,
-        bytes: any[num_bytes] OUT,
-        handles: mx_handle_t[num_handles] OUT,
-        num_bytes: uint32_t,
-        num_handles: uint32_t)
-    returns (mx_status_t, actual_bytes: uint32_t optional, actual_handles: uint32_t optional);
-
-syscall channel_write
-    (handle: mx_handle_t, options: uint32_t,
-        bytes: any[num_bytes] IN, num_bytes: uint32_t,
-        handles: mx_handle_t[num_handles] IN, num_handles: uint32_t)
-    returns (mx_status_t);
-
-syscall channel_call_noretry internal
-    (handle: mx_handle_t, options: uint32_t, deadline: mx_time_t,
-        args: mx_channel_call_args_t[1] IN)
-    returns (mx_status_t, actual_bytes: uint32_t,
-                actual_handles: uint32_t, read_status: mx_status_t optional);
-
-syscall channel_call_finish internal
-    (deadline: mx_time_t, args: mx_channel_call_args_t[1] IN)
-    returns (mx_status_t, actual_bytes: uint32_t,
-                actual_handles: uint32_t, read_status: mx_status_t optional);
-
-syscall channel_call vdsocall
-    (handle: mx_handle_t, options: uint32_t, deadline: mx_time_t,
-        args: mx_channel_call_args_t[1] IN)
-    returns (mx_status_t, actual_bytes: uint32_t,
-                actual_handles: uint32_t, read_status: mx_status_t optional);
-
-# IPC: Sockets
-
-syscall socket_create
-    (options: uint32_t)
-    returns (mx_status_t, out0: mx_handle_t handle_acquire,
-        out1: mx_handle_t handle_acquire);
-
-syscall socket_write
-    (handle: mx_handle_t, options: uint32_t,
-        buffer: any[size] IN, size: size_t)
-    returns (mx_status_t, actual: size_t optional);
-
-syscall socket_read
-    (handle: mx_handle_t, options: uint32_t,
-        buffer: any[size] OUT, size: size_t)
-    returns (mx_status_t, actual: size_t optional);
-
-# Threads
-
-syscall thread_exit noreturn ();
-
-syscall thread_create
-    (process: mx_handle_t, name: char[name_len] IN, name_len: uint32_t,
-        options: uint32_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall thread_start
-    (handle: mx_handle_t, thread_entry: uintptr_t,
-        stack: uintptr_t, arg1: uintptr_t, arg2: uintptr_t)
-    returns (mx_status_t);
-
-syscall thread_read_state
-    (handle: mx_handle_t, kind: uint32_t,
-        buffer: any[len] OUT, len: uint32_t)
-    returns (mx_status_t, actual: uint32_t);
-
-syscall thread_write_state
-    (handle: mx_handle_t, kind: uint32_t, buffer: any[buffer_len] IN, buffer_len: uint32_t)
-    returns (mx_status_t);
-
-# NOTE: thread_set_priority is an experimental syscall.
-# Do not use it.  It is going away very soon.  Just don't do it.  This is not
-# the syscall you are looking for.  See MG-940
-syscall thread_set_priority
-    (prio: int32_t)
-    returns (mx_status_t);
-
-# Processes
-
-syscall process_exit noreturn
-    (retcode: int);
-
-syscall process_create
-    (job: mx_handle_t, name: char[name_len] IN, name_len: uint32_t, options: uint32_t)
-    returns (mx_status_t, proc_handle: mx_handle_t handle_acquire,
-        vmar_handle: mx_handle_t handle_acquire);
-
-syscall process_start
-    (process_handle: mx_handle_t,
-        thread_handle: mx_handle_t, entry: uintptr_t,
-        stack: uintptr_t, arg_handle: mx_handle_t handle_release, arg2: uintptr_t)
-    returns (mx_status_t);
-
-syscall process_read_memory
-    (proc: mx_handle_t, vaddr: uintptr_t,
-    buffer: any[len] OUT, len: size_t)
-    returns (mx_status_t, actual: size_t);
-
-syscall process_write_memory
-    (proc: mx_handle_t, vaddr: uintptr_t,
-    buffer: any[len] IN, len: size_t)
-    returns (mx_status_t, actual: size_t);
-
-# Jobs
-
-syscall job_create
-    (parent_job: mx_handle_t, options: uint32_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall job_set_policy
-    (job: mx_handle_t, options: uint32_t, topic: uint32_t, policy: any[count] IN, count: uint32_t)
-    returns (mx_status_t);
-
-# Shared between process and threads
-syscall task_bind_exception_port
-    (object: mx_handle_t, eport: mx_handle_t, key: uint64_t, options: uint32_t)
-    returns (mx_status_t);
-
-syscall task_suspend
-    (task_handle: mx_handle_t)
-    returns (mx_status_t);
-
-syscall task_resume
-    (task_handle: mx_handle_t, options: uint32_t)
-    returns (mx_status_t);
-
-syscall task_kill
-    (task_handle: mx_handle_t)
-    returns (mx_status_t);
-
-# Synchronization
-
-syscall event_create
-    (options: uint32_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall eventpair_create
-    (options: uint32_t)
-    returns (mx_status_t,
-        out0: mx_handle_t handle_acquire, out1: mx_handle_t handle_acquire);
-
-syscall futex_wait blocking
-    (value_ptr: mx_futex_t[1] INOUT, current_value: int, deadline: mx_time_t)
-    returns (mx_status_t);
-
-syscall futex_wake
-    (value_ptr: mx_futex_t[1] IN, count: uint32_t)
-    returns (mx_status_t);
-
-syscall futex_requeue
-    (wake_ptr: mx_futex_t[1] INOUT, wake_count: uint32_t, current_value: int,
-        requeue_ptr: mx_futex_t[1] INOUT, requeue_count: uint32_t)
-    returns (mx_status_t);
-
-# Ports
-
-syscall port_create
-    (options: uint32_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall port_queue
-    (handle: mx_handle_t, packet: any[size] IN, size: size_t)
-    returns (mx_status_t);
-
-syscall port_wait blocking
-    (handle: mx_handle_t, deadline: mx_time_t, packet: any[size] OUT, size: size_t)
-    returns (mx_status_t);
-
-syscall port_cancel
-    (handle: mx_handle_t, source: mx_handle_t, key: uint64_t)
-    returns (mx_status_t);
-
-# Timers
-
-syscall timer_create
-    (options: uint32_t, clock_id: uint32_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall timer_set
-    (handle: mx_handle_t, deadline: mx_time_t, slack: mx_duration_t)
-    returns (mx_status_t);
-
-syscall timer_cancel
-    (handle: mx_handle_t)
-    returns (mx_status_t);
-
-# Memory management
-
-syscall vmo_create
-    (size: uint64_t, options: uint32_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall vmo_read
-    (handle: mx_handle_t, data: any[len] OUT, offset: uint64_t, len: size_t)
-    returns (mx_status_t, actual: size_t);
-
-syscall vmo_write
-    (handle: mx_handle_t, data: any[len] IN, offset: uint64_t, len: size_t)
-    returns (mx_status_t, actual: size_t);
-
-syscall vmo_get_size
-    (handle: mx_handle_t)
-    returns (mx_status_t, size: uint64_t);
-
-syscall vmo_set_size
-    (handle: mx_handle_t, size: uint64_t)
-    returns (mx_status_t);
-
-syscall vmo_op_range
-    (handle: mx_handle_t, op: uint32_t, offset: uint64_t, size: uint64_t,
-        buffer: any[buffer_size] INOUT, buffer_size: size_t)
-    returns (mx_status_t);
-
-syscall vmo_clone
-    (handle: mx_handle_t, options: uint32_t, offset: uint64_t, size: uint64_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall vmo_set_cache_policy
-    (handle: mx_handle_t, cache_policy: uint32_t)
-    returns (mx_status_t);
-
-# Address space management
-
-syscall vmar_allocate
-    (parent_vmar_handle: mx_handle_t, offset: size_t, size: size_t, map_flags: uint32_t)
-    returns (mx_status_t,
-        child_vmar: mx_handle_t handle_acquire, child_addr: uintptr_t);
-
-syscall vmar_destroy
-    (vmar_handle: mx_handle_t)
-    returns (mx_status_t);
-
-syscall vmar_map
-    (vmar_handle: mx_handle_t, vmar_offset: size_t,
-        vmo_handle: mx_handle_t, vmo_offset: uint64_t,
-        len: size_t, map_flags: uint32_t)
-    returns (mx_status_t, mapped_addr: uintptr_t);
-
-syscall vmar_unmap
-    (vmar_handle: mx_handle_t, addr: uintptr_t, len: size_t)
-    returns (mx_status_t);
-
-syscall vmar_protect
-    (vmar_handle: mx_handle_t, addr: uintptr_t, len: size_t,
-        prot_flags: uint32_t)
-    returns (mx_status_t);
-
-# Random Number generator
-
-syscall cprng_draw
-    (buffer: any[len] OUT, len: size_t)
-    returns (mx_status_t, actual: size_t);
-
-syscall cprng_add_entropy
-    (buffer: any[len] IN, len: size_t)
-    returns (mx_status_t);
-
-# Fifo
-
-syscall fifo_create
-    (elem_count: uint32_t, elem_size: uint32_t, options: uint32_t)
-    returns (mx_status_t,
-        out0: mx_handle_t handle_acquire, out1: mx_handle_t handle_acquire);
-
-syscall fifo_read
-    (handle: mx_handle_t, data: any[len] OUT, len: size_t)
-    returns (mx_status_t, num_written: uint32_t);
-
-syscall fifo_write
-    (handle: mx_handle_t, data: any[len] IN, len: size_t)
-    returns (mx_status_t, num_written: uint32_t);
-
-# Multi-function
-
-syscall vmar_unmap_handle_close_thread_exit vdsocall
-    (vmar_handle: mx_handle_t, addr: uintptr_t, len: size_t,
-        handle: mx_handle_t handle_release)
-    returns (mx_status_t);
-
-syscall futex_wake_handle_close_thread_exit vdsocall noreturn
-    (value_ptr: mx_futex_t[1] IN, count: uint32_t, new_value: int,
-        handle: mx_handle_t handle_release);
-
-# ---------------------------------------------------------------------------------------
-# Syscalls past this point are non-public
-# Some currently do not require a handle to restrict access.
-# Those will be modified or removed.
-# These syscalls are *not* a stable API/ABI surface.
-# ---------------------------------------------------------------------------------------
-
-# Logging
-
-syscall log_create
-    (options: uint32_t)
-    returns (mx_status_t, out: mx_handle_t);
-
-syscall log_write
-    (handle: mx_handle_t, len: uint32_t, buffer: any[len] IN, options: uint32_t)
-    returns (mx_status_t);
-
-syscall log_read
-    (handle: mx_handle_t, len: uint32_t, buffer: any[len] OUT, options: uint32_t)
-    returns (mx_status_t);
-
-
-syscall debuglog_create
-    (resource: mx_handle_t, options: uint32_t)
-    returns (mx_status_t, out: mx_handle_t);
-
-syscall debuglog_write
-    (handle: mx_handle_t, options: uint32_t, buffer: any[len] IN, len: size_t)
-    returns (mx_status_t);
-
-syscall debuglog_read
-    (handle: mx_handle_t, options: uint32_t, buffer: any[len] OUT, len: size_t)
-    returns (mx_status_t);
-
-# Tracing
-
-syscall ktrace_read
-    (handle: mx_handle_t, data: any[len] OUT, offset: uint32_t,
-        len: uint32_t)
-    returns (mx_status_t, actual: uint32_t);
-
-syscall ktrace_control
-    (handle: mx_handle_t, action: uint32_t, options: uint32_t, ptr: any[action] INOUT)
-    returns (mx_status_t);
-
-syscall ktrace_write
-    (handle: mx_handle_t, id: uint32_t, arg0: uint32_t, arg1: uint32_t)
-    returns (mx_status_t);
-
-syscall mtrace_control
-    (handle: mx_handle_t,
-        kind: uint32_t, action: uint32_t, options: uint32_t,
-        ptr: any[size] INOUT, size: uint32_t)
-    returns (mx_status_t);
-
-# Legacy LK debug syscalls
-
-syscall debug_read
-    (handle: mx_handle_t, buffer: any[length] OUT, length: uint32_t)
-    returns (mx_status_t);
-
-syscall debug_write
-    (buffer: any[length] IN, length: uint32_t)
-    returns (mx_status_t);
-
-syscall debug_send_command
-    (resource_handle: mx_handle_t, buffer: any[length] IN, length: uint32_t)
-    returns (mx_status_t);
-
-# DDK Syscalls: Interrupts
-
-syscall interrupt_create
-    (handle: mx_handle_t, vector: uint32_t, options: uint32_t)
-    returns (mx_status_t, out_handle: mx_handle_t);
-
-syscall interrupt_complete
-    (handle: mx_handle_t)
-    returns (mx_status_t);
-
-syscall interrupt_wait blocking
-    (handle: mx_handle_t)
-    returns (mx_status_t);
-
-syscall interrupt_signal
-    (handle: mx_handle_t)
-    returns (mx_status_t);
-
-# DDK Syscalls: MMIO and Ports
-
-syscall mmap_device_io
-    (handle: mx_handle_t, io_addr: uint32_t, len: uint32_t)
-    returns (mx_status_t);
-
-syscall vmo_create_contiguous
-    (rsrc_handle: mx_handle_t, size: size_t, alignment_log2: uint32_t)
-    returns (mx_status_t, out: mx_handle_t);
-
-syscall vmo_create_physical
-    (rsrc_handle: mx_handle_t, paddr: mx_paddr_t, size: size_t)
-    returns (mx_status_t, out: mx_handle_t);
-
-# DDK Syscalls: Misc Info
-
-syscall bootloader_fb_get_info
-    ()
-    returns (mx_status_t, format: uint32_t, width: uint32_t, height: uint32_t, stride: uint32_t);
-
-syscall set_framebuffer
-    (handle: mx_handle_t, vaddr: any[1] INOUT, len: uint32_t, format: uint32_t,
-        width: uint32_t, height: uint32_t, stride: uint32_t)
-    returns (mx_status_t);
-
-syscall set_framebuffer_vmo
-    (handle: mx_handle_t, vmo: mx_handle_t, len: uint32_t, format: uint32_t,
-        width: uint32_t, height: uint32_t, stride: uint32_t)
-    returns (mx_status_t);
-
-# DDK Syscalls: PCI
-
-syscall pci_get_nth_device
-    (handle: mx_handle_t, index: uint32_t)
-    returns (mx_status_t, out_info: mx_pcie_device_info_t, out_handle: mx_handle_t);
-
-syscall pci_enable_bus_master
-    (handle: mx_handle_t, enable: bool)
-    returns (mx_status_t);
-
-syscall pci_enable_pio
-    (handle: mx_handle_t, enable: bool)
-    returns (mx_status_t);
-
-syscall pci_reset_device
-    (handle: mx_handle_t)
-    returns (mx_status_t);
-
-syscall pci_cfg_pio_rw
-    (handle: mx_handle_t, bus: uint8_t, dev: uint8_t, func: uint8_t, offset: uint8_t,
-        val: uint32_t[1] OUT, width: size_t, write: bool)
-    returns (mx_status_t);
-
-syscall pci_get_bar
-    (handle: mx_handle_t, bar_num: uint32_t, out_bar: mx_pci_resource_t[1] OUT)
-    returns (mx_status_t);
-
-syscall pci_get_config
-    (handle: mx_handle_t, out_config: mx_pci_resource_t[1] OUT)
-    returns (mx_status_t);
-
-syscall pci_io_write
-    (handle: mx_handle_t, bar_num: uint32_t, offset: uint32_t, len: uint32_t, value: uint32_t)
-    returns (mx_status_t);
-
-syscall pci_io_read
-    (handle: mx_handle_t, bar_num: uint32_t,
-        offset: uint32_t, len: uint32_t)
-    returns (mx_status_t, out_value: uint32_t);
-
-syscall pci_map_interrupt
-    (handle: mx_handle_t, which_irq: int32_t)
-    returns (mx_status_t, out_handle: mx_handle_t);
-
-syscall pci_query_irq_mode_caps
-    (handle: mx_handle_t, mode: uint32_t)
-    returns (mx_status_t, out_max_irqs: uint32_t);
-
-syscall pci_set_irq_mode
-    (handle: mx_handle_t, mode: uint32_t, requested_irq_count: uint32_t)
-    returns (mx_status_t);
-
-syscall pci_init
-    (handle: mx_handle_t, init_buf: mx_pci_init_arg_t[len] IN, len: uint32_t)
-    returns (mx_status_t);
-
-syscall pci_add_subtract_io_range
-    (handle: mx_handle_t, mmio: bool, base: uint64_t, len: uint64_t, add: bool)
-    returns (mx_status_t);
-
-# DDK Syscalls: ACPI Glue
-
-syscall acpi_uefi_rsdp
-    (handle: mx_handle_t)
-    returns (uint64_t);
-
-syscall acpi_cache_flush
-    (handle: mx_handle_t)
-    returns (mx_status_t);
-
-# Resources
-
-syscall resource_create
-    (parent_handle: mx_handle_t, kind: uint32_t, low: uint64_t, high: uint64_t)
-    returns (mx_status_t, resource_out: mx_handle_t);
-
-# Hypervisor
-
-syscall guest_create
-    (resource: mx_handle_t, options: uint32_t, physmem_vmo: mx_handle_t)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall guest_set_trap
-    (guest: mx_handle_t, kind: uint32_t, addr: mx_vaddr_t, len: size_t, port: mx_handle_t,
-        key: uint64_t)
-    returns (mx_status_t);
-
-syscall vcpu_create
-    (guest: mx_handle_t, options: uint32_t, args: mx_vcpu_create_args_t[1] IN)
-    returns (mx_status_t, out: mx_handle_t handle_acquire);
-
-syscall vcpu_resume
-    (vcpu: mx_handle_t)
-    returns (mx_status_t, packet: mx_port_packet_t OUT);
-
-syscall vcpu_interrupt
-    (vcpu: mx_handle_t, vector: uint32_t)
-    returns (mx_status_t);
-
-syscall vcpu_read_state
-    (vcpu: mx_handle_t, kind: uint32_t, buffer: any[len] OUT, len: uint32_t)
-    returns (mx_status_t);
-
-syscall vcpu_write_state
-    (vcpu: mx_handle_t, kind: uint32_t, buffer: any[len] IN, len: uint32_t)
-    returns (mx_status_t);
-
-# System Control
-
-syscall system_mexec
-   (kernel: mx_handle_t, bootimage: mx_handle_t, cmdline: char[cmdline_len] IN, cmdline_len: uint32_t)
-   returns (mx_status_t);
-
-# Internal-only task syscalls
-
-syscall job_set_relative_importance
-    (root_resource: mx_handle_t,
-        job: mx_handle_t, less_important_job: mx_handle_t)
-    returns (mx_status_t);
-
-# Test syscalls (keep at the end)
-
-syscall syscall_test_0() returns (mx_status_t);
-syscall syscall_test_1 test_category1 (a:int) returns (mx_status_t);
-syscall syscall_test_2 test_category1 (a:int, b:int) returns (mx_status_t);
-syscall syscall_test_3 test_category2 (a:int, b:int, c:int) returns (mx_status_t);
-syscall syscall_test_4(a:int, b:int, c:int, d:int) returns (mx_status_t);
-syscall syscall_test_5(a:int, b:int, c:int, d:int, e:int) returns (mx_status_t);
-syscall syscall_test_6(a:int, b:int, c:int, d:int, e:int, f:int) returns (mx_status_t);
-syscall syscall_test_7(a:int, b:int, c:int, d:int, e:int, f:int, g:int) returns (mx_status_t);
-syscall syscall_test_8(a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int) returns (mx_status_t);
-syscall syscall_test_wrapper(a:int, b:int, c:int) returns (mx_status_t);
diff --git a/system/public/magenta/syscalls/debug.h b/system/public/magenta/syscalls/debug.h
deleted file mode 100644
index 99d086c..0000000
--- a/system/public/magenta/syscalls/debug.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/compiler.h>
-#include <stdint.h>
-
-__BEGIN_CDECLS
-
-// The format of data for r/w of x86_64 general regs.
-// By convention this is MX_THREAD_STATE_REGSET0.
-
-typedef struct mx_x86_64_general_regs {
-    uint64_t rax;
-    uint64_t rbx;
-    uint64_t rcx;
-    uint64_t rdx;
-    uint64_t rsi;
-    uint64_t rdi;
-    uint64_t rbp;
-    uint64_t rsp;
-    uint64_t r8;
-    uint64_t r9;
-    uint64_t r10;
-    uint64_t r11;
-    uint64_t r12;
-    uint64_t r13;
-    uint64_t r14;
-    uint64_t r15;
-    uint64_t rip;
-    uint64_t rflags;
-} mx_x86_64_general_regs_t;
-
-// The format of data for r/w of arm64 general regs.
-// By convention this is MX_THREAD_STATE_REGSET0.
-
-typedef struct mx_arm64_general_regs {
-    uint64_t r[30];
-    uint64_t lr;
-    uint64_t sp;
-    uint64_t pc;
-    uint64_t cpsr;
-} mx_arm64_general_regs_t;
-
-// mx_thread_read_state, mx_thread_write_state
-// The maximum size of thread state, in bytes, that can be processed by the
-// read_state/write_state syscalls. It exists so code can expect a sane limit
-// on the amount of memory needed to process the request.
-#define MX_MAX_THREAD_STATE_SIZE 4096u
-
-// The "general regs" are by convention in regset 0.
-#define MX_THREAD_STATE_REGSET0 0u
-#define MX_THREAD_STATE_REGSET1 1u
-#define MX_THREAD_STATE_REGSET2 2u
-#define MX_THREAD_STATE_REGSET3 3u
-#define MX_THREAD_STATE_REGSET4 4u
-#define MX_THREAD_STATE_REGSET5 5u
-#define MX_THREAD_STATE_REGSET6 6u
-#define MX_THREAD_STATE_REGSET7 7u
-#define MX_THREAD_STATE_REGSET8 8u
-#define MX_THREAD_STATE_REGSET9 9u
-
-__END_CDECLS
diff --git a/system/public/magenta/syscalls/exception.h b/system/public/magenta/syscalls/exception.h
deleted file mode 100644
index b5261ab..0000000
--- a/system/public/magenta/syscalls/exception.h
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-#include <magenta/syscalls/port.h>
-
-__BEGIN_CDECLS
-
-// ask clang format not to mess up the indentation:
-// clang-format off
-
-// This bit is set for synthetic exceptions to distinguish them from
-// architectural exceptions.
-// Note: Port packet types provide 8 bits to distinguish the exception type.
-// See magenta/port.h.
-#define MX_EXCP_SYNTH 0x80
-
-// The kind of an exception.
-// Exception types are a subset of port packet types. See magenta/port.h.
-typedef enum {
-    // These are architectural exceptions.
-    // Depending on the exception, further information can be found in
-    // |report.context.arch|.
-
-    // General exception not covered by another value.
-    MX_EXCP_GENERAL = MX_PKT_TYPE_EXCEPTION(0),
-    MX_EXCP_FATAL_PAGE_FAULT = MX_PKT_TYPE_EXCEPTION(1),
-    MX_EXCP_UNDEFINED_INSTRUCTION = MX_PKT_TYPE_EXCEPTION(2),
-    MX_EXCP_SW_BREAKPOINT = MX_PKT_TYPE_EXCEPTION(3),
-    MX_EXCP_HW_BREAKPOINT = MX_PKT_TYPE_EXCEPTION(4),
-    MX_EXCP_UNALIGNED_ACCESS = MX_PKT_TYPE_EXCEPTION(5),
-
-    // Synthetic exceptions.
-
-    // A thread is starting.
-    // This exception is sent to debuggers only (MX_EXCEPTION_PORT_DEBUGGER).
-    // The thread is paused until it is resumed by the debugger
-    // with mx_task_resume.
-    MX_EXCP_THREAD_STARTING = MX_PKT_TYPE_EXCEPTION(MX_EXCP_SYNTH | 0),
-
-    // A thread has suspended.
-    // This exception is sent to debuggers only (MX_EXCEPTION_PORT_DEBUGGER).
-    // The thread is paused until it is resumed by the debugger
-    // with mx_task_resume. This resume is different though: it's not resuming
-    // from an exception, so don't pass MX_RESUME_EXCEPTION, pass 0.
-    // A note on the word tense here: This is named "suspended" and not
-    // "suspending" because the thread has completely suspended at this point.
-    // N.B. This notification is not replied to.
-    MX_EXCP_THREAD_SUSPENDED = MX_PKT_TYPE_EXCEPTION(MX_EXCP_SYNTH | 1),
-
-    // A thread has resumed after being suspended.
-    // This exception is sent to debuggers only (MX_EXCEPTION_PORT_DEBUGGER).
-    // This is the counterpart to MX_EXCP_THREAD_SUSPENDED.
-    // A note on the word tense here: This is named "resumed" and not
-    // "resuming" because the thread has completely resumed at this point.
-    // N.B. This notification is not replied to.
-    MX_EXCP_THREAD_RESUMED = MX_PKT_TYPE_EXCEPTION(MX_EXCP_SYNTH | 2),
-
-    // A thread is exiting.
-    // This exception is sent to debuggers only (MX_EXCEPTION_PORT_DEBUGGER).
-    // This exception is different from MX_EXCP_GONE in that a debugger can
-    // still examine thread state.
-    // The thread is paused until it is resumed by the debugger
-    // with mx_task_resume.
-    MX_EXCP_THREAD_EXITING = MX_PKT_TYPE_EXCEPTION(MX_EXCP_SYNTH | 3),
-
-    // A thread or process has exited or otherwise terminated.
-    // At this point thread/process state is no longer available.
-    // Process gone notifications are only sent to the process exception port
-    // or debugger exception port (if one is registered).
-    // Thread gone notifications are only sent to the thread exception port
-    // (if one is registered).
-    // N.B. This notification is not replied to.
-    MX_EXCP_GONE = MX_PKT_TYPE_EXCEPTION(MX_EXCP_SYNTH | 4),
-
-    // This exception is generated when a syscall fails with a job policy
-    // error (for example, an invalid handle argument is passed to the
-    // syscall when the MX_POL_BAD_HANDLE policy is enabled) and
-    // MX_POL_ACTION_EXCEPTION is set for the policy.  The thread that
-    // invoked the syscall may be resumed with mx_task_resume().
-    MX_EXCP_POLICY_ERROR = MX_PKT_TYPE_EXCEPTION(MX_EXCP_SYNTH | 5),
-} mx_excp_type_t;
-
-// Assuming |excp| is an exception type, return non-zero if it is an
-// architectural exception.
-#define MX_EXCP_IS_ARCH(excp) \
-  (((excp) & (MX_PKT_TYPE_EXCEPTION(MX_EXCP_SYNTH) & ~MX_PKT_TYPE_MASK)) == 0)
-
-typedef struct x86_64_exc_data {
-    uint64_t vector;
-    uint64_t err_code;
-    uint64_t cr2;
-} x86_64_exc_data_t;
-
-typedef struct arm64_exc_data {
-    uint32_t esr;
-    uint64_t far;
-} arm64_exc_data_t;
-
-// data associated with an exception (siginfo in linux parlance)
-// Things available from regsets (e.g., pc) are not included here.
-// For an example list of things one might add, see linux siginfo.
-typedef struct mx_exception_context {
-    struct {
-        union {
-            x86_64_exc_data_t x86_64;
-            arm64_exc_data_t  arm_64;
-        } u;
-    } arch;
-} mx_exception_context_t;
-
-// The common header of all exception reports.
-typedef struct mx_exception_header {
-    // The actual size, in bytes, of the report (including this field).
-    uint32_t size;
-
-    // While IWBN to use an enum here, it's still not portable in C.
-    uint32_t /*mx_excp_type_t*/ type;
-} mx_exception_header_t;
-
-// Data reported to an exception handler for most exceptions.
-typedef struct mx_exception_report {
-    mx_exception_header_t header;
-    // The remainder of the report is exception-specific.
-    mx_exception_context_t context;
-} mx_exception_report_t;
-
-// Options for mx_task_resume()
-#define MX_RESUME_EXCEPTION (1)
-// Indicates that we should resume the thread from stopped-in-exception state
-// (default resume does not do so)
-
-#define MX_RESUME_TRY_NEXT (2)
-// Only meaningful when combined with MX_RESUME_EXCEPTION
-// Indicates that instead of resuming from the faulting instruction we instead
-// let the next exception handler in the search order, if any, process the
-// exception. If there are no more then the entire process is killed.
-
-// Options for mx_task_bind_exception_port.
-#define MX_EXCEPTION_PORT_DEBUGGER (1)
-// When binding an exception port to a process, set the process's debugger
-// exception port.
-#define MX_EXCEPTION_PORT_UNBIND_QUIETLY (2)
-// When unbinding an exception port from a thread or process, any threads that
-// got an exception and are waiting for a response from this exception port
-// will continue to wait for a response.
-
-// The type of exception port a thread may be waiting for a response from.
-// These values are reported in mx_info_thread_t.wait_exception_port_type.
-#define MX_EXCEPTION_PORT_TYPE_NONE     (0u)
-#define MX_EXCEPTION_PORT_TYPE_DEBUGGER (1u)
-#define MX_EXCEPTION_PORT_TYPE_THREAD   (2u)
-#define MX_EXCEPTION_PORT_TYPE_PROCESS  (3u)
-#define MX_EXCEPTION_PORT_TYPE_JOB      (4u)
-#define MX_EXCEPTION_PORT_TYPE_SYSTEM   (5u)
-
-__END_CDECLS
diff --git a/system/public/magenta/syscalls/log.h b/system/public/magenta/syscalls/log.h
deleted file mode 100644
index c23e0f3..0000000
--- a/system/public/magenta/syscalls/log.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-
-// ask clang format not to mess up the indentation:
-// clang-format off
-
-__BEGIN_CDECLS
-
-// Defines and structures for mx_log_*()
-typedef struct mx_log_record {
-    uint32_t reserved;
-    uint16_t datalen;
-    uint16_t flags;
-    mx_time_t timestamp;
-    uint64_t pid;
-    uint64_t tid;
-    char data[0];
-} mx_log_record_t;
-
-#define MX_LOG_RECORD_MAX     256
-
-// Common Log Levels
-#define MX_LOG_ERROR          (0x0001)
-#define MX_LOG_INFO           (0x0002)
-#define MX_LOG_TRACE          (0x0004)
-#define MX_LOG_SPEW           (0x0008)
-
-// Custom Log Levels
-#define MX_LOG_DEBUG1         (0x0010)
-#define MX_LOG_DEBUG2         (0x0020)
-#define MX_LOG_DEBUG3         (0x0030)
-#define MX_LOG_DEBUG4         (0x0040)
-
-// Filter Flags
-
-// Do not forward this message via network
-// (for logging in network core and drivers)
-#define MX_LOG_LOCAL          (0x1000)
-
-#define MX_LOG_LEVEL_MASK     (0x00FF)
-#define MX_LOG_FLAGS_MASK     (0xFFFF)
-
-// Options
-
-#define MX_LOG_FLAG_READABLE  0x40000000
-
-__END_CDECLS
diff --git a/system/public/magenta/syscalls/object.h b/system/public/magenta/syscalls/object.h
deleted file mode 100644
index e3a1087..0000000
--- a/system/public/magenta/syscalls/object.h
+++ /dev/null
@@ -1,397 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-
-__BEGIN_CDECLS
-
-// ask clang format not to mess up the indentation:
-// clang-format off
-
-// Valid topics for mx_object_get_info.
-typedef enum {
-    MX_INFO_NONE                       = 0,
-    MX_INFO_HANDLE_VALID               = 1,
-    MX_INFO_HANDLE_BASIC               = 2,  // mx_info_handle_basic_t[1]
-    MX_INFO_PROCESS                    = 3,  // mx_info_process_t[1]
-    MX_INFO_PROCESS_THREADS            = 4,  // mx_koid_t[n]
-    MX_INFO_VMAR                       = 7,  // mx_info_vmar_t[1]
-    MX_INFO_JOB_CHILDREN               = 8,  // mx_koid_t[n]
-    MX_INFO_JOB_PROCESSES              = 9,  // mx_koid_t[n]
-    MX_INFO_THREAD                     = 10, // mx_info_thread_t[1]
-    MX_INFO_THREAD_EXCEPTION_REPORT    = 11, // mx_exception_report_t[1]
-    MX_INFO_TASK_STATS                 = 12, // mx_info_task_stats_t[1]
-    MX_INFO_PROCESS_MAPS               = 13, // mx_info_maps_t[n]
-    MX_INFO_PROCESS_VMOS               = 14, // mx_info_vmo_t[n]
-    MX_INFO_THREAD_STATS               = 15, // mx_info_thread_stats_t[1]
-    MX_INFO_CPU_STATS                  = 16, // mx_info_cpu_stats_t[n]
-    MX_INFO_KMEM_STATS                 = 17, // mx_info_kmem_stats_t[1]
-    MX_INFO_RESOURCE                   = 18, // mx_info_resource_t[1]
-    MX_INFO_LAST
-} mx_object_info_topic_t;
-
-typedef enum {
-    MX_OBJ_TYPE_NONE                = 0,
-    MX_OBJ_TYPE_PROCESS             = 1,
-    MX_OBJ_TYPE_THREAD              = 2,
-    MX_OBJ_TYPE_VMO                 = 3,
-    MX_OBJ_TYPE_CHANNEL             = 4,
-    MX_OBJ_TYPE_EVENT               = 5,
-    MX_OBJ_TYPE_PORT                = 6,
-    MX_OBJ_TYPE_INTERRUPT           = 9,
-    MX_OBJ_TYPE_PCI_DEVICE          = 11,
-    MX_OBJ_TYPE_LOG                 = 12,
-    MX_OBJ_TYPE_SOCKET              = 14,
-    MX_OBJ_TYPE_RESOURCE            = 15,
-    MX_OBJ_TYPE_EVENT_PAIR          = 16,
-    MX_OBJ_TYPE_JOB                 = 17,
-    MX_OBJ_TYPE_VMAR                = 18,
-    MX_OBJ_TYPE_FIFO                = 19,
-    MX_OBJ_TYPE_GUEST               = 20,
-    MX_OBJ_TYPE_VCPU                = 21,
-    MX_OBJ_TYPE_TIMER               = 22,
-    MX_OBJ_TYPE_LAST
-} mx_obj_type_t;
-
-typedef enum {
-    MX_OBJ_PROP_NONE            = 0,
-    MX_OBJ_PROP_WAITABLE        = 1,
-} mx_obj_props_t;
-
-typedef struct mx_info_handle_basic {
-    // The unique id assigned by kernel to the object referenced by the
-    // handle.
-    mx_koid_t koid;
-
-    // The immutable rights assigned to the handle. Two handles that
-    // have the same koid and the same rights are equivalent and
-    // interchangeable.
-    mx_rights_t rights;
-
-    // The object type: channel, event, socket, etc.
-    uint32_t type;                // mx_obj_type_t;
-
-    // The koid of the logical counterpart or parent object of the
-    // object referenced by the handle. Otherwise this value is zero.
-    mx_koid_t related_koid;
-
-    // Set to MX_OBJ_PROP_WAITABLE if the object referenced by the
-    // handle can be waited on; zero otherwise.
-    uint32_t props;               // mx_obj_props_t;
-} mx_info_handle_basic_t;
-
-typedef struct mx_info_process {
-    // The process's return code; only valid if |exited| is true.
-    // Guaranteed to be non-zero if the process was killed by |mx_task_kill|.
-    int return_code;
-
-    // True if the process has ever left the initial creation state,
-    // even if it has exited as well.
-    bool started;
-
-    // If true, the process has exited and |return_code| is valid.
-    bool exited;
-
-    // True if a debugger is attached to the process.
-    bool debugger_attached;
-} mx_info_process_t;
-
-typedef struct mx_info_thread {
-    // One of MX_THREAD_STATE_* values.
-    uint32_t state;
-
-    // If nonzero, the thread has gotten an exception and is waiting for
-    // the exception to be handled by the specified port.
-    // The value is one of MX_EXCEPTION_PORT_TYPE_*.
-    // Note: If the thread is waiting for an exception response then |state|
-    // will have the value MX_THREAD_STATE_BLOCKED.
-    uint32_t wait_exception_port_type;
-} mx_info_thread_t;
-
-typedef struct mx_info_thread_stats {
-    // Total accumulated running time of the thread.
-    mx_time_t total_runtime;
-} mx_info_thread_stats_t;
-
-// Statistics about resources (e.g., memory) used by a task. Can be relatively
-// expensive to gather.
-typedef struct mx_info_task_stats {
-    // The total size of mapped memory ranges in the task.
-    // Not all will be backed by physical memory.
-    size_t mem_mapped_bytes;
-
-    // For the fields below, a byte is considered committed if it's backed by
-    // physical memory. Some of the memory may be double-mapped, and thus
-    // double-counted.
-
-    // Committed memory that is only mapped into this task.
-    size_t mem_private_bytes;
-
-    // Committed memory that is mapped into this and at least one other task.
-    size_t mem_shared_bytes;
-
-    // A number that estimates the fraction of mem_shared_bytes that this
-    // task is responsible for keeping alive.
-    //
-    // An estimate of:
-    //   For each shared, committed byte:
-    //   mem_scaled_shared_bytes += 1 / (number of tasks mapping this byte)
-    //
-    // This number is strictly smaller than mem_shared_bytes.
-    size_t mem_scaled_shared_bytes;
-} mx_info_task_stats_t;
-
-typedef struct mx_info_vmar {
-    // Base address of the region.
-    uintptr_t base;
-
-    // Length of the region, in bytes.
-    size_t len;
-} mx_info_vmar_t;
-
-
-// Types and values used by MX_INFO_PROCESS_MAPS.
-
-// Describes a VM mapping.
-typedef struct mx_info_maps_mapping {
-    // MMU flags for the mapping.
-    // Bitwise OR of MX_VM_FLAG_PERM_{READ,WRITE,EXECUTE} values.
-    uint32_t mmu_flags;
-    // koid of the mapped VMO.
-    mx_koid_t vmo_koid;
-    // The number of PAGE_SIZE pages in the mapped region of the VMO
-    // that are backed by physical memory.
-    size_t committed_pages;
-} mx_info_maps_mapping_t;
-
-// Types of entries represented by mx_info_maps_t.
-// Can't use mx_obj_type_t because not all of these are
-// user-visible kernel object types.
-typedef enum mx_info_maps_type {
-    MX_INFO_MAPS_TYPE_NONE    = 0,
-    MX_INFO_MAPS_TYPE_ASPACE  = 1,
-    MX_INFO_MAPS_TYPE_VMAR    = 2,
-    MX_INFO_MAPS_TYPE_MAPPING = 3,
-    MX_INFO_MAPS_TYPE_LAST
-} mx_info_maps_type_t;
-
-// Describes a node in the aspace/vmar/mapping hierarchy for a user process.
-typedef struct mx_info_maps {
-    // Name if available; empty string otherwise.
-    char name[MX_MAX_NAME_LEN];
-    // Base address.
-    mx_vaddr_t base;
-    // Size in bytes.
-    size_t size;
-
-    // The depth of this node in the tree.
-    // Can be used for indentation, or to rebuild the tree from an array
-    // of mx_info_maps_t entries, which will be in depth-first pre-order.
-    size_t depth;
-    // The type of this entry; indicates which union entry is valid.
-    uint32_t type; // mx_info_maps_type_t
-    union {
-        mx_info_maps_mapping_t mapping;
-        // No additional fields for other types.
-    } u;
-} mx_info_maps_t;
-
-
-// Values and types used by MX_INFO_PROCESS_VMOS.
-
-// The VMO is backed by RAM, consuming memory.
-// Mutually exclusive with MX_INFO_VMO_TYPE_PHYSICAL.
-// See MX_INFO_VMO_TYPE(flags)
-#define MX_INFO_VMO_TYPE_PAGED              (1u<<0)
-
-// The VMO points to a physical address range, and does not consume memory.
-// Typically used to access memory-mapped hardware.
-// Mutually exclusive with MX_INFO_VMO_TYPE_PAGED.
-// See MX_INFO_VMO_TYPE(flags)
-#define MX_INFO_VMO_TYPE_PHYSICAL           (0u<<0)
-
-// Returns a VMO's type based on its flags, allowing for checks like
-// if (MX_INFO_VMO_TYPE(f) == MX_INFO_VMO_TYPE_PAGED)
-#define MX_INFO_VMO_TYPE(flags)             ((flags) & (1u<<0))
-
-// The VMO is a clone, and is a copy-on-write clone.
-#define MX_INFO_VMO_IS_COW_CLONE            (1u<<2)
-
-// When reading a list of VMOs pointed to by a process, indicates that the
-// process has a handle to the VMO, which isn't necessarily mapped.
-#define MX_INFO_VMO_VIA_HANDLE              (1u<<3)
-
-// When reading a list of VMOs pointed to by a process, indicates that the
-// process maps the VMO into a VMAR, but doesn't necessarily have a handle to
-// the VMO.
-#define MX_INFO_VMO_VIA_MAPPING             (1u<<4)
-
-// Describes a VMO. For mapping information, see |mx_info_maps_t|.
-typedef struct mx_info_vmo {
-    // The koid of this VMO.
-    mx_koid_t koid;
-
-    // The name of this VMO.
-    char name[MX_MAX_NAME_LEN];
-
-    // The size of this VMO; i.e., the amount of virtual address space it
-    // would consume if mapped.
-    uint64_t size_bytes;
-
-    // If this VMO is a clone, the koid of its parent. Otherwise, zero.
-    // See |flags| for the type of clone.
-    mx_koid_t parent_koid;
-
-    // The number of clones of this VMO, if any.
-    size_t num_children;
-
-    // The number of times this VMO is currently mapped into VMARs.
-    // Note that the same process will often map the same VMO twice,
-    // and both mappings will be counted here. (I.e., this is not a count
-    // of the number of processes that map this VMO; see share_count.)
-    size_t num_mappings;
-
-    // An estimate of the number of unique address spaces that
-    // this VMO is mapped into. Every process has its own address space,
-    // and so does the kernel.
-    size_t share_count;
-
-    // Bitwise OR of MX_INFO_VMO_* values.
-    uint32_t flags;
-
-    // If |MX_INFO_VMO_TYPE(flags) == MX_INFO_VMO_TYPE_PAGED|, the amount of
-    // memory currently allocated to this VMO; i.e., the amount of physical
-    // memory it consumes. Undefined otherwise.
-    uint64_t committed_bytes;
-
-    // If |flags & MX_INFO_VMO_VIA_HANDLE|, the handle rights.
-    // Undefined otherwise.
-    mx_rights_t handle_rights;
-} mx_info_vmo_t;
-
-// kernel statistics per cpu
-typedef struct mx_info_cpu_stats {
-    uint32_t cpu_number;
-    uint32_t flags;
-
-    mx_time_t idle_time;
-
-    // kernel scheduler counters
-    uint64_t reschedules;
-    uint64_t context_switches;
-    uint64_t irq_preempts;
-    uint64_t preempts;
-    uint64_t yields;
-
-    // cpu level interrupts and exceptions
-    uint64_t ints;          // hardware interrupts, minus timer interrupts or inter-processor interrupts
-    uint64_t timer_ints;    // timer interrupts
-    uint64_t timers;        // timer callbacks
-    uint64_t page_faults;   // page faults
-    uint64_t exceptions;    // exceptions such as undefined opcode
-    uint64_t syscalls;
-
-    // inter-processor interrupts
-    uint64_t reschedule_ipis;
-    uint64_t generic_ipis;
-} mx_info_cpu_stats_t;
-
-// Information about kernel memory usage.
-// Can be expensive to gather.
-typedef struct mx_info_kmem_stats {
-    // The total amount of physical memory available to the system.
-    uint64_t total_bytes;
-
-    // The amount of unallocated memory.
-    uint64_t free_bytes;
-
-    // The amount of memory reserved by and mapped into the kernel for reasons
-    // not covered by other fields in this struct. Typically for readonly data
-    // like the ram disk and kernel image, and for early-boot dynamic memory.
-    uint64_t wired_bytes;
-
-    // The amount of memory allocated to the kernel heap.
-    uint64_t total_heap_bytes;
-
-    // The portion of |total_heap_bytes| that is not in use.
-    uint64_t free_heap_bytes;
-
-    // The amount of memory committed to VMOs, both kernel and user.
-    // A superset of all userspace memory.
-    // Does not include certain VMOs that fall under |wired_bytes|.
-    //
-    // TODO(dbort): Break this into at least two pieces: userspace VMOs that
-    // have koids, and kernel VMOs that don't. Or maybe look at VMOs
-    // mapped into the kernel aspace vs. everything else.
-    uint64_t vmo_bytes;
-
-    // The amount of memory used for architecture-specific MMU metadata
-    // like page tables.
-    uint64_t mmu_overhead_bytes;
-
-    // Non-free memory that isn't accounted for in any other field.
-    uint64_t other_bytes;
-} mx_info_kmem_stats_t;
-
-typedef struct mx_info_resource {
-    // The resource kind, one of:
-    // {MX_RSRC_KIND_ROOT, MX_RSRC_KIND_MMIO, MX_RSRC_KIND_IOPORT, MX_RSRC_KIND_IRQ}
-    uint32_t kind;
-    // Resource's low value (inclusive)
-    uint64_t low;
-    // Resource's high value (inclusive)
-    uint64_t high;
-} mx_info_resource_t;
-
-#define MX_INFO_CPU_STATS_FLAG_ONLINE       (1u<<0)
-
-// Object properties.
-
-// Argument is a uint32_t.
-#define MX_PROP_NUM_STATE_KINDS             2u
-// Argument is a char[MX_MAX_NAME_LEN].
-#define MX_PROP_NAME                        3u
-
-#if __x86_64__
-// Argument is a uintptr_t.
-#define MX_PROP_REGISTER_FS                 4u
-#endif
-
-// Argument is the value of ld.so's _dl_debug_addr, a uintptr_t.
-#define MX_PROP_PROCESS_DEBUG_ADDR          5u
-
-// Argument is the base address of the vDSO mapping (or zero), a uintptr_t.
-#define MX_PROP_PROCESS_VDSO_BASE_ADDRESS   6u
-
-// Argument is an mx_job_importance_t value.
-#define MX_PROP_JOB_IMPORTANCE             7u
-
-// Describes how important a job is.
-typedef int32_t mx_job_importance_t;
-
-// Valid mx_job_importance_t values and range.
-// The non-negative values must fit in 8 bits.
-
-// A job with this importance will inherit its actual importance from
-// the closest ancestor with a non-INHERITED importance property value.
-#define MX_JOB_IMPORTANCE_INHERITED ((mx_job_importance_t)-1)
-
-// The lowest importance. Jobs with this importance value are likely to be
-// killed first in an out-of-memory situation.
-#define MX_JOB_IMPORTANCE_MIN       ((mx_job_importance_t)0)
-
-// The highest importance.
-#define MX_JOB_IMPORTANCE_MAX       ((mx_job_importance_t)255)
-
-// Values for mx_info_thread_t.state.
-#define MX_THREAD_STATE_NEW                 0u
-#define MX_THREAD_STATE_RUNNING             1u
-#define MX_THREAD_STATE_SUSPENDED           2u
-#define MX_THREAD_STATE_BLOCKED             3u
-#define MX_THREAD_STATE_DYING               4u
-#define MX_THREAD_STATE_DEAD                5u
-
-__END_CDECLS
diff --git a/system/public/magenta/syscalls/policy.h b/system/public/magenta/syscalls/policy.h
deleted file mode 100644
index 5a99c8f..0000000
--- a/system/public/magenta/syscalls/policy.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-
-__BEGIN_CDECLS
-
-// ask clang format not to mess up the indentation:
-// clang-format off
-
-// Policy is applied for the conditions that are not
-// specified by the parent job policy.
-#define MX_JOB_POL_RELATIVE                 0u
-// Policy is either applied as-is or the syscall fails.
-#define MX_JOB_POL_ABSOLUTE                 1u
-
-// Basic policy topic.
-#define MX_JOB_POL_BASIC                    0u
-
-// Input structure to use with MX_JOB_POL_BASIC.
-typedef struct mx_policy_basic {
-    uint32_t condition;
-    uint32_t policy;
-} mx_policy_basic_t;
-
-// Conditions handled by job policy.
-#define MX_POL_BAD_HANDLE                    0u
-#define MX_POL_WRONG_OBJECT                  1u
-#define MX_POL_VMAR_WX                       2u
-#define MX_POL_NEW_ANY                       3u
-#define MX_POL_NEW_VMO                       4u
-#define MX_POL_NEW_CHANNEL                   5u
-#define MX_POL_NEW_EVENT                     6u
-#define MX_POL_NEW_EVPAIR                    7u
-#define MX_POL_NEW_PORT                      8u
-#define MX_POL_NEW_SOCKET                    9u
-#define MX_POL_NEW_FIFO                     10u
-#define MX_POL_NEW_TIMER                    11u
-#define MX_POL_MAX                          12u
-
-// Policy actions.
-// MX_POL_ACTION_ALLOW and MX_POL_ACTION_DENY can be ORed with MX_POL_ACTION_EXCEPTION.
-// MX_POL_ACTION_KILL implies MX_POL_ACTION_DENY.
-#define MX_POL_ACTION_ALLOW                 0u
-#define MX_POL_ACTION_DENY                  1u
-#define MX_POL_ACTION_EXCEPTION             2u
-#define MX_POL_ACTION_KILL                  5u
-
-__END_CDECLS
diff --git a/system/public/magenta/syscalls/port.h b/system/public/magenta/syscalls/port.h
deleted file mode 100644
index ed7ca1c..0000000
--- a/system/public/magenta/syscalls/port.h
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-
-__BEGIN_CDECLS
-
-// mx_object_wait_async() options
-#define MX_WAIT_ASYNC_ONCE          0u
-#define MX_WAIT_ASYNC_REPEATING     1u
-
-// packet types.
-#define MX_PKT_TYPE_USER            0x00u
-#define MX_PKT_TYPE_SIGNAL_ONE      0x01u
-#define MX_PKT_TYPE_SIGNAL_REP      0x02u
-#define MX_PKT_TYPE_GUEST_MEM       0x03u
-#define MX_PKT_TYPE_GUEST_IO        0x04u
-#define MX_PKT_TYPE_EXCEPTION(n)    (0x05u | (((n) & 0xFFu) << 8))
-
-#define MX_PKT_TYPE_MASK            0xFFu
-
-#define MX_PKT_IS_USER(type)        ((type) == MX_PKT_TYPE_USER)
-#define MX_PKT_IS_SIGNAL_ONE(type)  ((type) == MX_PKT_TYPE_SIGNAL_ONE)
-#define MX_PKT_IS_SIGNAL_REP(type)  ((type) == MX_PKT_TYPE_SIGNAL_REP)
-#define MX_PKT_IS_GUEST_MEM(type)   ((type) == MX_PKT_TYPE_GUEST_MEM)
-#define MX_PKT_IS_GUEST_IO(type)    ((type) == MX_PKT_TYPE_GUEST_IO)
-#define MX_PKT_IS_EXCEPTION(type)   (((type) & MX_PKT_TYPE_MASK) == MX_PKT_TYPE_EXCEPTION(0))
-
-// port_packet_t::type MX_PKT_TYPE_USER.
-typedef union mx_packet_user {
-    uint64_t u64[4];
-    uint32_t u32[8];
-    uint16_t u16[16];
-    uint8_t   c8[32];
-} mx_packet_user_t;
-
-// port_packet_t::type MX_PKT_TYPE_SIGNAL_ONE and MX_PKT_TYPE_SIGNAL_REP.
-typedef struct mx_packet_signal {
-    mx_signals_t trigger;
-    mx_signals_t observed;
-    uint64_t count;
-    uint64_t reserved0;
-    uint64_t reserved1;
-} mx_packet_signal_t;
-
-typedef struct mx_packet_exception {
-    uint64_t pid;
-    uint64_t tid;
-    uint64_t reserved0;
-    uint64_t reserved1;
-} mx_packet_exception_t;
-
-typedef struct mx_packet_guest_mem {
-    mx_vaddr_t addr;
-#if __aarch64__
-    uint32_t inst;
-    uint32_t reserved0;
-    uint64_t reserved1;
-    uint64_t reserved2;
-#elif __x86_64__
-// NOTE: x86 instructions are guaranteed to be 15 bytes or fewer.
-#define X86_MAX_INST_LEN 15u
-    uint8_t inst_len;
-    uint8_t inst_buf[X86_MAX_INST_LEN];
-    uint64_t reserved;
-#endif
-} mx_packet_guest_mem_t;
-
-typedef struct mx_packet_guest_io {
-    uint16_t port;
-    uint8_t access_size;
-    bool input;
-    union {
-        uint8_t u8;
-        uint16_t u16;
-        uint32_t u32;
-        uint8_t data[4];
-    };
-    uint64_t reserved0;
-    uint64_t reserved1;
-    uint64_t reserved2;
-} mx_packet_guest_io_t;
-
-typedef struct mx_port_packet {
-    uint64_t key;
-    uint32_t type;
-    int32_t status;
-    union {
-        mx_packet_user_t user;
-        mx_packet_signal_t signal;
-        mx_packet_exception_t exception;
-        mx_packet_guest_io_t guest_io;
-        mx_packet_guest_mem_t guest_mem;
-    };
-} mx_port_packet_t;
-
-__END_CDECLS
diff --git a/system/public/magenta/syscalls/resource.h b/system/public/magenta/syscalls/resource.h
deleted file mode 100644
index 06e1f37..0000000
--- a/system/public/magenta/syscalls/resource.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/compiler.h>
-
-__BEGIN_CDECLS
-
-// The root resource
-#define MX_RSRC_KIND_ROOT        (0x0000u)
-
-// Hardware resources
-#define MX_RSRC_KIND_MMIO        (0x1000u)
-#define MX_RSRC_KIND_IOPORT      (0x1001u)
-#define MX_RSRC_KIND_IRQ         (0x1002u)
-
-// Subsystem resources
-#define MX_RSRC_KIND_HYPERVISOR  (0x2000u)
-
-__END_CDECLS
diff --git a/system/public/magenta/syscalls/types.h b/system/public/magenta/syscalls/types.h
deleted file mode 100644
index 7a65cd0..0000000
--- a/system/public/magenta/syscalls/types.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-__BEGIN_CDECLS
-
-// forward declarations needed by syscalls.h
-typedef struct mx_port_packet mx_port_packet_t;
-typedef struct mx_pci_bar mx_pci_resource_t;
-typedef struct mx_pcie_device_info mx_pcie_device_info_t;
-typedef struct mx_pci_init_arg mx_pci_init_arg_t;
-typedef union mx_rrec mx_rrec_t;
-typedef struct mx_vcpu_create_args mx_vcpu_create_args_t;
-
-__END_CDECLS
diff --git a/system/public/magenta/types.h b/system/public/magenta/types.h
deleted file mode 100644
index e5746d9..0000000
--- a/system/public/magenta/types.h
+++ /dev/null
@@ -1,308 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/compiler.h>
-#include <magenta/errors.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-#ifndef __cplusplus
-#ifndef _KERNEL
-// We don't want to include <stdatomic.h> from the kernel code because the
-// kernel definitions of atomic operations are incompatible with those defined
-// in <stdatomic.h>.
-//
-// A better solution would be to use <stdatomic.h> and C11 atomic operation
-// even in the kernel, but that would require modifying all the code that uses
-// the existing homegrown atomics.
-#include <stdatomic.h>
-#endif
-#endif
-
-__BEGIN_CDECLS
-
-// ask clang format not to mess up the indentation:
-// clang-format off
-
-#ifdef _KERNEL
-typedef uint32_t mx_handle_t;
-#else
-typedef int32_t mx_handle_t;
-#endif
-
-#define MX_HANDLE_INVALID         ((mx_handle_t)0)
-
-// Same as kernel status_t
-typedef int32_t mx_status_t;
-
-// absolute time in nanoseconds (generally with respect to the monotonic clock)
-typedef uint64_t mx_time_t;
-// a duration in nanoseconds
-typedef uint64_t mx_duration_t;
-#define MX_TIME_INFINITE UINT64_MAX
-#define MX_USEC(n) ((mx_duration_t)(1000ULL * (n)))
-#define MX_MSEC(n) ((mx_duration_t)(1000000ULL * (n)))
-#define MX_SEC(n)  ((mx_duration_t)(1000000000ULL * (n)))
-
-typedef uint32_t mx_signals_t;
-
-#define MX_SIGNAL_NONE              ((mx_signals_t)0u)
-#define MX_USER_SIGNAL_ALL          ((mx_signals_t)0xff000000u)
-
-// Implementation details (__MX_* not intended for public consumption)
-//
-// Signals that have a common meaning where used are named with that
-// meaning.  Signals that do not, or are not yet in use, are named
-// generically.
-#define __MX_OBJECT_SIGNAL_ALL      ((mx_signals_t)0x00ffffffu)
-#define __MX_OBJECT_READABLE        ((mx_signals_t)1u << 0)
-#define __MX_OBJECT_WRITABLE        ((mx_signals_t)1u << 1)
-#define __MX_OBJECT_PEER_CLOSED     ((mx_signals_t)1u << 2)
-#define __MX_OBJECT_SIGNALED        ((mx_signals_t)1u << 3)
-#define __MX_OBJECT_SIGNAL_4        ((mx_signals_t)1u << 4)
-#define __MX_OBJECT_SIGNAL_5        ((mx_signals_t)1u << 5)
-#define __MX_OBJECT_SIGNAL_6        ((mx_signals_t)1u << 6)
-#define __MX_OBJECT_SIGNAL_7        ((mx_signals_t)1u << 7)
-#define __MX_OBJECT_SIGNAL_8        ((mx_signals_t)1u << 8)
-#define __MX_OBJECT_SIGNAL_9        ((mx_signals_t)1u << 9)
-#define __MX_OBJECT_SIGNAL_10       ((mx_signals_t)1u << 10)
-#define __MX_OBJECT_SIGNAL_11       ((mx_signals_t)1u << 11)
-#define __MX_OBJECT_SIGNAL_12       ((mx_signals_t)1u << 12)
-#define __MX_OBJECT_SIGNAL_13       ((mx_signals_t)1u << 13)
-#define __MX_OBJECT_SIGNAL_14       ((mx_signals_t)1u << 14)
-#define __MX_OBJECT_SIGNAL_15       ((mx_signals_t)1u << 15)
-#define __MX_OBJECT_SIGNAL_16       ((mx_signals_t)1u << 16)
-#define __MX_OBJECT_SIGNAL_17       ((mx_signals_t)1u << 17)
-#define __MX_OBJECT_SIGNAL_18       ((mx_signals_t)1u << 18)
-#define __MX_OBJECT_SIGNAL_19       ((mx_signals_t)1u << 19)
-#define __MX_OBJECT_SIGNAL_20       ((mx_signals_t)1u << 20)
-#define __MX_OBJECT_SIGNAL_21       ((mx_signals_t)1u << 21)
-#define __MX_OBJECT_LAST_HANDLE     ((mx_signals_t)1u << 22)
-#define __MX_OBJECT_HANDLE_CLOSED   ((mx_signals_t)1u << 23)
-
-
-
-// User Signals (for mx_object_signal() and mx_object_signal_peer())
-#define MX_USER_SIGNAL_0            ((mx_signals_t)1u << 24)
-#define MX_USER_SIGNAL_1            ((mx_signals_t)1u << 25)
-#define MX_USER_SIGNAL_2            ((mx_signals_t)1u << 26)
-#define MX_USER_SIGNAL_3            ((mx_signals_t)1u << 27)
-#define MX_USER_SIGNAL_4            ((mx_signals_t)1u << 28)
-#define MX_USER_SIGNAL_5            ((mx_signals_t)1u << 29)
-#define MX_USER_SIGNAL_6            ((mx_signals_t)1u << 30)
-#define MX_USER_SIGNAL_7            ((mx_signals_t)1u << 31)
-
-// Cancelation (handle was closed while waiting with it)
-#define MX_SIGNAL_HANDLE_CLOSED     __MX_OBJECT_HANDLE_CLOSED
-
-// Only one user-more reference (handle) to the object exists.
-#define MX_SIGNAL_LAST_HANDLE       __MX_OBJECT_LAST_HANDLE
-
-// Event
-#define MX_EVENT_SIGNALED           __MX_OBJECT_SIGNALED
-#define MX_EVENT_SIGNAL_MASK        (MX_USER_SIGNAL_ALL | __MX_OBJECT_SIGNALED)
-
-// EventPair
-#define MX_EPAIR_SIGNALED           __MX_OBJECT_SIGNALED
-#define MX_EPAIR_PEER_CLOSED        __MX_OBJECT_PEER_CLOSED
-#define MX_EPAIR_SIGNAL_MASK        (MX_USER_SIGNAL_ALL | __MX_OBJECT_SIGNALED | __MX_OBJECT_PEER_CLOSED)
-
-// Channel
-#define MX_CHANNEL_READABLE         __MX_OBJECT_READABLE
-#define MX_CHANNEL_WRITABLE         __MX_OBJECT_WRITABLE
-#define MX_CHANNEL_PEER_CLOSED      __MX_OBJECT_PEER_CLOSED
-
-// Socket
-#define MX_SOCKET_READABLE          __MX_OBJECT_READABLE
-#define MX_SOCKET_WRITABLE          __MX_OBJECT_WRITABLE
-#define MX_SOCKET_PEER_CLOSED       __MX_OBJECT_PEER_CLOSED
-#define MX_SOCKET_READ_DISABLED     __MX_OBJECT_SIGNAL_4
-#define MX_SOCKET_WRITE_DISABLED    __MX_OBJECT_SIGNAL_5
-#define MX_SOCKET_CONTROL_READABLE  __MX_OBJECT_SIGNAL_6
-#define MX_SOCKET_CONTROL_WRITABLE  __MX_OBJECT_SIGNAL_7
-
-// Port
-#define MX_PORT_READABLE            __MX_OBJECT_READABLE
-
-// Fifo
-#define MX_FIFO_READABLE            __MX_OBJECT_READABLE
-#define MX_FIFO_WRITABLE            __MX_OBJECT_WRITABLE
-#define MX_FIFO_PEER_CLOSED         __MX_OBJECT_PEER_CLOSED
-
-// Task signals (process, thread, job)
-#define MX_TASK_TERMINATED          __MX_OBJECT_SIGNALED
-
-// Job
-#define MX_JOB_NO_PROCESSES         __MX_OBJECT_SIGNALED
-#define MX_JOB_NO_JOBS              __MX_OBJECT_SIGNAL_4
-
-// Process
-#define MX_PROCESS_TERMINATED       __MX_OBJECT_SIGNALED
-
-// Thread
-#define MX_THREAD_TERMINATED        __MX_OBJECT_SIGNALED
-
-// Log
-#define MX_LOG_READABLE             __MX_OBJECT_READABLE
-#define MX_LOG_WRITABLE             __MX_OBJECT_WRITABLE
-
-// Timer
-#define MX_TIMER_SIGNALED           __MX_OBJECT_SIGNALED
-
-// global kernel object id.
-typedef uint64_t mx_koid_t;
-#define MX_KOID_INVALID ((uint64_t) 0)
-#define MX_KOID_KERNEL  ((uint64_t) 1)
-
-// Transaction ID and argument types for mx_channel_call.
-typedef uint32_t mx_txid_t;
-
-typedef struct {
-    const void* wr_bytes;
-    const mx_handle_t* wr_handles;
-    void *rd_bytes;
-    mx_handle_t* rd_handles;
-    uint32_t wr_num_bytes;
-    uint32_t wr_num_handles;
-    uint32_t rd_num_bytes;
-    uint32_t rd_num_handles;
-} mx_channel_call_args_t;
-
-// Structure for mx_object_wait_many():
-typedef struct {
-    mx_handle_t handle;
-    mx_signals_t waitfor;
-    mx_signals_t pending;
-} mx_wait_item_t;
-
-typedef uint32_t mx_rights_t;
-#define MX_RIGHT_NONE             ((mx_rights_t)0u)
-#define MX_RIGHT_DUPLICATE        ((mx_rights_t)1u << 0)
-#define MX_RIGHT_TRANSFER         ((mx_rights_t)1u << 1)
-#define MX_RIGHT_READ             ((mx_rights_t)1u << 2)
-#define MX_RIGHT_WRITE            ((mx_rights_t)1u << 3)
-#define MX_RIGHT_EXECUTE          ((mx_rights_t)1u << 4)
-#define MX_RIGHT_MAP              ((mx_rights_t)1u << 5)
-#define MX_RIGHT_GET_PROPERTY     ((mx_rights_t)1u << 6)
-#define MX_RIGHT_SET_PROPERTY     ((mx_rights_t)1u << 7)
-#define MX_RIGHT_ENUMERATE        ((mx_rights_t)1u << 8)
-#define MX_RIGHT_DESTROY          ((mx_rights_t)1u << 9)
-#define MX_RIGHT_SET_POLICY       ((mx_rights_t)1u << 10)
-#define MX_RIGHT_GET_POLICY       ((mx_rights_t)1u << 11)
-#define MX_RIGHT_SIGNAL           ((mx_rights_t)1u << 12)
-#define MX_RIGHT_SIGNAL_PEER      ((mx_rights_t)1u << 13)
-
-#define MX_RIGHT_SAME_RIGHTS      ((mx_rights_t)1u << 31)
-
-// VM Object opcodes
-#define MX_VMO_OP_COMMIT                 1u
-#define MX_VMO_OP_DECOMMIT               2u
-#define MX_VMO_OP_LOCK                   3u
-#define MX_VMO_OP_UNLOCK                 4u
-#define MX_VMO_OP_LOOKUP                 5u
-#define MX_VMO_OP_CACHE_SYNC             6u
-#define MX_VMO_OP_CACHE_INVALIDATE       7u
-#define MX_VMO_OP_CACHE_CLEAN            8u
-#define MX_VMO_OP_CACHE_CLEAN_INVALIDATE 9u
-
-// VM Object clone flags
-#define MX_VMO_CLONE_COPY_ON_WRITE       1u
-
-// Mapping flags to vmar routines
-#define MX_VM_FLAG_PERM_READ          (1u << 0)
-#define MX_VM_FLAG_PERM_WRITE         (1u << 1)
-#define MX_VM_FLAG_PERM_EXECUTE       (1u << 2)
-#define MX_VM_FLAG_COMPACT            (1u << 3)
-#define MX_VM_FLAG_SPECIFIC           (1u << 4)
-#define MX_VM_FLAG_SPECIFIC_OVERWRITE (1u << 5)
-#define MX_VM_FLAG_CAN_MAP_SPECIFIC   (1u << 6)
-#define MX_VM_FLAG_CAN_MAP_READ       (1u << 7)
-#define MX_VM_FLAG_CAN_MAP_WRITE      (1u << 8)
-#define MX_VM_FLAG_CAN_MAP_EXECUTE    (1u << 9)
-#define MX_VM_FLAG_MAP_RANGE          (1u << 10)
-
-// clock ids
-#define MX_CLOCK_MONOTONIC        (0u)
-#define MX_CLOCK_UTC              (1u)
-#define MX_CLOCK_THREAD           (2u)
-
-// virtual address
-typedef uintptr_t mx_vaddr_t;
-
-// physical address
-typedef uintptr_t mx_paddr_t;
-
-// offset
-typedef uint64_t mx_off_t;
-typedef int64_t mx_rel_off_t;
-
-// Maximum string length for kernel names (process name, thread name, etc)
-#define MX_MAX_NAME_LEN           (32)
-
-// Buffer size limits on the cprng syscalls
-#define MX_CPRNG_DRAW_MAX_LEN        256
-#define MX_CPRNG_ADD_ENTROPY_MAX_LEN 256
-
-// interrupt flags
-#define MX_FLAG_REMAP_IRQ  0x1
-
-// Channel options and limits.
-#define MX_CHANNEL_READ_MAY_DISCARD         1u
-
-#define MX_CHANNEL_MAX_MSG_BYTES            65536u
-#define MX_CHANNEL_MAX_MSG_HANDLES          64u
-
-// Socket options and limits.
-// These options can be passed to mx_socket_write()
-#define MX_SOCKET_SHUTDOWN_WRITE            (1u << 0)
-#define MX_SOCKET_SHUTDOWN_READ             (1u << 1)
-#define MX_SOCKET_SHUTDOWN_MASK             (MX_SOCKET_SHUTDOWN_WRITE | MX_SOCKET_SHUTDOWN_READ)
-// These can be passed to mx_socket_create()
-#define MX_SOCKET_STREAM                    (0u << 0)
-#define MX_SOCKET_DATAGRAM                  (1u << 0)
-#define MX_SOCKET_HAS_CONTROL               (1u << 1)
-#define MX_SOCKET_CREATE_MASK               (MX_SOCKET_DATAGRAM | MX_SOCKET_HAS_CONTROL)
-// These can be passed to mx_socket_read() and mx_socket_write().
-#define MX_SOCKET_CONTROL                   (1u << 2)
-
-// Flags which can be used to to control cache policy for APIs which map memory.
-typedef enum {
-    MX_CACHE_POLICY_CACHED          = 0,
-    MX_CACHE_POLICY_UNCACHED        = 1,
-    MX_CACHE_POLICY_UNCACHED_DEVICE = 2,
-    MX_CACHE_POLICY_WRITE_COMBINING = 3,
-
-    MX_CACHE_POLICY_MASK            = 0x3,
-} mx_cache_policy_t;
-
-// Flag bits for mx_cache_flush.
-#define MX_CACHE_FLUSH_INSN         (1u << 0)
-#define MX_CACHE_FLUSH_DATA         (1u << 1)
-
-// Timer options.
-#define MX_TIMER_SLACK_CENTER       0u
-#define MX_TIMER_SLACK_EARLY        1u
-#define MX_TIMER_SLACK_LATE         2u
-
-
-#ifdef __cplusplus
-// We cannot use <stdatomic.h> with C++ code as _Atomic qualifier defined by
-// C11 is not valid in C++11. There is not a single standard name that can
-// be used in both C and C++. C++ <atomic> defines names which are equivalent
-// to those in <stdatomic.h>, but these are contained in the std namespace.
-//
-// In kernel, the only operation done is a user_copy (of sizeof(int)) inside a
-// lock; otherwise the futex address is treated as a key.
-typedef int mx_futex_t;
-#else
-#ifdef _KERNEL
-typedef int mx_futex_t;
-#else
-typedef atomic_int mx_futex_t;
-#endif
-#endif
-
-__END_CDECLS
diff --git a/system/public/zircon/assert.h b/system/public/zircon/assert.h
new file mode 100644
index 0000000..6a64df3
--- /dev/null
+++ b/system/public/zircon/assert.h
@@ -0,0 +1,82 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#ifdef _KERNEL
+#include <assert.h>
+#define ZX_PANIC(args...) PANIC(args)
+#define ZX_ASSERT(args...) ASSERT(args)
+#define ZX_ASSERT_MSG(args...) ASSERT_MSG(args)
+#define ZX_DEBUG_ASSERT(args...) DEBUG_ASSERT(args)
+#define ZX_DEBUG_ASSERT_MSG(args...) DEBUG_ASSERT_MSG(args)
+#define ZX_DEBUG_ASSERT_COND(args...) DEBUG_ASSERT_COND(args)
+#define ZX_DEBUG_ASSERT_MSG_COND(args...) DEBUG_ASSERT_MSG_COND(args)
+#define ZX_DEBUG_ASSERT_IMPLEMENTED DEBUG_ASSERT_IMPLEMENTED
+
+#ifdef ZX_DEBUGLEVEL
+#undef ZX_DEBUGLEVEL
+#endif
+#define ZX_DEBUGLEVEL LK_DEBUGLEVEL
+
+#else // #ifdef _KERNEL
+
+#include <stdio.h> // for printf
+#include <stdlib.h> // for abort
+
+#include <zircon/compiler.h>
+
+#define ZX_PANIC(fmt, ...)          \
+    do {                            \
+        printf(fmt, ##__VA_ARGS__); \
+        abort();                    \
+    } while (0)
+
+#define ZX_ASSERT(x)                                                            \
+    do {                                                                        \
+        if (unlikely(!(x))) {                                                   \
+            ZX_PANIC("ASSERT FAILED at (%s:%d): %s\n", __FILE__, __LINE__, #x); \
+        }                                                                       \
+    } while (0)
+
+#define ZX_ASSERT_MSG(x, msg, msgargs...)                                                           \
+    do {                                                                                            \
+        if (unlikely(!(x))) {                                                                       \
+            ZX_PANIC("ASSERT FAILED at (%s:%d): %s\n" msg "\n", __FILE__, __LINE__, #x, ##msgargs); \
+        }                                                                                           \
+    } while (0)
+
+// conditionally implement DEBUG_ASSERT based on ZX_DEBUGLEVEL in kernel space
+// user space does not currently implement DEBUG_ASSERT
+#ifdef ZX_DEBUGLEVEL
+#define ZX_DEBUG_ASSERT_IMPLEMENTED (ZX_DEBUGLEVEL > 1)
+#else
+#define ZX_DEBUG_ASSERT_IMPLEMENTED 0
+#endif
+
+#define ZX_DEBUG_ASSERT(x)                                                            \
+    do {                                                                              \
+        if (ZX_DEBUG_ASSERT_IMPLEMENTED && unlikely(!(x))) {                          \
+            ZX_PANIC("DEBUG ASSERT FAILED at (%s:%d): %s\n", __FILE__, __LINE__, #x); \
+        }                                                                             \
+    } while (0)
+
+#define ZX_DEBUG_ASSERT_MSG(x, msg, msgargs...)                       \
+    do {                                                              \
+        if (ZX_DEBUG_ASSERT_IMPLEMENTED && unlikely(!(x))) {          \
+            ZX_PANIC("DEBUG ASSERT FAILED at (%s:%d): %s\n" msg "\n", \
+                     __FILE__, __LINE__, #x, ##msgargs);              \
+        }                                                             \
+    } while (0)
+
+// implement _COND versions of ZX_DEBUG_ASSERT which only emit the body if
+// ZX_DEBUG_ASSERT_IMPLEMENTED is set
+#if ZX_DEBUG_ASSERT_IMPLEMENTED
+#define ZX_DEBUG_ASSERT_COND(x) ZX_DEBUG_ASSERT(x)
+#define ZX_DEBUG_ASSERT_MSG_COND(x, msg, msgargs...) ZX_DEBUG_ASSERT_MSG(x, msg, msgargs)
+#else
+#define ZX_DEBUG_ASSERT_COND(x) do { } while (0)
+#define ZX_DEBUG_ASSERT_MSG_COND(x, msg, msgargs...) do { } while (0)
+#endif
+#endif // #ifdef _KERNEL
diff --git a/system/public/magenta/boot/bootdata.h b/system/public/zircon/boot/bootdata.h
similarity index 96%
rename from system/public/magenta/boot/bootdata.h
rename to system/public/zircon/boot/bootdata.h
index c492693..a27bb61 100644
--- a/system/public/magenta/boot/bootdata.h
+++ b/system/public/zircon/boot/bootdata.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #ifndef ASSEMBLY
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 #endif
 
@@ -56,7 +56,7 @@
 // MDI data.  The "extra" field is unused and set to 0.
 #define BOOTDATA_MDI              (0x3149444d) // MDI1
 
-// A Magenta Kernel Image
+// A Zircon Kernel Image
 // Content: bootdata_kernel_t
 #define BOOTDATA_KERNEL           (0x4c4e524b) // KRNL
 
@@ -158,7 +158,7 @@
     bootdata_t hdr_file;
     bootdata_t hdr_kernel;
     bootdata_kernel_t data_kernel;
-} magenta_kernel_t;
+} zircon_kernel_t;
 
 typedef struct {
     bootdata_t hdr_file;
@@ -166,7 +166,7 @@
     bootdata_t hdr_kernel;
     bootextra_t ext_kernel;
     bootdata_kernel_t data_kernel;
-} magenta_kernel2_t;
+} zircon_kernel2_t;
 
 typedef struct {
     uint64_t base;
@@ -183,11 +183,11 @@
 } bootdata_uart_t;
 
 /* EFI Variable for Crash Log */
-#define MAGENTA_VENDOR_GUID \
+#define ZIRCON_VENDOR_GUID \
     {0x82305eb2, 0xd39e, 0x4575, {0xa0, 0xc8, 0x6c, 0x20, 0x72, 0xd0, 0x84, 0x4c}}
-#define MAGENTA_CRASHLOG_EFIVAR \
+#define ZIRCON_CRASHLOG_EFIVAR \
     { 'c', 'r', 'a', 's', 'h', 'l', 'o', 'g', 0 };
-#define MAGENTA_CRASHLOG_EFIATTR \
+#define ZIRCON_CRASHLOG_EFIATTR \
     (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS)
 
 __END_CDECLS;
diff --git a/system/public/magenta/boot/multiboot.h b/system/public/zircon/boot/multiboot.h
similarity index 100%
rename from system/public/magenta/boot/multiboot.h
rename to system/public/zircon/boot/multiboot.h
diff --git a/system/public/magenta/boot/netboot.h b/system/public/zircon/boot/netboot.h
similarity index 100%
rename from system/public/magenta/boot/netboot.h
rename to system/public/zircon/boot/netboot.h
diff --git a/system/public/magenta/compiler.h b/system/public/zircon/compiler.h
similarity index 98%
rename from system/public/magenta/compiler.h
rename to system/public/zircon/compiler.h
index 1ae2f12..41974ba 100644
--- a/system/public/magenta/compiler.h
+++ b/system/public/zircon/compiler.h
@@ -63,7 +63,7 @@
 #define __offsetof(type, field) __builtin_offsetof(type, field)
 
 // Publicly exposed thread annotation macros. These have a long and ugly name to
-// minimize the chance of collision with consumers of Magenta's public headers.
+// minimize the chance of collision with consumers of Zircon's public headers.
 #define __TA_CAPABILITY(x) __THREAD_ANNOTATION(__capability__(x))
 #define __TA_GUARDED(x) __THREAD_ANNOTATION(__guarded_by__(x))
 #define __TA_ACQUIRE(...) __THREAD_ANNOTATION(__acquire_capability__(__VA_ARGS__))
diff --git a/system/public/magenta/crashlogger.h b/system/public/zircon/crashlogger.h
similarity index 100%
rename from system/public/magenta/crashlogger.h
rename to system/public/zircon/crashlogger.h
diff --git a/system/public/magenta/device/audio.h b/system/public/zircon/device/audio.h
similarity index 94%
rename from system/public/magenta/device/audio.h
rename to system/public/zircon/device/audio.h
index 85ea98d..e61309d 100644
--- a/system/public/magenta/device/audio.h
+++ b/system/public/zircon/device/audio.h
@@ -5,18 +5,18 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
 
 #define AUDIO_IOCTL_GET_CHANNEL IOCTL(IOCTL_KIND_GET_HANDLE, 0xFE, 0x00)
-IOCTL_WRAPPER_OUT(ioctl_audio_get_channel, AUDIO_IOCTL_GET_CHANNEL, mx_handle_t);
+IOCTL_WRAPPER_OUT(ioctl_audio_get_channel, AUDIO_IOCTL_GET_CHANNEL, zx_handle_t);
 
-// When communicating with an Audio driver using mx_channel_call, do not use
+// When communicating with an Audio driver using zx_channel_call, do not use
 // the AUDIO_INVALID_TRANSACTION_ID as your message's transaction ID.  It is
 // reserved for async notifications sent from the driver to the application.
-#define AUDIO_INVALID_TRANSACTION_ID ((mx_txid_t)0)
+#define AUDIO_INVALID_TRANSACTION_ID ((zx_txid_t)0)
 
 __BEGIN_CDECLS
 
@@ -48,7 +48,7 @@
               "audio_cmd_t must be 32 bits!");
 
 typedef struct audio_cmd_hdr {
-    mx_txid_t   transaction_id;
+    zx_txid_t   transaction_id;
     audio_cmd_t cmd;
 } audio_cmd_hdr_t;
 
@@ -147,7 +147,7 @@
     audio_cmd_hdr_t hdr;
 } audio_stream_cmd_get_formats_req_t;
 
-// TODO(johngro) : Figure out if mx_txid_t is ever going to go up to 8 bytes or
+// TODO(johngro) : Figure out if zx_txid_t is ever going to go up to 8 bytes or
 // not.  If it is, just remove the _pad field below.  If not, either keep it as
 // a _pad field, or repurpose it for some flags of some form.  Right now, we use
 // it to make sure that format_ranges is aligned to a 16 byte boundary.
@@ -174,7 +174,7 @@
 
 typedef struct audio_stream_cmd_set_format_resp {
     audio_cmd_hdr_t hdr;
-    mx_status_t     result;
+    zx_status_t     result;
 
     // Note: Upon success, a channel used to control the audio buffer will also
     // be returned.
@@ -214,7 +214,7 @@
 // of -33.5 being applied.
 //
 // Gain change requests outside of the capabilities of the stream's
-// amplifier will be rejected with a result of MX_ERR_INVALID_ARGS.  Using the
+// amplifier will be rejected with a result of ZX_ERR_INVALID_ARGS.  Using the
 // previous example, requests for gains of -65.0 or +3dB would be rejected.
 // Similarly,  If an amplifier is capable of gain control but cannot mute, a
 // request to mute will be rejected.
@@ -234,7 +234,7 @@
 
 typedef struct audio_stream_cmd_set_gain_resp {
     audio_cmd_hdr_t hdr;
-    mx_status_t     result;
+    zx_status_t     result;
     // The current gain settings observed immediately after processing the set
     // gain request.
     bool             cur_mute;
@@ -254,7 +254,7 @@
 typedef struct audio_stream_cmd_plug_detect_resp {
     audio_cmd_hdr_t         hdr;
     audio_pd_notify_flags_t flags;           // The current plug state and capabilities
-    mx_time_t               plug_state_time; // The time of the plug state last change.
+    zx_time_t               plug_state_time; // The time of the plug state last change.
 } audio_stream_cmd_plug_detect_resp_t;
 
 // AUDIO_STREAM_PLUG_DETECT_NOTIFY
@@ -284,7 +284,7 @@
 
 typedef struct audio_rb_cmd_get_fifo_depth_resp {
     audio_cmd_hdr_t hdr;
-    mx_status_t     result;
+    zx_status_t     result;
 
     // A representation (in bytes) of how far ahead audio hardware may read
     // into the stream (in the case of output) or may hold onto audio before
@@ -302,9 +302,9 @@
 
 typedef struct audio_rb_cmd_get_buffer_resp {
     audio_cmd_hdr_t hdr;
-    mx_status_t     result;
+    zx_status_t     result;
 
-    // NOTE: If result == MX_OK, a VMO handle representing the ring buffer to
+    // NOTE: If result == ZX_OK, a VMO handle representing the ring buffer to
     // be used will be returned as well.  Clients may map this buffer with
     // read-write permissions in the case of an output stream, or read-only
     // permissions in the case of an input stream.  The size of the VMO
@@ -323,10 +323,10 @@
 
 typedef struct audio_rb_cmd_start_resp {
     audio_cmd_hdr_t hdr;
-    mx_status_t     result;
+    zx_status_t     result;
 
     // Nominal time at which the first frame of audio started to be clocked out
-    // to the codec as measured by mx_ticks_get().
+    // to the codec as measured by zx_ticks_get().
     //
     uint64_t start_ticks;
 } audio_rb_cmd_start_resp_t;
@@ -338,7 +338,7 @@
 
 typedef struct audio_rb_cmd_stop_resp {
     audio_cmd_hdr_t hdr;
-    mx_status_t     result;
+    zx_status_t     result;
 } audio_rb_cmd_stop_resp_t;
 
 // AUDIO_RB_POSITION_NOTIFY
diff --git a/system/public/magenta/device/block.h b/system/public/zircon/device/block.h
similarity index 96%
rename from system/public/magenta/device/block.h
rename to system/public/zircon/device/block.h
index 4ae8b67..954b461 100644
--- a/system/public/magenta/device/block.h
+++ b/system/public/zircon/device/block.h
@@ -6,9 +6,9 @@
 
 #include <assert.h>
 #include <limits.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/types.h>
 
 // Get information about the underlying block device.
 #define IOCTL_BLOCK_GET_INFO \
@@ -88,13 +88,13 @@
 // TODO(smklein): Move these to a separate file
 // Block Device ioctls (shared between all block devices):
 
-// ssize_t ioctl_block_get_fifos(int fd, mx_handle_t* fifo_out);
-IOCTL_WRAPPER_OUT(ioctl_block_get_fifos, IOCTL_BLOCK_GET_FIFOS, mx_handle_t);
+// ssize_t ioctl_block_get_fifos(int fd, zx_handle_t* fifo_out);
+IOCTL_WRAPPER_OUT(ioctl_block_get_fifos, IOCTL_BLOCK_GET_FIFOS, zx_handle_t);
 
 typedef uint16_t vmoid_t;
 
-// ssize_t ioctl_block_attach_vmo(int fd, mx_handle_t* in, vmoid_t* out_vmoid);
-IOCTL_WRAPPER_INOUT(ioctl_block_attach_vmo, IOCTL_BLOCK_ATTACH_VMO, mx_handle_t, vmoid_t);
+// ssize_t ioctl_block_attach_vmo(int fd, zx_handle_t* in, vmoid_t* out_vmoid);
+IOCTL_WRAPPER_INOUT(ioctl_block_attach_vmo, IOCTL_BLOCK_ATTACH_VMO, zx_handle_t, vmoid_t);
 
 #define MAX_TXN_MESSAGES 16
 #define MAX_TXN_COUNT 256
@@ -189,7 +189,7 @@
 // Each transaction reads or writes up to 'length' bytes from the device, starting at
 // 'dev_offset', into the VMO associated with 'vmoid', starting at 'vmo_offset'.
 // If the transaction is out of range, for example if 'length' is too large or if
-// 'dev_offset' is beyond the end of the device, MX_ERR_OUT_OF_RANGE is returned.
+// 'dev_offset' is beyond the end of the device, ZX_ERR_OUT_OF_RANGE is returned.
 
 #define BLOCKIO_READ 0x0001      // Reads from the Block device into the VMO
 #define BLOCKIO_WRITE 0x0002     // Writes to the Block device from the VMO
@@ -213,7 +213,7 @@
 typedef struct {
     txnid_t txnid;
     uint16_t reserved0;
-    mx_status_t status;
+    zx_status_t status;
     uint32_t count; // The number of messages in the transaction completed by the block server.
     uint32_t reserved1;
     uint64_t reserved2;
diff --git a/system/public/magenta/device/bt-hci.h b/system/public/zircon/device/bt-hci.h
similarity index 84%
rename from system/public/magenta/device/bt-hci.h
rename to system/public/zircon/device/bt-hci.h
index 6c2077e..6899edc 100644
--- a/system/public/magenta/device/bt-hci.h
+++ b/system/public/zircon/device/bt-hci.h
@@ -7,8 +7,8 @@
 // clang-format off
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 __BEGIN_CDECLS
 
@@ -50,14 +50,14 @@
 #define IOCTL_BT_HCI_GET_SNOOP_CHANNEL \
     IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_BT_HCI, 2)
 
-// ssize_t ioctl_bt_hci_get_command_channel(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_bt_hci_get_command_channel, IOCTL_BT_HCI_GET_COMMAND_CHANNEL, mx_handle_t);
+// ssize_t ioctl_bt_hci_get_command_channel(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_bt_hci_get_command_channel, IOCTL_BT_HCI_GET_COMMAND_CHANNEL, zx_handle_t);
 
-// ssize_t ioctl_bt_hci_get_acl_data_channel(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_bt_hci_get_acl_data_channel, IOCTL_BT_HCI_GET_ACL_DATA_CHANNEL, mx_handle_t);
+// ssize_t ioctl_bt_hci_get_acl_data_channel(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_bt_hci_get_acl_data_channel, IOCTL_BT_HCI_GET_ACL_DATA_CHANNEL, zx_handle_t);
 
-// ssize_t ioctl_bt_hci_get_snoop_channel(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_bt_hci_get_snoop_channel, IOCTL_BT_HCI_GET_SNOOP_CHANNEL, mx_handle_t);
+// ssize_t ioctl_bt_hci_get_snoop_channel(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_bt_hci_get_snoop_channel, IOCTL_BT_HCI_GET_SNOOP_CHANNEL, zx_handle_t);
 
 // TODO(armansito): Add ioctls for ACL and SCO
 
diff --git a/system/public/magenta/device/console.h b/system/public/zircon/device/console.h
similarity index 90%
rename from system/public/magenta/device/console.h
rename to system/public/zircon/device/console.h
index ea14bf4..7bca64f 100644
--- a/system/public/magenta/device/console.h
+++ b/system/public/zircon/device/console.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 #define IOCTL_CONSOLE_GET_DIMENSIONS \
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_CONSOLE, 1)
diff --git a/system/public/magenta/device/device.h b/system/public/zircon/device/device.h
similarity index 85%
rename from system/public/magenta/device/device.h
rename to system/public/zircon/device/device.h
index 8fdeb36..4c65e9c 100644
--- a/system/public/magenta/device/device.h
+++ b/system/public/zircon/device/device.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
 
 // Bind to a driver
 //   in: path to the driver to bind (optional)
@@ -60,17 +60,17 @@
 
 // Indicates if there's data available to read,
 // or room to write, or an error condition.
-#define DEVICE_SIGNAL_READABLE MX_USER_SIGNAL_0
-#define DEVICE_SIGNAL_OOB      MX_USER_SIGNAL_1
-#define DEVICE_SIGNAL_WRITABLE MX_USER_SIGNAL_2
-#define DEVICE_SIGNAL_ERROR    MX_USER_SIGNAL_3
-#define DEVICE_SIGNAL_HANGUP   MX_USER_SIGNAL_4
+#define DEVICE_SIGNAL_READABLE ZX_USER_SIGNAL_0
+#define DEVICE_SIGNAL_OOB      ZX_USER_SIGNAL_1
+#define DEVICE_SIGNAL_WRITABLE ZX_USER_SIGNAL_2
+#define DEVICE_SIGNAL_ERROR    ZX_USER_SIGNAL_3
+#define DEVICE_SIGNAL_HANGUP   ZX_USER_SIGNAL_4
 
 // ssize_t ioctl_device_bind(int fd, const char* in, size_t in_len);
 IOCTL_WRAPPER_VARIN(ioctl_device_bind, IOCTL_DEVICE_BIND, char);
 
-// ssize_t ioctl_device_get_event_handle(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_device_get_event_handle, IOCTL_DEVICE_GET_EVENT_HANDLE, mx_handle_t);
+// ssize_t ioctl_device_get_event_handle(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_device_get_event_handle, IOCTL_DEVICE_GET_EVENT_HANDLE, zx_handle_t);
 
 // ssize_t ioctl_device_get_driver_name(int fd, char* out, size_t out_len);
 IOCTL_WRAPPER_VAROUT(ioctl_device_get_driver_name, IOCTL_DEVICE_GET_DRIVER_NAME, char);
diff --git a/system/public/magenta/device/display.h b/system/public/zircon/device/display.h
similarity index 85%
rename from system/public/magenta/device/display.h
rename to system/public/zircon/device/display.h
index 7a711e6..8951057 100644
--- a/system/public/magenta/device/display.h
+++ b/system/public/zircon/device/display.h
@@ -5,20 +5,20 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
 
-#define MX_DISPLAY_FLAG_HW_FRAMEBUFFER (1 << 0)
+#define ZX_DISPLAY_FLAG_HW_FRAMEBUFFER (1 << 0)
 
-typedef struct mx_display_info {
+typedef struct zx_display_info {
     uint32_t format;
     uint32_t width;
     uint32_t height;
     uint32_t stride;
     uint32_t pixelsize;
     uint32_t flags;
-} mx_display_info_t;
+} zx_display_info_t;
 
 // Return the framebuffer
 //   in: none
@@ -50,7 +50,7 @@
 // and with USER_SIGNAL_1 when it is released for use
 // by other clients.
 //  in: none
-//  out: mx_handle_t
+//  out: zx_handle_t
 #define IOCTL_DISPLAY_GET_OWNERSHIP_CHANGE_EVENT \
     IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_DISPLAY, 5)
 
@@ -60,8 +60,8 @@
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_DISPLAY, 6)
 
 typedef struct {
-    mx_handle_t vmo;
-    mx_display_info_t info;
+    zx_handle_t vmo;
+    zx_display_info_t info;
 } ioctl_display_get_fb_t;
 
 typedef struct {
@@ -83,8 +83,8 @@
 // ssize_t ioctl_display_set_fullscreen(int fd, uint32_t in);
 IOCTL_WRAPPER_IN(ioctl_display_set_fullscreen, IOCTL_DISPLAY_SET_FULLSCREEN, uint32_t);
 
-// ssize_t ioctl_display_get_ownership_change_event(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_display_get_ownership_change_event, IOCTL_DISPLAY_GET_OWNERSHIP_CHANGE_EVENT, mx_handle_t);
+// ssize_t ioctl_display_get_ownership_change_event(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_display_get_ownership_change_event, IOCTL_DISPLAY_GET_OWNERSHIP_CHANGE_EVENT, zx_handle_t);
 
 // ssize_t ioctl_display_set_owner(int fd, uint32_t owner);
 IOCTL_WRAPPER_IN(ioctl_display_set_owner, IOCTL_DISPLAY_SET_OWNER, uint32_t)
\ No newline at end of file
diff --git a/system/public/magenta/device/dmctl.h b/system/public/zircon/device/dmctl.h
similarity index 86%
rename from system/public/magenta/device/dmctl.h
rename to system/public/zircon/device/dmctl.h
index bb3d0ba..23d3d1e 100644
--- a/system/public/magenta/device/dmctl.h
+++ b/system/public/zircon/device/dmctl.h
@@ -5,17 +5,17 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 // Returns a handle to the system loader service, a channel that speaks
 // the protocol expected by dl_set_loader_service().  Should only be
-// used by mxio: see mxio/loader-service.h.
+// used by fdio: see fdio/loader-service.h.
 #define IOCTL_DMCTL_GET_LOADER_SERVICE_CHANNEL \
     IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_DMCTL, 0)
 
 typedef struct {
-    mx_handle_t h;
+    zx_handle_t h;
     char name[64];
 } dmctl_cmd_t;
 
@@ -45,7 +45,7 @@
     union {
         struct {
             uint32_t protocol_id;
-            // header is followed by props_len mx_device_prop_t
+            // header is followed by props_len zx_device_prop_t
             // and path_len of topological path (no \0 terminator)
             uint32_t props_len;
             uint32_t path_len;
@@ -67,15 +67,15 @@
 #define DEVMGR_FLAGS_BOUND 1
 
 
-// ssize_t ioctl_dmctl_get_loader_service_channel(int fd, mx_handle_t* channel_out);
+// ssize_t ioctl_dmctl_get_loader_service_channel(int fd, zx_handle_t* channel_out);
 IOCTL_WRAPPER_OUT(ioctl_dmctl_get_loader_service_channel,
-                  IOCTL_DMCTL_GET_LOADER_SERVICE_CHANNEL, mx_handle_t);
+                  IOCTL_DMCTL_GET_LOADER_SERVICE_CHANNEL, zx_handle_t);
 
 // ssize_t ioctl_dmctl_command(int fd, dmctl_cmd_t* cmd);
 IOCTL_WRAPPER_IN(ioctl_dmctl_command, IOCTL_DMCTL_COMMAND, dmctl_cmd_t);
 
 // ssize_t ioctl_dmctl_open_virtcon(int fd, dmctl_cmd_t* cmd);
-IOCTL_WRAPPER_IN(ioctl_dmctl_open_virtcon, IOCTL_DMCTL_OPEN_VIRTCON, mx_handle_t);
+IOCTL_WRAPPER_IN(ioctl_dmctl_open_virtcon, IOCTL_DMCTL_OPEN_VIRTCON, zx_handle_t);
 
 // ssize_t ioctl_dmctl_watch_devmgr(int fd, dmctl_cmd_t* cmd);
-IOCTL_WRAPPER_IN(ioctl_dmctl_watch_devmgr, IOCTL_DMCTL_WATCH_DEVMGR, mx_handle_t);
\ No newline at end of file
+IOCTL_WRAPPER_IN(ioctl_dmctl_watch_devmgr, IOCTL_DMCTL_WATCH_DEVMGR, zx_handle_t);
\ No newline at end of file
diff --git a/system/public/magenta/device/ethernet.h b/system/public/zircon/device/ethernet.h
similarity index 92%
rename from system/public/magenta/device/ethernet.h
rename to system/public/zircon/device/ethernet.h
index a81b9d4..e6ec9c8 100644
--- a/system/public/magenta/device/ethernet.h
+++ b/system/public/zircon/device/ethernet.h
@@ -5,9 +5,9 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
 
 // TODO: GET_DEVICE_INFO ioctl
 
@@ -25,7 +25,7 @@
     uint32_t reserved[12];
 } eth_info_t;
 
-#define ETH_SIGNAL_STATUS MX_USER_SIGNAL_0
+#define ETH_SIGNAL_STATUS ZX_USER_SIGNAL_0
 
 // Ethernet device features
 
@@ -42,21 +42,21 @@
 
 typedef struct eth_fifos_t {
     // handles to tx and rx fifos
-    mx_handle_t tx_fifo;
-    mx_handle_t rx_fifo;
+    zx_handle_t tx_fifo;
+    zx_handle_t rx_fifo;
     // maximum number of items in fifos
     uint32_t tx_depth;
     uint32_t rx_depth;
 } eth_fifos_t;
 
 // Set the io buffer that tx and rx operations act on
-//   in: mx_handle_t (vmo)
+//   in: zx_handle_t (vmo)
 //  out: none
 #define IOCTL_ETHERNET_SET_IOBUF \
     IOCTL(IOCTL_KIND_SET_HANDLE, IOCTL_FAMILY_ETH, 2)
 
 // Start/Stop transferring packets
-// Start will not succeed (MX_ERR_BAD_STATE) until the fifos have been
+// Start will not succeed (ZX_ERR_BAD_STATE) until the fifos have been
 // obtained and an io buffer vmo has been registered.
 #define IOCTL_ETHERNET_START \
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_ETH, 3)
@@ -128,8 +128,8 @@
 // ssize_t ioctl_ethernet_get_fifos(int fd, eth_fifos_t* out);
 IOCTL_WRAPPER_OUT(ioctl_ethernet_get_fifos, IOCTL_ETHERNET_GET_FIFOS, eth_fifos_t);
 
-// ssize_t ioctl_ethernet_set_iobuf(int fd, mx_handle_t_t* entries);
-IOCTL_WRAPPER_IN(ioctl_ethernet_set_iobuf, IOCTL_ETHERNET_SET_IOBUF, mx_handle_t);
+// ssize_t ioctl_ethernet_set_iobuf(int fd, zx_handle_t_t* entries);
+IOCTL_WRAPPER_IN(ioctl_ethernet_set_iobuf, IOCTL_ETHERNET_SET_IOBUF, zx_handle_t);
 
 // ssize_t ioctl_ethernet_start(int fd);
 IOCTL_WRAPPER(ioctl_ethernet_start, IOCTL_ETHERNET_START);
diff --git a/system/public/magenta/device/ethertap.h b/system/public/zircon/device/ethertap.h
similarity index 83%
rename from system/public/magenta/device/ethertap.h
rename to system/public/zircon/device/ethertap.h
index 7bd7f7e..7443d50 100644
--- a/system/public/magenta/device/ethertap.h
+++ b/system/public/zircon/device/ethertap.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 #include <stdint.h>
 
@@ -17,8 +17,8 @@
 // Ethertap signals on the socket are used to indicate link status. It is an error to assert that a
 // device is both online and offline; the device will be shutdown. A device is in the offline state
 // when it is created.
-#define ETHERTAP_SIGNAL_ONLINE  MX_USER_SIGNAL_0
-#define ETHERTAP_SIGNAL_OFFLINE MX_USER_SIGNAL_1
+#define ETHERTAP_SIGNAL_ONLINE  ZX_USER_SIGNAL_0
+#define ETHERTAP_SIGNAL_OFFLINE ZX_USER_SIGNAL_1
 
 // Enables tracing of the ethertap device itself
 #define ETHERTAP_OPT_TRACE         (1u << 0)
@@ -39,6 +39,6 @@
     uint8_t mac[6];
 } ethertap_ioctl_config_t;
 
-// ssize_t ioctl_ethertap_config(int fd, const ethertap_ioctl_config_t* in, mx_handle_t* out);
+// ssize_t ioctl_ethertap_config(int fd, const ethertap_ioctl_config_t* in, zx_handle_t* out);
 IOCTL_WRAPPER_INOUT(ioctl_ethertap_config, IOCTL_ETHERTAP_CONFIG, \
-        ethertap_ioctl_config_t, mx_handle_t);
+        ethertap_ioctl_config_t, zx_handle_t);
diff --git a/system/public/magenta/device/hidctl.h b/system/public/zircon/device/hidctl.h
similarity index 89%
rename from system/public/magenta/device/hidctl.h
rename to system/public/zircon/device/hidctl.h
index eb9845f..a5a4ed6 100644
--- a/system/public/magenta/device/hidctl.h
+++ b/system/public/zircon/device/hidctl.h
@@ -7,8 +7,8 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 #define IOCTL_HID_CTL_CONFIG \
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_HID, 0)
diff --git a/system/public/magenta/device/i2c.h b/system/public/zircon/device/i2c.h
similarity index 95%
rename from system/public/magenta/device/i2c.h
rename to system/public/zircon/device/i2c.h
index 8448acd..e820212 100644
--- a/system/public/magenta/device/i2c.h
+++ b/system/public/zircon/device/i2c.h
@@ -5,9 +5,9 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/compiler.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/public/magenta/device/input.h b/system/public/zircon/device/input.h
similarity index 97%
rename from system/public/magenta/device/input.h
rename to system/public/zircon/device/input.h
index e296b33..8a79195 100644
--- a/system/public/magenta/device/input.h
+++ b/system/public/zircon/device/input.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 #define IOCTL_INPUT_GET_PROTOCOL \
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_INPUT, 0)
diff --git a/system/public/magenta/device/intel-hda.h b/system/public/zircon/device/intel-hda.h
similarity index 93%
rename from system/public/magenta/device/intel-hda.h
rename to system/public/zircon/device/intel-hda.h
index 35208d0..76b408d 100644
--- a/system/public/magenta/device/intel-hda.h
+++ b/system/public/zircon/device/intel-hda.h
@@ -4,15 +4,15 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/types.h>
 
 #define IHDA_IOCTL_GET_CHANNEL IOCTL(IOCTL_KIND_GET_HANDLE, 0xFF, 0x00)
 
-// When communicating with an IHDA driver using mx_channel_call, do not use the
+// When communicating with an IHDA driver using zx_channel_call, do not use the
 // IHDA_INVALID_TRANSACTION_ID as your message's transaction ID.
-#define IHDA_INVALID_TRANSACTION_ID ((mx_txid_t)0)
+#define IHDA_INVALID_TRANSACTION_ID ((zx_txid_t)0)
 
 // Invalid Stream ID and Stream TAG.  These values will never be returned as
 // part of a successful REQUEST_STREAM response.
@@ -38,7 +38,7 @@
 } ihda_cmd_t;
 
 typedef struct ihda_cmd_hdr {
-    mx_txid_t  transaction_id;
+    zx_txid_t  transaction_id;
     ihda_cmd_t cmd;
 } ihda_cmd_hdr_t;
 
@@ -100,7 +100,7 @@
 
 typedef struct ihda_codec_request_stream_resp {
     ihda_cmd_hdr_t  hdr;
-    mx_status_t     result;
+    zx_status_t     result;
     uint16_t        stream_id;
     uint8_t         stream_tag;
 } ihda_codec_request_stream_resp_t;
diff --git a/system/public/magenta/device/intel-pt.h b/system/public/zircon/device/intel-pt.h
similarity index 97%
rename from system/public/magenta/device/intel-pt.h
rename to system/public/zircon/device/intel-pt.h
index 7807a9b..2e25937 100644
--- a/system/public/magenta/device/intel-pt.h
+++ b/system/public/zircon/device/intel-pt.h
@@ -4,13 +4,13 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 #ifdef __Fuchsia__
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
 #include <stddef.h>
 #endif
 
@@ -155,7 +155,7 @@
 
 // Macros for extracting info from ToPA entries
 #define IPT_TOPA_ENTRY_EXTRACT_PHYS_ADDR(e) \
-  ((mx_paddr_t)((e) & ~((1ULL<<12)-1)))
+  ((zx_paddr_t)((e) & ~((1ULL<<12)-1)))
 #define IPT_TOPA_ENTRY_EXTRACT_SIZE(e) ((uint)((((e) >> 6) & 0xf) + 12))
 
 // Arbitarily picked constants for ourselves.
@@ -175,7 +175,7 @@
     struct {
         uint64_t a,b;
     } addr_ranges[IPT_MAX_NUM_ADDR_RANGES];
-} mx_x86_pt_regs_t;
+} zx_x86_pt_regs_t;
 
 // Two "modes" of tracing are supported:
 // trace each cpu, regardless of what's running on it
@@ -218,7 +218,7 @@
 
 typedef struct {
     // for IOCTL_KIND_SET_HANDLE first element must be the handle
-    mx_handle_t thread;
+    zx_handle_t thread;
     uint32_t descriptor;
 } ioctl_ipt_assign_buffer_thread_t;
 
@@ -274,7 +274,7 @@
 #define IOCTL_IPT_GET_BUFFER_HANDLE \
     IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_IPT, 8)
 IOCTL_WRAPPER_INOUT(ioctl_ipt_get_buffer_handle, IOCTL_IPT_GET_BUFFER_HANDLE,
-                    ioctl_ipt_buffer_handle_req_t, mx_handle_t);
+                    ioctl_ipt_buffer_handle_req_t, zx_handle_t);
 
 // free a trace buffer
 // Input: trace buffer descriptor
diff --git a/system/public/magenta/device/ioctl-wrapper.h b/system/public/zircon/device/ioctl-wrapper.h
similarity index 70%
rename from system/public/magenta/device/ioctl-wrapper.h
rename to system/public/zircon/device/ioctl-wrapper.h
index 6c9b60e..5039b7e 100644
--- a/system/public/magenta/device/ioctl-wrapper.h
+++ b/system/public/zircon/device/ioctl-wrapper.h
@@ -4,57 +4,57 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stddef.h>
 #include <sys/types.h>
 
 __BEGIN_CDECLS
 
-extern ssize_t mxio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len);
+extern ssize_t fdio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len);
 
 #define IOCTL_WRAPPER(name, op) \
 static inline ssize_t name(int fd) {             \
-    return mxio_ioctl(fd, op, NULL, 0, NULL, 0); \
+    return fdio_ioctl(fd, op, NULL, 0, NULL, 0); \
 }
 
 #define IOCTL_WRAPPER_IN(name, op, type) \
 static inline ssize_t name(int fd, const type* in) {     \
-    return mxio_ioctl(fd, op, in, in ? sizeof(*in) : 0, NULL, 0); \
+    return fdio_ioctl(fd, op, in, in ? sizeof(*in) : 0, NULL, 0); \
 }
 
 #define IOCTL_WRAPPER_VARIN(name, op, type) \
 static inline ssize_t name(int fd, const type* in, size_t in_len) { \
-    return mxio_ioctl(fd, op, in, in_len, NULL, 0);                  \
+    return fdio_ioctl(fd, op, in, in_len, NULL, 0);                  \
 }
 
 #define IOCTL_WRAPPER_OUT(name, op, type) \
 static inline ssize_t name(int fd, type* out) {            \
-    return mxio_ioctl(fd, op, NULL, 0, out, out ? sizeof(*out) : 0); \
+    return fdio_ioctl(fd, op, NULL, 0, out, out ? sizeof(*out) : 0); \
 }
 
 #define IOCTL_WRAPPER_VAROUT(name, op, type) \
 static inline ssize_t name(int fd, type* out, size_t out_len) { \
-    return mxio_ioctl(fd, op, NULL, 0, out, out_len);           \
+    return fdio_ioctl(fd, op, NULL, 0, out, out_len);           \
 }
 
 #define IOCTL_WRAPPER_INOUT(name, op, intype, outtype) \
 static inline ssize_t name(int fd, const intype* in, outtype* out) { \
-    return mxio_ioctl(fd, op, in, in ? sizeof(*in) : 0, out, out ? sizeof(*out) : 0);   \
+    return fdio_ioctl(fd, op, in, in ? sizeof(*in) : 0, out, out ? sizeof(*out) : 0);   \
 }
 
 #define IOCTL_WRAPPER_VARIN_OUT(name, op, intype, outtype) \
 static inline ssize_t name(int fd, const intype* in, size_t in_len, outtype* out) { \
-    return mxio_ioctl(fd, op, in, in_len, out, out ? sizeof(*out) : 0);                       \
+    return fdio_ioctl(fd, op, in, in_len, out, out ? sizeof(*out) : 0);                       \
 }
 
 #define IOCTL_WRAPPER_IN_VAROUT(name, op, intype, outtype) \
 static inline ssize_t name(int fd, const intype* in, outtype* out, size_t out_len) { \
-    return mxio_ioctl(fd, op, in, in ? sizeof(*in) : 0, out, out_len);                        \
+    return fdio_ioctl(fd, op, in, in ? sizeof(*in) : 0, out, out_len);                        \
 }
 
 #define IOCTL_WRAPPER_VARIN_VAROUT(name, op, intype, outtype) \
 static inline ssize_t name(int fd, const intype* in, size_t in_len, outtype* out, size_t out_len) { \
-    return mxio_ioctl(fd, op, in, in_len, out, out_len);                                            \
+    return fdio_ioctl(fd, op, in, in_len, out, out_len);                                            \
 }
 
 __END_CDECLS
diff --git a/system/public/magenta/device/ioctl.h b/system/public/zircon/device/ioctl.h
similarity index 100%
rename from system/public/magenta/device/ioctl.h
rename to system/public/zircon/device/ioctl.h
diff --git a/system/public/magenta/device/ktrace.h b/system/public/zircon/device/ktrace.h
similarity index 68%
rename from system/public/magenta/device/ktrace.h
rename to system/public/zircon/device/ktrace.h
index dd64aab..a77554d 100644
--- a/system/public/magenta/device/ktrace.h
+++ b/system/public/zircon/device/ktrace.h
@@ -6,23 +6,23 @@
 
 #include <string.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
-// return a handle usable with mx_ktrace_write()
+// return a handle usable with zx_ktrace_write()
 #define IOCTL_KTRACE_GET_HANDLE \
     IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_KTRACE, 1)
 
 // define a new ktrace probe name
-// input: ascii probe name, < MX_MAX_NAME_LEN
-// reply: uint32_t probe id usable with mx_ktrace_write()
+// input: ascii probe name, < ZX_MAX_NAME_LEN
+// reply: uint32_t probe id usable with zx_ktrace_write()
 #define IOCTL_KTRACE_ADD_PROBE \
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_KTRACE, 2)
 
-IOCTL_WRAPPER_OUT(ioctl_ktrace_get_handle, IOCTL_KTRACE_GET_HANDLE, mx_handle_t);
+IOCTL_WRAPPER_OUT(ioctl_ktrace_get_handle, IOCTL_KTRACE_GET_HANDLE, zx_handle_t);
 // Start tracing.
 // input: The group_mask
 #define IOCTL_KTRACE_START \
@@ -32,8 +32,8 @@
 #define IOCTL_KTRACE_STOP \
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_KTRACE, 4)
 
-static inline mx_status_t ioctl_ktrace_add_probe(int fd, const char* name, uint32_t* probe_id) {
-    return mxio_ioctl(fd, IOCTL_KTRACE_ADD_PROBE,
+static inline zx_status_t ioctl_ktrace_add_probe(int fd, const char* name, uint32_t* probe_id) {
+    return fdio_ioctl(fd, IOCTL_KTRACE_ADD_PROBE,
                       name, strlen(name), probe_id, sizeof(uint32_t));
 }
 
diff --git a/system/public/magenta/device/midi.h b/system/public/zircon/device/midi.h
similarity index 89%
rename from system/public/magenta/device/midi.h
rename to system/public/zircon/device/midi.h
index c6da3f5..90024c2 100644
--- a/system/public/magenta/device/midi.h
+++ b/system/public/zircon/device/midi.h
@@ -7,8 +7,8 @@
 // clang-format off
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 __BEGIN_CDECLS
 
diff --git a/system/public/magenta/device/power.h b/system/public/zircon/device/power.h
similarity index 93%
rename from system/public/magenta/device/power.h
rename to system/public/zircon/device/power.h
index d2b8c9d..0b25791 100644
--- a/system/public/magenta/device/power.h
+++ b/system/public/zircon/device/power.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 typedef struct {
     uint32_t type;
@@ -73,7 +73,7 @@
 #define IOCTL_POWER_GET_BATTERY_INFO \
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_POWER, 2)
 
-// Get an event to get state change notifications on. MX_SIGNAL_USER_0 is
+// Get an event to get state change notifications on. ZX_SIGNAL_USER_0 is
 // asserted when power_info_t.state is changed. It is deasserted when the
 // state is read via IOCTL_POWER_GET_INFO.
 #define IOCTL_POWER_GET_STATE_CHANGE_EVENT \
@@ -87,7 +87,7 @@
                   IOCTL_POWER_GET_BATTERY_INFO,
                   battery_info_t);
 
-// ssize_t ioctl_power_get_state_change_event(int fd, mx_handle_t* out)
+// ssize_t ioctl_power_get_state_change_event(int fd, zx_handle_t* out)
 IOCTL_WRAPPER_OUT(ioctl_power_get_state_change_event,
                   IOCTL_POWER_GET_STATE_CHANGE_EVENT,
-                  mx_handle_t);
+                  zx_handle_t);
diff --git a/system/public/magenta/device/pty.h b/system/public/zircon/device/pty.h
similarity index 96%
rename from system/public/magenta/device/pty.h
rename to system/public/zircon/device/pty.h
index c4e8142..65ed5f1 100644
--- a/system/public/magenta/device/pty.h
+++ b/system/public/zircon/device/pty.h
@@ -5,9 +5,9 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
 
 
 // A PTY (pseudoterminal) emulates terminal devices, with a
diff --git a/system/public/magenta/device/ramdisk.h b/system/public/zircon/device/ramdisk.h
similarity index 92%
rename from system/public/magenta/device/ramdisk.h
rename to system/public/zircon/device/ramdisk.h
index d8af581..33ff2e0 100644
--- a/system/public/magenta/device/ramdisk.h
+++ b/system/public/zircon/device/ramdisk.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include <limits.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 #define IOCTL_RAMDISK_CONFIG \
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_RAMDISK, 1)
diff --git a/system/public/magenta/device/rtc.h b/system/public/zircon/device/rtc.h
similarity index 86%
rename from system/public/magenta/device/rtc.h
rename to system/public/zircon/device/rtc.h
index 43d63a7..71738c9 100644
--- a/system/public/magenta/device/rtc.h
+++ b/system/public/zircon/device/rtc.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/compiler.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 #include <stdint.h>
 
 __BEGIN_CDECLS;
diff --git a/system/public/zircon/device/sysinfo.h b/system/public/zircon/device/sysinfo.h
new file mode 100644
index 0000000..48d0fe0
--- /dev/null
+++ b/system/public/zircon/device/sysinfo.h
@@ -0,0 +1,38 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <stdint.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
+
+
+// Return the root job handle
+//   in: none
+//   out: zx_handle_t
+#define IOCTL_SYSINFO_GET_ROOT_JOB \
+    IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_SYSINFO, 1)
+
+// Return the root resource (with only ZX_RIGHT_ENUMERATE and ZX_RIGHT_TRANSFER)
+//   in: none
+//   out: zx_handle_t
+#define IOCTL_SYSINFO_GET_ROOT_RESOURCE \
+    IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_SYSINFO, 2)
+
+// Return the hypervisor resource (with only ZX_RIGHT_TRANSFER)
+//   in: none
+//   out: zx_handle_t
+#define IOCTL_SYSINFO_GET_HYPERVISOR_RESOURCE \
+    IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_SYSINFO, 3)
+
+// ssize_t ioctl_sysinfo_get_root_job(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_sysinfo_get_root_job, IOCTL_SYSINFO_GET_ROOT_JOB, zx_handle_t);
+
+// ssize_t ioctl_sysinfo_get_root_resource(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_sysinfo_get_root_resource, IOCTL_SYSINFO_GET_ROOT_RESOURCE, zx_handle_t);
+
+// ssize_t ioctl_sysinfo_get_hypervisor_resource(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_sysinfo_get_hypervisor_resource, IOCTL_SYSINFO_GET_HYPERVISOR_RESOURCE, zx_handle_t);
diff --git a/system/public/magenta/device/test.h b/system/public/zircon/device/test.h
similarity index 84%
rename from system/public/magenta/device/test.h
rename to system/public/zircon/device/test.h
index d208b64..65bfcb3 100644
--- a/system/public/magenta/device/test.h
+++ b/system/public/zircon/device/test.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
 
 // Create a test device, only supported by /dev/misc/test
 //   in: null-terminated string device name
@@ -27,13 +27,13 @@
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_TEST, 2)
 
 // Set an output socket
-//   in: mx_handle_t*
+//   in: zx_handle_t*
 //   out: none
 #define IOCTL_TEST_SET_OUTPUT_SOCKET \
     IOCTL(IOCTL_KIND_SET_HANDLE, IOCTL_FAMILY_TEST, 3)
 
 // Set a control channel
-//   in: mx_handle_t*
+//   in: zx_handle_t*
 //   out: none
 #define IOCTL_TEST_SET_CONTROL_CHANNEL \
     IOCTL(IOCTL_KIND_SET_HANDLE, IOCTL_FAMILY_TEST, 4)
@@ -53,8 +53,8 @@
 // ssize_t ioctl_test_run_tests(int fd, void* in, size_t in_len, test_ioctl_test_report_t* out);
 IOCTL_WRAPPER_VARIN_OUT(ioctl_test_run_tests, IOCTL_TEST_RUN_TESTS, void*, test_ioctl_test_report_t);
 
-// ssize_t ioctl_test_set_output_socket(int fd, mx_handle_t in)
-IOCTL_WRAPPER_IN(ioctl_test_set_output_socket, IOCTL_TEST_SET_OUTPUT_SOCKET, mx_handle_t)
+// ssize_t ioctl_test_set_output_socket(int fd, zx_handle_t in)
+IOCTL_WRAPPER_IN(ioctl_test_set_output_socket, IOCTL_TEST_SET_OUTPUT_SOCKET, zx_handle_t)
 
-// ssize_t ioctl_test_set_control_channel(int fd, mx_handle_t in)
-IOCTL_WRAPPER_IN(ioctl_test_set_control_channel, IOCTL_TEST_SET_CONTROL_CHANNEL, mx_handle_t)
+// ssize_t ioctl_test_set_control_channel(int fd, zx_handle_t in)
+IOCTL_WRAPPER_IN(ioctl_test_set_control_channel, IOCTL_TEST_SET_CONTROL_CHANNEL, zx_handle_t)
diff --git a/system/public/magenta/device/tpm.h b/system/public/zircon/device/tpm.h
similarity index 84%
rename from system/public/magenta/device/tpm.h
rename to system/public/zircon/device/tpm.h
index 9c03b9b..bb89a09 100644
--- a/system/public/magenta/device/tpm.h
+++ b/system/public/zircon/device/tpm.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/public/magenta/device/usb-device.h b/system/public/zircon/device/usb-device.h
similarity index 94%
rename from system/public/magenta/device/usb-device.h
rename to system/public/zircon/device/usb-device.h
index 8235ace..7df4c36 100644
--- a/system/public/magenta/device/usb-device.h
+++ b/system/public/zircon/device/usb-device.h
@@ -8,9 +8,9 @@
 
 #include <stdbool.h>
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/hw/usb.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/hw/usb.h>
 
 typedef struct {
     uint8_t interface_class;
diff --git a/system/public/magenta/device/usb-virt-bus.h b/system/public/zircon/device/usb-virt-bus.h
similarity index 90%
rename from system/public/magenta/device/usb-virt-bus.h
rename to system/public/zircon/device/usb-virt-bus.h
index d6e00fb..da50b54 100644
--- a/system/public/magenta/device/usb-virt-bus.h
+++ b/system/public/zircon/device/usb-virt-bus.h
@@ -7,8 +7,8 @@
 // clang-format off
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
 
 __BEGIN_CDECLS
 
diff --git a/system/public/magenta/device/usb.h b/system/public/zircon/device/usb.h
similarity index 96%
rename from system/public/magenta/device/usb.h
rename to system/public/zircon/device/usb.h
index 47dcff5..467ffb8 100644
--- a/system/public/magenta/device/usb.h
+++ b/system/public/zircon/device/usb.h
@@ -7,9 +7,9 @@
 // clang-format off
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/hw/usb.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/hw/usb.h>
 
 __BEGIN_CDECLS
 
@@ -98,7 +98,7 @@
 
 static inline ssize_t ioctl_usb_set_interface(int fd, int interface_number, int alt_setting) {
     int args[2] = { interface_number, alt_setting };
-    return mxio_ioctl(fd, IOCTL_USB_SET_INTERFACE, args, sizeof(args), NULL, 0);
+    return fdio_ioctl(fd, IOCTL_USB_SET_INTERFACE, args, sizeof(args), NULL, 0);
 }
 
 IOCTL_WRAPPER_OUT(ioctl_usb_get_current_frame, IOCTL_USB_GET_CURRENT_FRAME, uint64_t);
diff --git a/system/public/magenta/device/vfs.h b/system/public/zircon/device/vfs.h
similarity index 89%
rename from system/public/magenta/device/vfs.h
rename to system/public/zircon/device/vfs.h
index e168eb9..ffcf22e 100644
--- a/system/public/magenta/device/vfs.h
+++ b/system/public/zircon/device/vfs.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/types.h>
 
 #define MAX_FS_NAME_LEN 32
 
@@ -61,7 +61,7 @@
     IOCTL(IOCTL_KIND_DEFAULT, IOCTL_FAMILY_VFS, 9)
 
 typedef struct {
-    mx_handle_t channel; // Channel to which watch events will be sent
+    zx_handle_t channel; // Channel to which watch events will be sent
     uint32_t mask;       // Bitmask of desired events (1 << WATCH_EVT_*)
     uint32_t options;    // Options.  Must be zero.
 } vfs_watch_dir_t;
@@ -107,17 +107,17 @@
 #define VFS_WATCH_NAME_MAX 255
 #define VFS_WATCH_MSG_MAX 8192
 
-// ssize_t ioctl_vfs_mount_fs(int fd, mx_handle_t* in);
-IOCTL_WRAPPER_IN(ioctl_vfs_mount_fs, IOCTL_VFS_MOUNT_FS, mx_handle_t);
+// ssize_t ioctl_vfs_mount_fs(int fd, zx_handle_t* in);
+IOCTL_WRAPPER_IN(ioctl_vfs_mount_fs, IOCTL_VFS_MOUNT_FS, zx_handle_t);
 
 // ssize_t ioctl_vfs_unmount_fs(int fd);
 IOCTL_WRAPPER(ioctl_vfs_unmount_fs, IOCTL_VFS_UNMOUNT_FS);
 
-// ssize_t ioctl_vfs_unmount_node(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_vfs_unmount_node, IOCTL_VFS_UNMOUNT_NODE, mx_handle_t);
+// ssize_t ioctl_vfs_unmount_node(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_vfs_unmount_node, IOCTL_VFS_UNMOUNT_NODE, zx_handle_t);
 
-// ssize_t ioctl_vfs_mount_bootfs_vmo(int fd, mx_handle_t* in);
-IOCTL_WRAPPER_IN(ioctl_vfs_mount_bootfs_vmo, IOCTL_VFS_MOUNT_BOOTFS_VMO, mx_handle_t);
+// ssize_t ioctl_vfs_mount_bootfs_vmo(int fd, zx_handle_t* in);
+IOCTL_WRAPPER_IN(ioctl_vfs_mount_bootfs_vmo, IOCTL_VFS_MOUNT_BOOTFS_VMO, zx_handle_t);
 
 typedef struct vfs_query_info {
     // these are the total/used # of data bytes, not # of entire disk bytes
@@ -131,8 +131,8 @@
 // ssize_t ioctl_vfs_query_fs(int fd, vfs_query_info_t* out, size_t out_len);
 IOCTL_WRAPPER_VAROUT(ioctl_vfs_query_fs, IOCTL_VFS_QUERY_FS, vfs_query_info_t);
 
-// ssize_t ioctl_vfs_get_token(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_vfs_get_token, IOCTL_VFS_GET_TOKEN, mx_handle_t);
+// ssize_t ioctl_vfs_get_token(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_vfs_get_token, IOCTL_VFS_GET_TOKEN, zx_handle_t);
 
 // ssize_t ioctl_vfs_watch_dir(int fd, vfs_watch_dir_t* in);
 IOCTL_WRAPPER_IN(ioctl_vfs_watch_dir, IOCTL_VFS_WATCH_DIR, vfs_watch_dir_t);
@@ -141,7 +141,7 @@
 IOCTL_WRAPPER_VAROUT(ioctl_vfs_get_device_path, IOCTL_VFS_GET_DEVICE_PATH, char);
 
 typedef struct {
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     char name[]; // Null-terminator required
 } vmo_create_config_t;
 
@@ -151,7 +151,7 @@
 #define MOUNT_MKDIR_FLAG_REPLACE 1
 
 typedef struct mount_mkdir_config {
-    mx_handle_t fs_root;
+    zx_handle_t fs_root;
     uint32_t flags;
     char name[]; // Null-terminator required
 } mount_mkdir_config_t;
diff --git a/system/public/magenta/device/wlan.h b/system/public/zircon/device/wlan.h
similarity index 90%
rename from system/public/magenta/device/wlan.h
rename to system/public/zircon/device/wlan.h
index adab6dc..1865e64 100644
--- a/system/public/magenta/device/wlan.h
+++ b/system/public/zircon/device/wlan.h
@@ -7,17 +7,17 @@
 // clang-format off
 
 #include <stdint.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
 #define IOCTL_WLAN_GET_CHANNEL \
     IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_WLAN, 0)
 
-// ssize_t ioctl_wlan_get_channel(int fd, mx_handle_t* out);
-IOCTL_WRAPPER_OUT(ioctl_wlan_get_channel, IOCTL_WLAN_GET_CHANNEL, mx_handle_t);
+// ssize_t ioctl_wlan_get_channel(int fd, zx_handle_t* out);
+IOCTL_WRAPPER_OUT(ioctl_wlan_get_channel, IOCTL_WLAN_GET_CHANNEL, zx_handle_t);
 
 // TODO(tkilbourn): wlan messages defined elsewhere
 
@@ -30,7 +30,7 @@
 // channel that is returned from this ioctl. When all channels are closed, the
 // device stops scanning.
 //   in: wlan_start_scan_args
-//   out: mx_handle_t (channel)
+//   out: zx_handle_t (channel)
 #define IOCTL_WLAN_START_SCAN \
     IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_WLAN, 1)
 
@@ -87,7 +87,7 @@
     // etc.
 } wlan_scan_report;
 
-// ssize_t ioctl_wlan_start_scan(int fd, const wlan_start_scan_args* in, size_t in_len, mx_handle_t* out);
-IOCTL_WRAPPER_VARIN_OUT(ioctl_wlan_start_scan, IOCTL_WLAN_START_SCAN, wlan_start_scan_args, mx_handle_t);
+// ssize_t ioctl_wlan_start_scan(int fd, const wlan_start_scan_args* in, size_t in_len, zx_handle_t* out);
+IOCTL_WRAPPER_VARIN_OUT(ioctl_wlan_start_scan, IOCTL_WLAN_START_SCAN, wlan_start_scan_args, zx_handle_t);
 
 __END_CDECLS
diff --git a/system/public/magenta/driver/binding.h b/system/public/zircon/driver/binding.h
similarity index 79%
rename from system/public/magenta/driver/binding.h
rename to system/public/zircon/driver/binding.h
index d25413c..900074a 100644
--- a/system/public/magenta/driver/binding.h
+++ b/system/public/zircon/driver/binding.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdalign.h>
 #include <stddef.h>
 #include <stdint.h>
@@ -87,7 +87,7 @@
 #define BIND_PCI_BDF_UNPACK_FUNC(bdf) ((uint32_t)(bdf) & 0x07)
 
 // usb binding variables at 0x02XX
-// these are used for both MX_PROTOCOL_USB and MX_PROTOCOL_USB_FUNCTION
+// these are used for both ZX_PROTOCOL_USB and ZX_PROTOCOL_USB_FUNCTION
 #define BIND_USB_VID          0x0200
 #define BIND_USB_PID          0x0201
 #define BIND_USB_CLASS        0x0202
@@ -123,21 +123,21 @@
 // binding will eventually be made via some sort of ACPI device enumeration.
 #define BIND_I2C_ADDR         0x0f00
 
-typedef struct mx_bind_inst {
+typedef struct zx_bind_inst {
     uint32_t op;
     uint32_t arg;
-} mx_bind_inst_t;
+} zx_bind_inst_t;
 
-typedef struct mx_device_prop {
+typedef struct zx_device_prop {
     uint16_t id;
     uint16_t reserved;
     uint32_t value;
-} mx_device_prop_t;
+} zx_device_prop_t;
 
 // simple example
 #if 0
-mx_bind_inst_t i915_binding[] = {
-    BI_ABORT_IF(NE, BIND_PROTOCOL, MX_PROTOCOL_PCI),
+zx_bind_inst_t i915_binding[] = {
+    BI_ABORT_IF(NE, BIND_PROTOCOL, ZX_PROTOCOL_PCI),
     BI_ABORT_IF(NE, BIND_PCI_VID, 0x8086),
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x1616), // broadwell
     BI_MATCH_IF(EQ, BIND_PCI_DID, 0x1916), // skylake
@@ -145,8 +145,8 @@
 };
 #endif
 
-#define MAGENTA_NOTE_NAME "Magenta"
-#define MAGENTA_NOTE_DRIVER 0x31565244 // DRV1
+#define ZIRCON_NOTE_NAME "Zircon"
+#define ZIRCON_NOTE_DRIVER 0x31565244 // DRV1
 
 typedef struct {
     // Elf64_Nhdr fields:
@@ -155,15 +155,15 @@
     uint32_t type;
     // ELF note name.  namesz is the exact size of the name (including '\0'),
     // but the storage size is always rounded up to a multiple of 4 bytes.
-    char name[(sizeof(MAGENTA_NOTE_NAME) + 3) & -4];
-} magenta_driver_note_header_t;
+    char name[(sizeof(ZIRCON_NOTE_NAME) + 3) & -4];
+} zircon_driver_note_header_t;
 
-#define MAGENTA_DRIVER_NOTE_HEADER_INIT(object) {        \
-        /* .namesz = */ sizeof(MAGENTA_NOTE_NAME),              \
+#define ZIRCON_DRIVER_NOTE_HEADER_INIT(object) {        \
+        /* .namesz = */ sizeof(ZIRCON_NOTE_NAME),              \
         /* .descsz = */ (sizeof(object) -                       \
-                         sizeof(magenta_driver_note_header_t)), \
-        /* .type = */ MAGENTA_NOTE_DRIVER,                      \
-        /* .name = */ MAGENTA_NOTE_NAME,                        \
+                         sizeof(zircon_driver_note_header_t)), \
+        /* .type = */ ZIRCON_NOTE_DRIVER,                      \
+        /* .name = */ ZIRCON_NOTE_NAME,                        \
     }
 
 typedef struct {
@@ -178,9 +178,9 @@
     char version[16];
 
     // Driver Bind Program follows
-} magenta_driver_note_payload_t;
+} zircon_driver_note_payload_t;
 
-#define MAGENTA_DRIVER_NOTE_PAYLOAD_INIT(Driver,VendorName,Version,BindCount) \
+#define ZIRCON_DRIVER_NOTE_PAYLOAD_INIT(Driver,VendorName,Version,BindCount) \
     {                                                               \
         /* .flags = */ 0,                                           \
         /* .bindcount = */ (BindCount),                             \
@@ -191,20 +191,20 @@
     }
 
 typedef struct {
-    alignas(4) magenta_driver_note_header_t header;
-    alignas(4) magenta_driver_note_payload_t payload;
-} magenta_driver_note_t;
+    alignas(4) zircon_driver_note_header_t header;
+    alignas(4) zircon_driver_note_payload_t payload;
+} zircon_driver_note_t;
 
-static_assert(offsetof(magenta_driver_note_t, payload) ==
-              sizeof(magenta_driver_note_header_t),
+static_assert(offsetof(zircon_driver_note_t, payload) ==
+              sizeof(zircon_driver_note_header_t),
               "alignment snafu?");
 
 // Without this, ASan will add redzone padding after the object, which
 // would make it invalid ELF note format.
 #if __has_feature(address_sanitizer)
-# define MAGENTA_DRIVER_NOTE_ASAN __attribute__((no_sanitize("address")))
+# define ZIRCON_DRIVER_NOTE_ASAN __attribute__((no_sanitize("address")))
 #else
-# define MAGENTA_DRIVER_NOTE_ASAN
+# define ZIRCON_DRIVER_NOTE_ASAN
 #endif
 
 // GCC has a quirk about how '__attribute__((visibility("default")))'
@@ -213,28 +213,28 @@
 // warning/error about that.  The attribute must appear on the "extern"
 // declaration of the variable instead.
 
-#define MAGENTA_DRIVER_BEGIN(Driver,Ops,VendorName,Version,BindCount) \
-mx_driver_rec_t __magenta_driver_rec__ __EXPORT = {\
+#define ZIRCON_DRIVER_BEGIN(Driver,Ops,VendorName,Version,BindCount) \
+zx_driver_rec_t __zircon_driver_rec__ __EXPORT = {\
     /* .ops = */ &(Ops),\
     /* .driver = */ NULL,\
     /* .log_flags = */ 3, /* DDK_LOG_ERROR | DDK_LOG_INFO */\
 };\
-extern const struct magenta_driver_note __magenta_driver_note__ __EXPORT;\
-__SECTION(".note.magenta.driver." #Driver) MAGENTA_DRIVER_NOTE_ASAN \
-const struct magenta_driver_note {\
-    magenta_driver_note_t note;\
-    mx_bind_inst_t binding[BindCount];\
-} __magenta_driver_note__ = {\
+extern const struct zircon_driver_note __zircon_driver_note__ __EXPORT;\
+__SECTION(".note.zircon.driver." #Driver) ZIRCON_DRIVER_NOTE_ASAN \
+const struct zircon_driver_note {\
+    zircon_driver_note_t note;\
+    zx_bind_inst_t binding[BindCount];\
+} __zircon_driver_note__ = {\
     /* .note = */{\
-        MAGENTA_DRIVER_NOTE_HEADER_INIT(__magenta_driver_note__),\
-        MAGENTA_DRIVER_NOTE_PAYLOAD_INIT(Driver,VendorName,Version,BindCount),\
+        ZIRCON_DRIVER_NOTE_HEADER_INIT(__zircon_driver_note__),\
+        ZIRCON_DRIVER_NOTE_PAYLOAD_INIT(Driver,VendorName,Version,BindCount),\
     },\
     /* .binding = */ {
 
-#define MAGENTA_DRIVER_END(Driver) }};
+#define ZIRCON_DRIVER_END(Driver) }};
 
 //TODO: if we moved the Ops from the BEGIN() to END() macro we
-//      could add a magenta_driver_note_t* to the mx_driver_rec_t,
+//      could add a zircon_driver_note_t* to the zx_driver_rec_t,
 //      define it in END(), and have only one symbol to dlsym()
 //      when loading drivers
 
diff --git a/system/public/zircon/errors.h b/system/public/zircon/errors.h
new file mode 100644
index 0000000..61ac8d9
--- /dev/null
+++ b/system/public/zircon/errors.h
@@ -0,0 +1,209 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#define ZX_OK (0)
+
+// ======= Internal failures =======
+// ZX_ERR_INTERNAL: The system encountered an otherwise unspecified error
+// while performing the operation.
+#define ZX_ERR_INTERNAL (-1)
+
+// ZX_ERR_NOT_SUPPORTED: The operation is not implemented, supported,
+// or enabled.
+#define ZX_ERR_NOT_SUPPORTED (-2)
+
+// ZX_ERR_NO_RESOURCES: The system was not able to allocate some resource
+// needed for the operation.
+#define ZX_ERR_NO_RESOURCES (-3)
+
+// ZX_ERR_NO_MEMORY: The system was not able to allocate memory needed
+// for the operation.
+#define ZX_ERR_NO_MEMORY (-4)
+
+// ZX_ERR_CALL_FAILED: The second phase of zx_channel_call() did not complete
+// successfully.
+#define ZX_ERR_CALL_FAILED (-5)
+
+// ZX_ERR_INTERNAL_INTR_RETRY: The system call was interrupted, but should be
+// retried.  This should not be seen outside of the VDSO.
+#define ZX_ERR_INTERNAL_INTR_RETRY (-6)
+
+// ======= Parameter errors =======
+// ZX_ERR_INVALID_ARGS: an argument is invalid, ex. null pointer
+#define ZX_ERR_INVALID_ARGS (-10)
+
+// ZX_ERR_BAD_HANDLE: A specified handle value does not refer to a handle.
+#define ZX_ERR_BAD_HANDLE (-11)
+
+// ZX_ERR_WRONG_TYPE: The subject of the operation is the wrong type to
+// perform the operation.
+// Example: Attempting a message_read on a thread handle.
+#define ZX_ERR_WRONG_TYPE (-12)
+
+// ZX_ERR_BAD_SYSCALL: The specified syscall number is invalid.
+#define ZX_ERR_BAD_SYSCALL (-13)
+
+// ZX_ERR_OUT_OF_RANGE: An argument is outside the valid range for this
+// operation.
+#define ZX_ERR_OUT_OF_RANGE (-14)
+
+// ZX_ERR_BUFFER_TOO_SMALL: A caller provided buffer is too small for
+// this operation.
+#define ZX_ERR_BUFFER_TOO_SMALL (-15)
+
+// ======= Precondition or state errors =======
+// ZX_ERR_BAD_STATE: operation failed because the current state of the
+// object does not allow it, or a precondition of the operation is
+// not satisfied
+#define ZX_ERR_BAD_STATE (-20)
+
+// ZX_ERR_TIMED_OUT: The time limit for the operation elapsed before
+// the operation completed.
+#define ZX_ERR_TIMED_OUT (-21)
+
+// ZX_ERR_SHOULD_WAIT: The operation cannot be performed currently but
+// potentially could succeed if the caller waits for a prerequisite
+// to be satisfied, for example waiting for a handle to be readable
+// or writable.
+// Example: Attempting to read from a channel that has no
+// messages waiting but has an open remote will return ZX_ERR_SHOULD_WAIT.
+// Attempting to read from a channel that has no messages waiting
+// and has a closed remote end will return ZX_ERR_PEER_CLOSED.
+#define ZX_ERR_SHOULD_WAIT (-22)
+
+// ZX_ERR_CANCELED: The in-progress operation (e.g. a wait) has been
+// canceled.
+#define ZX_ERR_CANCELED (-23)
+
+// ZX_ERR_PEER_CLOSED: The operation failed because the remote end of the
+// subject of the operation was closed.
+#define ZX_ERR_PEER_CLOSED (-24)
+
+// ZX_ERR_NOT_FOUND: The requested entity is not found.
+#define ZX_ERR_NOT_FOUND (-25)
+
+// ZX_ERR_ALREADY_EXISTS: An object with the specified identifier
+// already exists.
+// Example: Attempting to create a file when a file already exists
+// with that name.
+#define ZX_ERR_ALREADY_EXISTS (-26)
+
+// ZX_ERR_ALREADY_BOUND: The operation failed because the named entity
+// is already owned or controlled by another entity. The operation
+// could succeed later if the current owner releases the entity.
+#define ZX_ERR_ALREADY_BOUND (-27)
+
+// ZX_ERR_UNAVAILABLE: The subject of the operation is currently unable
+// to perform the operation.
+// Note: This is used when there's no direct way for the caller to
+// observe when the subject will be able to perform the operation
+// and should thus retry.
+#define ZX_ERR_UNAVAILABLE (-28)
+
+
+// ======= Permission check errors =======
+// ZX_ERR_ACCESS_DENIED: The caller did not have permission to perform
+// the specified operation.
+#define ZX_ERR_ACCESS_DENIED (-30)
+
+// ======= Input-output errors =======
+// ZX_ERR_IO: Otherwise unspecified error occurred during I/O.
+#define ZX_ERR_IO (-40)
+
+// ZX_ERR_REFUSED: The entity the I/O operation is being performed on
+// rejected the operation.
+// Example: an I2C device NAK'ing a transaction or a disk controller
+// rejecting an invalid command, or a stalled USB endpoint.
+#define ZX_ERR_IO_REFUSED (-41)
+
+// ZX_ERR_IO_DATA_INTEGRITY: The data in the operation failed an integrity
+// check and is possibly corrupted.
+// Example: CRC or Parity error.
+#define ZX_ERR_IO_DATA_INTEGRITY (-42)
+
+// ZX_ERR_IO_DATA_LOSS: The data in the operation is currently unavailable
+// and may be permanently lost.
+// Example: A disk block is irrecoverably damaged.
+#define ZX_ERR_IO_DATA_LOSS (-43)
+
+// ZX_ERR_IO_NOT_PRESENT: The device is no longer available (has been
+// unplugged from the system, powered down, or the driver has been
+// unloaded)
+#define ZX_ERR_IO_NOT_PRESENT (-44)
+
+// ZX_ERR_IO_OVERRUN: More data was received from the device than expected.
+// Example: a USB "babble" error due to a device sending more data than
+// the host queued to receive.
+#define ZX_ERR_IO_OVERRUN (-45)
+
+// ZX_ERR_IO_MISSED_DEADLINE: An operation did not complete within the required timeframe.
+// Example: A USB isochronous transfer that failed to complete due to an overrun or underrun.
+#define ZX_ERR_IO_MISSED_DEADLINE (-46)
+
+// ======== Filesystem Errors ========
+// ZX_ERR_BAD_PATH: Path name is too long.
+#define ZX_ERR_BAD_PATH (-50)
+
+// ZX_ERR_NOT_DIR: Object is not a directory or does not support
+// directory operations.
+// Example: Attempted to open a file as a directory or
+// attempted to do directory operations on a file.
+#define ZX_ERR_NOT_DIR (-51)
+
+// ZX_ERR_NOT_FILE: Object is not a regular file.
+#define ZX_ERR_NOT_FILE (-52)
+
+// ZX_ERR_FILE_BIG: This operation would cause a file to exceed a
+// filesystem-specific size limit
+#define ZX_ERR_FILE_BIG (-53)
+
+// ZX_ERR_NO_SPACE: Filesystem or device space is exhausted.
+#define ZX_ERR_NO_SPACE (-54)
+
+// ZX_ERR_NOT_EMPTY: Directory is not empty.
+#define ZX_ERR_NOT_EMPTY (-55)
+
+// ======== Flow Control ========
+// These are not errors, as such, and will never be returned
+// by a syscall or public API.  They exist to allow callbacks
+// to request changes in operation.
+//
+// ZX_ERR_STOP: Do not call again.
+// Example: A notification callback will be called on every
+// event until it returns something other than ZX_OK.
+// This status allows differentiation between "stop due to
+// an error" and "stop because the work is done."
+#define ZX_ERR_STOP (-60)
+
+// ZX_ERR_NEXT: Advance to the next item.
+// Example: A notification callback will use this response
+// to indicate it did not "consume" an item passed to it,
+// but by choice, not due to an error condition.
+#define ZX_ERR_NEXT (-61)
+
+// ======== Network-related errors ========
+
+// ZX_ERR_PROTOCOL_NOT_SUPPORTED: Specified protocol is not
+// supported.
+#define ZX_ERR_PROTOCOL_NOT_SUPPORTED (-70)
+
+// ZX_ERR_ADDRESS_UNREACHABLE: Host is unreachable.
+#define ZX_ERR_ADDRESS_UNREACHABLE (-71)
+
+// ZX_ERR_ADDRESS_IN_USE: Address is being used by someone else.
+#define ZX_ERR_ADDRESS_IN_USE (-72)
+
+// ZX_ERR_NOT_CONNECTED: Socket is not connected.
+#define ZX_ERR_NOT_CONNECTED (-73)
+
+// ZX_ERR_CONNECTION_REFUSED: Remote peer rejected the connection.
+#define ZX_ERR_CONNECTION_REFUSED (-74)
+
+// ZX_ERR_CONNECTION_RESET: Connection was reset.
+#define ZX_ERR_CONNECTION_RESET (-75)
+
+// ZX_ERR_CONNECTION_ABORTED: Connection was aborted.
+#define ZX_ERR_CONNECTION_ABORTED (-76)
diff --git a/system/public/magenta/hw/usb-audio.h b/system/public/zircon/hw/usb-audio.h
similarity index 99%
rename from system/public/magenta/hw/usb-audio.h
rename to system/public/zircon/hw/usb-audio.h
index ee43102..a7b33ff 100644
--- a/system/public/magenta/hw/usb-audio.h
+++ b/system/public/zircon/hw/usb-audio.h
@@ -6,7 +6,7 @@
 
 // clang-format off
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/public/magenta/hw/usb-cdc.h b/system/public/zircon/hw/usb-cdc.h
similarity index 99%
rename from system/public/magenta/hw/usb-cdc.h
rename to system/public/zircon/hw/usb-cdc.h
index 5632ff4..27a9166 100644
--- a/system/public/magenta/hw/usb-cdc.h
+++ b/system/public/zircon/hw/usb-cdc.h
@@ -6,7 +6,7 @@
 
 // clang-format off
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 /* CDC Subclasses for the Communications Interface Class */
 #define USB_CDC_SUBCLASS_DIRECT_LINE       0x01
diff --git a/system/public/magenta/hw/usb-hid.h b/system/public/zircon/hw/usb-hid.h
similarity index 100%
rename from system/public/magenta/hw/usb-hid.h
rename to system/public/zircon/hw/usb-hid.h
diff --git a/system/public/magenta/hw/usb-hub.h b/system/public/zircon/hw/usb-hub.h
similarity index 100%
rename from system/public/magenta/hw/usb-hub.h
rename to system/public/zircon/hw/usb-hub.h
diff --git a/system/public/magenta/hw/usb-mass-storage.h b/system/public/zircon/hw/usb-mass-storage.h
similarity index 100%
rename from system/public/magenta/hw/usb-mass-storage.h
rename to system/public/zircon/hw/usb-mass-storage.h
diff --git a/system/public/magenta/hw/usb.h b/system/public/zircon/hw/usb.h
similarity index 99%
rename from system/public/magenta/hw/usb.h
rename to system/public/zircon/hw/usb.h
index 65177fe..adaac7f 100644
--- a/system/public/magenta/hw/usb.h
+++ b/system/public/zircon/hw/usb.h
@@ -8,7 +8,7 @@
 
 #include <endian.h>
 #include <stdint.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/public/magenta/ktrace-def.h b/system/public/zircon/ktrace-def.h
similarity index 100%
rename from system/public/magenta/ktrace-def.h
rename to system/public/zircon/ktrace-def.h
diff --git a/system/public/magenta/ktrace.h b/system/public/zircon/ktrace.h
similarity index 97%
rename from system/public/magenta/ktrace.h
rename to system/public/zircon/ktrace.h
index c1113a7..6c4da9e 100644
--- a/system/public/magenta/ktrace.h
+++ b/system/public/zircon/ktrace.h
@@ -6,7 +6,7 @@
 
 #include <stdint.h>
 #include <assert.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
@@ -77,7 +77,7 @@
 
 #define KTRACE_DEF(num,type,name,group) TAG_##name = KTRACE_TAG_##type(num,KTRACE_GRP_##group),
 enum {
-#include <magenta/ktrace-def.h>
+#include <zircon/ktrace-def.h>
 };
 
 #define TAG_PROBE_16(n) KTRACE_TAG(((n)|0x800),KTRACE_GRP_PROBE,16)
diff --git a/system/public/magenta/listnode.h b/system/public/zircon/listnode.h
similarity index 99%
rename from system/public/magenta/listnode.h
rename to system/public/zircon/listnode.h
index 312d4e4..db3e687 100644
--- a/system/public/magenta/listnode.h
+++ b/system/public/zircon/listnode.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <stddef.h>
 
diff --git a/system/public/magenta/mdi.h b/system/public/zircon/mdi.h
similarity index 95%
rename from system/public/magenta/mdi.h
rename to system/public/zircon/mdi.h
index 404178c..87bb233 100644
--- a/system/public/magenta/mdi.h
+++ b/system/public/zircon/mdi.h
@@ -4,13 +4,13 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <assert.h>
 #include <stdint.h>
 
 __BEGIN_CDECLS;
 
-// an MDI binary file consists of a bootdata_t header (see magenta/bootdata.h)
+// an MDI binary file consists of a bootdata_t header (see zircon/bootdata.h)
 // followed by a tree of mdi_node_t nodes.
 // The root node has id set to mdi_root_id.
 
diff --git a/system/public/magenta/mdi/magenta.mdi b/system/public/zircon/mdi/zircon.mdi
similarity index 98%
rename from system/public/magenta/mdi/magenta.mdi
rename to system/public/zircon/mdi/zircon.mdi
index b4e2576..df5913a 100644
--- a/system/public/magenta/mdi/magenta.mdi
+++ b/system/public/zircon/mdi/zircon.mdi
@@ -1,4 +1,4 @@
-// MDI definitions for Magenta
+// MDI definitions for Zircon
 
 // Top level nodes
 list    kernel                            MDI_KERNEL                            1
diff --git a/system/public/magenta/mtrace.h b/system/public/zircon/mtrace.h
similarity index 95%
rename from system/public/magenta/mtrace.h
rename to system/public/zircon/mtrace.h
index fb4b56d..60b546a 100644
--- a/system/public/magenta/mtrace.h
+++ b/system/public/zircon/mtrace.h
@@ -4,7 +4,7 @@
 
 // N.B. This is ideally temporary. It is used by Intel PT support, and is a
 // stopgap until "resources" can be used to read/write x86 MSRs.
-// "mtrace" == "magenta trace": the idea being to be a generalization of
+// "mtrace" == "zircon trace": the idea being to be a generalization of
 // ktrace. It's all temporary, but there may be other uses before the stopgap
 // is no longer necessary.
 
diff --git a/system/public/zircon/pixelformat.h b/system/public/zircon/pixelformat.h
new file mode 100644
index 0000000..82af8d9
--- /dev/null
+++ b/system/public/zircon/pixelformat.h
@@ -0,0 +1,17 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+// clang-format off
+
+#define ZX_PIXEL_FORMAT_NONE       (0)
+
+#define ZX_PIXEL_FORMAT_RGB_565    (1)
+#define ZX_PIXEL_FORMAT_RGB_332    (2)
+#define ZX_PIXEL_FORMAT_RGB_2220   (3)
+#define ZX_PIXEL_FORMAT_ARGB_8888  (4)
+#define ZX_PIXEL_FORMAT_RGB_x888   (5)
+#define ZX_PIXEL_FORMAT_MONO_1     (6)
+#define ZX_PIXEL_FORMAT_MONO_8     (7)
diff --git a/system/public/zircon/process.h b/system/public/zircon/process.h
new file mode 100644
index 0000000..5a72592
--- /dev/null
+++ b/system/public/zircon/process.h
@@ -0,0 +1,32 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+#include <stdint.h>
+
+__BEGIN_CDECLS
+
+// Accessors for Zircon-specific state maintained by the language runtime
+
+// Examines the set of handles received at process startup for one matching
+// |hnd_info|.  If one is found, atomically returns it and removes it from the
+// set available to future calls.
+// |hnd_info| is a value returned by PA_HND().
+zx_handle_t zx_get_startup_handle(uint32_t hnd_info);
+
+zx_handle_t _zx_thread_self(void);
+zx_handle_t zx_thread_self(void);
+
+zx_handle_t _zx_process_self(void);
+zx_handle_t zx_process_self(void);
+
+zx_handle_t _zx_vmar_root_self(void);
+zx_handle_t zx_vmar_root_self(void);
+
+zx_handle_t _zx_job_default(void);
+zx_handle_t zx_job_default(void);
+
+__END_CDECLS
diff --git a/system/public/magenta/processargs.h b/system/public/zircon/processargs.h
similarity index 90%
rename from system/public/magenta/processargs.h
rename to system/public/zircon/processargs.h
index fd0790a..ff4b2d8 100644
--- a/system/public/magenta/processargs.h
+++ b/system/public/zircon/processargs.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -14,12 +14,12 @@
 // This is a protocol for passing state to a new process
 // via a message in a channel.
 
-#define MX_PROCARGS_PROTOCOL 0x4150585d // MXPA
-#define MX_PROCARGS_VERSION 0x0001000
+#define ZX_PROCARGS_PROTOCOL 0x4150585d // MXPA
+#define ZX_PROCARGS_VERSION 0x0001000
 
-typedef struct mx_proc_args mx_proc_args_t;
+typedef struct zx_proc_args zx_proc_args_t;
 
-struct mx_proc_args {
+struct zx_proc_args {
     // Protocol and version identifiers to allow for
     // different process start message protocols and
     // versioning of the same.
@@ -135,16 +135,16 @@
 #define PA_NS_DIR                0x20
 
 
-// --- MXIO Handles ---
-// Used by libmxio for passing fdtable, fsroot, etc
+// --- FDIO Handles ---
+// Used by libfdio for passing fdtable, fsroot, etc
 
-// Handle types the mxio library uses
-#define PA_MXIO_CWD              0x31
-#define PA_MXIO_REMOTE           0x32
-#define PA_MXIO_PIPE             0x33
-#define PA_MXIO_EVENT            0x34
-#define PA_MXIO_LOGGER           0x35
-#define PA_MXIO_SOCKET           0x36
+// Handle types the fdio library uses
+#define PA_FDIO_CWD              0x31
+#define PA_FDIO_REMOTE           0x32
+#define PA_FDIO_PIPE             0x33
+#define PA_FDIO_EVENT            0x34
+#define PA_FDIO_LOGGER           0x35
+#define PA_FDIO_SOCKET           0x36
 
 // Server endpoint for remoteio "/svc" directory provided
 // to enable handling of inbound connections to services
@@ -167,9 +167,9 @@
 
 // Dynamic Loader Service Messages
 // Used by dynamic loader to obtain objects to link.
-typedef struct mx_loader_svc_msg mx_loader_svc_msg_t;
-struct mx_loader_svc_msg {
-    mx_txid_t txid;
+typedef struct zx_loader_svc_msg zx_loader_svc_msg_t;
+struct zx_loader_svc_msg {
+    zx_txid_t txid;
     uint32_t opcode;
     int32_t arg;
     uint32_t reserved0;
diff --git a/system/public/zircon/rights.h b/system/public/zircon/rights.h
new file mode 100644
index 0000000..0a7b04d
--- /dev/null
+++ b/system/public/zircon/rights.h
@@ -0,0 +1,82 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+
+// Default rights for objects.
+#define ZX_DEFAULT_CHANNEL_RIGHTS \
+  (ZX_RIGHT_TRANSFER | ZX_RIGHT_READ | ZX_RIGHT_WRITE | \
+   ZX_RIGHT_SIGNAL | ZX_RIGHT_SIGNAL_PEER)
+
+#define ZX_DEFAULT_EVENT_RIGHTS \
+  (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ | ZX_RIGHT_WRITE |\
+   ZX_RIGHT_SIGNAL)
+
+#define ZX_DEFAULT_EVENT_PAIR_RIGHTS \
+  (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ | ZX_RIGHT_WRITE |\
+   ZX_RIGHT_SIGNAL | ZX_RIGHT_SIGNAL_PEER)
+
+#define ZX_DEFAULT_FIFO_RIGHTS \
+  (ZX_RIGHT_TRANSFER | ZX_RIGHT_DUPLICATE | ZX_RIGHT_READ | ZX_RIGHT_WRITE |\
+   ZX_RIGHT_SIGNAL | ZX_RIGHT_SIGNAL_PEER)
+
+#define ZX_DEFAULT_GUEST_RIGHTS \
+  (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_WRITE)
+
+#define ZX_DEFAULT_INTERRUPT_RIGHTS \
+  (ZX_RIGHT_TRANSFER | ZX_RIGHT_READ | ZX_RIGHT_WRITE)
+
+#define ZX_DEFAULT_IO_MAPPING_RIGHTS ZX_RIGHT_READ
+
+#define ZX_DEFAULT_JOB_RIGHTS                                                \
+  (ZX_RIGHT_TRANSFER | ZX_RIGHT_DUPLICATE | ZX_RIGHT_READ | ZX_RIGHT_WRITE | \
+   ZX_RIGHT_ENUMERATE | ZX_RIGHT_DESTROY | ZX_RIGHT_GET_PROPERTY |           \
+   ZX_RIGHT_SET_PROPERTY | ZX_RIGHT_SET_POLICY | ZX_RIGHT_GET_POLICY |       \
+   ZX_RIGHT_SIGNAL)
+
+#define ZX_DEFAULT_LOG_RIGHTS \
+  (ZX_RIGHT_TRANSFER | ZX_RIGHT_WRITE | ZX_RIGHT_DUPLICATE | ZX_RIGHT_SIGNAL)
+
+#define ZX_DEFAULT_PCI_DEVICE_RIGHTS \
+  (ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER)
+#define ZX_DEFAULT_PCI_INTERRUPT_RIGHTS \
+  (ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_TRANSFER)
+
+#define ZX_DEFAULT_PORT_RIGHTS \
+  (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ | ZX_RIGHT_WRITE)
+
+#define ZX_DEFAULT_PROCESS_RIGHTS                                            \
+  (ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | \
+   ZX_RIGHT_ENUMERATE | ZX_RIGHT_DESTROY | ZX_RIGHT_GET_PROPERTY |           \
+   ZX_RIGHT_SET_PROPERTY | ZX_RIGHT_SIGNAL)
+
+#define ZX_DEFAULT_RESOURCE_RIGHTS \
+  (ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER |\
+   ZX_RIGHT_SIGNAL)
+
+#define ZX_DEFAULT_SOCKET_RIGHTS \
+  (ZX_RIGHT_TRANSFER | ZX_RIGHT_DUPLICATE | ZX_RIGHT_READ | ZX_RIGHT_WRITE |\
+   ZX_RIGHT_SIGNAL | ZX_RIGHT_SIGNAL_PEER)
+
+#define ZX_DEFAULT_THREAD_RIGHTS                                             \
+  (ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | \
+   ZX_RIGHT_DESTROY | ZX_RIGHT_GET_PROPERTY | ZX_RIGHT_SET_PROPERTY |        \
+   ZX_RIGHT_SIGNAL)
+
+#define ZX_DEFAULT_TIMERS_RIGHTS \
+  (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ | ZX_RIGHT_WRITE |\
+   ZX_RIGHT_SIGNAL)
+
+#define ZX_DEFAULT_VCPU_RIGHTS \
+  (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ | ZX_RIGHT_WRITE |\
+   ZX_RIGHT_EXECUTE | ZX_RIGHT_SIGNAL)
+
+#define ZX_DEFAULT_VMAR_RIGHTS (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER)
+
+#define ZX_DEFAULT_VMO_RIGHTS                                                \
+  (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ | ZX_RIGHT_WRITE | \
+   ZX_RIGHT_EXECUTE | ZX_RIGHT_MAP | ZX_RIGHT_GET_PROPERTY |                 \
+   ZX_RIGHT_SET_PROPERTY | ZX_RIGHT_SIGNAL)
diff --git a/system/public/zircon/syscalls.h b/system/public/zircon/syscalls.h
new file mode 100644
index 0000000..ed7aeb5
--- /dev/null
+++ b/system/public/zircon/syscalls.h
@@ -0,0 +1,26 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+#include <zircon/syscalls/types.h>
+
+#include <zircon/syscalls/pci.h>
+#include <zircon/syscalls/object.h>
+
+__BEGIN_CDECLS
+
+#if defined(__clang__)
+#define ZX_SYSCALL_PARAM_ATTR(x)   __attribute__((annotate("zx_" #x)))
+#else
+#define ZX_SYSCALL_PARAM_ATTR(x)   // no-op
+#endif
+
+#include <zircon/syscalls/definitions.h>
+
+// Compatibility wrappers for deprecated syscalls also go here, when
+// there are any.
+
+__END_CDECLS
diff --git a/system/public/zircon/syscalls.sysgen b/system/public/zircon/syscalls.sysgen
new file mode 100644
index 0000000..8bb13fe
--- /dev/null
+++ b/system/public/zircon/syscalls.sysgen
@@ -0,0 +1,695 @@
+# Copyright 2016 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+#
+# The syntax of each line is
+#     syscall <name> [attributes] ([args])
+#         [returns (<type> [attributes] [args])];
+#
+# with '[]' being optional and '<>' being required input.
+#
+# <name> is the syscall function name. It must be a valid C identifier.
+#
+# [attributes] can be empty or is a space separated list of words with
+# meaning for a particular generator.
+#
+# [args] can be empty or is a comma separated list of
+# '<aname>: <type> [attributes] [ctr]'
+#
+# <aname> is the argument name. It must be a valid C indentifier.
+#
+# <type> is the argument type. It must be a valid C indentifer with an optional
+# array-spec which when present it must be "[number]" or "[aname]", with the
+# number being an integer and aname the name of the argument that controls the
+# array size.
+#
+# [ctr] can be empty or is an all-caps word to specify a argument constraint
+# with valid values being one of: 'IN', 'OUT', 'INOUT'
+#
+# The 'returns (<type>)' is expected unless one of the attributes is 'noreturn'.
+#
+#
+# To help the clang static analyzer identify handle related syscalls, 3
+# attributes are available to describe handle behaviors. Which are
+# handle_acquire, handle_release and handle_release_always.
+#
+#  handle_acquire        The handle will be allocated when this call is
+#                        successful.
+#
+#  handle_release        The handle will be released/destroyed when this
+#                        call is successful.
+#
+#  handle_release_always The handle will be released/destroyed; the only failure
+#                        possible is for an invalid handle.
+#
+#
+
+# Time
+
+syscall time_get
+    (clock_id: uint32_t)
+    returns (zx_time_t);
+
+syscall nanosleep blocking
+    (deadline: zx_time_t)
+    returns (zx_status_t);
+
+syscall ticks_get vdsocall
+    ()
+    returns (uint64_t);
+
+syscall ticks_per_second vdsocall const
+    ()
+    returns (uint64_t);
+
+syscall deadline_after vdsocall
+    (nanoseconds: zx_duration_t)
+    returns (zx_time_t);
+
+syscall clock_adjust
+    (handle: zx_handle_t, clock_id: uint32_t, offset: int64_t)
+    returns (zx_status_t);
+
+# Global system information
+
+syscall system_get_num_cpus vdsocall const
+    ()
+    returns (uint32_t);
+
+syscall system_get_version vdsocall
+    (version: char[version_len] OUT, version_len: uint32_t)
+    returns (zx_status_t);
+
+syscall system_get_physmem vdsocall
+    ()
+    returns (uint64_t);
+
+# Abstraction of machine operations
+
+syscall cache_flush vdsocall
+    (addr: any[len] IN, len: size_t, options: uint32_t)
+    returns (zx_status_t);
+
+# Generic handle operations
+
+syscall handle_close
+    (handle: zx_handle_t handle_release_always)
+    returns (zx_status_t);
+
+syscall handle_duplicate
+    (handle: zx_handle_t, rights: zx_rights_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall handle_replace
+    (handle: zx_handle_t handle_release, rights: zx_rights_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+# Generic object operations
+
+syscall object_wait_one blocking
+    (handle: zx_handle_t, waitfor: zx_signals_t, deadline: zx_time_t)
+    returns (zx_status_t, observed: zx_signals_t optional);
+
+syscall object_wait_many blocking
+    (items: zx_wait_item_t[count] INOUT, count: uint32_t, deadline: zx_time_t)
+    returns (zx_status_t);
+
+syscall object_wait_async
+    (handle: zx_handle_t, port_handle: zx_handle_t, key: uint64_t,
+        signals: zx_signals_t, options: uint32_t)
+    returns (zx_status_t);
+
+syscall object_signal
+    (handle: zx_handle_t, clear_mask: uint32_t, set_mask: uint32_t)
+    returns (zx_status_t);
+
+syscall object_signal_peer
+    (handle: zx_handle_t, clear_mask: uint32_t, set_mask: uint32_t)
+    returns (zx_status_t);
+
+syscall object_get_property
+    (handle: zx_handle_t, property: uint32_t, value: any[size] OUT, size: size_t)
+    returns (zx_status_t);
+
+syscall object_set_property
+    (handle: zx_handle_t, property: uint32_t, value: any[size] IN, size: size_t)
+    returns (zx_status_t);
+
+syscall object_set_cookie
+    (handle: zx_handle_t, scope: zx_handle_t, cookie: uint64_t)
+    returns (zx_status_t);
+
+syscall object_get_cookie
+    (handle: zx_handle_t, scope: zx_handle_t)
+    returns (zx_status_t, cookie: uint64_t);
+
+syscall object_get_info
+    (handle: zx_handle_t, topic: uint32_t,
+        buffer: any[buffer_size] OUT, buffer_size: size_t)
+    returns (zx_status_t, actual_count: size_t optional, avail_count: size_t optional);
+
+syscall object_get_child
+    (handle: zx_handle_t, koid: uint64_t, rights: zx_rights_t)
+    returns (zx_status_t, out: zx_handle_t);
+
+# IPC: Channels
+
+syscall channel_create
+    (options: uint32_t)
+    returns (zx_status_t, out0: zx_handle_t handle_acquire,
+        out1: zx_handle_t handle_acquire);
+
+syscall channel_read
+    (handle: zx_handle_t, options: uint32_t,
+        bytes: any[num_bytes] OUT,
+        handles: zx_handle_t[num_handles] OUT,
+        num_bytes: uint32_t,
+        num_handles: uint32_t)
+    returns (zx_status_t, actual_bytes: uint32_t optional, actual_handles: uint32_t optional);
+
+syscall channel_write
+    (handle: zx_handle_t, options: uint32_t,
+        bytes: any[num_bytes] IN, num_bytes: uint32_t,
+        handles: zx_handle_t[num_handles] IN, num_handles: uint32_t)
+    returns (zx_status_t);
+
+syscall channel_call_noretry internal
+    (handle: zx_handle_t, options: uint32_t, deadline: zx_time_t,
+        args: zx_channel_call_args_t[1] IN)
+    returns (zx_status_t, actual_bytes: uint32_t,
+                actual_handles: uint32_t, read_status: zx_status_t optional);
+
+syscall channel_call_finish internal
+    (deadline: zx_time_t, args: zx_channel_call_args_t[1] IN)
+    returns (zx_status_t, actual_bytes: uint32_t,
+                actual_handles: uint32_t, read_status: zx_status_t optional);
+
+syscall channel_call vdsocall
+    (handle: zx_handle_t, options: uint32_t, deadline: zx_time_t,
+        args: zx_channel_call_args_t[1] IN)
+    returns (zx_status_t, actual_bytes: uint32_t,
+                actual_handles: uint32_t, read_status: zx_status_t optional);
+
+# IPC: Sockets
+
+syscall socket_create
+    (options: uint32_t)
+    returns (zx_status_t, out0: zx_handle_t handle_acquire,
+        out1: zx_handle_t handle_acquire);
+
+syscall socket_write
+    (handle: zx_handle_t, options: uint32_t,
+        buffer: any[size] IN, size: size_t)
+    returns (zx_status_t, actual: size_t optional);
+
+syscall socket_read
+    (handle: zx_handle_t, options: uint32_t,
+        buffer: any[size] OUT, size: size_t)
+    returns (zx_status_t, actual: size_t optional);
+
+# Threads
+
+syscall thread_exit noreturn ();
+
+syscall thread_create
+    (process: zx_handle_t, name: char[name_len] IN, name_len: uint32_t,
+        options: uint32_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall thread_start
+    (handle: zx_handle_t, thread_entry: uintptr_t,
+        stack: uintptr_t, arg1: uintptr_t, arg2: uintptr_t)
+    returns (zx_status_t);
+
+syscall thread_read_state
+    (handle: zx_handle_t, kind: uint32_t,
+        buffer: any[len] OUT, len: uint32_t)
+    returns (zx_status_t, actual: uint32_t);
+
+syscall thread_write_state
+    (handle: zx_handle_t, kind: uint32_t, buffer: any[buffer_len] IN, buffer_len: uint32_t)
+    returns (zx_status_t);
+
+# NOTE: thread_set_priority is an experimental syscall.
+# Do not use it.  It is going away very soon.  Just don't do it.  This is not
+# the syscall you are looking for.  See MG-940
+syscall thread_set_priority
+    (prio: int32_t)
+    returns (zx_status_t);
+
+# Processes
+
+syscall process_exit noreturn
+    (retcode: int);
+
+syscall process_create
+    (job: zx_handle_t, name: char[name_len] IN, name_len: uint32_t, options: uint32_t)
+    returns (zx_status_t, proc_handle: zx_handle_t handle_acquire,
+        vmar_handle: zx_handle_t handle_acquire);
+
+syscall process_start
+    (process_handle: zx_handle_t,
+        thread_handle: zx_handle_t, entry: uintptr_t,
+        stack: uintptr_t, arg_handle: zx_handle_t handle_release, arg2: uintptr_t)
+    returns (zx_status_t);
+
+syscall process_read_memory
+    (proc: zx_handle_t, vaddr: uintptr_t,
+    buffer: any[len] OUT, len: size_t)
+    returns (zx_status_t, actual: size_t);
+
+syscall process_write_memory
+    (proc: zx_handle_t, vaddr: uintptr_t,
+    buffer: any[len] IN, len: size_t)
+    returns (zx_status_t, actual: size_t);
+
+# Jobs
+
+syscall job_create
+    (parent_job: zx_handle_t, options: uint32_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall job_set_policy
+    (job: zx_handle_t, options: uint32_t, topic: uint32_t, policy: any[count] IN, count: uint32_t)
+    returns (zx_status_t);
+
+# Shared between process and threads
+syscall task_bind_exception_port
+    (object: zx_handle_t, eport: zx_handle_t, key: uint64_t, options: uint32_t)
+    returns (zx_status_t);
+
+syscall task_suspend
+    (task_handle: zx_handle_t)
+    returns (zx_status_t);
+
+syscall task_resume
+    (task_handle: zx_handle_t, options: uint32_t)
+    returns (zx_status_t);
+
+syscall task_kill
+    (task_handle: zx_handle_t)
+    returns (zx_status_t);
+
+# Synchronization
+
+syscall event_create
+    (options: uint32_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall eventpair_create
+    (options: uint32_t)
+    returns (zx_status_t,
+        out0: zx_handle_t handle_acquire, out1: zx_handle_t handle_acquire);
+
+syscall futex_wait blocking
+    (value_ptr: zx_futex_t[1] INOUT, current_value: int, deadline: zx_time_t)
+    returns (zx_status_t);
+
+syscall futex_wake
+    (value_ptr: zx_futex_t[1] IN, count: uint32_t)
+    returns (zx_status_t);
+
+syscall futex_requeue
+    (wake_ptr: zx_futex_t[1] INOUT, wake_count: uint32_t, current_value: int,
+        requeue_ptr: zx_futex_t[1] INOUT, requeue_count: uint32_t)
+    returns (zx_status_t);
+
+# Ports
+
+syscall port_create
+    (options: uint32_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall port_queue
+    (handle: zx_handle_t, packet: any[size] IN, size: size_t)
+    returns (zx_status_t);
+
+syscall port_wait blocking
+    (handle: zx_handle_t, deadline: zx_time_t, packet: any[size] OUT, size: size_t)
+    returns (zx_status_t);
+
+syscall port_cancel
+    (handle: zx_handle_t, source: zx_handle_t, key: uint64_t)
+    returns (zx_status_t);
+
+# Timers
+
+syscall timer_create
+    (options: uint32_t, clock_id: uint32_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall timer_set
+    (handle: zx_handle_t, deadline: zx_time_t, slack: zx_duration_t)
+    returns (zx_status_t);
+
+syscall timer_cancel
+    (handle: zx_handle_t)
+    returns (zx_status_t);
+
+# Memory management
+
+syscall vmo_create
+    (size: uint64_t, options: uint32_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall vmo_read
+    (handle: zx_handle_t, data: any[len] OUT, offset: uint64_t, len: size_t)
+    returns (zx_status_t, actual: size_t);
+
+syscall vmo_write
+    (handle: zx_handle_t, data: any[len] IN, offset: uint64_t, len: size_t)
+    returns (zx_status_t, actual: size_t);
+
+syscall vmo_get_size
+    (handle: zx_handle_t)
+    returns (zx_status_t, size: uint64_t);
+
+syscall vmo_set_size
+    (handle: zx_handle_t, size: uint64_t)
+    returns (zx_status_t);
+
+syscall vmo_op_range
+    (handle: zx_handle_t, op: uint32_t, offset: uint64_t, size: uint64_t,
+        buffer: any[buffer_size] INOUT, buffer_size: size_t)
+    returns (zx_status_t);
+
+syscall vmo_clone
+    (handle: zx_handle_t, options: uint32_t, offset: uint64_t, size: uint64_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall vmo_set_cache_policy
+    (handle: zx_handle_t, cache_policy: uint32_t)
+    returns (zx_status_t);
+
+# Address space management
+
+syscall vmar_allocate
+    (parent_vmar_handle: zx_handle_t, offset: size_t, size: size_t, map_flags: uint32_t)
+    returns (zx_status_t,
+        child_vmar: zx_handle_t handle_acquire, child_addr: uintptr_t);
+
+syscall vmar_destroy
+    (vmar_handle: zx_handle_t)
+    returns (zx_status_t);
+
+syscall vmar_map
+    (vmar_handle: zx_handle_t, vmar_offset: size_t,
+        vmo_handle: zx_handle_t, vmo_offset: uint64_t,
+        len: size_t, map_flags: uint32_t)
+    returns (zx_status_t, mapped_addr: uintptr_t);
+
+syscall vmar_unmap
+    (vmar_handle: zx_handle_t, addr: uintptr_t, len: size_t)
+    returns (zx_status_t);
+
+syscall vmar_protect
+    (vmar_handle: zx_handle_t, addr: uintptr_t, len: size_t,
+        prot_flags: uint32_t)
+    returns (zx_status_t);
+
+# Random Number generator
+
+syscall cprng_draw
+    (buffer: any[len] OUT, len: size_t)
+    returns (zx_status_t, actual: size_t);
+
+syscall cprng_add_entropy
+    (buffer: any[len] IN, len: size_t)
+    returns (zx_status_t);
+
+# Fifo
+
+syscall fifo_create
+    (elem_count: uint32_t, elem_size: uint32_t, options: uint32_t)
+    returns (zx_status_t,
+        out0: zx_handle_t handle_acquire, out1: zx_handle_t handle_acquire);
+
+syscall fifo_read
+    (handle: zx_handle_t, data: any[len] OUT, len: size_t)
+    returns (zx_status_t, num_written: uint32_t);
+
+syscall fifo_write
+    (handle: zx_handle_t, data: any[len] IN, len: size_t)
+    returns (zx_status_t, num_written: uint32_t);
+
+# Multi-function
+
+syscall vmar_unmap_handle_close_thread_exit vdsocall
+    (vmar_handle: zx_handle_t, addr: uintptr_t, len: size_t,
+        handle: zx_handle_t handle_release)
+    returns (zx_status_t);
+
+syscall futex_wake_handle_close_thread_exit vdsocall noreturn
+    (value_ptr: zx_futex_t[1] IN, count: uint32_t, new_value: int,
+        handle: zx_handle_t handle_release);
+
+# ---------------------------------------------------------------------------------------
+# Syscalls past this point are non-public
+# Some currently do not require a handle to restrict access.
+# Those will be modified or removed.
+# These syscalls are *not* a stable API/ABI surface.
+# ---------------------------------------------------------------------------------------
+
+# Logging
+
+syscall log_create
+    (options: uint32_t)
+    returns (zx_status_t, out: zx_handle_t);
+
+syscall log_write
+    (handle: zx_handle_t, len: uint32_t, buffer: any[len] IN, options: uint32_t)
+    returns (zx_status_t);
+
+syscall log_read
+    (handle: zx_handle_t, len: uint32_t, buffer: any[len] OUT, options: uint32_t)
+    returns (zx_status_t);
+
+
+syscall debuglog_create
+    (resource: zx_handle_t, options: uint32_t)
+    returns (zx_status_t, out: zx_handle_t);
+
+syscall debuglog_write
+    (handle: zx_handle_t, options: uint32_t, buffer: any[len] IN, len: size_t)
+    returns (zx_status_t);
+
+syscall debuglog_read
+    (handle: zx_handle_t, options: uint32_t, buffer: any[len] OUT, len: size_t)
+    returns (zx_status_t);
+
+# Tracing
+
+syscall ktrace_read
+    (handle: zx_handle_t, data: any[len] OUT, offset: uint32_t,
+        len: uint32_t)
+    returns (zx_status_t, actual: uint32_t);
+
+syscall ktrace_control
+    (handle: zx_handle_t, action: uint32_t, options: uint32_t, ptr: any[action] INOUT)
+    returns (zx_status_t);
+
+syscall ktrace_write
+    (handle: zx_handle_t, id: uint32_t, arg0: uint32_t, arg1: uint32_t)
+    returns (zx_status_t);
+
+syscall mtrace_control
+    (handle: zx_handle_t,
+        kind: uint32_t, action: uint32_t, options: uint32_t,
+        ptr: any[size] INOUT, size: uint32_t)
+    returns (zx_status_t);
+
+# Legacy LK debug syscalls
+
+syscall debug_read
+    (handle: zx_handle_t, buffer: any[length] OUT, length: uint32_t)
+    returns (zx_status_t);
+
+syscall debug_write
+    (buffer: any[length] IN, length: uint32_t)
+    returns (zx_status_t);
+
+syscall debug_send_command
+    (resource_handle: zx_handle_t, buffer: any[length] IN, length: uint32_t)
+    returns (zx_status_t);
+
+# DDK Syscalls: Interrupts
+
+syscall interrupt_create
+    (handle: zx_handle_t, vector: uint32_t, options: uint32_t)
+    returns (zx_status_t, out_handle: zx_handle_t);
+
+syscall interrupt_complete
+    (handle: zx_handle_t)
+    returns (zx_status_t);
+
+syscall interrupt_wait blocking
+    (handle: zx_handle_t)
+    returns (zx_status_t);
+
+syscall interrupt_signal
+    (handle: zx_handle_t)
+    returns (zx_status_t);
+
+# DDK Syscalls: MMIO and Ports
+
+syscall mmap_device_io
+    (handle: zx_handle_t, io_addr: uint32_t, len: uint32_t)
+    returns (zx_status_t);
+
+syscall vmo_create_contiguous
+    (rsrc_handle: zx_handle_t, size: size_t, alignment_log2: uint32_t)
+    returns (zx_status_t, out: zx_handle_t);
+
+syscall vmo_create_physical
+    (rsrc_handle: zx_handle_t, paddr: zx_paddr_t, size: size_t)
+    returns (zx_status_t, out: zx_handle_t);
+
+# DDK Syscalls: Misc Info
+
+syscall bootloader_fb_get_info
+    ()
+    returns (zx_status_t, format: uint32_t, width: uint32_t, height: uint32_t, stride: uint32_t);
+
+syscall set_framebuffer
+    (handle: zx_handle_t, vaddr: any[1] INOUT, len: uint32_t, format: uint32_t,
+        width: uint32_t, height: uint32_t, stride: uint32_t)
+    returns (zx_status_t);
+
+syscall set_framebuffer_vmo
+    (handle: zx_handle_t, vmo: zx_handle_t, len: uint32_t, format: uint32_t,
+        width: uint32_t, height: uint32_t, stride: uint32_t)
+    returns (zx_status_t);
+
+# DDK Syscalls: PCI
+
+syscall pci_get_nth_device
+    (handle: zx_handle_t, index: uint32_t)
+    returns (zx_status_t, out_info: zx_pcie_device_info_t, out_handle: zx_handle_t);
+
+syscall pci_enable_bus_master
+    (handle: zx_handle_t, enable: bool)
+    returns (zx_status_t);
+
+syscall pci_enable_pio
+    (handle: zx_handle_t, enable: bool)
+    returns (zx_status_t);
+
+syscall pci_reset_device
+    (handle: zx_handle_t)
+    returns (zx_status_t);
+
+syscall pci_cfg_pio_rw
+    (handle: zx_handle_t, bus: uint8_t, dev: uint8_t, func: uint8_t, offset: uint8_t,
+        val: uint32_t[1] OUT, width: size_t, write: bool)
+    returns (zx_status_t);
+
+syscall pci_get_bar
+    (handle: zx_handle_t, bar_num: uint32_t, out_bar: zx_pci_resource_t[1] OUT)
+    returns (zx_status_t);
+
+syscall pci_get_config
+    (handle: zx_handle_t, out_config: zx_pci_resource_t[1] OUT)
+    returns (zx_status_t);
+
+syscall pci_io_write
+    (handle: zx_handle_t, bar_num: uint32_t, offset: uint32_t, len: uint32_t, value: uint32_t)
+    returns (zx_status_t);
+
+syscall pci_io_read
+    (handle: zx_handle_t, bar_num: uint32_t,
+        offset: uint32_t, len: uint32_t)
+    returns (zx_status_t, out_value: uint32_t);
+
+syscall pci_map_interrupt
+    (handle: zx_handle_t, which_irq: int32_t)
+    returns (zx_status_t, out_handle: zx_handle_t);
+
+syscall pci_query_irq_mode_caps
+    (handle: zx_handle_t, mode: uint32_t)
+    returns (zx_status_t, out_max_irqs: uint32_t);
+
+syscall pci_set_irq_mode
+    (handle: zx_handle_t, mode: uint32_t, requested_irq_count: uint32_t)
+    returns (zx_status_t);
+
+syscall pci_init
+    (handle: zx_handle_t, init_buf: zx_pci_init_arg_t[len] IN, len: uint32_t)
+    returns (zx_status_t);
+
+syscall pci_add_subtract_io_range
+    (handle: zx_handle_t, mmio: bool, base: uint64_t, len: uint64_t, add: bool)
+    returns (zx_status_t);
+
+# DDK Syscalls: ACPI Glue
+
+syscall acpi_uefi_rsdp
+    (handle: zx_handle_t)
+    returns (uint64_t);
+
+syscall acpi_cache_flush
+    (handle: zx_handle_t)
+    returns (zx_status_t);
+
+# Resources
+
+syscall resource_create
+    (parent_handle: zx_handle_t, kind: uint32_t, low: uint64_t, high: uint64_t)
+    returns (zx_status_t, resource_out: zx_handle_t);
+
+# Hypervisor
+
+syscall guest_create
+    (resource: zx_handle_t, options: uint32_t, physmem_vmo: zx_handle_t)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall guest_set_trap
+    (guest: zx_handle_t, kind: uint32_t, addr: zx_vaddr_t, len: size_t, port: zx_handle_t,
+        key: uint64_t)
+    returns (zx_status_t);
+
+syscall vcpu_create
+    (guest: zx_handle_t, options: uint32_t, args: zx_vcpu_create_args_t[1] IN)
+    returns (zx_status_t, out: zx_handle_t handle_acquire);
+
+syscall vcpu_resume
+    (vcpu: zx_handle_t)
+    returns (zx_status_t, packet: zx_port_packet_t OUT);
+
+syscall vcpu_interrupt
+    (vcpu: zx_handle_t, vector: uint32_t)
+    returns (zx_status_t);
+
+syscall vcpu_read_state
+    (vcpu: zx_handle_t, kind: uint32_t, buffer: any[len] OUT, len: uint32_t)
+    returns (zx_status_t);
+
+syscall vcpu_write_state
+    (vcpu: zx_handle_t, kind: uint32_t, buffer: any[len] IN, len: uint32_t)
+    returns (zx_status_t);
+
+# System Control
+
+syscall system_mexec
+   (kernel: zx_handle_t, bootimage: zx_handle_t, cmdline: char[cmdline_len] IN, cmdline_len: uint32_t)
+   returns (zx_status_t);
+
+# Internal-only task syscalls
+
+syscall job_set_relative_importance
+    (root_resource: zx_handle_t,
+        job: zx_handle_t, less_important_job: zx_handle_t)
+    returns (zx_status_t);
+
+# Test syscalls (keep at the end)
+
+syscall syscall_test_0() returns (zx_status_t);
+syscall syscall_test_1 test_category1 (a:int) returns (zx_status_t);
+syscall syscall_test_2 test_category1 (a:int, b:int) returns (zx_status_t);
+syscall syscall_test_3 test_category2 (a:int, b:int, c:int) returns (zx_status_t);
+syscall syscall_test_4(a:int, b:int, c:int, d:int) returns (zx_status_t);
+syscall syscall_test_5(a:int, b:int, c:int, d:int, e:int) returns (zx_status_t);
+syscall syscall_test_6(a:int, b:int, c:int, d:int, e:int, f:int) returns (zx_status_t);
+syscall syscall_test_7(a:int, b:int, c:int, d:int, e:int, f:int, g:int) returns (zx_status_t);
+syscall syscall_test_8(a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int) returns (zx_status_t);
+syscall syscall_test_wrapper(a:int, b:int, c:int) returns (zx_status_t);
diff --git a/system/public/zircon/syscalls/debug.h b/system/public/zircon/syscalls/debug.h
new file mode 100644
index 0000000..4a468fa
--- /dev/null
+++ b/system/public/zircon/syscalls/debug.h
@@ -0,0 +1,65 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/compiler.h>
+#include <stdint.h>
+
+__BEGIN_CDECLS
+
+// The format of data for r/w of x86_64 general regs.
+// By convention this is ZX_THREAD_STATE_REGSET0.
+
+typedef struct zx_x86_64_general_regs {
+    uint64_t rax;
+    uint64_t rbx;
+    uint64_t rcx;
+    uint64_t rdx;
+    uint64_t rsi;
+    uint64_t rdi;
+    uint64_t rbp;
+    uint64_t rsp;
+    uint64_t r8;
+    uint64_t r9;
+    uint64_t r10;
+    uint64_t r11;
+    uint64_t r12;
+    uint64_t r13;
+    uint64_t r14;
+    uint64_t r15;
+    uint64_t rip;
+    uint64_t rflags;
+} zx_x86_64_general_regs_t;
+
+// The format of data for r/w of arm64 general regs.
+// By convention this is ZX_THREAD_STATE_REGSET0.
+
+typedef struct zx_arm64_general_regs {
+    uint64_t r[30];
+    uint64_t lr;
+    uint64_t sp;
+    uint64_t pc;
+    uint64_t cpsr;
+} zx_arm64_general_regs_t;
+
+// zx_thread_read_state, zx_thread_write_state
+// The maximum size of thread state, in bytes, that can be processed by the
+// read_state/write_state syscalls. It exists so code can expect a sane limit
+// on the amount of memory needed to process the request.
+#define ZX_MAX_THREAD_STATE_SIZE 4096u
+
+// The "general regs" are by convention in regset 0.
+#define ZX_THREAD_STATE_REGSET0 0u
+#define ZX_THREAD_STATE_REGSET1 1u
+#define ZX_THREAD_STATE_REGSET2 2u
+#define ZX_THREAD_STATE_REGSET3 3u
+#define ZX_THREAD_STATE_REGSET4 4u
+#define ZX_THREAD_STATE_REGSET5 5u
+#define ZX_THREAD_STATE_REGSET6 6u
+#define ZX_THREAD_STATE_REGSET7 7u
+#define ZX_THREAD_STATE_REGSET8 8u
+#define ZX_THREAD_STATE_REGSET9 9u
+
+__END_CDECLS
diff --git a/system/public/zircon/syscalls/exception.h b/system/public/zircon/syscalls/exception.h
new file mode 100644
index 0000000..a909105
--- /dev/null
+++ b/system/public/zircon/syscalls/exception.h
@@ -0,0 +1,160 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+#include <zircon/syscalls/port.h>
+
+__BEGIN_CDECLS
+
+// ask clang format not to mess up the indentation:
+// clang-format off
+
+// This bit is set for synthetic exceptions to distinguish them from
+// architectural exceptions.
+// Note: Port packet types provide 8 bits to distinguish the exception type.
+// See zircon/port.h.
+#define ZX_EXCP_SYNTH 0x80
+
+// The kind of an exception.
+// Exception types are a subset of port packet types. See zircon/port.h.
+typedef enum {
+    // These are architectural exceptions.
+    // Depending on the exception, further information can be found in
+    // |report.context.arch|.
+
+    // General exception not covered by another value.
+    ZX_EXCP_GENERAL = ZX_PKT_TYPE_EXCEPTION(0),
+    ZX_EXCP_FATAL_PAGE_FAULT = ZX_PKT_TYPE_EXCEPTION(1),
+    ZX_EXCP_UNDEFINED_INSTRUCTION = ZX_PKT_TYPE_EXCEPTION(2),
+    ZX_EXCP_SW_BREAKPOINT = ZX_PKT_TYPE_EXCEPTION(3),
+    ZX_EXCP_HW_BREAKPOINT = ZX_PKT_TYPE_EXCEPTION(4),
+    ZX_EXCP_UNALIGNED_ACCESS = ZX_PKT_TYPE_EXCEPTION(5),
+
+    // Synthetic exceptions.
+
+    // A thread is starting.
+    // This exception is sent to debuggers only (ZX_EXCEPTION_PORT_DEBUGGER).
+    // The thread is paused until it is resumed by the debugger
+    // with zx_task_resume.
+    ZX_EXCP_THREAD_STARTING = ZX_PKT_TYPE_EXCEPTION(ZX_EXCP_SYNTH | 0),
+
+    // A thread has suspended.
+    // This exception is sent to debuggers only (ZX_EXCEPTION_PORT_DEBUGGER).
+    // The thread is paused until it is resumed by the debugger
+    // with zx_task_resume. This resume is different though: it's not resuming
+    // from an exception, so don't pass ZX_RESUME_EXCEPTION, pass 0.
+    // A note on the word tense here: This is named "suspended" and not
+    // "suspending" because the thread has completely suspended at this point.
+    // N.B. This notification is not replied to.
+    ZX_EXCP_THREAD_SUSPENDED = ZX_PKT_TYPE_EXCEPTION(ZX_EXCP_SYNTH | 1),
+
+    // A thread has resumed after being suspended.
+    // This exception is sent to debuggers only (ZX_EXCEPTION_PORT_DEBUGGER).
+    // This is the counterpart to ZX_EXCP_THREAD_SUSPENDED.
+    // A note on the word tense here: This is named "resumed" and not
+    // "resuming" because the thread has completely resumed at this point.
+    // N.B. This notification is not replied to.
+    ZX_EXCP_THREAD_RESUMED = ZX_PKT_TYPE_EXCEPTION(ZX_EXCP_SYNTH | 2),
+
+    // A thread is exiting.
+    // This exception is sent to debuggers only (ZX_EXCEPTION_PORT_DEBUGGER).
+    // This exception is different from ZX_EXCP_GONE in that a debugger can
+    // still examine thread state.
+    // The thread is paused until it is resumed by the debugger
+    // with zx_task_resume.
+    ZX_EXCP_THREAD_EXITING = ZX_PKT_TYPE_EXCEPTION(ZX_EXCP_SYNTH | 3),
+
+    // A thread or process has exited or otherwise terminated.
+    // At this point thread/process state is no longer available.
+    // Process gone notifications are only sent to the process exception port
+    // or debugger exception port (if one is registered).
+    // Thread gone notifications are only sent to the thread exception port
+    // (if one is registered).
+    // N.B. This notification is not replied to.
+    ZX_EXCP_GONE = ZX_PKT_TYPE_EXCEPTION(ZX_EXCP_SYNTH | 4),
+
+    // This exception is generated when a syscall fails with a job policy
+    // error (for example, an invalid handle argument is passed to the
+    // syscall when the ZX_POL_BAD_HANDLE policy is enabled) and
+    // ZX_POL_ACTION_EXCEPTION is set for the policy.  The thread that
+    // invoked the syscall may be resumed with zx_task_resume().
+    ZX_EXCP_POLICY_ERROR = ZX_PKT_TYPE_EXCEPTION(ZX_EXCP_SYNTH | 5),
+} zx_excp_type_t;
+
+// Assuming |excp| is an exception type, return non-zero if it is an
+// architectural exception.
+#define ZX_EXCP_IS_ARCH(excp) \
+  (((excp) & (ZX_PKT_TYPE_EXCEPTION(ZX_EXCP_SYNTH) & ~ZX_PKT_TYPE_MASK)) == 0)
+
+typedef struct x86_64_exc_data {
+    uint64_t vector;
+    uint64_t err_code;
+    uint64_t cr2;
+} x86_64_exc_data_t;
+
+typedef struct arm64_exc_data {
+    uint32_t esr;
+    uint64_t far;
+} arm64_exc_data_t;
+
+// data associated with an exception (siginfo in linux parlance)
+// Things available from regsets (e.g., pc) are not included here.
+// For an example list of things one might add, see linux siginfo.
+typedef struct zx_exception_context {
+    struct {
+        union {
+            x86_64_exc_data_t x86_64;
+            arm64_exc_data_t  arm_64;
+        } u;
+    } arch;
+} zx_exception_context_t;
+
+// The common header of all exception reports.
+typedef struct zx_exception_header {
+    // The actual size, in bytes, of the report (including this field).
+    uint32_t size;
+
+    // While IWBN to use an enum here, it's still not portable in C.
+    uint32_t /*zx_excp_type_t*/ type;
+} zx_exception_header_t;
+
+// Data reported to an exception handler for most exceptions.
+typedef struct zx_exception_report {
+    zx_exception_header_t header;
+    // The remainder of the report is exception-specific.
+    zx_exception_context_t context;
+} zx_exception_report_t;
+
+// Options for zx_task_resume()
+#define ZX_RESUME_EXCEPTION (1)
+// Indicates that we should resume the thread from stopped-in-exception state
+// (default resume does not do so)
+
+#define ZX_RESUME_TRY_NEXT (2)
+// Only meaningful when combined with ZX_RESUME_EXCEPTION
+// Indicates that instead of resuming from the faulting instruction we instead
+// let the next exception handler in the search order, if any, process the
+// exception. If there are no more then the entire process is killed.
+
+// Options for zx_task_bind_exception_port.
+#define ZX_EXCEPTION_PORT_DEBUGGER (1)
+// When binding an exception port to a process, set the process's debugger
+// exception port.
+#define ZX_EXCEPTION_PORT_UNBIND_QUIETLY (2)
+// When unbinding an exception port from a thread or process, any threads that
+// got an exception and are waiting for a response from this exception port
+// will continue to wait for a response.
+
+// The type of exception port a thread may be waiting for a response from.
+// These values are reported in zx_info_thread_t.wait_exception_port_type.
+#define ZX_EXCEPTION_PORT_TYPE_NONE     (0u)
+#define ZX_EXCEPTION_PORT_TYPE_DEBUGGER (1u)
+#define ZX_EXCEPTION_PORT_TYPE_THREAD   (2u)
+#define ZX_EXCEPTION_PORT_TYPE_PROCESS  (3u)
+#define ZX_EXCEPTION_PORT_TYPE_JOB      (4u)
+#define ZX_EXCEPTION_PORT_TYPE_SYSTEM   (5u)
+
+__END_CDECLS
diff --git a/system/public/magenta/syscalls/hypervisor.h b/system/public/zircon/syscalls/hypervisor.h
similarity index 72%
rename from system/public/magenta/syscalls/hypervisor.h
rename to system/public/zircon/syscalls/hypervisor.h
index 179d868..f77879f 100644
--- a/system/public/magenta/syscalls/hypervisor.h
+++ b/system/public/zircon/syscalls/hypervisor.h
@@ -6,32 +6,32 @@
 
 #include <assert.h>
 
-#include <magenta/types.h>
-#include <magenta/compiler.h>
+#include <zircon/types.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
 enum {
-    MX_GUEST_TRAP_MEM = 0,
-    MX_GUEST_TRAP_IO  = 1,
+    ZX_GUEST_TRAP_MEM = 0,
+    ZX_GUEST_TRAP_IO  = 1,
 };
 
 // Structure to create a VCPU for a guest.
-typedef struct mx_vcpu_create_args {
-    mx_vaddr_t ip;
+typedef struct zx_vcpu_create_args {
+    zx_vaddr_t ip;
 #if __x86_64__
-    mx_vaddr_t cr3;
-    mx_handle_t apic_vmo;
+    zx_vaddr_t cr3;
+    zx_handle_t apic_vmo;
 #endif // __x86_64__
-} mx_vcpu_create_args_t;
+} zx_vcpu_create_args_t;
 
 enum {
-    MX_VCPU_STATE   = 0,
-    MX_VCPU_IO      = 1,
+    ZX_VCPU_STATE   = 0,
+    ZX_VCPU_IO      = 1,
 };
 
 // Structure to read and write VCPU state.
-typedef struct mx_vcpu_state {
+typedef struct zx_vcpu_state {
 #if __aarch64__
     uint64_t r[31];
 #elif __x86_64__
@@ -54,10 +54,10 @@
     // Only the user-controllable lower 32-bits of the flags register.
     uint32_t flags;
 #endif
-} mx_vcpu_state_t;
+} zx_vcpu_state_t;
 
 // Structure to read and write VCPU state for IO ports.
-typedef struct mx_vcpu_io {
+typedef struct zx_vcpu_io {
     uint8_t access_size;
     union {
         uint8_t u8;
@@ -65,6 +65,6 @@
         uint32_t u32;
         uint8_t data[4];
     };
-} mx_vcpu_io_t;
+} zx_vcpu_io_t;
 
 __END_CDECLS
diff --git a/system/public/zircon/syscalls/log.h b/system/public/zircon/syscalls/log.h
new file mode 100644
index 0000000..2d1a369
--- /dev/null
+++ b/system/public/zircon/syscalls/log.h
@@ -0,0 +1,52 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+
+// ask clang format not to mess up the indentation:
+// clang-format off
+
+__BEGIN_CDECLS
+
+// Defines and structures for zx_log_*()
+typedef struct zx_log_record {
+    uint32_t reserved;
+    uint16_t datalen;
+    uint16_t flags;
+    zx_time_t timestamp;
+    uint64_t pid;
+    uint64_t tid;
+    char data[0];
+} zx_log_record_t;
+
+#define ZX_LOG_RECORD_MAX     256
+
+// Common Log Levels
+#define ZX_LOG_ERROR          (0x0001)
+#define ZX_LOG_INFO           (0x0002)
+#define ZX_LOG_TRACE          (0x0004)
+#define ZX_LOG_SPEW           (0x0008)
+
+// Custom Log Levels
+#define ZX_LOG_DEBUG1         (0x0010)
+#define ZX_LOG_DEBUG2         (0x0020)
+#define ZX_LOG_DEBUG3         (0x0030)
+#define ZX_LOG_DEBUG4         (0x0040)
+
+// Filter Flags
+
+// Do not forward this message via network
+// (for logging in network core and drivers)
+#define ZX_LOG_LOCAL          (0x1000)
+
+#define ZX_LOG_LEVEL_MASK     (0x00FF)
+#define ZX_LOG_FLAGS_MASK     (0xFFFF)
+
+// Options
+
+#define ZX_LOG_FLAG_READABLE  0x40000000
+
+__END_CDECLS
diff --git a/system/public/zircon/syscalls/object.h b/system/public/zircon/syscalls/object.h
new file mode 100644
index 0000000..b75c310
--- /dev/null
+++ b/system/public/zircon/syscalls/object.h
@@ -0,0 +1,397 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+
+__BEGIN_CDECLS
+
+// ask clang format not to mess up the indentation:
+// clang-format off
+
+// Valid topics for zx_object_get_info.
+typedef enum {
+    ZX_INFO_NONE                       = 0,
+    ZX_INFO_HANDLE_VALID               = 1,
+    ZX_INFO_HANDLE_BASIC               = 2,  // zx_info_handle_basic_t[1]
+    ZX_INFO_PROCESS                    = 3,  // zx_info_process_t[1]
+    ZX_INFO_PROCESS_THREADS            = 4,  // zx_koid_t[n]
+    ZX_INFO_VMAR                       = 7,  // zx_info_vmar_t[1]
+    ZX_INFO_JOB_CHILDREN               = 8,  // zx_koid_t[n]
+    ZX_INFO_JOB_PROCESSES              = 9,  // zx_koid_t[n]
+    ZX_INFO_THREAD                     = 10, // zx_info_thread_t[1]
+    ZX_INFO_THREAD_EXCEPTION_REPORT    = 11, // zx_exception_report_t[1]
+    ZX_INFO_TASK_STATS                 = 12, // zx_info_task_stats_t[1]
+    ZX_INFO_PROCESS_MAPS               = 13, // zx_info_maps_t[n]
+    ZX_INFO_PROCESS_VMOS               = 14, // zx_info_vmo_t[n]
+    ZX_INFO_THREAD_STATS               = 15, // zx_info_thread_stats_t[1]
+    ZX_INFO_CPU_STATS                  = 16, // zx_info_cpu_stats_t[n]
+    ZX_INFO_KMEM_STATS                 = 17, // zx_info_kmem_stats_t[1]
+    ZX_INFO_RESOURCE                   = 18, // zx_info_resource_t[1]
+    ZX_INFO_LAST
+} zx_object_info_topic_t;
+
+typedef enum {
+    ZX_OBJ_TYPE_NONE                = 0,
+    ZX_OBJ_TYPE_PROCESS             = 1,
+    ZX_OBJ_TYPE_THREAD              = 2,
+    ZX_OBJ_TYPE_VMO                 = 3,
+    ZX_OBJ_TYPE_CHANNEL             = 4,
+    ZX_OBJ_TYPE_EVENT               = 5,
+    ZX_OBJ_TYPE_PORT                = 6,
+    ZX_OBJ_TYPE_INTERRUPT           = 9,
+    ZX_OBJ_TYPE_PCI_DEVICE          = 11,
+    ZX_OBJ_TYPE_LOG                 = 12,
+    ZX_OBJ_TYPE_SOCKET              = 14,
+    ZX_OBJ_TYPE_RESOURCE            = 15,
+    ZX_OBJ_TYPE_EVENT_PAIR          = 16,
+    ZX_OBJ_TYPE_JOB                 = 17,
+    ZX_OBJ_TYPE_VMAR                = 18,
+    ZX_OBJ_TYPE_FIFO                = 19,
+    ZX_OBJ_TYPE_GUEST               = 20,
+    ZX_OBJ_TYPE_VCPU                = 21,
+    ZX_OBJ_TYPE_TIMER               = 22,
+    ZX_OBJ_TYPE_LAST
+} zx_obj_type_t;
+
+typedef enum {
+    ZX_OBJ_PROP_NONE            = 0,
+    ZX_OBJ_PROP_WAITABLE        = 1,
+} zx_obj_props_t;
+
+typedef struct zx_info_handle_basic {
+    // The unique id assigned by kernel to the object referenced by the
+    // handle.
+    zx_koid_t koid;
+
+    // The immutable rights assigned to the handle. Two handles that
+    // have the same koid and the same rights are equivalent and
+    // interchangeable.
+    zx_rights_t rights;
+
+    // The object type: channel, event, socket, etc.
+    uint32_t type;                // zx_obj_type_t;
+
+    // The koid of the logical counterpart or parent object of the
+    // object referenced by the handle. Otherwise this value is zero.
+    zx_koid_t related_koid;
+
+    // Set to ZX_OBJ_PROP_WAITABLE if the object referenced by the
+    // handle can be waited on; zero otherwise.
+    uint32_t props;               // zx_obj_props_t;
+} zx_info_handle_basic_t;
+
+typedef struct zx_info_process {
+    // The process's return code; only valid if |exited| is true.
+    // Guaranteed to be non-zero if the process was killed by |zx_task_kill|.
+    int return_code;
+
+    // True if the process has ever left the initial creation state,
+    // even if it has exited as well.
+    bool started;
+
+    // If true, the process has exited and |return_code| is valid.
+    bool exited;
+
+    // True if a debugger is attached to the process.
+    bool debugger_attached;
+} zx_info_process_t;
+
+typedef struct zx_info_thread {
+    // One of ZX_THREAD_STATE_* values.
+    uint32_t state;
+
+    // If nonzero, the thread has gotten an exception and is waiting for
+    // the exception to be handled by the specified port.
+    // The value is one of ZX_EXCEPTION_PORT_TYPE_*.
+    // Note: If the thread is waiting for an exception response then |state|
+    // will have the value ZX_THREAD_STATE_BLOCKED.
+    uint32_t wait_exception_port_type;
+} zx_info_thread_t;
+
+typedef struct zx_info_thread_stats {
+    // Total accumulated running time of the thread.
+    zx_time_t total_runtime;
+} zx_info_thread_stats_t;
+
+// Statistics about resources (e.g., memory) used by a task. Can be relatively
+// expensive to gather.
+typedef struct zx_info_task_stats {
+    // The total size of mapped memory ranges in the task.
+    // Not all will be backed by physical memory.
+    size_t mem_mapped_bytes;
+
+    // For the fields below, a byte is considered committed if it's backed by
+    // physical memory. Some of the memory may be double-mapped, and thus
+    // double-counted.
+
+    // Committed memory that is only mapped into this task.
+    size_t mem_private_bytes;
+
+    // Committed memory that is mapped into this and at least one other task.
+    size_t mem_shared_bytes;
+
+    // A number that estimates the fraction of mem_shared_bytes that this
+    // task is responsible for keeping alive.
+    //
+    // An estimate of:
+    //   For each shared, committed byte:
+    //   mem_scaled_shared_bytes += 1 / (number of tasks mapping this byte)
+    //
+    // This number is strictly smaller than mem_shared_bytes.
+    size_t mem_scaled_shared_bytes;
+} zx_info_task_stats_t;
+
+typedef struct zx_info_vmar {
+    // Base address of the region.
+    uintptr_t base;
+
+    // Length of the region, in bytes.
+    size_t len;
+} zx_info_vmar_t;
+
+
+// Types and values used by ZX_INFO_PROCESS_MAPS.
+
+// Describes a VM mapping.
+typedef struct zx_info_maps_mapping {
+    // MMU flags for the mapping.
+    // Bitwise OR of ZX_VM_FLAG_PERM_{READ,WRITE,EXECUTE} values.
+    uint32_t mmu_flags;
+    // koid of the mapped VMO.
+    zx_koid_t vmo_koid;
+    // The number of PAGE_SIZE pages in the mapped region of the VMO
+    // that are backed by physical memory.
+    size_t committed_pages;
+} zx_info_maps_mapping_t;
+
+// Types of entries represented by zx_info_maps_t.
+// Can't use zx_obj_type_t because not all of these are
+// user-visible kernel object types.
+typedef enum zx_info_maps_type {
+    ZX_INFO_MAPS_TYPE_NONE    = 0,
+    ZX_INFO_MAPS_TYPE_ASPACE  = 1,
+    ZX_INFO_MAPS_TYPE_VMAR    = 2,
+    ZX_INFO_MAPS_TYPE_MAPPING = 3,
+    ZX_INFO_MAPS_TYPE_LAST
+} zx_info_maps_type_t;
+
+// Describes a node in the aspace/vmar/mapping hierarchy for a user process.
+typedef struct zx_info_maps {
+    // Name if available; empty string otherwise.
+    char name[ZX_MAX_NAME_LEN];
+    // Base address.
+    zx_vaddr_t base;
+    // Size in bytes.
+    size_t size;
+
+    // The depth of this node in the tree.
+    // Can be used for indentation, or to rebuild the tree from an array
+    // of zx_info_maps_t entries, which will be in depth-first pre-order.
+    size_t depth;
+    // The type of this entry; indicates which union entry is valid.
+    uint32_t type; // zx_info_maps_type_t
+    union {
+        zx_info_maps_mapping_t mapping;
+        // No additional fields for other types.
+    } u;
+} zx_info_maps_t;
+
+
+// Values and types used by ZX_INFO_PROCESS_VMOS.
+
+// The VMO is backed by RAM, consuming memory.
+// Mutually exclusive with ZX_INFO_VMO_TYPE_PHYSICAL.
+// See ZX_INFO_VMO_TYPE(flags)
+#define ZX_INFO_VMO_TYPE_PAGED              (1u<<0)
+
+// The VMO points to a physical address range, and does not consume memory.
+// Typically used to access memory-mapped hardware.
+// Mutually exclusive with ZX_INFO_VMO_TYPE_PAGED.
+// See ZX_INFO_VMO_TYPE(flags)
+#define ZX_INFO_VMO_TYPE_PHYSICAL           (0u<<0)
+
+// Returns a VMO's type based on its flags, allowing for checks like
+// if (ZX_INFO_VMO_TYPE(f) == ZX_INFO_VMO_TYPE_PAGED)
+#define ZX_INFO_VMO_TYPE(flags)             ((flags) & (1u<<0))
+
+// The VMO is a clone, and is a copy-on-write clone.
+#define ZX_INFO_VMO_IS_COW_CLONE            (1u<<2)
+
+// When reading a list of VMOs pointed to by a process, indicates that the
+// process has a handle to the VMO, which isn't necessarily mapped.
+#define ZX_INFO_VMO_VIA_HANDLE              (1u<<3)
+
+// When reading a list of VMOs pointed to by a process, indicates that the
+// process maps the VMO into a VMAR, but doesn't necessarily have a handle to
+// the VMO.
+#define ZX_INFO_VMO_VIA_MAPPING             (1u<<4)
+
+// Describes a VMO. For mapping information, see |zx_info_maps_t|.
+typedef struct zx_info_vmo {
+    // The koid of this VMO.
+    zx_koid_t koid;
+
+    // The name of this VMO.
+    char name[ZX_MAX_NAME_LEN];
+
+    // The size of this VMO; i.e., the amount of virtual address space it
+    // would consume if mapped.
+    uint64_t size_bytes;
+
+    // If this VMO is a clone, the koid of its parent. Otherwise, zero.
+    // See |flags| for the type of clone.
+    zx_koid_t parent_koid;
+
+    // The number of clones of this VMO, if any.
+    size_t num_children;
+
+    // The number of times this VMO is currently mapped into VMARs.
+    // Note that the same process will often map the same VMO twice,
+    // and both mappings will be counted here. (I.e., this is not a count
+    // of the number of processes that map this VMO; see share_count.)
+    size_t num_mappings;
+
+    // An estimate of the number of unique address spaces that
+    // this VMO is mapped into. Every process has its own address space,
+    // and so does the kernel.
+    size_t share_count;
+
+    // Bitwise OR of ZX_INFO_VMO_* values.
+    uint32_t flags;
+
+    // If |ZX_INFO_VMO_TYPE(flags) == ZX_INFO_VMO_TYPE_PAGED|, the amount of
+    // memory currently allocated to this VMO; i.e., the amount of physical
+    // memory it consumes. Undefined otherwise.
+    uint64_t committed_bytes;
+
+    // If |flags & ZX_INFO_VMO_VIA_HANDLE|, the handle rights.
+    // Undefined otherwise.
+    zx_rights_t handle_rights;
+} zx_info_vmo_t;
+
+// kernel statistics per cpu
+typedef struct zx_info_cpu_stats {
+    uint32_t cpu_number;
+    uint32_t flags;
+
+    zx_time_t idle_time;
+
+    // kernel scheduler counters
+    uint64_t reschedules;
+    uint64_t context_switches;
+    uint64_t irq_preempts;
+    uint64_t preempts;
+    uint64_t yields;
+
+    // cpu level interrupts and exceptions
+    uint64_t ints;          // hardware interrupts, minus timer interrupts or inter-processor interrupts
+    uint64_t timer_ints;    // timer interrupts
+    uint64_t timers;        // timer callbacks
+    uint64_t page_faults;   // page faults
+    uint64_t exceptions;    // exceptions such as undefined opcode
+    uint64_t syscalls;
+
+    // inter-processor interrupts
+    uint64_t reschedule_ipis;
+    uint64_t generic_ipis;
+} zx_info_cpu_stats_t;
+
+// Information about kernel memory usage.
+// Can be expensive to gather.
+typedef struct zx_info_kmem_stats {
+    // The total amount of physical memory available to the system.
+    uint64_t total_bytes;
+
+    // The amount of unallocated memory.
+    uint64_t free_bytes;
+
+    // The amount of memory reserved by and mapped into the kernel for reasons
+    // not covered by other fields in this struct. Typically for readonly data
+    // like the ram disk and kernel image, and for early-boot dynamic memory.
+    uint64_t wired_bytes;
+
+    // The amount of memory allocated to the kernel heap.
+    uint64_t total_heap_bytes;
+
+    // The portion of |total_heap_bytes| that is not in use.
+    uint64_t free_heap_bytes;
+
+    // The amount of memory committed to VMOs, both kernel and user.
+    // A superset of all userspace memory.
+    // Does not include certain VMOs that fall under |wired_bytes|.
+    //
+    // TODO(dbort): Break this into at least two pieces: userspace VMOs that
+    // have koids, and kernel VMOs that don't. Or maybe look at VMOs
+    // mapped into the kernel aspace vs. everything else.
+    uint64_t vmo_bytes;
+
+    // The amount of memory used for architecture-specific MMU metadata
+    // like page tables.
+    uint64_t mmu_overhead_bytes;
+
+    // Non-free memory that isn't accounted for in any other field.
+    uint64_t other_bytes;
+} zx_info_kmem_stats_t;
+
+typedef struct zx_info_resource {
+    // The resource kind, one of:
+    // {ZX_RSRC_KIND_ROOT, ZX_RSRC_KIND_MMIO, ZX_RSRC_KIND_IOPORT, ZX_RSRC_KIND_IRQ}
+    uint32_t kind;
+    // Resource's low value (inclusive)
+    uint64_t low;
+    // Resource's high value (inclusive)
+    uint64_t high;
+} zx_info_resource_t;
+
+#define ZX_INFO_CPU_STATS_FLAG_ONLINE       (1u<<0)
+
+// Object properties.
+
+// Argument is a uint32_t.
+#define ZX_PROP_NUM_STATE_KINDS             2u
+// Argument is a char[ZX_MAX_NAME_LEN].
+#define ZX_PROP_NAME                        3u
+
+#if __x86_64__
+// Argument is a uintptr_t.
+#define ZX_PROP_REGISTER_FS                 4u
+#endif
+
+// Argument is the value of ld.so's _dl_debug_addr, a uintptr_t.
+#define ZX_PROP_PROCESS_DEBUG_ADDR          5u
+
+// Argument is the base address of the vDSO mapping (or zero), a uintptr_t.
+#define ZX_PROP_PROCESS_VDSO_BASE_ADDRESS   6u
+
+// Argument is an zx_job_importance_t value.
+#define ZX_PROP_JOB_IMPORTANCE             7u
+
+// Describes how important a job is.
+typedef int32_t zx_job_importance_t;
+
+// Valid zx_job_importance_t values and range.
+// The non-negative values must fit in 8 bits.
+
+// A job with this importance will inherit its actual importance from
+// the closest ancestor with a non-INHERITED importance property value.
+#define ZX_JOB_IMPORTANCE_INHERITED ((zx_job_importance_t)-1)
+
+// The lowest importance. Jobs with this importance value are likely to be
+// killed first in an out-of-memory situation.
+#define ZX_JOB_IMPORTANCE_MIN       ((zx_job_importance_t)0)
+
+// The highest importance.
+#define ZX_JOB_IMPORTANCE_MAX       ((zx_job_importance_t)255)
+
+// Values for zx_info_thread_t.state.
+#define ZX_THREAD_STATE_NEW                 0u
+#define ZX_THREAD_STATE_RUNNING             1u
+#define ZX_THREAD_STATE_SUSPENDED           2u
+#define ZX_THREAD_STATE_BLOCKED             3u
+#define ZX_THREAD_STATE_DYING               4u
+#define ZX_THREAD_STATE_DEAD                5u
+
+__END_CDECLS
diff --git a/system/public/magenta/syscalls/pci.h b/system/public/zircon/syscalls/pci.h
similarity index 68%
rename from system/public/magenta/syscalls/pci.h
rename to system/public/zircon/syscalls/pci.h
index ba2ba3a..7e7fe58 100644
--- a/system/public/magenta/syscalls/pci.h
+++ b/system/public/zircon/syscalls/pci.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
@@ -21,24 +21,24 @@
     PCI_RESOURCE_TYPE_UNUSED = 0,
     PCI_RESOURCE_TYPE_MMIO,
     PCI_RESOURCE_TYPE_PIO,
-} mx_pci_resource_types_t;
+} zx_pci_resource_types_t;
 
 // TODO(cja): This makes some assumptions that anything in an arch's PIO region
 // is going to be defined as a base address and size. This will need to be
 // updated to a per-platform structure in the event that doesn't pan out
 // in the future.
-typedef struct mx_pci_bar {
+typedef struct zx_pci_bar {
     uint32_t type;
     size_t size;
     union {
-        mx_handle_t mmio_handle;
+        zx_handle_t mmio_handle;
         uintptr_t pio_addr;
     };
-} mx_pci_resource_t;
+} zx_pci_resource_t;
 
-// Defines and structures related to mx_pci_*()
+// Defines and structures related to zx_pci_*()
 // Info returned to dev manager for PCIe devices when probing.
-typedef struct mx_pcie_device_info {
+typedef struct zx_pcie_device_info {
     uint16_t vendor_id;
     uint16_t device_id;
 
@@ -50,16 +50,16 @@
     uint8_t  bus_id;
     uint8_t  dev_id;
     uint8_t  func_id;
-} mx_pcie_device_info_t;
+} zx_pcie_device_info_t;
 
-#define MX_PCI_NO_IRQ_MAPPING UINT32_MAX
+#define ZX_PCI_NO_IRQ_MAPPING UINT32_MAX
 
 // Dimensions: device id, function id, legacy pin number
-// MX_PCI_NO_IRQ_MAPPING if no mapping specified.
-typedef uint32_t mx_pci_irq_swizzle_lut_t[32][8][4];
+// ZX_PCI_NO_IRQ_MAPPING if no mapping specified.
+typedef uint32_t zx_pci_irq_swizzle_lut_t[32][8][4];
 
-typedef struct mx_pci_init_arg {
-    mx_pci_irq_swizzle_lut_t dev_pin_to_global_irq;
+typedef struct zx_pci_init_arg {
+    zx_pci_irq_swizzle_lut_t dev_pin_to_global_irq;
 
     uint32_t num_irqs;
     struct {
@@ -77,19 +77,19 @@
         uint8_t bus_start;
         uint8_t bus_end;
     } addr_windows[];
-} mx_pci_init_arg_t;
+} zx_pci_init_arg_t;
 
-#define MX_PCI_INIT_ARG_MAX_ECAM_WINDOWS 1
-#define MX_PCI_INIT_ARG_MAX_SIZE (sizeof(((mx_pci_init_arg_t*)NULL)->addr_windows[0]) * \
-                                  MX_PCI_INIT_ARG_MAX_ECAM_WINDOWS + \
-                                  sizeof(mx_pci_init_arg_t))
+#define ZX_PCI_INIT_ARG_MAX_ECAM_WINDOWS 1
+#define ZX_PCI_INIT_ARG_MAX_SIZE (sizeof(((zx_pci_init_arg_t*)NULL)->addr_windows[0]) * \
+                                  ZX_PCI_INIT_ARG_MAX_ECAM_WINDOWS + \
+                                  sizeof(zx_pci_init_arg_t))
 
 // Enum used to select PCIe IRQ modes
 typedef enum {
-    MX_PCIE_IRQ_MODE_DISABLED = 0,
-    MX_PCIE_IRQ_MODE_LEGACY   = 1,
-    MX_PCIE_IRQ_MODE_MSI      = 2,
-    MX_PCIE_IRQ_MODE_MSI_X    = 3,
-} mx_pci_irq_mode_t;
+    ZX_PCIE_IRQ_MODE_DISABLED = 0,
+    ZX_PCIE_IRQ_MODE_LEGACY   = 1,
+    ZX_PCIE_IRQ_MODE_MSI      = 2,
+    ZX_PCIE_IRQ_MODE_MSI_X    = 3,
+} zx_pci_irq_mode_t;
 
 __END_CDECLS
diff --git a/system/public/zircon/syscalls/policy.h b/system/public/zircon/syscalls/policy.h
new file mode 100644
index 0000000..52ba44b
--- /dev/null
+++ b/system/public/zircon/syscalls/policy.h
@@ -0,0 +1,52 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+
+__BEGIN_CDECLS
+
+// ask clang format not to mess up the indentation:
+// clang-format off
+
+// Policy is applied for the conditions that are not
+// specified by the parent job policy.
+#define ZX_JOB_POL_RELATIVE                 0u
+// Policy is either applied as-is or the syscall fails.
+#define ZX_JOB_POL_ABSOLUTE                 1u
+
+// Basic policy topic.
+#define ZX_JOB_POL_BASIC                    0u
+
+// Input structure to use with ZX_JOB_POL_BASIC.
+typedef struct zx_policy_basic {
+    uint32_t condition;
+    uint32_t policy;
+} zx_policy_basic_t;
+
+// Conditions handled by job policy.
+#define ZX_POL_BAD_HANDLE                    0u
+#define ZX_POL_WRONG_OBJECT                  1u
+#define ZX_POL_VMAR_WX                       2u
+#define ZX_POL_NEW_ANY                       3u
+#define ZX_POL_NEW_VMO                       4u
+#define ZX_POL_NEW_CHANNEL                   5u
+#define ZX_POL_NEW_EVENT                     6u
+#define ZX_POL_NEW_EVPAIR                    7u
+#define ZX_POL_NEW_PORT                      8u
+#define ZX_POL_NEW_SOCKET                    9u
+#define ZX_POL_NEW_FIFO                     10u
+#define ZX_POL_NEW_TIMER                    11u
+#define ZX_POL_MAX                          12u
+
+// Policy actions.
+// ZX_POL_ACTION_ALLOW and ZX_POL_ACTION_DENY can be ORed with ZX_POL_ACTION_EXCEPTION.
+// ZX_POL_ACTION_KILL implies ZX_POL_ACTION_DENY.
+#define ZX_POL_ACTION_ALLOW                 0u
+#define ZX_POL_ACTION_DENY                  1u
+#define ZX_POL_ACTION_EXCEPTION             2u
+#define ZX_POL_ACTION_KILL                  5u
+
+__END_CDECLS
diff --git a/system/public/zircon/syscalls/port.h b/system/public/zircon/syscalls/port.h
new file mode 100644
index 0000000..99f7968
--- /dev/null
+++ b/system/public/zircon/syscalls/port.h
@@ -0,0 +1,100 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+
+__BEGIN_CDECLS
+
+// zx_object_wait_async() options
+#define ZX_WAIT_ASYNC_ONCE          0u
+#define ZX_WAIT_ASYNC_REPEATING     1u
+
+// packet types.
+#define ZX_PKT_TYPE_USER            0x00u
+#define ZX_PKT_TYPE_SIGNAL_ONE      0x01u
+#define ZX_PKT_TYPE_SIGNAL_REP      0x02u
+#define ZX_PKT_TYPE_GUEST_MEM       0x03u
+#define ZX_PKT_TYPE_GUEST_IO        0x04u
+#define ZX_PKT_TYPE_EXCEPTION(n)    (0x05u | (((n) & 0xFFu) << 8))
+
+#define ZX_PKT_TYPE_MASK            0xFFu
+
+#define ZX_PKT_IS_USER(type)        ((type) == ZX_PKT_TYPE_USER)
+#define ZX_PKT_IS_SIGNAL_ONE(type)  ((type) == ZX_PKT_TYPE_SIGNAL_ONE)
+#define ZX_PKT_IS_SIGNAL_REP(type)  ((type) == ZX_PKT_TYPE_SIGNAL_REP)
+#define ZX_PKT_IS_GUEST_MEM(type)   ((type) == ZX_PKT_TYPE_GUEST_MEM)
+#define ZX_PKT_IS_GUEST_IO(type)    ((type) == ZX_PKT_TYPE_GUEST_IO)
+#define ZX_PKT_IS_EXCEPTION(type)   (((type) & ZX_PKT_TYPE_MASK) == ZX_PKT_TYPE_EXCEPTION(0))
+
+// port_packet_t::type ZX_PKT_TYPE_USER.
+typedef union zx_packet_user {
+    uint64_t u64[4];
+    uint32_t u32[8];
+    uint16_t u16[16];
+    uint8_t   c8[32];
+} zx_packet_user_t;
+
+// port_packet_t::type ZX_PKT_TYPE_SIGNAL_ONE and ZX_PKT_TYPE_SIGNAL_REP.
+typedef struct zx_packet_signal {
+    zx_signals_t trigger;
+    zx_signals_t observed;
+    uint64_t count;
+    uint64_t reserved0;
+    uint64_t reserved1;
+} zx_packet_signal_t;
+
+typedef struct zx_packet_exception {
+    uint64_t pid;
+    uint64_t tid;
+    uint64_t reserved0;
+    uint64_t reserved1;
+} zx_packet_exception_t;
+
+typedef struct zx_packet_guest_mem {
+    zx_vaddr_t addr;
+#if __aarch64__
+    uint32_t inst;
+    uint32_t reserved0;
+    uint64_t reserved1;
+    uint64_t reserved2;
+#elif __x86_64__
+// NOTE: x86 instructions are guaranteed to be 15 bytes or fewer.
+#define X86_MAX_INST_LEN 15u
+    uint8_t inst_len;
+    uint8_t inst_buf[X86_MAX_INST_LEN];
+    uint64_t reserved;
+#endif
+} zx_packet_guest_mem_t;
+
+typedef struct zx_packet_guest_io {
+    uint16_t port;
+    uint8_t access_size;
+    bool input;
+    union {
+        uint8_t u8;
+        uint16_t u16;
+        uint32_t u32;
+        uint8_t data[4];
+    };
+    uint64_t reserved0;
+    uint64_t reserved1;
+    uint64_t reserved2;
+} zx_packet_guest_io_t;
+
+typedef struct zx_port_packet {
+    uint64_t key;
+    uint32_t type;
+    int32_t status;
+    union {
+        zx_packet_user_t user;
+        zx_packet_signal_t signal;
+        zx_packet_exception_t exception;
+        zx_packet_guest_io_t guest_io;
+        zx_packet_guest_mem_t guest_mem;
+    };
+} zx_port_packet_t;
+
+__END_CDECLS
diff --git a/system/public/zircon/syscalls/resource.h b/system/public/zircon/syscalls/resource.h
new file mode 100644
index 0000000..1f2bcb3
--- /dev/null
+++ b/system/public/zircon/syscalls/resource.h
@@ -0,0 +1,22 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/compiler.h>
+
+__BEGIN_CDECLS
+
+// The root resource
+#define ZX_RSRC_KIND_ROOT        (0x0000u)
+
+// Hardware resources
+#define ZX_RSRC_KIND_MMIO        (0x1000u)
+#define ZX_RSRC_KIND_IOPORT      (0x1001u)
+#define ZX_RSRC_KIND_IRQ         (0x1002u)
+
+// Subsystem resources
+#define ZX_RSRC_KIND_HYPERVISOR  (0x2000u)
+
+__END_CDECLS
diff --git a/system/public/zircon/syscalls/types.h b/system/public/zircon/syscalls/types.h
new file mode 100644
index 0000000..9b1506a
--- /dev/null
+++ b/system/public/zircon/syscalls/types.h
@@ -0,0 +1,17 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+__BEGIN_CDECLS
+
+// forward declarations needed by syscalls.h
+typedef struct zx_port_packet zx_port_packet_t;
+typedef struct zx_pci_bar zx_pci_resource_t;
+typedef struct zx_pcie_device_info zx_pcie_device_info_t;
+typedef struct zx_pci_init_arg zx_pci_init_arg_t;
+typedef union zx_rrec zx_rrec_t;
+typedef struct zx_vcpu_create_args zx_vcpu_create_args_t;
+
+__END_CDECLS
diff --git a/system/public/magenta/tls.h b/system/public/zircon/tls.h
similarity index 69%
rename from system/public/magenta/tls.h
rename to system/public/zircon/tls.h
index bcf2cc4..347b36d 100644
--- a/system/public/magenta/tls.h
+++ b/system/public/zircon/tls.h
@@ -9,13 +9,13 @@
 
 #if defined(__x86_64__)
 
-#define MX_TLS_STACK_GUARD_OFFSET       0x10
-#define MX_TLS_UNSAFE_SP_OFFSET         0x18
+#define ZX_TLS_STACK_GUARD_OFFSET       0x10
+#define ZX_TLS_UNSAFE_SP_OFFSET         0x18
 
 #elif defined(__aarch64__)
 
-#define MX_TLS_STACK_GUARD_OFFSET       -0x10
-#define MX_TLS_UNSAFE_SP_OFFSET         -0x8
+#define ZX_TLS_STACK_GUARD_OFFSET       -0x10
+#define ZX_TLS_UNSAFE_SP_OFFSET         -0x8
 
 #else
 
diff --git a/system/public/zircon/types.h b/system/public/zircon/types.h
new file mode 100644
index 0000000..7e7a285
--- /dev/null
+++ b/system/public/zircon/types.h
@@ -0,0 +1,308 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/compiler.h>
+#include <zircon/errors.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#ifndef __cplusplus
+#ifndef _KERNEL
+// We don't want to include <stdatomic.h> from the kernel code because the
+// kernel definitions of atomic operations are incompatible with those defined
+// in <stdatomic.h>.
+//
+// A better solution would be to use <stdatomic.h> and C11 atomic operation
+// even in the kernel, but that would require modifying all the code that uses
+// the existing homegrown atomics.
+#include <stdatomic.h>
+#endif
+#endif
+
+__BEGIN_CDECLS
+
+// ask clang format not to mess up the indentation:
+// clang-format off
+
+#ifdef _KERNEL
+typedef uint32_t zx_handle_t;
+#else
+typedef int32_t zx_handle_t;
+#endif
+
+#define ZX_HANDLE_INVALID         ((zx_handle_t)0)
+
+// Same as kernel status_t
+typedef int32_t zx_status_t;
+
+// absolute time in nanoseconds (generally with respect to the monotonic clock)
+typedef uint64_t zx_time_t;
+// a duration in nanoseconds
+typedef uint64_t zx_duration_t;
+#define ZX_TIME_INFINITE UINT64_MAX
+#define ZX_USEC(n) ((zx_duration_t)(1000ULL * (n)))
+#define ZX_MSEC(n) ((zx_duration_t)(1000000ULL * (n)))
+#define ZX_SEC(n)  ((zx_duration_t)(1000000000ULL * (n)))
+
+typedef uint32_t zx_signals_t;
+
+#define ZX_SIGNAL_NONE              ((zx_signals_t)0u)
+#define ZX_USER_SIGNAL_ALL          ((zx_signals_t)0xff000000u)
+
+// Implementation details (__ZX_* not intended for public consumption)
+//
+// Signals that have a common meaning where used are named with that
+// meaning.  Signals that do not, or are not yet in use, are named
+// generically.
+#define __ZX_OBJECT_SIGNAL_ALL      ((zx_signals_t)0x00ffffffu)
+#define __ZX_OBJECT_READABLE        ((zx_signals_t)1u << 0)
+#define __ZX_OBJECT_WRITABLE        ((zx_signals_t)1u << 1)
+#define __ZX_OBJECT_PEER_CLOSED     ((zx_signals_t)1u << 2)
+#define __ZX_OBJECT_SIGNALED        ((zx_signals_t)1u << 3)
+#define __ZX_OBJECT_SIGNAL_4        ((zx_signals_t)1u << 4)
+#define __ZX_OBJECT_SIGNAL_5        ((zx_signals_t)1u << 5)
+#define __ZX_OBJECT_SIGNAL_6        ((zx_signals_t)1u << 6)
+#define __ZX_OBJECT_SIGNAL_7        ((zx_signals_t)1u << 7)
+#define __ZX_OBJECT_SIGNAL_8        ((zx_signals_t)1u << 8)
+#define __ZX_OBJECT_SIGNAL_9        ((zx_signals_t)1u << 9)
+#define __ZX_OBJECT_SIGNAL_10       ((zx_signals_t)1u << 10)
+#define __ZX_OBJECT_SIGNAL_11       ((zx_signals_t)1u << 11)
+#define __ZX_OBJECT_SIGNAL_12       ((zx_signals_t)1u << 12)
+#define __ZX_OBJECT_SIGNAL_13       ((zx_signals_t)1u << 13)
+#define __ZX_OBJECT_SIGNAL_14       ((zx_signals_t)1u << 14)
+#define __ZX_OBJECT_SIGNAL_15       ((zx_signals_t)1u << 15)
+#define __ZX_OBJECT_SIGNAL_16       ((zx_signals_t)1u << 16)
+#define __ZX_OBJECT_SIGNAL_17       ((zx_signals_t)1u << 17)
+#define __ZX_OBJECT_SIGNAL_18       ((zx_signals_t)1u << 18)
+#define __ZX_OBJECT_SIGNAL_19       ((zx_signals_t)1u << 19)
+#define __ZX_OBJECT_SIGNAL_20       ((zx_signals_t)1u << 20)
+#define __ZX_OBJECT_SIGNAL_21       ((zx_signals_t)1u << 21)
+#define __ZX_OBJECT_LAST_HANDLE     ((zx_signals_t)1u << 22)
+#define __ZX_OBJECT_HANDLE_CLOSED   ((zx_signals_t)1u << 23)
+
+
+
+// User Signals (for zx_object_signal() and zx_object_signal_peer())
+#define ZX_USER_SIGNAL_0            ((zx_signals_t)1u << 24)
+#define ZX_USER_SIGNAL_1            ((zx_signals_t)1u << 25)
+#define ZX_USER_SIGNAL_2            ((zx_signals_t)1u << 26)
+#define ZX_USER_SIGNAL_3            ((zx_signals_t)1u << 27)
+#define ZX_USER_SIGNAL_4            ((zx_signals_t)1u << 28)
+#define ZX_USER_SIGNAL_5            ((zx_signals_t)1u << 29)
+#define ZX_USER_SIGNAL_6            ((zx_signals_t)1u << 30)
+#define ZX_USER_SIGNAL_7            ((zx_signals_t)1u << 31)
+
+// Cancelation (handle was closed while waiting with it)
+#define ZX_SIGNAL_HANDLE_CLOSED     __ZX_OBJECT_HANDLE_CLOSED
+
+// Only one user-more reference (handle) to the object exists.
+#define ZX_SIGNAL_LAST_HANDLE       __ZX_OBJECT_LAST_HANDLE
+
+// Event
+#define ZX_EVENT_SIGNALED           __ZX_OBJECT_SIGNALED
+#define ZX_EVENT_SIGNAL_MASK        (ZX_USER_SIGNAL_ALL | __ZX_OBJECT_SIGNALED)
+
+// EventPair
+#define ZX_EPAIR_SIGNALED           __ZX_OBJECT_SIGNALED
+#define ZX_EPAIR_PEER_CLOSED        __ZX_OBJECT_PEER_CLOSED
+#define ZX_EPAIR_SIGNAL_MASK        (ZX_USER_SIGNAL_ALL | __ZX_OBJECT_SIGNALED | __ZX_OBJECT_PEER_CLOSED)
+
+// Channel
+#define ZX_CHANNEL_READABLE         __ZX_OBJECT_READABLE
+#define ZX_CHANNEL_WRITABLE         __ZX_OBJECT_WRITABLE
+#define ZX_CHANNEL_PEER_CLOSED      __ZX_OBJECT_PEER_CLOSED
+
+// Socket
+#define ZX_SOCKET_READABLE          __ZX_OBJECT_READABLE
+#define ZX_SOCKET_WRITABLE          __ZX_OBJECT_WRITABLE
+#define ZX_SOCKET_PEER_CLOSED       __ZX_OBJECT_PEER_CLOSED
+#define ZX_SOCKET_READ_DISABLED     __ZX_OBJECT_SIGNAL_4
+#define ZX_SOCKET_WRITE_DISABLED    __ZX_OBJECT_SIGNAL_5
+#define ZX_SOCKET_CONTROL_READABLE  __ZX_OBJECT_SIGNAL_6
+#define ZX_SOCKET_CONTROL_WRITABLE  __ZX_OBJECT_SIGNAL_7
+
+// Port
+#define ZX_PORT_READABLE            __ZX_OBJECT_READABLE
+
+// Fifo
+#define ZX_FIFO_READABLE            __ZX_OBJECT_READABLE
+#define ZX_FIFO_WRITABLE            __ZX_OBJECT_WRITABLE
+#define ZX_FIFO_PEER_CLOSED         __ZX_OBJECT_PEER_CLOSED
+
+// Task signals (process, thread, job)
+#define ZX_TASK_TERMINATED          __ZX_OBJECT_SIGNALED
+
+// Job
+#define ZX_JOB_NO_PROCESSES         __ZX_OBJECT_SIGNALED
+#define ZX_JOB_NO_JOBS              __ZX_OBJECT_SIGNAL_4
+
+// Process
+#define ZX_PROCESS_TERMINATED       __ZX_OBJECT_SIGNALED
+
+// Thread
+#define ZX_THREAD_TERMINATED        __ZX_OBJECT_SIGNALED
+
+// Log
+#define ZX_LOG_READABLE             __ZX_OBJECT_READABLE
+#define ZX_LOG_WRITABLE             __ZX_OBJECT_WRITABLE
+
+// Timer
+#define ZX_TIMER_SIGNALED           __ZX_OBJECT_SIGNALED
+
+// global kernel object id.
+typedef uint64_t zx_koid_t;
+#define ZX_KOID_INVALID ((uint64_t) 0)
+#define ZX_KOID_KERNEL  ((uint64_t) 1)
+
+// Transaction ID and argument types for zx_channel_call.
+typedef uint32_t zx_txid_t;
+
+typedef struct {
+    const void* wr_bytes;
+    const zx_handle_t* wr_handles;
+    void *rd_bytes;
+    zx_handle_t* rd_handles;
+    uint32_t wr_num_bytes;
+    uint32_t wr_num_handles;
+    uint32_t rd_num_bytes;
+    uint32_t rd_num_handles;
+} zx_channel_call_args_t;
+
+// Structure for zx_object_wait_many():
+typedef struct {
+    zx_handle_t handle;
+    zx_signals_t waitfor;
+    zx_signals_t pending;
+} zx_wait_item_t;
+
+typedef uint32_t zx_rights_t;
+#define ZX_RIGHT_NONE             ((zx_rights_t)0u)
+#define ZX_RIGHT_DUPLICATE        ((zx_rights_t)1u << 0)
+#define ZX_RIGHT_TRANSFER         ((zx_rights_t)1u << 1)
+#define ZX_RIGHT_READ             ((zx_rights_t)1u << 2)
+#define ZX_RIGHT_WRITE            ((zx_rights_t)1u << 3)
+#define ZX_RIGHT_EXECUTE          ((zx_rights_t)1u << 4)
+#define ZX_RIGHT_MAP              ((zx_rights_t)1u << 5)
+#define ZX_RIGHT_GET_PROPERTY     ((zx_rights_t)1u << 6)
+#define ZX_RIGHT_SET_PROPERTY     ((zx_rights_t)1u << 7)
+#define ZX_RIGHT_ENUMERATE        ((zx_rights_t)1u << 8)
+#define ZX_RIGHT_DESTROY          ((zx_rights_t)1u << 9)
+#define ZX_RIGHT_SET_POLICY       ((zx_rights_t)1u << 10)
+#define ZX_RIGHT_GET_POLICY       ((zx_rights_t)1u << 11)
+#define ZX_RIGHT_SIGNAL           ((zx_rights_t)1u << 12)
+#define ZX_RIGHT_SIGNAL_PEER      ((zx_rights_t)1u << 13)
+
+#define ZX_RIGHT_SAME_RIGHTS      ((zx_rights_t)1u << 31)
+
+// VM Object opcodes
+#define ZX_VMO_OP_COMMIT                 1u
+#define ZX_VMO_OP_DECOMMIT               2u
+#define ZX_VMO_OP_LOCK                   3u
+#define ZX_VMO_OP_UNLOCK                 4u
+#define ZX_VMO_OP_LOOKUP                 5u
+#define ZX_VMO_OP_CACHE_SYNC             6u
+#define ZX_VMO_OP_CACHE_INVALIDATE       7u
+#define ZX_VMO_OP_CACHE_CLEAN            8u
+#define ZX_VMO_OP_CACHE_CLEAN_INVALIDATE 9u
+
+// VM Object clone flags
+#define ZX_VMO_CLONE_COPY_ON_WRITE       1u
+
+// Mapping flags to vmar routines
+#define ZX_VM_FLAG_PERM_READ          (1u << 0)
+#define ZX_VM_FLAG_PERM_WRITE         (1u << 1)
+#define ZX_VM_FLAG_PERM_EXECUTE       (1u << 2)
+#define ZX_VM_FLAG_COMPACT            (1u << 3)
+#define ZX_VM_FLAG_SPECIFIC           (1u << 4)
+#define ZX_VM_FLAG_SPECIFIC_OVERWRITE (1u << 5)
+#define ZX_VM_FLAG_CAN_MAP_SPECIFIC   (1u << 6)
+#define ZX_VM_FLAG_CAN_MAP_READ       (1u << 7)
+#define ZX_VM_FLAG_CAN_MAP_WRITE      (1u << 8)
+#define ZX_VM_FLAG_CAN_MAP_EXECUTE    (1u << 9)
+#define ZX_VM_FLAG_MAP_RANGE          (1u << 10)
+
+// clock ids
+#define ZX_CLOCK_MONOTONIC        (0u)
+#define ZX_CLOCK_UTC              (1u)
+#define ZX_CLOCK_THREAD           (2u)
+
+// virtual address
+typedef uintptr_t zx_vaddr_t;
+
+// physical address
+typedef uintptr_t zx_paddr_t;
+
+// offset
+typedef uint64_t zx_off_t;
+typedef int64_t zx_rel_off_t;
+
+// Maximum string length for kernel names (process name, thread name, etc)
+#define ZX_MAX_NAME_LEN           (32)
+
+// Buffer size limits on the cprng syscalls
+#define ZX_CPRNG_DRAW_MAX_LEN        256
+#define ZX_CPRNG_ADD_ENTROPY_MAX_LEN 256
+
+// interrupt flags
+#define ZX_FLAG_REMAP_IRQ  0x1
+
+// Channel options and limits.
+#define ZX_CHANNEL_READ_MAY_DISCARD         1u
+
+#define ZX_CHANNEL_MAX_MSG_BYTES            65536u
+#define ZX_CHANNEL_MAX_MSG_HANDLES          64u
+
+// Socket options and limits.
+// These options can be passed to zx_socket_write()
+#define ZX_SOCKET_SHUTDOWN_WRITE            (1u << 0)
+#define ZX_SOCKET_SHUTDOWN_READ             (1u << 1)
+#define ZX_SOCKET_SHUTDOWN_MASK             (ZX_SOCKET_SHUTDOWN_WRITE | ZX_SOCKET_SHUTDOWN_READ)
+// These can be passed to zx_socket_create()
+#define ZX_SOCKET_STREAM                    (0u << 0)
+#define ZX_SOCKET_DATAGRAM                  (1u << 0)
+#define ZX_SOCKET_HAS_CONTROL               (1u << 1)
+#define ZX_SOCKET_CREATE_MASK               (ZX_SOCKET_DATAGRAM | ZX_SOCKET_HAS_CONTROL)
+// These can be passed to zx_socket_read() and zx_socket_write().
+#define ZX_SOCKET_CONTROL                   (1u << 2)
+
+// Flags which can be used to to control cache policy for APIs which map memory.
+typedef enum {
+    ZX_CACHE_POLICY_CACHED          = 0,
+    ZX_CACHE_POLICY_UNCACHED        = 1,
+    ZX_CACHE_POLICY_UNCACHED_DEVICE = 2,
+    ZX_CACHE_POLICY_WRITE_COMBINING = 3,
+
+    ZX_CACHE_POLICY_MASK            = 0x3,
+} zx_cache_policy_t;
+
+// Flag bits for zx_cache_flush.
+#define ZX_CACHE_FLUSH_INSN         (1u << 0)
+#define ZX_CACHE_FLUSH_DATA         (1u << 1)
+
+// Timer options.
+#define ZX_TIMER_SLACK_CENTER       0u
+#define ZX_TIMER_SLACK_EARLY        1u
+#define ZX_TIMER_SLACK_LATE         2u
+
+
+#ifdef __cplusplus
+// We cannot use <stdatomic.h> with C++ code as _Atomic qualifier defined by
+// C11 is not valid in C++11. There is not a single standard name that can
+// be used in both C and C++. C++ <atomic> defines names which are equivalent
+// to those in <stdatomic.h>, but these are contained in the std namespace.
+//
+// In kernel, the only operation done is a user_copy (of sizeof(int)) inside a
+// lock; otherwise the futex address is treated as a key.
+typedef int zx_futex_t;
+#else
+#ifdef _KERNEL
+typedef int zx_futex_t;
+#else
+typedef atomic_int zx_futex_t;
+#endif
+#endif
+
+__END_CDECLS
diff --git a/system/uapp/aslr-analysis/main.cpp b/system/uapp/aslr-analysis/main.cpp
index dd8c05d..ced2534 100644
--- a/system/uapp/aslr-analysis/main.cpp
+++ b/system/uapp/aslr-analysis/main.cpp
@@ -6,14 +6,14 @@
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
 #include <limits.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 #include <math.h>
-#include <mxio/io.h>
+#include <fdio/io.h>
 #include <fbl/algorithm.h>
 #include <fbl/array.h>
 #include <fbl/auto_call.h>
@@ -42,8 +42,8 @@
                           uintptr_t ReportInfo::*field);
 double ApproxBinomialCdf(double p, double N, double n);
 int TestRunMain(int argc, char** argv);
-mx_status_t LaunchTestRun(const char* bin, mx_handle_t h, mx_handle_t* out);
-int JoinProcess(mx_handle_t proc);
+zx_status_t LaunchTestRun(const char* bin, zx_handle_t h, zx_handle_t* out);
+int JoinProcess(zx_handle_t proc);
 } // namespace
 
 int main(int argc, char** argv) {
@@ -155,25 +155,25 @@
 int GatherReports(const char* test_bin, fbl::Array<ReportInfo>* reports) {
     const size_t count = reports->size();
     for (unsigned int run = 0; run < count; ++run) {
-        mx_handle_t handles[2];
-        mx_status_t status = mx_channel_create(0, &handles[0], &handles[1]);
-        if (status != MX_OK) {
+        zx_handle_t handles[2];
+        zx_status_t status = zx_channel_create(0, &handles[0], &handles[1]);
+        if (status != ZX_OK) {
             printf("Failed to create channel for test run\n");
             return -1;
         }
 
-        mx_handle_t proc;
-        if ((status = LaunchTestRun(test_bin, handles[1], &proc)) != MX_OK) {
-            mx_handle_close(handles[0]);
+        zx_handle_t proc;
+        if ((status = LaunchTestRun(test_bin, handles[1], &proc)) != ZX_OK) {
+            zx_handle_close(handles[0]);
             printf("Failed to launch testrun: %d\n", status);
             return -1;
         }
 
         int ret = JoinProcess(proc);
-        mx_handle_close(proc);
+        zx_handle_close(proc);
 
         if (ret != 0) {
-            mx_handle_close(handles[0]);
+            zx_handle_close(handles[0]);
             printf("Failed to join testrun: %d\n", ret);
             return -1;
         }
@@ -181,21 +181,21 @@
         ReportInfo* report = &(*reports)[run];
 
         uint32_t len = sizeof(*report);
-        status = mx_channel_read(handles[0], 0, report, NULL, len, 0, &len, NULL);
+        status = zx_channel_read(handles[0], 0, report, NULL, len, 0, &len, NULL);
         if (status != 0 || len != sizeof(*report)) {
             printf("Failed to read report: status %d, len %u\n", status, len);
-            mx_handle_close(handles[0]);
+            zx_handle_close(handles[0]);
             return -1;
         }
 
-        mx_handle_close(handles[0]);
+        zx_handle_close(handles[0]);
     }
     return 0;
 }
 
 int TestRunMain(int argc, char** argv) {
-    mx_handle_t report_pipe =
-        mx_get_startup_handle(PA_HND(PA_USER1, 0));
+    zx_handle_t report_pipe =
+        zx_get_startup_handle(PA_HND(PA_USER1, 0));
 
     ReportInfo report;
 
@@ -205,11 +205,11 @@
     report.first_stack = (uintptr_t)&report_pipe;
     report.first_heap_alloc = (uintptr_t)malloc(1);
     report.libc = (uintptr_t)&memcpy;
-    report.vdso = (uintptr_t)&mx_channel_write;
+    report.vdso = (uintptr_t)&zx_channel_write;
 
-    mx_status_t status =
-        mx_channel_write(report_pipe, 0, &report, sizeof(report), NULL, 0);
-    if (status != MX_OK) {
+    zx_status_t status =
+        zx_channel_write(report_pipe, 0, &report, sizeof(report), NULL, 0);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -217,17 +217,17 @@
 }
 
 // This function unconditionally consumes the handle h.
-mx_status_t LaunchTestRun(const char* bin, mx_handle_t h, mx_handle_t* out) {
+zx_status_t LaunchTestRun(const char* bin, zx_handle_t h, zx_handle_t* out) {
     launchpad_t* lp;
-    mx_handle_t proc;
-    mx_handle_t hnd[1];
-    mx_handle_t job;
+    zx_handle_t proc;
+    zx_handle_t hnd[1];
+    zx_handle_t job;
     uint32_t ids[1];
     const char* args[] = {bin, "testrun"};
     const char* errmsg;
 
-    mx_status_t status = mx_handle_duplicate(mx_job_default(), MX_RIGHT_SAME_RIGHTS, &job);
-    if (status != MX_OK) {
+    zx_status_t status = zx_handle_duplicate(zx_job_default(), ZX_RIGHT_SAME_RIGHTS, &job);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -239,26 +239,26 @@
     launchpad_add_handles(lp, fbl::count_of(hnd), hnd, ids);
 
     status = launchpad_go(lp, &proc, &errmsg);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("launch failed (%d): %s\n", status, errmsg);
         return status;
     }
 
     *out = proc;
-    return MX_OK;
+    return ZX_OK;
 }
 
-int JoinProcess(mx_handle_t proc) {
-    mx_status_t status =
-        mx_object_wait_one(proc, MX_PROCESS_TERMINATED, MX_TIME_INFINITE, NULL);
-    if (status != MX_OK) {
+int JoinProcess(zx_handle_t proc) {
+    zx_status_t status =
+        zx_object_wait_one(proc, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, NULL);
+    if (status != ZX_OK) {
         printf("join failed? %d\n", status);
         return -1;
     }
 
     // read the return code
-    mx_info_process_t proc_info;
-    if ((status = mx_object_get_info(proc, MX_INFO_PROCESS, &proc_info,
+    zx_info_process_t proc_info;
+    if ((status = zx_object_get_info(proc, ZX_INFO_PROCESS, &proc_info,
                                      sizeof(proc_info), NULL, NULL)) < 0) {
         printf("handle_get_info failed? %d\n", status);
         return -1;
diff --git a/system/uapp/aslr-analysis/rules.mk b/system/uapp/aslr-analysis/rules.mk
index 7325bbc..e90c549 100644
--- a/system/uapp/aslr-analysis/rules.mk
+++ b/system/uapp/aslr-analysis/rules.mk
@@ -13,14 +13,14 @@
     $(LOCAL_DIR)/main.cpp
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/runtime
 
 MODULE_LIBS := \
     system/ulib/launchpad \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/uapp/audio/audio.cpp b/system/uapp/audio/audio.cpp
index 201b2e3..4d9bdcf 100644
--- a/system/uapp/audio/audio.cpp
+++ b/system/uapp/audio/audio.cpp
@@ -6,7 +6,7 @@
 #include <audio-utils/audio-input.h>
 #include <audio-utils/audio-output.h>
 #include <audio-proto-utils/format-utils.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/algorithm.h>
 #include <fbl/auto_call.h>
 #include <stdio.h>
@@ -146,15 +146,15 @@
     }
 }
 
-mx_status_t dump_stream_info(const audio::utils::AudioDeviceStream& stream) {
-    mx_status_t res;
+zx_status_t dump_stream_info(const audio::utils::AudioDeviceStream& stream) {
+    zx_status_t res;
     printf("Info for audio %s at \"%s\"\n",
             stream.input() ? "input" : "output", stream.name());
 
     // Fetch and print the current gain settings for this audio stream.
     audio_stream_cmd_get_gain_resp gain_state;
     res = stream.GetGain(&gain_state);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to fetch gain information! (res %d)\n", res);
         return res;
     }
@@ -176,7 +176,7 @@
     // Fetch and print the current pluged/unplugged state for this audio stream.
     audio_stream_cmd_plug_detect_resp plug_state;
     res = stream.GetPlugState(&plug_state);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to fetch plug state information! (res %d)\n", res);
         return res;
     }
@@ -191,7 +191,7 @@
     // Fetch and print the currently supported audio formats for this audio stream.
     fbl::Vector<audio_stream_format_range_t> fmts;
     res = stream.GetSupportedFormats(&fmts);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to fetch supported formats! (res %d)\n", res);
         return res;
     }
@@ -200,7 +200,7 @@
     for (size_t i = 0; i < fmts.size(); ++i)
         dump_format_range(i, fmts[i]);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 int main(int argc, const char** argv) {
@@ -408,12 +408,12 @@
     else       stream = audio::utils::AudioOutput::Create(dev_id);
     if (stream == nullptr) {
         printf("Out of memory!\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // No need to log in the case of failure.  Open has already done so.
-    mx_status_t res = stream->Open();
-    if (res != MX_OK)
+    zx_status_t res = stream->Open();
+    if (res != ZX_OK)
         return res;
 
     // Execute the chosen command.
@@ -432,7 +432,7 @@
 
         SineSource sine_source;
         res = sine_source.Init(tone_freq, 1.0, duration, frame_rate, channels, sample_format);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to initialize sine wav generator (res %d)\n", res);
             return res;
         }
@@ -449,7 +449,7 @@
 
         WAVSource wav_source;
         res = wav_source.Initialize(wav_filename);
-        if (res != MX_OK)
+        if (res != ZX_OK)
             return res;
 
         return static_cast<audio::utils::AudioOutput*>(stream.get())->Play(wav_source);
@@ -462,7 +462,7 @@
         }
 
         res = stream->SetFormat(frame_rate, static_cast<uint16_t>(channels), sample_format);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to set format (rate %u, chan %u, fmt 0x%08x, res %d)\n",
                     frame_rate, channels, sample_format, res);
             return -1;
@@ -470,14 +470,14 @@
 
         WAVSink wav_sink;
         res = wav_sink.Initialize(wav_filename);
-        if (res != MX_OK)
+        if (res != ZX_OK)
             return res;
 
         return static_cast<audio::utils::AudioInput*>(stream.get())->Record(wav_sink, duration);
     }
 
     default:
-        MX_DEBUG_ASSERT(false);
+        ZX_DEBUG_ASSERT(false);
         return -1;
     }
 }
diff --git a/system/uapp/audio/rules.mk b/system/uapp/audio/rules.mk
index 8cae273..ebdf7f6 100644
--- a/system/uapp/audio/rules.mk
+++ b/system/uapp/audio/rules.mk
@@ -17,13 +17,13 @@
 MODULE_STATIC_LIBS := \
     system/ulib/audio-utils \
     system/ulib/audio-proto-utils \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/audio/sine-source.cpp b/system/uapp/audio/sine-source.cpp
index 7433a72..ff867d8 100644
--- a/system/uapp/audio/sine-source.cpp
+++ b/system/uapp/audio/sine-source.cpp
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <math.h>
 #include <fbl/algorithm.h>
 #include <fbl/limits.h>
 
 #include "sine-source.h"
 
-mx_status_t SineSource::Init(float freq,
+zx_status_t SineSource::Init(float freq,
                              float amp,
                              float duration_secs,
                              uint32_t frame_rate,
@@ -17,10 +17,10 @@
                              audio_sample_format_t sample_format) {
 
     if (!frame_rate)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (!channels)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     frame_rate_ = frame_rate;
     channels_ = channels;
@@ -37,23 +37,23 @@
     case AUDIO_SAMPLE_FORMAT_20BIT_IN32: return InitInternal<AUDIO_SAMPLE_FORMAT_20BIT_IN32>();
     case AUDIO_SAMPLE_FORMAT_24BIT_IN32: return InitInternal<AUDIO_SAMPLE_FORMAT_24BIT_IN32>();
     case AUDIO_SAMPLE_FORMAT_32BIT:      return InitInternal<AUDIO_SAMPLE_FORMAT_32BIT>();
-    default:                             return MX_ERR_INVALID_ARGS;
+    default:                             return ZX_ERR_INVALID_ARGS;
     }
 }
 
-mx_status_t SineSource::GetFormat(Format* out_format) {
+zx_status_t SineSource::GetFormat(Format* out_format) {
     if (out_format == nullptr)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     out_format->frame_rate    = frame_rate_;
     out_format->channels      = static_cast<uint16_t>(channels_);
     out_format->sample_format = sample_format_;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t SineSource::GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed) {
-    MX_DEBUG_ASSERT(get_frames_thunk_ != nullptr);
+zx_status_t SineSource::GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed) {
+    ZX_DEBUG_ASSERT(get_frames_thunk_ != nullptr);
     return ((*this).*(get_frames_thunk_))(buffer, buf_space, out_packed);
 }
 
@@ -106,7 +106,7 @@
 } // Anon namespace
 
 template <audio_sample_format_t SAMPLE_FORMAT>
-mx_status_t SineSource::InitInternal() {
+zx_status_t SineSource::InitInternal() {
     using SampleType   = typename SampleTraits<SAMPLE_FORMAT>::SampleType;
     using ComputedType = typename SampleTraits<SAMPLE_FORMAT>::ComputedType;
 
@@ -115,22 +115,22 @@
     frame_size_ = static_cast<uint32_t>(sizeof(SampleType) * channels_);
     amp_ *= fbl::numeric_limits<ComputedType>::max() - 1;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 template <audio_sample_format_t SAMPLE_FORMAT>
-mx_status_t SineSource::GetFramesInternal(void* buffer, uint32_t buf_space, uint32_t* out_packed) {
+zx_status_t SineSource::GetFramesInternal(void* buffer, uint32_t buf_space, uint32_t* out_packed) {
     using Traits       = SampleTraits<SAMPLE_FORMAT>;
     using SampleType   = typename SampleTraits<SAMPLE_FORMAT>::SampleType;
     using ComputedType = typename SampleTraits<SAMPLE_FORMAT>::ComputedType;
 
     if ((buffer == nullptr) || (out_packed == nullptr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (finished())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
-    MX_DEBUG_ASSERT(frames_produced_ < frames_to_produce_);
+    ZX_DEBUG_ASSERT(frames_produced_ < frames_to_produce_);
     uint64_t todo = fbl::min<uint64_t>(frames_to_produce_ - frames_produced_,
                                         buf_space / frame_size_);
     double pos = sine_scalar_ * static_cast<double>(frames_produced_);
@@ -148,5 +148,5 @@
     *out_packed = static_cast<uint32_t>(todo * frame_size_);
     frames_produced_ += todo;
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/uapp/audio/sine-source.h b/system/uapp/audio/sine-source.h
index 07dc1ae..7d9f712 100644
--- a/system/uapp/audio/sine-source.h
+++ b/system/uapp/audio/sine-source.h
@@ -5,33 +5,33 @@
 #pragma once
 
 #include <audio-utils/audio-stream.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 class SineSource : public audio::utils::AudioSource {
 public:
     SineSource() { }
 
-    mx_status_t Init(float freq,
+    zx_status_t Init(float freq,
                      float amp,
                      float duration_secs,
                      uint32_t frame_rate,
                      uint32_t channels,
                      audio_sample_format_t sample_format);
 
-    mx_status_t GetFormat(Format* out_format) final;
-    mx_status_t GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed);
+    zx_status_t GetFormat(Format* out_format) final;
+    zx_status_t GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed);
     bool finished() const final { return (frames_produced_ >= frames_to_produce_); }
 
 private:
-    using GetFramesThunk = mx_status_t (SineSource::*)(void* buffer,
+    using GetFramesThunk = zx_status_t (SineSource::*)(void* buffer,
                                                        uint32_t buf_space,
                                                        uint32_t* out_packed);
 
     template <audio_sample_format_t SAMPLE_FORMAT>
-    mx_status_t InitInternal();
+    zx_status_t InitInternal();
 
     template <audio_sample_format_t SAMPLE_FORMAT>
-    mx_status_t GetFramesInternal(void* buffer, uint32_t buf_space, uint32_t* out_packed);
+    zx_status_t GetFramesInternal(void* buffer, uint32_t buf_space, uint32_t* out_packed);
 
     uint64_t frames_to_produce_;
     uint64_t frames_produced_;
diff --git a/system/uapp/audio/wav-common.cpp b/system/uapp/audio/wav-common.cpp
index 86cbfee..5c8ba6e 100644
--- a/system/uapp/audio/wav-common.cpp
+++ b/system/uapp/audio/wav-common.cpp
@@ -4,10 +4,10 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/auto_call.h>
 #include <fbl/algorithm.h>
-#include <mxio/io.h>
+#include <fdio/io.h>
 #include <stdio.h>
 
 #include "wav-source.h"
@@ -24,10 +24,10 @@
 constexpr uint16_t WAVCommon::FORMAT_MSFT_ALAW;
 constexpr uint16_t WAVCommon::FORMAT_MSFT_MULAW;
 
-mx_status_t WAVCommon::Initialize(const char* filename, InitMode mode) {
+zx_status_t WAVCommon::Initialize(const char* filename, InitMode mode) {
     if (fd_ >= 0) {
         printf("Failed to initialize WAVCommon for \"%s\", already initialized\n", filename);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     int flags = (mode == InitMode::SOURCE)
@@ -36,10 +36,10 @@
     fd_ = ::open(filename, flags);
     if (fd_ < 0) {
         printf("Failed to open \"%s\" (res %d)\n", filename, fd_);
-        return static_cast<mx_status_t>(fd_);
+        return static_cast<zx_status_t>(fd_);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void WAVCommon::Close() {
@@ -49,56 +49,56 @@
     }
 }
 
-mx_status_t WAVCommon::Read(void* buf, size_t len) {
-    if (fd_ < 0) return MX_ERR_BAD_STATE;
+zx_status_t WAVCommon::Read(void* buf, size_t len) {
+    if (fd_ < 0) return ZX_ERR_BAD_STATE;
 
     ssize_t res = ::read(fd_, buf, len);
     if (res < 0) {
         printf("Read error (errno %d)\n", errno);
-        return static_cast<mx_status_t>(errno);
+        return static_cast<zx_status_t>(errno);
     }
 
     if (static_cast<size_t>(res) != len) {
         printf("Short read error (%zd < %zu)\n", res, len);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t WAVCommon::Write(const void* buf, size_t len) {
-    if (fd_ < 0) return MX_ERR_BAD_STATE;
+zx_status_t WAVCommon::Write(const void* buf, size_t len) {
+    if (fd_ < 0) return ZX_ERR_BAD_STATE;
 
     ssize_t res = ::write(fd_, buf, len);
     if (res < 0) {
         printf("Write error (errno %d)\n", errno);
-        return static_cast<mx_status_t>(errno);
+        return static_cast<zx_status_t>(errno);
     }
 
     if (static_cast<size_t>(res) != len) {
         printf("Short write error (%zd < %zu)\n", res, len);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t WAVCommon::Seek(off_t abs_pos) {
-    if (fd_ < 0) return MX_ERR_BAD_STATE;
-    if (abs_pos < 0) return MX_ERR_INVALID_ARGS;
+zx_status_t WAVCommon::Seek(off_t abs_pos) {
+    if (fd_ < 0) return ZX_ERR_BAD_STATE;
+    if (abs_pos < 0) return ZX_ERR_INVALID_ARGS;
 
     off_t res = ::lseek(fd_, abs_pos, SEEK_SET);
     if (res < 0) {
         printf("Seek error (errno %d)\n", errno);
-        return static_cast<mx_status_t>(errno);
+        return static_cast<zx_status_t>(errno);
     }
 
     if (res != abs_pos) {
         printf("Failed to see to target (target %zd, got %zd)\n",
                 static_cast<ssize_t>(abs_pos),
                 static_cast<ssize_t>(res));
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/uapp/audio/wav-common.h b/system/uapp/audio/wav-common.h
index 96ba68a..25f772d 100644
--- a/system/uapp/audio/wav-common.h
+++ b/system/uapp/audio/wav-common.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include <endian.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 namespace internal {
 static inline constexpr uint32_t make_fourcc(uint8_t a, uint8_t b,
@@ -59,7 +59,7 @@
     };
 
     enum class InitMode { SOURCE, SINK };
-    mx_status_t Initialize(const char* filename, InitMode mode);
+    zx_status_t Initialize(const char* filename, InitMode mode);
 
     static constexpr uint32_t RIFF_FOUR_CC = internal::make_fourcc('R', 'I', 'F', 'F');
     static constexpr uint32_t WAVE_FOUR_CC = internal::make_fourcc('W', 'A', 'V', 'E');
@@ -76,9 +76,9 @@
     static constexpr uint16_t FORMAT_MSFT_MULAW = 0x0007;
 
     void Close();
-    mx_status_t Read(void* buf, size_t len);
-    mx_status_t Write(const void* buf, size_t len);
-    mx_status_t Seek(off_t abs_pos);
+    zx_status_t Read(void* buf, size_t len);
+    zx_status_t Write(const void* buf, size_t len);
+    zx_status_t Seek(off_t abs_pos);
 
     int fd_ = -1;
 };
diff --git a/system/uapp/audio/wav-sink.cpp b/system/uapp/audio/wav-sink.cpp
index 1e5839d..4c2e090 100644
--- a/system/uapp/audio/wav-sink.cpp
+++ b/system/uapp/audio/wav-sink.cpp
@@ -2,24 +2,24 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/auto_call.h>
 #include <fbl/algorithm.h>
 #include <fbl/limits.h>
-#include <mxio/io.h>
+#include <fdio/io.h>
 #include <stdio.h>
 
 #include "wav-sink.h"
 
-mx_status_t WAVSink::SetFormat(const AudioStream::Format& format) {
+zx_status_t WAVSink::SetFormat(const AudioStream::Format& format) {
     WAVHeader wav_hdr;
 
     if ((fd_ < 0) || format_set_) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
-    if (format.channels > 8) return MX_ERR_INVALID_ARGS;
-    if (format.frame_rate == 0) return MX_ERR_INVALID_ARGS;
+    if (format.channels > 8) return ZX_ERR_INVALID_ARGS;
+    if (format.frame_rate == 0) return ZX_ERR_INVALID_ARGS;
 
     bool inv_endian = (format.sample_format & AUDIO_SAMPLE_FORMAT_FLAG_INVERT_ENDIAN) != 0;
     bool unsigned_fmt = (format.sample_format & AUDIO_SAMPLE_FORMAT_FLAG_UNSIGNED) != 0;
@@ -29,7 +29,7 @@
     // TODO(johngro): deal with endianness.  Right now, we just assume that we
     // are on a little endian system and demand that the samples given to us be
     // in host-endian (aka, little).
-    if (inv_endian) return MX_ERR_NOT_SUPPORTED;
+    if (inv_endian) return ZX_ERR_NOT_SUPPORTED;
 
     wav_hdr.wave_four_cc = WAVE_FOUR_CC;
     wav_hdr.fmt_four_cc = FMT_FOUR_CC;
@@ -43,7 +43,7 @@
     //
     // Only 8 bit formats are unsigned.
     if ((noflag_format == AUDIO_SAMPLE_FORMAT_8BIT) != unsigned_fmt)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     wav_hdr.format = FORMAT_LPCM;
 
@@ -62,14 +62,14 @@
 
     case AUDIO_SAMPLE_FORMAT_20BIT_PACKED:
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     wav_hdr.frame_size = static_cast<uint16_t>((wav_hdr.bits_per_sample >> 3u) *
                                                 wav_hdr.channel_count);
     wav_hdr.average_byte_rate = static_cast<uint32_t>(wav_hdr.frame_size) * wav_hdr.frame_rate;
 
-    mx_status_t res;
+    zx_status_t res;
     RIFFChunkHeader riff_chunk;
 
     // Note: we don't know the length of our RIFF chunk or our DATA chunk yet;
@@ -79,14 +79,14 @@
     riff_chunk.length  = sizeof(RIFFChunkHeader) + sizeof(WAVHeader);
     riff_chunk.FixupEndian();
     res = Write(&riff_chunk, sizeof(riff_chunk));
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to write top level RIFF header (res = %d)\n", res);
         return res;
     }
 
     wav_hdr.FixupEndian();
     res = Write(&wav_hdr, sizeof(wav_hdr));
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to write WAVE header (res = %d)\n", res);
         return res;
     }
@@ -95,24 +95,24 @@
     riff_chunk.length  = 0;
     riff_chunk.FixupEndian();
     res = Write(&riff_chunk, sizeof(riff_chunk));
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to write DATA header (res = %d)\n", res);
         return res;
     }
 
     format_set_ = true;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t WAVSink::PutFrames(const void* buffer, uint32_t amt) {
-    MX_DEBUG_ASSERT(buffer != nullptr);
+zx_status_t WAVSink::PutFrames(const void* buffer, uint32_t amt) {
+    ZX_DEBUG_ASSERT(buffer != nullptr);
 
     if ((fd_ < 0) || !format_set_) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
-    mx_status_t res = Write(buffer, amt);
-    if (res != MX_OK) {
+    zx_status_t res = Write(buffer, amt);
+    if (res != ZX_OK) {
         printf("Error writing %u bytes to WAV output (res %d)\n", amt, res);
         return res;
     }
@@ -121,9 +121,9 @@
     return res;
 }
 
-mx_status_t WAVSink::Finalize() {
+zx_status_t WAVSink::Finalize() {
     if ((fd_ < 0) || !format_set_) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     constexpr size_t riff_overhead = sizeof(RIFFChunkHeader) + sizeof(WAVHeader);
@@ -132,7 +132,7 @@
     auto data_size = fbl::min<uint64_t>(fbl::numeric_limits<uint32_t>::max(),
                                          bytes_written_);
 
-    mx_status_t res;
+    zx_status_t res;
     RIFFChunkHeader riff_chunk;
 
     res = Seek(0);
@@ -169,5 +169,5 @@
     format_set_ = false;
     bytes_written_ = 0;
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/uapp/audio/wav-sink.h b/system/uapp/audio/wav-sink.h
index 3d57131..c30ecaf 100644
--- a/system/uapp/audio/wav-sink.h
+++ b/system/uapp/audio/wav-sink.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <audio-utils/audio-stream.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include "wav-common.h"
 
@@ -14,14 +14,14 @@
 public:
     WAVSink() { }
     ~WAVSink() { Finalize(); }
-    mx_status_t Initialize(const char* filename) {
+    zx_status_t Initialize(const char* filename) {
         return WAVCommon::Initialize(filename, InitMode::SINK);
     }
 
     // AudioSink interface
-    mx_status_t SetFormat(const AudioStream::Format& format) final;
-    mx_status_t PutFrames(const void* buffer, uint32_t amt) final;
-    mx_status_t Finalize() final;
+    zx_status_t SetFormat(const AudioStream::Format& format) final;
+    zx_status_t PutFrames(const void* buffer, uint32_t amt) final;
+    zx_status_t Finalize() final;
 
 private:
     bool format_set_ = false;
diff --git a/system/uapp/audio/wav-source.cpp b/system/uapp/audio/wav-source.cpp
index 8a98448..aeb583a 100644
--- a/system/uapp/audio/wav-source.cpp
+++ b/system/uapp/audio/wav-source.cpp
@@ -7,14 +7,14 @@
 #include <fcntl.h>
 #include <stdio.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/auto_call.h>
 #include <fbl/algorithm.h>
-#include <mxio/io.h>
+#include <fdio/io.h>
 
-mx_status_t WAVSource::Initialize(const char* filename) {
-    mx_status_t res = WAVCommon::Initialize(filename, InitMode::SOURCE);
-    if (res != MX_OK) return res;
+zx_status_t WAVSource::Initialize(const char* filename) {
+    zx_status_t res = WAVCommon::Initialize(filename, InitMode::SOURCE);
+    if (res != ZX_OK) return res;
 
     RIFFChunkHeader riff_hdr;
     WAVHeader wav_info;
@@ -26,7 +26,7 @@
 
     // Read and sanity check the top level RIFF header
     res = Read(&riff_hdr, sizeof(riff_hdr));
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to read top level RIFF header!\n");
         return res;
     }
@@ -35,12 +35,12 @@
     if (riff_hdr.four_cc != RIFF_FOUR_CC) {
         printf("Missing expected 'RIFF' 4CC (expected 0x%08x got 0x%08x)\n",
                RIFF_FOUR_CC, riff_hdr.four_cc);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Read the WAVE header along with its required format chunk.
     res = Read(&wav_info, sizeof(wav_info));
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to read top level WAVE header!\n");
         return res;
     }
@@ -49,18 +49,18 @@
     if (wav_info.wave_four_cc != WAVE_FOUR_CC) {
         printf("Missing expected 'RIFF' 4CC (expected 0x%08x got 0x%08x)\n",
                WAVE_FOUR_CC, wav_info.wave_four_cc);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (wav_info.fmt_four_cc != FMT_FOUR_CC) {
         printf("Missing expected 'RIFF' 4CC (expected 0x%08x got 0x%08x)\n",
                FMT_FOUR_CC, wav_info.fmt_four_cc);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (!wav_info.frame_size) {
         printf("Bad frame size (%hu)\n", wav_info.frame_size);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Sanity check the format of the wave file.  This test app only supports a
@@ -68,7 +68,7 @@
     if (wav_info.format != FORMAT_LPCM) {
         printf("Unsupported format (0x%08hx) must be LPCM (0x%08hx)\n",
                 wav_info.format, FORMAT_LPCM);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     switch (wav_info.bits_per_sample) {
@@ -76,7 +76,7 @@
         case 16: audio_format_.sample_format = AUDIO_SAMPLE_FORMAT_16BIT; break;
         default:
             printf("Unsupported bits per sample (%hu)\n", wav_info.bits_per_sample);
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
     };
 
     audio_format_.frame_rate = wav_info.frame_rate;
@@ -86,7 +86,7 @@
     size_t total_wav_hdr_size = wav_info.fmt_chunk_len + offsetof(WAVHeader, format);
     if (total_wav_hdr_size < sizeof(WAVHeader)) {
         printf("Bad format chunk length in WAV header (%u)\n", wav_info.fmt_chunk_len);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (total_wav_hdr_size > sizeof(WAVHeader)) {
@@ -94,7 +94,7 @@
         if (::lseek(fd_, delta, SEEK_CUR) < 0) {
             printf("Error while attempt to skip %zu bytes of extra WAV header\n",
                     static_cast<size_t>(delta));
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     }
 
@@ -102,7 +102,7 @@
     RIFFChunkHeader data_hdr;
     while (true) {
         res = Read(&data_hdr, sizeof(data_hdr));
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to find DATA chunk header\n");
             return res;
         }
@@ -114,7 +114,7 @@
         if (::lseek(fd_, data_hdr.length, SEEK_CUR) < 0) {
             printf("Error while attempt to skip %u bytes of 0x%08x chunk\n",
                     data_hdr.length, data_hdr.four_cc);
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     }
 
@@ -130,28 +130,28 @@
     }
 
     cleanup.cancel();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t WAVSource::GetFormat(Format* out_format) {
+zx_status_t WAVSource::GetFormat(Format* out_format) {
     if (fd_ < 0)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     *out_format = audio_format_;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t WAVSource::GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed) {
+zx_status_t WAVSource::GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed) {
     if ((buffer == nullptr) || (out_packed == nullptr))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if ((fd_ < 0) || finished())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
-    MX_DEBUG_ASSERT(payload_played_ < payload_len_);
+    ZX_DEBUG_ASSERT(payload_played_ < payload_len_);
     uint32_t todo = fbl::min(buf_space, payload_len_ - payload_played_);
-    mx_status_t res = Read(buffer, todo);
-    if (res == MX_OK) {
+    zx_status_t res = Read(buffer, todo);
+    if (res == ZX_OK) {
         payload_played_ += todo;
         *out_packed = todo;
     }
diff --git a/system/uapp/audio/wav-source.h b/system/uapp/audio/wav-source.h
index 418b8bf..68931f4 100644
--- a/system/uapp/audio/wav-source.h
+++ b/system/uapp/audio/wav-source.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <audio-utils/audio-stream.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include "wav-common.h"
 
@@ -13,11 +13,11 @@
                   public audio::utils::AudioSource {
 public:
     WAVSource() { }
-    mx_status_t Initialize(const char* filename);
+    zx_status_t Initialize(const char* filename);
 
     // AudioSource interface
-    mx_status_t GetFormat(AudioStream::Format* out_format) final;
-    mx_status_t GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed) final;
+    zx_status_t GetFormat(AudioStream::Format* out_format) final;
+    zx_status_t GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed) final;
     bool finished() const final { return payload_played_ >= payload_len_; }
 
 private:
diff --git a/system/uapp/bcmctl/bcmctl.c b/system/uapp/bcmctl/bcmctl.c
index 32d3625..bc444bf 100644
--- a/system/uapp/bcmctl/bcmctl.c
+++ b/system/uapp/bcmctl/bcmctl.c
@@ -10,9 +10,9 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <mxio/util.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <fdio/util.h>
 #include <bcm/ioctl.h>
 
 const char* prog_name;
diff --git a/system/uapp/bcmctl/rules.mk b/system/uapp/bcmctl/rules.mk
index 971e827..18d4ee6 100644
--- a/system/uapp/bcmctl/rules.mk
+++ b/system/uapp/bcmctl/rules.mk
@@ -12,7 +12,7 @@
 MODULE_SRCS += \
 	$(LOCAL_DIR)/bcmctl.c
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 MODULE_STATIC_LIBS := system/ulib/bcm
 
diff --git a/system/uapp/blobstore/blobstore-check.cpp b/system/uapp/blobstore/blobstore-check.cpp
index 755972d..1c10fd5 100644
--- a/system/uapp/blobstore/blobstore-check.cpp
+++ b/system/uapp/blobstore/blobstore-check.cpp
@@ -24,16 +24,16 @@
     }
 }
 
-mx_status_t BlobstoreChecker::CheckAllocatedCounts() const {
-    mx_status_t status = MX_OK;
+zx_status_t BlobstoreChecker::CheckAllocatedCounts() const {
+    zx_status_t status = ZX_OK;
     if (alloc_blocks_ != blobstore_->info_.alloc_block_count) {
         FS_TRACE_ERROR("check: incorrect allocated block count %lu (should be %u)\n", blobstore_->info_.alloc_block_count, alloc_blocks_);
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     }
 
     if (alloc_inodes_ != blobstore_->info_.alloc_inode_count) {
         FS_TRACE_ERROR("check: incorrect allocated inode count %lu (should be %u)\n", blobstore_->info_.alloc_inode_count, alloc_inodes_);
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     }
 
     return status;
@@ -46,13 +46,13 @@
     blobstore_.reset(blob.get());
 }
 
-mx_status_t blobstore_check(fbl::RefPtr<Blobstore> blob) {
-    mx_status_t status = MX_OK;
+zx_status_t blobstore_check(fbl::RefPtr<Blobstore> blob) {
+    zx_status_t status = ZX_OK;
     BlobstoreChecker chk;
     chk.Init(fbl::move(blob));
     chk.TraverseInodeBitmap();
     chk.TraverseBlockBitmap();
-    status |= (status != MX_OK) ? 0 : chk.CheckAllocatedCounts();
+    status |= (status != ZX_OK) ? 0 : chk.CheckAllocatedCounts();
     return status;
 }
 
diff --git a/system/uapp/blobstore/blobstore-common.cpp b/system/uapp/blobstore/blobstore-common.cpp
index 3f1aeed..c820cbd 100644
--- a/system/uapp/blobstore/blobstore-common.cpp
+++ b/system/uapp/blobstore/blobstore-common.cpp
@@ -13,7 +13,7 @@
 #include <digest/digest.h>
 #include <digest/merkle-tree.h>
 #include <fs/block-txn.h>
-#include <mxio/debug.h>
+#include <fdio/debug.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/limits.h>
 
@@ -34,25 +34,25 @@
 
 // Sanity check the metadata for the blobstore, given a maximum number of
 // available blocks.
-mx_status_t blobstore_check_info(const blobstore_info_t* info, uint64_t max) {
+zx_status_t blobstore_check_info(const blobstore_info_t* info, uint64_t max) {
     if ((info->magic0 != kBlobstoreMagic0) ||
         (info->magic1 != kBlobstoreMagic1)) {
         fprintf(stderr, "blobstore: bad magic\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (info->version != kBlobstoreVersion) {
         fprintf(stderr, "blobstore: FS Version: %08x. Driver version: %08x\n", info->version,
                 kBlobstoreVersion);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (info->block_size != kBlobstoreBlockSize) {
         fprintf(stderr, "blobstore: bsz %u unsupported\n", info->block_size);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if ((info->flags & kBlobstoreFlagFVM) == 0) {
         if (info->block_count + DataStartBlock(*info) > max) {
             fprintf(stderr, "blobstore: too large for device\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     } else {
         const size_t blocks_per_slice = info->slice_size / info->block_size;
@@ -61,82 +61,82 @@
         size_t abm_blocks_allocated = info->abm_slices * blocks_per_slice;
         if (abm_blocks_needed > abm_blocks_allocated) {
             FS_TRACE_ERROR("blobstore: Not enough slices for block bitmap\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else if (abm_blocks_allocated + BlockMapStartBlock(*info) >= NodeMapStartBlock(*info)) {
             FS_TRACE_ERROR("blobstore: Block bitmap collides into node map\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         size_t ino_blocks_needed = NodeMapBlocks(*info);
         size_t ino_blocks_allocated = info->ino_slices * blocks_per_slice;
         if (ino_blocks_needed > ino_blocks_allocated) {
             FS_TRACE_ERROR("blobstore: Not enough slices for node map\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else if (ino_blocks_allocated + NodeMapStartBlock(*info) >= DataStartBlock(*info)) {
             FS_TRACE_ERROR("blobstore: Node bitmap collides into data blocks\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         size_t dat_blocks_needed = DataBlocks(*info);
         size_t dat_blocks_allocated = info->dat_slices * blocks_per_slice;
         if (dat_blocks_needed > dat_blocks_allocated) {
             FS_TRACE_ERROR("blobstore: Not enough slices for data blocks\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else if (dat_blocks_allocated + DataStartBlock(*info) >
                    fbl::numeric_limits<uint32_t>::max()) {
             FS_TRACE_ERROR("blobstore: Data blocks overflow uint32\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     }
     if (info->blob_header_next != 0) {
         fprintf(stderr, "blobstore: linked blob headers not yet supported\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t blobstore_get_blockcount(int fd, uint64_t* out) {
+zx_status_t blobstore_get_blockcount(int fd, uint64_t* out) {
 #ifdef __Fuchsia__
     block_info_t info;
     ssize_t r;
     if ((r = ioctl_block_get_info(fd, &info)) < 0) {
-        return static_cast<mx_status_t>(r);
+        return static_cast<zx_status_t>(r);
     }
     *out = (info.block_size * info.block_count) / kBlobstoreBlockSize;
 #else
     struct stat s;
     if (fstat(fd, &s) < 0) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     *out = s.st_size / kBlobstoreBlockSize;
 #endif
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t readblk(int fd, uint64_t bno, void* data) {
+zx_status_t readblk(int fd, uint64_t bno, void* data) {
     off_t off = bno * kBlobstoreBlockSize;
     if (lseek(fd, off, SEEK_SET) < 0) {
         fprintf(stderr, "blobstore: cannot seek to block %" PRIu64 "\n", bno);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     if (read(fd, data, kBlobstoreBlockSize) != kBlobstoreBlockSize) {
         fprintf(stderr, "blobstore: cannot read block %" PRIu64 "\n", bno);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t writeblk(int fd, uint64_t bno, const void* data) {
+zx_status_t writeblk(int fd, uint64_t bno, const void* data) {
     off_t off = bno * kBlobstoreBlockSize;
     if (lseek(fd, off, SEEK_SET) < 0) {
         fprintf(stderr, "blobstore: cannot seek to block %" PRIu64 "\n", bno);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     if (write(fd, data, kBlobstoreBlockSize) != kBlobstoreBlockSize) {
         fprintf(stderr, "blobstore: cannot write block %" PRIu64 "\n", bno);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 int blobstore_mkfs(int fd, uint64_t block_count) {
@@ -233,12 +233,12 @@
 
     // All in-memory structures have been created successfully. Dump everything to disk.
     char block[kBlobstoreBlockSize];
-    mx_status_t status;
+    zx_status_t status;
 
     // write the root block to disk
     memset(block, 0, sizeof(block));
     memcpy(block, &info, sizeof(info));
-    if ((status = writeblk(fd, 0, block)) != MX_OK) {
+    if ((status = writeblk(fd, 0, block)) != ZX_OK) {
         fprintf(stderr, "Failed to write root block\n");
         return status;
     }
@@ -257,7 +257,7 @@
         memset(block, 0, sizeof(block));
         if (writeblk(fd, NodeMapStartBlock(info) + n, block)) {
             fprintf(stderr, "blobstore: failed writing inode map\n");
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
     }
 
@@ -268,9 +268,9 @@
 } // namespace blobstore
 
 #ifndef __Fuchsia__
-// This is used by the ioctl wrappers in magenta/device/device.h. It's not
+// This is used by the ioctl wrappers in zircon/device/device.h. It's not
 // called by host tools, so just satisfy the linker with a stub.
-ssize_t mxio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len) {
+ssize_t fdio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len) {
     return -1;
 }
 #endif
diff --git a/system/uapp/blobstore/blobstore-ops.cpp b/system/uapp/blobstore/blobstore-ops.cpp
index 6fe2e00..4154963 100644
--- a/system/uapp/blobstore/blobstore-ops.cpp
+++ b/system/uapp/blobstore/blobstore-ops.cpp
@@ -11,12 +11,12 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/device/device.h>
-#include <magenta/device/vfs.h>
+#include <zircon/device/device.h>
+#include <zircon/device/vfs.h>
 
-#include <magenta/syscalls.h>
-#include <mxio/debug.h>
-#include <mxio/vfs.h>
+#include <zircon/syscalls.h>
+#include <fdio/debug.h>
+#include <fdio/vfs.h>
 #include <fbl/ref_ptr.h>
 
 #define MXDEBUG 0
@@ -38,26 +38,26 @@
     }
 }
 
-mx_status_t VnodeBlob::Open(uint32_t flags) {
+zx_status_t VnodeBlob::Open(uint32_t flags) {
     if ((flags & O_DIRECTORY) && !IsDirectory()) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     } else if (IsDirectory() && ((flags & O_ACCMODE) != 0)) {
-        return MX_ERR_NOT_FILE;
+        return ZX_ERR_NOT_FILE;
     }
 
     switch (flags & O_ACCMODE) {
     case O_WRONLY:
     case O_RDWR:
         if (GetState() != kBlobStateEmpty) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeBlob::Readdir(void* cookie, void* dirents, size_t len) {
+zx_status_t VnodeBlob::Readdir(void* cookie, void* dirents, size_t len) {
     if (!IsDirectory()) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     }
 
     return blobstore_->Readdir(cookie, dirents, len);
@@ -65,12 +65,12 @@
 
 ssize_t VnodeBlob::Read(void* data, size_t len, size_t off) {
     if (IsDirectory()) {
-        return MX_ERR_NOT_FILE;
+        return ZX_ERR_NOT_FILE;
     }
 
     size_t actual;
-    mx_status_t status = ReadInternal(data, len, off, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = ReadInternal(data, len, off, &actual);
+    if (status != ZX_OK) {
         return status;
     }
     return actual;
@@ -78,31 +78,31 @@
 
 ssize_t VnodeBlob::Write(const void* data, size_t len, size_t off) {
     if (IsDirectory()) {
-        return MX_ERR_NOT_FILE;
+        return ZX_ERR_NOT_FILE;
     }
     size_t actual;
-    mx_status_t status = WriteInternal(data, len, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = WriteInternal(data, len, &actual);
+    if (status != ZX_OK) {
         return status;
     }
     return actual;
 }
 
-mx_status_t VnodeBlob::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
+zx_status_t VnodeBlob::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
     assert(memchr(name, '/', len) == nullptr);
     if ((len == 1) && (name[0] == '.') && IsDirectory()) {
         // Special case: Accessing root directory via '.'
         *out = fbl::RefPtr<VnodeBlob>(this);
-        return MX_OK;
+        return ZX_OK;
     }
 
     if (!IsDirectory()) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     Digest digest;
-    if ((status = digest.Parse(name, len)) != MX_OK) {
+    if ((status = digest.Parse(name, len)) != ZX_OK) {
         return status;
     }
     fbl::RefPtr<VnodeBlob> vn;
@@ -110,10 +110,10 @@
         return status;
     }
     *out = fbl::move(vn);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeBlob::Getattr(vnattr_t* a) {
+zx_status_t VnodeBlob::Getattr(vnattr_t* a) {
     a->mode = IsDirectory() ? V_TYPE_DIR : V_TYPE_FILE;
     a->inode = 0;
     a->size = IsDirectory() ? 0 : SizeData();
@@ -123,26 +123,26 @@
     a->nlink = 1;
     a->create_time = 0;
     a->modify_time = 0;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeBlob::Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len, uint32_t mode) {
+zx_status_t VnodeBlob::Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len, uint32_t mode) {
     assert(memchr(name, '/', len) == nullptr);
     if (!IsDirectory()) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     Digest digest;
-    mx_status_t status;
-    if ((status = digest.Parse(name, len)) != MX_OK) {
+    zx_status_t status;
+    if ((status = digest.Parse(name, len)) != ZX_OK) {
         return status;
     }
     fbl::RefPtr<VnodeBlob> vn;
-    if ((status = blobstore_->NewBlob(digest, &vn)) != MX_OK) {
+    if ((status = blobstore_->NewBlob(digest, &vn)) != ZX_OK) {
         return status;
     }
     *out = fbl::move(vn);
-    return MX_OK;
+    return ZX_OK;
 }
 
 constexpr const char kFsName[] = "blobstore";
@@ -152,7 +152,7 @@
     switch (op) {
     case IOCTL_VFS_QUERY_FS: {
         if (out_len < sizeof(vfs_query_info_t) + strlen(kFsName)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         vfs_query_info_t* info = static_cast<vfs_query_info_t*>(out_buf);
         info->total_bytes = blobstore_->info_.block_count * blobstore_->info_.block_size;
@@ -163,8 +163,8 @@
         return sizeof(vfs_query_info_t) + strlen(kFsName);
     }
     case IOCTL_VFS_UNMOUNT_FS: {
-        mx_status_t status = Sync();
-        if (status != MX_OK) {
+        zx_status_t status = Sync();
+        if (status != ZX_OK) {
             FS_TRACE_ERROR("blobstore unmount failed to sync; unmounting anyway: %d\n", status);
         }
         return blobstore_->Unmount();
@@ -174,62 +174,62 @@
         ssize_t len = ioctl_device_get_topo_path(blobstore_->blockfd_, static_cast<char*>(out_buf), out_len);
 
         if ((ssize_t)out_len < len) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         return len;
     }
 #endif
     default: {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     }
 }
 
-mx_status_t VnodeBlob::Truncate(size_t len) {
+zx_status_t VnodeBlob::Truncate(size_t len) {
     if (IsDirectory()) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     return SpaceAllocate(len);
 }
 
-mx_status_t VnodeBlob::Unlink(const char* name, size_t len, bool must_be_dir) {
+zx_status_t VnodeBlob::Unlink(const char* name, size_t len, bool must_be_dir) {
     assert(memchr(name, '/', len) == nullptr);
     if (!IsDirectory()) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     Digest digest;
     fbl::RefPtr<VnodeBlob> out;
-    if ((status = digest.Parse(name, len)) != MX_OK) {
+    if ((status = digest.Parse(name, len)) != ZX_OK) {
         return status;
     } else if ((status = blobstore_->LookupBlob(digest, &out)) < 0) {
         return status;
     }
     out->QueueUnlink();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeBlob::Mmap(int flags, size_t len, size_t* off, mx_handle_t* out) {
+zx_status_t VnodeBlob::Mmap(int flags, size_t len, size_t* off, zx_handle_t* out) {
     if (IsDirectory()) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
-    if (flags & MXIO_MMAP_FLAG_WRITE) {
-        return MX_ERR_NOT_SUPPORTED;
+    if (flags & FDIO_MMAP_FLAG_WRITE) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
-    mx_rights_t rights = MX_RIGHT_TRANSFER | MX_RIGHT_MAP;
-    rights |= (flags & MXIO_MMAP_FLAG_READ) ? MX_RIGHT_READ : 0;
-    rights |= (flags & MXIO_MMAP_FLAG_EXEC) ? MX_RIGHT_EXECUTE : 0;
+    zx_rights_t rights = ZX_RIGHT_TRANSFER | ZX_RIGHT_MAP;
+    rights |= (flags & FDIO_MMAP_FLAG_READ) ? ZX_RIGHT_READ : 0;
+    rights |= (flags & FDIO_MMAP_FLAG_EXEC) ? ZX_RIGHT_EXECUTE : 0;
     return CopyVmo(rights, out);
 }
 
-mx_status_t VnodeBlob::Sync() {
+zx_status_t VnodeBlob::Sync() {
     // TODO(smklein): For now, this is a no-op, but it will change
     // once the kBlobFlagSync flag is in use.
-    return MX_OK;
+    return ZX_OK;
 }
 
 } // namespace blobstore
diff --git a/system/uapp/blobstore/blobstore-private.h b/system/uapp/blobstore/blobstore-private.h
index c0d1214..a100b46 100644
--- a/system/uapp/blobstore/blobstore-private.h
+++ b/system/uapp/blobstore/blobstore-private.h
@@ -22,8 +22,8 @@
 #ifdef __Fuchsia__
 #include <block-client/client.h>
 #include <fs/mapped-vmo.h>
-#include <mx/event.h>
-#include <mx/vmo.h>
+#include <zx/event.h>
+#include <zx/vmo.h>
 #endif
 
 namespace blobstore {
@@ -118,41 +118,41 @@
     // Returns a handle to an event which will be signalled when
     // the blob is readable.
     //
-    // Returns "MX_OK" if blob is already readable.
+    // Returns "ZX_OK" if blob is already readable.
     // Otherwise, returns size of the handle.
-    mx_status_t GetReadableEvent(mx_handle_t* out);
+    zx_status_t GetReadableEvent(zx_handle_t* out);
 
-    mx_status_t CopyVmo(mx_rights_t rights, mx_handle_t* out);
+    zx_status_t CopyVmo(zx_rights_t rights, zx_handle_t* out);
 
     void QueueUnlink();
 
     // If successful, allocates Blob Node and Blocks (in-memory)
     // kBlobStateEmpty --> kBlobStateDataWrite
-    mx_status_t SpaceAllocate(uint64_t size_data);
+    zx_status_t SpaceAllocate(uint64_t size_data);
 
     // Writes to either the Merkle Tree or the Data section,
     // depending on the state.
-    mx_status_t WriteInternal(const void* data, size_t len, size_t* actual);
+    zx_status_t WriteInternal(const void* data, size_t len, size_t* actual);
 
     // Reads from a blob.
     // Requires: kBlobStateReadable
-    mx_status_t ReadInternal(void* data, size_t len, size_t off, size_t* actual);
+    zx_status_t ReadInternal(void* data, size_t len, size_t off, size_t* actual);
 
     // Vnode I/O operations
-    mx_status_t GetHandles(uint32_t flags, mx_handle_t* hnds,
+    zx_status_t GetHandles(uint32_t flags, zx_handle_t* hnds,
                            uint32_t* type, void* extra, uint32_t* esize) final;
-    mx_status_t Open(uint32_t flags) final;
-    mx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
+    zx_status_t Open(uint32_t flags) final;
+    zx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
     ssize_t Read(void* data, size_t len, size_t off) final;
     ssize_t Write(const void* data, size_t len, size_t off) final;
-    mx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
-    mx_status_t Getattr(vnattr_t* a) final;
-    mx_status_t Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len,
+    zx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
+    zx_status_t Getattr(vnattr_t* a) final;
+    zx_status_t Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len,
                        uint32_t mode) final;
-    mx_status_t Truncate(size_t len) final;
-    mx_status_t Unlink(const char* name, size_t len, bool must_be_dir) final;
-    mx_status_t Mmap(int flags, size_t len, size_t* off, mx_handle_t* out) final;
-    mx_status_t Sync() final;
+    zx_status_t Truncate(size_t len) final;
+    zx_status_t Unlink(const char* name, size_t len, bool must_be_dir) final;
+    zx_status_t Mmap(int flags, size_t len, size_t* off, zx_handle_t* out) final;
+    zx_status_t Sync() final;
 
     // Read both VMOs into memory, if we haven't already.
     //
@@ -160,12 +160,12 @@
     // service, and it can properly handle pages faults on a vnode's contents,
     // then we can avoid reading the entire blob up-front. Until then, read
     // the contents of a VMO into memory when it is opened.
-    mx_status_t InitVmos();
+    zx_status_t InitVmos();
 
-    mx_status_t WriteShared(WriteTxn* txn, size_t start, size_t len, uint64_t start_block);
+    zx_status_t WriteShared(WriteTxn* txn, size_t start, size_t len, uint64_t start_block);
     // Called by Blob once the last write has completed, updating the
     // on-disk metadata.
-    mx_status_t WriteMetadata();
+    zx_status_t WriteMetadata();
 
     // Acquire a pointer to the mapped data or merkle tree
     void* GetData() const;
@@ -182,7 +182,7 @@
     fbl::unique_ptr<MappedVmo> blob_{};
     vmoid_t vmoid_{};
 
-    mx::event readable_event_{};
+    zx::event readable_event_{};
     uint64_t bytes_written_{};
     uint8_t digest_[Digest::kLength]{};
 
@@ -207,48 +207,48 @@
     DISALLOW_COPY_ASSIGN_AND_MOVE(Blobstore);
     friend class VnodeBlob;
 
-    static mx_status_t Create(int blockfd, const blobstore_info_t* info, fbl::RefPtr<Blobstore>* out);
+    static zx_status_t Create(int blockfd, const blobstore_info_t* info, fbl::RefPtr<Blobstore>* out);
 
-    mx_status_t Unmount();
+    zx_status_t Unmount();
     virtual ~Blobstore();
 
     // Returns the root blob
-    mx_status_t GetRootBlob(fbl::RefPtr<VnodeBlob>* out);
+    zx_status_t GetRootBlob(fbl::RefPtr<VnodeBlob>* out);
 
     // Searches for a blob by name.
     // - If a readable blob with the same name exists, return it.
     // - If a blob with the same name exists, but it is not readable,
-    //   MX_ERR_BAD_STATE is returned.
+    //   ZX_ERR_BAD_STATE is returned.
     //
     // 'out' may be null -- the same error code will be returned as if it
     // was a valid pointer.
     //
     // If 'out' is not null, then the blob's  will be added to the
     // "quick lookup" map if it was not there already.
-    mx_status_t LookupBlob(const Digest& digest, fbl::RefPtr<VnodeBlob>* out);
+    zx_status_t LookupBlob(const Digest& digest, fbl::RefPtr<VnodeBlob>* out);
 
     // Creates a new blob in-memory, with no backing disk storage (yet).
     // If a blob with the name already exists, this function fails.
     //
     // Adds Blob to the "quick lookup" map.
-    mx_status_t NewBlob(const Digest& digest, fbl::RefPtr<VnodeBlob>* out);
+    zx_status_t NewBlob(const Digest& digest, fbl::RefPtr<VnodeBlob>* out);
 
     // Removes blob from 'active' hashmap.
-    mx_status_t ReleaseBlob(VnodeBlob* blob);
+    zx_status_t ReleaseBlob(VnodeBlob* blob);
 
-    mx_status_t Readdir(void* cookie, void* dirents, size_t len);
+    zx_status_t Readdir(void* cookie, void* dirents, size_t len);
 
-    mx_status_t AttachVmo(mx_handle_t vmo, vmoid_t* out);
-    mx_status_t Txn(block_fifo_request_t* requests, size_t count) {
+    zx_status_t AttachVmo(zx_handle_t vmo, vmoid_t* out);
+    zx_status_t Txn(block_fifo_request_t* requests, size_t count) {
         return block_fifo_txn(fifo_client_, requests, count);
     }
     txnid_t TxnId() const { return txnid_; }
 
     // If possible, attempt to resize the blobstore partition.
     // Add one additional slice for inodes.
-    mx_status_t AddInodes();
+    zx_status_t AddInodes();
     // Add enough slices required to hold nblocks additional blocks.
-    mx_status_t AddBlocks(size_t nblocks);
+    zx_status_t AddBlocks(size_t nblocks);
 
     int blockfd_;
     blobstore_info_t info_;
@@ -257,14 +257,14 @@
     friend class BlobstoreChecker;
 
     Blobstore(int fd, const blobstore_info_t* info);
-    mx_status_t LoadBitmaps();
+    zx_status_t LoadBitmaps();
 
     // Finds space for a block in memory. Does not update disk.
-    mx_status_t AllocateBlocks(size_t nblocks, size_t* blkno_out);
+    zx_status_t AllocateBlocks(size_t nblocks, size_t* blkno_out);
     void FreeBlocks(size_t nblocks, size_t blkno);
 
     // Finds space for a blob node in memory. Does not update disk.
-    mx_status_t AllocateNode(size_t* node_index_out);
+    zx_status_t AllocateNode(size_t* node_index_out);
     void FreeNode(size_t node_index);
 
     // Access the nth inode of the node map
@@ -272,13 +272,13 @@
 
     // Given a contiguous number of blocks after a starting block,
     // write out the bitmap to disk for the corresponding blocks.
-    mx_status_t WriteBitmap(WriteTxn* txn, uint64_t nblocks, uint64_t start_block);
+    zx_status_t WriteBitmap(WriteTxn* txn, uint64_t nblocks, uint64_t start_block);
 
     // Given a node within the node map at an index, write it to disk.
-    mx_status_t WriteNode(WriteTxn* txn, size_t map_index);
+    zx_status_t WriteNode(WriteTxn* txn, size_t map_index);
 
     // Enqueues an update for allocated inode/block counts
-    mx_status_t CountUpdate(WriteTxn* txn);
+    zx_status_t CountUpdate(WriteTxn* txn);
 
     // VnodeBlobs exist in the WAVLTree as long as one or more reference exists;
     // when the Vnode is deleted, it is immediately removed from the WAVL tree.
@@ -304,7 +304,7 @@
     void Init(fbl::RefPtr<Blobstore> vnode);
     void TraverseInodeBitmap();
     void TraverseBlockBitmap();
-    mx_status_t CheckAllocatedCounts() const;
+    zx_status_t CheckAllocatedCounts() const;
 
 private:
     DISALLOW_COPY_ASSIGN_AND_MOVE(BlobstoreChecker);
@@ -317,12 +317,12 @@
 
 int blobstore_mkfs(int fd, uint64_t block_count);
 
-mx_status_t blobstore_mount(fbl::RefPtr<VnodeBlob>* out, int blockfd);
-mx_status_t blobstore_create(fbl::RefPtr<Blobstore>* out, int blockfd);
-mx_status_t blobstore_check(fbl::RefPtr<Blobstore> vnode);
+zx_status_t blobstore_mount(fbl::RefPtr<VnodeBlob>* out, int blockfd);
+zx_status_t blobstore_create(fbl::RefPtr<Blobstore>* out, int blockfd);
+zx_status_t blobstore_check(fbl::RefPtr<Blobstore> vnode);
 
-mx_status_t readblk(int fd, uint64_t bno, void* data);
-mx_status_t writeblk(int fd, uint64_t bno, const void* data);
+zx_status_t readblk(int fd, uint64_t bno, void* data);
+zx_status_t writeblk(int fd, uint64_t bno, const void* data);
 
 uint64_t MerkleTreeBlocks(const blobstore_inode_t& blobNode);
 // Get a pointer to the nth block of the bitmap.
@@ -331,7 +331,7 @@
     assert(kBlobstoreBlockSize <= (n + 1) * kBlobstoreBlockSize); // Avoid overflow
     return fs::GetBlock<kBlobstoreBlockSize>(bm.StorageUnsafe()->GetData(), n);
 }
-mx_status_t blobstore_check_info(const blobstore_info_t* info, uint64_t max);
-mx_status_t blobstore_get_blockcount(int fd, uint64_t* out);
+zx_status_t blobstore_check_info(const blobstore_info_t* info, uint64_t max);
+zx_status_t blobstore_get_blockcount(int fd, uint64_t* out);
 
 } // namespace blobstore
diff --git a/system/uapp/blobstore/blobstore.cpp b/system/uapp/blobstore/blobstore.cpp
index f798dde..ac4ec7f 100644
--- a/system/uapp/blobstore/blobstore.cpp
+++ b/system/uapp/blobstore/blobstore.cpp
@@ -13,9 +13,9 @@
 #include <digest/digest.h>
 #include <digest/merkle-tree.h>
 #include <fs/block-txn.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <mxio/debug.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <fdio/debug.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/limits.h>
 #include <fbl/ref_ptr.h>
@@ -29,26 +29,26 @@
 
 namespace {
 
-mx_status_t vmo_read_exact(mx_handle_t h, void* data, uint64_t offset, size_t len) {
+zx_status_t vmo_read_exact(zx_handle_t h, void* data, uint64_t offset, size_t len) {
     size_t actual;
-    mx_status_t status = mx_vmo_read(h, data, offset, len, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = zx_vmo_read(h, data, offset, len, &actual);
+    if (status != ZX_OK) {
         return status;
     } else if (actual != len) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t vmo_write_exact(mx_handle_t h, const void* data, uint64_t offset, size_t len) {
+zx_status_t vmo_write_exact(zx_handle_t h, const void* data, uint64_t offset, size_t len) {
     size_t actual;
-    mx_status_t status = mx_vmo_write(h, data, offset, len, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = zx_vmo_write(h, data, offset, len, &actual);
+    if (status != ZX_OK) {
         return status;
     } else if (actual != len) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 } // namespace
@@ -59,21 +59,21 @@
     return &reinterpret_cast<blobstore_inode_t*>(node_map_->GetData())[index];
 }
 
-mx_status_t VnodeBlob::InitVmos() {
+zx_status_t VnodeBlob::InitVmos() {
     if (blob_ != nullptr) {
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     blobstore_inode_t* inode = blobstore_->GetNode(map_index_);
 
     uint64_t num_blocks = BlobDataBlocks(*inode) + MerkleTreeBlocks(*inode);
-    if ((status = MappedVmo::Create(num_blocks * kBlobstoreBlockSize, "blob", &blob_)) != MX_OK) {
+    if ((status = MappedVmo::Create(num_blocks * kBlobstoreBlockSize, "blob", &blob_)) != ZX_OK) {
         FS_TRACE_ERROR("Failed to initialize vmo; error: %d\n", status);
         BlobCloseHandles();
         return status;
     }
-    if ((status = blobstore_->AttachVmo(blob_->GetVmo(), &vmoid_)) != MX_OK) {
+    if ((status = blobstore_->AttachVmo(blob_->GetVmo(), &vmoid_)) != ZX_OK) {
         FS_TRACE_ERROR("Failed to attach VMO to block device; error: %d\n", status);
         BlobCloseHandles();
         return status;
@@ -108,17 +108,17 @@
     readable_event_.reset();
 }
 
-mx_status_t VnodeBlob::SpaceAllocate(uint64_t size_data) {
+zx_status_t VnodeBlob::SpaceAllocate(uint64_t size_data) {
     if (size_data == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (GetState() != kBlobStateEmpty) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // Find a free node, mark it as reserved.
-    mx_status_t status;
-    if ((status = blobstore_->AllocateNode(&map_index_)) != MX_OK) {
+    zx_status_t status;
+    if ((status = blobstore_->AllocateNode(&map_index_)) != ZX_OK) {
         return status;
     }
 
@@ -129,20 +129,20 @@
     inode->num_blocks = MerkleTreeBlocks(*inode) + BlobDataBlocks(*inode);
 
     // Open VMOs, so we can begin writing after allocate succeeds.
-    if ((status = MappedVmo::Create(inode->num_blocks * kBlobstoreBlockSize, "blob", &blob_)) != MX_OK) {
+    if ((status = MappedVmo::Create(inode->num_blocks * kBlobstoreBlockSize, "blob", &blob_)) != ZX_OK) {
         goto fail;
     }
-    if ((status = blobstore_->AttachVmo(blob_->GetVmo(), &vmoid_)) != MX_OK) {
+    if ((status = blobstore_->AttachVmo(blob_->GetVmo(), &vmoid_)) != ZX_OK) {
         goto fail;
     }
 
     // Allocate space for the blob
-    if ((status = blobstore_->AllocateBlocks(inode->num_blocks, &inode->start_block)) != MX_OK) {
+    if ((status = blobstore_->AllocateBlocks(inode->num_blocks, &inode->start_block)) != ZX_OK) {
         goto fail;
     }
 
     SetState(kBlobStateDataWrite);
-    return MX_OK;
+    return ZX_OK;
 
 fail:
     BlobCloseHandles();
@@ -152,7 +152,7 @@
 
 // A helper function for dumping either the Merkle Tree or the actual blob data
 // to both (1) The containing VMO, and (2) disk.
-mx_status_t VnodeBlob::WriteShared(WriteTxn* txn, size_t start, size_t len, uint64_t start_block) {
+zx_status_t VnodeBlob::WriteShared(WriteTxn* txn, size_t start, size_t len, uint64_t start_block) {
     // Write as many 'entire blocks' as possible
     uint64_t n = start / kBlobstoreBlockSize;
     uint64_t n_end = (start + len + kBlobstoreBlockSize - 1) / kBlobstoreBlockSize;
@@ -170,14 +170,14 @@
     return blob_->GetData();
 }
 
-mx_status_t VnodeBlob::WriteMetadata() {
+zx_status_t VnodeBlob::WriteMetadata() {
     assert(GetState() == kBlobStateDataWrite);
 
     // All data has been written to the containing VMO
     SetState(kBlobStateReadable);
     if (readable_event_.is_valid()) {
-        mx_status_t status = readable_event_.signal(0u, MX_USER_SIGNAL_0);
-        if (status != MX_OK) {
+        zx_status_t status = readable_event_.signal(0u, ZX_USER_SIGNAL_0);
+        if (status != ZX_OK) {
             SetState(kBlobStateError);
             return status;
         }
@@ -195,8 +195,8 @@
     WriteTxn txn(blobstore_.get());
 
     // Write block allocation bitmap
-    if (blobstore_->WriteBitmap(&txn, inode->num_blocks, inode->start_block) != MX_OK) {
-        return MX_ERR_IO;
+    if (blobstore_->WriteBitmap(&txn, inode->num_blocks, inode->start_block) != ZX_OK) {
+        return ZX_ERR_IO;
     }
 
     // Flush the block allocation bitmap to disk
@@ -207,18 +207,18 @@
 
     // Write back the blob node
     if (blobstore_->WriteNode(&txn, map_index_)) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     blobstore_->CountUpdate(&txn);
     flags_ &= ~kBlobFlagSync;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeBlob::WriteInternal(const void* data, size_t len, size_t* actual) {
+zx_status_t VnodeBlob::WriteInternal(const void* data, size_t len, size_t* actual) {
     *actual = 0;
     if (len == 0) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     WriteTxn txn(blobstore_.get());
@@ -227,13 +227,13 @@
     if (GetState() == kBlobStateDataWrite) {
         size_t to_write = fbl::min(len, inode->blob_size - bytes_written_);
         size_t offset = bytes_written_ + data_start;
-        mx_status_t status = vmo_write_exact(blob_->GetVmo(), data, offset, to_write);
-        if (status != MX_OK) {
+        zx_status_t status = vmo_write_exact(blob_->GetVmo(), data, offset, to_write);
+        if (status != ZX_OK) {
             return status;
         }
 
         status = WriteShared(&txn, offset, len, inode->start_block);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             SetState(kBlobStateError);
             return status;
         }
@@ -243,7 +243,7 @@
 
         // More data to write.
         if (bytes_written_ < inode->blob_size) {
-            return MX_OK;
+            return ZX_OK;
         }
 
         // TODO(smklein): As an optimization, use the CreateInit/Update/Final
@@ -255,7 +255,7 @@
             void* merkle_data = GetMerkle();
             const void* blob_data = GetData();
             if (MerkleTree::Create(blob_data, inode->blob_size, merkle_data,
-                                   merkle_size, &digest) != MX_OK) {
+                                   merkle_size, &digest) != ZX_OK) {
                 SetState(kBlobStateError);
                 return status;
             } else if (digest != digest_) {
@@ -265,47 +265,47 @@
             }
 
             status = WriteShared(&txn, 0, merkle_size, inode->start_block);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 SetState(kBlobStateError);
                 return status;
             }
         }
 
         // No more data to write. Flush to disk.
-        if ((status = WriteMetadata()) != MX_OK) {
+        if ((status = WriteMetadata()) != ZX_OK) {
             SetState(kBlobStateError);
             return status;
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_BAD_STATE;
+    return ZX_ERR_BAD_STATE;
 }
 
-mx_status_t VnodeBlob::GetReadableEvent(mx_handle_t* out) {
-    mx_status_t status;
+zx_status_t VnodeBlob::GetReadableEvent(zx_handle_t* out) {
+    zx_status_t status;
     // This is the first 'wait until read event' request received
     if (!readable_event_.is_valid()) {
-        status = mx::event::create(0, &readable_event_);
-        if (status != MX_OK) {
+        status = zx::event::create(0, &readable_event_);
+        if (status != ZX_OK) {
             return status;
         } else if (GetState() == kBlobStateReadable) {
-            readable_event_.signal(0u, MX_USER_SIGNAL_0);
+            readable_event_.signal(0u, ZX_USER_SIGNAL_0);
         }
     }
-    status = mx_handle_duplicate(readable_event_.get(), MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ, out);
-    if (status != MX_OK) {
+    status = zx_handle_duplicate(readable_event_.get(), ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ, out);
+    if (status != ZX_OK) {
         return status;
     }
-    return sizeof(mx_handle_t);
+    return sizeof(zx_handle_t);
 }
 
-mx_status_t VnodeBlob::CopyVmo(mx_rights_t rights, mx_handle_t* out) {
+zx_status_t VnodeBlob::CopyVmo(zx_rights_t rights, zx_handle_t* out) {
     if (GetState() != kBlobStateReadable) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
-    mx_status_t status = InitVmos();
-    if (status != MX_OK) {
+    zx_status_t status = InitVmos();
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -321,33 +321,33 @@
     const void* blob_data = GetData();
     status = MerkleTree::Verify(blob_data, inode->blob_size, merkle_data,
                                 size_merkle, 0, inode->blob_size, d);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     // TODO(smklein): Only clone / verify the part of the vmo that
     // was requested.
     const size_t data_start = MerkleTreeBlocks(*inode) * kBlobstoreBlockSize;
-    mx_handle_t clone;
-    if ((status = mx_vmo_clone(blob_->GetVmo(), MX_VMO_CLONE_COPY_ON_WRITE,
-                               data_start, inode->blob_size, &clone)) != MX_OK) {
+    zx_handle_t clone;
+    if ((status = zx_vmo_clone(blob_->GetVmo(), ZX_VMO_CLONE_COPY_ON_WRITE,
+                               data_start, inode->blob_size, &clone)) != ZX_OK) {
         return status;
     }
 
-    if ((status = mx_handle_replace(clone, rights, out)) != MX_OK) {
-        mx_handle_close(clone);
+    if ((status = zx_handle_replace(clone, rights, out)) != ZX_OK) {
+        zx_handle_close(clone);
         return status;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeBlob::ReadInternal(void* data, size_t len, size_t off, size_t* actual) {
+zx_status_t VnodeBlob::ReadInternal(void* data, size_t len, size_t off, size_t* actual) {
     if (GetState() != kBlobStateReadable) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
-    mx_status_t status = InitVmos();
-    if (status != MX_OK) {
+    zx_status_t status = InitVmos();
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -356,7 +356,7 @@
     auto inode = blobstore_->GetNode(map_index_);
     if (off >= inode->blob_size) {
         *actual = 0;
-        return MX_OK;
+        return ZX_OK;
     }
     if (len > (inode->blob_size - off)) {
         len = inode->blob_size - off;
@@ -367,12 +367,12 @@
     const void* blob_data = GetData();
     status = MerkleTree::Verify(blob_data, inode->blob_size, merkle_data,
                                 size_merkle, off, len, d);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     const size_t data_start = MerkleTreeBlocks(*inode) * kBlobstoreBlockSize;
-    return mx_vmo_read(blob_->GetVmo(), data, data_start + off, len, actual);
+    return zx_vmo_read(blob_->GetVmo(), data, data_start + off, len, actual);
 }
 
 void VnodeBlob::QueueUnlink() {
@@ -380,49 +380,49 @@
 }
 
 // Allocates Blocks IN MEMORY
-mx_status_t Blobstore::AllocateBlocks(size_t nblocks, size_t* blkno_out) {
-    mx_status_t status;
-    if ((status = block_map_.Find(false, 0, block_map_.size(), nblocks, blkno_out)) != MX_OK) {
+zx_status_t Blobstore::AllocateBlocks(size_t nblocks, size_t* blkno_out) {
+    zx_status_t status;
+    if ((status = block_map_.Find(false, 0, block_map_.size(), nblocks, blkno_out)) != ZX_OK) {
         // If we have run out of blocks, attempt to add block slices via FVM
         size_t old_size = block_map_.size();
-        if (AddBlocks(nblocks) != MX_OK) {
-            return MX_ERR_NO_SPACE;
+        if (AddBlocks(nblocks) != ZX_OK) {
+            return ZX_ERR_NO_SPACE;
         } else if (block_map_.Find(false, old_size, block_map_.size(), nblocks, blkno_out)
-                   != MX_OK) {
-            return MX_ERR_NO_SPACE;
+                   != ZX_OK) {
+            return ZX_ERR_NO_SPACE;
         }
     }
     status = block_map_.Set(*blkno_out, *blkno_out + nblocks);
-    assert(status == MX_OK);
+    assert(status == ZX_OK);
     info_.alloc_block_count += nblocks;
     *blkno_out += DataStartBlock(info_);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Frees Blocks IN MEMORY
 void Blobstore::FreeBlocks(size_t nblocks, size_t blkno) {
-    mx_status_t status = block_map_.Clear(blkno - DataStartBlock(info_),
+    zx_status_t status = block_map_.Clear(blkno - DataStartBlock(info_),
                                           blkno - DataStartBlock(info_) + nblocks);
     info_.alloc_block_count -= nblocks;
-    assert(status == MX_OK);
+    assert(status == ZX_OK);
 }
 
 // Allocates a node IN MEMORY
-mx_status_t Blobstore::AllocateNode(size_t* node_index_out) {
+zx_status_t Blobstore::AllocateNode(size_t* node_index_out) {
     for (size_t i = 0; i < info_.inode_count; ++i) {
         if (GetNode(i)->start_block == kStartBlockFree) {
             // Found a free node. Mark it as reserved so no one else can allocate it.
             GetNode(i)->start_block = kStartBlockReserved;
             info_.alloc_inode_count++;
             *node_index_out = i;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
     // If we didn't find any free inodes, try adding more via FVM.
     size_t old_inode_count = info_.inode_count;
-    if (AddInodes() != MX_OK) {
-        return MX_ERR_NO_SPACE;
+    if (AddInodes() != ZX_OK) {
+        return ZX_ERR_NO_SPACE;
     }
 
     for (size_t i = old_inode_count; i < info_.inode_count; ++i) {
@@ -431,11 +431,11 @@
             GetNode(i)->start_block = kStartBlockReserved;
             info_.alloc_inode_count++;
             *node_index_out = i;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
-    return MX_ERR_NO_SPACE;
+    return ZX_ERR_NO_SPACE;
 }
 
 // Frees a node IN MEMORY
@@ -444,15 +444,15 @@
     info_.alloc_inode_count--;
 }
 
-mx_status_t Blobstore::Unmount() {
+zx_status_t Blobstore::Unmount() {
     close(blockfd_);
     // TODO(smklein): To not bind filesystem lifecycle to a process, shut
     // down (closing dispatcher) rather than calling exit.
     exit(0);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Blobstore::WriteBitmap(WriteTxn* txn, uint64_t nblocks, uint64_t start_block) {
+zx_status_t Blobstore::WriteBitmap(WriteTxn* txn, uint64_t nblocks, uint64_t start_block) {
     uint64_t bbm_start_block = (start_block - DataStartBlock(info_)) / kBlobstoreBlockBits;
     uint64_t bbm_end_block = fbl::roundup(start_block - DataStartBlock(info_) + nblocks,
                                            kBlobstoreBlockBits) / kBlobstoreBlockBits;
@@ -463,31 +463,31 @@
     return txn->Flush();
 }
 
-mx_status_t Blobstore::WriteNode(WriteTxn* txn, size_t map_index) {
+zx_status_t Blobstore::WriteNode(WriteTxn* txn, size_t map_index) {
     uint64_t b = (map_index * sizeof(blobstore_inode_t)) / kBlobstoreBlockSize;
     txn->Enqueue(node_map_vmoid_, b, NodeMapStartBlock(info_) + b, 1);
     return txn->Flush();
 }
 
-mx_status_t Blobstore::NewBlob(const Digest& digest, fbl::RefPtr<VnodeBlob>* out) {
-    mx_status_t status;
+zx_status_t Blobstore::NewBlob(const Digest& digest, fbl::RefPtr<VnodeBlob>* out) {
+    zx_status_t status;
     // If the blob already exists (or we're having trouble looking up the blob),
     // return an error.
-    if ((status = LookupBlob(digest, nullptr)) != MX_ERR_NOT_FOUND) {
-        return (status == MX_OK) ? MX_ERR_ALREADY_EXISTS : status;
+    if ((status = LookupBlob(digest, nullptr)) != ZX_ERR_NOT_FOUND) {
+        return (status == ZX_OK) ? ZX_ERR_ALREADY_EXISTS : status;
     }
 
     fbl::AllocChecker ac;
     *out = fbl::AdoptRef(new (&ac) VnodeBlob(fbl::RefPtr<Blobstore>(this), digest));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     hash_.insert(out->get());
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Blobstore::ReleaseBlob(VnodeBlob* vn) {
+zx_status_t Blobstore::ReleaseBlob(VnodeBlob* vn) {
     // TODO(smklein): What if kBlobFlagSync is set? Do we risk writing out
     // parts of the blob AFTER it has been deleted?
     // Ex: open, alloc, disk write async start, unlink, release, disk write async end.
@@ -497,13 +497,13 @@
     case kBlobStateEmpty: {
         // There are no in-memory or on-disk structures allocated.
         hash_.erase(*vn);
-        return MX_OK;
+        return ZX_OK;
     }
     case kBlobStateReadable: {
         if (!vn->DeletionQueued()) {
             // We want in-memory and on-disk data to persist.
             hash_.erase(*vn);
-            return MX_OK;
+            return ZX_OK;
         }
         // Fall-through
     }
@@ -520,17 +520,17 @@
         WriteBitmap(&txn, nblocks, start_block);
         CountUpdate(&txn);
         hash_.erase(*vn);
-        return MX_OK;
+        return ZX_OK;
     }
     default: {
         assert(false);
     }
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t Blobstore::CountUpdate(WriteTxn* txn) {
-    mx_status_t status = MX_OK;
+zx_status_t Blobstore::CountUpdate(WriteTxn* txn) {
+    zx_status_t status = ZX_OK;
     void* infodata = info_vmo_->GetData();
     memcpy(infodata, &info_, sizeof(info_));
     txn->Enqueue(info_vmoid_, 0, 0, 1);
@@ -545,7 +545,7 @@
 static_assert(sizeof(dircookie_t) <= sizeof(vdircookie_t),
               "Blobstore dircookie too large to fit in IO state");
 
-mx_status_t Blobstore::Readdir(void* cookie, void* dirents, size_t len) {
+zx_status_t Blobstore::Readdir(void* cookie, void* dirents, size_t len) {
     fs::DirentFiller df(dirents, len);
     dircookie_t* c = static_cast<dircookie_t*>(cookie);
 
@@ -553,11 +553,11 @@
         if (GetNode(i)->start_block >= kStartBlockMinimum) {
             Digest digest(GetNode(i)->merkle_root_hash);
             char name[Digest::kLength * 2 + 1];
-            mx_status_t r = digest.ToString(name, sizeof(name));
+            zx_status_t r = digest.ToString(name, sizeof(name));
             if (r < 0) {
                 return r;
             }
-            if ((r = df.Next(name, strlen(name), VTYPE_TO_DTYPE(V_TYPE_FILE))) != MX_OK) {
+            if ((r = df.Next(name, strlen(name), VTYPE_TO_DTYPE(V_TYPE_FILE))) != ZX_OK) {
                 break;
             }
             c->index = i + 1;
@@ -567,7 +567,7 @@
     return df.BytesFilled();
 }
 
-mx_status_t Blobstore::LookupBlob(const Digest& digest, fbl::RefPtr<VnodeBlob>* out) {
+zx_status_t Blobstore::LookupBlob(const Digest& digest, fbl::RefPtr<VnodeBlob>* out) {
     // Look up blob in the fast map (is the blob open elsewhere?)
     fbl::RefPtr<VnodeBlob> vn = fbl::RefPtr<VnodeBlob>(hash_.find(digest.AcquireBytes()).CopyPointer());
     digest.ReleaseBytes();
@@ -575,7 +575,7 @@
         if (out != nullptr) {
             *out = fbl::move(vn);
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Look up blob in the slow map
@@ -588,7 +588,7 @@
                     fbl::RefPtr<VnodeBlob> vn =
                         fbl::AdoptRef(new (&ac) VnodeBlob(fbl::RefPtr<Blobstore>(this), digest));
                     if (!ac.check()) {
-                        return MX_ERR_NO_MEMORY;
+                        return ZX_ERR_NO_MEMORY;
                     }
                     vn->SetState(kBlobStateReadable);
                     vn->SetMapIndex(i);
@@ -596,30 +596,30 @@
                     hash_.insert(vn.get());
                     *out = fbl::move(vn);
                 }
-                return MX_OK;
+                return ZX_OK;
             }
         }
     }
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
-mx_status_t Blobstore::AttachVmo(mx_handle_t vmo, vmoid_t* out) {
-    mx_handle_t xfer_vmo;
-    mx_status_t status = mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo);
-    if (status != MX_OK) {
+zx_status_t Blobstore::AttachVmo(zx_handle_t vmo, vmoid_t* out) {
+    zx_handle_t xfer_vmo;
+    zx_status_t status = zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo);
+    if (status != ZX_OK) {
         return status;
     }
     ssize_t r = ioctl_block_attach_vmo(blockfd_, &xfer_vmo, out);
     if (r < 0) {
-        mx_handle_close(xfer_vmo);
-        return static_cast<mx_status_t>(r);
+        zx_handle_close(xfer_vmo);
+        return static_cast<zx_status_t>(r);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Blobstore::AddInodes() {
+zx_status_t Blobstore::AddInodes() {
     if (!(info_.flags & kBlobstoreFlagFVM)) {
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     const size_t kBlocksPerSlice = info_.slice_size / kBlobstoreBlockSize;
@@ -628,22 +628,22 @@
     request.offset = (kFVMNodeMapStart / kBlocksPerSlice) + info_.ino_slices;
     if (ioctl_block_fvm_extend(blockfd_, &request) < 0) {
         fprintf(stderr, "Blobstore::AddInodes fvm_extend failure");
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     const uint32_t kInodesPerSlice = static_cast<uint32_t>(info_.slice_size / kBlobstoreInodeSize);
     uint64_t inodes64 = (info_.ino_slices + static_cast<uint32_t>(request.length))
                         * kInodesPerSlice;
-    MX_DEBUG_ASSERT(inodes64 <= fbl::numeric_limits<uint32_t>::max());
+    ZX_DEBUG_ASSERT(inodes64 <= fbl::numeric_limits<uint32_t>::max());
     uint32_t inodes = static_cast<uint32_t>(inodes64);
     uint32_t inoblks = (inodes + kBlobstoreInodesPerBlock - 1) / kBlobstoreInodesPerBlock;
-    MX_DEBUG_ASSERT(info_.inode_count <= fbl::numeric_limits<uint32_t>::max());
+    ZX_DEBUG_ASSERT(info_.inode_count <= fbl::numeric_limits<uint32_t>::max());
     uint32_t inoblks_old = (static_cast<uint32_t>(info_.inode_count) + kBlobstoreInodesPerBlock - 1)
                            / kBlobstoreInodesPerBlock;
-    MX_DEBUG_ASSERT(inoblks_old <= inoblks);
+    ZX_DEBUG_ASSERT(inoblks_old <= inoblks);
 
-    if (node_map_->Grow(inoblks * kBlobstoreBlockSize) != MX_OK) {
-        return MX_ERR_NO_SPACE;
+    if (node_map_->Grow(inoblks * kBlobstoreBlockSize) != ZX_OK) {
+        return ZX_ERR_NO_SPACE;
     }
 
     info_.vslice_count += request.length;
@@ -662,9 +662,9 @@
     return txn.Flush();
 }
 
-mx_status_t Blobstore::AddBlocks(size_t nblocks) {
+zx_status_t Blobstore::AddBlocks(size_t nblocks) {
     if (!(info_.flags & kBlobstoreFlagFVM)) {
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     const size_t kBlocksPerSlice = info_.slice_size / kBlobstoreBlockSize;
@@ -674,26 +674,26 @@
     request.offset = (kFVMDataStart / kBlocksPerSlice) + info_.dat_slices;
 
     uint64_t blocks64 = (info_.dat_slices + request.length) * kBlocksPerSlice;
-    MX_DEBUG_ASSERT(blocks64 <= fbl::numeric_limits<uint32_t>::max());
+    ZX_DEBUG_ASSERT(blocks64 <= fbl::numeric_limits<uint32_t>::max());
     uint32_t blocks = static_cast<uint32_t>(blocks64);
     uint32_t abmblks = (blocks + kBlobstoreBlockBits - 1) / kBlobstoreBlockBits;
     uint64_t abmblks_old = (info_.block_count + kBlobstoreBlockBits - 1) / kBlobstoreBlockBits;
-    MX_DEBUG_ASSERT(abmblks_old <= abmblks);
+    ZX_DEBUG_ASSERT(abmblks_old <= abmblks);
 
     if (abmblks > kBlocksPerSlice) {
         //TODO(planders): Allocate more slices for the block bitmap.
         fprintf(stderr, "Blobstore::AddBlocks needs to increase block bitmap size");
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     if (ioctl_block_fvm_extend(blockfd_, &request) < 0) {
         fprintf(stderr, "Blobstore::AddBlocks FVM Extend failure");
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     // Grow the block bitmap to hold new number of blocks
-    if (block_map_.Grow(fbl::roundup(blocks, kBlobstoreBlockBits)) != MX_OK) {
-        return MX_ERR_NO_SPACE;
+    if (block_map_.Grow(fbl::roundup(blocks, kBlobstoreBlockBits)) != ZX_OK) {
+        return ZX_ERR_NO_SPACE;
     }
     // Grow before shrinking to ensure the underlying storage is a multiple
     // of kBlobstoreBlockSize.
@@ -728,8 +728,8 @@
     }
 }
 
-mx_status_t Blobstore::Create(int fd, const blobstore_info_t* info, fbl::RefPtr<Blobstore>* out) {
-    mx_status_t status = blobstore_check_info(info, TotalBlocks(*info));
+zx_status_t Blobstore::Create(int fd, const blobstore_info_t* info, fbl::RefPtr<Blobstore>* out) {
+    zx_status_t status = blobstore_check_info(info, TotalBlocks(*info));
     if (status < 0) {
         fprintf(stderr, "blobstore: Check info failure\n");
         return status;
@@ -738,19 +738,19 @@
     fbl::AllocChecker ac;
     fbl::RefPtr<Blobstore> fs = fbl::AdoptRef(new (&ac) Blobstore(fd, info));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t r;
     if ((r = ioctl_block_get_fifos(fd, &fifo)) < 0) {
-        return static_cast<mx_status_t>(r);
+        return static_cast<zx_status_t>(r);
     } else if ((r = ioctl_block_alloc_txn(fd, &fs->txnid_)) < 0) {
-        mx_handle_close(fifo);
-        return static_cast<mx_status_t>(r);
-    } else if ((status = block_fifo_create_client(fifo, &fs->fifo_client_)) != MX_OK) {
+        zx_handle_close(fifo);
+        return static_cast<zx_status_t>(r);
+    } else if ((status = block_fifo_create_client(fifo, &fs->fifo_client_)) != ZX_OK) {
         ioctl_block_free_txn(fd, &fs->txnid_);
-        mx_handle_close(fifo);
+        zx_handle_close(fifo);
         return status;
     }
 
@@ -764,56 +764,56 @@
     }
 
     size_t nodemap_size = kBlobstoreInodeSize * fs->info_.inode_count;
-    MX_DEBUG_ASSERT(fbl::roundup(nodemap_size, kBlobstoreBlockSize) == nodemap_size);
-    MX_DEBUG_ASSERT(nodemap_size / kBlobstoreBlockSize == NodeMapBlocks(fs->info_));
-    if ((status = MappedVmo::Create(nodemap_size, "nodemap", &fs->node_map_)) != MX_OK) {
+    ZX_DEBUG_ASSERT(fbl::roundup(nodemap_size, kBlobstoreBlockSize) == nodemap_size);
+    ZX_DEBUG_ASSERT(nodemap_size / kBlobstoreBlockSize == NodeMapBlocks(fs->info_));
+    if ((status = MappedVmo::Create(nodemap_size, "nodemap", &fs->node_map_)) != ZX_OK) {
         return status;
     } else if ((status = fs->AttachVmo(fs->block_map_.StorageUnsafe()->GetVmo(),
-                                       &fs->block_map_vmoid_)) != MX_OK) {
+                                       &fs->block_map_vmoid_)) != ZX_OK) {
         return status;
     } else if ((status = fs->AttachVmo(fs->node_map_->GetVmo(),
-                                       &fs->node_map_vmoid_)) != MX_OK) {
+                                       &fs->node_map_vmoid_)) != ZX_OK) {
         return status;
     } else if ((status = fs->LoadBitmaps()) < 0) {
         fprintf(stderr, "blobstore: Failed to load bitmaps\n");
         return status;
     } else if ((status = MappedVmo::Create(kBlobstoreBlockSize, "blobstore-superblock",
-                                           &fs->info_vmo_)) != MX_OK) {
+                                           &fs->info_vmo_)) != ZX_OK) {
         fprintf(stderr, "blobstore: Failed to create info vmo\n");
         return status;
     } else if ((status = fs->AttachVmo(fs->info_vmo_->GetVmo(),
-                                       &fs->info_vmoid_)) != MX_OK) {
+                                       &fs->info_vmoid_)) != ZX_OK) {
         fprintf(stderr, "blobstore: Failed to attach info vmo\n");
         return status;
     }
 
     *out = fs;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Blobstore::GetRootBlob(fbl::RefPtr<VnodeBlob>* out) {
+zx_status_t Blobstore::GetRootBlob(fbl::RefPtr<VnodeBlob>* out) {
     fbl::AllocChecker ac;
     fbl::RefPtr<VnodeBlob> vn =
         fbl::AdoptRef(new (&ac) VnodeBlob(fbl::RefPtr<Blobstore>(this)));
 
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     *out = fbl::move(vn);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Blobstore::LoadBitmaps() {
+zx_status_t Blobstore::LoadBitmaps() {
     ReadTxn txn(this);
     txn.Enqueue(block_map_vmoid_, 0, BlockMapStartBlock(info_), BlockMapBlocks(info_));
     txn.Enqueue(node_map_vmoid_, 0, NodeMapStartBlock(info_), NodeMapBlocks(info_));
     return txn.Flush();
 }
 
-mx_status_t blobstore_create(fbl::RefPtr<Blobstore>* out, int blockfd) {
-    mx_status_t status;
+zx_status_t blobstore_create(fbl::RefPtr<Blobstore>* out, int blockfd) {
+    zx_status_t status;
 
     char block[kBlobstoreBlockSize];
     if ((status = readblk(blockfd, 0, (void*)block)) < 0) {
@@ -824,35 +824,35 @@
     blobstore_info_t* info = reinterpret_cast<blobstore_info_t*>(&block[0]);
 
     uint64_t blocks;
-    if ((status = blobstore_get_blockcount(blockfd, &blocks)) != MX_OK) {
+    if ((status = blobstore_get_blockcount(blockfd, &blocks)) != ZX_OK) {
         fprintf(stderr, "blobstore: cannot find end of underlying device\n");
         return status;
-    } else if ((status = blobstore_check_info(info, blocks)) != MX_OK) {
+    } else if ((status = blobstore_check_info(info, blocks)) != ZX_OK) {
         fprintf(stderr, "blobstore: Info check failed\n");
         return status;
     }
 
-    if ((status = Blobstore::Create(blockfd, info, out)) != MX_OK) {
+    if ((status = Blobstore::Create(blockfd, info, out)) != ZX_OK) {
         fprintf(stderr, "blobstore: mount failed\n");
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t blobstore_mount(fbl::RefPtr<VnodeBlob>* out, int blockfd) {
-    mx_status_t status;
+zx_status_t blobstore_mount(fbl::RefPtr<VnodeBlob>* out, int blockfd) {
+    zx_status_t status;
     fbl::RefPtr<Blobstore> fs;
 
-    if ((status = blobstore_create(&fs, blockfd)) != MX_OK) {
+    if ((status = blobstore_create(&fs, blockfd)) != ZX_OK) {
         return status;
     }
 
-    if ((status = fs->GetRootBlob(out)) != MX_OK) {
+    if ((status = fs->GetRootBlob(out)) != ZX_OK) {
         fprintf(stderr, "blobstore: mount failed\n");
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 } // namespace blobstore
diff --git a/system/uapp/blobstore/blobstore.h b/system/uapp/blobstore/blobstore.h
index 06bd84e..47feca8 100644
--- a/system/uapp/blobstore/blobstore.h
+++ b/system/uapp/blobstore/blobstore.h
@@ -16,7 +16,7 @@
 #include <fbl/ref_ptr.h>
 #include <fbl/unique_free_ptr.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <assert.h>
 #include <limits.h>
diff --git a/system/uapp/blobstore/main.cpp b/system/uapp/blobstore/main.cpp
index a8ee989..7ff890b 100644
--- a/system/uapp/blobstore/main.cpp
+++ b/system/uapp/blobstore/main.cpp
@@ -11,8 +11,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/process.h>
-#include <magenta/processargs.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
 #include <fbl/ref_ptr.h>
 
 #include "blobstore-private.h"
@@ -32,8 +32,8 @@
     if (blobstore::blobstore_mount(&vn, fd) < 0) {
         return -1;
     }
-    mx_handle_t h = mx_get_startup_handle(PA_HND(PA_USER0, 0));
-    if (h == MX_HANDLE_INVALID) {
+    zx_handle_t h = zx_get_startup_handle(PA_HND(PA_USER0, 0));
+    if (h == ZX_HANDLE_INVALID) {
         FS_TRACE_ERROR("blobstore: Could not access startup handle to mount point\n");
         return h;
     }
@@ -41,8 +41,8 @@
     async::Loop loop;
     fs::AsyncDispatcher dispatcher(loop.async());
     fs::Vfs vfs(&dispatcher);
-    mx_status_t status;
-    if ((status = vfs.ServeDirectory(fbl::move(vn), mx::channel(h))) != MX_OK) {
+    zx_status_t status;
+    if ((status = vfs.ServeDirectory(fbl::move(vn), zx::channel(h))) != ZX_OK) {
         return status;
     }
     loop.Run();
diff --git a/system/uapp/blobstore/rpc.cpp b/system/uapp/blobstore/rpc.cpp
index 20113fa..5440659 100644
--- a/system/uapp/blobstore/rpc.cpp
+++ b/system/uapp/blobstore/rpc.cpp
@@ -10,26 +10,26 @@
 
 #include <fs/vfs.h>
 
-#include <mxio/io.h>
-#include <mxio/remoteio.h>
-#include <mxio/util.h>
-#include <mxio/vfs.h>
+#include <fdio/io.h>
+#include <fdio/remoteio.h>
+#include <fdio/util.h>
+#include <fdio/vfs.h>
 
-#include <magenta/device/vfs.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/device/vfs.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #include "blobstore-private.h"
 
 namespace blobstore {
 
-mx_status_t VnodeBlob::GetHandles(uint32_t flags, mx_handle_t* hnds,
+zx_status_t VnodeBlob::GetHandles(uint32_t flags, zx_handle_t* hnds,
                                   uint32_t* type, void* extra, uint32_t* esize) {
-    *type = MXIO_PROTOCOL_REMOTE;
+    *type = FDIO_PROTOCOL_REMOTE;
     if (IsDirectory()) {
         return 0;
     }
-    mx_status_t r = GetReadableEvent(&hnds[0]);
+    zx_status_t r = GetReadableEvent(&hnds[0]);
     if (r < 0) {
         return r;
     }
diff --git a/system/uapp/blobstore/rules.mk b/system/uapp/blobstore/rules.mk
index c5b416b..b53649c 100644
--- a/system/uapp/blobstore/rules.mk
+++ b/system/uapp/blobstore/rules.mk
@@ -27,16 +27,16 @@
     system/ulib/block-client \
     system/ulib/digest \
     third_party/ulib/cryptolib \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/sync \
 
 MODULE_LIBS := \
     system/ulib/async.default \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/bitmap \
 
 include make/module.mk
@@ -68,8 +68,8 @@
     -Isystem/ulib/bitmap/include \
     -Isystem/ulib/digest/include \
     -Isystem/ulib/digest/include \
-    -Isystem/ulib/mxcpp/include \
-    -Isystem/ulib/mxio/include \
+    -Isystem/ulib/zxcpp/include \
+    -Isystem/ulib/fdio/include \
     -Isystem/ulib/fbl/include \
     -Isystem/ulib/fs/include \
 
diff --git a/system/uapp/channel-perf/main.cpp b/system/uapp/channel-perf/main.cpp
index ead3e31..6450198 100644
--- a/system/uapp/channel-perf/main.cpp
+++ b/system/uapp/channel-perf/main.cpp
@@ -10,8 +10,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 #include <fbl/unique_ptr.h>
 
@@ -22,9 +22,9 @@
     exit(EXIT_FAILURE);
 }
 
-void duplicate_handles(uint32_t n, mx_handle_t src, mx_handle_t* dest) {
+void duplicate_handles(uint32_t n, zx_handle_t src, zx_handle_t* dest) {
     for (uint32_t i = 0; i < n; i++) {
-        assert(mx_handle_duplicate(src, MX_RIGHT_SAME_RIGHTS, &dest[i]) == 0);
+        assert(zx_handle_duplicate(src, ZX_RIGHT_SAME_RIGHTS, &dest[i]) == 0);
     }
 }
 
@@ -35,18 +35,18 @@
 };
 
 void do_test(uint32_t duration, const TestArgs& test_args) {
-    __UNUSED mx_status_t status;
+    __UNUSED zx_status_t status;
 
     uint64_t duration_ns = duration * 1000000000ull;
 
     // We'll write to mp[0] (and read from mp[1]).
-    mx_handle_t mp[2] = {MX_HANDLE_INVALID, MX_HANDLE_INVALID};
-    status = mx_channel_create(0u, &mp[0], &mp[1]);
-    assert(status == MX_OK);
+    zx_handle_t mp[2] = {ZX_HANDLE_INVALID, ZX_HANDLE_INVALID};
+    status = zx_channel_create(0u, &mp[0], &mp[1]);
+    assert(status == ZX_OK);
 
     // We'll send/receive duplicates of this handle.
-    mx_handle_t event;
-    assert(mx_event_create(0u, &event) == MX_OK);
+    zx_handle_t event;
+    assert(zx_event_create(0u, &event) == ZX_OK);
 
     // Storage space for our messages' stuff.
     fbl::unique_ptr<uint8_t[]> data;
@@ -55,55 +55,55 @@
         for (uint32_t i = 0; i < test_args.size; i++)
             data[i] = static_cast<uint8_t>(i);
     }
-    fbl::unique_ptr<mx_handle_t[]> handles;
+    fbl::unique_ptr<zx_handle_t[]> handles;
     if (test_args.handles)
-        handles.reset(new mx_handle_t[test_args.handles]);
+        handles.reset(new zx_handle_t[test_args.handles]);
 
     // Pre-queue |test_args.queue| messages (there'll always be this many messages in the queue).
     for (uint32_t i = 0; i < test_args.queue; i++) {
         duplicate_handles(test_args.handles, event, handles.get());
-        status = mx_channel_write(mp[0], 0u, data.get(), test_args.size,
+        status = zx_channel_write(mp[0], 0u, data.get(), test_args.size,
                                   handles.get(), test_args.handles);
-        assert(status == MX_OK);
+        assert(status == ZX_OK);
     }
 
     duplicate_handles(test_args.handles, event, handles.get());
 
     static constexpr uint32_t big_it_size = 10000;
     uint64_t big_its = 0;
-    uint64_t start_ns = mx_time_get(MX_CLOCK_MONOTONIC);
+    uint64_t start_ns = zx_time_get(ZX_CLOCK_MONOTONIC);
     uint64_t end_ns;
     for (;;) {
         big_its++;
         for (uint32_t i = 0; i < big_it_size; i++) {
-            status = mx_channel_write(mp[0], 0, data.get(), test_args.size,
+            status = zx_channel_write(mp[0], 0, data.get(), test_args.size,
                                       handles.get(), test_args.handles);
-            assert(status == MX_OK);
+            assert(status == ZX_OK);
 
             uint32_t r_size = test_args.size;
             uint32_t r_handles = test_args.handles;
-            status = mx_channel_read(mp[1], 0u, data.get(), handles.get(), r_size,
+            status = zx_channel_read(mp[1], 0u, data.get(), handles.get(), r_size,
                                      r_handles, &r_size, &r_handles);
-            assert(status == MX_OK);
+            assert(status == ZX_OK);
             assert(r_size == test_args.size);
             assert(r_handles == test_args.handles);
         }
 
-        end_ns = mx_time_get(MX_CLOCK_MONOTONIC);
+        end_ns = zx_time_get(ZX_CLOCK_MONOTONIC);
         if ((end_ns - start_ns) >= duration_ns)
             break;
     }
 
     for (uint32_t i = 0; i < test_args.handles; i++) {
-        status = mx_handle_close(handles[i]);
-        assert(status == MX_OK);
+        status = zx_handle_close(handles[i]);
+        assert(status == ZX_OK);
     }
-    status = mx_handle_close(event);
-    assert(status == MX_OK);
-    status = mx_handle_close(mp[0]);
-    assert(status == MX_OK);
-    status = mx_handle_close(mp[1]);
-    assert(status == MX_OK);
+    status = zx_handle_close(event);
+    assert(status == ZX_OK);
+    status = zx_handle_close(mp[0]);
+    assert(status == ZX_OK);
+    status = zx_handle_close(mp[1]);
+    assert(status == ZX_OK);
 
     double real_duration = static_cast<double>(end_ns - start_ns) / 1000000000.0;
     double its_per_second = static_cast<double>(big_its) * big_it_size / real_duration;
diff --git a/system/uapp/channel-perf/rules.mk b/system/uapp/channel-perf/rules.mk
index da90e84..6b42e58 100644
--- a/system/uapp/channel-perf/rules.mk
+++ b/system/uapp/channel-perf/rules.mk
@@ -12,7 +12,7 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/main.cpp \
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
-MODULE_STATIC_LIBS := system/ulib/mxcpp system/ulib/fbl
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
+MODULE_STATIC_LIBS := system/ulib/zxcpp system/ulib/fbl
 
 include make/module.mk
diff --git a/system/uapp/clock/clock.c b/system/uapp/clock/clock.c
index 3ef95e4..749c671 100644
--- a/system/uapp/clock/clock.c
+++ b/system/uapp/clock/clock.c
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/device/rtc.h>
+#include <zircon/device/rtc.h>
 
 #include <fcntl.h>
 #include <getopt.h>
diff --git a/system/uapp/clock/rules.mk b/system/uapp/clock/rules.mk
index 8649a9d..a7f1e28 100644
--- a/system/uapp/clock/rules.mk
+++ b/system/uapp/clock/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := clock
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/cmdutils/env.c b/system/uapp/cmdutils/env.c
index 8d964af..37c6962 100644
--- a/system/uapp/cmdutils/env.c
+++ b/system/uapp/cmdutils/env.c
@@ -8,8 +8,8 @@
 #include <string.h>
 
 #include <launchpad/launchpad.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 
 extern char** environ;
 
@@ -94,8 +94,8 @@
 
     // Execute utility
     launchpad_t* lp;
-    launchpad_create(MX_HANDLE_INVALID, argv[next_arg], &lp);
-    mx_status_t status = launchpad_load_from_file(lp, argv[next_arg]);
+    launchpad_create(ZX_HANDLE_INVALID, argv[next_arg], &lp);
+    zx_status_t status = launchpad_load_from_file(lp, argv[next_arg]);
     if (status < 0) {
         fprintf(stderr, "%s: Failed to load from '%s'\n", argv[0],
                 argv[next_arg]);
@@ -106,9 +106,9 @@
     int num_args = (argc - next_arg);
     launchpad_set_args(lp, num_args, (const char* const*) &argv[next_arg]);
     launchpad_set_environ(lp, envp);
-    launchpad_clone(lp, LP_CLONE_MXIO_NAMESPACE | LP_CLONE_MXIO_CWD |
-                        LP_CLONE_MXIO_STDIO);
-    mx_handle_t proc;
+    launchpad_clone(lp, LP_CLONE_FDIO_NAMESPACE | LP_CLONE_FDIO_CWD |
+                        LP_CLONE_FDIO_STDIO);
+    zx_handle_t proc;
     const char* errmsg;
     status = launchpad_go(lp, &proc, &errmsg);
     free(envp);
@@ -118,15 +118,15 @@
     }
 
     // Wait for utility to complete and return status
-    status = mx_object_wait_one (proc, MX_TASK_TERMINATED,
-                                 MX_TIME_INFINITE, NULL);
-    if (status != MX_OK) {
+    status = zx_object_wait_one (proc, ZX_TASK_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL);
+    if (status != ZX_OK) {
         fprintf(stderr, "%s: Failed during object_wait_one\n", argv[0]);
         return 123;
     }
-    mx_info_process_t proc_info;
-    if (mx_object_get_info(proc, MX_INFO_PROCESS, &proc_info,
-                           sizeof(proc_info), NULL, NULL) != MX_OK) {
+    zx_info_process_t proc_info;
+    if (zx_object_get_info(proc, ZX_INFO_PROCESS, &proc_info,
+                           sizeof(proc_info), NULL, NULL) != ZX_OK) {
         fprintf(stderr, "%s: Failed during object_get_info\n", argv[0]);
         return 122;
     }
diff --git a/system/uapp/cmdutils/rules.mk b/system/uapp/cmdutils/rules.mk
index fcf57bc..1d3af42 100644
--- a/system/uapp/cmdutils/rules.mk
+++ b/system/uapp/cmdutils/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_NAME := env
 
-MODULE_LIBS := system/ulib/magenta system/ulib/c system/ulib/launchpad
+MODULE_LIBS := system/ulib/zircon system/ulib/c system/ulib/launchpad
 
 include make/module.mk
diff --git a/system/uapp/crasher/cpp_specific.cpp b/system/uapp/crasher/cpp_specific.cpp
index cc8e68e..48dffd6 100644
--- a/system/uapp/crasher/cpp_specific.cpp
+++ b/system/uapp/crasher/cpp_specific.cpp
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <mxcpp/new.h>
+#include <zxcpp/new.h>
 
 // 512MB structure.
 struct BigStruct {
diff --git a/system/uapp/crasher/crasher.c b/system/uapp/crasher/crasher.c
index 2931e35..034f5d6 100644
--- a/system/uapp/crasher/crasher.c
+++ b/system/uapp/crasher/crasher.c
@@ -7,7 +7,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 // defined in cpp_specific.cpp.
 int cpp_out_of_mem(void);
@@ -102,7 +102,7 @@
         memset((void*)mem_alloc, 0xa5, 1024*1024);
         count++;
         if ((count % 128) == 0) {
-            mx_nanosleep(mx_deadline_after(MX_MSEC(250)));
+            zx_nanosleep(zx_deadline_after(ZX_MSEC(250)));
             write(1, ".", 1);
         }
     }
diff --git a/system/uapp/crasher/rules.mk b/system/uapp/crasher/rules.mk
index 01c9ed9..cfebdfb 100644
--- a/system/uapp/crasher/rules.mk
+++ b/system/uapp/crasher/rules.mk
@@ -15,8 +15,8 @@
 
 MODULE_NAME := crasher
 
-MODULE_LIBS := system/ulib/mxio system/ulib/c system/ulib/magenta
-MODULE_STATIC_LIBS := system/ulib/mxcpp
+MODULE_LIBS := system/ulib/fdio system/ulib/c system/ulib/zircon
+MODULE_STATIC_LIBS := system/ulib/zxcpp
 
 MODULE_COMPILEFLAGS := -fstack-protector-all
 
diff --git a/system/uapp/df/main.c b/system/uapp/df/main.c
index 0d1f9f1..49e32da 100644
--- a/system/uapp/df/main.c
+++ b/system/uapp/df/main.c
@@ -14,7 +14,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/device/vfs.h>
+#include <zircon/device/vfs.h>
 
 int usage(void) {
     fprintf(stderr, "usage: df [ <option>* ] [paths]\n");
diff --git a/system/uapp/df/rules.mk b/system/uapp/df/rules.mk
index 7c3b9d2..0f75cb7 100644
--- a/system/uapp/df/rules.mk
+++ b/system/uapp/df/rules.mk
@@ -16,8 +16,8 @@
     $(LOCAL_DIR)/main.c \
 
 MODULE_LIBS := \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/dlog/dlog.c b/system/uapp/dlog/dlog.c
index 9ece266..fd6d2ed 100644
--- a/system/uapp/dlog/dlog.c
+++ b/system/uapp/dlog/dlog.c
@@ -8,12 +8,12 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
 
 void usage(void) {
     fprintf(stderr,
-        "usage: dlog        dump the magenta debug log\n"
+        "usage: dlog        dump the zircon debug log\n"
         "\n"
         "options: -f        don't exit, keep waiting for new messages\n"
         "         -p <pid>  only show messages from specified pid\n"
@@ -26,8 +26,8 @@
     bool tail = false;
     bool filter_pid = false;
     bool plain = false;
-    mx_koid_t pid;
-    mx_handle_t h;
+    zx_koid_t pid;
+    zx_handle_t h;
 
     while (argc > 1) {
         if (!strcmp(argv[1], "-h")) {
@@ -59,18 +59,18 @@
         argv++;
     }
 
-    if (mx_log_create(MX_LOG_FLAG_READABLE, &h) < 0) {
+    if (zx_log_create(ZX_LOG_FLAG_READABLE, &h) < 0) {
         fprintf(stderr, "dlog: cannot open debug log\n");
         return -1;
     }
 
-    char buf[MX_LOG_RECORD_MAX];
-    mx_log_record_t* rec = (mx_log_record_t*)buf;
+    char buf[ZX_LOG_RECORD_MAX];
+    zx_log_record_t* rec = (zx_log_record_t*)buf;
     for (;;) {
-        mx_status_t status;
-        if ((status = mx_log_read(h, MX_LOG_RECORD_MAX, rec, 0)) < 0) {
-            if ((status == MX_ERR_SHOULD_WAIT) && tail) {
-                mx_object_wait_one(h, MX_LOG_READABLE, MX_TIME_INFINITE, NULL);
+        zx_status_t status;
+        if ((status = zx_log_read(h, ZX_LOG_RECORD_MAX, rec, 0)) < 0) {
+            if ((status == ZX_ERR_SHOULD_WAIT) && tail) {
+                zx_object_wait_one(h, ZX_LOG_READABLE, ZX_TIME_INFINITE, NULL);
                 continue;
             }
             break;
diff --git a/system/uapp/dlog/rules.mk b/system/uapp/dlog/rules.mk
index 378a36f..01cc018 100644
--- a/system/uapp/dlog/rules.mk
+++ b/system/uapp/dlog/rules.mk
@@ -13,6 +13,6 @@
 	$(LOCAL_DIR)/dlog.c
 
 MODULE_LIBS := \
-    system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/fixfs/main.c b/system/uapp/fixfs/main.c
index ec69814..210156b 100644
--- a/system/uapp/fixfs/main.c
+++ b/system/uapp/fixfs/main.c
@@ -10,9 +10,9 @@
 
 #include <fs-management/mount.h>
 #include <gpt/gpt.h>
-#include <magenta/device/block.h>
-#include <magenta/device/device.h>
-#include <magenta/device/vfs.h>
+#include <zircon/device/block.h>
+#include <zircon/device/device.h>
+#include <zircon/device/vfs.h>
 
 typedef union {
     vfs_query_info_t info;
@@ -38,7 +38,7 @@
         if (strcmp(wrapper.name, "memfs")) {
             return;
         }
-    } else if (mountfd != MX_ERR_INTERNAL) {
+    } else if (mountfd != ZX_ERR_INTERNAL) {
         printf("fixfs: couldn't open: %s %d\n", mount_path, mountfd);
         return;
     }
@@ -65,8 +65,8 @@
         return;
     }
 
-    mx_status_t status = mount(devfd, mount_path, disk_format, mount_options, launch_logs_async);
-    if (status != MX_OK) {
+    zx_status_t status = mount(devfd, mount_path, disk_format, mount_options, launch_logs_async);
+    if (status != ZX_OK) {
         fprintf(stderr, "fixfs: Error while mounting %s at %s: %d\n", device_path, mount_path, status);
     } else {
         printf("fixfs: Successfully mounted device %s at %s\n", device_path, mount_path);
@@ -156,7 +156,7 @@
         return;
     }
 
-    mx_status_t r;
+    zx_status_t r;
 
     fsck_options_t fsck_options = default_fsck_options;
     fsck_options.always_modify = true;
@@ -172,8 +172,8 @@
         return;
     }
 
-    mx_status_t status = mount(devfd, mount_path, DISK_FORMAT_FAT, mount_options, launch_logs_async);
-    if (status != MX_OK) {
+    zx_status_t status = mount(devfd, mount_path, DISK_FORMAT_FAT, mount_options, launch_logs_async);
+    if (status != ZX_OK) {
         fprintf(stderr, "fixfs: Error while mounting %s at %s: %d\n", device_path, mount_path, status);
     } else {
         printf("fixfs: Successfully mounted device %s at %s\n", device_path, mount_path);
@@ -182,7 +182,7 @@
     close(devfd);
 }
 
-mx_status_t process_block_device(const char* device_name) {
+zx_status_t process_block_device(const char* device_name) {
     char device_path[PATH_MAX];
     disk_format_t disk_format;
     mount_options_t mount_options;
@@ -193,7 +193,7 @@
 
     if (devfd < 0) {
         printf("fixfs: Error opening block device %s\n", device_path);
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     disk_format = detect_disk_format(devfd);
@@ -242,7 +242,7 @@
     }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // This will only reformat the first matching device found for a particular mount path
@@ -260,7 +260,7 @@
             continue;
         }
 
-        if (process_block_device(de->d_name) != MX_OK) {
+        if (process_block_device(de->d_name) != ZX_OK) {
             return -1;
         }
     }
diff --git a/system/uapp/fixfs/rules.mk b/system/uapp/fixfs/rules.mk
index 1abafc6..34a98cd 100644
--- a/system/uapp/fixfs/rules.mk
+++ b/system/uapp/fixfs/rules.mk
@@ -20,8 +20,8 @@
 
 MODULE_LIBS := \
     system/ulib/fs-management \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/uapp/fs-fsck/main.c b/system/uapp/fs-fsck/main.c
index a8a82da..7ccfc19 100644
--- a/system/uapp/fs-fsck/main.c
+++ b/system/uapp/fs-fsck/main.c
@@ -13,10 +13,10 @@
 #include <unistd.h>
 
 #include <fs-management/mount.h>
-#include <magenta/compiler.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/util.h>
+#include <zircon/compiler.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/util.h>
 
 struct {
     const char* name;
diff --git a/system/uapp/fs-fsck/rules.mk b/system/uapp/fs-fsck/rules.mk
index 830cf99..81a37e2 100644
--- a/system/uapp/fs-fsck/rules.mk
+++ b/system/uapp/fs-fsck/rules.mk
@@ -17,8 +17,8 @@
 
 MODULE_LIBS := \
     system/ulib/fs-management \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/uapp/fs-mkfs/main.c b/system/uapp/fs-mkfs/main.c
index ef009af..3891b50 100644
--- a/system/uapp/fs-mkfs/main.c
+++ b/system/uapp/fs-mkfs/main.c
@@ -13,10 +13,10 @@
 #include <unistd.h>
 
 #include <fs-management/mount.h>
-#include <magenta/compiler.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/util.h>
+#include <zircon/compiler.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/util.h>
 
 struct {
     const char* name;
diff --git a/system/uapp/fs-mkfs/rules.mk b/system/uapp/fs-mkfs/rules.mk
index f6f6382..2a2c760 100644
--- a/system/uapp/fs-mkfs/rules.mk
+++ b/system/uapp/fs-mkfs/rules.mk
@@ -17,8 +17,8 @@
 
 MODULE_LIBS := \
     system/ulib/fs-management \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/uapp/fs-mount/main.c b/system/uapp/fs-mount/main.c
index 175627e..11e3da1 100644
--- a/system/uapp/fs-mount/main.c
+++ b/system/uapp/fs-mount/main.c
@@ -13,9 +13,9 @@
 #include <unistd.h>
 
 #include <fs-management/mount.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/util.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/util.h>
 
 
 int usage(void) {
@@ -65,8 +65,8 @@
         return -1;
     }
     disk_format_t df = detect_disk_format(fd);
-    mx_status_t status = mount(fd, mountpath, df, &options, launch_logs_async);
-    if (status != MX_OK) {
+    zx_status_t status = mount(fd, mountpath, df, &options, launch_logs_async);
+    if (status != ZX_OK) {
         fprintf(stderr, "fs_mount: Error while mounting: %d\n", status);
     }
     return status;
diff --git a/system/uapp/fs-mount/rules.mk b/system/uapp/fs-mount/rules.mk
index 1d0c8ee..46cc9ee 100644
--- a/system/uapp/fs-mount/rules.mk
+++ b/system/uapp/fs-mount/rules.mk
@@ -17,8 +17,8 @@
 
 MODULE_LIBS := \
     system/ulib/fs-management \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/fs-umount/main.c b/system/uapp/fs-umount/main.c
index 0c3ccea..9dcf1c9 100644
--- a/system/uapp/fs-umount/main.c
+++ b/system/uapp/fs-umount/main.c
@@ -14,7 +14,7 @@
 #include <unistd.h>
 
 #include <fs-management/mount.h>
-#include <magenta/device/vfs.h>
+#include <zircon/device/vfs.h>
 
 bool verbose = false;
 
diff --git a/system/uapp/fs-umount/rules.mk b/system/uapp/fs-umount/rules.mk
index 959f60d..6639ef4 100644
--- a/system/uapp/fs-umount/rules.mk
+++ b/system/uapp/fs-umount/rules.mk
@@ -15,6 +15,6 @@
 MODULE_SRCS := \
     $(LOCAL_DIR)/main.c \
 
-MODULE_LIBS := system/ulib/fs-management system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/fs-management system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/gfxfractal/main.c b/system/uapp/gfxfractal/main.c
index 1f50f6c..17fd944 100644
--- a/system/uapp/gfxfractal/main.c
+++ b/system/uapp/gfxfractal/main.c
@@ -10,10 +10,10 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/device/display.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/device/display.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #include <gfx/gfx.h>
 
@@ -31,8 +31,8 @@
 
     size_t size = fb.info.stride * fb.info.pixelsize * fb.info.height;
     uintptr_t fbo;
-    mx_status_t status = mx_vmar_map(mx_vmar_root_self(), 0, fb.vmo, 0, size,
-                                     MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &fbo);
+    zx_status_t status = zx_vmar_map(zx_vmar_root_self(), 0, fb.vmo, 0, size,
+                                     ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &fbo);
     if (status < 0) {
         printf("failed to map fb (%d)\n", status);
         return -1;
@@ -97,7 +97,7 @@
         }
     }
     ioctl_display_flush_fb(vfd);
-    mx_nanosleep(mx_deadline_after(MX_SEC(10)));
+    zx_nanosleep(zx_deadline_after(ZX_SEC(10)));
 
     gfx_surface_destroy(gfx);
     close(vfd);
diff --git a/system/uapp/gfxfractal/rules.mk b/system/uapp/gfxfractal/rules.mk
index c96b4ca..d5bde39 100644
--- a/system/uapp/gfxfractal/rules.mk
+++ b/system/uapp/gfxfractal/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/gfx
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/gfxtest/main.c b/system/uapp/gfxtest/main.c
index 1a26e90..f9de392 100644
--- a/system/uapp/gfxtest/main.c
+++ b/system/uapp/gfxtest/main.c
@@ -9,10 +9,10 @@
 #include <errno.h>
 #include <string.h>
 
-#include <magenta/device/display.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/device/display.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #include <gfx/gfx.h>
 
@@ -30,8 +30,8 @@
 
     size_t size = fb.info.stride * fb.info.pixelsize * fb.info.height;
     uintptr_t fbo;
-    mx_status_t status = mx_vmar_map(mx_vmar_root_self(), 0, fb.vmo, 0, size,
-                                     MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &fbo);
+    zx_status_t status = zx_vmar_map(zx_vmar_root_self(), 0, fb.vmo, 0, size,
+                                     ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &fbo);
     if (status < 0) {
         printf("failed to map fb (%d)\n", status);
         return -1;
@@ -48,7 +48,7 @@
     int d = gfx->height / 5;
     int i = 10;
     while (i--) {
-        mx_nanosleep(mx_deadline_after(MX_SEC(1)));
+        zx_nanosleep(zx_deadline_after(ZX_SEC(1)));
         gfx_fillrect(gfx, (gfx->width - d) / 2, (gfx->height - d) / 2, d, d, i % 2 ? 0xff55ff55 : 0xffaa00aa);
         ioctl_display_flush_fb(vfd);
     }
diff --git a/system/uapp/gfxtest/rules.mk b/system/uapp/gfxtest/rules.mk
index c96b4ca..d5bde39 100644
--- a/system/uapp/gfxtest/rules.mk
+++ b/system/uapp/gfxtest/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/gfx
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/gpt/gpt.c b/system/uapp/gpt/gpt.c
index aec1cd5..28a63e1 100644
--- a/system/uapp/gpt/gpt.c
+++ b/system/uapp/gpt/gpt.c
@@ -5,8 +5,8 @@
 #include <getopt.h>
 #include <gpt/cros.h>
 #include <gpt/gpt.h>
-#include <magenta/device/block.h>
-#include <magenta/syscalls.h> // for mx_cprng_draw
+#include <zircon/device/block.h>
+#include <zircon/syscalls.h> // for zx_cprng_draw
 #include <ctype.h>
 #include <inttypes.h>
 #include <stdio.h>
@@ -213,7 +213,7 @@
     close(fd);
 }
 
-static mx_status_t commit(gpt_device_t* gpt, int fd, const char* dev) {
+static zx_status_t commit(gpt_device_t* gpt, int fd, const char* dev) {
     if (confirm_writes) {
         dump(gpt, NULL);
         printf("\n");
@@ -229,7 +229,7 @@
             case 'N':
             case 27:
                 close(fd);
-                return MX_OK;
+                return ZX_OK;
             }
         }
     }
@@ -238,12 +238,12 @@
     int rc = gpt_device_sync(gpt);
     if (rc) {
         printf("Error: GPT device sync failed.\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     rc = ioctl_block_rr_part(fd);
     if (rc) {
         printf("Error: GPT updated but device could not be rebound. Please reboot.\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     printf("GPT changes complete.\n");
     return 0;
@@ -264,7 +264,7 @@
 static void add_partition(const char* dev, uint64_t start, uint64_t end, const char* name) {
     uint8_t guid[GPT_GUID_LEN];
     size_t sz;
-    if (mx_cprng_draw(guid, GPT_GUID_LEN, &sz) != MX_OK)
+    if (zx_cprng_draw(guid, GPT_GUID_LEN, &sz) != ZX_OK)
         return;
 
     int fd;
@@ -405,35 +405,35 @@
 /*
  * Give a path to a block device and a partition index into a GPT, load the GPT
  * information into memory and find the requested partition. This does all the
- * bounds and other error checking. If MX_OK is returned, the out parameters
- * will be set to valid values. If MX_OK is returned, the caller should close
+ * bounds and other error checking. If ZX_OK is returned, the out parameters
+ * will be set to valid values. If ZX_OK is returned, the caller should close
  * fd_out after it is done using the GPT information.
  */
-static mx_status_t get_gpt_and_part(char* path_device, long idx_part,
+static zx_status_t get_gpt_and_part(char* path_device, long idx_part,
                                     int* fd_out,
                                     gpt_device_t** gpt_out,
                                     gpt_partition_t** part_out) {
     if (idx_part < 0 || idx_part >= PARTITIONS_COUNT) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     int fd = -1;
     gpt_device_t* gpt = init(path_device, &fd);
     if (gpt == NULL) {
         tear_down_gpt(fd, gpt);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     gpt_partition_t* part = gpt->partitions[idx_part];
     if (part == NULL) {
         tear_down_gpt(fd, gpt);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     *gpt_out = gpt;
     *part_out = part;
     *fd_out = fd;
-    return MX_OK;
+    return ZX_OK;
 }
 
 /*
@@ -476,7 +476,7 @@
     return false;
 }
 
-static mx_status_t adjust_partition(char* dev, int idx_part,
+static zx_status_t adjust_partition(char* dev, int idx_part,
                                     uint64_t start, uint64_t end) {
     gpt_device_t* gpt = NULL;
     gpt_partition_t* part = NULL;
@@ -486,8 +486,8 @@
         fprintf(stderr, "partition #%d would end before it started\n", idx_part);
     }
 
-    mx_status_t rc = get_gpt_and_part(dev, idx_part, &fd, &gpt, &part);
-    if (rc != MX_OK) {
+    zx_status_t rc = get_gpt_and_part(dev, idx_part, &fd, &gpt, &part);
+    if (rc != ZX_OK) {
         return rc;
     }
 
@@ -534,7 +534,7 @@
  * string/human-readable form of the GUID and should be 36 characters plus a
  * null terminator.
  */
-static mx_status_t edit_partition(char* dev, long idx_part,
+static zx_status_t edit_partition(char* dev, long idx_part,
                                   char* type_or_id, char* guid) {
     gpt_device_t* gpt = NULL;
     gpt_partition_t* part = NULL;
@@ -548,17 +548,17 @@
     } else if (!strcmp(type_or_id, "id")) {
         set_type = false;
     } else {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     uint8_t guid_bytes[GPT_GUID_LEN];
     if (!expand_special(guid, guid_bytes) && !parse_guid(guid, guid_bytes)) {
         printf("GUID could not be parsed.\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t rc = get_gpt_and_part(dev, idx_part, &fd, &gpt, &part);
-    if (rc != MX_OK) {
+    zx_status_t rc = get_gpt_and_part(dev, idx_part, &fd, &gpt, &part);
+    if (rc != ZX_OK) {
         return rc;
     }
 
@@ -578,7 +578,7 @@
  *
  * argv/argc should correspond only to the arguments after the command.
  */
-static mx_status_t edit_cros_partition(char* const * argv, int argc) {
+static zx_status_t edit_cros_partition(char* const * argv, int argc) {
     gpt_device_t* gpt = NULL;
     gpt_partition_t* part = NULL;
     int fd = -1;
@@ -587,7 +587,7 @@
     long idx_part = strtol(argv[0], &end, 10);
     if (*end != 0 || argv[0][0] == 0) {
         print_usage();
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Use -1 as a sentinel for "not changing"
@@ -646,28 +646,28 @@
 
     char* dev = argv[optind];
 
-    mx_status_t rc = get_gpt_and_part(dev, idx_part, &fd, &gpt, &part);
-    if (rc != MX_OK) {
+    zx_status_t rc = get_gpt_and_part(dev, idx_part, &fd, &gpt, &part);
+    if (rc != ZX_OK) {
         return rc;
     }
 
     if (!gpt_cros_is_kernel_guid(part->type, GPT_GUID_LEN)) {
         printf("Partition is not a CrOS kernel partition\n");
-        rc = MX_ERR_INVALID_ARGS;
+        rc = ZX_ERR_INVALID_ARGS;
         goto cleanup;
     }
 
     if (tries >= 0) {
         if (gpt_cros_attr_set_tries(&part->flags, tries) < 0) {
             printf("Failed to set tries\n");
-            rc = MX_ERR_INVALID_ARGS;
+            rc = ZX_ERR_INVALID_ARGS;
             goto cleanup;
         }
     }
     if (priority >= 0) {
         if (gpt_cros_attr_set_priority(&part->flags, priority) < 0) {
             printf("Failed to set priority\n");
-            rc = MX_ERR_INVALID_ARGS;
+            rc = ZX_ERR_INVALID_ARGS;
             goto cleanup;
         }
     }
@@ -681,7 +681,7 @@
     return rc;
 usage:
     print_usage();
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
 
 /*
@@ -689,13 +689,13 @@
  * partition is set as hidden, the firmware will not attempt to boot from the
  * partition.
  */
-static mx_status_t set_visibility(char* dev, long idx_part, bool visible) {
+static zx_status_t set_visibility(char* dev, long idx_part, bool visible) {
     gpt_device_t* gpt = NULL;
     gpt_partition_t* part = NULL;
     int fd = -1;
 
-    mx_status_t rc = get_gpt_and_part(dev, idx_part, &fd, &gpt, &part);
-    if (rc != MX_OK) {
+    zx_status_t rc = get_gpt_and_part(dev, idx_part, &fd, &gpt, &part);
+    if (rc != ZX_OK) {
         return rc;
     }
 
@@ -838,7 +838,7 @@
 
       uint8_t guid[GPT_GUID_LEN];
       size_t sz;
-      if (mx_cprng_draw(guid, GPT_GUID_LEN, &sz) != MX_OK) {
+      if (zx_cprng_draw(guid, GPT_GUID_LEN, &sz) != ZX_OK) {
         printf("rand read error\n");
         rc = 255;
         goto repartition_end;
diff --git a/system/uapp/gpt/rules.mk b/system/uapp/gpt/rules.mk
index 4020328..d783e61 100644
--- a/system/uapp/gpt/rules.mk
+++ b/system/uapp/gpt/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/gpt third_party/ulib/cksum
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/guest-autorun/main.c b/system/uapp/guest-autorun/main.c
index a815afb..c975507 100644
--- a/system/uapp/guest-autorun/main.c
+++ b/system/uapp/guest-autorun/main.c
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 const char path[] = "/dev/class/block/000";
 uint8_t buf[PAGE_SIZE];
@@ -16,8 +16,8 @@
 int main(int argc, char** argv) {
     int fd;
     while ((fd = open(path, O_RDWR)) < 0) {
-        mx_status_t status = mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
-        if (status != MX_OK) {
+        zx_status_t status = zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
+        if (status != ZX_OK) {
             fprintf(stderr, "Failed to sleep %d\n", status);
             return status;
         }
@@ -26,15 +26,15 @@
     int ret = read(fd, buf, PAGE_SIZE);
     if (ret != PAGE_SIZE) {
         fprintf(stderr, "Failed to read a page from \"%s\"\n", path);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     ret = write(fd, buf, PAGE_SIZE);
     if (ret != PAGE_SIZE) {
         fprintf(stderr, "Failed to write a page to \"%s\"\n", path);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     fprintf(stderr, "Completed transactions on \"%s\"\n", path);
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/uapp/guest-autorun/rules.mk b/system/uapp/guest-autorun/rules.mk
index e2b5eca2..00693fa 100644
--- a/system/uapp/guest-autorun/rules.mk
+++ b/system/uapp/guest-autorun/rules.mk
@@ -14,7 +14,7 @@
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/uapp/guest/guest.cpp b/system/uapp/guest/guest.cpp
index 8312fbd..3c2d007 100644
--- a/system/uapp/guest/guest.cpp
+++ b/system/uapp/guest/guest.cpp
@@ -20,22 +20,22 @@
 #include <hypervisor/pci.h>
 #include <hypervisor/uart.h>
 #include <hypervisor/vcpu.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/hypervisor.h>
 #include <fbl/unique_ptr.h>
 #include <virtio/balloon.h>
 
 #include "linux.h"
-#include "magenta.h"
+#include "zircon.h"
 
 static const uint64_t kVmoSize = 1u << 30;
-static const uint32_t kMapFlags = MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE;
+static const uint32_t kMapFlags = ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE;
 
 /* Unused memory above this threshold may be reclaimed by the balloon. */
 static uint32_t balloon_threshold_pages = 1024;
 
-static mx_status_t usage(const char* cmd) {
+static zx_status_t usage(const char* cmd) {
     fprintf(stderr, "usage: %s [OPTIONS] kernel.bin\n", cmd);
     fprintf(stderr, "\n");
     fprintf(stderr, "OPTIONS:\n");
@@ -49,14 +49,14 @@
                     "\t                   retain. Has no effect unless -m is also used.\n");
     fprintf(stderr, "\t-d                 Demand-page balloon deflate requests.\n");
     fprintf(stderr, "\n");
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
 
-static mx_status_t create_vmo(uint64_t size, uintptr_t* addr, mx_handle_t* vmo) {
-    mx_status_t status = mx_vmo_create(size, 0, vmo);
-    if (status != MX_OK)
+static zx_status_t create_vmo(uint64_t size, uintptr_t* addr, zx_handle_t* vmo) {
+    zx_status_t status = zx_vmo_create(size, 0, vmo);
+    if (status != ZX_OK)
         return status;
-    return mx_vmar_map(mx_vmar_root_self(), 0, *vmo, 0, size, kMapFlags, addr);
+    return zx_vmar_map(zx_vmar_root_self(), 0, *vmo, 0, size, kMapFlags, addr);
 }
 
 static void balloon_stats_handler(const virtio_balloon_stat_t* stats, size_t len, void* ctx) {
@@ -76,8 +76,8 @@
 
         printf("virtio-balloon: adjusting target pages %#x -> %#x.\n",
                current_pages, target_pages);
-        mx_status_t status = balloon_update_num_pages(balloon, target_pages);
-        if (status != MX_OK)
+        zx_status_t status = balloon_update_num_pages(balloon, target_pages);
+        if (status != ZX_OK)
             fprintf(stderr, "Error %d updating balloon size.\n", status);
         return;
     }
@@ -85,19 +85,19 @@
 
 typedef struct balloon_task_args {
     balloon_t* balloon;
-    mx_duration_t interval;
+    zx_duration_t interval;
 } balloon_task_args_t;
 
 static int balloon_stats_task(void* ctx) {
     fbl::unique_ptr<balloon_task_args_t> args(static_cast<balloon_task_args_t*>(ctx));
     while (true) {
-        mx_nanosleep(mx_deadline_after(args->interval));
+        zx_nanosleep(zx_deadline_after(args->interval));
         balloon_request_stats(args->balloon, &balloon_stats_handler, args->balloon);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t poll_balloon_stats(balloon_t* balloon, mx_duration_t interval) {
+static zx_status_t poll_balloon_stats(balloon_t* balloon, zx_duration_t interval) {
     thrd_t thread;
     auto args = new balloon_task_args_t{balloon, interval};
 
@@ -105,16 +105,16 @@
     if (ret != thrd_success) {
         fprintf(stderr, "Failed to create balloon thread %d\n", ret);
         delete args;
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     ret = thrd_detach(thread);
     if (ret != thrd_success) {
         fprintf(stderr, "Failed to detach balloon thread %d\n", ret);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 int main(int argc, char** argv) {
@@ -122,7 +122,7 @@
     const char* block_path = NULL;
     const char* ramdisk_path = NULL;
     const char* cmdline = NULL;
-    mx_duration_t balloon_poll_interval = 0;
+    zx_duration_t balloon_poll_interval = 0;
     bool balloon_deflate_on_demand = false;
     int opt;
     while ((opt = getopt(argc, argv, "b:r:c:m:dp:")) != -1) {
@@ -137,11 +137,11 @@
             cmdline = optarg;
             break;
         case 'm':
-            balloon_poll_interval = MX_SEC(strtoul(optarg, nullptr, 10));
+            balloon_poll_interval = ZX_SEC(strtoul(optarg, nullptr, 10));
             if (balloon_poll_interval <= 0) {
                 fprintf(stderr, "Invalid balloon interval %s. Must be an integer greater than 0\n",
                         optarg);
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
             break;
         case 'd':
@@ -152,7 +152,7 @@
             if (balloon_threshold_pages <= 0) {
                 fprintf(stderr, "Invalid balloon threshold %s. Must be an integer greater than 0\n",
                         optarg);
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
             break;
         default:
@@ -165,37 +165,37 @@
     argv += optind;
 
     uintptr_t addr;
-    mx_handle_t physmem_vmo;
-    mx_status_t status = create_vmo(kVmoSize, &addr, &physmem_vmo);
-    if (status != MX_OK) {
+    zx_handle_t physmem_vmo;
+    zx_status_t status = create_vmo(kVmoSize, &addr, &physmem_vmo);
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create guest physical memory\n");
         return status;
     }
 
-    mx_handle_t resource;
+    zx_handle_t resource;
     status = guest_get_resource(&resource);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to get resource\n");
         return status;
     }
 
-    mx_handle_t guest;
-    status = mx_guest_create(resource, 0, physmem_vmo, &guest);
-    if (status != MX_OK) {
+    zx_handle_t guest;
+    status = zx_guest_create(resource, 0, physmem_vmo, &guest);
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create guest\n");
         return status;
     }
-    mx_handle_close(resource);
+    zx_handle_close(resource);
 
     uintptr_t pt_end_off;
     status = guest_create_page_table(addr, kVmoSize, &pt_end_off);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create page table\n");
         return status;
     }
 
     status = guest_create_acpi_table(addr, kVmoSize, pt_end_off);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create ACPI table\n");
         return status;
     }
@@ -204,7 +204,7 @@
     int fd = open(argv[0], O_RDONLY);
     if (fd < 0) {
         fprintf(stderr, "Failed to open kernel image \"%s\"\n", argv[0]);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     // Load the first page in to allow OS detection without requiring
@@ -213,29 +213,29 @@
     ssize_t ret = read(fd, (void*)first_page, PAGE_SIZE);
     if (ret != PAGE_SIZE) {
         fprintf(stderr, "Failed to read first page of kernel\n");
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     uintptr_t guest_ip;
     uintptr_t bootdata_off = 0;
 
     char guest_cmdline[PATH_MAX];
-    const char* magenta_fmt_string = "TERM=uart %s";
-    snprintf(guest_cmdline, PATH_MAX, magenta_fmt_string, cmdline ? cmdline : "");
-    status = setup_magenta(addr, kVmoSize, first_page, pt_end_off, fd, ramdisk_path,
+    const char* zircon_fmt_string = "TERM=uart %s";
+    snprintf(guest_cmdline, PATH_MAX, zircon_fmt_string, cmdline ? cmdline : "");
+    status = setup_zircon(addr, kVmoSize, first_page, pt_end_off, fd, ramdisk_path,
                            guest_cmdline, &guest_ip, &bootdata_off);
 
-    if (status == MX_ERR_NOT_SUPPORTED) {
+    if (status == ZX_ERR_NOT_SUPPORTED) {
         const char* linux_fmt_string = "earlyprintk=serial,ttyS,115200 console=ttyS0,115200 "
                                        "io_delay=none acpi_rsdp=%#lx %s";
         snprintf(guest_cmdline, PATH_MAX, linux_fmt_string, pt_end_off, cmdline ? cmdline : "");
         status = setup_linux(addr, kVmoSize, first_page, fd, ramdisk_path, guest_cmdline, &guest_ip,
                              &bootdata_off);
     }
-    if (status == MX_ERR_NOT_SUPPORTED) {
+    if (status == ZX_ERR_NOT_SUPPORTED) {
         fprintf(stderr, "Unknown kernel\n");
         return status;
-    } else if (status != MX_OK) {
+    } else if (status != ZX_OK) {
         fprintf(stderr, "Failed to load kernel\n");
         return status;
     }
@@ -243,24 +243,24 @@
 
 #if __x86_64__
     uintptr_t apic_addr;
-    mx_handle_t apic_vmo;
+    zx_handle_t apic_vmo;
     status = create_vmo(PAGE_SIZE, &apic_addr, &apic_vmo);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create VCPU local APIC memory\n");
         return status;
     }
 #endif // __x86_64__
 
-    mx_vcpu_create_args_t args = {
+    zx_vcpu_create_args_t args = {
         guest_ip,
 #if __x86_64__
         0 /* cr3 */,
         apic_vmo,
 #endif // __x86_64__
     };
-    mx_handle_t vcpu;
-    status = mx_vcpu_create(guest, 0, &args, &vcpu);
-    if (status != MX_OK) {
+    zx_handle_t vcpu;
+    status = zx_vcpu_create(guest, 0, &args, &vcpu);
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create VCPU\n");
         return status;
     }
@@ -279,7 +279,7 @@
     pci_bus_t bus;
     guest_ctx.bus = &bus;
     status = pci_bus_init(&bus, &io_apic);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create PCI bus.\n");
         return status;
     }
@@ -288,7 +288,7 @@
     guest_ctx.uart = &uart;
     uart_init(&uart, &io_apic);
     status = uart_async(&uart, guest);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Setup block device.
@@ -296,15 +296,15 @@
     pci_device_t* virtio_block = &block.virtio_device.pci_device;
     if (block_path != NULL) {
         status = block_init(&block, block_path, addr, kVmoSize);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
 
         status = pci_bus_connect(&bus, virtio_block, PCI_DEVICE_VIRTIO_BLOCK);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
 
         status = pci_device_async(virtio_block, guest);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
     }
     // Setup memory balloon.
@@ -313,10 +313,10 @@
     balloon.deflate_on_demand = balloon_deflate_on_demand;
     status = pci_bus_connect(&bus, &balloon.virtio_device.pci_device,
                              PCI_DEVICE_VIRTIO_BALLOON);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     status = pci_device_async(&balloon.virtio_device.pci_device, guest);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     if (balloon_poll_interval > 0)
         poll_balloon_stats(&balloon, balloon_poll_interval);
@@ -331,18 +331,18 @@
     // Setup Local APIC.
     vcpu_ctx.local_apic.vcpu = vcpu;
     status = io_apic_register_local_apic(&io_apic, 0, &vcpu_ctx.local_apic);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to register Local APIC with IO APIC.\n");
         return status;
     }
 
-    mx_vcpu_state_t vcpu_state;
+    zx_vcpu_state_t vcpu_state;
     memset(&vcpu_state, 0, sizeof(vcpu_state));
 #if __x86_64__
     vcpu_state.rsi = bootdata_off;
 #endif // __x86_64__
-    status = mx_vcpu_write_state(vcpu, MX_VCPU_STATE, &vcpu_state, sizeof(vcpu_state));
-    if (status != MX_OK) {
+    status = zx_vcpu_write_state(vcpu, ZX_VCPU_STATE, &vcpu_state, sizeof(vcpu_state));
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to write VCPU state\n");
         return status;
     }
diff --git a/system/uapp/guest/linux.cpp b/system/uapp/guest/linux.cpp
index d26ecf2..9f6bb57 100644
--- a/system/uapp/guest/linux.cpp
+++ b/system/uapp/guest/linux.cpp
@@ -72,16 +72,16 @@
            ZP32(zero_page, ZP_SH_32_HEADER) == HEADER_MAGIC;
 }
 
-mx_status_t setup_linux(const uintptr_t addr, const size_t size, const uintptr_t first_page,
+zx_status_t setup_linux(const uintptr_t addr, const size_t size, const uintptr_t first_page,
                         const int fd, const char* initrd_path, const char* cmdline,
                         uintptr_t* guest_ip, uintptr_t* zero_page_addr) {
     if (!is_linux(first_page))
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     bool has_legacy_entry = ZP16(first_page, ZP_SH_16_XLOADFLAGS) & XLF_KERNEL_64;
     if (!has_legacy_entry) {
         fprintf(stderr, "Kernel lacks the legacy 64-bit entry point\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     uint16_t protocol = ZP16(first_page, ZP_SH_16_VERSION);
@@ -89,7 +89,7 @@
     bool is_bzimage = (protocol >= MIN_BOOT_PROTOCOL) && (loadflags & LF_LOAD_HIGH);
     if (!is_bzimage) {
         fprintf(stderr, "Kernel is not a bzImage. Use a newer kernel\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Default to the preferred address, then change if we're relocatable
@@ -111,7 +111,7 @@
     uintptr_t cmdline_off = boot_params_off - cmdline_len;
     if (cmdline_off > UINT32_MAX) {
         fprintf(stderr, "Command line offset is outside of 32-bit range\n");
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     memcpy((char*)(addr + cmdline_off), cmdline, cmdline_len);
     ZP32(zero_page, ZP_SH_32_COMMAND_LINE) = static_cast<uint32_t>(cmdline_off);
@@ -128,13 +128,13 @@
     size_t e820_entries = guest_e820_size(size) / sizeof(e820entry_t);
     if (e820_entries > MAX_E820_ENTRIES) {
         fprintf(stderr, "Not enough space for e820 memory map\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     ZP8(zero_page, ZP_SH_8_E820_COUNT) = static_cast<uint8_t>(e820_entries);
 
     uintptr_t e820_off = boot_params_off + ZP_SH_XX_E820_MAP;
-    mx_status_t status = guest_create_e820(addr, size, e820_off);
-    if (status != MX_OK) {
+    zx_status_t status = guest_create_e820(addr, size, e820_off);
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create the e820 memory map\n");
         return status;
     }
@@ -150,14 +150,14 @@
     off_t ret = lseek(fd, protected_mode_off, SEEK_SET);
     if (ret < 0) {
         fprintf(stderr, "Failed seek to protected mode kernel\n");
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     size_t remaining = ZP32(zero_page, ZP_SH_32_SYSSIZE) << 4;
     ret = read(fd, (void*)(addr + runtime_start), remaining);
     if ((size_t)ret != remaining) {
         fprintf(stderr, "Failed to read Linux kernel data\n");
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     if (initrd_path) {
@@ -165,28 +165,28 @@
         int initrd_fd = open(initrd_path, O_RDONLY);
         if (initrd_fd < 0) {
             fprintf(stderr, "Failed to open initial RAM disk\n");
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
         struct stat initrd_stat;
         off_t ret = fstat(initrd_fd, &initrd_stat);
         if (ret < 0) {
             fprintf(stderr, "Failed to stat initial RAM disk\n");
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
         if (initrd_stat.st_size > UINT32_MAX ||
             static_cast<size_t>(initrd_stat.st_size) > size - kInitrdOffset) {
             fprintf(stderr, "Initial RAM disk is too large\n");
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         }
         ZP32(zero_page, ZP_SH_32_RAMDISK_SIZE) = static_cast<uint32_t>(initrd_stat.st_size);
         ret = read(initrd_fd, (void*)(addr + kInitrdOffset), initrd_stat.st_size);
         if (ret != initrd_stat.st_size) {
             fprintf(stderr, "Failed to read initial RAM disk\n");
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
     }
 
     *guest_ip = runtime_start + LEGACY_64_ENTRY_OFFSET;
     *zero_page_addr = boot_params_off;
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/uapp/guest/linux.h b/system/uapp/guest/linux.h
index c2e8a97..e7d2ec1 100644
--- a/system/uapp/guest/linux.h
+++ b/system/uapp/guest/linux.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
-mx_status_t setup_linux(const uintptr_t addr, const size_t size, const uintptr_t first_page,
+zx_status_t setup_linux(const uintptr_t addr, const size_t size, const uintptr_t first_page,
                         const int fd, const char* initrd_path, const char* cmdline,
                         uintptr_t* guest_ip, uintptr_t* zero_page);
diff --git a/system/uapp/guest/rules.mk b/system/uapp/guest/rules.mk
index 1d3f218..822e60e 100644
--- a/system/uapp/guest/rules.mk
+++ b/system/uapp/guest/rules.mk
@@ -12,16 +12,16 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/guest.cpp \
     $(LOCAL_DIR)/linux.cpp \
-    $(LOCAL_DIR)/magenta.cpp \
+    $(LOCAL_DIR)/zircon.cpp \
 
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/hypervisor \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/virtio \
 
diff --git a/system/uapp/guest/scripts/mkbootfs.sh b/system/uapp/guest/scripts/mkbootfs.sh
index 4d363c2..019721c 100755
--- a/system/uapp/guest/scripts/mkbootfs.sh
+++ b/system/uapp/guest/scripts/mkbootfs.sh
@@ -7,17 +7,17 @@
 # https://opensource.org/licenses/MIT
 
 GUEST_SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-MAGENTADIR="${MAGENTA_DIR:-${GUEST_SCRIPTS_DIR}/../../../..}"
-FUCHSIADIR="${FUCHSIA_DIR:-${MAGENTADIR}/..}"
-BUILDDIR="${MAGENTA_BUILD_DIR:-$MAGENTADIR/build-magenta-pc-x86-64}"
+ZIRCONDIR="${ZIRCON_DIR:-${GUEST_SCRIPTS_DIR}/../../../..}"
+FUCHSIADIR="${FUCHSIA_DIR:-${ZIRCONDIR}/..}"
+BUILDDIR="${ZIRCON_BUILD_DIR:-$ZIRCONDIR/build-zircon-pc-x86-64}"
 
 usage() {
     echo "usage: ${0} [options]"
     echo ""
     echo "    -f                        Build a Fuchsia host image."
-    echo "    -m magenta.bin            Magenta kernel."
-    echo "    -b bootdata.bin           Magenta bootdata."
-    echo "    -g magenta.gpt            Magenta GPT disk image."
+    echo "    -m zircon.bin            Zircon kernel."
+    echo "    -b bootdata.bin           Zircon bootdata."
+    echo "    -g zircon.gpt            Zircon GPT disk image."
     echo "    -l bzImage                Linux kernel."
     echo "    -i initrd                 Linux initrd."
     echo "    -r rootfs.ext2            Linux EXT2 root filesystem image."
@@ -25,9 +25,9 @@
     exit 1
 }
 
-declare MAGENTA="$BUILDDIR/magenta.bin"
+declare ZIRCON="$BUILDDIR/zircon.bin"
 declare BOOTDATA="$BUILDDIR/bootdata.bin"
-declare MAGENTA_DISK="$BUILDDIR/magenta.gpt"
+declare ZIRCON_DISK="$BUILDDIR/zircon.gpt"
 declare BZIMAGE="/tmp/linux/arch/x86/boot/bzImage"
 declare INITRD="/tmp/toybox/initrd.gz"
 declare ROOTFS="/tmp/toybox/rootfs.ext2"
@@ -35,9 +35,9 @@
 
 while getopts "m:b:l:i:r:g:f" opt; do
   case "${opt}" in
-    m) MAGENTA="${OPTARG}" ;;
+    m) ZIRCON="${OPTARG}" ;;
     b) BOOTDATA="${OPTARG}" ;;
-    g) MAGENTA_DISK="${OPTARG}" ;;
+    g) ZIRCON_DISK="${OPTARG}" ;;
     l) BZIMAGE="${OPTARG}" ;;
     i) INITRD="${OPTARG}" ;;
     r) ROOTFS="${OPTARG}" ;;
@@ -46,17 +46,17 @@
   esac
 done
 
-readonly MAGENTA BOOTDATA MAGENTA_DISK BZIMAGE INITRD ROOTFS HOST_BOOTFS
+readonly ZIRCON BOOTDATA ZIRCON_DISK BZIMAGE INITRD ROOTFS HOST_BOOTFS
 
 echo "
-data/dsdt.aml=$MAGENTADIR/system/ulib/hypervisor/acpi/dsdt.aml
-data/madt.aml=$MAGENTADIR/system/ulib/hypervisor/acpi/madt.aml
-data/mcfg.aml=$MAGENTADIR/system/ulib/hypervisor/acpi/mcfg.aml
-data/magenta.bin=$MAGENTA
+data/dsdt.aml=$ZIRCONDIR/system/ulib/hypervisor/acpi/dsdt.aml
+data/madt.aml=$ZIRCONDIR/system/ulib/hypervisor/acpi/madt.aml
+data/mcfg.aml=$ZIRCONDIR/system/ulib/hypervisor/acpi/mcfg.aml
+data/zircon.bin=$ZIRCON
 data/bootdata.bin=$BOOTDATA" > /tmp/guest.manifest
 
-if [ -f "$MAGENTA_DISK" ]; then
-    echo "data/magenta.gpt=$MAGENTA_DISK" >> /tmp/guest.manifest
+if [ -f "$ZIRCON_DISK" ]; then
+    echo "data/zircon.gpt=$ZIRCON_DISK" >> /tmp/guest.manifest
 fi
 
 if [ -f "$BZIMAGE" ]; then
diff --git a/system/uapp/guest/scripts/mkgpt.sh b/system/uapp/guest/scripts/mkgpt.sh
index b1fdce0..1ba0059 100755
--- a/system/uapp/guest/scripts/mkgpt.sh
+++ b/system/uapp/guest/scripts/mkgpt.sh
@@ -6,20 +6,20 @@
 # license that can be found in the LICENSE file or at
 # https://opensource.org/licenses/MIT
 #
-# Create a GPT disk image for magenta guests.
+# Create a GPT disk image for zircon guests.
 
 set -eo pipefail
 
 GUEST_SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-MAGENTADIR="${MAGENTA_DIR:-${GUEST_SCRIPTS_DIR}/../../../..}"
-BUILDDIR="${MAGENTA_BUILD_DIR:-$MAGENTADIR/build-magenta-pc-x86-64}"
+ZIRCONDIR="${ZIRCON_DIR:-${GUEST_SCRIPTS_DIR}/../../../..}"
+BUILDDIR="${ZIRCON_BUILD_DIR:-$ZIRCONDIR/build-zircon-pc-x86-64}"
 MINFS="${BUILDDIR}/tools/minfs"
 
-# Magenta's block-watcher will auto mount GPT partitions with this GUID as
+# Zircon's block-watcher will auto mount GPT partitions with this GUID as
 # the system partition.
-MAGENTA_SYSTEM_GUID="606B000B-B7C7-4653-A7D5-B737332C899D"
-MAGENTA_GPT_IMAGE="${BUILDDIR}/magenta.gpt"
-MAGENTA_SYSTEM_IMAGE="${BUILDDIR}/system.minfs"
+ZIRCON_SYSTEM_GUID="606B000B-B7C7-4653-A7D5-B737332C899D"
+ZIRCON_GPT_IMAGE="${BUILDDIR}/zircon.gpt"
+ZIRCON_SYSTEM_IMAGE="${BUILDDIR}/system.minfs"
 
 usage() {
     echo "usage: ${0} [-f]"
@@ -75,7 +75,7 @@
   dd if=/dev/zero of="${image}" bs=512 count="$((${sys_end_sector} + 2048))"
 
   sgdisk --new 1:${sys_start_sector}:${sys_end_sector} ${image}
-  sgdisk --typecode 1:${MAGENTA_SYSTEM_GUID}  ${image}
+  sgdisk --typecode 1:${ZIRCON_SYSTEM_GUID}  ${image}
   sgdisk --print ${image}
 
    # Copy bytes from the system image into the correct location in the GPT
@@ -102,10 +102,10 @@
 check_sgdisk
 
 # Are the requested targets up-to-date?
-if [ "${FORCE}" != "true" ] && [ -f "${MAGENTA_GPT_IMAGE}" ]; then
+if [ "${FORCE}" != "true" ] && [ -f "${ZIRCON_GPT_IMAGE}" ]; then
   echo "GPT image already exists. Pass -f to force a rebuild."
   exit 0
 fi
 
-generate_system_image "${MAGENTA_SYSTEM_IMAGE}" "20"
-generate_gpt_image "${MAGENTA_GPT_IMAGE}" "${MAGENTA_SYSTEM_IMAGE}"
+generate_system_image "${ZIRCON_SYSTEM_IMAGE}" "20"
+generate_gpt_image "${ZIRCON_GPT_IMAGE}" "${ZIRCON_SYSTEM_IMAGE}"
diff --git a/system/uapp/guest/scripts/mklinux.sh b/system/uapp/guest/scripts/mklinux.sh
index 7a2d957..e915110 100755
--- a/system/uapp/guest/scripts/mklinux.sh
+++ b/system/uapp/guest/scripts/mklinux.sh
@@ -24,7 +24,7 @@
 
 # Shallow clone the repository.
 if [ ! -d "$LINUXDIR" ]; then
-  git clone --depth 1 --branch machina https://magenta-guest.googlesource.com/third_party/linux "$LINUXDIR"
+  git clone --depth 1 --branch machina https://zircon-guest.googlesource.com/third_party/linux "$LINUXDIR"
 fi
 
 # Update the repository.
diff --git a/system/uapp/guest/scripts/mktoybox.sh b/system/uapp/guest/scripts/mktoybox.sh
index cfb9d62..4ba18df 100755
--- a/system/uapp/guest/scripts/mktoybox.sh
+++ b/system/uapp/guest/scripts/mktoybox.sh
@@ -47,7 +47,7 @@
   local toybox_src=$1
 
   if [ ! -d "$toybox_src" ]; then
-    git clone --depth 1 --branch machina https://magenta-guest.googlesource.com/third_party/toybox "$toybox_src"
+    git clone --depth 1 --branch machina https://zircon-guest.googlesource.com/third_party/toybox "$toybox_src"
   fi
 }
 
diff --git a/system/uapp/guest/magenta.cpp b/system/uapp/guest/zircon.cpp
similarity index 72%
rename from system/uapp/guest/magenta.cpp
rename to system/uapp/guest/zircon.cpp
index ac487ba..a833b78 100644
--- a/system/uapp/guest/magenta.cpp
+++ b/system/uapp/guest/zircon.cpp
@@ -9,10 +9,10 @@
 #include <unistd.h>
 
 #include <hypervisor/guest.h>
-#include <magenta/assert.h>
-#include <magenta/boot/bootdata.h>
+#include <zircon/assert.h>
+#include <zircon/boot/bootdata.h>
 
-#include "magenta.h"
+#include "zircon.h"
 
 static const uintptr_t kKernelOffset = 0x100000;
 static const uintptr_t kBootdataOffset = 0x800000;
@@ -24,45 +24,45 @@
            container->flags == 0;
 }
 
-static mx_status_t load_magenta(const int fd, const uintptr_t addr, const size_t size,
+static zx_status_t load_zircon(const int fd, const uintptr_t addr, const size_t size,
                                 const uintptr_t first_page, uintptr_t* guest_ip,
                                 uintptr_t* end_off) {
-    magenta_kernel_t* header = reinterpret_cast<magenta_kernel_t*>(addr + kKernelOffset);
-    // Move the first page to where magenta would like it to be
+    zircon_kernel_t* header = reinterpret_cast<zircon_kernel_t*>(addr + kKernelOffset);
+    // Move the first page to where zircon would like it to be
     memmove(header, reinterpret_cast<void*>(first_page), PAGE_SIZE);
 
     if (!container_is_valid(&header->hdr_file)) {
-        fprintf(stderr, "Invalid Magenta container\n");
-        return MX_ERR_IO_DATA_INTEGRITY;
+        fprintf(stderr, "Invalid Zircon container\n");
+        return ZX_ERR_IO_DATA_INTEGRITY;
     }
     if (header->hdr_kernel.type != BOOTDATA_KERNEL) {
-        fprintf(stderr, "Invalid Magenta kernel header\n");
-        return MX_ERR_IO_DATA_INTEGRITY;
+        fprintf(stderr, "Invalid Zircon kernel header\n");
+        return ZX_ERR_IO_DATA_INTEGRITY;
     }
     if (header->data_kernel.entry64 >= size) {
         fprintf(stderr, "Kernel entry point is outside of guest physical memory\n");
-        return MX_ERR_IO_DATA_INTEGRITY;
+        return ZX_ERR_IO_DATA_INTEGRITY;
     }
 
     // We already read a page, now we need the rest...
     // The rest is the length in the header, minus what we already read, but accounting for
-    // the bootdata_kernel_t portion of magenta_kernel_t that's included in the header length.
+    // the bootdata_kernel_t portion of zircon_kernel_t that's included in the header length.
     uintptr_t data_off = kKernelOffset + PAGE_SIZE;
     size_t data_len = header->hdr_kernel.length -
-                      (PAGE_SIZE - sizeof(magenta_kernel_t) + sizeof(bootdata_kernel_t));
+                      (PAGE_SIZE - sizeof(zircon_kernel_t) + sizeof(bootdata_kernel_t));
 
     ssize_t ret = read(fd, reinterpret_cast<void*>(addr + data_off), data_len);
     if (ret < 0 || (size_t)ret != data_len) {
-        fprintf(stderr, "Failed to read Magenta kernel data\n");
-        return MX_ERR_IO;
+        fprintf(stderr, "Failed to read Zircon kernel data\n");
+        return ZX_ERR_IO;
     }
 
     *guest_ip = header->data_kernel.entry64;
     *end_off = header->hdr_file.length + sizeof(bootdata_t);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t load_cmdline(const char* cmdline, const uintptr_t addr,
+static zx_status_t load_cmdline(const char* cmdline, const uintptr_t addr,
                                 const uintptr_t bootdata_off) {
     bootdata_t* bootdata_hdr = (bootdata_t*)(addr + bootdata_off);
     uintptr_t data_off = bootdata_off + sizeof(bootdata_t) + BOOTDATA_ALIGN(bootdata_hdr->length);
@@ -72,26 +72,26 @@
     size_t cmdline_len = strlen(cmdline) + 1;
     if (cmdline_len > UINT32_MAX) {
         fprintf(stderr, "Command line length is outside of 32-bit range\n");
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     cmdline_hdr->length = cmdline_len & UINT32_MAX;
     memcpy(cmdline_hdr + 1, cmdline, cmdline_len);
 
     bootdata_hdr->length += cmdline_hdr->length + static_cast<uint32_t>(sizeof(bootdata_t));
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t load_bootfs(const int fd, const uintptr_t addr, const uintptr_t bootdata_off) {
+static zx_status_t load_bootfs(const int fd, const uintptr_t addr, const uintptr_t bootdata_off) {
     bootdata_t ramdisk_hdr;
     ssize_t ret = read(fd, &ramdisk_hdr, sizeof(bootdata_t));
     if (ret != sizeof(bootdata_t)) {
         fprintf(stderr, "Failed to read BOOTFS image header\n");
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     if (!container_is_valid(&ramdisk_hdr)) {
         fprintf(stderr, "Invalid BOOTFS container\n");
-        return MX_ERR_IO_DATA_INTEGRITY;
+        return ZX_ERR_IO_DATA_INTEGRITY;
     }
 
     bootdata_t* bootdata_hdr = (bootdata_t*)(addr + bootdata_off);
@@ -99,25 +99,25 @@
     ret = read(fd, (void*)(addr + data_off), ramdisk_hdr.length);
     if (ret < 0 || (size_t)ret != ramdisk_hdr.length) {
         fprintf(stderr, "Failed to read BOOTFS image data\n");
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     bootdata_hdr->length += ramdisk_hdr.length + static_cast<uint32_t>(sizeof(bootdata_t));
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t create_bootdata(uintptr_t addr, size_t size, uintptr_t acpi_off,
+static zx_status_t create_bootdata(uintptr_t addr, size_t size, uintptr_t acpi_off,
                                    uintptr_t bootdata_off) {
     if (BOOTDATA_ALIGN(bootdata_off) != bootdata_off)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     const size_t e820_size = guest_e820_size(size);
     const size_t bootdata_len = sizeof(bootdata_t) + BOOTDATA_ALIGN(sizeof(uint64_t)) +
                                 sizeof(bootdata_t) + BOOTDATA_ALIGN(e820_size);
     if (bootdata_off + bootdata_len > size)
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     if (bootdata_len > UINT32_MAX)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // Bootdata container.
     bootdata_t* header = (bootdata_t*)(addr + bootdata_off);
@@ -145,34 +145,34 @@
     return guest_create_e820(addr, size, bootdata_off);
 }
 
-static bool is_magenta(const uintptr_t first_page) {
-    magenta_kernel_t* header = (magenta_kernel_t*)first_page;
+static bool is_zircon(const uintptr_t first_page) {
+    zircon_kernel_t* header = (zircon_kernel_t*)first_page;
     return container_is_valid(&header->hdr_file);
 }
 
-mx_status_t setup_magenta(const uintptr_t addr, const size_t size, const uintptr_t first_page,
+zx_status_t setup_zircon(const uintptr_t addr, const size_t size, const uintptr_t first_page,
                           const uintptr_t acpi_off, const int fd, const char* bootdata_path,
                           const char* cmdline, uintptr_t* guest_ip, uintptr_t* bootdata_offset) {
-    if (!is_magenta(first_page)) {
-        return MX_ERR_NOT_SUPPORTED;
+    if (!is_zircon(first_page)) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
-    mx_status_t status = create_bootdata(addr, size, acpi_off, kBootdataOffset);
-    if (status != MX_OK) {
+    zx_status_t status = create_bootdata(addr, size, acpi_off, kBootdataOffset);
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create bootdata\n");
         return status;
     }
 
-    uintptr_t magenta_end_off;
-    status = load_magenta(fd, addr, size, first_page, guest_ip, &magenta_end_off);
-    if (status != MX_OK)
+    uintptr_t zircon_end_off;
+    status = load_zircon(fd, addr, size, first_page, guest_ip, &zircon_end_off);
+    if (status != ZX_OK)
         return status;
-    MX_ASSERT(magenta_end_off <= kBootdataOffset);
+    ZX_ASSERT(zircon_end_off <= kBootdataOffset);
 
     // If we have a command line, load it.
     if (cmdline != NULL) {
         status = load_cmdline(cmdline, addr, kBootdataOffset);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
     }
 
@@ -181,14 +181,14 @@
         int boot_fd = open(bootdata_path, O_RDONLY);
         if (boot_fd < 0) {
             fprintf(stderr, "Failed to open BOOTFS image \"%s\"\n", bootdata_path);
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
 
         status = load_bootfs(boot_fd, addr, kBootdataOffset);
         close(boot_fd);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
     }
     *bootdata_offset = kBootdataOffset;
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/uapp/guest/magenta.h b/system/uapp/guest/zircon.h
similarity index 74%
rename from system/uapp/guest/magenta.h
rename to system/uapp/guest/zircon.h
index 2ef0d36..878972c 100644
--- a/system/uapp/guest/magenta.h
+++ b/system/uapp/guest/zircon.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
-mx_status_t setup_magenta(const uintptr_t addr, const size_t vmo_size, const uintptr_t first_page,
+zx_status_t setup_zircon(const uintptr_t addr, const size_t vmo_size, const uintptr_t first_page,
                           const uintptr_t acpi_off, const int fd, const char* bootdata_path,
                           const char* cmdline, uintptr_t* guest_ip, uintptr_t* bootdata_off);
diff --git a/system/uapp/hid/main.c b/system/uapp/hid/main.c
index 1ee7a09..4eeab20 100644
--- a/system/uapp/hid/main.c
+++ b/system/uapp/hid/main.c
@@ -14,13 +14,13 @@
 #include <unistd.h>
 #include <limits.h>
 
-#include <magenta/assert.h>
-#include <magenta/listnode.h>
-#include <magenta/threads.h>
-#include <magenta/types.h>
-#include <magenta/device/input.h>
+#include <zircon/assert.h>
+#include <zircon/listnode.h>
+#include <zircon/threads.h>
+#include <zircon/types.h>
+#include <zircon/device/input.h>
 
-#include <mxio/watcher.h>
+#include <fdio/watcher.h>
 
 #define DEV_INPUT "/dev/class/input"
 
@@ -60,26 +60,26 @@
     printf("\n");
 }
 
-static mx_status_t parse_uint_arg(const char* arg, uint32_t min, uint32_t max, uint32_t* out_val) {
+static zx_status_t parse_uint_arg(const char* arg, uint32_t min, uint32_t max, uint32_t* out_val) {
     if ((arg == NULL) || (out_val == NULL)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     bool is_hex = (arg[0] == '0') && (arg[1] == 'x');
     if (sscanf(arg, is_hex ? "%x" : "%u", out_val) != 1) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if ((*out_val < min) || (*out_val > max)) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t parse_input_report_type(const char* arg, input_report_type_t* out_type) {
+static zx_status_t parse_input_report_type(const char* arg, input_report_type_t* out_type) {
     if ((arg == NULL) || (out_type == NULL)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     static const struct {
@@ -94,25 +94,25 @@
     for (size_t i = 0; i < countof(LUT); ++i) {
         if (!strcasecmp(arg, LUT[i].name)) {
             *out_type = LUT[i].type;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
 
-static mx_status_t parse_set_get_report_args(int argc,
+static zx_status_t parse_set_get_report_args(int argc,
                                              const char** argv,
                                              input_report_id_t* out_id,
                                              input_report_type_t* out_type) {
     if ((argc < 3) || (argv == NULL) || (out_id == NULL) || (out_type == NULL)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t res;
+    zx_status_t res;
     uint32_t tmp;
     res = parse_uint_arg(argv[2], 0, 255, &tmp);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         return res;
     }
 
@@ -147,7 +147,7 @@
     uint8_t* buf = malloc(report_desc_len);
     if (!buf) {
         lprintf("hid: out of memory\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     ssize_t rc = ioctl_input_get_report_desc(fd, buf, report_desc_len);
     if (rc < 0) {
@@ -176,7 +176,7 @@
 static int get_report_ids(int fd, const char* name, size_t num_reports) {
     size_t out_len = num_reports * sizeof(input_report_id_t);
     input_report_id_t* ids = malloc(out_len);
-    if (!ids) return MX_ERR_NO_MEMORY;
+    if (!ids) return ZX_ERR_NO_MEMORY;
 
     ssize_t rc = ioctl_input_get_report_ids(fd, ids, out_len);
     if (rc < 0) {
@@ -252,7 +252,7 @@
     try(get_report_ids(fd, name, num_reports));
     try(get_max_report_len(fd, name, max_report_len));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static int hid_input_thread(void* arg) {
@@ -266,7 +266,7 @@
     max_report_len++;
 
     uint8_t* report = calloc(1, max_report_len);
-    if (!report) return MX_ERR_NO_MEMORY;
+    if (!report) return ZX_ERR_NO_MEMORY;
 
     for (uint32_t i = 0; i < args->num_reads; i++) {
         int r = read(args->fd, report, max_report_len);
@@ -285,17 +285,17 @@
     lprintf("hid: closing %s\n", args->name);
     close(args->fd);
     free(args);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t hid_input_device_added(int dirfd, int event, const char* fn, void* cookie) {
+static zx_status_t hid_input_device_added(int dirfd, int event, const char* fn, void* cookie) {
     if (event != WATCH_EVENT_ADD_FILE) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     int fd = openat(dirfd, fn, O_RDONLY);
     if (fd < 0) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     input_args_t* args = malloc(sizeof(*args));
@@ -309,19 +309,19 @@
     if (ret != thrd_success) {
         printf("hid: input thread %s did not start (error=%d)\n", args->name, ret);
         close(fd);
-        return thrd_status_to_mx_status(ret);
+        return thrd_status_to_zx_status(ret);
     }
     thrd_detach(t);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static int hid_input_devices_poll_thread(void* arg) {
     int dirfd = open(DEV_INPUT, O_DIRECTORY|O_RDONLY);
     if (dirfd < 0) {
         printf("hid: error opening %s\n", DEV_INPUT);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
-    mxio_watch_directory(dirfd, hid_input_device_added, MX_TIME_INFINITE, NULL);
+    fdio_watch_directory(dirfd, hid_input_device_added, ZX_TIME_INFINITE, NULL);
     close(dirfd);
     return -1;
 }
@@ -336,8 +336,8 @@
 
     uint32_t tmp = 0xffffffff;
     if (argc > 1) {
-        mx_status_t res = parse_uint_arg(argv[1], 0, 0xffffffff, &tmp);
-        if (res != MX_OK) {
+        zx_status_t res = parse_uint_arg(argv[1], 0, 0xffffffff, &tmp);
+        if (res != ZX_OK) {
             printf("Failed to parse <num reads> (res %d)\n", res);
             usage();
             return 0;
@@ -389,8 +389,8 @@
     }
 
     input_get_report_size_t size_arg;
-    mx_status_t res = parse_set_get_report_args(argc, argv, &size_arg.id, &size_arg.type);
-    if (res != MX_OK) {
+    zx_status_t res = parse_set_get_report_args(argc, argv, &size_arg.id, &size_arg.type);
+    if (res != ZX_OK) {
         printf("Failed to parse type/id for get report operation (res %d)\n", res);
         usage();
         return 0;
@@ -458,8 +458,8 @@
     }
 
     input_get_report_size_t size_arg;
-    mx_status_t res = parse_set_get_report_args(argc, argv, &size_arg.id, &size_arg.type);
-    if (res != MX_OK) {
+    zx_status_t res = parse_set_get_report_args(argc, argv, &size_arg.id, &size_arg.type);
+    if (res != ZX_OK) {
         printf("Failed to parse type/id for get report operation (res %d)\n", res);
         usage();
         return 0;
@@ -483,7 +483,7 @@
     }
 
     // If the set/get report args parsed, then we must have at least 3 arguments.
-    MX_DEBUG_ASSERT(argc >= 3);
+    ZX_DEBUG_ASSERT(argc >= 3);
     input_report_size_t payload_size = argc - 3;
 
     xprintf("hid: report size=%u, tx payload size=%u\n", size, payload_size);
@@ -494,8 +494,8 @@
     arg->type = size_arg.type;
     for (int i = 0; i < payload_size; i++) {
         uint32_t tmp;
-        mx_status_t res = parse_uint_arg(argv[i+3], 0, 255, &tmp);
-        if (res != MX_OK) {
+        zx_status_t res = parse_uint_arg(argv[i+3], 0, 255, &tmp);
+        if (res != ZX_OK) {
             printf("Failed to parse payload byte \"%s\" (res = %d)\n", argv[i+3], res);
             rc = res;
             goto finished;
diff --git a/system/uapp/hid/rules.mk b/system/uapp/hid/rules.mk
index 34f904d..45d00d2 100644
--- a/system/uapp/hid/rules.mk
+++ b/system/uapp/hid/rules.mk
@@ -13,8 +13,8 @@
     $(LOCAL_DIR)/main.c
 
 MODULE_LIBS := \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/hidtouch/main.c b/system/uapp/hidtouch/main.c
index 3ab9a45..e2279dc 100644
--- a/system/uapp/hidtouch/main.c
+++ b/system/uapp/hidtouch/main.c
@@ -16,12 +16,12 @@
 #include <hid/paradise.h>
 #include <hid/usages.h>
 
-#include <magenta/device/console.h>
-#include <magenta/device/display.h>
-#include <magenta/device/input.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/device/console.h>
+#include <zircon/device/display.h>
+#include <zircon/device/input.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #define DEV_INPUT       "/dev/class/input"
 #define FRAMEBUFFER     "/dev/class/framebuffer/000"
@@ -258,8 +258,8 @@
     size_t size = fb.info.stride * fb.info.pixelsize * fb.info.height;
     uintptr_t fbo;
 
-    mx_status_t status = _mx_vmar_map(mx_vmar_root_self(), 0, fb.vmo, 0, size,
-                                      MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &fbo);
+    zx_status_t status = _zx_vmar_map(zx_vmar_root_self(), 0, fb.vmo, 0, size,
+                                      ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &fbo);
     if (status < 0) {
         printf("couldn't map fb: %d\n", status);
         return -1;
@@ -388,7 +388,7 @@
     free(buf);
     free(rpt_desc);
     close(touchfd);
-    _mx_vmar_unmap(mx_vmar_root_self(), fbo, size);
+    _zx_vmar_unmap(zx_vmar_root_self(), fbo, size);
     close(vcfd);
     return 0;
 }
diff --git a/system/uapp/hidtouch/rules.mk b/system/uapp/hidtouch/rules.mk
index 76d897fb..9c608f4 100644
--- a/system/uapp/hidtouch/rules.mk
+++ b/system/uapp/hidtouch/rules.mk
@@ -14,8 +14,8 @@
 
 MODULE_LIBS := \
     system/ulib/hid \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/i2c/i2c.c b/system/uapp/i2c/i2c.c
index c1880af..3ed8fed 100644
--- a/system/uapp/i2c/i2c.c
+++ b/system/uapp/i2c/i2c.c
@@ -4,10 +4,10 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <magenta/device/i2c.h>
-#include <mxio/util.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <zircon/device/i2c.h>
+#include <fdio/util.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -204,7 +204,7 @@
 
 int cmd_transfer(int fd, int argc, const char** argv) {
     const size_t base_size = sizeof(i2c_slave_ioctl_segment_t);
-    int ret = MX_OK;
+    int ret = ZX_OK;
 
     // Figure out how big our buffers need to be.
     // Start the counters with enough space for the I2C_SEGMENT_TYPE_END
diff --git a/system/uapp/i2c/rules.mk b/system/uapp/i2c/rules.mk
index 7204730..03eb87e 100644
--- a/system/uapp/i2c/rules.mk
+++ b/system/uapp/i2c/rules.mk
@@ -12,6 +12,6 @@
 MODULE_SRCS += \
 	$(LOCAL_DIR)/i2c.c
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/iotime/iotime.c b/system/uapp/iotime/iotime.c
index 2ea2e5f..d4f90fb 100644
--- a/system/uapp/iotime/iotime.c
+++ b/system/uapp/iotime/iotime.c
@@ -10,9 +10,9 @@
 #include <unistd.h>
 
 #include <fs-management/ramdisk.h>
-#include <magenta/syscalls.h>
-#include <magenta/device/ramdisk.h>
-#include <magenta/device/block.h>
+#include <zircon/syscalls.h>
+#include <zircon/device/ramdisk.h>
+#include <zircon/device/block.h>
 #include <block-client/client.h>
 
 uint64_t number(const char* str) {
@@ -73,7 +73,7 @@
         return -1;
     }
 
-    mx_time_t t0 = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t t0 = zx_time_get(ZX_CLOCK_MONOTONIC);
     size_t n = total;
     while (n > 0) {
         size_t xfer = (n > bufsz) ? bufsz : n;
@@ -88,7 +88,7 @@
         }
         n -= xfer;
     }
-    mx_time_t t1 = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t t1 = zx_time_get(ZX_CLOCK_MONOTONIC);
 
     fprintf(stderr, "read %zu bytes in %zu ns: ", total, t1 - t0);
     bytes_per_second(total, t1 - t0);
@@ -136,7 +136,7 @@
         }
     }
 
-    mx_time_t t0 = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t t0 = zx_time_get(ZX_CLOCK_MONOTONIC);
     size_t n = total;
     while (n > 0) {
         size_t xfer = (n > bufsz) ? bufsz : n;
@@ -151,7 +151,7 @@
         }
         n -= xfer;
     }
-    mx_time_t t1 = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t t1 = zx_time_get(ZX_CLOCK_MONOTONIC);
 
     fprintf(stderr, "read %zu bytes in %zu ns: ", total, t1 - t0);
     bytes_per_second(total, t1 - t0);
@@ -165,8 +165,8 @@
     size_t total = number(argv[3]);
     size_t bufsz = number(argv[4]);
 
-    mx_handle_t vmo;
-    if (mx_vmo_create(bufsz, 0, &vmo) != MX_OK) {
+    zx_handle_t vmo;
+    if (zx_vmo_create(bufsz, 0, &vmo) != ZX_OK) {
         fprintf(stderr, "error: out of memory\n");
         return -1;
     }
@@ -177,7 +177,7 @@
         return -1;
     }
 
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     if (ioctl_block_get_fifos(fd, &fifo) != sizeof(fifo)) {
         fprintf(stderr, "err: cannot get fifo for '%s'\n", argv[2]);
         return -1;
@@ -189,8 +189,8 @@
         return -1;
     }
 
-    mx_handle_t dup;
-    if (mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &dup) != MX_OK) {
+    zx_handle_t dup;
+    if (zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &dup) != ZX_OK) {
         fprintf(stderr, "error: cannot duplicate handle\n");
         return -1;
     }
@@ -202,12 +202,12 @@
     }
 
     fifo_client_t* client;
-    if (block_fifo_create_client(fifo, &client) != MX_OK) {
+    if (block_fifo_create_client(fifo, &client) != ZX_OK) {
         fprintf(stderr, "err: cannot create block client for '%s'\n", argv[2]);
         return -1;
     }
 
-    mx_time_t t0 = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t t0 = zx_time_get(ZX_CLOCK_MONOTONIC);
     size_t n = total;
     while (n > 0) {
         size_t xfer = (n > bufsz) ? bufsz : n;
@@ -219,13 +219,13 @@
             .vmo_offset = 0,
             .dev_offset = total - n,
         };
-        if (block_fifo_txn(client, &request, 1) != MX_OK) {
+        if (block_fifo_txn(client, &request, 1) != ZX_OK) {
             fprintf(stderr, "error: block_fifo_txn error\n");
             return -1;
         }
         n -= xfer;
     }
-    mx_time_t t1 = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t t1 = zx_time_get(ZX_CLOCK_MONOTONIC);
 
     fprintf(stderr, "read %zu bytes in %zu ns: ", total, t1 - t0);
     bytes_per_second(total, t1 - t0);
diff --git a/system/uapp/iotime/rules.mk b/system/uapp/iotime/rules.mk
index 0a3d30d..f5134a0 100644
--- a/system/uapp/iotime/rules.mk
+++ b/system/uapp/iotime/rules.mk
@@ -17,8 +17,8 @@
 
 MODULE_LIBS := \
     system/ulib/fs-management \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/launch/launch.c b/system/uapp/launch/launch.c
index b32e1d1..2523292 100644
--- a/system/uapp/launch/launch.c
+++ b/system/uapp/launch/launch.c
@@ -6,13 +6,13 @@
 #include <launchpad/launchpad.h>
 #include <launchpad/loader-service.h>
 #include <launchpad/vmo.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/syscalls/policy.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/syscalls/policy.h>
 
-#include <mxio/io.h>
+#include <fdio/io.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -36,9 +36,9 @@
                  "enable exception-on-bad-handle job policy (implies -j)");
     option_usage(out, "-j", "start process in a new job");
     option_usage(out, "-l",
-                 "pass mxio_loader_service handle in main bootstrap message");
+                 "pass fdio_loader_service handle in main bootstrap message");
     option_usage(out, "-L", "force initial loader bootstrap message");
-    option_usage(out, "-r", "send mxio filesystem root");
+    option_usage(out, "-r", "send fdio filesystem root");
     option_usage(out, "-s", "shorthand for -r -d 0 -d 1 -d 2");
     option_usage(out, "-S BYTES", "set the initial stack size to BYTES");
     option_usage(out, "-v FILE", "send VMO of FILE as EXEC_VMO handle");
@@ -46,12 +46,12 @@
     exit(error ? 1 : 0);
 }
 
-static _Noreturn void fail(const char* call, mx_status_t status) {
+static _Noreturn void fail(const char* call, zx_status_t status) {
     fprintf(stderr, "%s failed: %d\n", call, status);
     exit(1);
 }
 
-static void check(const char* call, mx_status_t status) {
+static void check(const char* call, zx_status_t status) {
     if (status < 0)
         fail(call, status);
 }
@@ -157,10 +157,10 @@
     if (optind >= argc)
         usage(argv[0], true);
 
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     if (program_fd != -1) {
-        mx_status_t status = mxio_get_vmo(program_fd, &vmo);
-        if (status == MX_ERR_IO) {
+        zx_status_t status = fdio_get_vmo(program_fd, &vmo);
+        if (status == ZX_ERR_IO) {
             perror("launchpad_vmo_from_fd");
             return 2;
         }
@@ -168,39 +168,39 @@
     } else {
         if (program == NULL)
             program = argv[optind];
-        mx_status_t status = launchpad_vmo_from_file(program, &vmo);
-        if (status == MX_ERR_IO) {
+        zx_status_t status = launchpad_vmo_from_file(program, &vmo);
+        if (status == ZX_ERR_IO) {
             perror(program);
             return 2;
         }
         check("launchpad_vmo_from_file", status);
     }
 
-    mx_handle_t job = mx_job_default();
+    zx_handle_t job = zx_job_default();
     if (new_job) {
-        if (job == MX_HANDLE_INVALID) {
-            fprintf(stderr, "no mxio job handle found\n");
+        if (job == ZX_HANDLE_INVALID) {
+            fprintf(stderr, "no fdio job handle found\n");
             return 2;
         }
         check("launchpad job", job);
-        mx_handle_t child_job;
-        mx_status_t status = mx_job_create(job, 0u, &child_job);
+        zx_handle_t child_job;
+        zx_status_t status = zx_job_create(job, 0u, &child_job);
         check("launchpad child job", status);
-        mx_handle_close(job);
+        zx_handle_close(job);
         job = child_job;
     }
     if (enable_bad_handle_policy) {
-        mx_policy_basic_t policy[] = {
-            { MX_POL_BAD_HANDLE, MX_POL_ACTION_EXCEPTION },
+        zx_policy_basic_t policy[] = {
+            { ZX_POL_BAD_HANDLE, ZX_POL_ACTION_EXCEPTION },
         };
-        mx_status_t status = mx_job_set_policy(
-            job, MX_JOB_POL_RELATIVE, MX_JOB_POL_BASIC,
+        zx_status_t status = zx_job_set_policy(
+            job, ZX_JOB_POL_RELATIVE, ZX_JOB_POL_BASIC,
             &policy, countof(policy));
-        check("mx_job_set_policy", status);
+        check("zx_job_set_policy", status);
     }
 
     launchpad_t* lp;
-    mx_status_t status = launchpad_create(job, program, &lp);
+    zx_status_t status = launchpad_create(job, program, &lp);
     check("launchpad_create", status);
 
     status = launchpad_set_args(lp, argc - optind,
@@ -211,8 +211,8 @@
     check("launchpad_environ", status);
 
     if (send_root) {
-        status = launchpad_clone(lp, LP_CLONE_MXIO_NAMESPACE);
-        check("launchpad_clone(LP_CLONE_MXIO_NAMESPACE)", status);
+        status = launchpad_clone(lp, LP_CLONE_FDIO_NAMESPACE);
+        check("launchpad_clone(LP_CLONE_FDIO_NAMESPACE)", status);
     }
 
     for (size_t i = 0; i < nfds; ++i) {
@@ -226,12 +226,12 @@
     if (send_loader_message) {
         bool already_sending = launchpad_send_loader_message(lp, true);
         if (!already_sending) {
-            mx_handle_t loader_svc;
+            zx_handle_t loader_svc;
             status = loader_service_get_default(&loader_svc);
-            check("mxio_loader_service", status);
-            mx_handle_t old = launchpad_use_loader_service(lp, loader_svc);
+            check("fdio_loader_service", status);
+            zx_handle_t old = launchpad_use_loader_service(lp, loader_svc);
             check("launchpad_use_loader_service", old);
-            if (old != MX_HANDLE_INVALID) {
+            if (old != ZX_HANDLE_INVALID) {
                 fprintf(stderr, "launchpad_use_loader_service returned %#x\n",
                         old);
                 return 2;
@@ -240,9 +240,9 @@
     }
 
     if (pass_loader_handle) {
-        mx_handle_t loader_svc;
+        zx_handle_t loader_svc;
         status = loader_service_get_default(&loader_svc);
-        check("mxio_loader_service", status);
+        check("fdio_loader_service", status);
         status = launchpad_add_handle(lp, loader_svc, PA_SVC_LOADER);
         check("launchpad_add_handle", status);
     }
@@ -252,9 +252,9 @@
     // unlikely to be useful.  But this program is mainly to test the
     // library, so it makes all the library calls the user asks for.
     if (exec_vmo_file != NULL) {
-        mx_handle_t exec_vmo;
+        zx_handle_t exec_vmo;
         status = launchpad_vmo_from_file(exec_vmo_file, &exec_vmo);
-        if (status == MX_ERR_IO) {
+        if (status == ZX_ERR_IO) {
             perror(exec_vmo_file);
             return 2;
         }
@@ -263,9 +263,9 @@
     }
 
     if (exec_vmo_fd != -1) {
-        mx_handle_t exec_vmo;
-        status = mxio_get_vmo(exec_vmo_fd, &exec_vmo);
-        if (status == MX_ERR_IO) {
+        zx_handle_t exec_vmo;
+        status = fdio_get_vmo(exec_vmo_fd, &exec_vmo);
+        if (status == ZX_ERR_IO) {
             perror("launchpad_vmo_from_fd");
             return 2;
         }
@@ -281,7 +281,7 @@
 
     // This doesn't get ownership of the process handle.
     // We're just testing the invariant that it returns a valid handle.
-    mx_handle_t proc = launchpad_get_process_handle(lp);
+    zx_handle_t proc = launchpad_get_process_handle(lp);
     check("launchpad_get_process_handle", proc);
 
     // This gives us ownership of the process handle.
@@ -291,15 +291,15 @@
     // The launchpad is done.  Clean it up.
     launchpad_destroy(lp);
 
-    status = mx_object_wait_one(proc, MX_PROCESS_TERMINATED, MX_TIME_INFINITE, NULL);
-    check("mx_object_wait_one", status);
+    status = zx_object_wait_one(proc, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, NULL);
+    check("zx_object_wait_one", status);
 
-    mx_info_process_t info;
-    status = mx_object_get_info(proc, MX_INFO_PROCESS, &info, sizeof(info), NULL, NULL);
-    check("mx_object_get_info", status);
+    zx_info_process_t info;
+    status = zx_object_get_info(proc, ZX_INFO_PROCESS, &info, sizeof(info), NULL, NULL);
+    check("zx_object_get_info", status);
 
     if (job)
-        mx_handle_close(job);
+        zx_handle_close(job);
 
     printf("Process finished with return code %d\n", info.return_code);
     return info.return_code;
diff --git a/system/uapp/launch/rules.mk b/system/uapp/launch/rules.mk
index 97ec759..868a86c 100644
--- a/system/uapp/launch/rules.mk
+++ b/system/uapp/launch/rules.mk
@@ -15,8 +15,8 @@
 
 MODULE_LIBS := \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/loadgen/loadgen.cpp b/system/uapp/loadgen/loadgen.cpp
index 7f1777a..2e20890 100644
--- a/system/uapp/loadgen/loadgen.cpp
+++ b/system/uapp/loadgen/loadgen.cpp
@@ -6,9 +6,9 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/errors.h>
-#include <magenta/types.h>
-#include <magenta/syscalls.h>
+#include <zircon/errors.h>
+#include <zircon/types.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_call.h>
@@ -28,7 +28,7 @@
     LoadGeneratorThread(unsigned int seed) : seed_(seed) { }
     ~LoadGeneratorThread();
 
-    mx_status_t Start();
+    zx_status_t Start();
 
     static float& min_work_msec() { return min_work_msec_; }
     static float& max_work_msec() { return max_work_msec_; }
@@ -66,8 +66,8 @@
     }
 }
 
-mx_status_t LoadGeneratorThread::Start() {
-    if (thread_started_) return MX_ERR_BAD_STATE;
+zx_status_t LoadGeneratorThread::Start() {
+    if (thread_started_) return ZX_ERR_BAD_STATE;
 
     int c11_res = thrd_create(
             &thread_,
@@ -77,26 +77,26 @@
     if (c11_res != thrd_success) {
         printf("Failed to create new client thread (res %d)!\n", c11_res);
         // TODO(johngro) : translate musl error
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 int LoadGeneratorThread::Run() {
     constexpr double kMinNum = 1.0;
     constexpr double kMaxNum = 100000000.0;
-    uint32_t ticks_per_msec = static_cast<uint32_t>(mx_ticks_per_second() / 1000);
+    uint32_t ticks_per_msec = static_cast<uint32_t>(zx_ticks_per_second() / 1000);
     accumulator_ = MakeRandomDouble(kMinNum, kMaxNum);
 
     // While it is not time to quit, waste time performing pointless double
     // precision floating point math.
     while (!quit_) {
         double work_delay = MakeRandomDouble(min_work_msec(), max_work_msec());
-        uint64_t work_deadline_ticks = mx_ticks_get()
-                                     + static_cast<mx_time_t>(work_delay * ticks_per_msec);
+        uint64_t work_deadline_ticks = zx_ticks_get()
+                                     + static_cast<zx_time_t>(work_delay * ticks_per_msec);
 
-        while (!quit_ && (mx_ticks_get() < work_deadline_ticks)) {
+        while (!quit_ && (zx_ticks_get() < work_deadline_ticks)) {
             accumulator_ += MakeRandomDouble(kMinNum, kMaxNum);
             accumulator_ *= MakeRandomDouble(kMinNum, kMaxNum);
             accumulator_ -= MakeRandomDouble(kMinNum, kMaxNum);
@@ -110,20 +110,20 @@
             break;
 
         double sleep_delay = MakeRandomDouble(min_sleep_msec(), max_sleep_msec());
-        mx_time_t sleep_deadline = mx_time_get(MX_CLOCK_MONOTONIC)
-                                 + static_cast<mx_time_t>(sleep_delay * 1000000.0);
+        zx_time_t sleep_deadline = zx_time_get(ZX_CLOCK_MONOTONIC)
+                                 + static_cast<zx_time_t>(sleep_delay * 1000000.0);
 
         do {
-            static constexpr mx_time_t max_sleep = MX_MSEC(10);
-            mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+            static constexpr zx_time_t max_sleep = ZX_MSEC(10);
+            zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
 
             if (now >= sleep_deadline)
                 break;
 
             if ((sleep_deadline - now) > max_sleep) {
-                mx_nanosleep(now + max_sleep);
+                zx_nanosleep(now + max_sleep);
             } else {
-                mx_nanosleep(sleep_deadline);
+                zx_nanosleep(sleep_deadline);
                 break;
             }
         } while (!quit_);
@@ -144,7 +144,7 @@
            "  N             : Number of threads to create.  Default %u\n"
            "  min/max_work  : Min/max msec for threads to work for.  Default %.1f,%.1f mSec\n"
            "  min/max_sleep : Min/max msec for threads to sleep for.  Default %.1f,%.1f mSec\n"
-           "  seed          : RNG seed to use.  Defaults to seeding from mx_time_get\n",
+           "  seed          : RNG seed to use.  Defaults to seeding from zx_time_get\n",
            program_name,
            kDefaultNumThreads,
            kDefaultMinWorkMsec,
@@ -193,7 +193,7 @@
     }
 
     // Parse the PRNG seed, if present.
-    unsigned int seed = static_cast<unsigned int>(mx_time_get(CLOCK_MONOTONIC));
+    unsigned int seed = static_cast<unsigned int>(zx_time_get(CLOCK_MONOTONIC));
     if (argc >= 7) {
         if (sscanf(argv[6], "%u", &seed) != 1) return -1;
     }
@@ -227,8 +227,8 @@
     }
 
     for (auto& t : threads) {
-        mx_status_t res = t.Start();
-        if (res != MX_OK) {
+        zx_status_t res = t.Start();
+        if (res != ZX_OK) {
             printf("Failed to start thread.  (res %d)\n", res);
             return res;
         }
diff --git a/system/uapp/loadgen/rules.mk b/system/uapp/loadgen/rules.mk
index 8cd0f09..334361b 100644
--- a/system/uapp/loadgen/rules.mk
+++ b/system/uapp/loadgen/rules.mk
@@ -11,12 +11,12 @@
     $(LOCAL_DIR)/loadgen.cpp
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/lsblk/main.c b/system/uapp/lsblk/main.c
index 8e0989b..10ffad1 100644
--- a/system/uapp/lsblk/main.c
+++ b/system/uapp/lsblk/main.c
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 #include <gpt/gpt.h>
-#include <magenta/types.h>
-#include <mxio/io.h>
+#include <zircon/types.h>
+#include <fdio/io.h>
 #include <dirent.h>
 #include <fcntl.h>
 #include <inttypes.h>
@@ -14,8 +14,8 @@
 #include <unistd.h>
 #include <limits.h>
 
-#include <magenta/device/block.h>
-#include <magenta/device/device.h>
+#include <zircon/device/block.h>
+#include <zircon/device/device.h>
 #include <pretty/hexdump.h>
 
 #define DEV_BLOCK "/dev/class/block"
diff --git a/system/uapp/lsblk/rules.mk b/system/uapp/lsblk/rules.mk
index 3121588..6d78c6b 100644
--- a/system/uapp/lsblk/rules.mk
+++ b/system/uapp/lsblk/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/gpt system/ulib/pretty
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/lsdev/lsdev.c b/system/uapp/lsdev/lsdev.c
index 555f7ee..a42bd4d 100644
--- a/system/uapp/lsdev/lsdev.c
+++ b/system/uapp/lsdev/lsdev.c
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/device/device.h>
-#include <magenta/status.h>
-#include <magenta/types.h>
+#include <zircon/device/device.h>
+#include <zircon/status.h>
+#include <zircon/types.h>
 
 #include <errno.h>
 #include <fcntl.h>
@@ -28,7 +28,7 @@
     ssize_t rc = ioctl_device_get_topo_path(fd, path, 1024);
     if (rc < 0) {
         fprintf(stderr, "could not get topological path for %s: %s\n",
-                argv[1], mx_status_get_string((mx_status_t)rc));
+                argv[1], zx_status_get_string((zx_status_t)rc));
         close(fd);
         return -1;
     }
diff --git a/system/uapp/lsdev/rules.mk b/system/uapp/lsdev/rules.mk
index 74863b2..bbcbd9b 100644
--- a/system/uapp/lsdev/rules.mk
+++ b/system/uapp/lsdev/rules.mk
@@ -13,8 +13,8 @@
     $(LOCAL_DIR)/lsdev.c
 
 MODULE_LIBS := \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/lspwr/lspwr.c b/system/uapp/lspwr/lspwr.c
index 4095a5b..4903901 100644
--- a/system/uapp/lspwr/lspwr.c
+++ b/system/uapp/lspwr/lspwr.c
@@ -7,13 +7,13 @@
 #include <fcntl.h>
 #include <dirent.h>
 #include <string.h>
-#include <magenta/syscalls.h>
-#include <magenta/device/power.h>
+#include <zircon/syscalls.h>
+#include <zircon/device/power.h>
 
 typedef struct {
     int type;
     int fd;
-    mx_handle_t h;
+    zx_handle_t h;
 } pwrdev_t;
 
 static const char* type_to_string[] = { "AC", "battery" };
@@ -80,10 +80,10 @@
             }
         }
 
-        mx_handle_t h = MX_HANDLE_INVALID;
+        zx_handle_t h = ZX_HANDLE_INVALID;
         if (idx < (int)countof(dev)) {
             rc = ioctl_power_get_state_change_event(fd, &h);
-            if (rc != sizeof(mx_handle_t)) {
+            if (rc != sizeof(zx_handle_t)) {
                 printf("ioctl() returned %zd\n", rc);
                 return -1;
             }
@@ -100,20 +100,20 @@
     printf("waiting for events...\n\n");
 
     for (;;) {
-        mx_wait_item_t items[2];
+        zx_wait_item_t items[2];
         for (int i = 0; i < idx; i++) {
             items[i].handle = dev[i].h;
-            items[i].waitfor = MX_USER_SIGNAL_0;
+            items[i].waitfor = ZX_USER_SIGNAL_0;
             items[i].pending = 0;
         }
-        mx_status_t status = mx_object_wait_many(items, idx, MX_TIME_INFINITE);
-        if (status != MX_OK) {
-            printf("mx_object_wait_many() returned %d\n", status);
+        zx_status_t status = zx_object_wait_many(items, idx, ZX_TIME_INFINITE);
+        if (status != ZX_OK) {
+            printf("zx_object_wait_many() returned %d\n", status);
             return -1;
         }
 
         for (int i = 0; i < idx; i++) {
-            if (items[i].pending & MX_USER_SIGNAL_0) {
+            if (items[i].pending & ZX_USER_SIGNAL_0) {
                 power_info_t info;
                 ssize_t rc = ioctl_power_get_info(dev[i].fd, &info);
                 if (rc != sizeof(info)) {
diff --git a/system/uapp/lspwr/rules.mk b/system/uapp/lspwr/rules.mk
index 3c0636b..1f8b957 100644
--- a/system/uapp/lspwr/rules.mk
+++ b/system/uapp/lspwr/rules.mk
@@ -11,6 +11,6 @@
 
 MODULE_SRCS += $(LOCAL_DIR)/lspwr.c
 
-MODULE_LIBS := system/ulib/magenta system/ulib/c system/ulib/mxio
+MODULE_LIBS := system/ulib/zircon system/ulib/c system/ulib/fdio
 
 include make/module.mk
diff --git a/system/uapp/lsusb/lsusb.c b/system/uapp/lsusb/lsusb.c
index e6a22a3..1c9b332 100644
--- a/system/uapp/lsusb/lsusb.c
+++ b/system/uapp/lsusb/lsusb.c
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/types.h>
-#include <mxio/io.h>
+#include <zircon/types.h>
+#include <fdio/io.h>
 #include <dirent.h>
 #include <endian.h>
 #include <fcntl.h>
@@ -14,9 +14,9 @@
 #include <unistd.h>
 #include <limits.h>
 
-#include <magenta/hw/usb.h>
-#include <magenta/hw/usb-hid.h>
-#include <magenta/device/usb.h>
+#include <zircon/hw/usb.h>
+#include <zircon/hw/usb-hid.h>
+#include <zircon/device/usb.h>
 #include <pretty/hexdump.h>
 
 #define DEV_USB "/dev/class/usb"
diff --git a/system/uapp/lsusb/rules.mk b/system/uapp/lsusb/rules.mk
index cfe2705..55baccd 100644
--- a/system/uapp/lsusb/rules.mk
+++ b/system/uapp/lsusb/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/pretty
 
-MODULE_LIBS := system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/lz4/rules.mk b/system/uapp/lz4/rules.mk
index f9b5d96..9ff3c01 100644
--- a/system/uapp/lz4/rules.mk
+++ b/system/uapp/lz4/rules.mk
@@ -15,8 +15,8 @@
 MODULE_STATIC_LIBS := third_party/ulib/lz4
 
 MODULE_LIBS := \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/midiecho/midiecho.c b/system/uapp/midiecho/midiecho.c
index 6833c78..9d0b310 100644
--- a/system/uapp/midiecho/midiecho.c
+++ b/system/uapp/midiecho/midiecho.c
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/device/midi.h>
+#include <zircon/device/midi.h>
 #include <dirent.h>
 #include <fcntl.h>
 #include <stdbool.h>
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #define DEV_MIDI   "/dev/class/midi"
 
diff --git a/system/uapp/midiecho/rules.mk b/system/uapp/midiecho/rules.mk
index c11aece..5aff9ac 100644
--- a/system/uapp/midiecho/rules.mk
+++ b/system/uapp/midiecho/rules.mk
@@ -12,6 +12,6 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/midiecho.c
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/minfs/bcache.cpp b/system/uapp/minfs/bcache.cpp
index aa0ee5e..ef65e08 100644
--- a/system/uapp/minfs/bcache.cpp
+++ b/system/uapp/minfs/bcache.cpp
@@ -13,72 +13,72 @@
 #include <fbl/alloc_checker.h>
 #include <fbl/ref_ptr.h>
 #include <fbl/unique_ptr.h>
-#include <magenta/device/device.h>
+#include <zircon/device/device.h>
 
 #include "minfs.h"
 #include "minfs-private.h"
 
 namespace minfs {
 
-mx_status_t Bcache::Readblk(blk_t bno, void* data) {
+zx_status_t Bcache::Readblk(blk_t bno, void* data) {
     off_t off = bno * kMinfsBlockSize;
     assert(off / kMinfsBlockSize == bno); // Overflow
     FS_TRACE(IO, "readblk() bno=%u off=%#llx\n", bno, (unsigned long long)off);
     if (lseek(fd_, off, SEEK_SET) < 0) {
         FS_TRACE_ERROR("minfs: cannot seek to block %u\n", bno);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     if (read(fd_, data, kMinfsBlockSize) != kMinfsBlockSize) {
         FS_TRACE_ERROR("minfs: cannot read block %u\n", bno);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Bcache::Writeblk(blk_t bno, const void* data) {
+zx_status_t Bcache::Writeblk(blk_t bno, const void* data) {
     off_t off = bno * kMinfsBlockSize;
     assert(off / kMinfsBlockSize == bno); // Overflow
     FS_TRACE(IO, "writeblk() bno=%u off=%#llx\n", bno, (unsigned long long)off);
     if (lseek(fd_, off, SEEK_SET) < 0) {
         FS_TRACE_ERROR("minfs: cannot seek to block %u\n", bno);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     if (write(fd_, data, kMinfsBlockSize) != kMinfsBlockSize) {
         FS_TRACE_ERROR("minfs: cannot write block %u\n", bno);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 int Bcache::Sync() {
     return fsync(fd_);
 }
 
-mx_status_t Bcache::Create(fbl::unique_ptr<Bcache>* out, int fd, uint32_t blockmax) {
+zx_status_t Bcache::Create(fbl::unique_ptr<Bcache>* out, int fd, uint32_t blockmax) {
     fbl::AllocChecker ac;
     fbl::unique_ptr<Bcache> bc(new (&ac) Bcache(fd, blockmax));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 #ifdef __Fuchsia__
-    mx_status_t status;
-    mx_handle_t fifo;
+    zx_status_t status;
+    zx_handle_t fifo;
     ssize_t r;
 
     if ((r = ioctl_block_get_fifos(fd, &fifo)) < 0) {
-        return static_cast<mx_status_t>(r);
+        return static_cast<zx_status_t>(r);
     } else if ((r = ioctl_block_alloc_txn(fd, &bc->txnid_)) < 0) {
-        mx_handle_close(fifo);
-        return static_cast<mx_status_t>(r);
-    } else if ((status = block_fifo_create_client(fifo, &bc->fifo_client_)) != MX_OK) {
+        zx_handle_close(fifo);
+        return static_cast<zx_status_t>(r);
+    } else if ((status = block_fifo_create_client(fifo, &bc->fifo_client_)) != ZX_OK) {
         ioctl_block_free_txn(fd, &bc->txnid_);
-        mx_handle_close(fifo);
+        zx_handle_close(fifo);
         return status;
     }
 #endif
 
     *out = fbl::move(bc);
-    return MX_OK;
+    return ZX_OK;
 }
 
 #ifdef __Fuchsia__
@@ -86,18 +86,18 @@
     return ioctl_device_get_topo_path(fd_, out, out_len);
 }
 
-mx_status_t Bcache::AttachVmo(mx_handle_t vmo, vmoid_t* out) {
-    mx_handle_t xfer_vmo;
-    mx_status_t status = mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo);
-    if (status != MX_OK) {
+zx_status_t Bcache::AttachVmo(zx_handle_t vmo, vmoid_t* out) {
+    zx_handle_t xfer_vmo;
+    zx_status_t status = zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo);
+    if (status != ZX_OK) {
         return status;
     }
     ssize_t r = ioctl_block_attach_vmo(fd_, &xfer_vmo, out);
     if (r < 0) {
-        mx_handle_close(xfer_vmo);
-        return static_cast<mx_status_t>(r);
+        zx_handle_close(xfer_vmo);
+        return static_cast<zx_status_t>(r);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 #endif
 
@@ -116,9 +116,9 @@
 }
 
 #ifndef __Fuchsia__
-// This is used by the ioctl wrappers in magenta/device/device.h. It's not
+// This is used by the ioctl wrappers in zircon/device/device.h. It's not
 // called by host tools, so just satisfy the linker with a stub.
-ssize_t mxio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len) {
+ssize_t fdio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len) {
     return -1;
 }
 #endif
diff --git a/system/uapp/minfs/host.cpp b/system/uapp/minfs/host.cpp
index 4143b71..f5f49fd 100644
--- a/system/uapp/minfs/host.cpp
+++ b/system/uapp/minfs/host.cpp
@@ -17,14 +17,14 @@
 
 #include <fs/vfs.h>
 
-#include <mxio/vfs.h>
+#include <fdio/vfs.h>
 #include "minfs.h"
 #include "minfs-private.h"
 
-static mx_status_t do_stat(fbl::RefPtr<fs::Vnode> vn, struct stat* s) {
+static zx_status_t do_stat(fbl::RefPtr<fs::Vnode> vn, struct stat* s) {
     vnattr_t a;
-    mx_status_t status = vn->Getattr(&a);
-    if (status == MX_OK) {
+    zx_status_t status = vn->Getattr(&a);
+    if (status == ZX_OK) {
         memset(s, 0, sizeof(struct stat));
         s->st_mode = a.mode;
         s->st_size = a.size;
@@ -61,9 +61,9 @@
     return fdtab + fd;
 }
 
-int status_to_errno(mx_status_t status) {
+int status_to_errno(zx_status_t status) {
     switch (status) {
-    case MX_OK:
+    case ZX_OK:
         return 0;
     default:
         return EIO;
@@ -111,7 +111,7 @@
         if (fdtab[fd].vn == nullptr) {
             const char* pathout = nullptr;
             fbl::RefPtr<fs::Vnode> vn_fs;
-            mx_status_t status = minfs::vfs.Open(fake_root, &vn_fs, path + PREFIX_SIZE, &pathout, flags, mode);
+            zx_status_t status = minfs::vfs.Open(fake_root, &vn_fs, path + PREFIX_SIZE, &pathout, flags, mode);
             if (status < 0) {
                 STATUS(status);
             }
@@ -212,8 +212,8 @@
 int emu_unlink(const char* path) {
     PATH_WRAP(path, unlink, path);
     fbl::RefPtr<fs::Vnode> vn;
-    mx_status_t status = minfs::vfs.Walk(fake_root, &vn, path + PREFIX_SIZE, &path);
-    if (status == MX_OK) {
+    zx_status_t status = minfs::vfs.Walk(fake_root, &vn, path + PREFIX_SIZE, &path);
+    if (status == ZX_OK) {
         status = vn->Unlink(path, strlen(path), false);
         vn->Close();
     }
@@ -221,14 +221,14 @@
 }
 
 int emu_rename(const char* oldpath, const char* newpath) {
-    STATUS(MX_ERR_NOT_SUPPORTED);
+    STATUS(ZX_ERR_NOT_SUPPORTED);
 }
 
 int emu_stat(const char* fn, struct stat* s) {
     PATH_WRAP(fn, stat, fn, s);
     fbl::RefPtr<fs::Vnode> vn = fake_root;
     fbl::RefPtr<fs::Vnode> cur = fake_root;
-    mx_status_t status;
+    zx_status_t status;
     const char* nextpath = nullptr;
     size_t len;
 
@@ -248,7 +248,7 @@
         }
         fbl::RefPtr<fs::Vnode> vn_fs;
         status = cur->Lookup(&vn_fs, fn, len);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return -ENOENT;
         }
         vn = fbl::RefPtr<fs::Vnode>::Downcast(vn_fs);
@@ -281,8 +281,8 @@
 DIR* emu_opendir(const char* name) {
     PATH_WRAP(name, opendir, name);
     fbl::RefPtr<fs::Vnode> vn;
-    mx_status_t status = minfs::vfs.Open(fake_root, &vn, name + PREFIX_SIZE, &name, O_RDONLY, 0);
-    if (status != MX_OK) {
+    zx_status_t status = minfs::vfs.Open(fake_root, &vn, name + PREFIX_SIZE, &name, O_RDONLY, 0);
+    if (status != ZX_OK) {
         return nullptr;
     }
     MINDIR* dir = (MINDIR*)calloc(1, sizeof(MINDIR));
@@ -305,7 +305,7 @@
             }
             dir->size = 0;
         }
-        mx_status_t status = dir->vn->Readdir(&dir->cookie, &dir->data, DIR_BUFSIZE);
+        zx_status_t status = dir->vn->Readdir(&dir->cookie, &dir->data, DIR_BUFSIZE);
         if (status <= 0) {
             break;
         }
diff --git a/system/uapp/minfs/main.cpp b/system/uapp/minfs/main.cpp
index 4798827..ea23886 100644
--- a/system/uapp/minfs/main.cpp
+++ b/system/uapp/minfs/main.cpp
@@ -13,9 +13,9 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
+#include <zircon/compiler.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
 #include <fbl/unique_ptr.h>
 
 #ifdef __Fuchsia__
@@ -53,18 +53,18 @@
         return -1;
     }
 
-    mx_handle_t h = mx_get_startup_handle(PA_HND(PA_USER0, 0));
-    if (h == MX_HANDLE_INVALID) {
+    zx_handle_t h = zx_get_startup_handle(PA_HND(PA_USER0, 0));
+    if (h == ZX_HANDLE_INVALID) {
         FS_TRACE_ERROR("minfs: Could not access startup handle to mount point\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     async::Loop loop;
     fs::AsyncDispatcher dispatcher(loop.async());
     minfs::vfs.SetDispatcher(&dispatcher);
-    mx_status_t status;
+    zx_status_t status;
     if ((status = minfs::vfs.ServeDirectory(fbl::move(vn),
-                                            mx::channel(h))) != MX_OK) {
+                                            zx::channel(h))) != ZX_OK) {
         return status;
     }
     loop.Run();
@@ -382,7 +382,7 @@
 found:
     if ((fd = open(fn, flags, 0644)) < 0) {
         if (flags & O_CREAT) {
-            // temporary workaround for Magenta devfs issue
+            // temporary workaround for Zircon devfs issue
             flags &= (~O_CREAT);
             goto found;
         }
diff --git a/system/uapp/minfs/minfs-check.cpp b/system/uapp/minfs/minfs-check.cpp
index b1056dd..f5488f3 100644
--- a/system/uapp/minfs/minfs-check.cpp
+++ b/system/uapp/minfs/minfs-check.cpp
@@ -12,11 +12,11 @@
 
 namespace minfs {
 
-mx_status_t MinfsChecker::GetInode(minfs_inode_t* inode, ino_t ino) {
+zx_status_t MinfsChecker::GetInode(minfs_inode_t* inode, ino_t ino) {
     if (ino >= fs_->info_.inode_count) {
         FS_TRACE_ERROR("check: ino %u out of range (>=%u)\n",
               ino, fs_->info_.inode_count);
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     blk_t bno_of_ino = ino / kMinfsInodesPerBlock;
     uint32_t off_of_ino = (ino % kMinfsInodesPerBlock) * kMinfsInodeSize;
@@ -25,22 +25,22 @@
     memcpy(inode, reinterpret_cast<void*>(iaddr), kMinfsInodeSize);
     if ((inode->magic != kMinfsMagicFile) && (inode->magic != kMinfsMagicDir)) {
         FS_TRACE_ERROR("check: ino %u has bad magic %#x\n", ino, inode->magic);
-        return MX_ERR_IO_DATA_INTEGRITY;
+        return ZX_ERR_IO_DATA_INTEGRITY;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 #define CD_DUMP 1
 #define CD_RECURSE 2
 
-mx_status_t MinfsChecker::GetInodeNthBno(minfs_inode_t* inode, blk_t n,
+zx_status_t MinfsChecker::GetInodeNthBno(minfs_inode_t* inode, blk_t n,
                                          blk_t* next_n, blk_t* bno_out) {
     // The default value for the "next n". It's easier to set it here anyway,
     // since we proceed to modify n in the code below.
     *next_n = n + 1;
     if (n < kMinfsDirect) {
         *bno_out = inode->dnum[n];
-        return MX_OK;
+        return ZX_OK;
     }
 
     n -= kMinfsDirect;
@@ -52,16 +52,16 @@
         if ((ibno = inode->inum[i]) == 0) {
             *bno_out = 0;
             *next_n = kMinfsDirect + (i + 1) * kMinfsDirectPerIndirect;
-            return MX_OK;
+            return ZX_OK;
         }
         char data[kMinfsBlockSize];
-        mx_status_t status;
-        if ((status = fs_->bc_->Readblk(ibno + fs_->info_.dat_block, data)) != MX_OK) {
+        zx_status_t status;
+        if ((status = fs_->bc_->Readblk(ibno + fs_->info_.dat_block, data)) != ZX_OK) {
             return status;
         }
         uint32_t* ientry = reinterpret_cast<uint32_t*>(data);
         *bno_out = ientry[j];
-        return MX_OK;
+        return ZX_OK;
     }
 
     n -= kMinfsIndirect * kMinfsDirectPerIndirect;
@@ -77,12 +77,12 @@
             *bno_out = 0;
             *next_n = kMinfsDirect + kMinfsIndirect * kMinfsDirectPerIndirect +
                     (i + 1) * kMinfsDirectPerDindirect;
-            return MX_OK;
+            return ZX_OK;
         }
 
         if (cached_doubly_indirect_ != dibno) {
-            mx_status_t status;
-            if ((status = fs_->bc_->Readblk(dibno, doubly_indirect_cache_)) != MX_OK) {
+            zx_status_t status;
+            if ((status = fs_->bc_->Readblk(dibno, doubly_indirect_cache_)) != ZX_OK) {
                 return status;
             }
             cached_doubly_indirect_ = dibno;
@@ -94,12 +94,12 @@
             *bno_out = 0;
             *next_n = kMinfsDirect + kMinfsIndirect * kMinfsDirectPerIndirect +
                     (i * kMinfsDirectPerDindirect) + (j + 1) * kMinfsDirectPerIndirect;
-            return MX_OK;
+            return ZX_OK;
         }
 
         if (cached_indirect_ != ibno) {
-            mx_status_t status;
-            if ((status = fs_->bc_->Readblk(ibno, indirect_cache_)) != MX_OK) {
+            zx_status_t status;
+            if ((status = fs_->bc_->Readblk(ibno, indirect_cache_)) != ZX_OK) {
                 return status;
             }
             cached_indirect_ = ibno;
@@ -107,22 +107,22 @@
 
         uint32_t* ientry = reinterpret_cast<uint32_t*>(indirect_cache_);
         *bno_out = ientry[k];
-        return MX_OK;
+        return ZX_OK;
     }
 
-    return MX_ERR_OUT_OF_RANGE;
+    return ZX_ERR_OUT_OF_RANGE;
 }
 
-mx_status_t MinfsChecker::CheckDirectory(minfs_inode_t* inode, ino_t ino,
+zx_status_t MinfsChecker::CheckDirectory(minfs_inode_t* inode, ino_t ino,
                                          ino_t parent, uint32_t flags) {
     unsigned eno = 0;
     bool dot = false;
     bool dotdot = false;
     uint32_t dirent_count = 0;
 
-    mx_status_t status;
+    zx_status_t status;
     fbl::RefPtr<VnodeMinfs> vn;
-    if ((status = VnodeMinfs::AllocateHollow(fs_.get(), &vn)) != MX_OK) {
+    if ((status = VnodeMinfs::AllocateHollow(fs_.get(), &vn)) != ZX_OK) {
         return status;
     }
     memcpy(&vn->inode_, inode, kMinfsInodeSize);
@@ -134,7 +134,7 @@
         uint32_t data[MINFS_DIRENT_SIZE];
         size_t actual;
         status = vn->ReadInternal(data, MINFS_DIRENT_SIZE, off, &actual);
-        if (status != MX_OK || actual != MINFS_DIRENT_SIZE) {
+        if (status != ZX_OK || actual != MINFS_DIRENT_SIZE) {
             FS_TRACE_ERROR("check: ino#%u: Could not read de[%u] at %zd\n", eno, ino, off);
             if (inode->dirent_count >= 2 && inode->dirent_count == eno - 1) {
                 // So we couldn't read the last direntry, for whatever reason, but our
@@ -149,22 +149,22 @@
                 if (c == 'y') {
                     // Mark the 'last' visible direntry as last.
                     status = vn->ReadInternal(data, MINFS_DIRENT_SIZE, prev_off, &actual);
-                    if (status != MX_OK || actual != MINFS_DIRENT_SIZE) {
+                    if (status != ZX_OK || actual != MINFS_DIRENT_SIZE) {
                         FS_TRACE_ERROR("check: Error trying to update last dirent as 'last': %d.\n"
                               "Can't read the last dirent even though we just did earlier.\n",
                               status);
-                        return status < 0 ? status : MX_ERR_IO;
+                        return status < 0 ? status : ZX_ERR_IO;
                     }
                     minfs_dirent_t* de = reinterpret_cast<minfs_dirent_t*>(data);
                     de->reclen |= kMinfsReclenLast;
                     WriteTxn txn(fs_->bc_.get());
                     vn->WriteInternal(&txn, data, MINFS_DIRENT_SIZE, prev_off, &actual);
-                    return MX_OK;
+                    return ZX_OK;
                 } else {
-                    return MX_ERR_IO;
+                    return ZX_ERR_IO;
                 }
             } else {
-                return status < 0 ? status : MX_ERR_IO;
+                return status < 0 ? status : ZX_ERR_IO;
             }
         }
         minfs_dirent_t* de = reinterpret_cast<minfs_dirent_t*>(data);
@@ -173,7 +173,7 @@
         if (!is_last && ((rlen < MINFS_DIRENT_SIZE) ||
                          (rlen > kMinfsMaxDirentSize) || (rlen & 3))) {
             FS_TRACE_ERROR("check: ino#%u: de[%u]: bad dirent reclen (%u)\n", ino, eno, rlen);
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         }
         if (de->ino == 0) {
             if (flags & CD_DUMP) {
@@ -183,16 +183,16 @@
             // Re-read the dirent to acquire the full name
             uint32_t record_full[DirentSize(NAME_MAX)];
             status = vn->ReadInternal(record_full, DirentSize(de->namelen), off, &actual);
-            if (status != MX_OK || actual != DirentSize(de->namelen)) {
+            if (status != ZX_OK || actual != DirentSize(de->namelen)) {
                 FS_TRACE_ERROR("check: Error reading dirent of size: %u\n", DirentSize(de->namelen));
-                return MX_ERR_IO;
+                return ZX_ERR_IO;
             }
             de = reinterpret_cast<minfs_dirent_t*>(record_full);
             bool dot_or_dotdot = false;
 
             if ((de->namelen == 0) || (de->namelen > (rlen - MINFS_DIRENT_SIZE))) {
                 FS_TRACE_ERROR("check: ino#%u: de[%u]: invalid namelen %u\n", ino, eno, de->namelen);
-                return MX_ERR_IO_DATA_INTEGRITY;
+                return ZX_ERR_IO_DATA_INTEGRITY;
             }
             if ((de->namelen == 1) && (de->name[0] == '.')) {
                 if (dot) {
@@ -245,7 +245,7 @@
     if (dotdot == false) {
         FS_TRACE_ERROR("check: ino#%u: directory missing '..'\n", ino);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 const char* MinfsChecker::CheckDataBlock(blk_t bno) {
@@ -266,7 +266,7 @@
     return nullptr;
 }
 
-mx_status_t MinfsChecker::CheckFile(minfs_inode_t* inode, ino_t ino) {
+zx_status_t MinfsChecker::CheckFile(minfs_inode_t* inode, ino_t ino) {
     FS_TRACE_INFO("Direct blocks: \n");
     for (unsigned n = 0; n < kMinfsDirect; n++) {
         FS_TRACE_INFO(" %d,", inode->dnum[n]);
@@ -300,8 +300,8 @@
             block_count++;
 
             char data[kMinfsBlockSize];
-            mx_status_t status;
-            if ((status = fs_->bc_->Readblk(inode->dinum[n], data)) != MX_OK) {
+            zx_status_t status;
+            if ((status = fs_->bc_->Readblk(inode->dinum[n], data)) != ZX_OK) {
                 return status;
             }
             uint32_t* entry = reinterpret_cast<uint32_t*>(data);
@@ -329,11 +329,11 @@
 
     blk_t n = 0;
     while (true) {
-        mx_status_t status;
+        zx_status_t status;
         blk_t bno;
         blk_t next_n;
         if ((status = GetInodeNthBno(inode, n, &next_n, &bno)) < 0) {
-            if (status == MX_ERR_OUT_OF_RANGE) {
+            if (status == ZX_ERR_OUT_OF_RANGE) {
                 break;
             } else {
                 return status;
@@ -363,12 +363,12 @@
              ino, inode->block_count, block_count);
         conforming_ = false;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t MinfsChecker::CheckInode(ino_t ino, ino_t parent, bool dot_or_dotdot) {
+zx_status_t MinfsChecker::CheckInode(ino_t ino, ino_t parent, bool dot_or_dotdot) {
     minfs_inode_t inode;
-    mx_status_t status;
+    zx_status_t status;
 
     if ((status = GetInode(&inode, ino)) < 0) {
         FS_TRACE_ERROR("check: ino#%u: not readable\n", ino);
@@ -379,14 +379,14 @@
 
     if (inode.magic == kMinfsMagicDir && prev_checked && !dot_or_dotdot) {
         FS_TRACE_ERROR("check: ino#%u: Multiple hard links to directory (excluding '.' and '..') found\n", ino);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     links_[ino - 1] += 1;
 
     if (prev_checked) {
         // we've been here before
-        return MX_OK;
+        return ZX_OK;
     }
 
     links_[ino - 1] -= inode.link_count;
@@ -417,10 +417,10 @@
             return status;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t MinfsChecker::CheckForUnusedBlocks() const {
+zx_status_t MinfsChecker::CheckForUnusedBlocks() const {
     unsigned missing = 0;
     for (unsigned n = fs_->info_.dat_block; n < fs_->info_.block_count; n++) {
         if (fs_->block_map_.Get(n, n + 1)) {
@@ -432,12 +432,12 @@
     if (missing) {
         FS_TRACE_ERROR("check: %u allocated block%s not in use\n",
               missing, missing > 1 ? "s" : "");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t MinfsChecker::CheckForUnusedInodes() const {
+zx_status_t MinfsChecker::CheckForUnusedInodes() const {
     unsigned missing = 0;
     for (unsigned n = 1; n < fs_->info_.inode_count; n++) {
         if (fs_->inode_map_.Get(n, n + 1)) {
@@ -449,38 +449,38 @@
     if (missing) {
         FS_TRACE_ERROR("check: %u allocated inode%s not in use\n",
               missing, missing > 1 ? "s" : "");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t MinfsChecker::CheckLinkCounts() const {
+zx_status_t MinfsChecker::CheckLinkCounts() const {
     unsigned error = 0;
     for (uint32_t n = 0; n < fs_->info_.inode_count; n++) {
         if (links_[n] != 0) {
             error += 1;
             FS_TRACE_ERROR("check: inode#%u has incorrect link count %u\n", n + 1, links_[n]);
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
     }
     if (error) {
         FS_TRACE_ERROR("check: %u inode%s with incorrect link count\n",
               error, error > 1 ? "s" : "");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t MinfsChecker::CheckAllocatedCounts() const {
-    mx_status_t status = MX_OK;
+zx_status_t MinfsChecker::CheckAllocatedCounts() const {
+    zx_status_t status = ZX_OK;
     if (alloc_blocks_ != fs_->info_.alloc_block_count) {
         FS_TRACE_ERROR("check: incorrect allocated block count %u (should be %u)\n", fs_->info_.alloc_block_count, alloc_blocks_);
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     }
 
     if (alloc_inodes_ != fs_->info_.alloc_inode_count) {
         FS_TRACE_ERROR("check: incorrect allocated inode count %u (should be %u)\n", fs_->info_.alloc_inode_count, alloc_inodes_);
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
     }
 
     return status;
@@ -489,14 +489,14 @@
 MinfsChecker::MinfsChecker()
     : conforming_(true), fs_(nullptr), alloc_inodes_(0), alloc_blocks_(0), links_() {};
 
-mx_status_t MinfsChecker::Init(fbl::unique_ptr<Bcache> bc, const minfs_info_t* info) {
+zx_status_t MinfsChecker::Init(fbl::unique_ptr<Bcache> bc, const minfs_info_t* info) {
     links_.reset(new int32_t[info->inode_count]{0}, info->inode_count);
     links_[0] = -1;
 
     cached_doubly_indirect_ = 0;
     cached_indirect_ = 0;
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = checked_inodes_.Reset(info->inode_count)) < 0) {
         return status;
     }
@@ -508,11 +508,11 @@
         return status;
     }
     fs_.reset(fs);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t minfs_check(fbl::unique_ptr<Bcache> bc) {
-    mx_status_t status;
+zx_status_t minfs_check(fbl::unique_ptr<Bcache> bc) {
+    zx_status_t status;
 
     char data[kMinfsBlockSize];
     if (bc->Readblk(0, data) < 0) {
@@ -526,7 +526,7 @@
     }
 
     MinfsChecker chk;
-    if ((status = chk.Init(fbl::move(bc), info)) != MX_OK) {
+    if ((status = chk.Init(fbl::move(bc), info)) != ZX_OK) {
         return status;
     }
 
@@ -535,24 +535,24 @@
         return status;
     }
 
-    status = MX_OK;
-    mx_status_t r;
+    status = ZX_OK;
+    zx_status_t r;
 
     // Save an error if it occurs, but check for subsequent errors
     // anyway.
     r = chk.CheckForUnusedBlocks();
-    status |= (status != MX_OK) ? 0 : r;
+    status |= (status != ZX_OK) ? 0 : r;
     r = chk.CheckForUnusedInodes();
-    status |= (status != MX_OK) ? 0 : r;
+    status |= (status != ZX_OK) ? 0 : r;
     r = chk.CheckLinkCounts();
-    status |= (status != MX_OK) ? 0 : r;
+    status |= (status != ZX_OK) ? 0 : r;
     r = chk.CheckAllocatedCounts();
-    status |= (status != MX_OK) ? 0 : r;
+    status |= (status != ZX_OK) ? 0 : r;
 
     //TODO: check allocated inodes that were abandoned
     //TODO: check allocated blocks that were not accounted for
     //TODO: check unallocated inodes where magic != 0
-    status |= (status != MX_OK) ? 0 : (chk.conforming_ ? MX_OK : MX_ERR_BAD_STATE);
+    status |= (status != ZX_OK) ? 0 : (chk.conforming_ ? ZX_OK : ZX_ERR_BAD_STATE);
 
     return status;
 }
diff --git a/system/uapp/minfs/minfs-ops.cpp b/system/uapp/minfs/minfs-ops.cpp
index ceafe39..2e76890 100644
--- a/system/uapp/minfs/minfs-ops.cpp
+++ b/system/uapp/minfs/minfs-ops.cpp
@@ -12,22 +12,22 @@
 
 #include <fs/block-txn.h>
 #include <fbl/algorithm.h>
-#include <magenta/device/vfs.h>
+#include <zircon/device/vfs.h>
 
 #ifdef __Fuchsia__
-#include <magenta/syscalls.h>
-#include <mxio/vfs.h>
+#include <zircon/syscalls.h>
+#include <fdio/vfs.h>
 #endif
 
 #include "minfs-private.h"
 
 namespace {
 
-mx_time_t minfs_gettime_utc() {
-    // linux/magenta compatible
+zx_time_t minfs_gettime_utc() {
+    // linux/zircon compatible
     struct timespec ts;
     clock_gettime(CLOCK_REALTIME, &ts);
-    mx_time_t time = MX_SEC(ts.tv_sec)+ts.tv_nsec;
+    zx_time_t time = ZX_SEC(ts.tv_sec)+ts.tv_nsec;
     return time;
 }
 
@@ -36,26 +36,26 @@
 namespace minfs {
 
 #ifdef __Fuchsia__
-mx_status_t VnodeMinfs::VmoReadExact(void* data, uint64_t offset, size_t len) {
+zx_status_t VnodeMinfs::VmoReadExact(void* data, uint64_t offset, size_t len) {
     size_t actual;
-    mx_status_t status = vmo_.read(data, offset, len, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = vmo_.read(data, offset, len, &actual);
+    if (status != ZX_OK) {
         return status;
     } else if (actual != len) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::VmoWriteExact(const void* data, uint64_t offset, size_t len) {
+zx_status_t VnodeMinfs::VmoWriteExact(const void* data, uint64_t offset, size_t len) {
     size_t actual;
-    mx_status_t status = vmo_.write(data, offset, len, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = vmo_.write(data, offset, len, &actual);
+    if (status != ZX_OK) {
         return status;
     } else if (actual != len) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 #endif
 
@@ -63,7 +63,7 @@
 void VnodeMinfs::InodeSync(WriteTxn* txn, uint32_t flags) {
     // by default, c/mtimes are not updated to current time
     if (flags != kMxFsSyncDefault) {
-        mx_time_t cur_time = minfs_gettime_utc();
+        zx_time_t cur_time = minfs_gettime_utc();
         // update times before syncing
         if ((flags & kMxFsSyncMtime) != 0) {
             inode_.modify_time = cur_time;
@@ -76,7 +76,7 @@
     fs_->InodeSync(txn, ino_, &inode_);
 }
 
-mx_status_t VnodeMinfs::BlocksShrinkDirect(WriteTxn *txn, size_t count, blk_t* barray,
+zx_status_t VnodeMinfs::BlocksShrinkDirect(WriteTxn *txn, size_t count, blk_t* barray,
                                            bool* dirty) {
     // release direct blocks
     for (unsigned i = 0; i < count; i++) {
@@ -90,10 +90,10 @@
         *dirty = true;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::BlocksShrinkIndirect(WriteTxn* txn, uint32_t bindex, size_t count,
+zx_status_t VnodeMinfs::BlocksShrinkIndirect(WriteTxn* txn, uint32_t bindex, size_t count,
                                              uint32_t ib_vmo_offset, blk_t* iarray,
                                              bool* dirty) {
     // release indirect blocks
@@ -112,10 +112,10 @@
 #endif
 
         // release the blocks pointed at by the entries in the indirect block
-        mx_status_t status;
+        zx_status_t status;
         uint32_t direct_start = i == 0 ? bindex : 0;
         if ((status = BlocksShrinkDirect(txn, kMinfsDirectPerIndirect - direct_start,
-                                         &entry[direct_start], dirty)) != MX_OK) {
+                                         &entry[direct_start], dirty)) != ZX_OK) {
             return status;
         }
 
@@ -138,10 +138,10 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::BlocksShrinkDoublyIndirect(WriteTxn *txn, uint32_t ibindex, uint32_t bindex,
+zx_status_t VnodeMinfs::BlocksShrinkDoublyIndirect(WriteTxn *txn, uint32_t ibindex, uint32_t bindex,
                                                    size_t count, uint32_t dib_vmo_offset,
                                                    uint32_t ib_vmo_offset, blk_t* diarray,
                                                    bool* dirty) {
@@ -164,12 +164,12 @@
         // release the blocks pointed at by the entries in the indirect block
         uint32_t indirect_start = i == 0 ? ibindex : 0;
         uint32_t direct_start = (i == 0 && indirect_start == ibindex) ? bindex : 0;
-        mx_status_t status;
+        zx_status_t status;
         if ((status = BlocksShrinkIndirect(txn, direct_start,
                                            kMinfsDirectPerIndirect - indirect_start,
                                            ib_vmo_offset + i + indirect_start,
                                            &dientry[indirect_start], dirty))
-            != MX_OK) {
+            != ZX_OK) {
             return status;
         }
 
@@ -192,19 +192,19 @@
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Delete all blocks (relative to a file) from "start" (inclusive) to the end of
 // the file. Does not update mtime/atime.
-mx_status_t VnodeMinfs::BlocksShrink(WriteTxn *txn, blk_t start) {
+zx_status_t VnodeMinfs::BlocksShrink(WriteTxn *txn, blk_t start) {
     bool dirty = false;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     size_t size = (kMinfsIndirect + kMinfsDoublyIndirect) * kMinfsBlockSize;
 
     size_t count = start <= kMinfsDirect ? kMinfsDirect - start : 0;
     if ((status = BlocksShrinkDirect(txn, count, &inode_.dnum[start], &dirty))
-        != MX_OK) {
+        != ZX_OK) {
         return status;
     }
 
@@ -218,7 +218,7 @@
     uint32_t bindex = start % kMinfsDirectPerIndirect;
     count = ibindex <= kMinfsIndirect ? kMinfsIndirect - ibindex : 0;
     if ((status = BlocksShrinkIndirect(txn, bindex, count, 0, &inode_.inum[ibindex], &dirty))
-        != MX_OK) {
+        != ZX_OK) {
         return status;
     }
 
@@ -245,13 +245,13 @@
     if ((status = BlocksShrinkDoublyIndirect(txn, ibindex, bindex, count,
                                              GetVmoOffsetForDoublyIndirect(dibindex),
                                              GetVmoOffsetForIndirect(dibindex),
-                                             &inode_.dinum[dibindex], &dirty)) != MX_OK) {
+                                             &inode_.dinum[dibindex], &dirty)) != ZX_OK) {
         return status;
     }
 
 #ifdef __Fuchsia__
     if (vmo_indirect_ != nullptr && vmo_indirect_->GetSize() > size) {
-        if ((status = vmo_indirect_->Shrink(0, size)) != MX_OK) {
+        if ((status = vmo_indirect_->Shrink(0, size)) != ZX_OK) {
             return status;
         }
     }
@@ -261,20 +261,20 @@
         InodeSync(txn, kMxFsSyncDefault);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 #ifdef __Fuchsia__
-mx_status_t VnodeMinfs::LoadIndirectBlocks(blk_t* iarray, uint32_t count, uint32_t offset,
+zx_status_t VnodeMinfs::LoadIndirectBlocks(blk_t* iarray, uint32_t count, uint32_t offset,
                                            uint64_t size) {
-    mx_status_t status;
-    if ((status = InitIndirectVmo()) != MX_OK) {
+    zx_status_t status;
+    if ((status = InitIndirectVmo()) != ZX_OK) {
         return status;
     }
 
     if (vmo_indirect_->GetSize() < size) {
-        mx_status_t status;
-        if ((status = vmo_indirect_->Grow(size)) != MX_OK) {
+        zx_status_t status;
+        if ((status = vmo_indirect_->Grow(size)) != ZX_OK) {
             return status;
         }
     }
@@ -292,30 +292,30 @@
     return txn.Flush();
 }
 
-mx_status_t VnodeMinfs::LoadIndirectWithinDoublyIndirect(uint32_t dindex) {
+zx_status_t VnodeMinfs::LoadIndirectWithinDoublyIndirect(uint32_t dindex) {
     uint32_t* dientry;
     ReadIndirectVmoBlock(GetVmoOffsetForDoublyIndirect(dindex), &dientry);
     return LoadIndirectBlocks(dientry, kMinfsDirectPerIndirect, GetVmoOffsetForIndirect(dindex),
                               GetVmoSizeForIndirect(dindex));
 }
 
-mx_status_t VnodeMinfs::InitIndirectVmo() {
+zx_status_t VnodeMinfs::InitIndirectVmo() {
     if (vmo_indirect_ != nullptr) {
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = MappedVmo::Create(kMinfsBlockSize * (kMinfsIndirect + kMinfsDoublyIndirect),
-                                    "minfs-indirect", &vmo_indirect_)) != MX_OK) {
+                                    "minfs-indirect", &vmo_indirect_)) != ZX_OK) {
         return status;
     }
-    if ((status = fs_->bc_->AttachVmo(vmo_indirect_->GetVmo(), &vmoid_indirect_)) != MX_OK) {
+    if ((status = fs_->bc_->AttachVmo(vmo_indirect_->GetVmo(), &vmoid_indirect_)) != ZX_OK) {
         vmo_indirect_ = nullptr;
         return status;
     }
 
     // Load initial set of indirect blocks
-    if ((status = LoadIndirectBlocks(inode_.inum, kMinfsIndirect, 0, 0)) != MX_OK) {
+    if ((status = LoadIndirectBlocks(inode_.inum, kMinfsIndirect, 0, 0)) != ZX_OK) {
         vmo_indirect_ = nullptr;
         return status;
     }
@@ -323,12 +323,12 @@
     // Load doubly indirect blocks
     if ((status = LoadIndirectBlocks(inode_.dinum, kMinfsDoublyIndirect,
                                      GetVmoOffsetForDoublyIndirect(0),
-                                     GetVmoSizeForDoublyIndirect()) != MX_OK)) {
+                                     GetVmoSizeForDoublyIndirect()) != ZX_OK)) {
         vmo_indirect_ = nullptr;
         return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Since we cannot yet register the filesystem as a paging service (and cleanly
@@ -338,21 +338,21 @@
 // TODO(smklein): Even this hack can be optimized; a bitmap could be used to
 // track all 'empty/read/dirty' blocks for each vnode, rather than reading
 // the entire file.
-mx_status_t VnodeMinfs::InitVmo() {
+zx_status_t VnodeMinfs::InitVmo() {
     if (vmo_.is_valid()) {
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t status;
-    if ((status = mx::vmo::create(fbl::roundup(inode_.size, kMinfsBlockSize),
-                                  0, &vmo_)) != MX_OK) {
+    zx_status_t status;
+    if ((status = zx::vmo::create(fbl::roundup(inode_.size, kMinfsBlockSize),
+                                  0, &vmo_)) != ZX_OK) {
         FS_TRACE_ERROR("Failed to initialize vmo; error: %d\n", status);
         return status;
     }
 
-    mx_object_set_property(vmo_.get(), MX_PROP_NAME, "minfs-inode", 11);
+    zx_object_set_property(vmo_.get(), ZX_PROP_NAME, "minfs-inode", 11);
 
-    if ((status = fs_->bc_->AttachVmo(vmo_.get(), &vmoid_)) != MX_OK) {
+    if ((status = fs_->bc_->AttachVmo(vmo_.get(), &vmoid_)) != ZX_OK) {
         vmo_.reset();
         return status;
     }
@@ -374,7 +374,7 @@
             fs_->ValidateBno(ibno);
 
             // Only initialize the indirect vmo if it is being used.
-            if ((status = InitIndirectVmo()) != MX_OK) {
+            if ((status = InitIndirectVmo()) != ZX_OK) {
                 vmo_.reset();
                 return status;
             }
@@ -400,7 +400,7 @@
             fs_->ValidateBno(dibno);
 
             // Only initialize the doubly indirect vmo if it is being used.
-            if ((status = InitIndirectVmo()) != MX_OK) {
+            if ((status = InitIndirectVmo()) != ZX_OK) {
                 vmo_.reset();
                 return status;
             }
@@ -414,7 +414,7 @@
                     fs_->ValidateBno(ibno);
 
                     // Only initialize the indirect vmo if it is being used.
-                    if ((status = LoadIndirectWithinDoublyIndirect(i)) != MX_OK) {
+                    if ((status = LoadIndirectWithinDoublyIndirect(i)) != ZX_OK) {
                         vmo_.reset();
                         return status;
                     }
@@ -439,14 +439,14 @@
 }
 #endif
 
-mx_status_t VnodeMinfs::GetBnoDirect(WriteTxn* txn, blk_t* bno, bool* dirty) {
+zx_status_t VnodeMinfs::GetBnoDirect(WriteTxn* txn, blk_t* bno, bool* dirty) {
     // direct blocks are simple... is there an entry in dnum[]?
     blk_t hint = 0;
 
     if ((*bno == 0) && (txn != nullptr)) {
         // allocate a new block
-        mx_status_t status = fs_->BlockNew(txn, hint, bno);
-        if (status != MX_OK) {
+        zx_status_t status = fs_->BlockNew(txn, hint, bno);
+        if (status != ZX_OK) {
             return status;
         }
         inode_.block_count++;
@@ -454,16 +454,16 @@
     }
 
     fs_->ValidateBno(*bno);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::GetBnoIndirect(WriteTxn* txn, uint32_t bindex, uint32_t ib_vmo_offset,
+zx_status_t VnodeMinfs::GetBnoIndirect(WriteTxn* txn, uint32_t bindex, uint32_t ib_vmo_offset,
                                        blk_t* ibno, blk_t* bno, bool* dirty) {
     // we should have initialized vmo before calling this method
-    mx_status_t status;
+    zx_status_t status;
 
 #ifdef __Fuchsia__
-    if ((status = VnodeMinfs::InitIndirectVmo()) != MX_OK) {
+    if ((status = VnodeMinfs::InitIndirectVmo()) != ZX_OK) {
         return status;
     }
 #endif
@@ -471,7 +471,7 @@
     // retrieve indirect block at this index
     if ((*ibno == 0) && (txn != nullptr)) {
         // allocate new indirect block if it does not exist
-        if ((status = fs_->BlockNew(txn, 0, ibno)) != MX_OK) {
+        if ((status = fs_->BlockNew(txn, 0, ibno)) != ZX_OK) {
             return status;
         }
 
@@ -494,7 +494,7 @@
 #endif
 
     bool direct_dirty = false;
-    if ((status = GetBnoDirect(txn, &ientry[bindex], &direct_dirty)) != MX_OK) {
+    if ((status = GetBnoDirect(txn, &ientry[bindex], &direct_dirty)) != ZX_OK) {
         return status;
     }
 
@@ -510,26 +510,26 @@
         InodeSync(txn, kMxFsSyncDefault);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::GetBnoDoublyIndirect(WriteTxn* txn, uint32_t ibindex, uint32_t bindex,
+zx_status_t VnodeMinfs::GetBnoDoublyIndirect(WriteTxn* txn, uint32_t ibindex, uint32_t bindex,
                                              uint32_t dib_vmo_offset, uint32_t ib_vmo_offset,
                                              blk_t* dibno, blk_t* bno, bool* dirty) {
-    mx_status_t status;
+    zx_status_t status;
 #ifdef __Fuchsia__
     // If the vmo_indirect_ vmo has not been created, make it now.
-    if ((status = InitIndirectVmo()) != MX_OK) {
+    if ((status = InitIndirectVmo()) != ZX_OK) {
         return status;
     }
 
-    MX_DEBUG_ASSERT(vmo_indirect_ != nullptr);
+    ZX_DEBUG_ASSERT(vmo_indirect_ != nullptr);
 #endif
 
     // look up the doubly indirect bno, create if it doesn't already exist
     if ((*dibno == 0) && (txn != nullptr)) {
         // allocate a new doubly indirect block
-        if ((status = fs_->BlockNew(txn, 0, dibno)) != MX_OK) {
+        if ((status = fs_->BlockNew(txn, 0, dibno)) != ZX_OK) {
             return status;
         }
 
@@ -556,7 +556,7 @@
     // get indirect block
     bool indirect_dirty = false;
     if ((status = GetBnoIndirect(txn, bindex, ib_vmo_offset + ibindex, &dientry[ibindex], bno,
-                                 &indirect_dirty)) != MX_OK) {
+                                 &indirect_dirty)) != ZX_OK) {
         return status;
     }
 
@@ -570,18 +570,18 @@
         InodeSync(txn, kMxFsSyncDefault);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 #ifdef __Fuchsia__
 void VnodeMinfs::ReadIndirectVmoBlock(uint32_t offset, uint32_t** entry) {
-    MX_DEBUG_ASSERT(vmo_indirect_ != nullptr);
+    ZX_DEBUG_ASSERT(vmo_indirect_ != nullptr);
     uintptr_t addr = reinterpret_cast<uintptr_t>(vmo_indirect_->GetData());
     *entry = reinterpret_cast<uint32_t*>(addr + kMinfsBlockSize * offset);
 }
 
 void VnodeMinfs::ClearIndirectVmoBlock(uint32_t offset) {
-    MX_DEBUG_ASSERT(vmo_indirect_ != nullptr);
+    ZX_DEBUG_ASSERT(vmo_indirect_ != nullptr);
     uintptr_t addr = reinterpret_cast<uintptr_t>(vmo_indirect_->GetData());
     memset(reinterpret_cast<void*>(addr + kMinfsBlockSize * offset), 0, kMinfsBlockSize);
 }
@@ -598,11 +598,11 @@
 #endif
 
 // Get the bno corresponding to the nth logical block within the file.
-mx_status_t VnodeMinfs::GetBno(WriteTxn* txn, blk_t n, blk_t* bno) {
+zx_status_t VnodeMinfs::GetBno(WriteTxn* txn, blk_t n, blk_t* bno) {
     bool dirty = false;
 
     if (n < kMinfsDirect) {
-        mx_status_t status = GetBnoDirect(txn, &inode_.dnum[n], &dirty);
+        zx_status_t status = GetBnoDirect(txn, &inode_.dnum[n], &dirty);
         *bno = inode_.dnum[n];
         return status;
     }
@@ -624,7 +624,7 @@
     if (n < kMinfsDoublyIndirect * kMinfsDirectPerIndirect * kMinfsDirectPerIndirect) {
         // index of doubly indirect block
         uint32_t dibindex = n / (kMinfsDirectPerIndirect * kMinfsDirectPerIndirect);
-        MX_DEBUG_ASSERT(dibindex < kMinfsDoublyIndirect);
+        ZX_DEBUG_ASSERT(dibindex < kMinfsDoublyIndirect);
         n -= (dibindex * kMinfsDirectPerIndirect * kMinfsDirectPerIndirect);
         // index of indirect block within doubly indirect block
         uint32_t ibindex = n / kMinfsDirectPerIndirect;
@@ -633,10 +633,10 @@
 
     #ifdef __Fuchsia__
         // Grow VMO if we need more space to fit this set of indirect blocks
-        mx_status_t status;
+        zx_status_t status;
         uint64_t vmo_size = GetVmoSizeForIndirect(dibindex);
         if (vmo_indirect_->GetSize() < vmo_size) {
-            if ((status = vmo_indirect_->Grow(vmo_size)) != MX_OK) {
+            if ((status = vmo_indirect_->Grow(vmo_size)) != ZX_OK) {
                 return status;
             }
         }
@@ -647,7 +647,7 @@
                                     &dirty);
     }
 
-    return MX_ERR_OUT_OF_RANGE;
+    return ZX_ERR_OUT_OF_RANGE;
 }
 
 // Immediately stop iterating over the directory.
@@ -657,56 +657,56 @@
 // Identify that the direntry record was modified. Stop iterating.
 #define DIR_CB_SAVE_SYNC 2
 
-mx_status_t VnodeMinfs::ReadExactInternal(void* data, size_t len, size_t off) {
+zx_status_t VnodeMinfs::ReadExactInternal(void* data, size_t len, size_t off) {
     size_t actual;
-    mx_status_t status = ReadInternal(data, len, off, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = ReadInternal(data, len, off, &actual);
+    if (status != ZX_OK) {
         return status;
     } else if (actual != len) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::WriteExactInternal(WriteTxn* txn, const void* data,
+zx_status_t VnodeMinfs::WriteExactInternal(WriteTxn* txn, const void* data,
                                            size_t len, size_t off) {
     size_t actual;
-    mx_status_t status = WriteInternal(txn, data, len, off, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = WriteInternal(txn, data, len, off, &actual);
+    if (status != ZX_OK) {
         return status;
     } else if (actual != len) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     InodeSync(txn, kMxFsSyncMtime);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t validate_dirent(minfs_dirent_t* de, size_t bytes_read, size_t off) {
+static zx_status_t validate_dirent(minfs_dirent_t* de, size_t bytes_read, size_t off) {
     uint32_t reclen = static_cast<uint32_t>(MinfsReclen(de, off));
     if ((bytes_read < MINFS_DIRENT_SIZE) || (reclen < MINFS_DIRENT_SIZE)) {
         FS_TRACE_ERROR("vn_dir: Could not read dirent at offset: %zd\n", off);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     } else if ((off + reclen > kMinfsMaxDirectorySize) || (reclen & 3)) {
         FS_TRACE_ERROR("vn_dir: bad reclen %u > %u\n", reclen, kMinfsMaxDirectorySize);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     } else if (de->ino != 0) {
         if ((de->namelen == 0) ||
             (de->namelen > (reclen - MINFS_DIRENT_SIZE))) {
             FS_TRACE_ERROR("vn_dir: bad namelen %u / %u\n", de->namelen, reclen);
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Updates offset information to move to the next direntry in the directory.
-static mx_status_t do_next_dirent(minfs_dirent_t* de, DirectoryOffset* offs) {
+static zx_status_t do_next_dirent(minfs_dirent_t* de, DirectoryOffset* offs) {
     offs->off_prev = offs->off;
     offs->off += MinfsReclen(de, offs->off);
     return DIR_CB_NEXT;
 }
 
-static mx_status_t cb_dir_find(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
+static zx_status_t cb_dir_find(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
                                DirArgs* args, DirectoryOffset* offs) {
     if ((de->ino != 0) && (de->namelen == args->len) &&
         (!memcmp(de->name, args->name, args->len))) {
@@ -718,23 +718,23 @@
     }
 }
 
-mx_status_t VnodeMinfs::CanUnlink() const {
+zx_status_t VnodeMinfs::CanUnlink() const {
     // directories must be empty (dirent_count == 2)
     if (IsDirectory()) {
         if (inode_.dirent_count != 2) {
             // if we have more than "." and "..", not empty, cannot unlink
-            return MX_ERR_NOT_EMPTY;
+            return ZX_ERR_NOT_EMPTY;
 #ifdef __Fuchsia__
         } else if (IsRemote()) {
             // we cannot unlink mount points
-            return MX_ERR_UNAVAILABLE;
+            return ZX_ERR_UNAVAILABLE;
 #endif
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::UnlinkChild(WriteTxn* txn,
+zx_status_t VnodeMinfs::UnlinkChild(WriteTxn* txn,
                                     fbl::RefPtr<VnodeMinfs> childvn,
                                     minfs_dirent_t* de, DirectoryOffset* offs) {
     // Coalesce the current dirent with the previous/next dirent, if they
@@ -743,7 +743,7 @@
     size_t off = offs->off;
     size_t off_next = off + MinfsReclen(de, off);
     minfs_dirent_t de_prev, de_next;
-    mx_status_t status;
+    zx_status_t status;
 
     // Read the direntries we're considering merging with.
     // Verify they are free and small enough to merge.
@@ -752,10 +752,10 @@
     // back to "de" and "de_prev".
     if (!(de->reclen & kMinfsReclenLast)) {
         size_t len = MINFS_DIRENT_SIZE;
-        if ((status = ReadExactInternal(&de_next, len, off_next)) != MX_OK) {
+        if ((status = ReadExactInternal(&de_next, len, off_next)) != ZX_OK) {
             FS_TRACE_ERROR("unlink: Failed to read next dirent\n");
             return status;
-        } else if ((status = validate_dirent(&de_next, len, off_next)) != MX_OK) {
+        } else if ((status = validate_dirent(&de_next, len, off_next)) != ZX_OK) {
             FS_TRACE_ERROR("unlink: Read invalid dirent\n");
             return status;
         }
@@ -767,10 +767,10 @@
     }
     if (off_prev != off) {
         size_t len = MINFS_DIRENT_SIZE;
-        if ((status = ReadExactInternal(&de_prev, len, off_prev)) != MX_OK) {
+        if ((status = ReadExactInternal(&de_prev, len, off_prev)) != ZX_OK) {
             FS_TRACE_ERROR("unlink: Failed to read previous dirent\n");
             return status;
-        } else if ((status = validate_dirent(&de_prev, len, off_prev)) != MX_OK) {
+        } else if ((status = validate_dirent(&de_prev, len, off_prev)) != ZX_OK) {
             FS_TRACE_ERROR("unlink: Read invalid dirent\n");
             return status;
         }
@@ -782,13 +782,13 @@
 
     if (!(de->reclen & kMinfsReclenLast) && (coalesced_size >= kMinfsReclenMask)) {
         // Should only be possible if the on-disk record format is corrupted
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     de->ino = 0;
     de->reclen = static_cast<uint32_t>(coalesced_size & kMinfsReclenMask) |
         (de->reclen & kMinfsReclenLast);
     // Erase dirent (replace with 'empty' dirent)
-    if ((status = WriteExactInternal(txn, de, MINFS_DIRENT_SIZE, off)) != MX_OK) {
+    if ((status = WriteExactInternal(txn, de, MINFS_DIRENT_SIZE, off)) != ZX_OK) {
         return status;
     }
 
@@ -825,7 +825,7 @@
 }
 
 // caller is expected to prevent unlink of "." or ".."
-static mx_status_t cb_dir_unlink(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
+static zx_status_t cb_dir_unlink(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
                                  DirArgs* args, DirectoryOffset* offs) {
     if ((de->ino == 0) || (args->len != de->namelen) ||
         memcmp(args->name, de->name, args->len)) {
@@ -833,23 +833,23 @@
     }
 
     fbl::RefPtr<VnodeMinfs> vn;
-    mx_status_t status;
+    zx_status_t status;
     if ((status = vndir->fs_->VnodeGet(&vn, de->ino)) < 0) {
         return status;
     }
 
     // If a directory was requested, then only try unlinking a directory
     if ((args->type == kMinfsTypeDir) && !vn->IsDirectory()) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     }
-    if ((status = vn->CanUnlink()) != MX_OK) {
+    if ((status = vn->CanUnlink()) != ZX_OK) {
         return status;
     }
     return vndir->UnlinkChild(args->txn, fbl::move(vn), de, offs);
 }
 
 // same as unlink, but do not validate vnode
-static mx_status_t cb_dir_force_unlink(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
+static zx_status_t cb_dir_force_unlink(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
                                        DirArgs* args, DirectoryOffset* offs) {
     if ((de->ino == 0) || (args->len != de->namelen) ||
         memcmp(args->name, de->name, args->len)) {
@@ -857,7 +857,7 @@
     }
 
     fbl::RefPtr<VnodeMinfs> vn;
-    mx_status_t status;
+    zx_status_t status;
     if ((status = vndir->fs_->VnodeGet(&vn, de->ino)) < 0) {
         return status;
     }
@@ -865,7 +865,7 @@
 }
 
 // Given a (name, inode, type) combination:
-//   - If no corresponding 'name' is found, MX_ERR_NOT_FOUND is returned
+//   - If no corresponding 'name' is found, ZX_ERR_NOT_FOUND is returned
 //   - If the 'name' corresponds to a vnode, check that the target vnode:
 //      - Does not have the same inode as the argument inode
 //      - Is the same type as the argument 'type'
@@ -873,7 +873,7 @@
 //   - If the previous checks pass, then:
 //      - Remove the old vnode (decrement link count by one)
 //      - Replace the old vnode's position in the directory with the new inode
-static mx_status_t cb_dir_attempt_rename(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
+static zx_status_t cb_dir_attempt_rename(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
                                          DirArgs* args, DirectoryOffset* offs) {
     if ((de->ino == 0) || (args->len != de->namelen) ||
         memcmp(args->name, de->name, args->len)) {
@@ -881,16 +881,16 @@
     }
 
     fbl::RefPtr<VnodeMinfs> vn;
-    mx_status_t status;
+    zx_status_t status;
     if ((status = vndir->fs_->VnodeGet(&vn, de->ino)) < 0) {
         return status;
     } else if (args->ino == vn->ino_) {
         // cannot rename node to itself
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     } else if (args->type != de->type) {
         // cannot rename directory to file (or vice versa)
-        return MX_ERR_BAD_STATE;
-    } else if ((status = vn->CanUnlink()) != MX_OK) {
+        return ZX_ERR_BAD_STATE;
+    } else if ((status = vn->CanUnlink()) != ZX_OK) {
         // if we cannot unlink the target, we cannot rename the target
         return status;
     }
@@ -904,13 +904,13 @@
 
     de->ino = args->ino;
     status = vndir->WriteExactInternal(args->txn, de, DirentSize(de->namelen), offs->off);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     return DIR_CB_SAVE_SYNC;
 }
 
-static mx_status_t cb_dir_update_inode(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
+static zx_status_t cb_dir_update_inode(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
                                        DirArgs* args, DirectoryOffset* offs) {
     if ((de->ino == 0) || (args->len != de->namelen) ||
         memcmp(args->name, de->name, args->len)) {
@@ -918,25 +918,25 @@
     }
 
     de->ino = args->ino;
-    mx_status_t status = vndir->WriteExactInternal(args->txn, de,
+    zx_status_t status = vndir->WriteExactInternal(args->txn, de,
                                                    DirentSize(de->namelen),
                                                    offs->off);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     return DIR_CB_SAVE_SYNC;
 }
 
-static mx_status_t add_dirent(fbl::RefPtr<VnodeMinfs> vndir,
+static zx_status_t add_dirent(fbl::RefPtr<VnodeMinfs> vndir,
                               minfs_dirent_t* de, DirArgs* args, size_t off) {
     de->ino = args->ino;
     de->type = static_cast<uint8_t>(args->type);
     de->namelen = static_cast<uint8_t>(args->len);
     memcpy(de->name, args->name, args->len);
-    mx_status_t status = vndir->WriteExactInternal(args->txn, de,
+    zx_status_t status = vndir->WriteExactInternal(args->txn, de,
                                                    DirentSize(de->namelen),
                                                    off);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     vndir->inode_.dirent_count++;
@@ -947,7 +947,7 @@
     return DIR_CB_SAVE_SYNC;
 }
 
-static mx_status_t cb_dir_append(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
+static zx_status_t cb_dir_append(fbl::RefPtr<VnodeMinfs> vndir, minfs_dirent_t* de,
                                  DirArgs* args, DirectoryOffset* offs) {
     uint32_t reclen = static_cast<uint32_t>(MinfsReclen(de, offs->off));
     if (de->ino == 0) {
@@ -961,7 +961,7 @@
         uint32_t size = static_cast<uint32_t>(DirentSize(de->namelen));
         if (size > reclen) {
             FS_TRACE_ERROR("bad reclen (smaller than dirent) %u < %u\n", reclen, size);
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
         uint32_t extra = reclen - size;
         if (extra < args->reclen) {
@@ -970,10 +970,10 @@
         // shrink existing entry
         bool was_last_record = de->reclen & kMinfsReclenLast;
         de->reclen = size;
-        mx_status_t status = vndir->WriteExactInternal(args->txn, de,
+        zx_status_t status = vndir->WriteExactInternal(args->txn, de,
                                                        DirentSize(de->namelen),
                                                        offs->off);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
         offs->off += size;
@@ -997,7 +997,7 @@
 //  'offs': Offset info about where in the directory this direntry is located.
 //          Since 'func' may create / remove surrounding dirents, it is responsible for
 //          updating the offset information to access the next dirent.
-mx_status_t VnodeMinfs::ForEachDirent(DirArgs* args, const DirentCallback func) {
+zx_status_t VnodeMinfs::ForEachDirent(DirArgs* args, const DirentCallback func) {
     char data[kMinfsMaxDirentSize];
     minfs_dirent_t* de = (minfs_dirent_t*) data;
     DirectoryOffset offs = {
@@ -1007,10 +1007,10 @@
     while (offs.off + MINFS_DIRENT_SIZE < kMinfsMaxDirectorySize) {
         FS_TRACE(MINFS, "Reading dirent at offset %zd\n", offs.off);
         size_t r;
-        mx_status_t status = ReadInternal(data, kMinfsMaxDirentSize, offs.off, &r);
-        if (status != MX_OK) {
+        zx_status_t status = ReadInternal(data, kMinfsMaxDirentSize, offs.off, &r);
+        if (status != ZX_OK) {
             return status;
-        } else if ((status = validate_dirent(de, r, offs.off)) != MX_OK) {
+        } else if ((status = validate_dirent(de, r, offs.off)) != ZX_OK) {
             return status;
         }
 
@@ -1020,13 +1020,13 @@
         case DIR_CB_SAVE_SYNC:
             inode_.seq_num++;
             InodeSync(args->txn, kMxFsSyncMtime);
-            return MX_OK;
+            return ZX_OK;
         case DIR_CB_DONE:
         default:
             return status;
         }
     }
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
 VnodeMinfs::~VnodeMinfs() {
@@ -1058,52 +1058,52 @@
 #endif
 }
 
-mx_status_t VnodeMinfs::Open(uint32_t flags) {
+zx_status_t VnodeMinfs::Open(uint32_t flags) {
     FS_TRACE(MINFS, "minfs_open() vn=%p(#%u)\n", this, ino_);
     if ((flags & O_DIRECTORY) && !IsDirectory()) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     }
 
     switch (flags & O_ACCMODE) {
     case O_WRONLY:
     case O_RDWR:
         if (IsDirectory()) {
-            return MX_ERR_NOT_FILE;
+            return ZX_ERR_NOT_FILE;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 ssize_t VnodeMinfs::Read(void* data, size_t len, size_t off) {
     FS_TRACE(MINFS, "minfs_read() vn=%p(#%u) len=%zd off=%zd\n", this, ino_, len, off);
     if (IsDirectory()) {
-        return MX_ERR_NOT_FILE;
+        return ZX_ERR_NOT_FILE;
     }
     size_t r;
-    mx_status_t status = ReadInternal(data, len, off, &r);
-    if (status != MX_OK) {
+    zx_status_t status = ReadInternal(data, len, off, &r);
+    if (status != ZX_OK) {
         return status;
     }
     return r;
 }
 
 // Internal read. Usable on directories.
-mx_status_t VnodeMinfs::ReadInternal(void* data, size_t len, size_t off, size_t* actual) {
+zx_status_t VnodeMinfs::ReadInternal(void* data, size_t len, size_t off, size_t* actual) {
     // clip to EOF
     if (off >= inode_.size) {
         *actual = 0;
-        return MX_OK;
+        return ZX_OK;
     }
     if (len > (inode_.size - off)) {
         len = inode_.size - off;
     }
 
-    mx_status_t status;
+    zx_status_t status;
 #ifdef __Fuchsia__
-    if ((status = InitVmo()) != MX_OK) {
+    if ((status = InitVmo()) != ZX_OK) {
         return status;
-    } else if ((status = vmo_.read(data, off, len, actual)) != MX_OK) {
+    } else if ((status = vmo_.read(data, off, len, actual)) != ZX_OK) {
         return status;
     }
 #else
@@ -1120,13 +1120,13 @@
         }
 
         blk_t bno;
-        if ((status = GetBno(nullptr, n, &bno)) != MX_OK) {
+        if ((status = GetBno(nullptr, n, &bno)) != ZX_OK) {
             return status;
         }
         if (bno != 0) {
             char bdata[kMinfsBlockSize];
             if (fs_->bc_->Readblk(bno + fs_->info_.dat_block, bdata)) {
-                return MX_ERR_IO;
+                return ZX_ERR_IO;
             }
             memcpy(data, bdata + adjust, xfer);
         } else {
@@ -1141,18 +1141,18 @@
     }
     *actual = (uintptr_t)data - (uintptr_t)start;
 #endif
-    return MX_OK;
+    return ZX_OK;
 }
 
 ssize_t VnodeMinfs::Write(const void* data, size_t len, size_t off) {
     FS_TRACE(MINFS, "minfs_write() vn=%p(#%u) len=%zd off=%zd\n", this, ino_, len, off);
     if (IsDirectory()) {
-        return MX_ERR_NOT_FILE;
+        return ZX_ERR_NOT_FILE;
     }
     WriteTxn txn(fs_->bc_.get());
     size_t actual;
-    mx_status_t status = WriteInternal(&txn, data, len, off, &actual);
-    if (status != MX_OK) {
+    zx_status_t status = WriteInternal(&txn, data, len, off, &actual);
+    if (status != ZX_OK) {
         return status;
     }
     if (actual != 0) {
@@ -1162,16 +1162,16 @@
 }
 
 // Internal write. Usable on directories.
-mx_status_t VnodeMinfs::WriteInternal(WriteTxn* txn, const void* data,
+zx_status_t VnodeMinfs::WriteInternal(WriteTxn* txn, const void* data,
                                       size_t len, size_t off, size_t* actual) {
     if (len == 0) {
         *actual = 0;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t status;
+    zx_status_t status;
 #ifdef __Fuchsia__
-    if ((status = InitVmo()) != MX_OK) {
+    if ((status = InitVmo()) != ZX_OK) {
         return status;
     }
 #endif
@@ -1191,37 +1191,37 @@
         size_t xfer_off = n * kMinfsBlockSize + adjust;
         if ((xfer_off + xfer) > inode_.size) {
             size_t new_size = xfer_off + xfer;
-            if ((status = vmo_.set_size(fbl::roundup(new_size, kMinfsBlockSize))) != MX_OK) {
+            if ((status = vmo_.set_size(fbl::roundup(new_size, kMinfsBlockSize))) != ZX_OK) {
                 goto done;
             }
             inode_.size = static_cast<uint32_t>(new_size);
         }
 
         // Update this block of the in-memory VMO
-        if ((status = VmoWriteExact(data, xfer_off, xfer)) != MX_OK) {
-            return MX_ERR_IO;
+        if ((status = VmoWriteExact(data, xfer_off, xfer)) != ZX_OK) {
+            return ZX_ERR_IO;
         }
 
         // Update this block on-disk
         blk_t bno;
-        if ((status = GetBno(txn, n, &bno)) != MX_OK) {
+        if ((status = GetBno(txn, n, &bno)) != ZX_OK) {
             return status;
         }
-        MX_DEBUG_ASSERT(bno != 0);
+        ZX_DEBUG_ASSERT(bno != 0);
         txn->Enqueue(vmoid_, n, bno + fs_->info_.dat_block, 1);
 #else
         blk_t bno;
-        if ((status = GetBno(txn, n, &bno)) != MX_OK) {
+        if ((status = GetBno(txn, n, &bno)) != ZX_OK) {
             goto done;
         }
-        MX_DEBUG_ASSERT(bno != 0);
+        ZX_DEBUG_ASSERT(bno != 0);
         char wdata[kMinfsBlockSize];
         if (fs_->bc_->Readblk(bno + fs_->info_.dat_block, wdata)) {
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
         memcpy(wdata + adjust, data, xfer);
         if (fs_->bc_->Writeblk(bno + fs_->info_.dat_block, wdata)) {
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
 #endif
 
@@ -1237,37 +1237,37 @@
         // If more than zero bytes were requested, but zero bytes were written,
         // return an error explicitly (rather than zero).
         if (off >= kMinfsMaxFileSize) {
-            return MX_ERR_FILE_BIG;
+            return ZX_ERR_FILE_BIG;
         }
 
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     }
     if ((off + len) > inode_.size) {
         inode_.size = static_cast<uint32_t>(off + len);
     }
 
     *actual = len;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
+zx_status_t VnodeMinfs::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
     FS_TRACE(MINFS, "minfs_lookup() vn=%p(#%u) name='%.*s'\n", this, ino_, (int)len, name);
-    MX_DEBUG_ASSERT(fs::vfs_valid_name(name, len));
+    ZX_DEBUG_ASSERT(fs::vfs_valid_name(name, len));
 
     if (!IsDirectory()) {
         FS_TRACE_ERROR("not directory\n");
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     return LookupInternal(out, name, len);
 }
 
-mx_status_t VnodeMinfs::LookupInternal(fbl::RefPtr<fs::Vnode>* out,
+zx_status_t VnodeMinfs::LookupInternal(fbl::RefPtr<fs::Vnode>* out,
                                        const char* name, size_t len) {
     DirArgs args = DirArgs();
     args.name = name;
     args.len = len;
-    mx_status_t status;
+    zx_status_t status;
     if ((status = ForEachDirent(&args, cb_dir_find)) < 0) {
         return status;
     }
@@ -1276,10 +1276,10 @@
         return status;
     }
     *out = fbl::move(vn);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::Getattr(vnattr_t* a) {
+zx_status_t VnodeMinfs::Getattr(vnattr_t* a) {
     FS_TRACE(MINFS, "minfs_getattr() vn=%p(#%u)\n", this, ino_);
     a->mode = DTYPE_TO_VTYPE(MinfsMagicType(inode_.magic)) |
             V_IRUSR | V_IWUSR | V_IRGRP | V_IROTH;
@@ -1290,14 +1290,14 @@
     a->nlink = inode_.link_count;
     a->create_time = inode_.create_time;
     a->modify_time = inode_.modify_time;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::Setattr(vnattr_t* a) {
+zx_status_t VnodeMinfs::Setattr(vnattr_t* a) {
     int dirty = 0;
     FS_TRACE(MINFS, "minfs_setattr() vn=%p(#%u)\n", this, ino_);
     if ((a->valid & ~(ATTR_CTIME|ATTR_MTIME)) != 0) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     if ((a->valid & ATTR_CTIME) != 0) {
         inode_.create_time = a->create_time;
@@ -1312,7 +1312,7 @@
         WriteTxn txn(fs_->bc_.get());
         InodeSync(&txn, kMxFsSyncDefault);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 typedef struct dircookie {
@@ -1324,13 +1324,13 @@
 static_assert(sizeof(dircookie_t) <= sizeof(vdircookie_t),
               "MinFS dircookie too large to fit in IO state");
 
-mx_status_t VnodeMinfs::Readdir(void* cookie, void* dirents, size_t len) {
+zx_status_t VnodeMinfs::Readdir(void* cookie, void* dirents, size_t len) {
     FS_TRACE(MINFS, "minfs_readdir() vn=%p(#%u) cookie=%p len=%zd\n", this, ino_, cookie, len);
     dircookie_t* dc = reinterpret_cast<dircookie_t*>(cookie);
     fs::DirentFiller df(dirents, len);
 
     if (!IsDirectory()) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     size_t off = dc->off;
@@ -1348,8 +1348,8 @@
             if (off_recovered + MINFS_DIRENT_SIZE >= kMinfsMaxDirectorySize) {
                 goto fail;
             }
-            mx_status_t status = ReadInternal(de, kMinfsMaxDirentSize, off_recovered, &r);
-            if ((status != MX_OK) || (validate_dirent(de, r, off_recovered) != MX_OK)) {
+            zx_status_t status = ReadInternal(de, kMinfsMaxDirentSize, off_recovered, &r);
+            if ((status != ZX_OK) || (validate_dirent(de, r, off_recovered) != ZX_OK)) {
                 goto fail;
             }
             off_recovered += MinfsReclen(de, off_recovered);
@@ -1358,16 +1358,16 @@
     }
 
     while (off + MINFS_DIRENT_SIZE < kMinfsMaxDirectorySize) {
-        mx_status_t status = ReadInternal(de, kMinfsMaxDirentSize, off, &r);
-        if (status != MX_OK) {
+        zx_status_t status = ReadInternal(de, kMinfsMaxDirentSize, off, &r);
+        if (status != ZX_OK) {
             goto fail;
-        } else if (validate_dirent(de, r, off) != MX_OK) {
+        } else if (validate_dirent(de, r, off) != ZX_OK) {
             goto fail;
         }
 
         if (de->ino && (de->namelen != 2 || strncmp("..", de->name, de->namelen))) {
-            mx_status_t status;
-            if ((status = df.Next(de->name, de->namelen, de->type)) != MX_OK) {
+            zx_status_t status;
+            if ((status = df.Next(de->name, de->namelen, de->type)) != ZX_OK) {
                 // no more space
                 goto done;
             }
@@ -1381,74 +1381,74 @@
     dc->off = off;
     dc->seqno = inode_.seq_num;
     r = df.BytesFilled();
-    MX_DEBUG_ASSERT(r <= len); // Otherwise, we're overflowing the input buffer.
-    return static_cast<mx_status_t>(r);
+    ZX_DEBUG_ASSERT(r <= len); // Otherwise, we're overflowing the input buffer.
+    return static_cast<zx_status_t>(r);
 
 fail:
     dc->off = 0;
-    return MX_ERR_IO;
+    return ZX_ERR_IO;
 }
 
 #ifdef __Fuchsia__
 VnodeMinfs::VnodeMinfs(Minfs* fs) :
-    fs_(fs), vmo_(MX_HANDLE_INVALID), vmo_indirect_(nullptr) {}
+    fs_(fs), vmo_(ZX_HANDLE_INVALID), vmo_indirect_(nullptr) {}
 
 void VnodeMinfs::Notify(const char* name, size_t len, unsigned event) { watcher_.Notify(name, len, event); }
-mx_status_t VnodeMinfs::WatchDir(mx::channel* out) { return watcher_.WatchDir(out); }
-mx_status_t VnodeMinfs::WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) {
+zx_status_t VnodeMinfs::WatchDir(zx::channel* out) { return watcher_.WatchDir(out); }
+zx_status_t VnodeMinfs::WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) {
     return watcher_.WatchDirV2(vfs, this, cmd);
 }
 
 bool VnodeMinfs::IsRemote() const { return remoter_.IsRemote(); }
-mx::channel VnodeMinfs::DetachRemote() { return remoter_.DetachRemote(flags_); }
-mx_handle_t VnodeMinfs::WaitForRemote() { return remoter_.WaitForRemote(flags_); }
-mx_handle_t VnodeMinfs::GetRemote() const { return remoter_.GetRemote(); }
-void VnodeMinfs::SetRemote(mx::channel remote) { return remoter_.SetRemote(fbl::move(remote)); }
+zx::channel VnodeMinfs::DetachRemote() { return remoter_.DetachRemote(flags_); }
+zx_handle_t VnodeMinfs::WaitForRemote() { return remoter_.WaitForRemote(flags_); }
+zx_handle_t VnodeMinfs::GetRemote() const { return remoter_.GetRemote(); }
+void VnodeMinfs::SetRemote(zx::channel remote) { return remoter_.SetRemote(fbl::move(remote)); }
 
 #else
 VnodeMinfs::VnodeMinfs(Minfs* fs) : fs_(fs) {}
 #endif
 
-mx_status_t VnodeMinfs::Allocate(Minfs* fs, uint32_t type, fbl::RefPtr<VnodeMinfs>* out) {
-    mx_status_t status = AllocateHollow(fs, out);
-    if (status != MX_OK) {
+zx_status_t VnodeMinfs::Allocate(Minfs* fs, uint32_t type, fbl::RefPtr<VnodeMinfs>* out) {
+    zx_status_t status = AllocateHollow(fs, out);
+    if (status != ZX_OK) {
         return status;
     }
     memset(&(*out)->inode_, 0, sizeof((*out)->inode_));
     (*out)->inode_.magic = MinfsMagic(type);
     (*out)->inode_.create_time = (*out)->inode_.modify_time = minfs_gettime_utc();
     (*out)->inode_.link_count = (type == kMinfsTypeDir ? 2 : 1);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::AllocateHollow(Minfs* fs, fbl::RefPtr<VnodeMinfs>* out) {
+zx_status_t VnodeMinfs::AllocateHollow(Minfs* fs, fbl::RefPtr<VnodeMinfs>* out) {
     fbl::AllocChecker ac;
     *out = fbl::AdoptRef(new (&ac) VnodeMinfs(fs));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len, uint32_t mode) {
+zx_status_t VnodeMinfs::Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len, uint32_t mode) {
     FS_TRACE(MINFS, "minfs_create() vn=%p(#%u) name='%.*s' mode=%#x\n",
           this, ino_, (int)len, name, mode);
-    MX_DEBUG_ASSERT(fs::vfs_valid_name(name, len));
+    ZX_DEBUG_ASSERT(fs::vfs_valid_name(name, len));
 
     if (!IsDirectory()) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     if (IsDeletedDirectory()) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     DirArgs args = DirArgs();
     args.name = name;
     args.len = len;
     // ensure file does not exist
-    mx_status_t status;
-    if ((status = ForEachDirent(&args, cb_dir_find)) != MX_ERR_NOT_FOUND) {
-        return MX_ERR_ALREADY_EXISTS;
+    zx_status_t status;
+    if ((status = ForEachDirent(&args, cb_dir_find)) != ZX_ERR_NOT_FOUND) {
+        return ZX_ERR_ALREADY_EXISTS;
     }
 
     // creating a directory?
@@ -1466,8 +1466,8 @@
         char bdata[DirentSize(1) + DirentSize(2)];
         minfs_dir_init(bdata, vn->ino_, ino_);
         size_t expected = DirentSize(1) + DirentSize(2);
-        if (vn->WriteExactInternal(&txn, bdata, expected, 0) != MX_OK) {
-            return MX_ERR_IO;
+        if (vn->WriteExactInternal(&txn, bdata, expected, 0) != ZX_OK) {
+            return ZX_ERR_IO;
         }
         vn->inode_.dirent_count = 2;
         vn->InodeSync(&txn, kMxFsSyncDefault);
@@ -1483,7 +1483,7 @@
     }
 
     *out = fbl::move(vn);
-    return MX_OK;
+    return ZX_OK;
 }
 
 constexpr const char kFsName[] = "minfs";
@@ -1493,7 +1493,7 @@
     switch (op) {
         case IOCTL_VFS_QUERY_FS: {
             if (out_len < (sizeof(vfs_query_info_t) + strlen(kFsName))) {
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
 
             vfs_query_info_t* info = static_cast<vfs_query_info_t*>(out_buf);
@@ -1505,8 +1505,8 @@
             return sizeof(vfs_query_info_t) + strlen(kFsName);
         }
         case IOCTL_VFS_UNMOUNT_FS: {
-            mx_status_t status = Sync();
-            if (status != MX_OK) {
+            zx_status_t status = Sync();
+            if (status != ZX_OK) {
                 FS_TRACE_ERROR("minfs unmount failed to sync; unmounting anyway: %d\n", status);
             }
             // 'fs_' is deleted after Unmount is called.
@@ -1517,24 +1517,24 @@
             ssize_t len = fs_->bc_->GetDevicePath(static_cast<char*>(out_buf), out_len);
 
             if ((ssize_t)out_len < len) {
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
 
             return len;
         }
 #endif
         default: {
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
     }
 }
 
-mx_status_t VnodeMinfs::Unlink(const char* name, size_t len, bool must_be_dir) {
+zx_status_t VnodeMinfs::Unlink(const char* name, size_t len, bool must_be_dir) {
     FS_TRACE(MINFS, "minfs_unlink() vn=%p(#%u) name='%.*s'\n", this, ino_, (int)len, name);
-    MX_DEBUG_ASSERT(fs::vfs_valid_name(name, len));
+    ZX_DEBUG_ASSERT(fs::vfs_valid_name(name, len));
 
     if (!IsDirectory()) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     WriteTxn txn(fs_->bc_.get());
     DirArgs args = DirArgs();
@@ -1545,27 +1545,27 @@
     return ForEachDirent(&args, cb_dir_unlink);
 }
 
-mx_status_t VnodeMinfs::Truncate(size_t len) {
+zx_status_t VnodeMinfs::Truncate(size_t len) {
     if (IsDirectory()) {
-        return MX_ERR_NOT_FILE;
+        return ZX_ERR_NOT_FILE;
     }
 
     WriteTxn txn(fs_->bc_.get());
-    mx_status_t status = TruncateInternal(&txn, len);
-    if (status == MX_OK) {
+    zx_status_t status = TruncateInternal(&txn, len);
+    if (status == ZX_OK) {
         // Successful truncates update inode
         InodeSync(&txn, kMxFsSyncMtime);
     }
     return status;
 }
 
-mx_status_t VnodeMinfs::TruncateInternal(WriteTxn* txn, size_t len) {
-    mx_status_t r = 0;
+zx_status_t VnodeMinfs::TruncateInternal(WriteTxn* txn, size_t len) {
+    zx_status_t r = 0;
 #ifdef __Fuchsia__
     // TODO(smklein): We should only init up to 'len'; no need
     // to read in the portion of a large file we plan on deleting.
-    if (InitVmo() != MX_OK) {
-        return MX_ERR_IO;
+    if (InitVmo() != ZX_OK) {
+        return ZX_ERR_IO;
     }
 #endif
 
@@ -1591,28 +1591,28 @@
         if (len < inode_.size) {
             char bdata[kMinfsBlockSize];
             blk_t rel_bno = static_cast<blk_t>(len / kMinfsBlockSize);
-            if (GetBno(nullptr, rel_bno, &bno) != MX_OK) {
-                return MX_ERR_IO;
+            if (GetBno(nullptr, rel_bno, &bno) != ZX_OK) {
+                return ZX_ERR_IO;
             }
             if (bno != 0) {
                 size_t adjust = len % kMinfsBlockSize;
 #ifdef __Fuchsia__
-                if ((r = VmoReadExact(bdata, len - adjust, adjust)) != MX_OK) {
-                    return MX_ERR_IO;
+                if ((r = VmoReadExact(bdata, len - adjust, adjust)) != ZX_OK) {
+                    return ZX_ERR_IO;
                 }
                 memset(bdata + adjust, 0, kMinfsBlockSize - adjust);
 
-                if ((r = VmoWriteExact(bdata, len - adjust, kMinfsBlockSize)) != MX_OK) {
-                    return MX_ERR_IO;
+                if ((r = VmoWriteExact(bdata, len - adjust, kMinfsBlockSize)) != ZX_OK) {
+                    return ZX_ERR_IO;
                 }
                 txn->Enqueue(vmoid_, rel_bno, bno + fs_->info_.dat_block, 1);
 #else
                 if (fs_->bc_->Readblk(bno + fs_->info_.dat_block, bdata)) {
-                    return MX_ERR_IO;
+                    return ZX_ERR_IO;
                 }
                 memset(bdata + adjust, 0, kMinfsBlockSize - adjust);
                 if (fs_->bc_->Writeblk(bno + fs_->info_.dat_block, bdata)) {
-                    return MX_ERR_IO;
+                    return ZX_ERR_IO;
                 }
 #endif
             }
@@ -1620,31 +1620,31 @@
     } else if (len > inode_.size) {
         // Truncate should make the file longer, filled with zeroes.
         if (kMinfsMaxFileSize < len) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         char zero = 0;
-        if ((r = WriteExactInternal(txn, &zero, 1, len - 1)) != MX_OK) {
+        if ((r = WriteExactInternal(txn, &zero, 1, len - 1)) != ZX_OK) {
             return r;
         }
     }
 
     inode_.size = static_cast<uint32_t>(len);
 #ifdef __Fuchsia__
-    if ((r = vmo_.set_size(fbl::roundup(len, kMinfsBlockSize))) != MX_OK) {
+    if ((r = vmo_.set_size(fbl::roundup(len, kMinfsBlockSize))) != ZX_OK) {
         return r;
     }
 #endif
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // verify that the 'newdir' inode is not a subdirectory of the source.
-static mx_status_t check_not_subdirectory(fbl::RefPtr<VnodeMinfs> src, fbl::RefPtr<VnodeMinfs> newdir) {
+static zx_status_t check_not_subdirectory(fbl::RefPtr<VnodeMinfs> src, fbl::RefPtr<VnodeMinfs> newdir) {
     fbl::RefPtr<VnodeMinfs> vn = newdir;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     while (vn->ino_ != kMinfsRootIno) {
         if (vn->ino_ == src->ino_) {
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             break;
         }
 
@@ -1657,20 +1657,20 @@
     return status;
 }
 
-mx_status_t VnodeMinfs::Rename(fbl::RefPtr<fs::Vnode> _newdir, const char* oldname, size_t oldlen,
+zx_status_t VnodeMinfs::Rename(fbl::RefPtr<fs::Vnode> _newdir, const char* oldname, size_t oldlen,
                                const char* newname, size_t newlen, bool src_must_be_dir,
                                bool dst_must_be_dir) {
     auto newdir = fbl::RefPtr<VnodeMinfs>::Downcast(_newdir);
     FS_TRACE(MINFS, "minfs_rename() olddir=%p(#%u) newdir=%p(#%u) oldname='%.*s' newname='%.*s'\n",
           this, ino_, newdir.get(), newdir->ino_, (int)oldlen, oldname, (int)newlen, newname);
-    MX_DEBUG_ASSERT(fs::vfs_valid_name(oldname, oldlen));
-    MX_DEBUG_ASSERT(fs::vfs_valid_name(newname, newlen));
+    ZX_DEBUG_ASSERT(fs::vfs_valid_name(oldname, oldlen));
+    ZX_DEBUG_ASSERT(fs::vfs_valid_name(newname, newlen));
 
     // ensure that the vnodes containing oldname and newname are directories
     if (!(IsDirectory() && newdir->IsDirectory()))
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
-    mx_status_t status;
+    zx_status_t status;
     fbl::RefPtr<VnodeMinfs> oldvn = nullptr;
     // acquire the 'oldname' node (it must exist)
     DirArgs args = DirArgs();
@@ -1686,7 +1686,7 @@
 
     // If either the 'src' or 'dst' must be directories, BOTH of them must be directories.
     if (!oldvn->IsDirectory() && (src_must_be_dir || dst_must_be_dir)) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     }
 
     // if the entry for 'newname' exists, make sure it can be replaced by
@@ -1698,13 +1698,13 @@
     args.ino = oldvn->ino_;
     args.type = oldvn->IsDirectory() ? kMinfsTypeDir : kMinfsTypeFile;
     status = newdir->ForEachDirent(&args, cb_dir_attempt_rename);
-    if (status == MX_ERR_NOT_FOUND) {
+    if (status == ZX_ERR_NOT_FOUND) {
         // if 'newname' does not exist, create it
         args.reclen = static_cast<uint32_t>(DirentSize(static_cast<uint8_t>(newlen)));
         if ((status = newdir->ForEachDirent(&args, cb_dir_append)) < 0) {
             return status;
         }
-    } else if (status != MX_OK) {
+    } else if (status != ZX_OK) {
         return status;
     }
 
@@ -1734,29 +1734,29 @@
     return ForEachDirent(&args, cb_dir_force_unlink);
 }
 
-mx_status_t VnodeMinfs::Link(const char* name, size_t len, fbl::RefPtr<fs::Vnode> _target) {
+zx_status_t VnodeMinfs::Link(const char* name, size_t len, fbl::RefPtr<fs::Vnode> _target) {
     FS_TRACE(MINFS, "minfs_link() vndir=%p(#%u) name='%.*s'\n", this, ino_, (int)len, name);
-    MX_DEBUG_ASSERT(fs::vfs_valid_name(name, len));
+    ZX_DEBUG_ASSERT(fs::vfs_valid_name(name, len));
 
     if (!IsDirectory()) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     } else if (IsDeletedDirectory()) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     auto target = fbl::RefPtr<VnodeMinfs>::Downcast(_target);
     if (target->IsDirectory()) {
         // The target must not be a directory
-        return MX_ERR_NOT_FILE;
+        return ZX_ERR_NOT_FILE;
     }
 
     // The destination should not exist
     DirArgs args = DirArgs();
     args.name = name;
     args.len = len;
-    mx_status_t status;
-    if ((status = ForEachDirent(&args, cb_dir_find)) != MX_ERR_NOT_FOUND) {
-        return (status == MX_OK) ? MX_ERR_ALREADY_EXISTS : status;
+    zx_status_t status;
+    if ((status = ForEachDirent(&args, cb_dir_find)) != ZX_ERR_NOT_FOUND) {
+        return (status == ZX_OK) ? ZX_ERR_ALREADY_EXISTS : status;
     }
 
     WriteTxn txn(fs_->bc_.get());
@@ -1772,22 +1772,22 @@
     target->inode_.link_count++;
     target->InodeSync(&txn, kMxFsSyncDefault);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeMinfs::Sync() {
+zx_status_t VnodeMinfs::Sync() {
     return fs_->bc_->Sync();
 }
 
 #ifdef __Fuchsia__
-mx_status_t VnodeMinfs::AttachRemote(fs::MountChannel h) {
+zx_status_t VnodeMinfs::AttachRemote(fs::MountChannel h) {
     if (!IsDirectory() || IsDeletedDirectory()) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     } else if (IsRemote()) {
-        return MX_ERR_ALREADY_BOUND;
+        return ZX_ERR_ALREADY_BOUND;
     }
     SetRemote(fbl::move(h.TakeChannel()));
-    return MX_OK;
+    return ZX_OK;
 }
 #endif
 
diff --git a/system/uapp/minfs/minfs-private.h b/system/uapp/minfs/minfs-private.h
index 18642d7..9dbd044 100644
--- a/system/uapp/minfs/minfs-private.h
+++ b/system/uapp/minfs/minfs-private.h
@@ -8,7 +8,7 @@
 #include <fs/dispatcher.h>
 #include <fs/remote.h>
 #include <fs/watcher.h>
-#include <mx/vmo.h>
+#include <zx/vmo.h>
 #endif
 
 #include <fbl/algorithm.h>
@@ -56,32 +56,32 @@
     DISALLOW_COPY_ASSIGN_AND_MOVE(Minfs);
 
     ~Minfs();
-    static mx_status_t Create(Minfs** out, fbl::unique_ptr<Bcache> bc, const minfs_info_t* info);
+    static zx_status_t Create(Minfs** out, fbl::unique_ptr<Bcache> bc, const minfs_info_t* info);
 
-    mx_status_t Unmount();
+    zx_status_t Unmount();
 
     // instantiate a vnode from an inode
     // the inode must exist in the file system
-    mx_status_t VnodeGet(fbl::RefPtr<VnodeMinfs>* out, ino_t ino);
+    zx_status_t VnodeGet(fbl::RefPtr<VnodeMinfs>* out, ino_t ino);
 
     // instantiate a vnode with a new inode
-    mx_status_t VnodeNew(WriteTxn* txn, fbl::RefPtr<VnodeMinfs>* out, uint32_t type);
+    zx_status_t VnodeNew(WriteTxn* txn, fbl::RefPtr<VnodeMinfs>* out, uint32_t type);
 
     // remove a vnode from the hash map
     void VnodeRelease(VnodeMinfs* vn);
 
     // Allocate a new data block.
-    mx_status_t BlockNew(WriteTxn* txn, blk_t hint, blk_t* out_bno);
+    zx_status_t BlockNew(WriteTxn* txn, blk_t hint, blk_t* out_bno);
 
     // free block in block bitmap
-    mx_status_t BlockFree(WriteTxn* txn, blk_t bno);
+    zx_status_t BlockFree(WriteTxn* txn, blk_t bno);
 
     // free ino in inode bitmap, release all blocks held by inode
-    mx_status_t InoFree(VnodeMinfs* vn);
+    zx_status_t InoFree(VnodeMinfs* vn);
 
     // Writes back an inode into the inode table on persistent storage.
     // Does not modify inode bitmap.
-    mx_status_t InodeSync(WriteTxn* txn, ino_t ino, const minfs_inode_t* inode);
+    zx_status_t InodeSync(WriteTxn* txn, ino_t ino, const minfs_inode_t* inode);
 
 #ifdef __Fuchsia__
     fs::Dispatcher* GetDispatcher() {
@@ -89,8 +89,8 @@
     }
 #endif
     void ValidateBno(blk_t bno) const {
-        MX_DEBUG_ASSERT(bno != 0);
-        MX_DEBUG_ASSERT(bno < info_.block_count);
+        ZX_DEBUG_ASSERT(bno != 0);
+        ZX_DEBUG_ASSERT(bno < info_.block_count);
     }
 
     fbl::unique_ptr<Bcache> bc_{};
@@ -101,14 +101,14 @@
     friend class MinfsChecker;
     Minfs(fbl::unique_ptr<Bcache> bc_, const minfs_info_t* info_);
     // Find a free inode, allocate it in the inode bitmap, and write it back to disk
-    mx_status_t InoNew(WriteTxn* txn, const minfs_inode_t* inode, ino_t* ino_out);
+    zx_status_t InoNew(WriteTxn* txn, const minfs_inode_t* inode, ino_t* ino_out);
 
     // Enqueues an update for allocated inode/block counts
-    mx_status_t CountUpdate(WriteTxn* txn);
+    zx_status_t CountUpdate(WriteTxn* txn);
 
     // If possible, attempt to resize the MinFS partition.
-    mx_status_t AddInodes();
-    mx_status_t AddBlocks();
+    zx_status_t AddInodes();
+    zx_status_t AddBlocks();
 
 #ifdef __Fuchsia__
     fbl::unique_ptr<fs::Dispatcher> dispatcher_{nullptr};
@@ -159,34 +159,34 @@
 class VnodeMinfs final : public fs::Vnode, public fbl::SinglyLinkedListable<VnodeMinfs*> {
 public:
     // Allocates a Vnode and initializes the inode given the type.
-    static mx_status_t Allocate(Minfs* fs, uint32_t type, fbl::RefPtr<VnodeMinfs>* out);
+    static zx_status_t Allocate(Minfs* fs, uint32_t type, fbl::RefPtr<VnodeMinfs>* out);
     // Allocates a Vnode, but leaves the inode untouched, so it may be overwritten.
-    static mx_status_t AllocateHollow(Minfs* fs, fbl::RefPtr<VnodeMinfs>* out);
+    static zx_status_t AllocateHollow(Minfs* fs, fbl::RefPtr<VnodeMinfs>* out);
 
     bool IsDirectory() const { return inode_.magic == kMinfsMagicDir; }
     bool IsDeletedDirectory() const { return flags_ & kMinfsFlagDeletedDirectory; }
-    mx_status_t CanUnlink() const;
+    zx_status_t CanUnlink() const;
 
     ino_t GetKey() const { return ino_; }
     static size_t GetHash(ino_t key) { return INO_HASH(key); }
 
-    mx_status_t UnlinkChild(WriteTxn* txn, fbl::RefPtr<VnodeMinfs> child,
+    zx_status_t UnlinkChild(WriteTxn* txn, fbl::RefPtr<VnodeMinfs> child,
                             minfs_dirent_t* de, DirectoryOffset* offs);
     // Remove the link to a vnode (referring to inodes exclusively).
     // Has no impact on direntries (or parent inode).
     void RemoveInodeLink(WriteTxn* txn);
-    mx_status_t ReadInternal(void* data, size_t len, size_t off, size_t* actual);
-    mx_status_t ReadExactInternal(void* data, size_t len, size_t off);
-    mx_status_t WriteInternal(WriteTxn* txn, const void* data, size_t len,
+    zx_status_t ReadInternal(void* data, size_t len, size_t off, size_t* actual);
+    zx_status_t ReadExactInternal(void* data, size_t len, size_t off);
+    zx_status_t WriteInternal(WriteTxn* txn, const void* data, size_t len,
                               size_t off, size_t* actual);
-    mx_status_t WriteExactInternal(WriteTxn* txn, const void* data, size_t len,
+    zx_status_t WriteExactInternal(WriteTxn* txn, const void* data, size_t len,
                                    size_t off);
-    mx_status_t TruncateInternal(WriteTxn* txn, size_t len);
+    zx_status_t TruncateInternal(WriteTxn* txn, size_t len);
     ssize_t Ioctl(uint32_t op, const void* in_buf, size_t in_len, void* out_buf,
                   size_t out_len) final;
-    mx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
+    zx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
     // Lookup which can traverse '..'
-    mx_status_t LookupInternal(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len);
+    zx_status_t LookupInternal(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len);
 
     Minfs* fs_{};
     ino_t ino_{};
@@ -197,50 +197,50 @@
 private:
     // Fsck can introspect Minfs
     friend class MinfsChecker;
-    friend mx_status_t Minfs::InoFree(VnodeMinfs* vn);
+    friend zx_status_t Minfs::InoFree(VnodeMinfs* vn);
     VnodeMinfs(Minfs* fs);
 
     // Implementing methods from the fs::Vnode, so MinFS vnodes may be utilized
     // by the VFS library.
-    mx_status_t Open(uint32_t flags) final;
+    zx_status_t Open(uint32_t flags) final;
     ssize_t Read(void* data, size_t len, size_t off) final;
     ssize_t Write(const void* data, size_t len, size_t off) final;
-    mx_status_t Getattr(vnattr_t* a) final;
-    mx_status_t Setattr(vnattr_t* a) final;
-    mx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
-    mx_status_t Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len,
+    zx_status_t Getattr(vnattr_t* a) final;
+    zx_status_t Setattr(vnattr_t* a) final;
+    zx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
+    zx_status_t Create(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len,
                        uint32_t mode) final;
-    mx_status_t Unlink(const char* name, size_t len, bool must_be_dir) final;
-    mx_status_t Rename(fbl::RefPtr<fs::Vnode> newdir,
+    zx_status_t Unlink(const char* name, size_t len, bool must_be_dir) final;
+    zx_status_t Rename(fbl::RefPtr<fs::Vnode> newdir,
                        const char* oldname, size_t oldlen,
                        const char* newname, size_t newlen,
                        bool src_must_be_dir, bool dst_must_be_dir) final;
-    mx_status_t Link(const char* name, size_t len, fbl::RefPtr<fs::Vnode> target) final;
-    mx_status_t Truncate(size_t len) final;
-    mx_status_t Sync() final;
+    zx_status_t Link(const char* name, size_t len, fbl::RefPtr<fs::Vnode> target) final;
+    zx_status_t Truncate(size_t len) final;
+    zx_status_t Sync() final;
 
 #ifdef __Fuchsia__
-    mx_status_t AttachRemote(fs::MountChannel h) final;
-    mx_status_t InitVmo();
-    mx_status_t InitIndirectVmo();
+    zx_status_t AttachRemote(fs::MountChannel h) final;
+    zx_status_t InitVmo();
+    zx_status_t InitIndirectVmo();
     // Loads indirect blocks up to and including the doubly indirect block at |index|
-    mx_status_t LoadIndirectWithinDoublyIndirect(uint32_t index);
+    zx_status_t LoadIndirectWithinDoublyIndirect(uint32_t index);
     // Initializes the indirect VMO, grows it to |size| bytes, and reads |count| indirect
     // blocks from |iarray| into the indirect VMO, starting at block offset |offset|.
-    mx_status_t LoadIndirectBlocks(blk_t* iarray, uint32_t count, uint32_t offset,
+    zx_status_t LoadIndirectBlocks(blk_t* iarray, uint32_t count, uint32_t offset,
                                    uint64_t size);
 #endif
 
     // Get the disk block 'bno' corresponding to the 'nth' block relative to the start of the
     // current direct/indirect/doubly indirect block section.
     // Allocate the block if requested with a non-null "txn".
-    mx_status_t GetBno(WriteTxn* txn, blk_t n, blk_t* bno);
+    zx_status_t GetBno(WriteTxn* txn, blk_t n, blk_t* bno);
     // Acquire (or allocate) a direct block |*bno|. If allocation occurs,
     // |*dirty| is set to true, and the inode block is written to disk.
     //
     // Example call for accessing the 0th direct block in the inode:
     // GetBnoDirect(txn, &inode_.dnum[0], &dirty);
-    mx_status_t GetBnoDirect(WriteTxn* txn, blk_t* bno, bool* dirty);
+    zx_status_t GetBnoDirect(WriteTxn* txn, blk_t* bno, bool* dirty);
     // Acquire (or allocate) a direct block |*bno| contained at index |bindex| within an indirect
     // block |*ibno|, which is allocated if necessary. If allocation of the indirect block occurs,
     // |*dirty| is set to true, and the indirect and inode blocks are written to disk.
@@ -250,7 +250,7 @@
     //
     // Example call for accessing the 3rd direct block within the 2nd indirect block:
     // GetBnoIndirect(txn, 3, 2, &inode_.inum[2], &bno, &dirty);
-    mx_status_t GetBnoIndirect(WriteTxn* txn, uint32_t bindex, uint32_t ib_vmo_offset,
+    zx_status_t GetBnoIndirect(WriteTxn* txn, uint32_t bindex, uint32_t ib_vmo_offset,
                                blk_t* ibno, blk_t* bno, bool* dirty);
     // Acquire (or allocate) a direct block |*bno| contained at index |bindex| within a doubly
     // indirect block |*dibno|, at index |ibindex| within that indirect block. If allocation occurs,
@@ -262,16 +262,16 @@
     // in the 0th doubly indirect block:
     // GetBnoDoublyIndirect(txn, 2, 3, GetVmoOffsetForDoublyIndirect(0), GetVmoOffsetForIndirect(0),
     //                      &inode_.dinum[0], &bno, &dirty);
-    mx_status_t GetBnoDoublyIndirect(WriteTxn* txn, uint32_t ibindex, uint32_t bindex,
+    zx_status_t GetBnoDoublyIndirect(WriteTxn* txn, uint32_t ibindex, uint32_t bindex,
                                      uint32_t dib_vmo_offset, uint32_t ib_vmo_offset,
                                      blk_t* dibno, blk_t* bno, bool* dirty);
 
     // Deletes all blocks (relative to a file) from "start" (inclusive) to the end
     // of the file. Does not update mtime/atime.
-    mx_status_t BlocksShrink(WriteTxn* txn, blk_t start);
+    zx_status_t BlocksShrink(WriteTxn* txn, blk_t start);
     // Shrink |count| direct blocks from the |barray| array of direct blocks. Sets |*dirty| to
     // true if anything is deleted.
-    mx_status_t BlocksShrinkDirect(WriteTxn *txn, size_t count, blk_t* barray, bool* dirty);
+    zx_status_t BlocksShrinkDirect(WriteTxn *txn, size_t count, blk_t* barray, bool* dirty);
     // Shrink |count| indirect blocks from the |iarray| array of indirect blocks. Sets |*dirty| to
     // true if anything is deleted.
     //
@@ -280,7 +280,7 @@
     //
     // On Fuchsia |ib_vmo_offset| contains the block offset of the |iarray| buffer within the
     // cached indirect VMO. On other platforms, this argument may be ignored.
-    mx_status_t BlocksShrinkIndirect(WriteTxn* txn, uint32_t bindex, size_t count,
+    zx_status_t BlocksShrinkIndirect(WriteTxn* txn, uint32_t bindex, size_t count,
                                      uint32_t ib_vmo_offset, blk_t* iarray, bool* dirty);
     // Shrink |count| doubly indirect blocks from the |diarray| array of doubly indirect blocks.
     // Sets |*dirty| to true if anything is deleted.
@@ -294,7 +294,7 @@
     // cached indirect VMO, and |ib_vmo_offset| contains the block offset of the indirect blocks
     // pointed to from the doubly indirect block at diarray[0]. On other platforms, this argument
     // may be ignored.
-    mx_status_t BlocksShrinkDoublyIndirect(WriteTxn *txn, uint32_t ibindex, uint32_t bindex,
+    zx_status_t BlocksShrinkDoublyIndirect(WriteTxn *txn, uint32_t ibindex, uint32_t bindex,
                                            size_t count, uint32_t dib_vmo_offset,
                                            uint32_t ib_vmo_offset, blk_t* diarray, bool* dirty);
 
@@ -313,25 +313,25 @@
     // Update the vnode's inode and write it to disk
     void InodeSync(WriteTxn* txn, uint32_t flags);
 
-    using DirentCallback = mx_status_t (*)(fbl::RefPtr<VnodeMinfs>,
+    using DirentCallback = zx_status_t (*)(fbl::RefPtr<VnodeMinfs>,
                                            minfs_dirent_t*, DirArgs*,
                                            DirectoryOffset*);
 
     // Directories only
-    mx_status_t ForEachDirent(DirArgs* args, const DirentCallback func);
+    zx_status_t ForEachDirent(DirArgs* args, const DirentCallback func);
 
 #ifdef __Fuchsia__
     // The following functionality interacts with handles directly, and are not applicable outside
     // Fuchsia (since there is no "handle-equivalent" in host-side tools).
 
-    mx_status_t VmoReadExact(void* data, uint64_t offset, size_t len);
-    mx_status_t VmoWriteExact(const void* data, uint64_t offset, size_t len);
+    zx_status_t VmoReadExact(void* data, uint64_t offset, size_t len);
+    zx_status_t VmoWriteExact(const void* data, uint64_t offset, size_t len);
 
     // TODO(smklein): When we have can register MinFS as a pager service, and
     // it can properly handle pages faults on a vnode's contents, then we can
     // avoid reading the entire file up-front. Until then, read the contents of
     // a VMO into memory when it is read/written.
-    mx::vmo vmo_{};
+    zx::vmo vmo_{};
 
     // vmo_indirect_ contains all indirect and doubly indirect blocks in the following order:
     // First kMinfsIndirect blocks                                - initial set of indirect blocks
@@ -345,15 +345,15 @@
 
     // Use the watcher container to implement a directory watcher
     void Notify(const char* name, size_t len, unsigned event) final;
-    mx_status_t WatchDir(mx::channel* out) final;
-    mx_status_t WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) final;
+    zx_status_t WatchDir(zx::channel* out) final;
+    zx_status_t WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) final;
 
     // The vnode is acting as a mount point for a remote filesystem or device.
     virtual bool IsRemote() const final;
-    virtual mx::channel DetachRemote() final;
-    virtual mx_handle_t WaitForRemote() final;
-    virtual mx_handle_t GetRemote() const final;
-    virtual void SetRemote(mx::channel remote) final;
+    virtual zx::channel DetachRemote() final;
+    virtual zx_handle_t WaitForRemote() final;
+    virtual zx_handle_t GetRemote() const final;
+    virtual void SetRemote(zx::channel remote) final;
 
     fs::RemoteContainer remoter_{};
     fs::WatcherContainer watcher_{};
@@ -374,7 +374,7 @@
 
 // Return the block offset of doubly indirect blocks in vmo_indirect_
 constexpr uint32_t GetVmoOffsetForDoublyIndirect(uint32_t dibindex) {
-    MX_DEBUG_ASSERT(dibindex < kMinfsDoublyIndirect);
+    ZX_DEBUG_ASSERT(dibindex < kMinfsDoublyIndirect);
     return kMinfsIndirect + dibindex;
 }
 
@@ -386,7 +386,7 @@
 // write the inode data of this vnode to disk (default does not update time values)
 void minfs_sync_vnode(fbl::RefPtr<VnodeMinfs> vn, uint32_t flags);
 
-mx_status_t minfs_check_info(const minfs_info_t* info, uint32_t max);
+zx_status_t minfs_check_info(const minfs_info_t* info, uint32_t max);
 void minfs_dump_info(const minfs_info_t* info);
 void minfs_dump_inode(const minfs_inode_t* inode, ino_t ino);
 
@@ -397,12 +397,12 @@
 class MinfsChecker {
 public:
     MinfsChecker();
-    mx_status_t Init(fbl::unique_ptr<Bcache> bc, const minfs_info_t* info);
-    mx_status_t CheckInode(ino_t ino, ino_t parent, bool dot_or_dotdot);
-    mx_status_t CheckForUnusedBlocks() const;
-    mx_status_t CheckForUnusedInodes() const;
-    mx_status_t CheckLinkCounts() const;
-    mx_status_t CheckAllocatedCounts() const;
+    zx_status_t Init(fbl::unique_ptr<Bcache> bc, const minfs_info_t* info);
+    zx_status_t CheckInode(ino_t ino, ino_t parent, bool dot_or_dotdot);
+    zx_status_t CheckForUnusedBlocks() const;
+    zx_status_t CheckForUnusedInodes() const;
+    zx_status_t CheckLinkCounts() const;
+    zx_status_t CheckAllocatedCounts() const;
 
     // "Set once"-style flag to identify if anything nonconforming
     // was found in the underlying filesystem -- even if it was fixed.
@@ -411,19 +411,19 @@
 private:
     DISALLOW_COPY_ASSIGN_AND_MOVE(MinfsChecker);
 
-    mx_status_t GetInode(minfs_inode_t* inode, ino_t ino);
+    zx_status_t GetInode(minfs_inode_t* inode, ino_t ino);
 
     // Returns the nth block within an inode, relative to the start of the
     // file. Returns the "next_n" which might contain a bno. This "next_n"
     // is for performance reasons -- it allows fsck to avoid repeatedly checking
     // the same indirect / doubly indirect blocks with all internal
     // bno unallocated.
-    mx_status_t GetInodeNthBno(minfs_inode_t* inode, blk_t n, blk_t* next_n,
+    zx_status_t GetInodeNthBno(minfs_inode_t* inode, blk_t n, blk_t* next_n,
                                blk_t* bno_out);
-    mx_status_t CheckDirectory(minfs_inode_t* inode, ino_t ino,
+    zx_status_t CheckDirectory(minfs_inode_t* inode, ino_t ino,
                                ino_t parent, uint32_t flags);
     const char* CheckDataBlock(blk_t bno);
-    mx_status_t CheckFile(minfs_inode_t* inode, ino_t ino);
+    zx_status_t CheckFile(minfs_inode_t* inode, ino_t ino);
 
     fbl::unique_ptr<Minfs> fs_;
     RawBitmap checked_inodes_;
@@ -439,10 +439,10 @@
     uint8_t indirect_cache_[kMinfsBlockSize];
 };
 
-mx_status_t minfs_check(fbl::unique_ptr<Bcache> bc);
+zx_status_t minfs_check(fbl::unique_ptr<Bcache> bc);
 #endif
 
-mx_status_t minfs_mount(fbl::RefPtr<VnodeMinfs>* root_out, fbl::unique_ptr<Bcache> bc);
+zx_status_t minfs_mount(fbl::RefPtr<VnodeMinfs>* root_out, fbl::unique_ptr<Bcache> bc);
 
 void minfs_dir_init(void* bdata, ino_t ino_self, ino_t ino_parent);
 
diff --git a/system/uapp/minfs/minfs.cpp b/system/uapp/minfs/minfs.cpp
index 9dd53ac..d4b00ca 100644
--- a/system/uapp/minfs/minfs.cpp
+++ b/system/uapp/minfs/minfs.cpp
@@ -43,28 +43,28 @@
     FS_TRACE(MINFS, "inode[%u]: links:  %10u\n", ino, inode->link_count);
 }
 
-mx_status_t minfs_check_info(const minfs_info_t* info, uint32_t max) {
+zx_status_t minfs_check_info(const minfs_info_t* info, uint32_t max) {
     minfs_dump_info(info);
 
     if ((info->magic0 != kMinfsMagic0) ||
         (info->magic1 != kMinfsMagic1)) {
         FS_TRACE_ERROR("minfs: bad magic\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (info->version != kMinfsVersion) {
         FS_TRACE_ERROR("minfs: FS Version: %08x. Driver version: %08x\n", info->version,
               kMinfsVersion);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if ((info->block_size != kMinfsBlockSize) ||
         (info->inode_size != kMinfsInodeSize)) {
         FS_TRACE_ERROR("minfs: bsz/isz %u/%u unsupported\n", info->block_size, info->inode_size);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if ((info->flags & kMinfsFlagFVM) == 0) {
         if (info->dat_block + info->block_count > max) {
             FS_TRACE_ERROR("minfs: too large for device\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     } else {
         // TODO(smklein): Verify slice size, vslice count.
@@ -76,45 +76,45 @@
         size_t ibm_blocks_allocated = info->ibm_slices * kBlocksPerSlice;
         if (ibm_blocks_needed > ibm_blocks_allocated) {
             FS_TRACE_ERROR("minfs: Not enough slices for inode bitmap\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else if (ibm_blocks_allocated + info->ibm_block >= info->abm_block) {
             FS_TRACE_ERROR("minfs: Inode bitmap collides into block bitmap\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         size_t abm_blocks_needed = (info->block_count + kMinfsBlockBits - 1) / kMinfsBlockBits;
         size_t abm_blocks_allocated = info->abm_slices * kBlocksPerSlice;
         if (abm_blocks_needed > abm_blocks_allocated) {
             FS_TRACE_ERROR("minfs: Not enough slices for block bitmap\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else if (abm_blocks_allocated + info->abm_block >= info->ino_block) {
             FS_TRACE_ERROR("minfs: Block bitmap collides with inode table\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         size_t ino_blocks_needed = (info->inode_count + kMinfsInodesPerBlock - 1) / kMinfsInodesPerBlock;
         size_t ino_blocks_allocated = info->ino_slices * kBlocksPerSlice;
         if (ino_blocks_needed > ino_blocks_allocated) {
             FS_TRACE_ERROR("minfs: Not enough slices for inode table\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else if (ino_blocks_allocated + info->ino_block >= info->dat_block) {
             FS_TRACE_ERROR("minfs: Inode table collides with data blocks\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         size_t dat_blocks_needed = info->block_count;
         size_t dat_blocks_allocated = info->dat_slices * kBlocksPerSlice;
         if (dat_blocks_needed > dat_blocks_allocated) {
             FS_TRACE_ERROR("minfs: Not enough slices for data blocks\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else if (dat_blocks_allocated + info->dat_block >
                    fbl::numeric_limits<blk_t>::max()) {
             FS_TRACE_ERROR("minfs: Data blocks overflow blk_t\n");
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     }
     //TODO: validate layout
     return 0;
 }
 
-mx_status_t Minfs::InodeSync(WriteTxn* txn, ino_t ino, const minfs_inode_t* inode) {
+zx_status_t Minfs::InodeSync(WriteTxn* txn, ino_t ino, const minfs_inode_t* inode) {
     // Obtain the offset of the inode within its containing block
     const uint32_t off_of_ino = (ino % kMinfsInodesPerBlock) * kMinfsInodeSize;
     const blk_t inoblock_rel = ino / kMinfsInodesPerBlock;
@@ -134,7 +134,7 @@
     memcpy((void*)((uintptr_t)inodata + off_of_ino), inode, kMinfsInodeSize);
     bc_->Writeblk(inoblock_abs, inodata);
 #endif
-    return MX_OK;
+    return ZX_OK;
 }
 
 Minfs::Minfs(fbl::unique_ptr<Bcache> bc, const minfs_info_t* info) : bc_(fbl::move(bc)) {
@@ -145,7 +145,7 @@
     vnode_hash_.clear();
 }
 
-mx_status_t Minfs::InoFree(VnodeMinfs* vn) {
+zx_status_t Minfs::InoFree(VnodeMinfs* vn) {
     // We're going to be updating block bitmaps repeatedly.
     WriteTxn txn(bc_.get());
 #ifdef __Fuchsia__
@@ -180,8 +180,8 @@
         }
 
 #ifdef __Fuchsia__
-        mx_status_t status;
-        if ((status = vn->InitIndirectVmo()) != MX_OK) {
+        zx_status_t status;
+        if ((status = vn->InitIndirectVmo()) != ZX_OK) {
             return status;
         }
 
@@ -212,8 +212,8 @@
             continue;
         }
 #ifdef __Fuchsia__
-        mx_status_t status;
-        if ((status = vn->InitIndirectVmo()) != MX_OK) {
+        zx_status_t status;
+        if ((status = vn->InitIndirectVmo()) != ZX_OK) {
             return status;
         }
 
@@ -230,7 +230,7 @@
             }
 
 #ifdef __Fuchsia__
-            if ((status = vn->LoadIndirectWithinDoublyIndirect(n)) != MX_OK) {
+            if ((status = vn->LoadIndirectWithinDoublyIndirect(n)) != ZX_OK) {
                 return status;
             }
 
@@ -262,14 +262,14 @@
     }
 
     CountUpdate(&txn);
-    MX_DEBUG_ASSERT(block_count == 0);
-    return MX_OK;
+    ZX_DEBUG_ASSERT(block_count == 0);
+    return ZX_OK;
 }
 
-mx_status_t Minfs::AddInodes() {
+zx_status_t Minfs::AddInodes() {
 #ifdef __Fuchsia__
     if ((info_.flags & kMinfsFlagFVM) == 0) {
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     const size_t kBlocksPerSlice = info_.slice_size / kMinfsBlockSize;
@@ -283,27 +283,27 @@
             * kInodesPerSlice;
     uint32_t ibmblks = (inodes + kMinfsBlockBits - 1) / kMinfsBlockBits;
     uint32_t ibmblks_old = (info_.inode_count + kMinfsBlockBits - 1) / kMinfsBlockBits;
-    MX_DEBUG_ASSERT(ibmblks_old <= ibmblks);
+    ZX_DEBUG_ASSERT(ibmblks_old <= ibmblks);
     if (ibmblks > kBlocksPerSlice) {
         // TODO(smklein): Increase the size of the inode bitmap,
         // in addition to the size of the inode table.
         fprintf(stderr, "Minfs::AddInodes needs to increase inode bitmap size");
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
-    if (bc_->FVMExtend(&request) != MX_OK) {
+    if (bc_->FVMExtend(&request) != ZX_OK) {
         // TODO(smklein): Query FVM on reboot to verify our
         // superblock matches our allocated extents.
         fprintf(stderr, "Minfs::AddInodes FVM Extend failure");
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     WriteTxn txn(bc_.get());
 
     // Update the inode bitmap, write the new blocks back to disk
     // as "zero".
-    if (inode_map_.Grow(fbl::roundup(inodes, kMinfsBlockBits)) != MX_OK) {
-        return MX_ERR_NO_SPACE;
+    if (inode_map_.Grow(fbl::roundup(inodes, kMinfsBlockBits)) != ZX_OK) {
+        return ZX_ERR_NO_SPACE;
     }
     // Grow before shrinking to ensure the underlying storage is a multiple
     // of kMinfsBlockSize.
@@ -315,8 +315,8 @@
 
     // Update the inode table
     uint32_t inoblks = (inodes + kMinfsInodesPerBlock - 1) / kMinfsInodesPerBlock;
-    if (inode_table_->Grow(inoblks * kMinfsBlockSize) != MX_OK) {
-        return MX_ERR_NO_SPACE;
+    if (inode_table_->Grow(inoblks * kMinfsBlockSize) != ZX_OK) {
+        return ZX_ERR_NO_SPACE;
     }
 
     info_.vslice_count += request.length;
@@ -327,14 +327,14 @@
 
     return txn.Flush();
 #else
-    return MX_ERR_NO_SPACE;
+    return ZX_ERR_NO_SPACE;
 #endif
 }
 
-mx_status_t Minfs::AddBlocks() {
+zx_status_t Minfs::AddBlocks() {
 #ifdef __Fuchsia__
     if ((info_.flags & kMinfsFlagFVM) == 0) {
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     const size_t kBlocksPerSlice = info_.slice_size / kMinfsBlockSize;
@@ -342,31 +342,31 @@
     request.length = 1;
     request.offset = (kFVMBlockDataStart / kBlocksPerSlice) + info_.dat_slices;
     uint64_t blocks64 = (info_.dat_slices + request.length) * kBlocksPerSlice;
-    MX_DEBUG_ASSERT(blocks64 <= fbl::numeric_limits<uint32_t>::max());
+    ZX_DEBUG_ASSERT(blocks64 <= fbl::numeric_limits<uint32_t>::max());
     uint32_t blocks = static_cast<uint32_t>(blocks64);
     uint32_t abmblks = (blocks + kMinfsBlockBits - 1) / kMinfsBlockBits;
     uint32_t abmblks_old = (info_.block_count + kMinfsBlockBits - 1) / kMinfsBlockBits;
-    MX_DEBUG_ASSERT(abmblks_old <= abmblks);
+    ZX_DEBUG_ASSERT(abmblks_old <= abmblks);
 
     if (abmblks > kBlocksPerSlice) {
         // TODO(smklein): Increase the size of the block bitmap.
         fprintf(stderr, "Minfs::AddBlocks needs to increase block bitmap size");
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
-    if (bc_->FVMExtend(&request) != MX_OK) {
+    if (bc_->FVMExtend(&request) != ZX_OK) {
         // TODO(smklein): Query FVM on reboot to verify our
         // superblock matches our allocated extents.
         fprintf(stderr, "Minfs::AddBlocks FVM Extend failure");
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     WriteTxn txn(bc_.get());
 
     // Update the block bitmap, write the new blocks back to disk
     // as "zero".
-    if (block_map_.Grow(fbl::roundup(blocks, kMinfsBlockBits)) != MX_OK) {
-        return MX_ERR_NO_SPACE;
+    if (block_map_.Grow(fbl::roundup(blocks, kMinfsBlockBits)) != ZX_OK) {
+        return ZX_ERR_NO_SPACE;
     }
     // Grow before shrinking to ensure the underlying storage is a multiple
     // of kMinfsBlockSize.
@@ -384,31 +384,31 @@
     txn.Enqueue(info_vmoid_, 0, 0, 1);
     return txn.Flush();
 #else
-    return MX_ERR_NO_SPACE;
+    return ZX_ERR_NO_SPACE;
 #endif
 }
 
-mx_status_t Minfs::InoNew(WriteTxn* txn, const minfs_inode_t* inode, ino_t* ino_out) {
+zx_status_t Minfs::InoNew(WriteTxn* txn, const minfs_inode_t* inode, ino_t* ino_out) {
     size_t bitoff_start;
-    mx_status_t status = inode_map_.Find(false, 0, inode_map_.size(), 1, &bitoff_start);
-    if (status != MX_OK) {
+    zx_status_t status = inode_map_.Find(false, 0, inode_map_.size(), 1, &bitoff_start);
+    if (status != ZX_OK) {
         size_t old_size = inode_map_.size();
-        if ((status = AddInodes()) != MX_OK) {
+        if ((status = AddInodes()) != ZX_OK) {
             return status;
         } else if ((status = inode_map_.Find(false, old_size, inode_map_.size(),
-                                             1, &bitoff_start)) != MX_OK) {
+                                             1, &bitoff_start)) != ZX_OK) {
             return status;
         }
     }
 
     status = inode_map_.Set(bitoff_start, bitoff_start + 1);
-    assert(status == MX_OK);
+    assert(status == ZX_OK);
     info_.alloc_inode_count++;
     ino_t ino = static_cast<ino_t>(bitoff_start);
 
     // locate data and block offset of bitmap
     void* bmdata;
-    MX_DEBUG_ASSERT(ino <= inode_map_.size());
+    ZX_DEBUG_ASSERT(ino <= inode_map_.size());
     blk_t ibm_relative_bno = (ino / kMinfsBlockBits);
     if ((bmdata = fs::GetBlock<kMinfsBlockSize>(inode_map_.StorageUnsafe()->GetData(),
         ibm_relative_bno)) == nullptr) {
@@ -418,7 +418,7 @@
     // TODO(smklein): optional sanity check of both blocks
 
     // Write the inode back
-    if ((status = InodeSync(txn, ino, inode)) != MX_OK) {
+    if ((status = InodeSync(txn, ino, inode)) != ZX_OK) {
         inode_map_.Clear(ino, ino + 1);
         info_.alloc_inode_count--;
         return status;
@@ -434,24 +434,24 @@
 
     CountUpdate(txn);
     *ino_out = ino;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Minfs::VnodeNew(WriteTxn* txn, fbl::RefPtr<VnodeMinfs>* out, uint32_t type) {
+zx_status_t Minfs::VnodeNew(WriteTxn* txn, fbl::RefPtr<VnodeMinfs>* out, uint32_t type) {
     if ((type != kMinfsTypeFile) && (type != kMinfsTypeDir)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     fbl::RefPtr<VnodeMinfs> vn;
-    mx_status_t status;
+    zx_status_t status;
 
     // Allocate the in-memory vnode
-    if ((status = VnodeMinfs::Allocate(this, type, &vn)) != MX_OK) {
+    if ((status = VnodeMinfs::Allocate(this, type, &vn)) != ZX_OK) {
         return status;
     }
 
     // Allocate the on-disk inode
-    if ((status = InoNew(txn, &vn->inode_, &vn->ino_)) != MX_OK) {
+    if ((status = InoNew(txn, &vn->inode_, &vn->ino_)) != ZX_OK) {
         return status;
     }
 
@@ -465,18 +465,18 @@
     vnode_hash_.erase(*vn);
 }
 
-mx_status_t Minfs::VnodeGet(fbl::RefPtr<VnodeMinfs>* out, ino_t ino) {
+zx_status_t Minfs::VnodeGet(fbl::RefPtr<VnodeMinfs>* out, ino_t ino) {
     if ((ino < 1) || (ino >= info_.inode_count)) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     fbl::RefPtr<VnodeMinfs> vn = fbl::RefPtr<VnodeMinfs>(vnode_hash_.find(ino).CopyPointer());
     if (vn != nullptr) {
         *out = fbl::move(vn);
-        return MX_OK;
+        return ZX_OK;
     }
-    mx_status_t status;
-    if ((status = VnodeMinfs::AllocateHollow(this, &vn)) != MX_OK) {
-        return MX_ERR_NO_MEMORY;
+    zx_status_t status;
+    if ((status = VnodeMinfs::AllocateHollow(this, &vn)) != ZX_OK) {
+        return ZX_ERR_NO_MEMORY;
     }
 
     // obtain the block of the inode table we need
@@ -493,10 +493,10 @@
     vnode_hash_.insert(vn.get());
 
     *out = fbl::move(vn);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Minfs::BlockFree(WriteTxn* txn, blk_t bno) {
+zx_status_t Minfs::BlockFree(WriteTxn* txn, blk_t bno) {
     ValidateBno(bno);
 
 #ifdef __Fuchsia__
@@ -516,23 +516,23 @@
 //
 // If hint is nonzero it indicates which block number to start the search for
 // free blocks from.
-mx_status_t Minfs::BlockNew(WriteTxn* txn, blk_t hint, blk_t* out_bno) {
+zx_status_t Minfs::BlockNew(WriteTxn* txn, blk_t hint, blk_t* out_bno) {
     size_t bitoff_start;
-    mx_status_t status;
-    if ((status = block_map_.Find(false, hint, block_map_.size(), 1, &bitoff_start)) != MX_OK) {
-        if ((status = block_map_.Find(false, 0, hint, 1, &bitoff_start)) != MX_OK) {
+    zx_status_t status;
+    if ((status = block_map_.Find(false, hint, block_map_.size(), 1, &bitoff_start)) != ZX_OK) {
+        if ((status = block_map_.Find(false, 0, hint, 1, &bitoff_start)) != ZX_OK) {
             size_t old_size = block_map_.size();
-            if ((status = AddBlocks()) != MX_OK) {
+            if ((status = AddBlocks()) != ZX_OK) {
                 return status;
             } else if ((status = block_map_.Find(false, old_size, block_map_.size(),
-                                                 1, &bitoff_start)) != MX_OK) {
+                                                 1, &bitoff_start)) != ZX_OK) {
                 return status;
             }
         }
     }
 
     status = block_map_.Set(bitoff_start, bitoff_start + 1);
-    assert(status == MX_OK);
+    assert(status == ZX_OK);
     info_.alloc_block_count++;
     blk_t bno = static_cast<blk_t>(bitoff_start);
     ValidateBno(bno);
@@ -551,11 +551,11 @@
     *out_bno = bno;
 
     CountUpdate(txn);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Minfs::CountUpdate(WriteTxn* txn) {
-    mx_status_t status = MX_OK;
+zx_status_t Minfs::CountUpdate(WriteTxn* txn) {
+    zx_status_t status = ZX_OK;
 
 #ifdef __Fuchsia__
     void* infodata = info_vmo_->GetData();
@@ -593,8 +593,8 @@
     de->name[1] = '.';
 }
 
-mx_status_t Minfs::Create(Minfs** out, fbl::unique_ptr<Bcache> bc, const minfs_info_t* info) {
-    mx_status_t status = minfs_check_info(info, bc->Maxblk());
+zx_status_t Minfs::Create(Minfs** out, fbl::unique_ptr<Bcache> bc, const minfs_info_t* info) {
+    zx_status_t status = minfs_check_info(info, bc->Maxblk());
     if (status < 0) {
         return status;
     }
@@ -602,7 +602,7 @@
     fbl::AllocChecker ac;
     fbl::unique_ptr<Minfs> fs(new (&ac) Minfs(fbl::move(bc), info));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     // determine how many blocks of inodes, allocation bitmaps,
     // and inode bitmaps there are
@@ -628,34 +628,34 @@
 
 #ifdef __Fuchsia__
     if ((status = fs->bc_->AttachVmo(fs->block_map_.StorageUnsafe()->GetVmo(),
-                                     &fs->block_map_vmoid_)) != MX_OK) {
+                                     &fs->block_map_vmoid_)) != ZX_OK) {
         return status;
     }
     if ((status = fs->bc_->AttachVmo(fs->inode_map_.StorageUnsafe()->GetVmo(),
-                                     &fs->inode_map_vmoid_)) != MX_OK) {
+                                     &fs->inode_map_vmoid_)) != ZX_OK) {
         return status;
     }
 
     // Create the inode table.
     uint32_t inoblks = (inodes + kMinfsInodesPerBlock - 1) / kMinfsInodesPerBlock;
     if ((status = MappedVmo::Create(inoblks * kMinfsBlockSize, "minfs-inode-table",
-                                    &fs->inode_table_)) != MX_OK) {
+                                    &fs->inode_table_)) != ZX_OK) {
         return status;
     }
 
     if ((status = fs->bc_->AttachVmo(fs->inode_table_->GetVmo(),
-                                     &fs->inode_table_vmoid_)) != MX_OK) {
+                                     &fs->inode_table_vmoid_)) != ZX_OK) {
         return status;
     }
 
     // Create the info vmo
     if ((status = MappedVmo::Create(kMinfsBlockSize, "minfs-superblock",
-                                    &fs->info_vmo_)) != MX_OK) {
+                                    &fs->info_vmo_)) != ZX_OK) {
         return status;
     }
 
     if ((status = fs->bc_->AttachVmo(fs->info_vmo_->GetVmo(),
-                                     &fs->info_vmoid_)) != MX_OK) {
+                                     &fs->info_vmoid_)) != ZX_OK) {
         return status;
     }
 
@@ -664,7 +664,7 @@
     txn.Enqueue(fs->inode_map_vmoid_, 0, fs->info_.ibm_block, fs->ibmblks_);
     txn.Enqueue(fs->inode_table_vmoid_, 0, fs->info_.ino_block, inoblks);
     txn.Enqueue(fs->info_vmoid_, 0, 0, 1);
-    if ((status = txn.Flush()) != MX_OK) {
+    if ((status = txn.Flush()) != ZX_OK) {
         return status;
     }
 
@@ -684,38 +684,38 @@
 #endif
 
     *out = fs.release();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t minfs_mount(fbl::RefPtr<VnodeMinfs>* out, fbl::unique_ptr<Bcache> bc) {
-    mx_status_t status;
+zx_status_t minfs_mount(fbl::RefPtr<VnodeMinfs>* out, fbl::unique_ptr<Bcache> bc) {
+    zx_status_t status;
 
     char blk[kMinfsBlockSize];
-    if ((status = bc->Readblk(0, &blk)) != MX_OK) {
+    if ((status = bc->Readblk(0, &blk)) != ZX_OK) {
         FS_TRACE_ERROR("minfs: could not read info block\n");
         return status;
     }
     const minfs_info_t* info = reinterpret_cast<minfs_info_t*>(blk);
 
     Minfs* fs;
-    if ((status = Minfs::Create(&fs, fbl::move(bc), info)) != MX_OK) {
+    if ((status = Minfs::Create(&fs, fbl::move(bc), info)) != ZX_OK) {
         FS_TRACE_ERROR("minfs: mount failed\n");
         return status;
     }
 
     fbl::RefPtr<VnodeMinfs> vn;
-    if ((status = fs->VnodeGet(&vn, kMinfsRootIno)) != MX_OK) {
+    if ((status = fs->VnodeGet(&vn, kMinfsRootIno)) != ZX_OK) {
         FS_TRACE_ERROR("minfs: cannot find root inode\n");
         delete fs;
         return status;
     }
 
-    MX_DEBUG_ASSERT(vn->IsDirectory());
+    ZX_DEBUG_ASSERT(vn->IsDirectory());
     *out = fbl::move(vn);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Minfs::Unmount() {
+zx_status_t Minfs::Unmount() {
 #ifdef __Fuchsia__
     dispatcher_ = nullptr;
 #endif
@@ -726,7 +726,7 @@
     // TODO(smklein): To not bind filesystem lifecycle to a process, shut
     // down (closing dispatcher) rather than calling exit.
     exit(0);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void minfs_free_slices(Bcache* bc, const minfs_info_t* info) {
@@ -774,7 +774,7 @@
 
 #ifdef __Fuchsia__
     fvm_info_t fvm_info;
-    if (bc->FVMQuery(&fvm_info) == MX_OK) {
+    if (bc->FVMQuery(&fvm_info) == ZX_OK) {
         info.slice_size = fvm_info.slice_size;
         info.flags |= kMinfsFlagFVM;
 
@@ -788,27 +788,27 @@
         extend_request_t request;
         request.length = 1;
         request.offset = kFVMBlockInodeBmStart / kBlocksPerSlice;
-        if (bc->FVMExtend(&request) != MX_OK) {
+        if (bc->FVMExtend(&request) != ZX_OK) {
             fprintf(stderr, "minfs mkfs: Failed to allocate inode bitmap\n");
             return -1;
         }
         info.ibm_slices = 1;
         request.offset = kFVMBlockDataBmStart / kBlocksPerSlice;
-        if (bc->FVMExtend(&request) != MX_OK) {
+        if (bc->FVMExtend(&request) != ZX_OK) {
             fprintf(stderr, "minfs mkfs: Failed to allocate data bitmap\n");
             minfs_free_slices(bc.get(), &info);
             return -1;
         }
         info.abm_slices = 1;
         request.offset = kFVMBlockInodeStart / kBlocksPerSlice;
-        if (bc->FVMExtend(&request) != MX_OK) {
+        if (bc->FVMExtend(&request) != ZX_OK) {
             fprintf(stderr, "minfs mkfs: Failed to allocate inode table\n");
             minfs_free_slices(bc.get(), &info);
             return -1;
         }
         info.ino_slices = 1;
         request.offset = kFVMBlockDataStart / kBlocksPerSlice;
-        if (bc->FVMExtend(&request) != MX_OK) {
+        if (bc->FVMExtend(&request) != ZX_OK) {
             fprintf(stderr, "minfs mkfs: Failed to allocate data blocks\n");
             minfs_free_slices(bc.get(), &info);
             return -1;
@@ -842,7 +842,7 @@
         if (non_dat_blocks >= blocks) {
             fprintf(stderr, "mkfs: Partition size (%" PRIu64 " bytes) is too small\n",
                     static_cast<uint64_t>(blocks) * kMinfsBlockSize);
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         uint32_t dat_block_count = blocks - non_dat_blocks;
@@ -869,7 +869,7 @@
     // By allocating the bitmap and then shrinking it, we keep the underlying
     // storage a block multiple but ensure we can't allocate beyond the last
     // real block or inode.
-    mx_status_t status;
+    zx_status_t status;
     if ((status = abm.Reset(fbl::roundup(info.block_count, kMinfsBlockBits))) < 0) {
         FS_TRACE_ERROR("mkfs: Failed to allocate block bitmap\n");
         minfs_free_slices(bc.get(), &info);
diff --git a/system/uapp/minfs/minfs.h b/system/uapp/minfs/minfs.h
index ce844f0..1f9fa96 100644
--- a/system/uapp/minfs/minfs.h
+++ b/system/uapp/minfs/minfs.h
@@ -14,7 +14,7 @@
 #include <fbl/type_support.h>
 #include <fbl/unique_free_ptr.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <assert.h>
 #include <limits.h>
@@ -195,12 +195,12 @@
     DISALLOW_COPY_ASSIGN_AND_MOVE(Bcache);
     friend class BlockNode;
 
-    static mx_status_t Create(fbl::unique_ptr<Bcache>* out, int fd, uint32_t blockmax);
+    static zx_status_t Create(fbl::unique_ptr<Bcache>* out, int fd, uint32_t blockmax);
 
     // Raw block read functions.
     // These do not track blocks (or attempt to access the block cache)
-    mx_status_t Readblk(blk_t bno, void* data);
-    mx_status_t Writeblk(blk_t bno, const void* data);
+    zx_status_t Readblk(blk_t bno, void* data);
+    zx_status_t Writeblk(blk_t bno, const void* data);
 
     // Returns the maximum number of available blocks,
     // assuming the filesystem is non-resizable.
@@ -208,34 +208,34 @@
 
 #ifdef __Fuchsia__
     ssize_t GetDevicePath(char* out, size_t out_len);
-    mx_status_t AttachVmo(mx_handle_t vmo, vmoid_t* out);
-    mx_status_t Txn(block_fifo_request_t* requests, size_t count) {
+    zx_status_t AttachVmo(zx_handle_t vmo, vmoid_t* out);
+    zx_status_t Txn(block_fifo_request_t* requests, size_t count) {
         return block_fifo_txn(fifo_client_, requests, count);
     }
     txnid_t TxnId() const { return txnid_; }
 
-    mx_status_t FVMQuery(fvm_info_t* info) {
+    zx_status_t FVMQuery(fvm_info_t* info) {
         ssize_t r = ioctl_block_fvm_query(fd_, info);
         if (r < 0) {
-            return static_cast<mx_status_t>(r);
+            return static_cast<zx_status_t>(r);
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t FVMExtend(const extend_request_t* request) {
+    zx_status_t FVMExtend(const extend_request_t* request) {
         ssize_t r = ioctl_block_fvm_extend(fd_, request);
         if (r < 0) {
-            return static_cast<mx_status_t>(r);
+            return static_cast<zx_status_t>(r);
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t FVMShrink(const extend_request_t* request) {
+    zx_status_t FVMShrink(const extend_request_t* request) {
         ssize_t r = ioctl_block_fvm_shrink(fd_, request);
         if (r < 0) {
-            return static_cast<mx_status_t>(r);
+            return static_cast<zx_status_t>(r);
         }
-        return MX_OK;
+        return ZX_OK;
     }
 #endif
 
diff --git a/system/uapp/minfs/rules.mk b/system/uapp/minfs/rules.mk
index d9cdeb4..62cb3b7 100644
--- a/system/uapp/minfs/rules.mk
+++ b/system/uapp/minfs/rules.mk
@@ -28,18 +28,18 @@
     system/ulib/async \
     system/ulib/async.loop \
     system/ulib/block-client \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/sync \
 
 MODULE_LIBS := \
     system/ulib/async.default \
     system/ulib/bitmap \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
 
 include make/module.mk
 
@@ -66,8 +66,8 @@
     -Werror-implicit-function-declaration \
     -Wstrict-prototypes -Wwrite-strings \
     -Isystem/ulib/bitmap/include \
-    -Isystem/ulib/mxcpp/include \
-    -Isystem/ulib/mxio/include \
+    -Isystem/ulib/zxcpp/include \
+    -Isystem/ulib/fdio/include \
     -Isystem/ulib/fbl/include \
     -Isystem/ulib/fs/include \
 
diff --git a/system/uapp/namespace/namespace.c b/system/uapp/namespace/namespace.c
index b95501e..4bf2e99 100644
--- a/system/uapp/namespace/namespace.c
+++ b/system/uapp/namespace/namespace.c
@@ -10,13 +10,13 @@
 #include <unistd.h>
 
 #include <launchpad/launchpad.h>
-#include <mxio/namespace.h>
-#include <magenta/syscalls.h>
+#include <fdio/namespace.h>
+#include <zircon/syscalls.h>
 
 int run_in_namespace(const char* bin, size_t count, char** mapping) {
-    mxio_ns_t* ns;
-    mx_status_t r;
-    if ((r = mxio_ns_create(&ns)) < 0) {
+    fdio_ns_t* ns;
+    zx_status_t r;
+    if ((r = fdio_ns_create(&ns)) < 0) {
         fprintf(stderr, "failed to create namespace: %d\n", r);
         return -1;
     }
@@ -33,17 +33,17 @@
             fprintf(stderr, "error: cannot open '%s'\n", src);
             return -1;
         }
-        if ((r = mxio_ns_bind_fd(ns, dst, fd)) < 0) {
+        if ((r = fdio_ns_bind_fd(ns, dst, fd)) < 0) {
             fprintf(stderr, "error: binding fd %d to '%s' failed: %d\n", fd, dst, r);
             close(fd);
             return -1;
         }
         close(fd);
     }
-    mxio_flat_namespace_t* flat;
-    mxio_ns_opendir(ns);
-    r = mxio_ns_export(ns, &flat);
-    mxio_ns_destroy(ns);
+    fdio_flat_namespace_t* flat;
+    fdio_ns_opendir(ns);
+    r = fdio_ns_export(ns, &flat);
+    fdio_ns_destroy(ns);
     if (r < 0) {
         fprintf(stderr, "error: cannot flatten namespace: %d\n", r);
         return -1;
@@ -56,19 +56,19 @@
 
     launchpad_t* lp;
     launchpad_create(0, bin, &lp);
-    launchpad_clone(lp, LP_CLONE_MXIO_STDIO | LP_CLONE_ENVIRON | LP_CLONE_DEFAULT_JOB);
+    launchpad_clone(lp, LP_CLONE_FDIO_STDIO | LP_CLONE_ENVIRON | LP_CLONE_DEFAULT_JOB);
     launchpad_set_args(lp, 1, &bin);
     launchpad_set_nametable(lp, flat->count, flat->path);
     launchpad_add_handles(lp, flat->count, flat->handle, flat->type);
     launchpad_load_from_file(lp, bin);
     free(flat);
     const char* errmsg;
-    mx_handle_t proc;
+    zx_handle_t proc;
     if ((r = launchpad_go(lp, &proc, &errmsg)) < 0) {
         fprintf(stderr, "error: failed to launch shell: %s\n", errmsg);
         return -1;
     }
-    mx_object_wait_one(proc, MX_PROCESS_TERMINATED, MX_TIME_INFINITE, NULL);
+    zx_object_wait_one(proc, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, NULL);
     fprintf(stderr, "[done]\n");
     return 0;
 }
diff --git a/system/uapp/namespace/rules.mk b/system/uapp/namespace/rules.mk
index efab377..895217f 100644
--- a/system/uapp/namespace/rules.mk
+++ b/system/uapp/namespace/rules.mk
@@ -15,8 +15,8 @@
 
 MODULE_LIBS := \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/netdump/netdump.c b/system/uapp/netdump/netdump.c
index 1f3fc2a..20b211f 100644
--- a/system/uapp/netdump/netdump.c
+++ b/system/uapp/netdump/netdump.c
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/device/ethernet.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <pretty/hexdump.h>
 
 #include <fcntl.h>
@@ -15,15 +15,15 @@
 
 #define BUFSIZE 2048
 
-void handle_rx(mx_handle_t rx_fifo, char* iobuf, unsigned count) {
+void handle_rx(zx_handle_t rx_fifo, char* iobuf, unsigned count) {
     eth_fifo_entry_t entries[count];
 
     for (;;) {
         uint32_t n;
-        mx_status_t status;
-        if ((status = mx_fifo_read(rx_fifo, entries, sizeof(entries), &n)) < 0) {
-            if (status == MX_ERR_SHOULD_WAIT) {
-                mx_object_wait_one(rx_fifo, MX_FIFO_READABLE | MX_FIFO_PEER_CLOSED, MX_TIME_INFINITE, NULL);
+        zx_status_t status;
+        if ((status = zx_fifo_read(rx_fifo, entries, sizeof(entries), &n)) < 0) {
+            if (status == ZX_ERR_SHOULD_WAIT) {
+                zx_object_wait_one(rx_fifo, ZX_FIFO_READABLE | ZX_FIFO_PEER_CLOSED, ZX_TIME_INFINITE, NULL);
                 continue;
             }
             fprintf(stderr, "netdump: failed to read rx packets: %d\n", status);
@@ -39,7 +39,7 @@
             e->length = BUFSIZE;
             e->flags = 0;
             uint32_t actual;
-            if ((status = mx_fifo_write(rx_fifo, e, sizeof(*e), &actual)) < 0) {
+            if ((status = zx_fifo_write(rx_fifo, e, sizeof(*e), &actual)) < 0) {
                 fprintf(stderr, "netdump: failed to queue rx packet: %d\n", status);
                 break;
             }
@@ -60,7 +60,7 @@
     }
 
     eth_fifos_t fifos;
-    mx_status_t status;
+    zx_status_t status;
 
     ssize_t r;
     if ((r = ioctl_ethernet_get_fifos(fd, &fifos)) < 0) {
@@ -69,15 +69,15 @@
     }
 
     unsigned count = fifos.rx_depth / 2;
-    mx_handle_t iovmo;
+    zx_handle_t iovmo;
     // allocate shareable ethernet buffer data heap
-    if ((status = mx_vmo_create(count * BUFSIZE, 0, &iovmo)) < 0) {
+    if ((status = zx_vmo_create(count * BUFSIZE, 0, &iovmo)) < 0) {
         return -1;
     }
 
     char* iobuf;
-    if ((status = mx_vmar_map(mx_vmar_root_self(), 0, iovmo, 0, count * BUFSIZE,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    if ((status = zx_vmar_map(zx_vmar_root_self(), 0, iovmo, 0, count * BUFSIZE,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                               (uintptr_t*)&iobuf)) < 0) {
         return -1;
     }
@@ -100,7 +100,7 @@
             .cookie = NULL,
         };
         uint32_t actual;
-        if ((status = mx_fifo_write(fifos.rx_fifo, &entry, sizeof(entry), &actual)) < 0) {
+        if ((status = zx_fifo_write(fifos.rx_fifo, &entry, sizeof(entry), &actual)) < 0) {
             fprintf(stderr, "netdump: failed to queue rx packet: %d\n", status);
             return -1;
         }
diff --git a/system/uapp/netdump/rules.mk b/system/uapp/netdump/rules.mk
index 098b89e..c6af079 100644
--- a/system/uapp/netdump/rules.mk
+++ b/system/uapp/netdump/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/pretty
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/netreflector/netreflector.c b/system/uapp/netreflector/netreflector.c
index c64b0c1..2db8cbd 100644
--- a/system/uapp/netreflector/netreflector.c
+++ b/system/uapp/netreflector/netreflector.c
@@ -3,10 +3,10 @@
 // found in the LICENSE file.
 
 #include <inet6/inet6.h>
-#include <magenta/device/ethernet.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 
 #include <fcntl.h>
 #include <limits.h>
@@ -39,7 +39,7 @@
 
 eth_buf_t* avail_tx_buffers = NULL;
 eth_buf_t* pending_tx = NULL;
-mx_handle_t port = MX_HANDLE_INVALID;
+zx_handle_t port = ZX_HANDLE_INVALID;
 
 void flip_src_dst(void* packet) {
     eth_hdr_t* eth = packet;
@@ -61,13 +61,13 @@
     udp->checksum = ip6_checksum(ip, HDR_UDP, ntohs(ip->length));
 }
 
-void send_pending_tx(mx_handle_t tx_fifo) {
+void send_pending_tx(zx_handle_t tx_fifo) {
     uint32_t n;
-    mx_status_t status;
+    zx_status_t status;
     while (pending_tx != NULL) {
         eth_fifo_entry_t* e = pending_tx->e;
         e->cookie = pending_tx;
-        if ((status = mx_fifo_write(tx_fifo, e, sizeof(eth_fifo_entry_t), &n)) != MX_OK) {
+        if ((status = zx_fifo_write(tx_fifo, e, sizeof(eth_fifo_entry_t), &n)) != ZX_OK) {
             fprintf(stderr, "netreflector: error reflecting packet %d\n", status);
             return;
         }
@@ -83,14 +83,14 @@
     }
 }
 
-mx_status_t acquire_tx_buffer(eth_buf_t** out) {
+zx_status_t acquire_tx_buffer(eth_buf_t** out) {
     if (avail_tx_buffers == NULL) {
         fprintf(stderr, "netreflector: no tx buffers available.\n");
-        return MX_ERR_SHOULD_WAIT;
+        return ZX_ERR_SHOULD_WAIT;
     }
     *out = avail_tx_buffers;
     avail_tx_buffers = avail_tx_buffers->next;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void queue_tx_buffer(eth_buf_t* tx) {
@@ -98,10 +98,10 @@
     pending_tx = tx;
 }
 
-mx_status_t reflect_packet(char* iobuf, eth_fifo_entry_t* e) {
+zx_status_t reflect_packet(char* iobuf, eth_fifo_entry_t* e) {
     eth_buf_t* tx;
-    mx_status_t status;
-    if ((status = acquire_tx_buffer(&tx)) != MX_OK) {
+    zx_status_t status;
+    if ((status = acquire_tx_buffer(&tx)) != ZX_OK) {
         return status;
     }
     tx->e->length = e->length;
@@ -112,10 +112,10 @@
     flip_src_dst(out_pkt);
 
     queue_tx_buffer(tx);
-    return MX_OK;
+    return ZX_OK;
 }
 
-void rx_complete(char* iobuf, mx_handle_t rx_fifo, eth_fifo_entry_t* e) {
+void rx_complete(char* iobuf, zx_handle_t rx_fifo, eth_fifo_entry_t* e) {
     if (!(e->flags & ETH_FIFO_RX_OK)) {
         return;
     }
@@ -135,33 +135,33 @@
     e->length = BUFSIZE;
     e->flags = 0;
     uint32_t actual;
-    mx_status_t status;
-    if ((status = mx_fifo_write(rx_fifo, e, sizeof(*e), &actual)) != MX_OK) {
+    zx_status_t status;
+    if ((status = zx_fifo_write(rx_fifo, e, sizeof(*e), &actual)) != ZX_OK) {
         fprintf(stderr, "netreflector: failed to queue rx packet: %d\n", status);
     }
 }
 
 void handle(char* iobuf, eth_fifos_t* fifos) {
-    mx_port_packet_t packet;
-    mx_status_t status;
+    zx_port_packet_t packet;
+    zx_status_t status;
     uint32_t n;
     eth_fifo_entry_t entries[BUFS];
     for (;;) {
-        status = mx_port_wait(port, MX_TIME_INFINITE, &packet, 0);
-        if (status != MX_OK) {
+        status = zx_port_wait(port, ZX_TIME_INFINITE, &packet, 0);
+        if (status != ZX_OK) {
             fprintf(stderr, "netreflector: error while waiting on port %d\n", status);
             return;
         }
 
-        if (packet.signal.observed & MX_FIFO_PEER_CLOSED) {
+        if (packet.signal.observed & ZX_FIFO_PEER_CLOSED) {
             fprintf(stderr, "netreflector: fifo closed\n");
             return;
         }
 
-        if (packet.signal.observed & MX_FIFO_READABLE) {
+        if (packet.signal.observed & ZX_FIFO_READABLE) {
             uint8_t fifo_id = (uint8_t)packet.key;
-            mx_handle_t fifo = (fifo_id == RX_FIFO ? fifos->rx_fifo : fifos->tx_fifo);
-            if ((status = mx_fifo_read(fifo, entries, sizeof(entries), &n)) != MX_OK) {
+            zx_handle_t fifo = (fifo_id == RX_FIFO ? fifos->rx_fifo : fifos->tx_fifo);
+            if ((status = zx_fifo_read(fifo, entries, sizeof(entries), &n)) != ZX_OK) {
                 fprintf(stderr, "netreflector: error reading fifo %d\n", status);
                 continue;
             }
@@ -196,7 +196,7 @@
     }
 
     eth_fifos_t fifos;
-    mx_status_t status;
+    zx_status_t status;
 
     ssize_t r;
     if ((r = ioctl_ethernet_set_client_name(fd, "netreflector", 13)) < 0) {
@@ -211,13 +211,13 @@
     // Allocate shareable ethernet buffer data heap. The first BUFS entries represent rx buffers,
     // followed by BUFS entries representing tx buffers.
     unsigned count = BUFS * 2;
-    mx_handle_t iovmo;
-    if ((status = mx_vmo_create(count * BUFSIZE, 0, &iovmo)) < 0) {
+    zx_handle_t iovmo;
+    if ((status = zx_vmo_create(count * BUFSIZE, 0, &iovmo)) < 0) {
         return -1;
     }
     char* iobuf;
-    if ((status = mx_vmar_map(mx_vmar_root_self(), 0, iovmo, 0, count * BUFSIZE,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    if ((status = zx_vmar_map(zx_vmar_root_self(), 0, iovmo, 0, count * BUFSIZE,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                               (uintptr_t*)&iobuf)) < 0) {
         return -1;
     }
@@ -234,7 +234,7 @@
             .offset = n * BUFSIZE, .length = BUFSIZE, .flags = 0, .cookie = NULL,
         };
         uint32_t actual;
-        if ((status = mx_fifo_write(fifos.rx_fifo, &entry, sizeof(entry), &actual)) < 0) {
+        if ((status = zx_fifo_write(fifos.rx_fifo, &entry, sizeof(entry), &actual)) < 0) {
             fprintf(stderr, "netreflector: failed to queue rx packet: %d\n", status);
             return -1;
         }
@@ -256,20 +256,20 @@
         return -1;
     }
 
-    if (mx_port_create(0, &port) != MX_OK) {
+    if (zx_port_create(0, &port) != ZX_OK) {
         fprintf(stderr, "netreflector: failed to create port\n");
         return -1;
     }
 
-    u_int32_t signals = MX_FIFO_READABLE | MX_FIFO_PEER_CLOSED;
-    if ((status = mx_object_wait_async(fifos.rx_fifo, port, RX_FIFO, signals,
-                                       MX_WAIT_ASYNC_REPEATING)) != MX_OK) {
+    u_int32_t signals = ZX_FIFO_READABLE | ZX_FIFO_PEER_CLOSED;
+    if ((status = zx_object_wait_async(fifos.rx_fifo, port, RX_FIFO, signals,
+                                       ZX_WAIT_ASYNC_REPEATING)) != ZX_OK) {
         fprintf(stderr, "netreflector: failed binding port to rx fifo %d\n", status);
         return -1;
     }
 
-    if ((status = mx_object_wait_async(fifos.tx_fifo, port, TX_FIFO, signals,
-                                       MX_WAIT_ASYNC_REPEATING)) != MX_OK) {
+    if ((status = zx_object_wait_async(fifos.tx_fifo, port, TX_FIFO, signals,
+                                       ZX_WAIT_ASYNC_REPEATING)) != ZX_OK) {
         fprintf(stderr, "netreflector: failed binding port to tx fifo %d\n", status);
         return -1;
     }
diff --git a/system/uapp/netreflector/rules.mk b/system/uapp/netreflector/rules.mk
index 443b893..bc6e6a8 100644
--- a/system/uapp/netreflector/rules.mk
+++ b/system/uapp/netreflector/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/inet6
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/psutils/kill.c b/system/uapp/psutils/kill.c
index b1be5b3..8bd9f25 100644
--- a/system/uapp/psutils/kill.c
+++ b/system/uapp/psutils/kill.c
@@ -6,19 +6,19 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <task-utils/walker.h>
 
-mx_koid_t task_id;
+zx_koid_t task_id;
 
-mx_status_t callback(void* unused_ctx, int depth, mx_handle_t handle,
-                     mx_koid_t koid, mx_koid_t parent_koid) {
+zx_status_t callback(void* unused_ctx, int depth, zx_handle_t handle,
+                     zx_koid_t koid, zx_koid_t parent_koid) {
     if (koid == task_id) {
-        mx_task_kill(handle);
+        zx_task_kill(handle);
         // found and killed the task - abort the search
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 int main(int argc, char** argv) {
@@ -29,8 +29,8 @@
 
     task_id = atoll(argv[1]);
 
-    mx_status_t status = walk_root_job_tree(callback, callback, NULL, NULL);
-    if (status == MX_OK) {
+    zx_status_t status = walk_root_job_tree(callback, callback, NULL, NULL);
+    if (status == ZX_OK) {
         fprintf(stderr, "no task found\n");
         return -1;
     }
diff --git a/system/uapp/psutils/killall.c b/system/uapp/psutils/killall.c
index 741ca8f..9e5ee7a 100644
--- a/system/uapp/psutils/killall.c
+++ b/system/uapp/psutils/killall.c
@@ -9,28 +9,28 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <task-utils/walker.h>
 
 const char* kill_name;
 int killed = 0;
 
-mx_status_t process_callback(void* unused_ctx, int depth, mx_handle_t process,
-                             mx_koid_t koid, mx_koid_t parent_koid) {
-    char name[MX_MAX_NAME_LEN];
-    mx_status_t status =
-        mx_object_get_property(process, MX_PROP_NAME, name, sizeof(name));
-    if (status != MX_OK) {
+zx_status_t process_callback(void* unused_ctx, int depth, zx_handle_t process,
+                             zx_koid_t koid, zx_koid_t parent_koid) {
+    char name[ZX_MAX_NAME_LEN];
+    zx_status_t status =
+        zx_object_get_property(process, ZX_PROP_NAME, name, sizeof(name));
+    if (status != ZX_OK) {
         return status;
     }
     if (!strcmp(name, kill_name) ||
         !fnmatch(kill_name, name, 0) ||
         !strcmp(basename(name), kill_name)) {
-        mx_task_kill(process);
+        zx_task_kill(process);
         printf("Killed %" PRIu64 " %s\n", koid, name);
         killed++;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 int main(int argc, char** argv) {
diff --git a/system/uapp/psutils/kstats.c b/system/uapp/psutils/kstats.c
index 7cb6eb8..8ee0678 100644
--- a/system/uapp/psutils/kstats.c
+++ b/system/uapp/psutils/kstats.c
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/device/sysinfo.h>
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/device/sysinfo.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/object.h>
 #include <pretty/sizes.h>
 
 #include <errno.h>
@@ -26,16 +26,16 @@
 // TODO: dynamically compute this based on what it returns
 #define MAX_CPUS 32
 
-static mx_status_t cpustats(mx_handle_t root_resource, mx_time_t delay) {
-    static mx_time_t last_idle_time[MAX_CPUS];
-    static mx_info_cpu_stats_t old_stats[MAX_CPUS];
-    mx_info_cpu_stats_t stats[MAX_CPUS];
+static zx_status_t cpustats(zx_handle_t root_resource, zx_time_t delay) {
+    static zx_time_t last_idle_time[MAX_CPUS];
+    static zx_info_cpu_stats_t old_stats[MAX_CPUS];
+    zx_info_cpu_stats_t stats[MAX_CPUS];
 
     // retrieve the system stats
     size_t actual, avail;
-    mx_status_t err = mx_object_get_info(root_resource, MX_INFO_CPU_STATS, &stats, sizeof(stats), &actual, &avail);
-    if (err != MX_OK) {
-        fprintf(stderr, "MX_INFO_CPU_STATS returns %d (%s)\n", err, mx_status_get_string(err));
+    zx_status_t err = zx_object_get_info(root_resource, ZX_INFO_CPU_STATS, &stats, sizeof(stats), &actual, &avail);
+    if (err != ZX_OK) {
+        fprintf(stderr, "ZX_INFO_CPU_STATS returns %d (%s)\n", err, zx_status_get_string(err));
         return err;
     }
 
@@ -52,10 +52,10 @@
            " ints (hw  tmr tmr_cb)"
            " ipi (rs  gen)\n");
     for (size_t i = 0; i < actual; i++) {
-        mx_time_t idle_time = stats[i].idle_time;
+        zx_time_t idle_time = stats[i].idle_time;
 
-        mx_time_t delta_time = idle_time - last_idle_time[i];
-        mx_time_t busy_time = delay - (delta_time > delay ? delay : delta_time);
+        zx_time_t delta_time = idle_time - last_idle_time[i];
+        zx_time_t busy_time = delay - (delta_time > delay ? delay : delta_time);
         unsigned int busypercent = (busy_time * 10000) / delay;
 
         printf("%3zu"
@@ -86,7 +86,7 @@
         last_idle_time[i] = idle_time;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void print_mem_stat(const char* label, size_t bytes) {
@@ -98,13 +98,13 @@
            bytes);
 }
 
-static mx_status_t memstats(mx_handle_t root_resource) {
-    mx_info_kmem_stats_t stats;
-    mx_status_t err = mx_object_get_info(
-        root_resource, MX_INFO_KMEM_STATS, &stats, sizeof(stats), NULL, NULL);
-    if (err != MX_OK) {
-        fprintf(stderr, "MX_INFO_KMEM_STATS returns %d (%s)\n",
-                err, mx_status_get_string(err));
+static zx_status_t memstats(zx_handle_t root_resource) {
+    zx_info_kmem_stats_t stats;
+    zx_status_t err = zx_object_get_info(
+        root_resource, ZX_INFO_KMEM_STATS, &stats, sizeof(stats), NULL, NULL);
+    if (err != ZX_OK) {
+        fprintf(stderr, "ZX_INFO_KMEM_STATS returns %d (%s)\n",
+                err, zx_status_get_string(err));
         return err;
     }
 
@@ -144,7 +144,7 @@
         // Maybe have a few buckets like 1s, 10s, 1m.
     }
     printf("%s\n", line);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void print_help(FILE* f) {
@@ -179,7 +179,7 @@
 int main(int argc, char** argv) {
     bool cpu_stats = false;
     bool mem_stats = false;
-    mx_time_t delay = MX_SEC(1);
+    zx_time_t delay = ZX_SEC(1);
     int num_loops = -1;
     bool timestamp = false;
 
@@ -190,7 +190,7 @@
                 cpu_stats = true;
                 break;
             case 'd':
-                delay = MX_SEC(atoi(optarg));
+                delay = ZX_SEC(atoi(optarg));
                 if (delay == 0) {
                     fprintf(stderr, "Bad -d value '%s'\n", optarg);
                     print_help(stderr);
@@ -227,9 +227,9 @@
         return 1;
     }
 
-    mx_handle_t root_resource;
-    mx_status_t ret = get_root_resource(&root_resource);
-    if (ret != MX_OK) {
+    zx_handle_t root_resource;
+    zx_status_t ret = get_root_resource(&root_resource);
+    if (ret != ZX_OK) {
         return ret;
     }
 
@@ -238,7 +238,7 @@
     fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK);
 
     for (;;) {
-        mx_time_t next_deadline = mx_deadline_after(delay);
+        zx_time_t next_deadline = zx_deadline_after(delay);
 
         // Print the current UTC time with milliseconds as
         // an ISO 8601 string.
@@ -259,7 +259,7 @@
             ret |= memstats(root_resource);
         }
 
-        if (ret != MX_OK)
+        if (ret != ZX_OK)
             break;
 
         if (num_loops > 0) {
@@ -276,10 +276,10 @@
             }
         }
 
-        mx_nanosleep(next_deadline);
+        zx_nanosleep(next_deadline);
     }
 
-    mx_handle_close(root_resource);
+    zx_handle_close(root_resource);
 
     return ret;
 }
diff --git a/system/uapp/psutils/memgraph.cpp b/system/uapp/psutils/memgraph.cpp
index cac83db..91511e9 100644
--- a/system/uapp/psutils/memgraph.cpp
+++ b/system/uapp/psutils/memgraph.cpp
@@ -11,12 +11,12 @@
 #include <stdlib.h>
 #include <time.h>
 
-#include <magenta/process.h>
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/object.h>
-#include <mxcpp/new.h>
+#include <zircon/process.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/object.h>
+#include <zxcpp/new.h>
 #include <task-utils/walker.h>
 
 #include "resources.h"
@@ -30,7 +30,7 @@
 // Prints info about VMOs and their relationship to a process.
 // Assumes we're in the middle of dumping a process.
 // TODO(dbort): Insert some special entry if count < avail?
-void print_vmos(const mx_info_vmo_t* vmos, size_t count) {
+void print_vmos(const zx_info_vmo_t* vmos, size_t count) {
     if (count == 0) {
         // Should never happen, but don't print anything in this case.
         return;
@@ -41,7 +41,7 @@
     // is used or referred to.
     printf(",\n   \"vmos\": [\n");
     for (size_t i = 0; i < count; i++) {
-        const mx_info_vmo_t* vmo = vmos + i;
+        const zx_info_vmo_t* vmo = vmos + i;
         char delim = i < (count - 1) ? ',' : ' ';
         printf("      {"
                "\"koid\": %" PRIu64 ", "
@@ -69,30 +69,30 @@
     // information specific to this particular use of a given VMO.
     printf("   \"vmo_refs\": [\n");
     for (size_t i = 0; i < count; i++) {
-        const mx_info_vmo_t* vmo = vmos + i;
+        const zx_info_vmo_t* vmo = vmos + i;
         char delim = i < (count - 1) ? ',' : ' ';
         printf("      {"
                "\"vmo_koid\": %" PRIu64 ", "
                "\"via\": [",
                vmo->koid);
         bool need_comma = false;
-        if (vmo->flags & MX_INFO_VMO_VIA_HANDLE) {
+        if (vmo->flags & ZX_INFO_VMO_VIA_HANDLE) {
             printf("\"HANDLE\"");
             need_comma = true;
         }
-        if (vmo->flags & MX_INFO_VMO_VIA_MAPPING) {
+        if (vmo->flags & ZX_INFO_VMO_VIA_MAPPING) {
             printf("%s\"MAPPING\"", need_comma ? ", " : "");
-            // Future improvement: Could use MX_INFO_PROCESS_MAPS to include
+            // Future improvement: Could use ZX_INFO_PROCESS_MAPS to include
             // specifics of how this VMO is mapped.
         }
         printf("]");
-        if (vmo->flags & MX_INFO_VMO_VIA_HANDLE) {
+        if (vmo->flags & ZX_INFO_VMO_VIA_HANDLE) {
             need_comma = false;
             printf(", \"handle_rights\": [");
 
 #define PRINT_RIGHT(r)                                      \
     do {                                                    \
-        if (vmo->handle_rights & MX_RIGHT_##r) {            \
+        if (vmo->handle_rights & ZX_RIGHT_##r) {            \
             printf("%s\"" #r "\"", need_comma ? ", " : ""); \
             need_comma = true;                              \
         }                                                   \
@@ -118,35 +118,35 @@
 public:
     // |self_koid| is the koid of this memgraph process, so we can
     // avoid trying to read our own VMOs (which is illegal).
-    JsonTaskEnumerator(mx_koid_t self_koid, bool show_threads, bool show_vmos)
+    JsonTaskEnumerator(zx_koid_t self_koid, bool show_threads, bool show_vmos)
         : self_koid_(self_koid),
           show_threads_(show_threads), show_vmos_(show_vmos) {}
 
-    mx_status_t partial_failure() const { return partial_failure_; }
+    zx_status_t partial_failure() const { return partial_failure_; }
 
 private:
-    static void GetTaskName(mx_handle_t task, mx_koid_t koid,
-                            char out_name[MX_MAX_NAME_LEN]) {
-        mx_status_t s = mx_object_get_property(
-            task, MX_PROP_NAME, out_name, MX_MAX_NAME_LEN);
-        if (s != MX_OK) {
+    static void GetTaskName(zx_handle_t task, zx_koid_t koid,
+                            char out_name[ZX_MAX_NAME_LEN]) {
+        zx_status_t s = zx_object_get_property(
+            task, ZX_PROP_NAME, out_name, ZX_MAX_NAME_LEN);
+        if (s != ZX_OK) {
             fprintf(stderr,
                     "WARNING: failed to get name of task %" PRIu64
                     ": %s (%d)\n",
-                    koid, mx_status_get_string(s), s);
-            snprintf(out_name, MX_MAX_NAME_LEN, "<UNKNOWN>");
+                    koid, zx_status_get_string(s), s);
+            snprintf(out_name, ZX_MAX_NAME_LEN, "<UNKNOWN>");
             // This is unfortunate, but not worth a partial failure
             // since the overall structure of the output is still intact.
         }
         // TODO(dbort): Escape quotes in name
     }
 
-    mx_status_t OnJob(int depth, mx_handle_t job,
-                      mx_koid_t koid, mx_koid_t parent_koid) override {
-        char name[MX_MAX_NAME_LEN];
+    zx_status_t OnJob(int depth, zx_handle_t job,
+                      zx_koid_t koid, zx_koid_t parent_koid) override {
+        char name[ZX_MAX_NAME_LEN];
         GetTaskName(job, koid, name);
 
-        char parent_id[MX_MAX_NAME_LEN + 16];
+        char parent_id[ZX_MAX_NAME_LEN + 16];
         if (parent_koid == 0) {
             // This is the root job, which we treat as a child of the
             // system VMO arena node.
@@ -167,12 +167,12 @@
                parent_id,
                name);
 
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t OnProcess(int depth, mx_handle_t process,
-                          mx_koid_t koid, mx_koid_t parent_koid) override {
-        char name[MX_MAX_NAME_LEN];
+    zx_status_t OnProcess(int depth, zx_handle_t process,
+                          zx_koid_t koid, zx_koid_t parent_koid) override {
+        char name[ZX_MAX_NAME_LEN];
         GetTaskName(process, koid, name);
 
         // Print basic info.
@@ -188,20 +188,20 @@
                name);
 
         // Print memory usage summaries.
-        mx_info_task_stats_t info;
-        mx_status_t s = mx_object_get_info(
-            process, MX_INFO_TASK_STATS, &info, sizeof(info), nullptr, nullptr);
-        if (s == MX_ERR_BAD_STATE) {
+        zx_info_task_stats_t info;
+        zx_status_t s = zx_object_get_info(
+            process, ZX_INFO_TASK_STATS, &info, sizeof(info), nullptr, nullptr);
+        if (s == ZX_ERR_BAD_STATE) {
             // Process has exited, but has not been destroyed.
             // Default to zero for all sizes.
             info = {};
-            s = MX_OK;
+            s = ZX_OK;
         }
-        if (s != MX_OK) {
+        if (s != ZX_OK) {
             fprintf(stderr,
                     "WARNING: failed to get mem stats for process %" PRIu64
                     ": %s (%d)\n",
-                    koid, mx_status_get_string(s), s);
+                    koid, zx_status_get_string(s), s);
             set_partial_failure(s);
         } else {
             printf(", "
@@ -217,15 +217,15 @@
         // times in this list; it's up to the consumer of this output
         // to de-duplicate.
         if (show_vmos_ && koid != self_koid_) {
-            mx_info_vmo_t* vmos;
+            zx_info_vmo_t* vmos;
             size_t count = 0;
             size_t avail = 0;
             s = get_vmos(process, &vmos, &count, &avail);
-            if (s != MX_OK) {
+            if (s != ZX_OK) {
                 fprintf(stderr,
                         "WARNING: failed to read VMOs for process %" PRIu64
                         ": %s (%d)\n",
-                        koid, mx_status_get_string(s), s);
+                        koid, zx_status_get_string(s), s);
                 set_partial_failure(s);
             } else {
                 if (count < avail) {
@@ -233,7 +233,7 @@
                             "WARNING: failed to read all VMOs for process "
                             "%" PRIu64 ": count %zu < avail %zu\n",
                             koid, count, avail);
-                    set_partial_failure(MX_ERR_BUFFER_TOO_SMALL);
+                    set_partial_failure(ZX_ERR_BUFFER_TOO_SMALL);
                     // Keep going with the truncated list.
                 }
                 print_vmos(vmos, count);
@@ -242,12 +242,12 @@
         }
         printf("},\n");
 
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t OnThread(int depth, mx_handle_t thread,
-                         mx_koid_t koid, mx_koid_t parent_koid) override {
-        char name[MX_MAX_NAME_LEN];
+    zx_status_t OnThread(int depth, zx_handle_t thread,
+                         zx_koid_t koid, zx_koid_t parent_koid) override {
+        char name[ZX_MAX_NAME_LEN];
         GetTaskName(thread, koid, name);
 
         // Print basic info.
@@ -263,37 +263,37 @@
                name);
 
         // Print state.
-        mx_info_thread_t info;
-        mx_status_t s = mx_object_get_info(
-            thread, MX_INFO_THREAD, &info, sizeof(info), nullptr, nullptr);
-        if (s != MX_OK) {
+        zx_info_thread_t info;
+        zx_status_t s = zx_object_get_info(
+            thread, ZX_INFO_THREAD, &info, sizeof(info), nullptr, nullptr);
+        if (s != ZX_OK) {
             fprintf(stderr,
                     "WARNING: failed to get info for thread %" PRIu64
                     ": %s (%d)\n",
-                    koid, mx_status_get_string(s), s);
+                    koid, zx_status_get_string(s), s);
             set_partial_failure(s);
         } else {
             const char* state = "<UNKNOWN>";
-            if (info.wait_exception_port_type != MX_EXCEPTION_PORT_TYPE_NONE) {
+            if (info.wait_exception_port_type != ZX_EXCEPTION_PORT_TYPE_NONE) {
                 state = "EXCEPTION";
             } else {
                 switch (info.state) {
-                case MX_THREAD_STATE_NEW:
+                case ZX_THREAD_STATE_NEW:
                     state = "NEW";
                     break;
-                case MX_THREAD_STATE_RUNNING:
+                case ZX_THREAD_STATE_RUNNING:
                     state = "RUNNING";
                     break;
-                case MX_THREAD_STATE_SUSPENDED:
+                case ZX_THREAD_STATE_SUSPENDED:
                     state = "SUSPENDED";
                     break;
-                case MX_THREAD_STATE_BLOCKED:
+                case ZX_THREAD_STATE_BLOCKED:
                     state = "BLOCKED";
                     break;
-                case MX_THREAD_STATE_DYING:
+                case ZX_THREAD_STATE_DYING:
                     state = "DYING";
                     break;
-                case MX_THREAD_STATE_DEAD:
+                case ZX_THREAD_STATE_DEAD:
                     state = "DEAD";
                     break;
                 }
@@ -301,21 +301,21 @@
             printf(", \"state\": \"%s\"", state);
         }
         printf("},\n");
-        return MX_OK;
+        return ZX_OK;
     }
 
-    const mx_koid_t self_koid_;
+    const zx_koid_t self_koid_;
     const bool show_threads_;
     const bool show_vmos_;
 
     // We try to keep going despite failures, but for scripting
     // purposes it's good to indicate failure at the end.
-    void set_partial_failure(mx_status_t status) {
-        if (partial_failure_ == MX_OK) {
+    void set_partial_failure(zx_status_t status) {
+        if (partial_failure_ == ZX_OK) {
             partial_failure_ = status;
         }
     }
-    mx_status_t partial_failure_ = MX_OK;
+    zx_status_t partial_failure_ = ZX_OK;
 
     bool has_on_job() const final { return true; }
     bool has_on_process() const final { return true; }
@@ -337,19 +337,19 @@
            size_bytes);
 }
 
-mx_status_t dump_kernel_memory() {
-    mx_handle_t root_resource;
-    mx_status_t s = get_root_resource(&root_resource);
-    if (s != MX_OK) {
+zx_status_t dump_kernel_memory() {
+    zx_handle_t root_resource;
+    zx_status_t s = get_root_resource(&root_resource);
+    if (s != ZX_OK) {
         return s;
     }
-    mx_info_kmem_stats_t stats;
-    s = mx_object_get_info(root_resource, MX_INFO_KMEM_STATS,
+    zx_info_kmem_stats_t stats;
+    s = zx_object_get_info(root_resource, ZX_INFO_KMEM_STATS,
                            &stats, sizeof(stats), nullptr, nullptr);
-    mx_handle_close(root_resource);
-    if (s != MX_OK) {
+    zx_handle_close(root_resource);
+    if (s != ZX_OK) {
         fprintf(stderr, "WARNING: failed to get kernel memory stats: %s (%d)\n",
-                mx_status_get_string(s), s);
+                zx_status_get_string(s), s);
         return s;
     }
 
@@ -364,7 +364,7 @@
     print_kernel_json("mmu", "kernel/physmem", stats.mmu_overhead_bytes);
     print_kernel_json("other", "kernel/physmem", stats.other_bytes);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void print_help(FILE* f) {
@@ -422,14 +422,14 @@
     }
 
     // Get our own koid so we can avoid (illegally) reading this process's VMOs.
-    mx_info_handle_basic_t info;
-    mx_status_t s = mx_object_get_info(mx_process_self(), MX_INFO_HANDLE_BASIC,
+    zx_info_handle_basic_t info;
+    zx_status_t s = zx_object_get_info(zx_process_self(), ZX_INFO_HANDLE_BASIC,
                                        &info, sizeof(info), nullptr, nullptr);
-    if (s != MX_OK) {
+    if (s != ZX_OK) {
         // This will probably result in a partial failure when we try to read
         // our own VMOs, but keep going.
         fprintf(stderr, "WARNING: could not find our own koid: %s (%d)\n",
-                mx_status_get_string(s), s);
+                zx_status_get_string(s), s);
         info = {};
         info.koid = 0;
     }
@@ -440,12 +440,12 @@
 
     printf("[\n");
 
-    mx_status_t ks = dump_kernel_memory();
+    zx_status_t ks = dump_kernel_memory();
 
     JsonTaskEnumerator jte(info.koid, show_threads, show_vmos);
     s = jte.WalkRootJobTree();
-    if (s != MX_OK) {
-        fprintf(stderr, "ERROR: %s (%d)\n", mx_status_get_string(s), s);
+    if (s != ZX_OK) {
+        fprintf(stderr, "ERROR: %s (%d)\n", zx_status_get_string(s), s);
         return 1;
     }
 
@@ -464,12 +464,12 @@
 
     // Exit with an error status if we hit any partial failures.
     s = jte.partial_failure();
-    if (s == MX_OK) {
+    if (s == ZX_OK) {
         s = ks;
     }
-    if (s != MX_OK) {
+    if (s != ZX_OK) {
         fprintf(stderr, "ERROR: delayed exit after partial failure: %s (%d)\n",
-                mx_status_get_string(s), s);
+                zx_status_get_string(s), s);
         return 1;
     }
     return 0;
diff --git a/system/uapp/psutils/ps.c b/system/uapp/psutils/ps.c
index 6e0e8b5..950d46c 100644
--- a/system/uapp/psutils/ps.c
+++ b/system/uapp/psutils/ps.c
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/object.h>
 #include <pretty/sizes.h>
 #include <task-utils/walker.h>
 
@@ -24,7 +24,7 @@
     char koid_str[MAX_KOID_LEN];
     char parent_koid_str[MAX_KOID_LEN];
     int depth;
-    char name[MX_MAX_NAME_LEN];
+    char name[ZX_MAX_NAME_LEN];
     char state_str[MAX_STATE_LEN];
     size_t pss_bytes;
     size_t private_bytes;
@@ -62,12 +62,12 @@
 static task_entry_t* job_stack[JOB_STACK_SIZE];
 
 // Adds a job's information to |tasks|.
-static mx_status_t job_callback(void* unused_ctx, int depth, mx_handle_t job,
-                                mx_koid_t koid, mx_koid_t parent_koid) {
+static zx_status_t job_callback(void* unused_ctx, int depth, zx_handle_t job,
+                                zx_koid_t koid, zx_koid_t parent_koid) {
     task_entry_t e = {.type = 'j', .depth = depth};
-    mx_status_t status =
-        mx_object_get_property(job, MX_PROP_NAME, e.name, sizeof(e.name));
-    if (status != MX_OK) {
+    zx_status_t status =
+        zx_object_get_property(job, ZX_PROP_NAME, e.name, sizeof(e.name));
+    if (status != ZX_OK) {
         // This will abort walk_job_tree(), so we don't need to worry
         // about job_stack.
         return status;
@@ -78,26 +78,26 @@
     // Put our entry pointer on the job stack so our descendants can find us.
     assert(depth < JOB_STACK_SIZE);
     job_stack[depth] = add_entry(&tasks, &e);
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Adds a process's information to |tasks|.
-static mx_status_t process_callback(void* unused_ctx, int depth,
-                                    mx_handle_t process,
-                                    mx_koid_t koid, mx_koid_t parent_koid) {
+static zx_status_t process_callback(void* unused_ctx, int depth,
+                                    zx_handle_t process,
+                                    zx_koid_t koid, zx_koid_t parent_koid) {
     task_entry_t e = {.type = 'p', .depth = depth};
-    mx_status_t status =
-        mx_object_get_property(process, MX_PROP_NAME, e.name, sizeof(e.name));
-    if (status != MX_OK) {
+    zx_status_t status =
+        zx_object_get_property(process, ZX_PROP_NAME, e.name, sizeof(e.name));
+    if (status != ZX_OK) {
         return status;
     }
-    mx_info_task_stats_t info;
-    status = mx_object_get_info(
-        process, MX_INFO_TASK_STATS, &info, sizeof(info), NULL, NULL);
-    if (status == MX_ERR_BAD_STATE) {
+    zx_info_task_stats_t info;
+    status = zx_object_get_info(
+        process, ZX_INFO_TASK_STATS, &info, sizeof(info), NULL, NULL);
+    if (status == ZX_ERR_BAD_STATE) {
         // Process has exited, but has not been destroyed.
         // Default to zero for all sizes.
-    } else if (status != MX_OK) {
+    } else if (status != ZX_OK) {
         return status;
     } else {
         e.private_bytes = info.mem_private_bytes;
@@ -118,26 +118,26 @@
     snprintf(e.parent_koid_str, sizeof(e.koid_str), "%" PRIu64, parent_koid);
     add_entry(&tasks, &e);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Return text representation of thread state.
-static const char* state_string(const mx_info_thread_t* info) {
-    if (info->wait_exception_port_type != MX_EXCEPTION_PORT_TYPE_NONE) {
+static const char* state_string(const zx_info_thread_t* info) {
+    if (info->wait_exception_port_type != ZX_EXCEPTION_PORT_TYPE_NONE) {
         return "excp";
     } else {
         switch (info->state) {
-        case MX_THREAD_STATE_NEW:
+        case ZX_THREAD_STATE_NEW:
             return "new";
-        case MX_THREAD_STATE_RUNNING:
+        case ZX_THREAD_STATE_RUNNING:
             return "running";
-        case MX_THREAD_STATE_SUSPENDED:
+        case ZX_THREAD_STATE_SUSPENDED:
             return "susp";
-        case MX_THREAD_STATE_BLOCKED:
+        case ZX_THREAD_STATE_BLOCKED:
             return "blocked";
-        case MX_THREAD_STATE_DYING:
+        case ZX_THREAD_STATE_DYING:
             return "dying";
-        case MX_THREAD_STATE_DEAD:
+        case ZX_THREAD_STATE_DEAD:
             return "dead";
         default:
             return "???";
@@ -146,19 +146,19 @@
 }
 
 // Adds a thread's information to |tasks|.
-static mx_status_t thread_callback(void* unused_ctx, int depth,
-                                   mx_handle_t thread,
-                                   mx_koid_t koid, mx_koid_t parent_koid) {
+static zx_status_t thread_callback(void* unused_ctx, int depth,
+                                   zx_handle_t thread,
+                                   zx_koid_t koid, zx_koid_t parent_koid) {
     task_entry_t e = {.type = 't', .depth = depth};
-    mx_status_t status =
-        mx_object_get_property(thread, MX_PROP_NAME, e.name, sizeof(e.name));
-    if (status != MX_OK) {
+    zx_status_t status =
+        zx_object_get_property(thread, ZX_PROP_NAME, e.name, sizeof(e.name));
+    if (status != ZX_OK) {
         return status;
     }
-    mx_info_thread_t info;
-    status = mx_object_get_info(thread, MX_INFO_THREAD, &info, sizeof(info),
+    zx_info_thread_t info;
+    status = zx_object_get_info(thread, ZX_INFO_THREAD, &info, sizeof(info),
                                 NULL, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
     // TODO: Print thread stack size in one of the memory usage fields?
@@ -166,7 +166,7 @@
     snprintf(e.parent_koid_str, sizeof(e.koid_str), "%" PRIu64, parent_koid);
     snprintf(e.state_str, sizeof(e.state_str), "%s", state_string(&info));
     add_entry(&tasks, &e);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void print_header(int id_w, bool with_threads) {
@@ -274,12 +274,12 @@
     }
 
     int ret = 0;
-    mx_status_t status =
+    zx_status_t status =
         walk_root_job_tree(job_callback, process_callback,
                            with_threads ? thread_callback : NULL, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "WARNING: walk_root_job_tree failed: %s (%d)\n",
-                mx_status_get_string(status), status);
+                zx_status_get_string(status), status);
         ret = 1;
     }
     print_table(&tasks, with_threads);
diff --git a/system/uapp/psutils/resources.c b/system/uapp/psutils/resources.c
index 8259500..bb71c33 100644
--- a/system/uapp/psutils/resources.c
+++ b/system/uapp/psutils/resources.c
@@ -4,8 +4,8 @@
 
 #include "resources.h"
 
-#include <magenta/device/sysinfo.h>
-#include <magenta/status.h>
+#include <zircon/device/sysinfo.h>
+#include <zircon/status.h>
 
 #include <errno.h>
 #include <fcntl.h>
@@ -13,12 +13,12 @@
 #include <string.h>
 #include <unistd.h>
 
-mx_status_t get_root_resource(mx_handle_t* root_resource) {
+zx_status_t get_root_resource(zx_handle_t* root_resource) {
     int fd = open("/dev/misc/sysinfo", O_RDWR);
     if (fd < 0) {
         fprintf(stderr, "ERROR: Cannot open sysinfo: %s (%d)\n",
                 strerror(errno), errno);
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     ssize_t n = ioctl_sysinfo_get_root_resource(fd, root_resource);
@@ -26,13 +26,13 @@
     if (n != sizeof(*root_resource)) {
         if (n < 0) {
             fprintf(stderr, "ERROR: Cannot obtain root resource: %s (%zd)\n",
-                    mx_status_get_string(n), n);
-            return (mx_status_t)n;
+                    zx_status_get_string(n), n);
+            return (zx_status_t)n;
         } else {
             fprintf(stderr, "ERROR: Cannot obtain root resource (%zd != %zd)\n",
                     n, sizeof(root_resource));
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/uapp/psutils/resources.h b/system/uapp/psutils/resources.h
index 22dbf01..54df8bc 100644
--- a/system/uapp/psutils/resources.h
+++ b/system/uapp/psutils/resources.h
@@ -4,14 +4,14 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
 // Returns a new handle to the root resource, which the caller
 // is responsible for closing.
 // See docs/objects/resource.md
-mx_status_t get_root_resource(mx_handle_t* root_resource);
+zx_status_t get_root_resource(zx_handle_t* root_resource);
 
 __END_CDECLS
diff --git a/system/uapp/psutils/rules.mk b/system/uapp/psutils/rules.mk
index 2038154..f109bb1 100644
--- a/system/uapp/psutils/rules.mk
+++ b/system/uapp/psutils/rules.mk
@@ -15,8 +15,8 @@
 MODULE_NAME := ps
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 MODULE_STATIC_LIBS := \
@@ -36,8 +36,8 @@
 MODULE_NAME := top
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 MODULE_STATIC_LIBS := \
@@ -57,8 +57,8 @@
 MODULE_NAME := kill
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 MODULE_STATIC_LIBS := \
@@ -77,8 +77,8 @@
 MODULE_NAME := killall
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 MODULE_STATIC_LIBS := \
@@ -97,8 +97,8 @@
 MODULE_NAME := vmaps
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 MODULE_STATIC_LIBS := \
@@ -120,8 +120,8 @@
 MODULE_NAME := vmos
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 MODULE_STATIC_LIBS := \
@@ -144,12 +144,12 @@
 MODULE_NAME := memgraph
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/task-utils
 
 # Generate an include file that contains the schema json
@@ -193,8 +193,8 @@
 MODULE_GROUP := core
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 MODULE_STATIC_LIBS := \
diff --git a/system/uapp/psutils/top.c b/system/uapp/psutils/top.c
index d5095fd..4b9779f 100644
--- a/system/uapp/psutils/top.c
+++ b/system/uapp/psutils/top.c
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/listnode.h>
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/listnode.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/object.h>
 #include <pretty/sizes.h>
 #include <task-utils/walker.h>
 
@@ -29,19 +29,19 @@
 
     // has it been seen this pass?
     bool scanned;
-    mx_time_t delta_time;
+    zx_time_t delta_time;
 
     // information about the thread
-    mx_koid_t proc_koid;
-    mx_koid_t koid;
-    mx_info_thread_t info;
-    mx_info_thread_stats_t stats;
-    char name[MX_MAX_NAME_LEN];
-    char proc_name[MX_MAX_NAME_LEN];
+    zx_koid_t proc_koid;
+    zx_koid_t koid;
+    zx_info_thread_t info;
+    zx_info_thread_stats_t stats;
+    char name[ZX_MAX_NAME_LEN];
+    char proc_name[ZX_MAX_NAME_LEN];
 } thread_info_t;
 
 // arguments
-static mx_time_t delay = MX_SEC(1);
+static zx_time_t delay = ZX_SEC(1);
 static int count = -1;
 static bool print_all = false;
 static bool raw_time = false;
@@ -49,26 +49,26 @@
 
 // active locals
 static struct list_node thread_list = LIST_INITIAL_VALUE(thread_list);
-static char last_process_name[MX_MAX_NAME_LEN];
-static mx_koid_t last_process_scanned;
+static char last_process_name[ZX_MAX_NAME_LEN];
+static zx_koid_t last_process_scanned;
 
 // Return text representation of thread state.
-static const char* state_string(const mx_info_thread_t* info) {
-    if (info->wait_exception_port_type != MX_EXCEPTION_PORT_TYPE_NONE) {
+static const char* state_string(const zx_info_thread_t* info) {
+    if (info->wait_exception_port_type != ZX_EXCEPTION_PORT_TYPE_NONE) {
         return "excp";
     } else {
         switch (info->state) {
-        case MX_THREAD_STATE_NEW:
+        case ZX_THREAD_STATE_NEW:
             return "new";
-        case MX_THREAD_STATE_RUNNING:
+        case ZX_THREAD_STATE_RUNNING:
             return "run";
-        case MX_THREAD_STATE_SUSPENDED:
+        case ZX_THREAD_STATE_SUSPENDED:
             return "susp";
-        case MX_THREAD_STATE_BLOCKED:
+        case ZX_THREAD_STATE_BLOCKED:
             return "block";
-        case MX_THREAD_STATE_DYING:
+        case ZX_THREAD_STATE_DYING:
             return "dying";
-        case MX_THREAD_STATE_DEAD:
+        case ZX_THREAD_STATE_DEAD:
             return "dead";
         default:
             return "???";
@@ -76,20 +76,20 @@
     }
 }
 
-static mx_status_t process_callback(void* unused_ctx, int depth,
-                                    mx_handle_t proc,
-                                    mx_koid_t koid, mx_koid_t parent_koid) {
+static zx_status_t process_callback(void* unused_ctx, int depth,
+                                    zx_handle_t proc,
+                                    zx_koid_t koid, zx_koid_t parent_koid) {
     last_process_scanned = koid;
 
-    mx_status_t status = mx_object_get_property(
-        proc, MX_PROP_NAME, &last_process_name, sizeof(last_process_name));
+    zx_status_t status = zx_object_get_property(
+        proc, ZX_PROP_NAME, &last_process_name, sizeof(last_process_name));
     return status;
 }
 
 // Adds a thread's information to the thread_list
-static mx_status_t thread_callback(void* unused_ctx, int depth,
-                                   mx_handle_t thread,
-                                   mx_koid_t koid, mx_koid_t parent_koid) {
+static zx_status_t thread_callback(void* unused_ctx, int depth,
+                                   zx_handle_t thread,
+                                   zx_koid_t koid, zx_koid_t parent_koid) {
     thread_info_t e = {};
 
     e.koid = koid;
@@ -98,19 +98,19 @@
     e.proc_koid = last_process_scanned;
     strlcpy(e.proc_name, last_process_name, sizeof(e.proc_name));
 
-    mx_status_t status =
-        mx_object_get_property(thread, MX_PROP_NAME, e.name, sizeof(e.name));
-    if (status != MX_OK) {
+    zx_status_t status =
+        zx_object_get_property(thread, ZX_PROP_NAME, e.name, sizeof(e.name));
+    if (status != ZX_OK) {
         return status;
     }
-    status = mx_object_get_info(
-        thread, MX_INFO_THREAD, &e.info, sizeof(e.info), NULL, NULL);
-    if (status != MX_OK) {
+    status = zx_object_get_info(
+        thread, ZX_INFO_THREAD, &e.info, sizeof(e.info), NULL, NULL);
+    if (status != ZX_OK) {
         return status;
     }
-    status = mx_object_get_info(
-        thread, MX_INFO_THREAD_STATS, &e.stats, sizeof(e.stats), NULL, NULL);
-    if (status != MX_OK) {
+    status = zx_object_get_info(
+        thread, ZX_INFO_THREAD_STATS, &e.stats, sizeof(e.stats), NULL, NULL);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -125,7 +125,7 @@
                 e.stats.total_runtime - temp->stats.total_runtime;
             temp->info = e.info;
             temp->stats = e.stats;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
@@ -135,7 +135,7 @@
 
     list_add_tail(&thread_list, &new_entry->node);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void sort_threads(enum sort_order order) {
@@ -226,7 +226,7 @@
         } else if (!strcmp(arg, "-d")) {
             delay = 0;
             if (i + 1 < argc) {
-                delay = MX_SEC(atoi(argv[i + 1]));
+                delay = ZX_SEC(atoi(argv[i + 1]));
             }
             if (delay == 0) {
                 fprintf(stderr, "Bad -d value '%s'\n", argv[i + 1]);
@@ -285,7 +285,7 @@
 
     int ret = 0;
     for (;;) {
-        mx_time_t next_deadline = mx_deadline_after(delay);
+        zx_time_t next_deadline = zx_deadline_after(delay);
 
         // mark all active threads as not scanned
         thread_info_t* e;
@@ -294,11 +294,11 @@
         }
 
         // iterate the entire job tree
-        mx_status_t status =
+        zx_status_t status =
             walk_root_job_tree(NULL, process_callback, thread_callback, NULL);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             fprintf(stderr, "WARNING: walk_root_job_tree failed: %s (%d)\n",
-                    mx_status_get_string(status), status);
+                    zx_status_get_string(status), status);
             ret = 1;
         }
 
@@ -331,7 +331,7 @@
             }
         }
 
-        mx_nanosleep(next_deadline);
+        zx_nanosleep(next_deadline);
     }
 
     return ret;
diff --git a/system/uapp/psutils/vmaps.c b/system/uapp/psutils/vmaps.c
index 6cbc1c5..9739556 100644
--- a/system/uapp/psutils/vmaps.c
+++ b/system/uapp/psutils/vmaps.c
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/compiler.h>
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 #include <pretty/sizes.h>
 #include <task-utils/get.h>
 #include <task-utils/walker.h>
@@ -17,27 +17,27 @@
 #include <stdlib.h>
 #include <string.h>
 
-// Reads the mx_info_maps_t entries for the process.
+// Reads the zx_info_maps_t entries for the process.
 // Caller is responsible for the |out_maps| pointer.
-mx_status_t get_maps(mx_koid_t koid, mx_handle_t process,
-                     mx_info_maps_t** out_maps, size_t* out_count,
+zx_status_t get_maps(zx_koid_t koid, zx_handle_t process,
+                     zx_info_maps_t** out_maps, size_t* out_count,
                      size_t* out_avail) {
     size_t count = 4096; // Should be more than enough.
-    mx_info_maps_t* maps = NULL;
+    zx_info_maps_t* maps = NULL;
     int pass = 3;
     while (true) {
-        maps = (mx_info_maps_t*)realloc(maps, count * sizeof(mx_info_maps_t));
+        maps = (zx_info_maps_t*)realloc(maps, count * sizeof(zx_info_maps_t));
 
         size_t actual;
         size_t avail;
-        mx_status_t s = mx_object_get_info(process, MX_INFO_PROCESS_MAPS,
-                                           maps, count * sizeof(mx_info_maps_t),
+        zx_status_t s = zx_object_get_info(process, ZX_INFO_PROCESS_MAPS,
+                                           maps, count * sizeof(zx_info_maps_t),
                                            &actual, &avail);
-        if (s != MX_OK) {
+        if (s != ZX_OK) {
             fprintf(stderr,
                     "ERROR: couldn't get maps for process with koid %" PRIu64
                     ": %s (%d)\n",
-                    koid, mx_status_get_string(s), s);
+                    koid, zx_status_get_string(s), s);
             free(maps);
             return s;
         }
@@ -48,11 +48,11 @@
         *out_maps = maps;
         *out_count = actual;
         *out_avail = avail;
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
-void print_ptr(mx_vaddr_t addr) {
+void print_ptr(zx_vaddr_t addr) {
     if (addr <= UINT32_MAX) {
         printf("________%08" PRIx32, (uint32_t)addr);
     } else {
@@ -60,24 +60,24 @@
     }
 }
 
-void print_range(mx_vaddr_t addr, size_t size) {
+void print_range(zx_vaddr_t addr, size_t size) {
     print_ptr(addr);
     printf("-");
     print_ptr(addr + size);
 }
 
 void print_mmu_flags(unsigned int mmu_flags) {
-    if (mmu_flags & MX_VM_FLAG_PERM_READ) {
+    if (mmu_flags & ZX_VM_FLAG_PERM_READ) {
         printf("r");
     } else {
         printf("-");
     }
-    if (mmu_flags & MX_VM_FLAG_PERM_WRITE) {
+    if (mmu_flags & ZX_VM_FLAG_PERM_WRITE) {
         printf("w");
     } else {
         printf("-");
     }
-    if (mmu_flags & MX_VM_FLAG_PERM_EXECUTE) {
+    if (mmu_flags & ZX_VM_FLAG_PERM_EXECUTE) {
         printf("x");
     } else {
         printf("-");
@@ -85,10 +85,10 @@
 }
 
 // Pretty-prints the contents of |maps| to stdout.
-mx_status_t print_maps(mx_info_maps_t* maps, size_t count, size_t avail) {
+zx_status_t print_maps(zx_info_maps_t* maps, size_t count, size_t avail) {
     size_t max_depth = 2;
     for (size_t i = 0; i < count; i++) {
-        mx_info_maps_t* e = maps + i;
+        zx_info_maps_t* e = maps + i;
         if (e->depth > max_depth) {
             max_depth = e->depth;
         }
@@ -96,16 +96,16 @@
 
     char size_str[MAX_FORMAT_SIZE_LEN];
     for (size_t i = 0; i < count; i++) {
-        mx_info_maps_t* e = maps + i;
+        zx_info_maps_t* e = maps + i;
         char tc = 0;
         switch (e->type) {
-        case MX_INFO_MAPS_TYPE_ASPACE:
+        case ZX_INFO_MAPS_TYPE_ASPACE:
             tc = 'A';
             break;
-        case MX_INFO_MAPS_TYPE_VMAR:
+        case ZX_INFO_MAPS_TYPE_VMAR:
             tc = 'R';
             break;
-        case MX_INFO_MAPS_TYPE_MAPPING:
+        case ZX_INFO_MAPS_TYPE_MAPPING:
             tc = 'M';
             break;
         default:
@@ -129,7 +129,7 @@
         print_range(e->base, e->size);
 
         int size_width;
-        if (e->type == MX_INFO_MAPS_TYPE_MAPPING) {
+        if (e->type == ZX_INFO_MAPS_TYPE_MAPPING) {
             printf(" ");
             print_mmu_flags(e->u.mapping.mmu_flags);
             size_width = 5;
@@ -139,8 +139,8 @@
 
         format_size(size_str, sizeof(size_str), e->size);
         printf(" %*s:sz", size_width, size_str);
-        if (e->type == MX_INFO_MAPS_TYPE_MAPPING) {
-            const mx_info_maps_mapping_t* u = &e->u.mapping;
+        if (e->type == ZX_INFO_MAPS_TYPE_MAPPING) {
+            const zx_info_maps_mapping_t* u = &e->u.mapping;
             format_size(size_str, sizeof(size_str),
                         u->committed_pages * PAGE_SIZE);
             printf(" %4s:res", size_str);
@@ -154,7 +154,7 @@
     if (avail > count) {
         printf("[%zd entries truncated]\n", avail - count);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 void try_help(char** argv) {
@@ -191,35 +191,35 @@
     }
     try_help(argv);
     char* end;
-    mx_koid_t koid = strtoull(argv[1], &end, 0);
+    zx_koid_t koid = strtoull(argv[1], &end, 0);
     if (argv[1][0] == '\0' || *end != '\0') {
         fprintf(stderr, "ERROR: \"%s\" is not a number\n", argv[1]);
         usage(argv[0]);
     }
 
-    mx_handle_t process;
-    mx_obj_type_t type;
-    mx_status_t s = get_task_by_koid(koid, &type, &process);
-    if (s == MX_OK && type != MX_OBJ_TYPE_PROCESS) {
-        mx_handle_close(process);
-        s = MX_ERR_WRONG_TYPE;
+    zx_handle_t process;
+    zx_obj_type_t type;
+    zx_status_t s = get_task_by_koid(koid, &type, &process);
+    if (s == ZX_OK && type != ZX_OBJ_TYPE_PROCESS) {
+        zx_handle_close(process);
+        s = ZX_ERR_WRONG_TYPE;
     }
-    if (s != MX_OK) {
+    if (s != ZX_OK) {
         fprintf(stderr,
                 "ERROR: couldn't find process with koid %" PRIu64 ": %s (%d)\n",
-                koid, mx_status_get_string(s), s);
+                koid, zx_status_get_string(s), s);
         usage(argv[0]);
     }
 
-    mx_info_maps_t* maps;
+    zx_info_maps_t* maps;
     size_t count;
     size_t avail;
     s = get_maps(koid, process, &maps, &count, &avail);
-    mx_handle_close(process);
-    if (s != MX_OK) {
+    zx_handle_close(process);
+    if (s != ZX_OK) {
         return 1;
     }
     s = print_maps(maps, count, avail);
     free(maps);
-    return s == MX_OK ? 0 : 1;
+    return s == ZX_OK ? 0 : 1;
 }
diff --git a/system/uapp/psutils/vmo-utils.c b/system/uapp/psutils/vmo-utils.c
index 672a151..4ec020b 100644
--- a/system/uapp/psutils/vmo-utils.c
+++ b/system/uapp/psutils/vmo-utils.c
@@ -10,27 +10,27 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 
-// Reads the mx_info_vmo_t entries for the process.
+// Reads the zx_info_vmo_t entries for the process.
 // Caller is responsible for the |out_vmos| pointer.
-mx_status_t get_vmos(mx_handle_t process,
-                     mx_info_vmo_t** out_vmos, size_t* out_count,
+zx_status_t get_vmos(zx_handle_t process,
+                     zx_info_vmo_t** out_vmos, size_t* out_count,
                      size_t* out_avail) {
     size_t count = 4096; // Should be more than enough.
-    mx_info_vmo_t* vmos = NULL;
+    zx_info_vmo_t* vmos = NULL;
     int pass = 3;
     while (true) {
-        vmos = (mx_info_vmo_t*)realloc(vmos, count * sizeof(mx_info_vmo_t));
+        vmos = (zx_info_vmo_t*)realloc(vmos, count * sizeof(zx_info_vmo_t));
 
         size_t actual;
         size_t avail;
-        mx_status_t s = mx_object_get_info(process, MX_INFO_PROCESS_VMOS,
-                                           vmos, count * sizeof(mx_info_vmo_t),
+        zx_status_t s = zx_object_get_info(process, ZX_INFO_PROCESS_VMOS,
+                                           vmos, count * sizeof(zx_info_vmo_t),
                                            &actual, &avail);
-        if (s != MX_OK) {
+        if (s != ZX_OK) {
             free(vmos);
             return s;
         }
@@ -41,6 +41,6 @@
         *out_vmos = vmos;
         *out_count = actual;
         *out_avail = avail;
-        return MX_OK;
+        return ZX_OK;
     }
 }
diff --git a/system/uapp/psutils/vmo-utils.h b/system/uapp/psutils/vmo-utils.h
index 163d43c..065d279 100644
--- a/system/uapp/psutils/vmo-utils.h
+++ b/system/uapp/psutils/vmo-utils.h
@@ -6,16 +6,16 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
-// Reads the mx_info_vmo_t entries for the process.
+// Reads the zx_info_vmo_t entries for the process.
 // Caller is responsible for the |out_vmos| pointer.
-mx_status_t get_vmos(mx_handle_t process,
-                     mx_info_vmo_t** out_vmos, size_t* out_count,
+zx_status_t get_vmos(zx_handle_t process,
+                     zx_info_vmo_t** out_vmos, size_t* out_count,
                      size_t* out_avail);
 
 __END_CDECLS
diff --git a/system/uapp/psutils/vmos.cpp b/system/uapp/psutils/vmos.cpp
index 121a2e9..799c1f3 100644
--- a/system/uapp/psutils/vmos.cpp
+++ b/system/uapp/psutils/vmos.cpp
@@ -9,9 +9,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <pretty/sizes.h>
 #include <task-utils/get.h>
 
@@ -22,20 +22,20 @@
 static const char* handle_rights_to_string(uint32_t rights,
                                            char str[kRightsStrLen]) {
     char* c = str;
-    *c++ = (rights & MX_RIGHT_READ) ? 'r' : '-';
-    *c++ = (rights & MX_RIGHT_WRITE) ? 'w' : '-';
-    *c++ = (rights & MX_RIGHT_EXECUTE) ? 'x' : '-';
-    *c++ = (rights & MX_RIGHT_MAP) ? 'm' : '-';
-    *c++ = (rights & MX_RIGHT_DUPLICATE) ? 'd' : '-';
-    *c++ = (rights & MX_RIGHT_TRANSFER) ? 't' : '-';
+    *c++ = (rights & ZX_RIGHT_READ) ? 'r' : '-';
+    *c++ = (rights & ZX_RIGHT_WRITE) ? 'w' : '-';
+    *c++ = (rights & ZX_RIGHT_EXECUTE) ? 'x' : '-';
+    *c++ = (rights & ZX_RIGHT_MAP) ? 'm' : '-';
+    *c++ = (rights & ZX_RIGHT_DUPLICATE) ? 'd' : '-';
+    *c++ = (rights & ZX_RIGHT_TRANSFER) ? 't' : '-';
     *c = '\0';
     return str;
 }
 
-static void print_vmo(const mx_info_vmo_t* vmo) {
+static void print_vmo(const zx_info_vmo_t* vmo) {
 
     char rights_str[kRightsStrLen];
-    if (vmo->flags & MX_INFO_VMO_VIA_HANDLE) {
+    if (vmo->flags & ZX_INFO_VMO_VIA_HANDLE) {
         handle_rights_to_string(vmo->handle_rights, rights_str);
     } else {
         rights_str[0] = '-';
@@ -46,11 +46,11 @@
     format_size(size_str, sizeof(size_str), vmo->size_bytes);
 
     char alloc_str[MAX_FORMAT_SIZE_LEN];
-    switch (MX_INFO_VMO_TYPE(vmo->flags)) {
-    case MX_INFO_VMO_TYPE_PAGED:
+    switch (ZX_INFO_VMO_TYPE(vmo->flags)) {
+    case ZX_INFO_VMO_TYPE_PAGED:
         format_size(alloc_str, sizeof(alloc_str), vmo->committed_bytes);
         break;
-    case MX_INFO_VMO_TYPE_PHYSICAL:
+    case ZX_INFO_VMO_TYPE_PHYSICAL:
         strlcpy(alloc_str, "phys", sizeof(alloc_str));
         break;
     default:
@@ -60,14 +60,14 @@
     }
 
     char clone_str[21];
-    if (vmo->flags & MX_INFO_VMO_IS_COW_CLONE) {
+    if (vmo->flags & ZX_INFO_VMO_IS_COW_CLONE) {
         snprintf(clone_str, sizeof(clone_str), "%" PRIu64, vmo->parent_koid);
     } else {
         clone_str[0] = '-';
         clone_str[1] = '\0';
     }
 
-    char name[MX_MAX_NAME_LEN];
+    char name[ZX_MAX_NAME_LEN];
     strlcpy(name, vmo->name, sizeof(name));
     if (name[0] == '\0') {
         name[0] = '-';
@@ -99,7 +99,7 @@
 }
 
 // Pretty-prints the contents of |vmos| to stdout.
-void print_vmos(const mx_info_vmo_t* vmos, size_t count, size_t avail) {
+void print_vmos(const zx_info_vmo_t* vmos, size_t count, size_t avail) {
     print_header();
     for (size_t i = 0; i < count; i++) {
         print_vmo(vmos + i);
@@ -131,12 +131,12 @@
     printf("Columns:\n");
     printf("  rights: If the process points to the VMO via a handle, this column\n");
     printf("      shows the rights that the handle has, zero or more of:\n");
-    printf("          r: MX_RIGHT_READ\n");
-    printf("          w: MX_RIGHT_WRITE\n");
-    printf("          x: MX_RIGHT_EXECUTE\n");
-    printf("          m: MX_RIGHT_MAP\n");
-    printf("          d: MX_RIGHT_DUPLICATE\n");
-    printf("          t: MX_RIGHT_TRANSFER\n");
+    printf("          r: ZX_RIGHT_READ\n");
+    printf("          w: ZX_RIGHT_WRITE\n");
+    printf("          x: ZX_RIGHT_EXECUTE\n");
+    printf("          m: ZX_RIGHT_MAP\n");
+    printf("          d: ZX_RIGHT_DUPLICATE\n");
+    printf("          t: ZX_RIGHT_TRANSFER\n");
     printf("      NOTE: Non-handle entries will have a single '-' in this column.\n");
     printf("  koid: The koid of the VMO, if it has one. Zero otherwise. A VMO without a\n");
     printf("      koid was created by the kernel, and has never had a userspace handle.\n");
@@ -164,36 +164,36 @@
     }
     try_help(argv);
     char* end;
-    mx_koid_t koid = strtoull(argv[1], &end, 0);
+    zx_koid_t koid = strtoull(argv[1], &end, 0);
     if (argv[1][0] == '\0' || *end != '\0') {
         fprintf(stderr, "ERROR: \"%s\" is not a number\n", argv[1]);
         usage(argv[0]);
     }
 
-    mx_handle_t process;
-    mx_obj_type_t type;
-    mx_status_t s = get_task_by_koid(koid, &type, &process);
-    if (s == MX_OK && type != MX_OBJ_TYPE_PROCESS) {
-        mx_handle_close(process);
-        s = MX_ERR_WRONG_TYPE;
+    zx_handle_t process;
+    zx_obj_type_t type;
+    zx_status_t s = get_task_by_koid(koid, &type, &process);
+    if (s == ZX_OK && type != ZX_OBJ_TYPE_PROCESS) {
+        zx_handle_close(process);
+        s = ZX_ERR_WRONG_TYPE;
     }
-    if (s != MX_OK) {
+    if (s != ZX_OK) {
         fprintf(stderr,
                 "ERROR: couldn't find process with koid %" PRIu64 ": %s (%d)\n",
-                koid, mx_status_get_string(s), s);
+                koid, zx_status_get_string(s), s);
         usage(argv[0]);
     }
 
-    mx_info_vmo_t* vmos;
+    zx_info_vmo_t* vmos;
     size_t count;
     size_t avail;
     s = get_vmos(process, &vmos, &count, &avail);
-    mx_handle_close(process);
-    if (s != MX_OK) {
+    zx_handle_close(process);
+    if (s != ZX_OK) {
         fprintf(stderr,
                 "ERROR: couldn't get vmos for process with koid %" PRIu64
                 ": %s (%d)\n",
-                koid, mx_status_get_string(s), s);
+                koid, zx_status_get_string(s), s);
         return 1;
     }
     print_vmos(vmos, count, avail);
diff --git a/system/uapp/rng-trials/rng-trials.c b/system/uapp/rng-trials/rng-trials.c
index d9d78cb..aded2e0 100644
--- a/system/uapp/rng-trials/rng-trials.c
+++ b/system/uapp/rng-trials/rng-trials.c
@@ -5,7 +5,7 @@
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #define TRIALS 10000
 #define BINS 32
@@ -15,9 +15,9 @@
     uint64_t values[BINS] = { 0 };
 
     size_t sz = 0;
-    mx_cprng_draw(&buf, sizeof(buf), &sz);
+    zx_cprng_draw(&buf, sizeof(buf), &sz);
     if (sz != sizeof(buf)) {
-        printf("mx_cprng_draw had unexpected return: %zu\n", sz);
+        printf("zx_cprng_draw had unexpected return: %zu\n", sz);
         return 1;
     }
     printf("Drew %zd bytes: ", sizeof(buf));
@@ -29,9 +29,9 @@
     for (unsigned int i = 0; i < TRIALS; ++i) {
         uint8_t byte;
         size_t sz = 0;
-        mx_cprng_draw(&byte, 1, &sz);
+        zx_cprng_draw(&byte, 1, &sz);
         if (sz != 1) {
-            printf("mx_cprng_draw returned an error: %zu\n", sz);
+            printf("zx_cprng_draw returned an error: %zu\n", sz);
             return 1;
         }
         values[byte % BINS]++;
diff --git a/system/uapp/rng-trials/rules.mk b/system/uapp/rng-trials/rules.mk
index 962aa07..22b0660 100644
--- a/system/uapp/rng-trials/rules.mk
+++ b/system/uapp/rng-trials/rules.mk
@@ -15,6 +15,6 @@
 MODULE_NAME := rng-trials
 
 MODULE_LIBS := \
-    system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/run-vc/main.c b/system/uapp/run-vc/main.c
index 03329f6..bea8f65 100644
--- a/system/uapp/run-vc/main.c
+++ b/system/uapp/run-vc/main.c
@@ -6,14 +6,14 @@
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
 #include <limits.h>
-#include <magenta/device/dmctl.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <mxio/io.h>
-#include <mxio/util.h>
-#include <mxio/watcher.h>
+#include <zircon/device/dmctl.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <fdio/io.h>
+#include <fdio/util.h>
+#include <fdio/watcher.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -31,8 +31,8 @@
         }
     }
 
-    mx_handle_t h0, h1;
-    if (mx_channel_create(0, &h0, &h1) < 0) {
+    zx_handle_t h0, h1;
+    if (zx_channel_create(0, &h0, &h1) < 0) {
         return -1;
     }
     if (ioctl_dmctl_open_virtcon(fd, &h1) < 0) {
@@ -40,19 +40,19 @@
     }
     close(fd);
 
-    mx_object_wait_one(h0, MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                       MX_TIME_INFINITE, NULL);
+    zx_object_wait_one(h0, ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                       ZX_TIME_INFINITE, NULL);
 
     uint32_t types[2];
-    mx_handle_t handles[2];
+    zx_handle_t handles[2];
     uint32_t dcount, hcount;
-    if (mx_channel_read(h0, 0, types, handles, sizeof(types), 2, &dcount, &hcount) < 0) {
+    if (zx_channel_read(h0, 0, types, handles, sizeof(types), 2, &dcount, &hcount) < 0) {
         return -1;
     }
     if ((dcount != sizeof(types)) || (hcount != 2)) {
         return -1;
     }
-    mx_handle_close(h0);
+    zx_handle_close(h0);
 
     // start shell if no arguments
     if (argc == 1) {
@@ -71,12 +71,12 @@
 
     launchpad_t* lp;
     launchpad_create(0, pname, &lp);
-    launchpad_clone(lp, LP_CLONE_MXIO_NAMESPACE | LP_CLONE_ENVIRON);
+    launchpad_clone(lp, LP_CLONE_FDIO_NAMESPACE | LP_CLONE_ENVIRON);
     launchpad_add_handles(lp, 2, handles, types);
     launchpad_set_args(lp, argc, (const char* const*) argv);
     launchpad_load_from_file(lp, argv[0]);
 
-    mx_status_t status;
+    zx_status_t status;
     const char* errmsg;
     if ((status = launchpad_go(lp, NULL, &errmsg)) < 0) {
         fprintf(stderr, "error %d launching: %s\n", status, errmsg);
diff --git a/system/uapp/run-vc/rules.mk b/system/uapp/run-vc/rules.mk
index 77618fa..4295057 100644
--- a/system/uapp/run-vc/rules.mk
+++ b/system/uapp/run-vc/rules.mk
@@ -14,8 +14,8 @@
 
 MODULE_LIBS := \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/runtests/rules.mk b/system/uapp/runtests/rules.mk
index 7b50626..0a609ff 100644
--- a/system/uapp/runtests/rules.mk
+++ b/system/uapp/runtests/rules.mk
@@ -15,6 +15,6 @@
 MODULE_NAME := runtests
 
 MODULE_LIBS := \
-    system/ulib/mxio system/ulib/launchpad system/ulib/magenta system/ulib/c system/ulib/unittest
+    system/ulib/fdio system/ulib/launchpad system/ulib/zircon system/ulib/c system/ulib/unittest
 
 include make/module.mk
diff --git a/system/uapp/runtests/runtests.c b/system/uapp/runtests/runtests.c
index 8f66a12..02db900 100644
--- a/system/uapp/runtests/runtests.c
+++ b/system/uapp/runtests/runtests.c
@@ -6,9 +6,9 @@
 #include <inttypes.h>
 #include <launchpad/launchpad.h>
 #include <limits.h>
-#include <magenta/listnode.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/listnode.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -93,8 +93,8 @@
         launchpad_clone(lp, LP_CLONE_ALL);
         launchpad_set_args(lp, argc, argv);
         const char* errmsg;
-        mx_handle_t handle;
-        mx_status_t status = launchpad_go(lp, &handle, &errmsg);
+        zx_handle_t handle;
+        zx_status_t status = launchpad_go(lp, &handle, &errmsg);
         if (status < 0) {
             printf("FAILURE: Failed to launch %s: %d: %s\n", de->d_name, status, errmsg);
             fail_test(&failures, de->d_name, FAILED_TO_LAUNCH, 0);
@@ -102,9 +102,9 @@
             continue;
         }
 
-        status = mx_object_wait_one(handle, MX_PROCESS_TERMINATED,
-                                    MX_TIME_INFINITE, NULL);
-        if (status != MX_OK) {
+        status = zx_object_wait_one(handle, ZX_PROCESS_TERMINATED,
+                                    ZX_TIME_INFINITE, NULL);
+        if (status != ZX_OK) {
             printf("FAILURE: Failed to wait for process exiting %s: %d\n", de->d_name, status);
             fail_test(&failures, de->d_name, FAILED_TO_WAIT, 0);
             failed_count++;
@@ -112,9 +112,9 @@
         }
 
         // read the return code
-        mx_info_process_t proc_info;
-        status = mx_object_get_info(handle, MX_INFO_PROCESS, &proc_info, sizeof(proc_info), NULL, NULL);
-        mx_handle_close(handle);
+        zx_info_process_t proc_info;
+        status = zx_object_get_info(handle, ZX_INFO_PROCESS, &proc_info, sizeof(proc_info), NULL, NULL);
+        zx_handle_close(handle);
 
         if (status < 0) {
             printf("FAILURE: Failed to get process return code %s: %d\n", de->d_name, status);
diff --git a/system/uapp/strerror/rules.mk b/system/uapp/strerror/rules.mk
index 7c5bb18..b3bdb96 100644
--- a/system/uapp/strerror/rules.mk
+++ b/system/uapp/strerror/rules.mk
@@ -13,6 +13,6 @@
     $(LOCAL_DIR)/strerror.c
 
 MODULE_STATIC_LIBS := system/ulib/runtime
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/strerror/strerror.c b/system/uapp/strerror/strerror.c
index e1cc746..60fcb9b 100644
--- a/system/uapp/strerror/strerror.c
+++ b/system/uapp/strerror/strerror.c
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include <errno.h>
-#include <magenta/status.h>
+#include <zircon/status.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -25,13 +25,13 @@
         errno = 0;
         long error_long = strtol(argv[idx], NULL, 10);
         if (errno)
-            exit(MX_ERR_INVALID_ARGS);
+            exit(ZX_ERR_INVALID_ARGS);
         int error = (int)error_long;
-        const char* mx_error = mx_status_get_string((mx_status_t)error);
+        const char* zx_error = zx_status_get_string((zx_status_t)error);
         char* posix_error = strerror(error);
         const char* thrd_error = thrd_error_string(error);
         printf("Int value: %d\n", error);
-        printf("\tMagenta error: %s\n", mx_error);
+        printf("\tZircon error: %s\n", zx_error);
         printf("\tPosix error: %s\n", posix_error);
         printf("\tC11 thread error: %s\n", thrd_error);
     }
diff --git a/system/uapp/suspendtest/rules.mk b/system/uapp/suspendtest/rules.mk
index 679088c..66ed44b 100644
--- a/system/uapp/suspendtest/rules.mk
+++ b/system/uapp/suspendtest/rules.mk
@@ -12,6 +12,6 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/suspendtest.c
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/suspendtest/suspendtest.c b/system/uapp/suspendtest/suspendtest.c
index eadabcf..5ba4d6c 100644
--- a/system/uapp/suspendtest/suspendtest.c
+++ b/system/uapp/suspendtest/suspendtest.c
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/device/device.h>
+#include <zircon/device/device.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -24,7 +24,7 @@
 
     printf("suspending %s\n", path);
     int ret = ioctl_device_debug_suspend(fd);
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         fprintf(stderr, "suspend failed: %d\n", ret);
         goto out;
     }
@@ -33,7 +33,7 @@
 
     printf("resuming %s\n", path);
     ret = ioctl_device_debug_resume(fd);
-    if (ret != MX_OK) {
+    if (ret != ZX_OK) {
         fprintf(stderr, "resume failed: %d\n", ret);
     }
 
diff --git a/system/uapp/synthtest/rules.mk b/system/uapp/synthtest/rules.mk
index 86bca25b..f5c2ffe 100644
--- a/system/uapp/synthtest/rules.mk
+++ b/system/uapp/synthtest/rules.mk
@@ -12,6 +12,6 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/synthtest.c
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/synthtest/synthtest.c b/system/uapp/synthtest/synthtest.c
index 3357587..3e02023 100644
--- a/system/uapp/synthtest/synthtest.c
+++ b/system/uapp/synthtest/synthtest.c
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/device/midi.h>
+#include <zircon/device/midi.h>
 #include <dirent.h>
 #include <fcntl.h>
 #include <math.h>
@@ -13,7 +13,7 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include "midi.h"
 
@@ -255,7 +255,7 @@
             }
         }
         ret = ioctl_audio_set_sample_rate(fd, &sample_rate);
-        if (ret != MX_OK) {
+        if (ret != ZX_OK) {
             printf("%s ioctl_audio_set_sample_rate failed for %d\n", devname, sample_rate);
             goto next;
         }
diff --git a/system/uapp/thread-depth/rules.mk b/system/uapp/thread-depth/rules.mk
index b8fe8ff..e8a017f 100644
--- a/system/uapp/thread-depth/rules.mk
+++ b/system/uapp/thread-depth/rules.mk
@@ -15,8 +15,8 @@
 MODULE_NAME := thread-depth-test
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/thread-depth/thread-depth.c b/system/uapp/thread-depth/thread-depth.c
index 77f8933..339601c 100644
--- a/system/uapp/thread-depth/thread-depth.c
+++ b/system/uapp/thread-depth/thread-depth.c
@@ -8,7 +8,7 @@
 #include <threads.h>
 #include <time.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <stdatomic.h>
 
 static atomic_uint_fast64_t count = ATOMIC_VAR_INIT(0);
@@ -18,7 +18,7 @@
     val++;
     if (val % 1000 == 0) {
         printf("Created %" PRId64 " threads, time %" PRId64 " us\n", val,
-               mx_time_get(MX_CLOCK_MONOTONIC) / 1000000);
+               zx_time_get(ZX_CLOCK_MONOTONIC) / 1000000);
     }
 
     thrd_t thread;
@@ -33,7 +33,7 @@
         val--;
         if (val % 1000 == 0)
             printf("Joined %" PRId64 " threads, time %" PRId64 " us\n", val,
-                   mx_time_get(MX_CLOCK_MONOTONIC) / 1000000);
+                   zx_time_get(ZX_CLOCK_MONOTONIC) / 1000000);
     }
 
     return 0;
diff --git a/system/uapp/thread-stress/rules.mk b/system/uapp/thread-stress/rules.mk
index 9abab92..3402264 100644
--- a/system/uapp/thread-stress/rules.mk
+++ b/system/uapp/thread-stress/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := thread-stress-test
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/thread-stress/thread-stress.c b/system/uapp/thread-stress/thread-stress.c
index 1cd0152..3456502 100644
--- a/system/uapp/thread-stress/thread-stress.c
+++ b/system/uapp/thread-stress/thread-stress.c
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <threads.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #define NUM_THREADS 1000
 
@@ -31,15 +31,15 @@
     printf("Running thread stress test...\n");
     thrd_t thread[NUM_THREADS];
     while (true) {
-        mx_time_t start = mx_time_get(MX_CLOCK_MONOTONIC);
+        zx_time_t start = zx_time_get(ZX_CLOCK_MONOTONIC);
         for (int i = 0; i != NUM_THREADS; ++i) {
             thread_create(&thread[i]);
         }
-        mx_time_t create = mx_time_get(MX_CLOCK_MONOTONIC);
+        zx_time_t create = zx_time_get(ZX_CLOCK_MONOTONIC);
         for (int i = 0; i != NUM_THREADS; ++i) {
             thread_join(thread[i]);
         }
-        mx_time_t join = mx_time_get(MX_CLOCK_MONOTONIC);
+        zx_time_t join = zx_time_get(ZX_CLOCK_MONOTONIC);
         printf(
             "%d threads in %.2fs (create %.2fs, join %.2fs)\n",
             NUM_THREADS,
diff --git a/system/uapp/touch/rules.mk b/system/uapp/touch/rules.mk
index f5531d8..ac02e50 100644
--- a/system/uapp/touch/rules.mk
+++ b/system/uapp/touch/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_NAME := touch
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/tpmctl/rules.mk b/system/uapp/tpmctl/rules.mk
index a86aeb8..62eb805 100644
--- a/system/uapp/tpmctl/rules.mk
+++ b/system/uapp/tpmctl/rules.mk
@@ -12,6 +12,6 @@
 MODULE_SRCS += \
 	$(LOCAL_DIR)/tpmctl.c
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/tpmctl/tpmctl.c b/system/uapp/tpmctl/tpmctl.c
index 3fda5b3..aba7a96 100644
--- a/system/uapp/tpmctl/tpmctl.c
+++ b/system/uapp/tpmctl/tpmctl.c
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/device/tpm.h>
+#include <zircon/device/tpm.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <mxio/util.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <fdio/util.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/system/uapp/trace-example/main.cpp b/system/uapp/trace-example/main.cpp
index ce20e46..d00751f 100644
--- a/system/uapp/trace-example/main.cpp
+++ b/system/uapp/trace-example/main.cpp
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include <stdio.h>
 
@@ -13,8 +13,8 @@
 
 namespace {
 
-mx_time_t now() {
-    return mx_time_get(MX_CLOCK_MONOTONIC);
+zx_time_t now() {
+    return zx_time_get(ZX_CLOCK_MONOTONIC);
 }
 
 } // namespace
@@ -25,15 +25,15 @@
 
     puts("Doing work for 30 seconds...");
 
-    mx_time_t start_time = now();
-    mx_time_t quit_time = start_time + MX_SEC(30);
+    zx_time_t start_time = now();
+    zx_time_t quit_time = start_time + ZX_SEC(30);
     async::Task task(start_time);
-    task.set_handler([&task, &loop, quit_time](async_t* async, mx_status_t status) {
+    task.set_handler([&task, &loop, quit_time](async_t* async, zx_status_t status) {
         TRACE_DURATION("example", "Doing Work!", "async", async, "status", status);
 
         // Simulate some kind of workload.
         puts("Doing work!");
-        mx_nanosleep(now() + MX_MSEC(500));
+        zx_nanosleep(now() + ZX_MSEC(500));
 
         // Stop if quitting.
         if (task.deadline() > quit_time) {
@@ -42,7 +42,7 @@
         }
 
         // Schedule more work in a little bit.
-        task.set_deadline(now() + MX_MSEC(200));
+        task.set_deadline(now() + ZX_MSEC(200));
         return ASYNC_TASK_REPEAT;
     });
 
diff --git a/system/uapp/trace-example/rules.mk b/system/uapp/trace-example/rules.mk
index 09840d3..f623916 100644
--- a/system/uapp/trace-example/rules.mk
+++ b/system/uapp/trace-example/rules.mk
@@ -19,15 +19,15 @@
     system/ulib/trace \
     system/ulib/async \
     system/ulib/async.loop \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
-    system/ulib/mx
+    system/ulib/zx
 
 MODULE_LIBS := \
     system/ulib/async.default \
     system/ulib/c \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/trace-engine
 
 include make/module.mk
diff --git a/system/uapp/traceme/rules.mk b/system/uapp/traceme/rules.mk
index 5fd2d0a..b0983b0 100644
--- a/system/uapp/traceme/rules.mk
+++ b/system/uapp/traceme/rules.mk
@@ -11,6 +11,6 @@
 
 MODULE_SRCS += $(LOCAL_DIR)/traceme.c
 
-MODULE_LIBS := system/ulib/magenta system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/traceme/traceme.c b/system/uapp/traceme/traceme.c
index 94b7307..d465ca2 100644
--- a/system/uapp/traceme/traceme.c
+++ b/system/uapp/traceme/traceme.c
@@ -6,10 +6,10 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#include <magenta/device/ktrace.h>
+#include <zircon/device/ktrace.h>
 
-// 1. Run:            magenta> traceme
-// 2. Stop tracing:   magenta> dm ktraceoff
+// 1. Run:            zircon> traceme
+// 2. Stop tracing:   zircon> dm ktraceoff
 // 3. Grab trace:     host> netcp :/dev/misc/ktrace test.trace
 // 4. Examine trace:  host> tracevic test.trace
 
@@ -21,7 +21,7 @@
     }
 
     // obtain the handle needed to emit probes
-    mx_handle_t kth;
+    zx_handle_t kth;
     if (ioctl_ktrace_get_handle(fd, &kth) < 0) {
         fprintf(stderr, "cannot get ktrace handle\n");
         return -1;
@@ -38,9 +38,9 @@
     close(fd);
 
     // use the ktrace handle to emit probes into the trace stream
-    mx_ktrace_write(kth, id, 1, 0);
+    zx_ktrace_write(kth, id, 1, 0);
     printf("hello, ktrace! id = %u\n", id);
-    mx_ktrace_write(kth, id, 2, 0);
+    zx_ktrace_write(kth, id, 2, 0);
 
     return 0;
 }
diff --git a/system/uapp/usbctl/rules.mk b/system/uapp/usbctl/rules.mk
index 4e37164..e457d0d 100644
--- a/system/uapp/usbctl/rules.mk
+++ b/system/uapp/usbctl/rules.mk
@@ -13,8 +13,8 @@
     $(LOCAL_DIR)/usbctl.c
 
 MODULE_LIBS := \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/usbctl/usbctl.c b/system/uapp/usbctl/usbctl.c
index b9d07f2..d989f0d 100644
--- a/system/uapp/usbctl/usbctl.c
+++ b/system/uapp/usbctl/usbctl.c
@@ -8,11 +8,11 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <magenta/device/usb-device.h>
-#include <magenta/device/usb-virt-bus.h>
-#include <magenta/hw/usb-cdc.h>
+#include <zircon/device/usb-device.h>
+#include <zircon/device/usb-virt-bus.h>
+#include <zircon/hw/usb-cdc.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #define DEV_VIRTUAL_USB "/dev/misc/usb-virtual-bus"
 #define DEV_USB_DEVICE_DIR  "/dev/class/usb-device"
@@ -21,7 +21,7 @@
 #define GOOGLE_CDC_PID  0xA020
 #define GOOGLE_UMS_PID  0xA021
 
-#define MANUFACTURER_STRING "Magenta"
+#define MANUFACTURER_STRING "Zircon"
 #define CDC_PRODUCT_STRING  "CDC Ethernet"
 #define UMS_PRODUCT_STRING  "USB Mass Storage"
 #define SERIAL_STRING       "12345678"
@@ -99,12 +99,12 @@
     return -1;
 }
 
-static mx_status_t device_init(int fd, const usb_function_t* function) {
+static zx_status_t device_init(int fd, const usb_function_t* function) {
     device_desc.idVendor = htole16(function->vid);
     device_desc.idProduct = htole16(function->pid);
 
     // allocate string descriptors
-    mx_status_t status = ioctl_usb_device_alloc_string_desc(fd, MANUFACTURER_STRING,
+    zx_status_t status = ioctl_usb_device_alloc_string_desc(fd, MANUFACTURER_STRING,
                                                             strlen(MANUFACTURER_STRING) + 1,
                                                             &device_desc.iManufacturer);
     if (status < 0) {
@@ -158,7 +158,7 @@
         goto usage;
     }
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     const char* command = argv[1];
     if (!strcmp(command, "reset")) {
         status = ioctl_usb_device_clear_functions(fd);
@@ -171,7 +171,7 @@
     }
 
     close(fd);
-    return status == MX_OK ? 0 : -1;
+    return status == ZX_OK ? 0 : -1;
 
 usage:
     close(fd);
@@ -190,7 +190,7 @@
         goto usage;
     }
 
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     const char* command = argv[1];
     if (!strcmp(command, "enable")) {
         int enabled = 1;
@@ -209,7 +209,7 @@
     }
 
     close(fd);
-    return status == MX_OK ? 0 : -1;
+    return status == ZX_OK ? 0 : -1;
 
 usage:
     close(fd);
diff --git a/system/uapp/watch/rules.mk b/system/uapp/watch/rules.mk
index 4f8991a..d315247 100644
--- a/system/uapp/watch/rules.mk
+++ b/system/uapp/watch/rules.mk
@@ -11,6 +11,6 @@
 
 MODULE_SRCS += $(LOCAL_DIR)/watch.c
 
-MODULE_LIBS := system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/uapp/watch/watch.c b/system/uapp/watch/watch.c
index 6b4619c..65f80b6 100644
--- a/system/uapp/watch/watch.c
+++ b/system/uapp/watch/watch.c
@@ -6,9 +6,9 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-#include <mxio/watcher.h>
+#include <fdio/watcher.h>
 
-mx_status_t callback(int dirfd, int event, const char* fn, void* cookie) {
+zx_status_t callback(int dirfd, int event, const char* fn, void* cookie) {
     const char* path = cookie;
 
     switch (event) {
@@ -22,7 +22,7 @@
         fprintf(stderr, "watch: waiting...\n");
         break;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 int main(int argc, char** argv) {
@@ -35,9 +35,9 @@
         fprintf(stderr, "cannot open directory '%s'\n", argv[1]);
     }
 
-    mx_status_t status;
-    if ((status = mxio_watch_directory(fd, callback, MX_TIME_INFINITE, argv[1])) < 0) {
-        fprintf(stderr, "mxio watch directory failed: %d\n", status);
+    zx_status_t status;
+    if ((status = fdio_watch_directory(fd, callback, ZX_TIME_INFINITE, argv[1])) < 0) {
+        fprintf(stderr, "fdio watch directory failed: %d\n", status);
         return -1;
     }
 
diff --git a/system/ulib/acpisvc-client/include/acpisvc/protocol.h b/system/ulib/acpisvc-client/include/acpisvc/protocol.h
index a7ec0ec..5b9171d 100644
--- a/system/ulib/acpisvc-client/include/acpisvc/protocol.h
+++ b/system/ulib/acpisvc-client/include/acpisvc/protocol.h
@@ -5,9 +5,9 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls/pci.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/pci.h>
+#include <zircon/syscalls/port.h>
 
 #define ACPI_MAX_REQUEST_SIZE 2048
 #define ACPI_MAX_RESPONSE_SIZE 2048
@@ -33,7 +33,7 @@
 } __PACKED acpi_cmd_hdr_t;
 
 typedef struct {
-    mx_status_t status;
+    zx_status_t status;
     uint32_t len;
     uint32_t request_id; // ID value that was sent in cmd
 } __PACKED acpi_rsp_hdr_t;
@@ -53,7 +53,7 @@
     uint32_t reserved1[6];
 } __PACKED acpi_event_packet_t;
 
-static_assert(sizeof(mx_port_packet_t) == sizeof(acpi_event_packet_t), "");
+static_assert(sizeof(zx_port_packet_t) == sizeof(acpi_event_packet_t), "");
 
 // List all children of the node associated with the handle used to issue the
 // request.
@@ -94,7 +94,7 @@
 typedef struct {
     acpi_rsp_hdr_t hdr;
 
-    mx_pci_init_arg_t arg;
+    zx_pci_init_arg_t arg;
 } __PACKED acpi_rsp_get_pci_init_arg_t;
 
 // Perform an S-state transition (S5: poweroff, S3: suspend-to-RAM).
diff --git a/system/ulib/acpisvc-client/include/acpisvc/simple.h b/system/ulib/acpisvc-client/include/acpisvc/simple.h
index 38a128e..6896e31 100644
--- a/system/ulib/acpisvc-client/include/acpisvc/simple.h
+++ b/system/ulib/acpisvc-client/include/acpisvc/simple.h
@@ -7,8 +7,8 @@
 #include <threads.h>
 
 #include <acpisvc/protocol.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 
 __BEGIN_CDECLS
 
@@ -17,12 +17,12 @@
 // these simplified functions should not be mixed with other interfaces.
 
 typedef struct {
-    mx_handle_t pipe;
+    zx_handle_t pipe;
     mtx_t lock;
     uint32_t next_req_id;
 } acpi_handle_t;
 
-static void acpi_handle_init(acpi_handle_t* h, mx_handle_t pipe) {
+static void acpi_handle_init(acpi_handle_t* h, zx_handle_t pipe) {
     h->pipe = pipe;
     h->lock = (mtx_t)MTX_INIT;
     h->next_req_id = 0;
@@ -30,27 +30,27 @@
 
 static void acpi_handle_close(acpi_handle_t* h) {
     mtx_lock(&h->lock);
-    mx_handle_close(h->pipe);
+    zx_handle_close(h->pipe);
     mtx_unlock(&h->lock);
 }
 
 // Obtain an additional acpi service handle
 //
-mx_handle_t acpi_clone_handle(acpi_handle_t* h);
+zx_handle_t acpi_clone_handle(acpi_handle_t* h);
 
 // List the children of the ACPI node.
 //
 // *rsp* is a pointer to store the response into.  The response can be released
 // with free().
 // *len* is a pointer to store the length of the response into
-mx_status_t acpi_list_children(acpi_handle_t* h,
+zx_status_t acpi_list_children(acpi_handle_t* h,
                                acpi_rsp_list_children_t** rsp, size_t* len);
 
 // Get a handle to the specified child of the ACPI node.
 //
 // *name* is a 4-character name returned from list_children().
 // *child* will become a handle to the child, if the call is successful.
-mx_status_t acpi_get_child_handle(acpi_handle_t* h, const char name[4],
+zx_status_t acpi_get_child_handle(acpi_handle_t* h, const char name[4],
                                   acpi_handle_t* child);
 
 // Get information necessary for PCI bus driver initialization.
@@ -60,7 +60,7 @@
 // *len* is a pointer to store the length of the response into
 //
 // This command will only succeed if the ACPI node represents a PCI root bus.
-mx_status_t acpi_get_pci_init_arg(acpi_handle_t* h,
+zx_status_t acpi_get_pci_init_arg(acpi_handle_t* h,
                                   acpi_rsp_get_pci_init_arg_t** response,
                                   size_t* len);
 
@@ -68,23 +68,23 @@
 //
 // This command will only succeed if the handle is the ACPI root handle.
 // TODO(teisenbe): Perhaps open this up to a different handle.
-mx_status_t acpi_s_state_transition(acpi_handle_t* h, uint8_t target_state);
+zx_status_t acpi_s_state_transition(acpi_handle_t* h, uint8_t target_state);
 
 // Execute PS0 for an ACPI node.
 //
 // *path* is a full path to an ACPI object.
 // NOTE: this is a temporary interface that will be removed soon.
-mx_status_t acpi_ps0(acpi_handle_t* h, char* path, size_t len);
+zx_status_t acpi_ps0(acpi_handle_t* h, char* path, size_t len);
 
 // Execute BST for an ACPI node
 //
 // NOTE: this is a temporary interface that will be removed soon.
-mx_status_t acpi_bst(acpi_handle_t* h, acpi_rsp_bst_t** response);
+zx_status_t acpi_bst(acpi_handle_t* h, acpi_rsp_bst_t** response);
 
 // Execute BIF for an ACPI node
 //
 // NOTE: this is a temporary interface that will be removed soon.
-mx_status_t acpi_bif(acpi_handle_t* h, acpi_rsp_bif_t** response);
+zx_status_t acpi_bif(acpi_handle_t* h, acpi_rsp_bif_t** response);
 
 // Receive ACPI events on a port.
 //
@@ -92,6 +92,6 @@
 // consumed.
 // *key* is the key to pass in the event packet.
 // *events* is a bitmap of events.
-mx_status_t acpi_enable_event(acpi_handle_t* h, mx_handle_t port, uint64_t key, uint16_t events);
+zx_status_t acpi_enable_event(acpi_handle_t* h, zx_handle_t port, uint64_t key, uint16_t events);
 
 __END_CDECLS
diff --git a/system/ulib/acpisvc-client/rules.mk b/system/ulib/acpisvc-client/rules.mk
index a9e09d2..dcf4acb 100644
--- a/system/ulib/acpisvc-client/rules.mk
+++ b/system/ulib/acpisvc-client/rules.mk
@@ -12,7 +12,7 @@
     $(LOCAL_DIR)/simple.c
 
 MODULE_LIBS := \
-	system/ulib/magenta \
+	system/ulib/zircon \
 	system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/acpisvc-client/simple.c b/system/ulib/acpisvc-client/simple.c
index 82d3053..7a1465f 100644
--- a/system/ulib/acpisvc-client/simple.c
+++ b/system/ulib/acpisvc-client/simple.c
@@ -7,7 +7,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #define MAX_RETURNED_HANDLES 1
 
@@ -19,43 +19,43 @@
 // *num_handles* is an in/out parameter of the number of elements in
 // the *handles* array, and is populated with the number of elements
 // written.
-static mx_status_t wait_for_message(
-    mx_handle_t h, uint32_t req_id,
+static zx_status_t wait_for_message(
+    zx_handle_t h, uint32_t req_id,
     void** response, size_t* len,
-    mx_handle_t* handles, size_t* num_handles) {
+    zx_handle_t* handles, size_t* num_handles) {
 
-    mx_signals_t pending;
-    mx_status_t status = mx_object_wait_one(h,
-                                            MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                                            MX_TIME_INFINITE,
+    zx_signals_t pending;
+    zx_status_t status = zx_object_wait_one(h,
+                                            ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                                            ZX_TIME_INFINITE,
                                             &pending);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
-    if (pending & MX_CHANNEL_READABLE) {
+    if (pending & ZX_CHANNEL_READABLE) {
         uint32_t rsp_len = 0;
         uint32_t num_handles_returned = 0;
-        status = mx_channel_read(h, 0, NULL, NULL, rsp_len,
+        status = zx_channel_read(h, 0, NULL, NULL, rsp_len,
                 num_handles_returned, &rsp_len, &num_handles_returned);
-        if (status != MX_ERR_BUFFER_TOO_SMALL) {
+        if (status != ZX_ERR_BUFFER_TOO_SMALL) {
             return status;
         }
         if (rsp_len < sizeof(acpi_rsp_hdr_t)) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
         if (num_handles_returned > MAX_RETURNED_HANDLES) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
 
         acpi_rsp_hdr_t* rsp = malloc(rsp_len);
         if (!rsp) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
 
-        mx_handle_t handles_returned[MAX_RETURNED_HANDLES];
-        status = mx_channel_read(h, 0, rsp, handles_returned, rsp_len,
+        zx_handle_t handles_returned[MAX_RETURNED_HANDLES];
+        status = zx_channel_read(h, 0, rsp, handles_returned, rsp_len,
                 num_handles_returned, &rsp_len, &num_handles_returned);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             free(rsp);
             return status;
         }
@@ -66,24 +66,24 @@
 
             free(rsp);
             for (uint32_t i = 0; i < num_handles_returned; ++i) {
-                mx_handle_close(handles_returned[i]);
+                zx_handle_close(handles_returned[i]);
             }
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
 
         *response = rsp;
         *len = rsp_len;
         *num_handles = num_handles_returned;
         memcpy(handles, handles_returned,
-                sizeof(mx_handle_t) * num_handles_returned);
+                sizeof(zx_handle_t) * num_handles_returned);
 
-        return MX_OK;
-    } else if (pending & MX_CHANNEL_PEER_CLOSED) {
-        return MX_ERR_PEER_CLOSED;
+        return ZX_OK;
+    } else if (pending & ZX_CHANNEL_PEER_CLOSED) {
+        return ZX_ERR_PEER_CLOSED;
     } else {
-        // Shouldn't happen; if status == MX_OK, then one of the signals
+        // Shouldn't happen; if status == ZX_OK, then one of the signals
         // should be pending.
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 }
 
@@ -100,15 +100,15 @@
 // - The response was an error response.
 // - The response was malformed.
 // - The response had an unexpected number of handles
-static mx_status_t run_txn(
+static zx_status_t run_txn(
     acpi_handle_t* h,
     void* cmd, size_t cmd_len,
     void** rsp, size_t* rsp_len,
-    mx_handle_t cmd_handle,
-    mx_handle_t* rsp_handles, size_t num_rsp_handles) {
+    zx_handle_t cmd_handle,
+    zx_handle_t* rsp_handles, size_t num_rsp_handles) {
 
     if (cmd_len < sizeof(acpi_cmd_hdr_t)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     *rsp = NULL;
@@ -120,42 +120,42 @@
     acpi_cmd_hdr_t* cmd_hdr = cmd;
     cmd_hdr->request_id = req_id;
 
-    mx_status_t status = mx_channel_write(h->pipe, 0, cmd, cmd_len, &cmd_handle, (cmd_handle > 0) ? 1 : 0);
-    if (status != MX_OK) {
+    zx_status_t status = zx_channel_write(h->pipe, 0, cmd, cmd_len, &cmd_handle, (cmd_handle > 0) ? 1 : 0);
+    if (status != ZX_OK) {
         if (cmd_handle) {
-            mx_handle_close(cmd_handle);
+            zx_handle_close(cmd_handle);
         }
         goto exit;
     }
 
     size_t handle_count = num_rsp_handles;
     status = wait_for_message(h->pipe, req_id, rsp, rsp_len, rsp_handles, &handle_count);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto exit;
     }
 
     acpi_rsp_hdr_t* rsp_hdr = *(acpi_rsp_hdr_t**)rsp;
 
     // Validate the response
-    if (rsp_hdr->status != MX_OK) {
+    if (rsp_hdr->status != ZX_OK) {
         status = rsp_hdr->status;
         goto cleanup;
     }
     if (rsp_hdr->len != *rsp_len) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto cleanup;
     }
     if (handle_count != num_rsp_handles) {
-        status = MX_ERR_BAD_STATE;
+        status = ZX_ERR_BAD_STATE;
         goto cleanup;
     }
 
-    status = MX_OK;
+    status = ZX_OK;
     goto exit;
 
 cleanup:
     for (uint32_t i = 0; i < handle_count; ++i) {
-        mx_handle_close(rsp_handles[i]);
+        zx_handle_close(rsp_handles[i]);
         rsp_handles[i] = 0;
     }
 
@@ -166,7 +166,7 @@
     return status;
 }
 
-mx_status_t acpi_list_children(acpi_handle_t* h,
+zx_status_t acpi_list_children(acpi_handle_t* h,
                                acpi_rsp_list_children_t** response, size_t* len) {
 
     acpi_cmd_list_children_t cmd = {
@@ -179,24 +179,24 @@
 
     acpi_rsp_list_children_t* rsp;
     size_t rsp_len;
-    mx_status_t status =
+    zx_status_t status =
         run_txn(h, &cmd, sizeof(cmd), (void**)&rsp, &rsp_len, 0, NULL, 0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     // Validate the response
     if (rsp_len != sizeof(*rsp) + sizeof(rsp->children[0]) * rsp->num_children) {
         free(rsp);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     *response = rsp;
     *len = rsp_len;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t acpi_get_child_handle(acpi_handle_t* h, const char name[4],
+zx_status_t acpi_get_child_handle(acpi_handle_t* h, const char name[4],
                                   acpi_handle_t* child) {
     acpi_cmd_get_child_handle_t cmd = {
         .hdr = {
@@ -210,19 +210,19 @@
     acpi_rsp_get_child_handle_t* rsp = NULL;
     size_t rsp_len;
 
-    mx_handle_t handles[1] = {0};
-    mx_status_t status =
+    zx_handle_t handles[1] = {0};
+    zx_status_t status =
         run_txn(h, &cmd, sizeof(cmd), (void**)&rsp, &rsp_len, 0, handles, countof(handles));
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     acpi_handle_init(child, handles[0]);
     free(rsp);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t acpi_get_pci_init_arg(acpi_handle_t* h,
+zx_status_t acpi_get_pci_init_arg(acpi_handle_t* h,
                                   acpi_rsp_get_pci_init_arg_t** response,
                                   size_t* len) {
     acpi_cmd_get_pci_init_arg_t cmd = {
@@ -236,18 +236,18 @@
     acpi_rsp_get_pci_init_arg_t* rsp;
     size_t rsp_len;
 
-    mx_status_t status =
+    zx_status_t status =
         run_txn(h, &cmd, sizeof(cmd), (void**)&rsp, &rsp_len, 0, NULL, 0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     *response = rsp;
     *len = rsp_len;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t acpi_s_state_transition(acpi_handle_t* h, uint8_t target_state) {
+zx_status_t acpi_s_state_transition(acpi_handle_t* h, uint8_t target_state) {
     acpi_cmd_s_state_transition_t cmd = {
         .hdr = {
             .version = 0,
@@ -259,9 +259,9 @@
 
     acpi_rsp_s_state_transition_t* rsp;
     size_t rsp_len;
-    mx_status_t status =
+    zx_status_t status =
         run_txn(h, &cmd, sizeof(cmd), (void**)&rsp, &rsp_len, 0, NULL, 0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -269,7 +269,7 @@
     abort();
 }
 
-mx_status_t acpi_ps0(acpi_handle_t* h, char* path, size_t len) {
+zx_status_t acpi_ps0(acpi_handle_t* h, char* path, size_t len) {
     acpi_cmd_ps0_t cmd = {
         .hdr = {
             .version = 0,
@@ -281,17 +281,17 @@
 
     acpi_rsp_ps0_t* rsp;
     size_t rsp_len;
-    mx_status_t status =
+    zx_status_t status =
         run_txn(h, &cmd, sizeof(cmd), (void**)&rsp, &rsp_len, 0, NULL, 0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     free(rsp);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t acpi_bst(acpi_handle_t* h, acpi_rsp_bst_t** response) {
+zx_status_t acpi_bst(acpi_handle_t* h, acpi_rsp_bst_t** response) {
     acpi_cmd_bst_t cmd = {
         .hdr = {
             .version = 0,
@@ -303,17 +303,17 @@
     acpi_rsp_bst_t* rsp;
     size_t rsp_len;
 
-    mx_status_t status =
+    zx_status_t status =
         run_txn(h, &cmd, sizeof(cmd), (void**)&rsp, &rsp_len, 0, NULL, 0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     *response = rsp;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t acpi_bif(acpi_handle_t* h, acpi_rsp_bif_t** response) {
+zx_status_t acpi_bif(acpi_handle_t* h, acpi_rsp_bif_t** response) {
     acpi_cmd_bst_t cmd = {
         .hdr = {
             .version = 0,
@@ -325,26 +325,26 @@
     acpi_rsp_bif_t* rsp;
     size_t rsp_len;
 
-    mx_status_t status =
+    zx_status_t status =
         run_txn(h, &cmd, sizeof(cmd), (void**)&rsp, &rsp_len, 0, NULL, 0);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     *response = rsp;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t acpi_enable_event(acpi_handle_t* _h, mx_handle_t port, uint64_t key, uint16_t events) {
+zx_status_t acpi_enable_event(acpi_handle_t* _h, zx_handle_t port, uint64_t key, uint16_t events) {
     if (_h == NULL) {
-        mx_handle_close(port);
-        return MX_ERR_INVALID_ARGS;
+        zx_handle_close(port);
+        return ZX_ERR_INVALID_ARGS;
     }
-    if (port == MX_HANDLE_INVALID) {
-        return MX_ERR_INVALID_ARGS;
+    if (port == ZX_HANDLE_INVALID) {
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t status;
+    zx_status_t status;
     acpi_cmd_enable_event_t cmd = {
         .hdr = {
             .version = 0,
@@ -358,30 +358,30 @@
     acpi_cmd_enable_event_t* rsp;
     size_t rsp_len;
     if ((status = run_txn(_h, &cmd, sizeof(cmd), (void**)&rsp, &rsp_len, port, NULL, 0)) < 0) {
-        mx_handle_close(port);
+        zx_handle_close(port);
         return status;
     }
     free(rsp);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_handle_t acpi_clone_handle(acpi_handle_t* _h) {
+zx_handle_t acpi_clone_handle(acpi_handle_t* _h) {
     acpi_cmd_hdr_t cmd = {
         .version = 0,
         .cmd = ACPI_CMD_NEW_CONNECTION,
         .len = sizeof(cmd),
     };
 
-    mx_handle_t h[2];
-    mx_status_t status;
-    if ((status = mx_channel_create(0, &h[0], &h[1])) < 0) {
+    zx_handle_t h[2];
+    zx_status_t status;
+    if ((status = zx_channel_create(0, &h[0], &h[1])) < 0) {
         return status;
     }
 
     acpi_rsp_hdr_t* rsp;
     size_t rsp_len;
     if ((status = run_txn(_h, &cmd, sizeof(cmd), (void**)&rsp, &rsp_len, h[1], NULL, 0)) < 0) {
-        mx_handle_close(h[0]);
+        zx_handle_close(h[0]);
         return status;
     }
     free(rsp);
diff --git a/system/ulib/async/BUILD.gn b/system/ulib/async/BUILD.gn
index 982058d..0776f87 100644
--- a/system/ulib/async/BUILD.gn
+++ b/system/ulib/async/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 source_set("async") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "include/async/auto_task.h",
     "include/async/auto_wait.h",
@@ -23,17 +23,17 @@
     "wait_with_timeout.cpp",
   ]
 
-  libs = [ "magenta" ]
+  libs = [ "zircon" ]
 
   public_deps = [
-    "//magenta/system/ulib/fbl",
+    "//zircon/system/ulib/fbl",
   ]
 
   public_configs = [ ":async_config" ]
 }
 
 source_set("default") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "include/async/default.h",
   ]
@@ -46,7 +46,7 @@
 }
 
 source_set("loop") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "include/async/loop.h",
     "loop.c",
diff --git a/system/ulib/async/README.md b/system/ulib/async/README.md
index 6aad1bd..9be7ae9 100644
--- a/system/ulib/async/README.md
+++ b/system/ulib/async/README.md
@@ -53,13 +53,13 @@
 #include <async/wait.h>
 
 async_wait_result_t handler(async_t* async, async_wait_t* wait,
-                            mx_status_t status, const mx_packet_signal_t* signal) {
+                            zx_status_t status, const zx_packet_signal_t* signal) {
     printf("signal received: status=%d, observed=%d", status, signal ? signal->observed : 0);
     free(wait);
     return ASYNC_WAIT_FINISHED;
 }
 
-mx_status_t await(mx_handle_t object, mx_signals_t trigger, void* data) {
+zx_status_t await(zx_handle_t object, zx_signals_t trigger, void* data) {
     async_wait_t* wait = calloc(1, sizeof(async_wait_t));
     wait->handler = handler;
     wait->object = object;
@@ -92,17 +92,17 @@
     void* data;
 } task_data_t;
 
-async_task_result_t handler(async_t* async, async_task_t* task, mx_status_t status) {
+async_task_result_t handler(async_t* async, async_task_t* task, zx_status_t status) {
     task_data_t* task_data = (task_data_t*)task;
     printf("task deadline elapsed: status=%d, data=%p", status, task_data->data);
     free(task_data);
     return ASYNC_TASK_FINISHED;
 }
 
-mx_status_t schedule_work(void* data) {
+zx_status_t schedule_work(void* data) {
     task_data_t* task_data = calloc(1, sizeof(task_data_t));
     task_data->task.handler = handler;
-    task_data->task.deadline = mx_deadline_after(MX_SEC(2));
+    task_data->task.deadline = zx_deadline_after(ZX_SEC(2));
     task_data->task.flags = ASYNC_FLAG_HANDLE_SHUTDOWN;
     task_data->data = data;
     return async_post_task(async_get_default(), &task_data->task);
@@ -113,7 +113,7 @@
 
 Occasionally it may be useful to register a receiver which will be the
 recipient of multiple data packets instead of allocating a separate task
-structure for each one.  The Magenta port takes care of storing the queued
+structure for each one.  The Zircon port takes care of storing the queued
 packet data contents until it is delivered.
 
 The client can queue packets from any thread but dispatch will occur
@@ -127,8 +127,8 @@
 ```c
 #include <async/receiver.h>
 
-void handler(async_t* async, async_receiver_t* receiver, mx_status_t status,
-             const mx_packet_user_t* data) {
+void handler(async_t* async, async_receiver_t* receiver, zx_status_t status,
+             const zx_packet_user_t* data) {
     printf("packet received: status=%d, data.u32[0]=%d", status, data ? data.u32[0] : 0);
 }
 
@@ -136,7 +136,7 @@
     .handler = handler;
 }
 
-mx_status_t send(const mx_packet_user_t* data) {
+zx_status_t send(const zx_packet_user_t* data) {
     return async_queue_packet(async_get_default(), &receiver, data);
 }
 ```
@@ -159,13 +159,13 @@
 
     do_stuff();
 
-    async_loop_run(async, MX_TIME_INFINITE, false);
+    async_loop_run(async, ZX_TIME_INFINITE, false);
     async_loop_destroy(async);
     async_set_default(NULL);  // optional since we're exiting right away
     return 0;
 }
 
-async_task_result_t handler(async_t* async, async_task_t* task, mx_status_t status) {
+async_task_result_t handler(async_t* async, async_task_t* task, zx_status_t status) {
     printf("task deadline elapsed: status=%d", status);
     free(task);
 
@@ -174,10 +174,10 @@
     return ASYNC_TASK_FINISHED;
 }
 
-mx_status_t do_stuff() {
+zx_status_t do_stuff() {
     async_task_t* task = calloc(1, sizeof(async_task_t));
     task->handler = handler;
-    task->deadline = mx_deadline_after(MX_SEC(2));
+    task->deadline = zx_deadline_after(ZX_SEC(2));
     return async_post_task(async_get_default(), task);
 }
 ```
diff --git a/system/ulib/async/auto_task.cpp b/system/ulib/async/auto_task.cpp
index c45e0e6..42b6257 100644
--- a/system/ulib/async/auto_task.cpp
+++ b/system/ulib/async/auto_task.cpp
@@ -4,25 +4,25 @@
 
 #include <async/auto_task.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 namespace async {
 
-AutoTask::AutoTask(async_t* async, mx_time_t deadline, uint32_t flags)
+AutoTask::AutoTask(async_t* async, zx_time_t deadline, uint32_t flags)
     : async_task_t{{ASYNC_STATE_INIT}, &AutoTask::CallHandler, deadline, flags, {}},
       async_(async) {
-    MX_DEBUG_ASSERT(async_);
+    ZX_DEBUG_ASSERT(async_);
 }
 
 AutoTask::~AutoTask() {
     Cancel();
 }
 
-mx_status_t AutoTask::Post() {
-    MX_DEBUG_ASSERT(!pending_);
+zx_status_t AutoTask::Post() {
+    ZX_DEBUG_ASSERT(!pending_);
 
-    mx_status_t status = async_post_task(async_, this);
-    if (status == MX_OK)
+    zx_status_t status = async_post_task(async_, this);
+    if (status == ZX_OK)
         pending_ = true;
 
     return status;
@@ -32,21 +32,21 @@
     if (!pending_)
         return;
 
-    mx_status_t status = async_cancel_task(async_, this);
-    MX_DEBUG_ASSERT_MSG(status == MX_OK, "status=%d", status);
+    zx_status_t status = async_cancel_task(async_, this);
+    ZX_DEBUG_ASSERT_MSG(status == ZX_OK, "status=%d", status);
 
     pending_ = false;
 }
 
 async_task_result_t AutoTask::CallHandler(async_t* async, async_task_t* task,
-                                          mx_status_t status) {
+                                          zx_status_t status) {
     auto self = static_cast<AutoTask*>(task);
-    MX_DEBUG_ASSERT(self->pending_);
+    ZX_DEBUG_ASSERT(self->pending_);
     self->pending_ = false;
 
     async_task_result_t result = self->handler_(async, status);
-    if (result == ASYNC_TASK_REPEAT && status == MX_OK) {
-        MX_DEBUG_ASSERT(!self->pending_);
+    if (result == ASYNC_TASK_REPEAT && status == ZX_OK) {
+        ZX_DEBUG_ASSERT(!self->pending_);
         self->pending_ = true;
     }
     return result;
diff --git a/system/ulib/async/auto_wait.cpp b/system/ulib/async/auto_wait.cpp
index 9fd6182..36af94e 100644
--- a/system/ulib/async/auto_wait.cpp
+++ b/system/ulib/async/auto_wait.cpp
@@ -4,25 +4,25 @@
 
 #include <async/auto_wait.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 namespace async {
 
-AutoWait::AutoWait(async_t* async, mx_handle_t object, mx_signals_t trigger, uint32_t flags)
+AutoWait::AutoWait(async_t* async, zx_handle_t object, zx_signals_t trigger, uint32_t flags)
     : async_wait_t{{ASYNC_STATE_INIT}, &AutoWait::CallHandler, object, trigger, flags, {}},
       async_(async) {
-    MX_DEBUG_ASSERT(async_);
+    ZX_DEBUG_ASSERT(async_);
 }
 
 AutoWait::~AutoWait() {
     Cancel();
 }
 
-mx_status_t AutoWait::Begin() {
-    MX_DEBUG_ASSERT(!pending_);
+zx_status_t AutoWait::Begin() {
+    ZX_DEBUG_ASSERT(!pending_);
 
-    mx_status_t status = async_begin_wait(async_, this);
-    if (status == MX_OK)
+    zx_status_t status = async_begin_wait(async_, this);
+    if (status == ZX_OK)
         pending_ = true;
 
     return status;
@@ -32,21 +32,21 @@
     if (!pending_)
         return;
 
-    mx_status_t status = async_cancel_wait(async_, this);
-    MX_DEBUG_ASSERT_MSG(status == MX_OK, "status=%d", status);
+    zx_status_t status = async_cancel_wait(async_, this);
+    ZX_DEBUG_ASSERT_MSG(status == ZX_OK, "status=%d", status);
 
     pending_ = false;
 }
 
 async_wait_result_t AutoWait::CallHandler(async_t* async, async_wait_t* wait,
-                                          mx_status_t status, const mx_packet_signal_t* signal) {
+                                          zx_status_t status, const zx_packet_signal_t* signal) {
     auto self = static_cast<AutoWait*>(wait);
-    MX_DEBUG_ASSERT(self->pending_);
+    ZX_DEBUG_ASSERT(self->pending_);
     self->pending_ = false;
 
     async_wait_result_t result = self->handler_(async, status, signal);
-    if (result == ASYNC_WAIT_AGAIN && status == MX_OK) {
-        MX_DEBUG_ASSERT(!self->pending_);
+    if (result == ASYNC_WAIT_AGAIN && status == ZX_OK) {
+        ZX_DEBUG_ASSERT(!self->pending_);
         self->pending_ = true;
     }
     return result;
diff --git a/system/ulib/async/include/async/auto_task.h b/system/ulib/async/include/async/auto_task.h
index eb9251a..bb279ab 100644
--- a/system/ulib/async/include/async/auto_task.h
+++ b/system/ulib/async/include/async/auto_task.h
@@ -22,22 +22,22 @@
 public:
     // Handles execution of a posted task.
     //
-    // Reports the |status| of the task.  If the status is |MX_OK| then the
+    // Reports the |status| of the task.  If the status is |ZX_OK| then the
     // task ran, otherwise the task did not run.
     //
     // The result indicates whether the task should be repeated; it may
     // modify the task's properties (such as the deadline) before returning.
     //
-    // The result must be |ASYNC_TASK_FINISHED| if |status| was not |MX_OK|.
+    // The result must be |ASYNC_TASK_FINISHED| if |status| was not |ZX_OK|.
     //
     // It is safe for the handler to destroy itself when returning |ASYNC_TASK_FINISHED|.
     using Handler = fbl::Function<async_task_result_t(async_t* async,
-                                                      mx_status_t status)>;
+                                                      zx_status_t status)>;
 
     // Initializes the properties of the task and binds it to an asynchronous
     // dispatcher.
     explicit AutoTask(async_t* async,
-                      mx_time_t deadline = MX_TIME_INFINITE,
+                      zx_time_t deadline = ZX_TIME_INFINITE,
                       uint32_t flags = 0u);
 
     // Destroys the task.
@@ -58,8 +58,8 @@
     void set_handler(Handler handler) { handler_ = fbl::move(handler); }
 
     // The time when the task should run.
-    mx_time_t deadline() const { return async_task_t::deadline; }
-    void set_deadline(mx_time_t deadline) { async_task_t::deadline = deadline; }
+    zx_time_t deadline() const { return async_task_t::deadline; }
+    void set_deadline(zx_time_t deadline) { async_task_t::deadline = deadline; }
 
     // Valid flags: |ASYNC_FLAG_HANDLE_SHUTDOWN|.
     uint32_t flags() const { return async_task_t::flags; }
@@ -69,7 +69,7 @@
     // tasks with lesser or equal deadlines.
     //
     // See |async_post_task()| for details.
-    mx_status_t Post();
+    zx_status_t Post();
 
     // Cancels the task.
     //
@@ -80,7 +80,7 @@
 
 private:
     static async_task_result_t CallHandler(async_t* async, async_task_t* task,
-                                           mx_status_t status);
+                                           zx_status_t status);
 
     async_t* const async_;
     Handler handler_;
diff --git a/system/ulib/async/include/async/auto_wait.h b/system/ulib/async/include/async/auto_wait.h
index 4088de1..d2a7eac 100644
--- a/system/ulib/async/include/async/auto_wait.h
+++ b/system/ulib/async/include/async/auto_wait.h
@@ -22,24 +22,24 @@
 public:
     // Handles completion of asynchronous wait operations.
     //
-    // Reports the |status| of the wait.  If the status is |MX_OK| then |signal|
+    // Reports the |status| of the wait.  If the status is |ZX_OK| then |signal|
     // describes the signal which was received, otherwise |signal| is null.
     //
     // The result indicates whether the wait should be repeated; it may
     // modify the wait's properties (such as the trigger) before returning.
     //
-    // The result must be |ASYNC_WAIT_FINISHED| if |status| was not |MX_OK|.
+    // The result must be |ASYNC_WAIT_FINISHED| if |status| was not |ZX_OK|.
     //
     // It is safe for the handler to destroy itself when returning |ASYNC_WAIT_FINISHED|.
     using Handler = fbl::Function<async_wait_result_t(async_t* async,
-                                                      mx_status_t status,
-                                                      const mx_packet_signal_t* signal)>;
+                                                      zx_status_t status,
+                                                      const zx_packet_signal_t* signal)>;
 
     // Initializes the properties of the wait operation and binds it to an
     // asynchronous dispatcher.
     explicit AutoWait(async_t* async,
-                      mx_handle_t object = MX_HANDLE_INVALID,
-                      mx_signals_t trigger = MX_SIGNAL_NONE,
+                      zx_handle_t object = ZX_HANDLE_INVALID,
+                      zx_signals_t trigger = ZX_SIGNAL_NONE,
                       uint32_t flags = 0u);
 
     // Destroys the wait operation.
@@ -60,12 +60,12 @@
     void set_handler(Handler handler) { handler_ = fbl::move(handler); }
 
     // The object to wait for signals on.
-    mx_handle_t object() const { return async_wait_t::object; }
-    void set_object(mx_handle_t object) { async_wait_t::object = object; }
+    zx_handle_t object() const { return async_wait_t::object; }
+    void set_object(zx_handle_t object) { async_wait_t::object = object; }
 
     // The set of signals to wait for.
-    mx_signals_t trigger() const { return async_wait_t::trigger; }
-    void set_trigger(mx_signals_t trigger) { async_wait_t::trigger = trigger; }
+    zx_signals_t trigger() const { return async_wait_t::trigger; }
+    void set_trigger(zx_signals_t trigger) { async_wait_t::trigger = trigger; }
 
     // Valid flags: |ASYNC_FLAG_HANDLE_SHUTDOWN|.
     uint32_t flags() const { return async_wait_t::flags; }
@@ -77,7 +77,7 @@
     // This method must not be called when the wait is already pending.
     //
     // See |async_begin_wait()| for details.
-    mx_status_t Begin();
+    zx_status_t Begin();
 
     // Cancels the wait.
     //
@@ -88,8 +88,8 @@
 
 private:
     static async_wait_result_t CallHandler(async_t* async, async_wait_t* wait,
-                                           mx_status_t status,
-                                           const mx_packet_signal_t* signal);
+                                           zx_status_t status,
+                                           const zx_packet_signal_t* signal);
 
     async_t* const async_;
     Handler handler_;
diff --git a/system/ulib/async/include/async/dispatcher.h b/system/ulib/async/include/async/dispatcher.h
index 228646e..7cfe89a 100644
--- a/system/ulib/async/include/async/dispatcher.h
+++ b/system/ulib/async/include/async/dispatcher.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls/port.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
@@ -35,7 +35,7 @@
     // is being shut down so that the handler can release its resources.
     //
     // The dispatcher will invoke the handler with a status of
-    // |MX_ERR_CANCELED| to indicate that it is being shut down.
+    // |ZX_ERR_CANCELED| to indicate that it is being shut down.
     //
     // This flag only applies to pending waits and tasks; receivers will
     // not be notified of shutdown.
@@ -56,7 +56,7 @@
 //
 // Implementations of this interface are not required to support all of these methods.
 // Unsupported methods must have valid (non-null) function pointers, must have
-// no side-effects, and must return |MX_ERR_NOT_SUPPORTED| when called.
+// no side-effects, and must return |ZX_ERR_NOT_SUPPORTED| when called.
 // Furthermore, if an implementation supports one method of a group, such as |begin_wait|,
 // it must also support the other methods of the group, such as |cancel_wait|.
 //
@@ -65,12 +65,12 @@
 // Therefore general-purpose dispatcher implementations are strongly encouraged to
 // support the whole interface to ensure broad compatibility.
 typedef struct async_ops {
-    mx_status_t (*begin_wait)(async_t* async, async_wait_t* wait);
-    mx_status_t (*cancel_wait)(async_t* async, async_wait_t* wait);
-    mx_status_t (*post_task)(async_t* async, async_task_t* task);
-    mx_status_t (*cancel_task)(async_t* async, async_task_t* task);
-    mx_status_t (*queue_packet)(async_t* async, async_receiver_t* receiver,
-                                const mx_packet_user_t* data);
+    zx_status_t (*begin_wait)(async_t* async, async_wait_t* wait);
+    zx_status_t (*cancel_wait)(async_t* async, async_wait_t* wait);
+    zx_status_t (*post_task)(async_t* async, async_task_t* task);
+    zx_status_t (*cancel_task)(async_t* async, async_task_t* task);
+    zx_status_t (*queue_packet)(async_t* async, async_receiver_t* receiver,
+                                const zx_packet_user_t* data);
 } async_ops_t;
 struct async_dispatcher {
     const async_ops_t* ops;
diff --git a/system/ulib/async/include/async/loop.h b/system/ulib/async/include/async/loop.h
index f114ba1..60d1ea5 100644
--- a/system/ulib/async/include/async/loop.h
+++ b/system/ulib/async/include/async/loop.h
@@ -4,7 +4,7 @@
 
 //
 // Provides an implementation of a simple thread-safe asynchronous
-// dispatcher based on a Magenta completion port.  The implementation
+// dispatcher based on a Zircon completion port.  The implementation
 // is designed to avoid most dynamic memory allocation except for that
 // which is required to create the loop in the first place or to manage
 // the list of running threads.
@@ -18,7 +18,7 @@
 #include <stddef.h>
 #include <threads.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include <async/default.h>
 #include <async/dispatcher.h>
@@ -56,10 +56,10 @@
 // |config| provides configuration for the message loop, may be NULL for
 // default behavior.
 //
-// Returns |MX_OK| on success.
-// Returns |MX_ERR_NO_MEMORY| if allocation failed.
+// Returns |ZX_OK| on success.
+// Returns |ZX_ERR_NO_MEMORY| if allocation failed.
 // May return other errors if the necessary internal handles could not be created.
-mx_status_t async_loop_create(const async_loop_config_t* config,
+zx_status_t async_loop_create(const async_loop_config_t* config,
                               async_t** out_async);
 
 // Shuts down the message loop, notifies handlers which asked to handle shutdown.
@@ -79,15 +79,15 @@
 // dispatcher.
 //
 // Dispatches events until the |deadline| expires or the loop is quitted.
-// Use |MX_TIME_INFINITE| to dispatch events indefinitely.
+// Use |ZX_TIME_INFINITE| to dispatch events indefinitely.
 //
 // If |once| is true, performs a single unit of work then returns.
 //
-// Returns |MX_OK| if the dispatcher returns after one cycle.
-// Returns |MX_ERR_TIMED_OUT| if the deadline expired.
-// Returns |MX_ERR_CANCELED| if the loop quitted.
-// Returns |MX_ERR_BAD_STATE| if the loop was shut down with |async_loop_shutdown()|.
-mx_status_t async_loop_run(async_t* async, mx_time_t deadline, bool once);
+// Returns |ZX_OK| if the dispatcher returns after one cycle.
+// Returns |ZX_ERR_TIMED_OUT| if the deadline expired.
+// Returns |ZX_ERR_CANCELED| if the loop quitted.
+// Returns |ZX_ERR_BAD_STATE| if the loop was shut down with |async_loop_shutdown()|.
+zx_status_t async_loop_run(async_t* async, zx_time_t deadline, bool once);
 
 // Quits the message loop.
 // Active invocations of |async_loop_run()| and threads started using
@@ -106,10 +106,10 @@
 // threads started using |async_loop_start_thread()| have terminated before
 // resetting the quit state.
 //
-// Returns |MX_OK| if the loop's state was |ASYNC_LOOP_RUNNABLE| or |ASYNC_LOOP_QUIT|.
-// Returns |MX_ERR_BAD_STATE| if the loop's state was |ASYNC_LOOP_SHUTDOWN| or if
+// Returns |ZX_OK| if the loop's state was |ASYNC_LOOP_RUNNABLE| or |ASYNC_LOOP_QUIT|.
+// Returns |ZX_ERR_BAD_STATE| if the loop's state was |ASYNC_LOOP_SHUTDOWN| or if
 // the message loop is currently active on one or more threads.
-mx_status_t async_loop_reset_quit(async_t* async);
+zx_status_t async_loop_reset_quit(async_t* async);
 
 // Returns the current state of the message loop.
 typedef enum {
@@ -125,10 +125,10 @@
 // |name| is the desired name for the new thread, may be NULL.
 // If |out_thread| is not NULL, it is set to the new thread identifier.
 //
-// Returns |MX_OK| on success.
-// Returns |MX_ERR_BAD_STATE| if the loop was shut down with |async_loop_shutdown()|.
-// Returns |MX_ERR_NO_MEMORY| if allocation or thread creation failed.
-mx_status_t async_loop_start_thread(async_t* async, const char* name,
+// Returns |ZX_OK| on success.
+// Returns |ZX_ERR_BAD_STATE| if the loop was shut down with |async_loop_shutdown()|.
+// Returns |ZX_ERR_NO_MEMORY| if allocation or thread creation failed.
+zx_status_t async_loop_start_thread(async_t* async, const char* name,
                                     thrd_t* out_thread);
 
 // Blocks until all dispatch threads started with |async_loop_start_thread()|
@@ -174,15 +174,15 @@
     // dispatcher.
     //
     // Dispatches events until the |deadline| expires or the loop is quitted.
-    // Use |MX_TIME_INFINITE| to dispatch events indefinitely.
+    // Use |ZX_TIME_INFINITE| to dispatch events indefinitely.
     //
     // If |once| is true, performs a single unit of work then returns.
     //
-    // Returns |MX_OK| if the dispatcher returns after one cycle.
-    // Returns |MX_ERR_TIMED_OUT| if the deadline expired.
-    // Returns |MX_ERR_CANCELED| if the loop quitted.
-    // Returns |MX_ERR_BAD_STATE| if the loop was shut down with |Shutdown()|.
-    mx_status_t Run(mx_time_t deadline = MX_TIME_INFINITE, bool once = false);
+    // Returns |ZX_OK| if the dispatcher returns after one cycle.
+    // Returns |ZX_ERR_TIMED_OUT| if the deadline expired.
+    // Returns |ZX_ERR_CANCELED| if the loop quitted.
+    // Returns |ZX_ERR_BAD_STATE| if the loop was shut down with |Shutdown()|.
+    zx_status_t Run(zx_time_t deadline = ZX_TIME_INFINITE, bool once = false);
 
     // Quits the message loop.
     // Active invocations of |Run()| and threads started using |StartThread()|
@@ -199,10 +199,10 @@
     // The caller must ensure all active invocations of |Run()| and threads
     // started using |StartThread()| have terminated before resetting the quit state.
     //
-    // Returns |MX_OK| if the loop's state was |ASYNC_LOOP_RUNNABLE| or |ASYNC_LOOP_QUIT|.
-    // Returns |MX_ERR_BAD_STATE| if the loop's state was |ASYNC_LOOP_SHUTDOWN| or if
+    // Returns |ZX_OK| if the loop's state was |ASYNC_LOOP_RUNNABLE| or |ASYNC_LOOP_QUIT|.
+    // Returns |ZX_ERR_BAD_STATE| if the loop's state was |ASYNC_LOOP_SHUTDOWN| or if
     // the message loop is currently active on one or more threads.
-    mx_status_t ResetQuit();
+    zx_status_t ResetQuit();
 
     // Returns the current state of the message loop.
     async_loop_state_t GetState() const;
@@ -216,10 +216,10 @@
     // |name| is the desired name for the new thread, may be NULL.
     // If |out_thread| is not NULL, it is set to the new thread identifier.
     //
-    // Returns |MX_OK| on success.
-    // Returns |MX_ERR_BAD_STATE| if the loop was shut down with |async_loop_shutdown()|.
-    // Returns |MX_ERR_NO_MEMORY| if allocation or thread creation failed.
-    mx_status_t StartThread(const char* name = nullptr, thrd_t* out_thread = nullptr);
+    // Returns |ZX_OK| on success.
+    // Returns |ZX_ERR_BAD_STATE| if the loop was shut down with |async_loop_shutdown()|.
+    // Returns |ZX_ERR_NO_MEMORY| if allocation or thread creation failed.
+    zx_status_t StartThread(const char* name = nullptr, thrd_t* out_thread = nullptr);
 
     // Blocks until all dispatch threads started with |StartThread()|
     // have terminated.
diff --git a/system/ulib/async/include/async/receiver.h b/system/ulib/async/include/async/receiver.h
index f78d4f7..2cdfff8 100644
--- a/system/ulib/async/include/async/receiver.h
+++ b/system/ulib/async/include/async/receiver.h
@@ -10,7 +10,7 @@
 
 // Receives packets containing user supplied data.
 //
-// Reports the |status| of the receiver.  If the status is |MX_OK| then |data|
+// Reports the |status| of the receiver.  If the status is |ZX_OK| then |data|
 // describes the contents of the packet which was received, otherwise |data|
 // is null.
 //
@@ -19,8 +19,8 @@
 typedef struct async_receiver async_receiver_t;
 typedef void(async_receiver_handler_t)(async_t* async,
                                        async_receiver_t* receiver,
-                                       mx_status_t status,
-                                       const mx_packet_user_t* data);
+                                       zx_status_t status,
+                                       const zx_packet_user_t* data);
 
 // Context for packet receiver.
 // The same instance may be used to receive arbitrarily many queued packets.
@@ -51,13 +51,13 @@
 // When the dispatcher is shutting down (being destroyed), attempting to
 // queue new packets will fail.
 //
-// Returns |MX_OK| if the packet was successfully enqueued.
-// Returns |MX_ERR_BAD_STATE| if the dispatcher shut down.
-// Returns |MX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
+// Returns |ZX_OK| if the packet was successfully enqueued.
+// Returns |ZX_ERR_BAD_STATE| if the dispatcher shut down.
+// Returns |ZX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
 //
-// See |mx_port_queue()|.
-inline mx_status_t async_queue_packet(async_t* async, async_receiver_t* receiver,
-                                      const mx_packet_user_t* data) {
+// See |zx_port_queue()|.
+inline zx_status_t async_queue_packet(async_t* async, async_receiver_t* receiver,
+                                      const zx_packet_user_t* data) {
     return async->ops->queue_packet(async, receiver, data);
 }
 
@@ -78,15 +78,15 @@
 public:
     // Receives packets containing user supplied data.
     //
-    // Reports the |status| of the receiver.  If the status is |MX_OK| then |data|
+    // Reports the |status| of the receiver.  If the status is |ZX_OK| then |data|
     // describes the contents of the packet which was received, otherwise |data|
     // is null.
     //
     // It is safe for the handler to destroy itself when there are no remaining
     // packets pending delivery to it.
     using Handler = fbl::Function<void(async_t* async,
-                                       mx_status_t status,
-                                       const mx_packet_user_t* data)>;
+                                       zx_status_t status,
+                                       const zx_packet_user_t* data)>;
 
     // Initializes the properties of the receiver.
     explicit Receiver(uint32_t flags = 0u);
@@ -110,11 +110,11 @@
     // Enqueues a packet of data for delivery to the receiver.
     //
     // See |async_queue_packet()| for details.
-    mx_status_t Queue(async_t* async, const mx_packet_user_t* data = nullptr);
+    zx_status_t Queue(async_t* async, const zx_packet_user_t* data = nullptr);
 
 private:
     static void CallHandler(async_t* async, async_receiver_t* receiver,
-                            mx_status_t status, const mx_packet_user_t* data);
+                            zx_status_t status, const zx_packet_user_t* data);
 
     Handler handler_;
 
diff --git a/system/ulib/async/include/async/task.h b/system/ulib/async/include/async/task.h
index f7e0259..9f592a3 100644
--- a/system/ulib/async/include/async/task.h
+++ b/system/ulib/async/include/async/task.h
@@ -22,19 +22,19 @@
 
 // Handles execution of a posted task.
 //
-// Reports the |status| of the task.  If the status is |MX_OK| then the
+// Reports the |status| of the task.  If the status is |ZX_OK| then the
 // task ran, otherwise the task did not run.
 //
 // The result indicates whether the task should be repeated; it may
 // modify the task's properties (such as the deadline) before returning.
 //
-// The result must be |ASYNC_TASK_FINISHED| if |status| was not |MX_OK|.
+// The result must be |ASYNC_TASK_FINISHED| if |status| was not |ZX_OK|.
 //
 // It is safe for the handler to destroy itself when returning |ASYNC_TASK_FINISHED|.
 typedef struct async_task async_task_t;
 typedef async_task_result_t(async_task_handler_t)(async_t* async,
                                                   async_task_t* task,
-                                                  mx_status_t status);
+                                                  zx_status_t status);
 
 // Context for a posted task.
 // A separate instance must be used for each task.
@@ -49,7 +49,7 @@
     // The handler to invoke to perform the task.
     async_task_handler_t* handler;
     // The time when the task should run.
-    mx_time_t deadline;
+    zx_time_t deadline;
     // Valid flags: |ASYNC_FLAG_HANDLE_SHUTDOWN|.
     uint32_t flags;
     // Reserved for future use, set to zero.
@@ -67,16 +67,16 @@
 // post new tasks will fail but previously posted tasks can still be canceled
 // successfully.
 //
-// Returns |MX_OK| if the task was successfully posted.
-// Returns |MX_ERR_BAD_STATE| if the dispatcher shut down.
-// Returns |MX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
+// Returns |ZX_OK| if the task was successfully posted.
+// Returns |ZX_ERR_BAD_STATE| if the dispatcher shut down.
+// Returns |ZX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
 //
-// See also |mx_deadline_after()|.
+// See also |zx_deadline_after()|.
 //
 // TODO(MG-976): Strict serial ordering of task dispatch isn't always needed.
 // We should consider adding support for multiple independent task queues or
 // similar mechanisms.
-inline mx_status_t async_post_task(async_t* async, async_task_t* task) {
+inline zx_status_t async_post_task(async_t* async, async_task_t* task) {
     return async->ops->post_task(async, task);
 }
 
@@ -86,13 +86,13 @@
 // post new tasks will fail but previously posted tasks can still be canceled
 // successfully.
 //
-// Returns |MX_OK| if there was a pending task and it has been successfully
+// Returns |ZX_OK| if there was a pending task and it has been successfully
 // canceled; its handler will not run again and can be released immediately.
-// Returns |MX_ERR_NOT_FOUND| if there was no pending task either because it
+// Returns |ZX_ERR_NOT_FOUND| if there was no pending task either because it
 // already ran, had not been posted, or has been dequeued and is pending
 // execution (perhaps on another thread).
-// Returns |MX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
-inline mx_status_t async_cancel_task(async_t* async, async_task_t* task) {
+// Returns |ZX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
+inline zx_status_t async_cancel_task(async_t* async, async_task_t* task) {
     return async->ops->cancel_task(async, task);
 }
 
@@ -112,20 +112,20 @@
 public:
     // Handles execution of a posted task.
     //
-    // Reports the |status| of the task.  If the status is |MX_OK| then the
+    // Reports the |status| of the task.  If the status is |ZX_OK| then the
     // task ran, otherwise the task did not run.
     //
     // The result indicates whether the task should be repeated; it may
     // modify the task's properties (such as the deadline) before returning.
     //
-    // The result must be |ASYNC_TASK_FINISHED| if |status| was not |MX_OK|.
+    // The result must be |ASYNC_TASK_FINISHED| if |status| was not |ZX_OK|.
     //
     // It is safe for the handler to destroy itself when returning |ASYNC_TASK_FINISHED|.
     using Handler = fbl::Function<async_task_result_t(async_t* async,
-                                                      mx_status_t status)>;
+                                                      zx_status_t status)>;
 
     // Initializes the properties of the task.
-    explicit Task(mx_time_t deadline = MX_TIME_INFINITE, uint32_t flags = 0u);
+    explicit Task(zx_time_t deadline = ZX_TIME_INFINITE, uint32_t flags = 0u);
 
     // Destroys the task.
     //
@@ -140,8 +140,8 @@
     void set_handler(Handler handler) { handler_ = fbl::move(handler); }
 
     // The time when the task should run.
-    mx_time_t deadline() const { return async_task_t::deadline; }
-    void set_deadline(mx_time_t deadline) { async_task_t::deadline = deadline; }
+    zx_time_t deadline() const { return async_task_t::deadline; }
+    void set_deadline(zx_time_t deadline) { async_task_t::deadline = deadline; }
 
     // Valid flags: |ASYNC_FLAG_HANDLE_SHUTDOWN|.
     uint32_t flags() const { return async_task_t::flags; }
@@ -151,16 +151,16 @@
     // tasks with lesser or equal deadlines.
     //
     // See |async_post_task()| for details.
-    mx_status_t Post(async_t* async);
+    zx_status_t Post(async_t* async);
 
     // Cancels the task.
     //
     // See |async_cancel_task()| for details.
-    mx_status_t Cancel(async_t* async);
+    zx_status_t Cancel(async_t* async);
 
 private:
     static async_task_result_t CallHandler(async_t* async, async_task_t* task,
-                                           mx_status_t status);
+                                           zx_status_t status);
 
     Handler handler_;
 
diff --git a/system/ulib/async/include/async/wait.h b/system/ulib/async/include/async/wait.h
index 077497d..a1d022e 100644
--- a/system/ulib/async/include/async/wait.h
+++ b/system/ulib/async/include/async/wait.h
@@ -20,19 +20,19 @@
 
 // Handles completion of asynchronous wait operations.
 //
-// Reports the |status| of the wait.  If the status is |MX_OK| then |signal|
+// Reports the |status| of the wait.  If the status is |ZX_OK| then |signal|
 // describes the signal which was received, otherwise |signal| is null.
 //
 // The result indicates whether the wait should be repeated; it may
 // modify the wait's properties (such as the trigger) before returning.
 //
-// The result must be |ASYNC_WAIT_FINISHED| if |status| was not |MX_OK|.
+// The result must be |ASYNC_WAIT_FINISHED| if |status| was not |ZX_OK|.
 //
 // It is safe for the handler to destroy itself when returning |ASYNC_WAIT_FINISHED|.
 typedef async_wait_result_t(async_wait_handler_t)(async_t* async,
                                                   async_wait_t* wait,
-                                                  mx_status_t status,
-                                                  const mx_packet_signal_t* signal);
+                                                  zx_status_t status,
+                                                  const zx_packet_signal_t* signal);
 
 // Context for an asynchronous wait operation.
 // A separate instance must be used for each wait.
@@ -48,9 +48,9 @@
     // The handler to invoke on completion of the wait.
     async_wait_handler_t* handler;
     // The object to wait for signals on.
-    mx_handle_t object;
+    zx_handle_t object;
     // The set of signals to wait for.
-    mx_signals_t trigger;
+    zx_signals_t trigger;
     // Valid flags: |ASYNC_FLAG_HANDLE_SHUTDOWN|.
     uint32_t flags;
     // Reserved for future use, set to zero.
@@ -68,12 +68,12 @@
 // begin new waits will fail but previously begun waits can still be canceled
 // successfully.
 //
-// Returns |MX_OK| if the wait has been successfully started.
-// Returns |MX_ERR_BAD_STATE| if the dispatcher shut down.
-// Returns |MX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
+// Returns |ZX_OK| if the wait has been successfully started.
+// Returns |ZX_ERR_BAD_STATE| if the dispatcher shut down.
+// Returns |ZX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
 //
-// See |mx_object_wait_async()|.
-inline mx_status_t async_begin_wait(async_t* async, async_wait_t* wait) {
+// See |zx_object_wait_async()|.
+inline zx_status_t async_begin_wait(async_t* async, async_wait_t* wait) {
     return async->ops->begin_wait(async, wait);
 }
 
@@ -83,15 +83,15 @@
 // begin new waits will fail but previously begun waits can still be canceled
 // successfully.
 //
-// Returns |MX_OK| if there was a pending wait and it has been successfully
+// Returns |ZX_OK| if there was a pending wait and it has been successfully
 // canceled; its handler will not run again and can be released immediately.
-// Returns |MX_ERR_NOT_FOUND| if there was no pending wait either because it
+// Returns |ZX_ERR_NOT_FOUND| if there was no pending wait either because it
 // already completed, had not been started, or its completion packet has been
 // dequeued and is pending delivery to its handler (perhaps on another thread).
-// Returns |MX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
+// Returns |ZX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.
 //
-// See |mx_port_cancel()|.
-inline mx_status_t async_cancel_wait(async_t* async, async_wait_t* wait) {
+// See |zx_port_cancel()|.
+inline zx_status_t async_cancel_wait(async_t* async, async_wait_t* wait) {
     return async->ops->cancel_wait(async, wait);
 }
 
@@ -111,22 +111,22 @@
 public:
     // Handles completion of asynchronous wait operations.
     //
-    // Reports the |status| of the wait.  If the status is |MX_OK| then |signal|
+    // Reports the |status| of the wait.  If the status is |ZX_OK| then |signal|
     // describes the signal which was received, otherwise |signal| is null.
     //
     // The result indicates whether the wait should be repeated; it may
     // modify the wait's properties (such as the trigger) before returning.
     //
-    // The result must be |ASYNC_WAIT_FINISHED| if |status| was not |MX_OK|.
+    // The result must be |ASYNC_WAIT_FINISHED| if |status| was not |ZX_OK|.
     //
     // It is safe for the handler to destroy itself when returning |ASYNC_WAIT_FINISHED|.
     using Handler = fbl::Function<async_wait_result_t(async_t* async,
-                                                      mx_status_t status,
-                                                      const mx_packet_signal_t* signal)>;
+                                                      zx_status_t status,
+                                                      const zx_packet_signal_t* signal)>;
 
     // Initializes the properties of the wait operation.
-    explicit Wait(mx_handle_t object = MX_HANDLE_INVALID,
-                  mx_signals_t trigger = MX_SIGNAL_NONE, uint32_t flags = 0u);
+    explicit Wait(zx_handle_t object = ZX_HANDLE_INVALID,
+                  zx_signals_t trigger = ZX_SIGNAL_NONE, uint32_t flags = 0u);
 
     // Destroys the wait operation.
     //
@@ -141,12 +141,12 @@
     void set_handler(Handler handler) { handler_ = fbl::move(handler); }
 
     // The object to wait for signals on.
-    mx_handle_t object() const { return async_wait_t::object; }
-    void set_object(mx_handle_t object) { async_wait_t::object = object; }
+    zx_handle_t object() const { return async_wait_t::object; }
+    void set_object(zx_handle_t object) { async_wait_t::object = object; }
 
     // The set of signals to wait for.
-    mx_signals_t trigger() const { return async_wait_t::trigger; }
-    void set_trigger(mx_signals_t trigger) { async_wait_t::trigger = trigger; }
+    zx_signals_t trigger() const { return async_wait_t::trigger; }
+    void set_trigger(zx_signals_t trigger) { async_wait_t::trigger = trigger; }
 
     // Valid flags: |ASYNC_FLAG_HANDLE_SHUTDOWN|.
     uint32_t flags() const { return async_wait_t::flags; }
@@ -156,16 +156,16 @@
     // the trigger signals.
     //
     // See |async_begin_wait()| for details.
-    mx_status_t Begin(async_t* async);
+    zx_status_t Begin(async_t* async);
 
     // Cancels the wait.
     //
     // See |async_cancel_wait()| for details.
-    mx_status_t Cancel(async_t* async);
+    zx_status_t Cancel(async_t* async);
 
 private:
     static async_wait_result_t CallHandler(async_t* async, async_wait_t* wait,
-                                           mx_status_t status, const mx_packet_signal_t* signal);
+                                           zx_status_t status, const zx_packet_signal_t* signal);
 
     Handler handler_;
 
diff --git a/system/ulib/async/include/async/wait_with_timeout.h b/system/ulib/async/include/async/wait_with_timeout.h
index 492527c..d07b9ea 100644
--- a/system/ulib/async/include/async/wait_with_timeout.h
+++ b/system/ulib/async/include/async/wait_with_timeout.h
@@ -16,7 +16,7 @@
 
 // C++ wrapper for a pending wait operation with an associated timeout.
 //
-// Use |MX_TIME_INFINITE| as the deadline to wait indefinitely.
+// Use |ZX_TIME_INFINITE| as the deadline to wait indefinitely.
 //
 // This class is NOT thread-safe; it can only be used with single-threaded
 // asynchronous dispatchers.
@@ -27,25 +27,25 @@
 public:
     // Handles completion of asynchronous wait operations or a timeout.
     //
-    // Reports the |status| of the wait.  If the status is |MX_OK| then |signal|
+    // Reports the |status| of the wait.  If the status is |ZX_OK| then |signal|
     // describes the signal which was received, otherwise |signal| is null.
     //
-    // Timeouts are indicated with status |MX_ERR_TIMED_OUT|.
+    // Timeouts are indicated with status |ZX_ERR_TIMED_OUT|.
     //
     // The result indicates whether the wait should be repeated; it may
     // modify the wait's properties (such as the trigger) before returning.
     //
-    // The result must be |ASYNC_WAIT_FINISHED| if |status| was not |MX_OK|.
+    // The result must be |ASYNC_WAIT_FINISHED| if |status| was not |ZX_OK|.
     //
     // It is safe for the handler to destroy itself when returning |ASYNC_WAIT_FINISHED|.
     using Handler = fbl::Function<async_wait_result_t(async_t* async,
-                                                      mx_status_t status,
-                                                      const mx_packet_signal_t* signal)>;
+                                                      zx_status_t status,
+                                                      const zx_packet_signal_t* signal)>;
 
     // Initializes the properties of the wait with timeout operation.
-    explicit WaitWithTimeout(mx_handle_t object = MX_HANDLE_INVALID,
-                             mx_signals_t trigger = MX_SIGNAL_NONE,
-                             mx_time_t deadline = MX_TIME_INFINITE,
+    explicit WaitWithTimeout(zx_handle_t object = ZX_HANDLE_INVALID,
+                             zx_signals_t trigger = ZX_SIGNAL_NONE,
+                             zx_time_t deadline = ZX_TIME_INFINITE,
                              uint32_t flags = 0u);
 
     // Destroys the wait with timeout operation.
@@ -61,16 +61,16 @@
     void set_handler(Handler handler) { handler_ = fbl::move(handler); }
 
     // The object to wait for signals on.
-    mx_handle_t object() const { return async_wait_t::object; }
-    void set_object(mx_handle_t object) { async_wait_t::object = object; }
+    zx_handle_t object() const { return async_wait_t::object; }
+    void set_object(zx_handle_t object) { async_wait_t::object = object; }
 
     // The set of signals to wait for.
-    mx_signals_t trigger() const { return async_wait_t::trigger; }
-    void set_trigger(mx_signals_t trigger) { async_wait_t::trigger = trigger; }
+    zx_signals_t trigger() const { return async_wait_t::trigger; }
+    void set_trigger(zx_signals_t trigger) { async_wait_t::trigger = trigger; }
 
     // The time when the timeout should occur.
-    mx_time_t deadline() const { return async_task_t::deadline; }
-    void set_deadline(mx_time_t deadline) { async_task_t::deadline = deadline; }
+    zx_time_t deadline() const { return async_task_t::deadline; }
+    void set_deadline(zx_time_t deadline) { async_task_t::deadline = deadline; }
 
     // Valid flags: |ASYNC_FLAG_HANDLE_SHUTDOWN|.
     uint32_t flags() const { return async_wait_t::flags; }
@@ -80,19 +80,19 @@
     // the trigger signals or for the timeout deadline to elapse.
     //
     // See |async_begin_wait()| for details.
-    mx_status_t Begin(async_t* async);
+    zx_status_t Begin(async_t* async);
 
     // Cancels the wait and its associated timeout.
     //
     // See |async_cancel_wait()| for details.
-    mx_status_t Cancel(async_t* async);
+    zx_status_t Cancel(async_t* async);
 
 private:
     static async_wait_result_t WaitHandler(async_t* async, async_wait_t* wait,
-                                           mx_status_t status,
-                                           const mx_packet_signal_t* signal);
+                                           zx_status_t status,
+                                           const zx_packet_signal_t* signal);
     static async_task_result_t TimeoutHandler(async_t* async, async_task_t* task,
-                                              mx_status_t status);
+                                              zx_status_t status);
 
     Handler handler_;
 
diff --git a/system/ulib/async/loop.c b/system/ulib/async/loop.c
index dcdee2e..bedf9c5 100644
--- a/system/ulib/async/loop.c
+++ b/system/ulib/async/loop.c
@@ -8,9 +8,9 @@
 #include <stdatomic.h>
 #include <stdlib.h>
 
-#include <magenta/assert.h>
-#include <magenta/listnode.h>
-#include <magenta/syscalls.h>
+#include <zircon/assert.h>
+#include <zircon/listnode.h>
+#include <zircon/syscalls.h>
 
 #include <async/receiver.h>
 #include <async/task.h>
@@ -19,12 +19,12 @@
 // The port wait key associated with the dispatcher's control messages.
 #define KEY_CONTROL (0u)
 
-static mx_status_t async_loop_begin_wait(async_t* async, async_wait_t* wait);
-static mx_status_t async_loop_cancel_wait(async_t* async, async_wait_t* wait);
-static mx_status_t async_loop_post_task(async_t* async, async_task_t* task);
-static mx_status_t async_loop_cancel_task(async_t* async, async_task_t* task);
-static mx_status_t async_loop_queue_packet(async_t* async, async_receiver_t* receiver,
-                                           const mx_packet_user_t* data);
+static zx_status_t async_loop_begin_wait(async_t* async, async_wait_t* wait);
+static zx_status_t async_loop_cancel_wait(async_t* async, async_wait_t* wait);
+static zx_status_t async_loop_post_task(async_t* async, async_task_t* task);
+static zx_status_t async_loop_cancel_task(async_t* async, async_task_t* task);
+static zx_status_t async_loop_queue_packet(async_t* async, async_receiver_t* receiver,
+                                           const zx_packet_user_t* data);
 static const async_ops_t async_loop_ops = {
     .begin_wait = async_loop_begin_wait,
     .cancel_wait = async_loop_cancel_wait,
@@ -41,8 +41,8 @@
 typedef struct async_loop {
     async_t async; // must be first
     async_loop_config_t config; // immutable
-    mx_handle_t port; // immutable
-    mx_handle_t timer; // immutable
+    zx_handle_t port; // immutable
+    zx_handle_t timer; // immutable
 
     _Atomic async_loop_state_t state;
     atomic_uint active_threads; // number of active dispatch threads
@@ -55,22 +55,22 @@
     list_node_t thread_list; // earliest created thread first
 } async_loop_t;
 
-static mx_status_t async_loop_run_once(async_loop_t* loop, mx_time_t deadline);
-static mx_status_t async_loop_dispatch_wait(async_loop_t* loop, async_wait_t* wait,
-                                            mx_status_t status, const mx_packet_signal_t* signal);
-static mx_status_t async_loop_dispatch_tasks(async_loop_t* loop);
-static mx_status_t async_loop_dispatch_packet(async_loop_t* loop, async_receiver_t* receiver,
-                                              mx_status_t status, const mx_packet_user_t* data);
+static zx_status_t async_loop_run_once(async_loop_t* loop, zx_time_t deadline);
+static zx_status_t async_loop_dispatch_wait(async_loop_t* loop, async_wait_t* wait,
+                                            zx_status_t status, const zx_packet_signal_t* signal);
+static zx_status_t async_loop_dispatch_tasks(async_loop_t* loop);
+static zx_status_t async_loop_dispatch_packet(async_loop_t* loop, async_receiver_t* receiver,
+                                              zx_status_t status, const zx_packet_user_t* data);
 static void async_loop_wake_threads(async_loop_t* loop);
-static mx_status_t async_loop_wait_async(async_loop_t* loop, async_wait_t* wait);
+static zx_status_t async_loop_wait_async(async_loop_t* loop, async_wait_t* wait);
 static void async_loop_insert_task_locked(async_loop_t* loop, async_task_t* task);
 static void async_loop_restart_timer_locked(async_loop_t* loop);
 static async_wait_result_t async_loop_invoke_wait_handler(async_loop_t* loop, async_wait_t* wait,
-                                                          mx_status_t status, const mx_packet_signal_t* signal);
+                                                          zx_status_t status, const zx_packet_signal_t* signal);
 static async_task_result_t async_loop_invoke_task_handler(async_loop_t* loop, async_task_t* task,
-                                                          mx_status_t status);
+                                                          zx_status_t status);
 static void async_loop_invoke_receiver_handler(async_loop_t* loop, async_receiver_t* receiver,
-                                               mx_status_t status, const mx_packet_user_t* data);
+                                               zx_status_t status, const zx_packet_user_t* data);
 
 static_assert(sizeof(list_node_t) <= sizeof(async_state_t),
               "async_state_t too small");
@@ -94,12 +94,12 @@
     return FROM_NODE(async_task_t, node);
 }
 
-mx_status_t async_loop_create(const async_loop_config_t* config, async_t** out_async) {
-    MX_DEBUG_ASSERT(out_async);
+zx_status_t async_loop_create(const async_loop_config_t* config, async_t** out_async) {
+    ZX_DEBUG_ASSERT(out_async);
 
     async_loop_t* loop = calloc(1u, sizeof(async_loop_t));
     if (!loop)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     atomic_init(&loop->state, ASYNC_LOOP_RUNNABLE);
     atomic_init(&loop->active_threads, 0u);
 
@@ -112,18 +112,18 @@
     list_initialize(&loop->due_list);
     list_initialize(&loop->thread_list);
 
-    mx_status_t status = mx_port_create(0u, &loop->port);
-    if (status == MX_OK)
-        status = mx_timer_create(0u, MX_CLOCK_MONOTONIC, &loop->timer);
-    if (status == MX_OK) {
-        status = mx_object_wait_async(loop->timer, loop->port, KEY_CONTROL,
-                                      MX_TIMER_SIGNALED,
-                                      MX_WAIT_ASYNC_REPEATING);
+    zx_status_t status = zx_port_create(0u, &loop->port);
+    if (status == ZX_OK)
+        status = zx_timer_create(0u, ZX_CLOCK_MONOTONIC, &loop->timer);
+    if (status == ZX_OK) {
+        status = zx_object_wait_async(loop->timer, loop->port, KEY_CONTROL,
+                                      ZX_TIMER_SIGNALED,
+                                      ZX_WAIT_ASYNC_REPEATING);
     }
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         *out_async = &loop->async;
         if (loop->config.make_default_for_current_thread) {
-            MX_DEBUG_ASSERT(async_get_default() == NULL);
+            ZX_DEBUG_ASSERT(async_get_default() == NULL);
             async_set_default(&loop->async);
         }
     } else {
@@ -135,19 +135,19 @@
 
 void async_loop_destroy(async_t* async) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(loop);
 
     async_loop_shutdown(async);
 
-    mx_handle_close(loop->port);
-    mx_handle_close(loop->timer);
+    zx_handle_close(loop->port);
+    zx_handle_close(loop->timer);
     mtx_destroy(&loop->lock);
     free(loop);
 }
 
 void async_loop_shutdown(async_t* async) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(loop);
 
     async_loop_state_t prior_state =
         atomic_exchange_explicit(&loop->state, ASYNC_LOOP_SHUTDOWN,
@@ -161,81 +161,81 @@
     list_node_t* node;
     while ((node = list_remove_head(&loop->wait_list))) {
         async_wait_t* wait = node_to_wait(node);
-        MX_DEBUG_ASSERT(wait->flags & ASYNC_FLAG_HANDLE_SHUTDOWN);
-        async_loop_invoke_wait_handler(loop, wait, MX_ERR_CANCELED, NULL);
+        ZX_DEBUG_ASSERT(wait->flags & ASYNC_FLAG_HANDLE_SHUTDOWN);
+        async_loop_invoke_wait_handler(loop, wait, ZX_ERR_CANCELED, NULL);
     }
     while ((node = list_remove_head(&loop->due_list))) {
         async_task_t* task = node_to_task(node);
         if (task->flags & ASYNC_FLAG_HANDLE_SHUTDOWN)
-            async_loop_invoke_task_handler(loop, task, MX_ERR_CANCELED);
+            async_loop_invoke_task_handler(loop, task, ZX_ERR_CANCELED);
     }
     while ((node = list_remove_head(&loop->task_list))) {
         async_task_t* task = node_to_task(node);
         if (task->flags & ASYNC_FLAG_HANDLE_SHUTDOWN)
-            async_loop_invoke_task_handler(loop, task, MX_ERR_CANCELED);
+            async_loop_invoke_task_handler(loop, task, ZX_ERR_CANCELED);
     }
 
     if (loop->config.make_default_for_current_thread) {
-        MX_DEBUG_ASSERT(async_get_default() == async);
+        ZX_DEBUG_ASSERT(async_get_default() == async);
         async_set_default(NULL);
     }
 }
 
-mx_status_t async_loop_run(async_t* async, mx_time_t deadline, bool once) {
+zx_status_t async_loop_run(async_t* async, zx_time_t deadline, bool once) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(loop);
 
-    mx_status_t status;
+    zx_status_t status;
     atomic_fetch_add_explicit(&loop->active_threads, 1u, memory_order_acq_rel);
     do {
         status = async_loop_run_once(loop, deadline);
-    } while (status == MX_OK && !once);
+    } while (status == ZX_OK && !once);
     atomic_fetch_sub_explicit(&loop->active_threads, 1u, memory_order_acq_rel);
     return status;
 }
 
-static mx_status_t async_loop_run_once(async_loop_t* loop, mx_time_t deadline) {
+static zx_status_t async_loop_run_once(async_loop_t* loop, zx_time_t deadline) {
     async_loop_state_t state = atomic_load_explicit(&loop->state, memory_order_acquire);
     if (state == ASYNC_LOOP_SHUTDOWN)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (state != ASYNC_LOOP_RUNNABLE)
-        return MX_ERR_CANCELED;
+        return ZX_ERR_CANCELED;
 
-    mx_port_packet_t packet;
-    mx_status_t status = mx_port_wait(loop->port, deadline, &packet, 0);
-    if (status != MX_OK)
+    zx_port_packet_t packet;
+    zx_status_t status = zx_port_wait(loop->port, deadline, &packet, 0);
+    if (status != ZX_OK)
         return status;
 
     if (packet.key == KEY_CONTROL) {
         // Handle wake-up packets.
-        if (packet.type == MX_PKT_TYPE_USER)
-            return MX_OK;
+        if (packet.type == ZX_PKT_TYPE_USER)
+            return ZX_OK;
 
         // Handle task timer expirations.
-        if (packet.type == MX_PKT_TYPE_SIGNAL_REP &&
-            packet.signal.observed & MX_TIMER_SIGNALED) {
+        if (packet.type == ZX_PKT_TYPE_SIGNAL_REP &&
+            packet.signal.observed & ZX_TIMER_SIGNALED) {
             return async_loop_dispatch_tasks(loop);
         }
     } else {
         // Handle wait completion packets.
-        if (packet.type == MX_PKT_TYPE_SIGNAL_ONE) {
+        if (packet.type == ZX_PKT_TYPE_SIGNAL_ONE) {
             async_wait_t* wait = (void*)(uintptr_t)packet.key;
             return async_loop_dispatch_wait(loop, wait, packet.status, &packet.signal);
         }
 
         // Handle queued user packets.
-        if (packet.type == MX_PKT_TYPE_USER) {
+        if (packet.type == ZX_PKT_TYPE_USER) {
             async_receiver_t* receiver = (void*)(uintptr_t)packet.key;
             return async_loop_dispatch_packet(loop, receiver, packet.status, &packet.user);
         }
     }
 
-    MX_DEBUG_ASSERT(false);
-    return MX_ERR_INTERNAL;
+    ZX_DEBUG_ASSERT(false);
+    return ZX_ERR_INTERNAL;
 }
 
-static mx_status_t async_loop_dispatch_wait(async_loop_t* loop, async_wait_t* wait,
-                                            mx_status_t status, const mx_packet_signal_t* signal) {
+static zx_status_t async_loop_dispatch_wait(async_loop_t* loop, async_wait_t* wait,
+                                            zx_status_t status, const zx_packet_signal_t* signal) {
     // We must dequeue the handler before invoking it since it might destroy itself.
     if (wait->flags & ASYNC_FLAG_HANDLE_SHUTDOWN) {
         mtx_lock(&loop->lock);
@@ -247,7 +247,7 @@
     async_wait_result_t result = async_loop_invoke_wait_handler(loop, wait, status, signal);
     if (result == ASYNC_WAIT_AGAIN) {
         status = async_loop_wait_async(loop, wait);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             async_loop_invoke_wait_handler(loop, wait, status, NULL);
             result = ASYNC_WAIT_FINISHED;
         }
@@ -259,10 +259,10 @@
         list_add_head(&loop->wait_list, wait_to_node(wait));
         mtx_unlock(&loop->lock);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t async_loop_dispatch_tasks(async_loop_t* loop) {
+static zx_status_t async_loop_dispatch_tasks(async_loop_t* loop) {
     // Dequeue and dispatch one task at a time in case an earlier task wants
     // to cancel a later task which has also come due.  At most one thread
     // can dispatch tasks at any given moment (to preserve serial ordering).
@@ -276,7 +276,7 @@
         // we would like to process in order.
         list_node_t* node;
         if (list_is_empty(&loop->due_list)) {
-            mx_time_t due_time = mx_time_get(MX_CLOCK_MONOTONIC);
+            zx_time_t due_time = zx_time_get(ZX_CLOCK_MONOTONIC);
             list_node_t* tail = NULL;
             list_for_every(&loop->task_list, node) {
                 if (node_to_task(node)->deadline > due_time)
@@ -302,7 +302,7 @@
             mtx_unlock(&loop->lock);
 
             // Invoke the handler.  Note that it might destroy itself.
-            async_task_result_t result = async_loop_invoke_task_handler(loop, task, MX_OK);
+            async_task_result_t result = async_loop_invoke_task_handler(loop, task, ZX_OK);
 
             mtx_lock(&loop->lock);
             if (result == ASYNC_TASK_REPEAT)
@@ -317,19 +317,19 @@
         async_loop_restart_timer_locked(loop);
     }
     mtx_unlock(&loop->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t async_loop_dispatch_packet(async_loop_t* loop, async_receiver_t* receiver,
-                                              mx_status_t status, const mx_packet_user_t* data) {
+static zx_status_t async_loop_dispatch_packet(async_loop_t* loop, async_receiver_t* receiver,
+                                              zx_status_t status, const zx_packet_user_t* data) {
     // Invoke the handler.  Note that it might destroy itself.
     async_loop_invoke_receiver_handler(loop, receiver, status, data);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void async_loop_quit(async_t* async) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(loop);
 
     async_loop_state_t expected_state = ASYNC_LOOP_RUNNABLE;
     if (!atomic_compare_exchange_strong_explicit(&loop->state, &expected_state,
@@ -348,18 +348,18 @@
     // Issuing too many packets is also harmless.
     uint32_t n = atomic_load_explicit(&loop->active_threads, memory_order_acquire);
     for (uint32_t i = 0u; i < n; i++) {
-        mx_port_packet_t packet = {
+        zx_port_packet_t packet = {
             .key = KEY_CONTROL,
-            .type = MX_PKT_TYPE_USER,
-            .status = MX_OK};
-        mx_status_t status = mx_port_queue(loop->port, &packet, 0u);
-        MX_DEBUG_ASSERT_MSG(status == MX_OK, "status=%d", status);
+            .type = ZX_PKT_TYPE_USER,
+            .status = ZX_OK};
+        zx_status_t status = zx_port_queue(loop->port, &packet, 0u);
+        ZX_DEBUG_ASSERT_MSG(status == ZX_OK, "status=%d", status);
     }
 }
 
-mx_status_t async_loop_reset_quit(async_t* async) {
+zx_status_t async_loop_reset_quit(async_t* async) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(loop);
 
     // Ensure that there are no active threads before resetting the quit state.
     // This check is inherently racy but not dangerously so.  It's mainly a
@@ -367,38 +367,38 @@
     // how |async_loop_reset_quit()| is supposed to be used.
     uint32_t n = atomic_load_explicit(&loop->active_threads, memory_order_acquire);
     if (n != 0)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     async_loop_state_t expected_state = ASYNC_LOOP_QUIT;
     if (atomic_compare_exchange_strong_explicit(&loop->state, &expected_state,
                                                 ASYNC_LOOP_RUNNABLE,
                                                 memory_order_acq_rel, memory_order_acquire)) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     async_loop_state_t state = atomic_load_explicit(&loop->state, memory_order_acquire);
     if (state == ASYNC_LOOP_RUNNABLE)
-        return MX_OK;
-    return MX_ERR_BAD_STATE;
+        return ZX_OK;
+    return ZX_ERR_BAD_STATE;
 }
 
 async_loop_state_t async_loop_get_state(async_t* async) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(loop);
 
     return atomic_load_explicit(&loop->state, memory_order_acquire);
 }
 
-static mx_status_t async_loop_begin_wait(async_t* async, async_wait_t* wait) {
+static zx_status_t async_loop_begin_wait(async_t* async, async_wait_t* wait) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
-    MX_DEBUG_ASSERT(wait);
+    ZX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(wait);
 
     if (atomic_load_explicit(&loop->state, memory_order_acquire) == ASYNC_LOOP_SHUTDOWN)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
-    mx_status_t status = async_loop_wait_async(loop, wait);
-    if (status == MX_OK && (wait->flags & ASYNC_FLAG_HANDLE_SHUTDOWN)) {
+    zx_status_t status = async_loop_wait_async(loop, wait);
+    if (status == ZX_OK && (wait->flags & ASYNC_FLAG_HANDLE_SHUTDOWN)) {
         mtx_lock(&loop->lock);
         list_add_head(&loop->wait_list, wait_to_node(wait));
         mtx_unlock(&loop->lock);
@@ -406,17 +406,17 @@
     return status;
 }
 
-static mx_status_t async_loop_cancel_wait(async_t* async, async_wait_t* wait) {
+static zx_status_t async_loop_cancel_wait(async_t* async, async_wait_t* wait) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
-    MX_DEBUG_ASSERT(wait);
+    ZX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(wait);
 
     // Note: We need to process cancelations even while the loop is being
     // destroyed in case the client is counting on the handler not being
     // invoked again past this point.
-    mx_status_t status = mx_port_cancel(loop->port, wait->object,
+    zx_status_t status = zx_port_cancel(loop->port, wait->object,
                                         (uintptr_t)wait);
-    if (status == MX_OK && (wait->flags & ASYNC_FLAG_HANDLE_SHUTDOWN)) {
+    if (status == ZX_OK && (wait->flags & ASYNC_FLAG_HANDLE_SHUTDOWN)) {
         mtx_lock(&loop->lock);
         list_delete(wait_to_node(wait));
         mtx_unlock(&loop->lock);
@@ -424,13 +424,13 @@
     return status;
 }
 
-static mx_status_t async_loop_post_task(async_t* async, async_task_t* task) {
+static zx_status_t async_loop_post_task(async_t* async, async_task_t* task) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
-    MX_DEBUG_ASSERT(task);
+    ZX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(task);
 
     if (atomic_load_explicit(&loop->state, memory_order_acquire) == ASYNC_LOOP_SHUTDOWN)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     mtx_lock(&loop->lock);
 
@@ -442,13 +442,13 @@
     }
 
     mtx_unlock(&loop->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t async_loop_cancel_task(async_t* async, async_task_t* task) {
+static zx_status_t async_loop_cancel_task(async_t* async, async_task_t* task) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
-    MX_DEBUG_ASSERT(task);
+    ZX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(task);
 
     // Note: We need to process cancelations even while the loop is being
     // destroyed in case the client is counting on the handler not being
@@ -461,7 +461,7 @@
     list_node_t* node = task_to_node(task);
     if (!list_in_list(node)) {
         mtx_unlock(&loop->lock);
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     if (!loop->dispatching_tasks &&
@@ -473,31 +473,31 @@
     }
     list_delete(node);
     mtx_unlock(&loop->lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t async_loop_queue_packet(async_t* async, async_receiver_t* receiver,
-                                           const mx_packet_user_t* data) {
+static zx_status_t async_loop_queue_packet(async_t* async, async_receiver_t* receiver,
+                                           const zx_packet_user_t* data) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
-    MX_DEBUG_ASSERT(receiver);
-    MX_DEBUG_ASSERT(!(receiver->flags & ASYNC_FLAG_HANDLE_SHUTDOWN));
+    ZX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(receiver);
+    ZX_DEBUG_ASSERT(!(receiver->flags & ASYNC_FLAG_HANDLE_SHUTDOWN));
 
     if (atomic_load_explicit(&loop->state, memory_order_acquire) == ASYNC_LOOP_SHUTDOWN)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
-    mx_port_packet_t packet = {
+    zx_port_packet_t packet = {
         .key = (uintptr_t)receiver,
-        .type = MX_PKT_TYPE_USER,
-        .status = MX_OK};
+        .type = ZX_PKT_TYPE_USER,
+        .status = ZX_OK};
     if (data)
         packet.user = *data;
-    return mx_port_queue(loop->port, &packet, 0u);
+    return zx_port_queue(loop->port, &packet, 0u);
 }
 
-static mx_status_t async_loop_wait_async(async_loop_t* loop, async_wait_t* wait) {
-    return mx_object_wait_async(wait->object, loop->port, (uintptr_t)wait, wait->trigger,
-                                MX_WAIT_ASYNC_ONCE);
+static zx_status_t async_loop_wait_async(async_loop_t* loop, async_wait_t* wait) {
+    return zx_object_wait_async(wait->object, loop->port, (uintptr_t)wait, wait->trigger,
+                                ZX_WAIT_ASYNC_ONCE);
 }
 
 static void async_loop_insert_task_locked(async_loop_t* loop, async_task_t* task) {
@@ -514,22 +514,22 @@
 }
 
 static void async_loop_restart_timer_locked(async_loop_t* loop) {
-    mx_time_t deadline;
+    zx_time_t deadline;
     if (list_is_empty(&loop->due_list)) {
         list_node_t* head = list_peek_head(&loop->task_list);
         if (!head)
             return;
         async_task_t* task = node_to_task(head);
         deadline = task->deadline;
-        if (deadline == MX_TIME_INFINITE)
+        if (deadline == ZX_TIME_INFINITE)
             return;
     } else {
         // Fire now.
         deadline = 0ULL;
     }
 
-    mx_status_t status = mx_timer_set(loop->timer, deadline, 0);
-    MX_ASSERT_MSG(status == MX_OK, "status=%d", status);
+    zx_status_t status = zx_timer_set(loop->timer, deadline, 0);
+    ZX_ASSERT_MSG(status == ZX_OK, "status=%d", status);
 }
 
 static void async_loop_invoke_prologue(async_loop_t* loop) {
@@ -544,35 +544,35 @@
 
 static async_wait_result_t async_loop_invoke_wait_handler(async_loop_t* loop,
                                                           async_wait_t* wait,
-                                                          mx_status_t status,
-                                                          const mx_packet_signal_t* signal) {
+                                                          zx_status_t status,
+                                                          const zx_packet_signal_t* signal) {
     async_loop_invoke_prologue(loop);
     async_wait_result_t result = wait->handler((async_t*)loop, wait, status, signal);
     async_loop_invoke_epilogue(loop);
 
-    MX_ASSERT_MSG(result == ASYNC_WAIT_FINISHED ||
-                      (result == ASYNC_WAIT_AGAIN && status == MX_OK),
+    ZX_ASSERT_MSG(result == ASYNC_WAIT_FINISHED ||
+                      (result == ASYNC_WAIT_AGAIN && status == ZX_OK),
                   "result=%d, status=%d", result, status);
     return result;
 }
 
 static async_task_result_t async_loop_invoke_task_handler(async_loop_t* loop,
                                                           async_task_t* task,
-                                                          mx_status_t status) {
+                                                          zx_status_t status) {
     async_loop_invoke_prologue(loop);
     async_task_result_t result = task->handler((async_t*)loop, task, status);
     async_loop_invoke_epilogue(loop);
 
-    MX_ASSERT_MSG(result == ASYNC_TASK_FINISHED ||
-                      (result == ASYNC_TASK_REPEAT && status == MX_OK),
+    ZX_ASSERT_MSG(result == ASYNC_TASK_FINISHED ||
+                      (result == ASYNC_TASK_REPEAT && status == ZX_OK),
                   "result=%d, status=%d", result, status);
     return result;
 }
 
 static void async_loop_invoke_receiver_handler(async_loop_t* loop,
                                                async_receiver_t* receiver,
-                                               mx_status_t status,
-                                               const mx_packet_user_t* data) {
+                                               zx_status_t status,
+                                               const zx_packet_user_t* data) {
     async_loop_invoke_prologue(loop);
     receiver->handler((async_t*)loop, receiver, status, data);
     async_loop_invoke_epilogue(loop);
@@ -581,27 +581,27 @@
 static int async_loop_run_thread(void* data) {
     async_t* async = (async_t*)data;
     async_set_default(async);
-    async_loop_run(async, MX_TIME_INFINITE, false);
+    async_loop_run(async, ZX_TIME_INFINITE, false);
     return 0;
 }
 
-mx_status_t async_loop_start_thread(async_t* async, const char* name, thrd_t* out_thread) {
+zx_status_t async_loop_start_thread(async_t* async, const char* name, thrd_t* out_thread) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(loop);
 
     // This check is inherently racy.  The client should not be racing shutdown
     // with attemps to start new threads.  This is mainly a sanity check.
     async_loop_state_t state = atomic_load_explicit(&loop->state, memory_order_acquire);
     if (state == ASYNC_LOOP_SHUTDOWN)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     thread_record_t* rec = calloc(1u, sizeof(thread_record_t));
     if (!rec)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     if (thrd_create_with_name(&rec->thread, async_loop_run_thread, async, name) != thrd_success) {
         free(rec);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     mtx_lock(&loop->lock);
@@ -610,12 +610,12 @@
 
     if (out_thread)
         *out_thread = rec->thread;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void async_loop_join_threads(async_t* async) {
     async_loop_t* loop = (async_loop_t*)async;
-    MX_DEBUG_ASSERT(loop);
+    ZX_DEBUG_ASSERT(loop);
 
     mtx_lock(&loop->lock);
     for (;;) {
@@ -627,7 +627,7 @@
         thrd_t thread = rec->thread;
         free(rec);
         int result = thrd_join(thread, NULL);
-        MX_DEBUG_ASSERT(result == thrd_success);
+        ZX_DEBUG_ASSERT(result == thrd_success);
         mtx_lock(&loop->lock);
     }
     mtx_unlock(&loop->lock);
diff --git a/system/ulib/async/loop_wrapper.cpp b/system/ulib/async/loop_wrapper.cpp
index 4df6b1a..abc0558 100644
--- a/system/ulib/async/loop_wrapper.cpp
+++ b/system/ulib/async/loop_wrapper.cpp
@@ -4,13 +4,13 @@
 
 #include <async/loop.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 namespace async {
 
 Loop::Loop(const async_loop_config_t* config) {
-    mx_status_t status = async_loop_create(config, &async_);
-    MX_ASSERT_MSG(status == MX_OK, "status=%d", status);
+    zx_status_t status = async_loop_create(config, &async_);
+    ZX_ASSERT_MSG(status == ZX_OK, "status=%d", status);
 }
 
 Loop::~Loop() {
@@ -21,7 +21,7 @@
     async_loop_shutdown(async_);
 }
 
-mx_status_t Loop::Run(mx_time_t deadline, bool once) {
+zx_status_t Loop::Run(zx_time_t deadline, bool once) {
     return async_loop_run(async_, deadline, once);
 }
 
@@ -29,7 +29,7 @@
     async_loop_quit(async_);
 }
 
-mx_status_t Loop::ResetQuit() {
+zx_status_t Loop::ResetQuit() {
     return async_loop_reset_quit(async_);
 }
 
@@ -41,7 +41,7 @@
     return async_ == async_get_default();
 }
 
-mx_status_t Loop::StartThread(const char* name, thrd_t* out_thread) {
+zx_status_t Loop::StartThread(const char* name, thrd_t* out_thread) {
     return async_loop_start_thread(async_, name, out_thread);
 }
 
diff --git a/system/ulib/async/receiver.cpp b/system/ulib/async/receiver.cpp
index 784ca7b..e9a7f0a 100644
--- a/system/ulib/async/receiver.cpp
+++ b/system/ulib/async/receiver.cpp
@@ -11,12 +11,12 @@
 
 Receiver::~Receiver() = default;
 
-mx_status_t Receiver::Queue(async_t* async, const mx_packet_user_t* data) {
+zx_status_t Receiver::Queue(async_t* async, const zx_packet_user_t* data) {
     return async_queue_packet(async, this, data);
 }
 
 void Receiver::CallHandler(async_t* async, async_receiver_t* receiver,
-                           mx_status_t status, const mx_packet_user_t* data) {
+                           zx_status_t status, const zx_packet_user_t* data) {
     static_cast<Receiver*>(receiver)->handler_(async, status, data);
 }
 
diff --git a/system/ulib/async/rules.mk b/system/ulib/async/rules.mk
index c7a8c4d..4b59bde 100644
--- a/system/ulib/async/rules.mk
+++ b/system/ulib/async/rules.mk
@@ -26,7 +26,7 @@
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta
+    system/ulib/zircon
 
 include make/module.mk
 
@@ -50,7 +50,7 @@
 MODULE_LIBS := \
     system/ulib/async.default \
     system/ulib/c \
-    system/ulib/magenta
+    system/ulib/zircon
 
 include make/module.mk
 
diff --git a/system/ulib/async/task.cpp b/system/ulib/async/task.cpp
index 4dc907b..a7537c3 100644
--- a/system/ulib/async/task.cpp
+++ b/system/ulib/async/task.cpp
@@ -6,21 +6,21 @@
 
 namespace async {
 
-Task::Task(mx_time_t deadline, uint32_t flags)
+Task::Task(zx_time_t deadline, uint32_t flags)
     : async_task_t{{ASYNC_STATE_INIT}, &Task::CallHandler, deadline, flags, {}} {}
 
 Task::~Task() = default;
 
-mx_status_t Task::Post(async_t* async) {
+zx_status_t Task::Post(async_t* async) {
     return async_post_task(async, this);
 }
 
-mx_status_t Task::Cancel(async_t* async) {
+zx_status_t Task::Cancel(async_t* async) {
     return async_cancel_task(async, this);
 }
 
 async_task_result_t Task::CallHandler(async_t* async, async_task_t* task,
-                                      mx_status_t status) {
+                                      zx_status_t status) {
     return static_cast<Task*>(task)->handler_(async, status);
 }
 
diff --git a/system/ulib/async/wait.cpp b/system/ulib/async/wait.cpp
index bdd8896..b51eb30 100644
--- a/system/ulib/async/wait.cpp
+++ b/system/ulib/async/wait.cpp
@@ -6,21 +6,21 @@
 
 namespace async {
 
-Wait::Wait(mx_handle_t object, mx_signals_t trigger, uint32_t flags)
+Wait::Wait(zx_handle_t object, zx_signals_t trigger, uint32_t flags)
     : async_wait_t{{ASYNC_STATE_INIT}, &Wait::CallHandler, object, trigger, flags, {}} {}
 
 Wait::~Wait() = default;
 
-mx_status_t Wait::Begin(async_t* async) {
+zx_status_t Wait::Begin(async_t* async) {
     return async_begin_wait(async, this);
 }
 
-mx_status_t Wait::Cancel(async_t* async) {
+zx_status_t Wait::Cancel(async_t* async) {
     return async_cancel_wait(async, this);
 }
 
 async_wait_result_t Wait::CallHandler(async_t* async, async_wait_t* wait,
-                                      mx_status_t status, const mx_packet_signal_t* signal) {
+                                      zx_status_t status, const zx_packet_signal_t* signal) {
     return static_cast<Wait*>(wait)->handler_(async, status, signal);
 }
 
diff --git a/system/ulib/async/wait_with_timeout.cpp b/system/ulib/async/wait_with_timeout.cpp
index c335431..12b6b2b 100644
--- a/system/ulib/async/wait_with_timeout.cpp
+++ b/system/ulib/async/wait_with_timeout.cpp
@@ -4,48 +4,48 @@
 
 #include <async/wait_with_timeout.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 namespace async {
 
-WaitWithTimeout::WaitWithTimeout(mx_handle_t object, mx_signals_t trigger,
-                                 mx_time_t deadline, uint32_t flags)
+WaitWithTimeout::WaitWithTimeout(zx_handle_t object, zx_signals_t trigger,
+                                 zx_time_t deadline, uint32_t flags)
     : async_wait_t{{ASYNC_STATE_INIT}, &WaitWithTimeout::WaitHandler, object, trigger, flags, {}},
       async_task_t{{ASYNC_STATE_INIT}, &WaitWithTimeout::TimeoutHandler, deadline, 0u, {}} {}
 
 WaitWithTimeout::~WaitWithTimeout() = default;
 
-mx_status_t WaitWithTimeout::Begin(async_t* async) {
-    mx_status_t status = async_begin_wait(async, this);
-    if (status == MX_OK && deadline() != MX_TIME_INFINITE) {
+zx_status_t WaitWithTimeout::Begin(async_t* async) {
+    zx_status_t status = async_begin_wait(async, this);
+    if (status == ZX_OK && deadline() != ZX_TIME_INFINITE) {
         status = async_post_task(async, this);
-        if (status != MX_OK) {
-            mx_status_t cancel_status = async_cancel_wait(async, this);
-            MX_DEBUG_ASSERT_MSG(cancel_status == MX_OK,
+        if (status != ZX_OK) {
+            zx_status_t cancel_status = async_cancel_wait(async, this);
+            ZX_DEBUG_ASSERT_MSG(cancel_status == ZX_OK,
                                 "cancel_status=%d", cancel_status);
         }
     }
     return status;
 }
 
-mx_status_t WaitWithTimeout::Cancel(async_t* async) {
-    mx_status_t status = async_cancel_wait(async, this);
-    if (status == MX_OK && deadline() != MX_TIME_INFINITE)
+zx_status_t WaitWithTimeout::Cancel(async_t* async) {
+    zx_status_t status = async_cancel_wait(async, this);
+    if (status == ZX_OK && deadline() != ZX_TIME_INFINITE)
         status = async_cancel_task(async, this);
     return status;
 }
 
 async_wait_result_t WaitWithTimeout::WaitHandler(async_t* async, async_wait_t* wait,
-                                                 mx_status_t status,
-                                                 const mx_packet_signal_t* signal) {
+                                                 zx_status_t status,
+                                                 const zx_packet_signal_t* signal) {
     auto self = static_cast<WaitWithTimeout*>(wait);
 
     // We must cancel the task before calling the handler in case it decides
     // to destroy itself during execution.  If this proves inefficient, we
     // could make timeouts on waits a first class API.
-    if (self->deadline() != MX_TIME_INFINITE) {
-        mx_status_t cancel_status = async_cancel_task(async, self);
-        MX_DEBUG_ASSERT_MSG(cancel_status == MX_OK,
+    if (self->deadline() != ZX_TIME_INFINITE) {
+        zx_status_t cancel_status = async_cancel_task(async, self);
+        ZX_DEBUG_ASSERT_MSG(cancel_status == ZX_OK,
                             "cancel_status=%d", cancel_status);
     }
 
@@ -54,12 +54,12 @@
     // If the result is ASYNC_WAIT_FINISHED then it's possible that the handler has
     // already destroyed this object.  So take care to only dereference it if the wait
     // is still live.
-    if (result == ASYNC_WAIT_AGAIN && status == MX_OK &&
-        self->deadline() != MX_TIME_INFINITE) {
-        mx_status_t post_status = async_post_task(async, self);
-        if (post_status != MX_OK) {
+    if (result == ASYNC_WAIT_AGAIN && status == ZX_OK &&
+        self->deadline() != ZX_TIME_INFINITE) {
+        zx_status_t post_status = async_post_task(async, self);
+        if (post_status != ZX_OK) {
             // The loop is being destroyed.
-            MX_DEBUG_ASSERT_MSG(post_status == MX_ERR_BAD_STATE,
+            ZX_DEBUG_ASSERT_MSG(post_status == ZX_ERR_BAD_STATE,
                                 "post_status=%d", post_status);
             return ASYNC_WAIT_FINISHED;
         }
@@ -68,16 +68,16 @@
 }
 
 async_task_result_t WaitWithTimeout::TimeoutHandler(async_t* async, async_task_t* task,
-                                                    mx_status_t status) {
-    MX_DEBUG_ASSERT(status == MX_OK);
+                                                    zx_status_t status) {
+    ZX_DEBUG_ASSERT(status == ZX_OK);
 
     auto self = static_cast<WaitWithTimeout*>(task);
-    mx_status_t cancel_status = async_cancel_wait(async, self);
-    MX_DEBUG_ASSERT_MSG(cancel_status == MX_OK,
+    zx_status_t cancel_status = async_cancel_wait(async, self);
+    ZX_DEBUG_ASSERT_MSG(cancel_status == ZX_OK,
                         "cancel_status=%d", cancel_status);
 
-    async_wait_result_t result = self->handler_(async, MX_ERR_TIMED_OUT, nullptr);
-    MX_DEBUG_ASSERT(result == ASYNC_WAIT_FINISHED);
+    async_wait_result_t result = self->handler_(async, ZX_ERR_TIMED_OUT, nullptr);
+    ZX_DEBUG_ASSERT(result == ASYNC_WAIT_FINISHED);
     return ASYNC_TASK_FINISHED;
 }
 
diff --git a/system/ulib/audio-proto-utils/BUILD.gn b/system/ulib/audio-proto-utils/BUILD.gn
index de164f7..33172bc 100644
--- a/system/ulib/audio-proto-utils/BUILD.gn
+++ b/system/ulib/audio-proto-utils/BUILD.gn
@@ -7,14 +7,14 @@
 }
 
 source_set("audio-proto-utils") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "format-utils.cpp",
     "include/audio-proto-utils/format-utils.h",
   ]
 
   public_deps = [
-    "//magenta/system/ulib/fbl",
+    "//zircon/system/ulib/fbl",
   ]
 
   public_configs = [ ":audio-proto-utils-config" ]
diff --git a/system/ulib/audio-proto-utils/format-utils.cpp b/system/ulib/audio-proto-utils/format-utils.cpp
index 29f8a58..43b6a05 100644
--- a/system/ulib/audio-proto-utils/format-utils.cpp
+++ b/system/ulib/audio-proto-utils/format-utils.cpp
@@ -138,7 +138,7 @@
 
 void FrameRateEnumerator::iterator::Advance() {
     if (enumerator_ == nullptr) {
-        MX_DEBUG_ASSERT(!cur_rate_ && !cur_flag_ && !fmt_ndx_);
+        ZX_DEBUG_ASSERT(!cur_rate_ && !cur_flag_ && !fmt_ndx_);
         return;
     }
 
@@ -152,7 +152,7 @@
             rates = RATES_48000_FAMILY;
             rates_count = sizeof(RATES_48000_FAMILY);
         } else {
-            MX_DEBUG_ASSERT(cur_flag_ == ASF_RANGE_FLAG_FPS_44100_FAMILY);
+            ZX_DEBUG_ASSERT(cur_flag_ == ASF_RANGE_FLAG_FPS_44100_FAMILY);
             rates = RATES_44100_FAMILY;
             rates_count = sizeof(RATES_44100_FAMILY);
         }
diff --git a/system/ulib/audio-proto-utils/include/audio-proto-utils/format-utils.h b/system/ulib/audio-proto-utils/include/audio-proto-utils/format-utils.h
index 1eb2cb5..936558a 100644
--- a/system/ulib/audio-proto-utils/include/audio-proto-utils/format-utils.h
+++ b/system/ulib/audio-proto-utils/include/audio-proto-utils/format-utils.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/assert.h>
-#include <magenta/device/audio.h>
-#include <magenta/types.h>
+#include <zircon/assert.h>
+#include <zircon/device/audio.h>
+#include <zircon/types.h>
 #include <string.h>
 
 namespace audio {
@@ -53,7 +53,7 @@
 
         uint32_t operator*() {
             // No one should be dereferencing us if we are currently invalid.
-            MX_DEBUG_ASSERT(enumerator_ != nullptr);
+            ZX_DEBUG_ASSERT(enumerator_ != nullptr);
             return cur_rate_;
         }
 
diff --git a/system/ulib/audio-utils/BUILD.gn b/system/ulib/audio-utils/BUILD.gn
index 4dceb72..61b3b5d 100644
--- a/system/ulib/audio-utils/BUILD.gn
+++ b/system/ulib/audio-utils/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 source_set("audio-utils") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "audio-device-stream.cpp",
     "audio-input.cpp",
@@ -19,9 +19,9 @@
   ]
 
   public_deps = [
-    "//magenta/system/ulib/mx",
-    "//magenta/system/ulib/mxcpp",
-    "//magenta/system/ulib/fbl",
+    "//zircon/system/ulib/zx",
+    "//zircon/system/ulib/zxcpp",
+    "//zircon/system/ulib/fbl",
   ]
 
   public_configs = [ ":audio-utils-config" ]
diff --git a/system/ulib/audio-utils/audio-device-stream.cpp b/system/ulib/audio-utils/audio-device-stream.cpp
index bed2525..b9f39ed 100644
--- a/system/ulib/audio-utils/audio-device-stream.cpp
+++ b/system/ulib/audio-utils/audio-device-stream.cpp
@@ -7,33 +7,33 @@
 #include <audio-utils/audio-output.h>
 #include <fcntl.h>
 #include <inttypes.h>
-#include <magenta/assert.h>
-#include <magenta/device/audio.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <mx/channel.h>
-#include <mx/handle.h>
-#include <mx/vmo.h>
+#include <zircon/assert.h>
+#include <zircon/device/audio.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zx/channel.h>
+#include <zx/handle.h>
+#include <zx/vmo.h>
 #include <fbl/algorithm.h>
 #include <fbl/auto_call.h>
 #include <fbl/limits.h>
-#include <mxio/io.h>
+#include <fdio/io.h>
 #include <stdio.h>
 #include <string.h>
 
 namespace audio {
 namespace utils {
 
-static constexpr mx_duration_t CALL_TIMEOUT = MX_MSEC(500);
+static constexpr zx_duration_t CALL_TIMEOUT = ZX_MSEC(500);
 template <typename ReqType, typename RespType>
-mx_status_t DoCallImpl(const mx::channel& channel,
+zx_status_t DoCallImpl(const zx::channel& channel,
                        const ReqType&     req,
                        RespType*          resp,
-                       mx::handle*        resp_handle_out,
+                       zx::handle*        resp_handle_out,
                        uint32_t*          resp_len_out = nullptr) {
-    mx_channel_call_args_t args;
+    zx_channel_call_args_t args;
 
-    MX_DEBUG_ASSERT((resp_handle_out == nullptr) || !resp_handle_out->is_valid());
+    ZX_DEBUG_ASSERT((resp_handle_out == nullptr) || !resp_handle_out->is_valid());
 
     args.wr_bytes       = const_cast<ReqType*>(&req);
     args.wr_num_bytes   = sizeof(ReqType);
@@ -45,13 +45,13 @@
     args.rd_num_handles = resp_handle_out ? 1 : 0;
 
     uint32_t bytes, handles;
-    mx_status_t read_status, write_status;
+    zx_status_t read_status, write_status;
 
-    write_status = channel.call(0, mx_deadline_after(CALL_TIMEOUT), &args, &bytes, &handles,
+    write_status = channel.call(0, zx_deadline_after(CALL_TIMEOUT), &args, &bytes, &handles,
                                 &read_status);
 
-    if (write_status != MX_OK) {
-        if (write_status == MX_ERR_CALL_FAILED) {
+    if (write_status != ZX_OK) {
+        if (write_status == ZX_ERR_CALL_FAILED) {
             printf("Cmd read failure (cmd %04x, res %d)\n", req.hdr.cmd, read_status);
             return read_status;
         } else {
@@ -69,26 +69,26 @@
     } else
     if (bytes != sizeof(RespType)) {
         printf("Unexpected response size (got %u, expected %zu)\n", bytes, sizeof(RespType));
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 template <typename ReqType, typename RespType>
-mx_status_t DoCall(const mx::channel& channel,
+zx_status_t DoCall(const zx::channel& channel,
                    const ReqType&     req,
                    RespType*          resp,
-                   mx::handle*        resp_handle_out = nullptr) {
-    mx_status_t res = DoCallImpl(channel, req, resp, resp_handle_out);
-    return (res != MX_OK) ? res : resp->result;
+                   zx::handle*        resp_handle_out = nullptr) {
+    zx_status_t res = DoCallImpl(channel, req, resp, resp_handle_out);
+    return (res != ZX_OK) ? res : resp->result;
 }
 
 template <typename ReqType, typename RespType>
-mx_status_t DoNoFailCall(const mx::channel& channel,
+zx_status_t DoNoFailCall(const zx::channel& channel,
                          const ReqType&     req,
                          RespType*          resp,
-                         mx::handle*        resp_handle_out = nullptr) {
+                         zx::handle*        resp_handle_out = nullptr) {
     return DoCallImpl(channel, req, resp, resp_handle_out);
 }
 
@@ -105,9 +105,9 @@
     name_[sizeof(name_) - 1] = 0;
 }
 
-mx_status_t AudioDeviceStream::Open() {
-    if (stream_ch_ != MX_HANDLE_INVALID)
-        return MX_ERR_BAD_STATE;
+zx_status_t AudioDeviceStream::Open() {
+    if (stream_ch_ != ZX_HANDLE_INVALID)
+        return ZX_ERR_BAD_STATE;
 
     int fd = ::open(name(), O_RDONLY);
     if (fd < 0) {
@@ -115,35 +115,35 @@
         return fd;
     }
 
-    ssize_t res = ::mxio_ioctl(fd, AUDIO_IOCTL_GET_CHANNEL,
+    ssize_t res = ::fdio_ioctl(fd, AUDIO_IOCTL_GET_CHANNEL,
                                nullptr, 0,
                                &stream_ch_, sizeof(stream_ch_));
     ::close(fd);
 
     if (res != sizeof(stream_ch_)) {
         printf("Failed to obtain channel (res %zd)\n", res);
-        return static_cast<mx_status_t>(res);
+        return static_cast<zx_status_t>(res);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t AudioDeviceStream::GetSupportedFormats(
+zx_status_t AudioDeviceStream::GetSupportedFormats(
         fbl::Vector<audio_stream_format_range_t>* out_formats) const {
     constexpr uint32_t MIN_RESP_SIZE = offsetof(audio_stream_cmd_get_formats_resp_t, format_ranges);
     audio_stream_cmd_get_formats_req req;
     audio_stream_cmd_get_formats_resp resp;
     uint32_t rxed;
-    mx_status_t res;
+    zx_status_t res;
 
     if (out_formats == nullptr) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     req.hdr.cmd = AUDIO_STREAM_CMD_GET_FORMATS;
     req.hdr.transaction_id = 1;
     res = DoCallImpl(stream_ch_, req, &resp, nullptr, &rxed);
-    if ((res != MX_OK) || (rxed < MIN_RESP_SIZE)) {
+    if ((res != ZX_OK) || (rxed < MIN_RESP_SIZE)) {
         printf("Failed to fetch initial suppored format list chunk (res %d, rxed %u)\n",
                 res, rxed);
         return res;
@@ -151,37 +151,37 @@
 
     uint32_t expected_formats = resp.format_range_count;
     if (!expected_formats)
-        return MX_OK;
+        return ZX_OK;
 
     out_formats->reset();
     fbl::AllocChecker ac;
     out_formats->reserve(expected_formats, &ac);
     if (!ac.check()) {
         printf("Failed to allocated %u entries for format ranges\n", expected_formats);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
-    mx_txid_t txid = resp.hdr.transaction_id;
+    zx_txid_t txid = resp.hdr.transaction_id;
     uint32_t processed_formats = 0;
     while (true) {
         if (resp.hdr.cmd != AUDIO_STREAM_CMD_GET_FORMATS) {
             printf("Unexpected response command while fetching formats "
                    "(expected 0x%08x, got 0x%08x)\n",
                     AUDIO_STREAM_CMD_GET_FORMATS, resp.hdr.cmd);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
 
         if (resp.hdr.transaction_id != txid) {
             printf("Unexpected response transaction id while fetching formats "
                    "(expected 0x%08x, got 0x%08x)\n",
                     txid, resp.hdr.transaction_id);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
 
         if (resp.first_format_range_ndx != processed_formats) {
             printf("Bad format index while fetching formats (expected %u, got %hu)\n",
                     processed_formats, resp.first_format_range_ndx);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
 
         uint32_t todo = fbl::min(static_cast<uint32_t>(expected_formats - processed_formats),
@@ -189,7 +189,7 @@
         size_t min_size = MIN_RESP_SIZE + (todo * sizeof(audio_stream_format_range_t));
         if (rxed < min_size) {
             printf("Short response while fetching formats (%u < %zu)\n", rxed, min_size);
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
 
         for (uint16_t i = 0; i < todo; ++i) {
@@ -200,38 +200,38 @@
         if (processed_formats == expected_formats)
             break;
 
-        mx_signals_t pending_sig;
-        res = stream_ch_.wait_one(MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                                  mx_deadline_after(CALL_TIMEOUT),
+        zx_signals_t pending_sig;
+        res = stream_ch_.wait_one(ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                                  zx_deadline_after(CALL_TIMEOUT),
                                   &pending_sig);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to wait for next response after processing %u/%u formats (res %d)\n",
                     processed_formats, expected_formats, res);
             return res;
         }
 
         res = stream_ch_.read(0u, &resp, sizeof(resp), &rxed, nullptr, 0, nullptr);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to read next response after processing %u/%u formats (res %d)\n",
                     processed_formats, expected_formats, res);
             return res;
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t AudioDeviceStream::GetPlugState(audio_stream_cmd_plug_detect_resp_t* out_state,
+zx_status_t AudioDeviceStream::GetPlugState(audio_stream_cmd_plug_detect_resp_t* out_state,
                                             bool enable_notify) const {
-    MX_DEBUG_ASSERT(out_state != nullptr);
+    ZX_DEBUG_ASSERT(out_state != nullptr);
     audio_stream_cmd_plug_detect_req req;
 
     req.hdr.cmd = AUDIO_STREAM_CMD_PLUG_DETECT;
     req.hdr.transaction_id = 1;
     req.flags = enable_notify ? AUDIO_PDF_ENABLE_NOTIFICATIONS : AUDIO_PDF_NONE;
 
-    mx_status_t res = DoNoFailCall(stream_ch_, req, out_state);
-    if (res != MX_OK)
+    zx_status_t res = DoNoFailCall(stream_ch_, req, out_state);
+    if (res != ZX_OK)
         printf("Failed to fetch plug detect information! (res %d)\n", res);
 
     return res;
@@ -247,7 +247,7 @@
     stream_ch_.write(0, &req, sizeof(req), nullptr, 0);
 }
 
-mx_status_t AudioDeviceStream::SetMute(bool mute) {
+zx_status_t AudioDeviceStream::SetMute(bool mute) {
     audio_stream_cmd_set_gain_req  req;
     audio_stream_cmd_set_gain_resp resp;
 
@@ -257,8 +257,8 @@
               ? static_cast<audio_set_gain_flags_t>(AUDIO_SGF_MUTE_VALID | AUDIO_SGF_MUTE)
               : AUDIO_SGF_MUTE_VALID;
 
-    mx_status_t res = DoCall(stream_ch_, req, &resp);
-    if (res != MX_OK)
+    zx_status_t res = DoCall(stream_ch_, req, &resp);
+    if (res != ZX_OK)
         printf("Failed to %smute stream! (res %d)\n", mute ? "" : "un", res);
     else
         printf("Stream is now %smuted\n", mute ? "" : "un");
@@ -266,7 +266,7 @@
     return res;
 }
 
-mx_status_t AudioDeviceStream::SetGain(float gain) {
+zx_status_t AudioDeviceStream::SetGain(float gain) {
     audio_stream_cmd_set_gain_req  req;
     audio_stream_cmd_set_gain_resp resp;
 
@@ -275,8 +275,8 @@
     req.flags = AUDIO_SGF_GAIN_VALID;
     req.gain  = gain;
 
-    mx_status_t res = DoCall(stream_ch_, req, &resp);
-    if (res != MX_OK) {
+    zx_status_t res = DoCall(stream_ch_, req, &resp);
+    if (res != ZX_OK) {
         printf("Failed to set gain to %.2f dB! (res %d)\n", gain, res);
     } else {
         printf("Gain is now %.2f dB.  Stream is %smuted.\n",
@@ -286,9 +286,9 @@
     return res;
 }
 
-mx_status_t AudioDeviceStream::GetGain(audio_stream_cmd_get_gain_resp_t* out_gain) const {
+zx_status_t AudioDeviceStream::GetGain(audio_stream_cmd_get_gain_resp_t* out_gain) const {
     if (out_gain == nullptr)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     audio_stream_cmd_get_gain_req req;
     req.hdr.cmd = AUDIO_STREAM_CMD_GET_GAIN;
@@ -297,28 +297,28 @@
     return DoNoFailCall(stream_ch_, req, out_gain);
 }
 
-mx_status_t AudioDeviceStream::PlugMonitor(float duration) {
-    mx_time_t deadline = mx_deadline_after(MX_SEC(static_cast<double>(duration)));
+zx_status_t AudioDeviceStream::PlugMonitor(float duration) {
+    zx_time_t deadline = zx_deadline_after(ZX_SEC(static_cast<double>(duration)));
     audio_stream_cmd_plug_detect_resp resp;
-    mx_status_t res = GetPlugState(&resp, true);
-    if (res != MX_OK)
+    zx_status_t res = GetPlugState(&resp, true);
+    if (res != ZX_OK)
         return res;
 
-    mx_time_t last_plug_time = resp.plug_state_time;
+    zx_time_t last_plug_time = resp.plug_state_time;
     bool last_plug_state = (resp.flags & AUDIO_PDNF_PLUGGED);
     printf("Initial plug state is : %s.\n", last_plug_state ? "plugged" : "unplugged");
 
     if (resp.flags & AUDIO_PDNF_HARDWIRED) {
         printf("Stream reports that it is hardwired, Monitoring is not possible.\n");
-        return MX_OK;
+        return ZX_OK;
 
     }
 
     auto ReportPlugState = [&last_plug_time, &last_plug_state](bool plug_state,
-                                                               mx_time_t plug_time) {
+                                                               zx_time_t plug_time) {
         printf("Plug State now : %s (%.3lf sec since last change).\n",
                plug_state ? "plugged" : "unplugged",
-               static_cast<double>(plug_time - last_plug_time) / MX_SEC(1));
+               static_cast<double>(plug_time - last_plug_time) / ZX_SEC(1));
 
         last_plug_state = plug_state;
         last_plug_time  = plug_time;
@@ -330,26 +330,26 @@
 
         auto cleanup = fbl::MakeAutoCall([this]() { DisablePlugNotifications(); });
         while (true) {
-            mx_signals_t pending;
-            res = stream_ch_.wait_one(MX_CHANNEL_PEER_CLOSED | MX_CHANNEL_READABLE,
+            zx_signals_t pending;
+            res = stream_ch_.wait_one(ZX_CHANNEL_PEER_CLOSED | ZX_CHANNEL_READABLE,
                                       deadline, &pending);
 
-            if ((res != MX_OK) || (pending & MX_CHANNEL_PEER_CLOSED)) {
-                if (res != MX_ERR_TIMED_OUT)
+            if ((res != ZX_OK) || (pending & ZX_CHANNEL_PEER_CLOSED)) {
+                if (res != ZX_ERR_TIMED_OUT)
                     printf("Error while waiting for plug notification (res %d)\n", res);
 
-                if (pending & MX_CHANNEL_PEER_CLOSED)
+                if (pending & ZX_CHANNEL_PEER_CLOSED)
                     printf("Peer closed while waiting for plug notification\n");
 
                 break;
             }
 
-            MX_DEBUG_ASSERT(pending & MX_CHANNEL_READABLE);
+            ZX_DEBUG_ASSERT(pending & ZX_CHANNEL_READABLE);
 
             audio_stream_plug_detect_notify_t state;
             uint32_t bytes_read;
             res = stream_ch_.read(0, &state, sizeof(state), &bytes_read, nullptr, 0, nullptr);
-            if (res != MX_OK) {
+            if (res != ZX_OK) {
                 printf("Read failure while waiting for plug notification (res %d)\n", res);
                 break;
             }
@@ -371,27 +371,27 @@
                 duration);
 
         while (true) {
-            mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+            zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
             if (now >= deadline)
                 break;
 
-            mx_time_t next_wake = fbl::min(deadline, now + MX_MSEC(100u));
+            zx_time_t next_wake = fbl::min(deadline, now + ZX_MSEC(100u));
 
-            mx_signals_t sigs;
-            mx_status_t res = stream_ch_.wait_one(MX_CHANNEL_PEER_CLOSED, next_wake, &sigs);
+            zx_signals_t sigs;
+            zx_status_t res = stream_ch_.wait_one(ZX_CHANNEL_PEER_CLOSED, next_wake, &sigs);
 
-            if ((res != MX_OK) && (res != MX_ERR_TIMED_OUT)) {
+            if ((res != ZX_OK) && (res != ZX_ERR_TIMED_OUT)) {
                 printf("Error waiting on stream channel (res %d)\n", res);
                 break;
             }
 
-            if (sigs & MX_CHANNEL_PEER_CLOSED) {
+            if (sigs & ZX_CHANNEL_PEER_CLOSED) {
                 printf("Peer closed connection while polling plug state\n");
                 break;
             }
 
             res = GetPlugState(&resp, true);
-            if (res != MX_OK) {
+            if (res != ZX_OK) {
                 printf("Failed to poll plug state (res %d)\n", res);
                 break;
             }
@@ -404,14 +404,14 @@
 
     printf("Monitoring finished.\n");
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t AudioDeviceStream::SetFormat(uint32_t frames_per_second,
+zx_status_t AudioDeviceStream::SetFormat(uint32_t frames_per_second,
                                          uint16_t channels,
                                          audio_sample_format_t sample_format) {
-    if ((stream_ch_ == MX_HANDLE_INVALID) || (rb_ch_ != MX_HANDLE_INVALID))
-        return MX_ERR_BAD_STATE;
+    if ((stream_ch_ == ZX_HANDLE_INVALID) || (rb_ch_ != ZX_HANDLE_INVALID))
+        return ZX_ERR_BAD_STATE;
 
     auto noflag_format = static_cast<audio_sample_format_t>(
             (sample_format & ~AUDIO_SAMPLE_FORMAT_FLAG_MASK));
@@ -424,7 +424,7 @@
     case AUDIO_SAMPLE_FORMAT_24BIT_IN32:
     case AUDIO_SAMPLE_FORMAT_32BIT:
     case AUDIO_SAMPLE_FORMAT_32BIT_FLOAT:  sample_size_ = 4; break;
-    default: return MX_ERR_NOT_SUPPORTED;
+    default: return ZX_ERR_NOT_SUPPORTED;
     }
 
     channel_cnt_   = channels;
@@ -440,9 +440,9 @@
     req.channels           = channels;
     req.sample_format      = sample_format;
 
-    mx::handle tmp;
-    mx_status_t res = DoCall(stream_ch_, req, &resp, &tmp);
-    if (res != MX_OK) {
+    zx::handle tmp;
+    zx_status_t res = DoCall(stream_ch_, req, &resp, &tmp);
+    if (res != ZX_OK) {
         printf("Failed to set format %uHz %hu-Ch fmt 0x%x (res %d)\n",
                 frames_per_second, channels, sample_format, res);
     }
@@ -454,14 +454,14 @@
     return res;
 }
 
-mx_status_t AudioDeviceStream::GetBuffer(uint32_t frames, uint32_t irqs_per_ring) {
-    mx_status_t res;
+zx_status_t AudioDeviceStream::GetBuffer(uint32_t frames, uint32_t irqs_per_ring) {
+    zx_status_t res;
 
     if(!frames)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     if (!rb_ch_.is_valid() || rb_vmo_.is_valid() || !frame_sz_)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     // Stash the FIFO depth, in case users need to know it.
     {
@@ -471,7 +471,7 @@
         req.hdr.cmd = AUDIO_RB_CMD_GET_FIFO_DEPTH;
         req.hdr.transaction_id = 1;
         res = DoCall(rb_ch_, req, &resp);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to fetch fifo depth (res %d)\n", res);
             return res;
         }
@@ -489,13 +489,13 @@
         req.min_ring_buffer_frames = frames;
         req.notifications_per_ring = irqs_per_ring;
 
-        mx::handle tmp;
+        zx::handle tmp;
         res = DoCall(rb_ch_, req, &resp, &tmp);
 
-        if ((res == MX_OK) && (resp.result != MX_OK))
+        if ((res == ZX_OK) && (resp.result != ZX_OK))
             res = resp.result;
 
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to get driver ring buffer VMO (res %d)\n", res);
             return res;
         }
@@ -507,7 +507,7 @@
     // We have the buffer, fetch the size the driver finally decided on.
     uint64_t rb_sz;
     res = rb_vmo_.get_size(&rb_sz);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to fetch ring buffer VMO size (res %d)\n", res);
         return res;
     }
@@ -516,7 +516,7 @@
     if ((rb_sz > fbl::numeric_limits<decltype(rb_sz_)>::max()) || ((rb_sz % frame_sz_) != 0)) {
         printf("Bad VMO size returned by audio driver! (size = %" PRIu64 " frame_sz = %u)\n",
                 rb_sz, frame_sz_);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     rb_sz_ = static_cast<decltype(rb_sz_)>(rb_sz);
@@ -524,12 +524,12 @@
     // Map the VMO into our address space
     // TODO(johngro) : How do I specify the cache policy for this mapping?
     uint32_t flags = input_
-                   ? MX_VM_FLAG_PERM_READ
-                   : MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE;
-    res = mx_vmar_map(mx_vmar_root_self(), 0u,
+                   ? ZX_VM_FLAG_PERM_READ
+                   : ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE;
+    res = zx_vmar_map(zx_vmar_root_self(), 0u,
                       rb_vmo_.get(), 0u, rb_sz_,
                       flags, reinterpret_cast<uintptr_t*>(&rb_virt_));
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to map ring buffer VMO (res %d)\n", res);
         return res;
     }
@@ -539,12 +539,12 @@
         memset(rb_virt_, 0, rb_sz_);
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t AudioDeviceStream::StartRingBuffer() {
-    if (rb_ch_ == MX_HANDLE_INVALID)
-        return MX_ERR_BAD_STATE;
+zx_status_t AudioDeviceStream::StartRingBuffer() {
+    if (rb_ch_ == ZX_HANDLE_INVALID)
+        return ZX_ERR_BAD_STATE;
 
     audio_rb_cmd_start_req_t  req;
     audio_rb_cmd_start_resp_t resp;
@@ -552,18 +552,18 @@
     req.hdr.cmd = AUDIO_RB_CMD_START;
     req.hdr.transaction_id = 1;
 
-    mx_status_t res = DoCall(rb_ch_, req, &resp);
+    zx_status_t res = DoCall(rb_ch_, req, &resp);
 
-    if (res == MX_OK) {
+    if (res == ZX_OK) {
         start_ticks_ = resp.start_ticks;
     }
 
     return res;
 }
 
-mx_status_t AudioDeviceStream::StopRingBuffer() {
-    if (rb_ch_ == MX_HANDLE_INVALID)
-        return MX_ERR_BAD_STATE;
+zx_status_t AudioDeviceStream::StopRingBuffer() {
+    if (rb_ch_ == ZX_HANDLE_INVALID)
+        return ZX_ERR_BAD_STATE;
 
     start_ticks_ = 0;
 
@@ -584,12 +584,12 @@
 }
 
 
-bool AudioDeviceStream::IsChannelConnected(const mx::channel& ch) {
+bool AudioDeviceStream::IsChannelConnected(const zx::channel& ch) {
     if (!ch.is_valid())
         return false;
 
-    mx_signals_t junk;
-    return ch.wait_one(MX_CHANNEL_PEER_CLOSED, 0u, &junk) != MX_ERR_TIMED_OUT;
+    zx_signals_t junk;
+    return ch.wait_one(ZX_CHANNEL_PEER_CLOSED, 0u, &junk) != ZX_ERR_TIMED_OUT;
 }
 
 
diff --git a/system/ulib/audio-utils/audio-input.cpp b/system/ulib/audio-utils/audio-input.cpp
index aaf8ff2..c54ffe9 100644
--- a/system/ulib/audio-utils/audio-input.cpp
+++ b/system/ulib/audio-utils/audio-input.cpp
@@ -11,7 +11,7 @@
 namespace audio {
 namespace utils {
 
-static constexpr mx_time_t CHUNK_TIME = MX_MSEC(100);
+static constexpr zx_time_t CHUNK_TIME = ZX_MSEC(100);
 static constexpr float MIN_DURATION = 0.100f;
 static constexpr float MAX_DURATION = 86400.0f;
 
@@ -31,7 +31,7 @@
     return res;
 }
 
-mx_status_t AudioInput::Record(AudioSink& sink, float duration_seconds) {
+zx_status_t AudioInput::Record(AudioSink& sink, float duration_seconds) {
     AudioStream::Format fmt = {
         .frame_rate = frame_rate_,
         .channels = static_cast<uint16_t>(channel_cnt_),
@@ -40,14 +40,14 @@
 
     duration_seconds = fbl::clamp(duration_seconds, MIN_DURATION, MAX_DURATION);
 
-    mx_status_t res = sink.SetFormat(fmt);
-    if (res != MX_OK) {
+    zx_status_t res = sink.SetFormat(fmt);
+    if (res != ZX_OK) {
         printf("Failed to set sink format (rate %u, chan_count %u, fmt 0x%08x, res %d)\n",
                 frame_rate_, channel_cnt_, sample_format_, res);
         return res;
     }
 
-    uint64_t ring_bytes_64 = ((CHUNK_TIME * frame_rate_) / MX_SEC(1)) * frame_sz_;
+    uint64_t ring_bytes_64 = ((CHUNK_TIME * frame_rate_) / ZX_SEC(1)) * frame_sz_;
     if (ring_bytes_64 > fbl::numeric_limits<uint32_t>::max()) {
         printf("Invalid frame rate %u\n", frame_rate_);
         return res;
@@ -57,19 +57,19 @@
     uint32_t ring_frames = ring_bytes / frame_sz_;
 
     res = GetBuffer(ring_frames, 2u);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to establish ring buffer (%u frames, res %d)\n",
                 ring_frames, res);
         return res;
     }
 
-    mx_time_t duration_nsec = static_cast<mx_time_t>(MX_SEC(1)
+    zx_time_t duration_nsec = static_cast<zx_time_t>(ZX_SEC(1)
                             * static_cast<double>(duration_seconds));
-    mx_time_t stop_time = mx_time_get(MX_CLOCK_MONOTONIC) + duration_nsec;
+    zx_time_t stop_time = zx_time_get(ZX_CLOCK_MONOTONIC) + duration_nsec;
     printf("Recording for %.1f seconds\n", duration_seconds);
 
     res = StartRingBuffer();
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to start capture (res %d)\n", res);
         return res;
     }
@@ -77,20 +77,20 @@
     uint32_t  rd_ptr = 0;
     bool      peer_connected = true;
     while (true) {
-        mx_signals_t sigs;
+        zx_signals_t sigs;
 
-        res = rb_ch_.wait_one(MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
+        res = rb_ch_.wait_one(ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
                               stop_time, &sigs);
 
         // If we get a timeout error, we have hit our stop time.
-        if (res == MX_ERR_TIMED_OUT) break;
+        if (res == ZX_ERR_TIMED_OUT) break;
 
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to wait for notificiation (res %d)\n", res);
             break;
         }
 
-        if (sigs & MX_CHANNEL_PEER_CLOSED) {
+        if (sigs & ZX_CHANNEL_PEER_CLOSED) {
             printf("Peer closed connection during record!\n");
             peer_connected = false;
             break;
@@ -102,7 +102,7 @@
         res = rb_ch_.read(0,
                           &pos_notif, sizeof(pos_notif), &bytes_read,
                           nullptr, 0, &junk);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to read notification from ring buffer channel (res %d)\n", res);
             break;
         }
@@ -110,14 +110,14 @@
         if (bytes_read != sizeof(pos_notif)) {
             printf("Bad size when reading notification from ring buffer channel (%u != %zu)\n",
                    bytes_read, sizeof(pos_notif));
-            res = MX_ERR_INTERNAL;
+            res = ZX_ERR_INTERNAL;
             break;
         }
 
         if (pos_notif.hdr.cmd != AUDIO_RB_POSITION_NOTIFY) {
             printf("Unexpected command type when reading notification from ring "
                    "buffer channel (cmd %04x)\n", pos_notif.hdr.cmd);
-            res = MX_ERR_INTERNAL;
+            res = ZX_ERR_INTERNAL;
             break;
         }
 
@@ -125,25 +125,25 @@
         if (todo >= rb_sz_)
             todo -= rb_sz_;
 
-        MX_DEBUG_ASSERT(todo < rb_sz_);
-        MX_DEBUG_ASSERT(rd_ptr < rb_sz_);
+        ZX_DEBUG_ASSERT(todo < rb_sz_);
+        ZX_DEBUG_ASSERT(rd_ptr < rb_sz_);
 
         uint32_t space = rb_sz_ - rd_ptr;
         uint32_t amt = fbl::min(space, todo);
         auto data = static_cast<const uint8_t*>(rb_virt_) + rd_ptr;
 
         res = sink.PutFrames(data, amt);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to record %u bytes (res %d)\n", amt, res);
             break;
         }
 
         if (amt < todo) {
             amt = todo - amt;
-            MX_DEBUG_ASSERT(amt < ring_bytes);
+            ZX_DEBUG_ASSERT(amt < ring_bytes);
 
             res = sink.PutFrames(rb_virt_, amt);
-            if (res != MX_OK) {
+            if (res != ZX_OK) {
                 printf("Failed to record %u bytes (res %d)\n", amt, res);
                 break;
             }
@@ -152,7 +152,7 @@
         } else {
             rd_ptr += amt;
             if (rd_ptr >= ring_bytes) {
-                MX_DEBUG_ASSERT(rd_ptr == ring_bytes);
+                ZX_DEBUG_ASSERT(rd_ptr == ring_bytes);
                 rd_ptr = 0;
             }
         }
@@ -162,8 +162,8 @@
         StopRingBuffer();
     }
 
-    mx_status_t finalize_res = sink.Finalize();
-    return (res == MX_OK) ? finalize_res : res;
+    zx_status_t finalize_res = sink.Finalize();
+    return (res == ZX_OK) ? finalize_res : res;
 }
 
 }  // namespace utils
diff --git a/system/ulib/audio-utils/audio-output.cpp b/system/ulib/audio-utils/audio-output.cpp
index ab5d7a5..64f21bd 100644
--- a/system/ulib/audio-utils/audio-output.cpp
+++ b/system/ulib/audio-utils/audio-output.cpp
@@ -4,7 +4,7 @@
 
 #include <audio-utils/audio-output.h>
 #include <audio-utils/audio-stream.h>
-#include <magenta/device/audio.h>
+#include <zircon/device/audio.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/limits.h>
@@ -30,21 +30,21 @@
     return res;
 }
 
-mx_status_t AudioOutput::Play(AudioSource& source) {
-    mx_status_t res;
+zx_status_t AudioOutput::Play(AudioSource& source) {
+    zx_status_t res;
 
     if (source.finished())
-        return MX_OK;
+        return ZX_OK;
 
     AudioSource::Format format;
     res = source.GetFormat(&format);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to get source's format (res %d)\n", res);
         return res;
     }
 
     res = SetFormat(format.frame_rate, format.channels, format.sample_format);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to set source format [%u Hz, %hu Chan, %08x fmt] (res %d)\n",
                 format.frame_rate, format.channels, format.sample_format, res);
         return res;
@@ -56,7 +56,7 @@
     // HW is going to require so we can adjust our buffer size to what the HW
     // requires, not what ALSA under QEMU requires.
     res = GetBuffer(480 * 20 * 3, 3);
-    if (res != MX_OK) {
+    if (res != ZX_OK) {
         printf("Failed to set output format (res %d)\n", res);
         return res;
     }
@@ -73,14 +73,14 @@
     while (true) {
         uint32_t bytes_read, junk;
         audio_rb_position_notify_t pos_notif;
-        mx_signals_t sigs;
+        zx_signals_t sigs;
 
         // Top up the buffer.  In theory, we should only need to loop 2 times in
         // order to handle a ring discontinuity
         for (uint32_t i = 0; i < 2; ++i) {
             uint32_t space = (rb_sz_ + rd - wr - 1) % rb_sz_;
             uint32_t todo  = fbl::min(space, rb_sz_ - wr);
-            MX_DEBUG_ASSERT(space < rb_sz_);
+            ZX_DEBUG_ASSERT(space < rb_sz_);
 
             if (!todo)
                 break;
@@ -91,7 +91,7 @@
             } else {
                 uint32_t done;
                 res = source.GetFrames(buf + wr, fbl::min(space, rb_sz_ - wr), &done);
-                if (res != MX_OK) {
+                if (res != ZX_OK) {
                     printf("Error packing frames (res %d)\n", res);
                     break;
                 }
@@ -111,32 +111,32 @@
             if (wr < rb_sz_)
                 break;
 
-            MX_DEBUG_ASSERT(wr == rb_sz_);
+            ZX_DEBUG_ASSERT(wr == rb_sz_);
             wr = 0;
         }
 
-        if (res != MX_OK)
+        if (res != ZX_OK)
             break;
 
         // If we have not started yet, do so.
         if (!started) {
             res = StartRingBuffer();
-            if (res != MX_OK) {
+            if (res != ZX_OK) {
                 printf("Failed to start ring buffer!\n");
                 break;
             }
             started = true;
         }
 
-        res = rb_ch_.wait_one(MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                              MX_TIME_INFINITE, &sigs);
+        res = rb_ch_.wait_one(ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                              ZX_TIME_INFINITE, &sigs);
 
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to wait for notificiation (res %d)\n", res);
             break;
         }
 
-        if (sigs & MX_CHANNEL_PEER_CLOSED) {
+        if (sigs & ZX_CHANNEL_PEER_CLOSED) {
             printf("Peer closed connection during playback!\n");
             break;
         }
@@ -144,7 +144,7 @@
         res = rb_ch_.read(0,
                           &pos_notif, sizeof(pos_notif), &bytes_read,
                           nullptr, 0, &junk);
-        if (res != MX_OK) {
+        if (res != ZX_OK) {
             printf("Failed to read notification from ring buffer channel (res %d)\n", res);
             break;
         }
@@ -152,14 +152,14 @@
         if (bytes_read != sizeof(pos_notif)) {
             printf("Bad size when reading notification from ring buffer channel (%u != %zu)\n",
                    bytes_read, sizeof(pos_notif));
-            res = MX_ERR_INTERNAL;
+            res = ZX_ERR_INTERNAL;
             break;
         }
 
         if (pos_notif.hdr.cmd != AUDIO_RB_POSITION_NOTIFY) {
             printf("Unexpected command type when reading notification from ring "
                    "buffer channel (cmd %04x)\n", pos_notif.hdr.cmd);
-            res = MX_ERR_INTERNAL;
+            res = ZX_ERR_INTERNAL;
             break;
         }
 
@@ -178,18 +178,18 @@
         }
     }
 
-    if (res == MX_OK) {
+    if (res == ZX_OK) {
         // We have already let the DMA engine catch up, but we still need to
         // wait for the fifo to play out.  For now, just hard code this as
         // 30uSec.
         //
         // TODO: base this on the start time and the number of frames queued
         // instead of just making a number up.
-        mx_nanosleep(mx_deadline_after(MX_MSEC(30)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(30)));
     }
 
-    mx_status_t stop_res = StopRingBuffer();
-    if (res == MX_OK)
+    zx_status_t stop_res = StopRingBuffer();
+    if (res == ZX_OK)
         res = stop_res;
 
     return res;
diff --git a/system/ulib/audio-utils/include/audio-utils/audio-device-stream.h b/system/ulib/audio-utils/include/audio-utils/audio-device-stream.h
index f0e4cf5..3cf48a9 100644
--- a/system/ulib/audio-utils/include/audio-utils/audio-device-stream.h
+++ b/system/ulib/audio-utils/include/audio-utils/audio-device-stream.h
@@ -4,10 +4,10 @@
 
 #pragma once
 
-#include <magenta/device/audio.h>
-#include <magenta/types.h>
-#include <mx/channel.h>
-#include <mx/vmo.h>
+#include <zircon/device/audio.h>
+#include <zircon/types.h>
+#include <zx/channel.h>
+#include <zx/vmo.h>
 #include <fbl/unique_ptr.h>
 #include <fbl/vector.h>
 
@@ -16,21 +16,21 @@
 
 class AudioDeviceStream {
 public:
-    mx_status_t Open();
-    mx_status_t GetSupportedFormats(fbl::Vector<audio_stream_format_range_t>* out_formats) const;
-    mx_status_t SetMute(bool mute);
-    mx_status_t SetGain(float gain);
-    mx_status_t GetGain(audio_stream_cmd_get_gain_resp_t* out_gain) const;
-    mx_status_t PlugMonitor(float duration);
-    mx_status_t SetFormat(uint32_t frames_per_second,
+    zx_status_t Open();
+    zx_status_t GetSupportedFormats(fbl::Vector<audio_stream_format_range_t>* out_formats) const;
+    zx_status_t SetMute(bool mute);
+    zx_status_t SetGain(float gain);
+    zx_status_t GetGain(audio_stream_cmd_get_gain_resp_t* out_gain) const;
+    zx_status_t PlugMonitor(float duration);
+    zx_status_t SetFormat(uint32_t frames_per_second,
                           uint16_t channels,
                           audio_sample_format_t sample_format);
-    mx_status_t GetBuffer(uint32_t frames, uint32_t irqs_per_ring);
-    mx_status_t StartRingBuffer();
-    mx_status_t StopRingBuffer();
+    zx_status_t GetBuffer(uint32_t frames, uint32_t irqs_per_ring);
+    zx_status_t StartRingBuffer();
+    zx_status_t StopRingBuffer();
     void        ResetRingBuffer();
 
-    mx_status_t GetPlugState(audio_stream_cmd_plug_detect_resp_t* out_state) const {
+    zx_status_t GetPlugState(audio_stream_cmd_plug_detect_resp_t* out_state) const {
         return GetPlugState(out_state, false);
     }
 
@@ -51,8 +51,8 @@
 protected:
     friend class fbl::unique_ptr<AudioDeviceStream>;
 
-    static bool IsChannelConnected(const mx::channel& ch);
-    mx_status_t GetPlugState(audio_stream_cmd_plug_detect_resp_t* out_state,
+    static bool IsChannelConnected(const zx::channel& ch);
+    zx_status_t GetPlugState(audio_stream_cmd_plug_detect_resp_t* out_state,
                              bool enable_notify) const;
     void        DisablePlugNotifications();
 
@@ -60,9 +60,9 @@
     AudioDeviceStream(bool input, const char* dev_path);
     virtual ~AudioDeviceStream() { }
 
-    mx::channel stream_ch_;
-    mx::channel rb_ch_;
-    mx::vmo     rb_vmo_;
+    zx::channel stream_ch_;
+    zx::channel rb_ch_;
+    zx::vmo     rb_vmo_;
 
     const bool  input_;
     char        name_[64] = { 0 };
diff --git a/system/ulib/audio-utils/include/audio-utils/audio-input.h b/system/ulib/audio-utils/include/audio-utils/audio-input.h
index 9946ba4..1e45983 100644
--- a/system/ulib/audio-utils/include/audio-utils/audio-input.h
+++ b/system/ulib/audio-utils/include/audio-utils/audio-input.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <audio-utils/audio-device-stream.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 namespace audio {
 namespace utils {
@@ -16,7 +16,7 @@
 public:
     static fbl::unique_ptr<AudioInput> Create(uint32_t dev_id);
     static fbl::unique_ptr<AudioInput> Create(const char* dev_path);
-    mx_status_t Record(AudioSink& sink, float duration_seconds);
+    zx_status_t Record(AudioSink& sink, float duration_seconds);
 
 private:
     friend class fbl::unique_ptr<AudioInput>;
diff --git a/system/ulib/audio-utils/include/audio-utils/audio-output.h b/system/ulib/audio-utils/include/audio-utils/audio-output.h
index 559b38a..8b56ee1 100644
--- a/system/ulib/audio-utils/include/audio-utils/audio-output.h
+++ b/system/ulib/audio-utils/include/audio-utils/audio-output.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <audio-utils/audio-device-stream.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 namespace audio {
 namespace utils {
@@ -16,7 +16,7 @@
 public:
     static fbl::unique_ptr<AudioOutput> Create(uint32_t dev_id);
     static fbl::unique_ptr<AudioOutput> Create(const char* dev_path);
-    mx_status_t Play(AudioSource& source);
+    zx_status_t Play(AudioSource& source);
 
 private:
     friend class fbl::unique_ptr<AudioOutput>;
diff --git a/system/ulib/audio-utils/include/audio-utils/audio-stream.h b/system/ulib/audio-utils/include/audio-utils/audio-stream.h
index ebc1347..7ee4263 100644
--- a/system/ulib/audio-utils/include/audio-utils/audio-stream.h
+++ b/system/ulib/audio-utils/include/audio-utils/audio-stream.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/types.h>
-#include <magenta/device/audio.h>
+#include <zircon/types.h>
+#include <zircon/device/audio.h>
 
 namespace audio {
 namespace utils {
@@ -21,16 +21,16 @@
 
 class AudioSource : public AudioStream {
 public:
-    virtual mx_status_t GetFormat(Format* out_format) = 0;
-    virtual mx_status_t GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed) = 0;
+    virtual zx_status_t GetFormat(Format* out_format) = 0;
+    virtual zx_status_t GetFrames(void* buffer, uint32_t buf_space, uint32_t* out_packed) = 0;
     virtual bool finished() const = 0;
 };
 
 class AudioSink : public AudioStream {
 public:
-    virtual mx_status_t SetFormat(const Format& format) = 0;
-    virtual mx_status_t PutFrames(const void* buffer, uint32_t amt) = 0;
-    virtual mx_status_t Finalize() = 0;
+    virtual zx_status_t SetFormat(const Format& format) = 0;
+    virtual zx_status_t PutFrames(const void* buffer, uint32_t amt) = 0;
+    virtual zx_status_t Finalize() = 0;
 };
 
 }  // namespace utils
diff --git a/system/ulib/audio-utils/rules.mk b/system/ulib/audio-utils/rules.mk
index b3a591b..8e3c442 100644
--- a/system/ulib/audio-utils/rules.mk
+++ b/system/ulib/audio-utils/rules.mk
@@ -14,8 +14,8 @@
     $(LOCAL_DIR)/audio-output.cpp
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
-    system/ulib/mxio \
+    system/ulib/zx \
+    system/ulib/fdio \
     system/ulib/fbl
 
 include make/module.mk
diff --git a/system/ulib/bcm/dma.c b/system/ulib/bcm/dma.c
index 3410fc1..ec09cf5 100644
--- a/system/ulib/bcm/dma.c
+++ b/system/ulib/bcm/dma.c
@@ -7,10 +7,10 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/compiler.h>
-#include <magenta/assert.h>
-#include <magenta/syscalls.h>
-#include <magenta/threads.h>
+#include <zircon/compiler.h>
+#include <zircon/assert.h>
+#include <zircon/syscalls.h>
+#include <zircon/threads.h>
 
 #include <ddk/binding.h>
 #include <ddk/device.h>
@@ -37,19 +37,19 @@
 
 static int dma_irq_thread(void* arg) {
     bcm_dma_t* dma = arg;
-    mx_handle_t irq_handle = dma->irq_handle;
+    zx_handle_t irq_handle = dma->irq_handle;
     xprintf("dma interrupt thread started\n");
 
-    mx_status_t stat;
+    zx_status_t stat;
 
     while (!dma->irq_thrd_stop) {
 
-        mx_interrupt_complete(irq_handle);
-        stat = mx_interrupt_wait(irq_handle);
-        MX_DEBUG_ASSERT(stat == MX_OK);
+        zx_interrupt_complete(irq_handle);
+        stat = zx_interrupt_wait(irq_handle);
+        ZX_DEBUG_ASSERT(stat == ZX_OK);
 
         dma_regs->channels[dma->ch_num].cs |= BCM_DMA_CS_INT;
-        if (stat != MX_OK) {
+        if (stat != ZX_OK) {
             xprintf("dma interrupt wait failed = %d\n", stat);
             break;
         }
@@ -64,30 +64,30 @@
     return 0;
 }
 
-mx_status_t bcm_dma_init(bcm_dma_t* dma, uint32_t ch) {
+zx_status_t bcm_dma_init(bcm_dma_t* dma, uint32_t ch) {
 
     xprintf("Initializing dma channel %u\n", ch);
-    mx_status_t status;
-    mx_handle_t irq_handle = MX_HANDLE_INVALID;
+    zx_status_t status;
+    zx_handle_t irq_handle = ZX_HANDLE_INVALID;
 
     mtx_lock(&dma->dma_lock);
 
     if (dma->state > BCM_DMA_STATE_SHUTDOWN) {
         mtx_unlock(&dma->dma_lock);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     static_assert(BCM_DMA_MAX_CH < countof(dma_regs->channels),
                             "DMA channel out of range");
     if (ch > BCM_DMA_MAX_CH) { // Don't use ch 15 as it has different properties
         mtx_unlock(&dma->dma_lock);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (dma_regs == NULL) {
         status = io_buffer_init_physical(&dma->regs_buffer, DMA_BASE, BCM_DMA_PAGE_SIZE,
-            get_root_resource(), MX_CACHE_POLICY_UNCACHED_DEVICE);
-        if (status != MX_OK) {
+            get_root_resource(), ZX_CACHE_POLICY_UNCACHED_DEVICE);
+        if (status != ZX_OK) {
             goto dma_init_err;
         }
         dma_regs = io_buffer_virt(&dma->regs_buffer);
@@ -98,7 +98,7 @@
     status = io_buffer_init(&dma->ctl_blks,
                             BCM_DMA_NUM_CONTROL_BLOCKS * sizeof(bcm_dma_cb_t),
                             IO_BUFFER_RW);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("\nBCM_DMA: Error Allocating control blocks: %d\n", status);
         goto dma_init_err;
     }
@@ -108,11 +108,11 @@
     dma->callback = NULL;
 
     xprintf("Initializing interrupt handler\n");
-    status = mx_interrupt_create(get_root_resource(),
+    status = zx_interrupt_create(get_root_resource(),
                                      INTERRUPT_DMA0 + ch,
-                                     MX_FLAG_REMAP_IRQ,
+                                     ZX_FLAG_REMAP_IRQ,
                                      &irq_handle);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         xprintf("bcm-dma: failed to create interrupt handle, handle = %d\n",
                 status);
         goto dma_init_err;
@@ -130,31 +130,31 @@
                                         thrd_name);
     if (thrd_rc != thrd_success) {
         xprintf("failed to create irq thread\n");
-        status = thrd_status_to_mx_status(thrd_rc);
+        status = thrd_status_to_zx_status(thrd_rc);
         goto dma_init_err;
     }
 
     dma->state = BCM_DMA_STATE_INITIALIZED;
 
     mtx_unlock(&dma->dma_lock);
-    return MX_OK;
+    return ZX_OK;
 
 dma_init_err:
-    mx_handle_close(dma->irq_handle);
-    dma->irq_handle = MX_HANDLE_INVALID;
+    zx_handle_close(dma->irq_handle);
+    dma->irq_handle = ZX_HANDLE_INVALID;
 
     if (io_buffer_is_valid(&dma->ctl_blks)) {
         io_buffer_release(&dma->ctl_blks);
     }
     if (irq_handle > 0) {
-        mx_handle_close(irq_handle);
+        zx_handle_close(irq_handle);
     }
 
     mtx_unlock(&dma->dma_lock);
     return status;
 }
 
-mx_paddr_t bcm_dma_get_position(bcm_dma_t* dma) {
+zx_paddr_t bcm_dma_get_position(bcm_dma_t* dma) {
     /* .source_address reports the physical bus address of the memory location,
             which doesn't neccesarily equal the physical memory address as observed
             by the ARM cores (depending on L2 configuration).  The base address
@@ -162,35 +162,35 @@
             BCM_PHYS_ADDR_MASK to make to the phys address needed by the cpu.
     */
     uint32_t address = (dma_regs->channels[dma->ch_num].source_addr) & BCM_PHYS_ADDR_MASK;
-    return (mx_paddr_t)address;
+    return (zx_paddr_t)address;
 }
 
-mx_status_t bcm_dma_paddr_to_offset(bcm_dma_t* dma, mx_paddr_t paddr, uint32_t* offset) {
+zx_status_t bcm_dma_paddr_to_offset(bcm_dma_t* dma, zx_paddr_t paddr, uint32_t* offset) {
 
     // This call only works if an index was created for the memory object
     if (!dma->mem_idx) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     for (uint32_t i = 0; i < dma->mem_idx_len; i++) {
         if ((paddr >= dma->mem_idx[i].paddr) && (paddr < (dma->mem_idx[i].paddr + dma->mem_idx[i].len))) {
             *offset = dma->mem_idx[i].offset + (paddr - dma->mem_idx[i].paddr);
-            return MX_OK;
+            return ZX_OK;
         }
     }
-    return MX_ERR_OUT_OF_RANGE;
+    return ZX_ERR_OUT_OF_RANGE;
 }
 
 /* Builds index of vmo pages.  This is used to translate physical addresses
     reported by the dma status into offsets into the memory object used for the
     transaction.
 */
-static mx_status_t bcm_dma_build_mem_index(bcm_dma_t* dma, mx_paddr_t* page_list, uint32_t len) {
+static zx_status_t bcm_dma_build_mem_index(bcm_dma_t* dma, zx_paddr_t* page_list, uint32_t len) {
 
     dma->mem_idx = calloc(len, sizeof(bcm_dma_vmo_index_t)); //Allocate worst case sized array
-    MX_DEBUG_ASSERT(dma->mem_idx);
+    ZX_DEBUG_ASSERT(dma->mem_idx);
     if (!dma->mem_idx)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     dma->mem_idx_len = 0;
 
@@ -218,48 +218,48 @@
             dma->mem_idx_len++;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t bcm_dma_init_vmo_to_fifo_trans(bcm_dma_t* dma, mx_handle_t vmo, uint32_t t_info,
-                                           mx_paddr_t dest, uint32_t flags) {
-    mx_paddr_t* buf_pages = NULL;
+zx_status_t bcm_dma_init_vmo_to_fifo_trans(bcm_dma_t* dma, zx_handle_t vmo, uint32_t t_info,
+                                           zx_paddr_t dest, uint32_t flags) {
+    zx_paddr_t* buf_pages = NULL;
     xprintf("Linking vmo to fifo...\n");
     mtx_lock(&dma->dma_lock);
 
     if (dma->state < BCM_DMA_STATE_INITIALIZED) {
         mtx_unlock(&dma->dma_lock);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     size_t buffsize;
-    mx_status_t status = mx_vmo_get_size(vmo, &buffsize);
-    if (status != MX_OK) {
+    zx_status_t status = zx_vmo_get_size(vmo, &buffsize);
+    if (status != ZX_OK) {
         goto dma_link_err;
     }
 
     uint32_t num_pages = (buffsize + BCM_DMA_PAGE_SIZE - 1) / BCM_DMA_PAGE_SIZE;
 
-    MX_DEBUG_ASSERT(num_pages <= BCM_DMA_NUM_CONTROL_BLOCKS);
+    ZX_DEBUG_ASSERT(num_pages <= BCM_DMA_NUM_CONTROL_BLOCKS);
     if (num_pages > BCM_DMA_NUM_CONTROL_BLOCKS) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto dma_link_err;
     }
 
-    buf_pages = calloc(num_pages, sizeof(mx_paddr_t));
+    buf_pages = calloc(num_pages, sizeof(zx_paddr_t));
     if (!buf_pages) {
-        status = MX_ERR_NO_MEMORY;
+        status = ZX_ERR_NO_MEMORY;
         goto dma_link_err;
     }
 
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_LOOKUP, 0, buffsize,
-                             buf_pages, sizeof(mx_paddr_t) * num_pages);
-    if (status != MX_OK)
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_LOOKUP, 0, buffsize,
+                             buf_pages, sizeof(zx_paddr_t) * num_pages);
+    if (status != ZX_OK)
         goto dma_link_err;
 
     if (flags & BCM_DMA_FLAGS_USE_MEM_INDEX) {
         status = bcm_dma_build_mem_index(dma, buf_pages, num_pages);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             goto dma_link_err;
     }
 
@@ -293,7 +293,7 @@
         }
     }
 
-    io_buffer_cache_op(&dma->ctl_blks, MX_VMO_OP_CACHE_CLEAN, 0, num_pages * sizeof(bcm_dma_cb_t));
+    io_buffer_cache_op(&dma->ctl_blks, ZX_VMO_OP_CACHE_CLEAN, 0, num_pages * sizeof(bcm_dma_cb_t));
 
     dma->state = BCM_DMA_STATE_READY;
 
@@ -312,13 +312,13 @@
     return status;
 }
 
-mx_status_t bcm_dma_start(bcm_dma_t* dma) {
+zx_status_t bcm_dma_start(bcm_dma_t* dma) {
 
     xprintf("starting dma channel %u\n", dma->ch_num);
     mtx_lock(&dma->dma_lock);
     if ((dma_regs == NULL) || (dma->state != BCM_DMA_STATE_READY)) {
         mtx_unlock(&dma->dma_lock);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     dma_regs->channels[dma->ch_num].ctl_blk_addr =
@@ -328,44 +328,44 @@
 
     dma->state = BCM_DMA_STATE_RUNNING;
     mtx_unlock(&dma->dma_lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t bcm_dma_stop(bcm_dma_t* dma) {
+zx_status_t bcm_dma_stop(bcm_dma_t* dma) {
     xprintf("Stopping dma channel %u\n", dma->ch_num);
     mtx_lock(&dma->dma_lock);
 
     if ((dma_regs == NULL) || (dma->state < BCM_DMA_STATE_READY)) {
         mtx_unlock(&dma->dma_lock);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     dma_regs->channels[dma->ch_num].cs &= ~BCM_DMA_CS_ACTIVE;
     dma->state = BCM_DMA_STATE_READY;
 
     mtx_unlock(&dma->dma_lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void bcm_dma_deinit(bcm_dma_t* dma) {
 
-    MX_DEBUG_ASSERT(dma);
+    ZX_DEBUG_ASSERT(dma);
     xprintf("Deiniting dma channel %u\n", dma->ch_num);
 
     mtx_lock(&dma->dma_lock);
 
-    if (dma->irq_handle != MX_HANDLE_INVALID) {
+    if (dma->irq_handle != ZX_HANDLE_INVALID) {
         //shut down the irq thread
         xprintf("Shutting down irq thread\n");
         dma->irq_thrd_stop = true;
         //Signal the interrupt since the thread is waiting on it.
-        mx_interrupt_signal(dma->irq_handle);
+        zx_interrupt_signal(dma->irq_handle);
         thrd_join(dma->irq_thrd, NULL);
         xprintf("irq thread shut down\n");
 
         //Release the irq handle
-        mx_handle_close(dma->irq_handle);
-        dma->irq_handle = MX_HANDLE_INVALID;
+        zx_handle_close(dma->irq_handle);
+        dma->irq_handle = ZX_HANDLE_INVALID;
     }
 
     dma_regs->channels[dma->ch_num].cs &= ~BCM_DMA_CS_ACTIVE;
diff --git a/system/ulib/bcm/include/bcm/clockman.h b/system/ulib/bcm/include/bcm/clockman.h
index 240e76a..a291478 100644
--- a/system/ulib/bcm/include/bcm/clockman.h
+++ b/system/ulib/bcm/include/bcm/clockman.h
@@ -7,7 +7,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #define BCM_CLOCKMAN_PASSWORD       (uint32_t)( 0x5a000000 )
 
diff --git a/system/ulib/bcm/include/bcm/dma.h b/system/ulib/bcm/include/bcm/dma.h
index 464ba6e..554a121 100644
--- a/system/ulib/bcm/include/bcm/dma.h
+++ b/system/ulib/bcm/include/bcm/dma.h
@@ -66,7 +66,7 @@
 } __PACKED bcm_dma_ctrl_regs_t;
 
 typedef struct {
-    mx_paddr_t paddr;
+    zx_paddr_t paddr;
     uint32_t offset;
     uint32_t len;
 } bcm_dma_vmo_index_t;
@@ -82,14 +82,14 @@
     bcm_dma_vmo_index_t* mem_idx;
     uint32_t mem_idx_len;
     dma_cb_t callback;
-    mx_handle_t irq_handle;
+    zx_handle_t irq_handle;
     thrd_t irq_thrd;
     volatile bool irq_thrd_stop;
 } bcm_dma_t;
 
-mx_status_t bcm_dma_start(bcm_dma_t* dma);
-mx_status_t bcm_dma_stop(bcm_dma_t* dma);
-mx_status_t bcm_dma_init(bcm_dma_t* dma, uint32_t ch);
+zx_status_t bcm_dma_start(bcm_dma_t* dma);
+zx_status_t bcm_dma_stop(bcm_dma_t* dma);
+zx_status_t bcm_dma_init(bcm_dma_t* dma, uint32_t ch);
 
 /* Initialize a vmo->fifo transaction.  This assumes that the destination address
     is a non-incrementing physical address.
@@ -99,9 +99,9 @@
         dest - physical address of destination.  This is most likely a peripheral fifo
             and if this is the case then t_info should be configured appropriately.
 */
-mx_status_t bcm_dma_init_vmo_to_fifo_trans(bcm_dma_t* dma, mx_handle_t vmo, uint32_t t_info,
-                                           mx_paddr_t dest, uint32_t flags);
+zx_status_t bcm_dma_init_vmo_to_fifo_trans(bcm_dma_t* dma, zx_handle_t vmo, uint32_t t_info,
+                                           zx_paddr_t dest, uint32_t flags);
 void bcm_dma_deinit(bcm_dma_t* dma);
 
-mx_status_t bcm_dma_paddr_to_offset(bcm_dma_t* dma, mx_paddr_t paddr, uint32_t* offset);
-mx_paddr_t bcm_dma_get_position(bcm_dma_t* dma);
\ No newline at end of file
+zx_status_t bcm_dma_paddr_to_offset(bcm_dma_t* dma, zx_paddr_t paddr, uint32_t* offset);
+zx_paddr_t bcm_dma_get_position(bcm_dma_t* dma);
\ No newline at end of file
diff --git a/system/ulib/bcm/include/bcm/ioctl.h b/system/ulib/bcm/include/bcm/ioctl.h
index 0728e5b..a8e698b 100644
--- a/system/ulib/bcm/include/bcm/ioctl.h
+++ b/system/ulib/bcm/include/bcm/ioctl.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/compiler.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/compiler.h>
 #include <stddef.h>
 
 __BEGIN_CDECLS;
diff --git a/system/ulib/bitmap/include/bitmap/bitmap.h b/system/ulib/bitmap/include/bitmap/bitmap.h
index d745770..b0e8660 100644
--- a/system/ulib/bitmap/include/bitmap/bitmap.h
+++ b/system/ulib/bitmap/include/bitmap/bitmap.h
@@ -6,7 +6,7 @@
 
 #include <stddef.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 namespace bitmap {
 
@@ -27,22 +27,22 @@
                      size_t* first_unset = nullptr) const = 0;
 
     // Sets the bit at bitoff.  Only fails on allocation error.
-    virtual mx_status_t SetOne(size_t bitoff) {
+    virtual zx_status_t SetOne(size_t bitoff) {
         return Set(bitoff, bitoff + 1);
     }
 
     // Sets all bits in the range [*bitoff*, *bitmax*).  Only fails on
     // allocation error or if bitmax < bitoff.
-    virtual mx_status_t Set(size_t bitoff, size_t bitmax) = 0;
+    virtual zx_status_t Set(size_t bitoff, size_t bitmax) = 0;
 
     // Clears the bit at bitoff.  Only fails on allocation error.
-    virtual mx_status_t ClearOne(size_t bitoff) {
+    virtual zx_status_t ClearOne(size_t bitoff) {
         return Clear(bitoff, bitoff + 1);
     }
 
     // Clears all bits in the range [*bitoff*, *bitmax*).  Only fails on
     // allocation error or if bitmax < bitoff.
-    virtual mx_status_t Clear(size_t bitoff, size_t bitmax) = 0;
+    virtual zx_status_t Clear(size_t bitoff, size_t bitmax) = 0;
 
     // Clear all bits in the bitmap.
     virtual void ClearAll() = 0;
diff --git a/system/ulib/bitmap/include/bitmap/raw-bitmap.h b/system/ulib/bitmap/include/bitmap/raw-bitmap.h
index 535f3a7..2aac169 100644
--- a/system/ulib/bitmap/include/bitmap/raw-bitmap.h
+++ b/system/ulib/bitmap/include/bitmap/raw-bitmap.h
@@ -11,8 +11,8 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <magenta/assert.h>
-#include <magenta/types.h>
+#include <zircon/assert.h>
+#include <zircon/types.h>
 #include <fbl/algorithm.h>
 #include <fbl/macros.h>
 #include <fbl/type_support.h>
@@ -43,7 +43,7 @@
     // This is useful for programs which require underlying bitmap storage
     // to be aligned to a certain size (initialized via Reset), but want to
     // restrict access to a smaller portion of the bitmap (via Shrink).
-    mx_status_t Shrink(size_t size);
+    zx_status_t Shrink(size_t size);
 
     // Returns the lesser of bitmax and the index of the first bit that doesn't
     // match *is_set* starting from *bitoff*.
@@ -52,8 +52,8 @@
     // Find a run of *run_len* *is_set* bits, between bitoff and bitmax.
     // Returns the start of the run in *out*, or bitmax if it is
     // not found in the provided range.
-    // If the run is not found, "MX_ERR_NO_RESOURCES" is returned.
-    mx_status_t Find(bool is_set, size_t bitoff, size_t bitmax, size_t run_len, size_t* out) const;
+    // If the run is not found, "ZX_ERR_NO_RESOURCES" is returned.
+    zx_status_t Find(bool is_set, size_t bitoff, size_t bitmax, size_t run_len, size_t* out) const;
 
     // Returns true if all the bits in [*bitoff*, *bitmax*) are set. Afterwards,
     // *first_unset* will be set to the lesser of bitmax and the index of the
@@ -62,12 +62,12 @@
              size_t* first_unset = nullptr) const override;
 
     // Sets all bits in the range [*bitoff*, *bitmax*).  Returns an error if
-    // bitmax < bitoff or size_ < bitmax, and MX_OK otherwise.
-    mx_status_t Set(size_t bitoff, size_t bitmax) override;
+    // bitmax < bitoff or size_ < bitmax, and ZX_OK otherwise.
+    zx_status_t Set(size_t bitoff, size_t bitmax) override;
 
     // Clears all bits in the range [*bitoff*, *bitmax*).  Returns an error if
-    // bitmax < bitoff or size_ < bitmax, and MX_OK otherwise.
-    mx_status_t Clear(size_t bitoff, size_t bitmax) override;
+    // bitmax < bitoff or size_ < bitmax, and ZX_OK otherwise.
+    zx_status_t Clear(size_t bitoff, size_t bitmax) override;
 
     // Clear all bits in the bitmap.
     void ClearAll() override;
@@ -81,11 +81,11 @@
 
 // A simple bitmap backed by generic storage.
 // Storage must implement:
-//   - mx_status_t Allocate(size_t size)
+//   - zx_status_t Allocate(size_t size)
 //      To allocate |size| bytes of storage.
 //   - void* GetData()
 //      To access the underlying storage.
-//   - mx_status_t Grow(size_t size)
+//   - zx_status_t Grow(size_t size)
 //      (optional) To expand the underlying storage to fit at least |size| bytes.
 template <typename Storage>
 class RawBitmapGeneric final : public RawBitmapBase {
@@ -98,20 +98,20 @@
 
     // Increases the bitmap size
     template <typename U = Storage>
-    typename fbl::enable_if<internal::has_grow<U>::value, mx_status_t>::type
+    typename fbl::enable_if<internal::has_grow<U>::value, zx_status_t>::type
     Grow(size_t size) {
         if (size < size_) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else if (size == size_) {
-            return MX_OK;
+            return ZX_OK;
         }
 
         size_t old_len = LastIdx(size_) + 1;
         size_t new_len = LastIdx(size) + 1;
         size_t new_bitsize = sizeof(size_t) * new_len;
-        MX_ASSERT(new_bitsize >= new_len); // Overflow
-        mx_status_t status = bits_.Grow(new_bitsize);
-        if (status != MX_OK) {
+        ZX_ASSERT(new_bitsize >= new_len); // Overflow
+        zx_status_t status = bits_.Grow(new_bitsize);
+        if (status != ZX_OK) {
             return status;
         }
 
@@ -125,31 +125,31 @@
 
         // Clear the partial bits not included in the new "size_t"s.
         Clear(old_size, fbl::min(old_len * kBits, size_));
-        return MX_OK;
+        return ZX_OK;
     }
 
     template <typename U = Storage>
-    typename fbl::enable_if<!internal::has_grow<U>::value, mx_status_t>::type
+    typename fbl::enable_if<!internal::has_grow<U>::value, zx_status_t>::type
     Grow(size_t size) {
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     }
 
     // Resets the bitmap; clearing and resizing it.
     // Allocates memory, and can fail.
-    mx_status_t Reset(size_t size) {
+    zx_status_t Reset(size_t size) {
         size_ = size;
         if (size_ == 0) {
             data_ = nullptr;
-            return MX_OK;
+            return ZX_OK;
         }
         size_t last_idx = LastIdx(size);
-        mx_status_t status = bits_.Allocate(sizeof(size_t) * (last_idx + 1));
-        if (status != MX_OK) {
+        zx_status_t status = bits_.Allocate(sizeof(size_t) * (last_idx + 1));
+        if (status != ZX_OK) {
             return status;
         }
         data_ = static_cast<size_t*>(bits_.GetData());
         ClearAll();
-        return MX_OK;
+        return ZX_OK;
     }
 
     // This function allows access to underlying data, but is dangerous: It
diff --git a/system/ulib/bitmap/include/bitmap/rle-bitmap.h b/system/ulib/bitmap/include/bitmap/rle-bitmap.h
index c6cbffa..4e33421 100644
--- a/system/ulib/bitmap/include/bitmap/rle-bitmap.h
+++ b/system/ulib/bitmap/include/bitmap/rle-bitmap.h
@@ -8,7 +8,7 @@
 
 #include <stddef.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/macros.h>
 #include <fbl/unique_ptr.h>
@@ -47,7 +47,7 @@
 
     // Sets all bits in the range [*bitoff*, *bitmax*).  Only fails on allocation
     // error or if bitmax < bitoff.
-    mx_status_t Set(size_t bitoff, size_t bitmax) override;
+    zx_status_t Set(size_t bitoff, size_t bitmax) override;
 
     // Sets all bits in the range [*bitoff*, *bitmax*).  Only fails if
     // *bitmax* < *bitoff* or if an allocation is needed and *free_list*
@@ -57,11 +57,11 @@
     // it will be drawn from it.  This function is guaranteed to need at most
     // one allocation.  If any nodes need to be deleted, they will be appended
     // to *free_list*.
-    mx_status_t SetNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list);
+    zx_status_t SetNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list);
 
     // Clears all bits in the range [*bitoff*, *bitmax*).  Only fails on allocation
     // error or if bitmax < bitoff.
-    mx_status_t Clear(size_t bitoff, size_t bitmax) override;
+    zx_status_t Clear(size_t bitoff, size_t bitmax) override;
 
     // Clear all bits in the range [*bitoff*, *bitmax*).  Only fails if
     // *bitmax* < *bitoff* or if an allocation is needed and *free_list*
@@ -71,7 +71,7 @@
     // it will be drawn from it.  This function is guaranteed to need at most
     // one allocation.  If any nodes need to be deleted, they will be appended
     // to *free_list*.
-    mx_status_t ClearNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list);
+    zx_status_t ClearNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list);
 
     // Clear all bits in the bitmap.
     void ClearAll() override;
@@ -84,8 +84,8 @@
     const_iterator cend() const { return elems_.cend(); }
 
 private:
-    mx_status_t SetInternal(size_t bitoff, size_t bitmax, FreeList* free_list);
-    mx_status_t ClearInternal(size_t bitoff, size_t bitmax, FreeList* free_list);
+    zx_status_t SetInternal(size_t bitoff, size_t bitmax, FreeList* free_list);
+    zx_status_t ClearInternal(size_t bitoff, size_t bitmax, FreeList* free_list);
 
     // The ranges of the bitmap.
     ListType elems_;
diff --git a/system/ulib/bitmap/include/bitmap/storage.h b/system/ulib/bitmap/include/bitmap/storage.h
index cbe3914..45a80d6 100644
--- a/system/ulib/bitmap/include/bitmap/storage.h
+++ b/system/ulib/bitmap/include/bitmap/storage.h
@@ -8,16 +8,16 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include <magenta/process.h>
-#include <magenta/types.h>
+#include <zircon/process.h>
+#include <zircon/types.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/array.h>
 #include <fbl/macros.h>
 
 #if !defined _KERNEL && defined __Fuchsia__
-#include <mx/vmo.h>
-#include <magenta/syscalls.h>
+#include <zx/vmo.h>
+#include <zircon/syscalls.h>
 #endif
 
 namespace bitmap {
@@ -27,14 +27,14 @@
     DISALLOW_COPY_ASSIGN_AND_MOVE(DefaultStorage);
     DefaultStorage() = default;
 
-    mx_status_t Allocate(size_t size) {
+    zx_status_t Allocate(size_t size) {
         fbl::AllocChecker ac;
         auto arr = new (&ac) uint8_t[size];
         if (!ac.check()) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         storage_.reset(arr, size);
-        return MX_OK;
+        return ZX_OK;
     }
     void* GetData() { return storage_.get(); }
     const void* GetData() const { return storage_.get(); }
@@ -48,9 +48,9 @@
     DISALLOW_COPY_ASSIGN_AND_MOVE(FixedStorage);
     FixedStorage() = default;
 
-    mx_status_t Allocate(size_t size) {
-        MX_ASSERT(size <= N);
-        return MX_OK;
+    zx_status_t Allocate(size_t size) {
+        ZX_ASSERT(size <= N);
+        return ZX_OK;
     }
     void* GetData() { return storage_; }
     const void* GetData() const { return storage_; }
@@ -63,7 +63,7 @@
 public:
     DISALLOW_COPY_ASSIGN_AND_MOVE(VmoStorage);
     VmoStorage() :
-        vmo_(MX_HANDLE_INVALID),
+        vmo_(ZX_HANDLE_INVALID),
         mapped_addr_(0),
         size_(0) {}
 
@@ -71,73 +71,73 @@
         Release();
     }
 
-    mx_status_t Allocate(size_t size) {
+    zx_status_t Allocate(size_t size) {
         Release();
         size_ = fbl::roundup(size, static_cast<size_t>(PAGE_SIZE));
-        mx_status_t status;
-        if ((status = mx::vmo::create(size_, 0, &vmo_)) != MX_OK) {
+        zx_status_t status;
+        if ((status = zx::vmo::create(size_, 0, &vmo_)) != ZX_OK) {
             return status;
-        } else if ((status = mx_vmar_map(mx_vmar_root_self(), 0, vmo_.get(), 0,
-                                         size_, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
-                                         &mapped_addr_)) != MX_OK) {
+        } else if ((status = zx_vmar_map(zx_vmar_root_self(), 0, vmo_.get(), 0,
+                                         size_, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
+                                         &mapped_addr_)) != ZX_OK) {
             vmo_.reset();
             return status;
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t Grow(size_t size) {
+    zx_status_t Grow(size_t size) {
         if (size <= size_) {
-            return MX_OK;
+            return ZX_OK;
         }
 
         size = fbl::roundup(size, static_cast<size_t>(PAGE_SIZE));
-        mx_status_t status;
-        if ((status = vmo_.set_size(size)) != MX_OK) {
+        zx_status_t status;
+        if ((status = vmo_.set_size(size)) != ZX_OK) {
             return status;
         }
 
 
-        mx_info_vmar_t vmar_info;
-        if ((status = mx_object_get_info(mx_vmar_root_self(), MX_INFO_VMAR,
+        zx_info_vmar_t vmar_info;
+        if ((status = zx_object_get_info(zx_vmar_root_self(), ZX_INFO_VMAR,
                                          &vmar_info, sizeof(vmar_info), NULL,
-                                         NULL)) != MX_OK) {
+                                         NULL)) != ZX_OK) {
             return status;
         }
 
         // Try to extend mapping
         uintptr_t addr;
-        if ((status = mx_vmar_map(mx_vmar_root_self(), mapped_addr_ + size_ -
+        if ((status = zx_vmar_map(zx_vmar_root_self(), mapped_addr_ + size_ -
                                   vmar_info.base, vmo_.get(), size_, size - size_,
-                                  MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                                  MX_VM_FLAG_SPECIFIC, &addr)) != MX_OK) {
+                                  ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                                  ZX_VM_FLAG_SPECIFIC, &addr)) != ZX_OK) {
             // If extension fails, create entirely new mapping and unmap the old one
-            if ((status = mx_vmar_map(mx_vmar_root_self(), 0, vmo_.get(), 0, size,
-                                      MX_VM_FLAG_PERM_READ |
-                                      MX_VM_FLAG_PERM_WRITE, &addr)) != MX_OK) {
+            if ((status = zx_vmar_map(zx_vmar_root_self(), 0, vmo_.get(), 0, size,
+                                      ZX_VM_FLAG_PERM_READ |
+                                      ZX_VM_FLAG_PERM_WRITE, &addr)) != ZX_OK) {
                 return status;
             }
 
-            if ((status = mx_vmar_unmap(mx_vmar_root_self(), mapped_addr_, size_)) != MX_OK) {
+            if ((status = zx_vmar_unmap(zx_vmar_root_self(), mapped_addr_, size_)) != ZX_OK) {
                 return status;
             }
 
             mapped_addr_ = addr;
         }
 
-        return MX_OK;
+        return ZX_OK;
     }
 
-    void* GetData() { MX_DEBUG_ASSERT(mapped_addr_ != 0); return (void*) mapped_addr_; }
-    const void* GetData() const { MX_DEBUG_ASSERT(mapped_addr_ != 0); return (void*) mapped_addr_; }
-    mx_handle_t GetVmo() const { MX_DEBUG_ASSERT(mapped_addr_ != 0); return vmo_.get(); }
+    void* GetData() { ZX_DEBUG_ASSERT(mapped_addr_ != 0); return (void*) mapped_addr_; }
+    const void* GetData() const { ZX_DEBUG_ASSERT(mapped_addr_ != 0); return (void*) mapped_addr_; }
+    zx_handle_t GetVmo() const { ZX_DEBUG_ASSERT(mapped_addr_ != 0); return vmo_.get(); }
 private:
     void Release() {
         if (mapped_addr_ != 0) {
-            mx_vmar_unmap(mx_vmar_root_self(), mapped_addr_, size_);
+            zx_vmar_unmap(zx_vmar_root_self(), mapped_addr_, size_);
         }
     }
-    mx::vmo vmo_;
+    zx::vmo vmo_;
     uintptr_t mapped_addr_;
     size_t size_;
 };
diff --git a/system/ulib/bitmap/raw-bitmap.cpp b/system/ulib/bitmap/raw-bitmap.cpp
index a13ec11..d66646d 100644
--- a/system/ulib/bitmap/raw-bitmap.cpp
+++ b/system/ulib/bitmap/raw-bitmap.cpp
@@ -8,7 +8,7 @@
 #include <limits.h>
 #include <stddef.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/algorithm.h>
 #include <fbl/macros.h>
 
@@ -61,12 +61,12 @@
 
 namespace bitmap {
 
-mx_status_t RawBitmapBase::Shrink(size_t size) {
+zx_status_t RawBitmapBase::Shrink(size_t size) {
     if (size > size_) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     size_ = size;
-    return MX_OK;
+    return ZX_OK;
 }
 
 size_t RawBitmapBase::Scan(size_t bitoff, size_t bitmax, bool is_set) const {
@@ -96,22 +96,22 @@
     return fbl::min(bitmax, CountZeros(i, value));
 }
 
-mx_status_t RawBitmapBase::Find(bool is_set, size_t bitoff, size_t bitmax,
+zx_status_t RawBitmapBase::Find(bool is_set, size_t bitoff, size_t bitmax,
                                                 size_t run_len, size_t* out) const {
     if (!out || bitmax <= bitoff) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     size_t start = bitoff;
     while (bitoff - start < run_len && bitoff < bitmax) {
         start = Scan(bitoff, bitmax, !is_set);
         if (bitmax - start < run_len) {
             *out = bitmax;
-            return MX_ERR_NO_RESOURCES;
+            return ZX_ERR_NO_RESOURCES;
         }
         bitoff = Scan(start, start + run_len, is_set);
     }
     *out = start;
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool RawBitmapBase::Get(size_t bitoff, size_t bitmax, size_t* first) const {
@@ -123,12 +123,12 @@
     return result == bitmax;
 }
 
-mx_status_t RawBitmapBase::Set(size_t bitoff, size_t bitmax) {
+zx_status_t RawBitmapBase::Set(size_t bitoff, size_t bitmax) {
     if (bitoff > bitmax || bitmax > size_) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (bitoff == bitmax) {
-        return MX_OK;
+        return ZX_OK;
     }
     size_t first_idx = FirstIdx(bitoff);
     size_t last_idx = LastIdx(bitmax);
@@ -136,15 +136,15 @@
         data_[i] |=
                 GetMask(i == first_idx, i == last_idx, bitoff, bitmax);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t RawBitmapBase::Clear(size_t bitoff, size_t bitmax) {
+zx_status_t RawBitmapBase::Clear(size_t bitoff, size_t bitmax) {
     if (bitoff > bitmax || bitmax > size_) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (bitoff == bitmax) {
-        return MX_OK;
+        return ZX_OK;
     }
     size_t first_idx = FirstIdx(bitoff);
     size_t last_idx = LastIdx(bitmax);
@@ -152,7 +152,7 @@
         data_[i] &=
                 ~(GetMask(i == first_idx, i == last_idx, bitoff, bitmax));
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 void RawBitmapBase::ClearAll() {
diff --git a/system/ulib/bitmap/rle-bitmap.cpp b/system/ulib/bitmap/rle-bitmap.cpp
index c8de3f3..b0a1d33 100644
--- a/system/ulib/bitmap/rle-bitmap.cpp
+++ b/system/ulib/bitmap/rle-bitmap.cpp
@@ -6,8 +6,8 @@
 
 #include <stddef.h>
 
-#include <magenta/errors.h>
-#include <magenta/types.h>
+#include <zircon/errors.h>
+#include <zircon/types.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 
@@ -64,43 +64,43 @@
     num_elems_ = 0;
 }
 
-mx_status_t RleBitmap::Set(size_t bitoff, size_t bitmax) {
+zx_status_t RleBitmap::Set(size_t bitoff, size_t bitmax) {
     return SetInternal(bitoff, bitmax, nullptr);
 }
 
-mx_status_t RleBitmap::SetNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list) {
+zx_status_t RleBitmap::SetNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list) {
     if (free_list == nullptr) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     return SetInternal(bitoff, bitmax, free_list);
 }
 
-mx_status_t RleBitmap::Clear(size_t bitoff, size_t bitmax) {
+zx_status_t RleBitmap::Clear(size_t bitoff, size_t bitmax) {
     return ClearInternal(bitoff, bitmax, nullptr);
 }
 
-mx_status_t RleBitmap::ClearNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list) {
+zx_status_t RleBitmap::ClearNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list) {
     if (free_list == nullptr) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     return ClearInternal(bitoff, bitmax, free_list);
 }
 
-mx_status_t RleBitmap::SetInternal(size_t bitoff, size_t bitmax, FreeList* free_list) {
+zx_status_t RleBitmap::SetInternal(size_t bitoff, size_t bitmax, FreeList* free_list) {
     if (bitmax < bitoff) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     const size_t bitlen = bitmax - bitoff;
     if (bitlen == 0) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     fbl::unique_ptr<RleBitmapElement> new_elem = AllocateElement(free_list);
     if (!new_elem) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     ++num_elems_;
     new_elem->bitoff = bitoff;
@@ -116,7 +116,7 @@
 
     // If ends_after was the end of the list, there is no merging to do.
     if (ends_after == elems_.end()) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     auto itr = ends_after;
@@ -146,16 +146,16 @@
         --num_elems_;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t RleBitmap::ClearInternal(size_t bitoff, size_t bitmax, FreeList* free_list) {
+zx_status_t RleBitmap::ClearInternal(size_t bitoff, size_t bitmax, FreeList* free_list) {
     if (bitmax < bitoff) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (bitmax - bitoff == 0) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     auto itr = elems_.begin();
@@ -177,7 +177,7 @@
                 // '*itr' contains [bitoff, bitmax), and we need to split it.
                 fbl::unique_ptr<RleBitmapElement> new_elem = AllocateElement(free_list);
                 if (!new_elem) {
-                    return MX_ERR_NO_MEMORY;
+                    return ZX_ERR_NO_MEMORY;
                 }
                 ++num_elems_;
                 new_elem->bitoff = bitmax;
@@ -201,7 +201,7 @@
             }
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 } // namespace bitmap
diff --git a/system/ulib/bitmap/rules.mk b/system/ulib/bitmap/rules.mk
index 18d18ea..d8abd12 100644
--- a/system/ulib/bitmap/rules.mk
+++ b/system/ulib/bitmap/rules.mk
@@ -15,12 +15,12 @@
 MODULE_SO_NAME := bitmap
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
 
 include make/module.mk
diff --git a/system/ulib/blktest/blktest.cpp b/system/ulib/blktest/blktest.cpp
index 86373c5..b5df954 100644
--- a/system/ulib/blktest/blktest.cpp
+++ b/system/ulib/blktest/blktest.cpp
@@ -15,8 +15,8 @@
 #include <unistd.h>
 
 #include <block-client/client.h>
-#include <magenta/device/block.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/block.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/array.h>
@@ -141,10 +141,10 @@
     BEGIN_TEST;
     uint64_t blk_size, blk_count;
     int fd = get_testdev(&blk_size, &blk_count);
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -160,7 +160,7 @@
     uint64_t blk_size, blk_count;
     // Set up the initial handshake connection with the blkdev
     int fd = get_testdev(&blk_size, &blk_count);
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     txnid_t txnid;
@@ -170,22 +170,22 @@
     // Create an arbitrary VMO, fill it with some stuff
     //uint64_t vmo_size = blk_size * 3;
     uint64_t vmo_size = PAGE_SIZE * 3;
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(vmo_size, 0, &vmo), MX_OK, "Failed to create VMO");
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(vmo_size, 0, &vmo), ZX_OK, "Failed to create VMO");
     fbl::AllocChecker ac;
     fbl::unique_ptr<uint8_t[]> buf(new (&ac) uint8_t[vmo_size]);
     ASSERT_TRUE(ac.check(), "");
     fill_random(buf.get(), vmo_size);
 
     size_t actual;
-    ASSERT_EQ(mx_vmo_write(vmo, buf.get(), 0, vmo_size, &actual), MX_OK, "");
+    ASSERT_EQ(zx_vmo_write(vmo, buf.get(), 0, vmo_size, &actual), ZX_OK, "");
     ASSERT_EQ(actual, vmo_size, "");
 
     // Send a handle to the vmo to the block device, get a vmoid which identifies it
     vmoid_t vmoid;
     expected = sizeof(vmoid_t);
-    mx_handle_t xfer_vmo;
-    ASSERT_EQ(mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo), MX_OK, "");
+    zx_handle_t xfer_vmo;
+    ASSERT_EQ(zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo), ZX_OK, "");
     ASSERT_EQ(ioctl_block_attach_vmo(fd, &xfer_vmo, &vmoid), expected,
               "Failed to attach vmo");
 
@@ -207,27 +207,27 @@
     requests[1].dev_offset = blk_size * 100;
 
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], fbl::count_of(requests)), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], fbl::count_of(requests)), ZX_OK, "");
 
     // Empty the vmo, then read the info we just wrote to the disk
     fbl::unique_ptr<uint8_t[]> out(new (&ac) uint8_t[vmo_size]());
     ASSERT_TRUE(ac.check(), "");
 
-    ASSERT_EQ(mx_vmo_write(vmo, out.get(), 0, vmo_size, &actual), MX_OK, "");
+    ASSERT_EQ(zx_vmo_write(vmo, out.get(), 0, vmo_size, &actual), ZX_OK, "");
     requests[0].opcode = BLOCKIO_READ;
     requests[1].opcode = BLOCKIO_READ;
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], fbl::count_of(requests)), MX_OK, "");
-    ASSERT_EQ(mx_vmo_read(vmo, out.get(), 0, vmo_size, &actual), MX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], fbl::count_of(requests)), ZX_OK, "");
+    ASSERT_EQ(zx_vmo_read(vmo, out.get(), 0, vmo_size, &actual), ZX_OK, "");
     ASSERT_EQ(memcmp(buf.get(), out.get(), blk_size * 3), 0, "Read data not equal to written data");
 
     // Close the current vmo
     requests[0].opcode = BLOCKIO_CLOSE_VMO;
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], 1), MX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], 1), ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(vmo), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(vmo), ZX_OK, "");
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -237,7 +237,7 @@
     uint64_t blk_size, blk_count;
     // Set up the initial handshake connection with the blkdev
     int fd = get_testdev(&blk_size, &blk_count);
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     txnid_t txnid;
@@ -246,22 +246,22 @@
 
     // Create an arbitrary VMO, fill it with some stuff
     uint64_t vmo_size = blk_size * blk_count;
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(vmo_size, 0, &vmo), MX_OK, "Failed to create VMO");
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(vmo_size, 0, &vmo), ZX_OK, "Failed to create VMO");
     fbl::AllocChecker ac;
     fbl::unique_ptr<uint8_t[]> buf(new (&ac) uint8_t[vmo_size]);
     ASSERT_TRUE(ac.check(), "");
     fill_random(buf.get(), vmo_size);
 
     size_t actual;
-    ASSERT_EQ(mx_vmo_write(vmo, buf.get(), 0, vmo_size, &actual), MX_OK, "");
+    ASSERT_EQ(zx_vmo_write(vmo, buf.get(), 0, vmo_size, &actual), ZX_OK, "");
     ASSERT_EQ(actual, vmo_size, "");
 
     // Send a handle to the vmo to the block device, get a vmoid which identifies it
     vmoid_t vmoid;
     expected = sizeof(vmoid_t);
-    mx_handle_t xfer_vmo;
-    ASSERT_EQ(mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo), MX_OK, "");
+    zx_handle_t xfer_vmo;
+    ASSERT_EQ(zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo), ZX_OK, "");
     ASSERT_EQ(ioctl_block_attach_vmo(fd, &xfer_vmo, &vmoid), expected,
               "Failed to attach vmo");
 
@@ -275,33 +275,33 @@
     request.dev_offset = 0;
 
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_OK, "");
 
     // Empty the vmo, then read the info we just wrote to the disk
     fbl::unique_ptr<uint8_t[]> out(new (&ac) uint8_t[vmo_size]());
     ASSERT_TRUE(ac.check(), "");
 
-    ASSERT_EQ(mx_vmo_write(vmo, out.get(), 0, vmo_size, &actual), MX_OK, "");
+    ASSERT_EQ(zx_vmo_write(vmo, out.get(), 0, vmo_size, &actual), ZX_OK, "");
     request.opcode = BLOCKIO_READ;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_OK, "");
-    ASSERT_EQ(mx_vmo_read(vmo, out.get(), 0, vmo_size, &actual), MX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_OK, "");
+    ASSERT_EQ(zx_vmo_read(vmo, out.get(), 0, vmo_size, &actual), ZX_OK, "");
     ASSERT_EQ(memcmp(buf.get(), out.get(), blk_size * 3), 0, "Read data not equal to written data");
 
     // Close the current vmo
     request.opcode = BLOCKIO_CLOSE_VMO;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(vmo), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(vmo), ZX_OK, "");
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
 
 typedef struct {
     uint64_t vmo_size;
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     vmoid_t vmoid;
     fbl::unique_ptr<uint8_t[]> buf;
 } test_vmo_object_t;
@@ -309,20 +309,20 @@
 // Creates a VMO, fills it with data, and gives it to the block device.
 bool create_vmo_helper(int fd, test_vmo_object_t* obj, size_t kBlockSize) {
     obj->vmo_size = kBlockSize + (rand() % 5) * kBlockSize;
-    ASSERT_EQ(mx_vmo_create(obj->vmo_size, 0, &obj->vmo), MX_OK,
+    ASSERT_EQ(zx_vmo_create(obj->vmo_size, 0, &obj->vmo), ZX_OK,
               "Failed to create vmo");
     fbl::AllocChecker ac;
     obj->buf.reset(new (&ac) uint8_t[obj->vmo_size]);
     ASSERT_TRUE(ac.check(), "");
     fill_random(obj->buf.get(), obj->vmo_size);
     size_t actual;
-    ASSERT_EQ(mx_vmo_write(obj->vmo, obj->buf.get(), 0, obj->vmo_size, &actual),
-              MX_OK, "Failed to write to vmo");
+    ASSERT_EQ(zx_vmo_write(obj->vmo, obj->buf.get(), 0, obj->vmo_size, &actual),
+              ZX_OK, "Failed to write to vmo");
     ASSERT_EQ(obj->vmo_size, actual, "Could not write entire VMO");
 
     ssize_t expected = sizeof(vmoid_t);
-    mx_handle_t xfer_vmo;
-    ASSERT_EQ(mx_handle_duplicate(obj->vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo), MX_OK,
+    zx_handle_t xfer_vmo;
+    ASSERT_EQ(zx_handle_duplicate(obj->vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo), ZX_OK,
               "Failed to duplicate vmo");
     ASSERT_EQ(ioctl_block_attach_vmo(fd, &xfer_vmo, &obj->vmoid), expected,
               "Failed to attach vmo");
@@ -349,7 +349,7 @@
         requests[b].dev_offset = i * kBlockSize + b * (kBlockSize * objs);
     }
     // Write entire vmos at once
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), MX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), ZX_OK, "");
     return true;
 }
 
@@ -361,8 +361,8 @@
     fbl::unique_ptr<uint8_t[]> out(new (&ac) uint8_t[obj->vmo_size]());
     ASSERT_TRUE(ac.check(), "");
     size_t actual;
-    ASSERT_EQ(mx_vmo_write(obj->vmo, out.get(), 0, obj->vmo_size, &actual),
-              MX_OK, "");
+    ASSERT_EQ(zx_vmo_write(obj->vmo, out.get(), 0, obj->vmo_size, &actual),
+              ZX_OK, "");
 
     // Next, read to the vmo from the disk
     size_t blocks = obj->vmo_size / kBlockSize;
@@ -377,12 +377,12 @@
         requests[b].dev_offset = i * kBlockSize + b * (kBlockSize * objs);
     }
     // Read entire vmos at once
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), MX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), ZX_OK, "");
 
     // Finally, write from the vmo to an out buffer, where we can compare
     // the results with the input buffer.
-    ASSERT_EQ(mx_vmo_read(obj->vmo, out.get(), 0, obj->vmo_size, &actual),
-              MX_OK, "");
+    ASSERT_EQ(zx_vmo_read(obj->vmo, out.get(), 0, obj->vmo_size, &actual),
+              ZX_OK, "");
     ASSERT_EQ(memcmp(obj->buf.get(), out.get(), obj->vmo_size), 0,
               "Read data not equal to written data");
     return true;
@@ -394,8 +394,8 @@
     request.txnid = txnid;
     request.vmoid = obj->vmoid;
     request.opcode = BLOCKIO_CLOSE_VMO;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(obj->vmo), MX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(obj->vmo), ZX_OK, "");
     return true;
 }
 
@@ -404,14 +404,14 @@
     // Set up the initial handshake connection with the blkdev
     uint64_t blk_size, blk_count;
     int fd = get_testdev(&blk_size, &blk_count);
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     txnid_t txnid;
     expected = sizeof(txnid);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
 
     // Create multiple VMOs
     fbl::AllocChecker ac;
@@ -434,7 +434,7 @@
     }
 
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -453,7 +453,7 @@
     test_vmo_object_t* obj = fifoarg->obj;
     size_t i = fifoarg->i;
     size_t objs = fifoarg->objs;
-    mx_handle_t fd = fifoarg->fd;
+    zx_handle_t fd = fifoarg->fd;
     fifo_client_t* client = fifoarg->client;
     size_t kBlockSize = fifoarg->kBlockSize;
 
@@ -474,11 +474,11 @@
     // Set up the initial handshake connection with the blkdev
     uint64_t kBlockSize, blk_count;
     int fd = get_testdev(&kBlockSize, &blk_count);
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
 
     // Create multiple VMOs
     size_t num_threads = 10;
@@ -513,7 +513,7 @@
     }
 
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -525,13 +525,13 @@
     int fd = get_testdev(&kBlockSize, &blk_count);
 
     // Create a connection to the blkdev
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
-    ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), MX_ERR_ALREADY_BOUND,
+    ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), ZX_ERR_ALREADY_BOUND,
               "Expected fifo to already be bound");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
     txnid_t txnid;
     expected = sizeof(txnid_t);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
@@ -545,14 +545,14 @@
     }
 
     // Now that we've set up the connection for a few VMOs, shut down the fifo
-    ASSERT_EQ(mx_handle_close(fifo), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(fifo), ZX_OK, "");
 
     // Attempting to batch any operations to the fifo should fail
     block_fifo_request_t request;
     request.txnid = txnid;
     request.vmoid = objs[0].vmoid;
     request.opcode = BLOCKIO_CLOSE_VMO;
-    ASSERT_NE(block_fifo_txn(client, &request, 1), MX_OK,
+    ASSERT_NE(block_fifo_txn(client, &request, 1), ZX_OK,
               "Expected operation to fail after closing FIFO");
 
     // Free the dead client
@@ -564,7 +564,7 @@
     // The block server should still be functioning. We should be able to re-bind to it
     expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
     expected = sizeof(txnid);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
 
@@ -582,7 +582,7 @@
     }
 
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -594,11 +594,11 @@
     int fd = get_testdev(&kBlockSize, &blk_count);
 
     // Create a connection to the blkdev
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
 
     // Create a vmo
     test_vmo_object_t obj;
@@ -623,12 +623,12 @@
             requests[b].dev_offset = 0;
         }
 
-        ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), MX_OK, "");
-        ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), MX_OK, "Failed to free txn");
+        ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), ZX_OK, "");
+        ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), ZX_OK, "Failed to free txn");
     }
 
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -640,11 +640,11 @@
     int fd = get_testdev(&kBlockSize, &blk_count);
 
     // Create a connection to the blkdev
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
     test_vmo_object_t obj;
     ASSERT_TRUE(create_vmo_helper(fd, &obj, kBlockSize), "");
 
@@ -669,41 +669,41 @@
     }
 
     // This should be caught locally by the client library
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), MX_ERR_INVALID_ARGS, "");
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), ZX_ERR_INVALID_ARGS, "");
 
     // Since the client-side automatically appends the "TXN_END" flag, we avoid using it here.
     for (size_t i = 0; i < requests.size(); i++) {
         uint32_t actual;
 retry_write:
-        mx_status_t status = mx_fifo_write(fifo, &requests[i], sizeof(block_fifo_request_t),
+        zx_status_t status = zx_fifo_write(fifo, &requests[i], sizeof(block_fifo_request_t),
                                            &actual);
-        if (status == MX_ERR_SHOULD_WAIT) {
-            mx_signals_t signals;
-            ASSERT_EQ(mx_object_wait_one(fifo, MX_FIFO_WRITABLE, MX_TIME_INFINITE, &signals),
-                      MX_OK, "");
-            ASSERT_EQ(signals & MX_FIFO_WRITABLE, MX_FIFO_WRITABLE, "");
+        if (status == ZX_ERR_SHOULD_WAIT) {
+            zx_signals_t signals;
+            ASSERT_EQ(zx_object_wait_one(fifo, ZX_FIFO_WRITABLE, ZX_TIME_INFINITE, &signals),
+                      ZX_OK, "");
+            ASSERT_EQ(signals & ZX_FIFO_WRITABLE, ZX_FIFO_WRITABLE, "");
             goto retry_write;
         } else {
-            ASSERT_EQ(status, MX_OK, "");
+            ASSERT_EQ(status, ZX_OK, "");
         }
     }
 
     // Even though we never sent a request for TXN_END, we'll get a response because
     // we filled our txn to the brim.
-    mx_signals_t signals;
-    ASSERT_EQ(mx_object_wait_one(fifo, MX_FIFO_READABLE, MX_TIME_INFINITE, &signals),
-              MX_OK, "");
-    ASSERT_EQ(signals & MX_FIFO_READABLE, MX_FIFO_READABLE, "");
+    zx_signals_t signals;
+    ASSERT_EQ(zx_object_wait_one(fifo, ZX_FIFO_READABLE, ZX_TIME_INFINITE, &signals),
+              ZX_OK, "");
+    ASSERT_EQ(signals & ZX_FIFO_READABLE, ZX_FIFO_READABLE, "");
     block_fifo_response_t response;
     uint32_t count;
-    ASSERT_EQ(mx_fifo_read(fifo, &response, sizeof(block_fifo_response_t), &count), MX_OK, "");
-    ASSERT_EQ(response.status, MX_OK, "");
+    ASSERT_EQ(zx_fifo_read(fifo, &response, sizeof(block_fifo_response_t), &count), ZX_OK, "");
+    ASSERT_EQ(response.status, ZX_OK, "");
     ASSERT_EQ(response.txnid, txnid, "");
 
     // The txn should still be usable! We should still be able to send a close request.
-    ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), MX_OK, "Failed to free txn");
+    ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), ZX_OK, "Failed to free txn");
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -716,11 +716,11 @@
     int fd = get_testdev(&kBlockSize, &blk_count);
 
     // Create a connection to the blkdev
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
     txnid_t txnid;
     expected = sizeof(txnid_t);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
@@ -737,11 +737,11 @@
     request.length     = static_cast<uint32_t>(kBlockSize);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_IO, "Expected IO error with bad vmoid");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_IO, "Expected IO error with bad vmoid");
 
-    ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), MX_OK, "Failed to free txn");
+    ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), ZX_OK, "Failed to free txn");
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -754,11 +754,11 @@
     int fd = get_testdev(&kBlockSize, &blk_count);
 
     // Create a connection to the blkdev
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
 
     // Create a vmo
     test_vmo_object_t obj;
@@ -772,10 +772,10 @@
     request.length     = static_cast<uint32_t>(kBlockSize);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_IO, "Expected IO error with bad txnid");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_IO, "Expected IO error with bad txnid");
 
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -788,11 +788,11 @@
     int fd = get_testdev(&kBlockSize, &blk_count);
 
     // Create a connection to the blkdev
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
     txnid_t txnid;
     expected = sizeof(txnid_t);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
@@ -812,28 +812,28 @@
     request.length     = static_cast<uint32_t>(kBlockSize - 1);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS, "");
 
     // Send a request that has a non-block aligned length (+1)
     request.length     = static_cast<uint32_t>(kBlockSize + 1);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS, "");
 
     // Send a request that has a non-block aligned device offset
     request.length     = static_cast<uint32_t>(kBlockSize);
     request.vmo_offset = 0;
     request.dev_offset = 1;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS, "");
 
     // Actually, we don't care about aligning VMO offsets, so this request should be fine
     request.length     = static_cast<uint32_t>(kBlockSize);
     request.vmo_offset = 1;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_OK, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_OK, "");
 
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
@@ -846,11 +846,11 @@
     int fd = get_testdev(&kBlockSize, &blk_count);
 
     // Create a connection to the blkdev
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK, "");
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK, "");
     txnid_t txnid;
     expected = sizeof(txnid_t);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
@@ -858,18 +858,18 @@
     // Create a vmo which is not block aligned
     test_vmo_object_t obj;
     obj.vmo_size = kBlockSize - 1;
-    ASSERT_EQ(mx_vmo_create(obj.vmo_size, 0, &obj.vmo), MX_OK,
+    ASSERT_EQ(zx_vmo_create(obj.vmo_size, 0, &obj.vmo), ZX_OK,
               "Failed to create vmo");
     fbl::AllocChecker ac;
     obj.buf.reset(new (&ac) uint8_t[obj.vmo_size]);
     ASSERT_TRUE(ac.check(), "");
     fill_random(obj.buf.get(), obj.vmo_size);
     size_t actual;
-    ASSERT_EQ(mx_vmo_write(obj.vmo, obj.buf.get(), 0, obj.vmo_size, &actual),
-              MX_OK, "Failed to write to vmo");
+    ASSERT_EQ(zx_vmo_write(obj.vmo, obj.buf.get(), 0, obj.vmo_size, &actual),
+              ZX_OK, "Failed to write to vmo");
     ASSERT_EQ(obj.vmo_size, actual, "Could not write entire VMO");
-    mx_handle_t xfer_vmo;
-    ASSERT_EQ(mx_handle_duplicate(obj.vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo), MX_OK,
+    zx_handle_t xfer_vmo;
+    ASSERT_EQ(zx_handle_duplicate(obj.vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo), ZX_OK,
               "Failed to duplicate vmo");
     expected = sizeof(vmoid_t);
     ASSERT_EQ(ioctl_block_attach_vmo(fd, &xfer_vmo, &obj.vmoid), expected,
@@ -883,13 +883,13 @@
     request.length     = static_cast<uint32_t>(kBlockSize);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS, "");
     // Do the same thing, but for reading
     request.opcode     = BLOCKIO_READ;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS, "");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS, "");
 
     block_fifo_release_client(client);
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     close(fd);
     END_TEST;
 }
diff --git a/system/ulib/blktest/rules.mk b/system/ulib/blktest/rules.mk
index 9935039..d0b7872 100644
--- a/system/ulib/blktest/rules.mk
+++ b/system/ulib/blktest/rules.mk
@@ -17,13 +17,13 @@
     system/ulib/block-client \
     system/ulib/sync \
     system/ulib/pretty \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/ulib/block-client/client.c b/system/ulib/block-client/client.c
index a2ceb9c..9d6fe63 100644
--- a/system/ulib/block-client/client.c
+++ b/system/ulib/block-client/client.c
@@ -5,34 +5,34 @@
 #include <assert.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/device/block.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/device/block.h>
+#include <zircon/syscalls.h>
 #include <sync/completion.h>
 
 #include "block-client/client.h"
 
 // Writes on a FIFO, repeating the write later if the FIFO is full.
-static mx_status_t do_write(mx_handle_t fifo, block_fifo_request_t* request, size_t count) {
-    mx_status_t status;
+static zx_status_t do_write(zx_handle_t fifo, block_fifo_request_t* request, size_t count) {
+    zx_status_t status;
     while (true) {
         uint32_t actual;
-        status = mx_fifo_write(fifo, request, sizeof(block_fifo_request_t) * count, &actual);
-        if (status == MX_ERR_SHOULD_WAIT) {
-            mx_signals_t signals;
-            if ((status = mx_object_wait_one(fifo,
-                                             MX_FIFO_WRITABLE | MX_FIFO_PEER_CLOSED,
-                                             MX_TIME_INFINITE, &signals)) != MX_OK) {
+        status = zx_fifo_write(fifo, request, sizeof(block_fifo_request_t) * count, &actual);
+        if (status == ZX_ERR_SHOULD_WAIT) {
+            zx_signals_t signals;
+            if ((status = zx_object_wait_one(fifo,
+                                             ZX_FIFO_WRITABLE | ZX_FIFO_PEER_CLOSED,
+                                             ZX_TIME_INFINITE, &signals)) != ZX_OK) {
                 return status;
-            } else if (signals & MX_FIFO_PEER_CLOSED) {
-                return MX_ERR_PEER_CLOSED;
+            } else if (signals & ZX_FIFO_PEER_CLOSED) {
+                return ZX_ERR_PEER_CLOSED;
             }
             // Try writing again...
-        } else if (status == MX_OK) {
+        } else if (status == ZX_OK) {
             count -= actual;
             request += actual;
             if (count == 0) {
-                return MX_OK;
+                return ZX_OK;
             }
         } else {
             return status;
@@ -40,19 +40,19 @@
     }
 }
 
-static mx_status_t do_read(mx_handle_t fifo, block_fifo_response_t* response) {
-    mx_status_t status;
+static zx_status_t do_read(zx_handle_t fifo, block_fifo_response_t* response) {
+    zx_status_t status;
     while (true) {
         uint32_t count;
-        status = mx_fifo_read(fifo, response, sizeof(block_fifo_response_t), &count);
-        if (status == MX_ERR_SHOULD_WAIT) {
-            mx_signals_t signals;
-            if ((status = mx_object_wait_one(fifo,
-                                             MX_FIFO_READABLE | MX_FIFO_PEER_CLOSED,
-                                             MX_TIME_INFINITE, &signals)) != MX_OK) {
+        status = zx_fifo_read(fifo, response, sizeof(block_fifo_response_t), &count);
+        if (status == ZX_ERR_SHOULD_WAIT) {
+            zx_signals_t signals;
+            if ((status = zx_object_wait_one(fifo,
+                                             ZX_FIFO_READABLE | ZX_FIFO_PEER_CLOSED,
+                                             ZX_TIME_INFINITE, &signals)) != ZX_OK) {
                 return status;
-            } else if (signals & MX_FIFO_PEER_CLOSED) {
-                return MX_ERR_PEER_CLOSED;
+            } else if (signals & ZX_FIFO_PEER_CLOSED) {
+                return ZX_ERR_PEER_CLOSED;
             }
             // Try reading again...
         } else {
@@ -63,22 +63,22 @@
 
 typedef struct block_completion {
     completion_t completion;
-    mx_status_t status;
+    zx_status_t status;
 } block_completion_t;
 
 typedef struct fifo_client {
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     block_completion_t txns[MAX_TXN_COUNT];
 } fifo_client_t;
 
-mx_status_t block_fifo_create_client(mx_handle_t fifo, fifo_client_t** out) {
+zx_status_t block_fifo_create_client(zx_handle_t fifo, fifo_client_t** out) {
     fifo_client_t* client = calloc(sizeof(fifo_client_t), 1);
     if (client == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     client->fifo = fifo;
     *out = client;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void block_fifo_release_client(fifo_client_t* client) {
@@ -86,36 +86,36 @@
         return;
     }
 
-    mx_handle_close(client->fifo);
+    zx_handle_close(client->fifo);
     free(client);
 }
 
-mx_status_t block_fifo_txn(fifo_client_t* client, block_fifo_request_t* requests, size_t count) {
+zx_status_t block_fifo_txn(fifo_client_t* client, block_fifo_request_t* requests, size_t count) {
     if (count == 0) {
-        return MX_OK;
+        return ZX_OK;
     } else if (count > MAX_TXN_MESSAGES) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     txnid_t txnid = requests[0].txnid;
     assert(txnid < MAX_TXN_COUNT);
     completion_reset(&client->txns[txnid].completion);
-    client->txns[txnid].status = MX_ERR_IO;
+    client->txns[txnid].status = ZX_ERR_IO;
 
-    mx_status_t status;
+    zx_status_t status;
     for (size_t i = 0; i < count; i++) {
         assert(requests[i].txnid == txnid);
         requests[i].opcode = (requests[i].opcode & BLOCKIO_OP_MASK) |
                              (i == count - 1 ? BLOCKIO_TXN_END : 0);
     }
-    if ((status = do_write(client->fifo, &requests[0], count)) != MX_OK) {
+    if ((status = do_write(client->fifo, &requests[0], count)) != ZX_OK) {
         return status;
     }
 
     // As expected by the protocol, when we send one "BLOCKIO_TXN_END" message, we
     // must read a reply message.
     block_fifo_response_t response;
-    if ((status = do_read(client->fifo, &response)) != MX_OK) {
+    if ((status = do_read(client->fifo, &response)) != ZX_OK) {
         return status;
     }
 
@@ -125,7 +125,7 @@
     completion_signal(&client->txns[response_txnid].completion);
 
     // Wait for someone to signal us
-    completion_wait(&client->txns[txnid].completion, MX_TIME_INFINITE);
+    completion_wait(&client->txns[txnid].completion, ZX_TIME_INFINITE);
 
     return client->txns[txnid].status;
 }
diff --git a/system/ulib/block-client/include/block-client/client.h b/system/ulib/block-client/include/block-client/client.h
index ceec0ae..ab3f8c9 100644
--- a/system/ulib/block-client/include/block-client/client.h
+++ b/system/ulib/block-client/include/block-client/client.h
@@ -7,8 +7,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/device/block.h>
-#include <magenta/types.h>
+#include <zircon/device/block.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
@@ -16,7 +16,7 @@
 
 // Allocates a block fifo client. The client is thread-safe, as long
 // as each thread accessing the client uses a distinct txnid.
-mx_status_t block_fifo_create_client(mx_handle_t fifo, fifo_client_t** out);
+zx_status_t block_fifo_create_client(zx_handle_t fifo, fifo_client_t** out);
 
 // Frees a block fifo client
 void block_fifo_release_client(fifo_client_t* client);
@@ -35,6 +35,6 @@
 // length                                   read, write
 // vmo_offset                               read, write
 // dev_offset                               read, write
-mx_status_t block_fifo_txn(fifo_client_t* client, block_fifo_request_t* requests, size_t count);
+zx_status_t block_fifo_txn(fifo_client_t* client, block_fifo_request_t* requests, size_t count);
 
 __END_CDECLS
diff --git a/system/ulib/block-client/rules.mk b/system/ulib/block-client/rules.mk
index 1d363e0..51b2dae 100644
--- a/system/ulib/block-client/rules.mk
+++ b/system/ulib/block-client/rules.mk
@@ -17,8 +17,8 @@
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
 
 MODULE_HEADER_DEPS := system/ulib/ddk
 
diff --git a/system/ulib/bootdata/decompress.c b/system/ulib/bootdata/decompress.c
index c656a91..94a20b1 100644
--- a/system/ulib/bootdata/decompress.c
+++ b/system/ulib/bootdata/decompress.c
@@ -7,9 +7,9 @@
 #include <limits.h>
 #include <string.h>
 
-#include <magenta/boot/bootdata.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 
 #include <lz4/lz4.h>
 
@@ -23,8 +23,8 @@
 //  - Max block size is 64kB
 //
 //  See https://github.com/lz4/lz4/blob/dev/lz4_Frame_format.md for details.
-#define MX_LZ4_MAGIC 0x184D2204
-#define MX_LZ4_VERSION (1 << 6)
+#define ZX_LZ4_MAGIC 0x184D2204
+#define ZX_LZ4_VERSION (1 << 6)
 
 typedef struct {
     uint8_t flag;
@@ -33,64 +33,64 @@
     uint8_t header_cksum;
 } __PACKED lz4_frame_desc;
 
-#define MX_LZ4_FLAG_VERSION       (1 << 6)
-#define MX_LZ4_FLAG_BLOCK_DEP     (1 << 5)
-#define MX_LZ4_FLAG_BLOCK_CKSUM   (1 << 4)
-#define MX_LZ4_FLAG_CONTENT_SZ    (1 << 3)
-#define MX_LZ4_FLAG_CONTENT_CKSUM (1 << 2)
-#define MX_LZ4_FLAG_RESERVED      0x03
+#define ZX_LZ4_FLAG_VERSION       (1 << 6)
+#define ZX_LZ4_FLAG_BLOCK_DEP     (1 << 5)
+#define ZX_LZ4_FLAG_BLOCK_CKSUM   (1 << 4)
+#define ZX_LZ4_FLAG_CONTENT_SZ    (1 << 3)
+#define ZX_LZ4_FLAG_CONTENT_CKSUM (1 << 2)
+#define ZX_LZ4_FLAG_RESERVED      0x03
 
-#define MX_LZ4_BLOCK_MAX_MASK     (7 << 4)
-#define MX_LZ4_BLOCK_64KB         (4 << 4)
-#define MX_LZ4_BLOCK_256KB        (5 << 4)
-#define MX_LZ4_BLOCK_1MB          (6 << 4)
-#define MX_LZ4_BLOCK_4MB          (7 << 4)
+#define ZX_LZ4_BLOCK_MAX_MASK     (7 << 4)
+#define ZX_LZ4_BLOCK_64KB         (4 << 4)
+#define ZX_LZ4_BLOCK_256KB        (5 << 4)
+#define ZX_LZ4_BLOCK_1MB          (6 << 4)
+#define ZX_LZ4_BLOCK_4MB          (7 << 4)
 
-static mx_status_t check_lz4_frame(const lz4_frame_desc* fd,
+static zx_status_t check_lz4_frame(const lz4_frame_desc* fd,
                                    size_t expected, const char** err) {
-    if ((fd->flag & MX_LZ4_FLAG_VERSION) != MX_LZ4_VERSION) {
+    if ((fd->flag & ZX_LZ4_FLAG_VERSION) != ZX_LZ4_VERSION) {
         *err = "bad lz4 version for bootfs";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if ((fd->flag & MX_LZ4_FLAG_BLOCK_DEP) == 0) {
+    if ((fd->flag & ZX_LZ4_FLAG_BLOCK_DEP) == 0) {
         *err = "bad lz4 flag (blocks must be independent)";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if (fd->flag & MX_LZ4_FLAG_BLOCK_CKSUM) {
+    if (fd->flag & ZX_LZ4_FLAG_BLOCK_CKSUM) {
         *err = "bad lz4 flag (block checksum must be disabled)";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if ((fd->flag & MX_LZ4_FLAG_CONTENT_SZ) == 0) {
+    if ((fd->flag & ZX_LZ4_FLAG_CONTENT_SZ) == 0) {
         *err = "bad lz4 flag (content size must be included)";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if (fd->flag & MX_LZ4_FLAG_RESERVED) {
+    if (fd->flag & ZX_LZ4_FLAG_RESERVED) {
         *err = "bad lz4 flag (reserved bits in flg must be zero)";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if ((fd->block_desc & MX_LZ4_BLOCK_MAX_MASK) != MX_LZ4_BLOCK_64KB) {
+    if ((fd->block_desc & ZX_LZ4_BLOCK_MAX_MASK) != ZX_LZ4_BLOCK_64KB) {
         *err = "bad lz4 flag (max block size must be 64k)";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    if (fd->block_desc & ~MX_LZ4_BLOCK_MAX_MASK) {
+    if (fd->block_desc & ~ZX_LZ4_BLOCK_MAX_MASK) {
         *err = "bad lz4 flag (reserved bits in bd must be zero)";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (fd->content_size != expected) {
         *err = "lz4 content size does not match bootdata outsize";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // TODO: header checksum
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t decompress_bootfs_vmo(mx_handle_t vmar, const uint8_t* data,
-                                         size_t _outsize, mx_handle_t* out,
+static zx_status_t decompress_bootfs_vmo(zx_handle_t vmar, const uint8_t* data,
+                                         size_t _outsize, zx_handle_t* out,
                                          const char** err) {
-    if (*(const uint32_t*)data != MX_LZ4_MAGIC) {
+    if (*(const uint32_t*)data != ZX_LZ4_MAGIC) {
         *err = "bad magic number for compressed bootfs";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     data += sizeof(uint32_t);
 
@@ -101,21 +101,21 @@
     if (outsize < _outsize) {
         // newsize wrapped, which means the outsize was too large
         *err = "lz4 output size too large";
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    mx_handle_t dst_vmo;
-    mx_status_t status = mx_vmo_create((uint64_t)outsize, 0, &dst_vmo);
+    zx_handle_t dst_vmo;
+    zx_status_t status = zx_vmo_create((uint64_t)outsize, 0, &dst_vmo);
     if (status < 0) {
-        *err = "mx_vmo_create failed for decompressing bootfs";
+        *err = "zx_vmo_create failed for decompressing bootfs";
         return status;
     }
-    mx_object_set_property(dst_vmo, MX_PROP_NAME, "bootfs", 6);
+    zx_object_set_property(dst_vmo, ZX_PROP_NAME, "bootfs", 6);
 
     uintptr_t dst_addr = 0;
-    status = mx_vmar_map(vmar, 0, dst_vmo, 0, outsize,
-            MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &dst_addr);
+    status = zx_vmar_map(vmar, 0, dst_vmo, 0, outsize,
+            ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &dst_addr);
     if (status < 0) {
-        *err = "mx_vmar_map failed on bootfs vmo during decompression";
+        *err = "zx_vmar_map failed on bootfs vmo during decompression";
         return status;
     }
 
@@ -135,21 +135,21 @@
             if (remaining - actual > remaining) {
                 // Remaining wrapped around (would be negative if signed)
                 *err = "bootdata outsize too small for lz4 decompression";
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
             remaining -= actual;
         } else {
             int dcmp = LZ4_decompress_safe((const char*)data, (char*)dst, blocksize, remaining);
             if (dcmp < 0) {
                 *err = "lz4 decompression failed";
-                return MX_ERR_BAD_STATE;
+                return ZX_ERR_BAD_STATE;
             }
             dst += dcmp;
             data += blocksize;
             if (remaining - dcmp > remaining) {
                 // Remaining wrapped around (would be negative if signed)
                 *err = "bootdata outsize too small for lz4 decompression";
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
             remaining -= dcmp;
         }
@@ -163,35 +163,35 @@
     // we rounded up to the next full page.
     if (remaining > 4095) {
         *err = "bootdata size error; outsize does not match decompressed size";
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    status = mx_vmar_unmap(vmar, dst_addr, outsize);
+    status = zx_vmar_unmap(vmar, dst_addr, outsize);
     if (status < 0) {
-        *err = "mx_vmar_unmap after decompress failed";
+        *err = "zx_vmar_unmap after decompress failed";
         return status;
     }
     *out = dst_vmo;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t decompress_bootdata(mx_handle_t vmar, mx_handle_t vmo,
+zx_status_t decompress_bootdata(zx_handle_t vmar, zx_handle_t vmo,
                                 size_t offset, size_t length,
-                                mx_handle_t* out, const char** err) {
+                                zx_handle_t* out, const char** err) {
     *err = "none";
 
     if (length > SIZE_MAX) {
         *err = "bootfs VMO too large to map";
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
 
     uintptr_t addr = 0;
     size_t aligned_offset = offset & ~(PAGE_SIZE - 1);
     size_t align_shift = offset - aligned_offset;
     length += align_shift;
-    mx_status_t status = mx_vmar_map(vmar, 0, vmo, aligned_offset, length, MX_VM_FLAG_PERM_READ, &addr);
+    zx_status_t status = zx_vmar_map(vmar, 0, vmo, aligned_offset, length, ZX_VM_FLAG_PERM_READ, &addr);
     if (status < 0) {
-        *err = "mx_vmar_map failed on bootfs vmo";
+        *err = "zx_vmar_map failed on bootfs vmo";
         return status;
     }
     uintptr_t bootdata_addr = addr + align_shift;
@@ -210,13 +210,13 @@
         break;
     default:
         *err = "unknown bootdata type, not attempting decompression\n";
-        status = MX_ERR_NOT_SUPPORTED;
+        status = ZX_ERR_NOT_SUPPORTED;
         break;
     }
 
-    mx_status_t s = mx_vmar_unmap(vmar, addr, length);
+    zx_status_t s = zx_vmar_unmap(vmar, addr, length);
     if (s < 0) {
-        *err = "mx_vmar_unmap failed on bootfs vmo";
+        *err = "zx_vmar_unmap failed on bootfs vmo";
         return s;
     }
 
diff --git a/system/ulib/bootdata/include/bootdata/decompress.h b/system/ulib/bootdata/include/bootdata/decompress.h
index 860ca30..77c6c75 100644
--- a/system/ulib/bootdata/include/bootdata/decompress.h
+++ b/system/ulib/bootdata/include/bootdata/decompress.h
@@ -7,13 +7,13 @@
 
 #pragma GCC visibility push(hidden)
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 // Decompress bootdata at offset of total size length into a new VMO
 // On failure, errmsg is a human readable error description to provide
 // more precise debug information.
-mx_status_t decompress_bootdata(mx_handle_t vmar, mx_handle_t vmo,
+zx_status_t decompress_bootdata(zx_handle_t vmar, zx_handle_t vmo,
                                 size_t offset, size_t length,
-                                mx_handle_t* out, const char** errmsg);
+                                zx_handle_t* out, const char** errmsg);
 
 #pragma GCC visibility pop
diff --git a/system/ulib/bootdata/rules.mk b/system/ulib/bootdata/rules.mk
index ef08adb..3181bbf 100644
--- a/system/ulib/bootdata/rules.mk
+++ b/system/ulib/bootdata/rules.mk
@@ -12,7 +12,7 @@
 
 MODULE_LIBS := \
     third_party/ulib/lz4 \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/c/rules.mk b/system/ulib/c/rules.mk
index 11db187..d603a0a 100644
--- a/system/ulib/c/rules.mk
+++ b/system/ulib/c/rules.mk
@@ -5,7 +5,7 @@
 # The libc source lives in third_party/ulib/musl
 
 # This rules.mk exists to satisfy the requirements
-# of the Magenta build's module system, allowing
+# of the Zircon build's module system, allowing
 # libc to be referred to as "system/ulib/c" throughout the
 # build instead of the more confusing "system/ulib/musl".
 
diff --git a/system/ulib/ddk/include/ddk/binding.h b/system/ulib/ddk/include/ddk/binding.h
index e9f99ac..3785aa6 100644
--- a/system/ulib/ddk/include/ddk/binding.h
+++ b/system/ulib/ddk/include/ddk/binding.h
@@ -4,5 +4,5 @@
 
 #pragma once
 
-#include <magenta/driver/binding.h>
+#include <zircon/driver/binding.h>
 
diff --git a/system/ulib/ddk/include/ddk/debug.h b/system/ulib/ddk/include/ddk/debug.h
index e39b76d..d6666f1 100644
--- a/system/ulib/ddk/include/ddk/debug.h
+++ b/system/ulib/ddk/include/ddk/debug.h
@@ -8,8 +8,8 @@
 #include <stdio.h>
 
 #include <ddk/driver.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/log.h>
 
 __BEGIN_CDECLS
 
@@ -20,47 +20,47 @@
 // should avoid flooding the log (if an error is likely to happen
 // repeatedly, rapidly, it should throttle its dprintf()s).
 // Error messages are always displayed by default.
-#define DDK_LOG_ERROR    MX_LOG_ERROR
+#define DDK_LOG_ERROR    ZX_LOG_ERROR
 
 // Info messages should provide terse information messages
 // around driver startup, shutdown or state change.  They
 // should be concise, infrequent, and one-line whenever possible.
 // Info messages are always displayed by default.
-#define DDK_LOG_INFO     MX_LOG_INFO
+#define DDK_LOG_INFO     ZX_LOG_INFO
 
 // Trace messages are intended to provide detailed information
 // about what a driver is doing (start/end of transaction, etc)
 // They should aim for terseness, but provide visibility into
 // driver operation.  They are not displayed by default.
-#define DDK_LOG_TRACE    MX_LOG_TRACE
+#define DDK_LOG_TRACE    ZX_LOG_TRACE
 
 // Spew messages are extremely verbose driver state tracing
 // (possibly including register dumps / full state dumps).
 // They are not displayed by default.
-#define DDK_LOG_SPEW     MX_LOG_SPEW
+#define DDK_LOG_SPEW     ZX_LOG_SPEW
 
 // Debug1 through Debug4 messages are driver specific, and not
 // displayed by default.  Consult driver source or documentation
 // to learn if these messages exist for a specific driver and
 // what they're used for.
-#define DDK_LOG_DEBUG1   MX_LOG_DEBUG1
-#define DDK_LOG_DEBUG2   MX_LOG_DEBUG2
-#define DDK_LOG_DEBUG3   MX_LOG_DEBUG3
-#define DDK_LOG_DEBUG4   MX_LOG_DEBUG4
+#define DDK_LOG_DEBUG1   ZX_LOG_DEBUG1
+#define DDK_LOG_DEBUG2   ZX_LOG_DEBUG2
+#define DDK_LOG_DEBUG3   ZX_LOG_DEBUG3
+#define DDK_LOG_DEBUG4   ZX_LOG_DEBUG4
 
 
 // Local variants of log levels.  These levels will flag debug
 // messages so they do not get sent over the network.  They're
 // useful for network core or driver logging that would otherwise
 // spiral out of control as it logs about packets about logging...
-#define DDK_LOG_LERROR   (MX_LOG_ERROR | MX_LOG_LOCAL)
-#define DDK_LOG_LINFO    (MX_LOG_INFO | MX_LOG_LOCAL)
-#define DDK_LOG_LTRACE   (MX_LOG_TRACE | MX_LOG_LOCAL)
-#define DDK_LOG_LSPEW    (MX_LOG_SPEW | MX_LOG_LOCAL)
-#define DDK_LOG_LDEBUG1  (MX_LOG_DEBUG1 | MX_LOG_LOCAL)
-#define DDK_LOG_LDEBUG2  (MX_LOG_DEBUG2 | MX_LOG_LOCAL)
-#define DDK_LOG_LDEBUG3  (MX_LOG_DEBUG3 | MX_LOG_LOCAL)
-#define DDK_LOG_LDEBUG4  (MX_LOG_DEBUG4 | MX_LOG_LOCAL)
+#define DDK_LOG_LERROR   (ZX_LOG_ERROR | ZX_LOG_LOCAL)
+#define DDK_LOG_LINFO    (ZX_LOG_INFO | ZX_LOG_LOCAL)
+#define DDK_LOG_LTRACE   (ZX_LOG_TRACE | ZX_LOG_LOCAL)
+#define DDK_LOG_LSPEW    (ZX_LOG_SPEW | ZX_LOG_LOCAL)
+#define DDK_LOG_LDEBUG1  (ZX_LOG_DEBUG1 | ZX_LOG_LOCAL)
+#define DDK_LOG_LDEBUG2  (ZX_LOG_DEBUG2 | ZX_LOG_LOCAL)
+#define DDK_LOG_LDEBUG3  (ZX_LOG_DEBUG3 | ZX_LOG_LOCAL)
+#define DDK_LOG_LDEBUG4  (ZX_LOG_DEBUG4 | ZX_LOG_LOCAL)
 
 
 void driver_printf(uint32_t flags, const char* fmt, ...);
@@ -80,17 +80,17 @@
 //
 #define dprintf(flag, fmt...) \
     do { \
-        if ((DDK_LOG_##flag & MX_LOG_LEVEL_MASK) & __magenta_driver_rec__.log_flags) { \
+        if ((DDK_LOG_##flag & ZX_LOG_LEVEL_MASK) & __zircon_driver_rec__.log_flags) { \
             driver_printf(DDK_LOG_##flag, fmt); \
         } \
     } while (0)
 
 static inline void driver_set_log_flags(uint32_t flags) {
-    __magenta_driver_rec__.log_flags = flags;
+    __zircon_driver_rec__.log_flags = flags;
 }
 
 static inline uint32_t driver_get_log_flags(void) {
-    return __magenta_driver_rec__.log_flags;
+    return __zircon_driver_rec__.log_flags;
 }
 
 __END_CDECLS
diff --git a/system/ulib/ddk/include/ddk/device.h b/system/ulib/ddk/include/ddk/device.h
index 6f4ea81..2e0ca34 100644
--- a/system/ulib/ddk/include/ddk/device.h
+++ b/system/ulib/ddk/include/ddk/device.h
@@ -4,24 +4,24 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/device/device.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/device/device.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <ddk/iotxn.h>
-#include <magenta/listnode.h>
+#include <zircon/listnode.h>
 
 __BEGIN_CDECLS;
 
-typedef struct mx_device mx_device_t;
-typedef struct mx_driver mx_driver_t;
-typedef struct mx_device_prop mx_device_prop_t;
+typedef struct zx_device zx_device_t;
+typedef struct zx_driver zx_driver_t;
+typedef struct zx_device_prop zx_device_prop_t;
 
-typedef struct mx_protocol_device mx_protocol_device_t;
+typedef struct zx_protocol_device zx_protocol_device_t;
 
-#define MX_DEVICE_NAME_MAX 31
+#define ZX_DEVICE_NAME_MAX 31
 
-// echo -n "mx_device_ops_v0.5" | sha256sum | cut -c1-16
+// echo -n "zx_device_ops_v0.5" | sha256sum | cut -c1-16
 #define DEVICE_OPS_VERSION 0Xc9410d2a24f57424
 
 //@doc(docs/ddk/device-ops.md)
@@ -35,19 +35,19 @@
 // by the default implementation that is used for each hook if the
 // driver does not provide its own implementation.
 
-typedef struct mx_protocol_device {
+typedef struct zx_protocol_device {
     //@ ## version
     // This field must be set to `DEVICE_OPS_VERSION`
     uint64_t version;
 
-    mx_status_t (*get_protocol)(void* ctx, uint32_t proto_id, void* protocol);
+    zx_status_t (*get_protocol)(void* ctx, uint32_t proto_id, void* protocol);
 
     //@ ## open
     //
     // The open hook is called when a device is opened via the device filesystem,
     // or when an existing open connection to a device is cloned (for example,
     // when a device fd is shared with another process).  The default open hook,
-    // if a driver does not implement one, simply returns **MX_OK**.
+    // if a driver does not implement one, simply returns **ZX_OK**.
     //
     // Drivers may want to implement open to disallow simultaneous access (by
     // failing if the device is already open), or to return a new **device instance**
@@ -59,7 +59,7 @@
     // A child created for return as an instance **must** be created with the
     // **DEVICE_ADD_INSTANCE** flag set in the arguments to **device_add()**.
     //
-    mx_status_t (*open)(void* ctx, mx_device_t** dev_out, uint32_t flags);
+    zx_status_t (*open)(void* ctx, zx_device_t** dev_out, uint32_t flags);
 
     //@ ## open_at
     // The open_at hook is called in the event that the open path to the device
@@ -67,9 +67,9 @@
     // exists as `/dev/misc/foo` and an attempt is made to `open("/dev/misc/foo/bar",...)`,
     // the open_at hook would be invoked with a *path* of `"bar"`.
     //
-    // The default open_at implementation returns **MX_ERR_NOT_SUPPORTED**
+    // The default open_at implementation returns **ZX_ERR_NOT_SUPPORTED**
     //
-    mx_status_t (*open_at)(void* ctx, mx_device_t** dev_out, const char* path, uint32_t flags);
+    zx_status_t (*open_at)(void* ctx, zx_device_t** dev_out, const char* path, uint32_t flags);
 
     //@ ## close
     // The close hook is called when a connection to a device is closed.  These
@@ -78,8 +78,8 @@
     // **Note:** If open or open_at return a **device instance**, the balancing close
     // hook that is called is the close hook on the **instance**, not the parent.
     //
-    // The default close implementation returns **MX_OK**.
-    mx_status_t (*close)(void* ctx, uint32_t flags);
+    // The default close implementation returns **ZX_OK**.
+    zx_status_t (*close)(void* ctx, uint32_t flags);
 
     //@ ## unbind
     // The unbind hook is called when the parent of this device is being removed (due
@@ -101,7 +101,7 @@
     // removed and released.
     //
     // At the point release is invoked, the driver will not receive any further calls
-    // and absolutely must not use the underlying **mx_device_t** once this method
+    // and absolutely must not use the underlying **zx_device_t** once this method
     // returns.
     //
     // The driver must free all memory and release all resources related to this device
@@ -112,40 +112,40 @@
     // The read hook is an attempt to do a non-blocking read operation.
     //
     // On success *actual* must be set to the number of bytes read (which may be less
-    // than the number requested in *count*), and return **MX_OK**.
+    // than the number requested in *count*), and return **ZX_OK**.
     //
     // A successful read of 0 bytes is generally treated as an End Of File notification
     // by clients.
     //
-    // If no data is available now, **MX_ERR_SHOULD_WAIT** must be returned and when
+    // If no data is available now, **ZX_ERR_SHOULD_WAIT** must be returned and when
     // data becomes available `device_state_set(DEVICE_STATE_READABLE)` may be used to
     // signal waiting clients.
     //
     // This hook **must not block**.  Use `iotxn_queue` to handle IO which
     // requires processing and delayed status.
     //
-    // The default read implementation returns **MX_ERR_NOT_SUPPORTED**.
+    // The default read implementation returns **ZX_ERR_NOT_SUPPORTED**.
     //
-    mx_status_t (*read)(void* ctx, void* buf, size_t count,
-                        mx_off_t off, size_t* actual);
+    zx_status_t (*read)(void* ctx, void* buf, size_t count,
+                        zx_off_t off, size_t* actual);
 
     //@ ## write
     // The write hook is an attempt to do a non-blocking write operation.
     //
     // On success *actual* must be set to the number of bytes written (which may be
-    // less than the number requested in *count*), and **MX_OK** should be returned.
+    // less than the number requested in *count*), and **ZX_OK** should be returned.
     //
-    // If it is not possible to write data at present **MX_ERR_SHOULD_WAIT** must
+    // If it is not possible to write data at present **ZX_ERR_SHOULD_WAIT** must
     // be returned and when it is again possible to write,
     // `device_state_set(DEVICE_STATE_WRITABLE)` may be used to signal waiting clients.
     //
     // This hook **must not block**.  Use `iotxn_queue` to handle IO which
     // requires processing and delayed status.
     //
-    // The default write implementation returns **MX_ERR_NOT_SUPPORTED**.
+    // The default write implementation returns **ZX_ERR_NOT_SUPPORTED**.
     //
-    mx_status_t (*write)(void* ctx, const void* buf, size_t count,
-                         mx_off_t off, size_t* actual);
+    zx_status_t (*write)(void* ctx, const void* buf, size_t count,
+                         zx_off_t off, size_t* actual);
 
     //@ ## iotxn_queue
     // The iotxn_queue hook is the core mechanism for asynchronous IO.  A driver that
@@ -171,60 +171,60 @@
     // This is the offset at which no more reads or writes are possible.
     //
     // The default implementation returns 0.
-    mx_off_t (*get_size)(void* ctx);
+    zx_off_t (*get_size)(void* ctx);
 
     //@ ## ioctl
     // The ioctl hook allows support for device-specific operations.
     //
     // These, like read, write, and iotxn_queue, must not block.
     //
-    // On success, **MX_OK** must be returned and *out_actual* must be set
+    // On success, **ZX_OK** must be returned and *out_actual* must be set
     // to the number of output bytes provided (0 if none).
     //
-    // The default ioctl implementation returns **MX_ERR_NOT_SUPPORTED**.
-    mx_status_t (*ioctl)(void* ctx, uint32_t op,
+    // The default ioctl implementation returns **ZX_ERR_NOT_SUPPORTED**.
+    zx_status_t (*ioctl)(void* ctx, uint32_t op,
                          const void* in_buf, size_t in_len,
                          void* out_buf, size_t out_len, size_t* out_actual);
 
     // Stops the device and puts it in a low power mode
-    mx_status_t (*suspend)(void* ctx, uint32_t flags);
+    zx_status_t (*suspend)(void* ctx, uint32_t flags);
 
     // Restarts the device after being suspended
-    mx_status_t (*resume)(void* ctx, uint32_t flags);
-} mx_protocol_device_t;
+    zx_status_t (*resume)(void* ctx, uint32_t flags);
+} zx_protocol_device_t;
 
 
 // Device Accessors
-const char* device_get_name(mx_device_t* dev);
+const char* device_get_name(zx_device_t* dev);
 
-mx_device_t* device_get_parent(mx_device_t* dev);
+zx_device_t* device_get_parent(zx_device_t* dev);
 
-mx_handle_t device_get_resource(mx_device_t* dev);
+zx_handle_t device_get_resource(zx_device_t* dev);
 
 // protocols look like:
 // typedef struct {
 //     protocol_xyz_ops_t* ops;
 //     void* ctx;
 // } protocol_xyz_t;
-mx_status_t device_get_protocol(mx_device_t* dev, uint32_t proto_id, void* protocol);
+zx_status_t device_get_protocol(zx_device_t* dev, uint32_t proto_id, void* protocol);
 
 
 // Direct Device Ops Functions
-mx_status_t device_read(mx_device_t* dev, void* buf, size_t count,
-                        mx_off_t off, size_t* actual);
+zx_status_t device_read(zx_device_t* dev, void* buf, size_t count,
+                        zx_off_t off, size_t* actual);
 
-mx_status_t device_write(mx_device_t* dev, const void* buf, size_t count,
-                         mx_off_t off, size_t* actual);
+zx_status_t device_write(zx_device_t* dev, const void* buf, size_t count,
+                         zx_off_t off, size_t* actual);
 
-mx_off_t device_get_size(mx_device_t* dev);
+zx_off_t device_get_size(zx_device_t* dev);
 
-mx_status_t device_ioctl(mx_device_t* dev, uint32_t op,
+zx_status_t device_ioctl(zx_device_t* dev, uint32_t op,
                          const void* in_buf, size_t in_len,
                          void* out_buf, size_t out_len, size_t* out_actual);
 
-// return MX_ERR_NOT_SUPPORTED if this device does not support the iotxn_queue op
-// otherwise returns MX_OK aftering queuing the iotxn
-mx_status_t device_iotxn_queue(mx_device_t* dev, iotxn_t* txn);
+// return ZX_ERR_NOT_SUPPORTED if this device does not support the iotxn_queue op
+// otherwise returns ZX_OK aftering queuing the iotxn
+zx_status_t device_iotxn_queue(zx_device_t* dev, iotxn_t* txn);
 
 
 // Device State Change Functions
@@ -237,13 +237,13 @@
 #define DEV_STATE_OOB DEVICE_SIGNAL_OOB
 //}
 
-void device_state_clr_set(mx_device_t* dev, mx_signals_t clearflag, mx_signals_t setflag);
+void device_state_clr_set(zx_device_t* dev, zx_signals_t clearflag, zx_signals_t setflag);
 
 //@ #### device_state_set
-static inline void device_state_set(mx_device_t* dev, mx_signals_t stateflag) {
+static inline void device_state_set(zx_device_t* dev, zx_signals_t stateflag) {
     device_state_clr_set(dev, 0, stateflag);
 }
-static inline void device_state_clr(mx_device_t* dev, mx_signals_t stateflag) {
+static inline void device_state_clr(zx_device_t* dev, zx_signals_t stateflag) {
     device_state_clr_set(dev, stateflag, 0);
 }
 
diff --git a/system/ulib/ddk/include/ddk/driver.h b/system/ulib/ddk/include/ddk/driver.h
index e76736a..2a7489a 100644
--- a/system/ulib/ddk/include/ddk/driver.h
+++ b/system/ulib/ddk/include/ddk/driver.h
@@ -4,53 +4,53 @@
 
 #pragma once
 
-#include <magenta/types.h>
-#include <magenta/listnode.h>
-#include <magenta/compiler.h>
+#include <zircon/types.h>
+#include <zircon/listnode.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 __BEGIN_CDECLS;
 
-typedef struct mx_device mx_device_t;
-typedef struct mx_driver mx_driver_t;
-typedef struct mx_protocol_device mx_protocol_device_t;
-typedef struct mx_device_prop mx_device_prop_t;
-typedef struct mx_driver_rec mx_driver_rec_t;
+typedef struct zx_device zx_device_t;
+typedef struct zx_driver zx_driver_t;
+typedef struct zx_protocol_device zx_protocol_device_t;
+typedef struct zx_device_prop zx_device_prop_t;
+typedef struct zx_driver_rec zx_driver_rec_t;
 
-typedef struct mx_bind_inst mx_bind_inst_t;
-typedef struct mx_driver_binding mx_driver_binding_t;
+typedef struct zx_bind_inst zx_bind_inst_t;
+typedef struct zx_driver_binding zx_driver_binding_t;
 
-// echo -n "mx_driver_ops_v0.5" | sha256sum | cut -c1-16
+// echo -n "zx_driver_ops_v0.5" | sha256sum | cut -c1-16
 #define DRIVER_OPS_VERSION 0x2b3490fa40d9f452
 
-typedef struct mx_driver_ops {
+typedef struct zx_driver_ops {
     uint64_t version;   // DRIVER_OPS_VERSION
 
     // Opportunity to do on-load work.
     // Called ony once, before any other ops are called.
     // The driver may optionally return a context pointer to be passed
     // to the other driver ops.
-    mx_status_t (*init)(void** out_ctx);
+    zx_status_t (*init)(void** out_ctx);
 
     // Requests that the driver bind to the provided device,
     // initialize it, and publish and children.
     // On success, the cookie is remembered and passed back on unbind.
-    mx_status_t (*bind)(void* ctx, mx_device_t* device, void** cookie);
+    zx_status_t (*bind)(void* ctx, zx_device_t* device, void** cookie);
 
     // Notifies driver that the device which the driver bound to
     // is being removed.  Called after the unbind() op of any devices
     // that are children of that device.
-    void (*unbind)(void* ctx, mx_device_t* device, void* cookie);
+    void (*unbind)(void* ctx, zx_device_t* device, void* cookie);
 
     // Only provided by bus manager drivers, create() is invoked to
     // instantiate a bus device instance in a new device host process
-    mx_status_t (*create)(void* ctx, mx_device_t* parent,
+    zx_status_t (*create)(void* ctx, zx_device_t* parent,
                           const char* name, const char* args,
-                          mx_handle_t resource);
+                          zx_handle_t resource);
 
     // Last call before driver is unloaded.
     void (*release)(void* ctx);
-} mx_driver_ops_t;
+} zx_driver_ops_t;
 
 // echo -n "device_add_args_v0.5" | sha256sum | cut -c1-16
 #define DEVICE_ADD_ARGS_VERSION 0x96a64134d56e88e3
@@ -65,15 +65,15 @@
 typedef struct device_add_args {
     uint64_t version;   // DEVICE_ADD_ARGS_VERSION
     // driver name is copied to internal structure
-    // max length is MX_DEVICE_NAME_MAX
+    // max length is ZX_DEVICE_NAME_MAX
     const char* name;
     // context pointer for use by the driver
-    // and passed to driver in all mx_protocol_device_t callbacks
+    // and passed to driver in all zx_protocol_device_t callbacks
     void* ctx;
     // pointer to device's device protocol operations
-    mx_protocol_device_t* ops;
+    zx_protocol_device_t* ops;
     // optional list of device properties
-    mx_device_prop_t* props;
+    zx_device_prop_t* props;
     // number of device properties
     uint32_t prop_count;
     // optional custom protocol for this device
@@ -83,22 +83,22 @@
     // arguments used with DEVICE_ADD_BUSDEV
     const char* busdev_args;
     // resource handle used with DEVICE_ADD_BUSDEV
-     mx_handle_t rsrc;
+     zx_handle_t rsrc;
     // one or more of DEVICE_ADD_*
     uint32_t flags;
 } device_add_args_t;
 
-struct mx_driver_rec {
-    const mx_driver_ops_t* ops;
-    mx_driver_t* driver;
+struct zx_driver_rec {
+    const zx_driver_ops_t* ops;
+    zx_driver_t* driver;
     uint32_t log_flags;
 };
 
 // This global symbol is initialized by the driver loader in devhost
-extern mx_driver_rec_t __magenta_driver_rec__;
+extern zx_driver_rec_t __zircon_driver_rec__;
 
-mx_status_t device_add_from_driver(mx_driver_t* drv, mx_device_t* parent,
-                              device_add_args_t* args, mx_device_t** out);
+zx_status_t device_add_from_driver(zx_driver_t* drv, zx_device_t* parent,
+                              device_add_args_t* args, zx_device_t** out);
 
 // Creates a device and adds it to the devmgr.
 // device_add_args_t contains all "in" arguments.
@@ -108,29 +108,29 @@
 // The newly added device will be active before this call returns, so be sure to have
 // the "out" pointer point to your device-local structure so callbacks can access
 // it immediately.
-static inline mx_status_t device_add(mx_device_t* parent, device_add_args_t* args, mx_device_t** out) {
-    return device_add_from_driver(__magenta_driver_rec__.driver, parent, args, out);
+static inline zx_status_t device_add(zx_device_t* parent, device_add_args_t* args, zx_device_t** out) {
+    return device_add_from_driver(__zircon_driver_rec__.driver, parent, args, out);
 }
 
-mx_status_t device_remove(mx_device_t* device);
-mx_status_t device_rebind(mx_device_t* device);
+zx_status_t device_remove(zx_device_t* device);
+zx_status_t device_rebind(zx_device_t* device);
 
-void device_unbind(mx_device_t* dev);
+void device_unbind(zx_device_t* dev);
 
 #define ROUNDUP(a, b)   (((a) + ((b)-1)) & ~((b)-1))
 #define ROUNDDOWN(a, b) ((a) & ~((b)-1))
 #define ALIGN(a, b) ROUNDUP(a, b)
 
 // temporary accessor for root resource handle
-mx_handle_t get_root_resource(void);
+zx_handle_t get_root_resource(void);
 
 // Drivers may need to load firmware for a device, typically during the call to
 // bind the device. The devmgr will look for the firmware at the given path
 // relative to system-defined locations for device firmware. The file will be
 // loaded into a vmo pointed to by fw. The actual size of the firmware will be
 // returned in size.
-mx_status_t load_firmware(mx_device_t* device, const char* path,
-                          mx_handle_t* fw, size_t* size);
+zx_status_t load_firmware(zx_device_t* device, const char* path,
+                          zx_handle_t* fw, size_t* size);
 
 // panic is for handling non-recoverable, non-reportable fatal
 // errors in a way that will get logged.  Right now this just
@@ -142,7 +142,7 @@
 }
 
 // Protocol Identifiers
-#define DDK_PROTOCOL_DEF(tag, val, name, flags) MX_PROTOCOL_##tag = val,
+#define DDK_PROTOCOL_DEF(tag, val, name, flags) ZX_PROTOCOL_##tag = val,
 enum {
 #include <ddk/protodefs.h>
 };
diff --git a/system/ulib/ddk/include/ddk/io-buffer.h b/system/ulib/ddk/include/ddk/io-buffer.h
index 2c2fde9..b53a85c 100644
--- a/system/ulib/ddk/include/ddk/io-buffer.h
+++ b/system/ulib/ddk/include/ddk/io-buffer.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 #include <stdbool.h>
 #include <stddef.h>
@@ -14,45 +14,45 @@
 __BEGIN_CDECLS;
 
 typedef struct {
-    mx_handle_t vmo_handle;
+    zx_handle_t vmo_handle;
     size_t size;
-    mx_off_t offset;
+    zx_off_t offset;
     void* virt;
-    mx_paddr_t phys;
+    zx_paddr_t phys;
 } io_buffer_t;
 
 enum {
-    IO_BUFFER_RO = MX_VM_FLAG_PERM_READ,
-    IO_BUFFER_RW = MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    IO_BUFFER_RO = ZX_VM_FLAG_PERM_READ,
+    IO_BUFFER_RW = ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
 };
 
 // Initializes a new io_buffer
-mx_status_t io_buffer_init(io_buffer_t* buffer, size_t size, uint32_t flags);
-mx_status_t io_buffer_init_aligned(io_buffer_t* buffer, size_t size, uint32_t alignment_log2, uint32_t flags);
+zx_status_t io_buffer_init(io_buffer_t* buffer, size_t size, uint32_t flags);
+zx_status_t io_buffer_init_aligned(io_buffer_t* buffer, size_t size, uint32_t alignment_log2, uint32_t flags);
 
 // Initializes an io_buffer base on an existing VMO.
 // duplicates the provided vmo_handle - does not take ownership
-mx_status_t io_buffer_init_vmo(io_buffer_t* buffer, mx_handle_t vmo_handle,
-                               mx_off_t offset, uint32_t flags);
+zx_status_t io_buffer_init_vmo(io_buffer_t* buffer, zx_handle_t vmo_handle,
+                               zx_off_t offset, uint32_t flags);
 
 // Initializes an io_buffer that maps a given physical address
-mx_status_t io_buffer_init_physical(io_buffer_t* buffer, mx_paddr_t addr, size_t size,
-                                    mx_handle_t resource, uint32_t cache_policy);
+zx_status_t io_buffer_init_physical(io_buffer_t* buffer, zx_paddr_t addr, size_t size,
+                                    zx_handle_t resource, uint32_t cache_policy);
 
-mx_status_t io_buffer_cache_op(io_buffer_t* buffer, const uint32_t op,
-                               const mx_off_t offset, const size_t size);
+zx_status_t io_buffer_cache_op(io_buffer_t* buffer, const uint32_t op,
+                               const zx_off_t offset, const size_t size);
 // Releases an io_buffer
 void io_buffer_release(io_buffer_t* buffer);
 
 static inline bool io_buffer_is_valid(io_buffer_t* buffer) {
-    return (buffer->vmo_handle != MX_HANDLE_INVALID);
+    return (buffer->vmo_handle != ZX_HANDLE_INVALID);
 }
 
 static inline void* io_buffer_virt(io_buffer_t* buffer) {
     return (void*)(((uintptr_t)buffer->virt) + buffer->offset);
 }
 
-static inline mx_paddr_t io_buffer_phys(io_buffer_t* buffer) {
+static inline zx_paddr_t io_buffer_phys(io_buffer_t* buffer) {
     return buffer->phys + buffer->offset;
 }
 
diff --git a/system/ulib/ddk/include/ddk/iotxn.h b/system/ulib/ddk/include/ddk/iotxn.h
index ada3a1f..36ae6ac 100644
--- a/system/ulib/ddk/include/ddk/iotxn.h
+++ b/system/ulib/ddk/include/ddk/iotxn.h
@@ -5,9 +5,9 @@
 #pragma once
 
 #include <assert.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/listnode.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/listnode.h>
 #include <ddk/driver.h>
 #include <sys/types.h>
 #include <limits.h>
@@ -32,17 +32,17 @@
 // The driver *must* complete the txn (success or failure) by
 // calling iotxn_complete(txn);
 //
-// void (*queue)(mx_device_t* dev, iotxn_t* txn);
+// void (*queue)(zx_device_t* dev, iotxn_t* txn);
 
 // opcodes
 #define IOTXN_OP_READ      1
 #define IOTXN_OP_WRITE     2
 
 // cache maintenance ops
-#define IOTXN_CACHE_INVALIDATE        MX_VMO_OP_CACHE_INVALIDATE
-#define IOTXN_CACHE_CLEAN             MX_VMO_OP_CACHE_CLEAN
-#define IOTXN_CACHE_CLEAN_INVALIDATE  MX_VMO_OP_CACHE_CLEAN_INVALIDATE
-#define IOTXN_CACHE_SYNC              MX_VMO_OP_CACHE_SYNC
+#define IOTXN_CACHE_INVALIDATE        ZX_VMO_OP_CACHE_INVALIDATE
+#define IOTXN_CACHE_CLEAN             ZX_VMO_OP_CACHE_CLEAN
+#define IOTXN_CACHE_CLEAN_INVALIDATE  ZX_VMO_OP_CACHE_CLEAN_INVALIDATE
+#define IOTXN_CACHE_SYNC              ZX_VMO_OP_CACHE_SYNC
 
 // flags
 //
@@ -62,19 +62,19 @@
     // (filled in by requestor, read by processor)
     uint32_t opcode;
     uint32_t flags;
-    mx_off_t offset;      // byte offset (in file/device) to transfer to/from
-    mx_off_t length;      // number of bytes to transfer
+    zx_off_t offset;      // byte offset (in file/device) to transfer to/from
+    zx_off_t length;      // number of bytes to transfer
     uint32_t protocol;    // identifies the protocol-specific data
 
     // response data
     // (filled in by processor before iotxn_complete() is called)
-    mx_status_t status;   // status of transaction
-    mx_off_t actual;      // number of bytes actually transferred (on success)
+    zx_status_t status;   // status of transaction
+    zx_off_t actual;      // number of bytes actually transferred (on success)
 
     uint32_t pflags;      // private flags, do not set
 
     // data payload
-    mx_handle_t vmo_handle;
+    zx_handle_t vmo_handle;
     uint64_t vmo_offset;  // offset into the vmo to use for the buffer
                           // it is invalid to modify this value after initialization
     uint64_t vmo_length;  // buffer size starting at vmo_offset
@@ -88,7 +88,7 @@
     // each entry in the list represents a whole page and the first entry
     // points to the page containing 'vmo_offset'.
     // NOTE: if phys_count == 1, the buffer is physically contiguous.
-    mx_paddr_t* phys;
+    zx_paddr_t* phys;
     uint64_t phys_count;  // number of entries in phys list
 
     // protocol specific extra data
@@ -133,7 +133,7 @@
 
     // May be used by iotxn_physmap() to store the physical pages list
     // instead of allocating additional memory.
-    mx_paddr_t phys_inline[3];
+    zx_paddr_t phys_inline[3];
 };
 
 static_assert(offsetof(iotxn_t, phys) == 64, "phys should be at 64");
@@ -143,7 +143,7 @@
 // used to iterate over contiguous buffer ranges in the physical address space
 typedef struct {
     iotxn_t*    txn;        // txn we are operating on
-    mx_off_t    offset;     // current offset in the txn (relative to iotxn vmo_offset)
+    zx_off_t    offset;     // current offset in the txn (relative to iotxn vmo_offset)
     size_t      max_length; // max length to be returned by iotxn_phys_iter_next()
     uint64_t    page;       // index of page in txn->phys that contains offset
     uint64_t    last_page;  // last valid page index in txn->phys
@@ -156,19 +156,19 @@
 #define IOTXN_ALLOC_POOL       (1 << 1)    // freelist this iotxn on iotxn_release
 
 // create a new iotxn with payload space of data_size
-mx_status_t iotxn_alloc(iotxn_t** out, uint32_t alloc_flags, uint64_t data_size);
+zx_status_t iotxn_alloc(iotxn_t** out, uint32_t alloc_flags, uint64_t data_size);
 
 // create a new iotxn based on provided VMO.
-mx_status_t iotxn_alloc_vmo(iotxn_t** out, uint32_t alloc_flags, mx_handle_t vmo_handle,
+zx_status_t iotxn_alloc_vmo(iotxn_t** out, uint32_t alloc_flags, zx_handle_t vmo_handle,
                             uint64_t vmo_offset, uint64_t length);
 
 // initializes a statically allocated iotxn based on provided VMO.
 // calling iotxn_release() on this iotxn will free any resources allocated by the iotxn
 // but not free the iotxn itself.
-void iotxn_init(iotxn_t* txn, mx_handle_t vmo_handle, uint64_t vmo_offset, uint64_t length);
+void iotxn_init(iotxn_t* txn, zx_handle_t vmo_handle, uint64_t vmo_offset, uint64_t length);
 
 // queue an iotxn against a device
-void iotxn_queue(mx_device_t* dev, iotxn_t* txn);
+void iotxn_queue(zx_device_t* dev, iotxn_t* txn);
 
 // iotxn_complete() must be called by the processor when the io operation has
 // completed or failed and the iotxn and any virtual or physical memory obtained
@@ -176,7 +176,7 @@
 //
 // The iotxn's complete_cb() will be called as the last action of
 // this method.
-void iotxn_complete(iotxn_t* txn, mx_status_t status, mx_off_t actual);
+void iotxn_complete(iotxn_t* txn, zx_status_t status, zx_off_t actual);
 
 // iotxn_copyfrom() copies data from the iotxn's vm object.
 // Out of range operations are ignored.
@@ -188,13 +188,13 @@
 
 // iotxn_physmap() looks up the physical pages backing this iotxn's vm object.
 // the 'phys' and 'phys_count' fields are set if this function succeeds.
-mx_status_t iotxn_physmap(iotxn_t* txn);
+zx_status_t iotxn_physmap(iotxn_t* txn);
 
 // convenience function to get the physical address of iotxn, taking into
 // account 'vmo_offset', For contiguous buffers this will return the physical
 // address of the buffer. For noncontiguous buffers this will return the
 // physical address of the first page.
-static inline mx_paddr_t iotxn_phys(iotxn_t* txn) {
+static inline zx_paddr_t iotxn_phys(iotxn_t* txn) {
     if (!txn->phys) {
         return 0;
     }
@@ -205,7 +205,7 @@
 // iotxn_mmap() maps the iotxn's vm object and returns the virtual address.
 // iotxn_copyfrom(), iotxn_copyto(), or iotxn_ physmap() are almost always a
 // better option.
-mx_status_t iotxn_mmap(iotxn_t* txn, void** data);
+zx_status_t iotxn_mmap(iotxn_t* txn, void** data);
 
 // iotxn_cacheop() performs a cache maintenance op against the iotxn's internal
 // buffer.
@@ -215,13 +215,13 @@
 // suitable for a driver to use to make a request of a driver it is stacked on
 // top of. initializes the iotxn pointed to by 'out' if it is not null, and
 // allocates a new one otherwise.
-mx_status_t iotxn_clone(iotxn_t* txn, iotxn_t** out);
+zx_status_t iotxn_clone(iotxn_t* txn, iotxn_t** out);
 
 // iotxn_clone_partial() is similar to iotxn_clone(), but the cloned
 // iotxn will have an updated vmo_offset and length. The new vmo_offset
 // must be greater than or equal to the original's vmo_offset. The new
 // length must be less than or equal to the original's length.
-mx_status_t iotxn_clone_partial(iotxn_t* txn, uint64_t vmo_offset, mx_off_t length, iotxn_t** out);
+zx_status_t iotxn_clone_partial(iotxn_t* txn, uint64_t vmo_offset, zx_off_t length, iotxn_t** out);
 
 // free the iotxn -- should be called only by the entity that allocated it
 void iotxn_release(iotxn_t* txn);
@@ -233,6 +233,6 @@
 
 // returns the next physical address and length for the iterator up to size max_length.
 // return value is length, or zero if iteration is done.
-size_t iotxn_phys_iter_next(iotxn_phys_iter_t* iter, mx_paddr_t* out_paddr);
+size_t iotxn_phys_iter_next(iotxn_phys_iter_t* iter, zx_paddr_t* out_paddr);
 
 __END_CDECLS;
diff --git a/system/ulib/ddk/include/ddk/protocol/bcm-bus.h b/system/ulib/ddk/include/ddk/protocol/bcm-bus.h
index 3fd4e29..5b18b82 100644
--- a/system/ulib/ddk/include/ddk/protocol/bcm-bus.h
+++ b/system/ulib/ddk/include/ddk/protocol/bcm-bus.h
@@ -4,14 +4,14 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
 typedef struct {
-    mx_status_t (*get_macid)(void* ctx, uint8_t* out_mac);
-    mx_status_t (*get_clock_rate)(void* ctx, uint32_t id, uint32_t* out_clock);
-    mx_status_t (*set_framebuffer)(void* ctx, mx_paddr_t addr);
+    zx_status_t (*get_macid)(void* ctx, uint8_t* out_mac);
+    zx_status_t (*get_clock_rate)(void* ctx, uint32_t id, uint32_t* out_clock);
+    zx_status_t (*set_framebuffer)(void* ctx, zx_paddr_t addr);
 } bcm_bus_protocol_ops_t;
 
 typedef struct {
@@ -19,16 +19,16 @@
     void* ctx;
 } bcm_bus_protocol_t;
 
-static inline mx_status_t bcm_bus_get_macid(bcm_bus_protocol_t* bus, uint8_t* out_mac) {
+static inline zx_status_t bcm_bus_get_macid(bcm_bus_protocol_t* bus, uint8_t* out_mac) {
     return bus->ops->get_macid(bus->ctx, out_mac);
 }
 
-static inline mx_status_t bcm_bus_get_clock_rate(bcm_bus_protocol_t* bus, uint32_t id,
+static inline zx_status_t bcm_bus_get_clock_rate(bcm_bus_protocol_t* bus, uint32_t id,
                                                  uint32_t* out_clock) {
     return bus->ops->get_clock_rate(bus->ctx, id, out_clock);
 }
 
-static inline mx_status_t bcm_bus_set_framebuffer(bcm_bus_protocol_t* bus, mx_paddr_t addr) {
+static inline zx_status_t bcm_bus_set_framebuffer(bcm_bus_protocol_t* bus, zx_paddr_t addr) {
     return bus->ops->set_framebuffer(bus->ctx, addr);
 }
 
diff --git a/system/ulib/ddk/include/ddk/protocol/block.h b/system/ulib/ddk/include/ddk/protocol/block.h
index 0829990..e90312b 100644
--- a/system/ulib/ddk/include/ddk/protocol/block.h
+++ b/system/ulib/ddk/include/ddk/protocol/block.h
@@ -4,22 +4,22 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/device/block.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/device/block.h>
 
 __BEGIN_CDECLS;
 
 typedef struct block_callbacks {
-    void (*complete)(void* cookie, mx_status_t status);
+    void (*complete)(void* cookie, zx_status_t status);
 } block_callbacks_t;
 
 typedef struct block_protocol_ops {
     void (*set_callbacks)(void* ctx, block_callbacks_t* cb);
     void (*get_info)(void* ctx, block_info_t* info);
-    void (*read)(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
+    void (*read)(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
                  uint64_t dev_offset, void* cookie);
-    void (*write)(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
+    void (*write)(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
                   uint64_t dev_offset, void* cookie);
 } block_protocol_ops_t;
 
@@ -40,14 +40,14 @@
 }
 
 // Read to the VMO from the block device
-static inline void block_read(block_protocol_t* block, mx_handle_t vmo, uint64_t length,
+static inline void block_read(block_protocol_t* block, zx_handle_t vmo, uint64_t length,
                               uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block->ops->read(block->ctx, vmo, length, vmo_offset, dev_offset, cookie);
 }
 
 
 // Write from the VMO to the block device
-static inline void block_write(block_protocol_t* block, mx_handle_t vmo, uint64_t length,
+static inline void block_write(block_protocol_t* block, zx_handle_t vmo, uint64_t length,
                                uint64_t vmo_offset, uint64_t dev_offset, void* cookie) {
     block->ops->write(block->ctx, vmo, length, vmo_offset, dev_offset, cookie);
 }
diff --git a/system/ulib/ddk/include/ddk/protocol/display.h b/system/ulib/ddk/include/ddk/protocol/display.h
index 20c9a30..3d77a36 100644
--- a/system/ulib/ddk/include/ddk/protocol/display.h
+++ b/system/ulib/ddk/include/ddk/protocol/display.h
@@ -4,10 +4,10 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/pixelformat.h>
-#include <magenta/device/display.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/pixelformat.h>
+#include <zircon/device/display.h>
 
 __BEGIN_CDECLS;
 
@@ -15,17 +15,17 @@
  * protocol/display.h - display protocol definitions
  */
 
-typedef void (*mx_display_cb_t)(bool acquired, void* cookie);
+typedef void (*zx_display_cb_t)(bool acquired, void* cookie);
 
 typedef struct display_protocol_ops {
     // sets the display mode
-    mx_status_t (*set_mode)(void* ctx, mx_display_info_t* info);
+    zx_status_t (*set_mode)(void* ctx, zx_display_info_t* info);
 
     // gets the display mode
-    mx_status_t (*get_mode)(void* ctx, mx_display_info_t* info);
+    zx_status_t (*get_mode)(void* ctx, zx_display_info_t* info);
 
     // gets a pointer to the framebuffer
-    mx_status_t (*get_framebuffer)(void* ctx, void** framebuffer);
+    zx_status_t (*get_framebuffer)(void* ctx, void** framebuffer);
 
     // flushes the framebuffer
     void (*flush)(void* ctx);
@@ -43,10 +43,10 @@
     // Registers a callback to be invoked when display ownership changes.
     // The provided callback will be invoked with a value of true if the display
     // has been acquired, false if it has been released.
-    void (*set_ownership_change_callback)(void* ctx, mx_display_cb_t callback, void* cookie);
+    void (*set_ownership_change_callback)(void* ctx, zx_display_cb_t callback, void* cookie);
 } display_protocol_ops_t;
 
-typedef struct mx_display_protocol {
+typedef struct zx_display_protocol {
     display_protocol_ops_t* ops;
     void* ctx;
 } display_protocol_t;
diff --git a/system/ulib/ddk/include/ddk/protocol/ethernet.h b/system/ulib/ddk/include/ddk/protocol/ethernet.h
index 185a02e..f0b2967 100644
--- a/system/ulib/ddk/include/ddk/protocol/ethernet.h
+++ b/system/ulib/ddk/include/ddk/protocol/ethernet.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/device/ethernet.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/device/ethernet.h>
 
 __BEGIN_CDECLS;
 
@@ -63,7 +63,7 @@
 typedef struct ethmac_protocol_ops {
     // Obtain information about the ethermac device and supported features
     // Safe to call at any time.
-    mx_status_t (*query)(void* ctx, uint32_t options, ethmac_info_t* info);
+    zx_status_t (*query)(void* ctx, uint32_t options, ethmac_info_t* info);
 
     // Shut down a running ethermac
     // Safe to call if the ethermac is already stopped.
@@ -71,7 +71,7 @@
 
     // Start ethermac running with ifc_virt
     // Callbacks on ifc may be invoked from now until stop() is called
-    mx_status_t (*start)(void* ctx, ethmac_ifc_t* ifc, void* cookie);
+    zx_status_t (*start)(void* ctx, ethmac_ifc_t* ifc, void* cookie);
 
     // send() is valid if FEATURE_TX_QUEUE is not present, otherwise it is no-op
     // This may be called at any time, and can be called from multiple
diff --git a/system/ulib/ddk/include/ddk/protocol/gpio.h b/system/ulib/ddk/include/ddk/protocol/gpio.h
index fbce95c..82ca022 100644
--- a/system/ulib/ddk/include/ddk/protocol/gpio.h
+++ b/system/ulib/ddk/include/ddk/protocol/gpio.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
@@ -29,12 +29,12 @@
 } gpio_config_flags_t;
 
 typedef struct {
-    mx_status_t (*config)(void* ctx, unsigned pin, gpio_config_flags_t flags);
-    mx_status_t (*read)(void* ctx, unsigned pin, unsigned* out_value);
-    mx_status_t (*write)(void* ctx, unsigned pin, unsigned value);
-    mx_status_t (*int_enable)(void* ctx, unsigned pin, bool enable);
-    mx_status_t (*get_int_status)(void* ctx, unsigned pin, bool* out_status);
-    mx_status_t (*int_clear)(void* ctx, unsigned pin);
+    zx_status_t (*config)(void* ctx, unsigned pin, gpio_config_flags_t flags);
+    zx_status_t (*read)(void* ctx, unsigned pin, unsigned* out_value);
+    zx_status_t (*write)(void* ctx, unsigned pin, unsigned value);
+    zx_status_t (*int_enable)(void* ctx, unsigned pin, bool enable);
+    zx_status_t (*get_int_status)(void* ctx, unsigned pin, bool* out_status);
+    zx_status_t (*int_clear)(void* ctx, unsigned pin);
 } gpio_protocol_ops_t;
 
 typedef struct {
@@ -43,34 +43,34 @@
 } gpio_protocol_t;
 
 // configures a GPIO
-static inline mx_status_t gpio_config(gpio_protocol_t* gpio, unsigned pin,
+static inline zx_status_t gpio_config(gpio_protocol_t* gpio, unsigned pin,
                                       gpio_config_flags_t flags) {
     return gpio->ops->config(gpio->ctx, pin, flags);
 }
 
 // reads the current value of a GPIO (0 or 1)
-static inline mx_status_t gpio_read(gpio_protocol_t* gpio, unsigned pin, unsigned* out_value) {
+static inline zx_status_t gpio_read(gpio_protocol_t* gpio, unsigned pin, unsigned* out_value) {
     return gpio->ops->read(gpio->ctx, pin, out_value);
 }
 
 // sets the current value of the GPIO (any non-zero value maps to 1)
-static inline mx_status_t gpio_write(gpio_protocol_t* gpio, unsigned pin, unsigned value) {
+static inline zx_status_t gpio_write(gpio_protocol_t* gpio, unsigned pin, unsigned value) {
     return gpio->ops->write(gpio->ctx, pin, value);
 }
 
 // enables or disables interrupts for the  GPIO
-static inline mx_status_t gpio_int_enable(gpio_protocol_t* gpio, unsigned pin, bool enable) {
+static inline zx_status_t gpio_int_enable(gpio_protocol_t* gpio, unsigned pin, bool enable) {
     return gpio->ops->int_enable(gpio->ctx, pin, enable);
 }
 
 // returns whether an interrupt is pending for the GPIO
-static inline mx_status_t gpio_get_int_status(gpio_protocol_t* gpio, unsigned pin,
+static inline zx_status_t gpio_get_int_status(gpio_protocol_t* gpio, unsigned pin,
                                               bool* out_active) {
     return gpio->ops->get_int_status(gpio->ctx, pin, out_active);
 }
 
 // clears the interrupt for a GPIO
-static inline mx_status_t gpio_int_clear(gpio_protocol_t* gpio, unsigned pin) {
+static inline zx_status_t gpio_int_clear(gpio_protocol_t* gpio, unsigned pin) {
     return gpio->ops->int_clear(gpio->ctx, pin);
 }
 
diff --git a/system/ulib/ddk/include/ddk/protocol/hidbus.h b/system/ulib/ddk/include/ddk/protocol/hidbus.h
index 86740eb..ca01677 100644
--- a/system/ulib/ddk/include/ddk/protocol/hidbus.h
+++ b/system/ulib/ddk/include/ddk/protocol/hidbus.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
@@ -48,24 +48,24 @@
 typedef struct hidbus_protocol_ops {
     // Obtain information about the hidbus device and supported features.
     // Safe to call at any time.
-    mx_status_t (*query)(void* ctx, uint32_t options, hid_info_t* info);
+    zx_status_t (*query)(void* ctx, uint32_t options, hid_info_t* info);
 
     // Start the hidbus device. The device may begin queueing hid reports via
     // ifc->io_queue before this function returns. It is an error to start an
     // already-started hidbus device.
-    mx_status_t (*start)(void* ctx, hidbus_ifc_t* ifc, void* cookie);
+    zx_status_t (*start)(void* ctx, hidbus_ifc_t* ifc, void* cookie);
 
     // Stop the hidbus device. Safe to call if the hidbus is already stopped.
     void (*stop)(void* ctx);
 
     // HID operations. See Device Class Definition for HID for details.
-    mx_status_t (*get_descriptor)(void* ctx, uint8_t desc_type, void** data, size_t* len);
-    mx_status_t (*get_report)(void* ctx, uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len);
-    mx_status_t (*set_report)(void* ctx, uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len);
-    mx_status_t (*get_idle)(void* ctx, uint8_t rpt_id, uint8_t* duration);
-    mx_status_t (*set_idle)(void* ctx, uint8_t rpt_id, uint8_t duration);
-    mx_status_t (*get_protocol)(void* ctx, uint8_t* protocol);
-    mx_status_t (*set_protocol)(void* ctx, uint8_t protocol);
+    zx_status_t (*get_descriptor)(void* ctx, uint8_t desc_type, void** data, size_t* len);
+    zx_status_t (*get_report)(void* ctx, uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len);
+    zx_status_t (*set_report)(void* ctx, uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len);
+    zx_status_t (*get_idle)(void* ctx, uint8_t rpt_id, uint8_t* duration);
+    zx_status_t (*set_idle)(void* ctx, uint8_t rpt_id, uint8_t duration);
+    zx_status_t (*get_protocol)(void* ctx, uint8_t* protocol);
+    zx_status_t (*set_protocol)(void* ctx, uint8_t protocol);
 } hidbus_protocol_ops_t;
 
 typedef struct hidbus_protocol {
diff --git a/system/ulib/ddk/include/ddk/protocol/intel-hda-codec.h b/system/ulib/ddk/include/ddk/protocol/intel-hda-codec.h
index d2c51a9..ccec611 100644
--- a/system/ulib/ddk/include/ddk/protocol/intel-hda-codec.h
+++ b/system/ulib/ddk/include/ddk/protocol/intel-hda-codec.h
@@ -4,14 +4,14 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
 typedef struct ihda_codec_protocol_ops {
-    // Fetch an mx_handle_t to a channel which can be used to communicate with the codec device.
-    mx_status_t (*get_driver_channel)(void* ctx, mx_handle_t* channel_out);
+    // Fetch an zx_handle_t to a channel which can be used to communicate with the codec device.
+    zx_status_t (*get_driver_channel)(void* ctx, zx_handle_t* channel_out);
 } ihda_codec_protocol_ops_t;
 
 typedef struct ihda_codec_protocol {
diff --git a/system/ulib/ddk/include/ddk/protocol/pci.h b/system/ulib/ddk/include/ddk/protocol/pci.h
index f9ce953..3980111 100644
--- a/system/ulib/ddk/include/ddk/protocol/pci.h
+++ b/system/ulib/ddk/include/ddk/protocol/pci.h
@@ -5,16 +5,16 @@
 #pragma once
 
 #include <hw/pci.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls/pci.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/pci.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
 /**
  * protocols/pci.h - PCI protocol definitions
  *
- * The PCI host driver publishes mx_device_t's with its config set to a pci_device_config_t.
+ * The PCI host driver publishes zx_device_t's with its config set to a pci_device_config_t.
  */
 
 enum pci_resource_ids {
@@ -29,17 +29,17 @@
 };
 
 typedef struct pci_protocol_ops {
-    mx_status_t (*map_resource)(void* ctx, uint32_t res_id, uint32_t cache_policy,
-                                void** vaddr, size_t* size, mx_handle_t* out_handle);
-    mx_status_t (*enable_bus_master)(void* ctx, bool enable);
-    mx_status_t (*enable_pio)(void* ctx, bool enable);
-    mx_status_t (*reset_device)(void* ctx);
-    mx_status_t (*map_interrupt)(void* ctx, int which_irq, mx_handle_t* out_handle);
-    mx_status_t (*query_irq_mode_caps)(void* ctx, mx_pci_irq_mode_t mode,
+    zx_status_t (*map_resource)(void* ctx, uint32_t res_id, uint32_t cache_policy,
+                                void** vaddr, size_t* size, zx_handle_t* out_handle);
+    zx_status_t (*enable_bus_master)(void* ctx, bool enable);
+    zx_status_t (*enable_pio)(void* ctx, bool enable);
+    zx_status_t (*reset_device)(void* ctx);
+    zx_status_t (*map_interrupt)(void* ctx, int which_irq, zx_handle_t* out_handle);
+    zx_status_t (*query_irq_mode_caps)(void* ctx, zx_pci_irq_mode_t mode,
                                        uint32_t* out_max_irqs);
-    mx_status_t (*set_irq_mode)(void* ctx, mx_pci_irq_mode_t mode,
+    zx_status_t (*set_irq_mode)(void* ctx, zx_pci_irq_mode_t mode,
                                 uint32_t requested_irq_count);
-    mx_status_t (*get_device_info)(void* ctx, mx_pcie_device_info_t* out_info);
+    zx_status_t (*get_device_info)(void* ctx, zx_pcie_device_info_t* out_info);
 } pci_protocol_ops_t;
 
 typedef struct pci_protocol {
@@ -47,41 +47,41 @@
     void* ctx;
 } pci_protocol_t;
 
-static inline mx_status_t pci_map_resource(pci_protocol_t* pci, uint32_t res_id,
+static inline zx_status_t pci_map_resource(pci_protocol_t* pci, uint32_t res_id,
                                            uint32_t cache_policy, void** vaddr, size_t* size,
-                                           mx_handle_t* out_handle) {
+                                           zx_handle_t* out_handle) {
     return pci->ops->map_resource(pci->ctx, res_id, cache_policy, vaddr, size, out_handle);
 }
 
-static inline mx_status_t pci_enable_bus_master(pci_protocol_t* pci, bool enable) {
+static inline zx_status_t pci_enable_bus_master(pci_protocol_t* pci, bool enable) {
     return pci->ops->enable_bus_master(pci->ctx, enable);
 }
 
-static inline mx_status_t pci_enable_pio(pci_protocol_t* pci, bool enable) {
+static inline zx_status_t pci_enable_pio(pci_protocol_t* pci, bool enable) {
     return pci->ops->enable_pio(pci->ctx, enable);
 }
 
-static inline mx_status_t pci_reset_device(pci_protocol_t* pci) {
+static inline zx_status_t pci_reset_device(pci_protocol_t* pci) {
     return pci->ops->reset_device(pci->ctx);
 }
 
-static inline mx_status_t pci_map_interrupt(pci_protocol_t* pci, int which_irq,
-                                            mx_handle_t* out_handle) {
+static inline zx_status_t pci_map_interrupt(pci_protocol_t* pci, int which_irq,
+                                            zx_handle_t* out_handle) {
     return pci->ops->map_interrupt(pci->ctx, which_irq, out_handle);
 }
 
-static inline mx_status_t pci_query_irq_mode_caps(pci_protocol_t* pci, mx_pci_irq_mode_t mode,
+static inline zx_status_t pci_query_irq_mode_caps(pci_protocol_t* pci, zx_pci_irq_mode_t mode,
                                                   uint32_t* out_max_irqs) {
     return pci->ops->query_irq_mode_caps(pci->ctx, mode, out_max_irqs);
 }
 
-static inline mx_status_t pci_set_irq_mode(pci_protocol_t* pci, mx_pci_irq_mode_t mode,
+static inline zx_status_t pci_set_irq_mode(pci_protocol_t* pci, zx_pci_irq_mode_t mode,
                                            uint32_t requested_irq_count) {
     return pci->ops->set_irq_mode(pci->ctx, mode, requested_irq_count);
 }
 
-static inline mx_status_t pci_get_device_info(pci_protocol_t* pci,
-                                              mx_pcie_device_info_t* out_info) {
+static inline zx_status_t pci_get_device_info(pci_protocol_t* pci,
+                                              zx_pcie_device_info_t* out_info) {
     return pci->ops->get_device_info(pci->ctx, out_info);
 }
 
diff --git a/system/ulib/ddk/include/ddk/protocol/pciroot.h b/system/ulib/ddk/include/ddk/protocol/pciroot.h
index 84e4ea3..3ce3c3b 100644
--- a/system/ulib/ddk/include/ddk/protocol/pciroot.h
+++ b/system/ulib/ddk/include/ddk/protocol/pciroot.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/ulib/ddk/include/ddk/protocol/platform-device.h b/system/ulib/ddk/include/ddk/protocol/platform-device.h
index 4e83752..646be3e 100644
--- a/system/ulib/ddk/include/ddk/protocol/platform-device.h
+++ b/system/ulib/ddk/include/ddk/protocol/platform-device.h
@@ -4,10 +4,10 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
@@ -16,8 +16,8 @@
 
 // interface registered by the platform bus implementation driver
 typedef struct {
-    mx_status_t (*get_protocol)(void* ctx, uint32_t proto_id, void* out);
-    mx_status_t (*add_gpios)(void* ctx, uint32_t start, uint32_t count, uint32_t mmio_index,
+    zx_status_t (*get_protocol)(void* ctx, uint32_t proto_id, void* out);
+    zx_status_t (*add_gpios)(void* ctx, uint32_t start, uint32_t count, uint32_t mmio_index,
                              const uint32_t* irqs, uint32_t irq_count);
 
     // TODO(voydanoff) Add APIs for GPIOs, clocks I2C, etc
@@ -28,24 +28,24 @@
     void* ctx;
 } pbus_interface_t;
 
-static inline mx_status_t pbus_interface_get_protocol(pbus_interface_t* intf, uint32_t proto_id,
+static inline zx_status_t pbus_interface_get_protocol(pbus_interface_t* intf, uint32_t proto_id,
                                                       void* out) {
     return intf->ops->get_protocol(intf->ctx, proto_id, out);
 }
 
-static inline mx_status_t pbus_interface_add_gpios(pbus_interface_t* intf, uint32_t start,
+static inline zx_status_t pbus_interface_add_gpios(pbus_interface_t* intf, uint32_t start,
                                                    uint32_t count, uint32_t mmio_index,
                                                    const uint32_t* irqs, uint32_t irq_count) {
     return intf->ops->add_gpios(intf->ctx, start, count, mmio_index, irqs, irq_count);
 }
 
 typedef struct {
-    mx_status_t (*set_interface)(void* ctx, pbus_interface_t* interface);
-    mx_status_t (*get_protocol)(void* ctx, uint32_t proto_id, void* out);
-    mx_status_t (*map_mmio)(void* ctx, uint32_t index, uint32_t cache_policy, void** out_vaddr,
-                            size_t* out_size, mx_handle_t* out_handle);
+    zx_status_t (*set_interface)(void* ctx, pbus_interface_t* interface);
+    zx_status_t (*get_protocol)(void* ctx, uint32_t proto_id, void* out);
+    zx_status_t (*map_mmio)(void* ctx, uint32_t index, uint32_t cache_policy, void** out_vaddr,
+                            size_t* out_size, zx_handle_t* out_handle);
 
-    mx_status_t (*map_interrupt)(void* ctx, uint32_t index, mx_handle_t* out_handle);
+    zx_status_t (*map_interrupt)(void* ctx, uint32_t index, zx_handle_t* out_handle);
 } platform_device_protocol_ops_t;
 
 typedef struct {
@@ -53,29 +53,29 @@
     void* ctx;
 } platform_device_protocol_t;
 
-static inline mx_status_t pdev_set_interface(platform_device_protocol_t* pdev,
+static inline zx_status_t pdev_set_interface(platform_device_protocol_t* pdev,
                                              pbus_interface_t* interface) {
     return pdev->ops->set_interface(pdev->ctx, interface);
 }
 
 // Requests a given protocol from the platform bus implementation
-static inline mx_status_t pdev_get_protocol(platform_device_protocol_t* pdev, uint32_t proto_id,
+static inline zx_status_t pdev_get_protocol(platform_device_protocol_t* pdev, uint32_t proto_id,
                                              void* out_proto) {
     return pdev->ops->get_protocol(pdev->ctx, proto_id, out_proto);
 }
 
 // Maps an MMIO region based on information in the MDI
 // index is based on ordering of the device's mmio nodes in the MDI
-static inline mx_status_t pdev_map_mmio(platform_device_protocol_t* pdev, uint32_t index,
+static inline zx_status_t pdev_map_mmio(platform_device_protocol_t* pdev, uint32_t index,
                                         uint32_t cache_policy, void** out_vaddr, size_t* out_size,
-                                        mx_handle_t* out_handle) {
+                                        zx_handle_t* out_handle) {
     return pdev->ops->map_mmio(pdev->ctx, index, cache_policy, out_vaddr, out_size, out_handle);
 }
 
 // Returns an interrupt handle for an IRQ based on information in the MDI
 // index is based on ordering of the device's irq nodes in the MDI
-static inline mx_status_t pdev_map_interrupt(platform_device_protocol_t* pdev, uint32_t index,
-                                             mx_handle_t* out_handle) {
+static inline zx_status_t pdev_map_interrupt(platform_device_protocol_t* pdev, uint32_t index,
+                                             zx_handle_t* out_handle) {
     return pdev->ops->map_interrupt(pdev->ctx, index, out_handle);
 }
 
@@ -84,10 +84,10 @@
 typedef struct {
     void*       vaddr;
     size_t      size;
-    mx_handle_t handle;
+    zx_handle_t handle;
 } pdev_mmio_buffer_t;
 
-static inline mx_status_t pdev_map_mmio_buffer(platform_device_protocol_t* pdev, uint32_t index,
+static inline zx_status_t pdev_map_mmio_buffer(platform_device_protocol_t* pdev, uint32_t index,
                                         uint32_t cache_policy, pdev_mmio_buffer_t* buffer) {
     return pdev->ops->map_mmio(pdev->ctx, index, cache_policy, &buffer->vaddr, &buffer->size,
                                &buffer->handle);
@@ -95,9 +95,9 @@
 
 static inline void pdev_mmio_buffer_release(pdev_mmio_buffer_t* buffer) {
     if (buffer->vaddr) {
-        mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)buffer->vaddr, buffer->size);
+        zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)buffer->vaddr, buffer->size);
     }
-    mx_handle_close(buffer->handle);
+    zx_handle_close(buffer->handle);
 }
 
 __END_CDECLS;
diff --git a/system/ulib/ddk/include/ddk/protocol/platform-devices.h b/system/ulib/ddk/include/ddk/protocol/platform-devices.h
index 0695cf5..bfb51c3 100644
--- a/system/ulib/ddk/include/ddk/protocol/platform-devices.h
+++ b/system/ulib/ddk/include/ddk/protocol/platform-devices.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/ulib/ddk/include/ddk/protocol/sdhci.h b/system/ulib/ddk/include/ddk/protocol/sdhci.h
index b5be8df..7118238 100644
--- a/system/ulib/ddk/include/ddk/protocol/sdhci.h
+++ b/system/ulib/ddk/include/ddk/protocol/sdhci.h
@@ -5,18 +5,18 @@
 #pragma once
 
 #include <hw/sdhci.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
 typedef struct sdhci_protocol_ops {
     // TODO: should be replaced with a generic busdev mechanism
-    mx_handle_t (*get_interrupt)(void* ctx);
-    mx_status_t (*get_mmio)(void* ctx, volatile sdhci_regs_t** out);
+    zx_handle_t (*get_interrupt)(void* ctx);
+    zx_status_t (*get_mmio)(void* ctx, volatile sdhci_regs_t** out);
     uint32_t (*get_base_clock)(void* ctx);
     // TODO: replace this function with iotxn_phys(txn, ctx)
-    mx_paddr_t (*get_dma_offset)(void* ctx);
+    zx_paddr_t (*get_dma_offset)(void* ctx);
 
     // returns device quirks
     uint64_t (*get_quirks)(void* ctx);
diff --git a/system/ulib/ddk/include/ddk/protocol/sdmmc.h b/system/ulib/ddk/include/ddk/protocol/sdmmc.h
index 4db2b53..ec3a22c 100644
--- a/system/ulib/ddk/include/ddk/protocol/sdmmc.h
+++ b/system/ulib/ddk/include/ddk/protocol/sdmmc.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <ddk/iotxn.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/ulib/ddk/include/ddk/protocol/test.h b/system/ulib/ddk/include/ddk/protocol/test.h
index 1489bc4..092cd52 100644
--- a/system/ulib/ddk/include/ddk/protocol/test.h
+++ b/system/ulib/ddk/include/ddk/protocol/test.h
@@ -4,30 +4,30 @@
 
 #pragma once
 
-#include <magenta/device/test.h>
+#include <zircon/device/test.h>
 
 typedef test_ioctl_test_report_t test_report_t;
 
-typedef mx_status_t (*test_func_t)(void* cookie, test_report_t* report, const void* arg, size_t arglen);
+typedef zx_status_t (*test_func_t)(void* cookie, test_report_t* report, const void* arg, size_t arglen);
 
 typedef struct test_protocol_ops {
     // sets test output socket
-    void (*set_output_socket)(void* ctx, mx_handle_t handle);
+    void (*set_output_socket)(void* ctx, zx_handle_t handle);
 
     // gets test output socket
-    mx_handle_t (*get_output_socket)(void* ctx);
+    zx_handle_t (*get_output_socket)(void* ctx);
 
     // sets control channel
-    void (*set_control_channel)(void* ctx, mx_handle_t handle);
+    void (*set_control_channel)(void* ctx, zx_handle_t handle);
 
     // gets control channel
-    mx_handle_t (*get_control_channel)(void* ctx);
+    zx_handle_t (*get_control_channel)(void* ctx);
 
     // sets test function
     void (*set_test_func)(void* ctx, test_func_t func, void* cookie);
 
     // run tests, calls the function set in set_test_func
-    mx_status_t (*run_tests)(void* ctx, test_report_t* report, const void* arg, size_t arglen);
+    zx_status_t (*run_tests)(void* ctx, test_report_t* report, const void* arg, size_t arglen);
 
     // calls device_remove()
     void (*destroy)(void* ctx);
diff --git a/system/ulib/ddk/include/ddk/protocol/usb-bus.h b/system/ulib/ddk/include/ddk/protocol/usb-bus.h
index 7919b35..52291e9 100644
--- a/system/ulib/ddk/include/ddk/protocol/usb-bus.h
+++ b/system/ulib/ddk/include/ddk/protocol/usb-bus.h
@@ -6,20 +6,20 @@
 
 
 #include <ddk/driver.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/hw/usb.h>
-#include <magenta/hw/usb-hub.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/hw/usb.h>
+#include <zircon/hw/usb-hub.h>
 
 __BEGIN_CDECLS;
 
 typedef struct usb_bus_protocol_ops {
     // Hub support
-    mx_status_t (*configure_hub)(void* ctx, mx_device_t* hub_device, usb_speed_t speed,
+    zx_status_t (*configure_hub)(void* ctx, zx_device_t* hub_device, usb_speed_t speed,
                  usb_hub_descriptor_t* descriptor);
-    mx_status_t (*hub_device_added)(void* ctx, mx_device_t* hub_device, int port,
+    zx_status_t (*hub_device_added)(void* ctx, zx_device_t* hub_device, int port,
                                     usb_speed_t speed);
-    mx_status_t (*hub_device_removed)(void* ctx, mx_device_t* hub_device, int port);
+    zx_status_t (*hub_device_removed)(void* ctx, zx_device_t* hub_device, int port);
 } usb_bus_protocol_ops_t;
 
 typedef struct usb_bus_protocol {
@@ -27,25 +27,25 @@
     void* ctx;
 } usb_bus_protocol_t;
 
-static inline mx_status_t usb_bus_configure_hub(usb_bus_protocol_t* bus, mx_device_t* hub_device,
+static inline zx_status_t usb_bus_configure_hub(usb_bus_protocol_t* bus, zx_device_t* hub_device,
                                                 usb_speed_t speed,
                                                 usb_hub_descriptor_t* descriptor) {
     return bus->ops->configure_hub(bus->ctx, hub_device, speed, descriptor);
 }
 
-static inline mx_status_t usb_bus_hub_device_added(usb_bus_protocol_t* bus, mx_device_t* hub_device,
+static inline zx_status_t usb_bus_hub_device_added(usb_bus_protocol_t* bus, zx_device_t* hub_device,
                                                    int port, usb_speed_t speed) {
     return bus->ops->hub_device_added(bus->ctx, hub_device, port, speed);
 }
 
-static inline mx_status_t usb_bus_hub_device_removed(usb_bus_protocol_t* bus,
-                                                     mx_device_t* hub_device, int port) {
+static inline zx_status_t usb_bus_hub_device_removed(usb_bus_protocol_t* bus,
+                                                     zx_device_t* hub_device, int port) {
     return bus->ops->hub_device_removed(bus->ctx, hub_device, port);
 }
 
 // interface for use by the HCI controller to use to notify when devices are added and removed
 typedef struct {
-    mx_status_t (*add_device)(void* ctx, uint32_t device_id, uint32_t hub_id, usb_speed_t speed);
+    zx_status_t (*add_device)(void* ctx, uint32_t device_id, uint32_t hub_id, usb_speed_t speed);
     void (*remove_device)(void* ctx, uint32_t device_id);
 } usb_bus_interface_ops_t;
 
@@ -54,7 +54,7 @@
     void* ctx;
 } usb_bus_interface_t;
 
-static inline mx_status_t usb_bus_add_device(usb_bus_interface_t* bus, uint32_t device_id,
+static inline zx_status_t usb_bus_add_device(usb_bus_interface_t* bus, uint32_t device_id,
                                              uint32_t hub_id, usb_speed_t speed) {
     return bus->ops->add_device(bus->ctx, device_id, hub_id, speed);
 }
diff --git a/system/ulib/ddk/include/ddk/protocol/usb-dci.h b/system/ulib/ddk/include/ddk/protocol/usb-dci.h
index f214fd0..c5542cb 100644
--- a/system/ulib/ddk/include/ddk/protocol/usb-dci.h
+++ b/system/ulib/ddk/include/ddk/protocol/usb-dci.h
@@ -5,9 +5,9 @@
 #pragma once
 
 #include <stdbool.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/hw/usb.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/hw/usb.h>
 
 __BEGIN_CDECLS;
 
@@ -16,7 +16,7 @@
 // callbacks implemented by the USB device driver
 typedef struct {
     // callback for handling ep0 control requests
-    mx_status_t (*control)(void* ctx, const usb_setup_t* setup, void* buffer, size_t buffer_length,
+    zx_status_t (*control)(void* ctx, const usb_setup_t* setup, void* buffer, size_t buffer_length,
                            size_t* out_actual);
     void (*set_connected)(void* ctx, bool connected);
     void (*set_speed)(void* ctx, usb_speed_t speed);
@@ -27,7 +27,7 @@
     void* ctx;
 } usb_dci_interface_t;
 
-static inline mx_status_t usb_dci_control(usb_dci_interface_t* intf, const usb_setup_t* setup,
+static inline zx_status_t usb_dci_control(usb_dci_interface_t* intf, const usb_setup_t* setup,
                                           void* buffer, size_t buffer_length, size_t* out_actual) {
     return intf->ops->control(intf->ctx, setup, buffer, buffer_length, out_actual);
 }
@@ -41,15 +41,15 @@
 }
 
 typedef struct {
-    mx_status_t (*set_interface)(void* ctx, usb_dci_interface_t* interface);
-    mx_status_t (*config_ep)(void* ctx, usb_endpoint_descriptor_t* ep_desc,
+    zx_status_t (*set_interface)(void* ctx, usb_dci_interface_t* interface);
+    zx_status_t (*config_ep)(void* ctx, usb_endpoint_descriptor_t* ep_desc,
                              usb_ss_ep_comp_descriptor_t* ss_comp_desc);
-    mx_status_t (*disable_ep)(void* ctx, uint8_t ep_addr);
+    zx_status_t (*disable_ep)(void* ctx, uint8_t ep_addr);
     // enables or disables the device controller hardware
     // should not be enabled until upper layer is ready to respond to the host
-    mx_status_t (*set_enabled)(void* ctx, bool enabled);
-    mx_status_t (*ep_set_stall)(void* ctx, uint8_t ep_address);
-    mx_status_t (*ep_clear_stall)(void* ctx, uint8_t ep_address);
+    zx_status_t (*set_enabled)(void* ctx, bool enabled);
+    zx_status_t (*ep_set_stall)(void* ctx, uint8_t ep_address);
+    zx_status_t (*ep_clear_stall)(void* ctx, uint8_t ep_address);
 } usb_dci_protocol_ops_t;
 
 typedef struct {
@@ -62,25 +62,25 @@
     dci->ops->set_interface(dci->ctx, intf);
 }
 
-static mx_status_t usb_dci_config_ep(usb_dci_protocol_t* dci,
+static zx_status_t usb_dci_config_ep(usb_dci_protocol_t* dci,
                                      usb_endpoint_descriptor_t* ep_desc,
                                      usb_ss_ep_comp_descriptor_t* ss_comp_desc) {
     return dci->ops->config_ep(dci->ctx, ep_desc, ss_comp_desc);
 }
 
-static inline mx_status_t usb_dci_disable_ep(usb_dci_protocol_t* dci, uint8_t ep_addr) {
+static inline zx_status_t usb_dci_disable_ep(usb_dci_protocol_t* dci, uint8_t ep_addr) {
     return dci->ops->disable_ep(dci->ctx, ep_addr);
 }
 
-static mx_status_t usb_dci_set_enabled(usb_dci_protocol_t* dci, bool enabled) {
+static zx_status_t usb_dci_set_enabled(usb_dci_protocol_t* dci, bool enabled) {
     return dci->ops->set_enabled(dci->ctx, enabled);
 }
 
-static mx_status_t usb_dci_ep_set_stall(usb_dci_protocol_t* dci, uint8_t ep_address) {
+static zx_status_t usb_dci_ep_set_stall(usb_dci_protocol_t* dci, uint8_t ep_address) {
     return dci->ops->ep_set_stall(dci->ctx, ep_address);
 }
 
-static mx_status_t usb_dci_ep_clear_stall(usb_dci_protocol_t* dci, uint8_t ep_address) {
+static zx_status_t usb_dci_ep_clear_stall(usb_dci_protocol_t* dci, uint8_t ep_address) {
     return dci->ops->ep_clear_stall(dci->ctx, ep_address);
 }
 
diff --git a/system/ulib/ddk/include/ddk/protocol/usb-function.h b/system/ulib/ddk/include/ddk/protocol/usb-function.h
index 3b3b60c..7f217b7 100644
--- a/system/ulib/ddk/include/ddk/protocol/usb-function.h
+++ b/system/ulib/ddk/include/ddk/protocol/usb-function.h
@@ -5,9 +5,9 @@
 #pragma once
 
 #include <ddk/iotxn.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/hw/usb.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/hw/usb.h>
 
 __BEGIN_CDECLS;
 
@@ -27,7 +27,7 @@
     const usb_descriptor_header_t* (*get_descriptors)(void* ctx, size_t* out_length);
 
     // callback for handling ep0 control requests
-    mx_status_t (*control)(void* ctx, const usb_setup_t* setup, void* buffer, size_t buffer_length,
+    zx_status_t (*control)(void* ctx, const usb_setup_t* setup, void* buffer, size_t buffer_length,
                            size_t* out_actual);
 
     // Called to inform the function driver when the USB device configured state changes.
@@ -36,12 +36,12 @@
     // should call usb_function_config_ep() to configure its endpoints.
     // Called with configured == false when configuration is disabled or USB is disconnected.
     // The function driver should then call usb_function_disable_ep() to disable its endpoints.
-    mx_status_t (*set_configured)(void* ctx, bool configured, usb_speed_t speed);
+    zx_status_t (*set_configured)(void* ctx, bool configured, usb_speed_t speed);
 
     // Called to set an alternate setting for an interface due to a SET_INTERFACE control request.
     // The function driver should call usb_function_config_ep() and/or usb_function_config_ep()
     // to configure or disable the interface's endpoints as appropriate.
-    mx_status_t (*set_interface)(void* ctx, unsigned interface, unsigned alt_setting);
+    zx_status_t (*set_interface)(void* ctx, unsigned interface, unsigned alt_setting);
 } usb_function_interface_ops_t;
 
 typedef struct {
@@ -54,33 +54,33 @@
     return intf->ops->get_descriptors(intf->ctx, out_length);
 }
 
-static inline mx_status_t usb_function_control(usb_function_interface_t* intf,
+static inline zx_status_t usb_function_control(usb_function_interface_t* intf,
                                                const usb_setup_t* setup, void* buffer,
                                                size_t buffer_length, size_t* out_actual) {
     return intf->ops->control(intf->ctx, setup, buffer, buffer_length, out_actual);
 }
 
-static inline mx_status_t usb_function_set_configured(usb_function_interface_t* intf,
+static inline zx_status_t usb_function_set_configured(usb_function_interface_t* intf,
                                                       bool configured, usb_speed_t speed) {
     return intf->ops->set_configured(intf->ctx, configured, speed);
 }
 
-static inline mx_status_t usb_function_set_interface(usb_function_interface_t* intf,
+static inline zx_status_t usb_function_set_interface(usb_function_interface_t* intf,
                                                      unsigned interface, unsigned alt_setting) {
     return intf->ops->set_interface(intf->ctx, interface, alt_setting);
 }
 
 typedef struct {
-    mx_status_t (*register_func)(void* ctx, usb_function_interface_t* intf);
-    mx_status_t (*alloc_interface)(void* ctx, uint8_t* out_intf_num);
-    mx_status_t (*alloc_ep)(void* ctx, uint8_t direction, uint8_t* out_address);
-    mx_status_t (*config_ep)(void* ctx, usb_endpoint_descriptor_t* ep_desc,
+    zx_status_t (*register_func)(void* ctx, usb_function_interface_t* intf);
+    zx_status_t (*alloc_interface)(void* ctx, uint8_t* out_intf_num);
+    zx_status_t (*alloc_ep)(void* ctx, uint8_t direction, uint8_t* out_address);
+    zx_status_t (*config_ep)(void* ctx, usb_endpoint_descriptor_t* ep_desc,
                              usb_ss_ep_comp_descriptor_t* ss_comp_desc);
-    mx_status_t (*disable_ep)(void* ctx, uint8_t ep_addr);
-    mx_status_t (*alloc_string_desc)(void* ctx, const char* string, uint8_t* out_index);
+    zx_status_t (*disable_ep)(void* ctx, uint8_t ep_addr);
+    zx_status_t (*alloc_string_desc)(void* ctx, const char* string, uint8_t* out_index);
     void (*queue)(void* ctx, iotxn_t* txn, uint8_t ep_address);
-    mx_status_t (*ep_set_stall)(void* ctx, uint8_t ep_address);
-    mx_status_t (*ep_clear_stall)(void* ctx, uint8_t ep_address);
+    zx_status_t (*ep_set_stall)(void* ctx, uint8_t ep_address);
+    zx_status_t (*ep_clear_stall)(void* ctx, uint8_t ep_address);
 } usb_function_protocol_ops_t;
 
 typedef struct {
@@ -95,21 +95,21 @@
 }
 
 // allocates a unique interface descriptor number
-static inline mx_status_t usb_function_alloc_interface(usb_function_protocol_t* func,
+static inline zx_status_t usb_function_alloc_interface(usb_function_protocol_t* func,
                                                        uint8_t* out_intf_num) {
     return func->ops->alloc_interface(func->ctx, out_intf_num);
 }
 
 // allocates a unique endpoint descriptor number
 // direction should be either USB_DIR_OUT or USB_DIR_IN
-static inline mx_status_t usb_function_alloc_ep(usb_function_protocol_t* func, uint8_t direction,
+static inline zx_status_t usb_function_alloc_ep(usb_function_protocol_t* func, uint8_t direction,
                                                 uint8_t* out_address) {
     return func->ops->alloc_ep(func->ctx, direction, out_address);
 }
 
 // configures an endpoint based on the provided usb_endpoint_descriptor_t and
 // usb_ss_ep_comp_descriptor_t descriptors.
-static inline mx_status_t usb_function_config_ep(usb_function_protocol_t* func,
+static inline zx_status_t usb_function_config_ep(usb_function_protocol_t* func,
                                                  usb_endpoint_descriptor_t* ep_desc,
                                                  usb_ss_ep_comp_descriptor_t* ss_comp_desc) {
     return func->ops->config_ep(func->ctx, ep_desc, ss_comp_desc);
@@ -117,12 +117,12 @@
 
 // disables an endpoint. called when the device is no longer configured or an alternate interface
 // is selected.
-static inline mx_status_t usb_function_disable_ep(usb_function_protocol_t* func, uint8_t ep_addr) {
+static inline zx_status_t usb_function_disable_ep(usb_function_protocol_t* func, uint8_t ep_addr) {
     return func->ops->disable_ep(func->ctx, ep_addr);
 }
 
 // adds a string descriptor to the device configuration.
-static inline mx_status_t usb_function_alloc_string_desc(usb_function_protocol_t* func,
+static inline zx_status_t usb_function_alloc_string_desc(usb_function_protocol_t* func,
                                                          const char* string, uint8_t* out_index) {
     return func->ops->alloc_string_desc(func->ctx, string, out_index);
 }
@@ -134,12 +134,12 @@
 }
 
 // stalls an endpoint
-static mx_status_t usb_function_ep_set_stall(usb_function_protocol_t* func, uint8_t ep_address) {
+static zx_status_t usb_function_ep_set_stall(usb_function_protocol_t* func, uint8_t ep_address) {
     return func->ops->ep_set_stall(func->ctx, ep_address);
 }
 
 // clears endpoint stall state
-static mx_status_t usb_function_ep_clear_stall(usb_function_protocol_t* func, uint8_t ep_address) {
+static zx_status_t usb_function_ep_clear_stall(usb_function_protocol_t* func, uint8_t ep_address) {
     return func->ops->ep_clear_stall(func->ctx, ep_address);
 }
 
diff --git a/system/ulib/ddk/include/ddk/protocol/usb-hci.h b/system/ulib/ddk/include/ddk/protocol/usb-hci.h
index 799f3b5..ad1d78f 100644
--- a/system/ulib/ddk/include/ddk/protocol/usb-hci.h
+++ b/system/ulib/ddk/include/ddk/protocol/usb-hci.h
@@ -4,10 +4,10 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/hw/usb.h>
-#include <magenta/hw/usb-hub.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/hw/usb.h>
+#include <zircon/hw/usb-hub.h>
 #include <stdbool.h>
 
 __BEGIN_CDECLS;
@@ -18,7 +18,7 @@
     void (*set_bus_interface)(void* ctx, usb_bus_interface_t* bus_intf);
     size_t (*get_max_device_count)(void* ctx);
     // enables or disables an endpoint using parameters derived from ep_desc
-    mx_status_t (*enable_endpoint)(void* ctx, uint32_t device_id,
+    zx_status_t (*enable_endpoint)(void* ctx, uint32_t device_id,
                                    usb_endpoint_descriptor_t* ep_desc,
                                    usb_ss_ep_comp_descriptor_t* ss_comp_desc, bool enable);
 
@@ -26,13 +26,13 @@
     uint64_t (*get_current_frame)(void* ctx);
 
     // Hub support
-    mx_status_t (*configure_hub)(void* ctx, uint32_t device_id, usb_speed_t speed,
+    zx_status_t (*configure_hub)(void* ctx, uint32_t device_id, usb_speed_t speed,
                  usb_hub_descriptor_t* descriptor);
-    mx_status_t (*hub_device_added)(void* ctx, uint32_t device_id, int port, usb_speed_t speed);
-    mx_status_t (*hub_device_removed)(void* ctx, uint32_t device_id, int port);
-    mx_status_t (*reset_endpoint)(void* ctx, uint32_t device_id, uint8_t ep_address);
+    zx_status_t (*hub_device_added)(void* ctx, uint32_t device_id, int port, usb_speed_t speed);
+    zx_status_t (*hub_device_removed)(void* ctx, uint32_t device_id, int port);
+    zx_status_t (*reset_endpoint)(void* ctx, uint32_t device_id, uint8_t ep_address);
     size_t (*get_max_transfer_size)(void* ctx, uint32_t device_id, uint8_t ep_address);
-    mx_status_t (*cancel_all)(void* ctx, uint32_t device_id, uint8_t ep_address);
+    zx_status_t (*cancel_all)(void* ctx, uint32_t device_id, uint8_t ep_address);
 } usb_hci_protocol_ops_t;
 
 typedef struct usb_hci_protocol {
@@ -50,7 +50,7 @@
 }
 
 // enables or disables an endpoint using parameters derived from ep_desc
-static inline mx_status_t usb_hci_enable_endpoint(usb_hci_protocol_t* hci, uint32_t device_id,
+static inline zx_status_t usb_hci_enable_endpoint(usb_hci_protocol_t* hci, uint32_t device_id,
                                    usb_endpoint_descriptor_t* ep_desc,
                                    usb_ss_ep_comp_descriptor_t* ss_comp_desc, bool enable) {
     return hci->ops->enable_endpoint(hci->ctx, device_id, ep_desc, ss_comp_desc, enable);
@@ -61,23 +61,23 @@
     return hci->ops->get_current_frame(hci->ctx);
 }
 
-static inline mx_status_t usb_hci_configure_hub(usb_hci_protocol_t* hci, uint32_t device_id,
+static inline zx_status_t usb_hci_configure_hub(usb_hci_protocol_t* hci, uint32_t device_id,
                                                 usb_speed_t speed,
                                                 usb_hub_descriptor_t* descriptor) {
     return hci->ops->configure_hub(hci->ctx, device_id, speed, descriptor);
 }
 
-static inline mx_status_t usb_hci_hub_device_added(usb_hci_protocol_t* hci, uint32_t device_id,
+static inline zx_status_t usb_hci_hub_device_added(usb_hci_protocol_t* hci, uint32_t device_id,
                                                    int port, usb_speed_t speed) {
     return hci->ops->hub_device_added(hci->ctx, device_id, port, speed);
 }
 
-static inline mx_status_t usb_hci_hub_device_removed(usb_hci_protocol_t* hci, uint32_t device_id,
+static inline zx_status_t usb_hci_hub_device_removed(usb_hci_protocol_t* hci, uint32_t device_id,
                                                      int port) {
     return hci->ops->hub_device_removed(hci->ctx, device_id, port);
 }
 
-static inline mx_status_t usb_hci_reset_endpoint(usb_hci_protocol_t* hci, uint32_t device_id,
+static inline zx_status_t usb_hci_reset_endpoint(usb_hci_protocol_t* hci, uint32_t device_id,
                                                  uint8_t ep_address) {
     return hci->ops->reset_endpoint(hci->ctx, device_id, ep_address);
 }
@@ -87,7 +87,7 @@
     return hci->ops->get_max_transfer_size(hci->ctx, device_id, ep_address);
 }
 
-static inline mx_status_t usb_hci_cancel_all(usb_hci_protocol_t* hci, uint32_t device_id,
+static inline zx_status_t usb_hci_cancel_all(usb_hci_protocol_t* hci, uint32_t device_id,
                                              uint8_t ep_address) {
     return hci->ops->cancel_all(hci->ctx, device_id, ep_address);
 }
diff --git a/system/ulib/ddk/include/ddk/protocol/usb.h b/system/ulib/ddk/include/ddk/protocol/usb.h
index f7da6ff..077079a 100644
--- a/system/ulib/ddk/include/ddk/protocol/usb.h
+++ b/system/ulib/ddk/include/ddk/protocol/usb.h
@@ -4,10 +4,10 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/hw/usb.h>
-#include <magenta/hw/usb-hub.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/hw/usb.h>
+#include <zircon/hw/usb-hub.h>
 
 __BEGIN_CDECLS;
 
@@ -22,20 +22,20 @@
 } usb_protocol_data_t;
 
 typedef struct usb_protocol_ops {
-    mx_status_t (*control)(void* ctx, uint8_t request_type, uint8_t request, uint16_t value,
-                           uint16_t index, void* data, size_t length, mx_time_t timeout);
+    zx_status_t (*control)(void* ctx, uint8_t request_type, uint8_t request, uint16_t value,
+                           uint16_t index, void* data, size_t length, zx_time_t timeout);
     void (*queue)(void* ctx, iotxn_t* txn, uint8_t ep_address, uint64_t frame);
     usb_speed_t (*get_speed)(void* ctx);
-    mx_status_t (*set_interface)(void* ctx, int interface_number, int alt_setting);
-    mx_status_t (*set_configuration)(void* ctx, int configuration);
-    mx_status_t (*reset_endpoint)(void* ctx, uint8_t ep_address);
+    zx_status_t (*set_interface)(void* ctx, int interface_number, int alt_setting);
+    zx_status_t (*set_configuration)(void* ctx, int configuration);
+    zx_status_t (*reset_endpoint)(void* ctx, uint8_t ep_address);
     size_t (*get_max_transfer_size)(void* ctx, uint8_t ep_address);
     uint32_t (*get_device_id)(void* ctx);
-    mx_status_t (*get_descriptor_list)(void* ctx, void** out_descriptors, size_t* out_length);
-    mx_status_t (*get_additional_descriptor_list)(void* ctx, void** out_descriptors,
+    zx_status_t (*get_descriptor_list)(void* ctx, void** out_descriptors, size_t* out_length);
+    zx_status_t (*get_additional_descriptor_list)(void* ctx, void** out_descriptors,
                                                   size_t* out_length);
-    mx_status_t (*claim_interface)(void* ctx, usb_interface_descriptor_t* intf, size_t length);
-    mx_status_t (*cancel_all)(void* ctx, uint8_t ep_address);
+    zx_status_t (*claim_interface)(void* ctx, usb_interface_descriptor_t* intf, size_t length);
+    zx_status_t (*cancel_all)(void* ctx, uint8_t ep_address);
 } usb_protocol_ops_t;
 
 typedef struct usb_protocol {
@@ -44,32 +44,32 @@
 } usb_protocol_t;
 
 // synchronously executes a control request on endpoint zero
-static inline mx_status_t usb_control(usb_protocol_t* usb, uint8_t request_type, uint8_t request,
+static inline zx_status_t usb_control(usb_protocol_t* usb, uint8_t request_type, uint8_t request,
                                       uint16_t value, uint16_t index, void* data, size_t length,
-                                      mx_time_t timeout) {
+                                      zx_time_t timeout) {
     return usb->ops->control(usb->ctx, request_type, request, value, index, data, length, timeout);
 }
 
-static inline mx_status_t usb_get_descriptor(usb_protocol_t* usb, uint8_t request_type,
+static inline zx_status_t usb_get_descriptor(usb_protocol_t* usb, uint8_t request_type,
                                              uint16_t type, uint16_t index, void* data,
-                                             size_t length, mx_time_t timeout) {
+                                             size_t length, zx_time_t timeout) {
     return usb_control(usb, request_type | USB_DIR_IN, USB_REQ_GET_DESCRIPTOR, type << 8 | index, 0,
                        data, length, timeout);
 }
 
-static inline mx_status_t usb_get_status(usb_protocol_t* usb, uint8_t request_type, uint16_t index,
-                                         void* data, size_t length, mx_time_t timeout) {
+static inline zx_status_t usb_get_status(usb_protocol_t* usb, uint8_t request_type, uint16_t index,
+                                         void* data, size_t length, zx_time_t timeout) {
     return usb_control(usb, request_type | USB_DIR_IN, USB_REQ_GET_STATUS, 0, index, data, length,
                        timeout);
 }
 
-static inline mx_status_t usb_set_feature(usb_protocol_t* usb, uint8_t request_type, int feature,
-                                          int index, mx_time_t timeout) {
+static inline zx_status_t usb_set_feature(usb_protocol_t* usb, uint8_t request_type, int feature,
+                                          int index, zx_time_t timeout) {
     return usb_control(usb, request_type, USB_REQ_SET_FEATURE, feature, index, NULL, 0, timeout);
 }
 
-static inline mx_status_t usb_clear_feature(usb_protocol_t* usb, uint8_t request_type, int feature,
-                                            int index, mx_time_t timeout) {
+static inline zx_status_t usb_clear_feature(usb_protocol_t* usb, uint8_t request_type, int feature,
+                                            int index, zx_time_t timeout) {
     return usb_control(usb, request_type, USB_REQ_CLEAR_FEATURE, feature, index, NULL, 0, timeout);
 }
 
@@ -86,12 +86,12 @@
     return usb->ops->get_speed(usb->ctx);
 }
 
-static inline mx_status_t usb_set_interface(usb_protocol_t* usb, int interface_number,
+static inline zx_status_t usb_set_interface(usb_protocol_t* usb, int interface_number,
                                             int alt_setting) {
     return usb->ops->set_interface(usb->ctx, interface_number, alt_setting);
 }
 
-static inline mx_status_t usb_set_configuration(usb_protocol_t* usb, int configuration) {
+static inline zx_status_t usb_set_configuration(usb_protocol_t* usb, int configuration) {
     return usb->ops->set_configuration(usb->ctx, configuration);
 }
 
@@ -99,29 +99,29 @@
 // Endpoints will be halted if the device returns a STALL in response to a USB transaction.
 // When that occurs, the transaction will fail with ERR_IO_REFUSED.
 // usb_reset_endpoint() the endpoint to normal running state.
-static inline mx_status_t usb_reset_endpoint(usb_protocol_t* usb, uint8_t ep_address) {
+static inline zx_status_t usb_reset_endpoint(usb_protocol_t* usb, uint8_t ep_address) {
     return usb->ops->reset_endpoint(usb->ctx, ep_address);
 }
 
 // returns the maximum amount of data that can be transferred on an endpoint in a single transaction.
-static inline mx_status_t usb_get_max_transfer_size(usb_protocol_t* usb, uint8_t ep_address) {
+static inline zx_status_t usb_get_max_transfer_size(usb_protocol_t* usb, uint8_t ep_address) {
     return usb->ops->get_max_transfer_size(usb->ctx, ep_address);
 }
 
-static inline mx_status_t usb_get_device_id(usb_protocol_t* usb) {
+static inline zx_status_t usb_get_device_id(usb_protocol_t* usb) {
     return usb->ops->get_device_id(usb->ctx);
 }
 
 // returns the USB descriptors for the USB device or interface
 // the returned value is de-allocated with free()
-static inline mx_status_t usb_get_descriptor_list(usb_protocol_t* usb, void** out_descriptors,
+static inline zx_status_t usb_get_descriptor_list(usb_protocol_t* usb, void** out_descriptors,
                                                   size_t* out_length) {
     return usb->ops->get_descriptor_list(usb->ctx, out_descriptors, out_length);
 }
 
 // returns the USB descriptors following the interface's existing descriptors
 // the returned value is de-allocated with free()
-static inline mx_status_t usb_get_additional_descriptor_list(usb_protocol_t* usb,
+static inline zx_status_t usb_get_additional_descriptor_list(usb_protocol_t* usb,
                                                              void** out_descriptors,
                                                              size_t* out_length) {
     return usb->ops->get_additional_descriptor_list(usb->ctx, out_descriptors, out_length);
@@ -129,12 +129,12 @@
 
 // marks the interface as claimed and appends the interface descriptor to the
 // interface's existing descriptors.
-static inline mx_status_t usb_claim_interface(usb_protocol_t* usb,
+static inline zx_status_t usb_claim_interface(usb_protocol_t* usb,
                                               usb_interface_descriptor_t* intf, size_t length) {
     return usb->ops->claim_interface(usb->ctx, intf, length);
 }
 
-static inline mx_status_t usb_cancel_all(usb_protocol_t* usb, uint8_t ep_address) {
+static inline zx_status_t usb_cancel_all(usb_protocol_t* usb, uint8_t ep_address) {
     return usb->ops->cancel_all(usb->ctx, ep_address);
 }
 
diff --git a/system/ulib/ddk/include/ddk/protocol/wlan.h b/system/ulib/ddk/include/ddk/protocol/wlan.h
index cf2d130..e8eb846 100644
--- a/system/ulib/ddk/include/ddk/protocol/wlan.h
+++ b/system/ulib/ddk/include/ddk/protocol/wlan.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include <ddk/protocol/ethernet.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
@@ -84,11 +84,11 @@
     // Safe to call at any time.
     // TODO: create wlanmac_info_t for wlan-specific info and copy the relevant
     // ethernet fields into ethmac_info_t before passing up the stack
-    mx_status_t (*query)(void* ctx, uint32_t options, ethmac_info_t* info);
+    zx_status_t (*query)(void* ctx, uint32_t options, ethmac_info_t* info);
 
     // Start wlanmac running with ifc_virt
     // Callbacks on ifc may be invoked from now until stop() is called
-    mx_status_t (*start)(void* ctx, wlanmac_ifc_t* ifc, void* cookie);
+    zx_status_t (*start)(void* ctx, wlanmac_ifc_t* ifc, void* cookie);
 
     // Shut down a running wlanmac
     // Safe to call if the wlanmac is already stopped.
@@ -98,7 +98,7 @@
     void (*tx)(void* ctx, uint32_t options, const void* data, size_t length);
 
     // Set the radio channel
-    mx_status_t (*set_channel)(void* ctx, uint32_t options, wlan_channel_t* chan);
+    zx_status_t (*set_channel)(void* ctx, uint32_t options, wlan_channel_t* chan);
 } wlanmac_protocol_ops_t;
 
 typedef struct wlanmac_protocol {
diff --git a/system/ulib/ddk/include/hw/inout.h b/system/ulib/ddk/include/hw/inout.h
index d120e33..6682eab 100644
--- a/system/ulib/ddk/include/hw/inout.h
+++ b/system/ulib/ddk/include/hw/inout.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 __BEGIN_CDECLS;
diff --git a/system/ulib/ddk/include/hw/pci.h b/system/ulib/ddk/include/hw/pci.h
index b084d65..3890eec 100644
--- a/system/ulib/ddk/include/hw/pci.h
+++ b/system/ulib/ddk/include/hw/pci.h
@@ -9,8 +9,8 @@
 #include <endian.h>
 #include <stdbool.h>
 #include <stdint.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/ulib/ddk/include/hw/sdmmc.h b/system/ulib/ddk/include/hw/sdmmc.h
index 90d202c..def14cf 100644
--- a/system/ulib/ddk/include/hw/sdmmc.h
+++ b/system/ulib/ddk/include/hw/sdmmc.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <ddk/device.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/ulib/ddk/io-buffer.c b/system/ulib/ddk/io-buffer.c
index 9049c74..ba86c37 100644
--- a/system/ulib/ddk/io-buffer.c
+++ b/system/ulib/ddk/io-buffer.c
@@ -4,29 +4,29 @@
 
 #include <ddk/io-buffer.h>
 #include <ddk/driver.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <limits.h>
 #include <stdio.h>
 
-static mx_status_t io_buffer_init_common(io_buffer_t* buffer, mx_handle_t vmo_handle, size_t size,
-                                         mx_off_t offset, uint32_t flags) {
-    mx_vaddr_t virt;
+static zx_status_t io_buffer_init_common(io_buffer_t* buffer, zx_handle_t vmo_handle, size_t size,
+                                         zx_off_t offset, uint32_t flags) {
+    zx_vaddr_t virt;
 
-    mx_status_t status = mx_vmar_map(mx_vmar_root_self(), 0, vmo_handle, 0, size, flags, &virt);
-    if (status != MX_OK) {
-        printf("io_buffer: mx_vmar_map failed %d size: %zu\n", status, size);
-        mx_handle_close(vmo_handle);
+    zx_status_t status = zx_vmar_map(zx_vmar_root_self(), 0, vmo_handle, 0, size, flags, &virt);
+    if (status != ZX_OK) {
+        printf("io_buffer: zx_vmar_map failed %d size: %zu\n", status, size);
+        zx_handle_close(vmo_handle);
         return status;
     }
 
-    mx_paddr_t phys;
+    zx_paddr_t phys;
     size_t lookup_size = size < PAGE_SIZE ? size : PAGE_SIZE;
-    status = mx_vmo_op_range(vmo_handle, MX_VMO_OP_LOOKUP, 0, lookup_size, &phys, sizeof(phys));
-    if (status != MX_OK) {
-        printf("io_buffer: mx_vmo_op_range failed %d size: %zu\n", status, size);
-        mx_vmar_unmap(mx_vmar_root_self(), virt, size);
-        mx_handle_close(vmo_handle);
+    status = zx_vmo_op_range(vmo_handle, ZX_VMO_OP_LOOKUP, 0, lookup_size, &phys, sizeof(phys));
+    if (status != ZX_OK) {
+        printf("io_buffer: zx_vmo_op_range failed %d size: %zu\n", status, size);
+        zx_vmar_unmap(zx_vmar_root_self(), virt, size);
+        zx_handle_close(vmo_handle);
         return status;
     }
 
@@ -35,74 +35,74 @@
     buffer->offset = offset;
     buffer->virt = (void *)virt;
     buffer->phys = phys;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t io_buffer_init_aligned(io_buffer_t* buffer, size_t size, uint32_t alignment_log2, uint32_t flags) {
+zx_status_t io_buffer_init_aligned(io_buffer_t* buffer, size_t size, uint32_t alignment_log2, uint32_t flags) {
     if (size == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (flags != IO_BUFFER_RO && flags != IO_BUFFER_RW) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_handle_t vmo_handle;
-    mx_status_t status = mx_vmo_create_contiguous(get_root_resource(), size, alignment_log2, &vmo_handle);
-    if (status != MX_OK) {
-        printf("io_buffer: mx_vmo_create_contiguous failed %d\n", status);
+    zx_handle_t vmo_handle;
+    zx_status_t status = zx_vmo_create_contiguous(get_root_resource(), size, alignment_log2, &vmo_handle);
+    if (status != ZX_OK) {
+        printf("io_buffer: zx_vmo_create_contiguous failed %d\n", status);
         return status;
     }
 
     return io_buffer_init_common(buffer, vmo_handle, size, 0, flags);
 }
 
-mx_status_t io_buffer_init(io_buffer_t* buffer, size_t size, uint32_t flags) {
+zx_status_t io_buffer_init(io_buffer_t* buffer, size_t size, uint32_t flags) {
     // A zero alignment gets interpreted as PAGE_SIZE_SHIFT.
     return io_buffer_init_aligned(buffer, size, 0, flags);
 }
 
-mx_status_t io_buffer_init_vmo(io_buffer_t* buffer, mx_handle_t vmo_handle, mx_off_t offset,
+zx_status_t io_buffer_init_vmo(io_buffer_t* buffer, zx_handle_t vmo_handle, zx_off_t offset,
                                uint32_t flags) {
     uint64_t size;
 
     if (flags != IO_BUFFER_RO && flags != IO_BUFFER_RW) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t status = mx_handle_duplicate(vmo_handle, MX_RIGHT_SAME_RIGHTS, &vmo_handle);
-    if (status != MX_OK) return status;
+    zx_status_t status = zx_handle_duplicate(vmo_handle, ZX_RIGHT_SAME_RIGHTS, &vmo_handle);
+    if (status != ZX_OK) return status;
 
-    status = mx_vmo_get_size(vmo_handle, &size);
-    if (status != MX_OK) {
-        mx_handle_close(vmo_handle);
+    status = zx_vmo_get_size(vmo_handle, &size);
+    if (status != ZX_OK) {
+        zx_handle_close(vmo_handle);
         return status;
     }
 
     return io_buffer_init_common(buffer, vmo_handle, size, offset, flags);
 }
 
-mx_status_t io_buffer_init_physical(io_buffer_t* buffer, mx_paddr_t addr, size_t size,
-                                    mx_handle_t resource, uint32_t cache_policy) {
-    mx_handle_t vmo_handle;
-    mx_status_t status = mx_vmo_create_physical(resource, addr, size, &vmo_handle);
-    if (status != MX_OK) {
-        printf("io_buffer: mx_vmo_create_physical failed %d\n", status);
+zx_status_t io_buffer_init_physical(io_buffer_t* buffer, zx_paddr_t addr, size_t size,
+                                    zx_handle_t resource, uint32_t cache_policy) {
+    zx_handle_t vmo_handle;
+    zx_status_t status = zx_vmo_create_physical(resource, addr, size, &vmo_handle);
+    if (status != ZX_OK) {
+        printf("io_buffer: zx_vmo_create_physical failed %d\n", status);
         return status;
     }
 
-    status = mx_vmo_set_cache_policy(vmo_handle, cache_policy);
-    if (status != MX_OK) {
-        printf("io_buffer: mx_vmo_set_cache_policy failed %d\n", status);
-        mx_handle_close(vmo_handle);
+    status = zx_vmo_set_cache_policy(vmo_handle, cache_policy);
+    if (status != ZX_OK) {
+        printf("io_buffer: zx_vmo_set_cache_policy failed %d\n", status);
+        zx_handle_close(vmo_handle);
         return status;
     }
 
-    uint32_t flags = MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_MAP_RANGE;
-    mx_vaddr_t virt;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo_handle, 0, size, flags, &virt);
-    if (status != MX_OK) {
-        printf("io_buffer: mx_vmar_map failed %d size: %zu\n", status, size);
-        mx_handle_close(vmo_handle);
+    uint32_t flags = ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_MAP_RANGE;
+    zx_vaddr_t virt;
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo_handle, 0, size, flags, &virt);
+    if (status != ZX_OK) {
+        printf("io_buffer: zx_vmar_map failed %d size: %zu\n", status, size);
+        zx_handle_close(vmo_handle);
         return status;
     }
 
@@ -111,18 +111,18 @@
     buffer->offset = 0;
     buffer->virt = (void *)virt;
     buffer->phys = addr;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void io_buffer_release(io_buffer_t* buffer) {
     if (buffer->vmo_handle) {
-        mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)buffer->virt, buffer->size);
-        mx_handle_close(buffer->vmo_handle);
-        buffer->vmo_handle = MX_HANDLE_INVALID;
+        zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)buffer->virt, buffer->size);
+        zx_handle_close(buffer->vmo_handle);
+        buffer->vmo_handle = ZX_HANDLE_INVALID;
     }
 }
 
-mx_status_t io_buffer_cache_op(io_buffer_t* buffer, const uint32_t op,
-                               const mx_off_t offset, const size_t size) {
-    return mx_vmo_op_range(buffer->vmo_handle, op, offset, size, NULL, 0);
+zx_status_t io_buffer_cache_op(io_buffer_t* buffer, const uint32_t op,
+                               const zx_off_t offset, const size_t size) {
+    return zx_vmo_op_range(buffer->vmo_handle, op, offset, size, NULL, 0);
 }
diff --git a/system/ulib/ddk/iotxn.c b/system/ulib/ddk/iotxn.c
index 962d301..d038b12 100644
--- a/system/ulib/ddk/iotxn.c
+++ b/system/ulib/ddk/iotxn.c
@@ -5,9 +5,9 @@
 #include <assert.h>
 #include <ddk/iotxn.h>
 #include <ddk/device.h>
-#include <magenta/assert.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/assert.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <sys/param.h>
 #include <stdatomic.h>
 #include <stdlib.h>
@@ -46,7 +46,7 @@
 #endif
 
 // This assert will fail if we attempt to access the buffer of a cloned txn after it has been completed
-#define ASSERT_BUFFER_VALID(priv) MX_DEBUG_ASSERT(!(priv->flags & IOTXN_FLAG_DEAD))
+#define ASSERT_BUFFER_VALID(priv) ZX_DEBUG_ASSERT(!(priv->flags & IOTXN_FLAG_DEAD))
 
 static uint32_t alloc_flags_to_pflags(uint32_t alloc_flags) {
     if (alloc_flags & IOTXN_ALLOC_CONTIGUOUS) {
@@ -89,14 +89,14 @@
 
 // return the iotxn into the free list
 static void iotxn_release_free_list(iotxn_t* txn) {
-    mx_handle_t vmo_handle = txn->vmo_handle;
+    zx_handle_t vmo_handle = txn->vmo_handle;
     uint64_t vmo_offset = txn->vmo_offset;
     uint64_t vmo_length = txn->vmo_length;
     void* virt = txn->virt;
-    mx_paddr_t* phys = txn->phys;
+    zx_paddr_t* phys = txn->phys;
     uint64_t phys_count = txn->phys_count;
     uint32_t pflags = txn->pflags;
-    mx_paddr_t phys_inline[3];
+    zx_paddr_t phys_inline[3];
     memcpy(phys_inline, txn->phys_inline, sizeof(txn->phys_inline));
 
     memset(txn, 0, sizeof(iotxn_t));
@@ -120,7 +120,7 @@
         if (pflags & IOTXN_PFLAG_MMAP) {
             // only unmap if we called mmap()
             if (virt) {
-                mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)virt, vmo_length);
+                zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)virt, vmo_length);
             }
         }
     }
@@ -152,11 +152,11 @@
     }
     if (txn->pflags & IOTXN_PFLAG_MMAP) {
         if (txn->virt) {
-            mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)txn->virt, txn->vmo_length);
+            zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)txn->virt, txn->vmo_length);
         }
     }
     if (txn->pflags & IOTXN_PFLAG_ALLOC) {
-        mx_handle_close(txn->vmo_handle);
+        zx_handle_close(txn->vmo_handle);
     }
     free(txn);
 }
@@ -176,16 +176,16 @@
     if (pflags & IOTXN_PFLAG_MMAP) {
         // only unmap if we called mmap()
         if (txn->virt) {
-            mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)txn->virt, txn->vmo_length);
+            zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)txn->virt, txn->vmo_length);
             txn->virt = NULL;
         }
     }
 }
 
-void iotxn_complete(iotxn_t* txn, mx_status_t status, mx_off_t actual) {
+void iotxn_complete(iotxn_t* txn, zx_status_t status, zx_off_t actual) {
     xprintf("iotxn_complete txn %p\n", txn);
 
-    MX_DEBUG_ASSERT((txn->pflags & IOTXN_STATE_MASK) == IOTXN_PFLAG_QUEUED);
+    ZX_DEBUG_ASSERT((txn->pflags & IOTXN_STATE_MASK) == IOTXN_PFLAG_QUEUED);
     txn->pflags &= ~IOTXN_PFLAG_QUEUED;
 
     txn->actual = actual;
@@ -198,60 +198,60 @@
 ssize_t iotxn_copyfrom(iotxn_t* txn, void* data, size_t length, size_t offset) {
     length = MIN(txn->vmo_length - offset, length);
     size_t actual;
-    mx_status_t status = mx_vmo_read(txn->vmo_handle, data, txn->vmo_offset + offset, length, &actual);
+    zx_status_t status = zx_vmo_read(txn->vmo_handle, data, txn->vmo_offset + offset, length, &actual);
     xprintf("iotxn_copyfrom: txn %p vmo_offset 0x%" PRIx64 " offset 0x%zx length 0x%zx actual 0x%zx status %d\n", txn, txn->vmo_offset, offset, length, actual, status);
-    return (status == MX_OK) ? (ssize_t)actual : status;
+    return (status == ZX_OK) ? (ssize_t)actual : status;
 }
 
 ssize_t iotxn_copyto(iotxn_t* txn, const void* data, size_t length, size_t offset) {
     length = MIN(txn->vmo_length - offset, length);
     size_t actual;
-    mx_status_t status = mx_vmo_write(txn->vmo_handle, data, txn->vmo_offset + offset, length, &actual);
+    zx_status_t status = zx_vmo_write(txn->vmo_handle, data, txn->vmo_offset + offset, length, &actual);
     xprintf("iotxn_copyto: txn %p vmo_offset 0x%" PRIx64 " offset 0x%zx length 0x%zx actual 0x%zx status %d\n", txn, txn->vmo_offset, offset, length, actual, status);
-    return (status == MX_OK) ? (ssize_t)actual : status;
+    return (status == ZX_OK) ? (ssize_t)actual : status;
 }
 
-static mx_status_t iotxn_physmap_contiguous(iotxn_t* txn) {
+static zx_status_t iotxn_physmap_contiguous(iotxn_t* txn) {
     txn->phys = txn->phys_inline;
 
     // for contiguous buffers, commit the whole range but just map the first
     // page
     uint64_t page_offset = ROUNDDOWN(txn->vmo_offset, PAGE_SIZE);
-    mx_status_t status = mx_vmo_op_range(txn->vmo_handle, MX_VMO_OP_COMMIT, page_offset, txn->vmo_length, NULL, 0);
-    if (status != MX_OK) {
+    zx_status_t status = zx_vmo_op_range(txn->vmo_handle, ZX_VMO_OP_COMMIT, page_offset, txn->vmo_length, NULL, 0);
+    if (status != ZX_OK) {
         goto fail;
     }
 
-    status = mx_vmo_op_range(txn->vmo_handle, MX_VMO_OP_LOOKUP, page_offset, PAGE_SIZE, txn->phys, sizeof(mx_paddr_t));
-    if (status != MX_OK) {
+    status = zx_vmo_op_range(txn->vmo_handle, ZX_VMO_OP_LOOKUP, page_offset, PAGE_SIZE, txn->phys, sizeof(zx_paddr_t));
+    if (status != ZX_OK) {
         goto fail;
     }
 
     txn->phys_count = 1;
-    return MX_OK;
+    return ZX_OK;
 fail:
     txn->phys = NULL;
     return status;
 }
 
-static mx_status_t iotxn_physmap_paged(iotxn_t* txn) {
-    // MX_VMO_OP_LOOKUP returns whole pages, so take into account unaligned vmo
+static zx_status_t iotxn_physmap_paged(iotxn_t* txn) {
+    // ZX_VMO_OP_LOOKUP returns whole pages, so take into account unaligned vmo
     // offset and length when calculating the amount of pages returned
     uint64_t page_offset = ROUNDDOWN(txn->vmo_offset, PAGE_SIZE);
     uint64_t page_length = txn->vmo_length + (txn->vmo_offset - page_offset);
     uint64_t pages = ROUNDUP(page_length, PAGE_SIZE) / PAGE_SIZE;
 
     bool use_inline = pages <= 3;
-    mx_paddr_t* paddrs = use_inline ? txn->phys_inline : malloc(sizeof(mx_paddr_t) * pages);
+    zx_paddr_t* paddrs = use_inline ? txn->phys_inline : malloc(sizeof(zx_paddr_t) * pages);
     if (paddrs == NULL) {
         xprintf("iotxn_physmap_paged: out of memory\n");
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     // commit pages and lookup physical addresses
     // assume that commited pages will never be auto-decommitted
-    mx_status_t status = mx_vmo_op_range(txn->vmo_handle, MX_VMO_OP_COMMIT, txn->vmo_offset, txn->vmo_length, NULL, 0);
-    if (status != MX_OK) {
+    zx_status_t status = zx_vmo_op_range(txn->vmo_handle, ZX_VMO_OP_COMMIT, txn->vmo_offset, txn->vmo_length, NULL, 0);
+    if (status != ZX_OK) {
         xprintf("iotxn_physmap_paged: error %d in commit\n", status);
         if (!use_inline) {
             free(paddrs);
@@ -259,8 +259,8 @@
         return status;
     }
 
-    status = mx_vmo_op_range(txn->vmo_handle, MX_VMO_OP_LOOKUP, page_offset, page_length, paddrs, sizeof(mx_paddr_t) * pages);
-    if (status != MX_OK) {
+    status = zx_vmo_op_range(txn->vmo_handle, ZX_VMO_OP_LOOKUP, page_offset, page_length, paddrs, sizeof(zx_paddr_t) * pages);
+    if (status != ZX_OK) {
         xprintf("iotxn_physmap_paged: error %d in lookup\n", status);
         if (!use_inline) {
             free(paddrs);
@@ -273,17 +273,17 @@
     }
     txn->phys = paddrs;
     txn->phys_count = pages;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t iotxn_physmap(iotxn_t* txn) {
+zx_status_t iotxn_physmap(iotxn_t* txn) {
     if (txn->phys_count > 0) {
-        return MX_OK;
+        return ZX_OK;
     }
     if (txn->vmo_length == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    mx_status_t status;
+    zx_status_t status;
     if (txn->pflags & IOTXN_PFLAG_CONTIGUOUS) {
         status = iotxn_physmap_contiguous(txn);
     } else {
@@ -292,21 +292,21 @@
     return status;
 }
 
-mx_status_t iotxn_mmap(iotxn_t* txn, void** data) {
+zx_status_t iotxn_mmap(iotxn_t* txn, void** data) {
     xprintf("iotxn_mmap: txn %p\n", txn);
     if (txn->virt) {
         *data = txn->virt;
-        return MX_OK;
+        return ZX_OK;
     }
-    mx_status_t status = mx_vmar_map(mx_vmar_root_self(), 0, txn->vmo_handle, txn->vmo_offset, txn->vmo_length, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, (uintptr_t*)(&txn->virt));
-    if (status == MX_OK) {
+    zx_status_t status = zx_vmar_map(zx_vmar_root_self(), 0, txn->vmo_handle, txn->vmo_offset, txn->vmo_length, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, (uintptr_t*)(&txn->virt));
+    if (status == ZX_OK) {
         txn->pflags |= IOTXN_PFLAG_MMAP;
         *data = txn->virt;
     }
     return status;
 }
 
-mx_status_t iotxn_clone(iotxn_t* txn, iotxn_t** out) {
+zx_status_t iotxn_clone(iotxn_t* txn, iotxn_t** out) {
     xprintf("iotxn_clone txn %p\n", txn);
     iotxn_t* clone = NULL;
     if (*out != NULL) {
@@ -316,7 +316,7 @@
         if (clone == NULL) {
             clone = calloc(1, sizeof(iotxn_t));
             if (clone == NULL) {
-                return MX_ERR_NO_MEMORY;
+                return ZX_ERR_NO_MEMORY;
             }
         }
     }
@@ -329,23 +329,23 @@
     clone->release_cb = iotxn_release_free_list;
 
     *out = clone;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t iotxn_clone_partial(iotxn_t* txn, uint64_t vmo_offset, mx_off_t length, iotxn_t** out) {
+zx_status_t iotxn_clone_partial(iotxn_t* txn, uint64_t vmo_offset, zx_off_t length, iotxn_t** out) {
     xprintf("iotxn_clone_partial txn %p\n", txn);
     if (vmo_offset < txn->vmo_offset) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (length > txn->length) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if ((vmo_offset - txn->vmo_offset) > (length - txn->length)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t status = iotxn_clone(txn, out);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_clone(txn, out);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -368,21 +368,21 @@
                 uint64_t pages = (new_page_offset - page_offset) / PAGE_SIZE;
                 if (pages >= clone->phys_count) {
                     iotxn_release(clone);
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
                 clone->phys += pages;
                 clone->phys_count -= pages;
-                MX_DEBUG_ASSERT(clone->phys_count > 0);
+                ZX_DEBUG_ASSERT(clone->phys_count > 0);
             }
         }
     }
-    MX_DEBUG_ASSERT(clone->release_cb == iotxn_release_free_list);
-    return MX_OK;
+    ZX_DEBUG_ASSERT(clone->release_cb == iotxn_release_free_list);
+    return ZX_OK;
 }
 
 void iotxn_release(iotxn_t* txn) {
     // should not release a queued transaction
-    MX_DEBUG_ASSERT((txn->pflags & IOTXN_STATE_MASK) == 0);
+    ZX_DEBUG_ASSERT((txn->pflags & IOTXN_STATE_MASK) == 0);
 
     if (txn->release_cb) {
         txn->release_cb(txn);
@@ -394,10 +394,10 @@
     if (length == 0 || txn->vmo_length == 0)
         return;
 
-    mx_vmo_op_range(txn->vmo_handle, op, txn->vmo_offset + offset, length, NULL, 0);
+    zx_vmo_op_range(txn->vmo_handle, op, txn->vmo_offset + offset, length, NULL, 0);
 }
 
-mx_status_t iotxn_alloc(iotxn_t** out, uint32_t alloc_flags, uint64_t data_size) {
+zx_status_t iotxn_alloc(iotxn_t** out, uint32_t alloc_flags, uint64_t data_size) {
     //xprintf("iotxn_alloc: alloc_flags 0x%x data_size 0x%" PRIx64 "\n", alloc_flags, data_size);
 
     // look in free list first for a iotxn with data_size
@@ -410,19 +410,19 @@
     // didn't find one that fits, allocate a new one
     txn = calloc(1, sizeof(iotxn_t));
     if (!txn) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     if (data_size > 0) {
-        mx_status_t status;
+        zx_status_t status;
         if (alloc_flags & IOTXN_ALLOC_CONTIGUOUS) {
-            status = mx_vmo_create_contiguous(get_root_resource(), data_size, 0, &txn->vmo_handle);
+            status = zx_vmo_create_contiguous(get_root_resource(), data_size, 0, &txn->vmo_handle);
             txn->pflags |= IOTXN_PFLAG_CONTIGUOUS;
         } else {
-            status = mx_vmo_create(data_size, 0, &txn->vmo_handle);
+            status = zx_vmo_create(data_size, 0, &txn->vmo_handle);
         }
-        mx_object_set_property(txn->vmo_handle, MX_PROP_NAME, "iotxn", 5);
-        if (status != MX_OK) {
-            xprintf("iotxn_alloc: error %d in mx_vmo_create, flags 0x%x\n", status, alloc_flags);
+        zx_object_set_property(txn->vmo_handle, ZX_PROP_NAME, "iotxn", 5);
+        if (status != ZX_OK) {
+            xprintf("iotxn_alloc: error %d in zx_vmo_create, flags 0x%x\n", status, alloc_flags);
             free(txn);
             return status;
         }
@@ -432,25 +432,25 @@
     }
 
 out:
-    MX_DEBUG_ASSERT(txn != NULL);
-    MX_DEBUG_ASSERT(!(txn->pflags & IOTXN_PFLAG_FREE));
+    ZX_DEBUG_ASSERT(txn != NULL);
+    ZX_DEBUG_ASSERT(!(txn->pflags & IOTXN_PFLAG_FREE));
     if (alloc_flags & IOTXN_ALLOC_POOL) {
         txn->release_cb = iotxn_release_free_list;
     } else {
         txn->release_cb = iotxn_release_free;
     }
     *out = txn;
-    return MX_OK;
+    return ZX_OK;
 }
 
-void iotxn_queue(mx_device_t* dev, iotxn_t* txn) {
+void iotxn_queue(zx_device_t* dev, iotxn_t* txn) {
     // don't assert not queued here, since iotxns are allowed to be requeued
     txn->pflags |= IOTXN_PFLAG_QUEUED;
 
     // This can only fail if iotxn_queue() is not implemented by the
     // device, in which case we fall back to calling the read or write op
-    if (device_iotxn_queue(dev, txn) != MX_OK) {
-        mx_status_t status;
+    if (device_iotxn_queue(dev, txn) != ZX_OK) {
+        zx_status_t status;
         size_t actual = 0;
         void* buf;
         iotxn_mmap(txn, &buf);
@@ -459,13 +459,13 @@
         } else if (txn->opcode == IOTXN_OP_WRITE) {
             status = device_write(dev, buf, txn->length, txn->offset, &actual);
         } else {
-            status = MX_ERR_NOT_SUPPORTED;
+            status = ZX_ERR_NOT_SUPPORTED;
         }
         iotxn_complete(txn, status, actual);
     }
 }
 
-void iotxn_init(iotxn_t* txn, mx_handle_t vmo_handle, uint64_t vmo_offset, uint64_t length) {
+void iotxn_init(iotxn_t* txn, zx_handle_t vmo_handle, uint64_t vmo_offset, uint64_t length) {
     memset(txn, 0, sizeof(*txn));
     txn->vmo_handle = vmo_handle;
     txn->vmo_offset = vmo_offset;
@@ -474,11 +474,11 @@
     txn->release_cb = iotxn_release_static;
 }
 
-mx_status_t iotxn_alloc_vmo(iotxn_t** out, uint32_t alloc_flags, mx_handle_t vmo_handle,
+zx_status_t iotxn_alloc_vmo(iotxn_t** out, uint32_t alloc_flags, zx_handle_t vmo_handle,
                             uint64_t vmo_offset, uint64_t length) {
     iotxn_t* txn;
-    mx_status_t status = iotxn_alloc(&txn, alloc_flags, 0);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc(&txn, alloc_flags, 0);
+    if (status != ZX_OK) {
         return status;
     }
     txn->vmo_handle = vmo_handle;
@@ -486,13 +486,13 @@
     txn->vmo_length = length;
     txn->length = length;
     *out = txn;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void iotxn_phys_iter_init(iotxn_phys_iter_t* iter, iotxn_t* txn, size_t max_length) {
     iter->txn = txn;
     iter->offset = 0;
-    MX_DEBUG_ASSERT(max_length % PAGE_SIZE == 0);
+    ZX_DEBUG_ASSERT(max_length % PAGE_SIZE == 0);
     if (max_length == 0) {
         max_length = UINT64_MAX;
     }
@@ -508,18 +508,18 @@
     }
 }
 
-size_t iotxn_phys_iter_next(iotxn_phys_iter_t* iter, mx_paddr_t* out_paddr) {
+size_t iotxn_phys_iter_next(iotxn_phys_iter_t* iter, zx_paddr_t* out_paddr) {
     iotxn_t* txn = iter->txn;
-    mx_off_t offset = iter->offset;
+    zx_off_t offset = iter->offset;
     size_t max_length = iter->max_length;
     size_t length = txn->length;
     if (offset >= length) {
         return 0;
     }
     size_t remaining = length - offset;
-    mx_paddr_t* phys_addrs = txn->phys;
+    zx_paddr_t* phys_addrs = txn->phys;
     size_t align_adjust = txn->vmo_offset & (PAGE_SIZE - 1);
-    mx_paddr_t phys = phys_addrs[iter->page];
+    zx_paddr_t phys = phys_addrs[iter->page];
     size_t return_length = 0;
 
     if (txn->phys_count == 1) {
@@ -570,7 +570,7 @@
             break;
         }
 
-        mx_paddr_t next = phys_addrs[iter->page];
+        zx_paddr_t next = phys_addrs[iter->page];
         if (phys + PAGE_SIZE != next) {
             break;
         }
diff --git a/system/ulib/ddk/rules.mk b/system/ulib/ddk/rules.mk
index 7a4f3f4..13fb129 100644
--- a/system/ulib/ddk/rules.mk
+++ b/system/ulib/ddk/rules.mk
@@ -36,9 +36,9 @@
 
 MODULE_LIBS := \
     system/ulib/unittest \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/driver \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/ddk/test/iotxn-test.c b/system/ulib/ddk/test/iotxn-test.c
index fbd7101..3c24dc0 100644
--- a/system/ulib/ddk/test/iotxn-test.c
+++ b/system/ulib/ddk/test/iotxn-test.c
@@ -18,9 +18,9 @@
 static bool test_physmap_simple(void) {
     BEGIN_TEST;
     iotxn_t* txn;
-    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 3), MX_OK, "");
+    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 3), ZX_OK, "");
     ASSERT_NONNULL(txn, "");
-    ASSERT_EQ(iotxn_physmap(txn), MX_OK, "");
+    ASSERT_EQ(iotxn_physmap(txn), ZX_OK, "");
     ASSERT_NONNULL(txn->phys, "expected phys to be set");
     ASSERT_EQ(txn->phys_count, 3u, "unexpected phys_count");
     iotxn_release(txn);
@@ -30,9 +30,9 @@
 static bool test_physmap_contiguous(void) {
     BEGIN_TEST;
     iotxn_t* txn;
-    ASSERT_EQ(iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, PAGE_SIZE * 3), MX_OK, "");
+    ASSERT_EQ(iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, PAGE_SIZE * 3), ZX_OK, "");
     ASSERT_NONNULL(txn, "");
-    ASSERT_EQ(iotxn_physmap(txn), MX_OK, "");
+    ASSERT_EQ(iotxn_physmap(txn), ZX_OK, "");
     ASSERT_EQ(txn->phys, &txn->phys_inline[0], "expected phys to point to inline_phys");
     ASSERT_EQ(txn->phys_count, 1u, "unexpected phys_length");
     iotxn_release(txn);
@@ -42,14 +42,14 @@
 static bool test_physmap_clone(void) {
     BEGIN_TEST;
     iotxn_t* txn;
-    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 3), MX_OK, "");
+    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 3), ZX_OK, "");
     ASSERT_NONNULL(txn, "");
-    ASSERT_EQ(iotxn_physmap(txn), MX_OK, "");
+    ASSERT_EQ(iotxn_physmap(txn), ZX_OK, "");
     ASSERT_NONNULL(txn->phys, "expected phys to be set");
     ASSERT_EQ(txn->phys_count, 3u, "unexpected phys_count");
 
     iotxn_t* clone = NULL;
-    ASSERT_EQ(iotxn_clone(txn, &clone), MX_OK, "");
+    ASSERT_EQ(iotxn_clone(txn, &clone), ZX_OK, "");
     ASSERT_EQ(txn->phys, clone->phys, "expected clone to point to the same phys");
     ASSERT_EQ(txn->phys_count, clone->phys_count, "unexpected clone phys_count");
     iotxn_release(txn);
@@ -60,11 +60,11 @@
 static bool test_physmap_aligned_offset(void) {
     BEGIN_TEST;
     iotxn_t* txn;
-    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 3), MX_OK, "");
+    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 3), ZX_OK, "");
     ASSERT_NONNULL(txn, "");
     txn->vmo_offset = PAGE_SIZE;
     txn->vmo_length = PAGE_SIZE * 2;
-    ASSERT_EQ(iotxn_physmap(txn), MX_OK, "");
+    ASSERT_EQ(iotxn_physmap(txn), ZX_OK, "");
     ASSERT_NONNULL(txn->phys, "expected phys to be set");
     ASSERT_EQ(txn->phys_count, 2u, "unexpected phys_count");
     iotxn_release(txn);
@@ -74,11 +74,11 @@
 static bool test_physmap_unaligned_offset(void) {
     BEGIN_TEST;
     iotxn_t* txn;
-    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 3), MX_OK, "");
+    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 3), ZX_OK, "");
     ASSERT_NONNULL(txn, "");
     txn->vmo_offset = PAGE_SIZE / 2;
     txn->vmo_length = PAGE_SIZE * 2;
-    ASSERT_EQ(iotxn_physmap(txn), MX_OK, "");
+    ASSERT_EQ(iotxn_physmap(txn), ZX_OK, "");
     ASSERT_EQ(txn->phys, &txn->phys_inline[0], "expected phys to point to inline_phys");
     ASSERT_EQ(txn->phys_count, 3u, "unexpected phys_count");
     iotxn_release(txn);
@@ -88,11 +88,11 @@
 static bool test_physmap_unaligned_offset2(void) {
     BEGIN_TEST;
     iotxn_t* txn;
-    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 4), MX_OK, "");
+    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 4), ZX_OK, "");
     ASSERT_NONNULL(txn, "");
     txn->vmo_offset = PAGE_SIZE - (PAGE_SIZE / 4);
     txn->vmo_length = (PAGE_SIZE * 2) + (PAGE_SIZE / 2);
-    ASSERT_EQ(iotxn_physmap(txn), MX_OK, "");
+    ASSERT_EQ(iotxn_physmap(txn), ZX_OK, "");
     ASSERT_NONNULL(txn->phys, "expected phys to be set");
     ASSERT_NE(txn->phys, &txn->phys_inline[0], "expected phys not to point to inline_phys");
     ASSERT_EQ(txn->phys_count, 4u, "unexpected phys_count");
@@ -104,14 +104,14 @@
     BEGIN_TEST;
     iotxn_phys_iter_t iter;
     iotxn_t* txn;
-    mx_paddr_t paddr;
+    zx_paddr_t paddr;
     size_t length;
     size_t max_length;
 
     // create 4 page contiguous iotxn
-    ASSERT_EQ(iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, PAGE_SIZE * 4), MX_OK, "");
+    ASSERT_EQ(iotxn_alloc(&txn, IOTXN_ALLOC_CONTIGUOUS, PAGE_SIZE * 4), ZX_OK, "");
     txn->length = PAGE_SIZE * 4;
-    ASSERT_EQ(iotxn_physmap(txn), MX_OK, "");
+    ASSERT_EQ(iotxn_physmap(txn), ZX_OK, "");
     ASSERT_EQ(txn->phys_count, 1u, "");
 
     // simple contiguous case
@@ -145,9 +145,9 @@
     iotxn_release(txn);
 
     // create discontiguous iotxn
-    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 4), MX_OK, "");
+    ASSERT_EQ(iotxn_alloc(&txn, 0, PAGE_SIZE * 4), ZX_OK, "");
     txn->length = PAGE_SIZE * 4;
-    ASSERT_EQ(iotxn_physmap(txn), MX_OK, "");
+    ASSERT_EQ(iotxn_physmap(txn), ZX_OK, "");
     ASSERT_EQ(txn->phys_count, 4u, "");
     // pretend that first two pages are contiguous and second two are not
     txn->phys[1] = txn->phys[0] + PAGE_SIZE;
@@ -209,7 +209,7 @@
 
     iotxn_t iotxn;
     const size_t buf_size = 9 * PAGE_SIZE;
-    iotxn_init(&iotxn, MX_HANDLE_INVALID, PAGE_SIZE, buf_size);
+    iotxn_init(&iotxn, ZX_HANDLE_INVALID, PAGE_SIZE, buf_size);
     iotxn.phys = malloc(sizeof(iotxn.phys[0]) * 9);
     ASSERT_NONNULL(iotxn.phys, "");
     iotxn.phys_count = 9;
@@ -230,7 +230,7 @@
 
     // Try iterating 3 pages at a time
     iotxn_phys_iter_init(&iter, &iotxn, 3 * PAGE_SIZE);
-    mx_paddr_t paddr;
+    zx_paddr_t paddr;
     size_t size = iotxn_phys_iter_next(&iter, &paddr);
     ASSERT_EQ(size, 3u * PAGE_SIZE, "");
     ASSERT_EQ(paddr, iotxn.phys[0], "");
@@ -286,7 +286,7 @@
 
     iotxn_t iotxn;
     const size_t buf_size = 4 * PAGE_SIZE;
-    iotxn_init(&iotxn, MX_HANDLE_INVALID, 128, buf_size);
+    iotxn_init(&iotxn, ZX_HANDLE_INVALID, 128, buf_size);
     iotxn.phys = malloc(sizeof(iotxn.phys[0]) * 5);
     ASSERT_NONNULL(iotxn.phys, "");
     iotxn.phys_count = 5;
@@ -300,7 +300,7 @@
 
     // Try iterating 3 pages at a time
     iotxn_phys_iter_init(&iter, &iotxn, 3 * PAGE_SIZE);
-    mx_paddr_t paddr;
+    zx_paddr_t paddr;
     size_t size = iotxn_phys_iter_next(&iter, &paddr);
     ASSERT_EQ(size, 3u * PAGE_SIZE - 128, "");
     ASSERT_EQ(paddr, iotxn.phys[0] + 128, "");
@@ -332,7 +332,7 @@
 
     iotxn_t iotxn;
     const size_t buf_size = 2 * PAGE_SIZE;
-    iotxn_init(&iotxn, MX_HANDLE_INVALID, 128, buf_size);
+    iotxn_init(&iotxn, ZX_HANDLE_INVALID, 128, buf_size);
     iotxn.phys = malloc(sizeof(iotxn.phys[0]) * 3);
     ASSERT_NONNULL(iotxn.phys, "");
     iotxn.phys_count = 3;
@@ -343,7 +343,7 @@
     iotxn_phys_iter_t iter;
 
     iotxn_phys_iter_init(&iter, &iotxn, 0);
-    mx_paddr_t paddr;
+    zx_paddr_t paddr;
 
     size_t size = iotxn_phys_iter_next(&iter, &paddr);
     ASSERT_EQ(size, PAGE_SIZE - 128u, "");
@@ -371,7 +371,7 @@
 
     iotxn_t iotxn;
     const size_t buf_size = 128;
-    iotxn_init(&iotxn, MX_HANDLE_INVALID, 0, buf_size);
+    iotxn_init(&iotxn, ZX_HANDLE_INVALID, 0, buf_size);
     iotxn.phys = malloc(sizeof(iotxn.phys[0]) * 1);
     ASSERT_NONNULL(iotxn.phys, "");
     iotxn.phys_count = 1;
@@ -380,7 +380,7 @@
     iotxn_phys_iter_t iter;
 
     iotxn_phys_iter_init(&iter, &iotxn, 0);
-    mx_paddr_t paddr;
+    zx_paddr_t paddr;
     size_t size = iotxn_phys_iter_next(&iter, &paddr);
     ASSERT_EQ(size, 128u, "");
     ASSERT_EQ(paddr, iotxn.phys[0], "");
@@ -399,7 +399,7 @@
 
     iotxn_t iotxn;
     const size_t buf_size = 128;
-    iotxn_init(&iotxn, MX_HANDLE_INVALID, 128, buf_size);
+    iotxn_init(&iotxn, ZX_HANDLE_INVALID, 128, buf_size);
     iotxn.phys = malloc(sizeof(iotxn.phys[0]) * 1);
     ASSERT_NONNULL(iotxn.phys, "");
     iotxn.phys_count = 1;
@@ -408,7 +408,7 @@
     iotxn_phys_iter_t iter;
 
     iotxn_phys_iter_init(&iter, &iotxn, 0);
-    mx_paddr_t paddr;
+    zx_paddr_t paddr;
     size_t size = iotxn_phys_iter_next(&iter, &paddr);
     ASSERT_EQ(size, 128u, "");
     ASSERT_EQ(paddr, iotxn.phys[0] + 128, "");
@@ -437,22 +437,22 @@
 END_TEST_CASE(iotxn_tests)
 
 static void iotxn_test_output_func(const char* line, int len, void* arg) {
-    mx_handle_t h = *(mx_handle_t*)arg;
+    zx_handle_t h = *(zx_handle_t*)arg;
     // len is not actually the number of bytes to output
-    mx_socket_write(h, 0u, line, strlen(line), NULL);
+    zx_socket_write(h, 0u, line, strlen(line), NULL);
 }
 
-static mx_status_t iotxn_test_func(void* cookie, test_report_t* report, const void* arg, size_t arglen) {
-    mx_device_t* dev = (mx_device_t*)cookie;
+static zx_status_t iotxn_test_func(void* cookie, test_report_t* report, const void* arg, size_t arglen) {
+    zx_device_t* dev = (zx_device_t*)cookie;
 
     test_protocol_t proto;
-    mx_status_t status = device_get_protocol(dev, MX_PROTOCOL_TEST, &proto);
-    if (status != MX_OK) {
+    zx_status_t status = device_get_protocol(dev, ZX_PROTOCOL_TEST, &proto);
+    if (status != ZX_OK) {
         return status;
     }
 
-    mx_handle_t output = proto.ops->get_output_socket(proto.ctx);
-    if (output != MX_HANDLE_INVALID) {
+    zx_handle_t output = proto.ops->get_output_socket(proto.ctx);
+    if (output != ZX_HANDLE_INVALID) {
         unittest_set_output_function(iotxn_test_output_func, &output);
     }
 
@@ -460,26 +460,26 @@
     report->n_tests = 1;
     report->n_success = success ? 1 : 0;
     report->n_failed = success ? 0 : 1;
-    return success ? MX_OK : MX_ERR_INTERNAL;
+    return success ? ZX_OK : ZX_ERR_INTERNAL;
 }
 
-static mx_status_t iotxn_test_bind(void* ctx, mx_device_t* dev, void** cookie) {
+static zx_status_t iotxn_test_bind(void* ctx, zx_device_t* dev, void** cookie) {
     test_protocol_t proto;
-    mx_status_t status = device_get_protocol(dev, MX_PROTOCOL_TEST, &proto);
-    if (status != MX_OK) {
+    zx_status_t status = device_get_protocol(dev, ZX_PROTOCOL_TEST, &proto);
+    if (status != ZX_OK) {
         return status;
     }
 
     proto.ops->set_test_func(proto.ctx, iotxn_test_func, dev);
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_driver_ops_t iotxn_test_driver_ops = {
+static zx_driver_ops_t iotxn_test_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = iotxn_test_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(iotxn_test, iotxn_test_driver_ops, "magenta", "0.1", 2)
+ZIRCON_DRIVER_BEGIN(iotxn_test, iotxn_test_driver_ops, "zircon", "0.1", 2)
     BI_ABORT_IF_AUTOBIND,
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_TEST),
-MAGENTA_DRIVER_END(iotxn_test)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_TEST),
+ZIRCON_DRIVER_END(iotxn_test)
diff --git a/system/ulib/ddktl/BUILD.gn b/system/ulib/ddktl/BUILD.gn
index 4e1f8ee..815d483 100644
--- a/system/ulib/ddktl/BUILD.gn
+++ b/system/ulib/ddktl/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 source_set("ddktl") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "include/ddktl/device-internal.h",
     "include/ddktl/device.h",
diff --git a/system/ulib/ddktl/include/ddktl/device-internal.h b/system/ulib/ddktl/include/ddktl/device-internal.h
index a87db81..7298d1f 100644
--- a/system/ulib/ddktl/include/ddktl/device-internal.h
+++ b/system/ulib/ddktl/include/ddktl/device-internal.h
@@ -10,18 +10,18 @@
 namespace ddk {
 namespace internal {
 
-// base_device is a tag that default initalizes the mx_protocol_device_t so the mixin classes
+// base_device is a tag that default initalizes the zx_protocol_device_t so the mixin classes
 // can fill in the table.
 struct base_device {
   protected:
-    base_device(mx_device_t* parent)
+    base_device(zx_device_t* parent)
       : parent_(parent) {
         ddk_device_proto_.version = DEVICE_OPS_VERSION;
     }
 
-    mx_protocol_device_t ddk_device_proto_ = {};
-    mx_device_t* mxdev_ = nullptr;
-    mx_device_t* const parent_;
+    zx_protocol_device_t ddk_device_proto_ = {};
+    zx_device_t* mxdev_ = nullptr;
+    zx_device_t* const parent_;
 };
 
 // base_mixin is a tag that all mixins must inherit from.
@@ -55,9 +55,9 @@
     static_assert(fbl::is_base_of<base_device, D>::value,
                   "GetProtocolable classes must be derived from ddk::Device<...>.");
     static_assert(fbl::is_same<decltype(&D::DdkGetProtocol),
-                                mx_status_t (D::*)(uint32_t, void*)>::value,
+                                zx_status_t (D::*)(uint32_t, void*)>::value,
                   "DdkGetProtocol must be a public non-static member function with signature "
-                  "'mx_status_t DdkGetProtocol(uint32_t, void*)'.");
+                  "'zx_status_t DdkGetProtocol(uint32_t, void*)'.");
 }
 
 DECLARE_HAS_MEMBER_FN(has_ddk_open, DdkOpen);
@@ -68,9 +68,9 @@
     static_assert(fbl::is_base_of<base_device, D>::value,
                   "Openable classes must be derived from ddk::Device<...>.");
     static_assert(fbl::is_same<decltype(&D::DdkOpen),
-                                mx_status_t (D::*)(mx_device_t**, uint32_t)>::value,
+                                zx_status_t (D::*)(zx_device_t**, uint32_t)>::value,
                   "DdkOpen must be a public non-static member function with signature "
-                  "'mx_status_t DdkOpen(mx_device_t**, uint32_t)'.");
+                  "'zx_status_t DdkOpen(zx_device_t**, uint32_t)'.");
 }
 
 DECLARE_HAS_MEMBER_FN(has_ddk_open_at, DdkOpenAt);
@@ -83,9 +83,9 @@
                   "OpenAtable classes must be derived from ddk::Device<...>.");
     static_assert(
             fbl::is_same<decltype(&D::DdkOpenAt),
-                          mx_status_t (D::*)(mx_device_t**, const char*, uint32_t)>::value,
+                          zx_status_t (D::*)(zx_device_t**, const char*, uint32_t)>::value,
                   "DdkOpenAt must be a public non-static member function with signature "
-                  "'mx_status_t DdkOpenAt(mx_device_t**, const char*, uint32_t)'.");
+                  "'zx_status_t DdkOpenAt(zx_device_t**, const char*, uint32_t)'.");
 }
 
 DECLARE_HAS_MEMBER_FN(has_ddk_close, DdkClose);
@@ -96,9 +96,9 @@
                   "Closable classes must implement DdkClose");
     static_assert(fbl::is_base_of<base_device, D>::value,
                   "Closable classes must be derived from ddk::Device<...>.");
-    static_assert(fbl::is_same<decltype(&D::DdkClose), mx_status_t (D::*)(uint32_t)>::value,
+    static_assert(fbl::is_same<decltype(&D::DdkClose), zx_status_t (D::*)(uint32_t)>::value,
                   "DdkClose must be a public non-static member function with signature "
-                  "'mx_status_t DdkClose(uint32)'.");
+                  "'zx_status_t DdkClose(uint32)'.");
 }
 
 DECLARE_HAS_MEMBER_FN(has_ddk_unbind, DdkUnbind);
@@ -134,9 +134,9 @@
     static_assert(fbl::is_base_of<base_device, D>::value,
                   "Readable classes must be derived from ddk::Device<...>.");
     static_assert(fbl::is_same<decltype(&D::DdkRead),
-                                mx_status_t (D::*)(void*, size_t, mx_off_t, size_t*)>::value,
+                                zx_status_t (D::*)(void*, size_t, zx_off_t, size_t*)>::value,
                   "DdkRead must be a public non-static member function with signature "
-                  "'mx_status_t DdkRead(void*, size_t, mx_off_t, size_t*)'.");
+                  "'zx_status_t DdkRead(void*, size_t, zx_off_t, size_t*)'.");
 }
 
 DECLARE_HAS_MEMBER_FN(has_ddk_write, DdkWrite);
@@ -148,9 +148,9 @@
     static_assert(fbl::is_base_of<base_device, D>::value,
                   "Writable classes must be derived from ddk::Device<...>.");
     static_assert(fbl::is_same<decltype(&D::DdkWrite),
-                                mx_status_t (D::*)(const void*, size_t, mx_off_t, size_t*)>::value,
+                                zx_status_t (D::*)(const void*, size_t, zx_off_t, size_t*)>::value,
                   "DdkWrite must be a public non-static member function with signature "
-                  "'mx_status_t DdkWrite(const void*, size_t, mx_off_t, size_t*)'.");
+                  "'zx_status_t DdkWrite(const void*, size_t, zx_off_t, size_t*)'.");
 }
 
 DECLARE_HAS_MEMBER_FN(has_ddk_iotxn_queue, DdkIotxnQueue);
@@ -174,9 +174,9 @@
                   "GetSizable classes must implement DdkGetSize");
     static_assert(fbl::is_base_of<base_device, D>::value,
                   "GetSizable classes must be derived from ddk::Device<...>.");
-    static_assert(fbl::is_same<decltype(&D::DdkGetSize), mx_off_t (D::*)(void)>::value,
+    static_assert(fbl::is_same<decltype(&D::DdkGetSize), zx_off_t (D::*)(void)>::value,
                   "DdkGetSize must be a public non-static member function with signature "
-                  "'mx_off_t DdkGetSize()'.");
+                  "'zx_off_t DdkGetSize()'.");
 }
 
 DECLARE_HAS_MEMBER_FN(has_ddk_ioctl, DdkIoctl);
@@ -188,10 +188,10 @@
     static_assert(fbl::is_base_of<base_device, D>::value,
                   "Ioctlable classes must be derived from ddk::Device<...>.");
     static_assert(fbl::is_same<decltype(&D::DdkIoctl),
-                                mx_status_t (D::*)(uint32_t, const void*, size_t,
+                                zx_status_t (D::*)(uint32_t, const void*, size_t,
                                                    void*, size_t, size_t*)>::value,
                   "DdkIoctl must be a public non-static member function with signature "
-                  "'mx_status_t DdkIoctl(uint32_t, const void*, size_t, void*, size_t, size_t*)'.");
+                  "'zx_status_t DdkIoctl(uint32_t, const void*, size_t, void*, size_t, size_t*)'.");
 }
 
 DECLARE_HAS_MEMBER_FN(has_ddk_suspend, DdkSuspend);
@@ -202,9 +202,9 @@
                   "Suspendable classes must implement DdkSuspend");
     static_assert(fbl::is_base_of<base_device, D>::value,
                   "Suspendable classes must be derived from ddk::Device<...>.");
-    static_assert(fbl::is_same<decltype(&D::DdkSuspend), mx_status_t (D::*)(uint32_t)>::value,
+    static_assert(fbl::is_same<decltype(&D::DdkSuspend), zx_status_t (D::*)(uint32_t)>::value,
                   "DdkSuspend must be a public non-static member function with signature "
-                  "'mx_status_t DdkSuspend(uint32_t)'.");
+                  "'zx_status_t DdkSuspend(uint32_t)'.");
 }
 
 DECLARE_HAS_MEMBER_FN(has_ddk_resume, DdkResume);
@@ -215,9 +215,9 @@
                   "Resumable classes must implement DdkResume");
     static_assert(fbl::is_base_of<base_device, D>::value,
                   "Resumable classes must be derived from ddk::Device<...>.");
-    static_assert(fbl::is_same<decltype(&D::DdkResume), mx_status_t (D::*)(uint32_t)>::value,
+    static_assert(fbl::is_same<decltype(&D::DdkResume), zx_status_t (D::*)(uint32_t)>::value,
                   "DdkResume must be a public non-static member function with signature "
-                  "'mx_status_t DdkResume(uint32_t)'.");
+                  "'zx_status_t DdkResume(uint32_t)'.");
 }
 
 // all_mixins
diff --git a/system/ulib/ddktl/include/ddktl/device.h b/system/ulib/ddktl/include/ddktl/device.h
index 4194219..d14cc6c 100644
--- a/system/ulib/ddktl/include/ddktl/device.h
+++ b/system/ulib/ddktl/include/ddktl/device.h
@@ -6,7 +6,7 @@
 
 #include <ddk/device.h>
 #include <ddktl/device-internal.h>
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/type_support.h>
 
 // ddk::Device<D, ...>
@@ -14,7 +14,7 @@
 // Notes:
 //
 // ddk::Device<D, ...> is a mixin class that simplifies writing DDK drivers in
-// C++. The DDK's mx_device_t defines a set of function pointer callbacks that
+// C++. The DDK's zx_device_t defines a set of function pointer callbacks that
 // can be implemented to define standard behavior (e.g., open/close/read/write),
 // as well as to implement device lifecycle events (e.g., unbind/release). The
 // mixin classes are used to set up the function pointer table to call methods
@@ -30,40 +30,40 @@
 // +----------------------+----------------------------------------------------+
 // | Mixin class          | Required function implementation                   |
 // +----------------------+----------------------------------------------------+
-// | ddk::GetProtocolable | mx_status_t DdkGetProtocol(uint32_t proto_id,      |
+// | ddk::GetProtocolable | zx_status_t DdkGetProtocol(uint32_t proto_id,      |
 // |                      |                            void* out)              |
 // |                      |                                                    |
-// | ddk::Openable        | mx_status_t DdkOpen(mx_device_t** dev_out,         |
+// | ddk::Openable        | zx_status_t DdkOpen(zx_device_t** dev_out,         |
 // |                      |                     uint32_t flags)                |
 // |                      |                                                    |
-// | ddk::OpenAtable      | mx_status_t DdkOpenAt(mx_device_t** dev_out,       |
+// | ddk::OpenAtable      | zx_status_t DdkOpenAt(zx_device_t** dev_out,       |
 // |                      |                       const char* path,            |
 // |                      |                       uint32_t flags)              |
 // |                      |                                                    |
-// | ddk::Closable        | mx_status_t DdkClose(uint32_t flags)               |
+// | ddk::Closable        | zx_status_t DdkClose(uint32_t flags)               |
 // |                      |                                                    |
 // | ddk::Unbindable      | void DdkUnbind()                                   |
 // |                      |                                                    |
-// | ddk::Readable        | mx_status_t DdkRead(void* buf, size_t count,       |
-// |                      |                     mx_off_t off, size_t* actual)  |
+// | ddk::Readable        | zx_status_t DdkRead(void* buf, size_t count,       |
+// |                      |                     zx_off_t off, size_t* actual)  |
 // |                      |                                                    |
-// | ddk::Writable        | mx_status_t DdkWrite(const void* buf,              |
-// |                      |                      size_t count, mx_off_t off,   |
+// | ddk::Writable        | zx_status_t DdkWrite(const void* buf,              |
+// |                      |                      size_t count, zx_off_t off,   |
 // |                      |                      size_t* actual)               |
 // |                      |                                                    |
 // | ddk::IotxnQueueable  | void DdkIotxnQueue(iotxn_t* txn)                   |
 // |                      |                                                    |
-// | ddk::GetSizable      | mx_off_t DdkGetSize()                              |
+// | ddk::GetSizable      | zx_off_t DdkGetSize()                              |
 // |                      |                                                    |
-// | ddk::Ioctlable       | mx_status_t DdkIoctl(uint32_t op,                  |
+// | ddk::Ioctlable       | zx_status_t DdkIoctl(uint32_t op,                  |
 // |                      |                      const void* in_buf,           |
 // |                      |                      size_t in_len, void* out_buf, |
 // |                      |                      size_t out_len,               |
 // |                      |                      size_t* actual)               |
 // |                      |                                                    |
-// | ddk::Suspendable     | mx_status_t DdkSuspend(uint32_t flags)             |
+// | ddk::Suspendable     | zx_status_t DdkSuspend(uint32_t flags)             |
 // |                      |                                                    |
-// | ddk::Resumable       | mx_status_t DdkResume(uint32_t flags)              |
+// | ddk::Resumable       | zx_status_t DdkResume(uint32_t flags)              |
 // +----------------------+----------------------------------------------------+
 //
 // Note: the ddk::FullDevice type alias may also be used if your device class
@@ -79,28 +79,28 @@
 //
 // class MyDevice : public DeviceType {
 //   public:
-//     MyDevice(mx_device_t* parent)
+//     MyDevice(zx_device_t* parent)
 //       : DeviceType(parent) {}
 //
-//     mx_status_t Bind() {
+//     zx_status_t Bind() {
 //         // Any other setup required by MyDevice. The device_add_args_t will be filled out by the
 //         // base class.
 //         return DdkAdd("my-device-name");
 //     }
 //
 //     // Methods required by the ddk mixins
-//     mx_status_t DdkOpen(mx_device_t** dev_out, uint32_t flags);
-//     mx_status_t DdkClose(uint32_t flags);
-//     mx_status_t DdkRead(void* buf, size_t count, mx_off_t off, size_t* actual);
+//     zx_status_t DdkOpen(zx_device_t** dev_out, uint32_t flags);
+//     zx_status_t DdkClose(uint32_t flags);
+//     zx_status_t DdkRead(void* buf, size_t count, zx_off_t off, size_t* actual);
 //     void DdkUnbind();
 //     void DdkRelease();
 // };
 //
-// extern "C" mx_status_t my_bind(mx_device_t* device,
+// extern "C" zx_status_t my_bind(zx_device_t* device,
 //                                void** cookie) {
 //     auto dev = unique_ptr<MyDevice>(new MyDevice(device));
 //     auto status = dev->Bind();
-//     if (status == MX_OK) {
+//     if (status == ZX_OK) {
 //         // devmgr is now in charge of the memory for dev
 //         dev.release();
 //     }
@@ -121,13 +121,13 @@
 template <typename D>
 class GetProtocolable : public internal::base_mixin {
   protected:
-    explicit GetProtocolable(mx_protocol_device_t* proto) {
+    explicit GetProtocolable(zx_protocol_device_t* proto) {
         internal::CheckGetProtocolable<D>();
         proto->get_protocol = GetProtocol;
     }
 
   private:
-    static mx_status_t GetProtocol(void* ctx, uint32_t proto_id, void* out) {
+    static zx_status_t GetProtocol(void* ctx, uint32_t proto_id, void* out) {
         return static_cast<D*>(ctx)->DdkGetProtocol(proto_id, out);
     }
 };
@@ -135,13 +135,13 @@
 template <typename D>
 class Openable : public internal::base_mixin {
   protected:
-    explicit Openable(mx_protocol_device_t* proto) {
+    explicit Openable(zx_protocol_device_t* proto) {
         internal::CheckOpenable<D>();
         proto->open = Open;
     }
 
   private:
-    static mx_status_t Open(void* ctx, mx_device_t** dev_out, uint32_t flags) {
+    static zx_status_t Open(void* ctx, zx_device_t** dev_out, uint32_t flags) {
         return static_cast<D*>(ctx)->DdkOpen(dev_out, flags);
     }
 };
@@ -149,13 +149,13 @@
 template <typename D>
 class OpenAtable : public internal::base_mixin {
   protected:
-    explicit OpenAtable(mx_protocol_device_t* proto) {
+    explicit OpenAtable(zx_protocol_device_t* proto) {
         internal::CheckOpenAtable<D>();
         proto->open_at = OpenAt;
     }
 
   private:
-    static mx_status_t OpenAt(void* ctx, mx_device_t** dev_out, const char* path,
+    static zx_status_t OpenAt(void* ctx, zx_device_t** dev_out, const char* path,
                               uint32_t flags) {
         return static_cast<D*>(ctx)->DdkOpenAt(dev_out, path, flags);
     }
@@ -164,13 +164,13 @@
 template <typename D>
 class Closable : public internal::base_mixin {
   protected:
-    explicit Closable(mx_protocol_device_t* proto) {
+    explicit Closable(zx_protocol_device_t* proto) {
         internal::CheckClosable<D>();
         proto->close = Close;
     }
 
   private:
-    static mx_status_t Close(void* ctx, uint32_t flags) {
+    static zx_status_t Close(void* ctx, uint32_t flags) {
         return static_cast<D*>(ctx)->DdkClose(flags);
     }
 };
@@ -178,7 +178,7 @@
 template <typename D>
 class Unbindable : public internal::base_mixin {
   protected:
-    explicit Unbindable(mx_protocol_device_t* proto) {
+    explicit Unbindable(zx_protocol_device_t* proto) {
         internal::CheckUnbindable<D>();
         proto->unbind = Unbind;
     }
@@ -192,13 +192,13 @@
 template <typename D>
 class Readable : public internal::base_mixin {
   protected:
-    explicit Readable(mx_protocol_device_t* proto) {
+    explicit Readable(zx_protocol_device_t* proto) {
         internal::CheckReadable<D>();
         proto->read = Read;
     }
 
   private:
-    static mx_status_t Read(void* ctx, void* buf, size_t count, mx_off_t off, size_t* actual) {
+    static zx_status_t Read(void* ctx, void* buf, size_t count, zx_off_t off, size_t* actual) {
         return static_cast<D*>(ctx)->DdkRead(buf, count, off, actual);
     }
 };
@@ -206,13 +206,13 @@
 template <typename D>
 class Writable : public internal::base_mixin {
   protected:
-    explicit Writable(mx_protocol_device_t* proto) {
+    explicit Writable(zx_protocol_device_t* proto) {
         internal::CheckWritable<D>();
         proto->write = Write;
     }
 
   private:
-    static mx_status_t Write(void* ctx, const void* buf, size_t count, mx_off_t off,
+    static zx_status_t Write(void* ctx, const void* buf, size_t count, zx_off_t off,
                              size_t* actual) {
         return static_cast<D*>(ctx)->DdkWrite(buf, count, off, actual);
     }
@@ -221,7 +221,7 @@
 template <typename D>
 class IotxnQueueable : public internal::base_mixin {
   protected:
-    explicit IotxnQueueable(mx_protocol_device_t* proto) {
+    explicit IotxnQueueable(zx_protocol_device_t* proto) {
         internal::CheckIotxnQueueable<D>();
         proto->iotxn_queue = IotxnQueue;
     }
@@ -235,13 +235,13 @@
 template <typename D>
 class GetSizable : public internal::base_mixin {
   protected:
-    explicit GetSizable(mx_protocol_device_t* proto) {
+    explicit GetSizable(zx_protocol_device_t* proto) {
         internal::CheckGetSizable<D>();
         proto->get_size = GetSize;
     }
 
   private:
-    static mx_off_t GetSize(void* ctx) {
+    static zx_off_t GetSize(void* ctx) {
         return static_cast<D*>(ctx)->DdkGetSize();
     }
 };
@@ -249,13 +249,13 @@
 template <typename D>
 class Ioctlable : public internal::base_mixin {
   protected:
-    explicit Ioctlable(mx_protocol_device_t* proto) {
+    explicit Ioctlable(zx_protocol_device_t* proto) {
         internal::CheckIoctlable<D>();
         proto->ioctl = Ioctl;
     }
 
   private:
-    static mx_status_t Ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
+    static zx_status_t Ioctl(void* ctx, uint32_t op, const void* in_buf, size_t in_len,
                              void* out_buf, size_t out_len, size_t* out_actual) {
         return static_cast<D*>(ctx)->DdkIoctl(op, in_buf, in_len, out_buf, out_len, out_actual);
     }
@@ -264,13 +264,13 @@
 template <typename D>
 class Suspendable : public internal::base_mixin {
   protected:
-    explicit Suspendable(mx_protocol_device_t* proto) {
+    explicit Suspendable(zx_protocol_device_t* proto) {
         internal::CheckSuspendable<D>();
         proto->suspend = Suspend;
     }
 
   private:
-    static mx_status_t Suspend(void* ctx, uint32_t flags) {
+    static zx_status_t Suspend(void* ctx, uint32_t flags) {
         return static_cast<D*>(ctx)->DdkSuspend(flags);
     }
 };
@@ -278,13 +278,13 @@
 template <typename D>
 class Resumable : public internal::base_mixin {
   protected:
-    explicit Resumable(mx_protocol_device_t* proto) {
+    explicit Resumable(zx_protocol_device_t* proto) {
         internal::CheckResumable<D>();
         proto->resume = Resume;
     }
 
   private:
-    static mx_status_t Resume(void* ctx, uint32_t flags) {
+    static zx_status_t Resume(void* ctx, uint32_t flags) {
         return static_cast<D*>(ctx)->DdkResume(flags);
     }
 };
@@ -297,9 +297,9 @@
 template <class D, template <typename> class... Mixins>
 class Device : public ::ddk::internal::base_device, public Mixins<D>... {
   public:
-    mx_status_t DdkAdd(const char* name) {
+    zx_status_t DdkAdd(const char* name) {
         if (mxdev_ != nullptr) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
 
         device_add_args_t args = {};
@@ -314,12 +314,12 @@
         return device_add(parent_, &args, &mxdev_);
     }
 
-    mx_status_t DdkRemove() {
+    zx_status_t DdkRemove() {
         if (mxdev_ == nullptr) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
 
-        mx_status_t res = device_remove(mxdev_);
+        zx_status_t res = device_remove(mxdev_);
         mxdev_ = nullptr;
         return res;
     }
@@ -327,24 +327,24 @@
     const char* name() const { return mxdev() ? device_get_name(mxdev()) : nullptr; }
 
     // The opaque pointer representing this device.
-    mx_device_t* mxdev() const { return mxdev_; }
+    zx_device_t* mxdev() const { return mxdev_; }
     // The opaque pointer representing the device's parent.
-    mx_device_t* parent() const { return parent_; }
+    zx_device_t* parent() const { return parent_; }
 
-    void SetState(mx_signals_t stateflag) {
+    void SetState(zx_signals_t stateflag) {
         device_state_set(mxdev_, stateflag);
     }
 
-    void ClearState(mx_signals_t stateflag) {
+    void ClearState(zx_signals_t stateflag) {
         device_state_clr(mxdev_, stateflag);
     }
 
-    void ClearAndSetState(mx_signals_t clearflag, mx_signals_t setflag) {
+    void ClearAndSetState(zx_signals_t clearflag, zx_signals_t setflag) {
         device_state_clr_set(mxdev_, clearflag, setflag);
     }
 
   protected:
-    Device(mx_device_t* parent)
+    Device(zx_device_t* parent)
       : internal::base_device(parent),
         Mixins<D>(&ddk_device_proto_)... {
         internal::CheckMixins<Mixins<D>...>();
@@ -366,7 +366,7 @@
     void AddProtocol(device_add_args_t* args,
                      typename fbl::enable_if<is_protocol<T>::value, T>::type* dummy = 0) {
         auto dev = static_cast<D*>(this);
-        MX_ASSERT(dev->ddk_proto_id_ > 0);
+        ZX_ASSERT(dev->ddk_proto_id_ > 0);
         args->proto_id = dev->ddk_proto_id_;
         args->proto_ops = dev->ddk_proto_ops_;
     }
@@ -378,7 +378,7 @@
 };
 
 // Convenience type for implementations that would like to override all
-// mx_protocol_device_t methods.
+// zx_protocol_device_t methods.
 template <class D>
 using FullDevice = Device<D,
                           GetProtocolable,
diff --git a/system/ulib/ddktl/include/ddktl/protocol/block-internal.h b/system/ulib/ddktl/include/ddktl/protocol/block-internal.h
index 9d153cc..ca68c15 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/block-internal.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/block-internal.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <ddktl/device-internal.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/type_support.h>
 #include <fbl/unique_ptr.h>
 
@@ -40,17 +40,17 @@
     static_assert(internal::has_block_read<D>::value,
                   "BlockProtocol subclasses must implement BlockRead");
     static_assert(fbl::is_same<decltype(&D::BlockRead),
-                                void (D::*)(mx_handle_t, uint64_t, uint64_t, uint64_t, void*)>::value,
+                                void (D::*)(zx_handle_t, uint64_t, uint64_t, uint64_t, void*)>::value,
                   "BlockRead must be a non-static member function with signature "
-                  "'void BlockRead(mx_handle_t, uint64_t, uint64_t, uint64_t, void*)', and be "
+                  "'void BlockRead(zx_handle_t, uint64_t, uint64_t, uint64_t, void*)', and be "
                   "visible to ddk::BlockProtocol<D> (either because they are public, or because of "
                   "friendship).");
     static_assert(internal::has_block_write<D>::value,
                   "BlockProtocol subclasses must implement BlockWrite");
     static_assert(fbl::is_same<decltype(&D::BlockWrite),
-                                void (D::*)(mx_handle_t, uint64_t, uint64_t, uint64_t, void*)>::value,
+                                void (D::*)(zx_handle_t, uint64_t, uint64_t, uint64_t, void*)>::value,
                   "BlockWrite must be a non-static member function with signature "
-                  "'void BlockWrite(mx_handle_t, uint64_t, uint64_t, uint64_t, void*)', and be "
+                  "'void BlockWrite(zx_handle_t, uint64_t, uint64_t, uint64_t, void*)', and be "
                   "visible to ddk::BlockProtocol<D> (either because they are public, or because of "
                   "friendship).");
 }
diff --git a/system/ulib/ddktl/include/ddktl/protocol/block.h b/system/ulib/ddktl/include/ddktl/protocol/block.h
index eca1d56..38eb295 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/block.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/block.h
@@ -6,7 +6,7 @@
 
 #include <ddk/protocol/block.h>
 #include <ddktl/protocol/block-internal.h>
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/type_support.h>
 #include <fbl/unique_ptr.h>
 
@@ -20,17 +20,17 @@
 //
 // :: Examples ::
 //
-// // A driver that implements a MX_PROTOCOL_BLOCK_CORE device
+// // A driver that implements a ZX_PROTOCOL_BLOCK_CORE device
 // class BlockDevice;
 // using BlockDeviceType = ddk::Device<BlockDevice, /* ddk mixins */>;
 //
 // class BlockDevice : public BlockDeviceType,
 //                      public ddk::BlockProtocol<BlockDevice> {
 //   public:
-//     BlockDevice(mx_device_t* parent)
+//     BlockDevice(zx_device_t* parent)
 //       : BlockDeviceType("my-block-device", parent) {}
 //
-//     mx_status_t Bind() {
+//     zx_status_t Bind() {
 //         DdkAdd();
 //     }
 //
@@ -60,8 +60,8 @@
         ops_.write = Write;
 
         // Can only inherit from one base_protocol implemenation
-        MX_ASSERT(ddk_proto_ops_ == nullptr);
-        ddk_proto_id_ = MX_PROTOCOL_BLOCK_CORE;
+        ZX_ASSERT(ddk_proto_ops_ == nullptr);
+        ddk_proto_id_ = ZX_PROTOCOL_BLOCK_CORE;
         ddk_proto_ops_ = &ops_;
     }
 
@@ -74,12 +74,12 @@
         static_cast<D*>(ctx)->BlockGetInfo(info);
     }
 
-    static void Read(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
+    static void Read(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
                      uint64_t dev_offset, void* cookie) {
         static_cast<D*>(ctx)->BlockRead(vmo, length, vmo_offset, dev_offset, cookie);
     }
 
-    static void Write(void* ctx, mx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
+    static void Write(void* ctx, zx_handle_t vmo, uint64_t length, uint64_t vmo_offset,
                       uint64_t dev_offset, void* cookie) {
         static_cast<D*>(ctx)->BlockWrite(vmo, length, vmo_offset, dev_offset, cookie);
     }
diff --git a/system/ulib/ddktl/include/ddktl/protocol/ethernet-internal.h b/system/ulib/ddktl/include/ddktl/protocol/ethernet-internal.h
index 1e32be4..fa71270 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/ethernet-internal.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/ethernet-internal.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <ddktl/device-internal.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/type_support.h>
 #include <fbl/unique_ptr.h>
 
@@ -49,9 +49,9 @@
     static_assert(internal::has_ethmac_query<D>::value,
                   "EthmacProtocol subclasses must implement EthmacQuery");
     static_assert(fbl::is_same<decltype(&D::EthmacQuery),
-                                mx_status_t (D::*)(uint32_t, ethmac_info_t*)>::value,
+                                zx_status_t (D::*)(uint32_t, ethmac_info_t*)>::value,
                   "EthmacQuery must be a non-static member function with signature "
-                  "'mx_status_t EthmacQuery(uint32_t, ethmac_info_t*)', and be visible to "
+                  "'zx_status_t EthmacQuery(uint32_t, ethmac_info_t*)', and be visible to "
                   "ddk::EthmacProtocol<D> (either because they are public, or because of "
                   "friendship).");
     static_assert(internal::has_ethmac_stop<D>::value,
@@ -64,9 +64,9 @@
     static_assert(internal::has_ethmac_start<D>::value,
                   "EthmacProtocol subclasses must implement EthmacStart");
     static_assert(fbl::is_same<decltype(&D::EthmacStart),
-                                mx_status_t (D::*)(fbl::unique_ptr<EthmacIfcProxy>)>::value,
+                                zx_status_t (D::*)(fbl::unique_ptr<EthmacIfcProxy>)>::value,
                   "EthmacStart must be a non-static member function with signature "
-                  "'mx_status_t EthmacStart(fbl::unique_ptr<EthmacIfcProxy>)', and be visible "
+                  "'zx_status_t EthmacStart(fbl::unique_ptr<EthmacIfcProxy>)', and be visible "
                   "to ddk::EthmacProtocol<D> (either because they are public, or because of "
                   "friendship).");
     static_assert(internal::has_ethmac_send<D>::value,
@@ -74,7 +74,7 @@
     static_assert(fbl::is_same<decltype(&D::EthmacSend),
                                 void (D::*)(uint32_t, void*, size_t)>::value,
                   "EthmacSend must be a non-static member function with signature "
-                  "'mx_status_t EthmacSend(uint32_t, void*, size_t)', and be visible to "
+                  "'zx_status_t EthmacSend(uint32_t, void*, size_t)', and be visible to "
                   "ddk::EthmacProtocol<D> (either because they are public, or because of "
                   "friendship).");
 }
diff --git a/system/ulib/ddktl/include/ddktl/protocol/ethernet.h b/system/ulib/ddktl/include/ddktl/protocol/ethernet.h
index 372cafe..2e56c7d 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/ethernet.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/ethernet.h
@@ -6,7 +6,7 @@
 
 #include <ddk/protocol/ethernet.h>
 #include <ddktl/protocol/ethernet-internal.h>
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/type_support.h>
 #include <fbl/unique_ptr.h>
 
@@ -25,27 +25,27 @@
 //
 // :: Examples ::
 //
-// // A driver that communicates with a MX_PROTOCOL_ETHERMAC device as a ethmac_ifc_t
+// // A driver that communicates with a ZX_PROTOCOL_ETHERMAC device as a ethmac_ifc_t
 // class EthDevice;
 // using EthDeviceType = ddk::Device<EthDevice, /* ddk mixins */>;
 //
 // class EthDevice : public EthDeviceType,
 //                   public ddk::EthmacIfc<EthDevice> {
 //   public:
-//     EthDevice(mx_device_t* parent)
+//     EthDevice(zx_device_t* parent)
 //       : EthDeviceType("my-eth-device"),
 //         parent_(parent) {}
 //
-//     mx_status_t Bind() {
+//     zx_status_t Bind() {
 //         ethmac_protocol_t* ops;
-//         auto status = get_device_protocol(parent_, MX_PROTOCOL_ETHERMAC,
+//         auto status = get_device_protocol(parent_, ZX_PROTOCOL_ETHERMAC,
 //                                           reinterpret_cast<void**>(&ops));
-//         if (status != MX_OK) {
+//         if (status != ZX_OK) {
 //             return status;
 //         }
 //        proxy_.reset(new ddk::EthmacProtocolProxy(ops, parent_));
 //        status = proxy_->Start(this);
-//        if (status != MX_OK) {
+//        if (status != ZX_OK) {
 //            return status;
 //        }
 //        return device_add(ddk_device(), parent_);
@@ -64,23 +64,23 @@
 //     }
 //
 //   private:
-//     mx_device_t* parent_;
+//     zx_device_t* parent_;
 //     fbl::unique_ptr<ddk::EthmacProtocolProxy> proxy_;
 // };
 //
 //
-// // A driver that implements a MX_PROTOCOL_ETHERMAC device
+// // A driver that implements a ZX_PROTOCOL_ETHERMAC device
 // class EthmacDevice;
 // using EthmacDeviceType = ddk::Device<EthmacDevice, /* ddk mixins */>;
 //
 // class EthmacDevice : public EthmacDeviceType,
 //                      public ddk::EthmacProtocol<EthmacDevice> {
 //   public:
-//     EthmacDevice(mx_device_t* parent)
+//     EthmacDevice(zx_device_t* parent)
 //       : EthmacDeviceType("my-ethmac-device"),
 //         parent_(parent) {}
 //
-//     mx_status_t Bind() {
+//     zx_status_t Bind() {
 //         return device_add(ddk_device(), parent_);
 //     }
 //
@@ -88,19 +88,19 @@
 //         // Clean up
 //     }
 //
-//     mx_status_t EthmacQuery(uint32_t options, ethmac_info_t* info) {
+//     zx_status_t EthmacQuery(uint32_t options, ethmac_info_t* info) {
 //         // Fill out the ethmac info
-//         return MX_OK;
+//         return ZX_OK;
 //     }
 //
 //     void EthmacStop() {
 //         // Device should stop
 //     }
 //
-//     mx_status_t EthmacStart(fbl::unique_ptr<ddk::EthmacIfcProxy> proxy) {
+//     zx_status_t EthmacStart(fbl::unique_ptr<ddk::EthmacIfcProxy> proxy) {
 //         // Start ethmac operation
 //         proxy_.swap(proxy);
-//         return MX_OK;
+//         return ZX_OK;
 //     }
 //
 //     void EthmacSend(uint32_t options, void* data, size_t length) {
@@ -108,7 +108,7 @@
 //     }
 //
 //   private:
-//     mx_device_t* parent_;
+//     zx_device_t* parent_;
 //     fbl::unique_ptr<ddk::EthmacIfcProxy> proxy_;
 // };
 
@@ -166,13 +166,13 @@
         ops_.send = Send;
 
         // Can only inherit from one base_protocol implemenation
-        MX_ASSERT(ddk_proto_ops_ == nullptr);
-        ddk_proto_id_ = MX_PROTOCOL_ETHERMAC;
+        ZX_ASSERT(ddk_proto_ops_ == nullptr);
+        ddk_proto_id_ = ZX_PROTOCOL_ETHERMAC;
         ddk_proto_ops_ = &ops_;
     }
 
   private:
-    static mx_status_t Query(void* ctx, uint32_t options, ethmac_info_t* info) {
+    static zx_status_t Query(void* ctx, uint32_t options, ethmac_info_t* info) {
         return static_cast<D*>(ctx)->EthmacQuery(options, info);
     }
 
@@ -180,7 +180,7 @@
         static_cast<D*>(ctx)->EthmacStop();
     }
 
-    static mx_status_t Start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
+    static zx_status_t Start(void* ctx, ethmac_ifc_t* ifc, void* cookie) {
         auto ifc_proxy = fbl::unique_ptr<EthmacIfcProxy>(new EthmacIfcProxy(ifc, cookie));
         return static_cast<D*>(ctx)->EthmacStart(fbl::move(ifc_proxy));
     }
@@ -197,12 +197,12 @@
     EthmacProtocolProxy(ethmac_protocol_t* proto)
       : ops_(proto->ops), ctx_(proto->ctx) {}
 
-    mx_status_t Query(uint32_t options, ethmac_info_t* info) {
+    zx_status_t Query(uint32_t options, ethmac_info_t* info) {
         return ops_->query(ctx_, options, info);
     }
 
     template <typename D>
-    mx_status_t Start(D* ifc) {
+    zx_status_t Start(D* ifc) {
         static_assert(fbl::is_base_of<EthmacIfc<D>, D>::value,
                       "Start must be called with a subclass of EthmacIfc");
         return ops_->start(ctx_, ifc->ethmac_ifc(), ifc);
diff --git a/system/ulib/ddktl/include/ddktl/protocol/hidbus-internal.h b/system/ulib/ddktl/include/ddktl/protocol/hidbus-internal.h
index 8bfa34f..b5428b4 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/hidbus-internal.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/hidbus-internal.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <ddktl/device-internal.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/type_support.h>
 #include <fbl/unique_ptr.h>
 
@@ -33,18 +33,18 @@
     static_assert(internal::has_hidbus_query<D>::value,
                   "HidBusProtocol subclasses must implement HidBusQuery");
     static_assert(fbl::is_same<decltype(&D::HidBusQuery),
-                                mx_status_t (D::*)(uint32_t options, hid_info_t* info)>::value,
+                                zx_status_t (D::*)(uint32_t options, hid_info_t* info)>::value,
                   "HidBusQuery must be a non-static member function with signature "
-                  "'mx_status_t HidBusQuery(uint32_t options, hid_info_t* info)', and be visible to "
+                  "'zx_status_t HidBusQuery(uint32_t options, hid_info_t* info)', and be visible to "
                   "ddk::HidBusProtocol<D> (either because they are public, or because of "
                   "friendship).");
 
     static_assert(internal::has_hidbus_start<D>::value,
                   "HidBusProtocol subclasses must implement HidBusStart");
     static_assert(fbl::is_same<decltype(&D::HidBusStart),
-                                mx_status_t (D::*)(HidBusIfcProxy proxy)>::value,
+                                zx_status_t (D::*)(HidBusIfcProxy proxy)>::value,
                   "HidBusStart must be a non-static member function with signature "
-                  "'mx_status_t HidBusStart(HidBusIfcProxy proxy)', and be visible to "
+                  "'zx_status_t HidBusStart(HidBusIfcProxy proxy)', and be visible to "
                   "ddk::HidBusProtocol<D> (either because they are public, or because of "
                   "friendship).");
 
@@ -60,63 +60,63 @@
     static_assert(internal::has_hidbus_get_descriptor<D>::value,
                   "HidBusProtocol subclasses must implement HidBusGetDescriptor");
     static_assert(fbl::is_same<decltype(&D::HidBusGetDescriptor),
-                                mx_status_t (D::*)(uint8_t desc_type, void** data, size_t* len)>::value,
+                                zx_status_t (D::*)(uint8_t desc_type, void** data, size_t* len)>::value,
                   "HidBusGetDescriptor must be a non-static member function with signature "
-                  "'mx_status_t HidBusGetDescriptor(uint8_t desc_type, void** data, size_t* len)', and be visible to "
+                  "'zx_status_t HidBusGetDescriptor(uint8_t desc_type, void** data, size_t* len)', and be visible to "
                   "ddk::HidBusProtocol<D> (either because they are public, or because of "
                   "friendship).");
 
     static_assert(internal::has_hidbus_get_report<D>::value,
                   "HidBusProtocol subclasses must implement HidBusGetReport");
     static_assert(fbl::is_same<decltype(&D::HidBusGetReport),
-                                mx_status_t (D::*)(uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len)>::value,
+                                zx_status_t (D::*)(uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len)>::value,
                   "HidBusGetReport must be a non-static member function with signature "
-                  "'mx_status_t HidBusGetReport(uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len)', and be visible to "
+                  "'zx_status_t HidBusGetReport(uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len)', and be visible to "
                   "ddk::HidBusProtocol<D> (either because they are public, or because of "
                   "friendship).");
 
     static_assert(internal::has_hidbus_set_report<D>::value,
                   "HidBusProtocol subclasses must implement HidBusSetReport");
     static_assert(fbl::is_same<decltype(&D::HidBusSetReport),
-                                mx_status_t (D::*)(uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len)>::value,
+                                zx_status_t (D::*)(uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len)>::value,
                   "HidBusSetReport must be a non-static member function with signature "
-                  "'mx_status_t HidBusSetReport(uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len)', and be visible to "
+                  "'zx_status_t HidBusSetReport(uint8_t rpt_type, uint8_t rpt_id, void* data, size_t len)', and be visible to "
                   "ddk::HidBusProtocol<D> (either because they are public, or because of "
                   "friendship).");
 
     static_assert(internal::has_hidbus_get_idle<D>::value,
                   "HidBusProtocol subclasses must implement HidBusGetIdle");
     static_assert(fbl::is_same<decltype(&D::HidBusGetIdle),
-                                mx_status_t (D::*)(uint8_t rpt_id, uint8_t* duration)>::value,
+                                zx_status_t (D::*)(uint8_t rpt_id, uint8_t* duration)>::value,
                   "HidBusGetIdle must be a non-static member function with signature "
-                  "'mx_status_t HidBusGetIdle(uint8_t rpt_id, uint8_t* duration)', and be visible to "
+                  "'zx_status_t HidBusGetIdle(uint8_t rpt_id, uint8_t* duration)', and be visible to "
                   "ddk::HidBusProtocol<D> (either because they are public, or because of "
                   "friendship).");
 
     static_assert(internal::has_hidbus_set_idle<D>::value,
                   "HidBusProtocol subclasses must implement HidBusSetIdle");
     static_assert(fbl::is_same<decltype(&D::HidBusSetIdle),
-                                mx_status_t (D::*)(uint8_t rpt_id, uint8_t duration)>::value,
+                                zx_status_t (D::*)(uint8_t rpt_id, uint8_t duration)>::value,
                   "HidBusSetIdle must be a non-static member function with signature "
-                  "'mx_status_t HidBusSetIdle(uint8_t rpt_id, uint8_t duration)', and be visible to "
+                  "'zx_status_t HidBusSetIdle(uint8_t rpt_id, uint8_t duration)', and be visible to "
                   "ddk::HidBusProtocol<D> (either because they are public, or because of "
                   "friendship).");
 
     static_assert(internal::has_hidbus_get_protocol<D>::value,
                   "HidBusProtocol subclasses must implement HidBusGetProtocol");
     static_assert(fbl::is_same<decltype(&D::HidBusGetProtocol),
-                                mx_status_t (D::*)(uint8_t* protocol)>::value,
+                                zx_status_t (D::*)(uint8_t* protocol)>::value,
                   "HidBusGetProtocol must be a non-static member function with signature "
-                  "'mx_status_t HidBusGetProtocol(uint8_t* protocol)', and be visible to "
+                  "'zx_status_t HidBusGetProtocol(uint8_t* protocol)', and be visible to "
                   "ddk::HidBusProtocol<D> (either because they are public, or because of "
                   "friendship).");
 
     static_assert(internal::has_hidbus_set_protocol<D>::value,
                   "HidBusProtocol subclasses must implement HidBusSetProtocol");
     static_assert(fbl::is_same<decltype(&D::HidBusSetProtocol),
-                                mx_status_t (D::*)(uint8_t protocol)>::value,
+                                zx_status_t (D::*)(uint8_t protocol)>::value,
                   "HidBusSetProtocol must be a non-static member function with signature "
-                  "'mx_status_t HidBusSetProtocol(uint8_t protocol)', and be visible to "
+                  "'zx_status_t HidBusSetProtocol(uint8_t protocol)', and be visible to "
                   "ddk::HidBusProtocol<D> (either because they are public, or because of "
                   "friendship).");
 }
diff --git a/system/ulib/ddktl/include/ddktl/protocol/hidbus.h b/system/ulib/ddktl/include/ddktl/protocol/hidbus.h
index 5621c95..7e63cd8 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/hidbus.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/hidbus.h
@@ -6,7 +6,7 @@
 
 #include <ddk/protocol/hidbus.h>
 #include <ddktl/protocol/hidbus-internal.h>
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/type_support.h>
 #include <fbl/unique_ptr.h>
 
@@ -25,17 +25,17 @@
 //
 // :: Examples ::
 //
-// // A driver that implements a MX_PROTOCOL_HIDBUS device
+// // A driver that implements a ZX_PROTOCOL_HIDBUS device
 // class HidBusDevice;
 // using HidBusDeviceType = ddk::Device<HidBusDevice, /* ddk mixins */>;
 //
 // class HidBusDevice : public HidBusDeviceType,
 //                      public ddk::HidBusProtocol<HidBusDevice> {
 //   public:
-//     HidBusDevice(mx_device_t* parent)
+//     HidBusDevice(zx_device_t* parent)
 //       : HidBusDeviceType("my-hidbus-device", parent) {}
 //
-//     mx_status_t Bind() {
+//     zx_status_t Bind() {
 //         DdkAdd();
 //     }
 //
@@ -43,10 +43,10 @@
 //         // Clean up
 //     }
 //
-//     mx_status_t HidbusStart(ddk::HidBusIfcProxy proxy) {
+//     zx_status_t HidbusStart(ddk::HidBusIfcProxy proxy) {
 //         // Start hidbus operation
 //         proxy_ = proxy;
-//         return MX_OK;
+//         return ZX_OK;
 //     }
 //
 //     void HidBusQuery(uint32_t options, hid_info_t* info) {
@@ -78,17 +78,17 @@
         ops_.set_protocol = SetProtocol;
 
         // Can only inherit from one base_protocol implemenation
-        MX_ASSERT(ddk_proto_ops_ == nullptr);
-        ddk_proto_id_ = MX_PROTOCOL_HIDBUS;
+        ZX_ASSERT(ddk_proto_ops_ == nullptr);
+        ddk_proto_id_ = ZX_PROTOCOL_HIDBUS;
         ddk_proto_ops_ = &ops_;
     }
 
   private:
-    static mx_status_t Query(void* ctx, uint32_t options, hid_info_t* info) {
+    static zx_status_t Query(void* ctx, uint32_t options, hid_info_t* info) {
         return static_cast<D*>(ctx)->HidBusQuery(options, info);
     }
 
-    static mx_status_t Start(void* ctx, hidbus_ifc_t* ifc, void* cookie) {
+    static zx_status_t Start(void* ctx, hidbus_ifc_t* ifc, void* cookie) {
         HidBusIfcProxy proxy(ifc, cookie);
         return static_cast<D*>(ctx)->HidBusStart(proxy);
     }
@@ -97,33 +97,33 @@
         static_cast<D*>(ctx)->HidBusStop();
     }
 
-    static mx_status_t GetDescriptor(void* ctx, uint8_t desc_type, void** data, size_t* len) {
+    static zx_status_t GetDescriptor(void* ctx, uint8_t desc_type, void** data, size_t* len) {
         return static_cast<D*>(ctx)->HidBusGetDescriptor(desc_type, data, len);
     }
 
-    static mx_status_t GetReport(void* ctx, uint8_t rpt_type, uint8_t rpt_id, void* data,
+    static zx_status_t GetReport(void* ctx, uint8_t rpt_type, uint8_t rpt_id, void* data,
                                  size_t len) {
         return static_cast<D*>(ctx)->HidBusGetReport(rpt_type, rpt_id, data, len);
     }
 
-    static mx_status_t SetReport(void* ctx, uint8_t rpt_type, uint8_t rpt_id, void* data,
+    static zx_status_t SetReport(void* ctx, uint8_t rpt_type, uint8_t rpt_id, void* data,
                                  size_t len) {
         return static_cast<D*>(ctx)->HidBusSetReport(rpt_type, rpt_id, data, len);
     }
 
-    static mx_status_t GetIdle(void* ctx, uint8_t rpt_id, uint8_t* duration) {
+    static zx_status_t GetIdle(void* ctx, uint8_t rpt_id, uint8_t* duration) {
         return static_cast<D*>(ctx)->HidBusGetIdle(rpt_id, duration);
     }
 
-    static mx_status_t SetIdle(void* ctx, uint8_t rpt_id, uint8_t duration) {
+    static zx_status_t SetIdle(void* ctx, uint8_t rpt_id, uint8_t duration) {
         return static_cast<D*>(ctx)->HidBusSetIdle(rpt_id, duration);
     }
 
-    static mx_status_t GetProtocol(void* ctx, uint8_t* protocol) {
+    static zx_status_t GetProtocol(void* ctx, uint8_t* protocol) {
         return static_cast<D*>(ctx)->HidBusGetProtocol(protocol);
     }
 
-    static mx_status_t SetProtocol(void* ctx, uint8_t protocol) {
+    static zx_status_t SetProtocol(void* ctx, uint8_t protocol) {
         return static_cast<D*>(ctx)->HidBusSetProtocol(protocol);
     }
 
diff --git a/system/ulib/ddktl/include/ddktl/protocol/pci.h b/system/ulib/ddktl/include/ddktl/protocol/pci.h
index fe6b888..7742392 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/pci.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/pci.h
@@ -20,13 +20,13 @@
 //
 // :: Example ::
 //
-// // A driver that communicates with a MX_PROTOCOL_PCI device
+// // A driver that communicates with a ZX_PROTOCOL_PCI device
 // class MyDevice;
 // using MyDeviceType = ddk::Device<MyDevice, /* ddk mixins */>;
 //
 // class MyDevice : public MyDeviceType {
 //   public:
-//     MyDevice(mx_device_t* parent)
+//     MyDevice(zx_device_t* parent)
 //       : MyDeviceType(parent) {}
 //
 //     void DdkRelease() {
@@ -34,18 +34,18 @@
 //         delete this;
 //     }
 //
-//     mx_status_t Bind() {
+//     zx_status_t Bind() {
 //         pci_protocol_t* ops;
-//         auto status = get_device_protocol(parent_, MX_PROTOCOL_PCI,
+//         auto status = get_device_protocol(parent_, ZX_PROTOCOL_PCI,
 //                                           reinterpret_cast<void**>(&ops));
-//         if (status != MX_OK) {
+//         if (status != ZX_OK) {
 //             return status;
 //         }
 //         pci_.reset(new ddk::PciProtocolProxy(ops));
 //
 //         // Query interrupt capabilities, etc.
 //         uint32_t irq_count = 0;
-//         if (pci_.QueryIrqModeCaps(MX_PCIE_IRQ_MODE_MSI, &irq_count) == MX_OK) {
+//         if (pci_.QueryIrqModeCaps(ZX_PCIE_IRQ_MODE_MSI, &irq_count) == ZX_OK) {
 //             // etc
 //         }
 
@@ -63,36 +63,36 @@
     PciProtocolProxy(pci_protocol_t* proto)
       : ops_(proto->ops), ctx_(proto->ctx) {}
 
-    mx_status_t MapResource(uint32_t res_id, uint32_t cache_policy, void** vaddr, size_t* size,
-                            mx_handle_t* out_handle) {
+    zx_status_t MapResource(uint32_t res_id, uint32_t cache_policy, void** vaddr, size_t* size,
+                            zx_handle_t* out_handle) {
         return ops_->map_resource(ctx_, res_id, cache_policy, vaddr, size, out_handle);
     }
 
-    mx_status_t EnableBusMaster(bool enable) {
+    zx_status_t EnableBusMaster(bool enable) {
         return ops_->enable_bus_master(ctx_, enable);
     }
 
-    mx_status_t EnablePio(bool enable) {
+    zx_status_t EnablePio(bool enable) {
         return ops_->enable_pio(ctx_, enable);
     }
 
-    mx_status_t ResetDevice() {
+    zx_status_t ResetDevice() {
         return ops_->reset_device(ctx_);
     }
 
-    mx_status_t MapInterrupt(int which_irq, mx_handle_t* out_handle) {
+    zx_status_t MapInterrupt(int which_irq, zx_handle_t* out_handle) {
         return ops_->map_interrupt(ctx_, which_irq, out_handle);
     }
 
-    mx_status_t QueryIrqModeCaps(mx_pci_irq_mode_t mode, uint32_t* out_max_irqs) {
+    zx_status_t QueryIrqModeCaps(zx_pci_irq_mode_t mode, uint32_t* out_max_irqs) {
         return ops_->query_irq_mode_caps(ctx_, mode, out_max_irqs);
     }
 
-    mx_status_t SetIrqMode(mx_pci_irq_mode_t mode, uint32_t requested_irq_count) {
+    zx_status_t SetIrqMode(zx_pci_irq_mode_t mode, uint32_t requested_irq_count) {
         return ops_->set_irq_mode(ctx_, mode, requested_irq_count);
     }
 
-    mx_status_t GetDeviceInfo(mx_pcie_device_info_t* out_info) {
+    zx_status_t GetDeviceInfo(zx_pcie_device_info_t* out_info) {
         return ops_->get_device_info(ctx_, out_info);
     }
 
diff --git a/system/ulib/ddktl/include/ddktl/protocol/test.h b/system/ulib/ddktl/include/ddktl/protocol/test.h
index ebc424f..9391e3a 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/test.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/test.h
@@ -5,9 +5,9 @@
 #pragma once
 
 #include <ddk/protocol/test.h>
-#include <magenta/assert.h>
-#include <mx/channel.h>
-#include <mx/socket.h>
+#include <zircon/assert.h>
+#include <zx/channel.h>
+#include <zx/socket.h>
 
 // DDK test protocol support
 //
@@ -23,20 +23,20 @@
 //
 // :: Example ::
 //
-// // A driver that communicates with a MX_PROTOCOL_TEST device
+// // A driver that communicates with a ZX_PROTOCOL_TEST device
 // class MyDevice;
 // using MyDeviceType = ddk::Device<MyDevice, /* ddk mixins */>;
 //
-// static mx_status_t my_test_func(void* cookie, test_report_t* report, const void* arg,
+// static zx_status_t my_test_func(void* cookie, test_report_t* report, const void* arg,
 //                                 size_t arglen) {
 //     auto dev = static_cast<MyDevice*>(cookie);
 //     // run tests and set up report
-//     return MX_OK;
+//     return ZX_OK;
 // }
 //
 // class MyDevice : public MyDeviceType {
 //   public:
-//     MyDevice(mx_device_t* parent)
+//     MyDevice(zx_device_t* parent)
 //       : MyDeviceType("my-device"),
 //         parent_(parent) {}
 //
@@ -44,11 +44,11 @@
 //         // Clean up
 //     }
 //
-//     mx_status_t Bind() {
+//     zx_status_t Bind() {
 //         test_protocol_t* ops;
-//         auto status = get_device_protocol(parent_, MX_PROTOCOL_TEST,
+//         auto status = get_device_protocol(parent_, ZX_PROTOCOL_TEST,
 //                                           reinterpret_cast<void**>(&ops));
-//         if (status != MX_OK) {
+//         if (status != ZX_OK) {
 //             return status;
 //         }
 //        proxy_.reset(new ddk::TestProtocolProxy(ops, parent_));
@@ -69,27 +69,27 @@
     TestProtocolProxy(test_protocol_t* proto)
       : ops_(proto->ops), ctx_(proto->ctx) {}
 
-    void SetOutputSocket(mx::socket socket) {
+    void SetOutputSocket(zx::socket socket) {
         ops_->set_output_socket(ctx_, socket.release());
     }
 
-    mx::socket GetOutputSocket() {
-        return mx::socket(ops_->get_output_socket(ctx_));
+    zx::socket GetOutputSocket() {
+        return zx::socket(ops_->get_output_socket(ctx_));
     }
 
-    void SetControlChannel(mx::channel chan) {
+    void SetControlChannel(zx::channel chan) {
         ops_->set_control_channel(ctx_, chan.release());
     }
 
-    mx::channel GetControlChannel() {
-        return mx::channel(ops_->get_control_channel(ctx_));
+    zx::channel GetControlChannel() {
+        return zx::channel(ops_->get_control_channel(ctx_));
     }
 
     void SetTestFunc(test_func_t func, void* cookie) {
         ops_->set_test_func(ctx_, func, cookie);
     }
 
-    mx_status_t RunTests(test_report_t* report, const void* arg, size_t arglen) {
+    zx_status_t RunTests(test_report_t* report, const void* arg, size_t arglen) {
         return ops_->run_tests(ctx_, report, arg, arglen);
     }
 
diff --git a/system/ulib/ddktl/include/ddktl/protocol/wlan-internal.h b/system/ulib/ddktl/include/ddktl/protocol/wlan-internal.h
index acc8fe3..291dbc8 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/wlan-internal.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/wlan-internal.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <ddktl/device-internal.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/type_support.h>
 #include <fbl/unique_ptr.h>
 
@@ -50,9 +50,9 @@
     static_assert(internal::has_wlanmac_query<D>::value,
                   "WlanmacProtocol subclasses must implement WlanmacQuery");
     static_assert(fbl::is_same<decltype(&D::WlanmacQuery),
-                                mx_status_t (D::*)(uint32_t, ethmac_info_t*)>::value,
+                                zx_status_t (D::*)(uint32_t, ethmac_info_t*)>::value,
                   "WlanmacQuery must be a non-static member function with signature "
-                  "'mx_status_t WlanmacQuery(uint32_t, ethmac_info_t*)', and be visible to "
+                  "'zx_status_t WlanmacQuery(uint32_t, ethmac_info_t*)', and be visible to "
                   "ddk::WlanmacProtocol<D> (either because they are public, or because of "
                   "friendship).");
     static_assert(internal::has_wlanmac_stop<D>::value,
@@ -65,9 +65,9 @@
     static_assert(internal::has_wlanmac_start<D>::value,
                   "WlanmacProtocol subclasses must implement WlanmacStart");
     static_assert(fbl::is_same<decltype(&D::WlanmacStart),
-                                mx_status_t (D::*)(fbl::unique_ptr<WlanmacIfcProxy>)>::value,
+                                zx_status_t (D::*)(fbl::unique_ptr<WlanmacIfcProxy>)>::value,
                   "WlanmacStart must be a non-static member function with signature "
-                  "'mx_status_t WlanmacStart(fbl::unique_ptr<WlanmacIfcProxy>)', and be visible "
+                  "'zx_status_t WlanmacStart(fbl::unique_ptr<WlanmacIfcProxy>)', and be visible "
                   "to ddk::WlanmacProtocol<D> (either because they are public, or because of "
                   "friendship).");
     static_assert(internal::has_wlanmac_send<D>::value,
@@ -75,15 +75,15 @@
     static_assert(fbl::is_same<decltype(&D::WlanmacTx),
                                 void (D::*)(uint32_t, const void*, size_t)>::value,
                   "WlanmacTx must be a non-static member function with signature "
-                  "'mx_status_t WlanmacTx(uint32_t, const void*, size_t)', and be visible to "
+                  "'zx_status_t WlanmacTx(uint32_t, const void*, size_t)', and be visible to "
                   "ddk::WlanmacProtocol<D> (either because they are public, or because of "
                   "friendship).");
     static_assert(internal::has_wlanmac_set_channel<D>::value,
                   "WlanmacProtocol subclasses must implement WlanmacSetChannel");
     static_assert(fbl::is_same<decltype(&D::WlanmacSetChannel),
-                                mx_status_t (D::*)(uint32_t, wlan_channel_t*)>::value,
+                                zx_status_t (D::*)(uint32_t, wlan_channel_t*)>::value,
                   "WlanmacSetChannel must be a non-static member function with signature "
-                  "'mx_status_t WlanmacSetChannel(uint32_t, wlan_channel_t*)', and be visible to "
+                  "'zx_status_t WlanmacSetChannel(uint32_t, wlan_channel_t*)', and be visible to "
                   "ddk::WlanmacProtocol<D> (either because they are public, or because of "
                   "friendship).");
 }
diff --git a/system/ulib/ddktl/include/ddktl/protocol/wlan.h b/system/ulib/ddktl/include/ddktl/protocol/wlan.h
index 9b743a5..4a76149 100644
--- a/system/ulib/ddktl/include/ddktl/protocol/wlan.h
+++ b/system/ulib/ddktl/include/ddktl/protocol/wlan.h
@@ -6,7 +6,7 @@
 
 #include <ddk/protocol/wlan.h>
 #include <ddktl/protocol/wlan-internal.h>
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/type_support.h>
 #include <fbl/unique_ptr.h>
 
@@ -25,27 +25,27 @@
 //
 // :: Examples ::
 //
-// // A driver that communicates with a MX_PROTOCOL_WLANMAC device as a wlanmac_ifc_t
+// // A driver that communicates with a ZX_PROTOCOL_WLANMAC device as a wlanmac_ifc_t
 // class WlanDevice;
 // using WlanDeviceType = ddk::Device<WlanDevice, /* ddk mixins */>;
 //
 // class WlanDevice : public WlanDeviceType,
 //                    public ddk::WlanmacIfc<WlanDevice> {
 //   public:
-//     WlanDevice(mx_device_t* parent)
+//     WlanDevice(zx_device_t* parent)
 //       : WlanDeviceType(driver, "my-wlan-device"),
 //         parent_(parent) {}
 //
-//     mx_status_t Bind() {
+//     zx_status_t Bind() {
 //         wlanmac_protocol_t* ops;
-//         auto status = get_device_protocol(parent_, MX_PROTOCOL_WLANMAC,
+//         auto status = get_device_protocol(parent_, ZX_PROTOCOL_WLANMAC,
 //                                           reinterpret_cast<void**>(&ops));
-//         if (status != MX_OK) {
+//         if (status != ZX_OK) {
 //             return status;
 //         }
 //        proxy_.reset(new ddk::WlanmacProtocolProxy(ops, parent_));
 //        status = proxy_->Start(this);
-//        if (status != MX_OK) {
+//        if (status != ZX_OK) {
 //            return status;
 //        }
 //        return device_add(ddk_device(), parent_);
@@ -65,23 +65,23 @@
 //     }
 //
 //   private:
-//     mx_device_t* parent_;
+//     zx_device_t* parent_;
 //     fbl::unique_ptr<ddk::WlanmacProtocolProxy> proxy_;
 // };
 //
 //
-// // A driver that implements a MX_PROTOCOL_WLANMAC device
+// // A driver that implements a ZX_PROTOCOL_WLANMAC device
 // class WlanmacDevice;
 // using WlanmacDeviceType = ddk::Device<WlanmacDevice, /* ddk mixins */>;
 //
 // class WlanmacDevice : public WlanmacDeviceType,
 //                       public ddk::WlanmacProtocol<WlanmacDevice> {
 //   public:
-//     WlanmacDevice(mx_device_t* parent)
+//     WlanmacDevice(zx_device_t* parent)
 //       : WlanmacDeviceType(driver, "my-wlanmac-device"),
 //         parent_(parent) {}
 //
-//     mx_status_t Bind() {
+//     zx_status_t Bind() {
 //         return device_add(ddk_device(), parent_);
 //     }
 //
@@ -89,32 +89,32 @@
 //         // Clean up
 //     }
 //
-//     mx_status_t WlanmacQuery(uint32_t options, ethmac_info_t* info) {
+//     zx_status_t WlanmacQuery(uint32_t options, ethmac_info_t* info) {
 //         // Fill out the ethmac info
-//         return MX_OK;
+//         return ZX_OK;
 //     }
 //
 //     void WlanmacStop() {
 //         // Device should stop
 //     }
 //
-//     mx_status_t WlanmacStart(fbl::unique_ptr<ddk::WlanmacIfcProxy> proxy) {
+//     zx_status_t WlanmacStart(fbl::unique_ptr<ddk::WlanmacIfcProxy> proxy) {
 //         // Start wlanmac operation
 //         proxy_.swap(proxy);
-//         return MX_OK;
+//         return ZX_OK;
 //     }
 //
 //     void WlanmacTx(uint32_t options, void* data, size_t length) {
 //         // Send the data
 //     }
 //
-//     mx_status_t WlanmacSetChannel(uint32_t options, wlan_channel_t* chan) {
+//     zx_status_t WlanmacSetChannel(uint32_t options, wlan_channel_t* chan) {
 //         // Set the radio channel
-//         return MX_OK;
+//         return ZX_OK;
 //     }
 //
 //   private:
-//     mx_device_t* parent_;
+//     zx_device_t* parent_;
 //     fbl::unique_ptr<ddk::WlanmacIfcProxy> proxy_;
 // };
 
@@ -174,13 +174,13 @@
         ops_.set_channel = SetChannel;
 
         // Can only inherit from one base_protocol implemenation
-        MX_ASSERT(this->ddk_proto_ops_ == nullptr);
-        ddk_proto_id_ = MX_PROTOCOL_WLANMAC;
+        ZX_ASSERT(this->ddk_proto_ops_ == nullptr);
+        ddk_proto_id_ = ZX_PROTOCOL_WLANMAC;
         ddk_proto_ops_ = &ops_;
     }
 
   private:
-    static mx_status_t Query(void* ctx, uint32_t options, ethmac_info_t* info) {
+    static zx_status_t Query(void* ctx, uint32_t options, ethmac_info_t* info) {
         return static_cast<D*>(ctx)->WlanmacQuery(options, info);
     }
 
@@ -188,7 +188,7 @@
         static_cast<D*>(ctx)->WlanmacStop();
     }
 
-    static mx_status_t Start(void* ctx, wlanmac_ifc_t* ifc, void* cookie) {
+    static zx_status_t Start(void* ctx, wlanmac_ifc_t* ifc, void* cookie) {
         auto ifc_proxy = fbl::unique_ptr<WlanmacIfcProxy>(new WlanmacIfcProxy(ifc, cookie));
         return static_cast<D*>(ctx)->WlanmacStart(fbl::move(ifc_proxy));
     }
@@ -197,7 +197,7 @@
         static_cast<D*>(ctx)->WlanmacTx(options, data, length);
     }
 
-    static mx_status_t SetChannel(void* ctx, uint32_t options, wlan_channel_t* chan) {
+    static zx_status_t SetChannel(void* ctx, uint32_t options, wlan_channel_t* chan) {
         return static_cast<D*>(ctx)->WlanmacSetChannel(options, chan);
     }
 
@@ -209,12 +209,12 @@
     WlanmacProtocolProxy(wlanmac_protocol_t* proto)
       : ops_(proto->ops), ctx_(proto->ctx) {}
 
-    mx_status_t Query(uint32_t options, ethmac_info_t* info) {
+    zx_status_t Query(uint32_t options, ethmac_info_t* info) {
         return ops_->query(ctx_, options, info);
     }
 
     template <typename D>
-    mx_status_t Start(D* ifc) {
+    zx_status_t Start(D* ifc) {
         static_assert(fbl::is_base_of<WlanmacIfc<D>, D>::value,
                       "Start must be called with a subclass of WlanmacIfc");
         return ops_->start(ctx_, ifc->wlanmac_ifc(), ifc);
@@ -228,7 +228,7 @@
         ops_->tx(ctx_, options, data, length);
     }
 
-    mx_status_t SetChannel(uint32_t options, wlan_channel_t* chan) {
+    zx_status_t SetChannel(uint32_t options, wlan_channel_t* chan) {
         return ops_->set_channel(ctx_, options, chan);
     }
 
diff --git a/system/ulib/ddktl/rules.mk b/system/ulib/ddktl/rules.mk
index 455ec0a..bfb79ce 100644
--- a/system/ulib/ddktl/rules.mk
+++ b/system/ulib/ddktl/rules.mk
@@ -32,15 +32,15 @@
 MODULE_STATIC_LIBS := \
     system/ulib/ddk \
     system/ulib/ddktl \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/unittest \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/driver \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
 
 include make/module.mk
diff --git a/system/ulib/ddktl/test/ddktl-test-binding.c b/system/ulib/ddktl/test/ddktl-test-binding.c
index ef66a55..27ff49e 100644
--- a/system/ulib/ddktl/test/ddktl-test-binding.c
+++ b/system/ulib/ddktl/test/ddktl-test-binding.c
@@ -6,16 +6,16 @@
 #include <ddk/driver.h>
 #include <ddk/binding.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
-extern mx_status_t ddktl_test_bind(void* ctx, mx_device_t* dev, void** cookie);
+extern zx_status_t ddktl_test_bind(void* ctx, zx_device_t* dev, void** cookie);
 
-static mx_driver_ops_t ddktl_test_driver_ops = {
+static zx_driver_ops_t ddktl_test_driver_ops = {
     .version = DRIVER_OPS_VERSION,
     .bind = ddktl_test_bind,
 };
 
-MAGENTA_DRIVER_BEGIN(ddktl_test, ddktl_test_driver_ops, "magenta", "0.1", 2)
+ZIRCON_DRIVER_BEGIN(ddktl_test, ddktl_test_driver_ops, "zircon", "0.1", 2)
     BI_ABORT_IF_AUTOBIND,
-    BI_MATCH_IF(EQ, BIND_PROTOCOL, MX_PROTOCOL_TEST),
-MAGENTA_DRIVER_END(ddktl_test)
+    BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_TEST),
+ZIRCON_DRIVER_END(ddktl_test)
diff --git a/system/ulib/ddktl/test/ddktl-test.cpp b/system/ulib/ddktl/test/ddktl-test.cpp
index 025f3b5..b980074 100644
--- a/system/ulib/ddktl/test/ddktl-test.cpp
+++ b/system/ulib/ddktl/test/ddktl-test.cpp
@@ -6,7 +6,7 @@
 #include <ddk/driver.h>
 #include <ddk/binding.h>
 #include <ddk/protocol/test.h>
-#include <mx/socket.h>
+#include <zx/socket.h>
 
 #include <unittest/unittest.h>
 #include <stddef.h>
@@ -22,8 +22,8 @@
 namespace {
 
 void ddktl_test_output_func(const char* line, int len, void* arg) {
-    mx_handle_t h = *static_cast<mx_handle_t*>(arg);
-    mx::socket s(h);
+    zx_handle_t h = *static_cast<zx_handle_t*>(arg);
+    zx::socket s(h);
     // len is not actually the number of bytes to output
     s.write(0u, line, strlen(line), nullptr);
     // we don't on the socket so release it before it goes out of scope
@@ -39,18 +39,18 @@
     }
 }
 
-mx_status_t ddktl_test_func(void* cookie, test_report_t* report, const void* arg, size_t arglen) {
-    auto dev = static_cast<mx_device_t*>(cookie);
+zx_status_t ddktl_test_func(void* cookie, test_report_t* report, const void* arg, size_t arglen) {
+    auto dev = static_cast<zx_device_t*>(cookie);
 
     test_protocol_t proto;
     auto status =
-        device_get_protocol(dev, MX_PROTOCOL_TEST, reinterpret_cast<void*>(&proto));
-    if (status != MX_OK) {
+        device_get_protocol(dev, ZX_PROTOCOL_TEST, reinterpret_cast<void*>(&proto));
+    if (status != ZX_OK) {
         return status;
     }
 
-    mx_handle_t output = proto.ops->get_output_socket(proto.ctx);
-    if (output != MX_HANDLE_INVALID) {
+    zx_handle_t output = proto.ops->get_output_socket(proto.ctx);
+    if (output != ZX_HANDLE_INVALID) {
         unittest_set_output_function(ddktl_test_output_func, &output);
     }
 
@@ -58,20 +58,20 @@
     update_test_report(unittest_run_one_test(test_case_ddktl_device, TEST_ALL), report);
     update_test_report(unittest_run_one_test(test_case_ddktl_ethernet_device, TEST_ALL), report);
     update_test_report(unittest_run_one_test(test_case_ddktl_wlan_device, TEST_ALL), report);
-    return report->n_failed == 0 ? MX_OK : MX_ERR_INTERNAL;
+    return report->n_failed == 0 ? ZX_OK : ZX_ERR_INTERNAL;
 }
 
 }  // namespace
 
-extern "C" mx_status_t ddktl_test_bind(void* ctx, mx_device_t* dev, void** cookie) {
+extern "C" zx_status_t ddktl_test_bind(void* ctx, zx_device_t* dev, void** cookie) {
     test_protocol_t proto;
     auto status =
-        device_get_protocol(dev, MX_PROTOCOL_TEST, reinterpret_cast<void*>(&proto));
-    if (status != MX_OK) {
+        device_get_protocol(dev, ZX_PROTOCOL_TEST, reinterpret_cast<void*>(&proto));
+    if (status != ZX_OK) {
         return status;
     }
 
     proto.ops->set_test_func(proto.ctx, ddktl_test_func, dev);
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/ulib/ddktl/test/device-tests.cpp b/system/ulib/ddktl/test/device-tests.cpp
index db35500..c54046e 100644
--- a/system/ulib/ddktl/test/device-tests.cpp
+++ b/system/ulib/ddktl/test/device-tests.cpp
@@ -27,21 +27,21 @@
 #define END_SUCCESS_CASE };
 
 BEGIN_SUCCESS_CASE(GetProtocolable)
-    mx_status_t DdkGetProtocol(uint32_t proto_id, void* protocol) { return MX_OK; }
+    zx_status_t DdkGetProtocol(uint32_t proto_id, void* protocol) { return ZX_OK; }
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(Openable)
-    mx_status_t DdkOpen(mx_device_t** dev_out, uint32_t flags) { return MX_OK; }
+    zx_status_t DdkOpen(zx_device_t** dev_out, uint32_t flags) { return ZX_OK; }
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(OpenAtable)
-    mx_status_t DdkOpenAt(mx_device_t** dev_out, const char* path, uint32_t flags) {
-        return MX_OK;
+    zx_status_t DdkOpenAt(zx_device_t** dev_out, const char* path, uint32_t flags) {
+        return ZX_OK;
     }
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(Closable)
-    mx_status_t DdkClose(uint32_t flags) { return MX_OK; }
+    zx_status_t DdkClose(uint32_t flags) { return ZX_OK; }
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(Unbindable)
@@ -49,12 +49,12 @@
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(Readable)
-    mx_status_t DdkRead(void* buf, size_t count, mx_off_t off, size_t* actual) { return MX_OK; }
+    zx_status_t DdkRead(void* buf, size_t count, zx_off_t off, size_t* actual) { return ZX_OK; }
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(Writable)
-    mx_status_t DdkWrite(const void* buf, size_t count, mx_off_t off, size_t* actual) {
-        return MX_OK;
+    zx_status_t DdkWrite(const void* buf, size_t count, zx_off_t off, size_t* actual) {
+        return ZX_OK;
     }
 END_SUCCESS_CASE
 
@@ -63,22 +63,22 @@
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(GetSizable)
-    mx_off_t DdkGetSize() { return 0; }
+    zx_off_t DdkGetSize() { return 0; }
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(Ioctlable)
-    mx_status_t DdkIoctl(uint32_t op, const void* in_buf, size_t in_len, void* out_buf,
+    zx_status_t DdkIoctl(uint32_t op, const void* in_buf, size_t in_len, void* out_buf,
                          size_t out_len, size_t* out_actual) {
-        return MX_OK;
+        return ZX_OK;
     }
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(Suspendable)
-    mx_status_t DdkSuspend(uint32_t flags) { return MX_OK; }
+    zx_status_t DdkSuspend(uint32_t flags) { return ZX_OK; }
 END_SUCCESS_CASE
 
 BEGIN_SUCCESS_CASE(Resumable)
-    mx_status_t DdkResume(uint32_t flags) { return MX_OK; }
+    zx_status_t DdkResume(uint32_t flags) { return ZX_OK; }
 END_SUCCESS_CASE
 
 
@@ -97,28 +97,28 @@
     TestDispatch() : ddk::FullDevice<TestDispatch>(nullptr) {}
 
     // Give access to the device ops for testing
-    mx_protocol_device_t* GetDeviceOps() {
+    zx_protocol_device_t* GetDeviceOps() {
         return &ddk_device_proto_;
     }
 
-    mx_status_t DdkGetProtocol(uint32_t proto_id, void* protcool) {
+    zx_status_t DdkGetProtocol(uint32_t proto_id, void* protcool) {
         get_protocol_called = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t DdkOpen(mx_device_t** dev_out, uint32_t flags) {
+    zx_status_t DdkOpen(zx_device_t** dev_out, uint32_t flags) {
         open_called = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t DdkOpenAt(mx_device_t** dev_out, const char* path, uint32_t flags) {
+    zx_status_t DdkOpenAt(zx_device_t** dev_out, const char* path, uint32_t flags) {
         open_at_called = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t DdkClose(uint32_t flags) {
+    zx_status_t DdkClose(uint32_t flags) {
         close_called = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     void DdkUnbind() {
@@ -129,39 +129,39 @@
         release_called = true;
     }
 
-    mx_status_t DdkRead(void* buf, size_t count, mx_off_t off, size_t* actual) {
+    zx_status_t DdkRead(void* buf, size_t count, zx_off_t off, size_t* actual) {
         read_called = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t DdkWrite(const void* buf, size_t count, mx_off_t off, size_t* actual) {
+    zx_status_t DdkWrite(const void* buf, size_t count, zx_off_t off, size_t* actual) {
         write_called = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     void DdkIotxnQueue(iotxn_t* t) {
         iotxn_queue_called = true;
     }
 
-    mx_off_t DdkGetSize() {
+    zx_off_t DdkGetSize() {
         get_size_called = true;
         return 0;
     }
 
-    mx_status_t DdkIoctl(uint32_t op, const void* in_buf, size_t in_len, void* out_buf,
+    zx_status_t DdkIoctl(uint32_t op, const void* in_buf, size_t in_len, void* out_buf,
                          size_t out_len, size_t* out_actual) {
         ioctl_called = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t DdkSuspend(uint32_t flags) {
+    zx_status_t DdkSuspend(uint32_t flags) {
         suspend_called = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t DdkResume(uint32_t flags) {
+    zx_status_t DdkResume(uint32_t flags) {
         resume_called = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     bool get_protocol_called = false;
@@ -186,23 +186,23 @@
     auto dev = fbl::unique_ptr<TestDispatch>(new (&ac) TestDispatch);
     ASSERT_TRUE(ac.check(), "");
 
-    // Since we're not adding the device to devmgr, we don't have a valid mx_device_t.
+    // Since we're not adding the device to devmgr, we don't have a valid zx_device_t.
     // TODO: use a devmgr API to add a test device, and use that instead
     auto ctx = dev.get();
     auto ops = dev->GetDeviceOps();
-    EXPECT_EQ(MX_OK, ops->get_protocol(ctx, 0, nullptr), "");
-    EXPECT_EQ(MX_OK, ops->open(ctx, nullptr, 0), "");
-    EXPECT_EQ(MX_OK, ops->open_at(ctx, nullptr, "", 0), "");
-    EXPECT_EQ(MX_OK, ops->close(ctx, 0), "");
+    EXPECT_EQ(ZX_OK, ops->get_protocol(ctx, 0, nullptr), "");
+    EXPECT_EQ(ZX_OK, ops->open(ctx, nullptr, 0), "");
+    EXPECT_EQ(ZX_OK, ops->open_at(ctx, nullptr, "", 0), "");
+    EXPECT_EQ(ZX_OK, ops->close(ctx, 0), "");
     ops->unbind(ctx);
     ops->release(ctx);
-    EXPECT_EQ(MX_OK, ops->read(ctx, nullptr, 0, 0, nullptr), "");
-    EXPECT_EQ(MX_OK, ops->write(ctx, nullptr, 0, 0, nullptr), "");
+    EXPECT_EQ(ZX_OK, ops->read(ctx, nullptr, 0, 0, nullptr), "");
+    EXPECT_EQ(ZX_OK, ops->write(ctx, nullptr, 0, 0, nullptr), "");
     ops->iotxn_queue(ctx, nullptr);
     EXPECT_EQ(0, ops->get_size(ctx), "");
-    EXPECT_EQ(MX_OK, ops->ioctl(ctx, 0, nullptr, 0, nullptr, 0, nullptr), "");
-    EXPECT_EQ(MX_OK, ops->suspend(ctx, 0), "");
-    EXPECT_EQ(MX_OK, ops->resume(ctx, 0), "");
+    EXPECT_EQ(ZX_OK, ops->ioctl(ctx, 0, nullptr, 0, nullptr, 0, nullptr), "");
+    EXPECT_EQ(ZX_OK, ops->suspend(ctx, 0), "");
+    EXPECT_EQ(ZX_OK, ops->resume(ctx, 0), "");
 
     EXPECT_TRUE(dev->get_protocol_called, "");
     EXPECT_TRUE(dev->open_called, "");
@@ -263,7 +263,7 @@
     void DdkRelease() {}
 
   private:
-    mx_status_t DdkClose(uint32_t flags) { return MX_OK; }
+    zx_status_t DdkClose(uint32_t flags) { return ZX_OK; }
 };
 
 class TestStaticOverride : public ddk::Device<TestStaticOverride, ddk::Closable> {
@@ -272,12 +272,12 @@
       : ddk::Device<TestStaticOverride, ddk::Closable>(nullptr) {}
     void DdkRelease() {}
 
-    static mx_status_t DdkClose(uint32_t flags) { return MX_OK; }
+    static zx_status_t DdkClose(uint32_t flags) { return ZX_OK; }
 };
 
 template <typename D>
 struct A {
-    explicit A(mx_protocol_device_t* proto) {}
+    explicit A(zx_protocol_device_t* proto) {}
 };
 
 class TestNotAMixin : public ddk::Device<TestNotAMixin, A> {
@@ -295,8 +295,8 @@
   public:
     TestNotAllMixins() : TestNotAllMixinsType(nullptr) {}
     void DdkRelease() {}
-    mx_status_t DdkOpen(mx_device_t** dev_out, uint32_t flags) { return MX_OK; }
-    mx_status_t DdkClose(uint32_t flags) { return MX_OK; }
+    zx_status_t DdkOpen(zx_device_t** dev_out, uint32_t flags) { return ZX_OK; }
+    zx_status_t DdkClose(uint32_t flags) { return ZX_OK; }
 };
 #endif
 
diff --git a/system/ulib/ddktl/test/ethernet-tests.cpp b/system/ulib/ddktl/test/ethernet-tests.cpp
index 040e9a1..f3f552c 100644
--- a/system/ulib/ddktl/test/ethernet-tests.cpp
+++ b/system/ulib/ddktl/test/ethernet-tests.cpp
@@ -45,7 +45,7 @@
         END_HELPER;
     }
 
-    mx_status_t StartProtocol(ddk::EthmacProtocolProxy* proxy) {
+    zx_status_t StartProtocol(ddk::EthmacProtocolProxy* proxy) {
         return proxy->Start(this);
     }
 
@@ -65,20 +65,20 @@
         this_ = get_this();
     }
 
-    mx_status_t DdkGetProtocol(uint32_t proto_id, void* out) {
-        if (proto_id != MX_PROTOCOL_ETHERMAC) return MX_ERR_INVALID_ARGS;
+    zx_status_t DdkGetProtocol(uint32_t proto_id, void* out) {
+        if (proto_id != ZX_PROTOCOL_ETHERMAC) return ZX_ERR_INVALID_ARGS;
         ddk::AnyProtocol* proto = static_cast<ddk::AnyProtocol*>(out);
         proto->ops = ddk_proto_ops_;
         proto->ctx = this;
-        return MX_OK;
+        return ZX_OK;
     }
 
     void DdkRelease() {}
 
-    mx_status_t EthmacQuery(uint32_t options, ethmac_info_t* info) {
+    zx_status_t EthmacQuery(uint32_t options, ethmac_info_t* info) {
         query_this_ = get_this();
         query_called_ = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     void EthmacStop() {
@@ -86,11 +86,11 @@
         stop_called_ = true;
     }
 
-    mx_status_t EthmacStart(fbl::unique_ptr<ddk::EthmacIfcProxy> proxy) {
+    zx_status_t EthmacStart(fbl::unique_ptr<ddk::EthmacIfcProxy> proxy) {
         start_this_ = get_this();
         proxy_.swap(proxy);
         start_called_ = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     void EthmacSend(uint32_t options, void* data, size_t length) {
@@ -170,14 +170,14 @@
     // its ops table is currently invalid.
     ethmac_protocol_t proto;
     auto status = dev.DdkGetProtocol(0, reinterpret_cast<void*>(&proto));
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, status, "");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, status, "");
 
-    status = dev.DdkGetProtocol(MX_PROTOCOL_ETHERMAC, reinterpret_cast<void*>(&proto));
-    EXPECT_EQ(MX_OK, status, "");
+    status = dev.DdkGetProtocol(ZX_PROTOCOL_ETHERMAC, reinterpret_cast<void*>(&proto));
+    EXPECT_EQ(ZX_OK, status, "");
 
-    EXPECT_EQ(MX_OK, proto.ops->query(proto.ctx, 0, nullptr), "");
+    EXPECT_EQ(ZX_OK, proto.ops->query(proto.ctx, 0, nullptr), "");
     proto.ops->stop(proto.ctx);
-    EXPECT_EQ(MX_OK, proto.ops->start(proto.ctx, nullptr, nullptr), "");
+    EXPECT_EQ(ZX_OK, proto.ops->start(proto.ctx, nullptr, nullptr), "");
     proto.ops->send(proto.ctx, 0, nullptr, 0);
 
     EXPECT_TRUE(dev.VerifyCalls(), "");
@@ -193,17 +193,17 @@
     TestEthmacProtocol protocol_dev;
 
     ethmac_protocol_t proto;
-    auto status = protocol_dev.DdkGetProtocol(MX_PROTOCOL_ETHERMAC, reinterpret_cast<void*>(&proto));
-    EXPECT_EQ(MX_OK, status, "");
+    auto status = protocol_dev.DdkGetProtocol(ZX_PROTOCOL_ETHERMAC, reinterpret_cast<void*>(&proto));
+    EXPECT_EQ(ZX_OK, status, "");
     // The proxy device to wrap the ops + device that represent the parent
     // device.
     ddk::EthmacProtocolProxy proxy(&proto);
     // The EthmacIfc to hand to the parent device.
     TestEthmacIfc ifc_dev;
 
-    EXPECT_EQ(MX_OK, proxy.Query(0, nullptr), "");
+    EXPECT_EQ(ZX_OK, proxy.Query(0, nullptr), "");
     proxy.Stop();
-    EXPECT_EQ(MX_OK, proxy.Start(&ifc_dev), "");
+    EXPECT_EQ(ZX_OK, proxy.Start(&ifc_dev), "");
     proxy.Send(0, nullptr, 0);
 
     EXPECT_TRUE(protocol_dev.VerifyCalls(), "");
@@ -220,12 +220,12 @@
     TestEthmacProtocol protocol_dev;
 
     ethmac_protocol_t proto;
-    auto status = protocol_dev.DdkGetProtocol(MX_PROTOCOL_ETHERMAC, reinterpret_cast<void*>(&proto));
-    EXPECT_EQ(MX_OK, status, "");
+    auto status = protocol_dev.DdkGetProtocol(ZX_PROTOCOL_ETHERMAC, reinterpret_cast<void*>(&proto));
+    EXPECT_EQ(ZX_OK, status, "");
 
     ddk::EthmacProtocolProxy proxy(&proto);
     TestEthmacIfc ifc_dev;
-    EXPECT_EQ(MX_OK, ifc_dev.StartProtocol(&proxy), "");
+    EXPECT_EQ(ZX_OK, ifc_dev.StartProtocol(&proxy), "");
 
     // Execute the EthmacIfc methods
     ASSERT_TRUE(protocol_dev.TestIfc(), "");
diff --git a/system/ulib/ddktl/test/wlan-tests.cpp b/system/ulib/ddktl/test/wlan-tests.cpp
index 99b4baa..78ec030 100644
--- a/system/ulib/ddktl/test/wlan-tests.cpp
+++ b/system/ulib/ddktl/test/wlan-tests.cpp
@@ -45,7 +45,7 @@
         END_HELPER;
     }
 
-    mx_status_t StartProtocol(ddk::WlanmacProtocolProxy* proxy) {
+    zx_status_t StartProtocol(ddk::WlanmacProtocolProxy* proxy) {
         return proxy->Start(this);
     }
 
@@ -65,20 +65,20 @@
         this_ = get_this();
     }
 
-    mx_status_t DdkGetProtocol(uint32_t proto_id, void* out) {
-        if (proto_id != MX_PROTOCOL_WLANMAC) return MX_ERR_INVALID_ARGS;
+    zx_status_t DdkGetProtocol(uint32_t proto_id, void* out) {
+        if (proto_id != ZX_PROTOCOL_WLANMAC) return ZX_ERR_INVALID_ARGS;
         ddk::AnyProtocol* proto = static_cast<ddk::AnyProtocol*>(out);
         proto->ops = ddk_proto_ops_;
         proto->ctx = this;
-        return MX_OK;
+        return ZX_OK;
     }
 
     void DdkRelease() {}
 
-    mx_status_t WlanmacQuery(uint32_t options, ethmac_info_t* info) {
+    zx_status_t WlanmacQuery(uint32_t options, ethmac_info_t* info) {
         query_this_ = get_this();
         query_called_ = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     void WlanmacStop() {
@@ -86,11 +86,11 @@
         stop_called_ = true;
     }
 
-    mx_status_t WlanmacStart(fbl::unique_ptr<ddk::WlanmacIfcProxy> proxy) {
+    zx_status_t WlanmacStart(fbl::unique_ptr<ddk::WlanmacIfcProxy> proxy) {
         start_this_ = get_this();
         proxy_.swap(proxy);
         start_called_ = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     void WlanmacTx(uint32_t options, const void* data, size_t length) {
@@ -98,10 +98,10 @@
         tx_called_ = true;
     }
 
-    mx_status_t WlanmacSetChannel(uint32_t options, wlan_channel_t* chan) {
+    zx_status_t WlanmacSetChannel(uint32_t options, wlan_channel_t* chan) {
         set_channel_this_ = get_this();
         set_channel_called_ = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     bool VerifyCalls() const {
@@ -180,15 +180,15 @@
     // its ops table is currently invalid.
     wlanmac_protocol_t proto;
     auto status = dev.DdkGetProtocol(0, reinterpret_cast<void*>(&proto));
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, status, "");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, status, "");
 
-    status = dev.DdkGetProtocol(MX_PROTOCOL_WLANMAC, reinterpret_cast<void*>(&proto));
-    EXPECT_EQ(MX_OK, status, "");
-    EXPECT_EQ(MX_OK, proto.ops->query(proto.ctx, 0, nullptr), "");
+    status = dev.DdkGetProtocol(ZX_PROTOCOL_WLANMAC, reinterpret_cast<void*>(&proto));
+    EXPECT_EQ(ZX_OK, status, "");
+    EXPECT_EQ(ZX_OK, proto.ops->query(proto.ctx, 0, nullptr), "");
     proto.ops->stop(proto.ctx);
-    EXPECT_EQ(MX_OK, proto.ops->start(proto.ctx, nullptr, nullptr), "");
+    EXPECT_EQ(ZX_OK, proto.ops->start(proto.ctx, nullptr, nullptr), "");
     proto.ops->tx(proto.ctx, 0, nullptr, 0);
-    EXPECT_EQ(MX_OK, proto.ops->set_channel(proto.ctx, 0, nullptr), "");
+    EXPECT_EQ(ZX_OK, proto.ops->set_channel(proto.ctx, 0, nullptr), "");
 
     EXPECT_TRUE(dev.VerifyCalls(), "");
 
@@ -203,17 +203,17 @@
     TestWlanmacProtocol protocol_dev;
 
     wlanmac_protocol_t proto;
-    auto status = protocol_dev.DdkGetProtocol(MX_PROTOCOL_WLANMAC, reinterpret_cast<void*>(&proto));
-    EXPECT_EQ(MX_OK, status, "");
+    auto status = protocol_dev.DdkGetProtocol(ZX_PROTOCOL_WLANMAC, reinterpret_cast<void*>(&proto));
+    EXPECT_EQ(ZX_OK, status, "");
     // The proxy device to wrap the ops + device that represent the parent
     // device.
     ddk::WlanmacProtocolProxy proxy(&proto);
     // The WlanmacIfc to hand to the parent device.
     TestWlanmacIfc ifc_dev;
 
-    EXPECT_EQ(MX_OK, proxy.Query(0, nullptr), "");
+    EXPECT_EQ(ZX_OK, proxy.Query(0, nullptr), "");
     proxy.Stop();
-    EXPECT_EQ(MX_OK, proxy.Start(&ifc_dev), "");
+    EXPECT_EQ(ZX_OK, proxy.Start(&ifc_dev), "");
     proxy.Tx(0, nullptr, 0);
     proxy.SetChannel(0, nullptr);
 
@@ -231,12 +231,12 @@
     TestWlanmacProtocol protocol_dev;
 
     wlanmac_protocol_t proto;
-    auto status = protocol_dev.DdkGetProtocol(MX_PROTOCOL_WLANMAC, reinterpret_cast<void*>(&proto));
-    EXPECT_EQ(MX_OK, status, "");
+    auto status = protocol_dev.DdkGetProtocol(ZX_PROTOCOL_WLANMAC, reinterpret_cast<void*>(&proto));
+    EXPECT_EQ(ZX_OK, status, "");
 
     ddk::WlanmacProtocolProxy proxy(&proto);
     TestWlanmacIfc ifc_dev;
-    EXPECT_EQ(MX_OK, ifc_dev.StartProtocol(&proxy), "");
+    EXPECT_EQ(ZX_OK, ifc_dev.StartProtocol(&proxy), "");
 
     // Execute the WlanmacIfc methods
     ASSERT_TRUE(protocol_dev.TestIfc(), "");
diff --git a/system/ulib/digest/digest.cpp b/system/ulib/digest/digest.cpp
index b917568..c40ed8f 100644
--- a/system/ulib/digest/digest.cpp
+++ b/system/ulib/digest/digest.cpp
@@ -9,8 +9,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <magenta/assert.h>
-#include <magenta/errors.h>
+#include <zircon/assert.h>
+#include <zircon/errors.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/unique_ptr.h>
 
@@ -27,11 +27,11 @@
 }
 
 Digest::~Digest() {
-    MX_DEBUG_ASSERT(ref_count_ == 0);
+    ZX_DEBUG_ASSERT(ref_count_ == 0);
 }
 
 Digest& Digest::operator=(const Digest& rhs) {
-    MX_DEBUG_ASSERT(ref_count_ == 0);
+    ZX_DEBUG_ASSERT(ref_count_ == 0);
     if (this != &rhs) {
         memcpy(&ctx_, &rhs.ctx_, sizeof(ctx_));
         memcpy(bytes_, rhs.bytes_, kLength);
@@ -40,13 +40,13 @@
 }
 
 Digest& Digest::operator=(const uint8_t* rhs) {
-    MX_DEBUG_ASSERT(ref_count_ == 0);
+    ZX_DEBUG_ASSERT(ref_count_ == 0);
     memcpy(bytes_, rhs, kLength);
     return *this;
 }
 
 void Digest::Init() {
-    MX_DEBUG_ASSERT(ref_count_ == 0);
+    ZX_DEBUG_ASSERT(ref_count_ == 0);
 #ifdef USE_LIBCRYPTO
     SHA256_Init(&ctx_);
 #else
@@ -55,8 +55,8 @@
 }
 
 void Digest::Update(const void* buf, size_t len) {
-    MX_DEBUG_ASSERT(ref_count_ == 0);
-    MX_DEBUG_ASSERT(len <= INT_MAX);
+    ZX_DEBUG_ASSERT(ref_count_ == 0);
+    ZX_DEBUG_ASSERT(len <= INT_MAX);
 #ifdef USE_LIBCRYPTO
     SHA256_Update(&ctx_, buf, len);
 #else
@@ -65,7 +65,7 @@
 }
 
 const uint8_t* Digest::Final() {
-    MX_DEBUG_ASSERT(ref_count_ == 0);
+    ZX_DEBUG_ASSERT(ref_count_ == 0);
 #ifdef USE_LIBCRYPTO
     SHA256_Final(bytes_, &ctx_);
 #else
@@ -80,17 +80,17 @@
     return Final();
 }
 
-mx_status_t Digest::Parse(const char* hex, size_t len) {
-    MX_DEBUG_ASSERT(ref_count_ == 0);
+zx_status_t Digest::Parse(const char* hex, size_t len) {
+    ZX_DEBUG_ASSERT(ref_count_ == 0);
     if (len < sizeof(bytes_) * 2) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     uint8_t c = 0;
     size_t i = 0;
     for (size_t j = 0; j < sizeof(bytes_) * 2; ++j) {
         c = static_cast<uint8_t>(toupper(hex[j]) & 0xFF);
         if (!isxdigit(c)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         c = static_cast<uint8_t>(c < 'A' ? c - '0' : c - '7'); // '7' = 'A' - 10
         if (j % 2 == 0) {
@@ -99,12 +99,12 @@
             bytes_[i++] |= c;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Digest::ToString(char* out, size_t len) const {
+zx_status_t Digest::ToString(char* out, size_t len) const {
     if (len < sizeof(bytes_) * 2 + 1) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
     memset(out, 0, len);
     char* p = out;
@@ -112,26 +112,26 @@
         sprintf(p, "%02x", bytes_[i]);
         p += 2;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Digest::CopyTo(uint8_t* out, size_t len) const {
+zx_status_t Digest::CopyTo(uint8_t* out, size_t len) const {
     if (len < sizeof(bytes_)) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
     memset(out, 0, len);
     memcpy(out, bytes_, sizeof(bytes_));
-    return MX_OK;
+    return ZX_OK;
 }
 
 const uint8_t* Digest::AcquireBytes() const {
-    MX_DEBUG_ASSERT(ref_count_ < SIZE_MAX);
+    ZX_DEBUG_ASSERT(ref_count_ < SIZE_MAX);
     ++ref_count_;
     return bytes_;
 }
 
 void Digest::ReleaseBytes() const {
-    MX_DEBUG_ASSERT(ref_count_ > 0);
+    ZX_DEBUG_ASSERT(ref_count_ > 0);
     --ref_count_;
 }
 
@@ -160,29 +160,29 @@
     Digest obj;
 };
 
-mx_status_t digest_init(digest_t** out) {
+zx_status_t digest_init(digest_t** out) {
     fbl::AllocChecker ac;
     fbl::unique_ptr<digest_t> uptr(new (&ac) digest_t);
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     uptr->obj.Init();
     *out = uptr.release();
-    return MX_OK;
+    return ZX_OK;
 }
 
 void digest_update(digest_t* digest, const void* buf, size_t len) {
     digest->obj.Update(buf, len);
 }
 
-mx_status_t digest_final(digest_t* digest, void* out,
+zx_status_t digest_final(digest_t* digest, void* out,
                                 size_t out_len) {
     fbl::unique_ptr<digest_t> uptr(digest);
     uptr->obj.Final();
     return uptr->obj.CopyTo(static_cast<uint8_t*>(out), out_len);
 }
 
-mx_status_t digest_hash(const void* buf, size_t len, void* out,
+zx_status_t digest_hash(const void* buf, size_t len, void* out,
                                size_t out_len) {
     Digest digest;
     digest.Hash(buf, len);
diff --git a/system/ulib/digest/include/digest/digest.h b/system/ulib/digest/include/digest/digest.h
index e31c7d4..3da2c3f 100644
--- a/system/ulib/digest/include/digest/digest.h
+++ b/system/ulib/digest/include/digest/digest.h
@@ -6,8 +6,8 @@
 
 #include <stddef.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 #include <stdint.h>
 
@@ -66,16 +66,16 @@
 
     // Converts a |hex| string to binary and stores it in this->data.  The
     // string must contain at least |kLength| * 2 valid hex characters.
-    mx_status_t Parse(const char* hex, size_t len);
+    zx_status_t Parse(const char* hex, size_t len);
 
     // Writes the current digest to |out| as a null-terminated, hex-encoded
     // string.  |out| must have room for (kLength * 2) + 1 characters to
     // succeed.
-    mx_status_t ToString(char* out, size_t len) const;
+    zx_status_t ToString(char* out, size_t len) const;
 
     // Write the current digest to |out|.  |len| must be at least kLength to
     // succeed.
-    mx_status_t CopyTo(uint8_t* out, size_t len) const;
+    zx_status_t CopyTo(uint8_t* out, size_t len) const;
 
     // Returns a pointer to a buffer containing the current digest value.  This
     // will always have |kLength| bytes.  Each call to |AcquireBytes| must have
@@ -136,7 +136,7 @@
 // C wrapper for |Digest::Init|.  On success this function allocates memory and
 // returns it in |out|.  The caller must make a call to |digest_final| to free
 // this memory.
-mx_status_t digest_init(digest_t** out);
+zx_status_t digest_init(digest_t** out);
 
 // C wrapper for |Digest::Update|.
 void digest_update(digest_t* digest, const void* buf, size_t len);
@@ -144,10 +144,10 @@
 // C wrapper for |Digest::Final|. |out| must point to a buffer with room for at
 // least |DIGEST_LENGTH| bytes.  This method frees |digest|, which must not be
 // used again after this call.
-mx_status_t digest_final(digest_t* digest, void* out, size_t out_len);
+zx_status_t digest_final(digest_t* digest, void* out, size_t out_len);
 
 // C wrapper for |Digest::Hash|.  |out| must point to a buffer with room for at
 // least |DIGEST_LENGTH| bytes.
-mx_status_t digest_hash(const void* buf, size_t len, void* out, size_t out_len);
+zx_status_t digest_hash(const void* buf, size_t len, void* out, size_t out_len);
 
 __END_CDECLS
diff --git a/system/ulib/digest/include/digest/merkle-tree.h b/system/ulib/digest/include/digest/merkle-tree.h
index c6f6208..f443256 100644
--- a/system/ulib/digest/include/digest/merkle-tree.h
+++ b/system/ulib/digest/include/digest/merkle-tree.h
@@ -6,8 +6,8 @@
 
 #include <stddef.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 #ifdef __cplusplus
 
@@ -34,7 +34,7 @@
 // corresponding to the data. If this digest is trusted (e.g. the creator signs
 // it), other parties can use it to verify any portion of the data, chosen by
 // |offset| and |length| using the following:
-//      mx_status_t rc = digest::MerkleTree::Verify(data,
+//      zx_status_t rc = digest::MerkleTree::Verify(data,
 //          data_len, tree, tree_len, offset, length, digest);
 //
 // If |s| is NO_ERROR, the |data| between |offset| and |offset + length| is the
@@ -55,7 +55,7 @@
 
     // Writes a Merkle tree for the given data and saves its root digest.
     // |tree_len| must be at least as much as returned by GetTreeLength().
-    static mx_status_t Create(const void* data, size_t data_len, void* tree,
+    static zx_status_t Create(const void* data, size_t data_len, void* tree,
                               size_t tree_len, Digest* digest);
 
     // Checks the integrity of a the region of data given by the offset and
@@ -63,7 +63,7 @@
     // digest. |tree_len| must be at least as much as returned by
     // GetTreeLength().  |offset| and |length| must describe a range wholly
     // within |data_len|.
-    static mx_status_t Verify(const void* data, size_t data_len,
+    static zx_status_t Verify(const void* data, size_t data_len,
                               const void* tree, size_t tree_len, size_t offset,
                               size_t length, const Digest& digest);
 
@@ -74,20 +74,20 @@
 
     // Initializes |tree| to hold a the Merkle tree for |data_len| bytes of
     // data.  This must be called before |CreateUpdate|.
-    mx_status_t CreateInit(size_t data_len, size_t tree_len);
+    zx_status_t CreateInit(size_t data_len, size_t tree_len);
 
     // Processes an additional |length| bytes of |data| and writes digests to
     // the Merkle |tree|.  It is an error to process more data in total than was
     // specified by |data_len| in |CreateInit|.  |tree| must have room for at
     // least |GetTreeLength(data_len)| bytes.
-    mx_status_t CreateUpdate(const void* data, size_t length, void* tree);
+    zx_status_t CreateUpdate(const void* data, size_t length, void* tree);
 
     // Completes the Merkle |tree|, from the data leaves up to the |root|, which
     // it writes out if not null.  This must only be called after the total
     // number of bytes processed by |CreateUpdate| equals the |data_len| set by
     // |CreateInit|.  |tree| must have room for at least
     // |GetTreeLength(data_len)| bytes.
-    mx_status_t CreateFinal(void* tree, Digest* digest);
+    zx_status_t CreateFinal(void* tree, Digest* digest);
 
 private:
     DISALLOW_COPY_ASSIGN_AND_MOVE(MerkleTree);
@@ -95,7 +95,7 @@
     // Checks the integrity of the top level of a Merkle tree.  It checks
     // integrity using the given root digest. |data_len| must be at no more than
     // |kNodeSize|.
-    static mx_status_t VerifyRoot(const void* data, size_t data_len,
+    static zx_status_t VerifyRoot(const void* data, size_t data_len,
                                   uint64_t level, const Digest& root);
 
     // Checks the integrity of portion of a Merkle tree level given by the
@@ -103,13 +103,13 @@
     // Merkle tree. |tree_len| must be at least as much as returned by
     // |GetTreeLength(data_len)|.  |offset| and |length| must describe a range
     // wholly within |data_len|.
-    static mx_status_t VerifyLevel(const void* data, size_t data_len,
+    static zx_status_t VerifyLevel(const void* data, size_t data_len,
                                    const void* tree, size_t offset,
                                    size_t length, uint64_t level);
 
     // See CreateFinal.  This implements that method, with an extra parameter to
     // allow levels other than the bottommost to be padded.
-    mx_status_t CreateFinalInternal(const void* data, void* tree, Digest* root);
+    zx_status_t CreateFinalInternal(const void* data, void* tree, Digest* root);
 
     // All of the following fields are used to save state when creating the
     // Merkle tree using the Init/Update/Final methods.  These methods use a
@@ -179,27 +179,27 @@
 size_t merkle_tree_get_tree_length(size_t data_len);
 
 // C wrapper function for |MerkleTree::Create|.
-mx_status_t merkle_tree_create(const void* data, size_t data_len, void* tree,
+zx_status_t merkle_tree_create(const void* data, size_t data_len, void* tree,
                                size_t tree_len, void* out, size_t out_len);
 
 // C wrapper for |MerkleTree::CreateInit|.  On success, this function
 //  allocates memory for |out|.  The caller must free this memory by calling
 //  |merkle_tree_create_final|, even if an intervening call to
 //  |merkle_tree_create_update| returns an error.
-mx_status_t merkle_tree_create_init(size_t data_len, size_t tree_len,
+zx_status_t merkle_tree_create_init(size_t data_len, size_t tree_len,
                                     merkle_tree_t** out);
 
 // C wrapper function for |MerkleTree::CreateUpdate|.
-mx_status_t merkle_tree_create_update(merkle_tree_t* mt, const void* data,
+zx_status_t merkle_tree_create_update(merkle_tree_t* mt, const void* data,
                                       size_t length, void* tree);
 
 // C wrapper function for |MerkleTree::CreateFinal|.  This function consumes
 // |mt| and frees it.
-mx_status_t merkle_tree_create_final(merkle_tree_t* mt, void* tree, void* out,
+zx_status_t merkle_tree_create_final(merkle_tree_t* mt, void* tree, void* out,
                                      size_t out_len);
 
 // C wrapper function for |MerkleTree::Verify|.
-mx_status_t merkle_tree_verify(const void* data, size_t data_len, void* tree,
+zx_status_t merkle_tree_verify(const void* data, size_t data_len, void* tree,
                                size_t tree_len, size_t offset, size_t length,
                                const void* root, size_t root_len);
 
diff --git a/system/ulib/digest/merkle-tree.cpp b/system/ulib/digest/merkle-tree.cpp
index 33bbf31..9d23863 100644
--- a/system/ulib/digest/merkle-tree.cpp
+++ b/system/ulib/digest/merkle-tree.cpp
@@ -8,8 +8,8 @@
 #include <string.h>
 
 #include <digest/digest.h>
-#include <magenta/assert.h>
-#include <magenta/errors.h>
+#include <zircon/assert.h>
+#include <zircon/errors.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/unique_ptr.h>
@@ -39,8 +39,8 @@
 // Wrapper for Digest::Init.  This primes the working |digest| initializing it
 // and hashing the |locality| and |length|.
 void DigestInit(Digest* digest, uint64_t locality, size_t length) {
-    MX_DEBUG_ASSERT(digest);
-    MX_DEBUG_ASSERT(length < UINT32_MAX);
+    ZX_DEBUG_ASSERT(digest);
+    ZX_DEBUG_ASSERT(length < UINT32_MAX);
     digest->Init();
     digest->Update(&locality, sizeof(locality));
     uint32_t len32 =
@@ -53,7 +53,7 @@
 // the number of bytes hashed.
 size_t DigestUpdate(Digest* digest, const uint8_t* in, size_t offset,
                     size_t length) {
-    MX_DEBUG_ASSERT(digest);
+    ZX_DEBUG_ASSERT(digest);
     // Check if length crosses a node boundary
     length = fbl::min(length, MerkleTree::kNodeSize -
                                    (offset % MerkleTree::kNodeSize));
@@ -103,16 +103,16 @@
     return (next_len == 0 ? 0 : next_len + GetTreeLength(next_len));
 }
 
-mx_status_t MerkleTree::Create(const void* data, size_t data_len, void* tree,
+zx_status_t MerkleTree::Create(const void* data, size_t data_len, void* tree,
                                size_t tree_len, Digest* digest) {
-    mx_status_t rc;
+    zx_status_t rc;
     MerkleTree mt;
-    if ((rc = mt.CreateInit(data_len, tree_len)) != MX_OK ||
-        (rc = mt.CreateUpdate(data, data_len, tree)) != MX_OK ||
-        (rc = mt.CreateFinal(tree, digest)) != MX_OK) {
+    if ((rc = mt.CreateInit(data_len, tree_len)) != ZX_OK ||
+        (rc = mt.CreateUpdate(data, data_len, tree)) != ZX_OK ||
+        (rc = mt.CreateFinal(tree, digest)) != ZX_OK) {
         return rc;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 MerkleTree::MerkleTree()
@@ -120,48 +120,48 @@
 
 MerkleTree::~MerkleTree() {}
 
-mx_status_t MerkleTree::CreateInit(size_t data_len, size_t tree_len) {
+zx_status_t MerkleTree::CreateInit(size_t data_len, size_t tree_len) {
     initialized_ = true;
     offset_ = 0;
     length_ = data_len;
     // Data fits in a single node, making this the top level of the tree.
     if (data_len <= kNodeSize) {
-        return MX_OK;
+        return ZX_OK;
     }
     fbl::AllocChecker ac;
     next_.reset(new (&ac) MerkleTree());
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     next_->level_ = level_ + 1;
     // Ascend the tree.
     data_len = NextAligned(data_len);
     if (tree_len < data_len) {
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
     }
     tree_len -= data_len;
     return next_->CreateInit(data_len, tree_len);
 }
 
-mx_status_t MerkleTree::CreateUpdate(const void* data, size_t length,
+zx_status_t MerkleTree::CreateUpdate(const void* data, size_t length,
                                      void* tree) {
-    MX_DEBUG_ASSERT(offset_ + length >= offset_);
+    ZX_DEBUG_ASSERT(offset_ + length >= offset_);
     // Must call CreateInit first.
     if (!initialized_) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     // Early exit if no work to do.
     if (length == 0) {
-        return MX_OK;
+        return ZX_OK;
     }
     // Must not overrun expected length.
     if (offset_ + length > length_) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     // Must have data to read and a tree to fill if expecting more than one
     // digest.
     if (!data || (!tree && length_ > kNodeSize)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     // Save pointers to the data, digest, and the next level tree.
     const uint8_t* in = static_cast<const uint8_t*>(data);
@@ -169,8 +169,8 @@
     uint8_t* out = static_cast<uint8_t*>(tree) + tree_off;
     void* next = static_cast<uint8_t*>(tree) + NextAligned(length_);
     // Consume the data.
-    mx_status_t rc = MX_OK;
-    while (length > 0 && rc == MX_OK) {
+    zx_status_t rc = ZX_OK;
+    while (length > 0 && rc == ZX_OK) {
         // Check if this is the start of a node.
         if (offset_ % kNodeSize == 0) {
             DigestInit(&digest_, offset_ | level_, length_ - offset_);
@@ -202,20 +202,20 @@
     return rc;
 }
 
-mx_status_t MerkleTree::CreateFinal(void* tree, Digest* root) {
+zx_status_t MerkleTree::CreateFinal(void* tree, Digest* root) {
     return CreateFinalInternal(nullptr, tree, root);
 }
 
-mx_status_t MerkleTree::CreateFinalInternal(const void* data, void* tree,
+zx_status_t MerkleTree::CreateFinalInternal(const void* data, void* tree,
                                             Digest* root) {
     // Must call CreateInit first.  Must call CreateUpdate with all data first.
     if (!initialized_ || (level_ == 0 && offset_ != length_)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     // Must have root to write and a tree to fill if expecting more than one
     // digest.
     if (!root || (!tree && length_ > kNodeSize)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     // Special case: the level is empty.
     if (length_ == 0) {
@@ -224,15 +224,15 @@
     }
     // Consume padding if needed.
     const uint8_t* tail = static_cast<const uint8_t*>(data) + offset_;
-    mx_status_t rc;
-    if ((rc = CreateUpdate(tail, length_ - offset_, tree)) != MX_OK) {
+    zx_status_t rc;
+    if ((rc = CreateUpdate(tail, length_ - offset_, tree)) != ZX_OK) {
         return rc;
     }
     initialized_ = false;
     // If the top, save the digest as the Merkle tree root and return.
     if (length_ <= kNodeSize) {
         *root = digest_;
-        return MX_OK;
+        return ZX_OK;
     }
     // Finalize the next level up.
     uint8_t* next = static_cast<uint8_t*>(tree) + NextAligned(length_);
@@ -242,16 +242,16 @@
 ////////
 // Verification methods
 
-mx_status_t MerkleTree::Verify(const void* data, size_t data_len,
+zx_status_t MerkleTree::Verify(const void* data, size_t data_len,
                                const void* tree, size_t tree_len, size_t offset,
                                size_t length, const Digest& root) {
     uint64_t level = 0;
     size_t root_len = data_len;
     while (data_len > kNodeSize) {
-        mx_status_t rc;
+        zx_status_t rc;
         // Verify the data in this level.
         if ((rc = VerifyLevel(data, data_len, tree, offset, length, level)) !=
-            MX_OK) {
+            ZX_OK) {
             return rc;
         }
         // Ascend to the next level up.
@@ -260,7 +260,7 @@
         data_len = NextAligned(data_len);
         tree = static_cast<const uint8_t*>(tree) + data_len;
         if (tree_len < data_len) {
-            return MX_ERR_BUFFER_TOO_SMALL;
+            return ZX_ERR_BUFFER_TOO_SMALL;
         }
         tree_len -= data_len;
         offset /= kDigestsPerNode;
@@ -270,11 +270,11 @@
     return VerifyRoot(data, root_len, level, root);
 }
 
-mx_status_t MerkleTree::VerifyRoot(const void* data, size_t root_len,
+zx_status_t MerkleTree::VerifyRoot(const void* data, size_t root_len,
                                    uint64_t level, const Digest& expected) {
     // Must have data if length isn't 0.  Must have either zero or one node.
     if ((!data && root_len != 0) || root_len > kNodeSize) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     const uint8_t* in = static_cast<const uint8_t*>(data);
     Digest actual;
@@ -282,20 +282,20 @@
     DigestInit(&actual, level, (level == 0 ? root_len : kNodeSize));
     DigestUpdate(&actual, in, 0, root_len);
     DigestFinal(&actual, root_len);
-    return (actual == expected ? MX_OK : MX_ERR_IO_DATA_INTEGRITY);
+    return (actual == expected ? ZX_OK : ZX_ERR_IO_DATA_INTEGRITY);
 }
 
-mx_status_t MerkleTree::VerifyLevel(const void* data, size_t data_len,
+zx_status_t MerkleTree::VerifyLevel(const void* data, size_t data_len,
                                     const void* tree, size_t offset,
                                     size_t length, uint64_t level) {
-    MX_DEBUG_ASSERT(offset + length >= offset);
+    ZX_DEBUG_ASSERT(offset + length >= offset);
     // Must have more than one node of data and digests to check against.
     if (!data || data_len <= kNodeSize || !tree) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     // Must not overrun expected length.
     if (offset + length > data_len) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     // Align parameters to node boundaries, but don't exceed data_len
     offset -= offset % kNodeSize;
@@ -315,11 +315,11 @@
         length -= chunk;
         DigestFinal(&actual, offset);
         if (actual != expected) {
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         }
         expected += Digest::kLength;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 } // namespace digest
@@ -338,78 +338,78 @@
     return MerkleTree::GetTreeLength(data_len);
 }
 
-mx_status_t merkle_tree_create_init(size_t data_len, size_t tree_len,
+zx_status_t merkle_tree_create_init(size_t data_len, size_t tree_len,
                                     merkle_tree_t** out) {
-    mx_status_t rc;
+    zx_status_t rc;
     // Must have some where to store the wrapper.
     if (!out) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     // Allocate the wrapper object using a unique_ptr.  That way, if we hit an
     // error we'll clean up automatically.
     fbl::AllocChecker ac;
     fbl::unique_ptr<merkle_tree_t> mt_uniq(new (&ac) merkle_tree_t());
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     // Call the C++ function.
-    if ((rc = mt_uniq->obj.CreateInit(data_len, tree_len)) != MX_OK) {
+    if ((rc = mt_uniq->obj.CreateInit(data_len, tree_len)) != ZX_OK) {
         return rc;
     }
     // Release the wrapper object.
     *out = mt_uniq.release();
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t merkle_tree_create_update(merkle_tree_t* mt, const void* data,
+zx_status_t merkle_tree_create_update(merkle_tree_t* mt, const void* data,
                                       size_t length, void* tree) {
     // Must have a wrapper object.
     if (!mt) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     // Call the C++ function.
-    mx_status_t rc;
-    if ((rc = mt->obj.CreateUpdate(data, length, tree)) != MX_OK) {
+    zx_status_t rc;
+    if ((rc = mt->obj.CreateUpdate(data, length, tree)) != ZX_OK) {
         return rc;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t merkle_tree_create_final(merkle_tree_t* mt, void* tree, void* out,
+zx_status_t merkle_tree_create_final(merkle_tree_t* mt, void* tree, void* out,
                                      size_t out_len) {
     // Must have a wrapper object.
     if (!mt) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     // Take possession of the wrapper object. That way, we'll clean up
     // automatically.
     fbl::unique_ptr<merkle_tree_t> mt_uniq(mt);
     // Call the C++ function.
-    mx_status_t rc;
+    zx_status_t rc;
     Digest digest;
-    if ((rc = mt_uniq->obj.CreateFinal(tree, &digest)) != MX_OK) {
+    if ((rc = mt_uniq->obj.CreateFinal(tree, &digest)) != ZX_OK) {
         return rc;
     }
     return digest.CopyTo(static_cast<uint8_t*>(out), out_len);
 }
 
-mx_status_t merkle_tree_create(const void* data, size_t data_len, void* tree,
+zx_status_t merkle_tree_create(const void* data, size_t data_len, void* tree,
                                size_t tree_len, void* out, size_t out_len) {
-    mx_status_t rc;
+    zx_status_t rc;
     Digest digest;
     if ((rc = MerkleTree::Create(data, data_len, tree, tree_len, &digest)) !=
-        MX_OK) {
+        ZX_OK) {
         return rc;
     }
     return digest.CopyTo(static_cast<uint8_t*>(out), out_len);
 }
 
-mx_status_t merkle_tree_verify(const void* data, size_t data_len, void* tree,
+zx_status_t merkle_tree_verify(const void* data, size_t data_len, void* tree,
                                size_t tree_len, size_t offset, size_t length,
                                const void* root, size_t root_len) {
     // Must have a complete root digest.
     if (root_len < Digest::kLength) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     Digest digest(static_cast<const uint8_t*>(root));
     return MerkleTree::Verify(data, data_len, tree, tree_len, offset,
diff --git a/system/ulib/digest/rules.mk b/system/ulib/digest/rules.mk
index 7124bf3..90040c7 100644
--- a/system/ulib/digest/rules.mk
+++ b/system/ulib/digest/rules.mk
@@ -20,7 +20,7 @@
 # BoringSSL's optimized digests.
 MODULE_STATIC_LIBS := \
     third_party/ulib/cryptolib \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 include make/module.mk
diff --git a/system/ulib/driver-info/BUILD.gn b/system/ulib/driver-info/BUILD.gn
index 7490b6c..710bbc4 100644
--- a/system/ulib/driver-info/BUILD.gn
+++ b/system/ulib/driver-info/BUILD.gn
@@ -14,7 +14,7 @@
     "include/driver-info/driver-info.h",
   ]
   deps = [
-    "//magenta/third_party/ulib/cksum",
+    "//zircon/third_party/ulib/cksum",
   ]
   public_configs = [ ":driver-info_config" ]
 }
diff --git a/system/ulib/driver-info/driver-info-app.c b/system/ulib/driver-info/driver-info-app.c
index f32c6bb..71ff29b 100644
--- a/system/ulib/driver-info/driver-info-app.c
+++ b/system/ulib/driver-info/driver-info-app.c
@@ -9,8 +9,8 @@
 
 #include <driver-info/driver-info.h>
 
-static void callback(magenta_driver_note_payload_t* dn,
-                     const mx_bind_inst_t* binding,
+static void callback(zircon_driver_note_payload_t* dn,
+                     const zx_bind_inst_t* binding,
                      void* cookie) {
     printf("name:    %s\n", dn->name);
     printf("vendor:  %s\n", dn->vendor);
diff --git a/system/ulib/driver-info/driver-info.c b/system/ulib/driver-info/driver-info.c
index e42f3ea..7f28291 100644
--- a/system/ulib/driver-info/driver-info.c
+++ b/system/ulib/driver-info/driver-info.c
@@ -11,23 +11,23 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/driver/binding.h>
-#include <magenta/types.h>
+#include <zircon/driver/binding.h>
+#include <zircon/types.h>
 
 typedef Elf64_Ehdr elfhdr;
 typedef Elf64_Phdr elfphdr;
 typedef Elf64_Nhdr notehdr;
 
-static mx_status_t find_note(const char* name, size_t nlen, uint32_t type,
+static zx_status_t find_note(const char* name, size_t nlen, uint32_t type,
                              void* data, size_t size,
-                             mx_status_t (*func)(void* note, size_t sz,
+                             zx_status_t (*func)(void* note, size_t sz,
                                                  void* cookie),
                              void* cookie) {
     while (size >= sizeof(notehdr)) {
         const notehdr* hdr = data;
         uint32_t nsz = (hdr->n_namesz + 3) & (~3);
         if (nsz > (size - sizeof(notehdr))) {
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
         size_t hsz = sizeof(notehdr) + nsz;
         data += hsz;
@@ -35,7 +35,7 @@
 
         uint32_t dsz = (hdr->n_descsz + 3) & (~3);
         if (dsz > size) {
-            return MX_ERR_INTERNAL;
+            return ZX_ERR_INTERNAL;
         }
 
         if ((hdr->n_type == type) &&
@@ -47,12 +47,12 @@
         data += dsz;
         size -= dsz;
     }
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
-static mx_status_t for_each_note(int fd, const char* name, uint32_t type,
+static zx_status_t for_each_note(int fd, const char* name, uint32_t type,
                                  void* data, size_t dsize,
-                                 mx_status_t (*func)(void* note,
+                                 zx_status_t (*func)(void* note,
                                                      size_t sz, void* cookie),
                                  void* cookie) {
     size_t nlen = strlen(name) + 1;
@@ -60,22 +60,22 @@
     elfhdr eh;
     if (pread(fd, &eh, sizeof(eh), 0) != sizeof(eh)) {
         printf("for_each_note: pread(eh) failed\n");
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     if (memcmp(&eh, ELFMAG, 4) ||
         (eh.e_ehsize != sizeof(elfhdr)) ||
         (eh.e_phentsize != sizeof(elfphdr))) {
         printf("for_each_note: bad elf magic\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     size_t sz = sizeof(elfphdr) * eh.e_phnum;
     if (sz > sizeof(ph)) {
         printf("for_each_note: too many phdrs\n");
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     if ((pread(fd, ph, sz, eh.e_phoff) != (ssize_t)sz)) {
         printf("for_each_note: pread(sz,eh.e_phoff) failed\n");
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     for (int i = 0; i < eh.e_phnum; i++) {
         if ((ph[i].p_type != PT_NOTE) ||
@@ -84,48 +84,48 @@
         }
         if ((pread(fd, data, ph[i].p_filesz, ph[i].p_offset) != (ssize_t)ph[i].p_filesz)) {
             printf("for_each_note: pread(ph[i]) failed\n");
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
         int r = find_note(name, nlen, type, data, ph[i].p_filesz, func, cookie);
-        if (r == MX_OK) {
+        if (r == ZX_OK) {
             return r;
         }
     }
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
 typedef struct {
     void* cookie;
-    void (*func)(magenta_driver_note_payload_t* note,
-                 const mx_bind_inst_t* binding, void* cookie);
+    void (*func)(zircon_driver_note_payload_t* note,
+                 const zx_bind_inst_t* binding, void* cookie);
 } context;
 
-static mx_status_t callback(void* note, size_t sz, void* _ctx) {
+static zx_status_t callback(void* note, size_t sz, void* _ctx) {
     context* ctx = _ctx;
-    magenta_driver_note_t* dn = note;
-    if (sz < sizeof(magenta_driver_note_t)) {
-        return MX_ERR_INTERNAL;
+    zircon_driver_note_t* dn = note;
+    if (sz < sizeof(zircon_driver_note_t)) {
+        return ZX_ERR_INTERNAL;
     }
-    size_t max = (sz - sizeof(magenta_driver_note_t)) / sizeof(mx_bind_inst_t);
+    size_t max = (sz - sizeof(zircon_driver_note_t)) / sizeof(zx_bind_inst_t);
     if (dn->payload.bindcount > max) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
-    const mx_bind_inst_t* binding = (const void*)(&dn->payload + 1);
+    const zx_bind_inst_t* binding = (const void*)(&dn->payload + 1);
     ctx->func(&dn->payload, binding, ctx->cookie);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t di_read_driver_info(int fd, void *cookie,
+zx_status_t di_read_driver_info(int fd, void *cookie,
                                 void (*func)(
-                                    magenta_driver_note_payload_t* note,
-                                    const mx_bind_inst_t* binding,
+                                    zircon_driver_note_payload_t* note,
+                                    const zx_bind_inst_t* binding,
                                     void *cookie)) {
     context ctx = {
         .cookie = cookie,
         .func = func,
     };
     uint8_t data[4096];
-    return for_each_note(fd, MAGENTA_NOTE_NAME, MAGENTA_NOTE_DRIVER,
+    return for_each_note(fd, ZIRCON_NOTE_NAME, ZIRCON_NOTE_DRIVER,
                          data, sizeof(data), callback, &ctx);
 }
 
@@ -161,7 +161,7 @@
     }
 }
 
-void di_dump_bind_inst(const mx_bind_inst_t* b, char* buf, size_t buf_len) {
+void di_dump_bind_inst(const zx_bind_inst_t* b, char* buf, size_t buf_len) {
     if (!b || !buf || !buf_len) {
         return;
     }
diff --git a/system/ulib/driver-info/include/driver-info/driver-info.h b/system/ulib/driver-info/include/driver-info/driver-info.h
index 6f6ae4c..bcf572f 100644
--- a/system/ulib/driver-info/include/driver-info/driver-info.h
+++ b/system/ulib/driver-info/include/driver-info/driver-info.h
@@ -4,16 +4,16 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/driver/binding.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/driver/binding.h>
 
 __BEGIN_CDECLS;
 
-mx_status_t di_read_driver_info(int fd, void *cookie,
+zx_status_t di_read_driver_info(int fd, void *cookie,
                                 void (*func)(
-                                    magenta_driver_note_payload_t* note,
-                                    const mx_bind_inst_t* binding,
+                                    zircon_driver_note_payload_t* note,
+                                    const zx_bind_inst_t* binding,
                                     void *cookie));
 
 // Lookup the human readable name of a bind program parameter, or return NULL if
@@ -23,6 +23,6 @@
 
 // Disassemble a bind program instruction and dump it to the buffer provided by
 // the caller.  If the buffer is too small, the disassembly may be truncated.
-void di_dump_bind_inst(const mx_bind_inst_t* b, char* buf, size_t buf_len);
+void di_dump_bind_inst(const zx_bind_inst_t* b, char* buf, size_t buf_len);
 
 __END_CDECLS;
diff --git a/system/ulib/driver-info/rules.mk b/system/ulib/driver-info/rules.mk
index 5abd7aa..3846809 100644
--- a/system/ulib/driver-info/rules.mk
+++ b/system/ulib/driver-info/rules.mk
@@ -24,6 +24,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/driver-info
 
-MODULE_LIBS := system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/driver/include/driver/usb.h b/system/ulib/driver/include/driver/usb.h
index c4bace4..2a07a46 100644
--- a/system/ulib/driver/include/driver/usb.h
+++ b/system/ulib/driver/include/driver/usb.h
@@ -6,8 +6,8 @@
 
 #include <ddk/device.h>
 #include <ddk/protocol/usb.h>
-#include <magenta/compiler.h>
-#include <magenta/hw/usb.h>
+#include <zircon/compiler.h>
+#include <zircon/hw/usb.h>
 
 __BEGIN_CDECLS;
 
@@ -16,7 +16,7 @@
 
 // helper function for claiming additional interfaces that satisfy the want_interface predicate,
 // want_interface will be passed the supplied arg
-mx_status_t usb_claim_additional_interfaces(usb_protocol_t *usb,
+zx_status_t usb_claim_additional_interfaces(usb_protocol_t *usb,
                                             bool (*want_interface)(usb_interface_descriptor_t*, void*),
                                             void* arg);
 
@@ -33,7 +33,7 @@
 } usb_desc_iter_t;
 
 // initializes a usb_desc_iter_t
-mx_status_t usb_desc_iter_init(usb_protocol_t* usb, usb_desc_iter_t* iter);
+zx_status_t usb_desc_iter_init(usb_protocol_t* usb, usb_desc_iter_t* iter);
 
 // releases resources in a usb_desc_iter_t
 void usb_desc_iter_release(usb_desc_iter_t* iter);
diff --git a/system/ulib/driver/rules.mk b/system/ulib/driver/rules.mk
index e0e360e..4a58b9a 100644
--- a/system/ulib/driver/rules.mk
+++ b/system/ulib/driver/rules.mk
@@ -27,6 +27,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync system/ulib/port
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/driver/usb.c b/system/ulib/driver/usb.c
index 3678a44..0291c1d 100644
--- a/system/ulib/driver/usb.c
+++ b/system/ulib/driver/usb.c
@@ -5,7 +5,7 @@
 #include <ddk/iotxn.h>
 #include <ddk/protocol/usb.h>
 #include <driver/usb.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -13,11 +13,11 @@
 __EXPORT iotxn_t* usb_alloc_iotxn(uint8_t ep_address, size_t data_size) {
     iotxn_t* txn;
 
-    mx_status_t status = iotxn_alloc(&txn, 0, data_size);
-    if (status != MX_OK) {
+    zx_status_t status = iotxn_alloc(&txn, 0, data_size);
+    if (status != ZX_OK) {
         return NULL;
     }
-    txn->protocol = MX_PROTOCOL_USB;
+    txn->protocol = ZX_PROTOCOL_USB;
 
     usb_protocol_data_t* data = iotxn_pdata(txn, usb_protocol_data_t);
     memset(data, 0, sizeof(*data));
@@ -28,31 +28,31 @@
 
 // initializes a usb_desc_iter_t for iterating on descriptors past the
 // interface's existing descriptors.
-static mx_status_t usb_desc_iter_additional_init(usb_protocol_t* usb,
+static zx_status_t usb_desc_iter_additional_init(usb_protocol_t* usb,
                                                  usb_desc_iter_t* iter) {
     memset(iter, 0, sizeof(*iter));
 
     void* descriptors;
     size_t length;
-    mx_status_t status = usb_get_additional_descriptor_list(usb, &descriptors, &length);
-    if (status != MX_OK) {
+    zx_status_t status = usb_get_additional_descriptor_list(usb, &descriptors, &length);
+    if (status != ZX_OK) {
         return status;
     }
 
     iter->desc = descriptors;
     iter->desc_end = descriptors + length;
     iter->current = descriptors;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // helper function for claiming additional interfaces that satisfy the want_interface predicate,
 // want_interface will be passed the supplied arg
-__EXPORT mx_status_t usb_claim_additional_interfaces(usb_protocol_t* usb,
+__EXPORT zx_status_t usb_claim_additional_interfaces(usb_protocol_t* usb,
                                                      bool (*want_interface)(usb_interface_descriptor_t*, void*),
                                                      void* arg) {
     usb_desc_iter_t iter;
-    mx_status_t status = usb_desc_iter_additional_init(usb, &iter);
-    if (status != MX_OK) {
+    zx_status_t status = usb_desc_iter_additional_init(usb, &iter);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -66,7 +66,7 @@
         size_t length = intf_end - (void*)intf;
 
         status = usb_claim_interface(usb, intf, length);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             break;
         }
         intf = next;
@@ -76,20 +76,20 @@
 }
 
 // initializes a usb_desc_iter_t
-__EXPORT mx_status_t usb_desc_iter_init(usb_protocol_t* usb, usb_desc_iter_t* iter) {
+__EXPORT zx_status_t usb_desc_iter_init(usb_protocol_t* usb, usb_desc_iter_t* iter) {
     memset(iter, 0, sizeof(*iter));
 
     void* descriptors;
     size_t length;
-    mx_status_t status = usb_get_descriptor_list(usb, &descriptors, &length);
-    if (status != MX_OK) {
+    zx_status_t status = usb_get_descriptor_list(usb, &descriptors, &length);
+    if (status != ZX_OK) {
         return status;
     }
 
     iter->desc = descriptors;
     iter->desc_end = descriptors + length;
     iter->current = descriptors;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // releases resources in a usb_desc_iter_t
diff --git a/system/ulib/elfload/elf-load.c b/system/ulib/elfload/elf-load.c
index 7793f6d..d10cfca 100644
--- a/system/ulib/elfload/elf-load.c
+++ b/system/ulib/elfload/elf-load.c
@@ -7,7 +7,7 @@
 #include <endian.h>
 #include <limits.h>
 #include <string.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #if BYTE_ORDER == LITTLE_ENDIAN
 # define MY_ELFDATA ELFDATA2LSB
@@ -38,7 +38,7 @@
 // its own stack.
 
 // hdr_buf represents bytes already read from the start of the file.
-mx_status_t elf_load_prepare(mx_handle_t vmo, const void* hdr_buf, size_t buf_sz,
+zx_status_t elf_load_prepare(zx_handle_t vmo, const void* hdr_buf, size_t buf_sz,
                              elf_load_header_t* header, uintptr_t* phoff) {
     // Read the file header and validate basic format sanity.
     elf_ehdr_t ehdr;
@@ -46,8 +46,8 @@
         memcpy(&ehdr, hdr_buf, sizeof(ehdr));
     } else {
         size_t n;
-        mx_status_t status = mx_vmo_read(vmo, &ehdr, 0, sizeof(ehdr), &n);
-        if (status != MX_OK)
+        zx_status_t status = zx_vmo_read(vmo, &ehdr, 0, sizeof(ehdr), &n);
+        if (status != ZX_OK)
             return status;
         if (n != sizeof(ehdr))
             return ERR_ELF_BAD_FORMAT;
@@ -73,19 +73,19 @@
     header->e_phnum = ehdr.e_phnum;
     header->e_entry = ehdr.e_entry;
     *phoff = ehdr.e_phoff;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t elf_load_read_phdrs(mx_handle_t vmo, elf_phdr_t phdrs[],
+zx_status_t elf_load_read_phdrs(zx_handle_t vmo, elf_phdr_t phdrs[],
                                 uintptr_t phoff, size_t phnum) {
     size_t phdrs_size = (size_t)phnum * sizeof(elf_phdr_t);
     size_t n;
-    mx_status_t status = mx_vmo_read(vmo, phdrs, phoff, phdrs_size, &n);
-    if (status != MX_OK)
+    zx_status_t status = zx_vmo_read(vmo, phdrs, phoff, phdrs_size, &n);
+    if (status != ZX_OK)
         return status;
     if (n != phdrs_size)
         return ERR_ELF_BAD_FORMAT;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // An ET_DYN file can be loaded anywhere, so choose where.  This
@@ -95,10 +95,10 @@
 // addresses.  (Usually the lowest p_vaddr in an ET_DYN file will be 0
 // and so the load bias is also the load base address, but ELF does
 // not require that the lowest p_vaddr be 0.)
-static mx_status_t choose_load_bias(mx_handle_t root_vmar,
+static zx_status_t choose_load_bias(zx_handle_t root_vmar,
                                     const elf_load_header_t* header,
                                     const elf_phdr_t phdrs[],
-                                    mx_handle_t* vmar,
+                                    zx_handle_t* vmar,
                                     uintptr_t* vmar_base,
                                     uintptr_t* bias) {
     // This file can be loaded anywhere, so the first thing is to
@@ -125,33 +125,33 @@
 
     const size_t span = high - low;
     if (span == 0)
-        return MX_OK;
+        return ZX_OK;
 
     // Allocate a VMAR to reserve the whole address range.
-    mx_status_t status = mx_vmar_allocate(root_vmar, 0, span,
-                                          MX_VM_FLAG_CAN_MAP_READ |
-                                          MX_VM_FLAG_CAN_MAP_WRITE |
-                                          MX_VM_FLAG_CAN_MAP_EXECUTE |
-                                          MX_VM_FLAG_CAN_MAP_SPECIFIC,
+    zx_status_t status = zx_vmar_allocate(root_vmar, 0, span,
+                                          ZX_VM_FLAG_CAN_MAP_READ |
+                                          ZX_VM_FLAG_CAN_MAP_WRITE |
+                                          ZX_VM_FLAG_CAN_MAP_EXECUTE |
+                                          ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                           vmar, vmar_base);
-    if (status == MX_OK)
+    if (status == ZX_OK)
         *bias = *vmar_base - low;
     return status;
 }
 
-static mx_status_t finish_load_segment(
-    mx_handle_t vmar, mx_handle_t vmo, const char vmo_name[MX_MAX_NAME_LEN],
+static zx_status_t finish_load_segment(
+    zx_handle_t vmar, zx_handle_t vmo, const char vmo_name[ZX_MAX_NAME_LEN],
     const elf_phdr_t* ph, size_t start_offset, size_t size,
     uintptr_t file_start, uintptr_t file_end, size_t partial_page) {
-    const uint32_t flags = MX_VM_FLAG_SPECIFIC |
-        ((ph->p_flags & PF_R) ? MX_VM_FLAG_PERM_READ : 0) |
-        ((ph->p_flags & PF_W) ? MX_VM_FLAG_PERM_WRITE : 0) |
-        ((ph->p_flags & PF_X) ? MX_VM_FLAG_PERM_EXECUTE : 0);
+    const uint32_t flags = ZX_VM_FLAG_SPECIFIC |
+        ((ph->p_flags & PF_R) ? ZX_VM_FLAG_PERM_READ : 0) |
+        ((ph->p_flags & PF_W) ? ZX_VM_FLAG_PERM_WRITE : 0) |
+        ((ph->p_flags & PF_X) ? ZX_VM_FLAG_PERM_EXECUTE : 0);
 
     uintptr_t start;
     if (ph->p_filesz == ph->p_memsz)
         // Straightforward segment, map all the whole pages from the file.
-        return mx_vmar_map(vmar, start_offset, vmo, file_start, size, flags,
+        return zx_vmar_map(vmar, start_offset, vmo, file_start, size, flags,
                            &start);
 
     const size_t file_size = file_end - file_start;
@@ -159,9 +159,9 @@
     // This segment has some bss, so things are more complicated.
     // Only the leading portion is directly mapped in from the file.
     if (file_size > 0) {
-        mx_status_t status = mx_vmar_map(vmar, start_offset, vmo, file_start,
+        zx_status_t status = zx_vmar_map(vmar, start_offset, vmo, file_start,
                                          file_size, flags, &start);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
 
         start_offset += file_size;
@@ -169,18 +169,18 @@
     }
 
     // The rest of the segment will be backed by anonymous memory.
-    mx_handle_t bss_vmo;
-    mx_status_t status = mx_vmo_create(size, 0, &bss_vmo);
-    if (status != MX_OK)
+    zx_handle_t bss_vmo;
+    zx_status_t status = zx_vmo_create(size, 0, &bss_vmo);
+    if (status != ZX_OK)
         return status;
 
-    char bss_vmo_name[MX_MAX_NAME_LEN] = VMO_NAME_PREFIX_BSS;
+    char bss_vmo_name[ZX_MAX_NAME_LEN] = VMO_NAME_PREFIX_BSS;
     memcpy(&bss_vmo_name[sizeof(VMO_NAME_PREFIX_BSS) - 1],
-           vmo_name, MX_MAX_NAME_LEN - sizeof(VMO_NAME_PREFIX_BSS));
-    status = mx_object_set_property(bss_vmo, MX_PROP_NAME,
+           vmo_name, ZX_MAX_NAME_LEN - sizeof(VMO_NAME_PREFIX_BSS));
+    status = zx_object_set_property(bss_vmo, ZX_PROP_NAME,
                                     bss_vmo_name, strlen(bss_vmo_name));
-    if (status != MX_OK) {
-        mx_handle_close(bss_vmo);
+    if (status != ZX_OK) {
+        zx_handle_close(bss_vmo);
         return status;
     }
 
@@ -190,34 +190,34 @@
     if (partial_page > 0) {
         char buffer[PAGE_SIZE];
         size_t n;
-        status = mx_vmo_read(vmo, buffer, file_end, partial_page, &n);
-        if (status != MX_OK) {
-            mx_handle_close(bss_vmo);
+        status = zx_vmo_read(vmo, buffer, file_end, partial_page, &n);
+        if (status != ZX_OK) {
+            zx_handle_close(bss_vmo);
             return status;
         }
         if (n != partial_page) {
-            mx_handle_close(bss_vmo);
+            zx_handle_close(bss_vmo);
             return ERR_ELF_BAD_FORMAT;
         }
-        status = mx_vmo_write(bss_vmo, buffer, 0, n, &n);
-        if (status != MX_OK) {
-            mx_handle_close(bss_vmo);
+        status = zx_vmo_write(bss_vmo, buffer, 0, n, &n);
+        if (status != ZX_OK) {
+            zx_handle_close(bss_vmo);
             return status;
         }
         if (n != partial_page) {
-            mx_handle_close(bss_vmo);
-            return MX_ERR_IO;
+            zx_handle_close(bss_vmo);
+            return ZX_ERR_IO;
         }
     }
 
-    status = mx_vmar_map(vmar, start_offset, bss_vmo, 0, size, flags, &start);
-    mx_handle_close(bss_vmo);
+    status = zx_vmar_map(vmar, start_offset, bss_vmo, 0, size, flags, &start);
+    zx_handle_close(bss_vmo);
 
     return status;
 }
 
-static mx_status_t load_segment(mx_handle_t vmar, size_t vmar_offset,
-                                mx_handle_t vmo, const char* vmo_name,
+static zx_status_t load_segment(zx_handle_t vmar, size_t vmar_offset,
+                                zx_handle_t vmo, const char* vmo_name,
                                 const elf_phdr_t* ph) {
     // The p_vaddr can start in the middle of a page, but the
     // semantics are that all the whole pages containing the
@@ -230,7 +230,7 @@
 
     // Nothing to do for an empty segment (degenerate case).
     if (size == 0)
-        return MX_OK;
+        return ZX_OK;
 
     uintptr_t file_start = (uintptr_t)ph->p_offset;
     uintptr_t file_end = file_start + ph->p_filesz;
@@ -248,54 +248,54 @@
                                    file_start, file_end, partial_page);
 
     // For a writable segment, we need a writable VMO.
-    mx_handle_t writable_vmo;
-    mx_status_t status = mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE,
+    zx_handle_t writable_vmo;
+    zx_status_t status = zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE,
                                       file_start, data_size, &writable_vmo);
-    if (status == MX_OK) {
-        char name[MX_MAX_NAME_LEN] = VMO_NAME_PREFIX_DATA;
+    if (status == ZX_OK) {
+        char name[ZX_MAX_NAME_LEN] = VMO_NAME_PREFIX_DATA;
         memcpy(&name[sizeof(VMO_NAME_PREFIX_DATA) - 1],
-               vmo_name, MX_MAX_NAME_LEN - sizeof(VMO_NAME_PREFIX_DATA));
-        status = mx_object_set_property(writable_vmo, MX_PROP_NAME,
+               vmo_name, ZX_MAX_NAME_LEN - sizeof(VMO_NAME_PREFIX_DATA));
+        status = zx_object_set_property(writable_vmo, ZX_PROP_NAME,
                                         name, strlen(name));
-        if (status == MX_OK)
+        if (status == ZX_OK)
             status = finish_load_segment(
                 vmar, writable_vmo, vmo_name, ph, start, size,
                 0, file_end - file_start, partial_page);
-        mx_handle_close(writable_vmo);
+        zx_handle_close(writable_vmo);
     }
     return status;
 }
 
-mx_status_t elf_load_map_segments(mx_handle_t root_vmar,
+zx_status_t elf_load_map_segments(zx_handle_t root_vmar,
                                   const elf_load_header_t* header,
                                   const elf_phdr_t phdrs[],
-                                  mx_handle_t vmo,
-                                  mx_handle_t* segments_vmar,
-                                  mx_vaddr_t* base, mx_vaddr_t* entry) {
-    char vmo_name[MX_MAX_NAME_LEN];
-    if (mx_object_get_property(vmo, MX_PROP_NAME,
-                               vmo_name, sizeof(vmo_name)) != MX_OK ||
+                                  zx_handle_t vmo,
+                                  zx_handle_t* segments_vmar,
+                                  zx_vaddr_t* base, zx_vaddr_t* entry) {
+    char vmo_name[ZX_MAX_NAME_LEN];
+    if (zx_object_get_property(vmo, ZX_PROP_NAME,
+                               vmo_name, sizeof(vmo_name)) != ZX_OK ||
         vmo_name[0] == '\0')
         memcpy(vmo_name, VMO_NAME_UNKNOWN, sizeof(VMO_NAME_UNKNOWN));
 
     uintptr_t vmar_base = 0;
     uintptr_t bias = 0;
-    mx_handle_t vmar = MX_HANDLE_INVALID;
-    mx_status_t status = choose_load_bias(root_vmar, header, phdrs,
+    zx_handle_t vmar = ZX_HANDLE_INVALID;
+    zx_status_t status = choose_load_bias(root_vmar, header, phdrs,
                                           &vmar, &vmar_base, &bias);
 
     size_t vmar_offset = bias - vmar_base;
-    for (uint_fast16_t i = 0; status == MX_OK && i < header->e_phnum; ++i) {
+    for (uint_fast16_t i = 0; status == ZX_OK && i < header->e_phnum; ++i) {
         if (phdrs[i].p_type == PT_LOAD)
             status = load_segment(vmar, vmar_offset, vmo, vmo_name, &phdrs[i]);
     }
 
-    if (status == MX_OK && segments_vmar != NULL)
+    if (status == ZX_OK && segments_vmar != NULL)
         *segments_vmar = vmar;
     else
-        mx_handle_close(vmar);
+        zx_handle_close(vmar);
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         if (base != NULL)
             *base = vmar_base;
         if (entry != NULL)
diff --git a/system/ulib/elfload/include/elfload/elfload.h b/system/ulib/elfload/include/elfload/elfload.h
index dd1a126..0acb939 100644
--- a/system/ulib/elfload/include/elfload/elfload.h
+++ b/system/ulib/elfload/include/elfload/elfload.h
@@ -11,7 +11,7 @@
 #pragma once
 
 #include <elf.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
@@ -29,32 +29,32 @@
 #endif
 
 typedef struct {
-    mx_vaddr_t e_entry;
+    zx_vaddr_t e_entry;
     uint_fast16_t e_phnum;
 } elf_load_header_t;
 
 // These routines use this error code to indicate an invalid file format,
 // including wrong machine, wrong endian, etc. as well as a truncated file.
-#define ERR_ELF_BAD_FORMAT MX_ERR_NOT_FOUND
+#define ERR_ELF_BAD_FORMAT ZX_ERR_NOT_FOUND
 
 __BEGIN_CDECLS
 
 // Validate the ELF headers and fill in basic header information. 'hdr_buf'
 // represents bytes already read from the start of the file.
-mx_status_t elf_load_prepare(mx_handle_t vmo, const void* hdr_buf, size_t buf_sz,
+zx_status_t elf_load_prepare(zx_handle_t vmo, const void* hdr_buf, size_t buf_sz,
                              elf_load_header_t* header, uintptr_t* phoff);
 
 // Read the ELF program headers in.
-mx_status_t elf_load_read_phdrs(mx_handle_t vmo, elf_phdr_t* phdrs,
+zx_status_t elf_load_read_phdrs(zx_handle_t vmo, elf_phdr_t* phdrs,
                                 uintptr_t phoff, size_t phnum);
 
 // Load the image into the process.
-mx_status_t elf_load_map_segments(mx_handle_t vmar,
+zx_status_t elf_load_map_segments(zx_handle_t vmar,
                                   const elf_load_header_t* header,
                                   const elf_phdr_t* phdrs,
-                                  mx_handle_t vmo,
-                                  mx_handle_t* segments_vmar,
-                                  mx_vaddr_t* bias, mx_vaddr_t* entry);
+                                  zx_handle_t vmo,
+                                  zx_handle_t* segments_vmar,
+                                  zx_vaddr_t* bias, zx_vaddr_t* entry);
 
 // Locate the PT_INTERP program header and extract its bounds in the file.
 // Returns false if there was no PT_INTERP.
diff --git a/system/ulib/elfload/rules.mk b/system/ulib/elfload/rules.mk
index 721cb68..d5e21d7 100644
--- a/system/ulib/elfload/rules.mk
+++ b/system/ulib/elfload/rules.mk
@@ -10,9 +10,9 @@
 
 MODULE_SRCS := $(LOCAL_DIR)/elf-load.c
 
-# This library refers to Magenta system calls and so needs libmagenta
+# This library refers to Zircon system calls and so needs libzircon
 # headers.  But the library itself has no dependencies, so users must
-# ensure that the libmagenta entry points are available.
-MODULE_LIBS := system/ulib/magenta
+# ensure that the libzircon entry points are available.
+MODULE_LIBS := system/ulib/zircon
 
 include make/module.mk
diff --git a/system/ulib/explicit-memory/include/explicit-memory/bytes.h b/system/ulib/explicit-memory/include/explicit-memory/bytes.h
index 1d002fb..9a2e0e4 100644
--- a/system/ulib/explicit-memory/include/explicit-memory/bytes.h
+++ b/system/ulib/explicit-memory/include/explicit-memory/bytes.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/macros.h>
 #include <stddef.h>
 
diff --git a/system/ulib/fbl/BUILD.gn b/system/ulib/fbl/BUILD.gn
index 65b9887..503acd9 100644
--- a/system/ulib/fbl/BUILD.gn
+++ b/system/ulib/fbl/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 source_set("fbl") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "alloc_checker.cpp",
     "include/fbl/algorithm.h",
diff --git a/system/ulib/fbl/alloc_checker.cpp b/system/ulib/fbl/alloc_checker.cpp
index 056b46e..369720e 100644
--- a/system/ulib/fbl/alloc_checker.cpp
+++ b/system/ulib/fbl/alloc_checker.cpp
@@ -4,7 +4,7 @@
 
 #include <fbl/alloc_checker.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/new.h>
 
 namespace std {
@@ -22,7 +22,7 @@
 void panic_if_armed(unsigned state) {
 #if LK_DEBUGLEVEL > 1
     if (state & alloc_armed)
-        MX_PANIC("AllocChecker::check() needs to be called\n");
+        ZX_PANIC("AllocChecker::check() needs to be called\n");
 #endif
 }
 
@@ -61,7 +61,7 @@
 // via delete[], and only allocations done via the C malloc family
 // functions are freed via the C free function.  The non-throwing
 // operator new and operator new[] we call might be trivial ones like
-// mxcpp's that actually just call malloc, or they might be ones that
+// zxcpp's that actually just call malloc, or they might be ones that
 // enforce this invariant (such as the ASan allocator).
 
 } // namespace fbl
diff --git a/system/ulib/fbl/include/fbl/array.h b/system/ulib/fbl/include/fbl/array.h
index 237989d..3000ae8 100644
--- a/system/ulib/fbl/include/fbl/array.h
+++ b/system/ulib/fbl/include/fbl/array.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/macros.h>
 
 namespace fbl {
@@ -74,7 +74,7 @@
     }
 
     T& operator[](size_t i) const {
-        MX_DEBUG_ASSERT(i < count_);
+        ZX_DEBUG_ASSERT(i < count_);
         return ptr_[i];
     }
 
diff --git a/system/ulib/fbl/include/fbl/canary.h b/system/ulib/fbl/include/fbl/canary.h
index 87c1715..a1ddd77 100644
--- a/system/ulib/fbl/include/fbl/canary.h
+++ b/system/ulib/fbl/include/fbl/canary.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 namespace fbl {
 
@@ -61,7 +61,7 @@
     }
 
     void Assert() const {
-        MX_DEBUG_ASSERT_MSG(magic_ == magic,
+        ZX_DEBUG_ASSERT_MSG(magic_ == magic,
                             "Invalid canary (expt: %08x, got: %08x)\n",
                             static_cast<uint32_t>(magic), magic_);
     }
diff --git a/system/ulib/fbl/include/fbl/function.h b/system/ulib/fbl/include/fbl/function.h
index 3d70e3d..acfc58e 100644
--- a/system/ulib/fbl/include/fbl/function.h
+++ b/system/ulib/fbl/include/fbl/function.h
@@ -6,7 +6,7 @@
 
 #include <stddef.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/macros.h>
@@ -43,7 +43,7 @@
     bool is_null() const final { return true; }
 
     Result operator()(Args... args) const final {
-        MX_PANIC("Attempted to invoke fbl::Function with a null target.");
+        ZX_PANIC("Attempted to invoke fbl::Function with a null target.");
     }
 
     void MoveInitializeTo(void* ptr) final {
diff --git a/system/ulib/fbl/include/fbl/initializer_list.h b/system/ulib/fbl/include/fbl/initializer_list.h
index 60041c3..40917cc 100644
--- a/system/ulib/fbl/include/fbl/initializer_list.h
+++ b/system/ulib/fbl/include/fbl/initializer_list.h
@@ -6,19 +6,19 @@
 // Provides fbl::initializer_list<T>.
 // Unfortunately the C++ compiler hardcodes a dependency on std::initializer_list<T>.
 // We use the C++ standard library definition when available, otherwise we
-// use the one offered by the Magenta toolchain.
+// use the one offered by the Zircon toolchain.
 //
 
 #pragma once
 
-#ifdef MAGENTA_TOOLCHAIN
-// Use the implementation supplied by the Magenta toolchain when we are
+#ifdef ZIRCON_TOOLCHAIN
+// Use the implementation supplied by the Zircon toolchain when we are
 // compiling without the C++ standard library.
-#include <magenta/initializer_list.h>
+#include <zircon/initializer_list.h>
 #else
 // Use the implementation supplied by the C++ standard library.
 #include <initializer_list>
-#endif // MAGENTA_TOOLCHAIN
+#endif // ZIRCON_TOOLCHAIN
 
 // Expose std::initializer_list<T> as fbl::initializer_list<T>.
 namespace fbl {
diff --git a/system/ulib/fbl/include/fbl/intrusive_double_list.h b/system/ulib/fbl/include/fbl/intrusive_double_list.h
index a6a6c8a..55415fd 100644
--- a/system/ulib/fbl/include/fbl/intrusive_double_list.h
+++ b/system/ulib/fbl/include/fbl/intrusive_double_list.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/intrusive_pointer_traits.h>
 #include <fbl/macros.h>
 
@@ -112,7 +112,7 @@
     // an empty list of unmanaged pointers.  Like Rvalue construction, it will
     // result in the move of the source contents to the destination.
     DoublyLinkedList& operator=(DoublyLinkedList&& other_list) {
-        MX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
+        ZX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
 
         clear();
         swap(other_list);
@@ -124,7 +124,7 @@
         // It is considered an error to allow a list of unmanaged pointers to
         // destruct if there are still elements in it.  Managed pointer lists
         // will automatically release their references to their elements.
-        MX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
+        ZX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
         clear();
         PtrTraits::DetachSentinel(head_);
     }
@@ -148,20 +148,20 @@
     //
     // Return a reference to the element at the front of the list without
     // removing it.  It is an error to call front on an empty list.
-    typename PtrTraits::RefType      front()       { MX_DEBUG_ASSERT(!is_empty()); return *head_; }
-    typename PtrTraits::ConstRefType front() const { MX_DEBUG_ASSERT(!is_empty()); return *head_; }
+    typename PtrTraits::RefType      front()       { ZX_DEBUG_ASSERT(!is_empty()); return *head_; }
+    typename PtrTraits::ConstRefType front() const { ZX_DEBUG_ASSERT(!is_empty()); return *head_; }
 
     // back
     //
     // Return a reference to the element at the back of the list without
     // removing it.  It is an error to call back on an empty list.
     typename PtrTraits::RefType back() {
-        MX_DEBUG_ASSERT(!is_empty());
+        ZX_DEBUG_ASSERT(!is_empty());
         return *(NodeTraits::node_state(*head_).prev_);
     }
 
     typename PtrTraits::ConstRefType back() const {
-        MX_DEBUG_ASSERT(!is_empty());
+        ZX_DEBUG_ASSERT(!is_empty());
         return *(NodeTraits::node_state(*head_).prev_);
     }
 
@@ -187,15 +187,15 @@
     // splice : Splice another list before iter in this list.
     void splice(const iterator& iter, DoublyLinkedList& other_list)  {
         auto before = iter.node_;
-        MX_DEBUG_ASSERT(before != nullptr);
-        MX_DEBUG_ASSERT(head_  != nullptr);
+        ZX_DEBUG_ASSERT(before != nullptr);
+        ZX_DEBUG_ASSERT(head_  != nullptr);
 
         if (other_list.is_empty()) {
             return;
         }
         if (is_empty()) {
-            MX_DEBUG_ASSERT(before == sentinel());
-            MX_DEBUG_ASSERT(before == PtrTraits::GetRaw(head_));
+            ZX_DEBUG_ASSERT(before == sentinel());
+            ZX_DEBUG_ASSERT(before == PtrTraits::GetRaw(head_));
             swap(other_list);
             return;
         }
@@ -239,7 +239,7 @@
         insert_after(iter, PtrType(ptr));
     }
     void insert_after(const iterator& iter, PtrType&& ptr) {
-        MX_DEBUG_ASSERT(iter.IsValid());
+        ZX_DEBUG_ASSERT(iter.IsValid());
 
         auto& ns = NodeTraits::node_state(*iter.node_);
         internal_insert(PtrTraits::GetRaw(ns.next_), fbl::move(ptr));
@@ -270,7 +270,7 @@
 
         auto& ns = NodeTraits::node_state(*iter.node_);
         if (PtrTraits::IsSentinel(ns.next_)) {
-            MX_DEBUG_ASSERT(sentinel() == PtrTraits::GetRaw(ns.next_));
+            ZX_DEBUG_ASSERT(sentinel() == PtrTraits::GetRaw(ns.next_));
             return PtrType(nullptr);
         }
 
@@ -423,7 +423,7 @@
             if (IsValid()) {
                 auto& ns = NodeTraits::node_state(*node_);
                 node_ = PtrTraits::GetRaw(ns.next_);
-                MX_DEBUG_ASSERT(node_ != nullptr);
+                ZX_DEBUG_ASSERT(node_ != nullptr);
             }
 
             return *this;
@@ -437,7 +437,7 @@
                 } else {
                     auto& ns = NodeTraits::node_state(*node_);
                     node_ = ns.prev_;
-                    MX_DEBUG_ASSERT(node_ != nullptr);
+                    ZX_DEBUG_ASSERT(node_ != nullptr);
 
                     // If backing up would put us at a node whose next pointer
                     // is a sentinel, the we have looped around the start of the
@@ -471,12 +471,12 @@
         }
 
         typename IterTraits::RefType operator*() const {
-            MX_DEBUG_ASSERT(IsValid());
+            ZX_DEBUG_ASSERT(IsValid());
             return *node_;
         }
 
         typename IterTraits::RawPtrType operator->() const {
-            MX_DEBUG_ASSERT(IsValid());
+            ZX_DEBUG_ASSERT(IsValid());
             return node_;
         }
 
@@ -507,17 +507,17 @@
     }
 
     void internal_insert(RawPtrType before, PtrType&& ptr) {
-        MX_DEBUG_ASSERT(ptr    != nullptr);
-        MX_DEBUG_ASSERT(before != nullptr);
-        MX_DEBUG_ASSERT(head_  != nullptr);
+        ZX_DEBUG_ASSERT(ptr    != nullptr);
+        ZX_DEBUG_ASSERT(before != nullptr);
+        ZX_DEBUG_ASSERT(head_  != nullptr);
 
         auto& ptr_ns = NodeTraits::node_state(*ptr);
-        MX_DEBUG_ASSERT((ptr_ns.prev_ == nullptr) && (ptr_ns.next_ == nullptr));
+        ZX_DEBUG_ASSERT((ptr_ns.prev_ == nullptr) && (ptr_ns.next_ == nullptr));
 
         // Handle the (slightly) special case of an empty list.
         if (is_empty()) {
-            MX_DEBUG_ASSERT(before == sentinel());
-            MX_DEBUG_ASSERT(before == PtrTraits::GetRaw(head_));
+            ZX_DEBUG_ASSERT(before == sentinel());
+            ZX_DEBUG_ASSERT(before == PtrTraits::GetRaw(head_));
 
             ptr_ns.prev_ = PtrTraits::GetRaw(ptr);
             ptr_ns.next_ = fbl::move(head_);
@@ -555,7 +555,7 @@
             return PtrType(nullptr);
 
         auto& node_ns = NodeTraits::node_state(*node);
-        MX_DEBUG_ASSERT((node_ns.prev_ != nullptr) && (node_ns.next_ != nullptr));
+        ZX_DEBUG_ASSERT((node_ns.prev_ != nullptr) && (node_ns.next_ != nullptr));
 
         // Find the prev pointer we need to update.  If we are removing the tail
         // of the list, the prev pointer is head_'s prev pointer.  Otherwise, it
@@ -579,19 +579,19 @@
     }
 
     PtrType internal_swap(typename PtrTraits::RefType node, PtrType&& ptr) {
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(ptr != nullptr);
         auto& ptr_ns = NodeTraits::node_state(*ptr);
-        MX_DEBUG_ASSERT(!ptr_ns.InContainer());
+        ZX_DEBUG_ASSERT(!ptr_ns.InContainer());
 
         auto& node_ns = NodeTraits::node_state(node);
-        MX_DEBUG_ASSERT(node_ns.InContainer());
+        ZX_DEBUG_ASSERT(node_ns.InContainer());
 
         // Handle the case of there being only a single node in the list.
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(head_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(head_));
         if (PtrTraits::IsSentinel(NodeTraits::node_state(*head_).next_)) {
-            MX_DEBUG_ASSERT(PtrTraits::GetRaw(head_) == &node);
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(node_ns.next_));
-            MX_DEBUG_ASSERT(&node == node_ns.prev_);
+            ZX_DEBUG_ASSERT(PtrTraits::GetRaw(head_) == &node);
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(node_ns.next_));
+            ZX_DEBUG_ASSERT(&node == node_ns.prev_);
 
             ptr_ns.prev_  = PtrTraits::GetRaw(ptr);
             node_ns.prev_ = nullptr;
@@ -624,7 +624,7 @@
     }
 
     RawPtrType tail() const {
-        MX_DEBUG_ASSERT(head_ != nullptr);
+        ZX_DEBUG_ASSERT(head_ != nullptr);
         if (PtrTraits::IsSentinel(head_))
             return PtrTraits::GetRaw(head_);
         return NodeTraits::node_state(*head_).prev_;
diff --git a/system/ulib/fbl/include/fbl/intrusive_hash_table.h b/system/ulib/fbl/include/fbl/intrusive_hash_table.h
index 6c54e84..d4bd6c4 100644
--- a/system/ulib/fbl/include/fbl/intrusive_hash_table.h
+++ b/system/ulib/fbl/include/fbl/intrusive_hash_table.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/intrusive_container_utils.h>
 #include <fbl/intrusive_pointer_traits.h>
 #include <fbl/intrusive_single_list.h>
@@ -113,7 +113,7 @@
     static_assert(is_unsigned_integer<HashType>::value, "HashTypes must be unsigned integers");
 
     constexpr HashTable() {}
-    ~HashTable() { MX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty()); }
+    ~HashTable() { ZX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty()); }
 
     // Standard begin/end, cbegin/cend iterator accessors.
     iterator begin()              { return       iterator(this,       iterator::BEGIN); }
@@ -132,7 +132,7 @@
 
     void insert(const PtrType& ptr) { insert(PtrType(ptr)); }
     void insert(PtrType&& ptr) {
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(ptr != nullptr);
         KeyType key = KeyTraits::GetKey(*ptr);
         BucketType& bucket = GetBucket(key);
 
@@ -140,7 +140,7 @@
         // insert an element with a duplicate key.  If the user thought that
         // there might be a duplicate key in the HashTable already, he/she
         // should have used insert_or_find() instead.
-        MX_DEBUG_ASSERT(FindInBucket(bucket, key).IsValid() == false);
+        ZX_DEBUG_ASSERT(FindInBucket(bucket, key).IsValid() == false);
 
         bucket.push_front(fbl::move(ptr));
         ++count_;
@@ -163,7 +163,7 @@
     }
 
     bool insert_or_find(PtrType&& ptr, iterator* iter = nullptr) {
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(ptr != nullptr);
         KeyType  key         = KeyTraits::GetKey(*ptr);
         HashType ndx         = GetHash(key);
         auto&    bucket      = buckets_[ndx];
@@ -192,7 +192,7 @@
     }
 
     PtrType insert_or_replace(PtrType&& ptr) {
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(ptr != nullptr);
         KeyType  key    = KeyTraits::GetKey(*ptr);
         HashType ndx    = GetHash(key);
         auto&    bucket = buckets_[ndx];
@@ -374,7 +374,7 @@
         // Prefix
         iterator_impl& operator++() {
             if (!IsValid()) return *this;
-            MX_DEBUG_ASSERT(hash_table_);
+            ZX_DEBUG_ASSERT(hash_table_);
 
             // Bump the bucket iterator and go looking for a new bucket if the
             // iterator has become invalid.
@@ -388,7 +388,7 @@
             // If we have never been bound to a HashTable instance, the we had
             // better be invalid.
             if (!hash_table_) {
-                MX_DEBUG_ASSERT(!IsValid());
+                ZX_DEBUG_ASSERT(!IsValid());
                 return *this;
             }
 
@@ -404,7 +404,7 @@
                 auto& bucket = GetBucket(bucket_ndx_);
                 if (!bucket.is_empty()) {
                     iter_ = --IterTraits::BucketEnd(bucket);
-                    MX_DEBUG_ASSERT(iter_.IsValid());
+                    ZX_DEBUG_ASSERT(iter_.IsValid());
                     return *this;
                 }
             }
@@ -472,7 +472,7 @@
 
                     if (!bucket.is_empty()) {
                         iter_ = IterTraits::BucketBegin(bucket);
-                        MX_DEBUG_ASSERT(iter_.IsValid());
+                        ZX_DEBUG_ASSERT(iter_.IsValid());
                         break;
                     } else if (bucket_ndx_ == (kNumBuckets - 1)) {
                         iter_ = IterTraits::BucketEnd(bucket);
@@ -526,7 +526,7 @@
 
     static HashType GetHash(const KeyType& obj) {
         HashType ret = HashTraits::GetHash(obj);
-        MX_DEBUG_ASSERT((ret >= 0) && (ret < kNumBuckets));
+        ZX_DEBUG_ASSERT((ret >= 0) && (ret < kNumBuckets));
         return ret;
     }
 
diff --git a/system/ulib/fbl/include/fbl/intrusive_pointer_traits.h b/system/ulib/fbl/include/fbl/intrusive_pointer_traits.h
index 3de5bcf..56f2a69 100644
--- a/system/ulib/fbl/include/fbl/intrusive_pointer_traits.h
+++ b/system/ulib/fbl/include/fbl/intrusive_pointer_traits.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <stdint.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/ref_ptr.h>
 #include <fbl/unique_ptr.h>
 #include <fbl/type_support.h>
@@ -78,7 +78,7 @@
     }
 
     static inline void DetachSentinel(PtrType& ptr) {
-        MX_DEBUG_ASSERT((ptr == nullptr) || IsSentinel(ptr));
+        ZX_DEBUG_ASSERT((ptr == nullptr) || IsSentinel(ptr));
         ptr = nullptr;
     }
 
@@ -115,7 +115,7 @@
 
     static inline void DetachSentinel(PtrType& ptr) {
         __UNUSED RawPtrType detached = ptr.release();
-        MX_DEBUG_ASSERT((detached == nullptr) || IsSentinel(detached));
+        ZX_DEBUG_ASSERT((detached == nullptr) || IsSentinel(detached));
     }
 
     static constexpr bool IsSentinel(const PtrType& ptr) { return IsSentinel(ptr.get()); }
@@ -154,7 +154,7 @@
 
     static inline void DetachSentinel(PtrType& ptr) {
         __UNUSED RawPtrType detached = ptr.leak_ref();
-        MX_DEBUG_ASSERT((detached == nullptr) || IsSentinel(detached));
+        ZX_DEBUG_ASSERT((detached == nullptr) || IsSentinel(detached));
     }
 
     static constexpr bool IsSentinel(const PtrType& ptr) { return IsSentinel(ptr.get()); }
diff --git a/system/ulib/fbl/include/fbl/intrusive_single_list.h b/system/ulib/fbl/include/fbl/intrusive_single_list.h
index e7da00b..98f198c 100644
--- a/system/ulib/fbl/include/fbl/intrusive_single_list.h
+++ b/system/ulib/fbl/include/fbl/intrusive_single_list.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/intrusive_pointer_traits.h>
 #include <fbl/macros.h>
 
@@ -32,7 +32,7 @@
 //
 // Lists of unmanaged pointer types perform no lifecycle management.  It is up to
 // the user of the list class to make sure that lifecycles are managed properly.
-// As an added safety, a list of unmanaged pointers will MX_ASSERT if it is
+// As an added safety, a list of unmanaged pointers will ZX_ASSERT if it is
 // destroyed with elements still in it.
 //
 // Objects may exist in multiple lists (or other containers) through the use of
@@ -241,7 +241,7 @@
     // an empty list of unmanaged pointers.  Like Rvalue construction, it will
     // result in the move of the source contents to the destination.
     SinglyLinkedList& operator=(SinglyLinkedList&& other_list) {
-        MX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
+        ZX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
 
         clear();
         swap(other_list);
@@ -253,7 +253,7 @@
         // It is considered an error to allow a list of unmanaged pointers to
         // destruct of there are still elements in it.  Managed pointer lists
         // will automatically release their references to their elements.
-        MX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
+        ZX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
         clear();
         PtrTraits::DetachSentinel(head_);
     }
@@ -273,14 +273,14 @@
     // is_empty
     //
     // True if the list has at least one element in it, false otherwise.
-    bool is_empty() const { MX_DEBUG_ASSERT(head_ != nullptr); return PtrTraits::IsSentinel(head_); }
+    bool is_empty() const { ZX_DEBUG_ASSERT(head_ != nullptr); return PtrTraits::IsSentinel(head_); }
 
     // front
     //
     // Return a reference to the element at the front of the list without
     // removing it.  It is an error to call front on an empty list.
-    typename PtrTraits::RefType      front()       { MX_DEBUG_ASSERT(!is_empty()); return *head_; }
-    typename PtrTraits::ConstRefType front() const { MX_DEBUG_ASSERT(!is_empty()); return *head_; }
+    typename PtrTraits::RefType      front()       { ZX_DEBUG_ASSERT(!is_empty()); return *head_; }
+    typename PtrTraits::ConstRefType front() const { ZX_DEBUG_ASSERT(!is_empty()); return *head_; }
 
     // push_front
     //
@@ -289,10 +289,10 @@
     // is an error to attempt to push a nullptr instance of PtrType.
     void push_front(const PtrType& ptr) { push_front(PtrType(ptr)); }
     void push_front(PtrType&& ptr) {
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(ptr != nullptr);
 
         auto& ptr_ns = NodeTraits::node_state(*ptr);
-        MX_DEBUG_ASSERT(!ptr_ns.InContainer());
+        ZX_DEBUG_ASSERT(!ptr_ns.InContainer());
 
         ptr_ns.next_ = fbl::move(head_);
         head_        = fbl::move(ptr);
@@ -307,12 +307,12 @@
         insert_after(iter, PtrType(ptr));
     }
     void insert_after(const iterator& iter, PtrType&& ptr) {
-        MX_DEBUG_ASSERT(iter.IsValid());
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(iter.IsValid());
+        ZX_DEBUG_ASSERT(ptr != nullptr);
 
         auto& iter_ns = NodeTraits::node_state(*iter.node_);
         auto& ptr_ns  = NodeTraits::node_state(*ptr);
-        MX_DEBUG_ASSERT(!ptr_ns.InContainer());
+        ZX_DEBUG_ASSERT(!ptr_ns.InContainer());
 
         PtrTraits::Swap(iter_ns.next_, ptr_ns.next_);
         iter_ns.next_ = fbl::move(ptr);
@@ -370,7 +370,7 @@
     // instance of PtrType.  It is an error to attempt to
     // erase_next(end())
     PtrType erase_next(const iterator& iter) {
-        MX_DEBUG_ASSERT(iter != end());
+        ZX_DEBUG_ASSERT(iter != end());
         auto& iter_ns = NodeTraits::node_state(*iter);
 
         if (iter_ns.next_ == nullptr)
@@ -455,10 +455,10 @@
     template <typename UnaryFn>
     PtrType replace_if(UnaryFn fn, const PtrType& ptr) {
         using ConstRefType  = typename PtrTraits::ConstRefType;
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(ptr != nullptr);
 
         auto& ptr_ns = NodeTraits::node_state(*ptr);
-        MX_DEBUG_ASSERT(!ptr_ns.InContainer());
+        ZX_DEBUG_ASSERT(!ptr_ns.InContainer());
 
         auto iter = begin();
         if (iter.IsValid()) {
@@ -489,10 +489,10 @@
     template <typename UnaryFn>
     PtrType replace_if(UnaryFn fn, PtrType&& ptr) {
         using ConstRefType  = typename PtrTraits::ConstRefType;
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(ptr != nullptr);
 
         auto& ptr_ns = NodeTraits::node_state(*ptr);
-        MX_DEBUG_ASSERT(!ptr_ns.InContainer());
+        ZX_DEBUG_ASSERT(!ptr_ns.InContainer());
 
         auto iter = begin();
         if (iter.IsValid()) {
@@ -566,12 +566,12 @@
         }
 
         typename IterTraits::RefType operator*() const {
-            MX_DEBUG_ASSERT(IsValid());
+            ZX_DEBUG_ASSERT(IsValid());
             return *node_;
         }
 
         typename IterTraits::RawPtrType operator->() const {
-            MX_DEBUG_ASSERT(IsValid());
+            ZX_DEBUG_ASSERT(IsValid());
             return node_;
         }
 
diff --git a/system/ulib/fbl/include/fbl/intrusive_wavl_tree.h b/system/ulib/fbl/include/fbl/intrusive_wavl_tree.h
index 6a32992..708f43f 100644
--- a/system/ulib/fbl/include/fbl/intrusive_wavl_tree.h
+++ b/system/ulib/fbl/include/fbl/intrusive_wavl_tree.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/intrusive_container_utils.h>
 #include <fbl/intrusive_pointer_traits.h>
 #include <fbl/intrusive_wavl_tree_internal.h>
@@ -155,7 +155,7 @@
     // an empty tree of unmanaged pointers.  Like Rvalue construction, it will
     // result in the move of the source contents to the destination.
     WAVLTree& operator=(WAVLTree&& other_tree) {
-        MX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
+        ZX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
 
         clear();
         swap(other_tree);
@@ -167,7 +167,7 @@
         // It is considered an error to allow a tree of unmanaged pointers to
         // destruct of there are still elements in it.  Managed pointer trees
         // will automatically release their references to their elements.
-        MX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
+        ZX_DEBUG_ASSERT(PtrTraits::IsManaged || is_empty());
         clear();
     }
 
@@ -191,12 +191,12 @@
     // Return a reference to the element at the front of the list without
     // removing it.  It is an error to call front on an empty list.
     typename PtrTraits::RefType front() {
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(left_most_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(left_most_));
         return *left_most_;
     }
 
     typename PtrTraits::ConstRefType front() const {
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(left_most_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(left_most_));
         return *left_most_;
     }
 
@@ -205,12 +205,12 @@
     // Return a reference to the element at the back of the list without
     // removing it.  It is an error to call back on an empty list.
     typename PtrTraits::RefType back() {
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(right_most_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(right_most_));
         return *right_most_;
     }
 
     typename PtrTraits::ConstRefType back() const {
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(right_most_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(right_most_));
         return *right_most_;
     }
 
@@ -258,8 +258,8 @@
     }
 
     PtrType insert_or_replace(PtrType&& ptr) {
-        MX_DEBUG_ASSERT(ptr != nullptr);
-        MX_DEBUG_ASSERT(! NodeTraits::node_state(*ptr).InContainer());
+        ZX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(! NodeTraits::node_state(*ptr).InContainer());
 
         RawPtrType collision = nullptr;
         internal_insert(ptr, &collision);
@@ -267,7 +267,7 @@
         // If there was a collision, swap our node with the node we collided
         // with.
         if (collision) {
-            MX_DEBUG_ASSERT(ptr != nullptr);
+            ZX_DEBUG_ASSERT(ptr != nullptr);
             return internal_swap(collision, fbl::move(ptr));
         }
 
@@ -369,9 +369,9 @@
         if (is_empty())
             return;
 
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(root_));
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(left_most_));
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(right_most_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(root_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(left_most_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(right_most_));
 
         // Detach the left and right sentinels right now so that we don't have
         // to worry about them while cleaning up the tree.
@@ -386,7 +386,7 @@
 
             if ((ns.left_ == nullptr) && (ns.right_ == nullptr)) {
                 // Leaf node.  Trim it.
-                MX_DEBUG_ASSERT(ns.parent_ == owner);
+                ZX_DEBUG_ASSERT(ns.parent_ == owner);
                 ns.parent_ = nullptr;
                 *link_ptr  = nullptr;
 
@@ -401,15 +401,15 @@
             } else {
                 // Non-leaf node, descend.  We have already detached the left
                 // and right sentinels, so we shouldn't be seeing any here.
-                MX_DEBUG_ASSERT(!PtrTraits::IsSentinel(ns.left_));
-                MX_DEBUG_ASSERT(!PtrTraits::IsSentinel(ns.right_));
+                ZX_DEBUG_ASSERT(!PtrTraits::IsSentinel(ns.left_));
+                ZX_DEBUG_ASSERT(!PtrTraits::IsSentinel(ns.right_));
 
                 owner    = PtrTraits::GetRaw(*link_ptr);
                 link_ptr = (ns.left_ != nullptr) ? &ns.left_ : &ns.right_;
             }
         }
 
-        MX_DEBUG_ASSERT(root_ == nullptr);
+        ZX_DEBUG_ASSERT(root_ == nullptr);
         left_most_  = sentinel();
         right_most_ = sentinel();
         count_ = 0;
@@ -603,8 +603,8 @@
             return IsValid() ? PtrTraits::Copy(node_) : nullptr;
         }
 
-        typename IterTraits::RefType operator*()     const { MX_DEBUG_ASSERT(node_); return *node_; }
-        typename IterTraits::RawPtrType operator->() const { MX_DEBUG_ASSERT(node_); return node_; }
+        typename IterTraits::RefType operator*()     const { ZX_DEBUG_ASSERT(node_); return *node_; }
+        typename IterTraits::RawPtrType operator->() const { ZX_DEBUG_ASSERT(node_); return node_; }
 
     private:
         friend ContainerType;
@@ -618,7 +618,7 @@
 
         template <typename LRTraits>
         void advance() {
-            MX_DEBUG_ASSERT(PtrTraits::IsValid(node_));
+            ZX_DEBUG_ASSERT(PtrTraits::IsValid(node_));
 
             // Find the next node in the ordered sequecnce.
             // key.  This will be either...
@@ -638,7 +638,7 @@
                 // While we can go LR, do so.
                 auto lr_child = LRTraits::LRRawChild(NodeTraits::node_state(*node_));
                 while (lr_child != nullptr) {
-                    MX_DEBUG_ASSERT(!PtrTraits::IsSentinel(lr_child));
+                    ZX_DEBUG_ASSERT(!PtrTraits::IsSentinel(lr_child));
                     node_    = lr_child;
                     lr_child = LRTraits::LRRawChild(NodeTraits::node_state(*node_));
                 }
@@ -649,12 +649,12 @@
                 bool done;
                 auto ns = &NodeTraits::node_state(*node_);
                 do {
-                    MX_DEBUG_ASSERT(PtrTraits::IsValid(ns->parent_));
+                    ZX_DEBUG_ASSERT(PtrTraits::IsValid(ns->parent_));
 
                     auto parent_ns = &NodeTraits::node_state(*ns->parent_);
                     done = (LRTraits::LRRawChild(*parent_ns) == node_);
 
-                    MX_DEBUG_ASSERT(done || (LRTraits::RLRawChild(*parent_ns) == node_));
+                    ZX_DEBUG_ASSERT(done || (LRTraits::RLRawChild(*parent_ns) == node_));
 
                     node_ = ns->parent_;
                     ns    = parent_ns;
@@ -672,10 +672,10 @@
     DISALLOW_COPY_AND_ASSIGN_ALLOW_MOVE(WAVLTree);
 
     void internal_insert(PtrType& ptr, RawPtrType* collision = nullptr) {
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(ptr != nullptr);
 
         auto& ns = NodeTraits::node_state(*ptr);
-        MX_DEBUG_ASSERT(ns.IsValid() && !ns.InContainer());
+        ZX_DEBUG_ASSERT(ns.IsValid() && !ns.InContainer());
 
         // The rank of an inserted node always starts at 0.
         ns.rank_ = 0;
@@ -686,7 +686,7 @@
             ns.left_   = PtrTraits::MakeSentinel(this);
             ns.right_  = PtrTraits::MakeSentinel(this);
 
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(left_most_) && PtrTraits::IsSentinel(right_most_));
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(left_most_) && PtrTraits::IsSentinel(right_most_));
             left_most_  = PtrTraits::GetRaw(ptr);
             right_most_ = PtrTraits::GetRaw(ptr);
 
@@ -715,10 +715,10 @@
             // knows which object he/she collided with.  Either way, do not
             // actually insert the object.
             if (KeyTraits::EqualTo(key, parent_key)) {
-                MX_DEBUG_ASSERT(collision);
+                ZX_DEBUG_ASSERT(collision);
 
                 if (collision) {
-                    MX_DEBUG_ASSERT(*collision == nullptr);
+                    ZX_DEBUG_ASSERT(*collision == nullptr);
                     *collision = parent;
                 }
 
@@ -751,19 +751,19 @@
 
         // We know that we are not the root of the tree, therefore we cannot be
         // both left and right-most.
-        MX_DEBUG_ASSERT(!is_left_most || !is_right_most);
+        ZX_DEBUG_ASSERT(!is_left_most || !is_right_most);
 
         if (is_right_most) {
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(*owner));
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(*owner));
             ns.right_   = PtrTraits::Take(*owner);
             right_most_ = PtrTraits::GetRaw(ptr);
         } else if (is_left_most) {
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(*owner));
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(*owner));
             ns.left_   = PtrTraits::Take(*owner);
             left_most_ = PtrTraits::GetRaw(ptr);
         }
 
-        MX_DEBUG_ASSERT(*owner == nullptr);
+        ZX_DEBUG_ASSERT(*owner == nullptr);
         ns.parent_ = parent;
         *owner = fbl::move(ptr);
 
@@ -783,7 +783,7 @@
 
         // If the target node is the root of the tree, then its parent will be
         // sentinel value and the owning pointer will be the root pointer.
-        MX_DEBUG_ASSERT(ns.parent_ != nullptr);
+        ZX_DEBUG_ASSERT(ns.parent_ != nullptr);
         if (PtrTraits::IsSentinel(ns.parent_)) {
             owner = &root_;
         } else {
@@ -796,7 +796,7 @@
                   : &parent_ns.right_;
 
         }
-        MX_DEBUG_ASSERT(PtrTraits::GetRaw(*owner) == ptr);
+        ZX_DEBUG_ASSERT(PtrTraits::GetRaw(*owner) == ptr);
 
         // If the node we want to remove has two children, swap it with the
         // left-most node of the right-hand sub-tree before proceeding.  This
@@ -806,13 +806,13 @@
             auto       new_ns    = &NodeTraits::node_state(*ns.right_);
 
             while (new_ns->left_ != nullptr) {
-                MX_DEBUG_ASSERT(!PtrTraits::IsSentinel(new_ns->left_));
+                ZX_DEBUG_ASSERT(!PtrTraits::IsSentinel(new_ns->left_));
                 new_owner = &new_ns->left_;
                 new_ns = &NodeTraits::node_state(*new_ns->left_);
             }
 
             owner = SwapWithRightDescendant(*owner, *new_owner);
-            MX_DEBUG_ASSERT(PtrTraits::GetRaw(*owner) == ptr);
+            ZX_DEBUG_ASSERT(PtrTraits::GetRaw(*owner) == ptr);
         }
 
         // Now that we know our relationship with our parent, go ahead and start
@@ -823,7 +823,7 @@
         RawPtrType parent = ns.parent_;
         bool was_one_child, was_left_child;
 
-        MX_DEBUG_ASSERT(parent != nullptr);
+        ZX_DEBUG_ASSERT(parent != nullptr);
         if (!PtrTraits::IsSentinel(parent)) {
             auto& parent_ns = NodeTraits::node_state(*parent);
 
@@ -872,27 +872,27 @@
         else {
             // The target's LR-child is the sentinel if and only if the target
             // is the LR-most node in the tree.
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(ns.left_)  == (left_most_  == target));
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(ns.right_) == (right_most_ == target));
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(ns.left_)  == (left_most_  == target));
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(ns.right_) == (right_most_ == target));
 
             if (PtrTraits::IsSentinel(ns.left_)) {
                 if (PtrTraits::IsSentinel(ns.right_)) {
                     // Target is both left and right most.
-                    MX_DEBUG_ASSERT(count_ == 1);
-                    MX_DEBUG_ASSERT(PtrTraits::IsSentinel(ns.parent_));
+                    ZX_DEBUG_ASSERT(count_ == 1);
+                    ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(ns.parent_));
                     left_most_  = sentinel();
                     right_most_ = sentinel();
                     PtrTraits::DetachSentinel(ns.left_);
                     PtrTraits::DetachSentinel(ns.right_);
                 } else {
                     // Target is just left most.
-                    MX_DEBUG_ASSERT(PtrTraits::IsValid(ns.parent_));
+                    ZX_DEBUG_ASSERT(PtrTraits::IsValid(ns.parent_));
                     left_most_ = ns.parent_;
                     *owner = PtrTraits::Take(ns.left_);
                 }
             } else if (PtrTraits::IsSentinel(ns.right_)) {
                     // Target is just right most.
-                    MX_DEBUG_ASSERT(PtrTraits::IsValid(ns.parent_));
+                    ZX_DEBUG_ASSERT(PtrTraits::IsValid(ns.parent_));
                     right_most_ = ns.parent_;
                     *owner = PtrTraits::Take(ns.right_);
             }
@@ -904,7 +904,7 @@
         // At this point in time, the target node should have been completely
         // removed from the tree.  Its internal state should be valid, and
         // indicate that it is not in the container.
-        MX_DEBUG_ASSERT(ns.IsValid() && !ns.InContainer());
+        ZX_DEBUG_ASSERT(ns.IsValid() && !ns.InContainer());
 
         // Update the count bookkeeping.
         --count_;
@@ -940,17 +940,17 @@
     // old_node and new_node *must* have the same key.
     //
     PtrType internal_swap(RawPtrType old_node, PtrType&& new_node) {
-        MX_DEBUG_ASSERT(old_node != nullptr);
-        MX_DEBUG_ASSERT(new_node != nullptr);
-        MX_DEBUG_ASSERT(KeyTraits::EqualTo(KeyTraits::GetKey(*old_node),
+        ZX_DEBUG_ASSERT(old_node != nullptr);
+        ZX_DEBUG_ASSERT(new_node != nullptr);
+        ZX_DEBUG_ASSERT(KeyTraits::EqualTo(KeyTraits::GetKey(*old_node),
                                            KeyTraits::GetKey(*new_node)));
 
         auto& old_ns  = NodeTraits::node_state(*old_node);
         auto& new_ns  = NodeTraits::node_state(*new_node);
         auto  new_raw = PtrTraits::GetRaw(new_node);
 
-        MX_DEBUG_ASSERT(old_ns.InContainer());
-        MX_DEBUG_ASSERT(!new_ns.InContainer());
+        ZX_DEBUG_ASSERT(old_ns.InContainer());
+        ZX_DEBUG_ASSERT(!new_ns.InContainer());
 
         // Start with the left child state.
         if (PtrTraits::IsValid(old_ns.left_)) {
@@ -960,7 +960,7 @@
             // We have no left child, so there is no left-child parent pointer
             // to fixup, but we may need to fix the left-most bookkeeping.
             if (PtrTraits::IsSentinel(old_ns.left_)) {
-                MX_DEBUG_ASSERT(left_most_ == old_node);
+                ZX_DEBUG_ASSERT(left_most_ == old_node);
                 left_most_ = new_raw;
             }
         }
@@ -974,7 +974,7 @@
             // We have no right child, so there is no right-child parent pointer
             // to fixup, but we may need to fix the right-most bookkeeping.
             if (PtrTraits::IsSentinel(old_ns.right_)) {
-                MX_DEBUG_ASSERT(right_most_ == old_node);
+                ZX_DEBUG_ASSERT(right_most_ == old_node);
                 right_most_ = new_raw;
             }
         }
@@ -1071,7 +1071,7 @@
 
         // node 2 is a right-hand descendant of node 1, so node 1's right hand
         // pointer must be valid.
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(ns1.right_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(ns1.right_));
         auto ns1_rp = &NodeTraits::node_state(*ns1.right_).parent_;
 
         // Start by updating the LR-most bookkeeping.  Node 1 cannot be the
@@ -1132,8 +1132,8 @@
             *ns1_rp = node2;
             return &ptr_ref2;
         } else {
-            MX_DEBUG_ASSERT(ns1.parent_ == node1);
-            MX_DEBUG_ASSERT(PtrTraits::GetRaw(ns2.right_) == node2);
+            ZX_DEBUG_ASSERT(ns1.parent_ == node1);
+            ZX_DEBUG_ASSERT(PtrTraits::GetRaw(ns2.right_) == node2);
             PtrTraits::Swap(ptr_ref1, ns2.right_);
             ns1.parent_ = node2;
             return &ns2.right_;
@@ -1157,14 +1157,14 @@
     //
     template <typename LRTraits>
     void PromoteLRChild(PtrType& owner, RawPtrType node) {
-        MX_DEBUG_ASSERT(owner == nullptr);
-        MX_DEBUG_ASSERT(node != nullptr);
+        ZX_DEBUG_ASSERT(owner == nullptr);
+        ZX_DEBUG_ASSERT(node != nullptr);
 
         auto& ns = NodeTraits::node_state(*node);
         PtrType& lr_child = LRTraits::LRChild(ns);
         PtrType& rl_child = LRTraits::RLChild(ns);
 
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(lr_child) && !PtrTraits::IsValid(rl_child));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(lr_child) && !PtrTraits::IsValid(rl_child));
 
         // Promote by transferring the LR-Child pointer to the owner pointer and
         // fixing up the LR-Child's parent pointer be the current parent of the
@@ -1175,7 +1175,7 @@
         // The removed node is the RL-most node if (and only if) its RL-child
         // was the sentinel value.
         RawPtrType& rl_most = LRTraits::RLMost(*this);
-        MX_DEBUG_ASSERT((rl_most == node) == (PtrTraits::IsSentinel(rl_child)));
+        ZX_DEBUG_ASSERT((rl_most == node) == (PtrTraits::IsSentinel(rl_child)));
         if (PtrTraits::IsSentinel(rl_child)) {
             // The target node was the RL-most.  Find the new RL-most node. It will
             // be the RL-most node in the LR-subtree of the target node.  Once
@@ -1188,7 +1188,7 @@
                 auto& replacement_ns = NodeTraits::node_state(*replacement);
                 next_rl_child = &LRTraits::RLChild(replacement_ns);
 
-                MX_DEBUG_ASSERT(!PtrTraits::IsSentinel(*next_rl_child));
+                ZX_DEBUG_ASSERT(!PtrTraits::IsSentinel(*next_rl_child));
                 if (*next_rl_child == nullptr)
                     break;
 
@@ -1205,8 +1205,8 @@
         // The left and right children of the target node should already be
         // nullptr by now.
         ns.parent_ = nullptr;
-        MX_DEBUG_ASSERT(ns.left_  == nullptr);
-        MX_DEBUG_ASSERT(ns.right_ == nullptr);
+        ZX_DEBUG_ASSERT(ns.left_  == nullptr);
+        ZX_DEBUG_ASSERT(ns.right_ == nullptr);
     }
 
     // After we have swapped contents with another tree, we need to fix up the
@@ -1214,16 +1214,16 @@
     // A's sentinels will point at tree B's, and vice-versa.
     void FixSentinelsAfterSwap() {
         if (root_) {
-            MX_DEBUG_ASSERT(!PtrTraits::IsSentinel(root_));
-            MX_DEBUG_ASSERT(left_most_ &&  !PtrTraits::IsSentinel(left_most_));
-            MX_DEBUG_ASSERT(right_most_ && !PtrTraits::IsSentinel(right_most_));
+            ZX_DEBUG_ASSERT(!PtrTraits::IsSentinel(root_));
+            ZX_DEBUG_ASSERT(left_most_ &&  !PtrTraits::IsSentinel(left_most_));
+            ZX_DEBUG_ASSERT(right_most_ && !PtrTraits::IsSentinel(right_most_));
 
             auto& root_ns       = NodeTraits::node_state(*root_);
             auto& left_most_ns  = NodeTraits::node_state(*left_most_);
             auto& right_most_ns = NodeTraits::node_state(*right_most_);
 
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(left_most_ns.left_));
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(right_most_ns.right_));
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(left_most_ns.left_));
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(right_most_ns.right_));
 
             PtrTraits::DetachSentinel(left_most_ns.left_);
             PtrTraits::DetachSentinel(right_most_ns.right_);
@@ -1231,8 +1231,8 @@
             left_most_ns.left_   = PtrTraits::MakeSentinel(this);
             right_most_ns.right_ = PtrTraits::MakeSentinel(this);
         } else {
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(left_most_));
-            MX_DEBUG_ASSERT(PtrTraits::IsSentinel(right_most_));
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(left_most_));
+            ZX_DEBUG_ASSERT(PtrTraits::IsSentinel(right_most_));
             left_most_  = sentinel();
             right_most_ = sentinel();
         }
@@ -1244,21 +1244,21 @@
     // a reference to the node's parent's left child, right child, or the root
     // node of the tree if the child has no parent.
     PtrType& GetLinkPtrToNode(RawPtrType node) {
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(node));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(node));
 
         auto& ns = NodeTraits::node_state(*node);
         if (PtrTraits::IsSentinel(ns.parent_)) {
-            MX_DEBUG_ASSERT(ns.parent_ == sentinel());
-            MX_DEBUG_ASSERT(PtrTraits::GetRaw(root_) == node);
+            ZX_DEBUG_ASSERT(ns.parent_ == sentinel());
+            ZX_DEBUG_ASSERT(PtrTraits::GetRaw(root_) == node);
             return root_;
         }
 
-        MX_DEBUG_ASSERT(ns.parent_ != nullptr);
+        ZX_DEBUG_ASSERT(ns.parent_ != nullptr);
         auto& parent_ns = NodeTraits::node_state(*ns.parent_);
         if (PtrTraits::GetRaw(parent_ns.left_) == node)
             return parent_ns.left_;
 
-        MX_DEBUG_ASSERT(PtrTraits::GetRaw(parent_ns.right_) == node);
+        ZX_DEBUG_ASSERT(PtrTraits::GetRaw(parent_ns.right_) == node);
         return parent_ns.right_;
     }
 
@@ -1315,8 +1315,8 @@
     //    LR-child).
     template <typename LRTraits>
     void RotateLR(RawPtrType node, RawPtrType parent) {
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(node));     // Node must be valid
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(parent));   // Node must have a parent
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(node));     // Node must be valid
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(parent));   // Node must have a parent
 
         // Aliases, just to make the code below match the notation used above.
         RawPtrType X = node;
@@ -1326,7 +1326,7 @@
         auto& Z_ns = NodeTraits::node_state(*Z);
 
         // X must be the RL-child of Z.
-        MX_DEBUG_ASSERT(LRTraits::RLRawChild(Z_ns) == X);
+        ZX_DEBUG_ASSERT(LRTraits::RLRawChild(Z_ns) == X);
 
         PtrType& X_link = LRTraits::RLChild(Z_ns);
         PtrType& Y_link = LRTraits::LRChild(X_ns);
@@ -1337,7 +1337,7 @@
 
         // The pointer to Y cannot be a sentinel, because that would imply that
         // X was LR-most.
-        MX_DEBUG_ASSERT(!PtrTraits::IsSentinel(Y));
+        ZX_DEBUG_ASSERT(!PtrTraits::IsSentinel(Y));
 
         // Permute the downstream links.
         PtrTraits::Swap(X_link, Y_link);
@@ -1380,13 +1380,13 @@
     void PostInsertFixupLR(RawPtrType node, RawPtrType parent) {
         using RLTraits = typename LRTraits::Inverse;
 
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(node));
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(parent));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(node));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(parent));
 
         auto& node_ns   = NodeTraits::node_state(*node);
         auto& parent_ns = NodeTraits::node_state(*parent);
 
-        MX_DEBUG_ASSERT(LRTraits::LRRawChild(parent_ns) == node);
+        ZX_DEBUG_ASSERT(LRTraits::LRRawChild(parent_ns) == node);
 
         RawPtrType rl_child = LRTraits::RLRawChild(node_ns);
         auto rl_child_ns    = PtrTraits::IsValid(rl_child)
@@ -1428,7 +1428,7 @@
         // We do not balance the tree after inserting the first (root)
         // node, so we should be able to assert that we have a valid parent.
         auto node_ns = &NodeTraits::node_state(*node);
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(node_ns->parent_));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(node_ns->parent_));
 
         // If we have a sibling, then our parent just went from being a 1,2
         // unary node into a 1,1 binary node and no action needs to be taken.
@@ -1477,7 +1477,7 @@
                                ? NodeTraits::node_state(*parent_ns->right_).rank_parity()
                                : true;
             } else {
-                MX_DEBUG_ASSERT(PtrTraits::GetRaw(parent_ns->right_) == node);
+                ZX_DEBUG_ASSERT(PtrTraits::GetRaw(parent_ns->right_) == node);
                 sibling_parity = PtrTraits::IsValid(parent_ns->left_)
                                ? NodeTraits::node_state(*parent_ns->left_).rank_parity()
                                : true;
@@ -1518,7 +1518,7 @@
     // Checks to see if the node has become a 2,2 leaf node and takes
     // appropriate action to restore the rank rule if needed.
     void BalancePostErase_Fix22Leaf(RawPtrType node) {
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(node));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(node));
 
         // If we just turned node into a 2,2 leaf, it will have no children and
         // odd rank-parity.  If it has even parity, or any children at all,
@@ -1538,13 +1538,13 @@
         // FixLR3Child method to check for the 3-child case and deal with it if
         // we need to.  If this node had no parent, then we know that we are
         // finished.
-        MX_DEBUG_ASSERT(ns.parent_ != nullptr);
+        ZX_DEBUG_ASSERT(ns.parent_ != nullptr);
         if (PtrTraits::IsSentinel(ns.parent_))
             return;
 
         auto& parent_ns     = NodeTraits::node_state(*ns.parent_);
         bool  is_left_child = PtrTraits::GetRaw(parent_ns.left_) == node;
-        MX_DEBUG_ASSERT(is_left_child || (PtrTraits::GetRaw(parent_ns.right_) == node));
+        ZX_DEBUG_ASSERT(is_left_child || (PtrTraits::GetRaw(parent_ns.right_) == node));
 
         if (is_left_child) BalancePostErase_FixLR3Child<ForwardTraits>(ns.parent_);
         else               BalancePostErase_FixLR3Child<ReverseTraits>(ns.parent_);
@@ -1570,7 +1570,7 @@
     template <typename LRTraits>
     void BalancePostErase_FixLR3Child(RawPtrType node) {
         using RLTraits = typename LRTraits::Inverse;
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(node));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(node));
 
         // Throughout this method, we will use the following notation.
         //
@@ -1609,7 +1609,7 @@
             //    meaning that the rank difference between Y and Z is either 1 or 2,
             //    therefor Y's rank is at least 0.
             // 3) Because Y has non-negative rank, it must exist.
-            MX_DEBUG_ASSERT(PtrTraits::IsValid(Y));
+            ZX_DEBUG_ASSERT(PtrTraits::IsValid(Y));
 
             auto& Y_ns = NodeTraits::node_state(*Y);
             bool  Y_is_2_child = (Y_ns.rank_parity() == Z_ns->rank_parity());
@@ -1700,8 +1700,8 @@
     template <typename LRTraits>
     void BalancePostErase_DoRotations(RawPtrType Y, RawPtrType Z) {
         using RLTraits = typename LRTraits::Inverse;
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(Y));
-        MX_DEBUG_ASSERT(PtrTraits::IsValid(Z));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(Y));
+        ZX_DEBUG_ASSERT(PtrTraits::IsValid(Z));
 
         auto& Y_ns = NodeTraits::node_state(*Y);
         auto& Z_ns = NodeTraits::node_state(*Z);
@@ -1743,9 +1743,9 @@
             // 3) Demote Y once.
             // 3) Demote Z twice.
             RawPtrType V = LRTraits::LRRawChild(Y_ns);
-            MX_DEBUG_ASSERT(PtrTraits::IsValid(V));                     // V must exist
+            ZX_DEBUG_ASSERT(PtrTraits::IsValid(V));                     // V must exist
             auto& V_ns = NodeTraits::node_state(*V);
-            MX_DEBUG_ASSERT(V_ns.rank_parity() != Y_ns.rank_parity());  // V must be a 1-child of Y
+            ZX_DEBUG_ASSERT(V_ns.rank_parity() != Y_ns.rank_parity());  // V must be a 1-child of Y
 
             // TODO(johngro) : Special case the implementation of a double
             // rotation operation.  It would almost certainly be more efficient
diff --git a/system/ulib/fbl/include/fbl/mutex.h b/system/ulib/fbl/include/fbl/mutex.h
index 3aa8d1c..1eb002e 100644
--- a/system/ulib/fbl/include/fbl/mutex.h
+++ b/system/ulib/fbl/include/fbl/mutex.h
@@ -6,7 +6,7 @@
 
 #ifdef __cplusplus
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/macros.h>
 
 // Notes about class Mutex
@@ -56,7 +56,7 @@
 
 #else   // if _KERNEL
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <threads.h>
 
 namespace fbl {
diff --git a/system/ulib/fbl/include/fbl/null_lock.h b/system/ulib/fbl/include/fbl/null_lock.h
index 7df68d6..68f0967 100644
--- a/system/ulib/fbl/include/fbl/null_lock.h
+++ b/system/ulib/fbl/include/fbl/null_lock.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #ifdef __cplusplus
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 // Notes about class NullLock
 //
diff --git a/system/ulib/fbl/include/fbl/recycler.h b/system/ulib/fbl/include/fbl/recycler.h
index c637c06..7cd7256 100644
--- a/system/ulib/fbl/include/fbl/recycler.h
+++ b/system/ulib/fbl/include/fbl/recycler.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/type_support.h>
 
 // fbl::Recyclable<T>
@@ -103,7 +103,7 @@
 // to undergo name lookup or template expansion.
 template <typename T, typename = void>
 struct recycler {
-    static inline void recycle(T* ptr) { MX_ASSERT(false); }
+    static inline void recycle(T* ptr) { ZX_ASSERT(false); }
 };
 
 template <typename T>
diff --git a/system/ulib/fbl/include/fbl/ref_counted.h b/system/ulib/fbl/include/fbl/ref_counted.h
index 54fbeef..f0181b9 100644
--- a/system/ulib/fbl/include/fbl/ref_counted.h
+++ b/system/ulib/fbl/include/fbl/ref_counted.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/macros.h>
 #include <fbl/ref_counted_internal.h>
 
@@ -30,7 +30,7 @@
 // protected.
 //
 template <typename T,
-          bool EnableAdoptionValidator = MX_DEBUG_ASSERT_IMPLEMENTED>
+          bool EnableAdoptionValidator = ZX_DEBUG_ASSERT_IMPLEMENTED>
 class RefCounted : public internal::RefCountedBase<EnableAdoptionValidator> {
 public:
     RefCounted() {}
diff --git a/system/ulib/fbl/include/fbl/ref_counted_internal.h b/system/ulib/fbl/include/fbl/ref_counted_internal.h
index 9b9cfb3..f2decc8 100644
--- a/system/ulib/fbl/include/fbl/ref_counted_internal.h
+++ b/system/ulib/fbl/include/fbl/ref_counted_internal.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/assert.h>
-#include <magenta/compiler.h>
+#include <zircon/assert.h>
+#include <zircon/compiler.h>
 #include <fbl/atomic.h>
 #include <fbl/canary.h>
 
@@ -40,7 +40,7 @@
 
 private:
     void AssertMagic(const uint32_t expected) const {
-        MX_DEBUG_ASSERT_MSG(magic_ == expected,
+        ZX_DEBUG_ASSERT_MSG(magic_ == expected,
                             "Invalid magic (expect: 0x%02x, got: 0x%02x)\n",
                             static_cast<unsigned int>(expected),
                             static_cast<unsigned int>(magic_));
@@ -81,7 +81,7 @@
             // already been destroyed, the magic check in
             // adoption_validator_.ValidateAddRef() should have caught it before
             // this point.
-            MX_DEBUG_ASSERT_MSG(rc >= 1, "count %d < 1\n", rc);
+            ZX_DEBUG_ASSERT_MSG(rc >= 1, "count %d < 1\n", rc);
         }
     }
 
@@ -115,7 +115,7 @@
         if (EnableAdoptionValidator) {
             // This assertion will fire if someone manually calls Release()
             // on a ref-counted object too many times.
-            MX_DEBUG_ASSERT_MSG(rc >= 1, "count %d < 1\n", rc);
+            ZX_DEBUG_ASSERT_MSG(rc >= 1, "count %d < 1\n", rc);
         }
         if (rc == 1) {
             atomic_thread_fence(memory_order_acquire);
diff --git a/system/ulib/fbl/include/fbl/ref_ptr.h b/system/ulib/fbl/include/fbl/ref_ptr.h
index b1512b2..7f5975d 100644
--- a/system/ulib/fbl/include/fbl/ref_ptr.h
+++ b/system/ulib/fbl/include/fbl/ref_ptr.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/assert.h>
-#include <magenta/compiler.h>
+#include <zircon/assert.h>
+#include <zircon/compiler.h>
 #include <fbl/recycler.h>
 #include <fbl/type_support.h>
 
@@ -138,7 +138,7 @@
     template <typename BaseType>
     RefPtr(T* ptr, RefPtr<BaseType>&& base)
         : ptr_(ptr) {
-        MX_ASSERT(static_cast<BaseType*>(ptr_) == base.ptr_);
+        ZX_ASSERT(static_cast<BaseType*>(ptr_) == base.ptr_);
         base.ptr_ = nullptr;
     }
 
@@ -226,7 +226,7 @@
     RefPtr(T* ptr, const Mutex& dtor_lock)
         : ptr_(ptr->AddRefMaybeInDestructor() ? ptr : nullptr) {
 #if _KERNEL
-        MX_DEBUG_ASSERT_MSG(dtor_lock.IsHeld(), "Lock must be held while using this ctor\n");
+        ZX_DEBUG_ASSERT_MSG(dtor_lock.IsHeld(), "Lock must be held while using this ctor\n");
 #endif
     }
 
diff --git a/system/ulib/fbl/include/fbl/slab_allocator.h b/system/ulib/fbl/include/fbl/slab_allocator.h
index 5a62f59..f41d250 100644
--- a/system/ulib/fbl/include/fbl/slab_allocator.h
+++ b/system/ulib/fbl/include/fbl/slab_allocator.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/algorithm.h>
 #include <fbl/auto_lock.h>
 #include <fbl/deleter.h>
@@ -330,7 +330,7 @@
 struct SlabOriginSetter {
     static inline void SetOrigin(typename SATraits::ObjType* ptr,
                                  internal::SlabAllocator<SATraits>* origin) {
-        MX_DEBUG_ASSERT((ptr != nullptr) && (origin != nullptr));
+        ZX_DEBUG_ASSERT((ptr != nullptr) && (origin != nullptr));
         ptr->slab_origin_ = origin;
     }
 };
@@ -404,7 +404,7 @@
     }
 
     ~SlabAllocatorBase() {
-#if MX_DEBUG_ASSERT_IMPLEMENTED
+#if ZX_DEBUG_ASSERT_IMPLEMENTED
         size_t allocated_count = 0;
         size_t free_list_size = this->free_list_.size_slow();
 #endif
@@ -416,10 +416,10 @@
 
         while (!slab_list_.is_empty()) {
             Slab* free_me = slab_list_.pop_front();
-#if MX_DEBUG_ASSERT_IMPLEMENTED
+#if ZX_DEBUG_ASSERT_IMPLEMENTED
             size_t bytes_used = free_me->bytes_used_ - initial_slab_used_;
-            MX_DEBUG_ASSERT(free_me->bytes_used_ >= initial_slab_used_);
-            MX_DEBUG_ASSERT((bytes_used % alloc_size_) == 0);
+            ZX_DEBUG_ASSERT(free_me->bytes_used_ >= initial_slab_used_);
+            ZX_DEBUG_ASSERT((bytes_used % alloc_size_) == 0);
             allocated_count += (bytes_used / alloc_size_);
 #endif
             SlabMalloc::Free(reinterpret_cast<void*>(free_me));
@@ -427,7 +427,7 @@
 
         // Make sure that everything which was ever allocated had been returned
         // to the free list before we were destroyed.
-        MX_DEBUG_ASSERT_COND(free_list_size == allocated_count);
+        ZX_DEBUG_ASSERT_COND(free_list_size == allocated_count);
     }
 
     size_t max_slabs() const { return max_slabs_; }
@@ -696,8 +696,8 @@
         // be able to modify slab_origin_ because it is private.
         ObjType* obj_ptr = reinterpret_cast<ObjType*>(ptr);
 
-        MX_DEBUG_ASSERT(obj_ptr != nullptr);
-        MX_DEBUG_ASSERT(obj_ptr->slab_origin_ != nullptr);
+        ZX_DEBUG_ASSERT(obj_ptr != nullptr);
+        ZX_DEBUG_ASSERT(obj_ptr->slab_origin_ != nullptr);
         obj_ptr->slab_origin_->ReturnToFreeList(obj_ptr);
     }
 
@@ -730,7 +730,7 @@
     // Note: it would be nice to either = delete this operator, or at least make
     // it private, but we cannot.  To do so would prevent the implemementer of
     // the slab allocated object from defining a destructor.
-    void operator delete(void*) { MX_DEBUG_ASSERT(false); }
+    void operator delete(void*) { ZX_DEBUG_ASSERT(false); }
 };
 
 // Shorthand for declaring the properties of an instanced allocator (somewhat
@@ -817,7 +817,7 @@
     using ObjType       = typename SATraits::ObjType;
 
     void operator delete(void* ptr) {
-        MX_DEBUG_ASSERT(ptr != nullptr);
+        ZX_DEBUG_ASSERT(ptr != nullptr);
         AllocatorType::ReturnToFreeList(reinterpret_cast<ObjType*>(ptr));
     }
 };
diff --git a/system/ulib/fbl/include/fbl/slab_malloc.h b/system/ulib/fbl/include/fbl/slab_malloc.h
index b310914..ae7b587 100644
--- a/system/ulib/fbl/include/fbl/slab_malloc.h
+++ b/system/ulib/fbl/include/fbl/slab_malloc.h
@@ -28,7 +28,7 @@
     // which does not use the heap.
     static void* Allocate(size_t amt, size_t align) {
         void* mem = ::malloc(amt);
-        MX_DEBUG_ASSERT((reinterpret_cast<uintptr_t>(mem) % align) == 0);
+        ZX_DEBUG_ASSERT((reinterpret_cast<uintptr_t>(mem) % align) == 0);
         return mem;
     }
 
diff --git a/system/ulib/fbl/include/fbl/string.h b/system/ulib/fbl/include/fbl/string.h
index 40c890c..f48852a 100644
--- a/system/ulib/fbl/include/fbl/string.h
+++ b/system/ulib/fbl/include/fbl/string.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/atomic.h>
 #include <fbl/initializer_list.h>
diff --git a/system/ulib/fbl/include/fbl/string_buffer.h b/system/ulib/fbl/include/fbl/string_buffer.h
index f26ed37..e61ec15 100644
--- a/system/ulib/fbl/include/fbl/string_buffer.h
+++ b/system/ulib/fbl/include/fbl/string_buffer.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/assert.h>
-#include <magenta/compiler.h>
+#include <zircon/assert.h>
+#include <zircon/compiler.h>
 #include <fbl/string.h>
 #include <fbl/string_piece.h>
 
@@ -69,7 +69,7 @@
     // If the current length is greater than |count|, the string is truncated.
     // |length| must be less than or equal to |N|.
     void Resize(size_t count, char ch = '\0') {
-        MX_DEBUG_ASSERT(count <= N);
+        ZX_DEBUG_ASSERT(count <= N);
         if (length_ < count)
             memset(data_ + length_, ch, count - length_);
         length_ = count;
diff --git a/system/ulib/fbl/include/fbl/string_printf.h b/system/ulib/fbl/include/fbl/string_printf.h
index 23fcafd..4777ffc 100644
--- a/system/ulib/fbl/include/fbl/string_printf.h
+++ b/system/ulib/fbl/include/fbl/string_printf.h
@@ -6,7 +6,7 @@
 
 #include <stdarg.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/string.h>
 
 namespace fbl {
diff --git a/system/ulib/fbl/include/fbl/vector.h b/system/ulib/fbl/include/fbl/vector.h
index 13adf51..e25c3b2 100644
--- a/system/ulib/fbl/include/fbl/vector.h
+++ b/system/ulib/fbl/include/fbl/vector.h
@@ -6,7 +6,7 @@
 
 #include <string.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/macros.h>
 #include <fbl/new.h>
@@ -28,7 +28,7 @@
     // pointer on success. This same pointer may later be passed
     // to deallocate when resizing.
     static void* Allocate(size_t size) {
-        MX_DEBUG_ASSERT(size > 0);
+        ZX_DEBUG_ASSERT(size > 0);
         AllocChecker ac;
         void* object = new (&ac) char[size];
         return ac.check() ? object : nullptr;
@@ -160,7 +160,7 @@
     //
     // Index must be less than the size of the vector.
     T erase(size_t index) {
-        MX_DEBUG_ASSERT(index < size_);
+        ZX_DEBUG_ASSERT(index < size_);
         auto val = fbl::move(ptr_[index]);
         shift_forward(index);
         consider_shrinking();
@@ -168,7 +168,7 @@
     }
 
     void pop_back() {
-        MX_DEBUG_ASSERT(size_ > 0);
+        ZX_DEBUG_ASSERT(size_ > 0);
         ptr_[--size_].~T();
         consider_shrinking();
     }
@@ -182,7 +182,7 @@
     }
 
     T& operator[](size_t i) const {
-        MX_DEBUG_ASSERT(i < size_);
+        ZX_DEBUG_ASSERT(i < size_);
         return ptr_[i];
     }
 
@@ -222,7 +222,7 @@
     template <typename U,
               typename = typename enable_if<is_same<internal::remove_cv_ref<U>, T>::value>::type>
     void insert_internal(size_t index, U&& value, AllocChecker* ac) {
-        MX_DEBUG_ASSERT(index <= size_);
+        ZX_DEBUG_ASSERT(index <= size_);
         if (!grow_for_new_element(ac)) {
             return;
         }
@@ -232,7 +232,7 @@
     template <typename U,
               typename = typename enable_if<is_same<internal::remove_cv_ref<U>, T>::value>::type>
     void insert_internal(size_t index, U&& value) {
-        MX_DEBUG_ASSERT(index <= size_);
+        ZX_DEBUG_ASSERT(index <= size_);
         grow_for_new_element();
         insert_complete(index, fbl::forward<U>(value));
     }
@@ -261,8 +261,8 @@
     template <typename U = T>
     typename enable_if<is_pod<U>::value, void>::type
     shift_back(size_t index) {
-        MX_DEBUG_ASSERT(size_ < capacity_);
-        MX_DEBUG_ASSERT(size_ > 0);
+        ZX_DEBUG_ASSERT(size_ < capacity_);
+        ZX_DEBUG_ASSERT(size_ > 0);
         size_++;
         memmove(&ptr_[index + 1], &ptr_[index], sizeof(T) * (size_ - (index + 1)));
     }
@@ -270,8 +270,8 @@
     template <typename U = T>
     typename enable_if<!is_pod<U>::value, void>::type
     shift_back(size_t index) {
-        MX_DEBUG_ASSERT(size_ < capacity_);
-        MX_DEBUG_ASSERT(size_ > 0);
+        ZX_DEBUG_ASSERT(size_ < capacity_);
+        ZX_DEBUG_ASSERT(size_ > 0);
         size_++;
         new (&ptr_[size_ - 1]) T(fbl::move(ptr_[size_ - 2]));
         for (size_t i = size_ - 2; i > index; i--) {
@@ -284,7 +284,7 @@
     template <typename U = T>
     typename enable_if<is_pod<U>::value, void>::type
     shift_forward(size_t index) {
-        MX_DEBUG_ASSERT(size_ > 0);
+        ZX_DEBUG_ASSERT(size_ > 0);
         memmove(&ptr_[index], &ptr_[index + 1], sizeof(T) * (size_ - (index + 1)));
         size_--;
     }
@@ -292,7 +292,7 @@
     template <typename U = T>
     typename enable_if<!is_pod<U>::value, void>::type
     shift_forward(size_t index) {
-        MX_DEBUG_ASSERT(size_ > 0);
+        ZX_DEBUG_ASSERT(size_ > 0);
         for (size_t i = index; (i + 1) < size_; i++) {
             ptr_[i] = fbl::move(ptr_[i + 1]);
         }
@@ -317,7 +317,7 @@
     // Grows the vector's capacity to accommodate one more element.
     // Returns true on success, false on failure.
     bool grow_for_new_element(AllocChecker* ac) {
-        MX_DEBUG_ASSERT(size_ <= capacity_);
+        ZX_DEBUG_ASSERT(size_ <= capacity_);
         if (size_ == capacity_) {
             size_t newCapacity = capacity_ < kCapacityMinimum ? kCapacityMinimum :
                     capacity_ * kCapacityGrowthFactor;
@@ -331,7 +331,7 @@
     }
 
     void grow_for_new_element() {
-        MX_DEBUG_ASSERT(size_ <= capacity_);
+        ZX_DEBUG_ASSERT(size_ <= capacity_);
         if (size_ == capacity_) {
             size_t newCapacity = capacity_ < kCapacityMinimum ? kCapacityMinimum :
                     capacity_ * kCapacityGrowthFactor;
@@ -356,8 +356,8 @@
     // Returns true on success, false on failure.
     // If reallocate fails, the old "ptr_" array is unmodified.
     bool reallocate(size_t newCapacity, AllocChecker* ac) {
-        MX_DEBUG_ASSERT(newCapacity > 0);
-        MX_DEBUG_ASSERT(newCapacity >= size_);
+        ZX_DEBUG_ASSERT(newCapacity > 0);
+        ZX_DEBUG_ASSERT(newCapacity >= size_);
         auto newPtr = reinterpret_cast<T*>(AllocatorTraits::Allocate(newCapacity * sizeof(T)));
         if (newPtr == nullptr) {
             ac->arm(1u, false);
@@ -372,8 +372,8 @@
     }
 
     void reallocate(size_t newCapacity) {
-        MX_DEBUG_ASSERT(newCapacity > 0);
-        MX_DEBUG_ASSERT(newCapacity >= size_);
+        ZX_DEBUG_ASSERT(newCapacity > 0);
+        ZX_DEBUG_ASSERT(newCapacity >= size_);
         auto newPtr = reinterpret_cast<T*>(AllocatorTraits::Allocate(newCapacity * sizeof(T)));
         transfer_to(newPtr, size_);
         AllocatorTraits::Deallocate(ptr_);
@@ -393,7 +393,7 @@
     }
 
     void reset(T* t, size_t size, size_t capacity) {
-        MX_DEBUG_ASSERT(size <= capacity);
+        ZX_DEBUG_ASSERT(size <= capacity);
         while (size_ > 0) {
             ptr_[--size_].~T();
         }
diff --git a/system/ulib/fbl/string.cpp b/system/ulib/fbl/string.cpp
index 28f80e9..8d5b792 100644
--- a/system/ulib/fbl/string.cpp
+++ b/system/ulib/fbl/string.cpp
@@ -6,7 +6,7 @@
 
 #include <string.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 #include <fbl/algorithm.h>
 #include <fbl/atomic.h>
@@ -211,7 +211,7 @@
 
 void String::ReleaseRef(char* data) {
     unsigned int prior_count = ref_count_field_of(data)->fetch_sub(1u, memory_order_release);
-    MX_DEBUG_ASSERT(prior_count != 0u);
+    ZX_DEBUG_ASSERT(prior_count != 0u);
     if (prior_count == 1u) {
         atomic_thread_fence(memory_order_acquire);
         operator delete(data - kDataFieldOffset);
diff --git a/system/ulib/fbl/string_printf.cpp b/system/ulib/fbl/string_printf.cpp
index 0f4a9c7..552725a 100644
--- a/system/ulib/fbl/string_printf.cpp
+++ b/system/ulib/fbl/string_printf.cpp
@@ -8,7 +8,7 @@
 #include <stddef.h>
 #include <stdio.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <fbl/unique_ptr.h>
 
 namespace fbl {
@@ -54,7 +54,7 @@
     size_t heap_buf_size = output_size + 1u;
     fbl::unique_ptr<char[]> heap_buf(new char[heap_buf_size]);
     result = vsnprintf(heap_buf.get(), heap_buf_size, format, ap);
-    MX_ASSERT(result >= 0 && static_cast<size_t>(result) == output_size);
+    ZX_ASSERT(result >= 0 && static_cast<size_t>(result) == output_size);
     return String(heap_buf.get(), static_cast<size_t>(result));
 }
 
diff --git a/system/ulib/mxio/bootfs.c b/system/ulib/fdio/bootfs.c
similarity index 60%
rename from system/ulib/mxio/bootfs.c
rename to system/ulib/fdio/bootfs.c
index da871d4..03aeedd 100644
--- a/system/ulib/mxio/bootfs.c
+++ b/system/ulib/fdio/bootfs.c
@@ -7,72 +7,72 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/boot/bootdata.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
-#include <mxio/util.h>
+#include <fdio/util.h>
 
-mx_status_t bootfs_create(bootfs_t* bfs, mx_handle_t vmo) {
+zx_status_t bootfs_create(bootfs_t* bfs, zx_handle_t vmo) {
     bootfs_header_t hdr;
     size_t rlen;
-    mx_status_t r = mx_vmo_read(vmo, &hdr, 0, sizeof(hdr), &rlen);
+    zx_status_t r = zx_vmo_read(vmo, &hdr, 0, sizeof(hdr), &rlen);
     if ((r < 0) || (rlen < sizeof(hdr))) {
         printf("bootfs_create: couldn't read boot_data - %d\n", r);
         return r;
     }
     if (hdr.magic != BOOTFS_MAGIC) {
         printf("bootfs_create: incorrect bootdata header: %x\n", hdr.magic);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
-    if ((r = mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &bfs->vmo)) < 0) {
+    if ((r = zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &bfs->vmo)) < 0) {
         return r;
     }
     uintptr_t addr;
-    if ((r = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0,
+    if ((r = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0,
                          sizeof(hdr) + hdr.dirsize,
-                         MX_VM_FLAG_PERM_READ, &addr)) < 0) {
+                         ZX_VM_FLAG_PERM_READ, &addr)) < 0) {
         printf("boofts_create: couldn't map directory: %d\n", r);
-        mx_handle_close(bfs->vmo);
+        zx_handle_close(bfs->vmo);
         return r;
     }
     bfs->dirsize = hdr.dirsize;
     bfs->dir = (void*)addr + sizeof(hdr);
-    return MX_OK;
+    return ZX_OK;
 }
 
 void bootfs_destroy(bootfs_t* bfs) {
-    mx_handle_close(bfs->vmo);
-    mx_vmar_unmap(mx_vmar_root_self(),
+    zx_handle_close(bfs->vmo);
+    zx_vmar_unmap(zx_vmar_root_self(),
                   (uintptr_t)bfs->dir - sizeof(bootfs_header_t),
                   bfs->dirsize);
 }
 
-mx_status_t bootfs_parse(bootfs_t* bfs,
-                         mx_status_t (*cb)(void* cookie, const bootfs_entry_t* entry),
+zx_status_t bootfs_parse(bootfs_t* bfs,
+                         zx_status_t (*cb)(void* cookie, const bootfs_entry_t* entry),
                          void* cookie) {
     size_t avail = bfs->dirsize;
     void* p = bfs->dir;
-    mx_status_t r;
+    zx_status_t r;
     while (avail > sizeof(bootfs_entry_t)) {
         bootfs_entry_t* e = p;
         size_t sz = BOOTFS_RECSIZE(e);
         if ((e->name_len < 1) || (e->name_len > BOOTFS_MAX_NAME_LEN) ||
             (e->name[e->name_len - 1] != 0) || (sz > avail)) {
             printf("bootfs: bogus entry!\n");
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
-        if ((r = cb(cookie, e)) != MX_OK) {
+        if ((r = cb(cookie, e)) != ZX_OK) {
             return r;
         }
         p += sz;
         avail -= sz;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t bootfs_open(bootfs_t* bfs, const char* name, mx_handle_t* vmo_out) {
+zx_status_t bootfs_open(bootfs_t* bfs, const char* name, zx_handle_t* vmo_out) {
     size_t name_len = strlen(name) + 1;
     size_t avail = bfs->dirsize;
     void* p = bfs->dir;
@@ -83,7 +83,7 @@
         if ((e->name_len < 1) || (e->name_len > BOOTFS_MAX_NAME_LEN) ||
             (e->name[e->name_len - 1] != 0) || (sz > avail)) {
             printf("bootfs: bogus entry!\n");
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
         if ((name_len == e->name_len) && (memcmp(name, e->name, name_len) == 0)) {
             goto found;
@@ -92,32 +92,32 @@
         avail -= sz;
     }
     printf("bootfs_open: '%s' not found\n", name);
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 
 found:;
-    mx_handle_t vmo;
-    mx_status_t r;
+    zx_handle_t vmo;
+    zx_status_t r;
 
     // Clone a private copy of the file's subset of the bootfs VMO.
     // TODO(mcgrathr): Create a plain read-only clone when the feature
     // is implemented in the VM.
-    if ((r = mx_vmo_clone(bfs->vmo, MX_VMO_CLONE_COPY_ON_WRITE,
-                          e->data_off, e->data_len, &vmo)) != MX_OK) {
+    if ((r = zx_vmo_clone(bfs->vmo, ZX_VMO_CLONE_COPY_ON_WRITE,
+                          e->data_off, e->data_len, &vmo)) != ZX_OK) {
         return r;
     }
 
-    mx_object_set_property(vmo, MX_PROP_NAME, name, name_len - 1);
+    zx_object_set_property(vmo, ZX_PROP_NAME, name, name_len - 1);
 
-    // Drop unnecessary MX_RIGHT_WRITE rights.
-    // TODO(mcgrathr): Should be superfluous with read-only mx_vmo_clone.
-    if ((r = mx_handle_replace(vmo,
-                               MX_RIGHT_READ | MX_RIGHT_EXECUTE |
-                               MX_RIGHT_MAP | MX_RIGHT_TRANSFER |
-                               MX_RIGHT_DUPLICATE | MX_RIGHT_GET_PROPERTY,
-                               &vmo)) != MX_OK) {
+    // Drop unnecessary ZX_RIGHT_WRITE rights.
+    // TODO(mcgrathr): Should be superfluous with read-only zx_vmo_clone.
+    if ((r = zx_handle_replace(vmo,
+                               ZX_RIGHT_READ | ZX_RIGHT_EXECUTE |
+                               ZX_RIGHT_MAP | ZX_RIGHT_TRANSFER |
+                               ZX_RIGHT_DUPLICATE | ZX_RIGHT_GET_PROPERTY,
+                               &vmo)) != ZX_OK) {
         return r;
     }
 
     *vmo_out = vmo;
-    return MX_OK;
+    return ZX_OK;
 }
\ No newline at end of file
diff --git a/system/ulib/mxio/bsdsocket.c b/system/ulib/fdio/bsdsocket.c
similarity index 64%
rename from system/ulib/mxio/bsdsocket.c
rename to system/ulib/fdio/bsdsocket.c
index fb78d21..5afbce6 100644
--- a/system/ulib/mxio/bsdsocket.c
+++ b/system/ulib/fdio/bsdsocket.c
@@ -14,18 +14,18 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-#include <mxio/debug.h>
-#include <mxio/io.h>
-#include <mxio/remoteio.h>
-#include <mxio/util.h>
-#include <mxio/socket.h>
+#include <fdio/debug.h>
+#include <fdio/io.h>
+#include <fdio/remoteio.h>
+#include <fdio/util.h>
+#include <fdio/socket.h>
 
 #include "private.h"
 #include "unistd.h"
 
-static mx_status_t mxio_getsockopt(mxio_t* io, int level, int optname,
+static zx_status_t fdio_getsockopt(fdio_t* io, int level, int optname,
                                    void* restrict optval,
                                    socklen_t* restrict optlen);
 
@@ -43,11 +43,11 @@
 
 int socket(int domain, int type, int protocol) {
 
-    mxio_t* io = NULL;
-    mx_status_t r;
+    fdio_t* io = NULL;
+    zx_status_t r;
 
     char path[1024];
-    int n = snprintf(path, sizeof(path), "%s/%d/%d/%d", MXRIO_SOCKET_DIR_SOCKET,
+    int n = snprintf(path, sizeof(path), "%s/%d/%d/%d", ZXRIO_SOCKET_DIR_SOCKET,
                      domain, type & ~SOCK_NONBLOCK, protocol);
     if (n < 0 || n >= (int)sizeof(path)) {
         return ERRNO(EINVAL);
@@ -57,87 +57,87 @@
     // if necessary.
     // TODO: move to a better mechanism when available.
     unsigned retry = 0;
-    while ((r = __mxio_open_at(&io, get_netstack(), path, 0, 0)) == MX_ERR_NOT_FOUND) {
+    while ((r = __fdio_open_at(&io, get_netstack(), path, 0, 0)) == ZX_ERR_NOT_FOUND) {
         if (retry >= 24) {
             // 10-second timeout
             return ERRNO(EIO);
         }
         retry++;
-        mx_nanosleep(mx_deadline_after((retry < 8) ? MX_MSEC(250) : MX_MSEC(500)));
+        zx_nanosleep(zx_deadline_after((retry < 8) ? ZX_MSEC(250) : ZX_MSEC(500)));
     }
     if (r < 0) {
         return ERROR(r);
     }
     if (type & SOCK_STREAM) {
-        mxio_socket_set_stream_ops(io);
+        fdio_socket_set_stream_ops(io);
     } else if (type & SOCK_DGRAM) {
-        mxio_socket_set_dgram_ops(io);
+        fdio_socket_set_dgram_ops(io);
     }
 
     if (type & SOCK_NONBLOCK) {
-        io->flags |= MXIO_FLAG_NONBLOCK;
+        io->flags |= FDIO_FLAG_NONBLOCK;
     }
 
     int fd;
-    if ((fd = mxio_bind_to_fd(io, -1, 0)) < 0) {
+    if ((fd = fdio_bind_to_fd(io, -1, 0)) < 0) {
         io->ops->close(io);
-        mxio_release(io);
+        fdio_release(io);
         return ERRNO(EMFILE);
     }
     return fd;
 }
 
 int connect(int fd, const struct sockaddr* addr, socklen_t len) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
 
-    mx_status_t r;
-    r = io->ops->misc(io, MXRIO_CONNECT, 0, 0, (void*)addr, len);
-    if (r == MX_ERR_SHOULD_WAIT) {
-        if (io->flags & MXIO_FLAG_NONBLOCK) {
-            io->flags |= MXIO_FLAG_SOCKET_CONNECTING;
-            mxio_release(io);
+    zx_status_t r;
+    r = io->ops->misc(io, ZXRIO_CONNECT, 0, 0, (void*)addr, len);
+    if (r == ZX_ERR_SHOULD_WAIT) {
+        if (io->flags & FDIO_FLAG_NONBLOCK) {
+            io->flags |= FDIO_FLAG_SOCKET_CONNECTING;
+            fdio_release(io);
             return ERRNO(EINPROGRESS);
         }
         // going to wait for the completion
     } else {
-        if (r == MX_OK) {
-            io->flags |= MXIO_FLAG_SOCKET_CONNECTED;
+        if (r == ZX_OK) {
+            io->flags |= FDIO_FLAG_SOCKET_CONNECTED;
         }
-        mxio_release(io);
+        fdio_release(io);
         return STATUS(r);
     }
 
     // wait for the completion
     uint32_t events = POLLOUT;
-    mx_handle_t h;
-    mx_signals_t sigs;
+    zx_handle_t h;
+    zx_signals_t sigs;
     io->ops->wait_begin(io, events, &h, &sigs);
-    r = mx_object_wait_one(h, sigs, MX_TIME_INFINITE, &sigs);
+    r = zx_object_wait_one(h, sigs, ZX_TIME_INFINITE, &sigs);
     io->ops->wait_end(io, sigs, &events);
     if (!(events & POLLOUT)) {
-        mxio_release(io);
+        fdio_release(io);
         return ERRNO(EIO);
     }
     if (r < 0) {
-        mxio_release(io);
+        fdio_release(io);
         return ERROR(r);
     }
 
     // check the result
     int errno_;
     socklen_t errno_len = sizeof(errno_);
-    r = mxio_getsockopt(io, SOL_SOCKET, SO_ERROR, &errno_, &errno_len);
+    r = fdio_getsockopt(io, SOL_SOCKET, SO_ERROR, &errno_, &errno_len);
     if (r < 0) {
-        mxio_release(io);
+        fdio_release(io);
         return ERRNO(EIO);
     }
     if (errno_ == 0) {
-        io->flags |= MXIO_FLAG_SOCKET_CONNECTED;
+        io->flags |= FDIO_FLAG_SOCKET_CONNECTED;
     }
-    mxio_release(io);
+    fdio_release(io);
     if (errno_ != 0) {
         return ERRNO(errno_);
     }
@@ -145,26 +145,26 @@
 }
 
 int bind(int fd, const struct sockaddr* addr, socklen_t len) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
 
-    mx_status_t r;
-    r = io->ops->misc(io, MXRIO_BIND, 0, 0, (void*)addr, len);
-    mxio_release(io);
+    zx_status_t r;
+    r = io->ops->misc(io, ZXRIO_BIND, 0, 0, (void*)addr, len);
+    fdio_release(io);
     return STATUS(r);
 }
 
 int listen(int fd, int backlog) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
 
-    mx_status_t r;
-    r = io->ops->misc(io, MXRIO_LISTEN, 0, 0, &backlog, sizeof(backlog));
-    mxio_release(io);
+    zx_status_t r;
+    r = io->ops->misc(io, ZXRIO_LISTEN, 0, 0, &backlog, sizeof(backlog));
+    fdio_release(io);
     return STATUS(r);
 }
 
@@ -174,54 +174,54 @@
         return ERRNO(EINVAL);
     }
 
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
 
-    mxio_t* io2;
-    mx_status_t r;
+    fdio_t* io2;
+    zx_status_t r;
     for (;;) {
-        r = io->ops->open(io, MXRIO_SOCKET_DIR_ACCEPT, 0, 0, &io2);
-        if (r == MX_ERR_SHOULD_WAIT) {
-            if (io->flags & MXIO_FLAG_NONBLOCK) {
-                mxio_release(io);
+        r = io->ops->open(io, ZXRIO_SOCKET_DIR_ACCEPT, 0, 0, &io2);
+        if (r == ZX_ERR_SHOULD_WAIT) {
+            if (io->flags & FDIO_FLAG_NONBLOCK) {
+                fdio_release(io);
                 return ERRNO(EWOULDBLOCK);
             }
             // wait for an incoming connection
             uint32_t events = POLLIN;
-            mx_handle_t h;
-            mx_signals_t sigs;
+            zx_handle_t h;
+            zx_signals_t sigs;
             io->ops->wait_begin(io, events, &h, &sigs);
-            r = mx_object_wait_one(h, sigs, MX_TIME_INFINITE, &sigs);
+            r = zx_object_wait_one(h, sigs, ZX_TIME_INFINITE, &sigs);
             io->ops->wait_end(io, sigs, &events);
             if (!(events & POLLIN)) {
-                mxio_release(io);
+                fdio_release(io);
                 return ERRNO(EIO);
             }
             continue;
-        } else if (r == MX_OK) {
+        } else if (r == ZX_OK) {
             break;
         }
-        mxio_release(io);
+        fdio_release(io);
         return ERROR(r);
     }
-    mxio_release(io);
+    fdio_release(io);
 
-    mxio_socket_set_stream_ops(io2);
-    io2->flags |= MXIO_FLAG_SOCKET_CONNECTED;
+    fdio_socket_set_stream_ops(io2);
+    io2->flags |= FDIO_FLAG_SOCKET_CONNECTED;
 
     if (flags & SOCK_NONBLOCK) {
-        io2->flags |= MXIO_FLAG_NONBLOCK;
+        io2->flags |= FDIO_FLAG_NONBLOCK;
     }
 
     if (addr != NULL && len != NULL) {
-        mxrio_sockaddr_reply_t reply;
-        if ((r = io2->ops->misc(io2, MXRIO_GETPEERNAME, 0,
-                                sizeof(mxrio_sockaddr_reply_t), &reply,
+        zxrio_sockaddr_reply_t reply;
+        if ((r = io2->ops->misc(io2, ZXRIO_GETPEERNAME, 0,
+                                sizeof(zxrio_sockaddr_reply_t), &reply,
                                 sizeof(reply))) < 0) {
             io->ops->close(io2);
-            mxio_release(io2);
+            fdio_release(io2);
             return ERROR(r);
         }
         socklen_t avail = *len;
@@ -230,9 +230,9 @@
     }
 
     int fd2;
-    if ((fd2 = mxio_bind_to_fd(io2, -1, 0)) < 0) {
+    if ((fd2 = fdio_bind_to_fd(io2, -1, 0)) < 0) {
         io->ops->close(io2);
-        mxio_release(io2);
+        fdio_release(io2);
         return ERRNO(EMFILE);
     }
     return fd2;
@@ -242,8 +242,8 @@
                 const char* __restrict service,
                 const struct addrinfo* __restrict hints,
                 struct addrinfo** __restrict res) {
-    mxio_t* io = NULL;
-    mx_status_t r;
+    fdio_t* io = NULL;
+    zx_status_t r;
 
     if ((node == NULL && service == NULL) || res == NULL) {
         errno = EINVAL;
@@ -253,35 +253,35 @@
     // if necessary.
     // TODO: move to a better mechanism when available.
     unsigned retry = 0;
-    while ((r = __mxio_open_at(&io, get_netstack(), MXRIO_SOCKET_DIR_NONE,
-                               0, 0)) == MX_ERR_NOT_FOUND) {
+    while ((r = __fdio_open_at(&io, get_netstack(), ZXRIO_SOCKET_DIR_NONE,
+                               0, 0)) == ZX_ERR_NOT_FOUND) {
         if (retry >= 24) {
             // 10-second timeout
             return EAI_AGAIN;
         }
         retry++;
-        mx_nanosleep(mx_deadline_after((retry < 8) ? MX_MSEC(250) : MX_MSEC(500)));
+        zx_nanosleep(zx_deadline_after((retry < 8) ? ZX_MSEC(250) : ZX_MSEC(500)));
     }
     if (r < 0) {
-        errno = mxio_status_to_errno(r);
+        errno = fdio_status_to_errno(r);
         return EAI_SYSTEM;
     }
 
-    static_assert(sizeof(mxrio_gai_req_reply_t) <= MXIO_CHUNK_SIZE,
-                  "this type should be no larger than MXIO_CHUNK_SIZE");
+    static_assert(sizeof(zxrio_gai_req_reply_t) <= FDIO_CHUNK_SIZE,
+                  "this type should be no larger than FDIO_CHUNK_SIZE");
 
-    mxrio_gai_req_reply_t gai;
+    zxrio_gai_req_reply_t gai;
 
     gai.req.node_is_null = (node == NULL) ? 1 : 0;
     gai.req.service_is_null = (service == NULL) ? 1 : 0;
     gai.req.hints_is_null = (hints == NULL) ? 1 : 0;
     if (node) {
-        strncpy(gai.req.node, node, MXRIO_GAI_REQ_NODE_MAXLEN);
-        gai.req.node[MXRIO_GAI_REQ_NODE_MAXLEN-1] = '\0';
+        strncpy(gai.req.node, node, ZXRIO_GAI_REQ_NODE_MAXLEN);
+        gai.req.node[ZXRIO_GAI_REQ_NODE_MAXLEN-1] = '\0';
     }
     if (service) {
-        strncpy(gai.req.service, service, MXRIO_GAI_REQ_SERVICE_MAXLEN);
-        gai.req.service[MXRIO_GAI_REQ_SERVICE_MAXLEN-1] = '\0';
+        strncpy(gai.req.service, service, ZXRIO_GAI_REQ_SERVICE_MAXLEN);
+        gai.req.service[ZXRIO_GAI_REQ_SERVICE_MAXLEN-1] = '\0';
     }
     if (hints) {
         if (hints->ai_addrlen != 0 || hints->ai_addr != NULL ||
@@ -292,18 +292,18 @@
         memcpy(&gai.req.hints, hints, sizeof(struct addrinfo));
     }
 
-    r = io->ops->misc(io, MXRIO_GETADDRINFO, 0, sizeof(mxrio_gai_reply_t),
+    r = io->ops->misc(io, ZXRIO_GETADDRINFO, 0, sizeof(zxrio_gai_reply_t),
                       &gai, sizeof(gai));
     io->ops->close(io);
-    mxio_release(io);
+    fdio_release(io);
 
     if (r < 0) {
-        errno = mxio_status_to_errno(r);
+        errno = fdio_status_to_errno(r);
         return EAI_SYSTEM;
     }
     if (gai.reply.retval == 0) {
         // alloc the memory for the out param
-        mxrio_gai_reply_t* reply = calloc(1, sizeof(*reply));
+        zxrio_gai_reply_t* reply = calloc(1, sizeof(*reply));
         // copy the reply
         memcpy(reply, &gai.reply, sizeof(*reply));
 
@@ -335,15 +335,15 @@
         return ERRNO(EINVAL);
     }
 
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
 
-    mxrio_sockaddr_reply_t reply;
-    mx_status_t r = io->ops->misc(io, op, 0, sizeof(mxrio_sockaddr_reply_t),
+    zxrio_sockaddr_reply_t reply;
+    zx_status_t r = io->ops->misc(io, op, 0, sizeof(zxrio_sockaddr_reply_t),
                                   &reply, sizeof(reply));
-    mxio_release(io);
+    fdio_release(io);
 
     if (r < 0) {
         return ERROR(r);
@@ -358,25 +358,25 @@
 
 int getsockname(int fd, struct sockaddr* restrict addr, socklen_t* restrict len)
 {
-    return getsockaddr(fd, MXRIO_GETSOCKNAME, addr, len);
+    return getsockaddr(fd, ZXRIO_GETSOCKNAME, addr, len);
 }
 
 int getpeername(int fd, struct sockaddr* restrict addr, socklen_t* restrict len)
 {
-    return getsockaddr(fd, MXRIO_GETPEERNAME, addr, len);
+    return getsockaddr(fd, ZXRIO_GETPEERNAME, addr, len);
 }
 
-static mx_status_t mxio_getsockopt(mxio_t* io, int level, int optname,
+static zx_status_t fdio_getsockopt(fdio_t* io, int level, int optname,
                             void* restrict optval, socklen_t* restrict optlen) {
     if (optval == NULL || optlen == NULL) {
         return ERRNO(EINVAL);
     }
 
-    mxrio_sockopt_req_reply_t req_reply;
+    zxrio_sockopt_req_reply_t req_reply;
     req_reply.level = level;
     req_reply.optname = optname;
-    mx_status_t r = io->ops->misc(io, MXRIO_GETSOCKOPT, 0,
-                                  sizeof(mxrio_sockopt_req_reply_t),
+    zx_status_t r = io->ops->misc(io, ZXRIO_GETSOCKOPT, 0,
+                                  sizeof(zxrio_sockopt_req_reply_t),
                                   &req_reply, sizeof(req_reply));
     if (r < 0) {
         return r;
@@ -386,53 +386,53 @@
     memcpy(optval, req_reply.optval,
            (avail < req_reply.optlen) ? avail : req_reply.optlen);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 int getsockopt(int fd, int level, int optname, void* restrict optval,
                socklen_t* restrict optlen) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
 
-    mx_status_t r;
-    r = mxio_getsockopt(io, level, optname, optval, optlen);
-    mxio_release(io);
+    zx_status_t r;
+    r = fdio_getsockopt(io, level, optname, optval, optlen);
+    fdio_release(io);
 
     return STATUS(r);
 }
 
 int setsockopt(int fd, int level, int optname, const void* optval,
                socklen_t optlen) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
 
-    mxrio_sockopt_req_reply_t req;
+    zxrio_sockopt_req_reply_t req;
     req.level = level;
     req.optname = optname;
     if (optlen > sizeof(req.optval)) {
-        mxio_release(io);
+        fdio_release(io);
         return ERRNO(EINVAL);
     }
     memcpy(req.optval, optval, optlen);
     req.optlen = optlen;
-    mx_status_t r = io->ops->misc(io, MXRIO_SETSOCKOPT, 0, 0, &req,
+    zx_status_t r = io->ops->misc(io, ZXRIO_SETSOCKOPT, 0, 0, &req,
                                   sizeof(req));
-    mxio_release(io);
+    fdio_release(io);
     return STATUS(r);
 }
 
-static ssize_t mxio_recvmsg(mxio_t* io, struct msghdr* msg, int flags) {
-    mx_status_t r = io->ops->recvmsg(io, msg, flags);
+static ssize_t fdio_recvmsg(fdio_t* io, struct msghdr* msg, int flags) {
+    zx_status_t r = io->ops->recvmsg(io, msg, flags);
     // TODO(MG-974): audit error codes
-    if (r == MX_ERR_WRONG_TYPE)
+    if (r == ZX_ERR_WRONG_TYPE)
         return ERRNO(ENOTSOCK);
-    else if (r == MX_ERR_BAD_STATE)
+    else if (r == ZX_ERR_BAD_STATE)
         return ERRNO(ENOTCONN);
-    else if (r == MX_ERR_ALREADY_EXISTS)
+    else if (r == ZX_ERR_ALREADY_EXISTS)
         return ERRNO(EISCONN);
     return STATUS(r);
 }
diff --git a/system/ulib/mxio/dispatcher.c b/system/ulib/fdio/dispatcher.c
similarity index 62%
rename from system/ulib/mxio/dispatcher.c
rename to system/ulib/fdio/dispatcher.c
index 1cceb64..b76c509 100644
--- a/system/ulib/mxio/dispatcher.c
+++ b/system/ulib/fdio/dispatcher.c
@@ -8,12 +8,12 @@
 #include <string.h>
 #include <threads.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
-#include <mxio/dispatcher.h>
-#include <magenta/listnode.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
+#include <fdio/dispatcher.h>
+#include <zircon/listnode.h>
 
-// Eventually we want to use the repeating version of mx_object_wait_async,
+// Eventually we want to use the repeating version of zx_object_wait_async,
 // but it is not ready for prime time yet.  This feature flag enables testing.
 #define USE_WAIT_ONCE 1
 
@@ -27,9 +27,9 @@
 
 typedef struct {
     list_node_t node;
-    mx_handle_t h;
+    zx_handle_t h;
     uint32_t flags;
-    mxio_dispatcher_cb_t cb;
+    fdio_dispatcher_cb_t cb;
     void* func;
     void* cookie;
 } handler_t;
@@ -38,26 +38,26 @@
 #define FLAG_DISCONNECTED 1
 #endif
 
-struct mxio_dispatcher {
+struct fdio_dispatcher {
     mtx_t lock;
     list_node_t list;
-    mx_handle_t port;
-    mxio_dispatcher_cb_t default_cb;
+    zx_handle_t port;
+    fdio_dispatcher_cb_t default_cb;
     thrd_t t;
 };
 
-static void mxio_dispatcher_destroy(mxio_dispatcher_t* md) {
-    mx_handle_close(md->port);
+static void fdio_dispatcher_destroy(fdio_dispatcher_t* md) {
+    zx_handle_close(md->port);
     free(md);
 }
 
-static void destroy_handler(mxio_dispatcher_t* md, handler_t* handler, bool need_close_cb) {
+static void destroy_handler(fdio_dispatcher_t* md, handler_t* handler, bool need_close_cb) {
     if (need_close_cb) {
         handler->cb(0, handler->func, handler->cookie);
     }
 
-    mx_handle_close(handler->h);
-    handler->h = MX_HANDLE_INVALID;
+    zx_handle_close(handler->h);
+    handler->h = ZX_HANDLE_INVALID;
 
     mtx_lock(&md->lock);
     list_delete(&handler->node);
@@ -69,14 +69,14 @@
 // used during teardown.
 #define SIGNAL_NEEDS_CLOSE_CB 1u
 
-static void disconnect_handler(mxio_dispatcher_t* md, handler_t* handler, bool need_close_cb) {
+static void disconnect_handler(fdio_dispatcher_t* md, handler_t* handler, bool need_close_cb) {
     xprintf("dispatcher: disconnect: %p / %x\n", handler, handler->h);
 
 #if USE_WAIT_ONCE
     destroy_handler(md, handler, need_close_cb);
 #else
     // Cancel the async wait operations.
-    mx_status_t r = mx_port_cancel(md->port, handler->h, (uint64_t)(uintptr_t)handler);
+    zx_status_t r = zx_port_cancel(md->port, handler->h, (uint64_t)(uintptr_t)handler);
     if (r) {
         printf("dispatcher: CANCEL FAILED %d\n", r);
     }
@@ -84,10 +84,10 @@
     // send a synthetic message so we know when it's safe to destroy
     // TODO: once cancel guarantees no packets will arrive after,
     // we can just destroy the object here instead of doing this...
-    mx_port_packet_t packet;
+    zx_port_packet_t packet;
     packet.key = (uint64_t)(uintptr_t)handler;
     packet.signal.observed = need_close_cb ? SIGNAL_NEEDS_CLOSE_CB : 0;
-    r = mx_port_queue(md->port, &packet, 0);
+    r = zx_port_queue(md->port, &packet, 0);
     if (r) {
         printf("dispatcher: PORT QUEUE FAILED %d\n", r);
     }
@@ -97,14 +97,14 @@
 #endif
 }
 
-static int mxio_dispatcher_thread(void* _md) {
-    mxio_dispatcher_t* md = _md;
-    mx_status_t r;
+static int fdio_dispatcher_thread(void* _md) {
+    fdio_dispatcher_t* md = _md;
+    zx_status_t r;
     xprintf("dispatcher: start %p\n", md);
 
     for (;;) {
-        mx_port_packet_t packet;
-        if ((r = mx_port_wait(md->port, MX_TIME_INFINITE, &packet, 0)) < 0) {
+        zx_port_packet_t packet;
+        if ((r = zx_port_wait(md->port, ZX_TIME_INFINITE, &packet, 0)) < 0) {
             printf("dispatcher: port wait failed %d\n", r);
             break;
         }
@@ -113,7 +113,7 @@
         if (handler->flags & FLAG_DISCONNECTED) {
             // handler is awaiting gc
             // ignore events for it until we get the synthetic "destroy" event
-            if (packet.type == MX_PKT_TYPE_USER) {
+            if (packet.type == ZX_PKT_TYPE_USER) {
                 destroy_handler(md, handler, packet.signal.observed & SIGNAL_NEEDS_CLOSE_CB);
                 printf("dispatcher: destroy %p\n", handler);
             } else {
@@ -122,87 +122,87 @@
             continue;
         }
 #endif
-        if (packet.signal.observed & MX_CHANNEL_READABLE) {
+        if (packet.signal.observed & ZX_CHANNEL_READABLE) {
             if ((r = handler->cb(handler->h, handler->func, handler->cookie)) != 0) {
                 if (r == ERR_DISPATCHER_NO_WORK) {
-                    printf("mxio: dispatcher found no work to do!\n");
+                    printf("fdio: dispatcher found no work to do!\n");
                 } else {
                     disconnect_handler(md, handler, r != ERR_DISPATCHER_DONE);
                     continue;
                 }
             }
 #if USE_WAIT_ONCE
-            if ((r = mx_object_wait_async(handler->h, md->port, (uint64_t)(uintptr_t)handler,
-                                          MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                                          MX_WAIT_ASYNC_ONCE)) < 0) {
+            if ((r = zx_object_wait_async(handler->h, md->port, (uint64_t)(uintptr_t)handler,
+                                          ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                                          ZX_WAIT_ASYNC_ONCE)) < 0) {
                 printf("dispatcher: could not re-arm: %p\n", handler);
             }
 #endif
             continue;
         }
-        if (packet.signal.observed & MX_CHANNEL_PEER_CLOSED) {
+        if (packet.signal.observed & ZX_CHANNEL_PEER_CLOSED) {
             // synthesize a close
             disconnect_handler(md, handler, true);
         }
     }
 
     xprintf("dispatcher: FATAL ERROR, EXITING\n");
-    mxio_dispatcher_destroy(md);
-    return MX_OK;
+    fdio_dispatcher_destroy(md);
+    return ZX_OK;
 }
 
-mx_status_t mxio_dispatcher_create(mxio_dispatcher_t** out, mxio_dispatcher_cb_t cb) {
-    mxio_dispatcher_t* md;
+zx_status_t fdio_dispatcher_create(fdio_dispatcher_t** out, fdio_dispatcher_cb_t cb) {
+    fdio_dispatcher_t* md;
     if ((md = calloc(1, sizeof(*md))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    xprintf("mxio_dispatcher_create: %p\n", md);
+    xprintf("fdio_dispatcher_create: %p\n", md);
     list_initialize(&md->list);
     mtx_init(&md->lock, mtx_plain);
-    mx_status_t status;
-    if ((status = mx_port_create(0, &md->port)) < 0) {
+    zx_status_t status;
+    if ((status = zx_port_create(0, &md->port)) < 0) {
         free(md);
         return status;
     }
     md->default_cb = cb;
     *out = md;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mxio_dispatcher_start(mxio_dispatcher_t* md, const char* name) {
-    mx_status_t r;
+zx_status_t fdio_dispatcher_start(fdio_dispatcher_t* md, const char* name) {
+    zx_status_t r;
     mtx_lock(&md->lock);
     if (md->t == NULL) {
-        if (thrd_create_with_name(&md->t, mxio_dispatcher_thread, md, name) != thrd_success) {
-            mxio_dispatcher_destroy(md);
-            r = MX_ERR_NO_RESOURCES;
+        if (thrd_create_with_name(&md->t, fdio_dispatcher_thread, md, name) != thrd_success) {
+            fdio_dispatcher_destroy(md);
+            r = ZX_ERR_NO_RESOURCES;
         } else {
             thrd_detach(md->t);
-            r = MX_OK;
+            r = ZX_OK;
         }
     } else {
-        r = MX_ERR_BAD_STATE;
+        r = ZX_ERR_BAD_STATE;
     }
     mtx_unlock(&md->lock);
     return r;
 }
 
-void mxio_dispatcher_run(mxio_dispatcher_t* md) {
-    mxio_dispatcher_thread(md);
+void fdio_dispatcher_run(fdio_dispatcher_t* md) {
+    fdio_dispatcher_thread(md);
 }
 
-mx_status_t mxio_dispatcher_add(mxio_dispatcher_t* md, mx_handle_t h, void* func, void* cookie) {
-    return mxio_dispatcher_add_etc(md, h, md->default_cb, func, cookie);
+zx_status_t fdio_dispatcher_add(fdio_dispatcher_t* md, zx_handle_t h, void* func, void* cookie) {
+    return fdio_dispatcher_add_etc(md, h, md->default_cb, func, cookie);
 }
 
-mx_status_t mxio_dispatcher_add_etc(mxio_dispatcher_t* md, mx_handle_t h,
-                                    mxio_dispatcher_cb_t cb,
+zx_status_t fdio_dispatcher_add_etc(fdio_dispatcher_t* md, zx_handle_t h,
+                                    fdio_dispatcher_cb_t cb,
                                     void* func, void* cookie) {
     handler_t* handler;
-    mx_status_t r;
+    zx_status_t r;
 
     if ((handler = malloc(sizeof(handler_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     handler->h = h;
     handler->flags = 0;
@@ -213,15 +213,15 @@
     mtx_lock(&md->lock);
     list_add_tail(&md->list, &handler->node);
 #if USE_WAIT_ONCE
-    if ((r = mx_object_wait_async(h, md->port, (uint64_t)(uintptr_t)handler,
-                                  MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                                  MX_WAIT_ASYNC_ONCE)) < 0) {
+    if ((r = zx_object_wait_async(h, md->port, (uint64_t)(uintptr_t)handler,
+                                  ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                                  ZX_WAIT_ASYNC_ONCE)) < 0) {
         list_delete(&handler->node);
     }
 #else
-    if ((r = mx_object_wait_async(h, md->port, (uint64_t)(uintptr_t)handler,
-                                  MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                                  MX_WAIT_ASYNC_REPEATING)) < 0) {
+    if ((r = zx_object_wait_async(h, md->port, (uint64_t)(uintptr_t)handler,
+                                  ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                                  ZX_WAIT_ASYNC_REPEATING)) < 0) {
         list_delete(&handler->node);
     }
 #endif
diff --git a/system/ulib/fdio/get-vmo.c b/system/ulib/fdio/get-vmo.c
new file mode 100644
index 0000000..856ec1f
--- /dev/null
+++ b/system/ulib/fdio/get-vmo.c
@@ -0,0 +1,170 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "private.h"
+#include "unistd.h"
+
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+
+#include <fdio/io.h>
+#include <fdio/remoteio.h>
+#include <fdio/vfs.h>
+
+#define MIN_WINDOW (PAGE_SIZE * 4)
+#define MAX_WINDOW ((size_t)64 << 20)
+
+static zx_status_t read_at(fdio_t* io, void* buf, size_t len, off_t offset,
+                           size_t* actual_len) {
+    zx_status_t status;
+    while ((status = fdio_read_at(io, buf, len, offset)) == ZX_ERR_SHOULD_WAIT) {
+        status = fdio_wait(io, FDIO_EVT_READABLE, ZX_TIME_INFINITE, NULL);
+        if (status != ZX_OK)
+            return status;
+    }
+    if (status < 0)
+        return status;
+    if (status == 0) // EOF (?)
+        return ZX_ERR_OUT_OF_RANGE;
+    *actual_len = status;
+    return ZX_OK;
+}
+
+static zx_status_t read_file_into_vmo(fdio_t* io, zx_handle_t* out_vmo) {
+    zx_handle_t current_vmar_handle = zx_vmar_root_self();
+
+    vnattr_t attr;
+    int r = io->ops->misc(io, ZXRIO_STAT, 0, sizeof(attr), &attr, 0);
+    if (r < 0)
+        return ZX_ERR_BAD_HANDLE;
+    if (r < (int)sizeof(attr))
+        return ZX_ERR_IO;
+
+    uint64_t size = attr.size;
+    uint64_t offset = 0;
+
+    zx_status_t status = zx_vmo_create(size, 0, out_vmo);
+    if (status != ZX_OK)
+        return status;
+
+    while (size > 0) {
+        if (size < MIN_WINDOW) {
+            // There is little enough left that copying is less overhead
+            // than fiddling with the page tables.
+            char buffer[PAGE_SIZE];
+            size_t xfer = size < sizeof(buffer) ? size : sizeof(buffer);
+            size_t nread;
+            status = read_at(io, buffer, xfer, offset, &nread);
+            if (status != ZX_OK) {
+                zx_handle_close(*out_vmo);
+                return status;
+            }
+            size_t n;
+            status = zx_vmo_write(*out_vmo, buffer, offset, nread, &n);
+            if (status < 0) {
+                zx_handle_close(*out_vmo);
+                return status;
+            }
+            if (n != (size_t)nread) {
+                zx_handle_close(*out_vmo);
+                return ZX_ERR_IO;
+            }
+            offset += nread;
+            size -= nread;
+        } else {
+            // Map the VMO into our own address space so we can read into
+            // it directly and avoid double-buffering.
+            size_t chunk = size < MAX_WINDOW ? size : MAX_WINDOW;
+            size_t window = (chunk + PAGE_SIZE - 1) & -PAGE_SIZE;
+            uintptr_t start = 0;
+            status = zx_vmar_map(
+                current_vmar_handle, 0, *out_vmo, offset, window,
+                ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &start);
+            if (status != ZX_OK) {
+                zx_handle_close(*out_vmo);
+                return status;
+            }
+            uint8_t* buffer = (void*)start;
+            while (chunk > 0) {
+                size_t nread;
+                status = read_at(io, buffer, chunk, offset, &nread);
+                if (status != ZX_OK) {
+                    zx_vmar_unmap(current_vmar_handle, start, window);
+                    zx_handle_close(*out_vmo);
+                    return status;
+                }
+                buffer += nread;
+                offset += nread;
+                size -= nread;
+                chunk -= nread;
+            }
+            zx_vmar_unmap(current_vmar_handle, start, window);
+        }
+    }
+
+    return ZX_OK;
+}
+
+static zx_status_t get_file_vmo(fdio_t* io, zx_handle_t* out_vmo) {
+    zx_handle_t vmo;
+    size_t offset, len;
+    zx_status_t status = io->ops->get_vmo(io, &vmo, &offset, &len);
+    if (status != ZX_OK)
+        return status;
+    // Clone a private copy of it at the offset/length returned with
+    // the handle.
+    // TODO(mcgrathr): Create a plain read only clone when the feature
+    // is implemented in the VM.
+    status = zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE, offset, len, out_vmo);
+    zx_handle_close(vmo);
+    return status;
+}
+
+zx_status_t fdio_get_vmo(int fd, zx_handle_t* out_vmo) {
+    fdio_t* io = fd_to_io(fd);
+    if (io == NULL)
+        return ZX_ERR_BAD_HANDLE;
+
+    zx_handle_t vmo;
+    zx_status_t status = get_file_vmo(io, &vmo);
+    if (status != ZX_OK)
+        status = read_file_into_vmo(io, &vmo);
+    fdio_release(io);
+
+    if (status == ZX_OK) {
+        status = zx_handle_replace(
+            vmo,
+            ZX_RIGHT_READ | ZX_RIGHT_EXECUTE | ZX_RIGHT_MAP |
+            ZX_RIGHT_TRANSFER | ZX_RIGHT_DUPLICATE |
+            ZX_RIGHT_GET_PROPERTY | ZX_RIGHT_SET_PROPERTY,
+            out_vmo);
+        if (status != ZX_OK)
+            zx_handle_close(vmo);
+    }
+
+    return status;
+}
+
+zx_status_t fdio_get_exact_vmo(int fd, zx_handle_t* out_vmo) {
+    fdio_t* io = fd_to_io(fd);
+    if (io == NULL)
+        return ZX_ERR_BAD_HANDLE;
+
+    zx_handle_t vmo;
+    size_t offset, len;
+    zx_status_t status = io->ops->get_vmo(io, &vmo, &offset, &len);
+    fdio_release(io);
+
+    if (status != ZX_OK)
+        return status;
+
+    size_t vmo_size;
+    if (offset != 0 || zx_vmo_get_size(vmo, &vmo_size) != ZX_OK || vmo_size != len) {
+        zx_handle_close(vmo);
+        return ZX_ERR_NOT_FOUND;
+     }
+
+    *out_vmo = vmo;
+    return ZX_OK;
+}
diff --git a/system/ulib/mxio/include/mxio/debug.h b/system/ulib/fdio/include/fdio/debug.h
similarity index 92%
rename from system/ulib/mxio/include/mxio/debug.h
rename to system/ulib/fdio/include/fdio/debug.h
index 2a1dfc9..dac2d04 100644
--- a/system/ulib/mxio/include/mxio/debug.h
+++ b/system/ulib/fdio/include/fdio/debug.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdio.h>
 
 __BEGIN_CDECLS
diff --git a/system/ulib/mxio/include/mxio/dispatcher.h b/system/ulib/fdio/include/fdio/dispatcher.h
similarity index 67%
rename from system/ulib/mxio/include/mxio/dispatcher.h
rename to system/ulib/fdio/include/fdio/dispatcher.h
index fac1cb5..cdf2d60 100644
--- a/system/ulib/mxio/include/mxio/dispatcher.h
+++ b/system/ulib/fdio/include/fdio/dispatcher.h
@@ -4,15 +4,15 @@
 
 #pragma once
 
-#include <magenta/types.h>
-#include <magenta/compiler.h>
-#include <mxio/remoteio.h>
+#include <zircon/types.h>
+#include <zircon/compiler.h>
+#include <fdio/remoteio.h>
 
 __BEGIN_CDECLS
 
-typedef struct mxio_dispatcher mxio_dispatcher_t;
+typedef struct fdio_dispatcher fdio_dispatcher_t;
 
-typedef mx_status_t (*mxio_dispatcher_cb_t)(mx_handle_t h, void* func, void* cookie);
+typedef zx_status_t (*fdio_dispatcher_cb_t)(zx_handle_t h, void* func, void* cookie);
 
 // Create a dispatcher that will process messages from many channels.
 //
@@ -25,21 +25,21 @@
 // A non-zero return will cause the handle to be closed.  If the non-zero
 // return is *negative*, the handler will be called one last time, as if
 // the channel had been closed remotely (zero handle).
-mx_status_t mxio_dispatcher_create(mxio_dispatcher_t** out, mxio_dispatcher_cb_t cb);
+zx_status_t fdio_dispatcher_create(fdio_dispatcher_t** out, fdio_dispatcher_cb_t cb);
 
 // create a thread for a dispatcher and start it running
-mx_status_t mxio_dispatcher_start(mxio_dispatcher_t* md, const char* name);
+zx_status_t fdio_dispatcher_start(fdio_dispatcher_t* md, const char* name);
 
 // run the dispatcher loop on the current thread, never to return
-void mxio_dispatcher_run(mxio_dispatcher_t* md);
+void fdio_dispatcher_run(fdio_dispatcher_t* md);
 
 // add a channel to the dispatcher, using the default callback
-mx_status_t mxio_dispatcher_add(mxio_dispatcher_t* md, mx_handle_t h,
+zx_status_t fdio_dispatcher_add(fdio_dispatcher_t* md, zx_handle_t h,
                                 void* func, void* cookie);
 
 // add a channel to the dispatcher, using a specified callback
-mx_status_t mxio_dispatcher_add_etc(mxio_dispatcher_t* md, mx_handle_t h,
-                                    mxio_dispatcher_cb_t callback,
+zx_status_t fdio_dispatcher_add_etc(fdio_dispatcher_t* md, zx_handle_t h,
+                                    fdio_dispatcher_cb_t callback,
                                     void* func, void* cookie);
 
 __END_CDECLS
diff --git a/system/ulib/fdio/include/fdio/io.h b/system/ulib/fdio/include/fdio/io.h
new file mode 100644
index 0000000..c9ef169
--- /dev/null
+++ b/system/ulib/fdio/include/fdio/io.h
@@ -0,0 +1,73 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <limits.h>
+#include <poll.h>
+#include <stdbool.h>
+#include <unistd.h> // for ssize_t
+
+#include <zircon/types.h>
+#include <zircon/compiler.h>
+
+#include <fdio/limits.h>
+
+// flag on handle args in processargs
+// instructing that this fd should be dup'd to 0/1/2
+// and be used for all of stdio
+#define FDIO_FLAG_USE_FOR_STDIO 0x8000
+
+#define FDIO_NONBLOCKING 1
+
+#define FDIO_PROTOCOL_UNDEFINED 0
+#define FDIO_PROTOCOL_PIPE 1
+#define FDIO_PROTOCOL_REMOTE 2
+#define FDIO_PROTOCOL_VMOFILE 3
+#define FDIO_PROTOCOL_SOCKET 4
+#define FDIO_PROTOCOL_SERVICE 5
+#define FDIO_PROTOCOL_SOCKET_CONNECTED 6
+
+// events for fdio_wait_fd()
+#define FDIO_EVT_READABLE POLLIN
+#define FDIO_EVT_WRITABLE POLLOUT
+#define FDIO_EVT_ERROR POLLERR
+#define FDIO_EVT_PEER_CLOSED POLLRDHUP
+#define FDIO_EVT_ALL (POLLIN | POLLOUT | POLLERR | POLLRDHUP)
+
+__BEGIN_CDECLS
+
+// wait until one or more events are pending
+zx_status_t fdio_wait_fd(int fd, uint32_t events, uint32_t* pending, zx_time_t deadline);
+
+// create a fd that works with wait APIs (epoll, select, etc.) from a handle
+// and expected signals (signals_in/signals_out correspond to POLLIN/POLLOUT
+// events respectively). the handle will be closed when the fd is closed, unless
+// shared_handle is true.
+int fdio_handle_fd(zx_handle_t h, zx_signals_t signals_in, zx_signals_t signals_out, bool shared_handle);
+
+// invoke a raw fdio ioctl
+ssize_t fdio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len);
+
+// create a pipe, installing one half in a fd, returning the other
+// for transport to another process
+zx_status_t fdio_pipe_half(zx_handle_t* handle, uint32_t* type);
+
+// Get a read-only VMO containing the whole contents of the file.
+// This function creates a clone of the underlying VMO when possible, falling
+// back to eagerly reading the contents into a freshly-created VMO.
+zx_status_t fdio_get_vmo(int fd, zx_handle_t* out_vmo);
+
+// Get a read-only handle to the exact VMO used by the file system server to
+// represent the file. This function fails if the server does not have an exact
+// VMO representation of the file (e.g., if fdio_get_vmo would need to copy the
+// data into a new VMO).
+zx_status_t fdio_get_exact_vmo(int fd, zx_handle_t* out_vmo);
+
+// create a fd that is backed by the given range of the vmo.
+// This function takes ownership of the vmo and will close the vmo when the fd
+// is closed.
+int fdio_vmo_fd(zx_handle_t vmo, uint64_t offset, uint64_t length);
+
+__END_CDECLS
diff --git a/system/ulib/mxio/include/mxio/limits.h b/system/ulib/fdio/include/fdio/limits.h
similarity index 65%
rename from system/ulib/mxio/include/mxio/limits.h
rename to system/ulib/fdio/include/fdio/limits.h
index b6d1674..807e766 100644
--- a/system/ulib/mxio/include/mxio/limits.h
+++ b/system/ulib/fdio/include/fdio/limits.h
@@ -7,17 +7,17 @@
 #include <limits.h>
 
 // Maximum number of fds per process.
-#define MAX_MXIO_FD 256
+#define MAX_FDIO_FD 256
 
 // Maximum handles used in open/clone/create.
-#define MXIO_MAX_HANDLES 3
+#define FDIO_MAX_HANDLES 3
 
-// mxio_ops_t's read/write are able to do io of
+// fdio_ops_t's read/write are able to do io of
 // at least this size.
-#define MXIO_CHUNK_SIZE 8192
+#define FDIO_CHUNK_SIZE 8192
 
 // Maximum size for an ioctl input.
-#define MXIO_IOCTL_MAX_INPUT 1024
+#define FDIO_IOCTL_MAX_INPUT 1024
 
 // Maxium length of a filename.
-#define MXIO_MAX_FILENAME NAME_MAX
+#define FDIO_MAX_FILENAME NAME_MAX
diff --git a/system/ulib/mxio/include/mxio/namespace.h b/system/ulib/fdio/include/fdio/namespace.h
similarity index 63%
rename from system/ulib/mxio/include/mxio/namespace.h
rename to system/ulib/fdio/include/fdio/namespace.h
index e727fe9..9f2b87b 100644
--- a/system/ulib/mxio/include/mxio/namespace.h
+++ b/system/ulib/fdio/include/fdio/namespace.h
@@ -6,20 +6,20 @@
 
 #include <stdint.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
-typedef struct mxio_namespace mxio_ns_t;
+typedef struct fdio_namespace fdio_ns_t;
 
 
 // Create a new, empty namespace
-mx_status_t mxio_ns_create(mxio_ns_t** out);
+zx_status_t fdio_ns_create(fdio_ns_t** out);
 
 // Destroy and deallocate a namespace
-// Will fail (MX_ERR_BAD_STATE) if the namespace is in use.
-mx_status_t mxio_ns_destroy(mxio_ns_t* ns);
+// Will fail (ZX_ERR_BAD_STATE) if the namespace is in use.
+zx_status_t fdio_ns_destroy(fdio_ns_t* ns);
 
 // Create a new directory within a namespace, bound to the
 // directory-protocol-compatible handle h
@@ -29,8 +29,8 @@
 //
 // The handle is not closed on failure.
 //
-// Will fail with MX_ERR_BAD_STATE if the namespace is in use.
-mx_status_t mxio_ns_bind(mxio_ns_t* ns, const char* path, mx_handle_t h);
+// Will fail with ZX_ERR_BAD_STATE if the namespace is in use.
+zx_status_t fdio_ns_bind(fdio_ns_t* ns, const char* path, zx_handle_t h);
 
 // Create a new directory within a namespace, bound to the
 // directory referenced by the file descriptor fd.
@@ -41,40 +41,40 @@
 // The fd is not closed on success or failure.
 // Closing the fd after success does not affect namespace.
 //
-// Will fail with MX_ERR_BAD_STATE if the namespace is in use.
-mx_status_t mxio_ns_bind_fd(mxio_ns_t* ns, const char* path, int fd);
+// Will fail with ZX_ERR_BAD_STATE if the namespace is in use.
+zx_status_t fdio_ns_bind_fd(fdio_ns_t* ns, const char* path, int fd);
 
 // Open the root directory of the namespace as a file descriptor
-int mxio_ns_opendir(mxio_ns_t* ns);
+int fdio_ns_opendir(fdio_ns_t* ns);
 
 // chdir to / in the provided namespace
-mx_status_t mxio_ns_chdir(mxio_ns_t* ns);
+zx_status_t fdio_ns_chdir(fdio_ns_t* ns);
 
-// Replace the mxio "global" namespace with the provided namespace
-mx_status_t mxio_ns_install(mxio_ns_t* ns);
+// Replace the fdio "global" namespace with the provided namespace
+zx_status_t fdio_ns_install(fdio_ns_t* ns);
 
 
-typedef struct mxio_flat_namespace {
+typedef struct fdio_flat_namespace {
     size_t count;
-    mx_handle_t* handle;
+    zx_handle_t* handle;
     uint32_t* type;
     const char* const* path;
-} mxio_flat_namespace_t;
+} fdio_flat_namespace_t;
 
-// On success the caller takes ownership of a mxio_flat_namespace_t
+// On success the caller takes ownership of a fdio_flat_namespace_t
 // containing a flat representation of the exported namespace (the
 // one provided in 'ns' or the active root namespace, respectively.)
 // The handles are CLONEs of the handles in the namespace and also
 // belong to the caller.
 // The whole data structure can be released with free(), keeping in
 // mind that the handles should be used or closed first.
-mx_status_t mxio_ns_export(mxio_ns_t* ns, mxio_flat_namespace_t** out);
-mx_status_t mxio_ns_export_root(mxio_flat_namespace_t** out);
+zx_status_t fdio_ns_export(fdio_ns_t* ns, fdio_flat_namespace_t** out);
+zx_status_t fdio_ns_export_root(fdio_flat_namespace_t** out);
 
 // Attempt to connect to a service through the namespace.
 // The handle is always consumed.  It will be closed on error
 // or passed to the remote service on success.
 // The path must be an absolute path starting with / and containing
 // no ".." or "." or empty segments.
-mx_status_t mxio_ns_connect(mxio_ns_t* ns, const char* path, mx_handle_t h);
+zx_status_t fdio_ns_connect(fdio_ns_t* ns, const char* path, zx_handle_t h);
 __END_CDECLS;
diff --git a/system/ulib/fdio/include/fdio/private.h b/system/ulib/fdio/include/fdio/private.h
new file mode 100644
index 0000000..852519d
--- /dev/null
+++ b/system/ulib/fdio/include/fdio/private.h
@@ -0,0 +1,66 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <stdint.h>
+
+__BEGIN_CDECLS;
+
+// WARNING: These APIs are subject to change
+
+// __fdio_cleanpath cleans an input path, placing the output
+// in out, which is a buffer of at least "PATH_MAX" bytes.
+//
+// 'outlen' returns the length of the path placed in out, and 'is_dir'
+// is set to true if the returned path must be a directory.
+zx_status_t __fdio_cleanpath(const char* in, char* out, size_t* outlen, bool* is_dir);
+
+// WARNING: These interfaces exist to allow integration of fdio file
+// descriptors with handle-centric message loops.  If used incorrectly
+// they can seriously mess up the state of fdio, fds, etc.
+
+typedef struct fdio fdio_t;
+
+
+// This looks up a file descriptor, and if it exists,
+// upreferences the fdio_t under it and returns that.
+//
+// If the fd does not exist, it returns NULL
+fdio_t* __fdio_fd_to_io(int fd);
+
+// Releases a reference on a fdio_t.  Used to "return"
+// a fdio_t obtained from __fdio_fd_to_io() when you're
+// done with it.
+void __fdio_release(fdio_t* io);
+
+
+// This given a fdio_t, and a bitmask of posix-style events
+// (EPOLLIN, EPOLLOUT, EPOLLERR), this returns a handle that
+// may be waited upon and a  bitmask of which signals to
+// wait on for the desired events.
+//
+// The handle belongs to the fdio_t, is not duplicated,
+// and may be closed() by the fdio library but MUST NOT
+// be closed by the caller.
+//
+// If waiting is not supported by this fdio_t, the returned
+// handle is ZX_HANDLE_INVALID.
+//
+// This function is only safe to call on a fdio_t you
+// hold a reference to.
+void __fdio_wait_begin(fdio_t* io, uint32_t events,
+                       zx_handle_t* handle_out, zx_signals_t* signals_out);
+
+// This given a set of signals observed on a handle obtained
+// from __fdio_wait_begin() returns a set of posix-style events
+// that are indicated.
+//
+// This function is only safe to call on a fdio_t you
+// hold a reference to.
+void __fdio_wait_end(fdio_t* io, zx_signals_t signals, uint32_t* events_out);
+
+__END_CDECLS;
diff --git a/system/ulib/mxio/include/mxio/remoteio.h b/system/ulib/fdio/include/fdio/remoteio.h
similarity index 65%
rename from system/ulib/mxio/include/mxio/remoteio.h
rename to system/ulib/fdio/include/fdio/remoteio.h
index 2078d14..2c04841 100644
--- a/system/ulib/mxio/include/mxio/remoteio.h
+++ b/system/ulib/fdio/include/fdio/remoteio.h
@@ -4,10 +4,10 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
-#include <mxio/limits.h>
+#include <fdio/limits.h>
 
 #include <assert.h>
 #include <limits.h>
@@ -17,47 +17,47 @@
 
 // clang-format off
 
-#define MXRIO_HDR_SZ       (__builtin_offsetof(mxrio_msg_t, data))
+#define ZXRIO_HDR_SZ       (__builtin_offsetof(zxrio_msg_t, data))
 
-#define MXRIO_ONE_HANDLE   0x00000100
+#define ZXRIO_ONE_HANDLE   0x00000100
 
-#define MXRIO_STATUS       0x00000000
-#define MXRIO_CLOSE        0x00000001
-#define MXRIO_CLONE       (0x00000002 | MXRIO_ONE_HANDLE)
-#define MXRIO_OPEN        (0x00000003 | MXRIO_ONE_HANDLE)
-#define MXRIO_MISC         0x00000004
-#define MXRIO_READ         0x00000005
-#define MXRIO_WRITE        0x00000006
-#define MXRIO_SEEK         0x00000007
-#define MXRIO_STAT         0x00000008
-#define MXRIO_READDIR      0x00000009
-#define MXRIO_IOCTL        0x0000000a
-#define MXRIO_IOCTL_1H    (0x0000000a | MXRIO_ONE_HANDLE)
-#define MXRIO_UNLINK       0x0000000b
-#define MXRIO_READ_AT      0x0000000c
-#define MXRIO_WRITE_AT     0x0000000d
-#define MXRIO_TRUNCATE     0x0000000e
-#define MXRIO_RENAME      (0x0000000f | MXRIO_ONE_HANDLE)
-#define MXRIO_CONNECT      0x00000010
-#define MXRIO_BIND         0x00000011
-#define MXRIO_LISTEN       0x00000012
-#define MXRIO_GETSOCKNAME  0x00000013
-#define MXRIO_GETPEERNAME  0x00000014
-#define MXRIO_GETSOCKOPT   0x00000015
-#define MXRIO_SETSOCKOPT   0x00000016
-#define MXRIO_GETADDRINFO  0x00000017
-#define MXRIO_SETATTR      0x00000018
-#define MXRIO_SYNC         0x00000019
-#define MXRIO_LINK        (0x0000001a | MXRIO_ONE_HANDLE)
-#define MXRIO_MMAP         0x0000001b
-#define MXRIO_FCNTL        0x0000001c
-#define MXRIO_NUM_OPS      29
+#define ZXRIO_STATUS       0x00000000
+#define ZXRIO_CLOSE        0x00000001
+#define ZXRIO_CLONE       (0x00000002 | ZXRIO_ONE_HANDLE)
+#define ZXRIO_OPEN        (0x00000003 | ZXRIO_ONE_HANDLE)
+#define ZXRIO_MISC         0x00000004
+#define ZXRIO_READ         0x00000005
+#define ZXRIO_WRITE        0x00000006
+#define ZXRIO_SEEK         0x00000007
+#define ZXRIO_STAT         0x00000008
+#define ZXRIO_READDIR      0x00000009
+#define ZXRIO_IOCTL        0x0000000a
+#define ZXRIO_IOCTL_1H    (0x0000000a | ZXRIO_ONE_HANDLE)
+#define ZXRIO_UNLINK       0x0000000b
+#define ZXRIO_READ_AT      0x0000000c
+#define ZXRIO_WRITE_AT     0x0000000d
+#define ZXRIO_TRUNCATE     0x0000000e
+#define ZXRIO_RENAME      (0x0000000f | ZXRIO_ONE_HANDLE)
+#define ZXRIO_CONNECT      0x00000010
+#define ZXRIO_BIND         0x00000011
+#define ZXRIO_LISTEN       0x00000012
+#define ZXRIO_GETSOCKNAME  0x00000013
+#define ZXRIO_GETPEERNAME  0x00000014
+#define ZXRIO_GETSOCKOPT   0x00000015
+#define ZXRIO_SETSOCKOPT   0x00000016
+#define ZXRIO_GETADDRINFO  0x00000017
+#define ZXRIO_SETATTR      0x00000018
+#define ZXRIO_SYNC         0x00000019
+#define ZXRIO_LINK        (0x0000001a | ZXRIO_ONE_HANDLE)
+#define ZXRIO_MMAP         0x0000001b
+#define ZXRIO_FCNTL        0x0000001c
+#define ZXRIO_NUM_OPS      29
 
-#define MXRIO_OP(n)        ((n) & 0x3FF) // opcode
-#define MXRIO_HC(n)        (((n) >> 8) & 3) // handle count
-#define MXRIO_OPNAME(n)    ((n) & 0xFF) // opcode, "name" part only
+#define ZXRIO_OP(n)        ((n) & 0x3FF) // opcode
+#define ZXRIO_HC(n)        (((n) >> 8) & 3) // handle count
+#define ZXRIO_OPNAME(n)    ((n) & 0xFF) // opcode, "name" part only
 
-#define MXRIO_OPNAMES { \
+#define ZXRIO_OPNAMES { \
     "status", "close", "clone", "open", \
     "misc", "read", "write", "seek", \
     "stat", "readdir", "ioctl", "unlink", \
@@ -67,22 +67,22 @@
     "setattr", "sync", "link", "mmap", "fcntl" }
 
 // dispatcher callback return code that there were no messages to read
-#define ERR_DISPATCHER_NO_WORK MX_ERR_SHOULD_WAIT
+#define ERR_DISPATCHER_NO_WORK ZX_ERR_SHOULD_WAIT
 
 // indicates message handed off to another server
 // used by rio remote handler for deferred reply pipe completion
-#define ERR_DISPATCHER_INDIRECT MX_ERR_NEXT
+#define ERR_DISPATCHER_INDIRECT ZX_ERR_NEXT
 
 // indicates that this was a close message and that no further
 // callbacks should be made to the dispatcher
-#define ERR_DISPATCHER_DONE MX_ERR_STOP
+#define ERR_DISPATCHER_DONE ZX_ERR_STOP
 
-const char* mxio_opname(uint32_t op);
+const char* fdio_opname(uint32_t op);
 
-typedef struct mxrio_msg mxrio_msg_t;
+typedef struct zxrio_msg zxrio_msg_t;
 
-typedef mx_status_t (*mxrio_cb_t)(mxrio_msg_t* msg, void* cookie);
-// callback to process a mxrio_msg
+typedef zx_status_t (*zxrio_cb_t)(zxrio_msg_t* msg, void* cookie);
+// callback to process a zxrio_msg
 // - on entry datalen indicates how much valid data is in msg.data[]
 // - return value of ERR_DISPATCHER_INDIRECT indicates that the
 //   reply is being handled by the callback (forwarded to another
@@ -91,51 +91,51 @@
 //   in the rpc response, and msg.len indicates how much valid data
 //   to send.  On error return msg.len will be set to 0.
 
-// a mxio_dispatcher_handler suitable for use with a mxio_dispatcher
-mx_status_t mxrio_handler(mx_handle_t h, void* cb, void* cookie);
+// a fdio_dispatcher_handler suitable for use with a fdio_dispatcher
+zx_status_t zxrio_handler(zx_handle_t h, void* cb, void* cookie);
 
 // the underlying handling for regular rpc or for a synthetic close,
-// called by mxrio_handler.  handle_rpc() processes a single message
+// called by zxrio_handler.  handle_rpc() processes a single message
 // from the provideded channel, returning a negative error value on
 // error or 1 on clean shutdown (indicating no further callbacks
 // should be made).  handle_close() processes a "synthetic" close
 // event (eg, channel was remotely closed), and neither function
 // should be callaed again after handle_close().
-mx_status_t mxrio_handle_rpc(mx_handle_t h, mxrio_msg_t* msg, mxrio_cb_t cb, void* cookie);
-mx_status_t mxrio_handle_close(mxrio_cb_t cb, void* cookie);
+zx_status_t zxrio_handle_rpc(zx_handle_t h, zxrio_msg_t* msg, zxrio_cb_t cb, void* cookie);
+zx_status_t zxrio_handle_close(zxrio_cb_t cb, void* cookie);
 
 // OPEN and CLOSE messages, can be forwarded to another remoteio server,
 // without any need to wait for a reply.  The reply channel from the initial
 // request is passed along to the new server.
 // If the write to the server fails, an error reply is sent to the reply channel.
-void mxrio_txn_handoff(mx_handle_t server, mx_handle_t reply, mxrio_msg_t* msg);
+void zxrio_txn_handoff(zx_handle_t server, zx_handle_t reply, zxrio_msg_t* msg);
 
 
 // OPEN and CLONE ops do not return a reply
 // Instead they receive a channel handle that they write their status
 // and (if successful) type, extra data, and handles to.
 
-#define MXRIO_OBJECT_EXTRA 32
-#define MXRIO_OBJECT_MINSIZE (2 * sizeof(uint32_t))
-#define MXRIO_OBJECT_MAXSIZE (MXRIO_OBJECT_MINSIZE + MXRIO_OBJECT_EXTRA)
+#define ZXRIO_OBJECT_EXTRA 32
+#define ZXRIO_OBJECT_MINSIZE (2 * sizeof(uint32_t))
+#define ZXRIO_OBJECT_MAXSIZE (ZXRIO_OBJECT_MINSIZE + ZXRIO_OBJECT_EXTRA)
 
 typedef struct {
     // Required Header
-    mx_status_t status;
+    zx_status_t status;
     uint32_t type;
 
     // Optional Extra Data
-    uint8_t extra[MXRIO_OBJECT_EXTRA];
+    uint8_t extra[ZXRIO_OBJECT_EXTRA];
 
     // OOB Data
     uint32_t esize;
     uint32_t hcount;
-    mx_handle_t handle[MXIO_MAX_HANDLES];
-} mxrio_object_t;
+    zx_handle_t handle[FDIO_MAX_HANDLES];
+} zxrio_object_t;
 
 
-struct mxrio_msg {
-    mx_txid_t txid;                    // transaction id
+struct zxrio_msg {
+    zx_txid_t txid;                    // transaction id
     uint32_t op;                       // opcode
     uint32_t datalen;                  // size of data[]
     int32_t arg;                       // tx: argument, rx: return value
@@ -147,31 +147,31 @@
     } arg2;
     int32_t reserved;
     uint32_t hcount;                   // number of valid handles
-    mx_handle_t handle[4];             // up to 3 handles + reply channel handle
-    uint8_t data[MXIO_CHUNK_SIZE];     // payload
+    zx_handle_t handle[4];             // up to 3 handles + reply channel handle
+    uint8_t data[FDIO_CHUNK_SIZE];     // payload
 };
 
-#define MXIO_MMAP_FLAG_READ    (1u << 0)
-#define MXIO_MMAP_FLAG_WRITE   (1u << 1)
-#define MXIO_MMAP_FLAG_EXEC    (1u << 2)
-#define MXIO_MMAP_FLAG_PRIVATE (1u << 16)
+#define FDIO_MMAP_FLAG_READ    (1u << 0)
+#define FDIO_MMAP_FLAG_WRITE   (1u << 1)
+#define FDIO_MMAP_FLAG_EXEC    (1u << 2)
+#define FDIO_MMAP_FLAG_PRIVATE (1u << 16)
 
-static_assert(MXIO_MMAP_FLAG_READ == MX_VM_FLAG_PERM_READ, "Vmar / Mmap flags should be aligned");
-static_assert(MXIO_MMAP_FLAG_WRITE == MX_VM_FLAG_PERM_WRITE, "Vmar / Mmap flags should be aligned");
-static_assert(MXIO_MMAP_FLAG_EXEC == MX_VM_FLAG_PERM_EXECUTE, "Vmar / Mmap flags should be aligned");
+static_assert(FDIO_MMAP_FLAG_READ == ZX_VM_FLAG_PERM_READ, "Vmar / Mmap flags should be aligned");
+static_assert(FDIO_MMAP_FLAG_WRITE == ZX_VM_FLAG_PERM_WRITE, "Vmar / Mmap flags should be aligned");
+static_assert(FDIO_MMAP_FLAG_EXEC == ZX_VM_FLAG_PERM_EXECUTE, "Vmar / Mmap flags should be aligned");
 
-typedef struct mxrio_mmap_data {
+typedef struct zxrio_mmap_data {
     size_t offset;
     uint64_t length;
     int32_t flags;
-} mxrio_mmap_data_t;
+} zxrio_mmap_data_t;
 
-static_assert(MXIO_CHUNK_SIZE >= PATH_MAX, "MXIO_CHUNK_SIZE must be large enough to contain paths");
+static_assert(FDIO_CHUNK_SIZE >= PATH_MAX, "FDIO_CHUNK_SIZE must be large enough to contain paths");
 
 #define READDIR_CMD_NONE  0
 #define READDIR_CMD_RESET 1
 
-// - msg.datalen is the size of data sent or received and must be <= MXIO_CHUNK_SIZE
+// - msg.datalen is the size of data sent or received and must be <= FDIO_CHUNK_SIZE
 // - msg.arg is the return code on replies
 
 // request---------------------------------------    response------------------------------
@@ -213,6 +213,6 @@
 // READLINK    maxreply   0        -                 0           <path>          -
 // FLUSH       0          0        -                 0           -               -
 //
-// on response arg32 is always mx_status, and may be positive for read/write calls
+// on response arg32 is always zx_status, and may be positive for read/write calls
 
 __END_CDECLS
diff --git a/system/ulib/fdio/include/fdio/socket.h b/system/ulib/fdio/include/fdio/socket.h
new file mode 100644
index 0000000..63618fe
--- /dev/null
+++ b/system/ulib/fdio/include/fdio/socket.h
@@ -0,0 +1,89 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/device/ioctl.h>
+
+#include <fdio/io.h>
+
+#include <stdint.h>
+
+#include <sys/socket.h>
+#include <netdb.h>
+
+__BEGIN_CDECLS
+
+#define ZXRIO_SOCKET_DIR_NONE   "none"
+#define ZXRIO_SOCKET_DIR_SOCKET "socket"
+#define ZXRIO_SOCKET_DIR_ACCEPT "accept"
+
+// fdio signals
+#define ZXSIO_SIGNAL_INCOMING ZX_USER_SIGNAL_0
+#define ZXSIO_SIGNAL_OUTGOING ZX_USER_SIGNAL_1
+#define ZXSIO_SIGNAL_ERROR ZX_USER_SIGNAL_2
+#define ZXSIO_SIGNAL_CONNECTED ZX_USER_SIGNAL_3
+#define ZXSIO_SIGNAL_HALFCLOSED ZX_USER_SIGNAL_4
+
+// ZXRIO_GETADDRINFO
+#define ZXRIO_GAI_REQ_NODE_MAXLEN 256
+#define ZXRIO_GAI_REQ_SERVICE_MAXLEN 256
+
+typedef struct zxrio_gai_req {
+    uint8_t node_is_null;
+    uint8_t service_is_null;
+    uint8_t hints_is_null;
+    uint8_t reserved;
+    uint32_t reserved2;
+    char node[ZXRIO_GAI_REQ_NODE_MAXLEN];
+    char service[ZXRIO_GAI_REQ_SERVICE_MAXLEN];
+    struct addrinfo hints;
+} zxrio_gai_req_t;
+
+#define ZXRIO_GAI_REPLY_MAX 4
+
+typedef struct zxrio_gai_reply {
+    // 'res[0].ai' should be the first field
+    struct {
+        struct addrinfo ai;
+        struct sockaddr_storage addr;
+    } res[ZXRIO_GAI_REPLY_MAX];
+    int32_t nres;
+    int32_t retval;
+} zxrio_gai_reply_t;
+
+typedef union {
+    zxrio_gai_req_t req;
+    zxrio_gai_reply_t reply;
+} zxrio_gai_req_reply_t;
+
+// ZXRIO_GETSOCKNAME
+// ZXRIO_GETPEERNAME
+typedef struct zxrio_sockaddr_reply {
+    struct sockaddr_storage addr;
+    socklen_t len;
+} zxrio_sockaddr_reply_t;
+
+// ZXRIO_GETSOCKOPT
+// ZXRIO_SETSOCKOPT
+typedef struct zxrio_sockopt_req_reply {
+    int32_t level;
+    int32_t optname;
+    char optval[8];
+    socklen_t optlen;
+} zxrio_sockopt_req_reply_t;
+
+// wire format for datagram messages
+typedef struct fdio_socket_msg {
+    struct sockaddr_storage addr;
+    socklen_t addrlen;
+    int32_t flags;
+    char data[1]; // variable size
+} fdio_socket_msg_t;
+
+#define FDIO_SOCKET_MSG_HEADER_SIZE offsetof(fdio_socket_msg_t, data)
+
+__END_CDECLS
diff --git a/system/ulib/fdio/include/fdio/util.h b/system/ulib/fdio/include/fdio/util.h
new file mode 100644
index 0000000..38bc393
--- /dev/null
+++ b/system/ulib/fdio/include/fdio/util.h
@@ -0,0 +1,112 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+#include <zircon/compiler.h>
+#include <stdint.h>
+#include <unistd.h>
+
+__BEGIN_CDECLS
+
+// These routines are "internal" to fdio but used by some companion
+// code like userboot and devmgr
+
+typedef struct fdio fdio_t;
+
+// Utilities to help assemble handles for a new process
+// may return up to FDIO_MAX_HANDLES
+zx_status_t fdio_clone_root(zx_handle_t* handles, uint32_t* types);
+zx_status_t fdio_clone_cwd(zx_handle_t* handles, uint32_t* types);
+zx_status_t fdio_clone_fd(int fd, int newfd, zx_handle_t* handles, uint32_t* types);
+zx_status_t fdio_pipe_pair_raw(zx_handle_t* handles, uint32_t* types);
+zx_status_t fdio_transfer_fd(int fd, int newfd, zx_handle_t* handles, uint32_t* types);
+
+// Attempt to create an fdio fd from some handles and their associated types,
+// as returned from fdio_transfer_fd.
+//
+// Can only create fds around:
+// - Remote IO objects
+// - Pipes
+// - Connected sockets
+//
+// This function transfers ownership of handles to the fd on success, and
+// closes them on failure.
+zx_status_t fdio_create_fd(zx_handle_t* handles, uint32_t* types, size_t hcount, int* fd_out);
+
+typedef struct bootfs_entry bootfs_entry_t;
+
+typedef struct bootfs {
+    zx_handle_t vmo;
+    uint32_t dirsize;
+    void* dir;
+} bootfs_t;
+
+zx_status_t bootfs_create(bootfs_t* bfs, zx_handle_t vmo);
+void bootfs_destroy(bootfs_t* bfs);
+zx_status_t bootfs_open(bootfs_t* bfs, const char* name, zx_handle_t* vmo);
+zx_status_t bootfs_parse(bootfs_t* bfs,
+                         zx_status_t (*cb)(void* cookie, const bootfs_entry_t* entry),
+                         void* cookie);
+
+// used for bootstrap
+void fdio_install_root(fdio_t* root);
+
+// attempt to install a fdio in the unistd fd table
+// if fd >= 0, request a specific fd, and starting_fd is ignored
+// if fd < 0, request the first available fd >= starting_fd
+// returns fd on success
+// the fdio must have been upref'd on behalf of the fdtab first
+int fdio_bind_to_fd(fdio_t* io, int fd, int starting_fd);
+
+// attempt to detach an fdio_t from the fd table
+// returns ZX_ERR_INVALID_ARGS if fd is out of range or doesn't exist
+// returns ZX_ERR_UNAVAILABLE if the fd is busy or has been dup'd
+// returns fdio_t via io_out with refcount 1 on success
+zx_status_t fdio_unbind_from_fd(int fd, fdio_t** io_out);
+
+// If this fd represents a "service" (an rpc channel speaking
+// a non-fdio protocol), this call will return ZX_OK and
+// return the underlying handle.
+// On both success and failure, the fd is effectively closed.
+zx_status_t fdio_get_service_handle(int fd, zx_handle_t* out);
+
+// creates a do-nothing fdio_t
+fdio_t* fdio_null_create(void);
+
+// Wraps a channel with an fdio_t using remote io.
+// Takes ownership of h and e.
+fdio_t* fdio_remote_create(zx_handle_t h, zx_handle_t e);
+
+// Wraps a channel with an fdio_t using an unknown rpc protocl.
+// Takes ownership of h.
+fdio_t* fdio_service_create(zx_handle_t);
+
+// creates a fdio that wraps a log object
+// this will allocate a per-thread buffer (on demand) to assemble
+// entire log-lines and flush them on newline or buffer full.
+fdio_t* fdio_logger_create(zx_handle_t);
+
+// create a fdio that wraps a function
+// used for plumbing stdout/err to logging subsystems, etc
+fdio_t* fdio_output_create(ssize_t (*func)(void* cookie, const void* data, size_t len),
+                           void* cookie);
+
+// Attempt to connect a channel to a named service.
+// On success the channel is connected.  On failure
+// an error is returned and the handle is closed.
+zx_status_t fdio_service_connect(const char* svcpath, zx_handle_t h);
+
+// Attempt to connect a channel to a named service relative to dir.
+// On success the channel is connected.  On failure
+// an error is returned and the handle is closed.
+zx_status_t fdio_service_connect_at(zx_handle_t dir, const char* path, zx_handle_t h);
+
+// Attempt to clone a sevice handle by doing a pipelined
+// CLONE operation, returning the new channel endpoint,
+// or ZX_HANDLE_INVALID.
+zx_handle_t fdio_service_clone(zx_handle_t h);
+
+__END_CDECLS
diff --git a/system/ulib/mxio/include/mxio/vfs.h b/system/ulib/fdio/include/fdio/vfs.h
similarity index 95%
rename from system/ulib/mxio/include/mxio/vfs.h
rename to system/ulib/fdio/include/fdio/vfs.h
index 3ec7804..f98103e 100644
--- a/system/ulib/mxio/include/mxio/vfs.h
+++ b/system/ulib/fdio/include/fdio/vfs.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/types.h>
-#include <magenta/listnode.h>
-#include <magenta/compiler.h>
+#include <zircon/types.h>
+#include <zircon/listnode.h>
+#include <zircon/compiler.h>
 
 #include <stdio.h>
 #include <unistd.h>  // ssize_t
diff --git a/system/ulib/fdio/include/fdio/watcher.h b/system/ulib/fdio/include/fdio/watcher.h
new file mode 100644
index 0000000..4c3837c
--- /dev/null
+++ b/system/ulib/fdio/include/fdio/watcher.h
@@ -0,0 +1,43 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/compiler.h>
+#include <fdio/io.h>
+
+__BEGIN_CDECLS
+
+typedef zx_status_t (*watchdir_func_t)(int dirfd, int event, const char* fn, void* cookie);
+
+// This event occurs when a file is added or removed, including
+// (for fdio_watch_directory()) files that already exist.
+#define WATCH_EVENT_ADD_FILE 1
+#define WATCH_EVENT_REMOVE_FILE 2
+
+// This event occurs, once, when fdio_watch_directory() runs
+// out of existing files and has to start waiting for new
+// files to be added.
+#define WATCH_EVENT_IDLE 3
+
+// Call the provided callback (cb) for each file in directory
+// and each time a new file is added to the directory.
+//
+// If the callback returns a status other than ZX_OK, watching
+// stops and the callback's status is returned to the caller
+// of fdio_watch_directory.
+//
+// If the deadline expires, ZX_ERR_TIMED_OUT is returned to the
+// caller.  A deadline of ZX_TIME_INFINITE will never expire.
+//
+// The callback may use ZX_ERR_STOP as a way to signal to the
+// caller that it wants to stop because it found what it was
+// looking for, etc -- since this error code is not returned
+// by syscalls or public APIs, the callback does not need to
+// worry about it turning up normally.
+
+zx_status_t fdio_watch_directory(int dirfd, watchdir_func_t cb, zx_time_t deadline, void* cookie);
+
+
+__END_CDECLS
diff --git a/system/ulib/fdio/logger.c b/system/ulib/fdio/logger.c
new file mode 100644
index 0000000..de5614c
--- /dev/null
+++ b/system/ulib/fdio/logger.c
@@ -0,0 +1,114 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <fdio/io.h>
+
+#include <stdatomic.h>
+#include <stdlib.h>
+#include <threads.h>
+
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
+#include <zircon/processargs.h>
+
+#include "private.h"
+
+typedef struct fdio_log fdio_log_t;
+struct fdio_log {
+    fdio_t io;
+    zx_handle_t handle;
+};
+
+#define LOGBUF_MAX (ZX_LOG_RECORD_MAX - sizeof(zx_log_record_t))
+
+static ssize_t log_write(fdio_t* io, const void* _data, size_t len) {
+    static thread_local struct {
+        unsigned next;
+        char data[LOGBUF_MAX];
+    }* logbuf = NULL;
+
+    fdio_log_t* log_io = (fdio_log_t*)io;
+
+    if (logbuf == NULL) {
+        if ((logbuf = calloc(1, sizeof(*logbuf))) == NULL) {
+            return len;
+        }
+    }
+
+    const char* data = _data;
+    size_t r = len;
+
+    while (len-- > 0) {
+        char c = *data++;
+        if (c == '\n') {
+            zx_log_write(log_io->handle, logbuf->next, logbuf->data, 0);
+            logbuf->next = 0;
+            continue;
+        }
+        if (c < ' ') {
+            continue;
+        }
+        logbuf->data[logbuf->next++] = c;
+        if (logbuf->next == LOGBUF_MAX) {
+            zx_log_write(log_io->handle, logbuf->next, logbuf->data, 0);
+            logbuf->next = 0;
+            continue;
+        }
+    }
+    return r;
+}
+
+static zx_status_t log_close(fdio_t* io) {
+    fdio_log_t* log_io = (fdio_log_t*)io;
+    zx_handle_t h = log_io->handle;
+    log_io->handle = 0;
+    zx_handle_close(h);
+    return ZX_OK;
+}
+
+static zx_status_t log_clone(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
+    fdio_log_t* log_io = (fdio_log_t*)io;
+
+    zx_status_t status = zx_handle_duplicate(log_io->handle, ZX_RIGHT_SAME_RIGHTS, &handles[0]);
+    if (status < 0) {
+        return status;
+    }
+    types[0] = PA_FDIO_LOGGER;
+    return 1;
+}
+
+static fdio_ops_t log_io_ops = {
+    .read = fdio_default_read,
+    .read_at = fdio_default_read_at,
+    .write = log_write,
+    .write_at = fdio_default_write_at,
+    .recvfrom = fdio_default_recvfrom,
+    .sendto = fdio_default_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
+    .seek = fdio_default_seek,
+    .misc = fdio_default_misc,
+    .close = log_close,
+    .open = fdio_default_open,
+    .clone = log_clone,
+    .ioctl = fdio_default_ioctl,
+    .wait_begin = fdio_default_wait_begin,
+    .wait_end = fdio_default_wait_end,
+    .unwrap = fdio_default_unwrap,
+    .shutdown = fdio_default_shutdown,
+    .posix_ioctl = fdio_default_posix_ioctl,
+    .get_vmo = fdio_default_get_vmo,
+};
+
+fdio_t* fdio_logger_create(zx_handle_t handle) {
+    fdio_log_t* log = calloc(1, sizeof(fdio_log_t));
+    if (log == NULL) {
+        return NULL;
+    }
+    log->io.ops = &log_io_ops;
+    log->io.magic = FDIO_MAGIC;
+    atomic_init(&log->io.refcount, 1);
+    log->handle = handle;
+    return &log->io;
+}
diff --git a/system/ulib/mxio/namespace.c b/system/ulib/fdio/namespace.c
similarity index 67%
rename from system/ulib/mxio/namespace.c
rename to system/ulib/fdio/namespace.c
index 1080144..c4510e4 100644
--- a/system/ulib/mxio/namespace.c
+++ b/system/ulib/fdio/namespace.c
@@ -8,20 +8,20 @@
 #include <string.h>
 #include <threads.h>
 
-#include <magenta/types.h>
-#include <magenta/listnode.h>
-#include <magenta/syscalls.h>
-#include <magenta/processargs.h>
+#include <zircon/types.h>
+#include <zircon/listnode.h>
+#include <zircon/syscalls.h>
+#include <zircon/processargs.h>
 
-#include <mxio/namespace.h>
-#include <mxio/remoteio.h>
-#include <mxio/util.h>
-#include <mxio/vfs.h>
+#include <fdio/namespace.h>
+#include <fdio/remoteio.h>
+#include <fdio/util.h>
+#include <fdio/vfs.h>
 
 #include "private.h"
 #include "private-remoteio.h"
 
-// A mxio namespace is a simple local filesystem that consists
+// A fdio namespace is a simple local filesystem that consists
 // of a tree of vnodes, each of which may contain child vnodes
 // and a handle for a remote filesystem.
 //
@@ -32,28 +32,28 @@
 // doing the local directory walk part of an OPEN operation.
 //
 // If an OPEN path matches one of the local vnodes exactly, a
-// mxio_directory object is created and returned.  This object
+// fdio_directory object is created and returned.  This object
 // handles further OPEN operations, as well as READDIR and STAT.
 // It favors local children over the remote -- so, for example,
 // READDIR first returns the vnode's local children, then forwards
 // the request to the remote, but filters the results (removing
 // matches of its own children).
 
-typedef struct mxio_directory mxdir_t;
-typedef struct mxio_vnode mxvn_t;
+typedef struct fdio_directory mxdir_t;
+typedef struct fdio_vnode mxvn_t;
 
-struct mxio_vnode {
+struct fdio_vnode {
     mxvn_t* child;
     mxvn_t* parent;
     mxvn_t* next;
-    mx_handle_t remote;
+    zx_handle_t remote;
     uint32_t namelen;
     char name[];
 };
 
-// refcount is incremented when a mxio_dir references any of its vnodes
+// refcount is incremented when a fdio_dir references any of its vnodes
 // when refcount is nonzero it may not be modified or destroyed
-struct mxio_namespace {
+struct fdio_namespace {
     mtx_t lock;
     int32_t refcount;
     mxvn_t root;
@@ -62,17 +62,17 @@
 // The directory "subclasses" rio so that it can
 // call remoteio ops it needs to pass through to
 // the underlying remote fs.
-struct mxio_directory {
-    mxrio_t rio;
+struct fdio_directory {
+    zxrio_t rio;
     mxvn_t* vn;
-    mxio_ns_t* ns;
+    fdio_ns_t* ns;
 
     // readdir sequence number
     // TODO: rewind support (when we have rewinddir)
     atomic_int_fast32_t seq;
 };
 
-static mxio_t* mxio_dir_create_locked(mxio_ns_t* fs, mxvn_t* vn, mx_handle_t h);
+static fdio_t* fdio_dir_create_locked(fdio_ns_t* fs, mxvn_t* vn, zx_handle_t h);
 
 static mxvn_t* vn_lookup_locked(mxvn_t* dir, const char* name, size_t len) {
     for (mxvn_t* vn = dir->child; vn; vn = vn->next) {
@@ -83,29 +83,29 @@
     return NULL;
 }
 
-static mx_status_t vn_create_locked(mxvn_t* dir, const char* name, size_t len,
-                                    mx_handle_t remote, mxvn_t** out) {
+static zx_status_t vn_create_locked(mxvn_t* dir, const char* name, size_t len,
+                                    zx_handle_t remote, mxvn_t** out) {
     if ((len == 0) || (len > NAME_MAX)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if ((len == 1) && (name[0] == '.')) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if ((len == 2) && (name[0] == '.') && (name[1] == '.')) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     mxvn_t* vn = vn_lookup_locked(dir, name, len);
     if (vn != NULL) {
         // if there's already a vnode, that's okay as long
         // as we don't want to override its remote
-        if (remote != MX_HANDLE_INVALID) {
-            return MX_ERR_ALREADY_EXISTS;
+        if (remote != ZX_HANDLE_INVALID) {
+            return ZX_ERR_ALREADY_EXISTS;
         }
         *out = vn;
-        return MX_OK;
+        return ZX_OK;
     }
     if ((vn = calloc(1, sizeof(*vn) + len + 1)) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     memcpy(vn->name, name, len);
     vn->name[len] = 0;
@@ -115,25 +115,25 @@
     vn->next = dir->child;
     dir->child = vn;
     *out = vn;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // vn_destroy *only* safe to be called on vnodes that have never been
 // wrapped in a directory object, because we don't refcount vnodes
 // (they're expected to live for the duration of the namespace).
 //
-// It's used by mxio_ns_bind() to delete intermediate vnodes that
+// It's used by fdio_ns_bind() to delete intermediate vnodes that
 // were created while the ns lock is held, to "undo" a partial mkdir
 // operation that failed partway down the pat.  Since the lock is not
 // released until the full operation completes, this is safe.
-static mx_status_t vn_destroy_locked(mxvn_t* child) {
+static zx_status_t vn_destroy_locked(mxvn_t* child) {
     // can't destroy a live node
-    if (child->remote != MX_HANDLE_INVALID) {
-        return MX_ERR_BAD_STATE;
+    if (child->remote != ZX_HANDLE_INVALID) {
+        return ZX_ERR_BAD_STATE;
     }
     // can't destroy the root
     if (child->parent == NULL) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
     mxvn_t* dir = child->parent;
 
@@ -148,7 +148,7 @@
         }
     }
     free(child);
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void vn_destroy_children_locked(mxvn_t* parent) {
@@ -158,49 +158,49 @@
         if (vn->child) {
             vn_destroy_children_locked(vn);
         }
-        if (vn->remote != MX_HANDLE_INVALID) {
-            mx_handle_close(vn->remote);
+        if (vn->remote != ZX_HANDLE_INVALID) {
+            zx_handle_close(vn->remote);
         }
         free(vn);
     }
 }
 
-static mx_status_t mxdir_close(mxio_t* io) {
+static zx_status_t mxdir_close(fdio_t* io) {
     mxdir_t* dir = (mxdir_t*) io;
     mtx_lock(&dir->ns->lock);
     dir->ns->refcount--;
     mtx_unlock(&dir->ns->lock);
     dir->ns = NULL;
     dir->vn = NULL;
-    if (dir->rio.h != MX_HANDLE_INVALID) {
-        mx_handle_close(dir->rio.h);
-        dir->rio.h = MX_HANDLE_INVALID;
+    if (dir->rio.h != ZX_HANDLE_INVALID) {
+        zx_handle_close(dir->rio.h);
+        dir->rio.h = ZX_HANDLE_INVALID;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t mxdir_clone(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
+static zx_status_t mxdir_clone(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
     mxdir_t* dir = (mxdir_t*) io;
-    if (dir->rio.h == MX_HANDLE_INVALID) {
-        return MX_ERR_NOT_SUPPORTED;
+    if (dir->rio.h == ZX_HANDLE_INVALID) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
-    if ((handles[0] = mxio_service_clone(dir->rio.h)) == MX_HANDLE_INVALID) {
-        return MX_ERR_BAD_HANDLE;
+    if ((handles[0] = fdio_service_clone(dir->rio.h)) == ZX_HANDLE_INVALID) {
+        return ZX_ERR_BAD_HANDLE;
     }
     mtx_lock(&dir->ns->lock);
     dir->ns->refcount++;
     mtx_unlock(&dir->ns->lock);
-    types[0] = PA_MXIO_REMOTE;
+    types[0] = PA_FDIO_REMOTE;
     return 1;
 }
 
-mx_status_t mxio_ns_connect(mxio_ns_t* ns, const char* path, mx_handle_t h) {
+zx_status_t fdio_ns_connect(fdio_ns_t* ns, const char* path, zx_handle_t h) {
     mxvn_t* vn = &ns->root;
-    mx_status_t r = MX_OK;
+    zx_status_t r = ZX_OK;
 
     mtx_lock(&ns->lock);
     if (path[0] != '/') {
-        r = MX_ERR_NOT_FOUND;
+        r = ZX_ERR_NOT_FOUND;
         goto done;
     }
     path++;
@@ -220,7 +220,7 @@
 
         // path segment can't be empty
         if (len == 0) {
-            r = MX_ERR_BAD_PATH;
+            r = ZX_ERR_BAD_PATH;
             break;
         }
 
@@ -233,7 +233,7 @@
                 // descend and continue
                 path = next + 1;
                 // but remember this node and path
-                if (child->remote != MX_HANDLE_INVALID) {
+                if (child->remote != ZX_HANDLE_INVALID) {
                     save_vn = child;
                     save_path = path;
                 }
@@ -246,10 +246,10 @@
         }
 
         // if there's not a remote filesystem, did we pass one?
-        if (vn->remote == MX_HANDLE_INVALID) {
+        if (vn->remote == ZX_HANDLE_INVALID) {
             // if not, we're done
             if (save_vn == NULL) {
-                r = MX_ERR_NOT_FOUND;
+                r = ZX_ERR_NOT_FOUND;
                 break;
             }
             // otherwise roll back
@@ -258,10 +258,10 @@
         }
 
         // hand off to remote filesystem
-        r = mxio_service_connect_at(vn->remote, path, h);
+        r = fdio_service_connect_at(vn->remote, path, h);
         goto done;
     }
-    mx_handle_close(h);
+    zx_handle_close(h);
 done:
     mtx_unlock(&ns->lock);
     return r;
@@ -269,12 +269,12 @@
 
 // Expects a canonical path (no ..) with no leading
 // slash and no trailing slash
-static mx_status_t mxdir_open(mxio_t* io, const char* path,
+static zx_status_t mxdir_open(fdio_t* io, const char* path,
                               int32_t flags, uint32_t mode,
-                              mxio_t** out) {
+                              fdio_t** out) {
     mxdir_t* dir = (mxdir_t*) io;
     mxvn_t* vn = dir->vn;
-    mx_status_t r = MX_OK;
+    zx_status_t r = ZX_OK;
 
     mtx_lock(&dir->ns->lock);
     if ((path[0] == '.') && (path[1] == 0)) {
@@ -296,7 +296,7 @@
 
         // path segment can't be empty
         if (len == 0) {
-            r = MX_ERR_BAD_PATH;
+            r = ZX_ERR_BAD_PATH;
             break;
         }
 
@@ -309,7 +309,7 @@
                 // descend and continue
                 path = next + 1;
                 // but remember this node and path
-                if (child->remote != MX_HANDLE_INVALID) {
+                if (child->remote != ZX_HANDLE_INVALID) {
                     save_vn = child;
                     save_path = path;
                 }
@@ -317,39 +317,39 @@
             } else {
                 // match on the last segment
                 // this is it
-                r = MX_OK;
+                r = ZX_OK;
                 break;
             }
         }
 
         // if there's not a remote filesystem, give up
-        if (vn->remote == MX_HANDLE_INVALID) {
-            r = MX_ERR_NOT_FOUND;
+        if (vn->remote == ZX_HANDLE_INVALID) {
+            r = ZX_ERR_NOT_FOUND;
             break;
         }
 
         // hand off to remote filesystem
         mtx_unlock(&dir->ns->lock);
-        return mxrio_open_handle(vn->remote, path, flags, mode, out);
+        return zxrio_open_handle(vn->remote, path, flags, mode, out);
     }
-    if (r == MX_OK) {
-        if ((vn->remote == MX_HANDLE_INVALID) && (save_vn != NULL)) {
+    if (r == ZX_OK) {
+        if ((vn->remote == ZX_HANDLE_INVALID) && (save_vn != NULL)) {
             // This node doesn't have a remote directory, but it
             // is a child of a node that does, so we try to open
             // relative to that directory for our remote fs
-            mx_handle_t h;
-            if (mxrio_open_handle_raw(save_vn->remote, save_path, flags, mode, &h) == MX_OK) {
-                if ((*out = mxio_dir_create_locked(dir->ns, vn, h)) == NULL) {
-                    r = MX_ERR_NO_MEMORY;
+            zx_handle_t h;
+            if (zxrio_open_handle_raw(save_vn->remote, save_path, flags, mode, &h) == ZX_OK) {
+                if ((*out = fdio_dir_create_locked(dir->ns, vn, h)) == NULL) {
+                    r = ZX_ERR_NO_MEMORY;
                 } else {
-                    r = MX_OK;
+                    r = ZX_OK;
                 }
             }
 
         } else {
 open_dot:
-            if ((*out = mxio_dir_create_locked(dir->ns, vn, 0)) == NULL) {
-                r = MX_ERR_NO_MEMORY;
+            if ((*out = fdio_dir_create_locked(dir->ns, vn, 0)) == NULL) {
+                r = ZX_ERR_NO_MEMORY;
             }
         }
     }
@@ -357,7 +357,7 @@
     return r;
 }
 
-static mx_status_t fill_dirent(vdirent_t* de, size_t delen,
+static zx_status_t fill_dirent(vdirent_t* de, size_t delen,
                                const char* name, size_t len, uint32_t type) {
     size_t sz = sizeof(vdirent_t) + len + 1;
 
@@ -365,7 +365,7 @@
     if (sz & 3)
         sz = (sz + 3) & (~3);
     if (sz > delen)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     de->size = sz;
     de->type = type;
     memcpy(de->name, name, len);
@@ -373,11 +373,11 @@
     return sz;
 }
 
-static mx_status_t mxdir_readdir_locked(mxdir_t* dir, void* buf, size_t len) {
+static zx_status_t mxdir_readdir_locked(mxdir_t* dir, void* buf, size_t len) {
     void *ptr = buf;
 
     for (mxvn_t* vn = dir->vn->child; vn; vn = vn->next) {
-        mx_status_t r = fill_dirent(ptr, len, vn->name, vn->namelen,
+        zx_status_t r = fill_dirent(ptr, len, vn->name, vn->namelen,
                                     VTYPE_TO_DTYPE(V_TYPE_DIR));
         if (r < 0) {
             break;
@@ -391,7 +391,7 @@
 
 // walk a set of directory entries and filter out any that match
 // our children, by setting their names to ""
-static mx_status_t mxdir_filter(mxdir_t* dir, void* ptr, size_t len) {
+static zx_status_t mxdir_filter(mxdir_t* dir, void* ptr, size_t len) {
     size_t r = len;
     mtx_lock(&dir->ns->lock);
     for (;;) {
@@ -418,25 +418,25 @@
 }
 
 
-static mx_status_t mxdir_misc(mxio_t* io, uint32_t op, int64_t off,
+static zx_status_t mxdir_misc(fdio_t* io, uint32_t op, int64_t off,
                               uint32_t maxreply, void* ptr, size_t len) {
     mxdir_t* dir = (mxdir_t*) io;
-    mx_status_t r;
-    switch (MXRIO_OP(op)) {
-    case MXRIO_READDIR:
+    zx_status_t r;
+    switch (ZXRIO_OP(op)) {
+    case ZXRIO_READDIR:
         //TODO(swetland): Make more robust in the face of large
         // numbers of local children, callers with tiny buffers (none
-        // such exist as yet, it's a private interface to mxio), and
+        // such exist as yet, it's a private interface to fdio), and
         // ideally integrate with a local ordering cookie w/ readdir().
         mtx_lock(&dir->ns->lock);
         for (;;) {
             int n = atomic_fetch_add(&dir->seq, 1);
             if (n > 0) {
                 mtx_unlock(&dir->ns->lock);
-                if (dir->rio.h == MX_HANDLE_INVALID) {
+                if (dir->rio.h == ZX_HANDLE_INVALID) {
                     return 0;
                 }
-                if ((r = mxrio_misc(io, op, off, maxreply, ptr, len)) < 0) {
+                if ((r = zxrio_misc(io, op, off, maxreply, ptr, len)) < 0) {
                     return r;
                 }
                 return mxdir_filter(dir, ptr, r);
@@ -450,9 +450,9 @@
         }
         mtx_unlock(&dir->ns->lock);
         return r;
-    case MXRIO_STAT:
+    case ZXRIO_STAT:
         if (maxreply < sizeof(vnattr_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         vnattr_t* attr = ptr;
         memset(attr, 0, sizeof(*attr));
@@ -461,48 +461,48 @@
         attr->nlink = 1;
         return sizeof(vnattr_t);
     default:
-        return mxrio_misc(io, op, off, maxreply, ptr, len);
+        return zxrio_misc(io, op, off, maxreply, ptr, len);
     }
 }
 
-static mxio_ops_t dir_ops = {
-    .read = mxio_default_read,
-    .read_at = mxio_default_read_at,
-    .write = mxio_default_write,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mxio_default_recvfrom,
-    .sendto = mxio_default_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
+static fdio_ops_t dir_ops = {
+    .read = fdio_default_read,
+    .read_at = fdio_default_read_at,
+    .write = fdio_default_write,
+    .write_at = fdio_default_write_at,
+    .recvfrom = fdio_default_recvfrom,
+    .sendto = fdio_default_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
     .misc = mxdir_misc,
-    .seek = mxio_default_seek,
+    .seek = fdio_default_seek,
     .close = mxdir_close,
     .open = mxdir_open,
     .clone = mxdir_clone,
-    .ioctl = mxrio_ioctl,
-    .wait_begin = mxio_default_wait_begin,
-    .wait_end = mxio_default_wait_end,
-    .unwrap = mxio_default_unwrap,
-    .shutdown = mxio_default_shutdown,
-    .posix_ioctl = mxio_default_posix_ioctl,
-    .get_vmo = mxio_default_get_vmo,
+    .ioctl = zxrio_ioctl,
+    .wait_begin = fdio_default_wait_begin,
+    .wait_end = fdio_default_wait_end,
+    .unwrap = fdio_default_unwrap,
+    .shutdown = fdio_default_shutdown,
+    .posix_ioctl = fdio_default_posix_ioctl,
+    .get_vmo = fdio_default_get_vmo,
 };
 
-static mxio_t* mxio_dir_create_locked(mxio_ns_t* ns, mxvn_t* vn, mx_handle_t h) {
+static fdio_t* fdio_dir_create_locked(fdio_ns_t* ns, mxvn_t* vn, zx_handle_t h) {
     mxdir_t* dir = calloc(1, sizeof(*dir));
     if (dir == NULL) {
-        if (h != MX_HANDLE_INVALID) {
-            mx_handle_close(h);
+        if (h != ZX_HANDLE_INVALID) {
+            zx_handle_close(h);
         }
         return NULL;
     }
     dir->rio.io.ops = &dir_ops;
-    dir->rio.io.magic = MXIO_MAGIC;
+    dir->rio.io.magic = FDIO_MAGIC;
     atomic_init(&dir->rio.io.refcount, 1);
-    if (h != MX_HANDLE_INVALID) {
+    if (h != ZX_HANDLE_INVALID) {
         dir->rio.h = h;
     } else {
-        dir->rio.h = mxio_service_clone(vn->remote);
+        dir->rio.h = fdio_service_clone(vn->remote);
     }
     dir->ns = ns;
     dir->vn = vn;
@@ -510,55 +510,55 @@
     return &dir->rio.io;
 }
 
-mx_status_t mxio_ns_create(mxio_ns_t** out) {
+zx_status_t fdio_ns_create(fdio_ns_t** out) {
     // +1 is for the "" name
-    mxio_ns_t* ns = calloc(1, sizeof(mxio_ns_t) + 1);
+    fdio_ns_t* ns = calloc(1, sizeof(fdio_ns_t) + 1);
     if (ns == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     mtx_init(&ns->lock, mtx_plain);
     *out = ns;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mxio_ns_destroy(mxio_ns_t* ns) {
+zx_status_t fdio_ns_destroy(fdio_ns_t* ns) {
     mtx_lock(&ns->lock);
     if (ns->refcount != 0) {
         mtx_unlock(&ns->lock);
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     } else {
         vn_destroy_children_locked(&ns->root);
         mtx_unlock(&ns->lock);
         free(ns);
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
-mx_status_t mxio_ns_bind(mxio_ns_t* ns, const char* path, mx_handle_t remote) {
-    if (remote == MX_HANDLE_INVALID) {
-        return MX_ERR_BAD_HANDLE;
+zx_status_t fdio_ns_bind(fdio_ns_t* ns, const char* path, zx_handle_t remote) {
+    if (remote == ZX_HANDLE_INVALID) {
+        return ZX_ERR_BAD_HANDLE;
     }
     if ((path == NULL) || (path[0] != '/')) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // skip leading slash
     path++;
 
-    mx_status_t r = MX_OK;
+    zx_status_t r = ZX_OK;
 
     mtx_lock(&ns->lock);
     if (ns->refcount != 0) {
-        r = MX_ERR_BAD_STATE;
+        r = ZX_ERR_BAD_STATE;
         goto done;
     }
     mxvn_t* vn = &ns->root;
     if (path[0] == 0) {
         // the path was "/" so we're trying to bind to the root vnode
-        if (vn->remote == MX_HANDLE_INVALID) {
+        if (vn->remote == ZX_HANDLE_INVALID) {
             vn->remote = remote;
         } else {
-            r = MX_ERR_ALREADY_EXISTS;
+            r = ZX_ERR_ALREADY_EXISTS;
         }
         mtx_unlock(&ns->lock);
         return r;
@@ -567,7 +567,7 @@
         const char* next = strchr(path, '/');
         if (next) {
             // not the final segment, create an intermediate vnode
-            r = vn_create_locked(vn, path, next - path, MX_HANDLE_INVALID, &vn);
+            r = vn_create_locked(vn, path, next - path, ZX_HANDLE_INVALID, &vn);
             if (r < 0) {
                 break;
             }
@@ -598,39 +598,39 @@
     return r;
 }
 
-mx_status_t mxio_ns_bind_fd(mxio_ns_t* ns, const char* path, int fd) {
-    mx_handle_t handle[MXIO_MAX_HANDLES];
-    uint32_t type[MXIO_MAX_HANDLES];
+zx_status_t fdio_ns_bind_fd(fdio_ns_t* ns, const char* path, int fd) {
+    zx_handle_t handle[FDIO_MAX_HANDLES];
+    uint32_t type[FDIO_MAX_HANDLES];
 
-    mx_status_t r = mxio_clone_fd(fd, 0, handle, type);
+    zx_status_t r = fdio_clone_fd(fd, 0, handle, type);
     if (r < 0) {
         return r;
     }
     if (r == 0) {
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
-    if (type[0] != PA_MXIO_REMOTE) {
+    if (type[0] != PA_FDIO_REMOTE) {
         // wrong type, discard handles
         for (int n = 0; n < r; n++) {
-            mx_handle_close(handle[n]);
+            zx_handle_close(handle[n]);
         }
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
 
     // close any aux handles, then do the actual bind
     for (int n = 1; n < r; n++) {
-        mx_handle_close(handle[n]);
+        zx_handle_close(handle[n]);
     }
-    if ((r = mxio_ns_bind(ns, path, handle[0])) < 0) {
-        mx_handle_close(handle[0]);
+    if ((r = fdio_ns_bind(ns, path, handle[0])) < 0) {
+        zx_handle_close(handle[0]);
     }
     return r;
 }
 
-mxio_t* mxio_ns_open_root(mxio_ns_t* ns) {
+fdio_t* fdio_ns_open_root(fdio_ns_t* ns) {
     mtx_lock(&ns->lock);
-    mxio_t* io = mxio_dir_create_locked(ns, &ns->root, 0);
+    fdio_t* io = fdio_dir_create_locked(ns, &ns->root, 0);
     if (io != NULL) {
         ns->refcount++;
     }
@@ -638,39 +638,39 @@
     return io;
 }
 
-int mxio_ns_opendir(mxio_ns_t* ns) {
-    mxio_t* io = mxio_ns_open_root(ns);
+int fdio_ns_opendir(fdio_ns_t* ns) {
+    fdio_t* io = fdio_ns_open_root(ns);
     if (io == NULL) {
         errno = ENOMEM;
         return -1;
     }
-    int fd = mxio_bind_to_fd(io, -1, 0);
+    int fd = fdio_bind_to_fd(io, -1, 0);
     if (fd < 0) {
-        mxio_release(io);
+        fdio_release(io);
         errno = ENOMEM;
     }
     return fd;
 }
 
-mx_status_t mxio_ns_chdir(mxio_ns_t* ns) {
-    mxio_t* io = mxio_ns_open_root(ns);
+zx_status_t fdio_ns_chdir(fdio_ns_t* ns) {
+    fdio_t* io = fdio_ns_open_root(ns);
     if (io == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    mxio_chdir(io, "/");
-    return MX_OK;
+    fdio_chdir(io, "/");
+    return ZX_OK;
 }
 
-static mx_status_t ns_enum_callback(mxvn_t* vn, void* cookie,
-                                    mx_status_t (*func)(void* cookie, const char* path,
-                                                        size_t len, mx_handle_t h)) {
+static zx_status_t ns_enum_callback(mxvn_t* vn, void* cookie,
+                                    zx_status_t (*func)(void* cookie, const char* path,
+                                                        size_t len, zx_handle_t h)) {
     char path[PATH_MAX];
     char* end = path + sizeof(path) - 1;
     *end = 0;
-    mx_handle_t h = vn->remote;
+    zx_handle_t h = vn->remote;
     for (;;) {
         if ((vn->namelen + 1) > (size_t)(end - path)) {
-            return MX_ERR_BAD_PATH;
+            return ZX_ERR_BAD_PATH;
         }
         end -= vn->namelen;
         memcpy(end, vn->name, vn->namelen);
@@ -689,11 +689,11 @@
     }
 }
 
-static mx_status_t ns_enumerate(mxvn_t* vn, void* cookie,
-                                mx_status_t (*func)(void* cookie, const char* path,
-                                                    size_t len, mx_handle_t h)) {
+static zx_status_t ns_enumerate(mxvn_t* vn, void* cookie,
+                                zx_status_t (*func)(void* cookie, const char* path,
+                                                    size_t len, zx_handle_t h)) {
     while (vn != NULL) {
-        if (vn->remote != MX_HANDLE_INVALID) {
+        if (vn->remote != ZX_HANDLE_INVALID) {
             ns_enum_callback(vn, cookie, func);
         }
         if (vn->child) {
@@ -708,26 +708,26 @@
     size_t bytes;
     size_t count;
     char* buffer;
-    mx_handle_t* handle;
+    zx_handle_t* handle;
     uint32_t* type;
     char** path;
 } export_state_t;
 
-static mx_status_t ns_export_count(void* cookie, const char* path,
-                                   size_t len, mx_handle_t h) {
+static zx_status_t ns_export_count(void* cookie, const char* path,
+                                   size_t len, zx_handle_t h) {
     export_state_t* es = cookie;
     // Each entry needs one slot in the handle table,
     // one slot in the type table, and one slot in the
     // path table, plus storage for the path and NUL
-    es->bytes += sizeof(mx_handle_t) + sizeof(uint32_t) + sizeof(char**) + len + 1;
+    es->bytes += sizeof(zx_handle_t) + sizeof(uint32_t) + sizeof(char**) + len + 1;
     es->count += 1;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t ns_export_copy(void* cookie, const char* path,
-                                  size_t len, mx_handle_t h) {
-    if ((h = mxio_service_clone(h)) == MX_HANDLE_INVALID) {
-        return MX_ERR_BAD_STATE;
+static zx_status_t ns_export_copy(void* cookie, const char* path,
+                                  size_t len, zx_handle_t h) {
+    if ((h = fdio_service_clone(h)) == ZX_HANDLE_INVALID) {
+        return ZX_ERR_BAD_STATE;
     }
     export_state_t* es = cookie;
     memcpy(es->buffer, path, len + 1);
@@ -736,40 +736,40 @@
     es->type[es->count] = PA_HND(PA_NS_DIR, es->count);
     es->buffer += (len + 1);
     es->count++;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mxio_ns_export(mxio_ns_t* ns, mxio_flat_namespace_t** out) {
+zx_status_t fdio_ns_export(fdio_ns_t* ns, fdio_flat_namespace_t** out) {
     export_state_t es;
-    es.bytes = sizeof(mxio_flat_namespace_t);
+    es.bytes = sizeof(fdio_flat_namespace_t);
     es.count = 0;
 
     mtx_lock(&ns->lock);
 
     ns_enumerate(&ns->root, &es, ns_export_count);
 
-    mxio_flat_namespace_t* flat = malloc(es.bytes);
+    fdio_flat_namespace_t* flat = malloc(es.bytes);
     if (flat == NULL) {
         mtx_unlock(&ns->lock);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     // We've allocated enough memory for the flat struct
     // followed by count handles, followed by count types,
     // follewed by count path ptrs followed by enough bytes
     // for all the path strings.  Point es.* at the right
     // slices of that memory:
-    es.handle = (mx_handle_t*) (flat + 1);
+    es.handle = (zx_handle_t*) (flat + 1);
     es.type = (uint32_t*) (es.handle + es.count);
     es.path = (char**) (es.type + es.count);
     es.buffer = (char*) (es.path + es.count);
 
     es.count = 0;
-    mx_status_t status = ns_enumerate(&ns->root, &es, ns_export_copy);
+    zx_status_t status = ns_enumerate(&ns->root, &es, ns_export_copy);
     mtx_unlock(&ns->lock);
 
     if (status < 0) {
         for (size_t n = 0; n < es.count; n++) {
-            mx_handle_close(es.handle[n]);
+            zx_handle_close(es.handle[n]);
         }
         free(flat);
     } else {
@@ -783,14 +783,14 @@
     return status;
 }
 
-mx_status_t mxio_ns_export_root(mxio_flat_namespace_t** out) {
-    mx_status_t status;
-    mtx_lock(&mxio_lock);
-    if (mxio_root_ns == NULL) {
-        status = MX_ERR_NOT_FOUND;
+zx_status_t fdio_ns_export_root(fdio_flat_namespace_t** out) {
+    zx_status_t status;
+    mtx_lock(&fdio_lock);
+    if (fdio_root_ns == NULL) {
+        status = ZX_ERR_NOT_FOUND;
     } else {
-        status = mxio_ns_export(mxio_root_ns, out);
+        status = fdio_ns_export(fdio_root_ns, out);
     }
-    mtx_unlock(&mxio_lock);
+    mtx_unlock(&fdio_lock);
     return status;
 }
diff --git a/system/ulib/fdio/null.c b/system/ulib/fdio/null.c
new file mode 100644
index 0000000..b0af66c
--- /dev/null
+++ b/system/ulib/fdio/null.c
@@ -0,0 +1,135 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stdarg.h>
+#include <stdatomic.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <zircon/types.h>
+#include <fdio/io.h>
+
+#include "private.h"
+
+void fdio_free(fdio_t* io) {
+    io->magic = 0xDEAD0123;
+    io->ops = NULL;
+    free(io);
+}
+
+ssize_t fdio_default_read(fdio_t* io, void* _data, size_t len) {
+    return 0;
+}
+
+ssize_t fdio_default_read_at(fdio_t* io, void* _data, size_t len, off_t offset) {
+    return ZX_ERR_WRONG_TYPE;
+}
+
+ssize_t fdio_default_write(fdio_t* io, const void* _data, size_t len) {
+    return len;
+}
+
+ssize_t fdio_default_write_at(fdio_t* io, const void* _data, size_t len, off_t offset) {
+    return ZX_ERR_WRONG_TYPE;
+}
+
+ssize_t fdio_default_recvfrom(fdio_t* io, void* data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen) {
+    return ZX_ERR_WRONG_TYPE;
+}
+
+ssize_t fdio_default_sendto(fdio_t* io, const void* data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen) {
+    return ZX_ERR_WRONG_TYPE;
+}
+
+ssize_t fdio_default_recvmsg(fdio_t* io, struct msghdr* msg, int flags) {
+    return ZX_ERR_WRONG_TYPE;
+}
+
+ssize_t fdio_default_sendmsg(fdio_t* io, const struct msghdr* msg, int flags) {
+    return ZX_ERR_WRONG_TYPE;
+}
+
+off_t fdio_default_seek(fdio_t* io, off_t offset, int whence) {
+    return ZX_ERR_WRONG_TYPE;
+}
+
+zx_status_t fdio_default_misc(fdio_t* io, uint32_t op, int64_t off, uint32_t arg, void* data, size_t len) {
+    return ZX_ERR_NOT_SUPPORTED;
+}
+
+zx_status_t fdio_default_open(fdio_t* io, const char* path, int32_t flags, uint32_t mode, fdio_t** out) {
+    return ZX_ERR_NOT_SUPPORTED;
+}
+
+zx_status_t fdio_default_clone(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
+    return ZX_ERR_NOT_SUPPORTED;
+}
+
+zx_status_t fdio_default_unwrap(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
+    return ZX_ERR_NOT_SUPPORTED;
+}
+
+zx_status_t fdio_default_shutdown(fdio_t* io, int how) {
+    return ZX_ERR_WRONG_TYPE;
+}
+
+zx_status_t fdio_default_close(fdio_t* io) {
+    return ZX_OK;
+}
+
+ssize_t fdio_default_ioctl(fdio_t* io, uint32_t op, const void* in_buf,
+                           size_t in_len, void* out_buf, size_t out_len) {
+    return ZX_ERR_NOT_SUPPORTED;
+}
+
+void fdio_default_wait_begin(fdio_t* io, uint32_t events,
+                             zx_handle_t* handle, zx_signals_t* _signals) {
+    *handle = ZX_HANDLE_INVALID;
+}
+
+void fdio_default_wait_end(fdio_t* io, zx_signals_t signals, uint32_t* _events) {
+}
+
+ssize_t fdio_default_posix_ioctl(fdio_t* io, int req, va_list va) {
+    return ZX_ERR_NOT_SUPPORTED;
+}
+
+zx_status_t fdio_default_get_vmo(fdio_t* io, zx_handle_t* out, size_t* off, size_t* len) {
+    return ZX_ERR_NOT_SUPPORTED;
+}
+
+static fdio_ops_t zx_null_ops = {
+    .read = fdio_default_read,
+    .read_at = fdio_default_read_at,
+    .write = fdio_default_write,
+    .write_at = fdio_default_write_at,
+    .recvfrom = fdio_default_recvfrom,
+    .sendto = fdio_default_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
+    .seek = fdio_default_seek,
+    .misc = fdio_default_misc,
+    .close = fdio_default_close,
+    .open = fdio_default_open,
+    .clone = fdio_default_clone,
+    .ioctl = fdio_default_ioctl,
+    .wait_begin = fdio_default_wait_begin,
+    .wait_end = fdio_default_wait_end,
+    .unwrap = fdio_default_unwrap,
+    .shutdown = fdio_default_shutdown,
+    .posix_ioctl = fdio_default_posix_ioctl,
+    .get_vmo = fdio_default_get_vmo,
+};
+
+fdio_t* fdio_null_create(void) {
+    fdio_t* io = calloc(1, sizeof(*io));
+    if (io == NULL) {
+        return NULL;
+    }
+    io->ops = &zx_null_ops;
+    io->magic = FDIO_MAGIC;
+    atomic_init(&io->refcount, 1);
+    return io;
+}
diff --git a/system/ulib/fdio/output.c b/system/ulib/fdio/output.c
new file mode 100644
index 0000000..9d2d84f
--- /dev/null
+++ b/system/ulib/fdio/output.c
@@ -0,0 +1,67 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <fdio/io.h>
+
+#include <stdatomic.h>
+#include <stdlib.h>
+#include <threads.h>
+
+#include <zircon/syscalls.h>
+
+#include "private.h"
+
+typedef struct fdio_out fdio_out_t;
+
+struct fdio_out {
+    fdio_t io;
+    ssize_t (*func)(void* cookie, const void* data, size_t len);
+    void* cookie;
+};
+
+static ssize_t log_write(fdio_t* io, const void* data, size_t len) {
+    fdio_out_t* out = (void*)io;
+    return out->func(out->cookie, data, len);
+}
+
+static zx_status_t log_close(fdio_t* io) {
+    return ZX_OK;
+}
+
+static fdio_ops_t out_io_ops = {
+    .read = fdio_default_read,
+    .read_at = fdio_default_read_at,
+    .write = log_write,
+    .write_at = fdio_default_write_at,
+    .recvfrom = fdio_default_recvfrom,
+    .sendto = fdio_default_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
+    .seek = fdio_default_seek,
+    .misc = fdio_default_misc,
+    .close = fdio_default_close,
+    .open = fdio_default_open,
+    .clone = fdio_default_clone,
+    .ioctl = fdio_default_ioctl,
+    .wait_begin = fdio_default_wait_begin,
+    .wait_end = fdio_default_wait_end,
+    .unwrap = fdio_default_unwrap,
+    .shutdown = fdio_default_shutdown,
+    .posix_ioctl = fdio_default_posix_ioctl,
+    .get_vmo = fdio_default_get_vmo,
+};
+
+fdio_t* fdio_output_create(ssize_t (*func)(void* cookie, const void* data, size_t len),
+                           void* cookie) {
+    fdio_out_t* out = calloc(1, sizeof(fdio_out_t));
+    if (out == NULL) {
+        return NULL;
+    }
+    out->io.ops = &out_io_ops;
+    out->io.magic = FDIO_MAGIC;
+    atomic_init(&out->io.refcount, 1);
+    out->func = func;
+    out->cookie = cookie;
+    return &out->io;
+}
diff --git a/system/ulib/fdio/pipe.c b/system/ulib/fdio/pipe.c
new file mode 100644
index 0000000..c5693af
--- /dev/null
+++ b/system/ulib/fdio/pipe.c
@@ -0,0 +1,299 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <limits.h>
+#include <poll.h>
+#include <stdarg.h>
+#include <stdatomic.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/io.h>
+#include <fdio/remoteio.h>
+#include <fdio/util.h>
+#include <fdio/vfs.h>
+
+#include "pipe.h"
+#include "private.h"
+
+ssize_t zx_pipe_read_internal(zx_handle_t h, void* data, size_t len, int nonblock) {
+    // TODO: let the generic read() to do this loop
+    for (;;) {
+        size_t bytes_read;
+        ssize_t r = zx_socket_read(h, 0, data, len, &bytes_read);
+        if (r == ZX_OK) {
+            // zx_socket_read() sets *actual to the number of bytes in the buffer when data is NULL
+            // and len is 0. read() should return 0 in that case.
+            if (len == 0) {
+                return 0;
+            } else {
+                return (ssize_t)bytes_read;
+            }
+        } else if (r == ZX_ERR_PEER_CLOSED || r == ZX_ERR_BAD_STATE) {
+            return 0;
+        }
+        if (r == ZX_ERR_SHOULD_WAIT && !nonblock) {
+            zx_signals_t pending;
+            r = zx_object_wait_one(h,
+                                   ZX_SOCKET_READABLE | ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED,
+                                   ZX_TIME_INFINITE,
+                                   &pending);
+            if (r < 0) {
+                return r;
+            }
+            if (pending & ZX_SOCKET_READABLE) {
+                continue;
+            }
+            if (pending & (ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED)) {
+                return 0;
+            }
+            // impossible
+            return ZX_ERR_INTERNAL;
+        }
+        return r;
+    }
+}
+
+ssize_t zx_pipe_write_internal(zx_handle_t h, const void* data, size_t len, int nonblock) {
+    // TODO: let the generic write() to do this loop
+    for (;;) {
+        ssize_t r;
+        if ((r = zx_socket_write(h, 0, data, len, &len)) == ZX_OK) {
+            return (ssize_t)len;
+        }
+        if (r == ZX_ERR_SHOULD_WAIT && !nonblock) {
+            zx_signals_t pending;
+            r = zx_object_wait_one(h,
+                                   ZX_SOCKET_WRITABLE | ZX_SOCKET_WRITE_DISABLED | ZX_SOCKET_PEER_CLOSED,
+                                   ZX_TIME_INFINITE,
+                                   &pending);
+            if (r < 0) {
+                return r;
+            }
+            if (pending & ZX_SOCKET_WRITABLE) {
+                continue;
+            }
+            if (pending & (ZX_SOCKET_WRITE_DISABLED | ZX_SOCKET_PEER_CLOSED)) {
+                return ZX_ERR_PEER_CLOSED;
+            }
+            // impossible
+            return ZX_ERR_INTERNAL;
+        }
+        return r;
+    }
+}
+
+
+ssize_t zx_pipe_write(fdio_t* io, const void* data, size_t len) {
+    zx_pipe_t* p = (zx_pipe_t*)io;
+    return zx_pipe_write_internal(p->h, data, len, io->flags & FDIO_FLAG_NONBLOCK);
+}
+
+ssize_t zx_pipe_read(fdio_t* io, void* data, size_t len) {
+    zx_pipe_t* p = (zx_pipe_t*)io;
+    return zx_pipe_read_internal(p->h, data, len, io->flags & FDIO_FLAG_NONBLOCK);
+}
+zx_status_t zx_pipe_misc(fdio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* data, size_t len) {
+    switch (op) {
+    default:
+        return ZX_ERR_NOT_SUPPORTED;
+
+    case ZXRIO_STAT: {
+        vnattr_t attr = {};
+        if (maxreply < sizeof(attr)) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        attr.mode = V_TYPE_PIPE | V_IRUSR | V_IWUSR;
+        vnattr_t* attr_out = data;
+        *attr_out = attr;
+        return sizeof(attr);
+    }
+    case ZXRIO_FCNTL: {
+        uint32_t* flags = (uint32_t*) data;
+        if (flags) {
+            *flags = 0;
+        }
+        return 0;
+    }
+    }
+}
+
+zx_status_t zx_pipe_close(fdio_t* io) {
+    zx_pipe_t* p = (zx_pipe_t*)io;
+    zx_handle_t h = p->h;
+    p->h = 0;
+    zx_handle_close(h);
+    return 0;
+}
+
+static void zx_pipe_release(fdio_t* io) {
+    zx_pipe_t* p = (zx_pipe_t*)io;
+    zx_handle_close(p->h);
+    free(io);
+}
+
+void zx_pipe_wait_begin(fdio_t* io, uint32_t events, zx_handle_t* handle, zx_signals_t* _signals) {
+    zx_pipe_t* p = (void*)io;
+    *handle = p->h;
+    zx_signals_t signals = 0;
+    if (events & POLLIN) {
+        signals |= ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED | ZX_SOCKET_READ_DISABLED;
+    }
+    if (events & POLLOUT) {
+        signals |= ZX_SOCKET_WRITABLE | ZX_SOCKET_WRITE_DISABLED;
+    }
+    if (events & POLLRDHUP) {
+        signals |= ZX_SOCKET_PEER_CLOSED | ZX_SOCKET_READ_DISABLED;
+    }
+    *_signals = signals;
+}
+
+void zx_pipe_wait_end(fdio_t* io, zx_signals_t signals, uint32_t* _events) {
+    uint32_t events = 0;
+    if (signals & (ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED | ZX_SOCKET_READ_DISABLED)) {
+        events |= POLLIN;
+    }
+    if (signals & (ZX_SOCKET_WRITABLE | ZX_SOCKET_WRITE_DISABLED)) {
+        events |= POLLOUT;
+    }
+    if (signals & (ZX_SOCKET_PEER_CLOSED | ZX_SOCKET_READ_DISABLED)) {
+        events |= POLLRDHUP;
+    }
+    *_events = events;
+}
+
+zx_status_t zx_pipe_clone(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
+    zx_pipe_t* p = (void*)io;
+    zx_status_t status = zx_handle_duplicate(p->h, ZX_RIGHT_SAME_RIGHTS, &handles[0]);
+    if (status < 0) {
+        return status;
+    }
+    types[0] = PA_FDIO_PIPE;
+    return 1;
+}
+
+zx_status_t zx_pipe_unwrap(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
+    zx_pipe_t* p = (void*)io;
+    handles[0] = p->h;
+    types[0] = PA_FDIO_PIPE;
+    free(p);
+    return 1;
+}
+
+ssize_t zx_pipe_posix_ioctl(fdio_t* io, int req, va_list va) {
+    zx_pipe_t* p = (void*)io;
+    switch (req) {
+    case FIONREAD: {
+        zx_status_t r;
+        size_t avail;
+        if ((r = zx_socket_read(p->h, 0, NULL, 0, &avail)) < 0) {
+            return r;
+        }
+        if (avail > INT_MAX) {
+            avail = INT_MAX;
+        }
+        int* actual = va_arg(va, int*);
+        *actual = avail;
+        return ZX_OK;
+    }
+    default:
+        return ZX_ERR_NOT_SUPPORTED;
+    }
+}
+
+static fdio_ops_t zx_pipe_ops = {
+    .read = zx_pipe_read,
+    .read_at = fdio_default_read_at,
+    .write = zx_pipe_write,
+    .write_at = fdio_default_write_at,
+    .recvfrom = fdio_default_recvfrom,
+    .sendto = fdio_default_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
+    .seek = fdio_default_seek,
+    .misc = zx_pipe_misc,
+    .close = zx_pipe_close,
+    .open = fdio_default_open,
+    .clone = zx_pipe_clone,
+    .ioctl = fdio_default_ioctl,
+    .wait_begin = zx_pipe_wait_begin,
+    .wait_end = zx_pipe_wait_end,
+    .unwrap = zx_pipe_unwrap,
+    .shutdown = fdio_default_shutdown,
+    .posix_ioctl = zx_pipe_posix_ioctl,
+    .get_vmo = fdio_default_get_vmo,
+};
+
+fdio_t* fdio_pipe_create(zx_handle_t h) {
+    zx_pipe_t* p = calloc(1, sizeof(*p));
+    if (p == NULL) {
+        zx_handle_close(h);
+        return NULL;
+    }
+    p->io.ops = &zx_pipe_ops;
+    p->io.magic = FDIO_MAGIC;
+    atomic_init(&p->io.refcount, 1);
+    p->h = h;
+    return &p->io;
+}
+
+int fdio_pipe_pair(fdio_t** _a, fdio_t** _b) {
+    zx_handle_t h0, h1;
+    fdio_t *a, *b;
+    zx_status_t r;
+    if ((r = zx_socket_create(0, &h0, &h1)) < 0) {
+        return r;
+    }
+    if ((a = fdio_pipe_create(h0)) == NULL) {
+        zx_handle_close(h1);
+        return ZX_ERR_NO_MEMORY;
+    }
+    if ((b = fdio_pipe_create(h1)) == NULL) {
+        zx_pipe_close(a);
+        return ZX_ERR_NO_MEMORY;
+    }
+    *_a = a;
+    *_b = b;
+    return 0;
+}
+
+zx_status_t fdio_pipe_pair_raw(zx_handle_t* handles, uint32_t* types) {
+    zx_status_t r;
+    if ((r = zx_socket_create(0, handles, handles + 1)) < 0) {
+        return r;
+    }
+    types[0] = PA_FDIO_PIPE;
+    types[1] = PA_FDIO_PIPE;
+    return 2;
+}
+
+zx_status_t fdio_pipe_half(zx_handle_t* handle, uint32_t* type) {
+    zx_handle_t h0, h1;
+    zx_status_t r;
+    fdio_t* io;
+    int fd;
+    if ((r = zx_socket_create(0, &h0, &h1)) < 0) {
+        return r;
+    }
+    if ((io = fdio_pipe_create(h0)) == NULL) {
+        r = ZX_ERR_NO_MEMORY;
+        goto fail;
+    }
+    if ((fd = fdio_bind_to_fd(io, -1, 0)) < 0) {
+        fdio_release(io);
+        r = ZX_ERR_NO_RESOURCES;
+        goto fail;
+    }
+    *handle = h1;
+    *type = PA_FDIO_PIPE;
+    return fd;
+
+fail:
+    zx_handle_close(h1);
+    return r;
+}
diff --git a/system/ulib/fdio/pipe.h b/system/ulib/fdio/pipe.h
new file mode 100644
index 0000000..827b105
--- /dev/null
+++ b/system/ulib/fdio/pipe.h
@@ -0,0 +1,29 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <stdint.h>
+#include <fdio/io.h>
+
+#include "private.h"
+
+// This defines operations shared by pipe(2) and socketpair(2) primitives.
+typedef struct zx_pipe {
+    fdio_t io;
+    zx_handle_t h;
+} zx_pipe_t;
+
+ssize_t zx_pipe_read(fdio_t* io, void* data, size_t len);
+ssize_t zx_pipe_write(fdio_t* io, const void* data, size_t len);
+zx_status_t zx_pipe_misc(fdio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* data, size_t len);
+zx_status_t zx_pipe_close(fdio_t* io);
+zx_status_t zx_pipe_clone(fdio_t* io, zx_handle_t* handles, uint32_t* types);
+void zx_pipe_wait_begin(fdio_t* io, uint32_t events, zx_handle_t* handle, zx_signals_t* _signals);
+void zx_pipe_wait_end(fdio_t* io, zx_signals_t signals, uint32_t* _events);
+zx_status_t zx_pipe_unwrap(fdio_t* io, zx_handle_t* handles, uint32_t* types);
+ssize_t zx_pipe_posix_ioctl(fdio_t* io, int req, va_list va);
+
+ssize_t zx_pipe_read_internal(zx_handle_t h, void* data, size_t len, int nonblock);
+ssize_t zx_pipe_write_internal(zx_handle_t h, const void* data, size_t len, int nonblock);
diff --git a/system/ulib/fdio/private-remoteio.h b/system/ulib/fdio/private-remoteio.h
new file mode 100644
index 0000000..53c045c
--- /dev/null
+++ b/system/ulib/fdio/private-remoteio.h
@@ -0,0 +1,55 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include "private.h"
+
+typedef struct zxrio zxrio_t;
+struct zxrio {
+    // base fdio io object
+    fdio_t io;
+
+    // channel handle for rpc
+    zx_handle_t h;
+
+    // event handle for device state signals, or socket handle
+    zx_handle_t h2;
+
+    // transaction id used for synchronous remoteio calls
+    _Atomic zx_txid_t txid;
+};
+
+// These are for the benefit of namespace.c
+// which needs lower level access to remoteio internals
+
+// open operation directly on remoteio handle
+zx_status_t zxrio_open_handle(zx_handle_t h, const char* path, int32_t flags,
+                              uint32_t mode, fdio_t** out);
+
+// open operation directly on remoteio handle
+// returns new remoteio handle on success
+// fails and discards non-REMOTE protocols
+zx_status_t zxrio_open_handle_raw(zx_handle_t h, const char* path, int32_t flags,
+                                  uint32_t mode, zx_handle_t *out);
+
+// open operation directly on remoteio fdio_t
+zx_status_t zxrio_open(fdio_t* io, const char* path, int32_t flags,
+                       uint32_t mode, fdio_t** out);
+
+// misc operation directly on remoteio fdio_t
+zx_status_t zxrio_misc(fdio_t* io, uint32_t op, int64_t off,
+                       uint32_t maxreply, void* ptr, size_t len);
+
+
+// Shared with remotesocket.c
+
+zx_status_t zxrio_close(fdio_t* io);
+
+ssize_t zxrio_ioctl(fdio_t* io, uint32_t op, const void* in_buf,
+                    size_t in_len, void* out_buf, size_t out_len);
+
+zx_status_t zxrio_getobject(zx_handle_t rio_h, uint32_t op, const char* name,
+                            int32_t flags, uint32_t mode,
+                            zxrio_object_t* info);
diff --git a/system/ulib/fdio/private.h b/system/ulib/fdio/private.h
new file mode 100644
index 0000000..3d42ba9
--- /dev/null
+++ b/system/ulib/fdio/private.h
@@ -0,0 +1,223 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+#include <fdio/limits.h>
+#include <stdarg.h>
+#include <stdatomic.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <threads.h>
+
+typedef struct fdio fdio_t;
+typedef struct fdio_namespace fdio_ns_t;
+
+// FDIO provides open/close/read/write io over various transports
+// via the fdio_t interface abstraction.
+//
+// The PIPE protocol uses message ports as simple, no-flow-control
+// io pipes with a maximum message size of ZX_PIPE_SIZE.
+//
+// The REMOTEIO protocol uses message ports to implement simple
+// synchronous remoting of read/write/close operations.
+//
+// The NULL protocol absorbs writes and is never readable.
+
+typedef struct fdio_ops {
+    ssize_t (*read)(fdio_t* io, void* data, size_t len);
+    ssize_t (*read_at)(fdio_t* io, void* data, size_t len, off_t offset);
+    ssize_t (*write)(fdio_t* io, const void* data, size_t len);
+    ssize_t (*write_at)(fdio_t* io, const void* data, size_t len, off_t offset);
+    ssize_t (*recvfrom)(fdio_t* io, void* data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen);
+    ssize_t (*sendto)(fdio_t* io, const void* data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen);
+    ssize_t (*recvmsg)(fdio_t* io, struct msghdr* msg, int flags);
+    ssize_t (*sendmsg)(fdio_t* io, const struct msghdr* msg, int flags);
+    off_t (*seek)(fdio_t* io, off_t offset, int whence);
+    zx_status_t (*misc)(fdio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* data, size_t len);
+    zx_status_t (*close)(fdio_t* io);
+    zx_status_t (*open)(fdio_t* io, const char* path, int32_t flags, uint32_t mode, fdio_t** out);
+    zx_status_t (*clone)(fdio_t* io, zx_handle_t* out_handles, uint32_t* out_types);
+    zx_status_t (*unwrap)(fdio_t* io, zx_handle_t* out_handles, uint32_t* out_types);
+    zx_status_t (*shutdown)(fdio_t* io, int how);
+    void (*wait_begin)(fdio_t* io, uint32_t events, zx_handle_t* handle, zx_signals_t* signals);
+    void (*wait_end)(fdio_t* io, zx_signals_t signals, uint32_t* events);
+    ssize_t (*ioctl)(fdio_t* io, uint32_t op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len);
+    ssize_t (*posix_ioctl)(fdio_t* io, int req, va_list va);
+    zx_status_t (*get_vmo)(fdio_t* io, zx_handle_t* out, size_t* off, size_t* len);
+} fdio_ops_t;
+
+// fdio_t flags
+#define FDIO_FLAG_CLOEXEC ((int32_t)1 << 0)
+#define FDIO_FLAG_SOCKET ((int32_t)1 << 1)
+#define FDIO_FLAG_EPOLL ((int32_t)1 << 2)
+#define FDIO_FLAG_WAITABLE ((int32_t)1 << 3)
+#define FDIO_FLAG_SOCKET_CONNECTING ((int32_t)1 << 4)
+#define FDIO_FLAG_SOCKET_CONNECTED ((int32_t)1 << 5)
+#define FDIO_FLAG_NONBLOCK ((int32_t)1 << 6)
+
+// The subset of fdio_t per-fd flags queryable via fcntl.
+// Static assertions in unistd.c ensure we aren't colliding.
+#define FDIO_FD_FLAGS FDIO_FLAG_CLOEXEC
+
+typedef struct fdio {
+    fdio_ops_t* ops;
+    uint32_t magic;
+    atomic_int_fast32_t refcount;
+    int32_t dupcount;
+    int32_t flags;
+} fdio_t;
+
+// Lifecycle notes:
+//
+// Upon creation, fdio objects have a refcount of 1.
+// fdio_acquire() and fdio_release() are used to upref
+// and downref, respectively.  Upon downref to 0,
+// fdio_free() is called, which poisons the object and
+// free()s it.
+//
+// The close hook must be called before free and should
+// only be called once.  In normal use, fdio objects are
+// accessed through the fdio_fdtab, and when close is
+// called they are removed from the fdtab and the reference
+// that the fdtab itself is holding is released, at which
+// point they will be free()'d unless somebody is holding
+// a ref due to an ongoing io transaction, which will
+// certainly fail doe to underlying handles being closed
+// at which point a downref will happen and destruction
+// will follow.
+//
+// dupcount tracks how many fdtab entries an fdio object
+// is in.  close() reduces the dupcount, and only actually
+// closes the underlying object when it reaches zero.
+
+#define FDIO_MAGIC 0x4f49584d // FDIO
+
+static inline ssize_t fdio_read(fdio_t* io, void* data, size_t len) {
+    return io->ops->read(io, data, len);
+}
+static inline ssize_t fdio_read_at(fdio_t* io, void* data, size_t len, off_t offset) {
+    return io->ops->read_at(io, data, len, offset);
+}
+static inline ssize_t fdio_write(fdio_t* io, const void* data, size_t len) {
+    return io->ops->write(io, data, len);
+}
+static inline ssize_t fdio_write_at(fdio_t* io, const void* data, size_t len, off_t offset) {
+    return io->ops->write_at(io, data, len, offset);
+}
+static inline off_t fdio_seek(fdio_t* io, off_t offset, int whence) {
+    return io->ops->seek(io, offset, whence);
+}
+static inline zx_status_t fdio_misc(fdio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* data, size_t len) {
+    return io->ops->misc(io, op, off, maxreply, data, len);
+}
+static inline zx_status_t fdio_open(fdio_t* io, const char* path, int32_t flags, uint32_t mode, fdio_t** out) {
+    return io->ops->open(io, path, flags, mode, out);
+}
+zx_status_t fdio_close(fdio_t* io);
+zx_status_t fdio_wait(fdio_t* io, uint32_t events, zx_time_t deadline,
+                      uint32_t* out_pending);
+
+// Wraps a socket with an fdio_t using simple io.
+// Takes ownership of h.
+fdio_t* fdio_pipe_create(zx_handle_t h);
+
+zx_status_t fdio_pipe_posix_ioctl(fdio_t* io, int req, va_list va);
+
+// Wraps a vmo, offset, length with an fdio_t providing a readonly file.
+// Takens ownership of h.
+fdio_t* fdio_vmofile_create(zx_handle_t h, zx_off_t off, zx_off_t len);
+
+// Wraps a socket with an fdio_t using socket io.
+// Takes ownership of h and s.
+fdio_t* fdio_socket_create(zx_handle_t h, zx_handle_t s, int flags);
+
+// creates a message port and pair of simple io fdio_t's
+int fdio_pipe_pair(fdio_t** a, fdio_t** b);
+
+// create a fdio (if possible) from type, handles and extradata
+zx_status_t fdio_from_handles(uint32_t type, zx_handle_t* handles, int hcount,
+                              void* extra, uint32_t esize, fdio_t** out);
+
+void fdio_free(fdio_t* io);
+
+static inline void fdio_acquire(fdio_t* io) {
+    atomic_fetch_add(&io->refcount, 1);
+}
+
+static inline void fdio_release(fdio_t* io) {
+    if (atomic_fetch_sub(&io->refcount, 1) == 1) {
+        fdio_free(io);
+    }
+}
+
+fdio_t* fdio_ns_open_root(fdio_ns_t* ns);
+
+// io will be consumed by this and must not be shared
+void fdio_chdir(fdio_t* io, const char* path);
+
+// Wraps an arbitrary handle with a fdio_t that works with wait hooks.
+// Takes ownership of handle unless shared_handle is true.
+fdio_t* fdio_waitable_create(zx_handle_t h, zx_signals_t signals_in, zx_signals_t signals_out, bool shared_handle);
+
+void fdio_socket_set_stream_ops(fdio_t* io);
+void fdio_socket_set_dgram_ops(fdio_t* io);
+
+zx_status_t fdio_socket_posix_ioctl(fdio_t* io, int req, va_list va);
+zx_status_t fdio_socket_shutdown(fdio_t* io, int how);
+zx_status_t fdio_socketpair_shutdown(fdio_t* io, int how);
+
+// unsupported / do-nothing hooks shared by implementations
+ssize_t fdio_default_read(fdio_t* io, void* _data, size_t len);
+ssize_t fdio_default_read_at(fdio_t* io, void* _data, size_t len, off_t offset);
+ssize_t fdio_default_write(fdio_t* io, const void* _data, size_t len);
+ssize_t fdio_default_write_at(fdio_t* io, const void* _data, size_t len, off_t offset);
+ssize_t fdio_default_recvfrom(fdio_t* io, void* _data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen);
+ssize_t fdio_default_sendto(fdio_t* io, const void* _data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen);
+ssize_t fdio_default_recvmsg(fdio_t* io, struct msghdr* msg, int flags);
+ssize_t fdio_default_sendmsg(fdio_t* io, const struct msghdr* msg, int flags);
+off_t fdio_default_seek(fdio_t* io, off_t offset, int whence);
+zx_status_t fdio_default_misc(fdio_t* io, uint32_t op, int64_t off, uint32_t arg, void* data, size_t len);
+zx_status_t fdio_default_close(fdio_t* io);
+zx_status_t fdio_default_open(fdio_t* io, const char* path, int32_t flags, uint32_t mode, fdio_t** out);
+zx_status_t fdio_default_clone(fdio_t* io, zx_handle_t* handles, uint32_t* types);
+ssize_t fdio_default_ioctl(fdio_t* io, uint32_t op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len);
+void fdio_default_wait_begin(fdio_t* io, uint32_t events, zx_handle_t* handle, zx_signals_t* _signals);
+void fdio_default_wait_end(fdio_t* io, zx_signals_t signals, uint32_t* _events);
+zx_status_t fdio_default_unwrap(fdio_t* io, zx_handle_t* handles, uint32_t* types);
+zx_status_t fdio_default_shutdown(fdio_t* io, int how);
+ssize_t fdio_default_posix_ioctl(fdio_t* io, int req, va_list va);
+zx_status_t fdio_default_get_vmo(fdio_t* io, zx_handle_t* out, size_t* off, size_t* len);
+
+void __fdio_startup_handles_init(uint32_t num, zx_handle_t handles[],
+                                 uint32_t handle_info[])
+    __attribute__((visibility("hidden")));
+
+void __fdio_rchannel_init(void) __attribute__((visibility("hidden")));
+
+typedef struct {
+    mtx_t lock;
+    mtx_t cwd_lock;
+    bool init;
+    mode_t umask;
+    fdio_t* root;
+    fdio_t* cwd;
+    fdio_t* fdtab[MAX_FDIO_FD];
+    fdio_ns_t* ns;
+    char cwd_path[PATH_MAX];
+} fdio_state_t;
+
+extern fdio_state_t __fdio_global_state;
+
+#define fdio_lock (__fdio_global_state.lock)
+#define fdio_root_handle (__fdio_global_state.root)
+#define fdio_cwd_handle (__fdio_global_state.cwd)
+#define fdio_cwd_lock (__fdio_global_state.cwd_lock)
+#define fdio_cwd_path (__fdio_global_state.cwd_path)
+#define fdio_fdtab (__fdio_global_state.fdtab)
+#define fdio_root_init (__fdio_global_state.init)
+#define fdio_root_ns (__fdio_global_state.ns)
diff --git a/system/ulib/fdio/remoteio.c b/system/ulib/fdio/remoteio.c
new file mode 100644
index 0000000..3914898
--- /dev/null
+++ b/system/ulib/fdio/remoteio.c
@@ -0,0 +1,959 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <assert.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <poll.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <threads.h>
+
+#include <zircon/device/device.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+
+#include <fdio/debug.h>
+#include <fdio/io.h>
+#include <fdio/namespace.h>
+#include <fdio/remoteio.h>
+#include <fdio/util.h>
+
+#include "private-remoteio.h"
+
+#define MXDEBUG 0
+
+// POLL_MASK and POLL_SHIFT intend to convert the lower five POLL events into
+// ZX_USER_SIGNALs and vice-versa. Other events need to be manually converted to
+// an zx_signal_t, if they are desired.
+#define POLL_SHIFT  24
+#define POLL_MASK   0x1F
+
+static_assert(ZX_USER_SIGNAL_0 == (1 << POLL_SHIFT), "");
+static_assert((POLLIN << POLL_SHIFT) == DEVICE_SIGNAL_READABLE, "");
+static_assert((POLLPRI << POLL_SHIFT) == DEVICE_SIGNAL_OOB, "");
+static_assert((POLLOUT << POLL_SHIFT) == DEVICE_SIGNAL_WRITABLE, "");
+static_assert((POLLERR << POLL_SHIFT) == DEVICE_SIGNAL_ERROR, "");
+static_assert((POLLHUP << POLL_SHIFT) == DEVICE_SIGNAL_HANGUP, "");
+
+static pthread_key_t rchannel_key;
+
+static void rchannel_cleanup(void* data) {
+    if (data == NULL) {
+        return;
+    }
+    zx_handle_t* handles = (zx_handle_t*)data;
+    if (handles[0] != ZX_HANDLE_INVALID)
+        zx_handle_close(handles[0]);
+    if (handles[1] != ZX_HANDLE_INVALID)
+        zx_handle_close(handles[1]);
+    free(handles);
+}
+
+void __fdio_rchannel_init(void) {
+    if (pthread_key_create(&rchannel_key, &rchannel_cleanup) != 0)
+        abort();
+}
+
+static const char* _opnames[] = ZXRIO_OPNAMES;
+const char* fdio_opname(uint32_t op) {
+    op = ZXRIO_OPNAME(op);
+    if (op < ZXRIO_NUM_OPS) {
+        return _opnames[op];
+    } else {
+        return "unknown";
+    }
+}
+
+static bool is_message_valid(zxrio_msg_t* msg) {
+    if ((msg->datalen > FDIO_CHUNK_SIZE) ||
+        (msg->hcount > FDIO_MAX_HANDLES)) {
+        return false;
+    }
+    return true;
+}
+
+static bool is_message_reply_valid(zxrio_msg_t* msg, uint32_t size) {
+    if ((size < ZXRIO_HDR_SZ) ||
+        (msg->datalen != (size - ZXRIO_HDR_SZ))) {
+        return false;
+    }
+    return is_message_valid(msg);
+}
+
+static void discard_handles(zx_handle_t* handles, unsigned count) {
+    while (count-- > 0) {
+        zx_handle_close(*handles++);
+    }
+}
+
+zx_status_t zxrio_handle_rpc(zx_handle_t h, zxrio_msg_t* msg, zxrio_cb_t cb, void* cookie) {
+    zx_status_t r;
+
+    // NOTE: hcount intentionally received out-of-bound from the message to
+    // avoid letting "client-supplied" bytes override the REAL hcount value.
+    uint32_t hcount = 0;
+    uint32_t dsz = sizeof(zxrio_msg_t);
+    if ((r = zx_channel_read(h, 0, msg, msg->handle, dsz, FDIO_MAX_HANDLES, &dsz, &hcount)) < 0) {
+        return r;
+    }
+    // Now, "msg->hcount" can be trusted once again.
+    msg->hcount = hcount;
+
+    if (!is_message_reply_valid(msg, dsz)) {
+        discard_handles(msg->handle, msg->hcount);
+        return ZX_ERR_INVALID_ARGS;
+    }
+
+    bool is_close = (ZXRIO_OP(msg->op) == ZXRIO_CLOSE);
+
+    xprintf("handle_rio: op=%s arg=%d len=%u hsz=%d\n",
+            fdio_opname(msg->op), msg->arg, msg->datalen, msg->hcount);
+
+    if ((msg->arg = cb(msg, cookie)) == ERR_DISPATCHER_INDIRECT) {
+        // callback is handling the reply itself
+        // and took ownership of the reply handle
+        return ZX_OK;
+    }
+    if ((msg->arg < 0) || !is_message_valid(msg)) {
+        // in the event of an error response or bad message
+        // release all the handles and data payload
+        discard_handles(msg->handle, msg->hcount);
+        msg->datalen = 0;
+        msg->hcount = 0;
+        // specific errors are prioritized over the bad
+        // message case which we represent as ZX_ERR_INTERNAL
+        // to differentiate from ZX_ERR_IO on the near side
+        // TODO(MG-974): consider a better error code
+        msg->arg = (msg->arg < 0) ? msg->arg : ZX_ERR_INTERNAL;
+    }
+
+    msg->op = ZXRIO_STATUS;
+    if ((r = zx_channel_write(h, 0, msg, ZXRIO_HDR_SZ + msg->datalen, msg->handle, msg->hcount)) < 0) {
+        discard_handles(msg->handle, msg->hcount);
+    }
+    if (is_close) {
+        // signals to not perform a close callback
+        return ERR_DISPATCHER_DONE;
+    } else {
+        return r;
+    }
+}
+
+zx_status_t zxrio_handle_close(zxrio_cb_t cb, void* cookie) {
+    zxrio_msg_t msg;
+
+    // remote side was closed;
+    msg.op = ZXRIO_CLOSE;
+    msg.arg = 0;
+    msg.datalen = 0;
+    msg.hcount = 0;
+    cb(&msg, cookie);
+    return ZX_OK;
+}
+
+zx_status_t zxrio_handler(zx_handle_t h, void* _cb, void* cookie) {
+    zxrio_cb_t cb = _cb;
+
+    if (h == ZX_HANDLE_INVALID) {
+        return zxrio_handle_close(cb, cookie);
+    } else {
+        zxrio_msg_t msg;
+        return zxrio_handle_rpc(h, &msg, cb, cookie);
+    }
+}
+
+void zxrio_txn_handoff(zx_handle_t srv, zx_handle_t reply, zxrio_msg_t* msg) {
+    msg->txid = 0;
+    msg->handle[0] = reply;
+    msg->hcount = 1;
+
+    zx_status_t r;
+    uint32_t dsize = ZXRIO_HDR_SZ + msg->datalen;
+    if ((r = zx_channel_write(srv, 0, msg, dsize, msg->handle, msg->hcount)) < 0) {
+        // nothing to do but inform the caller that we failed
+        struct {
+            zx_status_t status;
+            uint32_t type;
+        } error = { r, 0 };
+        zx_channel_write(reply, 0, &error, sizeof(error), NULL, 0);
+        zx_handle_close(reply);
+    }
+}
+
+// on success, msg->hcount indicates number of valid handles in msg->handle
+// on error there are never any handles
+static zx_status_t zxrio_txn(zxrio_t* rio, zxrio_msg_t* msg) {
+    if (!is_message_valid(msg)) {
+        return ZX_ERR_INVALID_ARGS;
+    }
+
+    msg->txid = atomic_fetch_add(&rio->txid, 1);
+    xprintf("txn h=%x txid=%x op=%d len=%u\n", rio->h, msg->txid, msg->op, msg->datalen);
+
+    zx_status_t r;
+    zx_status_t rs = ZX_ERR_INTERNAL;
+    uint32_t dsize;
+
+    zx_channel_call_args_t args;
+    args.wr_bytes = msg;
+    args.wr_handles = msg->handle;
+    args.rd_bytes = msg;
+    args.rd_handles = msg->handle;
+    args.wr_num_bytes = ZXRIO_HDR_SZ + msg->datalen;
+    args.wr_num_handles = msg->hcount;
+    args.rd_num_bytes = ZXRIO_HDR_SZ + FDIO_CHUNK_SIZE;
+    args.rd_num_handles = FDIO_MAX_HANDLES;
+
+    r = zx_channel_call(rio->h, 0, ZX_TIME_INFINITE, &args, &dsize, &msg->hcount, &rs);
+    if (r < 0) {
+        if (r == ZX_ERR_CALL_FAILED) {
+            // read phase failed, true status is in rs
+            msg->hcount = 0;
+            return rs;
+        } else {
+            // write phase failed, we must discard the handles
+            goto fail_discard_handles;
+        }
+    }
+
+    // check for protocol errors
+    if (!is_message_reply_valid(msg, dsize) ||
+        (ZXRIO_OP(msg->op) != ZXRIO_STATUS)) {
+        r = ZX_ERR_IO;
+        goto fail_discard_handles;
+    }
+    // check for remote error
+    if ((r = msg->arg) < 0) {
+        goto fail_discard_handles;
+    }
+    return r;
+
+fail_discard_handles:
+    // We failed either writing at all (still have the handles)
+    // or after reading (need to abandon any handles we received)
+    discard_handles(msg->handle, msg->hcount);
+    msg->hcount = 0;
+    return r;
+}
+
+ssize_t zxrio_ioctl(fdio_t* io, uint32_t op, const void* in_buf,
+                    size_t in_len, void* out_buf, size_t out_len) {
+    zxrio_t* rio = (zxrio_t*)io;
+    const uint8_t* data = in_buf;
+    zx_status_t r = 0;
+    zxrio_msg_t msg;
+
+    if (in_len > FDIO_IOCTL_MAX_INPUT || out_len > FDIO_CHUNK_SIZE) {
+        return ZX_ERR_INVALID_ARGS;
+    }
+
+    memset(&msg, 0, ZXRIO_HDR_SZ);
+    msg.op = ZXRIO_IOCTL;
+    msg.datalen = in_len;
+    msg.arg = out_len;
+    msg.arg2.op = op;
+
+    switch (IOCTL_KIND(op)) {
+    case IOCTL_KIND_GET_HANDLE:
+        if (out_len < sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        break;
+    case IOCTL_KIND_GET_TWO_HANDLES:
+        if (out_len < 2 * sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        break;
+    case IOCTL_KIND_GET_THREE_HANDLES:
+        if (out_len < 3 * sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        break;
+    case IOCTL_KIND_SET_HANDLE:
+        msg.op = ZXRIO_IOCTL_1H;
+        if (in_len < sizeof(zx_handle_t)) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        msg.hcount = 1;
+        msg.handle[0] = *((zx_handle_t*) in_buf);
+        break;
+    }
+
+    memcpy(msg.data, data, in_len);
+
+    if ((r = zxrio_txn(rio, &msg)) < 0) {
+        return r;
+    }
+
+    size_t copy_len = msg.datalen;
+    if (msg.datalen > out_len) {
+        copy_len = out_len;
+    }
+
+    memcpy(out_buf, msg.data, copy_len);
+
+    int handles = 0;
+    switch (IOCTL_KIND(op)) {
+        case IOCTL_KIND_GET_HANDLE:
+            handles = (msg.hcount > 0 ? 1 : 0);
+            if (handles) {
+                memcpy(out_buf, msg.handle, sizeof(zx_handle_t));
+            } else {
+                memset(out_buf, 0, sizeof(zx_handle_t));
+            }
+            break;
+        case IOCTL_KIND_GET_TWO_HANDLES:
+            handles = (msg.hcount > 2 ? 2 : msg.hcount);
+            if (handles) {
+                memcpy(out_buf, msg.handle, handles * sizeof(zx_handle_t));
+            }
+            if (handles < 2) {
+                memset(out_buf, 0, (2 - handles) * sizeof(zx_handle_t));
+            }
+            break;
+        case IOCTL_KIND_GET_THREE_HANDLES:
+            handles = (msg.hcount > 3 ? 3 : msg.hcount);
+            if (handles) {
+                memcpy(out_buf, msg.handle, handles * sizeof(zx_handle_t));
+            }
+            if (handles < 3) {
+                memset(out_buf, 0, (3 - handles) * sizeof(zx_handle_t));
+            }
+            break;
+    }
+    discard_handles(msg.handle + handles, msg.hcount - handles);
+
+    return r;
+}
+
+static ssize_t write_common(uint32_t op, fdio_t* io, const void* _data, size_t len, off_t offset) {
+    zxrio_t* rio = (zxrio_t*)io;
+    const uint8_t* data = _data;
+    ssize_t count = 0;
+    zx_status_t r = 0;
+    zxrio_msg_t msg;
+    ssize_t xfer;
+
+    while (len > 0) {
+        xfer = (len > FDIO_CHUNK_SIZE) ? FDIO_CHUNK_SIZE : len;
+
+        memset(&msg, 0, ZXRIO_HDR_SZ);
+        msg.op = op;
+        msg.datalen = xfer;
+        if (op == ZXRIO_WRITE_AT)
+            msg.arg2.off = offset;
+        memcpy(msg.data, data, xfer);
+
+        if ((r = zxrio_txn(rio, &msg)) < 0) {
+            break;
+        }
+        discard_handles(msg.handle, msg.hcount);
+
+        if (r > xfer) {
+            r = ZX_ERR_IO;
+            break;
+        }
+        count += r;
+        data += r;
+        len -= r;
+        if (op == ZXRIO_WRITE_AT)
+            offset += r;
+        // stop at short read
+        if (r < xfer) {
+            break;
+        }
+    }
+    return count ? count : r;
+}
+
+static ssize_t zxrio_write(fdio_t* io, const void* _data, size_t len) {
+    return write_common(ZXRIO_WRITE, io, _data, len, 0);
+}
+
+static ssize_t zxrio_write_at(fdio_t* io, const void* _data, size_t len, off_t offset) {
+    return write_common(ZXRIO_WRITE_AT, io, _data, len, offset);
+}
+
+static ssize_t read_common(uint32_t op, fdio_t* io, void* _data, size_t len, off_t offset) {
+    zxrio_t* rio = (zxrio_t*)io;
+    uint8_t* data = _data;
+    ssize_t count = 0;
+    zx_status_t r = 0;
+    zxrio_msg_t msg;
+    ssize_t xfer;
+
+    while (len > 0) {
+        xfer = (len > FDIO_CHUNK_SIZE) ? FDIO_CHUNK_SIZE : len;
+
+        memset(&msg, 0, ZXRIO_HDR_SZ);
+        msg.op = op;
+        msg.arg = xfer;
+        if (op == ZXRIO_READ_AT)
+            msg.arg2.off = offset;
+
+        if ((r = zxrio_txn(rio, &msg)) < 0) {
+            break;
+        }
+        discard_handles(msg.handle, msg.hcount);
+
+        if ((r > (int)msg.datalen) || (r > xfer)) {
+            r = ZX_ERR_IO;
+            break;
+        }
+        memcpy(data, msg.data, r);
+        count += r;
+        data += r;
+        len -= r;
+        if (op == ZXRIO_READ_AT)
+            offset += r;
+
+        // stop at short read
+        if (r < xfer) {
+            break;
+        }
+    }
+    return count ? count : r;
+}
+
+static ssize_t zxrio_read(fdio_t* io, void* _data, size_t len) {
+    return read_common(ZXRIO_READ, io, _data, len, 0);
+}
+
+static ssize_t zxrio_read_at(fdio_t* io, void* _data, size_t len, off_t offset) {
+    return read_common(ZXRIO_READ_AT, io, _data, len, offset);
+}
+
+static off_t zxrio_seek(fdio_t* io, off_t offset, int whence) {
+    zxrio_t* rio = (zxrio_t*)io;
+    zxrio_msg_t msg;
+    zx_status_t r;
+
+    memset(&msg, 0, ZXRIO_HDR_SZ);
+    msg.op = ZXRIO_SEEK;
+    msg.arg2.off = offset;
+    msg.arg = whence;
+
+    if ((r = zxrio_txn(rio, &msg)) < 0) {
+        return r;
+    }
+
+    discard_handles(msg.handle, msg.hcount);
+    return msg.arg2.off;
+}
+
+zx_status_t zxrio_close(fdio_t* io) {
+    zxrio_t* rio = (zxrio_t*)io;
+    zxrio_msg_t msg;
+    zx_status_t r;
+
+    memset(&msg, 0, ZXRIO_HDR_SZ);
+    msg.op = ZXRIO_CLOSE;
+
+    if ((r = zxrio_txn(rio, &msg)) >= 0) {
+        discard_handles(msg.handle, msg.hcount);
+    }
+
+    zx_handle_t h = rio->h;
+    rio->h = 0;
+    zx_handle_close(h);
+    if (rio->h2 > 0) {
+        h = rio->h2;
+        rio->h2 = 0;
+        zx_handle_close(h);
+    }
+
+    return r;
+}
+
+static zx_status_t zxrio_reply_channel_call(zx_handle_t rio_h, zxrio_msg_t* msg,
+                                            zxrio_object_t* info) {
+    zx_status_t r;
+    zx_handle_t h;
+    if ((r = zx_channel_create(0, &h, &msg->handle[0])) < 0) {
+        return r;
+    }
+    msg->hcount = 1;
+
+    // Write the (one-way) request message
+    if ((r = zx_channel_write(rio_h, 0, msg, ZXRIO_HDR_SZ + msg->datalen,
+                              msg->handle, msg->hcount)) < 0) {
+        zx_handle_close(msg->handle[0]);
+        zx_handle_close(h);
+        return r;
+    }
+
+    // Wait
+    zx_object_wait_one(h, ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, ZX_TIME_INFINITE, NULL);
+
+    // Attempt to read the callback response
+    memset(info, 0xfe, sizeof(*info));
+    uint32_t dsize = ZXRIO_OBJECT_MAXSIZE;
+    info->hcount = FDIO_MAX_HANDLES;
+    r = zx_channel_read(h, 0, info, &info->handle[1], dsize,
+                        info->hcount, &dsize, &info->hcount);
+    if (r < 0) {
+        zx_handle_close(h);
+        return r;
+    }
+    info->handle[0] = h;
+    info->hcount++;
+    if (dsize < ZXRIO_OBJECT_MINSIZE) {
+        r = ZX_ERR_IO;
+    } else {
+        info->esize = dsize - ZXRIO_OBJECT_MINSIZE;
+        r = info->status;
+    }
+    if (r < 0) {
+        discard_handles(info->handle, info->hcount);
+    }
+    return r;
+}
+
+// This function always consumes the cnxn handle
+// The svc handle is only used to send a message
+static zx_status_t zxrio_connect(zx_handle_t svc, zx_handle_t cnxn,
+                                 uint32_t op, int32_t flags, uint32_t mode,
+                                 const char* name) {
+    size_t len = strlen(name);
+    if (len >= PATH_MAX) {
+        zx_handle_close(cnxn);
+        return ZX_ERR_BAD_PATH;
+    }
+
+    zxrio_msg_t msg;
+    memset(&msg, 0, ZXRIO_HDR_SZ);
+    msg.op = op;
+    msg.datalen = len;
+    msg.arg = O_PIPELINE | flags;
+    msg.arg2.mode = mode;
+    msg.hcount = 1;
+    msg.handle[0] = cnxn;
+    memcpy(msg.data, name, len);
+
+    zx_status_t r;
+    if ((r = zx_channel_write(svc, 0, &msg, ZXRIO_HDR_SZ + msg.datalen, msg.handle, 1)) < 0) {
+        zx_handle_close(cnxn);
+        return r;
+    }
+
+    return ZX_OK;
+}
+
+zx_status_t fdio_service_connect(const char* svcpath, zx_handle_t h) {
+    if (svcpath == NULL) {
+        zx_handle_close(h);
+        return ZX_ERR_INVALID_ARGS;
+    }
+    // Otherwise attempt to connect through the root namespace
+    if (fdio_root_ns != NULL) {
+        return fdio_ns_connect(fdio_root_ns, svcpath, h);
+    }
+    // Otherwise we fail
+    zx_handle_close(h);
+    return ZX_ERR_NOT_FOUND;
+}
+
+zx_status_t fdio_service_connect_at(zx_handle_t dir, const char* path, zx_handle_t h) {
+    if (path == NULL) {
+        zx_handle_close(h);
+        return ZX_ERR_INVALID_ARGS;
+    }
+    if (dir == ZX_HANDLE_INVALID) {
+        zx_handle_close(h);
+        return ZX_ERR_UNAVAILABLE;
+    }
+    return zxrio_connect(dir, h, ZXRIO_OPEN, O_RDWR, 0755, path);
+}
+
+zx_handle_t fdio_service_clone(zx_handle_t svc) {
+    zx_handle_t cli, srv;
+    zx_status_t r;
+    if (svc == ZX_HANDLE_INVALID) {
+        return ZX_HANDLE_INVALID;
+    }
+    if ((r = zx_channel_create(0, &cli, &srv)) < 0) {
+        return ZX_HANDLE_INVALID;
+    }
+    if ((r = zxrio_connect(svc, srv, ZXRIO_CLONE, O_RDWR, 0755, "")) < 0) {
+        zx_handle_close(cli);
+        return ZX_HANDLE_INVALID;
+    }
+    return cli;
+}
+
+zx_status_t zxrio_misc(fdio_t* io, uint32_t op, int64_t off,
+                       uint32_t maxreply, void* ptr, size_t len) {
+    zxrio_t* rio = (zxrio_t*)io;
+    zxrio_msg_t msg;
+    zx_status_t r;
+
+    if ((len > FDIO_CHUNK_SIZE) || (maxreply > FDIO_CHUNK_SIZE)) {
+        return ZX_ERR_INVALID_ARGS;
+    }
+
+    memset(&msg, 0, ZXRIO_HDR_SZ);
+    msg.op = op;
+    msg.arg = maxreply;
+    msg.arg2.off = off;
+    msg.datalen = len;
+    if (ptr && len > 0) {
+        memcpy(msg.data, ptr, len);
+    }
+    switch (op) {
+    case ZXRIO_RENAME:
+    case ZXRIO_LINK:
+        // As a hack, 'Rename' and 'Link' take token handles through
+        // the offset argument.
+        msg.handle[0] = (zx_handle_t) off;
+        msg.hcount = 1;
+    }
+
+    if ((r = zxrio_txn(rio, &msg)) < 0) {
+        return r;
+    }
+
+    switch (op) {
+    case ZXRIO_MMAP: {
+        // Ops which receive single handles:
+        if ((msg.hcount != 1) || (msg.datalen > maxreply)) {
+            discard_handles(msg.handle, msg.hcount);
+            return ZX_ERR_IO;
+        }
+        r = msg.handle[0];
+        memcpy(ptr, msg.data, msg.datalen);
+        break;
+    }
+    case ZXRIO_FCNTL:
+        // This is a bit of a hack, but for this case, we
+        // return 'msg.arg2.mode' in the data field to simplify
+        // this call for the client.
+        discard_handles(msg.handle, msg.hcount);
+        if (ptr) {
+            memcpy(ptr, &msg.arg2.mode, sizeof(msg.arg2.mode));
+        }
+        break;
+    default:
+        // Ops which don't receive handles:
+        discard_handles(msg.handle, msg.hcount);
+        if (msg.datalen > maxreply) {
+            return ZX_ERR_IO;
+        }
+        if (ptr && msg.datalen > 0) {
+            memcpy(ptr, msg.data, msg.datalen);
+        }
+    }
+    return r;
+}
+
+zx_status_t fdio_create_fd(zx_handle_t* handles, uint32_t* types, size_t hcount,
+                           int* fd_out) {
+    fdio_t* io;
+    zx_status_t r;
+    int fd;
+    uint32_t type;
+
+    switch (PA_HND_TYPE(types[0])) {
+    case PA_FDIO_REMOTE:
+        type = FDIO_PROTOCOL_REMOTE;
+        break;
+    case PA_FDIO_PIPE:
+        type = FDIO_PROTOCOL_PIPE;
+        break;
+    case PA_FDIO_SOCKET:
+        type = FDIO_PROTOCOL_SOCKET_CONNECTED;
+        break;
+    default:
+        r = ZX_ERR_IO;
+        goto fail;
+    }
+
+    if ((r = fdio_from_handles(type, handles, hcount, NULL, 0, &io)) != ZX_OK) {
+        goto fail;
+    }
+
+    fd = fdio_bind_to_fd(io, -1, 0);
+    if (fd < 0) {
+        fdio_close(io);
+        fdio_release(io);
+        return ZX_ERR_BAD_STATE;
+    }
+
+    *fd_out = fd;
+    return ZX_OK;
+fail:
+    for (size_t i = 0; i < hcount; i++) {
+        zx_handle_close(handles[i]);
+    }
+    return r;
+}
+
+zx_status_t fdio_from_handles(uint32_t type, zx_handle_t* handles, int hcount,
+                              void* extra, uint32_t esize, fdio_t** out) {
+    // All failure cases which require discard_handles set r and break
+    // to the end. All other cases in which handle ownership is moved
+    // on return locally.
+    zx_status_t r;
+    fdio_t* io;
+    switch (type) {
+    case FDIO_PROTOCOL_REMOTE:
+        if (hcount == 1) {
+            io = fdio_remote_create(handles[0], 0);
+            xprintf("rio (%x,%x) -> %p\n", handles[0], 0, io);
+        } else if (hcount == 2) {
+            io = fdio_remote_create(handles[0], handles[1]);
+            xprintf("rio (%x,%x) -> %p\n", handles[0], handles[1], io);
+        } else {
+            r = ZX_ERR_INVALID_ARGS;
+            break;
+        }
+        if (io == NULL) {
+            return ZX_ERR_NO_RESOURCES;
+        } else {
+            *out = io;
+            return ZX_OK;
+        }
+        break;
+    case FDIO_PROTOCOL_SERVICE:
+        if (hcount != 1) {
+            r = ZX_ERR_INVALID_ARGS;
+            break;
+        } else if ((*out = fdio_service_create(handles[0])) == NULL) {
+            return ZX_ERR_NO_RESOURCES;
+        } else {
+            return ZX_OK;
+        }
+        break;
+    case FDIO_PROTOCOL_PIPE:
+        if (hcount != 1) {
+            r = ZX_ERR_INVALID_ARGS;
+            break;
+        } else if ((*out = fdio_pipe_create(handles[0])) == NULL) {
+            return ZX_ERR_NO_RESOURCES;
+        } else {
+            return ZX_OK;
+        }
+    case FDIO_PROTOCOL_VMOFILE: {
+        zx_off_t* args = extra;
+        if ((hcount != 2) || (esize != (sizeof(zx_off_t) * 2))) {
+            r = ZX_ERR_INVALID_ARGS;
+            break;
+        }
+        // Currently, VMO Files don't use a client-side control channel.
+        zx_handle_close(handles[0]);
+        if ((*out = fdio_vmofile_create(handles[1], args[0], args[1])) == NULL) {
+            return ZX_ERR_NO_RESOURCES;
+        } else {
+            return ZX_OK;
+        }
+    }
+    case FDIO_PROTOCOL_SOCKET_CONNECTED:
+    case FDIO_PROTOCOL_SOCKET: {
+        int flags = (type == FDIO_PROTOCOL_SOCKET_CONNECTED) ? FDIO_FLAG_SOCKET_CONNECTED : 0;
+        if (hcount == 1) {
+            io = fdio_socket_create(handles[0], ZX_HANDLE_INVALID, flags);
+        } else if (hcount == 2) {
+            io = fdio_socket_create(handles[0], handles[1], flags);
+        } else {
+            r = ZX_ERR_INVALID_ARGS;
+            break;
+        }
+        if (io == NULL) {
+            return ZX_ERR_NO_RESOURCES;
+        } else {
+            *out = io;
+            return ZX_OK;
+        }
+    }
+    default:
+        r = ZX_ERR_NOT_SUPPORTED;
+        break;
+    }
+    discard_handles(handles, hcount);
+    return r;
+}
+
+zx_status_t zxrio_getobject(zx_handle_t rio_h, uint32_t op, const char* name,
+                            int32_t flags, uint32_t mode,
+                            zxrio_object_t* info) {
+    if (name == NULL) {
+        return ZX_ERR_INVALID_ARGS;
+    }
+
+    size_t len = strlen(name);
+    if (len >= PATH_MAX) {
+        return ZX_ERR_BAD_PATH;
+    }
+
+    if (flags & O_PIPELINE) {
+        zx_handle_t h0, h1;
+        zx_status_t r;
+        if ((r = zx_channel_create(0, &h0, &h1)) < 0) {
+            return r;
+        }
+        if ((r = zxrio_connect(rio_h, h1, ZXRIO_OPEN, flags, mode, name)) < 0) {
+            zx_handle_close(h0);
+            return r;
+        }
+        // fake up a reply message since pipelined opens don't generate one
+        info->status = ZX_OK;
+        info->type = FDIO_PROTOCOL_REMOTE;
+        info->esize = 0;
+        info->hcount = 1;
+        info->handle[0] = h0;
+        return ZX_OK;
+    } else {
+        zxrio_msg_t msg;
+        memset(&msg, 0, ZXRIO_HDR_SZ);
+        msg.op = op;
+        msg.datalen = len;
+        msg.arg = flags;
+        msg.arg2.mode = mode;
+        memcpy(msg.data, name, len);
+
+        return zxrio_reply_channel_call(rio_h, &msg, info);
+    }
+}
+
+zx_status_t zxrio_open_handle(zx_handle_t h, const char* path, int32_t flags,
+                              uint32_t mode, fdio_t** out) {
+    zxrio_object_t info;
+    zx_status_t r = zxrio_getobject(h, ZXRIO_OPEN, path, flags, mode, &info);
+    if (r < 0) {
+        return r;
+    }
+    return fdio_from_handles(info.type, info.handle, info.hcount, info.extra, info.esize, out);
+}
+
+zx_status_t zxrio_open_handle_raw(zx_handle_t h, const char* path, int32_t flags,
+                                  uint32_t mode, zx_handle_t *out) {
+    zxrio_object_t info;
+    zx_status_t r = zxrio_getobject(h, ZXRIO_OPEN, path, flags, mode, &info);
+    if (r < 0) {
+        return r;
+    }
+    if ((info.type == FDIO_PROTOCOL_REMOTE) && (info.hcount > 0)) {
+        for (unsigned n = 1; n < info.hcount; n++) {
+            zx_handle_close(info.handle[n]);
+        }
+        *out = info.handle[0];
+        return ZX_OK;
+    }
+    for (unsigned n = 0; n < info.hcount; n++) {
+        zx_handle_close(info.handle[n]);
+    }
+    return ZX_ERR_WRONG_TYPE;
+}
+
+zx_status_t zxrio_open(fdio_t* io, const char* path, int32_t flags, uint32_t mode, fdio_t** out) {
+    zxrio_t* rio = (void*)io;
+    zxrio_object_t info;
+    zx_status_t r = zxrio_getobject(rio->h, ZXRIO_OPEN, path, flags, mode, &info);
+    if (r < 0) {
+        return r;
+    }
+    return fdio_from_handles(info.type, info.handle, info.hcount, info.extra, info.esize, out);
+}
+
+static zx_status_t zxrio_clone(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
+    zxrio_t* rio = (void*)io;
+    zxrio_object_t info;
+    zx_status_t r = zxrio_getobject(rio->h, ZXRIO_CLONE, "", 0, 0, &info);
+    if (r < 0) {
+        return r;
+    }
+    for (unsigned i = 0; i < info.hcount; i++) {
+        types[i] = PA_FDIO_REMOTE;
+    }
+    memcpy(handles, info.handle, info.hcount * sizeof(zx_handle_t));
+    return info.hcount;
+}
+
+zx_status_t __zxrio_clone(zx_handle_t h, zx_handle_t* handles, uint32_t* types) {
+    zxrio_t rio;
+    rio.h = h;
+    return zxrio_clone(&rio.io, handles, types);
+}
+
+static zx_status_t zxrio_unwrap(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
+    zxrio_t* rio = (void*)io;
+    zx_status_t r;
+    handles[0] = rio->h;
+    types[0] = PA_FDIO_REMOTE;
+    if (rio->h2 != 0) {
+        handles[1] = rio->h2;
+        types[1] = PA_FDIO_REMOTE;
+        r = 2;
+    } else {
+        r = 1;
+    }
+    free(io);
+    return r;
+}
+
+static void zxrio_wait_begin(fdio_t* io, uint32_t events, zx_handle_t* handle, zx_signals_t* _signals) {
+    zxrio_t* rio = (void*)io;
+    *handle = rio->h2;
+
+    zx_signals_t signals = 0;
+    // Manually add signals that don't fit within POLL_MASK
+    if (events & POLLRDHUP) {
+        signals |= ZX_CHANNEL_PEER_CLOSED;
+    }
+
+    // POLLERR is always detected
+    *_signals = (((POLLERR | events) & POLL_MASK) << POLL_SHIFT) | signals;
+}
+
+static void zxrio_wait_end(fdio_t* io, zx_signals_t signals, uint32_t* _events) {
+    // Manually add events that don't fit within POLL_MASK
+    uint32_t events = 0;
+    if (signals & ZX_CHANNEL_PEER_CLOSED) {
+        events |= POLLRDHUP;
+    }
+    *_events = ((signals >> POLL_SHIFT) & POLL_MASK) | events;
+}
+
+static fdio_ops_t zx_remote_ops = {
+    .read = zxrio_read,
+    .read_at = zxrio_read_at,
+    .write = zxrio_write,
+    .write_at = zxrio_write_at,
+    .recvfrom = fdio_default_recvfrom,
+    .sendto = fdio_default_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
+    .misc = zxrio_misc,
+    .seek = zxrio_seek,
+    .close = zxrio_close,
+    .open = zxrio_open,
+    .clone = zxrio_clone,
+    .ioctl = zxrio_ioctl,
+    .wait_begin = zxrio_wait_begin,
+    .wait_end = zxrio_wait_end,
+    .unwrap = zxrio_unwrap,
+    .shutdown = fdio_default_shutdown,
+    .posix_ioctl = fdio_default_posix_ioctl,
+    .get_vmo = fdio_default_get_vmo,
+};
+
+fdio_t* fdio_remote_create(zx_handle_t h, zx_handle_t e) {
+    zxrio_t* rio = calloc(1, sizeof(*rio));
+    if (rio == NULL) {
+        zx_handle_close(h);
+        zx_handle_close(e);
+        return NULL;
+    }
+    rio->io.ops = &zx_remote_ops;
+    rio->io.magic = FDIO_MAGIC;
+    atomic_init(&rio->io.refcount, 1);
+    rio->h = h;
+    rio->h2 = e;
+    return &rio->io;
+}
diff --git a/system/ulib/fdio/remotesocket.c b/system/ulib/fdio/remotesocket.c
new file mode 100644
index 0000000..5861ae6
--- /dev/null
+++ b/system/ulib/fdio/remotesocket.c
@@ -0,0 +1,599 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <poll.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+
+#include <fdio/io.h>
+#include <fdio/remoteio.h>
+#include <fdio/socket.h>
+#include <fdio/util.h>
+
+#include "private-remoteio.h"
+
+
+static ssize_t zxsio_read_stream(fdio_t* io, void* data, size_t len) {
+    zxrio_t* rio = (zxrio_t*)io;
+    int nonblock = rio->io.flags & FDIO_FLAG_NONBLOCK;
+
+    // TODO: let the generic read() to do this loop
+    for (;;) {
+        ssize_t r;
+        size_t bytes_read;
+        if ((r = zx_socket_read(rio->h2, 0, data, len, &bytes_read)) == ZX_OK) {
+            // zx_socket_read() sets *actual to the number of bytes in the buffer when data is NULL
+            // and len is 0. read() should return 0 in that case.
+            if (len == 0) {
+                return 0;
+            } else {
+                return (ssize_t)bytes_read;
+            }
+        }
+        if (r == ZX_ERR_PEER_CLOSED || r == ZX_ERR_BAD_STATE) {
+            return 0;
+        } else if (r == ZX_ERR_SHOULD_WAIT && !nonblock) {
+            zx_signals_t pending;
+            r = zx_object_wait_one(rio->h2,
+                                   ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED | ZX_SOCKET_READ_DISABLED,
+                                   ZX_TIME_INFINITE, &pending);
+            if (r < 0) {
+                return r;
+            }
+            if (pending & ZX_SOCKET_READABLE) {
+                continue;
+            }
+            if (pending & (ZX_SOCKET_PEER_CLOSED | ZX_SOCKET_READ_DISABLED)) {
+                return 0;
+            }
+            // impossible
+            return ZX_ERR_INTERNAL;
+        }
+        return r;
+    }
+}
+
+static ssize_t zxsio_recvfrom(fdio_t* io, void* data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen) {
+    struct iovec iov;
+    iov.iov_base = data;
+    iov.iov_len = len;
+
+    struct msghdr msg;
+    msg.msg_name = addr;
+    // the caller (recvfrom) checks if addrlen is NULL.
+    msg.msg_namelen = (addr == NULL) ? 0 : *addrlen;
+    msg.msg_iov = &iov;
+    msg.msg_iovlen = 1;
+    msg.msg_control = NULL;
+    msg.msg_controllen = 0;
+    msg.msg_flags = 0;
+
+    ssize_t r = io->ops->recvmsg(io, &msg, flags);
+    if (addr != NULL)
+        *addrlen = msg.msg_namelen;
+
+    return r;
+}
+
+static ssize_t zxsio_write_stream(fdio_t* io, const void* data, size_t len) {
+    zxrio_t* rio = (zxrio_t*)io;
+    int nonblock = rio->io.flags & FDIO_FLAG_NONBLOCK;
+
+    // TODO: let the generic write() to do this loop
+    for (;;) {
+        ssize_t r;
+        if ((r = zx_socket_write(rio->h2, 0, data, len, &len)) == ZX_OK) {
+            return (ssize_t) len;
+        }
+        if (r == ZX_ERR_SHOULD_WAIT && !nonblock) {
+            zx_signals_t pending;
+            r = zx_object_wait_one(rio->h2,
+                                   ZX_SOCKET_WRITABLE | ZX_SOCKET_WRITE_DISABLED | ZX_SOCKET_PEER_CLOSED,
+                                   ZX_TIME_INFINITE, &pending);
+            if (r < 0) {
+                return r;
+            }
+            if (pending & (ZX_SOCKET_WRITE_DISABLED | ZX_SOCKET_PEER_CLOSED)) {
+                return ZX_ERR_PEER_CLOSED;
+            }
+            if (pending & ZX_SOCKET_WRITABLE) {
+                continue;
+            }
+            // impossible
+            return ZX_ERR_INTERNAL;
+        }
+        return r;
+    }
+}
+
+static ssize_t zxsio_sendto(fdio_t* io, const void* data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen) {
+    struct iovec iov;
+    iov.iov_base = (void*)data;
+    iov.iov_len = len;
+
+    struct msghdr msg;
+    msg.msg_name = (void*)addr;
+    msg.msg_namelen = addrlen;
+    msg.msg_iov = &iov;
+    msg.msg_iovlen = 1;
+    msg.msg_control = NULL;
+    msg.msg_controllen = 0;
+    msg.msg_flags = 0; // this field is ignored
+
+    return io->ops->sendmsg(io, &msg, flags);
+}
+
+
+static ssize_t zxsio_recvmsg_stream(fdio_t* io, struct msghdr* msg, int flags) {
+    if (flags != 0) {
+        // TODO: support MSG_OOB
+        return ZX_ERR_NOT_SUPPORTED;
+    }
+    if (!(io->flags & FDIO_FLAG_SOCKET_CONNECTED)) {
+        return ZX_ERR_BAD_STATE;
+    }
+    // we ignore msg_name and msg_namelen members.
+    // (this is a consistent behavior with other OS implementations for TCP protocol)
+    ssize_t total = 0;
+    for (int i = 0; i < msg->msg_iovlen; i++) {
+        struct iovec *iov = &msg->msg_iov[i];
+        ssize_t n = zxsio_read_stream(io, iov->iov_base, iov->iov_len);
+        if (n < 0) {
+            return n;
+        }
+        total += n;
+        if ((size_t)n != iov->iov_len) {
+            break;
+        }
+    }
+    return total;
+}
+
+static ssize_t zxsio_sendmsg_stream(fdio_t* io, const struct msghdr* msg, int flags) {
+    if (flags != 0) {
+        // TODO: support MSG_OOB
+        return ZX_ERR_NOT_SUPPORTED;
+    }
+    // TODO: support flags and control messages
+    if (io->flags & FDIO_FLAG_SOCKET_CONNECTED) {
+        // if connected, can't specify address
+        if (msg->msg_name != NULL || msg->msg_namelen != 0) {
+            return ZX_ERR_ALREADY_EXISTS;
+        }
+    } else {
+        return ZX_ERR_BAD_STATE;
+    }
+    ssize_t total = 0;
+    for (int i = 0; i < msg->msg_iovlen; i++) {
+        struct iovec *iov = &msg->msg_iov[i];
+        if (iov->iov_len <= 0) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        ssize_t n = zxsio_write_stream(io, iov->iov_base, iov->iov_len);
+        if (n < 0) {
+            return n;
+        }
+        total += n;
+        if ((size_t)n != iov->iov_len) {
+            break;
+        }
+    }
+    return total;
+}
+
+static zx_status_t zxsio_clone_stream(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
+    // TODO: support unconnected sockets
+    if (!(io->flags & FDIO_FLAG_SOCKET_CONNECTED)) {
+        return ZX_ERR_BAD_STATE;
+    }
+    zxrio_t* rio = (void*)io;
+    zxrio_object_t info;
+    zx_status_t r = zxrio_getobject(rio->h, ZXRIO_CLONE, "", 0, 0, &info);
+    if (r < 0) {
+        return r;
+    }
+    for (unsigned i = 0; i < info.hcount; i++) {
+        types[i] = PA_FDIO_SOCKET;
+    }
+    memcpy(handles, info.handle, info.hcount * sizeof(zx_handle_t));
+    return info.hcount;
+}
+
+static zx_status_t zxsio_unwrap_stream(fdio_t* io, zx_handle_t* handles, uint32_t* types) {
+    // TODO: support unconnected sockets
+    if (!(io->flags & FDIO_FLAG_SOCKET_CONNECTED)) {
+        return ZX_ERR_BAD_STATE;
+    }
+    zxrio_t* rio = (void*)io;
+    zx_status_t r;
+    handles[0] = rio->h;
+    types[0] = PA_FDIO_SOCKET;
+    if (rio->h2 != 0) {
+        handles[1] = rio->h2;
+        types[1] = PA_FDIO_SOCKET;
+        r = 2;
+    } else {
+        r = 1;
+    }
+    free(io);
+    return r;
+}
+
+static void zxsio_wait_begin_stream(fdio_t* io, uint32_t events, zx_handle_t* handle, zx_signals_t* _signals) {
+    zxrio_t* rio = (void*)io;
+    *handle = rio->h2;
+    // TODO: locking for flags/state
+    if (io->flags & FDIO_FLAG_SOCKET_CONNECTING) {
+        // check the connection state
+        zx_signals_t observed;
+        zx_status_t r;
+        r = zx_object_wait_one(rio->h2, ZXSIO_SIGNAL_CONNECTED, 0u,
+                               &observed);
+        if (r == ZX_OK || r == ZX_ERR_TIMED_OUT) {
+            if (observed & ZXSIO_SIGNAL_CONNECTED) {
+                io->flags &= ~FDIO_FLAG_SOCKET_CONNECTING;
+                io->flags |= FDIO_FLAG_SOCKET_CONNECTED;
+            }
+        }
+    }
+    zx_signals_t signals = ZXSIO_SIGNAL_ERROR;
+    if (io->flags & FDIO_FLAG_SOCKET_CONNECTED) {
+        // if socket is connected
+        if (events & POLLIN) {
+            signals |= ZX_SOCKET_READABLE | ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED;
+        }
+        if (events & POLLOUT) {
+            signals |= ZX_SOCKET_WRITABLE | ZX_SOCKET_WRITE_DISABLED;
+        }
+    } else {
+        // if socket is not connected
+        if (events & POLLIN) {
+            // signal when a listening socket gets an incoming connection
+            // or a connecting socket gets connected and receives data
+            signals |= ZXSIO_SIGNAL_INCOMING |
+                ZX_SOCKET_READABLE | ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED;
+        }
+        if (events & POLLOUT) {
+            // signal when connect() operation is finished
+            signals |= ZXSIO_SIGNAL_OUTGOING;
+        }
+    }
+    if (events & POLLRDHUP) {
+        signals |= ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED;
+    }
+    *_signals = signals;
+}
+
+static void zxsio_wait_end_stream(fdio_t* io, zx_signals_t signals, uint32_t* _events) {
+    // check the connection state
+    if (io->flags & FDIO_FLAG_SOCKET_CONNECTING) {
+        if (signals & ZXSIO_SIGNAL_CONNECTED) {
+            io->flags &= ~FDIO_FLAG_SOCKET_CONNECTING;
+            io->flags |= FDIO_FLAG_SOCKET_CONNECTED;
+        }
+    }
+    uint32_t events = 0;
+    if (io->flags & FDIO_FLAG_SOCKET_CONNECTED) {
+        if (signals & (ZX_SOCKET_READABLE | ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED)) {
+            events |= POLLIN;
+        }
+        if (signals & (ZX_SOCKET_WRITABLE | ZX_SOCKET_WRITE_DISABLED)) {
+            events |= POLLOUT;
+        }
+    } else {
+        if (signals & (ZXSIO_SIGNAL_INCOMING | ZX_SOCKET_PEER_CLOSED)) {
+            events |= POLLIN;
+        }
+        if (signals & ZXSIO_SIGNAL_OUTGOING) {
+            events |= POLLOUT;
+        }
+    }
+    if (signals & ZXSIO_SIGNAL_ERROR) {
+        events |= POLLERR;
+    }
+    if (signals & (ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED)) {
+        events |= POLLRDHUP;
+    }
+    *_events = events;
+}
+
+static ssize_t zxsio_posix_ioctl_stream(fdio_t* io, int req, va_list va) {
+    zxrio_t* rio = (zxrio_t*)io;
+    switch (req) {
+    case FIONREAD: {
+        zx_status_t r;
+        size_t avail;
+        if ((r = zx_socket_read(rio->h2, 0, NULL, 0, &avail)) < 0) {
+            return r;
+        }
+        if (avail > INT_MAX) {
+            avail = INT_MAX;
+        }
+        int* actual = va_arg(va, int*);
+        *actual = avail;
+        return ZX_OK;
+    }
+    default:
+        return ZX_ERR_NOT_SUPPORTED;
+    }
+}
+
+static ssize_t zxsio_rx_dgram(fdio_t* io, void* buf, size_t buflen) {
+    return zxsio_read_stream(io, buf, buflen);
+}
+
+static ssize_t zxsio_tx_dgram(fdio_t* io, const void* buf, size_t buflen) {
+    zx_status_t r = zxsio_write_stream(io, buf, buflen);
+    return (r < 0) ? r : ZX_OK;
+}
+
+static ssize_t zxsio_recvmsg_dgram(fdio_t* io, struct msghdr* msg, int flags);
+static ssize_t zxsio_sendmsg_dgram(fdio_t* io, const struct msghdr* msg, int flags);
+
+static ssize_t zxsio_read_dgram(fdio_t* io, void* data, size_t len) {
+    struct iovec iov;
+    iov.iov_base = data;
+    iov.iov_len = len;
+
+    struct msghdr msg;
+    msg.msg_name = NULL;
+    msg.msg_namelen = 0;
+    msg.msg_iov = &iov;
+    msg.msg_iovlen = 1;
+    msg.msg_control = NULL;
+    msg.msg_controllen = 0;
+    msg.msg_flags = 0;
+
+    return zxsio_recvmsg_dgram(io, &msg, 0);
+}
+
+static ssize_t zxsio_write_dgram(fdio_t* io, const void* data, size_t len) {
+    struct iovec iov;
+    iov.iov_base = (void*)data;
+    iov.iov_len = len;
+
+    struct msghdr msg;
+    msg.msg_name = NULL;
+    msg.msg_namelen = 0;
+    msg.msg_iov = &iov;
+    msg.msg_iovlen = 1;
+    msg.msg_control = NULL;
+    msg.msg_controllen = 0;
+    msg.msg_flags = 0;
+
+    return zxsio_sendmsg_dgram(io, &msg, 0);
+}
+
+static ssize_t zxsio_recvmsg_dgram(fdio_t* io, struct msghdr* msg, int flags) {
+    if (flags != 0) {
+        // TODO: support MSG_OOB
+        return ZX_ERR_NOT_SUPPORTED;
+    }
+    // Read 1 extra byte to detect if the buffer is too small to fit the whole
+    // packet, so we can set MSG_TRUNC flag if necessary.
+    size_t mlen = FDIO_SOCKET_MSG_HEADER_SIZE + 1;
+    for (int i = 0; i < msg->msg_iovlen; i++) {
+        struct iovec *iov = &msg->msg_iov[i];
+        if (iov->iov_len <= 0) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        mlen += iov->iov_len;
+    }
+
+    // TODO: avoid malloc
+    fdio_socket_msg_t* m = malloc(mlen);
+    ssize_t n = zxsio_rx_dgram(io, m, mlen);
+    if (n < 0) {
+        free(m);
+        return n;
+    }
+    if ((size_t)n < FDIO_SOCKET_MSG_HEADER_SIZE) {
+        free(m);
+        return ZX_ERR_INTERNAL;
+    }
+    n -= FDIO_SOCKET_MSG_HEADER_SIZE;
+    if (msg->msg_name != NULL) {
+        int bytes_to_copy = (msg->msg_namelen < m->addrlen) ? msg->msg_namelen : m->addrlen;
+        memcpy(msg->msg_name, &m->addr, bytes_to_copy);
+    }
+    msg->msg_namelen = m->addrlen;
+    msg->msg_flags = m->flags;
+    char* data = m->data;
+    size_t resid = n;
+    for (int i = 0; i < msg->msg_iovlen; i++) {
+        struct iovec *iov = &msg->msg_iov[i];
+        if (resid == 0) {
+            iov->iov_len = 0;
+        } else {
+            if (resid < iov->iov_len)
+                iov->iov_len = resid;
+            memcpy(iov->iov_base, data, iov->iov_len);
+            data += iov->iov_len;
+            resid -= iov->iov_len;
+        }
+    }
+
+    if (resid > 0) {
+        msg->msg_flags |= MSG_TRUNC;
+        n -= resid;
+    }
+
+    free(m);
+    return n;
+}
+
+static ssize_t zxsio_sendmsg_dgram(fdio_t* io, const struct msghdr* msg, int flags) {
+    if (flags != 0) {
+        // TODO: MSG_OOB
+        return ZX_ERR_NOT_SUPPORTED;
+    }
+    // TODO: support flags and control messages
+    if (io->flags & FDIO_FLAG_SOCKET_CONNECTED) {
+        // if connected, can't specify address
+        if (msg->msg_name != NULL || msg->msg_namelen != 0) {
+            return ZX_ERR_ALREADY_EXISTS;
+        }
+    }
+    ssize_t n = 0;
+    for (int i = 0; i < msg->msg_iovlen; i++) {
+        struct iovec *iov = &msg->msg_iov[i];
+        if (iov->iov_len <= 0) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        n += iov->iov_len;
+    }
+    size_t mlen = n + FDIO_SOCKET_MSG_HEADER_SIZE;
+
+    // TODO: avoid malloc m
+    fdio_socket_msg_t* m = malloc(mlen);
+    if (msg->msg_name != NULL) {
+        memcpy(&m->addr, msg->msg_name, msg->msg_namelen);
+    }
+    m->addrlen = msg->msg_namelen;
+    m->flags = flags;
+    char* data = m->data;
+    for (int i = 0; i < msg->msg_iovlen; i++) {
+        struct iovec *iov = &msg->msg_iov[i];
+        memcpy(data, iov->iov_base, iov->iov_len);
+        data += iov->iov_len;
+    }
+    ssize_t r = zxsio_tx_dgram(io, m, mlen);
+    free(m);
+    return r == ZX_OK ? n : r;
+}
+
+static void zxsio_wait_begin_dgram(fdio_t* io, uint32_t events, zx_handle_t* handle, zx_signals_t* _signals) {
+    zxrio_t* rio = (void*)io;
+    *handle = rio->h2;
+    zx_signals_t signals = ZXSIO_SIGNAL_ERROR;
+    if (events & POLLIN) {
+        signals |= ZX_SOCKET_READABLE | ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED;
+    }
+    if (events & POLLOUT) {
+        signals |= ZX_SOCKET_WRITABLE | ZX_SOCKET_WRITE_DISABLED;
+    }
+    if (events & POLLRDHUP) {
+        signals |=  ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED;
+    }
+    *_signals = signals;
+}
+
+static void zxsio_wait_end_dgram(fdio_t* io, zx_signals_t signals, uint32_t* _events) {
+    uint32_t events = 0;
+    if (signals & (ZX_SOCKET_READABLE | ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED)) {
+        events |= POLLIN;
+    }
+    if (signals & (ZX_SOCKET_WRITABLE | ZX_SOCKET_WRITE_DISABLED)) {
+        events |= POLLOUT;
+    }
+    if (signals & ZXSIO_SIGNAL_ERROR) {
+        events |= POLLERR;
+    }
+    if (signals & (ZX_SOCKET_READ_DISABLED | ZX_SOCKET_PEER_CLOSED)) {
+        events |= POLLRDHUP;
+    }
+    *_events = events;
+}
+
+static fdio_ops_t fdio_socket_stream_ops = {
+    .read = zxsio_read_stream,
+    .read_at = fdio_default_read_at,
+    .write = zxsio_write_stream,
+    .write_at = fdio_default_write_at,
+    .recvfrom = zxsio_recvfrom,
+    .sendto = zxsio_sendto,
+    .recvmsg = zxsio_recvmsg_stream,
+    .sendmsg = zxsio_sendmsg_stream,
+    .seek = fdio_default_seek,
+    .misc = zxrio_misc,
+    .close = zxrio_close,
+    .open = zxrio_open,
+    .clone = zxsio_clone_stream,
+    .ioctl = zxrio_ioctl,
+    .wait_begin = zxsio_wait_begin_stream,
+    .wait_end = zxsio_wait_end_stream,
+    .unwrap = zxsio_unwrap_stream,
+    .shutdown = fdio_socket_shutdown,
+    .posix_ioctl = zxsio_posix_ioctl_stream,
+    .get_vmo = fdio_default_get_vmo,
+};
+
+static fdio_ops_t fdio_socket_dgram_ops = {
+    .read = zxsio_read_dgram,
+    .read_at = fdio_default_read_at,
+    .write = zxsio_write_dgram,
+    .write_at = fdio_default_write_at,
+    .recvfrom = zxsio_recvfrom,
+    .sendto = zxsio_sendto,
+    .recvmsg = zxsio_recvmsg_dgram,
+    .sendmsg = zxsio_sendmsg_dgram,
+    .seek = fdio_default_seek,
+    .misc = zxrio_misc,
+    .close = zxrio_close,
+    .open = zxrio_open,
+    .clone = fdio_default_clone,
+    .ioctl = zxrio_ioctl,
+    .wait_begin = zxsio_wait_begin_dgram,
+    .wait_end = zxsio_wait_end_dgram,
+    .unwrap = fdio_default_unwrap,
+    .shutdown = fdio_socket_shutdown,
+    .posix_ioctl = fdio_default_posix_ioctl, // not supported
+    .get_vmo = fdio_default_get_vmo,
+};
+
+fdio_t* fdio_socket_create(zx_handle_t h, zx_handle_t s, int flags) {
+    zxrio_t* rio = calloc(1, sizeof(*rio));
+    if (rio == NULL) {
+        zx_handle_close(h);
+        zx_handle_close(s);
+        return NULL;
+    }
+    rio->io.ops = &fdio_socket_stream_ops; // default is stream
+    rio->io.magic = FDIO_MAGIC;
+    rio->io.refcount = 1;
+    rio->io.flags = FDIO_FLAG_SOCKET | flags;
+    rio->h = h;
+    rio->h2 = s;
+    return &rio->io;
+}
+
+void fdio_socket_set_stream_ops(fdio_t* io) {
+    zxrio_t* rio = (zxrio_t*)io;
+    rio->io.ops = &fdio_socket_stream_ops;
+}
+
+void fdio_socket_set_dgram_ops(fdio_t* io) {
+    zxrio_t* rio = (zxrio_t*)io;
+    rio->io.ops = &fdio_socket_dgram_ops;
+}
+
+zx_status_t fdio_socket_shutdown(fdio_t* io, int how) {
+    if (!(io->flags & FDIO_FLAG_SOCKET_CONNECTED)) {
+        return ZX_ERR_BAD_STATE;
+    }
+    zxrio_t* rio = (zxrio_t*)io;
+    if (how == SHUT_WR || how == SHUT_RDWR) {
+        // netstack expects this user signal to be set - raise it to keep that code working until
+        // it learns about the read/write disabled signals.
+        zx_object_signal_peer(rio->h2, 0u, ZXSIO_SIGNAL_HALFCLOSED);
+    }
+    uint32_t options = 0;
+    switch (how) {
+    case SHUT_RD:
+        options = ZX_SOCKET_SHUTDOWN_READ;
+        break;
+    case SHUT_WR:
+        options = ZX_SOCKET_SHUTDOWN_WRITE;
+        break;
+    case SHUT_RDWR:
+        options = ZX_SOCKET_SHUTDOWN_READ | ZX_SOCKET_SHUTDOWN_WRITE;
+        break;
+    }
+    return zx_socket_write(rio->h2, options, NULL, 0, NULL);
+}
diff --git a/system/ulib/mxio/rules.mk b/system/ulib/fdio/rules.mk
similarity index 92%
rename from system/ulib/mxio/rules.mk
rename to system/ulib/fdio/rules.mk
index 3618c16..1fd84bb 100644
--- a/system/ulib/mxio/rules.mk
+++ b/system/ulib/fdio/rules.mk
@@ -31,7 +31,7 @@
 
 MODULE_EXPORT := so
 
-MODULE_SO_NAME := mxio
-MODULE_LIBS := system/ulib/magenta system/ulib/c
+MODULE_SO_NAME := fdio
+MODULE_LIBS := system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/fdio/service.c b/system/ulib/fdio/service.c
new file mode 100644
index 0000000..93ab649
--- /dev/null
+++ b/system/ulib/fdio/service.c
@@ -0,0 +1,93 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <errno.h>
+#include <stdatomic.h>
+#include <stdlib.h>
+
+#include <zircon/errors.h>
+#include <zircon/syscalls.h>
+
+#include "private.h"
+#include "unistd.h"
+
+typedef struct {
+    fdio_t io;
+    zx_handle_t h;
+} mxsvc_t;
+
+static zx_status_t mxsvc_close(fdio_t* io) {
+    mxsvc_t* svc = (mxsvc_t*) io;
+    zx_handle_close(svc->h);
+    svc->h = ZX_HANDLE_INVALID;
+    return ZX_OK;
+}
+
+static fdio_ops_t zx_svc_ops = {
+    .read = fdio_default_read,
+    .read_at = fdio_default_read_at,
+    .write = fdio_default_write,
+    .write_at = fdio_default_write_at,
+    .recvfrom = fdio_default_recvfrom,
+    .sendto = fdio_default_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
+    .seek = fdio_default_seek,
+    .misc = fdio_default_misc,
+    .close = mxsvc_close,
+    .open = fdio_default_open,
+    .clone = fdio_default_clone,
+    .ioctl = fdio_default_ioctl,
+    .wait_begin = fdio_default_wait_begin,
+    .wait_end = fdio_default_wait_end,
+    .unwrap = fdio_default_unwrap,
+    .shutdown = fdio_default_shutdown,
+    .posix_ioctl = fdio_default_posix_ioctl,
+    .get_vmo = fdio_default_get_vmo,
+};
+
+fdio_t* fdio_service_create(zx_handle_t h) {
+    mxsvc_t* svc = calloc(1, sizeof(*svc));
+    if (svc == NULL) {
+        zx_handle_close(h);
+        return NULL;
+    }
+    svc->io.ops = &zx_svc_ops;
+    svc->io.magic = FDIO_MAGIC;
+    svc->h = h;
+    atomic_init(&svc->io.refcount, 1);
+    return &svc->io;
+}
+
+zx_status_t fdio_get_service_handle(int fd, zx_handle_t* out) {
+    mtx_lock(&fdio_lock);
+    if ((fd < 0) || (fd >= MAX_FDIO_FD) || (fdio_fdtab[fd] == NULL)) {
+        mtx_unlock(&fdio_lock);
+        return ERRNO(EBADF);
+    }
+    fdio_t* io = fdio_fdtab[fd];
+    io->dupcount--;
+    fdio_fdtab[fd] = NULL;
+    if (io->dupcount > 0) {
+        // still alive in other fdtab slots
+        // this fd goes away but we can't give away the handle
+        mtx_unlock(&fdio_lock);
+        fdio_release(io);
+        return ZX_ERR_UNAVAILABLE;
+    } else {
+        mtx_unlock(&fdio_lock);
+        int r;
+        if (io->ops == &zx_svc_ops) {
+            // is a service, extract handle
+            mxsvc_t* svc = (mxsvc_t*) io;
+            *out = svc->h;
+            svc->h = ZX_HANDLE_INVALID;
+            r = ZX_OK;
+        } else {
+            r = io->ops->close(io);
+            fdio_release(io);
+        }
+        return STATUS(r);
+    }
+}
diff --git a/system/ulib/fdio/socketpair.c b/system/ulib/fdio/socketpair.c
new file mode 100644
index 0000000..6408544
--- /dev/null
+++ b/system/ulib/fdio/socketpair.c
@@ -0,0 +1,151 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <sys/socket.h>
+
+#include <zircon/syscalls.h>
+
+#include <errno.h>
+#include <fdio/io.h>
+#include <fdio/socket.h>
+#include <fdio/util.h>
+
+#include "pipe.h"
+#include "private.h"
+#include "unistd.h"
+
+static int checksocket(int fd, int sock_err, int err) {
+    fdio_t* io = fd_to_io(fd);
+    if (io == NULL) {
+        errno = EBADF;
+        return -1;
+    }
+    int32_t is_socket = io->flags & FDIO_FLAG_SOCKET;
+    fdio_release(io);
+    if (!is_socket) {
+        errno = sock_err;
+        return -1;
+    }
+    if (err) {
+        errno = err;
+        return -1;
+    }
+    return 0;
+}
+
+static ssize_t zx_socketpair_recvfrom(fdio_t* io, void* data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen) {
+    if (flags != 0 && flags != MSG_DONTWAIT) {
+        return ZX_ERR_INVALID_ARGS;
+    }
+    zx_pipe_t* p = (zx_pipe_t*)io;
+    int nonblock = (io->flags & FDIO_FLAG_NONBLOCK) || flags & MSG_DONTWAIT;
+    return zx_pipe_read_internal(p->h, data, len, nonblock);
+}
+
+static ssize_t zx_socketpair_sendto(fdio_t* io, const void* data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen) {
+    if (flags != 0 && flags != MSG_DONTWAIT) {
+        return ZX_ERR_INVALID_ARGS;
+    }
+    if (addr != NULL) {
+        return ZX_ERR_INVALID_ARGS;  // should set errno to EISCONN
+    }
+    zx_pipe_t* p = (zx_pipe_t*)io;
+    int nonblock = (io->flags & FDIO_FLAG_NONBLOCK) || flags & MSG_DONTWAIT;
+    return zx_pipe_write_internal(p->h, data, len, nonblock);
+}
+
+
+static fdio_ops_t zx_socketpair_ops = {
+    .read = zx_pipe_read,
+    .read_at = fdio_default_read_at,
+    .write = zx_pipe_write,
+    .write_at = fdio_default_write_at,
+    .recvfrom = zx_socketpair_recvfrom,
+    .sendto = zx_socketpair_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
+    .seek = fdio_default_seek,
+    .misc = zx_pipe_misc,
+    .close = zx_pipe_close,
+    .open = fdio_default_open,
+    .clone = zx_pipe_clone,
+    .ioctl = fdio_default_ioctl,
+    .wait_begin = zx_pipe_wait_begin,
+    .wait_end = zx_pipe_wait_end,
+    .unwrap = zx_pipe_unwrap,
+    .shutdown = fdio_socketpair_shutdown,
+    .posix_ioctl = zx_pipe_posix_ioctl,
+    .get_vmo = fdio_default_get_vmo,
+};
+
+
+int socketpair(int domain, int type, int protocol, int fd[2]) {
+    if (type != SOCK_STREAM) {  // TODO(jamesr): SOCK_DGRAM
+        errno = EPROTOTYPE;
+        return -1;
+    }
+    if (domain != AF_UNIX) {
+        errno = EAFNOSUPPORT;
+        return -1;
+    }
+    if (protocol != 0) {
+        errno = EPROTONOSUPPORT;
+        return -1;
+    }
+
+    fdio_t* io[2];
+    zx_status_t r = fdio_pipe_pair(&io[0], &io[1]);
+    if (r != ZX_OK) {
+        errno = ERRNO(r);
+        return -1;
+    }
+    io[0]->ops = &zx_socketpair_ops;
+    io[1]->ops = &zx_socketpair_ops;
+
+    if ((fd[0] = fdio_bind_to_fd(io[0], -1, 0)) < 0) {
+        io[0]->ops->close(io[0]);
+        fdio_release(io[0]);
+        errno = ERRNO(EMFILE);
+        return -1;
+    }
+    if ((fd[1] = fdio_bind_to_fd(io[1], -1, 0)) < 0) {
+        io[1]->ops->close(io[1]);
+        fdio_release(io[1]);
+        close(fd[0]);
+        errno = ERRNO(EMFILE);
+        return -1;
+    }
+    return 0;
+}
+
+int sendmmsg(int fd, struct mmsghdr* msgvec, unsigned int vlen, unsigned int flags) {
+    return checksocket(fd, ENOTSOCK, ENOSYS);
+}
+
+int recvmmsg(int fd, struct mmsghdr* msgvec, unsigned int vlen, unsigned int flags, struct timespec* timeout) {
+    return checksocket(fd, ENOTSOCK, ENOSYS);
+}
+
+int sockatmark(int fd) {
+    // ENOTTY is sic.
+    return checksocket(fd, ENOTTY, ENOSYS);
+}
+
+zx_status_t fdio_socketpair_shutdown(fdio_t* io, int how) {
+    zx_pipe_t* p = (zx_pipe_t*)io;
+
+    uint32_t options = 0;
+    switch (how) {
+    case SHUT_RD:
+        options = ZX_SOCKET_SHUTDOWN_READ;
+        break;
+    case SHUT_WR:
+        options = ZX_SOCKET_SHUTDOWN_WRITE;
+        break;
+    case SHUT_RDWR:
+        options = ZX_SOCKET_SHUTDOWN_READ | ZX_SOCKET_SHUTDOWN_WRITE;
+        break;
+    }
+    return zx_socket_write(p->h, options, NULL, 0, NULL);
+}
diff --git a/system/ulib/mxio/stubs.c b/system/ulib/fdio/stubs.c
similarity index 98%
rename from system/ulib/mxio/stubs.c
rename to system/ulib/fdio/stubs.c
index 6394ce4..0e0de23 100644
--- a/system/ulib/mxio/stubs.c
+++ b/system/ulib/fdio/stubs.c
@@ -40,12 +40,12 @@
 }
 
 static int checkfd(int fd, int err) {
-    mxio_t* io;
+    fdio_t* io;
     if ((io = fd_to_io(fd)) == NULL) {
         errno = EBADF;
         return -1;
     }
-    mxio_release(io);
+    fdio_release(io);
     if (err) {
         errno = err;
         return -1;
diff --git a/system/ulib/mxio/uname.c b/system/ulib/fdio/uname.c
similarity index 90%
rename from system/ulib/mxio/uname.c
rename to system/ulib/fdio/uname.c
index e62ced7..65d31e8 100644
--- a/system/ulib/mxio/uname.c
+++ b/system/ulib/fdio/uname.c
@@ -8,9 +8,9 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/device/ioctl.h>
-#include <magenta/device/ioctl-wrapper.h>
-#include <magenta/types.h>
+#include <zircon/device/ioctl.h>
+#include <zircon/device/ioctl-wrapper.h>
+#include <zircon/types.h>
 
 // IOCTL implemented by Fuchsia's netstack.
 #define IOCTL_NETC_GET_NODENAME \
diff --git a/system/ulib/mxio/unistd.c b/system/ulib/fdio/unistd.c
similarity index 66%
rename from system/ulib/mxio/unistd.c
rename to system/ulib/fdio/unistd.c
index f0cc685..1cb6b77 100644
--- a/system/ulib/mxio/unistd.c
+++ b/system/ulib/fdio/unistd.c
@@ -21,74 +21,74 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/device/vfs.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/device/vfs.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 
-#include <mxio/debug.h>
-#include <mxio/io.h>
-#include <mxio/namespace.h>
-#include <mxio/private.h>
-#include <mxio/remoteio.h>
-#include <mxio/util.h>
-#include <mxio/vfs.h>
-#include <mxio/socket.h>
+#include <fdio/debug.h>
+#include <fdio/io.h>
+#include <fdio/namespace.h>
+#include <fdio/private.h>
+#include <fdio/remoteio.h>
+#include <fdio/util.h>
+#include <fdio/vfs.h>
+#include <fdio/socket.h>
 
 #include "private.h"
 #include "unistd.h"
 
-static_assert(MXIO_FLAG_CLOEXEC == FD_CLOEXEC, "Unexpected mxio flags value");
+static_assert(FDIO_FLAG_CLOEXEC == FD_CLOEXEC, "Unexpected fdio flags value");
 
 // non-thread-safe emulation of unistd io functions
-// using the mxio transports
+// using the fdio transports
 
-mxio_state_t __mxio_global_state = {
+fdio_state_t __fdio_global_state = {
     .lock = MTX_INIT,
     .cwd_lock = MTX_INIT,
     .init = true,
     .cwd_path = "/",
 };
 
-void mxio_install_root(mxio_t* root) {
-    mtx_lock(&mxio_lock);
-    if (mxio_root_init) {
-        mxio_root_handle = root;
-        mxio_root_init = false;
+void fdio_install_root(fdio_t* root) {
+    mtx_lock(&fdio_lock);
+    if (fdio_root_init) {
+        fdio_root_handle = root;
+        fdio_root_init = false;
     }
-    mtx_unlock(&mxio_lock);
+    mtx_unlock(&fdio_lock);
 }
 
-// Attaches an mxio to an fdtab slot.
-// The mxio must have been upref'd on behalf of the
+// Attaches an fdio to an fdtab slot.
+// The fdio must have been upref'd on behalf of the
 // fdtab prior to binding.
-int mxio_bind_to_fd(mxio_t* io, int fd, int starting_fd) {
-    mxio_t* io_to_close = NULL;
+int fdio_bind_to_fd(fdio_t* io, int fd, int starting_fd) {
+    fdio_t* io_to_close = NULL;
 
-    mtx_lock(&mxio_lock);
+    mtx_lock(&fdio_lock);
     if (fd < 0) {
         // A negative fd implies that any free fd value can be used
         //TODO: bitmap, ffs, etc
-        for (fd = starting_fd; fd < MAX_MXIO_FD; fd++) {
-            if (mxio_fdtab[fd] == NULL) {
+        for (fd = starting_fd; fd < MAX_FDIO_FD; fd++) {
+            if (fdio_fdtab[fd] == NULL) {
                 goto free_fd_found;
             }
         }
         errno = EMFILE;
-        mtx_unlock(&mxio_lock);
+        mtx_unlock(&fdio_lock);
         return -1;
-    } else if (fd >= MAX_MXIO_FD) {
+    } else if (fd >= MAX_FDIO_FD) {
         errno = EINVAL;
-        mtx_unlock(&mxio_lock);
+        mtx_unlock(&fdio_lock);
         return -1;
     } else {
-        io_to_close = mxio_fdtab[fd];
+        io_to_close = fdio_fdtab[fd];
         if (io_to_close) {
             io_to_close->dupcount--;
             if (io_to_close->dupcount > 0) {
                 // still alive in another fdtab slot
-                mxio_release(io_to_close);
+                fdio_release(io_to_close);
                 io_to_close = NULL;
             }
         }
@@ -96,93 +96,93 @@
 
 free_fd_found:
     io->dupcount++;
-    mxio_fdtab[fd] = io;
-    mtx_unlock(&mxio_lock);
+    fdio_fdtab[fd] = io;
+    mtx_unlock(&fdio_lock);
 
     if (io_to_close) {
         io_to_close->ops->close(io_to_close);
-        mxio_release(io_to_close);
+        fdio_release(io_to_close);
     }
     return fd;
 }
 
-// If a mxio_t exists for this fd and it has not been dup'd
+// If a fdio_t exists for this fd and it has not been dup'd
 // and is not in active use (an io operation underway, etc),
 // detach it from the fdtab and return it with a single
 // refcount.
-mx_status_t mxio_unbind_from_fd(int fd, mxio_t** out) {
-    mx_status_t status;
-    mtx_lock(&mxio_lock);
-    if (fd >= MAX_MXIO_FD) {
-        status = MX_ERR_INVALID_ARGS;
+zx_status_t fdio_unbind_from_fd(int fd, fdio_t** out) {
+    zx_status_t status;
+    mtx_lock(&fdio_lock);
+    if (fd >= MAX_FDIO_FD) {
+        status = ZX_ERR_INVALID_ARGS;
         goto done;
     }
-    mxio_t* io = mxio_fdtab[fd];
+    fdio_t* io = fdio_fdtab[fd];
     if (io == NULL) {
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
         goto done;
     }
     if (io->dupcount > 1) {
-        status = MX_ERR_UNAVAILABLE;
+        status = ZX_ERR_UNAVAILABLE;
         goto done;
     }
     if (atomic_load(&io->refcount) > 1) {
-        status = MX_ERR_UNAVAILABLE;
+        status = ZX_ERR_UNAVAILABLE;
         goto done;
     }
     io->dupcount = 0;
-    mxio_fdtab[fd] = NULL;
+    fdio_fdtab[fd] = NULL;
     *out = io;
-    status = MX_OK;
+    status = ZX_OK;
 done:
-    mtx_unlock(&mxio_lock);
+    mtx_unlock(&fdio_lock);
     return status;
 }
 
-mxio_t* __mxio_fd_to_io(int fd) {
-    if ((fd < 0) || (fd >= MAX_MXIO_FD)) {
+fdio_t* __fdio_fd_to_io(int fd) {
+    if ((fd < 0) || (fd >= MAX_FDIO_FD)) {
         return NULL;
     }
-    mxio_t* io = NULL;
-    mtx_lock(&mxio_lock);
-    if ((io = mxio_fdtab[fd]) != NULL) {
-        mxio_acquire(io);
+    fdio_t* io = NULL;
+    mtx_lock(&fdio_lock);
+    if ((io = fdio_fdtab[fd]) != NULL) {
+        fdio_acquire(io);
     }
-    mtx_unlock(&mxio_lock);
+    mtx_unlock(&fdio_lock);
     return io;
 }
 
-static void mxio_exit(void) {
-    mtx_lock(&mxio_lock);
-    for (int fd = 0; fd < MAX_MXIO_FD; fd++) {
-        mxio_t* io = mxio_fdtab[fd];
+static void fdio_exit(void) {
+    mtx_lock(&fdio_lock);
+    for (int fd = 0; fd < MAX_FDIO_FD; fd++) {
+        fdio_t* io = fdio_fdtab[fd];
         if (io) {
-            mxio_fdtab[fd] = NULL;
+            fdio_fdtab[fd] = NULL;
             io->dupcount--;
             if (io->dupcount == 0) {
                 io->ops->close(io);
-                mxio_release(io);
+                fdio_release(io);
             }
         }
     }
-    mtx_unlock(&mxio_lock);
+    mtx_unlock(&fdio_lock);
 }
 
-mx_status_t mxio_close(mxio_t* io) {
+zx_status_t fdio_close(fdio_t* io) {
     if (io->dupcount > 0) {
-        printf("mxio_close(%p): dupcount nonzero!\n", io);
+        printf("fdio_close(%p): dupcount nonzero!\n", io);
     }
     return io->ops->close(io);
 }
 
-// Possibly return an owned mxio_t corresponding to either the root,
+// Possibly return an owned fdio_t corresponding to either the root,
 // the cwd, or, for the ...at variants, dirfd. In the absolute path
 // case, *path is also adjusted.
-static mxio_t* mxio_iodir(const char** path, int dirfd) {
-    mxio_t* iodir = NULL;
-    mtx_lock(&mxio_lock);
+static fdio_t* fdio_iodir(const char** path, int dirfd) {
+    fdio_t* iodir = NULL;
+    mtx_lock(&fdio_lock);
     if (*path[0] == '/') {
-        iodir = mxio_root_handle;
+        iodir = fdio_root_handle;
         // Since we are sending a request to the root handle, the
         // rest of the path should be canonicalized as a relative
         // path (relative to this root handle).
@@ -193,14 +193,14 @@
             }
         }
     } else if (dirfd == AT_FDCWD) {
-        iodir = mxio_cwd_handle;
-    } else if ((dirfd >= 0) && (dirfd < MAX_MXIO_FD)) {
-        iodir = mxio_fdtab[dirfd];
+        iodir = fdio_cwd_handle;
+    } else if ((dirfd >= 0) && (dirfd < MAX_FDIO_FD)) {
+        iodir = fdio_fdtab[dirfd];
     }
     if (iodir != NULL) {
-        mxio_acquire(iodir);
+        fdio_acquire(iodir);
     }
-    mtx_unlock(&mxio_lock);
+    mtx_unlock(&fdio_lock);
     return iodir;
 }
 
@@ -211,7 +211,7 @@
 // PATH_MAX bytes.
 #define CHECK_CAN_INCREMENT(i)           \
     if (unlikely((i) + 1 >= PATH_MAX)) { \
-        return MX_ERR_BAD_PATH;          \
+        return ZX_ERR_BAD_PATH;          \
     }
 
 // Cleans an input path, transforming it to out, according to the
@@ -223,12 +223,12 @@
 //
 // out is expected to be PATH_MAX bytes long.
 // Sets is_dir to 'true' if the path is a directory, and 'false' otherwise.
-mx_status_t __mxio_cleanpath(const char* in, char* out, size_t* outlen, bool* is_dir) {
+zx_status_t __fdio_cleanpath(const char* in, char* out, size_t* outlen, bool* is_dir) {
     if (in[0] == 0) {
         strcpy(out, ".");
         *outlen = 1;
         *is_dir = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     bool rooted = (in[0] == '/');
@@ -292,51 +292,51 @@
         strcpy(out, ".");
         *outlen = 1;
         *is_dir = true;
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Append null character
     *outlen = out_index;
     out[out_index++] = 0;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t __mxio_open_at(mxio_t** io, int dirfd, const char* path, int flags, uint32_t mode) {
+zx_status_t __fdio_open_at(fdio_t** io, int dirfd, const char* path, int flags, uint32_t mode) {
     if (path == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (path[0] == 0) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
-    mxio_t* iodir = mxio_iodir(&path, dirfd);
+    fdio_t* iodir = fdio_iodir(&path, dirfd);
     if (iodir == NULL) {
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
     }
 
     char clean[PATH_MAX];
     size_t outlen;
     bool is_dir;
-    mx_status_t status = __mxio_cleanpath(path, clean, &outlen, &is_dir);
-    if (status != MX_OK) {
+    zx_status_t status = __fdio_cleanpath(path, clean, &outlen, &is_dir);
+    if (status != ZX_OK) {
         return status;
     }
     flags |= (is_dir ? O_DIRECTORY : 0);
 
     status = iodir->ops->open(iodir, clean, flags, mode, io);
-    mxio_release(iodir);
+    fdio_release(iodir);
     return status;
 }
 
-mx_status_t __mxio_open(mxio_t** io, const char* path, int flags, uint32_t mode) {
-    return __mxio_open_at(io, AT_FDCWD, path, flags, mode);
+zx_status_t __fdio_open(fdio_t** io, const char* path, int flags, uint32_t mode) {
+    return __fdio_open_at(io, AT_FDCWD, path, flags, mode);
 }
 
 static void update_cwd_path(const char* path) {
     if (path[0] == '/') {
         // it's "absolute", but we'll still parse it as relative (from /)
         // so that we normalize the path (resolving, ., .., //, etc)
-        mxio_cwd_path[0] = '/';
-        mxio_cwd_path[1] = 0;
+        fdio_cwd_path[0] = '/';
+        fdio_cwd_path[1] = 0;
         path++;
     }
 
@@ -361,37 +361,37 @@
         }
         if ((seglen == 2) && (path[0] == '.') && (path[1] == '.')) {
             // parent directory, remove the trailing path segment from cwd_path
-            char* x = strrchr(mxio_cwd_path, '/');
+            char* x = strrchr(fdio_cwd_path, '/');
             if (x == NULL) {
                 // shouldn't ever happen
                 goto wat;
             }
             // remove the current trailing path segment from cwd
-            if (x == mxio_cwd_path) {
+            if (x == fdio_cwd_path) {
                 // but never remove the first /
-                mxio_cwd_path[1] = 0;
+                fdio_cwd_path[1] = 0;
             } else {
                 x[0] = 0;
             }
             continue;
         }
         // regular path segment, append to cwd_path
-        size_t len = strlen(mxio_cwd_path);
+        size_t len = strlen(fdio_cwd_path);
         if ((len + seglen + 2) >= PATH_MAX) {
             // doesn't fit, shouldn't happen, but...
             goto wat;
         }
         if (len != 1) {
             // if len is 1, path is "/", so don't append a '/'
-            mxio_cwd_path[len++] = '/';
+            fdio_cwd_path[len++] = '/';
         }
-        memcpy(mxio_cwd_path + len, path, seglen);
-        mxio_cwd_path[len + seglen] = 0;
+        memcpy(fdio_cwd_path + len, path, seglen);
+        fdio_cwd_path[len + seglen] = 0;
     }
     return;
 
 wat:
-    strcpy(mxio_cwd_path, "(unknown)");
+    strcpy(fdio_cwd_path, "(unknown)");
     return;
 }
 
@@ -399,23 +399,23 @@
 //
 // Returns the non-directory portion of the path in 'out', which
 // must be a buffer that can fit [NAME_MAX + 1] characters.
-static mx_status_t __mxio_opendir_containing_at(mxio_t** io, int dirfd, const char* path,
+static zx_status_t __fdio_opendir_containing_at(fdio_t** io, int dirfd, const char* path,
                                                 char* out) {
     if (path == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mxio_t* iodir = mxio_iodir(&path, dirfd);
+    fdio_t* iodir = fdio_iodir(&path, dirfd);
     if (iodir == NULL) {
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
     }
 
     char clean[PATH_MAX];
     size_t pathlen;
     bool is_dir;
-    mx_status_t status = __mxio_cleanpath(path, clean, &pathlen, &is_dir);
-    if (status != MX_OK) {
-        mxio_release(iodir);
+    zx_status_t status = __fdio_cleanpath(path, clean, &pathlen, &is_dir);
+    if (status != ZX_OK) {
+        fdio_release(iodir);
         return status;
     }
 
@@ -432,8 +432,8 @@
     // clean[i] is now the start of the name
     size_t namelen = pathlen - i;
     if (namelen + (is_dir ? 1 : 0) > NAME_MAX) {
-        mxio_release(iodir);
-        return MX_ERR_BAD_PATH;
+        fdio_release(iodir);
+        return ZX_ERR_BAD_PATH;
     }
 
     // Copy the trailing 'name' to out.
@@ -451,22 +451,22 @@
         clean[1] = 0;
     }
 
-    mx_status_t r = iodir->ops->open(iodir, clean, O_RDONLY | O_DIRECTORY, 0, io);
-    mxio_release(iodir);
+    zx_status_t r = iodir->ops->open(iodir, clean, O_RDONLY | O_DIRECTORY, 0, io);
+    fdio_release(iodir);
     return r;
 }
 
 // 'name' must be a user-provided buffer, at least NAME_MAX + 1 bytes long.
-static mx_status_t __mxio_opendir_containing(mxio_t** io, const char* path, char* name) {
-    return __mxio_opendir_containing_at(io, AT_FDCWD, path, name);
+static zx_status_t __fdio_opendir_containing(fdio_t** io, const char* path, char* name) {
+    return __fdio_opendir_containing_at(io, AT_FDCWD, path, name);
 }
 
 
 // hook into libc process startup
-// this is called prior to main to set up the mxio world
-// and thus does not use the mxio_lock
+// this is called prior to main to set up the fdio world
+// and thus does not use the fdio_lock
 void __libc_extensions_init(uint32_t handle_count,
-                            mx_handle_t handle[],
+                            zx_handle_t handle[],
                             uint32_t handle_info[],
                             uint32_t name_count,
                             char** names) {
@@ -475,51 +475,51 @@
     // extract handles we care about
     for (uint32_t n = 0; n < handle_count; n++) {
         unsigned arg = PA_HND_ARG(handle_info[n]);
-        mx_handle_t h = handle[n];
+        zx_handle_t h = handle[n];
 
-        // MXIO uses this bit as a flag to say
+        // FDIO uses this bit as a flag to say
         // that an fd should be duped into 0/1/2
         // and become all of stdin/out/err
-        if (arg & MXIO_FLAG_USE_FOR_STDIO) {
-            arg &= (~MXIO_FLAG_USE_FOR_STDIO);
-            if (arg < MAX_MXIO_FD) {
+        if (arg & FDIO_FLAG_USE_FOR_STDIO) {
+            arg &= (~FDIO_FLAG_USE_FOR_STDIO);
+            if (arg < MAX_FDIO_FD) {
                 stdio_fd = arg;
             }
         }
 
         switch (PA_HND_TYPE(handle_info[n])) {
-        case PA_MXIO_CWD:
-            mxio_cwd_handle = mxio_remote_create(h, 0);
+        case PA_FDIO_CWD:
+            fdio_cwd_handle = fdio_remote_create(h, 0);
             break;
-        case PA_MXIO_REMOTE:
+        case PA_FDIO_REMOTE:
             // remote objects may have a second handle
             // which is for signaling events
             if (((n + 1) < handle_count) &&
                 (handle_info[n] == handle_info[n + 1])) {
-                mxio_fdtab[arg] = mxio_remote_create(h, handle[n + 1]);
+                fdio_fdtab[arg] = fdio_remote_create(h, handle[n + 1]);
                 handle_info[n + 1] = 0;
             } else {
-                mxio_fdtab[arg] = mxio_remote_create(h, 0);
+                fdio_fdtab[arg] = fdio_remote_create(h, 0);
             }
-            mxio_fdtab[arg]->dupcount++;
+            fdio_fdtab[arg]->dupcount++;
             break;
-        case PA_MXIO_PIPE:
-            mxio_fdtab[arg] = mxio_pipe_create(h);
-            mxio_fdtab[arg]->dupcount++;
+        case PA_FDIO_PIPE:
+            fdio_fdtab[arg] = fdio_pipe_create(h);
+            fdio_fdtab[arg]->dupcount++;
             break;
-        case PA_MXIO_LOGGER:
-            mxio_fdtab[arg] = mxio_logger_create(h);
-            mxio_fdtab[arg]->dupcount++;
+        case PA_FDIO_LOGGER:
+            fdio_fdtab[arg] = fdio_logger_create(h);
+            fdio_fdtab[arg]->dupcount++;
             break;
-        case PA_MXIO_SOCKET:
+        case PA_FDIO_SOCKET:
             // socket objects have a second handle
             if (((n + 1) < handle_count) &&
                 (handle_info[n] == handle_info[n + 1])) {
-                mxio_fdtab[arg] = mxio_socket_create(h, handle[n + 1], MXIO_FLAG_SOCKET_CONNECTED);
+                fdio_fdtab[arg] = fdio_socket_create(h, handle[n + 1], FDIO_FLAG_SOCKET_CONNECTED);
                 handle_info[n + 1] = 0;
-                mxio_fdtab[arg]->dupcount++;
+                fdio_fdtab[arg]->dupcount++;
             } else {
-                mx_handle_close(h);
+                zx_handle_close(h);
             }
             break;
         case PA_NS_DIR:
@@ -529,12 +529,12 @@
             if (arg >= name_count) {
                 continue;
             }
-            if (mxio_root_ns == NULL) {
-                if (mxio_ns_create(&mxio_root_ns) < 0) {
+            if (fdio_root_ns == NULL) {
+                if (fdio_ns_create(&fdio_root_ns) < 0) {
                     continue;
                 }
             }
-            mxio_ns_bind(mxio_root_ns, names[arg], h);
+            fdio_ns_bind(fdio_root_ns, names[arg], h);
             continue;
         default:
             // unknown handle, leave it alone
@@ -545,7 +545,7 @@
     }
 
     // Set up thread local storage for rchannels.
-    __mxio_rchannel_init();
+    __fdio_rchannel_init();
 
     // TODO(abarth): The cwd path string should be more tightly coupled with
     // the cwd handle.
@@ -554,103 +554,103 @@
         update_cwd_path(cwd);
     }
 
-    mxio_t* use_for_stdio = (stdio_fd >= 0) ? mxio_fdtab[stdio_fd] : NULL;
+    fdio_t* use_for_stdio = (stdio_fd >= 0) ? fdio_fdtab[stdio_fd] : NULL;
 
     // configure stdin/out/err if not init'd
     for (uint32_t n = 0; n < 3; n++) {
-        if (mxio_fdtab[n] == NULL) {
+        if (fdio_fdtab[n] == NULL) {
             if (use_for_stdio) {
-                mxio_fdtab[n] = use_for_stdio;
+                fdio_fdtab[n] = use_for_stdio;
             } else {
-                mxio_fdtab[n] = mxio_null_create();
+                fdio_fdtab[n] = fdio_null_create();
             }
-            mxio_fdtab[n]->dupcount++;
+            fdio_fdtab[n]->dupcount++;
         }
     }
 
-    if (mxio_root_ns) {
-        mxio_t* io = mxio_ns_open_root(mxio_root_ns);
+    if (fdio_root_ns) {
+        fdio_t* io = fdio_ns_open_root(fdio_root_ns);
         if (io != NULL) {
-            // If we have a root from the legacy PA_MXIO_ROOT,
+            // If we have a root from the legacy PA_FDIO_ROOT,
             // a specified root namespace overrides it
-            if (mxio_root_handle) {
-                mxio_close(mxio_root_handle);
+            if (fdio_root_handle) {
+                fdio_close(fdio_root_handle);
             }
-            mxio_root_handle = io;
+            fdio_root_handle = io;
         }
     }
-    if (mxio_root_handle) {
-        mxio_root_init = true;
-        if(!mxio_cwd_handle) {
-            __mxio_open(&mxio_cwd_handle, mxio_cwd_path, O_RDONLY | O_DIRECTORY, 0);
+    if (fdio_root_handle) {
+        fdio_root_init = true;
+        if(!fdio_cwd_handle) {
+            __fdio_open(&fdio_cwd_handle, fdio_cwd_path, O_RDONLY | O_DIRECTORY, 0);
         }
     } else {
         // placeholder null handle
-        mxio_root_handle = mxio_null_create();
+        fdio_root_handle = fdio_null_create();
     }
-    if (mxio_cwd_handle == NULL) {
-        mxio_cwd_handle = mxio_null_create();
+    if (fdio_cwd_handle == NULL) {
+        fdio_cwd_handle = fdio_null_create();
     }
 
-    atexit(mxio_exit);
+    atexit(fdio_exit);
 }
 
 
-mx_status_t mxio_ns_install(mxio_ns_t* ns) {
-    mxio_t* io = mxio_ns_open_root(ns);
+zx_status_t fdio_ns_install(fdio_ns_t* ns) {
+    fdio_t* io = fdio_ns_open_root(ns);
     if (io == NULL) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
-    mxio_t* old_root = NULL;
-    mx_status_t status;
+    fdio_t* old_root = NULL;
+    zx_status_t status;
 
-    mtx_lock(&mxio_lock);
-    if (mxio_root_ns != NULL) {
+    mtx_lock(&fdio_lock);
+    if (fdio_root_ns != NULL) {
         //TODO: support replacing an active namespace
-        status = MX_ERR_ALREADY_EXISTS;
+        status = ZX_ERR_ALREADY_EXISTS;
     } else {
-        if (mxio_root_handle) {
-            old_root = mxio_root_handle;
+        if (fdio_root_handle) {
+            old_root = fdio_root_handle;
         }
-        mxio_root_handle = io;
-        status = MX_OK;
+        fdio_root_handle = io;
+        status = ZX_OK;
     }
-    mtx_unlock(&mxio_lock);
+    mtx_unlock(&fdio_lock);
 
     if (old_root) {
-        mxio_close(old_root);
-        mxio_release(old_root);
+        fdio_close(old_root);
+        fdio_release(old_root);
     }
     return status;
 }
 
 
-mx_status_t mxio_clone_root(mx_handle_t* handles, uint32_t* types) {
+zx_status_t fdio_clone_root(zx_handle_t* handles, uint32_t* types) {
     // The root handle is established in the init hook called from
     // libc startup (or, in the special case of devmgr, installed
     // slightly later), and is never NULL and does not change
     // in normal operation
-    mx_status_t r = mxio_root_handle->ops->clone(mxio_root_handle, handles, types);
+    zx_status_t r = fdio_root_handle->ops->clone(fdio_root_handle, handles, types);
     if (r > 0) {
-        *types = PA_MXIO_REMOTE;
+        *types = PA_FDIO_REMOTE;
     }
     return r;
 }
 
-mx_status_t mxio_clone_cwd(mx_handle_t* handles, uint32_t* types) {
-    mx_status_t r = mxio_cwd_handle->ops->clone(mxio_cwd_handle, handles, types);
+zx_status_t fdio_clone_cwd(zx_handle_t* handles, uint32_t* types) {
+    zx_status_t r = fdio_cwd_handle->ops->clone(fdio_cwd_handle, handles, types);
     if (r > 0) {
-        *types = PA_MXIO_CWD;
+        *types = PA_FDIO_CWD;
     }
     return r;
 }
 
-mx_status_t mxio_clone_fd(int fd, int newfd, mx_handle_t* handles, uint32_t* types) {
-    mx_status_t r;
-    mxio_t* io;
+zx_status_t fdio_clone_fd(int fd, int newfd, zx_handle_t* handles, uint32_t* types) {
+    zx_status_t r;
+    fdio_t* io;
     if ((io = fd_to_io(fd)) == NULL) {
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
     }
     // TODO(MG-973): implement/honor close-on-exec flag
     if ((r = io->ops->clone(io, handles, types)) > 0) {
@@ -658,14 +658,14 @@
             types[i] |= (newfd << 16);
         }
     }
-    mxio_release(io);
+    fdio_release(io);
     return r;
 }
 
-mx_status_t mxio_transfer_fd(int fd, int newfd, mx_handle_t* handles, uint32_t* types) {
-    mxio_t* io;
-    mx_status_t status;
-    if ((status = mxio_unbind_from_fd(fd, &io)) < 0) {
+zx_status_t fdio_transfer_fd(int fd, int newfd, zx_handle_t* handles, uint32_t* types) {
+    fdio_t* io;
+    zx_status_t status;
+    if ((status = fdio_unbind_from_fd(fd, &io)) < 0) {
         return status;
     }
     if ((status = io->ops->unwrap(io, handles, types)) < 0) {
@@ -677,28 +677,28 @@
     return status;
 }
 
-ssize_t mxio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len) {
-    mxio_t* io;
+ssize_t fdio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len) {
+    fdio_t* io;
     if ((io = fd_to_io(fd)) == NULL) {
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
     }
     ssize_t r = io->ops->ioctl(io, op, in_buf, in_len, out_buf, out_len);
-    mxio_release(io);
+    fdio_release(io);
     return r;
 }
 
-mx_status_t mxio_wait(mxio_t* io, uint32_t events, mx_time_t deadline,
+zx_status_t fdio_wait(fdio_t* io, uint32_t events, zx_time_t deadline,
                       uint32_t* out_pending) {
-    mx_handle_t h = MX_HANDLE_INVALID;
-    mx_signals_t signals = 0;
+    zx_handle_t h = ZX_HANDLE_INVALID;
+    zx_signals_t signals = 0;
     io->ops->wait_begin(io, events, &h, &signals);
-    if (h == MX_HANDLE_INVALID)
+    if (h == ZX_HANDLE_INVALID)
         // Wait operation is not applicable to the handle.
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
-    mx_signals_t pending;
-    mx_status_t status = mx_object_wait_one(h, signals, deadline, &pending);
-    if (status == MX_OK || status == MX_ERR_TIMED_OUT) {
+    zx_signals_t pending;
+    zx_status_t status = zx_object_wait_one(h, signals, deadline, &pending);
+    if (status == ZX_OK || status == ZX_ERR_TIMED_OUT) {
         io->ops->wait_end(io, pending, &events);
         if (out_pending != NULL)
             *out_pending = events;
@@ -707,25 +707,25 @@
     return status;
 }
 
-mx_status_t mxio_wait_fd(int fd, uint32_t events, uint32_t* _pending, mx_time_t deadline) {
-    mxio_t* io = fd_to_io(fd);
+zx_status_t fdio_wait_fd(int fd, uint32_t events, uint32_t* _pending, zx_time_t deadline) {
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL)
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
 
-    mx_status_t status = mxio_wait(io, events, deadline, _pending);
+    zx_status_t status = fdio_wait(io, events, deadline, _pending);
 
-    mxio_release(io);
+    fdio_release(io);
     return status;
 }
 
-int mxio_stat(mxio_t* io, struct stat* s) {
+int fdio_stat(fdio_t* io, struct stat* s) {
     vnattr_t attr;
-    int r = io->ops->misc(io, MXRIO_STAT, 0, sizeof(attr), &attr, 0);
+    int r = io->ops->misc(io, ZXRIO_STAT, 0, sizeof(attr), &attr, 0);
     if (r < 0) {
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
     }
     if (r < (int)sizeof(attr)) {
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     memset(s, 0, sizeof(struct stat));
     s->st_mode = attr.mode;
@@ -734,18 +734,18 @@
     s->st_blksize = attr.blksize;
     s->st_blocks = attr.blkcount;
     s->st_nlink = attr.nlink;
-    s->st_ctim.tv_sec = attr.create_time / MX_SEC(1);
-    s->st_ctim.tv_nsec = attr.create_time % MX_SEC(1);
-    s->st_mtim.tv_sec = attr.modify_time / MX_SEC(1);
-    s->st_mtim.tv_nsec = attr.modify_time % MX_SEC(1);
+    s->st_ctim.tv_sec = attr.create_time / ZX_SEC(1);
+    s->st_ctim.tv_nsec = attr.create_time % ZX_SEC(1);
+    s->st_mtim.tv_sec = attr.modify_time / ZX_SEC(1);
+    s->st_mtim.tv_nsec = attr.modify_time % ZX_SEC(1);
     return 0;
 }
 
 
-mx_status_t mxio_setattr(mxio_t* io, vnattr_t* vn){
-    mx_status_t r = io->ops->misc(io, MXRIO_SETATTR, 0, 0, vn, sizeof(*vn));
+zx_status_t fdio_setattr(fdio_t* io, vnattr_t* vn){
+    zx_status_t r = io->ops->misc(io, ZXRIO_SETATTR, 0, 0, vn, sizeof(*vn));
     if (r < 0) {
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
     }
 
     return  r;
@@ -753,39 +753,39 @@
 
 
 // TODO(MG-974): determine complete correct mapping
-int mxio_status_to_errno(mx_status_t status) {
+int fdio_status_to_errno(zx_status_t status) {
     switch (status) {
-    case MX_ERR_NOT_FOUND: return ENOENT;
-    case MX_ERR_NO_MEMORY: return ENOMEM;
-    case MX_ERR_INVALID_ARGS: return EINVAL;
-    case MX_ERR_BUFFER_TOO_SMALL: return EINVAL;
-    case MX_ERR_TIMED_OUT: return ETIMEDOUT;
-    case MX_ERR_UNAVAILABLE: return EBUSY;
-    case MX_ERR_ALREADY_EXISTS: return EEXIST;
-    case MX_ERR_PEER_CLOSED: return EPIPE;
-    case MX_ERR_BAD_STATE: return EPIPE;
-    case MX_ERR_BAD_PATH: return ENAMETOOLONG;
-    case MX_ERR_IO: return EIO;
-    case MX_ERR_NOT_FILE: return EISDIR;
-    case MX_ERR_NOT_DIR: return ENOTDIR;
-    case MX_ERR_NOT_SUPPORTED: return ENOTSUP;
-    case MX_ERR_OUT_OF_RANGE: return EINVAL;
-    case MX_ERR_NO_RESOURCES: return ENOMEM;
-    case MX_ERR_BAD_HANDLE: return EBADF;
-    case MX_ERR_ACCESS_DENIED: return EACCES;
-    case MX_ERR_SHOULD_WAIT: return EAGAIN;
-    case MX_ERR_FILE_BIG: return EFBIG;
-    case MX_ERR_NO_SPACE: return ENOSPC;
-    case MX_ERR_NOT_EMPTY: return ENOTEMPTY;
-    case MX_ERR_IO_REFUSED: return ECONNREFUSED;
-    case MX_ERR_CANCELED: return ECANCELED;
-    case MX_ERR_PROTOCOL_NOT_SUPPORTED: return EPROTONOSUPPORT;
-    case MX_ERR_ADDRESS_UNREACHABLE: return ENETUNREACH;
-    case MX_ERR_ADDRESS_IN_USE: return EADDRINUSE;
-    case MX_ERR_NOT_CONNECTED: return ENOTCONN;
-    case MX_ERR_CONNECTION_REFUSED: return ECONNREFUSED;
-    case MX_ERR_CONNECTION_RESET: return ECONNRESET;
-    case MX_ERR_CONNECTION_ABORTED: return ECONNABORTED;
+    case ZX_ERR_NOT_FOUND: return ENOENT;
+    case ZX_ERR_NO_MEMORY: return ENOMEM;
+    case ZX_ERR_INVALID_ARGS: return EINVAL;
+    case ZX_ERR_BUFFER_TOO_SMALL: return EINVAL;
+    case ZX_ERR_TIMED_OUT: return ETIMEDOUT;
+    case ZX_ERR_UNAVAILABLE: return EBUSY;
+    case ZX_ERR_ALREADY_EXISTS: return EEXIST;
+    case ZX_ERR_PEER_CLOSED: return EPIPE;
+    case ZX_ERR_BAD_STATE: return EPIPE;
+    case ZX_ERR_BAD_PATH: return ENAMETOOLONG;
+    case ZX_ERR_IO: return EIO;
+    case ZX_ERR_NOT_FILE: return EISDIR;
+    case ZX_ERR_NOT_DIR: return ENOTDIR;
+    case ZX_ERR_NOT_SUPPORTED: return ENOTSUP;
+    case ZX_ERR_OUT_OF_RANGE: return EINVAL;
+    case ZX_ERR_NO_RESOURCES: return ENOMEM;
+    case ZX_ERR_BAD_HANDLE: return EBADF;
+    case ZX_ERR_ACCESS_DENIED: return EACCES;
+    case ZX_ERR_SHOULD_WAIT: return EAGAIN;
+    case ZX_ERR_FILE_BIG: return EFBIG;
+    case ZX_ERR_NO_SPACE: return ENOSPC;
+    case ZX_ERR_NOT_EMPTY: return ENOTEMPTY;
+    case ZX_ERR_IO_REFUSED: return ECONNREFUSED;
+    case ZX_ERR_CANCELED: return ECANCELED;
+    case ZX_ERR_PROTOCOL_NOT_SUPPORTED: return EPROTONOSUPPORT;
+    case ZX_ERR_ADDRESS_UNREACHABLE: return ENETUNREACH;
+    case ZX_ERR_ADDRESS_IN_USE: return EADDRINUSE;
+    case ZX_ERR_NOT_CONNECTED: return ENOTCONN;
+    case ZX_ERR_CONNECTION_REFUSED: return ECONNREFUSED;
+    case ZX_ERR_CONNECTION_RESET: return ECONNRESET;
+    case ZX_ERR_CONNECTION_ABORTED: return ECONNABORTED;
 
     // No specific translation, so return a generic errno value.
     default: return EIO;
@@ -835,52 +835,52 @@
     return count;
 }
 
-mx_status_t _mmap_file(size_t offset, size_t len, uint32_t mx_flags, int flags, int fd,
+zx_status_t _mmap_file(size_t offset, size_t len, uint32_t zx_flags, int flags, int fd,
                        off_t fd_off, uintptr_t* out) {
-    mxio_t* io;
+    fdio_t* io;
     if ((io = fd_to_io(fd)) == NULL) {
-        return MX_ERR_BAD_HANDLE;
+        return ZX_ERR_BAD_HANDLE;
     }
 
     // At the moment, these parameters are sent to filesystem servers purely
     // for validation, since there is no mechanism to create a "subset vmo"
     // from the original VMO.
     // TODO(smklein): Once (if?) we can create 'subset' vmos, remove the
-    // fd_off argument to mx_vmar_map below.
-    mxrio_mmap_data_t data;
+    // fd_off argument to zx_vmar_map below.
+    zxrio_mmap_data_t data;
     data.offset = fd_off;
     data.length = len;
-    data.flags = mx_flags | (flags & MAP_PRIVATE ? MXIO_MMAP_FLAG_PRIVATE : 0);
+    data.flags = zx_flags | (flags & MAP_PRIVATE ? FDIO_MMAP_FLAG_PRIVATE : 0);
 
-    mx_status_t r = io->ops->misc(io, MXRIO_MMAP, 0, sizeof(data), &data, sizeof(data));
-    mxio_release(io);
+    zx_status_t r = io->ops->misc(io, ZXRIO_MMAP, 0, sizeof(data), &data, sizeof(data));
+    fdio_release(io);
     if (r < 0) {
         return r;
     }
-    mx_handle_t vmo = r;
+    zx_handle_t vmo = r;
 
     uintptr_t ptr = 0;
-    r = mx_vmar_map(mx_vmar_root_self(), offset, vmo, data.offset, data.length, mx_flags, &ptr);
-    mx_handle_close(vmo);
+    r = zx_vmar_map(zx_vmar_root_self(), offset, vmo, data.offset, data.length, zx_flags, &ptr);
+    zx_handle_close(vmo);
     // TODO: map this as shared if we ever implement forking
     if (r < 0) {
         return r;
     }
 
     *out = ptr;
-    return MX_OK;
+    return ZX_OK;
 }
 
 int unlinkat(int dirfd, const char* path, int flags) {
     char name[NAME_MAX + 1];
-    mxio_t* io;
-    mx_status_t r;
-    if ((r = __mxio_opendir_containing_at(&io, dirfd, path, name)) < 0) {
+    fdio_t* io;
+    zx_status_t r;
+    if ((r = __fdio_opendir_containing_at(&io, dirfd, path, name)) < 0) {
         return ERROR(r);
     }
-    r = io->ops->misc(io, MXRIO_UNLINK, 0, 0, (void*)name, strlen(name));
+    r = io->ops->misc(io, ZXRIO_UNLINK, 0, 0, (void*)name, strlen(name));
     io->ops->close(io);
-    mxio_release(io);
+    fdio_release(io);
     return STATUS(r);
 }
 
@@ -889,19 +889,19 @@
         return ERRNO(EINVAL);
     }
 
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
-    mx_status_t status;
+    zx_status_t status;
     for (;;) {
         status = io->ops->read(io, buf, count);
-        if (status != MX_ERR_SHOULD_WAIT || io->flags & MXIO_FLAG_NONBLOCK) {
+        if (status != ZX_ERR_SHOULD_WAIT || io->flags & FDIO_FLAG_NONBLOCK) {
             break;
         }
-        mxio_wait_fd(fd, MXIO_EVT_READABLE | MXIO_EVT_PEER_CLOSED, NULL, MX_TIME_INFINITE);
+        fdio_wait_fd(fd, FDIO_EVT_READABLE | FDIO_EVT_PEER_CLOSED, NULL, ZX_TIME_INFINITE);
     }
-    mxio_release(io);
+    fdio_release(io);
     return status < 0 ? STATUS(status) : status;
 }
 
@@ -910,19 +910,19 @@
         return ERRNO(EINVAL);
     }
 
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
-    mx_status_t status;
+    zx_status_t status;
     for (;;) {
         status = io->ops->write(io, buf, count);
-        if (status != MX_ERR_SHOULD_WAIT || io->flags & MXIO_FLAG_NONBLOCK) {
+        if (status != ZX_ERR_SHOULD_WAIT || io->flags & FDIO_FLAG_NONBLOCK) {
             break;
         }
-        mxio_wait_fd(fd, MXIO_EVT_WRITABLE | MXIO_EVT_PEER_CLOSED, NULL, MX_TIME_INFINITE);
+        fdio_wait_fd(fd, FDIO_EVT_WRITABLE | FDIO_EVT_PEER_CLOSED, NULL, ZX_TIME_INFINITE);
     }
-    mxio_release(io);
+    fdio_release(io);
     return status < 0 ? STATUS(status) : status;
 }
 
@@ -952,19 +952,19 @@
         return ERRNO(EINVAL);
     }
 
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
-    mx_status_t status;
+    zx_status_t status;
     for (;;) {
         status = io->ops->read_at(io, buf, size, ofs);
-        if (status != MX_ERR_SHOULD_WAIT || io->flags & MXIO_FLAG_NONBLOCK) {
+        if (status != ZX_ERR_SHOULD_WAIT || io->flags & FDIO_FLAG_NONBLOCK) {
             break;
         }
-        mxio_wait_fd(fd, MXIO_EVT_READABLE | MXIO_EVT_PEER_CLOSED, NULL, MX_TIME_INFINITE);
+        fdio_wait_fd(fd, FDIO_EVT_READABLE | FDIO_EVT_PEER_CLOSED, NULL, ZX_TIME_INFINITE);
     }
-    mxio_release(io);
+    fdio_release(io);
     return status < 0 ? STATUS(status) : status;
 }
 
@@ -994,62 +994,62 @@
         return ERRNO(EINVAL);
     }
 
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
-    mx_status_t status;
+    zx_status_t status;
     for (;;) {
         status = io->ops->write_at(io, buf, size, ofs);
-        if (status != MX_ERR_SHOULD_WAIT || io->flags & MXIO_FLAG_NONBLOCK) {
+        if (status != ZX_ERR_SHOULD_WAIT || io->flags & FDIO_FLAG_NONBLOCK) {
             break;
         }
-        mxio_wait_fd(fd, MXIO_EVT_WRITABLE | MXIO_EVT_PEER_CLOSED, NULL, MX_TIME_INFINITE);
+        fdio_wait_fd(fd, FDIO_EVT_WRITABLE | FDIO_EVT_PEER_CLOSED, NULL, ZX_TIME_INFINITE);
     }
-    mxio_release(io);
+    fdio_release(io);
     return status < 0 ? STATUS(status) : status;
 }
 
 int close(int fd) {
-    mtx_lock(&mxio_lock);
-    if ((fd < 0) || (fd >= MAX_MXIO_FD) || (mxio_fdtab[fd] == NULL)) {
-        mtx_unlock(&mxio_lock);
+    mtx_lock(&fdio_lock);
+    if ((fd < 0) || (fd >= MAX_FDIO_FD) || (fdio_fdtab[fd] == NULL)) {
+        mtx_unlock(&fdio_lock);
         return ERRNO(EBADF);
     }
-    mxio_t* io = mxio_fdtab[fd];
+    fdio_t* io = fdio_fdtab[fd];
     io->dupcount--;
-    mxio_fdtab[fd] = NULL;
+    fdio_fdtab[fd] = NULL;
     if (io->dupcount > 0) {
         // still alive in other fdtab slots
-        mtx_unlock(&mxio_lock);
-        mxio_release(io);
-        return MX_OK;
+        mtx_unlock(&fdio_lock);
+        fdio_release(io);
+        return ZX_OK;
     } else {
-        mtx_unlock(&mxio_lock);
+        mtx_unlock(&fdio_lock);
         int r = io->ops->close(io);
-        mxio_release(io);
+        fdio_release(io);
         return STATUS(r);
     }
 }
 
-static int mxio_dup(int oldfd, int newfd, int starting_fd) {
-    mxio_t* io = fd_to_io(oldfd);
+static int fdio_dup(int oldfd, int newfd, int starting_fd) {
+    fdio_t* io = fd_to_io(oldfd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
-    int fd = mxio_bind_to_fd(io, newfd, starting_fd);
+    int fd = fdio_bind_to_fd(io, newfd, starting_fd);
     if (fd < 0) {
-        mxio_release(io);
+        fdio_release(io);
     }
     return fd;
 }
 
 int dup2(int oldfd, int newfd) {
-    return mxio_dup(oldfd, newfd, 0);
+    return fdio_dup(oldfd, newfd, 0);
 }
 
 int dup(int oldfd) {
-    return mxio_dup(oldfd, -1, 0);
+    return fdio_dup(oldfd, -1, 0);
 }
 
 int dup3(int oldfd, int newfd, int flags) {
@@ -1065,7 +1065,7 @@
     }
 
     // TODO(MG-973) Implement O_CLOEXEC.
-    return mxio_dup(oldfd, newfd, 0);
+    return fdio_dup(oldfd, newfd, 0);
 }
 
 int fcntl(int fd, int cmd, ...) {
@@ -1083,81 +1083,81 @@
     case F_DUPFD_CLOEXEC: {
         // TODO(MG-973) Implement CLOEXEC.
         GET_INT_ARG(starting_fd);
-        return mxio_dup(fd, -1, starting_fd);
+        return fdio_dup(fd, -1, starting_fd);
     }
     case F_GETFD: {
-        mxio_t* io = fd_to_io(fd);
+        fdio_t* io = fd_to_io(fd);
         if (io == NULL) {
             return ERRNO(EBADF);
         }
-        int flags = (int)(io->flags & MXIO_FD_FLAGS);
+        int flags = (int)(io->flags & FDIO_FD_FLAGS);
         // POSIX mandates that the return value be nonnegative if successful.
         assert(flags >= 0);
-        mxio_release(io);
+        fdio_release(io);
         return flags;
     }
     case F_SETFD: {
-        mxio_t* io = fd_to_io(fd);
+        fdio_t* io = fd_to_io(fd);
         if (io == NULL) {
             return ERRNO(EBADF);
         }
         GET_INT_ARG(flags);
         // TODO(MG-973) Implement CLOEXEC.
-        io->flags &= ~MXIO_FD_FLAGS;
-        io->flags |= (int32_t)flags & MXIO_FD_FLAGS;
-        mxio_release(io);
+        io->flags &= ~FDIO_FD_FLAGS;
+        io->flags |= (int32_t)flags & FDIO_FD_FLAGS;
+        fdio_release(io);
         return 0;
     }
     case F_GETFL: {
-        mxio_t* io = fd_to_io(fd);
+        fdio_t* io = fd_to_io(fd);
         if (io == NULL) {
             return ERRNO(EBADF);
         }
         uint32_t flags = 0;
-        mx_status_t r = io->ops->misc(io, MXRIO_FCNTL, 0, F_GETFL, &flags, 0);
-        if (r == MX_ERR_NOT_SUPPORTED) {
+        zx_status_t r = io->ops->misc(io, ZXRIO_FCNTL, 0, F_GETFL, &flags, 0);
+        if (r == ZX_ERR_NOT_SUPPORTED) {
             // We treat this as non-fatal, as it's valid for a remote to
             // simply not support FCNTL, but we still want to correctly
             // report the state of the (local) NONBLOCK flag
             flags = 0;
-            r = MX_OK;
+            r = ZX_OK;
         }
-        if (io->flags & MXIO_FLAG_NONBLOCK) {
+        if (io->flags & FDIO_FLAG_NONBLOCK) {
             flags |= O_NONBLOCK;
         }
-        mxio_release(io);
+        fdio_release(io);
         if (r < 0) {
             return STATUS(r);
         }
         return flags;
     }
     case F_SETFL: {
-        mxio_t* io = fd_to_io(fd);
+        fdio_t* io = fd_to_io(fd);
         if (io == NULL) {
             return ERRNO(EBADF);
         }
         GET_INT_ARG(n);
 
-        mx_status_t r;
+        zx_status_t r;
         if (n == O_NONBLOCK) {
             // NONBLOCK is local, so we can avoid the rpc for it
             // which is good in situations where the remote doesn't
             // support FCNTL but it's still valid to set non-blocking
-            r = MX_OK;
+            r = ZX_OK;
         } else {
-            r = io->ops->misc(io, MXRIO_FCNTL, n & (~O_NONBLOCK), F_SETFL, NULL, 0);
+            r = io->ops->misc(io, ZXRIO_FCNTL, n & (~O_NONBLOCK), F_SETFL, NULL, 0);
         }
-        if (r != MX_OK) {
+        if (r != ZX_OK) {
             n = STATUS(r);
         } else {
             if (n & O_NONBLOCK) {
-                io->flags |= MXIO_FLAG_NONBLOCK;
+                io->flags |= FDIO_FLAG_NONBLOCK;
             } else {
-                io->flags &= ~MXIO_FLAG_NONBLOCK;
+                io->flags &= ~FDIO_FLAG_NONBLOCK;
             }
             n = 0;
         }
-        mxio_release(io);
+        fdio_release(io);
         return n;
     }
     case F_GETOWN:
@@ -1177,12 +1177,12 @@
 }
 
 off_t lseek(int fd, off_t offset, int whence) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
     off_t r = io->ops->seek(io, offset, whence);
-    if (r == MX_ERR_WRONG_TYPE) {
+    if (r == ZX_ERR_WRONG_TYPE) {
         // Although 'ESPIPE' is a bit of a misnomer, it is the valid errno
         // for any fd which does not implement seeking (i.e., for pipes,
         // sockets, etc).
@@ -1191,30 +1191,30 @@
     } else if (r < 0) {
         r = ERROR(r);
     }
-    mxio_release(io);
+    fdio_release(io);
     return r;
 }
 
 static int getdirents(int fd, void* ptr, size_t len, long cmd) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
-    int r = STATUS(io->ops->misc(io, MXRIO_READDIR, cmd, len, ptr, 0));
-    mxio_release(io);
+    int r = STATUS(io->ops->misc(io, ZXRIO_READDIR, cmd, len, ptr, 0));
+    fdio_release(io);
     return r;
 }
 
 static int truncateat(int dirfd, const char* path, off_t len) {
-    mxio_t* io;
-    mx_status_t r;
+    fdio_t* io;
+    zx_status_t r;
 
-    if ((r = __mxio_open_at(&io, dirfd, path, O_WRONLY, 0)) < 0) {
+    if ((r = __fdio_open_at(&io, dirfd, path, O_WRONLY, 0)) < 0) {
         return ERROR(r);
     }
-    r = io->ops->misc(io, MXRIO_TRUNCATE, len, 0, NULL, 0);
-    mxio_close(io);
-    mxio_release(io);
+    r = io->ops->misc(io, ZXRIO_TRUNCATE, len, 0, NULL, 0);
+    fdio_close(io);
+    fdio_release(io);
     return STATUS(r);
 }
 
@@ -1223,17 +1223,17 @@
 }
 
 int ftruncate(int fd, off_t len) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
-    int r = STATUS(io->ops->misc(io, MXRIO_TRUNCATE, len, 0, NULL, 0));
-     mxio_release(io);
+    int r = STATUS(io->ops->misc(io, ZXRIO_TRUNCATE, len, 0, NULL, 0));
+     fdio_release(io);
      return r;
 }
 
 // Filesystem operations (such as rename and link) which act on multiple paths
-// have some additional complexity on Magenta. These operations (eventually) act
+// have some additional complexity on Zircon. These operations (eventually) act
 // on two pairs of variables: a source parent vnode + name, and a target parent
 // vnode + name. However, the loose coupling of these pairs can make their
 // correspondence difficult, especially when accessing each parent vnode may
@@ -1245,36 +1245,36 @@
 // - Sending the real operation + names to the source parent vnode, along with
 //   the "vnode token" representing the target parent vnode.
 //
-// Using magenta kernel primitives (cookies) to authenticate the vnode token, this
+// Using zircon kernel primitives (cookies) to authenticate the vnode token, this
 // allows these multi-path operations to mix absolute / relative paths and cross
 // mount points with ease.
 static int two_path_op_at(uint32_t op, int olddirfd, const char* oldpath,
                           int newdirfd, const char* newpath) {
     char oldname[NAME_MAX + 1];
-    mxio_t* io_oldparent;
-    mx_status_t status = MX_OK;
-    if ((status = __mxio_opendir_containing_at(&io_oldparent, olddirfd, oldpath, oldname)) < 0) {
+    fdio_t* io_oldparent;
+    zx_status_t status = ZX_OK;
+    if ((status = __fdio_opendir_containing_at(&io_oldparent, olddirfd, oldpath, oldname)) < 0) {
         return ERROR(status);
     }
 
     char newname[NAME_MAX + 1];
-    mxio_t* io_newparent;
-    if ((status = __mxio_opendir_containing_at(&io_newparent, newdirfd, newpath, newname)) < 0) {
+    fdio_t* io_newparent;
+    if ((status = __fdio_opendir_containing_at(&io_newparent, newdirfd, newpath, newname)) < 0) {
         goto oldparent_open;
     }
 
-    mx_handle_t token;
+    zx_handle_t token;
     status = io_newparent->ops->ioctl(io_newparent, IOCTL_VFS_GET_TOKEN,
                                       NULL, 0, &token, sizeof(token));
     if (status < 0) {
         goto newparent_open;
     }
 
-    char name[MXIO_CHUNK_SIZE];
+    char name[FDIO_CHUNK_SIZE];
     size_t oldlen = strlen(oldname);
     size_t newlen = strlen(newname);
     static_assert(sizeof(oldname) + sizeof(newname) + 2 < sizeof(name),
-                  "Dual-path operation names should fit in MXIO name buffer");
+                  "Dual-path operation names should fit in FDIO name buffer");
     memcpy(name, oldname, oldlen);
     name[oldlen] = '\0';
     memcpy(name + oldlen + 1, newname, newlen);
@@ -1284,23 +1284,23 @@
     goto newparent_open;
 newparent_open:
     io_newparent->ops->close(io_newparent);
-    mxio_release(io_newparent);
+    fdio_release(io_newparent);
 oldparent_open:
     io_oldparent->ops->close(io_oldparent);
-    mxio_release(io_oldparent);
+    fdio_release(io_oldparent);
     return STATUS(status);
 }
 
 int renameat(int olddirfd, const char* oldpath, int newdirfd, const char* newpath) {
-    return two_path_op_at(MXRIO_RENAME, olddirfd, oldpath, newdirfd, newpath);
+    return two_path_op_at(ZXRIO_RENAME, olddirfd, oldpath, newdirfd, newpath);
 }
 
 int rename(const char* oldpath, const char* newpath) {
-    return two_path_op_at(MXRIO_RENAME, AT_FDCWD, oldpath, AT_FDCWD, newpath);
+    return two_path_op_at(ZXRIO_RENAME, AT_FDCWD, oldpath, AT_FDCWD, newpath);
 }
 
 int link(const char* oldpath, const char* newpath) {
-    return two_path_op_at(MXRIO_LINK, AT_FDCWD, oldpath, AT_FDCWD, newpath);
+    return two_path_op_at(ZXRIO_LINK, AT_FDCWD, oldpath, AT_FDCWD, newpath);
 }
 
 int unlink(const char* path) {
@@ -1308,8 +1308,8 @@
 }
 
 static int vopenat(int dirfd, const char* path, int flags, va_list args) {
-    mxio_t* io = NULL;
-    mx_status_t r;
+    fdio_t* io = NULL;
+    zx_status_t r;
     int fd;
     uint32_t mode = 0;
 
@@ -1322,15 +1322,15 @@
         }
         mode = va_arg(args, uint32_t) & 0777;
     }
-    if ((r = __mxio_open_at(&io, dirfd, path, flags, mode)) < 0) {
+    if ((r = __fdio_open_at(&io, dirfd, path, flags, mode)) < 0) {
         return ERROR(r);
     }
     if (flags & O_NONBLOCK) {
-        io->flags |= MXIO_FLAG_NONBLOCK;
+        io->flags |= FDIO_FLAG_NONBLOCK;
     }
-    if ((fd = mxio_bind_to_fd(io, -1, 0)) < 0) {
+    if ((fd = fdio_bind_to_fd(io, -1, 0)) < 0) {
         io->ops->close(io);
-        mxio_release(io);
+        fdio_release(io);
         return ERRNO(EMFILE);
     }
     return fd;
@@ -1357,26 +1357,26 @@
 }
 
 int mkdirat(int dirfd, const char* path, mode_t mode) {
-    mxio_t* io = NULL;
-    mx_status_t r;
+    fdio_t* io = NULL;
+    zx_status_t r;
 
     mode = (mode & 0777) | S_IFDIR;
 
-    if ((r = __mxio_open_at(&io, dirfd, path, O_RDONLY | O_CREAT | O_EXCL, mode)) < 0) {
+    if ((r = __fdio_open_at(&io, dirfd, path, O_RDONLY | O_CREAT | O_EXCL, mode)) < 0) {
         return ERROR(r);
     }
     io->ops->close(io);
-    mxio_release(io);
+    fdio_release(io);
     return 0;
 }
 
 int fsync(int fd) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
-    int r = STATUS(io->ops->misc(io, MXRIO_SYNC, 0, 0, 0, 0));
-    mxio_release(io);
+    int r = STATUS(io->ops->misc(io, ZXRIO_SYNC, 0, 0, 0, 0));
+    fdio_release(io);
     return r;
 }
 
@@ -1388,25 +1388,25 @@
 }
 
 int fstat(int fd, struct stat* s) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
-    int r = STATUS(mxio_stat(io, s));
-    mxio_release(io);
+    int r = STATUS(fdio_stat(io, s));
+    fdio_release(io);
     return r;
 }
 
 int fstatat(int dirfd, const char* fn, struct stat* s, int flags) {
-    mxio_t* io;
-    mx_status_t r;
+    fdio_t* io;
+    zx_status_t r;
 
-    if ((r = __mxio_open_at(&io, dirfd, fn, 0, 0)) < 0) {
+    if ((r = __fdio_open_at(&io, dirfd, fn, 0, 0)) < 0) {
         return ERROR(r);
     }
-    r = mxio_stat(io, s);
-    mxio_close(io);
-    mxio_release(io);
+    r = fdio_stat(io, s);
+    fdio_close(io);
+    fdio_release(io);
     return STATUS(r);
 }
 
@@ -1433,27 +1433,27 @@
     if (filename[0] != '/') {
         // Convert 'filename' from a relative path to an absolute path.
         size_t file_len = strlen(filename);
-        mtx_lock(&mxio_cwd_lock);
-        size_t cwd_len = strlen(mxio_cwd_path);
+        mtx_lock(&fdio_cwd_lock);
+        size_t cwd_len = strlen(fdio_cwd_path);
         if (cwd_len + 1 + file_len >= PATH_MAX) {
-            mtx_unlock(&mxio_cwd_lock);
+            mtx_unlock(&fdio_cwd_lock);
             errno = ENAMETOOLONG;
             return NULL;
         }
         char tmp2[PATH_MAX];
-        memcpy(tmp2, mxio_cwd_path, cwd_len);
-        mtx_unlock(&mxio_cwd_lock);
+        memcpy(tmp2, fdio_cwd_path, cwd_len);
+        mtx_unlock(&fdio_cwd_lock);
         tmp2[cwd_len] = '/';
         strcpy(tmp2 + cwd_len + 1, filename);
-        mx_status_t status = __mxio_cleanpath(tmp2, tmp, &outlen, &is_dir);
-        if (status != MX_OK) {
+        zx_status_t status = __fdio_cleanpath(tmp2, tmp, &outlen, &is_dir);
+        if (status != ZX_OK) {
             errno = EINVAL;
             return NULL;
         }
     } else {
         // Clean the provided absolute path
-        mx_status_t status = __mxio_cleanpath(filename, tmp, &outlen, &is_dir);
-        if (status != MX_OK) {
+        zx_status_t status = __fdio_cleanpath(filename, tmp, &outlen, &is_dir);
+        if (status != ZX_OK) {
             errno = EINVAL;
             return NULL;
         }
@@ -1466,16 +1466,16 @@
     return resolved ? strcpy(resolved, tmp) : strdup(tmp);
 }
 
-static int mx_utimens(mxio_t* io, const struct timespec times[2], int flags) {
+static int zx_utimens(fdio_t* io, const struct timespec times[2], int flags) {
     vnattr_t vn;
-    mx_status_t r;
+    zx_status_t r;
 
     vn.valid = 0;
 
     // extract modify time
     vn.modify_time = (times == NULL || times[1].tv_nsec == UTIME_NOW)
-        ? mx_time_get(MX_CLOCK_UTC)
-        : MX_SEC(times[1].tv_sec) + times[1].tv_nsec;
+        ? zx_time_get(ZX_CLOCK_UTC)
+        : ZX_SEC(times[1].tv_sec) + times[1].tv_nsec;
 
     if (times == NULL || times[1].tv_nsec != UTIME_OMIT) {
         // TODO(orr) UTIME_NOW requires write access or euid == owner or "appropriate privilege"
@@ -1485,14 +1485,14 @@
     // TODO(orr): access time not implemented for now
 
     // set time(s) on underlying object
-    r = mxio_setattr(io, &vn);
+    r = fdio_setattr(io, &vn);
     return r;
 }
 
 int utimensat(int dirfd, const char *fn,
               const struct timespec times[2], int flags) {
-    mxio_t* io;
-    mx_status_t r;
+    fdio_t* io;
+    zx_status_t r;
 
     // TODO(orr): AT_SYMLINK_NOFOLLOW
     if ((flags & AT_SYMLINK_NOFOLLOW) != 0) {
@@ -1500,21 +1500,21 @@
         // symlinks, so don't break utilities (like tar) that use this flag.
     }
 
-    if ((r = __mxio_open_at(&io, dirfd, fn, 0, 0)) < 0) {
+    if ((r = __fdio_open_at(&io, dirfd, fn, 0, 0)) < 0) {
         return ERROR(r);
     }
 
-    r = mx_utimens(io, times, 0);
+    r = zx_utimens(io, times, 0);
 
-    mxio_close(io);
-    mxio_release(io);
+    fdio_close(io);
+    fdio_release(io);
     return STATUS(r);
 }
 
 int futimens(int fd, const struct timespec times[2]) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
 
-    mx_status_t r = mx_utimens(io, times, 0);
+    zx_status_t r = zx_utimens(io, times, 0);
     return STATUS(r);
 }
 
@@ -1523,24 +1523,24 @@
     if (flags & ~allowed_flags) {
         return ERRNO(EINVAL);
     }
-    mxio_t *a, *b;
-    int r = mxio_pipe_pair(&a, &b);
+    fdio_t *a, *b;
+    int r = fdio_pipe_pair(&a, &b);
     if (r < 0) {
         return ERROR(r);
     }
-    pipefd[0] = mxio_bind_to_fd(a, -1, 0);
+    pipefd[0] = fdio_bind_to_fd(a, -1, 0);
     if (pipefd[0] < 0) {
-        mxio_close(a);
-        mxio_release(a);
-        mxio_close(b);
-        mxio_release(b);
+        fdio_close(a);
+        fdio_release(a);
+        fdio_close(b);
+        fdio_release(b);
         return ERROR(pipefd[0]);
     }
-    pipefd[1] = mxio_bind_to_fd(b, -1, 0);
+    pipefd[1] = fdio_bind_to_fd(b, -1, 0);
     if (pipefd[1] < 0) {
         close(pipefd[0]);
-        mxio_close(b);
-        mxio_release(b);
+        fdio_close(b);
+        fdio_release(b);
         return ERROR(pipefd[1]);
     }
     return 0;
@@ -1567,15 +1567,15 @@
 
     // Since we are not tracking permissions yet, just check that the
     // file exists a la fstatat.
-    mxio_t* io;
-    mx_status_t status;
-    if ((status = __mxio_open_at(&io, dirfd, filename, 0, 0)) < 0) {
+    fdio_t* io;
+    zx_status_t status;
+    if ((status = __fdio_open_at(&io, dirfd, filename, 0, 0)) < 0) {
         return ERROR(status);
     }
     struct stat s;
-    status = mxio_stat(io, &s);
-    mxio_close(io);
-    mxio_release(io);
+    status = fdio_stat(io, &s);
+    fdio_close(io);
+    fdio_release(io);
     return STATUS(status);
 }
 
@@ -1590,15 +1590,15 @@
     }
 
     char* out = NULL;
-    mtx_lock(&mxio_cwd_lock);
-    size_t len = strlen(mxio_cwd_path) + 1;
+    mtx_lock(&fdio_cwd_lock);
+    size_t len = strlen(fdio_cwd_path) + 1;
     if (len < size) {
-        memcpy(buf, mxio_cwd_path, len);
+        memcpy(buf, fdio_cwd_path, len);
         out = buf;
     } else {
         errno = ERANGE;
     }
-    mtx_unlock(&mxio_cwd_lock);
+    mtx_unlock(&fdio_cwd_lock);
 
     if (out == tmp) {
         out = strdup(tmp);
@@ -1606,25 +1606,25 @@
     return out;
 }
 
-void mxio_chdir(mxio_t* io, const char* path) {
-    mtx_lock(&mxio_cwd_lock);
+void fdio_chdir(fdio_t* io, const char* path) {
+    mtx_lock(&fdio_cwd_lock);
     update_cwd_path(path);
-    mtx_lock(&mxio_lock);
-    mxio_t* old = mxio_cwd_handle;
-    mxio_cwd_handle = io;
+    mtx_lock(&fdio_lock);
+    fdio_t* old = fdio_cwd_handle;
+    fdio_cwd_handle = io;
     old->ops->close(old);
-    mxio_release(old);
-    mtx_unlock(&mxio_lock);
-    mtx_unlock(&mxio_cwd_lock);
+    fdio_release(old);
+    mtx_unlock(&fdio_lock);
+    mtx_unlock(&fdio_cwd_lock);
 }
 
 int chdir(const char* path) {
-    mxio_t* io;
-    mx_status_t r;
-    if ((r = __mxio_open(&io, path, O_RDONLY | O_DIRECTORY, 0)) < 0) {
+    fdio_t* io;
+    zx_status_t r;
+    if ((r = __fdio_open(&io, path, O_RDONLY | O_DIRECTORY, 0)) < 0) {
         return STATUS(r);
     }
-    mxio_chdir(io, path);
+    fdio_chdir(io, path);
     return 0;
 }
 
@@ -1666,8 +1666,8 @@
 
 DIR* fdopendir(int fd) {
     // Check the fd for validity, but we'll just store the fd
-    // number so we don't save the mxio_t pointer.
-    mxio_t* io = fd_to_io(fd);
+    // number so we don't save the fdio_t pointer.
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         errno = EBADF;
         return NULL;
@@ -1675,7 +1675,7 @@
     // TODO(mcgrathr): Technically this should verify that it's
     // really a directory and fail with ENOTDIR if not.  But
     // that's not so easy to do, so don't bother for now.
-    mxio_release(io);
+    fdio_release(io);
     return internal_opendir(fd);
 }
 
@@ -1735,7 +1735,7 @@
 }
 
 int isatty(int fd) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         errno = EBADF;
         return 0;
@@ -1752,44 +1752,44 @@
         errno = ENOTTY;
     }
 
-    mxio_release(io);
+    fdio_release(io);
 
     return ret;
 }
 
 mode_t umask(mode_t mask) {
     mode_t oldmask;
-    mtx_lock(&mxio_lock);
-    oldmask = __mxio_global_state.umask;
-    __mxio_global_state.umask = mask & 0777;
-    mtx_unlock(&mxio_lock);
+    mtx_lock(&fdio_lock);
+    oldmask = __fdio_global_state.umask;
+    __fdio_global_state.umask = mask & 0777;
+    mtx_unlock(&fdio_lock);
     return oldmask;
 }
 
-int mxio_handle_fd(mx_handle_t h, mx_signals_t signals_in, mx_signals_t signals_out,
+int fdio_handle_fd(zx_handle_t h, zx_signals_t signals_in, zx_signals_t signals_out,
                    bool shared_handle) {
-    mxio_t* io = mxio_waitable_create(h, signals_in, signals_out, shared_handle);
-    int fd = mxio_bind_to_fd(io, -1, 0);
+    fdio_t* io = fdio_waitable_create(h, signals_in, signals_out, shared_handle);
+    int fd = fdio_bind_to_fd(io, -1, 0);
     if (fd < 0) {
-        mxio_close(io);
-        mxio_release(io);
+        fdio_close(io);
+        fdio_release(io);
     }
     return fd;
 }
 
-// from mxio/private.h, to support message-loop integration
+// from fdio/private.h, to support message-loop integration
 
-void __mxio_wait_begin(mxio_t* io, uint32_t events,
-                       mx_handle_t* handle_out, mx_signals_t* signals_out) {
+void __fdio_wait_begin(fdio_t* io, uint32_t events,
+                       zx_handle_t* handle_out, zx_signals_t* signals_out) {
     return io->ops->wait_begin(io, events, handle_out, signals_out);
 }
 
-void __mxio_wait_end(mxio_t* io, mx_signals_t signals, uint32_t* events_out) {
+void __fdio_wait_end(fdio_t* io, zx_signals_t signals, uint32_t* events_out) {
     return io->ops->wait_end(io, signals, events_out);
 }
 
-void __mxio_release(mxio_t* io) {
-    mxio_release(io);
+void __fdio_release(fdio_t* io) {
+    fdio_release(io);
 }
 
 
@@ -1801,13 +1801,13 @@
         return ERRNO(EINVAL);
     }
 
-    mxio_t* ios[n];
+    fdio_t* ios[n];
     int ios_used_max = -1;
 
-    mx_status_t r = MX_OK;
+    zx_status_t r = ZX_OK;
     nfds_t nvalid = 0;
 
-    mx_wait_item_t items[n];
+    zx_wait_item_t items[n];
 
     for (nfds_t i = 0; i < n; i++) {
         struct pollfd* pfd = &fds[i];
@@ -1818,7 +1818,7 @@
             // if fd is negative, the entry is invalid
             continue;
         }
-        mxio_t* io;
+        fdio_t* io;
         if ((io = fd_to_io(pfd->fd)) == NULL) {
             // fd is not opened
             pfd->revents = POLLNVAL;
@@ -1827,12 +1827,12 @@
         ios[i] = io;
         ios_used_max = i;
 
-        mx_handle_t h;
-        mx_signals_t sigs;
+        zx_handle_t h;
+        zx_signals_t sigs;
         io->ops->wait_begin(io, pfd->events, &h, &sigs);
-        if (h == MX_HANDLE_INVALID) {
+        if (h == ZX_HANDLE_INVALID) {
             // wait operation is not applicable to the handle
-            r = MX_ERR_INVALID_ARGS;
+            r = ZX_ERR_INVALID_ARGS;
             break;
         }
         items[nvalid].handle = h;
@@ -1842,16 +1842,16 @@
     }
 
     int nfds = 0;
-    if (r == MX_OK && nvalid > 0) {
-        mx_time_t tmo = (timeout >= 0) ? mx_deadline_after(MX_MSEC(timeout)) : MX_TIME_INFINITE;
-        r = mx_object_wait_many(items, nvalid, tmo);
-        // pending signals could be reported on MX_ERR_TIMED_OUT case as well
-        if (r == MX_OK || r == MX_ERR_TIMED_OUT) {
+    if (r == ZX_OK && nvalid > 0) {
+        zx_time_t tmo = (timeout >= 0) ? zx_deadline_after(ZX_MSEC(timeout)) : ZX_TIME_INFINITE;
+        r = zx_object_wait_many(items, nvalid, tmo);
+        // pending signals could be reported on ZX_ERR_TIMED_OUT case as well
+        if (r == ZX_OK || r == ZX_ERR_TIMED_OUT) {
             nfds_t j = 0; // j counts up on a valid entry
 
             for (nfds_t i = 0; i < n; i++) {
                 struct pollfd* pfd = &fds[i];
-                mxio_t* io = ios[i];
+                fdio_t* io = ios[i];
 
                 if (io == NULL) {
                     // skip an invalid entry
@@ -1873,11 +1873,11 @@
 
     for (int i = 0; i <= ios_used_max; i++) {
         if (ios[i]) {
-            mxio_release(ios[i]);
+            fdio_release(ios[i]);
         }
     }
 
-    return (r == MX_OK || r == MX_ERR_TIMED_OUT) ? nfds : ERROR(r);
+    return (r == ZX_OK || r == ZX_ERR_TIMED_OUT) ? nfds : ERROR(r);
 }
 
 int select(int n, fd_set* restrict rfds, fd_set* restrict wfds, fd_set* restrict efds,
@@ -1886,13 +1886,13 @@
         return ERRNO(EINVAL);
     }
 
-    mxio_t* ios[n];
+    fdio_t* ios[n];
     int ios_used_max = -1;
 
-    mx_status_t r = MX_OK;
+    zx_status_t r = ZX_OK;
     int nvalid = 0;
 
-    mx_wait_item_t items[n];
+    zx_wait_item_t items[n];
 
     for (int fd = 0; fd < n; fd++) {
         ios[fd] = NULL;
@@ -1908,19 +1908,19 @@
             continue;
         }
 
-        mxio_t* io;
+        fdio_t* io;
         if ((io = fd_to_io(fd)) == NULL) {
-            r = MX_ERR_BAD_HANDLE;
+            r = ZX_ERR_BAD_HANDLE;
             break;
         }
         ios[fd] = io;
         ios_used_max = fd;
 
-        mx_handle_t h;
-        mx_signals_t sigs;
+        zx_handle_t h;
+        zx_signals_t sigs;
         io->ops->wait_begin(io, events, &h, &sigs);
-        if (h == MX_HANDLE_INVALID) {
-            r = MX_ERR_INVALID_ARGS;
+        if (h == ZX_HANDLE_INVALID) {
+            r = ZX_ERR_INVALID_ARGS;
             break;
         }
         items[nvalid].handle = h;
@@ -1930,16 +1930,16 @@
     }
 
     int nfds = 0;
-    if (r == MX_OK && nvalid > 0) {
-        mx_time_t tmo = (tv == NULL) ? MX_TIME_INFINITE :
-            mx_deadline_after(MX_SEC(tv->tv_sec) + MX_USEC(tv->tv_usec));
-        r = mx_object_wait_many(items, nvalid, tmo);
-        // pending signals could be reported on MX_ERR_TIMED_OUT case as well
-        if (r == MX_OK || r == MX_ERR_TIMED_OUT) {
+    if (r == ZX_OK && nvalid > 0) {
+        zx_time_t tmo = (tv == NULL) ? ZX_TIME_INFINITE :
+            zx_deadline_after(ZX_SEC(tv->tv_sec) + ZX_USEC(tv->tv_usec));
+        r = zx_object_wait_many(items, nvalid, tmo);
+        // pending signals could be reported on ZX_ERR_TIMED_OUT case as well
+        if (r == ZX_OK || r == ZX_ERR_TIMED_OUT) {
             int j = 0; // j counts up on a valid entry
 
             for (int fd = 0; fd < n; fd++) {
-                mxio_t* io = ios[fd];
+                fdio_t* io = ios[fd];
                 if (io == NULL) {
                     // skip an invalid entry
                     continue;
@@ -1986,15 +1986,15 @@
 
     for (int i = 0; i <= ios_used_max; i++) {
         if (ios[i]) {
-            mxio_release(ios[i]);
+            fdio_release(ios[i]);
         }
     }
 
-    return (r == MX_OK || r == MX_ERR_TIMED_OUT) ? nfds : ERROR(r);
+    return (r == ZX_OK || r == ZX_ERR_TIMED_OUT) ? nfds : ERROR(r);
 }
 
 int ioctl(int fd, int req, ...) {
-    mxio_t* io;
+    fdio_t* io;
     if ((io = fd_to_io(fd)) == NULL) {
         return ERRNO(EBADF);
     }
@@ -2002,22 +2002,22 @@
     va_start(ap, req);
     ssize_t r = io->ops->posix_ioctl(io, req, ap);
     va_end(ap);
-    mxio_release(io);
+    fdio_release(io);
     return STATUS(r);
 }
 
 ssize_t sendto(int fd, const void* buf, size_t buflen, int flags, const struct sockaddr* addr, socklen_t addrlen) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
     ssize_t r = io->ops->sendto(io, buf, buflen, flags, addr, addrlen);
-    mxio_release(io);
+    fdio_release(io);
     return r < 0 ? STATUS(r) : r;
 }
 
 ssize_t recvfrom(int fd, void* restrict buf, size_t buflen, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
@@ -2025,41 +2025,41 @@
         return ERRNO(EFAULT);
     }
     ssize_t r = io->ops->recvfrom(io, buf, buflen, flags, addr, addrlen);
-    mxio_release(io);
+    fdio_release(io);
     return r < 0 ? STATUS(r) : r;
 }
 
 ssize_t sendmsg(int fd, const struct msghdr *msg, int flags) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
     ssize_t r = io->ops->sendmsg(io, msg, flags);
-    mxio_release(io);
+    fdio_release(io);
     return r < 0 ? STATUS(r) : r;
 }
 
 ssize_t recvmsg(int fd, struct msghdr* msg, int flags) {
-    mxio_t* io = fd_to_io(fd);
+    fdio_t* io = fd_to_io(fd);
     if (io == NULL) {
         return ERRNO(EBADF);
     }
     ssize_t r = io->ops->recvmsg(io, msg, flags);
-    mxio_release(io);
+    fdio_release(io);
     return r < 0 ? STATUS(r) : r;
 }
 
 int shutdown(int fd, int how) {
-    mxio_t* io;
+    fdio_t* io;
     if ((io = fd_to_io(fd)) == NULL) {
         return ERRNO(EBADF);
     }
-    mx_status_t r = io->ops->shutdown(io, how);
-    mxio_release(io);
-    if (r == MX_ERR_BAD_STATE) {
+    zx_status_t r = io->ops->shutdown(io, how);
+    fdio_release(io);
+    if (r == ZX_ERR_BAD_STATE) {
         return ERRNO(ENOTCONN);
     }
-    if (r == MX_ERR_WRONG_TYPE) {
+    if (r == ZX_ERR_WRONG_TYPE) {
         return ERRNO(ENOTSOCK);
     }
     return STATUS(r);
diff --git a/system/ulib/mxio/unistd.h b/system/ulib/fdio/unistd.h
similarity index 61%
rename from system/ulib/mxio/unistd.h
rename to system/ulib/fdio/unistd.h
index 3ffac2e..4d48707 100644
--- a/system/ulib/mxio/unistd.h
+++ b/system/ulib/fdio/unistd.h
@@ -5,7 +5,7 @@
 #pragma once
 
 #include <errno.h>
-#include <mxio/io.h>
+#include <fdio/io.h>
 #include <limits.h>
 #include <stdbool.h>
 #include <sys/types.h>
@@ -13,26 +13,26 @@
 
 #include "private.h"
 
-mxio_t* __mxio_fd_to_io(int fd);
+fdio_t* __fdio_fd_to_io(int fd);
 
-#define fd_to_io(n) __mxio_fd_to_io(n)
+#define fd_to_io(n) __fdio_fd_to_io(n)
 
-mx_status_t __mxio_open_at(mxio_t** io, int dirfd, const char* path, int flags, uint32_t mode);
-mx_status_t __mxio_open(mxio_t** io, const char* path, int flags, uint32_t mode);
+zx_status_t __fdio_open_at(fdio_t** io, int dirfd, const char* path, int flags, uint32_t mode);
+zx_status_t __fdio_open(fdio_t** io, const char* path, int flags, uint32_t mode);
 
-int mxio_status_to_errno(mx_status_t status);
+int fdio_status_to_errno(zx_status_t status);
 
 // set errno to the closest match for error and return -1
-static inline int ERROR(mx_status_t error) {
-    errno = mxio_status_to_errno(error);
+static inline int ERROR(zx_status_t error) {
+    errno = fdio_status_to_errno(error);
     return -1;
 }
 
 // if status is negative, set errno as appropriate and return -1
 // otherwise return status
-static inline int STATUS(mx_status_t status) {
+static inline int STATUS(zx_status_t status) {
     if (status < 0) {
-        errno = mxio_status_to_errno(status);
+        errno = fdio_status_to_errno(status);
         return -1;
     } else {
         return status;
diff --git a/system/ulib/fdio/vmofile.c b/system/ulib/fdio/vmofile.c
new file mode 100644
index 0000000..bc9af7b
--- /dev/null
+++ b/system/ulib/fdio/vmofile.c
@@ -0,0 +1,250 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <fcntl.h>
+#include <stdatomic.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <threads.h>
+
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/io.h>
+#include <fdio/util.h>
+
+#include <fdio/remoteio.h>
+#include <fdio/vfs.h>
+
+#include "private.h"
+
+typedef struct vmofile {
+    fdio_t io;
+    zx_handle_t vmo;
+    zx_off_t off;
+    zx_off_t end;
+    zx_off_t ptr;
+    mtx_t lock;
+} vmofile_t;
+
+static ssize_t vmofile_read(fdio_t* io, void* data, size_t len) {
+    vmofile_t* vf = (vmofile_t*)io;
+    zx_off_t at;
+
+    mtx_lock(&vf->lock);
+    if (len > (vf->end - vf->ptr)) {
+        len = vf->end - vf->ptr;
+    }
+    at = vf->ptr;
+    vf->ptr += len;
+    mtx_unlock(&vf->lock);
+
+    zx_status_t status = zx_vmo_read(vf->vmo, data, at, len, &len);
+    if (status < 0) {
+        return status;
+    } else {
+        return len;
+    }
+}
+
+static ssize_t vmofile_read_at(fdio_t* io, void* data, size_t len, off_t at) {
+    vmofile_t* vf = (vmofile_t*)io;
+
+    // make sure we're within the file's bounds
+    if (at > (off_t)(vf->end - vf->off)) {
+        return ZX_ERR_INVALID_ARGS;
+    }
+
+    // adjust to vmo offset
+    at += vf->off;
+
+    // clip length to file bounds
+    if (len > (vf->end - at)) {
+        len = vf->end - at;
+    }
+
+    zx_status_t status = zx_vmo_read(vf->vmo, data, at, len, &len);
+    if (status < 0) {
+        return status;
+    } else {
+        return len;
+    }
+}
+
+static ssize_t vmofile_write_at(fdio_t* io, const void* data, size_t len, off_t at) {
+    return ZX_ERR_NOT_SUPPORTED;
+}
+
+static off_t vmofile_seek(fdio_t* io, off_t offset, int whence) {
+    vmofile_t* vf = (vmofile_t*)io;
+    mtx_lock(&vf->lock);
+    zx_off_t at;
+    switch (whence) {
+    case SEEK_SET:
+        at = offset;
+        break;
+    case SEEK_CUR:
+        at = (vf->ptr - vf->off) + offset;
+        break;
+    case SEEK_END:
+        at = (vf->end - vf->off) + offset;
+        break;
+    default:
+        mtx_unlock(&vf->lock);
+        return ZX_ERR_INVALID_ARGS;
+    }
+    if (at > (vf->end - vf->off)) {
+        at = ZX_ERR_OUT_OF_RANGE;
+    } else {
+        vf->ptr = vf->off + at;
+    }
+    mtx_unlock(&vf->lock);
+    return at;
+}
+
+static zx_status_t vmofile_close(fdio_t* io) {
+    vmofile_t* vf = (vmofile_t*)io;
+    zx_handle_t h = vf->vmo;
+    vf->vmo = 0;
+    zx_handle_close(h);
+    return 0;
+}
+
+static void vmofile_release(fdio_t* io) {
+    vmofile_t* vf = (vmofile_t*)io;
+    zx_handle_close(vf->vmo);
+    free(io);
+}
+
+static zx_status_t vmofile_misc(fdio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* ptr, size_t len) {
+    vmofile_t* vf = (vmofile_t*)io;
+    switch (op) {
+    case ZXRIO_STAT: {
+        vnattr_t attr;
+        memset(&attr, 0, sizeof(attr));
+        attr.size = vf->end - vf->off;
+        attr.mode = V_TYPE_FILE | V_IRUSR;
+        if (maxreply < sizeof(attr)) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        memcpy(ptr, &attr, sizeof(attr));
+        return sizeof(attr);
+    }
+    case ZXRIO_MMAP: {
+        if (len != sizeof(zxrio_mmap_data_t) || maxreply < sizeof(zxrio_mmap_data_t)) {
+            return ZX_ERR_INVALID_ARGS;
+        }
+        zxrio_mmap_data_t* data = ptr;
+        zx_rights_t rights = ZX_RIGHT_TRANSFER | ZX_RIGHT_MAP |
+                             ZX_RIGHT_DUPLICATE | ZX_RIGHT_GET_PROPERTY;
+        if (data->flags & FDIO_MMAP_FLAG_WRITE) {
+            return ZX_ERR_ACCESS_DENIED;
+        }
+        rights |= (data->flags & FDIO_MMAP_FLAG_READ) ? ZX_RIGHT_READ : 0;
+        rights |= (data->flags & FDIO_MMAP_FLAG_EXEC) ? ZX_RIGHT_EXECUTE : 0;
+
+        // Make a tiny clone of the portion of the portion of the VMO representing this file
+        zx_handle_t h;
+        // TODO(smklein): In the future, "vf->vmo" will already be a cloned vmo
+        // representing this file (logically, making "vf->off" always zero), and
+        // nothing past "vf->end". As a consequence, we will be able to
+        // duplicate "vf->vmo" instead of cloning it.
+        zx_status_t status = zx_vmo_clone(vf->vmo, ZX_VMO_CLONE_COPY_ON_WRITE,
+                                          vf->off, vf->end - vf->off, &h);
+        if (status != ZX_OK) {
+            return status;
+        }
+        // Only return this clone with the requested rights
+        zx_handle_t out;
+        if ((status = zx_handle_replace(h, rights, &out)) != ZX_OK) {
+            zx_handle_close(h);
+            return status;
+        }
+        return out;
+    }
+    case ZXRIO_FCNTL: {
+        uint32_t cmd = maxreply;
+        switch (cmd) {
+        case F_GETFL: {
+            uint32_t* flags = (uint32_t*) ptr;
+            if (flags) {
+                *flags = 0;
+            }
+        }
+        case F_SETFL:
+            return ZX_OK;
+        default:
+            return ZX_ERR_NOT_SUPPORTED;
+        }
+    }
+    default:
+        return ZX_ERR_INVALID_ARGS;
+    }
+}
+
+zx_status_t vmofile_get_vmo(fdio_t* io, zx_handle_t* out, size_t* off, size_t* len) {
+    vmofile_t* vf = (vmofile_t*)io;
+
+    if ((out == NULL) || (off == NULL) || (len == NULL)) {
+        return ZX_ERR_INVALID_ARGS;
+    }
+
+    *off = vf->off;
+    *len = vf->end - vf->off;
+    return zx_handle_duplicate(vf->vmo, ZX_RIGHT_SAME_RIGHTS, out);
+}
+
+static fdio_ops_t vmofile_ops = {
+    .read = vmofile_read,
+    .read_at = vmofile_read_at,
+    .write = fdio_default_write,
+    .write_at = vmofile_write_at,
+    .recvfrom = fdio_default_recvfrom,
+    .sendto = fdio_default_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
+    .seek = vmofile_seek,
+    .misc = vmofile_misc,
+    .close = vmofile_close,
+    .open = fdio_default_open,
+    .clone = fdio_default_clone,
+    .ioctl = fdio_default_ioctl,
+    .wait_begin = fdio_default_wait_begin,
+    .wait_end = fdio_default_wait_end,
+    .unwrap = fdio_default_unwrap,
+    .shutdown = fdio_default_shutdown,
+    .posix_ioctl = fdio_default_posix_ioctl,
+    .get_vmo = vmofile_get_vmo,
+};
+
+fdio_t* fdio_vmofile_create(zx_handle_t h, zx_off_t off, zx_off_t len) {
+    vmofile_t* vf = calloc(1, sizeof(vmofile_t));
+    if (vf == NULL) {
+        zx_handle_close(h);
+        return NULL;
+    }
+    vf->io.ops = &vmofile_ops;
+    vf->io.magic = FDIO_MAGIC;
+    atomic_init(&vf->io.refcount, 1);
+    vf->vmo = h;
+    vf->off = off;
+    vf->end = off + len;
+    vf->ptr = off;
+    mtx_init(&vf->lock, mtx_plain);
+    return &vf->io;
+}
+
+int fdio_vmo_fd(zx_handle_t vmo, uint64_t offset, uint64_t length) {
+    fdio_t* io;
+    int fd;
+    if ((io = fdio_vmofile_create(vmo, offset, length)) == NULL) {
+        return -1;
+    }
+    if ((fd = fdio_bind_to_fd(io, -1, 0)) < 0) {
+        fdio_close(io);
+        fdio_release(io);
+        return -1;
+    }
+    return fd;
+}
diff --git a/system/ulib/fdio/waitable.c b/system/ulib/fdio/waitable.c
new file mode 100644
index 0000000..722b3d1
--- /dev/null
+++ b/system/ulib/fdio/waitable.c
@@ -0,0 +1,108 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <poll.h>
+#include <stdbool.h>
+#include <stdlib.h>
+
+#include <zircon/syscalls.h>
+#include <fdio/io.h>
+
+#include "private.h"
+
+typedef struct mxwio mxwio_t;
+struct mxwio {
+    // base fdio io object
+    fdio_t io;
+
+    // arbitrary handle
+    zx_handle_t h;
+
+    // signals that cause POLLIN
+    zx_signals_t signals_in;
+
+    // signals that cause POLLOUT
+    zx_signals_t signals_out;
+
+    // if true, don't close handle on close() op
+    bool shared_handle;
+};
+
+static zx_status_t mxwio_close(fdio_t* io) {
+    mxwio_t* wio = (mxwio_t*)io;
+    zx_handle_t h = wio->h;
+    wio->h = ZX_HANDLE_INVALID;
+    if (!wio->shared_handle) {
+        zx_handle_close(h);
+    }
+    return ZX_OK;
+}
+
+static void mxwio_wait_begin(fdio_t* io, uint32_t events, zx_handle_t* handle,
+                             zx_signals_t* _signals) {
+    mxwio_t* wio = (void*)io;
+    *handle = wio->h;
+    zx_signals_t signals = 0;
+    if (events & POLLIN) {
+        signals |= wio->signals_in;
+    }
+    if (events & POLLOUT) {
+        signals |= wio->signals_out;
+    }
+    *_signals = signals;
+}
+
+static void mxwio_wait_end(fdio_t* io, zx_signals_t signals, uint32_t* _events) {
+    mxwio_t* wio = (void*)io;
+    uint32_t events = 0;
+    if (signals & wio->signals_in) {
+        events |= POLLIN;
+    }
+    if (signals & wio->signals_out) {
+        events |= POLLOUT;
+    }
+    *_events = events;
+}
+
+static fdio_ops_t fdio_waitable_ops = {
+    .read = fdio_default_read,
+    .read_at = fdio_default_read_at,
+    .write = fdio_default_write,
+    .write_at = fdio_default_write_at,
+    .recvfrom = fdio_default_recvfrom,
+    .sendto = fdio_default_sendto,
+    .recvmsg = fdio_default_recvmsg,
+    .sendmsg = fdio_default_sendmsg,
+    .seek = fdio_default_seek,
+    .misc = fdio_default_misc,
+    .close = mxwio_close,
+    .open = fdio_default_open,
+    .clone = fdio_default_clone,
+    .ioctl = fdio_default_ioctl,
+    .unwrap = fdio_default_unwrap,
+    .shutdown = fdio_default_shutdown,
+    .wait_begin = mxwio_wait_begin,
+    .wait_end = mxwio_wait_end,
+    .posix_ioctl = fdio_default_posix_ioctl,
+};
+
+fdio_t* fdio_waitable_create(zx_handle_t h, zx_signals_t signals_in,
+                             zx_signals_t signals_out, bool shared_handle) {
+    mxwio_t* wio = calloc(1, sizeof(*wio));
+    if (wio == NULL) {
+        if (!shared_handle) {
+            zx_handle_close(h);
+        }
+        return NULL;
+    }
+    wio->io.ops = &fdio_waitable_ops;
+    wio->io.magic = FDIO_MAGIC;
+    wio->io.refcount = 1;
+    wio->io.flags |= FDIO_FLAG_WAITABLE;
+    wio->h = h;
+    wio->signals_in = signals_in;
+    wio->signals_out = signals_out;
+    wio->shared_handle = shared_handle;
+    return &wio->io;
+}
diff --git a/system/ulib/mxio/watcher.c b/system/ulib/fdio/watcher.c
similarity index 61%
rename from system/ulib/mxio/watcher.c
rename to system/ulib/fdio/watcher.c
index b72be80..59cb4c5 100644
--- a/system/ulib/mxio/watcher.c
+++ b/system/ulib/fdio/watcher.c
@@ -8,23 +8,23 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <magenta/device/vfs.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <zircon/device/vfs.h>
 
-#include <mxio/watcher.h>
+#include <fdio/watcher.h>
 
-typedef struct mxio_watcher {
-    mx_handle_t h;
+typedef struct fdio_watcher {
+    zx_handle_t h;
     watchdir_func_t func;
     void* cookie;
     int fd;
-} mxio_watcher_t;
+} fdio_watcher_t;
 
-mx_status_t mxio_watcher_create(int dirfd, mxio_watcher_t** out) {
-    mxio_watcher_t* watcher;
-    if ((watcher = malloc(sizeof(mxio_watcher_t))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+zx_status_t fdio_watcher_create(int dirfd, fdio_watcher_t** out) {
+    fdio_watcher_t* watcher;
+    if ((watcher = malloc(sizeof(fdio_watcher_t))) == NULL) {
+        return ZX_ERR_NO_MEMORY;
     }
 
     // Try V2 Protocol First
@@ -32,25 +32,25 @@
         .mask = VFS_WATCH_MASK_ALL,
         .options = 0,
     };
-    if (mx_channel_create(0, &wd.channel, &watcher->h) < 0) {
+    if (zx_channel_create(0, &wd.channel, &watcher->h) < 0) {
         free(watcher);
-        return MX_ERR_NO_RESOURCES;
+        return ZX_ERR_NO_RESOURCES;
     }
     ssize_t r;
     if ((r = ioctl_vfs_watch_dir(dirfd, &wd)) < 0) {
         //TODO: if MASK_EXISTING was rejected, set NEED_DIR_SCAN and try without
-        mx_handle_close(wd.channel);
-        mx_handle_close(watcher->h);
+        zx_handle_close(wd.channel);
+        zx_handle_close(watcher->h);
         return r;
     }
 
     *out = watcher;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // watcher process expects the msg buffer to be len + 1 in length
 // as it drops temporary nuls in it while dispatching
-static mx_status_t mxio_watcher_process(mxio_watcher_t* w, uint8_t* msg, size_t len) {
+static zx_status_t fdio_watcher_process(fdio_watcher_t* w, uint8_t* msg, size_t len) {
     // Message Format: { OP, LEN, DATA[LEN] }
     while (len >= 2) {
         unsigned event = *msg++;
@@ -79,8 +79,8 @@
         uint8_t tmp = msg[namelen];
         msg[namelen] = 0;
 
-        mx_status_t status;
-        if ((status = w->func(w->fd, event, (char*) msg, w->cookie)) != MX_OK) {
+        zx_status_t status;
+        if ((status = w->func(w->fd, event, (char*) msg, w->cookie)) != ZX_OK) {
             return status;
         }
         msg[namelen] = tmp;
@@ -88,51 +88,51 @@
         msg += namelen;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t mxio_watcher_loop(mxio_watcher_t* w, mx_time_t deadline) {
+static zx_status_t fdio_watcher_loop(fdio_watcher_t* w, zx_time_t deadline) {
     for (;;) {
         // extra byte for watcher process use
         uint8_t msg[VFS_WATCH_MSG_MAX + 1];
         uint32_t sz = VFS_WATCH_MSG_MAX;
-        mx_status_t status;
-        if ((status = mx_channel_read(w->h, 0, msg, NULL, sz, 0, &sz, NULL)) < 0) {
-            if (status != MX_ERR_SHOULD_WAIT) {
+        zx_status_t status;
+        if ((status = zx_channel_read(w->h, 0, msg, NULL, sz, 0, &sz, NULL)) < 0) {
+            if (status != ZX_ERR_SHOULD_WAIT) {
                 return status;
             }
-            if ((status = mx_object_wait_one(w->h, MX_CHANNEL_READABLE |
-                                             MX_CHANNEL_PEER_CLOSED,
+            if ((status = zx_object_wait_one(w->h, ZX_CHANNEL_READABLE |
+                                             ZX_CHANNEL_PEER_CLOSED,
                                              deadline, NULL)) < 0) {
                 return status;
             }
             continue;
         }
 
-        if ((status = mxio_watcher_process(w, msg, sz)) != MX_OK) {
+        if ((status = fdio_watcher_process(w, msg, sz)) != ZX_OK) {
             return status;
         }
     }
 }
 
-void mxio_watcher_destroy(mxio_watcher_t* watcher) {
-    mx_handle_close(watcher->h);
+void fdio_watcher_destroy(fdio_watcher_t* watcher) {
+    zx_handle_close(watcher->h);
     free(watcher);
 }
 
-mx_status_t mxio_watch_directory(int dirfd, watchdir_func_t cb, mx_time_t deadline, void *cookie) {
-    mxio_watcher_t* watcher;
+zx_status_t fdio_watch_directory(int dirfd, watchdir_func_t cb, zx_time_t deadline, void *cookie) {
+    fdio_watcher_t* watcher;
 
-    mx_status_t status;
-    if ((status = mxio_watcher_create(dirfd, &watcher)) < 0) {
+    zx_status_t status;
+    if ((status = fdio_watcher_create(dirfd, &watcher)) < 0) {
         return status;
     }
 
     watcher->func = cb;
     watcher->cookie = cookie;
     watcher->fd = dirfd;
-    status = mxio_watcher_loop(watcher, deadline);
+    status = fdio_watcher_loop(watcher, deadline);
 
-    mxio_watcher_destroy(watcher);
+    fdio_watcher_destroy(watcher);
     return status;
 }
diff --git a/system/ulib/fs-management/fsck.c b/system/ulib/fs-management/fsck.c
index ea9883d..9b508f0 100644
--- a/system/ulib/fs-management/fsck.c
+++ b/system/ulib/fs-management/fsck.c
@@ -9,28 +9,28 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/device/vfs.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/limits.h>
-#include <mxio/util.h>
-#include <mxio/vfs.h>
+#include <zircon/compiler.h>
+#include <zircon/device/vfs.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/limits.h>
+#include <fdio/util.h>
+#include <fdio/vfs.h>
 
-static mx_status_t fsck_mxfs(const char* devicepath, const fsck_options_t* options,
+static zx_status_t fsck_mxfs(const char* devicepath, const fsck_options_t* options,
                               LaunchCallback cb, const char* cmdpath) {
-    mx_handle_t hnd[MXIO_MAX_HANDLES * 2];
-    uint32_t ids[MXIO_MAX_HANDLES * 2];
+    zx_handle_t hnd[FDIO_MAX_HANDLES * 2];
+    uint32_t ids[FDIO_MAX_HANDLES * 2];
     size_t n = 0;
     int device_fd;
     if ((device_fd = open(devicepath, O_RDWR)) < 0) {
         fprintf(stderr, "Failed to open device\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
-    mx_status_t status;
-    if ((status = mxio_transfer_fd(device_fd, FS_FD_BLOCKDEVICE, hnd + n, ids + n)) <= 0) {
+    zx_status_t status;
+    if ((status = fdio_transfer_fd(device_fd, FS_FD_BLOCKDEVICE, hnd + n, ids + n)) <= 0) {
         fprintf(stderr, "Failed to access device handle\n");
-        return status != 0 ? status : MX_ERR_BAD_STATE;
+        return status != 0 ? status : ZX_ERR_BAD_STATE;
     }
     n += status;
 
@@ -48,7 +48,7 @@
     return status;
 }
 
-static mx_status_t fsck_fat(const char* devicepath, const fsck_options_t* options,
+static zx_status_t fsck_fat(const char* devicepath, const fsck_options_t* options,
                             LaunchCallback cb) {
     const char** argv = calloc(sizeof(char*), (2 + NUM_FSCK_OPTIONS));
     size_t argc = 0;
@@ -62,12 +62,12 @@
         argv[argc++] = "-f";
     }
     argv[argc++] = devicepath;
-    mx_status_t status = cb(argc, argv, NULL, NULL, 0);
+    zx_status_t status = cb(argc, argv, NULL, NULL, 0);
     free(argv);
     return status;
 }
 
-mx_status_t fsck(const char* devicepath, disk_format_t df,
+zx_status_t fsck(const char* devicepath, disk_format_t df,
                  const fsck_options_t* options, LaunchCallback cb) {
     switch (df) {
     case DISK_FORMAT_MINFS:
@@ -77,6 +77,6 @@
     case DISK_FORMAT_BLOBFS:
         return fsck_mxfs(devicepath, options, cb, "/boot/bin/blobstore");
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
diff --git a/system/ulib/fs-management/include/fs-management/mount.h b/system/ulib/fs-management/include/fs-management/mount.h
index 702b364..f8b4ada 100644
--- a/system/ulib/fs-management/include/fs-management/mount.h
+++ b/system/ulib/fs-management/include/fs-management/mount.h
@@ -8,8 +8,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
@@ -75,17 +75,17 @@
     .force = false,
 };
 
-typedef mx_status_t (*LaunchCallback)(int argc, const char** argv,
-                                      mx_handle_t* hnd, uint32_t* ids, size_t len);
+typedef zx_status_t (*LaunchCallback)(int argc, const char** argv,
+                                      zx_handle_t* hnd, uint32_t* ids, size_t len);
 
 // Creates kernel logs, does not wait for process to terminate
-mx_status_t launch_logs_async(int argc, const char** argv, mx_handle_t* handles,
+zx_status_t launch_logs_async(int argc, const char** argv, zx_handle_t* handles,
                               uint32_t* types, size_t len);
 // Creates stdio logs, waits for process to terminate
-mx_status_t launch_stdio_sync(int argc, const char** argv, mx_handle_t* handles,
+zx_status_t launch_stdio_sync(int argc, const char** argv, zx_handle_t* handles,
                               uint32_t* types, size_t len);
 // Creates stdio logs, does not wait for process to terminate
-mx_status_t launch_stdio_async(int argc, const char** argv, mx_handle_t* handles,
+zx_status_t launch_stdio_async(int argc, const char** argv, zx_handle_t* handles,
                                uint32_t* types, size_t len);
 
 // Given the following:
@@ -100,29 +100,29 @@
 //
 // devicefd is always consumed. If the callback is reached, then the 'devicefd'
 // is transferred via handles to the callback arguments.
-mx_status_t mount(int devicefd, const char* mountpath, disk_format_t df,
+zx_status_t mount(int devicefd, const char* mountpath, disk_format_t df,
                   const mount_options_t* options, LaunchCallback cb);
 // 'mountfd' is used in lieu of the mountpath. It is not consumed (i.e.,
 // it will still be open after this function completes, regardless of
 // success or failure).
-mx_status_t fmount(int devicefd, int mountfd, disk_format_t df,
+zx_status_t fmount(int devicefd, int mountfd, disk_format_t df,
                    const mount_options_t* options, LaunchCallback cb);
 
 // Format the provided device with a requested disk format.
-mx_status_t mkfs(const char* devicepath, disk_format_t df, LaunchCallback cb,
+zx_status_t mkfs(const char* devicepath, disk_format_t df, LaunchCallback cb,
                  const mkfs_options_t* options);
 
 // Check and repair a device with a requested disk format.
-mx_status_t fsck(const char* devicepath, disk_format_t df,
+zx_status_t fsck(const char* devicepath, disk_format_t df,
                  const fsck_options_t* options, LaunchCallback cb);
 
 // Umount the filesystem process.
 //
-// Returns MX_ERR_BAD_STATE if mountpath could not be opened.
-// Returns MX_ERR_NOT_FOUND if there is no mounted filesystem on mountpath.
+// Returns ZX_ERR_BAD_STATE if mountpath could not be opened.
+// Returns ZX_ERR_NOT_FOUND if there is no mounted filesystem on mountpath.
 // Other errors may also be returned if problems occur while unmounting.
-mx_status_t umount(const char* mountpath);
+zx_status_t umount(const char* mountpath);
 // 'mountfd' is used in lieu of the mountpath. It is not consumed.
-mx_status_t fumount(int mountfd);
+zx_status_t fumount(int mountfd);
 
 __END_CDECLS
diff --git a/system/ulib/fs-management/include/fs-management/ramdisk.h b/system/ulib/fs-management/include/fs-management/ramdisk.h
index 7368252..3d73f5e 100644
--- a/system/ulib/fs-management/include/fs-management/ramdisk.h
+++ b/system/ulib/fs-management/include/fs-management/ramdisk.h
@@ -7,7 +7,7 @@
 #include <inttypes.h>
 #include <stdlib.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/system/ulib/fs-management/launch.c b/system/ulib/fs-management/launch.c
index 726daf3..499fc10 100644
--- a/system/ulib/fs-management/launch.c
+++ b/system/ulib/fs-management/launch.c
@@ -15,41 +15,41 @@
 #include <fs-management/mount.h>
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
-#include <magenta/compiler.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/io.h>
-#include <mxio/util.h>
+#include <zircon/compiler.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/io.h>
+#include <fdio/util.h>
 
 
-mx_status_t launch_logs_async(int argc, const char** argv, mx_handle_t* handles,
+zx_status_t launch_logs_async(int argc, const char** argv, zx_handle_t* handles,
                               uint32_t* types, size_t len) {
     launchpad_t* lp;
     launchpad_create(0, argv[0], &lp);
-    launchpad_clone(lp, LP_CLONE_ALL & (~LP_CLONE_MXIO_STDIO));
+    launchpad_clone(lp, LP_CLONE_ALL & (~LP_CLONE_FDIO_STDIO));
     launchpad_load_from_file(lp, argv[0]);
     launchpad_set_args(lp, argc, argv);
 
     for (size_t i = 0; i < len; i++) {
         launchpad_add_handle(lp, handles[i], types[i]);
     }
-    mx_handle_t h;
-    mx_log_create(0, &h);
-    if (h != MX_HANDLE_INVALID) {
-        launchpad_add_handle(lp, h, PA_HND(PA_MXIO_LOGGER,
-                                           0 | MXIO_FLAG_USE_FOR_STDIO));
+    zx_handle_t h;
+    zx_log_create(0, &h);
+    if (h != ZX_HANDLE_INVALID) {
+        launchpad_add_handle(lp, h, PA_HND(PA_FDIO_LOGGER,
+                                           0 | FDIO_FLAG_USE_FOR_STDIO));
     }
 
-    mx_status_t status;
+    zx_status_t status;
     const char* errmsg;
-    if ((status = launchpad_go(lp, NULL, &errmsg)) != MX_OK) {
+    if ((status = launchpad_go(lp, NULL, &errmsg)) != ZX_OK) {
         fprintf(stderr, "fs-management: Cannot launch %s: %d: %s\n", argv[0], status, errmsg);
     }
     return status;
 }
 
 static void init_stdio(launchpad_t** lp, int argc, const char** argv,
-                       mx_handle_t* handles, uint32_t* types, size_t len) {
+                       zx_handle_t* handles, uint32_t* types, size_t len) {
     launchpad_create(0, argv[0], lp);
     launchpad_clone(*lp, LP_CLONE_ALL);
     launchpad_load_from_file(*lp, argv[0]);
@@ -60,47 +60,47 @@
     }
 }
 
-mx_status_t launch_stdio_sync(int argc, const char** argv, mx_handle_t* handles,
+zx_status_t launch_stdio_sync(int argc, const char** argv, zx_handle_t* handles,
                               uint32_t* types, size_t len) {
     launchpad_t* lp;
     init_stdio(&lp, argc, argv, handles, types, len);
 
-    mx_status_t status;
-    mx_handle_t proc;
+    zx_status_t status;
+    zx_handle_t proc;
     const char* errmsg;
-    if ((status = launchpad_go(lp, &proc, &errmsg)) != MX_OK) {
+    if ((status = launchpad_go(lp, &proc, &errmsg)) != ZX_OK) {
         fprintf(stderr, "fs-management: Cannot launch %s: %d: %s\n", argv[0], status, errmsg);
         return status;
     }
 
-    status = mx_object_wait_one(proc, MX_PROCESS_TERMINATED, MX_TIME_INFINITE, NULL);
-    if (status != MX_OK) {
+    status = zx_object_wait_one(proc, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, NULL);
+    if (status != ZX_OK) {
         fprintf(stderr, "launch: Error waiting for process to terminate\n");
-        mx_handle_close(proc);
+        zx_handle_close(proc);
         return status;
     }
 
-    mx_info_process_t info;
-    if ((status = mx_object_get_info(proc, MX_INFO_PROCESS, &info, sizeof(info), NULL, NULL)) < 0) {
+    zx_info_process_t info;
+    if ((status = zx_object_get_info(proc, ZX_INFO_PROCESS, &info, sizeof(info), NULL, NULL)) < 0) {
         fprintf(stderr, "launch: Failed to get process info\n");
-        mx_handle_close(proc);
+        zx_handle_close(proc);
         return status;
     }
-    mx_handle_close(proc);
+    zx_handle_close(proc);
     if (!info.exited || info.return_code != 0) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t launch_stdio_async(int argc, const char** argv, mx_handle_t* handles,
+zx_status_t launch_stdio_async(int argc, const char** argv, zx_handle_t* handles,
                                uint32_t* types, size_t len) {
     launchpad_t* lp;
     init_stdio(&lp, argc, argv, handles, types, len);
 
-    mx_status_t status;
+    zx_status_t status;
     const char* errmsg;
-    if ((status = launchpad_go(lp, NULL, &errmsg)) != MX_OK) {
+    if ((status = launchpad_go(lp, NULL, &errmsg)) != ZX_OK) {
         fprintf(stderr, "fs-management: Cannot launch %s: %d: %s\n", argv[0], status, errmsg);
         return status;
     }
diff --git a/system/ulib/fs-management/mkfs.c b/system/ulib/fs-management/mkfs.c
index b341e13..c4bd122 100644
--- a/system/ulib/fs-management/mkfs.c
+++ b/system/ulib/fs-management/mkfs.c
@@ -9,28 +9,28 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/device/vfs.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/limits.h>
-#include <mxio/util.h>
-#include <mxio/vfs.h>
+#include <zircon/compiler.h>
+#include <zircon/device/vfs.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/limits.h>
+#include <fdio/util.h>
+#include <fdio/vfs.h>
 
-static mx_status_t mkfs_mxfs(const char* binary, const char* devicepath,
+static zx_status_t mkfs_mxfs(const char* binary, const char* devicepath,
                              LaunchCallback cb, const mkfs_options_t* options) {
-    mx_handle_t hnd[MXIO_MAX_HANDLES * 2];
-    uint32_t ids[MXIO_MAX_HANDLES * 2];
+    zx_handle_t hnd[FDIO_MAX_HANDLES * 2];
+    uint32_t ids[FDIO_MAX_HANDLES * 2];
     size_t n = 0;
     int device_fd;
     if ((device_fd = open(devicepath, O_RDWR)) < 0) {
         fprintf(stderr, "Failed to open device\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
-    mx_status_t status;
-    if ((status = mxio_transfer_fd(device_fd, FS_FD_BLOCKDEVICE, hnd + n, ids + n)) <= 0) {
+    zx_status_t status;
+    if ((status = fdio_transfer_fd(device_fd, FS_FD_BLOCKDEVICE, hnd + n, ids + n)) <= 0) {
         fprintf(stderr, "Failed to access device handle\n");
-        return status != 0 ? status : MX_ERR_BAD_STATE;
+        return status != 0 ? status : ZX_ERR_BAD_STATE;
     }
     n += status;
 
@@ -46,13 +46,13 @@
     return status;
 }
 
-static mx_status_t mkfs_fat(const char* devicepath, LaunchCallback cb,
+static zx_status_t mkfs_fat(const char* devicepath, LaunchCallback cb,
                             const mkfs_options_t* options) {
     const char* argv[] = {"/boot/bin/mkfs-msdosfs", devicepath};
     return cb(countof(argv), argv, NULL, NULL, 0);
 }
 
-mx_status_t mkfs(const char* devicepath, disk_format_t df, LaunchCallback cb,
+zx_status_t mkfs(const char* devicepath, disk_format_t df, LaunchCallback cb,
                  const mkfs_options_t* options) {
     switch (df) {
     case DISK_FORMAT_MINFS:
@@ -62,6 +62,6 @@
     case DISK_FORMAT_BLOBFS:
         return mkfs_mxfs("/boot/bin/blobstore", devicepath, cb, options);
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
diff --git a/system/ulib/fs-management/mount.c b/system/ulib/fs-management/mount.c
index 869746c..c7e5c27 100644
--- a/system/ulib/fs-management/mount.c
+++ b/system/ulib/fs-management/mount.c
@@ -10,13 +10,13 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/device/vfs.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/limits.h>
-#include <mxio/util.h>
-#include <mxio/vfs.h>
+#include <zircon/compiler.h>
+#include <zircon/device/vfs.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/limits.h>
+#include <fdio/util.h>
+#include <fdio/vfs.h>
 
 #define HEADER_SIZE 4096
 
@@ -69,11 +69,11 @@
 
 // Initializes 'hnd' and 'ids' with the root handle and block device handle.
 // Consumes devicefd.
-static mx_status_t mount_prepare_handles(int devicefd, mx_handle_t* mount_handle_out,
-                                         mx_handle_t* hnd, uint32_t* ids, size_t* n) {
-    mx_status_t status;
-    mx_handle_t mountee_handle;
-    if ((status = mx_channel_create(0, &mountee_handle, mount_handle_out)) != MX_OK) {
+static zx_status_t mount_prepare_handles(int devicefd, zx_handle_t* mount_handle_out,
+                                         zx_handle_t* hnd, uint32_t* ids, size_t* n) {
+    zx_status_t status;
+    zx_handle_t mountee_handle;
+    if ((status = zx_channel_create(0, &mountee_handle, mount_handle_out)) != ZX_OK) {
         close(devicefd);
         return status;
     }
@@ -81,15 +81,15 @@
     ids[*n] = PA_USER0;
     *n = *n + 1;
 
-    if ((status = mxio_transfer_fd(devicefd, FS_FD_BLOCKDEVICE, hnd + *n, ids + *n)) <= 0) {
+    if ((status = fdio_transfer_fd(devicefd, FS_FD_BLOCKDEVICE, hnd + *n, ids + *n)) <= 0) {
         fprintf(stderr, "Failed to access device handle\n");
-        mx_handle_close(mountee_handle);
-        mx_handle_close(*mount_handle_out);
+        zx_handle_close(mountee_handle);
+        zx_handle_close(*mount_handle_out);
         close(devicefd);
-        return status != 0 ? status : MX_ERR_BAD_STATE;
+        return status != 0 ? status : ZX_ERR_BAD_STATE;
     }
     *n = *n + status;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Describes the mountpoint of the to-be-mounted root,
@@ -103,21 +103,21 @@
 } mountpoint_t;
 
 // Calls the 'launch callback' and mounts the remote handle to the target vnode, if successful.
-static mx_status_t launch_and_mount(LaunchCallback cb, const mount_options_t* options,
-                                    const char** argv, int argc, mx_handle_t* hnd,
-                                    uint32_t* ids, size_t n, mountpoint_t* mp, mx_handle_t root) {
-    mx_status_t status;
-    if ((status = cb(argc, argv, hnd, ids, n)) != MX_OK) {
+static zx_status_t launch_and_mount(LaunchCallback cb, const mount_options_t* options,
+                                    const char** argv, int argc, zx_handle_t* hnd,
+                                    uint32_t* ids, size_t n, mountpoint_t* mp, zx_handle_t root) {
+    zx_status_t status;
+    if ((status = cb(argc, argv, hnd, ids, n)) != ZX_OK) {
         goto fail;
     }
 
     if (options->wait_until_ready) {
         // Wait until the filesystem is ready to take incoming requests
-        mx_signals_t observed;
-        status = mx_object_wait_one(root, MX_USER_SIGNAL_0 | MX_CHANNEL_PEER_CLOSED,
-                                    MX_TIME_INFINITE, &observed);
-        if ((status != MX_OK) || (observed & MX_CHANNEL_PEER_CLOSED)) {
-            status = (status != MX_OK) ? status : MX_ERR_BAD_STATE;
+        zx_signals_t observed;
+        status = zx_object_wait_one(root, ZX_USER_SIGNAL_0 | ZX_CHANNEL_PEER_CLOSED,
+                                    ZX_TIME_INFINITE, &observed);
+        if ((status != ZX_OK) || (observed & ZX_CHANNEL_PEER_CLOSED)) {
+            status = (status != ZX_OK) ? status : ZX_ERR_BAD_STATE;
             goto fail;
         }
     }
@@ -154,18 +154,18 @@
     //
     // The unmount process is a little atypical, since we're just sending a signal over a handle,
     // rather than detaching the mounted filesytem from the "parent" filesystem.
-    vfs_unmount_handle(root, options->wait_until_ready ? MX_TIME_INFINITE : 0);
+    vfs_unmount_handle(root, options->wait_until_ready ? ZX_TIME_INFINITE : 0);
     return status;
 }
 
-static mx_status_t mount_mxfs(const char* binary, int devicefd, mountpoint_t* mp,
+static zx_status_t mount_mxfs(const char* binary, int devicefd, mountpoint_t* mp,
                               const mount_options_t* options, LaunchCallback cb) {
-    mx_handle_t hnd[MXIO_MAX_HANDLES * 2];
-    uint32_t ids[MXIO_MAX_HANDLES * 2];
+    zx_handle_t hnd[FDIO_MAX_HANDLES * 2];
+    uint32_t ids[FDIO_MAX_HANDLES * 2];
     size_t n = 0;
-    mx_handle_t root;
-    mx_status_t status;
-    if ((status = mount_prepare_handles(devicefd, &root, hnd, ids, &n)) != MX_OK) {
+    zx_handle_t root;
+    zx_status_t status;
+    if ((status = mount_prepare_handles(devicefd, &root, hnd, ids, &n)) != ZX_OK) {
         return status;
     }
 
@@ -176,14 +176,14 @@
     return launch_and_mount(cb, options, argv, countof(argv), hnd, ids, n, mp, root);
 }
 
-static mx_status_t mount_fat(int devicefd, mountpoint_t* mp, const mount_options_t* options,
+static zx_status_t mount_fat(int devicefd, mountpoint_t* mp, const mount_options_t* options,
                              LaunchCallback cb) {
-    mx_handle_t hnd[MXIO_MAX_HANDLES * 2];
-    uint32_t ids[MXIO_MAX_HANDLES * 2];
+    zx_handle_t hnd[FDIO_MAX_HANDLES * 2];
+    uint32_t ids[FDIO_MAX_HANDLES * 2];
     size_t n = 0;
-    mx_handle_t root;
-    mx_status_t status;
-    if ((status = mount_prepare_handles(devicefd, &root, hnd, ids, &n)) != MX_OK) {
+    zx_handle_t root;
+    zx_status_t status;
+    if ((status = mount_prepare_handles(devicefd, &root, hnd, ids, &n)) != ZX_OK) {
         return status;
     }
 
@@ -205,7 +205,7 @@
     return launch_and_mount(cb, options, argv, countof(argv), hnd, ids, n, mp, root);
 }
 
-mx_status_t fmount_common(int devicefd, mountpoint_t* mp, disk_format_t df,
+zx_status_t fmount_common(int devicefd, mountpoint_t* mp, disk_format_t df,
                           const mount_options_t* options, LaunchCallback cb) {
     switch (df) {
     case DISK_FORMAT_MINFS:
@@ -216,11 +216,11 @@
         return mount_fat(devicefd, mp, options, cb);
     default:
         close(devicefd);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-mx_status_t fmount(int devicefd, int mountfd, disk_format_t df,
+zx_status_t fmount(int devicefd, int mountfd, disk_format_t df,
                    const mount_options_t* options, LaunchCallback cb) {
     mountpoint_t mp;
     mp.fd = mountfd;
@@ -229,7 +229,7 @@
     return fmount_common(devicefd, &mp, df, options, cb);
 }
 
-mx_status_t mount(int devicefd, const char* mountpath, disk_format_t df,
+zx_status_t mount(int devicefd, const char* mountpath, disk_format_t df,
                   const mount_options_t* options, LaunchCallback cb) {
     mountpoint_t mp;
     mp.flags = 0;
@@ -240,35 +240,35 @@
     } else {
         // Open mountpoint; use it directly
         if ((mp.fd = open(mountpath, O_RDONLY | O_DIRECTORY | O_ADMIN)) < 0) {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
     }
 
-    mx_status_t status = fmount_common(devicefd, &mp, df, options, cb);
+    zx_status_t status = fmount_common(devicefd, &mp, df, options, cb);
     if (!options->create_mountpoint) {
         close(mp.fd);
     }
     return status;
 }
 
-mx_status_t fumount(int mountfd) {
-    mx_handle_t h;
-    mx_status_t status = ioctl_vfs_unmount_node(mountfd, &h);
+zx_status_t fumount(int mountfd) {
+    zx_handle_t h;
+    zx_status_t status = ioctl_vfs_unmount_node(mountfd, &h);
     if (status < 0) {
         fprintf(stderr, "Could not unmount filesystem: %d\n", status);
     } else {
-        status = vfs_unmount_handle(h, MX_TIME_INFINITE);
+        status = vfs_unmount_handle(h, ZX_TIME_INFINITE);
     }
     return status;
 }
 
-mx_status_t umount(const char* mountpath) {
+zx_status_t umount(const char* mountpath) {
     int fd = open(mountpath, O_DIRECTORY | O_NOREMOTE | O_ADMIN);
     if (fd < 0) {
         fprintf(stderr, "Could not open directory: %s\n", strerror(errno));
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
-    mx_status_t status = fumount(fd);
+    zx_status_t status = fumount(fd);
     close(fd);
     return status;
 }
diff --git a/system/ulib/fs-management/ramdisk.c b/system/ulib/fs-management/ramdisk.c
index 78f668c..7437203 100644
--- a/system/ulib/fs-management/ramdisk.c
+++ b/system/ulib/fs-management/ramdisk.c
@@ -14,25 +14,25 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <magenta/device/block.h>
-#include <magenta/device/ramdisk.h>
-#include <magenta/device/vfs.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <mxio/watcher.h>
+#include <zircon/device/block.h>
+#include <zircon/device/ramdisk.h>
+#include <zircon/device/vfs.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <fdio/watcher.h>
 
 #include <fs-management/ramdisk.h>
 
 #define RAMCTL_PATH "/dev/misc/ramctl"
 #define BLOCK_EXTENSION "block"
 
-static mx_status_t driver_watcher_cb(int dirfd, int event, const char* fn, void* cookie) {
+static zx_status_t driver_watcher_cb(int dirfd, int event, const char* fn, void* cookie) {
     const char* wanted = *(const char**)cookie;
     if (event == WATCH_EVENT_ADD_FILE && strcmp(fn, wanted) == 0) {
-        return MX_ERR_STOP;
+        return ZX_ERR_STOP;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 int wait_for_driver_bind(const char* parent, const char* driver) {
@@ -44,8 +44,8 @@
         return -1;
     }
 
-    mx_time_t deadline = mx_deadline_after(MX_SEC(3));
-    if (mxio_watch_directory(dirfd(dir), driver_watcher_cb, deadline, &driver) != MX_ERR_STOP) {
+    zx_time_t deadline = zx_deadline_after(ZX_SEC(3));
+    if (fdio_watch_directory(dirfd(dir), driver_watcher_cb, deadline, &driver) != ZX_ERR_STOP) {
         closedir(dir);
         return -1;
     }
@@ -95,7 +95,7 @@
         return -1;
     }
     ssize_t r = ioctl_ramdisk_unlink(fd);
-    if (r != MX_OK) {
+    if (r != ZX_OK) {
         fprintf(stderr, "Could not shut off ramdisk\n");
         return -1;
     }
diff --git a/system/ulib/fs-management/rules.mk b/system/ulib/fs-management/rules.mk
index 16d5874..f1f2f7b 100644
--- a/system/ulib/fs-management/rules.mk
+++ b/system/ulib/fs-management/rules.mk
@@ -20,9 +20,9 @@
 
 MODULE_LIBS := \
     system/ulib/launchpad \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
 
 MODULE_EXPORT := so
 MODULE_SO_NAME := fs-management
diff --git a/system/ulib/fs/BUILD.gn b/system/ulib/fs/BUILD.gn
index b039009..fca7a82 100644
--- a/system/ulib/fs/BUILD.gn
+++ b/system/ulib/fs/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 static_library("fs") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "include/fs/async-dispatcher.h",
     "include/fs/block-txn.h",
@@ -34,19 +34,19 @@
     "_ALL_SOURCE=1",
   ]
 
-  include_dirs = [ "//magenta/system/private" ]
+  include_dirs = [ "//zircon/system/private" ]
 
   deps = [
-    "//magenta/system/ulib/async",
-    "//magenta/system/ulib/async:default",
-    "//magenta/system/ulib/async:loop",
-    "//magenta/system/ulib/mx",
-    "//magenta/system/ulib/mxcpp",
-    "//magenta/system/ulib/fbl",
+    "//zircon/system/ulib/async",
+    "//zircon/system/ulib/async:default",
+    "//zircon/system/ulib/async:loop",
+    "//zircon/system/ulib/zx",
+    "//zircon/system/ulib/zxcpp",
+    "//zircon/system/ulib/fbl",
   ]
 
   libs = [
-    "magenta",
-    "mxio",
+    "zircon",
+    "fdio",
   ]
 }
diff --git a/system/ulib/fs/async-dispatcher.cpp b/system/ulib/fs/async-dispatcher.cpp
index 1ca036f..83a6135 100644
--- a/system/ulib/fs/async-dispatcher.cpp
+++ b/system/ulib/fs/async-dispatcher.cpp
@@ -8,24 +8,24 @@
 #include <async/dispatcher.h>
 #include <async/wait.h>
 #include <fs/async-dispatcher.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 namespace fs {
 
-AsyncHandler::AsyncHandler(mx::channel channel, vfs_dispatcher_cb_t cb, void* cookie) :
+AsyncHandler::AsyncHandler(zx::channel channel, vfs_dispatcher_cb_t cb, void* cookie) :
     channel_(fbl::move(channel)), cb_(cb), cookie_(cookie),
-    wait_(channel_.get(), MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
+    wait_(channel_.get(), ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
           ASYNC_FLAG_HANDLE_SHUTDOWN) {
     wait_.set_handler(fbl::BindMember(this, &AsyncHandler::Handle));
 }
 
 AsyncHandler::~AsyncHandler() = default;
 
-async_wait_result_t AsyncHandler::Handle(async_t* async, mx_status_t status,
-                                         const mx_packet_signal_t* signal) {
-    if (status == MX_OK && (signal->observed & MX_CHANNEL_READABLE)) {
-        status = mxrio_handler(channel_.get(), (void*) cb_, cookie_);
-        if (status != MX_OK) {
+async_wait_result_t AsyncHandler::Handle(async_t* async, zx_status_t status,
+                                         const zx_packet_signal_t* signal) {
+    if (status == ZX_OK && (signal->observed & ZX_CHANNEL_READABLE)) {
+        status = zxrio_handler(channel_.get(), (void*) cb_, cookie_);
+        if (status != ZX_OK) {
             // Disconnect the handler in the case of
             // (1) Explicit Close from the client, or
             // (2) IPC-related error
@@ -34,7 +34,7 @@
         return ASYNC_WAIT_AGAIN;
     } else {
         // Either the dispatcher failed to wait for signals, or
-        // we received |MX_CHANNEL_PEER_CLOSED|. Either way, terminate
+        // we received |ZX_CHANNEL_PEER_CLOSED|. Either way, terminate
         // the handler.
         return HandlerClose(true);
     }
@@ -43,7 +43,7 @@
 async_wait_result_t AsyncHandler::HandlerClose(bool need_close_cb) {
     if (need_close_cb) {
         // We're closing the handle here; we don't care about the result.
-        mxrio_handler(MX_HANDLE_INVALID, (void*) cb_, cookie_);
+        zxrio_handler(ZX_HANDLE_INVALID, (void*) cb_, cookie_);
     }
     delete this;
     return ASYNC_WAIT_FINISHED;
@@ -53,12 +53,12 @@
 
 AsyncDispatcher::~AsyncDispatcher() = default;
 
-mx_status_t AsyncDispatcher::AddVFSHandler(mx::channel channel,
+zx_status_t AsyncDispatcher::AddVFSHandler(zx::channel channel,
                                            vfs_dispatcher_cb_t cb,
                                            void* iostate) {
     AsyncHandler* handler = new AsyncHandler(fbl::move(channel), cb, iostate);
-    mx_status_t status;
-    if ((status = handler->Begin(async_)) != MX_OK) {
+    zx_status_t status;
+    if ((status = handler->Begin(async_)) != ZX_OK) {
         delete handler;
     }
     return status;
diff --git a/system/ulib/fs/include/fs/async-dispatcher.h b/system/ulib/fs/include/fs/async-dispatcher.h
index 470ad64..7c23606 100644
--- a/system/ulib/fs/include/fs/async-dispatcher.h
+++ b/system/ulib/fs/include/fs/async-dispatcher.h
@@ -10,19 +10,19 @@
 #include <async/dispatcher.h>
 #include <async/wait.h>
 #include <fs/vfs.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 namespace fs {
 
 class AsyncHandler {
 public:
-    AsyncHandler(mx::channel channel, vfs_dispatcher_cb_t cb, void* cookie);
+    AsyncHandler(zx::channel channel, vfs_dispatcher_cb_t cb, void* cookie);
     ~AsyncHandler();
 
-    mx_status_t Begin(async_t* async) { return wait_.Begin(async); }
+    zx_status_t Begin(async_t* async) { return wait_.Begin(async); }
 
-    async_wait_result_t Handle(async_t* async, mx_status_t status,
-                               const mx_packet_signal_t* signal);
+    async_wait_result_t Handle(async_t* async, zx_status_t status,
+                               const zx_packet_signal_t* signal);
 private:
     DISALLOW_COPY_ASSIGN_AND_MOVE(AsyncHandler);
 
@@ -30,7 +30,7 @@
     // and terminate the handler by returning |ASYNC_WAIT_FINISHED|
     async_wait_result_t HandlerClose(bool need_close_cb);
 
-    mx::channel channel_;
+    zx::channel channel_;
     vfs_dispatcher_cb_t cb_;
     void* cookie_;
     async::Wait wait_;
@@ -41,7 +41,7 @@
     AsyncDispatcher(async_t* async);
     ~AsyncDispatcher();
 
-    mx_status_t AddVFSHandler(mx::channel channel, vfs_dispatcher_cb_t cb,
+    zx_status_t AddVFSHandler(zx::channel channel, vfs_dispatcher_cb_t cb,
                               void* iostate) final;
 
 private:
diff --git a/system/ulib/fs/include/fs/block-txn.h b/system/ulib/fs/include/fs/block-txn.h
index f96eb92..c390a30 100644
--- a/system/ulib/fs/include/fs/block-txn.h
+++ b/system/ulib/fs/include/fs/block-txn.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/device/block.h>
+#include <zircon/device/block.h>
 #include <fbl/algorithm.h>
 #include <fbl/macros.h>
 
@@ -83,7 +83,7 @@
     }
 
     // Activate the transaction
-    mx_status_t Flush();
+    zx_status_t Flush();
 
 private:
     TxnHandler* handler_;
@@ -92,14 +92,14 @@
 };
 
 template <bool Write, size_t BlockSize, typename TxnHandler>
-inline mx_status_t BlockTxn<vmoid_t, Write, BlockSize, TxnHandler>::Flush() {
+inline zx_status_t BlockTxn<vmoid_t, Write, BlockSize, TxnHandler>::Flush() {
     for (size_t i = 0; i < count_; i++) {
         requests_[i].opcode = Write ? BLOCKIO_WRITE : BLOCKIO_READ;
         requests_[i].vmo_offset *= BlockSize;
         requests_[i].dev_offset *= BlockSize;
         requests_[i].length *= BlockSize;
     }
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     if (count_ != 0) {
         status = handler_->Txn(requests_, count_);
     }
@@ -137,7 +137,7 @@
     }
 
     // Activate the transaction (do nothing)
-    mx_status_t Flush() { return MX_OK; }
+    zx_status_t Flush() { return ZX_OK; }
 
 private:
     TxnHandler* handler_;
diff --git a/system/ulib/fs/include/fs/client.h b/system/ulib/fs/include/fs/client.h
index 5990da0..30c3a2c 100644
--- a/system/ulib/fs/include/fs/client.h
+++ b/system/ulib/fs/include/fs/client.h
@@ -4,20 +4,20 @@
 
 #pragma once
 
-#include <mxio/remoteio.h>
+#include <fdio/remoteio.h>
 
 #include <stdlib.h>
 #include <stdint.h>
 #include <sys/types.h>
 
-#include <magenta/assert.h>
-#include <magenta/types.h>
+#include <zircon/assert.h>
+#include <zircon/types.h>
 
-#include <mxio/vfs.h>
+#include <fdio/vfs.h>
 
 __BEGIN_CDECLS
 
 // Send an unmount signal on a handle to a filesystem and await a response.
-mx_status_t vfs_unmount_handle(mx_handle_t h, mx_time_t deadline);
+zx_status_t vfs_unmount_handle(zx_handle_t h, zx_time_t deadline);
 
 __END_CDECLS
diff --git a/system/ulib/fs/include/fs/dispatcher.h b/system/ulib/fs/include/fs/dispatcher.h
index 15b8c3a..08d66a8 100644
--- a/system/ulib/fs/include/fs/dispatcher.h
+++ b/system/ulib/fs/include/fs/dispatcher.h
@@ -7,14 +7,14 @@
 #include <stdlib.h>
 #include <stdint.h>
 
-#include <magenta/types.h>
-#include <mx/channel.h>
+#include <zircon/types.h>
+#include <zx/channel.h>
 #include <fbl/ref_counted.h>
-#include <mxio/remoteio.h>
+#include <fdio/remoteio.h>
 
 namespace fs {
 
-using vfs_dispatcher_cb_t = mxrio_cb_t;
+using vfs_dispatcher_cb_t = zxrio_cb_t;
 
 // Dispatcher describes the interface that the VFS layer uses when
 // interacting with a dispatcher. Filesystems which intend to be
@@ -27,7 +27,7 @@
     // Add a new object to be handled to the dispatcher.
     // The dispatcher will read from 'channel', and pass the
     // message to the dispatcher callback 'cb'.
-    virtual mx_status_t AddVFSHandler(mx::channel channel, vfs_dispatcher_cb_t cb, void* iostate) = 0;
+    virtual zx_status_t AddVFSHandler(zx::channel channel, vfs_dispatcher_cb_t cb, void* iostate) = 0;
 };
 
 } // namespace fs
diff --git a/system/ulib/fs/include/fs/mapped-vmo.h b/system/ulib/fs/include/fs/mapped-vmo.h
index 688f9e3..7445b2c 100644
--- a/system/ulib/fs/include/fs/mapped-vmo.h
+++ b/system/ulib/fs/include/fs/mapped-vmo.h
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/algorithm.h>
 #include <fbl/unique_ptr.h>
 
@@ -19,7 +19,7 @@
     DISALLOW_COPY_ASSIGN_AND_MOVE(MappedVmo);
     virtual ~MappedVmo();
 
-    static mx_status_t Create(size_t size, const char* name, fbl::unique_ptr<MappedVmo>* out);
+    static zx_status_t Create(size_t size, const char* name, fbl::unique_ptr<MappedVmo>* out);
 
     // Attempts to reduce both the VMO size and VMAR mapping:
     // From [addr_, addr_ + len_]
@@ -30,7 +30,7 @@
     // returns an error.
     //
     // On failure, the Mapping may be partially removed, and should not be used.
-    mx_status_t Shrink(size_t off, size_t len);
+    zx_status_t Shrink(size_t off, size_t len);
 
     // Attempts to increase both VMO size and VMAR mapping:
     // From [addr_, addr_ + len_]
@@ -40,16 +40,16 @@
     // current size will return an error.
     //
     // On failure, the Mapping will be safe to use, but will remain at its original size.
-    mx_status_t Grow(size_t len);
+    zx_status_t Grow(size_t len);
 
-    mx_handle_t GetVmo(void) const;
+    zx_handle_t GetVmo(void) const;
     size_t GetSize(void) const;
     void* GetData(void) const;
 
 private:
-    MappedVmo(mx_handle_t vmo, uintptr_t addr, size_t len);
+    MappedVmo(zx_handle_t vmo, uintptr_t addr, size_t len);
 
-    mx_handle_t vmo_;
+    zx_handle_t vmo_;
     uintptr_t addr_;
     size_t len_;
 };
diff --git a/system/ulib/fs/include/fs/remote.h b/system/ulib/fs/include/fs/remote.h
index f279667..02a6f51 100644
--- a/system/ulib/fs/include/fs/remote.h
+++ b/system/ulib/fs/include/fs/remote.h
@@ -9,7 +9,7 @@
 #endif
 
 #include <fs/vfs.h>
-#include <mx/channel.h>
+#include <zx/channel.h>
 
 namespace fs {
 
@@ -18,13 +18,13 @@
 public:
     constexpr RemoteContainer() {};
     bool IsRemote() const;
-    mx::channel DetachRemote(uint32_t &flags_);
+    zx::channel DetachRemote(uint32_t &flags_);
     // Access the remote handle if it's ready -- otherwise, return an error.
-    mx_handle_t WaitForRemote(uint32_t &flags_);
-    mx_handle_t GetRemote() const;
-    void SetRemote(mx::channel remote);
+    zx_handle_t WaitForRemote(uint32_t &flags_);
+    zx_handle_t GetRemote() const;
+    void SetRemote(zx::channel remote);
 private:
-    mx::channel remote_;
+    zx::channel remote_;
 };
 
 }
diff --git a/system/ulib/fs/include/fs/vfs.h b/system/ulib/fs/include/fs/vfs.h
index 10dbfd1..1c78a79 100644
--- a/system/ulib/fs/include/fs/vfs.h
+++ b/system/ulib/fs/include/fs/vfs.h
@@ -6,23 +6,23 @@
 
 #include "trace.h"
 
-#include <mxio/remoteio.h>
+#include <fdio/remoteio.h>
 
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
 #include <sys/types.h>
 
-#include <magenta/assert.h>
-#include <magenta/compiler.h>
-#include <magenta/device/vfs.h>
-#include <magenta/types.h>
+#include <zircon/assert.h>
+#include <zircon/compiler.h>
+#include <zircon/device/vfs.h>
+#include <zircon/types.h>
 
-#include <mxio/vfs.h>
+#include <fdio/vfs.h>
 
 #ifdef __Fuchsia__
 #include <threads.h>
-#include <mxio/io.h>
+#include <fdio/io.h>
 #endif
 
 // VFS Helpers (vfs.c)
@@ -38,7 +38,7 @@
 typedef struct vfs_iostate vfs_iostate_t;
 
 // Send an unmount signal on a handle to a filesystem and await a response.
-mx_status_t vfs_unmount_handle(mx_handle_t h, mx_time_t deadline);
+zx_status_t vfs_unmount_handle(zx_handle_t h, zx_time_t deadline);
 
 __END_CDECLS
 
@@ -46,9 +46,9 @@
 
 #ifdef __Fuchsia__
 #include <fs/dispatcher.h>
-#include <mx/channel.h>
-#include <mx/event.h>
-#include <mx/vmo.h>
+#include <zx/channel.h>
+#include <zx/event.h>
+#include <zx/vmo.h>
 #include <fbl/mutex.h>
 #endif  // __Fuchsia__
 
@@ -75,11 +75,11 @@
 class MountChannel {
 public:
     constexpr MountChannel() = default;
-    explicit MountChannel(mx_handle_t handle) : channel_(handle) {}
-    explicit MountChannel(mx::channel channel) : channel_(fbl::move(channel)) {}
+    explicit MountChannel(zx_handle_t handle) : channel_(handle) {}
+    explicit MountChannel(zx::channel channel) : channel_(fbl::move(channel)) {}
     MountChannel(MountChannel&& other) : channel_(fbl::move(other.channel_)) {}
 
-    mx::channel TakeChannel() { return fbl::move(channel_); }
+    zx::channel TakeChannel() { return fbl::move(channel_); }
 
     ~MountChannel() {
         if (channel_.is_valid()) {
@@ -88,7 +88,7 @@
     }
 
 private:
-    mx::channel channel_;
+    zx::channel channel_;
 };
 
 #endif // __Fuchsia__
@@ -102,10 +102,10 @@
 
     // Attempts to add the name to the end of the dirent buffer
     // which is returned by readdir.
-    mx_status_t Next(const char* name, size_t len, uint32_t type);
+    zx_status_t Next(const char* name, size_t len, uint32_t type);
 
-    mx_status_t BytesFilled() const {
-        return static_cast<mx_status_t>(pos_);
+    zx_status_t BytesFilled() const {
+        return static_cast<zx_status_t>(pos_);
     }
 
 private:
@@ -137,53 +137,53 @@
 #ifdef __Fuchsia__
     // Allocate iostate and register the transferred handle with a dispatcher.
     // Allows Vnode to act as server.
-    virtual mx_status_t Serve(fs::Vfs* vfs, mx::channel channel, uint32_t flags);
+    virtual zx_status_t Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags);
 
     // Extract handle(s), type, and extra info from a vnode.
     // Returns the number of handles which should be returned on the requesting handle.
-    virtual mx_status_t GetHandles(uint32_t flags, mx_handle_t* hnds,
+    virtual zx_status_t GetHandles(uint32_t flags, zx_handle_t* hnds,
                                    uint32_t* type, void* extra, uint32_t* esize) {
-        *type = MXIO_PROTOCOL_REMOTE;
+        *type = FDIO_PROTOCOL_REMOTE;
         return 0;
     }
 
-    virtual mx_status_t WatchDir(mx::channel* out) { return MX_ERR_NOT_SUPPORTED; }
-    virtual mx_status_t WatchDirV2(Vfs* vfs, const vfs_watch_dir_t* cmd) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t WatchDir(zx::channel* out) { return ZX_ERR_NOT_SUPPORTED; }
+    virtual zx_status_t WatchDirV2(Vfs* vfs, const vfs_watch_dir_t* cmd) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 #endif
     virtual void Notify(const char* name, size_t len, unsigned event) {}
 
     // Ensure that it is valid to open vn.
-    virtual mx_status_t Open(uint32_t flags) = 0;
+    virtual zx_status_t Open(uint32_t flags) = 0;
 
-    // Closes vn. Typically, most Vnodes simply return "MX_OK".
-    virtual mx_status_t Close();
+    // Closes vn. Typically, most Vnodes simply return "ZX_OK".
+    virtual zx_status_t Close();
 
     // Read data from vn at offset.
     virtual ssize_t Read(void* data, size_t len, size_t off) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Write data to vn at offset.
     virtual ssize_t Write(const void* data, size_t len, size_t off) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Attempt to find child of vn, child returned on success.
     // Name is len bytes long, and does not include a null terminator.
-    virtual mx_status_t Lookup(fbl::RefPtr<Vnode>* out, const char* name, size_t len) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Lookup(fbl::RefPtr<Vnode>* out, const char* name, size_t len) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Read attributes of vn.
-    virtual mx_status_t Getattr(vnattr_t* a) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Getattr(vnattr_t* a) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Set attributes of vn.
-    virtual mx_status_t Setattr(vnattr_t* a) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Setattr(vnattr_t* a) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Read directory entries of vn, error if not a directory.
@@ -191,47 +191,47 @@
     // Cookie must be zero'd before first call and will be used by.
     // the readdir implementation to maintain state across calls.
     // To "rewind" and start from the beginning, cookie may be zero'd.
-    virtual mx_status_t Readdir(void* cookie, void* dirents, size_t len) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Readdir(void* cookie, void* dirents, size_t len) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Create a new node under vn.
     // Name is len bytes long, and does not include a null terminator.
     // Mode specifies the type of entity to create.
-    virtual mx_status_t Create(fbl::RefPtr<Vnode>* out, const char* name, size_t len, uint32_t mode) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Create(fbl::RefPtr<Vnode>* out, const char* name, size_t len, uint32_t mode) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Performs the given ioctl op on vn.
     // On success, returns the number of bytes received.
     virtual ssize_t Ioctl(uint32_t op, const void* in_buf, size_t in_len,
                           void* out_buf, size_t out_len) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Removes name from directory vn
-    virtual mx_status_t Unlink(const char* name, size_t len, bool must_be_dir) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Unlink(const char* name, size_t len, bool must_be_dir) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Change the size of vn
-    virtual mx_status_t Truncate(size_t len) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Truncate(size_t len) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Renames the path at oldname in olddir to the path at newname in newdir.
     // Called on the "olddir" vnode.
     // Unlinks any prior newname if it already exists.
-    virtual mx_status_t Rename(fbl::RefPtr<Vnode> newdir,
+    virtual zx_status_t Rename(fbl::RefPtr<Vnode> newdir,
                                const char* oldname, size_t oldlen,
                                const char* newname, size_t newlen,
                                bool src_must_be_dir, bool dst_must_be_dir) {
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Creates a hard link to the 'target' vnode with a provided name in vndir
-    virtual mx_status_t Link(const char* name, size_t len, fbl::RefPtr<Vnode> target) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Link(const char* name, size_t len, fbl::RefPtr<Vnode> target) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Acquire a vmo from a vnode.
@@ -240,20 +240,20 @@
     // since (without paging) there is no mechanism to update either
     // 1) The file by writing to the mapping, or
     // 2) The mapping by writing to the underlying file.
-    virtual mx_status_t Mmap(int flags, size_t len, size_t* off, mx_handle_t* out) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Mmap(int flags, size_t len, size_t* off, zx_handle_t* out) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Syncs the vnode with its underlying storage
-    virtual mx_status_t Sync() {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t Sync() {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     virtual ~Vnode() {};
 
 #ifdef __Fuchsia__
     // Attaches a handle to the vnode, if possible. Otherwise, returns an error.
-    virtual mx_status_t AttachRemote(MountChannel h) { return MX_ERR_NOT_SUPPORTED; }
+    virtual zx_status_t AttachRemote(MountChannel h) { return ZX_ERR_NOT_SUPPORTED; }
 
     // The following methods are required to mount sub-filesystems. The logic
     // (and storage) necessary to implement these functions exists within the
@@ -262,10 +262,10 @@
 
     // The vnode is acting as a mount point for a remote filesystem or device.
     virtual bool IsRemote() const { return false; }
-    virtual mx::channel DetachRemote() { return mx::channel(); }
-    virtual mx_handle_t WaitForRemote() { return MX_HANDLE_INVALID; }
-    virtual mx_handle_t GetRemote() const { return MX_HANDLE_INVALID; }
-    virtual void SetRemote(mx::channel remote) { MX_DEBUG_ASSERT(false); }
+    virtual zx::channel DetachRemote() { return zx::channel(); }
+    virtual zx_handle_t WaitForRemote() { return ZX_HANDLE_INVALID; }
+    virtual zx_handle_t GetRemote() const { return ZX_HANDLE_INVALID; }
+    virtual void SetRemote(zx::channel remote) { ZX_DEBUG_ASSERT(false); }
 
     // The vnode is a device. Devices may opt to reveal themselves as directories
     // or endpoints, depending on context. For the purposes of our VFS layer,
@@ -273,7 +273,7 @@
     // they contain remote handles.
     bool IsDevice() const { return (flags_ & VFS_FLAG_DEVICE) && IsRemote(); }
     void DetachDevice() {
-        MX_DEBUG_ASSERT(flags_ & VFS_FLAG_DEVICE);
+        ZX_DEBUG_ASSERT(flags_ & VFS_FLAG_DEVICE);
         flags_ |= VFS_FLAG_DEVICE_DETACHED;
     }
     bool IsDetachedDevice() const { return (flags_ & VFS_FLAG_DEVICE_DETACHED); }
@@ -291,22 +291,22 @@
 public:
     using ListType = fbl::DoublyLinkedList<fbl::unique_ptr<MountNode>>;
     constexpr MountNode() : vn_(nullptr) {}
-    ~MountNode() { MX_DEBUG_ASSERT(vn_ == nullptr); }
+    ~MountNode() { ZX_DEBUG_ASSERT(vn_ == nullptr); }
 
     void SetNode(fbl::RefPtr<Vnode> vn) {
-        MX_DEBUG_ASSERT(vn_ == nullptr);
+        ZX_DEBUG_ASSERT(vn_ == nullptr);
         vn_ = vn;
     }
 
-    mx::channel ReleaseRemote() {
-        MX_DEBUG_ASSERT(vn_ != nullptr);
-        mx::channel h = vn_->DetachRemote();
+    zx::channel ReleaseRemote() {
+        ZX_DEBUG_ASSERT(vn_ != nullptr);
+        zx::channel h = vn_->DetachRemote();
         vn_ = nullptr;
         return h;
     }
 
     bool VnodeMatch(fbl::RefPtr<Vnode> vn) const {
-        MX_DEBUG_ASSERT(vn_ != nullptr);
+        ZX_DEBUG_ASSERT(vn_ != nullptr);
         return vn == vn_;
     }
 
@@ -325,24 +325,24 @@
     Vfs();
     // Walk from vn --> out until either only one path segment remains or we
     // encounter a remote filesystem.
-    mx_status_t Walk(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
+    zx_status_t Walk(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
                      const char* path, const char** pathout) __TA_REQUIRES(vfs_lock_);
     // Traverse the path to the target vnode, and create / open it using
     // the underlying filesystem functions (lookup, create, open).
-    mx_status_t Open(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
+    zx_status_t Open(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
                      const char* path, const char** pathout,
                      uint32_t flags, uint32_t mode) __TA_EXCLUDES(vfs_lock_);
-    mx_status_t Unlink(fbl::RefPtr<Vnode> vn, const char* path, size_t len) __TA_EXCLUDES(vfs_lock_);
+    zx_status_t Unlink(fbl::RefPtr<Vnode> vn, const char* path, size_t len) __TA_EXCLUDES(vfs_lock_);
     ssize_t Ioctl(fbl::RefPtr<Vnode> vn, uint32_t op, const void* in_buf, size_t in_len,
                   void* out_buf, size_t out_len) __TA_EXCLUDES(vfs_lock_);
 
 #ifdef __Fuchsia__
-    void TokenDiscard(mx::event* ios_token) __TA_EXCLUDES(vfs_lock_);
-    mx_status_t VnodeToToken(fbl::RefPtr<Vnode> vn, mx::event* ios_token,
-                             mx::event* out) __TA_EXCLUDES(vfs_lock_);
-    mx_status_t Link(mx::event token, fbl::RefPtr<Vnode> oldparent,
+    void TokenDiscard(zx::event* ios_token) __TA_EXCLUDES(vfs_lock_);
+    zx_status_t VnodeToToken(fbl::RefPtr<Vnode> vn, zx::event* ios_token,
+                             zx::event* out) __TA_EXCLUDES(vfs_lock_);
+    zx_status_t Link(zx::event token, fbl::RefPtr<Vnode> oldparent,
                      const char* oldname, const char* newname) __TA_EXCLUDES(vfs_lock_);
-    mx_status_t Rename(mx::event token, fbl::RefPtr<Vnode> oldparent,
+    zx_status_t Rename(zx::event token, fbl::RefPtr<Vnode> oldparent,
                        const char* oldname, const char* newname) __TA_EXCLUDES(vfs_lock_);
 
     Vfs(Dispatcher* dispatcher);
@@ -350,24 +350,24 @@
     void SetDispatcher(Dispatcher* dispatcher) { dispatcher_ = dispatcher; }
 
     // Dispatches to a Vnode over the specified handle (normal case)
-    mx_status_t Serve(mx::channel channel, void* ios);
+    zx_status_t Serve(zx::channel channel, void* ios);
 
     // Serves a Vnode over the specified handle (used for creating new filesystems)
-    mx_status_t ServeDirectory(fbl::RefPtr<fs::Vnode> vn, mx::channel channel);
+    zx_status_t ServeDirectory(fbl::RefPtr<fs::Vnode> vn, zx::channel channel);
 
     // Pins a handle to a remote filesystem onto a vnode, if possible.
-    mx_status_t InstallRemote(fbl::RefPtr<Vnode> vn, MountChannel h) __TA_EXCLUDES(vfs_lock_);
+    zx_status_t InstallRemote(fbl::RefPtr<Vnode> vn, MountChannel h) __TA_EXCLUDES(vfs_lock_);
 
     // Create and mount a directory with a provided name
-    mx_status_t MountMkdir(fbl::RefPtr<Vnode> vn,
+    zx_status_t MountMkdir(fbl::RefPtr<Vnode> vn,
                            const mount_mkdir_config_t* config) __TA_EXCLUDES(vfs_lock_);
 
     // Unpin a handle to a remote filesystem from a vnode, if one exists.
-    mx_status_t UninstallRemote(fbl::RefPtr<Vnode> vn, mx::channel* h) __TA_EXCLUDES(vfs_lock_);
+    zx_status_t UninstallRemote(fbl::RefPtr<Vnode> vn, zx::channel* h) __TA_EXCLUDES(vfs_lock_);
 
     // Unpins all remote filesystems in the current filesystem, and waits for the
     // response of each one with the provided deadline.
-    mx_status_t UninstallAll(mx_time_t deadline) __TA_EXCLUDES(vfs_lock_);
+    zx_status_t UninstallAll(zx_time_t deadline) __TA_EXCLUDES(vfs_lock_);
 
     // A lock which should be used to protect lookup and walk operations
     // TODO(smklein): Encapsulate the lock; make it private.
@@ -375,19 +375,19 @@
 #endif
 
 private:
-    mx_status_t OpenLocked(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
+    zx_status_t OpenLocked(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
                            const char* path, const char** pathout,
                            uint32_t flags, uint32_t mode) __TA_REQUIRES(vfs_lock_);
 #ifdef __Fuchsia__
-    mx_status_t TokenToVnode(mx::event token, fbl::RefPtr<Vnode>* out) __TA_REQUIRES(vfs_lock_);
-    mx_status_t InstallRemoteLocked(fbl::RefPtr<Vnode> vn, MountChannel h) __TA_REQUIRES(vfs_lock_);
-    mx_status_t UninstallRemoteLocked(fbl::RefPtr<Vnode> vn,
-                                      mx::channel* h) __TA_REQUIRES(vfs_lock_);
+    zx_status_t TokenToVnode(zx::event token, fbl::RefPtr<Vnode>* out) __TA_REQUIRES(vfs_lock_);
+    zx_status_t InstallRemoteLocked(fbl::RefPtr<Vnode> vn, MountChannel h) __TA_REQUIRES(vfs_lock_);
+    zx_status_t UninstallRemoteLocked(fbl::RefPtr<Vnode> vn,
+                                      zx::channel* h) __TA_REQUIRES(vfs_lock_);
     // Waits for a remote handle on a Vnode to become ready to receive requests.
-    // Returns |MX_ERR_PEER_CLOSED| if the remote will never become available, since it is closed.
-    // Returns |MX_ERR_UNAVAILABLE| if there is no remote handle, or if the remote handle is not yet ready.
+    // Returns |ZX_ERR_PEER_CLOSED| if the remote will never become available, since it is closed.
+    // Returns |ZX_ERR_UNAVAILABLE| if there is no remote handle, or if the remote handle is not yet ready.
     // On success, returns the remote handle.
-    mx_handle_t WaitForRemoteLocked(fbl::RefPtr<Vnode> vn) __TA_REQUIRES(vfs_lock_);
+    zx_handle_t WaitForRemoteLocked(fbl::RefPtr<Vnode> vn) __TA_REQUIRES(vfs_lock_);
     // The mount list is a global static variable, but it only uses
     // constexpr constructors during initialization. As a consequence,
     // the .init_array section of the compiled vfs-mount object file is
@@ -412,7 +412,7 @@
     void* p;
 } vdircookie_t;
 
-// Handle incoming mxrio messages, dispatching them to vnode operations.
-mx_status_t vfs_handler(mxrio_msg_t* msg, void* cookie);
+// Handle incoming zxrio messages, dispatching them to vnode operations.
+zx_status_t vfs_handler(zxrio_msg_t* msg, void* cookie);
 
 __END_CDECLS
diff --git a/system/ulib/fs/include/fs/watcher.h b/system/ulib/fs/include/fs/watcher.h
index 5aa1f5c..5fab4c9 100644
--- a/system/ulib/fs/include/fs/watcher.h
+++ b/system/ulib/fs/include/fs/watcher.h
@@ -13,8 +13,8 @@
 #include <fbl/mutex.h>
 #include <fbl/unique_ptr.h>
 #include <fs/vfs.h>
-#include <magenta/device/vfs.h>
-#include <mx/channel.h>
+#include <zircon/device/vfs.h>
+#include <zx/channel.h>
 
 namespace fs {
 
@@ -24,8 +24,8 @@
     WatcherContainer();
     ~WatcherContainer();
 
-    mx_status_t WatchDir(mx::channel* out);
-    mx_status_t WatchDirV2(Vfs* vfs, Vnode* vn, const vfs_watch_dir_t* cmd);
+    zx_status_t WatchDir(zx::channel* out);
+    zx_status_t WatchDirV2(Vfs* vfs, Vnode* vn, const vfs_watch_dir_t* cmd);
 
     // Notifies all VnodeWatchers in the watch list, if their mask
     // indicates they are interested in the incoming event.
@@ -36,10 +36,10 @@
     // A simple structure which holds a channel to a watching client,
     // as well as a mask of signals they are interested in hearing about.
     struct VnodeWatcher : public fbl::DoublyLinkedListable<fbl::unique_ptr<VnodeWatcher>> {
-        VnodeWatcher(mx::channel h, uint32_t mask);
+        VnodeWatcher(zx::channel h, uint32_t mask);
         ~VnodeWatcher();
 
-        mx::channel h;
+        zx::channel h;
         uint32_t mask;
     };
 
diff --git a/system/ulib/fs/mapped-vmo.cpp b/system/ulib/fs/mapped-vmo.cpp
index 0f8218c..de15bce 100644
--- a/system/ulib/fs/mapped-vmo.cpp
+++ b/system/ulib/fs/mapped-vmo.cpp
@@ -8,94 +8,94 @@
 #include <unistd.h>
 
 #include <fs/mapped-vmo.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/unique_ptr.h>
 
-mx_status_t MappedVmo::Create(size_t size, const char* name, fbl::unique_ptr<MappedVmo>* out) {
-    mx_handle_t vmo;
+zx_status_t MappedVmo::Create(size_t size, const char* name, fbl::unique_ptr<MappedVmo>* out) {
+    zx_handle_t vmo;
     uintptr_t addr;
-    mx_status_t status;
-    if ((status = mx_vmo_create(size, 0, &vmo)) != MX_OK) {
+    zx_status_t status;
+    if ((status = zx_vmo_create(size, 0, &vmo)) != ZX_OK) {
         return status;
-    } else if ((status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0,
-                                     size, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
-                                     &addr)) != MX_OK) {
-        mx_handle_close(vmo);
+    } else if ((status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0,
+                                     size, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
+                                     &addr)) != ZX_OK) {
+        zx_handle_close(vmo);
         return status;
     }
 
-    mx_object_set_property(vmo, MX_PROP_NAME, name, strlen(name));
+    zx_object_set_property(vmo, ZX_PROP_NAME, name, strlen(name));
 
     fbl::AllocChecker ac;
     fbl::unique_ptr<MappedVmo> mvmo(new (&ac) MappedVmo(vmo, addr, size));
     if (!ac.check()) {
-        mx_vmar_unmap(mx_vmar_root_self(), addr, size);
-        mx_handle_close(vmo);
-        return MX_ERR_NO_MEMORY;
+        zx_vmar_unmap(zx_vmar_root_self(), addr, size);
+        zx_handle_close(vmo);
+        return ZX_ERR_NO_MEMORY;
     }
 
     *out = fbl::move(mvmo);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t MappedVmo::Shrink(size_t off, size_t len) {
+zx_status_t MappedVmo::Shrink(size_t off, size_t len) {
     if (len == 0 || off + len > len_ || off > len_ || off + len < off) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    mx_status_t status;
-    mx_handle_t new_vmo;
+    zx_status_t status;
+    zx_handle_t new_vmo;
     if (off > 0) {
         // Unmap everything before the offset
-        if ((status = mx_vmar_unmap(mx_vmar_root_self(), addr_, off)) != MX_OK) {
+        if ((status = zx_vmar_unmap(zx_vmar_root_self(), addr_, off)) != ZX_OK) {
             return status;
         }
     }
     if (off + len < len_) {
         // Unmap everything after the offset
-        if ((status = mx_vmar_unmap(mx_vmar_root_self(), addr_ + off + len, len_ - (off + len))) != MX_OK) {
+        if ((status = zx_vmar_unmap(zx_vmar_root_self(), addr_ + off + len, len_ - (off + len))) != ZX_OK) {
             return status;
         }
     }
-    if ((status = mx_vmo_clone(vmo_, MX_VMO_CLONE_COPY_ON_WRITE, off, len, &new_vmo)) != MX_OK) {
+    if ((status = zx_vmo_clone(vmo_, ZX_VMO_CLONE_COPY_ON_WRITE, off, len, &new_vmo)) != ZX_OK) {
         return status;
     }
-    mx_handle_close(vmo_);
+    zx_handle_close(vmo_);
     vmo_ = new_vmo;
     addr_ = addr_ + off;
     len_ = len;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t MappedVmo::Grow(size_t len) {
+zx_status_t MappedVmo::Grow(size_t len) {
     if (len < len_) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     len = fbl::roundup(len, static_cast<size_t>(PAGE_SIZE));
-    mx_status_t status;
+    zx_status_t status;
     uintptr_t addr;
 
-    if ((status = mx_vmo_set_size(vmo_, len)) != MX_OK) {
+    if ((status = zx_vmo_set_size(vmo_, len)) != ZX_OK) {
         return status;
     }
 
-    mx_info_vmar_t vmar_info;
-    if ((status = mx_object_get_info(mx_vmar_root_self(), MX_INFO_VMAR, &vmar_info, sizeof(vmar_info), NULL, NULL)) != MX_OK) {
+    zx_info_vmar_t vmar_info;
+    if ((status = zx_object_get_info(zx_vmar_root_self(), ZX_INFO_VMAR, &vmar_info, sizeof(vmar_info), NULL, NULL)) != ZX_OK) {
         return status;
     }
 
     // Try to extend mapping
-    if ((status = mx_vmar_map(mx_vmar_root_self(), addr_ + len_ - vmar_info.base, vmo_, len_, len - len_, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC, &addr)) != MX_OK) {
+    if ((status = zx_vmar_map(zx_vmar_root_self(), addr_ + len_ - vmar_info.base, vmo_, len_, len - len_, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC, &addr)) != ZX_OK) {
         // If extension fails, create entirely new mapping and unmap the old one
-        if ((status = mx_vmar_map(mx_vmar_root_self(), 0, vmo_, 0, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &addr)) != MX_OK) {
+        if ((status = zx_vmar_map(zx_vmar_root_self(), 0, vmo_, 0, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &addr)) != ZX_OK) {
             return status;
         }
 
-        if ((status = mx_vmar_unmap(mx_vmar_root_self(), addr_, len_)) != MX_OK) {
+        if ((status = zx_vmar_unmap(zx_vmar_root_self(), addr_, len_)) != ZX_OK) {
             return status;
         }
 
@@ -103,10 +103,10 @@
     }
 
     len_ = len;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_handle_t MappedVmo::GetVmo(void) const {
+zx_handle_t MappedVmo::GetVmo(void) const {
     return vmo_;
 }
 void* MappedVmo::GetData(void) const {
@@ -117,10 +117,10 @@
     return len_;
 }
 
-MappedVmo::MappedVmo(mx_handle_t vmo, uintptr_t addr, size_t len)
+MappedVmo::MappedVmo(zx_handle_t vmo, uintptr_t addr, size_t len)
     : vmo_(vmo), addr_(addr), len_(len) {}
 
 MappedVmo::~MappedVmo() {
-    mx_vmar_unmap(mx_vmar_root_self(), addr_, len_);
-    mx_handle_close(vmo_);
+    zx_vmar_unmap(zx_vmar_root_self(), addr_, len_);
+    zx_handle_close(vmo_);
 }
diff --git a/system/ulib/fs/mount.cpp b/system/ulib/fs/mount.cpp
index daf613f..9531ed9 100644
--- a/system/ulib/fs/mount.cpp
+++ b/system/ulib/fs/mount.cpp
@@ -9,10 +9,10 @@
 #include <threads.h>
 
 #include <fs/vfs.h>
-#include <magenta/thread_annotations.h>
-#include <mxio/debug.h>
-#include <mxio/remoteio.h>
-#include <mxio/vfs.h>
+#include <zircon/thread_annotations.h>
+#include <fdio/debug.h>
+#include <fdio/remoteio.h>
+#include <fdio/vfs.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
 #include <fbl/intrusive_double_list.h>
@@ -23,57 +23,57 @@
 namespace fs {
 
 // Installs a remote filesystem on vn and adds it to the remote_list_.
-mx_status_t Vfs::InstallRemote(fbl::RefPtr<Vnode> vn, MountChannel h) {
+zx_status_t Vfs::InstallRemote(fbl::RefPtr<Vnode> vn, MountChannel h) {
     if (vn == nullptr) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     // Allocate a node to track the remote handle
     fbl::AllocChecker ac;
     fbl::unique_ptr<MountNode> mount_point(new (&ac) MountNode());
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    mx_status_t status = vn->AttachRemote(fbl::move(h));
-    if (status != MX_OK) {
+    zx_status_t status = vn->AttachRemote(fbl::move(h));
+    if (status != ZX_OK) {
         return status;
     }
     // Save this node in the list of mounted vnodes
     mount_point->SetNode(fbl::move(vn));
     fbl::AutoLock lock(&vfs_lock_);
     remote_list_.push_front(fbl::move(mount_point));
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Installs a remote filesystem on vn and adds it to the remote_list_.
-mx_status_t Vfs::InstallRemoteLocked(fbl::RefPtr<Vnode> vn, MountChannel h) {
+zx_status_t Vfs::InstallRemoteLocked(fbl::RefPtr<Vnode> vn, MountChannel h) {
     if (vn == nullptr) {
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
 
     // Allocate a node to track the remote handle
     fbl::AllocChecker ac;
     fbl::unique_ptr<MountNode> mount_point(new (&ac) MountNode());
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    mx_status_t status = vn->AttachRemote(fbl::move(h));
-    if (status != MX_OK) {
+    zx_status_t status = vn->AttachRemote(fbl::move(h));
+    if (status != ZX_OK) {
         return status;
     }
     // Save this node in the list of mounted vnodes
     mount_point->SetNode(fbl::move(vn));
     remote_list_.push_front(fbl::move(mount_point));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Vfs::MountMkdir(fbl::RefPtr<Vnode> vn, const mount_mkdir_config_t* config) {
+zx_status_t Vfs::MountMkdir(fbl::RefPtr<Vnode> vn, const mount_mkdir_config_t* config) {
     fbl::AutoLock lock(&vfs_lock_);
     const char* name = config->name;
     MountChannel h = MountChannel(config->fs_root);
-    mx_status_t r = OpenLocked(vn, &vn, name, &name,
+    zx_status_t r = OpenLocked(vn, &vn, name, &name,
                                O_CREAT | O_RDONLY | O_DIRECTORY | O_NOREMOTE, S_IFDIR);
-    MX_DEBUG_ASSERT(r <= MX_OK); // Should not be accessing remote nodes
+    ZX_DEBUG_ASSERT(r <= ZX_OK); // Should not be accessing remote nodes
     if (r < 0) {
         return r;
     }
@@ -81,40 +81,40 @@
         if (config->flags & MOUNT_MKDIR_FLAG_REPLACE) {
             // There is an old remote handle on this vnode; shut it down and
             // replace it with our own.
-            mx::channel old_remote;
+            zx::channel old_remote;
             Vfs::UninstallRemoteLocked(vn, &old_remote);
             vfs_unmount_handle(old_remote.release(), 0);
         } else {
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         }
     }
     return Vfs::InstallRemoteLocked(vn, fbl::move(h));
 }
 
-mx_status_t Vfs::UninstallRemote(fbl::RefPtr<Vnode> vn, mx::channel* h) {
+zx_status_t Vfs::UninstallRemote(fbl::RefPtr<Vnode> vn, zx::channel* h) {
     fbl::AutoLock lock(&vfs_lock_);
     return UninstallRemoteLocked(fbl::move(vn), h);
 }
 
 // Uninstall the remote filesystem mounted on vn. Removes vn from the
 // remote_list_, and sends its corresponding filesystem an 'unmount' signal.
-mx_status_t Vfs::UninstallRemoteLocked(fbl::RefPtr<Vnode> vn, mx::channel* h) {
+zx_status_t Vfs::UninstallRemoteLocked(fbl::RefPtr<Vnode> vn, zx::channel* h) {
     fbl::unique_ptr<MountNode> mount_point;
     {
         mount_point = remote_list_.erase_if([&vn](const MountNode& node) {
             return node.VnodeMatch(vn);
         });
         if (!mount_point) {
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
         }
     }
     *h = mount_point->ReleaseRemote();
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Uninstall all remote filesystems. Acts like 'UninstallRemote' for all
 // known remotes.
-mx_status_t Vfs::UninstallAll(mx_time_t deadline) {
+zx_status_t Vfs::UninstallAll(zx_time_t deadline) {
     fbl::unique_ptr<fs::MountNode> mount_point;
     for (;;) {
         {
@@ -124,7 +124,7 @@
         if (mount_point) {
             vfs_unmount_handle(mount_point->ReleaseRemote().release(), deadline);
         } else {
-            return MX_OK;
+            return ZX_OK;
         }
     }
 }
diff --git a/system/ulib/fs/rpc.cpp b/system/ulib/fs/rpc.cpp
index 8770bcc..4e15c7d 100644
--- a/system/ulib/fs/rpc.cpp
+++ b/system/ulib/fs/rpc.cpp
@@ -10,12 +10,12 @@
 #include <threads.h>
 
 #include <fs/vfs.h>
-#include <magenta/process.h>
-#include <mx/event.h>
-#include <mxio/debug.h>
-#include <mxio/io.h>
-#include <mxio/remoteio.h>
-#include <mxio/vfs.h>
+#include <zircon/process.h>
+#include <zx/event.h>
+#include <fdio/debug.h>
+#include <fdio/io.h>
+#include <fdio/remoteio.h>
+#include <fdio/vfs.h>
 #include <fbl/auto_lock.h>
 #include <fbl/ref_ptr.h>
 
@@ -26,9 +26,9 @@
     // The VFS state & dispatcher associated with this handle.
     fs::Vfs* vfs;
     // Handle to event which allows client to refer to open vnodes in multi-patt
-    // operations (see: link, rename). Defaults to MX_HANDLE_INVALID.
+    // operations (see: link, rename). Defaults to ZX_HANDLE_INVALID.
     // Validated on the server side using cookies.
-    mx::event token;
+    zx::event token;
     vdircookie_t dircookie;
     size_t io_off;
     uint32_t io_flags;
@@ -45,23 +45,23 @@
 namespace fs {
 namespace {
 
-static void txn_handoff_open(mx_handle_t srv, mx::channel channel,
+static void txn_handoff_open(zx_handle_t srv, zx::channel channel,
                              const char* path, uint32_t flags, uint32_t mode) {
-    mxrio_msg_t msg;
-    memset(&msg, 0, MXRIO_HDR_SZ);
+    zxrio_msg_t msg;
+    memset(&msg, 0, ZXRIO_HDR_SZ);
     size_t len = strlen(path);
-    msg.op = MXRIO_OPEN;
+    msg.op = ZXRIO_OPEN;
     msg.arg = flags;
     msg.arg2.mode = mode;
     msg.datalen = static_cast<uint32_t>(len) + 1;
     memcpy(msg.data, path, len + 1);
-    mxrio_txn_handoff(srv, channel.release(), &msg);
+    zxrio_txn_handoff(srv, channel.release(), &msg);
 }
 
 // Initializes io state for a vnode and attaches it to a dispatcher.
-void vfs_rpc_open(mxrio_msg_t* msg, mx::channel channel, fbl::RefPtr<Vnode> vn,
+void vfs_rpc_open(zxrio_msg_t* msg, zx::channel channel, fbl::RefPtr<Vnode> vn,
                   vfs_iostate_t* ios, const char* path, uint32_t flags, uint32_t mode) {
-    mx_status_t r;
+    zx_status_t r;
 
     // The pipeline directive instructs the VFS layer to open the vnode
     // immediately, rather than describing the VFS object to the caller.
@@ -71,7 +71,7 @@
 
     r = ios->vfs->Open(fbl::move(vn), &vn, path, &path, open_flags, mode);
 
-    mxrio_object_t obj;
+    zxrio_object_t obj;
     memset(&obj, 0, sizeof(obj));
     if (r < 0) {
         xprintf("vfs: open: r=%d\n", r);
@@ -96,7 +96,7 @@
         // If a pipeline open was requested, but extra handles are required, then
         // we cannot complete the open in a pipelined fashion.
         while (r-- > 0) {
-            mx_handle_close(obj.handle[r]);
+            zx_handle_close(obj.handle[r]);
         }
         vn->Close();
         return;
@@ -104,9 +104,9 @@
 
     if (!pipeline) {
         // Describe the VFS object to the caller in the non-pipelined case.
-        obj.status = (r < 0) ? r : MX_OK;
+        obj.status = (r < 0) ? r : ZX_OK;
         obj.hcount = (r > 0) ? r : 0;
-        channel.write(0, &obj, static_cast<uint32_t>(MXRIO_OBJECT_MINSIZE + obj.esize),
+        channel.write(0, &obj, static_cast<uint32_t>(ZXRIO_OBJECT_MINSIZE + obj.esize),
                       obj.handle, obj.hcount);
     }
 
@@ -117,22 +117,22 @@
     vn->Serve(ios->vfs, fbl::move(channel), open_flags);
 }
 
-void mxrio_reply_channel_status(mx::channel channel, mx_status_t status) {
+void zxrio_reply_channel_status(zx::channel channel, zx_status_t status) {
     struct {
-        mx_status_t status;
+        zx_status_t status;
         uint32_t type;
     } reply = {status, 0};
-    channel.write(0, &reply, MXRIO_OBJECT_MINSIZE, nullptr, 0);
+    channel.write(0, &reply, ZXRIO_OBJECT_MINSIZE, nullptr, 0);
 }
 
 } // namespace
 
-mx_status_t Vnode::Serve(fs::Vfs* vfs, mx::channel channel, uint32_t flags) {
-    mx_status_t r;
+zx_status_t Vnode::Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) {
+    zx_status_t r;
     vfs_iostate_t* ios;
 
     if ((ios = static_cast<vfs_iostate_t*>(calloc(1, sizeof(vfs_iostate_t)))) == nullptr) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     ios->vn = fbl::RefPtr<fs::Vnode>(this);
     ios->io_flags = flags;
@@ -142,23 +142,23 @@
         free(ios);
         return r;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Vfs::Serve(mx::channel channel, void* ios) {
+zx_status_t Vfs::Serve(zx::channel channel, void* ios) {
     return dispatcher_->AddVFSHandler(fbl::move(channel), vfs_handler, ios);
 }
 
-mx_status_t Vfs::ServeDirectory(fbl::RefPtr<fs::Vnode> vn,
-                                mx::channel channel) {
+zx_status_t Vfs::ServeDirectory(fbl::RefPtr<fs::Vnode> vn,
+                                zx::channel channel) {
     // Make sure the Vnode really is a directory.
-    mx_status_t r;
-    if ((r = vn->Open(O_DIRECTORY)) != MX_OK) {
+    zx_status_t r;
+    if ((r = vn->Open(O_DIRECTORY)) != ZX_OK) {
         return r;
     }
 
     // Tell the calling process that we've mounted the directory.
-    if ((r = channel.signal_peer(0, MX_USER_SIGNAL_0)) != MX_OK) {
+    if ((r = channel.signal_peer(0, ZX_USER_SIGNAL_0)) != ZX_OK) {
         return r;
     }
 
@@ -167,28 +167,28 @@
 
 } // namespace fs
 
-static mx_status_t vfs_handler_vn(mxrio_msg_t* msg, fbl::RefPtr<fs::Vnode> vn, vfs_iostate* ios) {
+static zx_status_t vfs_handler_vn(zxrio_msg_t* msg, fbl::RefPtr<fs::Vnode> vn, vfs_iostate* ios) {
     uint32_t len = msg->datalen;
     int32_t arg = msg->arg;
     msg->datalen = 0;
 
     // ensure handle count specified by opcode matches reality
-    if (msg->hcount != MXRIO_HC(msg->op)) {
+    if (msg->hcount != ZXRIO_HC(msg->op)) {
         for (unsigned i = 0; i < msg->hcount; i++) {
-            mx_handle_close(msg->handle[i]);
+            zx_handle_close(msg->handle[i]);
         }
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     msg->hcount = 0;
 
-    switch (MXRIO_OP(msg->op)) {
-    case MXRIO_OPEN: {
+    switch (ZXRIO_OP(msg->op)) {
+    case ZXRIO_OPEN: {
         char* path = (char*)msg->data;
-        mx::channel channel(msg->handle[0]); // take ownership
+        zx::channel channel(msg->handle[0]); // take ownership
         if ((len < 1) || (len > PATH_MAX)) {
-            fs::mxrio_reply_channel_status(fbl::move(channel), MX_ERR_INVALID_ARGS);
+            fs::zxrio_reply_channel_status(fbl::move(channel), ZX_ERR_INVALID_ARGS);
         } else if ((arg & O_ADMIN) && !(ios->io_flags & O_ADMIN)) {
-            fs::mxrio_reply_channel_status(fbl::move(channel), MX_ERR_ACCESS_DENIED);
+            fs::zxrio_reply_channel_status(fbl::move(channel), ZX_ERR_ACCESS_DENIED);
         } else {
             path[len] = 0;
             xprintf("vfs: open name='%s' flags=%d mode=%u\n", path, arg, msg->arg2.mode);
@@ -196,28 +196,28 @@
         }
         return ERR_DISPATCHER_INDIRECT;
     }
-    case MXRIO_CLOSE: {
+    case ZXRIO_CLOSE: {
         ios->vfs->TokenDiscard(&ios->token);
         // this will drop the ref on the vn
-        mx_status_t status = vn->Close();
+        zx_status_t status = vn->Close();
         ios->vn = nullptr;
         free(ios);
         return status;
     }
-    case MXRIO_CLONE: {
-        mx::channel channel(msg->handle[0]); // take ownership
+    case ZXRIO_CLONE: {
+        zx::channel channel(msg->handle[0]); // take ownership
         if (!(arg & O_PIPELINE)) {
-            mxrio_object_t obj;
-            memset(&obj, 0, MXRIO_OBJECT_MINSIZE);
-            obj.type = MXIO_PROTOCOL_REMOTE;
-            channel.write(0, &obj, MXRIO_OBJECT_MINSIZE, 0, 0);
+            zxrio_object_t obj;
+            memset(&obj, 0, ZXRIO_OBJECT_MINSIZE);
+            obj.type = FDIO_PROTOCOL_REMOTE;
+            channel.write(0, &obj, ZXRIO_OBJECT_MINSIZE, 0, 0);
         }
         vn->Serve(ios->vfs, fbl::move(channel), ios->io_flags);
         return ERR_DISPATCHER_INDIRECT;
     }
-    case MXRIO_READ: {
+    case ZXRIO_READ: {
         if (!readable(ios->io_flags)) {
-            return MX_ERR_BAD_HANDLE;
+            return ZX_ERR_BAD_HANDLE;
         }
         ssize_t r = vn->Read(msg->data, arg, ios->io_off);
         if (r >= 0) {
@@ -225,25 +225,25 @@
             msg->arg2.off = ios->io_off;
             msg->datalen = static_cast<uint32_t>(r);
         }
-        return static_cast<mx_status_t>(r);
+        return static_cast<zx_status_t>(r);
     }
-    case MXRIO_READ_AT: {
+    case ZXRIO_READ_AT: {
         if (!readable(ios->io_flags)) {
-            return MX_ERR_BAD_HANDLE;
+            return ZX_ERR_BAD_HANDLE;
         }
         ssize_t r = vn->Read(msg->data, arg, msg->arg2.off);
         if (r >= 0) {
             msg->datalen = static_cast<uint32_t>(r);
         }
-        return static_cast<mx_status_t>(r);
+        return static_cast<zx_status_t>(r);
     }
-    case MXRIO_WRITE: {
+    case ZXRIO_WRITE: {
         if (!writable(ios->io_flags)) {
-            return MX_ERR_BAD_HANDLE;
+            return ZX_ERR_BAD_HANDLE;
         }
         if (ios->io_flags & O_APPEND) {
             vnattr_t attr;
-            mx_status_t r;
+            zx_status_t r;
             if ((r = vn->Getattr(&attr)) < 0) {
                 return r;
             }
@@ -254,18 +254,18 @@
             ios->io_off += r;
             msg->arg2.off = ios->io_off;
         }
-        return static_cast<mx_status_t>(r);
+        return static_cast<zx_status_t>(r);
     }
-    case MXRIO_WRITE_AT: {
+    case ZXRIO_WRITE_AT: {
         if (!writable(ios->io_flags)) {
-            return MX_ERR_BAD_HANDLE;
+            return ZX_ERR_BAD_HANDLE;
         }
         ssize_t r = vn->Write(msg->data, len, msg->arg2.off);
-        return static_cast<mx_status_t>(r);
+        return static_cast<zx_status_t>(r);
     }
-    case MXRIO_SEEK: {
+    case ZXRIO_SEEK: {
         vnattr_t attr;
-        mx_status_t r;
+        zx_status_t r;
         if ((r = vn->Getattr(&attr)) < 0) {
             return r;
         }
@@ -273,7 +273,7 @@
         switch (arg) {
         case SEEK_SET:
             if (msg->arg2.off < 0) {
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
             n = msg->arg2.off;
             break;
@@ -283,13 +283,13 @@
                 // if negative seek
                 if (n > ios->io_off) {
                     // wrapped around. attempt to seek before start
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
             } else {
                 // positive seek
                 if (n < ios->io_off) {
                     // wrapped around. overflow
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
             }
             break;
@@ -299,63 +299,63 @@
                 // if negative seek
                 if (n > attr.size) {
                     // wrapped around. attempt to seek before start
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
             } else {
                 // positive seek
                 if (n < attr.size) {
                     // wrapped around
-                    return MX_ERR_INVALID_ARGS;
+                    return ZX_ERR_INVALID_ARGS;
                 }
             }
             break;
         default:
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         if (vn->IsDevice()) {
             if (n > attr.size) {
                 // devices may not seek past the end
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             }
         }
         ios->io_off = n;
         msg->arg2.off = ios->io_off;
-        return MX_OK;
+        return ZX_OK;
     }
-    case MXRIO_STAT: {
-        mx_status_t r;
+    case ZXRIO_STAT: {
+        zx_status_t r;
         msg->datalen = sizeof(vnattr_t);
         if ((r = vn->Getattr((vnattr_t*)msg->data)) < 0) {
             return r;
         }
         return msg->datalen;
     }
-    case MXRIO_SETATTR: {
-        mx_status_t r = vn->Setattr((vnattr_t*)msg->data);
+    case ZXRIO_SETATTR: {
+        zx_status_t r = vn->Setattr((vnattr_t*)msg->data);
         return r;
     }
-    case MXRIO_FCNTL: {
+    case ZXRIO_FCNTL: {
         uint32_t cmd = msg->arg;
         constexpr uint32_t kStatusFlags = O_APPEND;
         switch (cmd) {
         case F_GETFL:
             msg->arg2.mode = ios->io_flags & (kStatusFlags | O_ACCMODE);
-            return MX_OK;
+            return ZX_OK;
         case F_SETFL:
             ios->io_flags = (ios->io_flags & ~kStatusFlags) | (msg->arg2.mode & kStatusFlags);
-            return MX_OK;
+            return ZX_OK;
         default:
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
     }
-    case MXRIO_READDIR: {
-        if (arg > MXIO_CHUNK_SIZE) {
-            return MX_ERR_INVALID_ARGS;
+    case ZXRIO_READDIR: {
+        if (arg > FDIO_CHUNK_SIZE) {
+            return ZX_ERR_INVALID_ARGS;
         }
         if (msg->arg2.off == READDIR_CMD_RESET) {
             memset(&ios->dircookie, 0, sizeof(ios->dircookie));
         }
-        mx_status_t r;
+        zx_status_t r;
         {
             fbl::AutoLock lock(&ios->vfs->vfs_lock_);
             r = vn->Readdir(&ios->dircookie, msg->data, arg);
@@ -365,25 +365,25 @@
         }
         return r;
     }
-    case MXRIO_IOCTL_1H: {
-        if ((len > MXIO_IOCTL_MAX_INPUT) ||
+    case ZXRIO_IOCTL_1H: {
+        if ((len > FDIO_IOCTL_MAX_INPUT) ||
             (arg > (ssize_t)sizeof(msg->data)) ||
             (IOCTL_KIND(msg->arg2.op) != IOCTL_KIND_SET_HANDLE)) {
-            mx_handle_close(msg->handle[0]);
-            return MX_ERR_INVALID_ARGS;
+            zx_handle_close(msg->handle[0]);
+            return ZX_ERR_INVALID_ARGS;
         }
-        if (len < sizeof(mx_handle_t)) {
-            len = sizeof(mx_handle_t);
+        if (len < sizeof(zx_handle_t)) {
+            len = sizeof(zx_handle_t);
         }
 
-        char in_buf[MXIO_IOCTL_MAX_INPUT];
+        char in_buf[FDIO_IOCTL_MAX_INPUT];
         // The sending side copied the handle into msg->handle[0]
         // so that it would be sent via channel_write().  Here we
         // copy the local version back into the space in the buffer
         // that the original occupied.
-        memcpy(in_buf, msg->handle, sizeof(mx_handle_t));
-        memcpy(in_buf + sizeof(mx_handle_t), msg->data + sizeof(mx_handle_t),
-               len - sizeof(mx_handle_t));
+        memcpy(in_buf, msg->handle, sizeof(zx_handle_t));
+        memcpy(in_buf + sizeof(zx_handle_t), msg->data + sizeof(zx_handle_t),
+               len - sizeof(zx_handle_t));
 
         switch (msg->arg2.op) {
         case IOCTL_VFS_MOUNT_FS:
@@ -391,41 +391,41 @@
             // Mounting requires iostate privileges
             if (!(ios->io_flags & O_ADMIN)) {
                 vfs_unmount_handle(msg->handle[0], 0);
-                mx_handle_close(msg->handle[0]);
-                return MX_ERR_ACCESS_DENIED;
+                zx_handle_close(msg->handle[0]);
+                return ZX_ERR_ACCESS_DENIED;
             }
             // If our permissions validate, fall through to the VFS ioctl
         }
         ssize_t r = ios->vfs->Ioctl(fbl::move(vn), msg->arg2.op, in_buf, len,
                                     msg->data, arg);
 
-        if (r == MX_ERR_NOT_SUPPORTED) {
-            mx_handle_close(msg->handle[0]);
+        if (r == ZX_ERR_NOT_SUPPORTED) {
+            zx_handle_close(msg->handle[0]);
         }
 
-        return static_cast<mx_status_t>(r);
+        return static_cast<zx_status_t>(r);
     }
-    case MXRIO_IOCTL: {
-        if (len > MXIO_IOCTL_MAX_INPUT ||
+    case ZXRIO_IOCTL: {
+        if (len > FDIO_IOCTL_MAX_INPUT ||
             (arg > (ssize_t)sizeof(msg->data)) ||
             (IOCTL_KIND(msg->arg2.op) == IOCTL_KIND_SET_HANDLE)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
-        char in_buf[MXIO_IOCTL_MAX_INPUT];
+        char in_buf[FDIO_IOCTL_MAX_INPUT];
         memcpy(in_buf, msg->data, len);
 
         ssize_t r;
         switch (msg->arg2.op) {
         case IOCTL_VFS_GET_TOKEN: {
             // Ioctls which act on iostate
-            if (arg != sizeof(mx_handle_t)) {
-                r = MX_ERR_INVALID_ARGS;
+            if (arg != sizeof(zx_handle_t)) {
+                r = ZX_ERR_INVALID_ARGS;
             } else {
-                mx::event token;
+                zx::event token;
                 r = ios->vfs->VnodeToToken(fbl::move(vn), &ios->token, &token);
-                if (r == MX_OK) {
-                    r = sizeof(mx_handle_t);
-                    mx_handle_t* out = reinterpret_cast<mx_handle_t*>(msg->data);
+                if (r == ZX_OK) {
+                    r = sizeof(zx_handle_t);
+                    zx_handle_t* out = reinterpret_cast<zx_handle_t*>(msg->data);
                     *out = token.release();
                 }
             }
@@ -436,7 +436,7 @@
         case IOCTL_VFS_GET_DEVICE_PATH:
             // Unmounting ioctls require iostate privileges
             if (!(ios->io_flags & O_ADMIN)) {
-                r = MX_ERR_ACCESS_DENIED;
+                r = ZX_ERR_ACCESS_DENIED;
                 break;
             }
             // If our permissions validate, fall through to the VFS ioctl
@@ -449,15 +449,15 @@
                 break;
             case IOCTL_KIND_GET_HANDLE:
                 msg->hcount = 1;
-                memcpy(msg->handle, msg->data, sizeof(mx_handle_t));
+                memcpy(msg->handle, msg->data, sizeof(zx_handle_t));
                 break;
             case IOCTL_KIND_GET_TWO_HANDLES:
                 msg->hcount = 2;
-                memcpy(msg->handle, msg->data, 2 * sizeof(mx_handle_t));
+                memcpy(msg->handle, msg->data, 2 * sizeof(zx_handle_t));
                 break;
             case IOCTL_KIND_GET_THREE_HANDLES:
                 msg->hcount = 3;
-                memcpy(msg->handle, msg->data, 3 * sizeof(mx_handle_t));
+                memcpy(msg->handle, msg->data, 3 * sizeof(zx_handle_t));
                 break;
             }
             msg->arg2.off = 0;
@@ -465,23 +465,23 @@
         }
         return static_cast<uint32_t>(r);
     }
-    case MXRIO_TRUNCATE: {
+    case ZXRIO_TRUNCATE: {
         if (!writable(ios->io_flags)) {
-            return MX_ERR_BAD_HANDLE;
+            return ZX_ERR_BAD_HANDLE;
         }
         if (msg->arg2.off < 0) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         return vn->Truncate(msg->arg2.off);
     }
-    case MXRIO_RENAME:
-    case MXRIO_LINK: {
+    case ZXRIO_RENAME:
+    case ZXRIO_LINK: {
         // Regardless of success or failure, we'll close the client-provided
         // vnode token handle.
-        mx::event token(msg->handle[0]);
+        zx::event token(msg->handle[0]);
 
         if (len < 4) { // At least one byte for src + dst + null terminators
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         char* data_end = (char*)(msg->data + len - 1);
@@ -491,50 +491,50 @@
         const char* newname = (const char*)msg->data + (oldlen + 1);
 
         if (data_end <= newname) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
-        switch (MXRIO_OP(msg->op)) {
-        case MXRIO_RENAME:
+        switch (ZXRIO_OP(msg->op)) {
+        case ZXRIO_RENAME:
             return ios->vfs->Rename(fbl::move(token), fbl::move(vn),
                                     oldname, newname);
-        case MXRIO_LINK:
+        case ZXRIO_LINK:
             return ios->vfs->Link(fbl::move(token), fbl::move(vn),
                                   oldname, newname);
         }
         assert(false);
     }
-    case MXRIO_MMAP: {
-        if (len != sizeof(mxrio_mmap_data_t)) {
-            return MX_ERR_INVALID_ARGS;
+    case ZXRIO_MMAP: {
+        if (len != sizeof(zxrio_mmap_data_t)) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        mxrio_mmap_data_t* data = reinterpret_cast<mxrio_mmap_data_t*>(msg->data);
-        if (ios->io_flags & O_APPEND && data->flags & MXIO_MMAP_FLAG_WRITE) {
-            return MX_ERR_ACCESS_DENIED;
-        } else if (!writable(ios->io_flags) && (data->flags & MXIO_MMAP_FLAG_WRITE)) {
-            return MX_ERR_ACCESS_DENIED;
+        zxrio_mmap_data_t* data = reinterpret_cast<zxrio_mmap_data_t*>(msg->data);
+        if (ios->io_flags & O_APPEND && data->flags & FDIO_MMAP_FLAG_WRITE) {
+            return ZX_ERR_ACCESS_DENIED;
+        } else if (!writable(ios->io_flags) && (data->flags & FDIO_MMAP_FLAG_WRITE)) {
+            return ZX_ERR_ACCESS_DENIED;
         } else if (!readable(ios->io_flags)) {
-            return MX_ERR_ACCESS_DENIED;
+            return ZX_ERR_ACCESS_DENIED;
         }
 
-        mx_status_t status = vn->Mmap(data->flags, data->length, &data->offset,
+        zx_status_t status = vn->Mmap(data->flags, data->length, &data->offset,
                                       &msg->handle[0]);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             msg->hcount = 1;
         }
         return status;
     }
-    case MXRIO_SYNC: {
+    case ZXRIO_SYNC: {
         return vn->Sync();
     }
-    case MXRIO_UNLINK:
+    case ZXRIO_UNLINK:
         return ios->vfs->Unlink(fbl::move(vn), (const char*)msg->data, len);
     default:
         // close inbound handles so they do not leak
-        for (unsigned i = 0; i < MXRIO_HC(msg->op); i++) {
-            mx_handle_close(msg->handle[i]);
+        for (unsigned i = 0; i < ZXRIO_HC(msg->op); i++) {
+            zx_handle_close(msg->handle[i]);
         }
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -542,11 +542,11 @@
 // make locking more fine grained
 static mtx_t vfs_big_lock = MTX_INIT;
 
-mx_status_t vfs_handler(mxrio_msg_t* msg, void* cookie) {
+zx_status_t vfs_handler(zxrio_msg_t* msg, void* cookie) {
     vfs_iostate_t* ios = static_cast<vfs_iostate_t*>(cookie);
 
     fbl::AutoLock lock(&vfs_big_lock);
     fbl::RefPtr<fs::Vnode> vn = ios->vn;
-    mx_status_t status = vfs_handler_vn(msg, fbl::move(vn), ios);
+    zx_status_t status = vfs_handler_vn(msg, fbl::move(vn), ios);
     return status;
 }
diff --git a/system/ulib/fs/rules.mk b/system/ulib/fs/rules.mk
index e0349e5..2a90af7 100644
--- a/system/ulib/fs/rules.mk
+++ b/system/ulib/fs/rules.mk
@@ -20,14 +20,14 @@
 MODULE_STATIC_LIBS := \
     system/ulib/async \
     system/ulib/async.loop \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/async.default \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/ulib/fs/unmount.cpp b/system/ulib/fs/unmount.cpp
index b3fd9c3..fc7011e 100644
--- a/system/ulib/fs/unmount.cpp
+++ b/system/ulib/fs/unmount.cpp
@@ -3,9 +3,9 @@
 // found in the LICENSE file.
 
 #include <fs/vfs.h>
-#include <mxio/debug.h>
-#include <mxio/remoteio.h>
-#include <mxio/vfs.h>
+#include <fdio/debug.h>
+#include <fdio/remoteio.h>
+#include <fdio/vfs.h>
 
 #include <stdlib.h>
 #include <string.h>
@@ -13,47 +13,47 @@
 
 // Sends an 'unmount' signal on the srv handle, and waits until it is closed.
 // Consumes 'srv'.
-mx_status_t vfs_unmount_handle(mx_handle_t srv, mx_time_t deadline) {
-    mxrio_msg_t msg;
-    memset(&msg, 0, MXRIO_HDR_SZ);
+zx_status_t vfs_unmount_handle(zx_handle_t srv, zx_time_t deadline) {
+    zxrio_msg_t msg;
+    memset(&msg, 0, ZXRIO_HDR_SZ);
 
     // the only other messages we ever send are no-reply OPEN or CLONE with
     // txid of 0.
     msg.txid = 1;
-    msg.op = MXRIO_IOCTL;
+    msg.op = ZXRIO_IOCTL;
     msg.arg2.op = IOCTL_VFS_UNMOUNT_FS;
 
-    mx_channel_call_args_t args;
+    zx_channel_call_args_t args;
     args.wr_bytes = &msg;
     args.wr_handles = NULL;
     args.rd_bytes = &msg;
     args.rd_handles = NULL;
-    args.wr_num_bytes = MXRIO_HDR_SZ;
+    args.wr_num_bytes = ZXRIO_HDR_SZ;
     args.wr_num_handles = 0;
-    args.rd_num_bytes = MXRIO_HDR_SZ + MXIO_CHUNK_SIZE;
+    args.rd_num_bytes = ZXRIO_HDR_SZ + FDIO_CHUNK_SIZE;
     args.rd_num_handles = 0;
 
     uint32_t dsize;
     uint32_t hcount;
-    mx_status_t rs;
+    zx_status_t rs;
 
     // At the moment, we don't actually care what the response is from the
     // filesystem server (or even if it supports the unmount operation). As
     // soon as ANY response comes back, either in the form of a closed handle
     // or a visible response, shut down.
-    mx_status_t status = mx_channel_call(srv, 0, deadline, &args, &dsize, &hcount, &rs);
-    if (status == MX_ERR_CALL_FAILED) {
+    zx_status_t status = zx_channel_call(srv, 0, deadline, &args, &dsize, &hcount, &rs);
+    if (status == ZX_ERR_CALL_FAILED) {
         // Write phase succeeded. The target filesystem had a chance to unmount properly.
-        status = MX_OK;
-    } else if (status == MX_OK) {
+        status = ZX_OK;
+    } else if (status == ZX_OK) {
         // Read phase succeeded. If the target filesystem returned an error, we
         // should parse it.
-        if (dsize < MXRIO_HDR_SZ) {
-            status = MX_ERR_IO;
+        if (dsize < ZXRIO_HDR_SZ) {
+            status = ZX_ERR_IO;
         } else {
             status = msg.arg;
         }
     }
-    mx_handle_close(srv);
+    zx_handle_close(srv);
     return status;
 }
diff --git a/system/ulib/fs/vfs.cpp b/system/ulib/fs/vfs.cpp
index b6f74b8..980c76d 100644
--- a/system/ulib/fs/vfs.cpp
+++ b/system/ulib/fs/vfs.cpp
@@ -7,16 +7,16 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <mxio/remoteio.h>
-#include <mxio/watcher.h>
+#include <fdio/remoteio.h>
+#include <fdio/watcher.h>
 #include <fbl/auto_call.h>
 
 #ifdef __Fuchsia__
 #include <threads.h>
-#include <magenta/assert.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <mx/event.h>
+#include <zircon/assert.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zx/event.h>
 #include <fbl/auto_lock.h>
 #include <fbl/ref_ptr.h>
 #include <fs/remote.h>
@@ -45,7 +45,7 @@
 
 // Trim a name before sending it to internal filesystem functions.
 // Trailing '/' characters imply that the name must refer to a directory.
-mx_status_t vfs_name_trim(const char* name, size_t len, size_t* len_out, bool* dir_out) {
+zx_status_t vfs_name_trim(const char* name, size_t len, size_t* len_out, bool* dir_out) {
     bool is_dir = false;
     while ((len > 0) && name[len - 1] == '/') {
         len--;
@@ -54,40 +54,40 @@
 
     // 'name' should not contain paths consisting of exclusively '/' characters.
     if (len == 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     } else if (len > NAME_MAX) {
-        return MX_ERR_BAD_PATH;
+        return ZX_ERR_BAD_PATH;
     }
 
     *len_out = len;
     *dir_out = is_dir;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t vfs_lookup(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
+zx_status_t vfs_lookup(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
                        const char* name, size_t len) {
     if (is_dot_dot(name, len)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     } else if (is_dot(name, len)) {
         *out = fbl::move(vn);
-        return MX_OK;
+        return ZX_OK;
     }
     return vn->Lookup(out, name, len);
 }
 
 // Validate open flags as much as they can be validated
 // independently of the target node.
-mx_status_t vfs_validate_flags(uint32_t flags) {
+zx_status_t vfs_validate_flags(uint32_t flags) {
     switch (flags & 3) {
     case O_RDONLY:
         if (flags & O_TRUNC) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
     case O_WRONLY:
     case O_RDWR:
-        return MX_OK;
+        return ZX_OK;
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 }
 
@@ -99,27 +99,27 @@
     return remote_.is_valid();
 }
 
-mx::channel RemoteContainer::DetachRemote(uint32_t &flags_) {
+zx::channel RemoteContainer::DetachRemote(uint32_t &flags_) {
     flags_ &= ~VFS_FLAG_MOUNT_READY;
     return fbl::move(remote_);
 }
 
 // Access the remote handle if it's ready -- otherwise, return an error.
-mx_handle_t RemoteContainer::WaitForRemote(uint32_t &flags_) {
+zx_handle_t RemoteContainer::WaitForRemote(uint32_t &flags_) {
     if (!remote_.is_valid()) {
         // Trying to get remote on a non-remote vnode
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     } else if (!(flags_ & VFS_FLAG_MOUNT_READY)) {
-        mx_signals_t observed;
-        mx_status_t status = remote_.wait_one(MX_USER_SIGNAL_0 | MX_CHANNEL_PEER_CLOSED,
+        zx_signals_t observed;
+        zx_status_t status = remote_.wait_one(ZX_USER_SIGNAL_0 | ZX_CHANNEL_PEER_CLOSED,
                                               0,
                                               &observed);
         // Not set (or otherwise remote is bad)
         // TODO(planders): Add a background thread that waits on all remotes
-        if (observed & MX_CHANNEL_PEER_CLOSED) {
-            return MX_ERR_PEER_CLOSED;
-        } else if ((status != MX_OK)) {
-            return MX_ERR_UNAVAILABLE;
+        if (observed & ZX_CHANNEL_PEER_CLOSED) {
+            return ZX_ERR_PEER_CLOSED;
+        } else if ((status != ZX_OK)) {
+            return ZX_ERR_UNAVAILABLE;
         }
 
         flags_ |= VFS_FLAG_MOUNT_READY;
@@ -127,12 +127,12 @@
     return remote_.get();
 }
 
-mx_handle_t RemoteContainer::GetRemote() const {
+zx_handle_t RemoteContainer::GetRemote() const {
     return remote_.get();
 }
 
-void RemoteContainer::SetRemote(mx::channel remote) {
-    MX_DEBUG_ASSERT(!remote_.is_valid());
+void RemoteContainer::SetRemote(zx::channel remote) {
+    ZX_DEBUG_ASSERT(!remote_.is_valid());
     remote_ = fbl::move(remote);
 }
 
@@ -144,7 +144,7 @@
 Vfs::Vfs(Dispatcher* dispatcher) : dispatcher_(dispatcher) {}
 #endif
 
-mx_status_t Vfs::Open(fbl::RefPtr<Vnode> vndir, fbl::RefPtr<Vnode>* out,
+zx_status_t Vfs::Open(fbl::RefPtr<Vnode> vndir, fbl::RefPtr<Vnode>* out,
                       const char* path, const char** pathout, uint32_t flags,
                       uint32_t mode) {
 #ifdef __Fuchsia__
@@ -153,12 +153,12 @@
     return OpenLocked(fbl::move(vndir), out, path, pathout, flags, mode);
 }
 
-mx_status_t Vfs::OpenLocked(fbl::RefPtr<Vnode> vndir, fbl::RefPtr<Vnode>* out,
+zx_status_t Vfs::OpenLocked(fbl::RefPtr<Vnode> vndir, fbl::RefPtr<Vnode>* out,
                             const char* path, const char** pathout, uint32_t flags,
                             uint32_t mode) {
     FS_TRACE(VFS, "VfsOpen: path='%s' flags=%d\n", path, flags);
-    mx_status_t r;
-    if ((r = vfs_validate_flags(flags)) != MX_OK) {
+    zx_status_t r;
+    if ((r = vfs_validate_flags(flags)) != ZX_OK) {
         return r;
     }
     if ((r = Vfs::Walk(vndir, &vndir, path, &path)) < 0) {
@@ -174,24 +174,24 @@
     fbl::RefPtr<Vnode> vn;
 
     bool must_be_dir = false;
-    if ((r = vfs_name_trim(path, len, &len, &must_be_dir)) != MX_OK) {
+    if ((r = vfs_name_trim(path, len, &len, &must_be_dir)) != ZX_OK) {
         return r;
     } else if (is_dot_dot(path, len)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (flags & O_CREAT) {
         if (must_be_dir && !S_ISDIR(mode)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         } else if (is_dot(path, len)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         if ((r = vndir->Create(&vn, path, len, mode)) < 0) {
-            if ((r == MX_ERR_ALREADY_EXISTS) && (!(flags & O_EXCL))) {
+            if ((r == ZX_ERR_ALREADY_EXISTS) && (!(flags & O_EXCL))) {
                 goto try_open;
             }
-            if (r == MX_ERR_NOT_SUPPORTED) {
+            if (r == ZX_ERR_NOT_SUPPORTED) {
                 // filesystem may not support create (like devfs)
                 // in which case we should still try to open() the file
                 goto try_open;
@@ -211,7 +211,7 @@
             // Devices are different, even though they also have remotes.  Ignore them.
             *pathout = ".";
 
-            if ((r = Vfs::WaitForRemoteLocked(vn)) != MX_ERR_PEER_CLOSED) {
+            if ((r = Vfs::WaitForRemoteLocked(vn)) != ZX_ERR_PEER_CLOSED) {
                 return r;
             }
         }
@@ -235,18 +235,18 @@
     FS_TRACE(VFS, "VfsOpen: vn=%p\n", vn.get());
     *pathout = "";
     *out = vn;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Vfs::Unlink(fbl::RefPtr<Vnode> vndir, const char* path, size_t len) {
+zx_status_t Vfs::Unlink(fbl::RefPtr<Vnode> vndir, const char* path, size_t len) {
     bool must_be_dir;
-    mx_status_t r;
-    if ((r = vfs_name_trim(path, len, &len, &must_be_dir)) != MX_OK) {
+    zx_status_t r;
+    if ((r = vfs_name_trim(path, len, &len, &must_be_dir)) != ZX_OK) {
         return r;
     } else if (is_dot(path, len)) {
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     } else if (is_dot_dot(path, len)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     {
@@ -255,18 +255,18 @@
 #endif
         r = vndir->Unlink(path, len, must_be_dir);
     }
-    if (r != MX_OK) {
+    if (r != ZX_OK) {
         return r;
     }
     vndir->Notify(path, len, VFS_WATCH_EVT_REMOVED);
-    return MX_OK;
+    return ZX_OK;
 }
 
 #ifdef __Fuchsia__
 
-#define TOKEN_RIGHTS (MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER)
+#define TOKEN_RIGHTS (ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER)
 
-void Vfs::TokenDiscard(mx::event* ios_token) {
+void Vfs::TokenDiscard(zx::event* ios_token) {
     fbl::AutoLock lock(&vfs_lock_);
     if (ios_token->is_valid()) {
         // The token is nullified here to prevent the following race condition:
@@ -278,103 +278,103 @@
         //
         // By nullifying the token cookie, any remaining handles to the event will
         // be ignored by the filesystem server.
-        ios_token->set_cookie(mx_process_self(), 0);
+        ios_token->set_cookie(zx_process_self(), 0);
         ios_token->reset();
     }
 }
 
-mx_status_t Vfs::VnodeToToken(fbl::RefPtr<Vnode> vn, mx::event* ios_token,
-                              mx::event* out) {
+zx_status_t Vfs::VnodeToToken(fbl::RefPtr<Vnode> vn, zx::event* ios_token,
+                              zx::event* out) {
     uint64_t vnode_cookie = reinterpret_cast<uint64_t>(vn.get());
-    mx_status_t r;
+    zx_status_t r;
 
     fbl::AutoLock lock(&vfs_lock_);
     if (ios_token->is_valid()) {
         // Token has already been set for this iostate
-        if ((r = ios_token->duplicate(TOKEN_RIGHTS, out) != MX_OK)) {
+        if ((r = ios_token->duplicate(TOKEN_RIGHTS, out) != ZX_OK)) {
             return r;
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx::event new_token;
-    mx::event new_ios_token;
-    if ((r = mx::event::create(0, &new_ios_token)) != MX_OK) {
+    zx::event new_token;
+    zx::event new_ios_token;
+    if ((r = zx::event::create(0, &new_ios_token)) != ZX_OK) {
         return r;
-    } else if ((r = new_ios_token.duplicate(TOKEN_RIGHTS, &new_token) != MX_OK)) {
+    } else if ((r = new_ios_token.duplicate(TOKEN_RIGHTS, &new_token) != ZX_OK)) {
         return r;
-    } else if ((r = new_ios_token.set_cookie(mx_process_self(), vnode_cookie)) != MX_OK) {
+    } else if ((r = new_ios_token.set_cookie(zx_process_self(), vnode_cookie)) != ZX_OK) {
         return r;
     }
     *ios_token = fbl::move(new_ios_token);
     *out = fbl::move(new_token);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Vfs::TokenToVnode(mx::event token, fbl::RefPtr<Vnode>* out) {
+zx_status_t Vfs::TokenToVnode(zx::event token, fbl::RefPtr<Vnode>* out) {
     uint64_t vcookie;
-    mx_status_t r;
-    if ((r = token.get_cookie(mx_process_self(), &vcookie)) < 0) {
+    zx_status_t r;
+    if ((r = token.get_cookie(zx_process_self(), &vcookie)) < 0) {
         // TODO(smklein): Return a more specific error code for "token not from this server"
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (vcookie == 0) {
         // Client closed the channel associated with the token
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     *out = fbl::RefPtr<fs::Vnode>(reinterpret_cast<fs::Vnode*>(vcookie));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Vfs::Rename(mx::event token, fbl::RefPtr<Vnode> oldparent,
+zx_status_t Vfs::Rename(zx::event token, fbl::RefPtr<Vnode> oldparent,
                         const char* oldname, const char* newname) {
     // Local filesystem
     size_t oldlen = strlen(oldname);
     size_t newlen = strlen(newname);
     bool old_must_be_dir;
     bool new_must_be_dir;
-    mx_status_t r;
-    if ((r = vfs_name_trim(oldname, oldlen, &oldlen, &old_must_be_dir)) != MX_OK) {
+    zx_status_t r;
+    if ((r = vfs_name_trim(oldname, oldlen, &oldlen, &old_must_be_dir)) != ZX_OK) {
         return r;
     } else if (is_dot(oldname, oldlen)) {
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     } else if (is_dot_dot(oldname, oldlen)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
 
-    if ((r = vfs_name_trim(newname, newlen, &newlen, &new_must_be_dir)) != MX_OK) {
+    if ((r = vfs_name_trim(newname, newlen, &newlen, &new_must_be_dir)) != ZX_OK) {
         return r;
     } else if (is_dot_or_dot_dot(newname, newlen)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     fbl::RefPtr<fs::Vnode> newparent;
     {
         fbl::AutoLock lock(&vfs_lock_);
-        if ((r = TokenToVnode(fbl::move(token), &newparent)) != MX_OK) {
+        if ((r = TokenToVnode(fbl::move(token), &newparent)) != ZX_OK) {
             return r;
         }
 
         r = oldparent->Rename(newparent, oldname, oldlen, newname, newlen,
                               old_must_be_dir, new_must_be_dir);
     }
-    if (r != MX_OK) {
+    if (r != ZX_OK) {
         return r;
     }
     oldparent->Notify(oldname, oldlen, VFS_WATCH_EVT_REMOVED);
     newparent->Notify(newname, newlen, VFS_WATCH_EVT_ADDED);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t Vfs::Link(mx::event token, fbl::RefPtr<Vnode> oldparent,
+zx_status_t Vfs::Link(zx::event token, fbl::RefPtr<Vnode> oldparent,
                       const char* oldname, const char* newname) {
     fbl::AutoLock lock(&vfs_lock_);
     fbl::RefPtr<fs::Vnode> newparent;
-    mx_status_t r;
-    if ((r = TokenToVnode(fbl::move(token), &newparent)) != MX_OK) {
+    zx_status_t r;
+    if ((r = TokenToVnode(fbl::move(token), &newparent)) != ZX_OK) {
         return r;
     }
     // Local filesystem
@@ -382,22 +382,22 @@
     size_t newlen = strlen(newname);
     bool old_must_be_dir;
     bool new_must_be_dir;
-    if ((r = vfs_name_trim(oldname, oldlen, &oldlen, &old_must_be_dir)) != MX_OK) {
+    if ((r = vfs_name_trim(oldname, oldlen, &oldlen, &old_must_be_dir)) != ZX_OK) {
         return r;
     } else if (old_must_be_dir) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     } else if (is_dot(oldname, oldlen)) {
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     } else if (is_dot_dot(oldname, oldlen)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
-    if ((r = vfs_name_trim(newname, newlen, &newlen, &new_must_be_dir)) != MX_OK) {
+    if ((r = vfs_name_trim(newname, newlen, &newlen, &new_must_be_dir)) != ZX_OK) {
         return r;
     } else if (new_must_be_dir) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     } else if (is_dot_or_dot_dot(newname, newlen)) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // Look up the target vnode
@@ -406,21 +406,21 @@
         return r;
     }
     r = newparent->Link(newname, newlen, target);
-    if (r != MX_OK) {
+    if (r != ZX_OK) {
         return r;
     }
     newparent->Notify(newname, newlen, VFS_WATCH_EVT_ADDED);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_handle_t Vfs::WaitForRemoteLocked(fbl::RefPtr<Vnode> vn) {
-    mx_handle_t h = vn->WaitForRemote();
+zx_handle_t Vfs::WaitForRemoteLocked(fbl::RefPtr<Vnode> vn) {
+    zx_handle_t h = vn->WaitForRemote();
 
-    if (h == MX_ERR_PEER_CLOSED) {
+    if (h == ZX_ERR_PEER_CLOSED) {
         printf("VFS: Remote filesystem channel closed, unmounting\n");
-        mx::channel c;
-        mx_status_t status;
-        if ((status = Vfs::UninstallRemoteLocked(vn, &c)) != MX_OK) {
+        zx::channel c;
+        zx_status_t status;
+        if ((status = Vfs::UninstallRemoteLocked(vn, &c)) != ZX_OK) {
             return status;
         }
     }
@@ -436,16 +436,16 @@
 #ifdef __Fuchsia__
     case IOCTL_VFS_WATCH_DIR: {
         if (in_len != sizeof(vfs_watch_dir_t)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         const vfs_watch_dir_t* request = reinterpret_cast<const vfs_watch_dir_t*>(in_buf);
         return vn->WatchDirV2(this, request);
     }
     case IOCTL_VFS_MOUNT_FS: {
-        if ((in_len != sizeof(mx_handle_t)) || (out_len != 0)) {
-            return MX_ERR_INVALID_ARGS;
+        if ((in_len != sizeof(zx_handle_t)) || (out_len != 0)) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        MountChannel h = MountChannel(*reinterpret_cast<const mx_handle_t*>(in_buf));
+        MountChannel h = MountChannel(*reinterpret_cast<const zx_handle_t*>(in_buf));
         return Vfs::InstallRemote(vn, fbl::move(h));
     }
     case IOCTL_VFS_MOUNT_MKDIR_FS: {
@@ -455,25 +455,25 @@
         if ((in_len < sizeof(mount_mkdir_config_t)) ||
             (namelen < 1) || (namelen > PATH_MAX) || (name[namelen - 1] != 0) ||
             (out_len != 0)) {
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
 
         return Vfs::MountMkdir(fbl::move(vn), config);
     }
     case IOCTL_VFS_UNMOUNT_NODE: {
-        if ((in_len != 0) || (out_len != sizeof(mx_handle_t))) {
-            return MX_ERR_INVALID_ARGS;
+        if ((in_len != 0) || (out_len != sizeof(zx_handle_t))) {
+            return ZX_ERR_INVALID_ARGS;
         }
-        mx_handle_t* h = (mx_handle_t*)out_buf;
-        mx::channel c;
-        mx_status_t s = Vfs::UninstallRemote(vn, &c);
+        zx_handle_t* h = (zx_handle_t*)out_buf;
+        zx::channel c;
+        zx_status_t s = Vfs::UninstallRemote(vn, &c);
         *h = c.release();
         return s;
     }
     case IOCTL_VFS_UNMOUNT_FS: {
-        Vfs::UninstallAll(MX_TIME_INFINITE);
+        Vfs::UninstallAll(ZX_TIME_INFINITE);
         vn->Ioctl(op, in_buf, in_len, out_buf, out_len);
-        return MX_OK;
+        return ZX_OK;
     }
 #endif
     default:
@@ -481,14 +481,14 @@
     }
 }
 
-mx_status_t Vnode::Close() {
-    return MX_OK;
+zx_status_t Vnode::Close() {
+    return ZX_OK;
 }
 
 DirentFiller::DirentFiller(void* ptr, size_t len) :
     ptr_(static_cast<char*>(ptr)), pos_(0), len_(len) {}
 
-mx_status_t DirentFiller::Next(const char* name, size_t len, uint32_t type) {
+zx_status_t DirentFiller::Next(const char* name, size_t len, uint32_t type) {
     vdirent_t* de = reinterpret_cast<vdirent_t*>(ptr_ + pos_);
     size_t sz = sizeof(vdirent_t) + len + 1;
 
@@ -497,14 +497,14 @@
         sz = (sz + 3) & (~3);
     }
     if (sz > len_ - pos_) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     de->size = static_cast<uint32_t>(sz);
     de->type = type;
     memcpy(de->name, name, len);
     de->name[len] = 0;
     pos_ += sz;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Starting at vnode vn, walk the tree described by the path string,
@@ -513,9 +513,9 @@
 //
 // If a non-negative status is returned, the vnode at 'out' has been acquired.
 // Otherwise, no net deltas in acquires/releases occur.
-mx_status_t Vfs::Walk(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
+zx_status_t Vfs::Walk(fbl::RefPtr<Vnode> vn, fbl::RefPtr<Vnode>* out,
                       const char* path, const char** pathout) {
-    mx_status_t r;
+    zx_status_t r;
 
     for (;;) {
         while (path[0] == '/') {
@@ -531,7 +531,7 @@
             // remote filesystem mount, caller must resolve
             // devices are different, so ignore them even though they can have vn->remote
             r = Vfs::WaitForRemoteLocked(vn);
-            if (r != MX_ERR_PEER_CLOSED) {
+            if (r != ZX_ERR_PEER_CLOSED) {
                 if (r >= 0) {
                     *out = vn;
                     *pathout = path;
@@ -566,7 +566,7 @@
             // final path segment, we're done here
             *out = vn;
             *pathout = path;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 }
diff --git a/system/ulib/fs/watcher.cpp b/system/ulib/fs/watcher.cpp
index 38629e8..8a8cbd3 100644
--- a/system/ulib/fs/watcher.cpp
+++ b/system/ulib/fs/watcher.cpp
@@ -9,22 +9,22 @@
 #include <unistd.h>
 
 #ifdef __Fuchsia__
-#include <magenta/device/vfs.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/vfs.h>
+#include <zircon/syscalls.h>
 #include <fbl/auto_lock.h>
 #endif
 
 #include <fbl/alloc_checker.h>
 #include <fs/vfs.h>
 #include <fs/watcher.h>
-#include <mx/channel.h>
+#include <zx/channel.h>
 
 namespace fs {
 
 WatcherContainer::WatcherContainer() = default;
 WatcherContainer::~WatcherContainer() = default;
 
-WatcherContainer::VnodeWatcher::VnodeWatcher(mx::channel h, uint32_t mask) : h(fbl::move(h)),
+WatcherContainer::VnodeWatcher::VnodeWatcher(zx::channel h, uint32_t mask) : h(fbl::move(h)),
     mask(mask & ~(VFS_WATCH_MASK_EXISTING | VFS_WATCH_MASK_IDLE)) {}
 
 WatcherContainer::VnodeWatcher::~VnodeWatcher() {}
@@ -37,21 +37,21 @@
     DISALLOW_COPY_ASSIGN_AND_MOVE(WatchBuffer);
     WatchBuffer() = default;
 
-    mx_status_t AddMsg(const mx::channel& c, unsigned event, const char* name);
-    mx_status_t Send(const mx::channel& c);
+    zx_status_t AddMsg(const zx::channel& c, unsigned event, const char* name);
+    zx_status_t Send(const zx::channel& c);
 
 private:
     size_t watch_buf_size_ = 0;
     char watch_buf_[VFS_WATCH_MSG_MAX]{};
 };
 
-mx_status_t WatchBuffer::AddMsg(const mx::channel& c, unsigned event, const char* name) {
+zx_status_t WatchBuffer::AddMsg(const zx::channel& c, unsigned event, const char* name) {
     size_t slen = strlen(name);
     size_t mlen = sizeof(vfs_watch_msg_t) + slen;
     if (mlen + watch_buf_size_ > sizeof(watch_buf_)) {
         // This message won't fit in the watch_buf; transmit first.
-        mx_status_t status = Send(c);
-        if (status != MX_OK) {
+        zx_status_t status = Send(c);
+        if (status != ZX_OK) {
             return status;
         }
     }
@@ -60,61 +60,61 @@
     vmsg->len = static_cast<uint8_t>(slen);
     memcpy(vmsg->name,name, slen);
     watch_buf_size_ += mlen;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t WatchBuffer::Send(const mx::channel& c) {
+zx_status_t WatchBuffer::Send(const zx::channel& c) {
     if (watch_buf_size_ > 0) {
         // Only write if we have something to write
-        mx_status_t status = c.write(0, watch_buf_, static_cast<uint32_t>(watch_buf_size_), nullptr, 0);
+        zx_status_t status = c.write(0, watch_buf_, static_cast<uint32_t>(watch_buf_size_), nullptr, 0);
         watch_buf_size_ = 0;
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t WatcherContainer::WatchDir(mx::channel* out) {
+zx_status_t WatcherContainer::WatchDir(zx::channel* out) {
     fbl::AllocChecker ac;
-    fbl::unique_ptr<VnodeWatcher> watcher(new (&ac) VnodeWatcher(mx::channel(),
+    fbl::unique_ptr<VnodeWatcher> watcher(new (&ac) VnodeWatcher(zx::channel(),
                                                                   VFS_WATCH_MASK_ADDED));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
-    mx::channel out_channel;
-    if (mx::channel::create(0, &out_channel, &watcher->h) != MX_OK) {
-        return MX_ERR_NO_RESOURCES;
+    zx::channel out_channel;
+    if (zx::channel::create(0, &out_channel, &watcher->h) != ZX_OK) {
+        return ZX_ERR_NO_RESOURCES;
     }
     fbl::AutoLock lock(&lock_);
     watch_list_.push_back(fbl::move(watcher));
     *out = fbl::move(out_channel);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t WatcherContainer::WatchDirV2(Vfs* vfs, Vnode* vn, const vfs_watch_dir_t* cmd) {
-    mx::channel c = mx::channel(cmd->channel);
+zx_status_t WatcherContainer::WatchDirV2(Vfs* vfs, Vnode* vn, const vfs_watch_dir_t* cmd) {
+    zx::channel c = zx::channel(cmd->channel);
     if ((cmd->mask & VFS_WATCH_MASK_ALL) == 0) {
         // No events to watch
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     fbl::AllocChecker ac;
     fbl::unique_ptr<VnodeWatcher> watcher(new (&ac) VnodeWatcher(fbl::move(c), cmd->mask));
     if (!ac.check()) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     if (cmd->mask & VFS_WATCH_MASK_EXISTING) {
         vdircookie_t dircookie;
         memset(&dircookie, 0, sizeof(dircookie));
-        char readdir_buf[MXIO_CHUNK_SIZE];
+        char readdir_buf[FDIO_CHUNK_SIZE];
         WatchBuffer wb;
         {
             // Send "VFS_WATCH_EVT_EXISTING" for all entries in readdir
             fbl::AutoLock lock(&vfs->vfs_lock_);
             while (true) {
-                mx_status_t status = vn->Readdir(&dircookie, &readdir_buf, sizeof(readdir_buf));
+                zx_status_t status = vn->Readdir(&dircookie, &readdir_buf, sizeof(readdir_buf));
                 if (status <= 0) {
                     break;
                 }
@@ -142,7 +142,7 @@
 
     fbl::AutoLock lock(&lock_);
     watch_list_.push_back(fbl::move(watcher));
-    return MX_OK;
+    return ZX_OK;
 }
 
 void WatcherContainer::Notify(const char* name, size_t len, unsigned event) {
@@ -168,7 +168,7 @@
             continue;
         }
 
-        mx_status_t status = it->h.write(0, msg, static_cast<uint32_t>(sizeof(msg)), nullptr, 0);
+        zx_status_t status = it->h.write(0, msg, static_cast<uint32_t>(sizeof(msg)), nullptr, 0);
         if (status < 0) {
             // Lazily remove watchers when their handles cannot accept incoming
             // watch messages.
diff --git a/system/ulib/fvm/fvm.cpp b/system/ulib/fvm/fvm.cpp
index 7de001b..9bba3e7 100644
--- a/system/ulib/fvm/fvm.cpp
+++ b/system/ulib/fvm/fvm.cpp
@@ -12,11 +12,11 @@
 #include <unistd.h>
 
 #include <fs/mapped-vmo.h>
-#include <magenta/device/block.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <mxio/debug.h>
-#include <mxio/watcher.h>
+#include <zircon/device/block.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <fdio/debug.h>
+#include <fdio/watcher.h>
 #include <fbl/unique_ptr.h>
 
 #include "fvm/fvm.h"
@@ -39,7 +39,7 @@
 // Validate the metadata's hash value.
 // Returns 'true' if it matches, 'false' otherwise.
 bool fvm_check_hash(const void* metadata, size_t metadata_size) {
-    MX_DEBUG_ASSERT(metadata_size >= sizeof(fvm::fvm_t));
+    ZX_DEBUG_ASSERT(metadata_size >= sizeof(fvm::fvm_t));
     const fvm::fvm_t* header = static_cast<const fvm::fvm_t*>(metadata);
     const void* metadata_after_hash =
         reinterpret_cast<const void*>(header->hash + sizeof(header->hash));
@@ -84,7 +84,7 @@
     memcpy(header->hash, hash, sizeof(header->hash));
 }
 
-mx_status_t fvm_validate_header(const void* metadata, const void* backup,
+zx_status_t fvm_validate_header(const void* metadata, const void* backup,
                                 size_t metadata_size, const void** out) {
     const fvm::fvm_t* primary_header = static_cast<const fvm::fvm_t*>(metadata);
     const fvm::fvm_t* backup_header = static_cast<const fvm::fvm_t*>(backup);
@@ -97,7 +97,7 @@
     bool use_primary;
     if (!primary_valid && !backup_valid) {
         fprintf(stderr, "fvm: Neither copy of metadata is valid\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     } else if (primary_valid && !backup_valid) {
         use_primary = true;
     } else if (!primary_valid && backup_valid) {
@@ -109,11 +109,11 @@
     const fvm::fvm_t* header = use_primary ? primary_header : backup_header;
     if (header->magic != FVM_MAGIC) {
         fprintf(stderr, "fvm: Bad magic\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     if (header->version > FVM_VERSION) {
         fprintf(stderr, "fvm: Header Version does not match fvm driver\n");
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     // TODO(smklein): Additional validation....
@@ -121,12 +121,12 @@
     if (out) {
         *out = use_primary ? metadata : backup;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t fvm_init(int fd, size_t slice_size) {
+zx_status_t fvm_init(int fd, size_t slice_size) {
     if (slice_size % FVM_BLOCK_SIZE != 0) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     // The metadata layout of the FVM is dependent on the
@@ -134,19 +134,19 @@
     block_info_t block_info;
     ssize_t rc = ioctl_block_get_info(fd, &block_info);
     if (rc < 0) {
-        return static_cast<mx_status_t>(rc);
+        return static_cast<zx_status_t>(rc);
     } else if (rc != sizeof(block_info)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     } else if (slice_size == 0 || slice_size % block_info.block_size) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     size_t disk_size = block_info.block_count * block_info.block_size;
     size_t metadata_size = fvm::MetadataSize(disk_size, slice_size);
 
     fbl::unique_ptr<MappedVmo> mvmo;
-    mx_status_t status = MappedVmo::Create(metadata_size * 2, "fvm-meta", &mvmo);
-    if (status != MX_OK) {
+    zx_status_t status = MappedVmo::Create(metadata_size * 2, "fvm-meta", &mvmo);
+    if (status != ZX_OK) {
         return status;
     }
 
@@ -165,7 +165,7 @@
     sb->generation = 0;
 
     if (sb->pslice_count == 0) {
-        return MX_ERR_NO_SPACE;
+        return ZX_ERR_NO_SPACE;
     }
 
     fvm_update_hash(mvmo->GetData(), metadata_size);
@@ -173,21 +173,21 @@
     const void* backup = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(mvmo->GetData()) +
                                                  metadata_size);
     status = fvm_validate_header(mvmo->GetData(), backup, metadata_size, nullptr);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return status;
     }
 
     if (lseek(fd, 0, SEEK_SET) < 0) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     // Write to primary copy.
     if (write(fd, mvmo->GetData(), metadata_size) != static_cast<ssize_t>(metadata_size)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
     // Write to secondary copy, to overwrite any previous FVM metadata copy that
     // could be here.
     if (write(fd, mvmo->GetData(), metadata_size) != static_cast<ssize_t>(metadata_size)) {
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     }
 
     xprintf("fvm_init: Success\n");
@@ -202,13 +202,13 @@
            fvm::SlicesStart(disk_size, slice_size),
            fvm::UsableSlicesCount(disk_size, slice_size));
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Helper function to allocate, find, and open VPartition.
 int fvm_allocate_partition(int fvm_fd, const alloc_req_t* request) {
     ssize_t r;
-    if ((r = ioctl_block_fvm_alloc(fvm_fd, request)) != MX_OK) {
+    if ((r = ioctl_block_fvm_alloc(fvm_fd, request)) != ZX_OK) {
         return -1;
     }
 
@@ -222,19 +222,19 @@
 
     auto cb = [](int dirfd, int event, const char* fn, void* cookie) {
         if (event != WATCH_EVENT_ADD_FILE) {
-            return MX_OK;
+            return ZX_OK;
         }
         auto info = static_cast<alloc_helper_info_t*>(cookie);
         int devfd = openat(dirfd, fn, O_RDWR);
         if (devfd < 0) {
-            return MX_OK;
+            return ZX_OK;
         }
         if (is_partition(devfd, info->request->guid, info->request->type)) {
             info->out_partition = devfd;
-            return MX_ERR_STOP;
+            return ZX_ERR_STOP;
         }
         close(devfd);
-        return MX_OK;
+        return ZX_OK;
     };
 
     DIR* dir = opendir(kBlockDevPath);
@@ -242,8 +242,8 @@
         return -1;
     }
 
-    mx_time_t deadline = mx_deadline_after(MX_SEC(2));
-    if (mxio_watch_directory(dirfd(dir), cb, deadline, &info) != MX_ERR_STOP) {
+    zx_time_t deadline = zx_deadline_after(ZX_SEC(2));
+    if (fdio_watch_directory(dirfd(dir), cb, deadline, &info) != ZX_ERR_STOP) {
         return -1;
     }
     closedir(dir);
diff --git a/system/ulib/fvm/include/fvm/fvm.h b/system/ulib/fvm/include/fvm/fvm.h
index 4f34990..0afd9a3 100644
--- a/system/ulib/fvm/include/fvm/fvm.h
+++ b/system/ulib/fvm/include/fvm/fvm.h
@@ -6,7 +6,7 @@
 
 #include <digest/digest.h>
 #include <gpt/gpt.h>
-#include <magenta/device/block.h>
+#include <zircon/device/block.h>
 #include <stdlib.h>
 
 #define FVM_MAGIC (0x54524150204d5646ull) // 'FVM PART'
@@ -122,11 +122,11 @@
 //
 // "out" is an optional output parameter which is equal to a
 // valid copy of either metadata or backup on success.
-mx_status_t fvm_validate_header(const void* metadata, const void* backup,
+zx_status_t fvm_validate_header(const void* metadata, const void* backup,
                                 size_t metadata_size, const void** out);
 
 // Format a block device to be an empty FVM.
-mx_status_t fvm_init(int fd, size_t slice_size);
+zx_status_t fvm_init(int fd, size_t slice_size);
 
 // Allocates a new vpartition in the fvm, and waits for it to become
 // accessible (by watching for a corresponding block device).
diff --git a/system/ulib/fvm/rules.mk b/system/ulib/fvm/rules.mk
index 6b0ffaf..2df69e5 100644
--- a/system/ulib/fvm/rules.mk
+++ b/system/ulib/fvm/rules.mk
@@ -15,13 +15,13 @@
     system/ulib/fs \
     system/ulib/gpt \
     system/ulib/digest \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     third_party/ulib/cryptolib \
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/ulib/gfx/gfx.c b/system/ulib/gfx/gfx.c
index 77b04fe..a3f0e46 100644
--- a/system/ulib/gfx/gfx.c
+++ b/system/ulib/gfx/gfx.c
@@ -16,7 +16,7 @@
 
 #include <assert.h>
 #include <err.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
@@ -490,7 +490,7 @@
         height = source->height - srcy;
 
     // XXX total hack to deal with various blends
-    if (source->format == MX_PIXEL_FORMAT_RGB_565 && target->format == MX_PIXEL_FORMAT_RGB_565) {
+    if (source->format == ZX_PIXEL_FORMAT_RGB_565 && target->format == ZX_PIXEL_FORMAT_RGB_565) {
         // 16 bit to 16 bit
         const uint16_t* src = &((const uint16_t*)source->ptr)[srcx + srcy * source->stride];
         uint16_t* dest = &((uint16_t*)target->ptr)[destx + desty * target->stride];
@@ -509,7 +509,7 @@
             dest += dest_stride_diff;
             src += source_stride_diff;
         }
-    } else if (source->format == MX_PIXEL_FORMAT_ARGB_8888 && target->format == MX_PIXEL_FORMAT_ARGB_8888) {
+    } else if (source->format == ZX_PIXEL_FORMAT_ARGB_8888 && target->format == ZX_PIXEL_FORMAT_ARGB_8888) {
         // both are 32 bit modes, both alpha
         const uint32_t* src = &((const uint32_t*)source->ptr)[srcx + srcy * source->stride];
         uint32_t* dest = &((uint32_t*)target->ptr)[destx + desty * target->stride];
@@ -529,7 +529,7 @@
             dest += dest_stride_diff;
             src += source_stride_diff;
         }
-    } else if (source->format == MX_PIXEL_FORMAT_RGB_x888 && target->format == MX_PIXEL_FORMAT_RGB_x888) {
+    } else if (source->format == ZX_PIXEL_FORMAT_RGB_x888 && target->format == ZX_PIXEL_FORMAT_RGB_x888) {
         // both are 32 bit modes, no alpha
         const uint32_t* src = &((const uint32_t*)source->ptr)[srcx + srcy * source->stride];
         uint32_t* dest = &((uint32_t*)target->ptr)[destx + desty * target->stride];
@@ -548,7 +548,7 @@
             dest += dest_stride_diff;
             src += source_stride_diff;
         }
-    } else if (source->format == MX_PIXEL_FORMAT_MONO_1 && target->format == MX_PIXEL_FORMAT_MONO_1) {
+    } else if (source->format == ZX_PIXEL_FORMAT_MONO_1 && target->format == ZX_PIXEL_FORMAT_MONO_1) {
         // both are 8 bit modes, no alpha
         const uint8_t* src = &((const uint8_t*)source->ptr)[srcx + srcy * source->stride];
         uint8_t* dest = &((uint8_t*)target->ptr)[destx + desty * target->stride];
@@ -642,7 +642,7 @@
 
     // set up some function pointers
     switch (format) {
-    case MX_PIXEL_FORMAT_RGB_565:
+    case ZX_PIXEL_FORMAT_RGB_565:
         surface->translate_color = &ARGB8888_to_RGB565;
         surface->copyrect = &copyrect16;
         surface->fillrect = &fillrect16;
@@ -651,8 +651,8 @@
         surface->pixelsize = 2;
         surface->len = (surface->height * surface->stride * surface->pixelsize);
         break;
-    case MX_PIXEL_FORMAT_RGB_x888:
-    case MX_PIXEL_FORMAT_ARGB_8888:
+    case ZX_PIXEL_FORMAT_RGB_x888:
+    case ZX_PIXEL_FORMAT_ARGB_8888:
         surface->translate_color = NULL;
         surface->copyrect = &copyrect32;
         surface->fillrect = &fillrect32;
@@ -661,7 +661,7 @@
         surface->pixelsize = 4;
         surface->len = (surface->height * surface->stride * surface->pixelsize);
         break;
-    case MX_PIXEL_FORMAT_MONO_1:
+    case ZX_PIXEL_FORMAT_MONO_1:
         surface->translate_color = &ARGB8888_to_Luma;
         surface->copyrect = &copyrect8;
         surface->fillrect = &fillrect8;
@@ -670,7 +670,7 @@
         surface->pixelsize = 1;
         surface->len = (surface->height * surface->stride * surface->pixelsize);
         break;
-    case MX_PIXEL_FORMAT_RGB_332:
+    case ZX_PIXEL_FORMAT_RGB_332:
         surface->translate_color = &ARGB8888_to_RGB332;
         surface->copyrect = &copyrect8;
         surface->fillrect = &fillrect8;
@@ -679,7 +679,7 @@
         surface->pixelsize = 1;
         surface->len = (surface->height * surface->stride * surface->pixelsize);
         break;
-    case MX_PIXEL_FORMAT_RGB_2220:
+    case ZX_PIXEL_FORMAT_RGB_2220:
         surface->translate_color = &ARGB8888_to_RGB2220;
         surface->copyrect = &copyrect8;
         surface->fillrect = &fillrect8;
@@ -690,14 +690,14 @@
         break;
     default:
         xprintf("invalid graphics format\n");
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     if (ptr == NULL) {
         // allocate a buffer
         ptr = malloc(surface->len);
         if (ptr == NULL) {
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
         assert(ptr);
         surface->flags |= GFX_FLAG_FREE_ON_DESTROY;
@@ -718,8 +718,8 @@
     free(surface);
 }
 
-#include <magenta/font/font-9x16.h>
-#include <magenta/font/font-18x32.h>
+#include <zircon/font/font-9x16.h>
+#include <zircon/font/font-18x32.h>
 
 const gfx_font font9x16 = {
     .data = FONT9X16,
diff --git a/system/ulib/gfx/include/gfx/gfx.h b/system/ulib/gfx/include/gfx/gfx.h
index 8fdefee..6c08520 100644
--- a/system/ulib/gfx/include/gfx/gfx.h
+++ b/system/ulib/gfx/include/gfx/gfx.h
@@ -9,9 +9,9 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/pixelformat.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
+#include <zircon/pixelformat.h>
 
 __BEGIN_CDECLS
 
@@ -99,7 +99,7 @@
 
 // surface setup
 gfx_surface* gfx_create_surface(void* ptr, unsigned width, unsigned height, unsigned stride, unsigned format, uint32_t flags);
-mx_status_t gfx_init_surface(gfx_surface* surface, void* ptr, unsigned width, unsigned height, unsigned stride, unsigned format, uint32_t flags);
+zx_status_t gfx_init_surface(gfx_surface* surface, void* ptr, unsigned width, unsigned height, unsigned stride, unsigned format, uint32_t flags);
 
 // free the surface
 // optionally frees the buffer if the free bit is set
diff --git a/system/ulib/gfx/rules.mk b/system/ulib/gfx/rules.mk
index 2167741..8202b39 100644
--- a/system/ulib/gfx/rules.mk
+++ b/system/ulib/gfx/rules.mk
@@ -11,7 +11,7 @@
 MODULE_TYPE := userlib
 
 MODULE_LIBS := \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
 
 MODULE_SRCS += \
diff --git a/system/ulib/gpt/BUILD.gn b/system/ulib/gpt/BUILD.gn
index 28451614..8114633 100644
--- a/system/ulib/gpt/BUILD.gn
+++ b/system/ulib/gpt/BUILD.gn
@@ -14,7 +14,7 @@
     "include/gpt/gpt.h",
   ]
   deps = [
-    "//magenta/third_party/ulib/cksum",
+    "//zircon/third_party/ulib/cksum",
   ]
   public_configs = [ ":gpt_config" ]
 }
diff --git a/system/ulib/gpt/gpt.c b/system/ulib/gpt/gpt.c
index bf2ce1b..9f148df 100644
--- a/system/ulib/gpt/gpt.c
+++ b/system/ulib/gpt/gpt.c
@@ -4,7 +4,7 @@
 
 #include <gpt/gpt.h>
 #include <lib/cksum.h>
-#include <magenta/syscalls.h> // for mx_cprng_draw
+#include <zircon/syscalls.h> // for zx_cprng_draw
 #include <assert.h>
 #include <errno.h>
 #include <inttypes.h>
@@ -321,7 +321,7 @@
         header.backup = priv->blocks - 1;
         // generate a guid
         size_t sz;
-        if (mx_cprng_draw(header.guid, GPT_GUID_LEN, &sz) != MX_OK ||
+        if (zx_cprng_draw(header.guid, GPT_GUID_LEN, &sz) != ZX_OK ||
             sz != GPT_GUID_LEN) {
             return -1;
         }
diff --git a/system/ulib/hid/acer12.c b/system/ulib/hid/acer12.c
index 54ab087..57ea468 100644
--- a/system/ulib/hid/acer12.c
+++ b/system/ulib/hid/acer12.c
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include <hid/acer12.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 #include <string.h>
 
 static const uint8_t acer12_touch_report_desc[] = {
@@ -342,9 +342,9 @@
     return (memcmp(data, acer12_touch_report_desc, len) == 0);
 }
 
-mx_status_t setup_acer12_touch(int fd) {
+zx_status_t setup_acer12_touch(int fd) {
     if (fd < 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/ulib/hid/include/hid/acer12.h b/system/ulib/hid/include/hid/acer12.h
index c74b2ea..5b06b34 100644
--- a/system/ulib/hid/include/hid/acer12.h
+++ b/system/ulib/hid/include/hid/acer12.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <stdbool.h>
 #include <stdint.h>
 
@@ -61,6 +61,6 @@
 } __attribute__((packed)) acer12_stylus_t;
 
 extern bool is_acer12_touch_report_desc(const uint8_t* data, size_t len);
-extern mx_status_t setup_acer12_touch(int fd);
+extern zx_status_t setup_acer12_touch(int fd);
 
 __END_CDECLS
diff --git a/system/ulib/hid/include/hid/hid.h b/system/ulib/hid/include/hid/hid.h
index 6255b2f..538ebcf 100644
--- a/system/ulib/hid/include/hid/hid.h
+++ b/system/ulib/hid/include/hid/hid.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <stdint.h>
 
diff --git a/system/ulib/hid/include/hid/paradise.h b/system/ulib/hid/include/hid/paradise.h
index 8685f7e..ff5eec0 100644
--- a/system/ulib/hid/include/hid/paradise.h
+++ b/system/ulib/hid/include/hid/paradise.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <stdbool.h>
 #include <stdint.h>
 
@@ -72,6 +72,6 @@
 } __attribute__((packed)) paradise_stylus_t;
 
 extern bool is_paradise_touch_report_desc(const uint8_t* data, size_t len);
-extern mx_status_t setup_paradise_touch(int fd);
+extern zx_status_t setup_paradise_touch(int fd);
 
 __END_CDECLS
diff --git a/system/ulib/hid/include/hid/samsung.h b/system/ulib/hid/include/hid/samsung.h
index 9445864..f24b176 100644
--- a/system/ulib/hid/include/hid/samsung.h
+++ b/system/ulib/hid/include/hid/samsung.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <stdbool.h>
 #include <stdint.h>
 
@@ -38,7 +38,7 @@
 } __attribute__((packed)) samsung_touch_t;
 
 extern bool is_samsung_touch_report_desc(const uint8_t* data, size_t len);
-extern mx_status_t setup_samsung_touch(int fd);
+extern zx_status_t setup_samsung_touch(int fd);
 
 __END_CDECLS
 
diff --git a/system/ulib/hid/paradise.c b/system/ulib/hid/paradise.c
index 3b48ef4..3dd3b09 100644
--- a/system/ulib/hid/paradise.c
+++ b/system/ulib/hid/paradise.c
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include <hid/paradise.h>
-#include <magenta/errors.h>
+#include <zircon/errors.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -510,9 +510,9 @@
     return (memcmp(data, paradise_touch_report_desc, len) == 0);
 }
 
-mx_status_t setup_paradise_touch(int fd) {
+zx_status_t setup_paradise_touch(int fd) {
     if (fd < 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/ulib/hid/rules.mk b/system/ulib/hid/rules.mk
index ef9a2b1..2dbb134 100644
--- a/system/ulib/hid/rules.mk
+++ b/system/ulib/hid/rules.mk
@@ -19,8 +19,8 @@
 MODULE_SO_NAME := hid
 
 MODULE_LIBS := \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/hid/samsung.c b/system/ulib/hid/samsung.c
index 0db278f..c1d4797 100644
--- a/system/ulib/hid/samsung.c
+++ b/system/ulib/hid/samsung.c
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 #include <hid/samsung.h>
-#include <magenta/device/input.h>
-#include <magenta/errors.h>
+#include <zircon/device/input.h>
+#include <zircon/errors.h>
 #include <string.h>
 
 static const uint8_t samsung_touch_report_desc[] = {
@@ -432,9 +432,9 @@
     return (memcmp(data, samsung_touch_report_desc, len) == 0);
 }
 
-mx_status_t setup_samsung_touch(int fd) {
+zx_status_t setup_samsung_touch(int fd) {
     if (fd < 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     uint8_t buf[sizeof(input_set_report_t) + 3];
     input_set_report_t* enable_multitouch = (input_set_report_t*)buf;
@@ -446,6 +446,6 @@
     enable_multitouch->data[2] = 0;
 
     ssize_t res = ioctl_input_set_report(fd, enable_multitouch, sizeof(buf));
-    return (res >= 0) ? MX_OK : (mx_status_t)res;
+    return (res >= 0) ? ZX_OK : (zx_status_t)res;
 }
 
diff --git a/system/ulib/hypervisor/acpi.cpp b/system/ulib/hypervisor/acpi.cpp
index 84d9497..0de8905 100644
--- a/system/ulib/hypervisor/acpi.cpp
+++ b/system/ulib/hypervisor/acpi.cpp
@@ -32,36 +32,36 @@
     header->Checksum = acpi_checksum(header, header->Length);
 }
 
-static mx_status_t load_file(const char* path, uintptr_t addr, size_t size, uint32_t* actual) {
+static zx_status_t load_file(const char* path, uintptr_t addr, size_t size, uint32_t* actual) {
     int fd = open(path, O_RDONLY);
     if (fd < 0) {
         fprintf(stderr, "Failed to open ACPI table \"%s\"\n", path);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     struct stat stat;
     int ret = fstat(fd, &stat);
     if (ret < 0) {
         fprintf(stderr, "Failed to stat ACPI table \"%s\"\n", path);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     if ((size_t)stat.st_size > size) {
         fprintf(stderr, "Not enough space for ACPI table \"%s\"\n", path);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     ssize_t count = read(fd, (void*)addr, stat.st_size);
     if (count < 0 || count != stat.st_size) {
         fprintf(stderr, "Failed to read ACPI table \"%s\"\n", path);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     *actual = static_cast<uint32_t>(stat.st_size);
-    return MX_OK;
+    return ZX_OK;
 }
 #endif // __x86_64__
 
-mx_status_t guest_create_acpi_table(uintptr_t addr, size_t size, uintptr_t acpi_off) {
+zx_status_t guest_create_acpi_table(uintptr_t addr, size_t size, uintptr_t acpi_off) {
 #if __x86_64__
     if (size < acpi_off + PAGE_SIZE)
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     const uint32_t rsdt_entries = 3;
     const uint32_t rsdt_length = sizeof(ACPI_TABLE_RSDT) + (rsdt_entries - 1) * sizeof(uint32_t);
@@ -69,7 +69,7 @@
     // RSDP. ACPI 1.0.
     ACPI_RSDP_COMMON* rsdp = (ACPI_RSDP_COMMON*)(addr + acpi_off);
     ACPI_MAKE_RSDP_SIG(rsdp->Signature);
-    memcpy(rsdp->OemId, "MX", 2);
+    memcpy(rsdp->OemId, "ZX", 2);
     rsdp->RsdtPhysicalAddress = static_cast<uint32_t>(acpi_off + sizeof(ACPI_RSDP_COMMON));
     rsdp->Checksum = acpi_checksum(rsdp, ACPI_RSDP_CHECKSUM_LENGTH);
 
@@ -86,20 +86,20 @@
 
     // DSDT.
     uint32_t actual;
-    mx_status_t status = load_file(kDsdtPath, addr + dsdt_off, size - dsdt_off, &actual);
-    if (status != MX_OK)
+    zx_status_t status = load_file(kDsdtPath, addr + dsdt_off, size - dsdt_off, &actual);
+    if (status != ZX_OK)
         return status;
 
     // MADT.
     const uint32_t madt_off = dsdt_off + actual;
     status = load_file(kMadtPath, addr + madt_off, size - madt_off, &actual);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // MCFG.
     const uint32_t mcfg_off = madt_off + actual;
     status = load_file(kMcfgPath, addr + mcfg_off, size - mcfg_off, &actual);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // RSDT.
@@ -108,8 +108,8 @@
     rsdt->TableOffsetEntry[1] = madt_off;
     rsdt->TableOffsetEntry[2] = mcfg_off;
     acpi_header(&rsdt->Header, ACPI_SIG_RSDT, rsdt_length);
-    return MX_OK;
+    return ZX_OK;
 #else // __x86_64__
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif // __x86_64__
 }
diff --git a/system/ulib/hypervisor/acpi/dsdt.aml b/system/ulib/hypervisor/acpi/dsdt.aml
index d9b7633..e86bc96 100644
--- a/system/ulib/hypervisor/acpi/dsdt.aml
+++ b/system/ulib/hypervisor/acpi/dsdt.aml
Binary files differ
diff --git a/system/ulib/hypervisor/acpi/dsdt.asl b/system/ulib/hypervisor/acpi/dsdt.asl
index 0d4b9d6..164ec2c 100644
--- a/system/ulib/hypervisor/acpi/dsdt.asl
+++ b/system/ulib/hypervisor/acpi/dsdt.asl
@@ -8,7 +8,7 @@
 // integers are restricted to 32 bits. Otherwise, full 64-bit integers are used.
 // The version of the DSDT sets the global integer width for all integers,
 // including integers in SSDTs.
-DefinitionBlock ("dsdt.aml", "DSDT", 2, "MX", "MX DSDT", 0x0)
+DefinitionBlock ("dsdt.aml", "DSDT", 2, "ZX", "ZX DSDT", 0x0)
 {
     Name (PICM, Zero)
     Method (_PIC, 1, NotSerialized)                                 // _PIC: Interrupt Model
diff --git a/system/ulib/hypervisor/acpi/madt.aml b/system/ulib/hypervisor/acpi/madt.aml
index ca94f33..38345ca 100644
--- a/system/ulib/hypervisor/acpi/madt.aml
+++ b/system/ulib/hypervisor/acpi/madt.aml
Binary files differ
diff --git a/system/ulib/hypervisor/acpi/madt.asl b/system/ulib/hypervisor/acpi/madt.asl
index 9a1fb05..c7cce4d 100644
--- a/system/ulib/hypervisor/acpi/madt.asl
+++ b/system/ulib/hypervisor/acpi/madt.asl
@@ -8,8 +8,8 @@
 [004h 0004   4]                 Table Length : 0
 [008h 0008   1]                     Revision : 4
 [009h 0009   1]                     Checksum : 0
-[00Ah 0010   6]                       Oem ID : "MX"
-[010h 0016   8]                 Oem Table ID : "MX MADT"
+[00Ah 0010   6]                       Oem ID : "ZX"
+[010h 0016   8]                 Oem Table ID : "ZX MADT"
 [018h 0024   4]                 Oem Revision : 0
 [01Ch 0028   4]              Asl Compiler ID : ""
 [020h 0032   4]        Asl Compiler Revision : 0
diff --git a/system/ulib/hypervisor/acpi/mcfg.aml b/system/ulib/hypervisor/acpi/mcfg.aml
index d96dae5..a9d364c 100644
--- a/system/ulib/hypervisor/acpi/mcfg.aml
+++ b/system/ulib/hypervisor/acpi/mcfg.aml
Binary files differ
diff --git a/system/ulib/hypervisor/acpi/mcfg.asl b/system/ulib/hypervisor/acpi/mcfg.asl
index bf1f868..973bda7 100644
--- a/system/ulib/hypervisor/acpi/mcfg.asl
+++ b/system/ulib/hypervisor/acpi/mcfg.asl
@@ -8,8 +8,8 @@
 [004h 0004   4]                 Table Length : 0
 [008h 0008   1]                     Revision : 1
 [009h 0009   1]                     Checksum : 0
-[00Ah 0010   6]                       Oem ID : "MX"
-[010h 0016   8]                 Oem Table ID : "MX MCFG"
+[00Ah 0010   6]                       Oem ID : "ZX"
+[010h 0016   8]                 Oem Table ID : "ZX MCFG"
 [018h 0024   4]                 Oem Revision : 0
 [01Ch 0028   4]              Asl Compiler ID : ""
 [020h 0032   4]        Asl Compiler Revision : 0
diff --git a/system/ulib/hypervisor/balloon.cpp b/system/ulib/hypervisor/balloon.cpp
index 23d8982..5140b8a 100644
--- a/system/ulib/hypervisor/balloon.cpp
+++ b/system/ulib/hypervisor/balloon.cpp
@@ -11,8 +11,8 @@
 #include <fbl/auto_lock.h>
 #include <hypervisor/vcpu.h>
 #include <hypervisor/virtio.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 #include <virtio/balloon.h>
 #include <virtio/virtio.h>
 #include <virtio/virtio_ids.h>
@@ -25,21 +25,21 @@
     return (balloon_t*)device->impl;
 }
 
-static mx_status_t decommit_pages(balloon_t* balloon, uint64_t addr, uint64_t len) {
-    return mx_vmo_op_range(balloon->vmo, MX_VMO_OP_DECOMMIT, addr, len, NULL, 0);
+static zx_status_t decommit_pages(balloon_t* balloon, uint64_t addr, uint64_t len) {
+    return zx_vmo_op_range(balloon->vmo, ZX_VMO_OP_DECOMMIT, addr, len, NULL, 0);
 }
 
-static mx_status_t commit_pages(balloon_t* balloon, uint64_t addr, uint64_t len) {
+static zx_status_t commit_pages(balloon_t* balloon, uint64_t addr, uint64_t len) {
     if (balloon->deflate_on_demand)
-        return MX_OK;
-    return mx_vmo_op_range(balloon->vmo, MX_VMO_OP_COMMIT, addr, len, NULL, 0);
+        return ZX_OK;
+    return zx_vmo_op_range(balloon->vmo, ZX_VMO_OP_COMMIT, addr, len, NULL, 0);
 }
 
 /* Structure passed to the inflate/deflate queue handler. */
 typedef struct queue_ctx {
     balloon_t* balloon;
     // Operation to perform on the queue (inflate or deflate).
-    mx_status_t (*op)(balloon_t* balloon, uint64_t addr, uint64_t len);
+    zx_status_t (*op)(balloon_t* balloon, uint64_t addr, uint64_t len);
 } queue_ctx_t;
 
 /* Handle balloon inflate/deflate requests.
@@ -60,7 +60,7 @@
  *  (c) Otherwise, the guest is allowed to re-use pages previously given to the
  *      balloon before the device has acknowledged their withdrawal.
  */
-static mx_status_t queue_range_op(void* addr, uint32_t len, uint16_t flags, uint32_t* used,
+static zx_status_t queue_range_op(void* addr, uint32_t len, uint16_t flags, uint32_t* used,
                                   void* ctx) {
     queue_ctx_t* balloon_op_ctx = static_cast<queue_ctx_t*>(ctx);
     balloon_t* balloon = balloon_op_ctx->balloon;
@@ -80,10 +80,10 @@
 
         // If we have an existing region; invoke the inflate/deflate op.
         if (region_length > 0) {
-            mx_status_t status = balloon_op_ctx->op(balloon,
+            zx_status_t status = balloon_op_ctx->op(balloon,
                                                     region_base * VIRTIO_BALLOON_PAGE_SIZE,
                                                     region_length * VIRTIO_BALLOON_PAGE_SIZE);
-            if (status != MX_OK)
+            if (status != ZX_OK)
                 return status;
         }
 
@@ -94,20 +94,20 @@
 
     // Handle the last region.
     if (region_length > 0) {
-        mx_status_t status = balloon_op_ctx->op(balloon, region_base * VIRTIO_BALLOON_PAGE_SIZE,
+        zx_status_t status = balloon_op_ctx->op(balloon, region_base * VIRTIO_BALLOON_PAGE_SIZE,
                                                 region_length * VIRTIO_BALLOON_PAGE_SIZE);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t handle_queue_notify(balloon_t* balloon, uint16_t queue_sel) {
+static zx_status_t handle_queue_notify(balloon_t* balloon, uint16_t queue_sel) {
     queue_ctx_t ctx;
     switch (queue_sel) {
     case VIRTIO_BALLOON_Q_STATSQ:
-        return MX_OK;
+        return ZX_OK;
     case VIRTIO_BALLOON_Q_INFLATEQ:
         ctx.op = &decommit_pages;
         break;
@@ -115,31 +115,31 @@
         ctx.op = &commit_pages;
         break;
     default:
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     ctx.balloon = balloon;
     return virtio_queue_handler(&balloon->queues[queue_sel], &queue_range_op, &ctx);
 }
 
-static mx_status_t balloon_queue_notify(virtio_device_t* device, uint16_t queue_sel) {
-    mx_status_t status;
+static zx_status_t balloon_queue_notify(virtio_device_t* device, uint16_t queue_sel) {
+    zx_status_t status;
     balloon_t* balloon = virtio_device_to_balloon(device);
     do {
         status = handle_queue_notify(balloon, queue_sel);
-    } while (status == MX_ERR_NEXT);
+    } while (status == ZX_ERR_NEXT);
     return status;
 }
 
-static mx_status_t balloon_read(const virtio_device_t* device, uint16_t port, uint8_t access_size,
-                                mx_vcpu_io_t* vcpu_io) {
+static zx_status_t balloon_read(const virtio_device_t* device, uint16_t port, uint8_t access_size,
+                                zx_vcpu_io_t* vcpu_io) {
     balloon_t* balloon = virtio_device_to_balloon(device);
 
     fbl::AutoLock lock(&balloon->mutex);
     return virtio_device_config_read(device, &balloon->config, port, access_size, vcpu_io);
 }
 
-static mx_status_t balloon_write(virtio_device_t* device, uint16_t port,
-                                 const mx_vcpu_io_t* io) {
+static zx_status_t balloon_write(virtio_device_t* device, uint16_t port,
+                                 const zx_vcpu_io_t* io) {
     balloon_t* balloon = virtio_device_to_balloon(device);
 
     fbl::AutoLock lock(&balloon->mutex);
@@ -153,7 +153,7 @@
 };
 
 void balloon_init(balloon_t* balloon, uintptr_t guest_physmem_addr, size_t guest_physmem_size,
-                  mx_handle_t guest_physmem_vmo) {
+                  zx_handle_t guest_physmem_vmo) {
     memset(balloon, 0, sizeof(*balloon));
 
     // Virt queue initialization.
@@ -190,8 +190,8 @@
     }
 }
 
-mx_status_t balloon_request_stats(balloon_t* balloon, balloon_stats_fn_t handler, void* ctx) {
-    mx_status_t status;
+zx_status_t balloon_request_stats(balloon_t* balloon, balloon_stats_fn_t handler, void* ctx) {
+    zx_status_t status;
     virtio_queue_t* stats_queue = &balloon->queues[VIRTIO_BALLOON_Q_STATSQ];
 
     // stats.mutex needs to be held during the entire time the guest is
@@ -209,7 +209,7 @@
     balloon->stats.has_buffer = false;
     virtio_queue_return(stats_queue, balloon->stats.desc_index, 0);
     status = virtio_device_notify(&balloon->virtio_device);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         mtx_unlock(&balloon->stats.mutex);
         return status;
     }
@@ -217,14 +217,14 @@
 
     virtio_desc_t desc;
     status = virtio_queue_read_desc(stats_queue, balloon->stats.desc_index, &desc);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         mtx_unlock(&balloon->stats.mutex);
         return status;
     }
 
     if ((desc.len % sizeof(virtio_balloon_stat_t)) != 0) {
         mtx_unlock(&balloon->stats.mutex);
-        return MX_ERR_IO_DATA_INTEGRITY;
+        return ZX_ERR_IO_DATA_INTEGRITY;
     }
 
     // Invoke the handler on the stats.
@@ -235,10 +235,10 @@
 
     // Note we deliberately do not return the buffer here. This will be done to
     // initiate the next stats request.
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t balloon_update_num_pages(balloon_t* balloon, uint32_t num_pages) {
+zx_status_t balloon_update_num_pages(balloon_t* balloon, uint32_t num_pages) {
     mtx_lock(&balloon->mutex);
     balloon->config.num_pages = num_pages;
     mtx_unlock(&balloon->mutex);
diff --git a/system/ulib/hypervisor/block.cpp b/system/ulib/hypervisor/block.cpp
index 598b6cd..29a72f2 100644
--- a/system/ulib/hypervisor/block.cpp
+++ b/system/ulib/hypervisor/block.cpp
@@ -12,8 +12,8 @@
 #include <hypervisor/io_apic.h>
 #include <hypervisor/pci.h>
 #include <hypervisor/vcpu.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/hypervisor.h>
 #include <virtio/virtio.h>
 #include <virtio/virtio_ids.h>
 #include <virtio/virtio_ring.h>
@@ -28,21 +28,21 @@
     return (block_t*)virtio_device->impl;
 }
 
-static mx_status_t block_read(const virtio_device_t* device, uint16_t port, uint8_t access_size,
-                              mx_vcpu_io_t* vcpu_io) {
+static zx_status_t block_read(const virtio_device_t* device, uint16_t port, uint8_t access_size,
+                              zx_vcpu_io_t* vcpu_io) {
     block_t* block = virtio_device_to_block(device);
     return virtio_device_config_read(device, &block->config, port, access_size, vcpu_io);
 }
 
-static mx_status_t block_write(virtio_device_t* device, uint16_t port,
-                               const mx_vcpu_io_t* io) {
+static zx_status_t block_write(virtio_device_t* device, uint16_t port,
+                               const zx_vcpu_io_t* io) {
     // No device fields are writable.
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t block_queue_notify(virtio_device_t* device, uint16_t queue_sel) {
+static zx_status_t block_queue_notify(virtio_device_t* device, uint16_t queue_sel) {
     if (queue_sel != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     return file_block_device(virtio_device_to_block(device));
 }
 
@@ -52,7 +52,7 @@
     .queue_notify = &block_queue_notify,
 };
 
-mx_status_t block_init(block_t* block, const char* path, uintptr_t guest_physmem_addr,
+zx_status_t block_init(block_t* block, const char* path, uintptr_t guest_physmem_addr,
                        size_t guest_physmem_size) {
     memset(block, 0, sizeof(*block));
 
@@ -63,7 +63,7 @@
         block->fd = open(path, O_RDONLY);
         if (block->fd < 0) {
             fprintf(stderr, "Failed to open block file \"%s\"\n", path);
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
         fprintf(stderr, "Unable to open block file \"%s\" read-write. "
                         "Block device will be read-only.\n",
@@ -74,7 +74,7 @@
     off_t ret = lseek(block->fd, 0, SEEK_END);
     if (ret < 0) {
         fprintf(stderr, "Failed to read size of block file \"%s\"\n", path);
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     block->size = ret;
     block->config.capacity = block->size / SECTOR_SIZE;
@@ -90,7 +90,7 @@
     block->virtio_device.guest_physmem_size = guest_physmem_size;
     // Virtio 1.0: 5.2.5.2: Devices SHOULD always offer VIRTIO_BLK_F_FLUSH
     block->virtio_device.features |= VIRTIO_BLK_F_FLUSH
-                                     // Required by magenta guests.
+                                     // Required by zircon guests.
                                      | VIRTIO_BLK_F_BLK_SIZE;
     block->config.blk_size = SECTOR_SIZE;
 
@@ -101,7 +101,7 @@
     // PCI Transport.
     virtio_pci_init(&block->virtio_device);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Multiple data buffers can be chained in the payload of block read/write
@@ -116,20 +116,20 @@
     uint8_t status;
 } file_state_t;
 
-static mx_status_t file_req(file_state_t* state, void* addr, uint32_t len) {
+static zx_status_t file_req(file_state_t* state, void* addr, uint32_t len) {
     block_t* block = state->block;
     virtio_blk_req_t* blk_req = state->blk_req;
 
     // From VIRTIO Version 1.0: If the VIRTIO_BLK_F_RO feature is set by
     // the device, any write requests will fail.
     if (blk_req->type == VIRTIO_BLK_T_OUT && (block->virtio_device.features & VIRTIO_BLK_F_RO))
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     // From VIRTIO Version 1.0: A driver MUST set sector to 0 for a
     // VIRTIO_BLK_T_FLUSH request. A driver SHOULD NOT include any data in a
     // VIRTIO_BLK_T_FLUSH request.
     if (blk_req->type == VIRTIO_BLK_T_FLUSH && blk_req->sector != 0)
-        return MX_ERR_IO_DATA_INTEGRITY;
+        return ZX_ERR_IO_DATA_INTEGRITY;
 
     mtx_lock(&block->file_mutex);
     off_t ret;
@@ -139,7 +139,7 @@
         ret = lseek(block->fd, off, SEEK_SET);
         if (ret < 0) {
             mtx_unlock(&block->file_mutex);
-            return MX_ERR_IO;
+            return ZX_ERR_IO;
         }
     }
 
@@ -156,65 +156,65 @@
         break;
     default:
         mtx_unlock(&block->file_mutex);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     mtx_unlock(&block->file_mutex);
-    return ret != len ? MX_ERR_IO : MX_OK;
+    return ret != len ? ZX_ERR_IO : ZX_OK;
 }
 
-/* Map mx_status_t values to their Virtio counterparts. */
-static uint8_t to_virtio_status(mx_status_t status) {
+/* Map zx_status_t values to their Virtio counterparts. */
+static uint8_t to_virtio_status(zx_status_t status) {
     switch (status) {
-    case MX_OK:
+    case ZX_OK:
         return VIRTIO_BLK_S_OK;
-    case MX_ERR_NOT_SUPPORTED:
+    case ZX_ERR_NOT_SUPPORTED:
         return VIRTIO_BLK_S_UNSUPP;
     default:
         return VIRTIO_BLK_S_IOERR;
     }
 }
 
-static mx_status_t block_queue_handler(void* addr, uint32_t len, uint16_t flags, uint32_t* used,
+static zx_status_t block_queue_handler(void* addr, uint32_t len, uint16_t flags, uint32_t* used,
                                        void* context) {
     file_state_t* file_state = (file_state_t*)context;
 
     // Header.
     if (file_state->blk_req == NULL) {
         if (len != sizeof(*file_state->blk_req))
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         file_state->blk_req = static_cast<virtio_blk_req_t*>(addr);
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Payload.
     if (flags & VRING_DESC_F_NEXT) {
         file_state->has_payload = true;
-        mx_status_t status = file_req(file_state, addr, len);
-        if (status != MX_OK) {
+        zx_status_t status = file_req(file_state, addr, len);
+        if (status != ZX_OK) {
             file_state->status = to_virtio_status(status);
         } else {
             *used += len;
         }
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Status.
     if (len != sizeof(uint8_t))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // If there was no payload, call the handler function once.
     if (!file_state->has_payload) {
-        mx_status_t status = file_req(file_state, addr, len);
-        if (status != MX_OK)
+        zx_status_t status = file_req(file_state, addr, len);
+        if (status != ZX_OK)
             file_state->status = to_virtio_status(status);
     }
     uint8_t* status = static_cast<uint8_t*>(addr);
     *status = file_state->status;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t file_block_device(block_t* block) {
-    mx_status_t status;
+zx_status_t file_block_device(block_t* block) {
+    zx_status_t status;
     do {
         file_state_t state = {
             .block = block,
@@ -224,6 +224,6 @@
             .status = VIRTIO_BLK_S_OK,
         };
         status = virtio_queue_handler(&block->queue, &block_queue_handler, &state);
-    } while (status == MX_ERR_NEXT);
+    } while (status == ZX_ERR_NEXT);
     return status;
 }
diff --git a/system/ulib/hypervisor/decode.cpp b/system/ulib/hypervisor/decode.cpp
index b4f57ee..18919b4 100644
--- a/system/ulib/hypervisor/decode.cpp
+++ b/system/ulib/hypervisor/decode.cpp
@@ -5,8 +5,8 @@
 #include <string.h>
 
 #include <hypervisor/decode.h>
-#include <magenta/syscalls/hypervisor.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls/hypervisor.h>
+#include <zircon/syscalls/port.h>
 
 static const uint8_t kRexRMask = 1u << 2;
 static const uint8_t kRexWMask = 1u << 3;
@@ -49,7 +49,7 @@
     return static_cast<uint8_t>(((mod_rm >> 3) & 0b111) + (rex_r ? 0b1000 : 0));
 }
 
-static uint64_t* select_register(mx_vcpu_state_t* vcpu_state, uint8_t register_id) {
+static uint64_t* select_register(zx_vcpu_state_t* vcpu_state, uint8_t register_id) {
     // From Intel Volume 2, Section 2.1.
     switch (register_id) {
     // From Intel Volume 2, Section 2.1.5.
@@ -90,39 +90,39 @@
     }
 }
 
-mx_status_t deconstruct_instruction(const uint8_t* inst_buf, uint32_t inst_len,
+zx_status_t deconstruct_instruction(const uint8_t* inst_buf, uint32_t inst_len,
                                     uint16_t* opcode, uint8_t* mod_rm) {
     if (inst_len == 0)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     switch (inst_buf[0]) {
     case 0x0f:
         if (inst_len < 3)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         *opcode = *(uint16_t*)inst_buf;
         *mod_rm = inst_buf[2];
         break;
     default:
         if (inst_len < 2)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         *opcode = inst_buf[0];
         *mod_rm = inst_buf[1];
         break;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t inst_decode(const uint8_t* inst_buf, uint32_t inst_len, mx_vcpu_state_t* vcpu_state,
+zx_status_t inst_decode(const uint8_t* inst_buf, uint32_t inst_len, zx_vcpu_state_t* vcpu_state,
                         instruction_t* inst) {
     if (inst_len == 0)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     if (inst_len > X86_MAX_INST_LEN)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // Parse 66H prefix.
     bool h66 = is_h66_prefix(inst_buf[0]);
     if (h66) {
         if (inst_len == 1)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         inst_buf++;
         inst_len--;
     }
@@ -141,93 +141,93 @@
     }
     // Technically this is valid, but no sane compiler should emit it.
     if (h66 && rex_w)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     uint16_t opcode;
     uint8_t mod_rm;
-    mx_status_t status = deconstruct_instruction(inst_buf, inst_len, &opcode, &mod_rm);
-    if (status != MX_OK)
+    zx_status_t status = deconstruct_instruction(inst_buf, inst_len, &opcode, &mod_rm);
+    if (status != ZX_OK)
         return status;
     if (has_sib_byte(mod_rm))
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     const uint8_t disp_size = displacement_size(mod_rm);
     switch (opcode) {
     // Move r to r/m.
     case 0x89:
         if (inst_len != disp_size + 2u)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         inst->type = INST_MOV_WRITE;
         inst->mem = mem_size(h66, rex_w);
         inst->imm = 0;
         inst->reg = select_register(vcpu_state, register_id(mod_rm, rex_r));
         inst->flags = NULL;
-        return inst->reg == NULL ? MX_ERR_NOT_SUPPORTED : MX_OK;
+        return inst->reg == NULL ? ZX_ERR_NOT_SUPPORTED : ZX_OK;
     // Move r/m to r.
     case 0x8b:
         if (inst_len != disp_size + 2u)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         inst->type = INST_MOV_READ;
         inst->mem = mem_size(h66, rex_w);
         inst->imm = 0;
         inst->reg = select_register(vcpu_state, register_id(mod_rm, rex_r));
         inst->flags = NULL;
-        return inst->reg == NULL ? MX_ERR_NOT_SUPPORTED : MX_OK;
+        return inst->reg == NULL ? ZX_ERR_NOT_SUPPORTED : ZX_OK;
     // Move imm to r/m.
     case 0xc7: {
         const uint8_t imm_size = h66 ? 2 : 4;
         if (inst_len != disp_size + imm_size + 2u)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         if ((mod_rm & kModRMRegMask) != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         inst->type = INST_MOV_WRITE;
         inst->mem = mem_size(h66, rex_w);
         inst->imm = 0;
         inst->reg = NULL;
         inst->flags = NULL;
         memcpy(&inst->imm, inst_buf + disp_size + 2, imm_size);
-        return MX_OK;
+        return ZX_OK;
     }
     // Move (8-bit) with zero-extend r/m to r.
     case 0xb60f:
         if (h66)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         if (inst_len != disp_size + 3u)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         inst->type = INST_MOV_READ;
         inst->mem = 1;
         inst->imm = 0;
         inst->reg = select_register(vcpu_state, register_id(mod_rm, rex_r));
         inst->flags = NULL;
-        return inst->reg == NULL ? MX_ERR_NOT_SUPPORTED : MX_OK;
+        return inst->reg == NULL ? ZX_ERR_NOT_SUPPORTED : ZX_OK;
     // Move (16-bit) with zero-extend r/m to r.
     case 0xb70f:
         if (h66)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         if (inst_len != disp_size + 3u)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         inst->type = INST_MOV_READ;
         inst->mem = 2;
         inst->imm = 0;
         inst->reg = select_register(vcpu_state, register_id(mod_rm, rex_r));
         inst->flags = NULL;
-        return inst->reg == NULL ? MX_ERR_NOT_SUPPORTED : MX_OK;
+        return inst->reg == NULL ? ZX_ERR_NOT_SUPPORTED : ZX_OK;
     // Logical compare (8-bit) imm with r/m.
     case 0xf6:
         if (h66)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
         if (inst_len != disp_size + 3u)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
         if ((mod_rm & kModRMRegMask) != 0)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         inst->type = INST_TEST;
         inst->mem = 1;
         inst->imm = 0;
         inst->reg = NULL;
         inst->flags = &vcpu_state->flags;
         memcpy(&inst->imm, inst_buf + disp_size + 2, 1);
-        return MX_OK;
+        return ZX_OK;
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
diff --git a/system/ulib/hypervisor/guest.cpp b/system/ulib/hypervisor/guest.cpp
index 03f93b7..71c439f 100644
--- a/system/ulib/hypervisor/guest.cpp
+++ b/system/ulib/hypervisor/guest.cpp
@@ -7,7 +7,7 @@
 #include <unistd.h>
 
 #include <hypervisor/guest.h>
-#include <magenta/device/sysinfo.h>
+#include <zircon/device/sysinfo.h>
 
 static const char kResourcePath[] = "/dev/misc/sysinfo";
 
@@ -74,11 +74,11 @@
 }
 #endif // __x86_64__
 
-mx_status_t guest_create_page_table(uintptr_t addr, size_t size, uintptr_t* end_off) {
+zx_status_t guest_create_page_table(uintptr_t addr, size_t size, uintptr_t* end_off) {
     if (size % PAGE_SIZE != 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     if (size > kMaxSize || size < kMinSize)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
 #if __x86_64__
     uint64_t aspace_off = 0;
@@ -87,9 +87,9 @@
     *end_off = page_table(addr, size - aspace_off, kPdpPageSize, *end_off, &aspace_off, true, X86_PTE_PS);
     *end_off = page_table(addr, size - aspace_off, kPdPageSize, *end_off, &aspace_off, true, X86_PTE_PS);
     *end_off = page_table(addr, size - aspace_off, kPtPageSize, *end_off, &aspace_off, true, 0);
-    return MX_OK;
+    return ZX_OK;
 #else // __x86_64__
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif // __x86_64__
 }
 
@@ -97,9 +97,9 @@
     return (size > kAddr4000mb ? 6 : 5) * sizeof(e820entry_t);
 }
 
-mx_status_t guest_create_e820(uintptr_t addr, size_t size, uintptr_t e820_off) {
+zx_status_t guest_create_e820(uintptr_t addr, size_t size, uintptr_t e820_off) {
     if (e820_off + guest_e820_size(size) > size)
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     e820entry_t* entry = (e820entry_t*)(addr + e820_off);
     // 0 to 32kb is reserved.
@@ -129,14 +129,14 @@
         entry[5].type = kE820Ram;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t guest_get_resource(mx_handle_t* resource) {
+zx_status_t guest_get_resource(zx_handle_t* resource) {
     int fd = open(kResourcePath, O_RDWR);
     if (fd < 0)
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     ssize_t n = ioctl_sysinfo_get_hypervisor_resource(fd, resource);
     close(fd);
-    return n < 0 ? MX_ERR_IO : MX_OK;
+    return n < 0 ? ZX_ERR_IO : ZX_OK;
 }
diff --git a/system/ulib/hypervisor/include/hypervisor/acpi.h b/system/ulib/hypervisor/include/hypervisor/acpi.h
index 043a4ed..918181d 100644
--- a/system/ulib/hypervisor/include/hypervisor/acpi.h
+++ b/system/ulib/hypervisor/include/hypervisor/acpi.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
@@ -15,6 +15,6 @@
  * @param size The size of guest physical memory.
  * @param acpi_off The offset to write the ACPI table.
  */
-mx_status_t guest_create_acpi_table(uintptr_t addr, size_t size, uintptr_t acpi_off);
+zx_status_t guest_create_acpi_table(uintptr_t addr, size_t size, uintptr_t acpi_off);
 
 __END_CDECLS
diff --git a/system/ulib/hypervisor/include/hypervisor/balloon.h b/system/ulib/hypervisor/include/hypervisor/balloon.h
index a190b1a..bdcc316 100644
--- a/system/ulib/hypervisor/include/hypervisor/balloon.h
+++ b/system/ulib/hypervisor/include/hypervisor/balloon.h
@@ -7,8 +7,8 @@
 #include <threads.h>
 
 #include <hypervisor/virtio.h>
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <virtio/balloon.h>
 
 #define VIRTIO_BALLOON_Q_INFLATEQ 0
@@ -27,7 +27,7 @@
 typedef struct balloon {
     mtx_t mutex;
     // Handle to the guest phsycial memory VMO for memory management.
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     // With on-demand deflation we won't commit memory up-front for balloon
     // deflate requests.
     bool deflate_on_demand;
@@ -53,7 +53,7 @@
 } balloon_t;
 
 void balloon_init(balloon_t* balloon, uintptr_t guest_physmem_addr, size_t guest_physmem_size,
-                  mx_handle_t guest_physmem_vmo);
+                  zx_handle_t guest_physmem_vmo);
 
 /* Callback for balloon_request_stats. */
 typedef void (*balloon_stats_fn_t)(const virtio_balloon_stat_t* stats, size_t len, void* ctx);
@@ -64,9 +64,9 @@
  * been received from the guest. Pointers to stats must not be held after the
  * callback returns.
  */
-mx_status_t balloon_request_stats(balloon_t* balloon, balloon_stats_fn_t handler, void* ctx);
+zx_status_t balloon_request_stats(balloon_t* balloon, balloon_stats_fn_t handler, void* ctx);
 
 /* Update the 'num_pages' configuration field in the balloon. */
-mx_status_t balloon_update_num_pages(balloon_t* balloon, uint32_t num_pages);
+zx_status_t balloon_update_num_pages(balloon_t* balloon, uint32_t num_pages);
 
 __END_CDECLS
diff --git a/system/ulib/hypervisor/include/hypervisor/block.h b/system/ulib/hypervisor/include/hypervisor/block.h
index 0361323..5dc3beb 100644
--- a/system/ulib/hypervisor/include/hypervisor/block.h
+++ b/system/ulib/hypervisor/include/hypervisor/block.h
@@ -33,10 +33,10 @@
     virtio_blk_config_t config;
 } block_t;
 
-mx_status_t block_init(block_t* block, const char* path, uintptr_t guest_physmem_addr,
+zx_status_t block_init(block_t* block, const char* path, uintptr_t guest_physmem_addr,
                        size_t guest_physmem_size);
 
 /* Block device that returns reads and writes to a file. */
-mx_status_t file_block_device(block_t* block);
+zx_status_t file_block_device(block_t* block);
 
 __END_CDECLS
diff --git a/system/ulib/hypervisor/include/hypervisor/decode.h b/system/ulib/hypervisor/include/hypervisor/decode.h
index 960c89c..c82df99 100644
--- a/system/ulib/hypervisor/include/hypervisor/decode.h
+++ b/system/ulib/hypervisor/include/hypervisor/decode.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 // clang-format off
 
@@ -23,7 +23,7 @@
 
 __BEGIN_CDECLS
 
-typedef struct mx_vcpu_state mx_vcpu_state_t;
+typedef struct zx_vcpu_state zx_vcpu_state_t;
 
 /* Stores info from a decoded instruction. */
 typedef struct instruction {
@@ -34,7 +34,7 @@
     uint32_t* flags;
 } instruction_t;
 
-mx_status_t inst_decode(const uint8_t* inst_buf, uint32_t inst_len, mx_vcpu_state_t* vcpu_state,
+zx_status_t inst_decode(const uint8_t* inst_buf, uint32_t inst_len, zx_vcpu_state_t* vcpu_state,
                         instruction_t* inst);
 
 #define DEFINE_INST_VAL(size)                                                \
@@ -47,11 +47,11 @@
 #undef DEFINE_INST_VAL
 
 #define DEFINE_INST_READ(size)                                                                   \
-    static inline mx_status_t inst_read##size(const instruction_t* inst, uint##size##_t value) { \
+    static inline zx_status_t inst_read##size(const instruction_t* inst, uint##size##_t value) { \
         if (inst->type != INST_MOV_READ || inst->mem != (size / 8))                              \
-            return MX_ERR_NOT_SUPPORTED;                                                         \
+            return ZX_ERR_NOT_SUPPORTED;                                                         \
         *inst->reg = value;                                                                      \
-        return MX_OK;                                                                            \
+        return ZX_OK;                                                                            \
     }
 DEFINE_INST_READ(32);
 DEFINE_INST_READ(16);
@@ -59,24 +59,24 @@
 #undef DEFINE_INST_READ
 
 #define DEFINE_INST_WRITE(size)                                                                    \
-    static inline mx_status_t inst_write##size(const instruction_t* inst, uint##size##_t* value) { \
+    static inline zx_status_t inst_write##size(const instruction_t* inst, uint##size##_t* value) { \
         if (inst->type != INST_MOV_WRITE || inst->mem != (size / 8))                               \
-            return MX_ERR_NOT_SUPPORTED;                                                           \
+            return ZX_ERR_NOT_SUPPORTED;                                                           \
         *value = inst_val##size(inst);                                                             \
-        return MX_OK;                                                                              \
+        return ZX_OK;                                                                              \
     }
 DEFINE_INST_WRITE(32);
 DEFINE_INST_WRITE(16);
 #undef DEFINE_INST_WRITE
 
 #define DEFINE_INST_RW(size)                                                                    \
-    static inline mx_status_t inst_rw##size(const instruction_t* inst, uint##size##_t* value) { \
+    static inline zx_status_t inst_rw##size(const instruction_t* inst, uint##size##_t* value) { \
         if (inst->type == INST_MOV_READ) {                                                      \
             return inst_read##size(inst, *value);                                               \
         } else if (inst->type == INST_MOV_WRITE) {                                              \
             return inst_write##size(inst, value);                                               \
         } else {                                                                                \
-            return MX_ERR_NOT_SUPPORTED;                                                        \
+            return ZX_ERR_NOT_SUPPORTED;                                                        \
         }                                                                                       \
     }
 DEFINE_INST_RW(32);
@@ -100,15 +100,15 @@
 }
 #endif
 
-static inline mx_status_t inst_test8(const instruction_t* inst, uint8_t inst_val, uint8_t value) {
+static inline zx_status_t inst_test8(const instruction_t* inst, uint8_t inst_val, uint8_t value) {
     if (inst->type != INST_TEST || inst->mem != 1u || inst_val8(inst) != inst_val)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 #if __x86_64__
     *inst->flags &= ~X86_FLAGS_STATUS;
     *inst->flags |= x86_flags_for_test8(inst_val, value);
-    return MX_OK;
+    return ZX_OK;
 #else // __x86_64__
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif // __x86_64__
 }
 
diff --git a/system/ulib/hypervisor/include/hypervisor/guest.h b/system/ulib/hypervisor/include/hypervisor/guest.h
index ea4d6cd..78087fa 100644
--- a/system/ulib/hypervisor/include/hypervisor/guest.h
+++ b/system/ulib/hypervisor/include/hypervisor/guest.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
@@ -21,7 +21,7 @@
  * @param size The size of guest physical memory.
  * @param end_off The offset to the end of the page table.
  */
-mx_status_t guest_create_page_table(uintptr_t addr, size_t size, uintptr_t* end_off);
+zx_status_t guest_create_page_table(uintptr_t addr, size_t size, uintptr_t* end_off);
 
 /**
  * Return the size in bytes of e820 memory map.
@@ -37,11 +37,11 @@
  * @param size The size of guest physical memory.
  * @param e820_off The offset to the e820 memory map.
  */
-mx_status_t guest_create_e820(uintptr_t addr, size_t size, uintptr_t e820_off);
+zx_status_t guest_create_e820(uintptr_t addr, size_t size, uintptr_t e820_off);
 
 /**
  * Get a hypervisor resource to create a guest.
  */
-mx_status_t guest_get_resource(mx_handle_t* resource);
+zx_status_t guest_get_resource(zx_handle_t* resource);
 
 __END_CDECLS
diff --git a/system/ulib/hypervisor/include/hypervisor/io_apic.h b/system/ulib/hypervisor/include/hypervisor/io_apic.h
index 70c904b..44826c1 100644
--- a/system/ulib/hypervisor/include/hypervisor/io_apic.h
+++ b/system/ulib/hypervisor/include/hypervisor/io_apic.h
@@ -7,7 +7,7 @@
 #include <threads.h>
 
 #include <hypervisor/decode.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls/port.h>
 
 #define IO_APIC_REDIRECTS 48u
 #define IO_APIC_REDIRECT_OFFSETS (IO_APIC_REDIRECTS * 2)
@@ -33,20 +33,20 @@
 void io_apic_init(io_apic_t* io_apic);
 
 /* Associate a local APIC with an IO APIC. */
-mx_status_t io_apic_register_local_apic(io_apic_t* io_apic, uint8_t local_apic_id,
+zx_status_t io_apic_register_local_apic(io_apic_t* io_apic, uint8_t local_apic_id,
                                         local_apic_t* local_apic);
 
 /* Handle memory access to the IO APIC. */
-mx_status_t io_apic_handler(io_apic_t* io_apic, const mx_packet_guest_mem_t* mem,
+zx_status_t io_apic_handler(io_apic_t* io_apic, const zx_packet_guest_mem_t* mem,
                             const instruction_t* inst);
 
 /* Returns the redirected interrupt vector and target VCPU for the given
  * global IRQ.
  */
-mx_status_t io_apic_redirect(const io_apic_t* io_apic, uint32_t global_irq, uint8_t* vector,
-                             mx_handle_t* vcpu);
+zx_status_t io_apic_redirect(const io_apic_t* io_apic, uint32_t global_irq, uint8_t* vector,
+                             zx_handle_t* vcpu);
 
 /* Signals the given global IRQ. */
-mx_status_t io_apic_interrupt(const io_apic_t* io_apic, uint32_t global_irq);
+zx_status_t io_apic_interrupt(const io_apic_t* io_apic, uint32_t global_irq);
 
 __END_CDECLS
diff --git a/system/ulib/hypervisor/include/hypervisor/io_port.h b/system/ulib/hypervisor/include/hypervisor/io_port.h
index e24f29b..0ae161a 100644
--- a/system/ulib/hypervisor/include/hypervisor/io_port.h
+++ b/system/ulib/hypervisor/include/hypervisor/io_port.h
@@ -6,12 +6,12 @@
 
 #include <threads.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
-typedef struct mx_packet_guest_io mx_packet_guest_io_t;
-typedef struct mx_vcpu_io mx_vcpu_io_t;
+typedef struct zx_packet_guest_io zx_packet_guest_io_t;
+typedef struct zx_vcpu_io zx_vcpu_io_t;
 
 /* Stores the IO port state. */
 typedef struct io_port {
@@ -25,7 +25,7 @@
 } io_port_t;
 
 void io_port_init(io_port_t* io_port);
-mx_status_t io_port_read(const io_port_t* io_port, uint16_t port, mx_vcpu_io_t* vcpu_io);
-mx_status_t io_port_write(io_port_t* io_port, const mx_packet_guest_io_t* io);
+zx_status_t io_port_read(const io_port_t* io_port, uint16_t port, zx_vcpu_io_t* vcpu_io);
+zx_status_t io_port_write(io_port_t* io_port, const zx_packet_guest_io_t* io);
 
 __END_CDECLS
diff --git a/system/ulib/hypervisor/include/hypervisor/pci.h b/system/ulib/hypervisor/include/hypervisor/pci.h
index f97eb07..8c6be00 100644
--- a/system/ulib/hypervisor/include/hypervisor/pci.h
+++ b/system/ulib/hypervisor/include/hypervisor/pci.h
@@ -6,7 +6,7 @@
 
 #include <threads.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <sys/types.h>
 
 // clang-format off
@@ -46,21 +46,21 @@
 
 typedef struct instruction instruction_t;
 typedef struct io_apic io_apic_t;
-typedef struct mx_packet_guest_io mx_packet_guest_io_t;
-typedef struct mx_packet_guest_mem mx_packet_guest_mem_t;
-typedef struct mx_vcpu_io mx_vcpu_io_t;
+typedef struct zx_packet_guest_io zx_packet_guest_io_t;
+typedef struct zx_packet_guest_mem zx_packet_guest_mem_t;
+typedef struct zx_vcpu_io zx_vcpu_io_t;
 typedef struct pci_bus pci_bus_t;
 typedef struct pci_device pci_device_t;
 
 /* Device specific callbacks. */
 typedef struct pci_device_ops {
     // Read from a region mapped by a BAR register.
-    mx_status_t (*read_bar)(const pci_device_t* device, uint8_t bar, uint16_t port,
-                            uint8_t access_size, mx_vcpu_io_t* vcpu_io);
+    zx_status_t (*read_bar)(const pci_device_t* device, uint8_t bar, uint16_t port,
+                            uint8_t access_size, zx_vcpu_io_t* vcpu_io);
 
     // Write to a region mapped by a BAR register.
-    mx_status_t (*write_bar)(pci_device_t* device, uint8_t bar, uint16_t port,
-                             const mx_vcpu_io_t* io);
+    zx_status_t (*write_bar)(pci_device_t* device, uint8_t bar, uint16_t port,
+                             const zx_vcpu_io_t* io);
 } pci_device_ops_t;
 
 /* PCI capability structure.
@@ -138,30 +138,30 @@
     uint32_t pio_base;
 } pci_bus_t;
 
-mx_status_t pci_bus_init(pci_bus_t* bus, const io_apic_t* io_apic);
+zx_status_t pci_bus_init(pci_bus_t* bus, const io_apic_t* io_apic);
 
 /* Connect a PCI device to the bus.
  *
  * slot must be between 1 and PCI_MAX_DEVICES (slot 0 is reserved for
  * the root complex).
  */
-mx_status_t pci_bus_connect(pci_bus_t* bus, pci_device_t* device, uint8_t slot);
+zx_status_t pci_bus_connect(pci_bus_t* bus, pci_device_t* device, uint8_t slot);
 
 /* Handle reads from the PCI ECAM region. */
-mx_status_t pci_ecam_read(pci_bus_t* bus, mx_vaddr_t addr, uint8_t access_size, mx_vcpu_io_t* io);
+zx_status_t pci_ecam_read(pci_bus_t* bus, zx_vaddr_t addr, uint8_t access_size, zx_vcpu_io_t* io);
 
 /* Handle writes to the PCI ECAM region. */
-mx_status_t pci_ecam_write(pci_bus_t* bus, mx_vaddr_t addr, const mx_vcpu_io_t* io);
+zx_status_t pci_ecam_write(pci_bus_t* bus, zx_vaddr_t addr, const zx_vcpu_io_t* io);
 
 /* Handle PIO reads to the PCI config space. */
-mx_status_t pci_bus_read(const pci_bus_t* bus, uint16_t port, uint8_t access_size,
-                         mx_vcpu_io_t* vcpu_io);
+zx_status_t pci_bus_read(const pci_bus_t* bus, uint16_t port, uint8_t access_size,
+                         zx_vcpu_io_t* vcpu_io);
 
 /* Handle PIO writes to the PCI config space. */
-mx_status_t pci_bus_write(pci_bus_t* bus, const mx_packet_guest_io_t* io);
+zx_status_t pci_bus_write(pci_bus_t* bus, const zx_packet_guest_io_t* io);
 
-mx_status_t pci_device_read(const pci_device_t* device, uint16_t reg, uint8_t len, uint32_t* value);
-mx_status_t pci_device_write(pci_device_t* device, uint16_t reg, uint8_t len, uint32_t value);
+zx_status_t pci_device_read(const pci_device_t* device, uint16_t reg, uint8_t len, uint32_t* value);
+zx_status_t pci_device_write(pci_device_t* device, uint16_t reg, uint8_t len, uint32_t value);
 
 /* Return the device that has a BAR mapped to the given address with the
  * specified IO type. Returns NULL if no mapping exists or IO is disabled for
@@ -180,9 +180,9 @@
 uint16_t pci_bar_size(pci_bar_t* bar);
 
 /* Start asynchronous handling of writes to the pci device. */
-mx_status_t pci_device_async(pci_device_t* device, mx_handle_t guest);
+zx_status_t pci_device_async(pci_device_t* device, zx_handle_t guest);
 
 /* Raise the configured interrupt for the given PCI device. */
-mx_status_t pci_interrupt(pci_device_t* device);
+zx_status_t pci_interrupt(pci_device_t* device);
 
 __END_CDECLS
diff --git a/system/ulib/hypervisor/include/hypervisor/uart.h b/system/ulib/hypervisor/include/hypervisor/uart.h
index 4ea2741..860f11b 100644
--- a/system/ulib/hypervisor/include/hypervisor/uart.h
+++ b/system/ulib/hypervisor/include/hypervisor/uart.h
@@ -6,7 +6,7 @@
 
 #include <threads.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 // clang-format off
 
@@ -34,8 +34,8 @@
 __BEGIN_CDECLS
 
 typedef struct io_apic io_apic_t;
-typedef struct mx_packet_guest_io mx_packet_guest_io_t;
-typedef struct mx_vcpu_io mx_vcpu_io_t;
+typedef struct zx_packet_guest_io zx_packet_guest_io_t;
+typedef struct zx_vcpu_io zx_vcpu_io_t;
 
 /* Stores the state of a UART. */
 typedef struct uart {
@@ -65,14 +65,14 @@
     uint8_t line_status;
 
     // Raise an interrupt.
-    mx_status_t (*raise_interrupt)(mx_handle_t vcpu, uint32_t vector);
+    zx_status_t (*raise_interrupt)(zx_handle_t vcpu, uint32_t vector);
 } uart_t;
 
 void uart_init(uart_t* uart, const io_apic_t* io_apic);
-mx_status_t uart_read(uart_t* uart, uint16_t port, mx_vcpu_io_t* vcpu_io);
-mx_status_t uart_write(uart_t* uart, const mx_packet_guest_io_t* io);
+zx_status_t uart_read(uart_t* uart, uint16_t port, zx_vcpu_io_t* vcpu_io);
+zx_status_t uart_write(uart_t* uart, const zx_packet_guest_io_t* io);
 
 /* Start asynchronous handling of UART. */
-mx_status_t uart_async(uart_t* uart, mx_handle_t guest);
+zx_status_t uart_async(uart_t* uart, zx_handle_t guest);
 
 __END_CDECLS
diff --git a/system/ulib/hypervisor/include/hypervisor/vcpu.h b/system/ulib/hypervisor/include/hypervisor/vcpu.h
index 19611a6..81cf2fe 100644
--- a/system/ulib/hypervisor/include/hypervisor/vcpu.h
+++ b/system/ulib/hypervisor/include/hypervisor/vcpu.h
@@ -6,13 +6,13 @@
 
 #include <threads.h>
 
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls/hypervisor.h>
 
 __BEGIN_CDECLS
 
 typedef struct io_apic io_apic_t;
 typedef struct io_port io_port_t;
-typedef struct mx_port_packet mx_port_packet_t;
+typedef struct zx_port_packet zx_port_packet_t;
 typedef struct pci_bus pci_bus_t;
 typedef struct uart uart_t;
 
@@ -27,8 +27,8 @@
 
 /* Typedefs to abstract reading and writing VCPU state. */
 typedef struct vcpu_ctx vcpu_ctx_t;
-typedef mx_status_t (*read_state_fn_t)(vcpu_ctx_t* vcpu, uint32_t kind, void* buffer, uint32_t len);
-typedef mx_status_t (*write_state_fn_t)(vcpu_ctx_t* vcpu, uint32_t kind, const void* buffer, uint32_t len);
+typedef zx_status_t (*read_state_fn_t)(vcpu_ctx_t* vcpu, uint32_t kind, void* buffer, uint32_t len);
+typedef zx_status_t (*write_state_fn_t)(vcpu_ctx_t* vcpu, uint32_t kind, const void* buffer, uint32_t len);
 
 /* Local APIC registers are all 128-bit aligned. */
 typedef union local_apic_reg {
@@ -61,7 +61,7 @@
 /* Stores the local APIC state. */
 typedef struct local_apic {
     // VCPU associated with this APIC.
-    mx_handle_t vcpu;
+    zx_handle_t vcpu;
     union {
         // Address of the local APIC.
         void* apic_addr;
@@ -72,7 +72,7 @@
 
 /* Stores the state associated with a single VCPU. */
 typedef struct vcpu_ctx {
-    mx_handle_t vcpu;
+    zx_handle_t vcpu;
 
     read_state_fn_t read_state;
     write_state_fn_t write_state;
@@ -85,20 +85,20 @@
 void vcpu_init(vcpu_ctx_t* vcpu_ctx);
 
 /* Controls execution of a VCPU context, providing the main logic. */
-mx_status_t vcpu_loop(vcpu_ctx_t* vcpu_ctx);
+zx_status_t vcpu_loop(vcpu_ctx_t* vcpu_ctx);
 
 /* Processes a single guest packet. */
-mx_status_t vcpu_packet_handler(vcpu_ctx_t* vcpu_ctx, mx_port_packet_t* packet);
+zx_status_t vcpu_packet_handler(vcpu_ctx_t* vcpu_ctx, zx_port_packet_t* packet);
 
-typedef mx_status_t (*device_handler_fn_t)(mx_port_packet_t* packet, void* ctx);
+typedef zx_status_t (*device_handler_fn_t)(zx_port_packet_t* packet, void* ctx);
 
 /* A set of arguments to specify a trap region.
  *
- * See mx_guest_set_trap for more details on trap args.
+ * See zx_guest_set_trap for more details on trap args.
  */
 typedef struct trap_args {
     uint32_t kind;
-    mx_vaddr_t addr;
+    zx_vaddr_t addr;
     size_t len;
     uint32_t key;
 } trap_args_t;
@@ -106,7 +106,7 @@
 /* Start asynchronous handling of device operations, based on a set of traps
  * provided. A trap will be created for every trap in |traps|.
  */
-mx_status_t device_async(mx_handle_t guest, const trap_args_t* traps, size_t num_traps,
+zx_status_t device_async(zx_handle_t guest, const trap_args_t* traps, size_t num_traps,
                          device_handler_fn_t handler, void* ctx);
 
 __END_CDECLS
diff --git a/system/ulib/hypervisor/include/hypervisor/virtio.h b/system/ulib/hypervisor/include/hypervisor/virtio.h
index 387bc85..581e76b 100644
--- a/system/ulib/hypervisor/include/hypervisor/virtio.h
+++ b/system/ulib/hypervisor/include/hypervisor/virtio.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include <hypervisor/pci.h>
-#include <magenta/syscalls/hypervisor.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/hypervisor.h>
+#include <zircon/types.h>
 #include <virtio/virtio.h>
 
 // clang-format off
@@ -24,21 +24,21 @@
 struct vring_used;
 
 typedef struct io_apic io_apic_t;
-typedef struct mx_vcpu_io mx_vcpu_io_t;
+typedef struct zx_vcpu_io zx_vcpu_io_t;
 typedef struct virtio_device virtio_device_t;
 typedef struct virtio_queue virtio_queue_t;
 
 /* Device-specific operations. */
 typedef struct virtio_device_ops {
     // Read a device configuration field.
-    mx_status_t (*read)(const virtio_device_t* device, uint16_t port, uint8_t access_size,
-                        mx_vcpu_io_t* vcpu_io);
+    zx_status_t (*read)(const virtio_device_t* device, uint16_t port, uint8_t access_size,
+                        zx_vcpu_io_t* vcpu_io);
 
     // Write a device configuration field.
-    mx_status_t (*write)(virtio_device_t* device, uint16_t port, const mx_vcpu_io_t* io);
+    zx_status_t (*write)(virtio_device_t* device, uint16_t port, const zx_vcpu_io_t* io);
 
     // Handle notify events for one of this devices queues.
-    mx_status_t (*queue_notify)(virtio_device_t* device, uint16_t queue_sel);
+    zx_status_t (*queue_notify)(virtio_device_t* device, uint16_t queue_sel);
 } virtio_device_ops_t;
 
 static const size_t kVirtioPciNumCapabilities = 4;
@@ -105,10 +105,10 @@
 void virtio_pci_init(virtio_device_t* device);
 
 /* Send an interrupt back to the guest for a device. */
-mx_status_t virtio_device_notify(virtio_device_t* device);
+zx_status_t virtio_device_notify(virtio_device_t* device);
 
 /* Handle kicks from the guest to process a queue. */
-mx_status_t virtio_device_kick(virtio_device_t* device, uint16_t queue_sel);
+zx_status_t virtio_device_kick(virtio_device_t* device, uint16_t queue_sel);
 
 /* Stores the Virtio queue based on the ring provided by the guest.
  *
@@ -159,25 +159,25 @@
  * used     - To be incremented by the number of bytes used from addr.
  * ctx      - The same pointer passed to virtio_queue_handler.
  */
-typedef mx_status_t (*virtio_queue_fn_t)(void* addr, uint32_t len, uint16_t flags, uint32_t* used,
+typedef zx_status_t (*virtio_queue_fn_t)(void* addr, uint32_t len, uint16_t flags, uint32_t* used,
                                          void* ctx);
 
 /* Handles the next available descriptor in a Virtio queue, calling handler to
  * process individual payload buffers.
  *
- * On success the function either returns MX_OK if there are no more descriptors
- * available, or MX_ERR_NEXT if there are more available descriptors to process.
+ * On success the function either returns ZX_OK if there are no more descriptors
+ * available, or ZX_ERR_NEXT if there are more available descriptors to process.
  */
-mx_status_t virtio_queue_handler(virtio_queue_t* queue, virtio_queue_fn_t handler, void* ctx);
+zx_status_t virtio_queue_handler(virtio_queue_t* queue, virtio_queue_fn_t handler, void* ctx);
 
 /* Get the index of the next descriptor in the available ring.
  *
  * If a buffer is a available, the descriptor index is written to |index|, the
- * queue index pointer is incremented, and MX_OK is returned.
+ * queue index pointer is incremented, and ZX_OK is returned.
  *
- * If no buffers are available MX_ERR_NOT_FOUND is returned.
+ * If no buffers are available ZX_ERR_NOT_FOUND is returned.
  */
-mx_status_t virtio_queue_next_avail(virtio_queue_t* queue, uint16_t* index);
+zx_status_t virtio_queue_next_avail(virtio_queue_t* queue, uint16_t* index);
 
 /* Blocking variant of virtio_queue_next_avail. */
 void virtio_queue_wait(virtio_queue_t* queue, uint16_t* index);
@@ -202,20 +202,20 @@
  * used     - To be incremented by the number of bytes used from addr.
  * ctx      - The same pointer passed to virtio_queue_poll.
  *
- * The queue will continue to be polled as long as this method returns MX_OK.
- * The error MX_ERR_STOP will be treated as a special value to indicate queue
+ * The queue will continue to be polled as long as this method returns ZX_OK.
+ * The error ZX_ERR_STOP will be treated as a special value to indicate queue
  * polling should stop gracefully and terminate the thread.
  *
  * Any other error values will be treated as unexpected errors that will cause
  * the polling thread to be terminated with a non-zero exit value.
  */
-typedef mx_status_t (*virtio_queue_poll_fn_t)(virtio_queue_t* queue, uint16_t head,
+typedef zx_status_t (*virtio_queue_poll_fn_t)(virtio_queue_t* queue, uint16_t head,
                                               uint32_t* used, void* ctx);
 
 /* Spawn a thread to wait for descriptors to be available and invoke the
  * provided handler on each available buffer asyncronously.
  */
-mx_status_t virtio_queue_poll(virtio_queue_t* queue, virtio_queue_poll_fn_t handler, void* ctx);
+zx_status_t virtio_queue_poll(virtio_queue_t* queue, virtio_queue_poll_fn_t handler, void* ctx);
 
 /* A higher-level API for vring_desc. */
 typedef struct virtio_desc {
@@ -238,7 +238,7 @@
  * virtio_queue_next_avail (including any chained decriptors) and before
  * they've been released with virtio_queue_return.
  */
-mx_status_t virtio_queue_read_desc(virtio_queue_t* queue, uint16_t index, virtio_desc_t* desc);
+zx_status_t virtio_queue_read_desc(virtio_queue_t* queue, uint16_t index, virtio_desc_t* desc);
 
 /* Return a descriptor to the used ring.
  *
diff --git a/system/ulib/hypervisor/io_apic.cpp b/system/ulib/hypervisor/io_apic.cpp
index be48916..dcfee31 100644
--- a/system/ulib/hypervisor/io_apic.cpp
+++ b/system/ulib/hypervisor/io_apic.cpp
@@ -8,9 +8,9 @@
 #include <hypervisor/bits.h>
 #include <hypervisor/io_apic.h>
 #include <hypervisor/vcpu.h>
-#include <magenta/assert.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/assert.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/hypervisor.h>
 
 // clang-format off
 
@@ -40,22 +40,22 @@
     memset(io_apic, 0, sizeof(*io_apic));
 }
 
-mx_status_t io_apic_register_local_apic(io_apic_t* io_apic, uint8_t local_apic_id,
+zx_status_t io_apic_register_local_apic(io_apic_t* io_apic, uint8_t local_apic_id,
                                         local_apic_t* local_apic) {
     if (local_apic_id >= IO_APIC_MAX_LOCAL_APICS)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     if (io_apic->local_apic[local_apic_id] != NULL)
-        return MX_ERR_ALREADY_EXISTS;
+        return ZX_ERR_ALREADY_EXISTS;
 
     local_apic->regs->id.u32 = local_apic_id;
     io_apic->local_apic[local_apic_id] = local_apic;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t io_apic_redirect(const io_apic_t* io_apic, uint32_t global_irq, uint8_t* out_vector,
-                             mx_handle_t* out_vcpu) {
+zx_status_t io_apic_redirect(const io_apic_t* io_apic, uint32_t global_irq, uint8_t* out_vector,
+                             zx_handle_t* out_vcpu) {
     if (global_irq >= IO_APIC_REDIRECTS)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     mtx_lock((mtx_t*)&io_apic->mutex);
     uint32_t lower = io_apic->redirect[global_irq * 2];
@@ -81,10 +81,10 @@
         uint32_t dest = bits_shift(upper, 27, 24);
         local_apic_t* apic = dest < IO_APIC_MAX_LOCAL_APICS ? io_apic->local_apic[dest] : NULL;
         if (apic == NULL)
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
         *out_vector = static_cast<uint8_t>(vector);
         *out_vcpu = apic->vcpu;
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Logical DESTMOD.
@@ -104,7 +104,7 @@
         uint32_t model = bits_shift(local_apic->regs->dfr.u32, 31, 28);
         if (model != LOCAL_APIC_DFR_FLAT_MODEL) {
             fprintf(stderr, "APIC only supports the flat model.\n");
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
 
         // Note we're not currently respecting the DELMODE field and
@@ -112,21 +112,21 @@
         // targeted.
         *out_vector = static_cast<uint8_t>(vector);
         *out_vcpu = local_apic->vcpu;
-        return MX_OK;
+        return ZX_OK;
     }
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
-mx_status_t io_apic_interrupt(const io_apic_t* io_apic, uint32_t global_irq) {
+zx_status_t io_apic_interrupt(const io_apic_t* io_apic, uint32_t global_irq) {
     uint8_t vector;
-    mx_handle_t vcpu;
-    mx_status_t status = io_apic_redirect(io_apic, global_irq, &vector, &vcpu);
-    if (status != MX_OK)
+    zx_handle_t vcpu;
+    zx_status_t status = io_apic_redirect(io_apic, global_irq, &vector, &vcpu);
+    if (status != ZX_OK)
         return status;
-    return mx_vcpu_interrupt(vcpu, vector);
+    return zx_vcpu_interrupt(vcpu, vector);
 }
 
-static mx_status_t io_apic_register_handler(io_apic_t* io_apic, const instruction_t* inst) {
+static zx_status_t io_apic_register_handler(io_apic_t* io_apic, const instruction_t* inst) {
     switch (io_apic->select) {
     case IO_APIC_REGISTER_ID:
         return inst_rw32(inst, &io_apic->id);
@@ -146,34 +146,34 @@
     }
     default:
         fprintf(stderr, "Unhandled IO APIC register %#x\n", io_apic->select);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-mx_status_t io_apic_handler(io_apic_t* io_apic, const mx_packet_guest_mem_t* mem,
+zx_status_t io_apic_handler(io_apic_t* io_apic, const zx_packet_guest_mem_t* mem,
                             const instruction_t* inst) {
-    MX_ASSERT(mem->addr >= IO_APIC_PHYS_BASE);
-    mx_vaddr_t offset = mem->addr - IO_APIC_PHYS_BASE;
+    ZX_ASSERT(mem->addr >= IO_APIC_PHYS_BASE);
+    zx_vaddr_t offset = mem->addr - IO_APIC_PHYS_BASE;
 
     switch (offset) {
     case IO_APIC_IOREGSEL: {
         uint32_t select;
-        mx_status_t status = inst_write32(inst, &select);
-        if (status != MX_OK)
+        zx_status_t status = inst_write32(inst, &select);
+        if (status != ZX_OK)
             return status;
         mtx_lock((mtx_t*)&io_apic->mutex);
         io_apic->select = select;
         mtx_unlock((mtx_t*)&io_apic->mutex);
-        return select > UINT8_MAX ? MX_ERR_INVALID_ARGS : MX_OK;
+        return select > UINT8_MAX ? ZX_ERR_INVALID_ARGS : ZX_OK;
     }
     case IO_APIC_IOWIN: {
         mtx_lock((mtx_t*)&io_apic->mutex);
-        mx_status_t status = io_apic_register_handler(io_apic, inst);
+        zx_status_t status = io_apic_register_handler(io_apic, inst);
         mtx_unlock((mtx_t*)&io_apic->mutex);
         return status;
     }
     default:
         fprintf(stderr, "Unhandled IO APIC address %#lx\n", offset);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
diff --git a/system/ulib/hypervisor/io_port.cpp b/system/ulib/hypervisor/io_port.cpp
index a3d4a2b..1bdd83b 100644
--- a/system/ulib/hypervisor/io_port.cpp
+++ b/system/ulib/hypervisor/io_port.cpp
@@ -7,8 +7,8 @@
 
 #include <hypervisor/address.h>
 #include <hypervisor/io_port.h>
-#include <magenta/syscalls/hypervisor.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls/hypervisor.h>
+#include <zircon/syscalls/port.h>
 
 #include "acpi_priv.h"
 
@@ -49,11 +49,11 @@
     return static_cast<uint8_t>(((binary / 10) << 4) | (binary % 10));
 }
 
-static mx_status_t handle_rtc(uint8_t rtc_index, uint8_t* value) {
+static zx_status_t handle_rtc(uint8_t rtc_index, uint8_t* value) {
     time_t now = time(NULL);
     struct tm tm;
     if (localtime_r(&now, &tm) == NULL)
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     switch (rtc_index) {
     case RTC_REGISTER_SECONDS:
         *value = to_bcd(tm.tm_sec);
@@ -88,12 +88,12 @@
             *value |= RTC_REGISTER_B_DAYLIGHT_SAVINGS;
         break;
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t io_port_read(const io_port_t* io_port, uint16_t port, mx_vcpu_io_t* vcpu_io) {
+zx_status_t io_port_read(const io_port_t* io_port, uint16_t port, zx_vcpu_io_t* vcpu_io) {
 #ifdef __x86_64__
     switch (port) {
     case RTC_DATA_PORT: {
@@ -128,15 +128,15 @@
         vcpu_io->u8 = PIC_INVALID;
         break;
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
-    return MX_OK;
+    return ZX_OK;
 #else // __x86_64__
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif // __x86_64__
 }
 
-mx_status_t io_port_write(io_port_t* io_port, const mx_packet_guest_io_t* io) {
+zx_status_t io_port_write(io_port_t* io_port, const zx_packet_guest_io_t* io) {
 #ifdef __x86_64__
     switch (io->port) {
     case I8042_DATA_PORT:
@@ -148,30 +148,30 @@
         break;
     case I8042_COMMAND_PORT:
         if (io->access_size != 1)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         mtx_lock(&io_port->mutex);
         io_port->i8042_command = io->u8;
         mtx_unlock(&io_port->mutex);
         break;
     case PM1_EVENT_PORT + PM1A_REGISTER_ENABLE:
         if (io->access_size != 2)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         mtx_lock(&io_port->mutex);
         io_port->pm1_enable = io->u16;
         mtx_unlock(&io_port->mutex);
         break;
     case RTC_INDEX_PORT:
         if (io->access_size != 1)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         mtx_lock(&io_port->mutex);
         io_port->rtc_index = io->u8;
         mtx_unlock(&io_port->mutex);
         break;
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
-    return MX_OK;
+    return ZX_OK;
 #else // __x86_64__
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif // __x86_64__
 }
diff --git a/system/ulib/hypervisor/pci.cpp b/system/ulib/hypervisor/pci.cpp
index 47fa46a..b570e3b 100644
--- a/system/ulib/hypervisor/pci.cpp
+++ b/system/ulib/hypervisor/pci.cpp
@@ -13,8 +13,8 @@
 #include <hypervisor/decode.h>
 #include <hypervisor/io_apic.h>
 #include <hypervisor/vcpu.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/hypervisor.h>
 #include <virtio/virtio_ids.h>
 
 // PCI BAR register addresses.
@@ -44,14 +44,14 @@
  */
 static const uint32_t kPciGlobalIrqAssigments[PCI_MAX_DEVICES] = {32, 33, 34};
 
-static mx_status_t pci_bar_read_unsupported(const pci_device_t* device, uint8_t bar, uint16_t port,
-                                            uint8_t access_size, mx_vcpu_io_t* vcpu_io) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t pci_bar_read_unsupported(const pci_device_t* device, uint8_t bar, uint16_t port,
+                                            uint8_t access_size, zx_vcpu_io_t* vcpu_io) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t pci_bar_write_unsupported(pci_device_t* device, uint8_t bar, uint16_t port,
-                                             const mx_vcpu_io_t* io) {
-    return MX_ERR_NOT_SUPPORTED;
+static zx_status_t pci_bar_write_unsupported(pci_device_t* device, uint8_t bar, uint16_t port,
+                                             const zx_vcpu_io_t* io) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static inline bool pci_bar_implemented(pci_device_t* device, uint8_t bar) {
@@ -73,7 +73,7 @@
     host_bridge->ops = &kRootComplexDeviceOps;
 }
 
-mx_status_t pci_bus_init(pci_bus_t* bus, const io_apic_t* io_apic) {
+zx_status_t pci_bus_init(pci_bus_t* bus, const io_apic_t* io_apic) {
     memset(bus, 0, sizeof(*bus));
     bus->io_apic = io_apic;
     bus->pio_base = kPioBase;
@@ -81,11 +81,11 @@
     return pci_bus_connect(bus, &bus->root_complex, PCI_DEVICE_ROOT_COMPLEX);
 }
 
-mx_status_t pci_bus_connect(pci_bus_t* bus, pci_device_t* device, uint8_t slot) {
+zx_status_t pci_bus_connect(pci_bus_t* bus, pci_device_t* device, uint8_t slot) {
     if (slot >= PCI_MAX_DEVICES)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     if (bus->device[slot])
-        return MX_ERR_ALREADY_EXISTS;
+        return ZX_ERR_ALREADY_EXISTS;
 
     // Initialize BAR registers.
     for (uint8_t bar_num = 0; bar_num < PCI_MAX_BARS; ++bar_num) {
@@ -99,7 +99,7 @@
         // size and are naturally aligned.
         uint32_t bar_size = round_up_pow2(device->bar[bar_num].size);
         if (bar_size > kMaxBarSize)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
 
         device->bus = bus;
         device->bar[bar_num].size = static_cast<uint16_t>(bar_size);
@@ -110,7 +110,7 @@
     device->command = PCI_COMMAND_IO_EN;
     device->global_irq = kPciGlobalIrqAssigments[slot];
     bus->device[slot] = device;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static bool pci_addr_valid(const pci_bus_t* b, uint8_t bus, uint8_t device, uint8_t function) {
@@ -128,31 +128,31 @@
     *value = bit_mask<uint32_t>(len * 8);
 }
 
-mx_status_t pci_ecam_read(pci_bus_t* bus, mx_vaddr_t addr, uint8_t access_size, mx_vcpu_io_t* io) {
+zx_status_t pci_ecam_read(pci_bus_t* bus, zx_vaddr_t addr, uint8_t access_size, zx_vcpu_io_t* io) {
     const uint8_t device = PCI_ECAM_DEVICE(addr);
     const uint16_t reg = PCI_ECAM_REGISTER(addr);
     const bool valid = pci_addr_valid(bus, PCI_ECAM_BUS(addr), device, PCI_ECAM_FUNCTION(addr));
     if (!valid) {
         pci_addr_invalid_read(access_size, &io->u32);
-        return MX_OK;
+        return ZX_OK;
     }
 
     return pci_device_read(bus->device[device], reg, access_size, &io->u32);
 }
 
-mx_status_t pci_ecam_write(pci_bus_t* bus, mx_vaddr_t addr, const mx_vcpu_io_t* io) {
+zx_status_t pci_ecam_write(pci_bus_t* bus, zx_vaddr_t addr, const zx_vcpu_io_t* io) {
     const uint8_t device = PCI_ECAM_DEVICE(addr);
     const uint16_t reg = PCI_ECAM_REGISTER(addr);
     const bool valid = pci_addr_valid(bus, PCI_ECAM_BUS(addr), device, PCI_ECAM_FUNCTION(addr));
     if (!valid) {
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
 
     return pci_device_write(bus->device[device], reg, io->access_size, io->u32);
 }
 
-mx_status_t pci_bus_read(const pci_bus_t* bus, uint16_t port, uint8_t access_size,
-                         mx_vcpu_io_t* vcpu_io) {
+zx_status_t pci_bus_read(const pci_bus_t* bus, uint16_t port, uint8_t access_size,
+                         zx_vcpu_io_t* vcpu_io) {
     switch (port) {
     case PCI_CONFIG_ADDRESS_PORT_BASE ... PCI_CONFIG_ADDRESS_PORT_TOP: {
         uint32_t bit_offset = (port - PCI_CONFIG_ADDRESS_PORT_BASE) * 8;
@@ -162,7 +162,7 @@
         mtx_unlock((mtx_t*)&bus->mutex);
         vcpu_io->access_size = access_size;
         vcpu_io->u32 = (vcpu_io->u32 & ~mask) | (addr & mask);
-        return MX_OK;
+        return ZX_OK;
     }
     case PCI_CONFIG_DATA_PORT_BASE ... PCI_CONFIG_DATA_PORT_TOP: {
         mtx_lock((mtx_t*)&bus->mutex);
@@ -172,7 +172,7 @@
         if (!pci_addr_valid(bus, PCI_TYPE1_BUS(addr), PCI_TYPE1_DEVICE(addr),
                             PCI_TYPE1_FUNCTION(addr))) {
             pci_addr_invalid_read(access_size, &vcpu_io->u32);
-            return MX_OK;
+            return ZX_OK;
         }
 
         const pci_device_t* device = bus->device[PCI_TYPE1_DEVICE(addr)];
@@ -180,11 +180,11 @@
         return pci_device_read(device, static_cast<uint16_t>(reg), access_size, &vcpu_io->u32);
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
-mx_status_t pci_bus_write(pci_bus_t* bus, const mx_packet_guest_io_t* io) {
+zx_status_t pci_bus_write(pci_bus_t* bus, const zx_packet_guest_io_t* io) {
     switch (io->port) {
     case PCI_CONFIG_ADDRESS_PORT_BASE ... PCI_CONFIG_ADDRESS_PORT_TOP: {
         // Software can (and Linux does) perform partial word accesses to the
@@ -200,21 +200,21 @@
         // Set the bits of the address.
         bus->config_addr |= (io->u32 & mask) << bit_offset;
         mtx_unlock(&bus->mutex);
-        return MX_OK;
+        return ZX_OK;
     }
     case PCI_CONFIG_DATA_PORT_BASE ... PCI_CONFIG_DATA_PORT_TOP: {
         mtx_lock(&bus->mutex);
         uint32_t addr = bus->config_addr;
         mtx_unlock(&bus->mutex);
         if (!pci_addr_valid(bus, PCI_TYPE1_BUS(addr), PCI_TYPE1_DEVICE(addr), PCI_TYPE1_FUNCTION(addr)))
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
 
         pci_device_t* device = bus->device[PCI_TYPE1_DEVICE(addr)];
         uint32_t reg = PCI_TYPE1_REGISTER(addr) + io->port - PCI_CONFIG_DATA_PORT_BASE;
         return pci_device_write(device, static_cast<uint16_t>(reg), io->access_size, io->u32);
     }
     default:
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
@@ -243,12 +243,12 @@
     return nullptr;
 }
 
-static mx_status_t pci_read_cap(const pci_device_t* device, uint8_t addr, uint32_t* out) {
+static zx_status_t pci_read_cap(const pci_device_t* device, uint8_t addr, uint32_t* out) {
     uint8_t cap_index;
     uint32_t cap_base;
     const pci_cap_t* cap = pci_find_cap(device, addr, &cap_index, &cap_base);
     if (cap == nullptr)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     uint32_t word = 0;
     uint32_t cap_offset = addr - cap_base;
@@ -282,20 +282,20 @@
     }
 
     *out = word;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // PCI LOCAL BUS SPECIFICATION, REV. 3.0 Section 6.1
 //
 // Read accesses to reserved or unimplemented registers must be completed
 // normally and a data value of 0 returned.
-static mx_status_t pci_device_read_unimplemented(uint32_t* value) {
+static zx_status_t pci_device_read_unimplemented(uint32_t* value) {
     *value = 0;
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* Read a 4 byte aligned value from PCI config space. */
-static mx_status_t pci_device_read_word(const pci_device_t* device, uint8_t reg, uint32_t* value) {
+static zx_status_t pci_device_read_word(const pci_device_t* device, uint8_t reg, uint32_t* value) {
     switch (reg) {
     //  ---------------------------------
     // |   (31..16)     |    (15..0)     |
@@ -304,7 +304,7 @@
     case PCI_CONFIG_VENDOR_ID:
         *value = device->vendor_id;
         *value |= device->device_id << 16;
-        return MX_OK;
+        return ZX_OK;
     //  ----------------------------
     // |   (31..16)  |   (15..0)    |
     // |   status    |    command   |
@@ -318,7 +318,7 @@
         if (device->capabilities != nullptr)
             status |= PCI_STATUS_NEW_CAPS;
         *value |= status << 16;
-        return MX_OK;
+        return ZX_OK;
     }
     //  -------------------------------------------------
     // |    (31..16)    |    (15..8)   |      (7..0)     |
@@ -326,14 +326,14 @@
     //  -------------------------------------------------
     case PCI_CONFIG_REVISION_ID:
         *value = device->class_code << 16 | device->revision_id;
-        return MX_OK;
+        return ZX_OK;
     //  ---------------------------------------------------------------
     // |   (31..24)  |   (23..16)    |    (15..8)    |      (7..0)     |
     // |     BIST    |  header_type  | latency_timer | cache_line_size |
     //  ---------------------------------------------------------------
     case PCI_CONFIG_CACHE_LINE_SIZE:
         *value = PCI_HEADER_TYPE_STANDARD << 16;
-        return MX_OK;
+        return ZX_OK;
     case PCI_REGISTER_BAR_0:
     case PCI_REGISTER_BAR_1:
     case PCI_REGISTER_BAR_2:
@@ -348,7 +348,7 @@
         const pci_bar_t* bar = &device->bar[bar_num];
         *value = bar->addr | bar->io_type;
         mtx_unlock((mtx_t*)&device->mutex);
-        return MX_OK;
+        return ZX_OK;
     }
     //  -------------------------------------------------------------
     // |   (31..24)  |  (23..16)   |    (15..8)     |    (7..0)      |
@@ -357,7 +357,7 @@
     case PCI_CONFIG_INTERRUPT_LINE: {
         const uint8_t interrupt_pin = 1;
         *value = interrupt_pin << 8;
-        return MX_OK;
+        return ZX_OK;
     }
     //  -------------------------------------------
     // |   (31..16)        |         (15..0)       |
@@ -366,7 +366,7 @@
     case PCI_CONFIG_SUBSYS_VENDOR_ID:
         *value = device->subsystem_vendor_id;
         *value |= device->subsystem_id << 16;
-        return MX_OK;
+        return ZX_OK;
     //  ------------------------------------------
     // |     (31..8)     |         (7..0)         |
     // |     Reserved    |  capabilities_pointer  |
@@ -375,10 +375,10 @@
         *value = 0;
         if (device->capabilities != nullptr)
             *value |= PCI_REGISTER_CAP_BASE;
-        return MX_OK;
+        return ZX_OK;
     case PCI_REGISTER_CAP_BASE... PCI_REGISTER_CAP_TOP:
-        if (pci_read_cap(device, reg, value) != MX_ERR_NOT_FOUND)
-            return MX_OK;
+        if (pci_read_cap(device, reg, value) != ZX_ERR_NOT_FOUND)
+            return ZX_OK;
         // Fall-through if the capability is not-implemented.
     // These are all 32-bit registers.
     case PCI_CONFIG_CARDBUS_CIS_PTR:
@@ -387,24 +387,24 @@
     }
 
     fprintf(stderr, "Unhandled PCI device read %#x\n", reg);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t pci_device_read(const pci_device_t* device, uint16_t reg, uint8_t len, uint32_t* value) {
+zx_status_t pci_device_read(const pci_device_t* device, uint16_t reg, uint8_t len, uint32_t* value) {
     // Perform 4-byte aligned read and then shift + mask the result to get the
     // expected value.
     uint32_t word = 0;
     const uint8_t reg_mask = bit_mask<uint8_t>(2);
     uint8_t word_aligend_reg = static_cast<uint8_t>(reg & ~reg_mask);
     uint8_t bit_offset = static_cast<uint8_t>((reg & reg_mask) * 8);
-    mx_status_t status = pci_device_read_word(device, word_aligend_reg, &word);
-    if (status != MX_OK)
+    zx_status_t status = pci_device_read_word(device, word_aligend_reg, &word);
+    if (status != ZX_OK)
         return status;
 
     word >>= bit_offset;
     word &= bit_mask<uint32_t>(len * 8);
     *value = word;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // PCI LOCAL BUS SPECIFICATION, REV. 3.0 Section 6.1
@@ -412,11 +412,11 @@
 // All PCI devices must treat Configuration Space write operations to reserved
 // registers as no-ops; that is, the access must be completed  normally on the
 // bus and the data discarded.
-static inline mx_status_t pci_device_write_unimplemented() {
-    return MX_OK;
+static inline zx_status_t pci_device_write_unimplemented() {
+    return ZX_OK;
 }
 
-mx_status_t pci_device_write(pci_device_t* device, uint16_t reg, uint8_t len, uint32_t value) {
+zx_status_t pci_device_write(pci_device_t* device, uint16_t reg, uint8_t len, uint32_t value) {
     switch (reg) {
     case PCI_CONFIG_VENDOR_ID:
     case PCI_CONFIG_DEVICE_ID:
@@ -426,14 +426,14 @@
     case PCI_CONFIG_CLASS_CODE_SUB:
     case PCI_CONFIG_CLASS_CODE_BASE:
         // Read-only registers.
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     case PCI_CONFIG_COMMAND:
         if (len != 2)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         mtx_lock(&device->mutex);
         device->command = static_cast<uint16_t>(value);
         mtx_unlock(&device->mutex);
-        return MX_OK;
+        return ZX_OK;
     case PCI_REGISTER_BAR_0:
     case PCI_REGISTER_BAR_1:
     case PCI_REGISTER_BAR_2:
@@ -441,7 +441,7 @@
     case PCI_REGISTER_BAR_4:
     case PCI_REGISTER_BAR_5: {
         if (len != 4)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
 
         uint32_t bar_num = (reg - PCI_REGISTER_BAR_0) / 4;
         if (bar_num >= PCI_MAX_BARS)
@@ -453,7 +453,7 @@
         // We zero bits in the BAR in order to set the size.
         bar->addr &= ~(bar->size - 1);
         mtx_unlock(&device->mutex);
-        return MX_OK;
+        return ZX_OK;
     }
     default:
         return pci_device_write_unimplemented();
@@ -520,15 +520,15 @@
     return static_cast<uint16_t>(bar->size);
 }
 
-static mx_status_t pci_handler(mx_port_packet_t* packet, void* ctx) {
+static zx_status_t pci_handler(zx_port_packet_t* packet, void* ctx) {
     pci_device_t* pci_device = static_cast<pci_device_t*>(ctx);
 
     // We provide the bar number as the trap key.
     if (packet->key > UINT8_MAX)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     uint8_t bar = static_cast<uint8_t>(packet->key);
 
-    mx_vcpu_io_t io;
+    zx_vcpu_io_t io;
     io.access_size = packet->guest_io.access_size;
     io.u32 = packet->guest_io.u32;
     uint32_t bar_base = pci_bar_base(&pci_device->bar[bar]);
@@ -536,7 +536,7 @@
     return pci_device->ops->write_bar(pci_device, bar, device_port, &io);
 }
 
-mx_status_t pci_device_async(pci_device_t* device, mx_handle_t guest) {
+zx_status_t pci_device_async(pci_device_t* device, zx_handle_t guest) {
     size_t num_traps = 0;
     trap_args_t traps[PCI_MAX_BARS];
     for (uint8_t i = 0; i < PCI_MAX_BARS; ++i) {
@@ -548,15 +548,15 @@
         trap->key = i;
         trap->addr = pci_bar_base(bar);
         trap->len = pci_bar_size(bar);
-        trap->kind = bar->io_type == PCI_BAR_IO_TYPE_PIO ? MX_GUEST_TRAP_IO : MX_GUEST_TRAP_MEM;
+        trap->kind = bar->io_type == PCI_BAR_IO_TYPE_PIO ? ZX_GUEST_TRAP_IO : ZX_GUEST_TRAP_MEM;
     }
     return device_async(guest, traps, num_traps, pci_handler, device);
 }
 
-mx_status_t pci_interrupt(pci_device_t* pci_device) {
+zx_status_t pci_interrupt(pci_device_t* pci_device) {
     pci_bus_t* bus = pci_device->bus;
     if (!bus)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     return io_apic_interrupt(bus->io_apic, pci_device->global_irq);
 }
diff --git a/system/ulib/hypervisor/rules.mk b/system/ulib/hypervisor/rules.mk
index 3173646..d722793 100644
--- a/system/ulib/hypervisor/rules.mk
+++ b/system/ulib/hypervisor/rules.mk
@@ -34,14 +34,14 @@
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
 
 MODULE_STATIC_LIBS := \
     system/ulib/ddk \
     system/ulib/virtio \
     third_party/ulib/acpica \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 include make/module.mk
diff --git a/system/ulib/hypervisor/uart.cpp b/system/ulib/hypervisor/uart.cpp
index 8aa94e0..97accb0 100644
--- a/system/ulib/hypervisor/uart.cpp
+++ b/system/ulib/hypervisor/uart.cpp
@@ -11,8 +11,8 @@
 #include <hypervisor/io_apic.h>
 #include <hypervisor/uart.h>
 #include <hypervisor/vcpu.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/hypervisor.h>
 #include <fbl/auto_lock.h>
 
 /* UART configuration masks. */
@@ -26,21 +26,21 @@
     uart->line_status = UART_LINE_STATUS_THR_EMPTY;
     uart->interrupt_id = UART_INTERRUPT_ID_NONE;
     uart->interrupt_enable = UART_INTERRUPT_ENABLE_NONE;
-    uart->raise_interrupt = mx_vcpu_interrupt;
+    uart->raise_interrupt = zx_vcpu_interrupt;
 }
 
-static mx_status_t try_raise_interrupt(uart_t* uart, uint8_t interrupt_id) {
+static zx_status_t try_raise_interrupt(uart_t* uart, uint8_t interrupt_id) {
     uint8_t vector = 0;
-    mx_handle_t vcpu;
-    mx_status_t status = io_apic_redirect(uart->io_apic, X86_INT_UART, &vector, &vcpu);
-    if (status != MX_OK)
+    zx_handle_t vcpu;
+    zx_status_t status = io_apic_redirect(uart->io_apic, X86_INT_UART, &vector, &vcpu);
+    if (status != ZX_OK)
         return status;
 
     // UART IRQs overlap with CPU exception handlers, so they need to be
     // remapped. If that hasn't happened yet, don't fire the interrupt - it
     // would be bad.
     if (vector == 0)
-        return MX_OK;
+        return ZX_OK;
 
     uart->interrupt_id = interrupt_id;
     return uart->raise_interrupt(vcpu, vector);
@@ -51,27 +51,27 @@
 // the caller is ready. Others just always call try_raise_interrupt and hope.
 static bool can_raise_interrupt(uart_t* uart) {
     uint8_t vector = 0;
-    mx_handle_t vcpu;
-    mx_status_t status = io_apic_redirect(uart->io_apic, X86_INT_UART, &vector, &vcpu);
-    return status == MX_OK && vector != 0;
+    zx_handle_t vcpu;
+    zx_status_t status = io_apic_redirect(uart->io_apic, X86_INT_UART, &vector, &vcpu);
+    return status == ZX_OK && vector != 0;
 }
 
 // Determines whether an interrupt needs to be raised and does so if necessary.
 // Will not raise an interrupt if the interrupt_enable bit is not set.
-static mx_status_t raise_next_interrupt(uart_t* uart) {
+static zx_status_t raise_next_interrupt(uart_t* uart) {
     if (uart->interrupt_id != UART_INTERRUPT_ID_NONE)
         // Don't wipe out a pending interrupt, just wait.
-        return MX_OK;
+        return ZX_OK;
     if (uart->interrupt_enable & UART_INTERRUPT_ENABLE_RDA &&
         uart->line_status & UART_LINE_STATUS_DATA_READY)
         return try_raise_interrupt(uart, UART_INTERRUPT_ID_RDA);
     if (uart->interrupt_enable & UART_INTERRUPT_ENABLE_THR_EMPTY &&
         uart->line_status & UART_LINE_STATUS_THR_EMPTY)
         return try_raise_interrupt(uart, UART_INTERRUPT_ID_THR_EMPTY);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t uart_read(uart_t* uart, uint16_t port, mx_vcpu_io_t* vcpu_io) {
+zx_status_t uart_read(uart_t* uart, uint16_t port, zx_vcpu_io_t* vcpu_io) {
     switch (port) {
     case UART_MODEM_CONTROL_PORT:
     case UART_MODEM_STATUS_PORT:
@@ -122,19 +122,19 @@
         break;
     }
     default:
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t uart_write(uart_t* uart, const mx_packet_guest_io_t* io) {
+zx_status_t uart_write(uart_t* uart, const zx_packet_guest_io_t* io) {
     switch (io->port) {
     case UART_TRANSMIT_PORT: {
         fbl::AutoLock lock(&uart->mutex);
         if (uart->line_control & UART_LINE_CONTROL_DIV_LATCH)
             // Ignore writes when divisor latch is enabled.
-            return (io->access_size != 1) ? MX_ERR_IO_DATA_INTEGRITY : MX_OK;
+            return (io->access_size != 1) ? ZX_ERR_IO_DATA_INTEGRITY : ZX_OK;
 
         for (int i = 0; i < io->access_size; i++) {
             uart->tx_buffer[uart->tx_offset++] = io->data[i];
@@ -151,31 +151,31 @@
     }
     case UART_INTERRUPT_ENABLE_PORT: {
         if (io->access_size != 1)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         fbl::AutoLock lock(&uart->mutex);
         // Ignore writes when divisor latch is enabled.
         if (uart->line_control & UART_LINE_CONTROL_DIV_LATCH)
-            return MX_OK;
+            return ZX_OK;
 
         uart->interrupt_enable = io->u8;
         return raise_next_interrupt(uart);
     }
     case UART_LINE_CONTROL_PORT: {
         if (io->access_size != 1)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         fbl::AutoLock lock(&uart->mutex);
         uart->line_control = io->u8;
-        return MX_OK;
+        return ZX_OK;
     }
     case UART_INTERRUPT_ID_PORT:
     case UART_MODEM_CONTROL_PORT ... UART_SCR_SCRATCH_PORT:
-        return MX_OK;
+        return ZX_OK;
     default:
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 }
 
-static mx_status_t uart_handler(mx_port_packet_t* packet, void* ctx) {
+static zx_status_t uart_handler(zx_port_packet_t* packet, void* ctx) {
     uart_t* uart = static_cast<uart_t*>(ctx);
     return uart_write(uart, &packet->guest_io);
 }
@@ -200,13 +200,13 @@
             break;
         }
     }
-    return MX_ERR_INTERNAL;
+    return ZX_ERR_INTERNAL;
 }
 
 static int uart_fill_rx(void* arg) {
     uart_t* uart = reinterpret_cast<uart_t*>(arg);
 
-    mx_status_t status;
+    zx_status_t status;
     do {
         mtx_lock(&uart->mutex);
         // Wait for a signal that the line is clear.
@@ -222,7 +222,7 @@
             pending_char = 0x7f;
 
         if (pending_char == EOF)
-            status = MX_ERR_PEER_CLOSED;
+            status = ZX_ERR_PEER_CLOSED;
         else {
             mtx_lock(&uart->mutex);
             uart->rx_buffer = static_cast<uint8_t>(pending_char);
@@ -230,38 +230,38 @@
             status = raise_next_interrupt(uart);
             mtx_unlock(&uart->mutex);
         }
-    } while (status == MX_OK);
+    } while (status == ZX_OK);
     fprintf(stderr, "Stopped processing UART input (%d)\n", status);
     return status;
 }
 
-mx_status_t uart_async(uart_t* uart, mx_handle_t guest) {
+zx_status_t uart_async(uart_t* uart, zx_handle_t guest) {
     thrd_t uart_input_thread;
     int ret = thrd_create(&uart_input_thread, uart_fill_rx, uart);
     if (ret != thrd_success) {
         fprintf(stderr, "Failed to create UART input thread %d\n", ret);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     ret = thrd_detach(uart_input_thread);
     if (ret != thrd_success) {
         fprintf(stderr, "Failed to detach UART input thread %d\n", ret);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     thrd_t uart_output_thread;
     ret = thrd_create(&uart_output_thread, uart_empty_tx, uart);
     if (ret != thrd_success) {
         fprintf(stderr, "Failed to create UART output thread %d\n", ret);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
     ret = thrd_detach(uart_output_thread);
     if (ret != thrd_success) {
         fprintf(stderr, "Failed to detach UART output thread %d\n", ret);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     const trap_args_t trap = {
-        .kind = MX_GUEST_TRAP_IO,
+        .kind = ZX_GUEST_TRAP_IO,
         .addr = UART_RECEIVE_PORT,
         .len = 1,
         .key = 0,
diff --git a/system/ulib/hypervisor/vcpu.cpp b/system/ulib/hypervisor/vcpu.cpp
index 1e8453a..5dbc9b1 100644
--- a/system/ulib/hypervisor/vcpu.cpp
+++ b/system/ulib/hypervisor/vcpu.cpp
@@ -15,8 +15,8 @@
 #include <hypervisor/pci.h>
 #include <hypervisor/uart.h>
 #include <hypervisor/vcpu.h>
-#include <magenta/assert.h>
-#include <magenta/syscalls.h>
+#include <zircon/assert.h>
+#include <zircon/syscalls.h>
 #include <fbl/unique_ptr.h>
 
 #include "acpi_priv.h"
@@ -51,10 +51,10 @@
 
 // clang-format on
 
-static mx_status_t handle_local_apic(local_apic_t* local_apic, const mx_packet_guest_mem_t* mem,
+static zx_status_t handle_local_apic(local_apic_t* local_apic, const zx_packet_guest_mem_t* mem,
                                      instruction_t* inst) {
-    MX_ASSERT(mem->addr >= LOCAL_APIC_PHYS_BASE);
-    mx_vaddr_t offset = mem->addr - LOCAL_APIC_PHYS_BASE;
+    ZX_ASSERT(mem->addr >= LOCAL_APIC_PHYS_BASE);
+    zx_vaddr_t offset = mem->addr - LOCAL_APIC_PHYS_BASE;
     // From Intel Volume 3, Section 10.4.1.: All 32-bit registers should be
     // accessed using 128-bit aligned 32-bit loads or stores. Some processors
     // may support loads and stores of less than 32 bits to some of the APIC
@@ -77,7 +77,7 @@
         //
         // Therefore, we ignore writes to the ESR.
         if (inst->type == INST_MOV_WRITE)
-            return MX_OK;
+            return ZX_OK;
     case LOCAL_APIC_REGISTER_ISR_31_0 ... LOCAL_APIC_REGISTER_ISR_255_224:
     case LOCAL_APIC_REGISTER_TMR_31_0 ... LOCAL_APIC_REGISTER_TMR_255_224:
     case LOCAL_APIC_REGISTER_IRR_31_0 ... LOCAL_APIC_REGISTER_IRR_255_224:
@@ -86,7 +86,7 @@
         // The IO APIC implementation currently assumes these won't change.
         if (inst->type == INST_MOV_WRITE && inst_val32(inst) != local_apic->regs->id.u32) {
             fprintf(stderr, "Changing APIC IDs is not supported.\n");
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
         uintptr_t addr = reinterpret_cast<uintptr_t>(local_apic->apic_addr) + offset;
         return inst_rw32(inst, reinterpret_cast<uint32_t*>(addr));
@@ -106,46 +106,46 @@
     }
     case LOCAL_APIC_REGISTER_INITIAL_COUNT: {
         uint32_t initial_count;
-        mx_status_t status = inst_write32(inst, &initial_count);
-        if (status != MX_OK)
+        zx_status_t status = inst_write32(inst, &initial_count);
+        if (status != ZX_OK)
             return status;
-        return initial_count > 0 ? MX_ERR_NOT_SUPPORTED : MX_OK;
+        return initial_count > 0 ? ZX_ERR_NOT_SUPPORTED : ZX_OK;
     }
     }
 
     fprintf(stderr, "Unhandled local APIC address %#lx\n", offset);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t unhandled_mem(const mx_packet_guest_mem_t* mem, const instruction_t* inst) {
+static zx_status_t unhandled_mem(const zx_packet_guest_mem_t* mem, const instruction_t* inst) {
     fprintf(stderr, "Unhandled address %#lx\n", mem->addr);
     if (inst->type == INST_MOV_READ)
         *inst->reg = UINT64_MAX;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t handle_mmio_read(vcpu_ctx_t* vcpu_ctx, mx_vaddr_t addr, uint8_t access_size,
-                                    mx_vcpu_io_t* io) {
+static zx_status_t handle_mmio_read(vcpu_ctx_t* vcpu_ctx, zx_vaddr_t addr, uint8_t access_size,
+                                    zx_vcpu_io_t* io) {
     switch (addr) {
     case PCI_ECAM_PHYS_BASE ... PCI_ECAM_PHYS_TOP:
         return pci_ecam_read(vcpu_ctx->guest_ctx->bus, addr, access_size, io);
     default:
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 }
 
-static mx_status_t handle_mmio_write(vcpu_ctx_t* vcpu_ctx, mx_vaddr_t addr, mx_vcpu_io_t* io) {
+static zx_status_t handle_mmio_write(vcpu_ctx_t* vcpu_ctx, zx_vaddr_t addr, zx_vcpu_io_t* io) {
     switch (addr) {
     case PCI_ECAM_PHYS_BASE ... PCI_ECAM_PHYS_TOP:
         return pci_ecam_write(vcpu_ctx->guest_ctx->bus, addr, io);
     default:
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 }
 
-static mx_status_t handle_mmio(vcpu_ctx_t* vcpu_ctx, const mx_packet_guest_mem_t* mem, const instruction_t* inst) {
-    mx_status_t status;
-    mx_vcpu_io_t mmio;
+static zx_status_t handle_mmio(vcpu_ctx_t* vcpu_ctx, const zx_packet_guest_mem_t* mem, const instruction_t* inst) {
+    zx_status_t status;
+    zx_vcpu_io_t mmio;
     if (inst->type == INST_MOV_WRITE) {
         switch (inst->mem) {
         case 2:
@@ -155,9 +155,9 @@
             status = inst_write32(inst, &mmio.u32);
             break;
         default:
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         mmio.access_size = inst->mem;
         return handle_mmio_write(vcpu_ctx, mem->addr, &mmio);
@@ -165,7 +165,7 @@
 
     if (inst->type == INST_MOV_READ) {
         status = handle_mmio_read(vcpu_ctx, mem->addr, inst->mem, &mmio);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         switch (inst->mem) {
         case 1:
@@ -175,42 +175,42 @@
         case 4:
             return inst_read32(inst, mmio.u32);
         default:
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
     }
 
     if (inst->type == INST_TEST) {
         status = handle_mmio_read(vcpu_ctx, mem->addr, inst->mem, &mmio);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         switch (inst->mem) {
         case 1:
             return inst_test8(inst, static_cast<uint8_t>(inst->imm), mmio.u8);
         default:
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
     }
 
-    return MX_ERR_INVALID_ARGS;
+    return ZX_ERR_INVALID_ARGS;
 }
 
-static mx_status_t handle_mem(vcpu_ctx_t* vcpu_ctx, const mx_packet_guest_mem_t* mem) {
-    mx_vcpu_state_t vcpu_state;
-    mx_status_t status = vcpu_ctx->read_state(vcpu_ctx, MX_VCPU_STATE, &vcpu_state,
+static zx_status_t handle_mem(vcpu_ctx_t* vcpu_ctx, const zx_packet_guest_mem_t* mem) {
+    zx_vcpu_state_t vcpu_state;
+    zx_status_t status = vcpu_ctx->read_state(vcpu_ctx, ZX_VCPU_STATE, &vcpu_state,
                                               sizeof(vcpu_state));
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     instruction_t inst;
 #if __aarch64__
-    status = MX_ERR_NOT_SUPPORTED;
+    status = ZX_ERR_NOT_SUPPORTED;
 #elif __x86_64__
     status = inst_decode(mem->inst_buf, mem->inst_len, &vcpu_state, &inst);
 #else
 #error Unsupported architecture
 #endif
 
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "Unsupported instruction:");
 #if __x86_64__
         for (uint8_t i = 0; i < mem->inst_len; i++)
@@ -228,27 +228,27 @@
             break;
         default: {
             status = handle_mmio(vcpu_ctx, mem, &inst);
-            if (status == MX_ERR_NOT_FOUND)
+            if (status == ZX_ERR_NOT_FOUND)
                 status = unhandled_mem(mem, &inst);
             break;
         }
     }
     }
 
-    if (status != MX_OK) {
-        return mx_vcpu_interrupt(vcpu_ctx->vcpu, X86_INT_GP_FAULT);
+    if (status != ZX_OK) {
+        return zx_vcpu_interrupt(vcpu_ctx->vcpu, X86_INT_GP_FAULT);
     } else if (inst.type == INST_MOV_READ || inst.type == INST_TEST) {
         // If there was an attempt to read or test memory, update the GPRs.
-        return vcpu_ctx->write_state(vcpu_ctx, MX_VCPU_STATE, &vcpu_state,
+        return vcpu_ctx->write_state(vcpu_ctx, ZX_VCPU_STATE, &vcpu_state,
                                      sizeof(vcpu_state));
     }
     return status;
 }
 
-static mx_status_t handle_input(vcpu_ctx_t* vcpu_ctx, const mx_packet_guest_io_t* io) {
+static zx_status_t handle_input(vcpu_ctx_t* vcpu_ctx, const zx_packet_guest_io_t* io) {
 #if __x86_64__
-    mx_status_t status = MX_OK;
-    mx_vcpu_io_t vcpu_io;
+    zx_status_t status = ZX_OK;
+    zx_vcpu_io_t vcpu_io;
     memset(&vcpu_io, 0, sizeof(vcpu_io));
     switch (io->port) {
     case I8042_COMMAND_PORT:
@@ -277,25 +277,25 @@
                                                &vcpu_io);
             break;
         }
-        status = MX_ERR_NOT_SUPPORTED;
+        status = ZX_ERR_NOT_SUPPORTED;
     }
     }
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "Unhandled port in %#x: %d\n", io->port, status);
         return status;
     }
     if (vcpu_io.access_size != io->access_size) {
         fprintf(stderr, "Unexpected size (%u != %u) for port in %#x\n", vcpu_io.access_size,
                 io->access_size, io->port);
-        return MX_ERR_IO_DATA_INTEGRITY;
+        return ZX_ERR_IO_DATA_INTEGRITY;
     }
-    return vcpu_ctx->write_state(vcpu_ctx, MX_VCPU_IO, &vcpu_io, sizeof(vcpu_io));
+    return vcpu_ctx->write_state(vcpu_ctx, ZX_VCPU_IO, &vcpu_io, sizeof(vcpu_io));
 #else // __x86_64__
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif // __x86_64__
 }
 
-static mx_status_t handle_output(vcpu_ctx_t* vcpu_ctx, const mx_packet_guest_io_t* io) {
+static zx_status_t handle_output(vcpu_ctx_t* vcpu_ctx, const zx_packet_guest_io_t* io) {
 #if __x86_64__
     switch (io->port) {
     case I8042_COMMAND_PORT:
@@ -315,24 +315,24 @@
         return uart_write(vcpu_ctx->guest_ctx->uart, io);
     }
     fprintf(stderr, "Unhandled port out %#x\n", io->port);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #else // __x86_64__
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 #endif // __x86_64__
 }
 
-static mx_status_t handle_io(vcpu_ctx_t* vcpu_ctx, const mx_packet_guest_io_t* io) {
+static zx_status_t handle_io(vcpu_ctx_t* vcpu_ctx, const zx_packet_guest_io_t* io) {
     return io->input ? handle_input(vcpu_ctx, io) : handle_output(vcpu_ctx, io);
 }
 
-static mx_status_t vcpu_state_read(vcpu_ctx_t* vcpu_ctx, uint32_t kind, void* buffer,
+static zx_status_t vcpu_state_read(vcpu_ctx_t* vcpu_ctx, uint32_t kind, void* buffer,
                                    uint32_t len) {
-    return mx_vcpu_read_state(vcpu_ctx->vcpu, kind, buffer, len);
+    return zx_vcpu_read_state(vcpu_ctx->vcpu, kind, buffer, len);
 }
 
-static mx_status_t vcpu_state_write(vcpu_ctx_t* vcpu_ctx, uint32_t kind, const void* buffer,
+static zx_status_t vcpu_state_write(vcpu_ctx_t* vcpu_ctx, uint32_t kind, const void* buffer,
                                     uint32_t len) {
-    return mx_vcpu_write_state(vcpu_ctx->vcpu, kind, buffer, len);
+    return zx_vcpu_write_state(vcpu_ctx->vcpu, kind, buffer, len);
 }
 
 void vcpu_init(vcpu_ctx_t* vcpu_ctx) {
@@ -341,36 +341,36 @@
     vcpu_ctx->write_state = vcpu_state_write;
 }
 
-mx_status_t vcpu_loop(vcpu_ctx_t* vcpu_ctx) {
+zx_status_t vcpu_loop(vcpu_ctx_t* vcpu_ctx) {
     while (true) {
-        mx_port_packet_t packet;
-        mx_status_t status = mx_vcpu_resume(vcpu_ctx->vcpu, &packet);
-        if (status != MX_OK) {
+        zx_port_packet_t packet;
+        zx_status_t status = zx_vcpu_resume(vcpu_ctx->vcpu, &packet);
+        if (status != ZX_OK) {
             fprintf(stderr, "Failed to resume VCPU %d\n", status);
             return status;
         }
         status = vcpu_packet_handler(vcpu_ctx, &packet);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             fprintf(stderr, "Failed to handle guest packet %d: %d\n", packet.type, status);
             return status;
         }
     }
 }
 
-mx_status_t vcpu_packet_handler(vcpu_ctx_t* vcpu_ctx, mx_port_packet_t* packet) {
+zx_status_t vcpu_packet_handler(vcpu_ctx_t* vcpu_ctx, zx_port_packet_t* packet) {
     switch (packet->type) {
-    case MX_PKT_TYPE_GUEST_MEM:
+    case ZX_PKT_TYPE_GUEST_MEM:
         return handle_mem(vcpu_ctx, &packet->guest_mem);
-    case MX_PKT_TYPE_GUEST_IO:
+    case ZX_PKT_TYPE_GUEST_IO:
         return handle_io(vcpu_ctx, &packet->guest_io);
     default:
         fprintf(stderr, "Unhandled guest packet %d\n", packet->type);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
 }
 
 typedef struct device {
-    mx_handle_t port;
+    zx_handle_t port;
     device_handler_fn_t handler;
     void* ctx;
 } device_t;
@@ -379,34 +379,34 @@
     fbl::unique_ptr<device_t> device(static_cast<device_t*>(ctx));
 
     while (true) {
-        mx_port_packet_t packet;
-        mx_status_t status = mx_port_wait(device->port, MX_TIME_INFINITE, &packet, 0);
-        if (status != MX_OK) {
+        zx_port_packet_t packet;
+        zx_status_t status = zx_port_wait(device->port, ZX_TIME_INFINITE, &packet, 0);
+        if (status != ZX_OK) {
             fprintf(stderr, "Failed to wait for device port %d\n", status);
             break;
         }
 
         status = device->handler(&packet, device->ctx);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             fprintf(stderr, "Unable to handle packet for device %d\n", status);
             break;
         }
     }
 
-    mx_handle_close(device->port);
-    return MX_ERR_INTERNAL;
+    zx_handle_close(device->port);
+    return ZX_ERR_INTERNAL;
 }
 
-mx_status_t device_async(mx_handle_t guest, const trap_args_t* traps, size_t num_traps,
+zx_status_t device_async(zx_handle_t guest, const trap_args_t* traps, size_t num_traps,
                          device_handler_fn_t handler, void* ctx) {
     if (num_traps == 0)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     int ret;
-    auto device = new device_t{MX_HANDLE_INVALID, handler, ctx};
+    auto device = new device_t{ZX_HANDLE_INVALID, handler, ctx};
 
-    mx_status_t status = mx_port_create(0, &device->port);
-    if (status != MX_OK) {
+    zx_status_t status = zx_port_create(0, &device->port);
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to create device port %d\n", status);
         goto mem_cleanup;
     }
@@ -414,9 +414,9 @@
     for (size_t i = 0; i < num_traps; ++i) {
         const trap_args_t* trap = &traps[i];
 
-        status = mx_guest_set_trap(guest, trap->kind, trap->addr, trap->len, device->port,
+        status = zx_guest_set_trap(guest, trap->kind, trap->addr, trap->len, device->port,
                                    trap->key);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             fprintf(stderr, "Failed to set trap for device port %d\n", status);
             goto cleanup;
         }
@@ -432,13 +432,13 @@
     ret = thrd_detach(thread);
     if (ret != thrd_success) {
         fprintf(stderr, "Failed to detach device thread %d\n", ret);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
-    return MX_OK;
+    return ZX_OK;
 cleanup:
-    mx_handle_close(device->port);
+    zx_handle_close(device->port);
 mem_cleanup:
     delete device;
-    return MX_ERR_INTERNAL;
+    return ZX_ERR_INTERNAL;
 }
diff --git a/system/ulib/hypervisor/virtio.cpp b/system/ulib/hypervisor/virtio.cpp
index 5f9e524..df53211 100644
--- a/system/ulib/hypervisor/virtio.cpp
+++ b/system/ulib/hypervisor/virtio.cpp
@@ -11,14 +11,14 @@
 #include <fbl/unique_ptr.h>
 #include <hypervisor/vcpu.h>
 #include <hypervisor/virtio.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls/port.h>
 
 #include <virtio/virtio.h>
 #include <virtio/virtio_ring.h>
 
 // Convert guest-physical addresses to usable virtual addresses.
 #define guest_paddr_to_host_vaddr(device, addr) \
-    (static_cast<mx_vaddr_t>(((device)->guest_physmem_addr) + (addr)))
+    (static_cast<zx_vaddr_t>(((device)->guest_physmem_addr) + (addr)))
 
 // Returns a circular index into a Virtio ring.
 static uint32_t ring_index(virtio_queue_t* queue, uint32_t index) {
@@ -31,11 +31,11 @@
     return queue->avail->idx - queue->index;
 }
 
-static bool validate_queue_range(virtio_device_t* device, mx_vaddr_t addr, size_t size) {
+static bool validate_queue_range(virtio_device_t* device, zx_vaddr_t addr, size_t size) {
     uintptr_t mem_addr = device->guest_physmem_addr;
     size_t mem_size = device->guest_physmem_size;
-    mx_vaddr_t range_end = addr + size;
-    mx_vaddr_t mem_end = mem_addr + mem_size;
+    zx_vaddr_t range_end = addr + size;
+    zx_vaddr_t mem_end = mem_addr + mem_size;
 
     return addr >= mem_addr && range_end <= mem_end;
 }
@@ -44,7 +44,7 @@
 static void queue_set_segment_addr(virtio_queue_t* queue, uint64_t guest_paddr, size_t size,
                                    T** ptr) {
     virtio_device_t* device = queue->virtio_device;
-    mx_vaddr_t host_vaddr = guest_paddr_to_host_vaddr(device, guest_paddr);
+    zx_vaddr_t host_vaddr = guest_paddr_to_host_vaddr(device, guest_paddr);
 
     *ptr = validate_queue_range(device, host_vaddr, size)
                ? reinterpret_cast<T*>(host_vaddr)
@@ -84,18 +84,18 @@
     mtx_unlock(&queue->mutex);
 }
 
-mx_status_t virtio_device_notify(virtio_device_t* device) {
+zx_status_t virtio_device_notify(virtio_device_t* device) {
     return pci_interrupt(&device->pci_device);
 }
 
-mx_status_t virtio_device_kick(virtio_device_t* device, uint16_t queue_sel) {
+zx_status_t virtio_device_kick(virtio_device_t* device, uint16_t queue_sel) {
     if (queue_sel >= device->num_queues)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     // Invoke the device callback if one has been provided.
     if (device->ops->queue_notify != NULL) {
-        mx_status_t status = device->ops->queue_notify(device, queue_sel);
-        if (status != MX_OK) {
+        zx_status_t status = device->ops->queue_notify(device, queue_sel);
+        if (status != ZX_OK) {
             fprintf(stderr, "Failed to handle queue notify event.\n");
             return status;
         }
@@ -110,29 +110,29 @@
 
     // Notify threads waiting on a descriptor.
     virtio_queue_signal(&device->queues[queue_sel]);
-    return MX_OK;
+    return ZX_OK;
 }
 
 
-// This must not return any errors besides MX_ERR_NOT_FOUND.
-static mx_status_t virtio_queue_next_avail_locked(virtio_queue_t* queue, uint16_t* index) {
+// This must not return any errors besides ZX_ERR_NOT_FOUND.
+static zx_status_t virtio_queue_next_avail_locked(virtio_queue_t* queue, uint16_t* index) {
     if (ring_avail_count(queue) < 1)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     *index = queue->avail->ring[ring_index(queue, queue->index++)];
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t virtio_queue_next_avail(virtio_queue_t* queue, uint16_t* index) {
+zx_status_t virtio_queue_next_avail(virtio_queue_t* queue, uint16_t* index) {
     mtx_lock(&queue->mutex);
-    mx_status_t status = virtio_queue_next_avail_locked(queue, index);
+    zx_status_t status = virtio_queue_next_avail_locked(queue, index);
     mtx_unlock(&queue->mutex);
     return status;
 }
 
 void virtio_queue_wait(virtio_queue_t* queue, uint16_t* index) {
     mtx_lock(&queue->mutex);
-    while (virtio_queue_next_avail_locked(queue, index) == MX_ERR_NOT_FOUND)
+    while (virtio_queue_next_avail_locked(queue, index) == ZX_ERR_NOT_FOUND)
         cnd_wait(&queue->avail_ring_cnd, &queue->mutex);
     mtx_unlock(&queue->mutex);
 }
@@ -144,33 +144,33 @@
 } poll_task_args_t;
 
 static int virtio_queue_poll_task(void* ctx) {
-    mx_status_t result = MX_OK;
+    zx_status_t result = ZX_OK;
     fbl::unique_ptr<poll_task_args_t> args(static_cast<poll_task_args_t*>(ctx));
     while (true) {
         uint16_t descriptor;
         virtio_queue_wait(args->queue, &descriptor);
 
         uint32_t used = 0;
-        mx_status_t status = args->handler(args->queue, descriptor, &used, args->ctx);
+        zx_status_t status = args->handler(args->queue, descriptor, &used, args->ctx);
         virtio_queue_return(args->queue, descriptor, used);
 
-        if (status == MX_ERR_STOP)
+        if (status == ZX_ERR_STOP)
             break;
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             fprintf(stderr, "Error %d while handling queue buffer.\n", status);
             result = status;
             break;
         }
 
         result = virtio_device_notify(args->queue->virtio_device);
-        if (result != MX_OK)
+        if (result != ZX_OK)
             break;
     }
 
     return result;
 }
 
-mx_status_t virtio_queue_poll(virtio_queue_t* queue, virtio_queue_poll_fn_t handler, void* ctx) {
+zx_status_t virtio_queue_poll(virtio_queue_t* queue, virtio_queue_poll_fn_t handler, void* ctx) {
     poll_task_args_t* args = new poll_task_args_t{queue, handler, ctx};
 
     thrd_t thread;
@@ -178,19 +178,19 @@
     if (ret != thrd_success) {
         fprintf(stderr, "Failed to create queue thread %d\n", ret);
         delete args;
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
     ret = thrd_detach(thread);
     if (ret != thrd_success) {
         fprintf(stderr, "Failed to detach queue thread %d\n", ret);
-        return MX_ERR_INTERNAL;
+        return ZX_ERR_INTERNAL;
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t virtio_queue_read_desc(virtio_queue_t* queue, uint16_t desc_index,
+zx_status_t virtio_queue_read_desc(virtio_queue_t* queue, uint16_t desc_index,
                                    virtio_desc_t* out) {
     virtio_device_t* device = queue->virtio_device;
     volatile struct vring_desc& desc = queue->desc[desc_index];
@@ -198,14 +198,14 @@
 
     const uint64_t end = desc.addr + desc.len;
     if (end < desc.addr || end > mem_size)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     out->addr = reinterpret_cast<void*>(guest_paddr_to_host_vaddr(device, desc.addr));
     out->len = desc.len;
     out->has_next = desc.flags & VRING_DESC_F_NEXT;
     out->writable = desc.flags & VRING_DESC_F_WRITE;
     out->next = desc.next;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void virtio_queue_return(virtio_queue_t* queue, uint16_t index, uint32_t len) {
@@ -228,7 +228,7 @@
     mtx_unlock(&device->mutex);
 }
 
-mx_status_t virtio_queue_handler(virtio_queue_t* queue, virtio_queue_fn_t handler, void* context) {
+zx_status_t virtio_queue_handler(virtio_queue_t* queue, virtio_queue_fn_t handler, void* context) {
     uint16_t head;
     uint32_t used_len = 0;
     uintptr_t mem_addr = queue->virtio_device->guest_physmem_addr;
@@ -236,13 +236,13 @@
 
     // Get the next descriptor from the available ring. If none are available
     // we can just no-op.
-    mx_status_t status = virtio_queue_next_avail(queue, &head);
-    if (status == MX_ERR_NOT_FOUND)
-        return MX_OK;
-    if (status != MX_OK)
+    zx_status_t status = virtio_queue_next_avail(queue, &head);
+    if (status == ZX_ERR_NOT_FOUND)
+        return ZX_OK;
+    if (status != ZX_OK)
         return status;
 
-    status = MX_OK;
+    status = ZX_OK;
     uint16_t desc_index = head;
     volatile const struct vring_desc* desc;
     do {
@@ -250,11 +250,11 @@
 
         const uint64_t end = desc->addr + desc->len;
         if (end < desc->addr || end > mem_size)
-            return MX_ERR_OUT_OF_RANGE;
+            return ZX_ERR_OUT_OF_RANGE;
 
         void* addr = reinterpret_cast<void*>(mem_addr + desc->addr);
         status = handler(addr, desc->len, desc->flags, &used_len, context);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             fprintf(stderr, "Virtio request (%#lx, %u) failed %d\n", desc->addr, desc->len, status);
             return status;
         }
@@ -264,50 +264,50 @@
 
     virtio_queue_return(queue, head, used_len);
 
-    return ring_avail_count(queue) > 0 ? MX_ERR_NEXT : MX_OK;
+    return ring_avail_count(queue) > 0 ? ZX_ERR_NEXT : ZX_OK;
 }
 
-mx_status_t virtio_device_config_read(const virtio_device_t* device, void* config, uint16_t port,
-                                      uint8_t access_size, mx_vcpu_io_t* vcpu_io) {
+zx_status_t virtio_device_config_read(const virtio_device_t* device, void* config, uint16_t port,
+                                      uint8_t access_size, zx_vcpu_io_t* vcpu_io) {
     vcpu_io->access_size = access_size;
     switch (access_size) {
     case 1: {
         uint8_t* buf = reinterpret_cast<uint8_t*>(config);
         vcpu_io->u8 = buf[port];
-        return MX_OK;
+        return ZX_OK;
     }
     case 2: {
         uint16_t* buf = reinterpret_cast<uint16_t*>(config);
         vcpu_io->u16 = buf[port/2];
-        return MX_OK;
+        return ZX_OK;
     }
     case 4: {
         uint32_t* buf = reinterpret_cast<uint32_t*>(config);
         vcpu_io->u32 = buf[port/4];
-        return MX_OK;
+        return ZX_OK;
     }
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t virtio_device_config_write(const virtio_device_t* device, void* config, uint16_t port,
-                                       const mx_vcpu_io_t* io) {
+zx_status_t virtio_device_config_write(const virtio_device_t* device, void* config, uint16_t port,
+                                       const zx_vcpu_io_t* io) {
     switch (io->access_size) {
     case 1: {
         uint8_t* buf = reinterpret_cast<uint8_t*>(config);
         buf[port] = io->u8;
-        return MX_OK;
+        return ZX_OK;
     }
     case 2: {
         uint16_t* buf = reinterpret_cast<uint16_t*>(config);
         buf[port/2] = io->u16;
-        return MX_OK;
+        return ZX_OK;
     }
     case 4: {
         uint32_t* buf = reinterpret_cast<uint32_t*>(config);
         buf[port/4] = io->u32;
-        return MX_OK;
+        return ZX_OK;
     }
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
diff --git a/system/ulib/hypervisor/virtio_pci.cpp b/system/ulib/hypervisor/virtio_pci.cpp
index 58d42c4..5fd00c0 100644
--- a/system/ulib/hypervisor/virtio_pci.cpp
+++ b/system/ulib/hypervisor/virtio_pci.cpp
@@ -12,7 +12,7 @@
 #include <hypervisor/bits.h>
 #include <hypervisor/vcpu.h>
 #include <hypervisor/virtio.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls/port.h>
 #include <virtio/virtio.h>
 #include <virtio/virtio_ring.h>
 
@@ -107,28 +107,28 @@
 /* Handle reads to the common configuration structure as defined in
  * Virtio 1.0 Section 4.1.4.3.
  */
-static mx_status_t virtio_pci_common_cfg_read(const pci_device_t* pci_device, uint16_t port,
-                                              uint8_t access_size, mx_vcpu_io_t* vcpu_io) {
+static zx_status_t virtio_pci_common_cfg_read(const pci_device_t* pci_device, uint16_t port,
+                                              uint8_t access_size, zx_vcpu_io_t* vcpu_io) {
     virtio_device_t* device = pci_device_to_virtio(pci_device);
     switch (port) {
     case VIRTIO_PCI_COMMON_CFG_DRIVER_FEATURES_SEL: {
         fbl::AutoLock lock(&device->mutex);
         vcpu_io->u32 = device->driver_features_sel;
         vcpu_io->access_size = 4;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_DEVICE_FEATURES_SEL: {
         fbl::AutoLock lock(&device->mutex);
         vcpu_io->u32 = device->features_sel;
         vcpu_io->access_size = 4;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_DRIVER_FEATURES: {
         // We currently only support a single feature word.
         fbl::AutoLock lock(&device->mutex);
         vcpu_io->u32 = device->driver_features_sel > 0 ? 0 : device->driver_features;
         vcpu_io->access_size = 4;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_DEVICE_FEATURES: {
         // Virtio 1.0 Section 6:
@@ -145,39 +145,39 @@
         vcpu_io->access_size = 4;
         if (device->features_sel == 1) {
             vcpu_io->u32 = 1;
-            return MX_OK;
+            return ZX_OK;
         }
 
         vcpu_io->u32 = device->features_sel > 0 ? 0 : device->features;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_NUM_QUEUES: {
         fbl::AutoLock lock(&device->mutex);
         vcpu_io->u16 = device->num_queues;
         vcpu_io->access_size = 2;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_DEVICE_STATUS: {
         fbl::AutoLock lock(&device->mutex);
         vcpu_io->u8 = device->status;
         vcpu_io->access_size = 1;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_QUEUE_SEL: {
         fbl::AutoLock lock(&device->mutex);
         vcpu_io->u16 = device->queue_sel;
         vcpu_io->access_size = 2;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_QUEUE_SIZE: {
         virtio_queue_t* queue = selected_queue(device);
         if (queue == nullptr)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         fbl::AutoLock lock(&queue->mutex);
         vcpu_io->u16 = queue->size;
         vcpu_io->access_size = 2;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_QUEUE_ENABLE:
         // Virtio 1.0 Section 4.1.4.3: The device MUST present a 0 in
@@ -186,17 +186,17 @@
         // Note the implementation currently does not respect this value.
         vcpu_io->access_size = 2;
         vcpu_io->u16 = 0;
-        return MX_OK;
+        return ZX_OK;
     case VIRTIO_PCI_COMMON_CFG_QUEUE_DESC_LOW ... VIRTIO_PCI_COMMON_CFG_QUEUE_USED_HIGH: {
         virtio_queue_t* queue = selected_queue(device);
         if (queue == nullptr)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         size_t word = (port - VIRTIO_PCI_COMMON_CFG_QUEUE_DESC_LOW) / sizeof(uint32_t);
         fbl::AutoLock lock(&queue->mutex);
         vcpu_io->u32 = queue->addr.words[word];
         vcpu_io->access_size = 4;
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Currently not implmeneted.
@@ -206,15 +206,15 @@
     case VIRTIO_PCI_COMMON_CFG_MSIX_CONFIG:
         vcpu_io->u32 = 0;
         vcpu_io->access_size = access_size;
-        return MX_OK;
+        return ZX_OK;
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t virtio_pci_read(const pci_device_t* pci_device, uint8_t bar, uint16_t port,
-                                   uint8_t access_size, mx_vcpu_io_t* vcpu_io) {
+static zx_status_t virtio_pci_read(const pci_device_t* pci_device, uint8_t bar, uint16_t port,
+                                   uint8_t access_size, zx_vcpu_io_t* vcpu_io) {
     if (bar != VirtioPciBar::MODERN)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     virtio_device_t* device = pci_device_to_virtio(pci_device);
     switch (port) {
@@ -231,7 +231,7 @@
         // To avoid an extra access, simply reading this register resets it to
         // 0 and causes the device to de-assert the interrupt.
         device->isr_status = 0;
-        return MX_OK;
+        return ZX_OK;
     }
 
     if (port >= kVirtioPciDeviceCfgBase && port < kVirtioPciDeviceCfgBase + device->config_size) {
@@ -239,7 +239,7 @@
         return device->ops->read(device, device_offset, access_size, vcpu_io);
     }
     fprintf(stderr, "Unhandled read %#x\n", port);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
 static void virtio_queue_update_addr(virtio_queue_t* queue) {
@@ -251,100 +251,100 @@
 /* Handle writes to the common configuration structure as defined in
  * Virtio 1.0 Section 4.1.4.3.
  */
-static mx_status_t virtio_pci_common_cfg_write(pci_device_t* pci_device, uint16_t port,
-                                               const mx_vcpu_io_t* io) {
+static zx_status_t virtio_pci_common_cfg_write(pci_device_t* pci_device, uint16_t port,
+                                               const zx_vcpu_io_t* io) {
     virtio_device_t* device = pci_device_to_virtio(pci_device);
 
     switch (port) {
     case VIRTIO_PCI_COMMON_CFG_DEVICE_FEATURES_SEL: {
         if (io->access_size != 4)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
 
         fbl::AutoLock lock(&device->mutex);
         device->features_sel = io->u32;
-        return MX_OK;
+        return ZX_OK;
     }
 
     case VIRTIO_PCI_COMMON_CFG_DRIVER_FEATURES_SEL: {
         if (io->access_size != 4)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
 
         fbl::AutoLock lock(&device->mutex);
         device->driver_features_sel = io->u32;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_DRIVER_FEATURES: {
         if (io->access_size != 4)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
 
         fbl::AutoLock lock(&device->mutex);
         if (device->driver_features_sel == 0)
             device->driver_features = io->u32;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_DEVICE_STATUS: {
         if (io->access_size != 1)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
 
         fbl::AutoLock lock(&device->mutex);
         device->status = io->u8;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_QUEUE_SEL: {
         if (io->access_size != 2)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         if (io->u16 >= device->num_queues)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
 
         fbl::AutoLock lock(&device->mutex);
         device->queue_sel = io->u16;
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_QUEUE_SIZE: {
         if (io->access_size != 2)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         virtio_queue_t* queue = selected_queue(device);
         if (queue == nullptr)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         fbl::AutoLock lock(&queue->mutex);
         queue->size = io->u16;
         virtio_queue_update_addr(queue);
-        return MX_OK;
+        return ZX_OK;
     }
     case VIRTIO_PCI_COMMON_CFG_QUEUE_DESC_LOW ... VIRTIO_PCI_COMMON_CFG_QUEUE_USED_HIGH: {
         if (io->access_size != 4)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         virtio_queue_t* queue = selected_queue(device);
         if (queue == nullptr)
-            return MX_ERR_BAD_STATE;
+            return ZX_ERR_BAD_STATE;
 
         size_t word = (port - VIRTIO_PCI_COMMON_CFG_QUEUE_DESC_LOW) / sizeof(uint32_t);
         fbl::AutoLock lock(&queue->mutex);
         queue->addr.words[word] = io->u32;
         virtio_queue_update_addr(queue);
-        return MX_OK;
+        return ZX_OK;
     }
     // Not implemented registers.
     case VIRTIO_PCI_COMMON_CFG_QUEUE_MSIX_VECTOR:
     case VIRTIO_PCI_COMMON_CFG_MSIX_CONFIG:
     case VIRTIO_PCI_COMMON_CFG_QUEUE_ENABLE:
-        return MX_OK;
+        return ZX_OK;
     // Read-only registers.
     case VIRTIO_PCI_COMMON_CFG_QUEUE_NOTIFY_OFF:
     case VIRTIO_PCI_COMMON_CFG_NUM_QUEUES:
     case VIRTIO_PCI_COMMON_CFG_CONFIG_GEN:
     case VIRTIO_PCI_COMMON_CFG_DEVICE_FEATURES:
         fprintf(stderr, "Unsupported write to %x\n", port);
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
     }
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t virtio_pci_write(pci_device_t* pci_device, uint8_t bar, uint16_t port,
-                                    const mx_vcpu_io_t* io) {
+static zx_status_t virtio_pci_write(pci_device_t* pci_device, uint8_t bar, uint16_t port,
+                                    const zx_vcpu_io_t* io) {
     if (bar != VirtioPciBar::MODERN)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     virtio_device_t* device = pci_device_to_virtio(pci_device);
     switch (port) {
@@ -354,7 +354,7 @@
     }
     case kVirtioPciNotifyCfgBase ... kVirtioPciNotifyCfgTop:
         if (io->access_size != 2)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
 
         return virtio_device_kick(device, io->u16);
     }
@@ -364,20 +364,20 @@
         return device->ops->write(device, device_offset, io);
     }
     fprintf(stderr, "Unhandled write %#x\n", port);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-static mx_status_t virtio_pci_transitional_write(pci_device_t* pci_device, uint8_t bar,
-                                                 uint16_t port, const mx_vcpu_io_t* io) {
+static zx_status_t virtio_pci_transitional_write(pci_device_t* pci_device, uint8_t bar,
+                                                 uint16_t port, const zx_vcpu_io_t* io) {
     if (bar == VirtioPciBar::LEGACY)
         return virtio_pci_legacy_write(pci_device, bar, port, io);
 
     return virtio_pci_write(pci_device, bar, port, io);
 }
 
-static mx_status_t virtio_pci_transitional_read(const pci_device_t* pci_device, uint8_t bar,
+static zx_status_t virtio_pci_transitional_read(const pci_device_t* pci_device, uint8_t bar,
                                                 uint16_t port, uint8_t access_size,
-                                                mx_vcpu_io_t* vcpu_io) {
+                                                zx_vcpu_io_t* vcpu_io) {
     if (bar == VirtioPciBar::LEGACY)
         return virtio_pci_legacy_read(pci_device, bar, port, access_size, vcpu_io);
 
@@ -441,7 +441,7 @@
 
     // Note VIRTIO_PCI_CAP_PCI_CFG is not implmeneted.
     // This one is more complex since it is writable and doesn't seem to be
-    // used by Linux or Magenta.
+    // used by Linux or Zircon.
 
     static_assert(kVirtioPciNumCapabilities == 4, "Incorrect number of capabilities.");
     device->pci_device.capabilities = device->capabilities;
diff --git a/system/ulib/hypervisor/virtio_pci_legacy.cpp b/system/ulib/hypervisor/virtio_pci_legacy.cpp
index ebb780d..3724330 100644
--- a/system/ulib/hypervisor/virtio_pci_legacy.cpp
+++ b/system/ulib/hypervisor/virtio_pci_legacy.cpp
@@ -11,7 +11,7 @@
 #include <hypervisor/bits.h>
 #include <hypervisor/vcpu.h>
 #include <hypervisor/virtio.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls/port.h>
 #include <virtio/virtio.h>
 #include <virtio/virtio_ring.h>
 
@@ -34,7 +34,7 @@
 // When using the legacy interface, the queue layout follows 2.4.2 Legacy
 // Interfaces: A Note on Virtqueue Layout with an alignment of 4096. Driver
 // writes the physical address, divided by 4096 to the Queue Address field 2.
-static mx_status_t virtio_queue_set_pfn(virtio_queue_t* queue, uint32_t pfn) {
+static zx_status_t virtio_queue_set_pfn(virtio_queue_t* queue, uint32_t pfn) {
     uintptr_t desc_paddr = pfn * PAGE_SIZE;
     uintptr_t desc_size = queue->size * sizeof(queue->desc[0]);
     virtio_queue_set_desc_addr(queue, desc_paddr);
@@ -48,14 +48,14 @@
     uintptr_t used_paddr = align(avail_paddr + avail_size, 4096);
     virtio_queue_set_used_addr(queue, used_paddr);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 
-mx_status_t virtio_pci_legacy_read(const pci_device_t* pci_device, uint8_t bar, uint16_t port,
-                                   uint8_t access_size, mx_vcpu_io_t* vcpu_io) {
+zx_status_t virtio_pci_legacy_read(const pci_device_t* pci_device, uint8_t bar, uint16_t port,
+                                   uint8_t access_size, zx_vcpu_io_t* vcpu_io) {
     if (bar != 0)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     virtio_device_t* device = pci_device_to_virtio(pci_device);
     const virtio_queue_t* queue = selected_queue(device);
@@ -63,23 +63,23 @@
     case VIRTIO_PCI_DEVICE_FEATURES:
         vcpu_io->access_size = 4;
         vcpu_io->u32 = device->features;
-        return MX_OK;
+        return ZX_OK;
     case VIRTIO_PCI_QUEUE_PFN:
         if (!queue)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         vcpu_io->access_size = 4;
         vcpu_io->u32 = static_cast<uint32_t>(queue->addr.desc / PAGE_SIZE);
-        return MX_OK;
+        return ZX_OK;
     case VIRTIO_PCI_QUEUE_SIZE:
         if (!queue)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         vcpu_io->access_size = 2;
         vcpu_io->u16 = queue->size;
-        return MX_OK;
+        return ZX_OK;
     case VIRTIO_PCI_DEVICE_STATUS:
         vcpu_io->access_size = 1;
         vcpu_io->u8 = device->status;
-        return MX_OK;
+        return ZX_OK;
     case VIRTIO_PCI_ISR_STATUS:
         vcpu_io->access_size = 1;
         mtx_lock(&device->mutex);
@@ -91,7 +91,7 @@
         // 0 and causes the device to de-assert the interrupt.
         device->isr_status = 0;
         mtx_unlock(&device->mutex);
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Handle device-specific accesses.
@@ -101,53 +101,53 @@
     }
 
     fprintf(stderr, "Unhandled virtio device read %#x\n", port);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t virtio_pci_legacy_write(pci_device_t* pci_device, uint8_t bar, uint16_t port,
-                                    const mx_vcpu_io_t* io) {
+zx_status_t virtio_pci_legacy_write(pci_device_t* pci_device, uint8_t bar, uint16_t port,
+                                    const zx_vcpu_io_t* io) {
     if (bar != 0)
-        return MX_ERR_NOT_SUPPORTED;
+        return ZX_ERR_NOT_SUPPORTED;
 
     virtio_device_t* device = pci_device_to_virtio(pci_device);
     virtio_queue_t* queue = selected_queue(device);
     switch (port) {
     case VIRTIO_PCI_DRIVER_FEATURES:
         if (io->access_size != 4)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         // Currently we expect the driver to accept all our features.
         if (io->u32 != device->features)
-            return MX_ERR_INVALID_ARGS;
-        return MX_OK;
+            return ZX_ERR_INVALID_ARGS;
+        return ZX_OK;
     case VIRTIO_PCI_DEVICE_STATUS:
         if (io->access_size != 1)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         device->status = io->u8;
-        return MX_OK;
+        return ZX_OK;
     case VIRTIO_PCI_QUEUE_PFN: {
         if (io->access_size != 4)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         if (!queue)
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         return virtio_queue_set_pfn(queue, io->u32);
     }
     case VIRTIO_PCI_QUEUE_SIZE:
         if (io->access_size != 2)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         queue->size = io->u16;
-        return MX_OK;
+        return ZX_OK;
     case VIRTIO_PCI_QUEUE_SELECT:
         if (io->access_size != 2)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         if (io->u16 >= device->num_queues) {
             fprintf(stderr, "Selected queue does not exist.\n");
-            return MX_ERR_NOT_SUPPORTED;
+            return ZX_ERR_NOT_SUPPORTED;
         }
         device->queue_sel = io->u16;
-        return MX_OK;
+        return ZX_OK;
     case VIRTIO_PCI_QUEUE_NOTIFY: {
         if (io->access_size != 2)
-            return MX_ERR_IO_DATA_INTEGRITY;
+            return ZX_ERR_IO_DATA_INTEGRITY;
         return virtio_device_kick(device, io->u16);
     }
     }
@@ -159,5 +159,5 @@
     }
 
     fprintf(stderr, "Unhandled virtio device write %#x\n", port);
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
diff --git a/system/ulib/hypervisor/virtio_priv.h b/system/ulib/hypervisor/virtio_priv.h
index 151bd7a..cee9426 100644
--- a/system/ulib/hypervisor/virtio_priv.h
+++ b/system/ulib/hypervisor/virtio_priv.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include <hypervisor/pci.h>
-#include <magenta/syscalls/hypervisor.h>
-#include <magenta/types.h>
+#include <zircon/syscalls/hypervisor.h>
+#include <zircon/types.h>
 #include <virtio/virtio.h>
 
 /* Virtio PCI interface types. */
@@ -21,24 +21,24 @@
 
 
 /* Legacy PCI device functions. */
-mx_status_t virtio_pci_legacy_write(pci_device_t* pci_device, uint8_t bar, uint16_t port,
-                                    const mx_vcpu_io_t* io);
+zx_status_t virtio_pci_legacy_write(pci_device_t* pci_device, uint8_t bar, uint16_t port,
+                                    const zx_vcpu_io_t* io);
 
-mx_status_t virtio_pci_legacy_read(const pci_device_t* pci_device, uint8_t bar, uint16_t port,
-                                   uint8_t access_size, mx_vcpu_io_t* vcpu_io);
+zx_status_t virtio_pci_legacy_read(const pci_device_t* pci_device, uint8_t bar, uint16_t port,
+                                   uint8_t access_size, zx_vcpu_io_t* vcpu_io);
 
 /* Read bytes from a devices config structure.
  *
  * |config| must point to an in-memory representation of the config structure
  * that will be addressed by software.
  */
-mx_status_t virtio_device_config_read(const virtio_device_t* device, void* config, uint16_t port,
-                                      uint8_t access_size, mx_vcpu_io_t* vcpu_io);
+zx_status_t virtio_device_config_read(const virtio_device_t* device, void* config, uint16_t port,
+                                      uint8_t access_size, zx_vcpu_io_t* vcpu_io);
 
 /* Write bytes to a devices config structure.
  *
  * |config| must point to an in-memory representation of the config structure
  * that will be addressed by software.
  */
-mx_status_t virtio_device_config_write(const virtio_device_t* device, void* config, uint16_t port,
-                                       const mx_vcpu_io_t* io);
+zx_status_t virtio_device_config_write(const virtio_device_t* device, void* config, uint16_t port,
+                                       const zx_vcpu_io_t* io);
diff --git a/system/ulib/inet6/eth-client.c b/system/ulib/inet6/eth-client.c
index 20306c9..c10330c 100644
--- a/system/ulib/inet6/eth-client.c
+++ b/system/ulib/inet6/eth-client.c
@@ -4,7 +4,7 @@
 
 #include "eth-client.h"
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include <limits.h>
 #include <stdlib.h>
@@ -18,20 +18,20 @@
 #endif
 
 void eth_destroy(eth_client_t* eth) {
-    mx_handle_close(eth->rx_fifo);
-    mx_handle_close(eth->tx_fifo);
+    zx_handle_close(eth->rx_fifo);
+    zx_handle_close(eth->tx_fifo);
     free(eth);
 }
 
-mx_status_t eth_create(int fd, mx_handle_t io_vmo, void* io_mem, eth_client_t** out) {
+zx_status_t eth_create(int fd, zx_handle_t io_vmo, void* io_mem, eth_client_t** out) {
     eth_client_t* eth;
 
     if ((eth = calloc(1, sizeof(*eth))) == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     eth_fifos_t fifos;
-    mx_status_t status;
+    zx_status_t status;
 
     ssize_t r;
     if ((r = ioctl_ethernet_get_fifos(fd, &fifos)) < 0) {
@@ -39,8 +39,8 @@
         return r;
     }
 
-    mx_handle_t vmo;
-    if ((status = mx_handle_duplicate(io_vmo, MX_RIGHT_SAME_RIGHTS, &vmo)) < 0) {
+    zx_handle_t vmo;
+    if ((status = zx_handle_duplicate(io_vmo, ZX_RIGHT_SAME_RIGHTS, &vmo)) < 0) {
         fprintf(stderr, "eth_create: failed to duplicate vmo\n");
         goto fail;
     }
@@ -60,16 +60,16 @@
     eth->iobuf = io_mem;
 
     *out = eth;
-    return MX_OK;
+    return ZX_OK;
 
 fail:
-    mx_handle_close(fifos.tx_fifo);
-    mx_handle_close(fifos.rx_fifo);
+    zx_handle_close(fifos.tx_fifo);
+    zx_handle_close(fifos.rx_fifo);
     eth_destroy(eth);
     return status;
 }
 
-mx_status_t eth_queue_tx(eth_client_t* eth, void* cookie,
+zx_status_t eth_queue_tx(eth_client_t* eth, void* cookie,
                          void* data, size_t len, uint32_t options) {
     eth_fifo_entry_t e = {
         .offset = data - eth->iobuf,
@@ -80,10 +80,10 @@
     uint32_t actual;
     IORING_TRACE("eth:tx+ c=%p o=%u l=%u f=%u\n",
                  e.cookie, e.offset, e.length, e.flags);
-    return mx_fifo_write(eth->tx_fifo, &e, sizeof(e), &actual);
+    return zx_fifo_write(eth->tx_fifo, &e, sizeof(e), &actual);
 }
 
-mx_status_t eth_queue_rx(eth_client_t* eth, void* cookie,
+zx_status_t eth_queue_rx(eth_client_t* eth, void* cookie,
                          void* data, size_t len, uint32_t options) {
     eth_fifo_entry_t e = {
         .offset = data - eth->iobuf,
@@ -94,17 +94,17 @@
     uint32_t actual;
     IORING_TRACE("eth:rx+ c=%p o=%u l=%u f=%u\n",
                  e.cookie, e.offset, e.length, e.flags);
-    return mx_fifo_write(eth->rx_fifo, &e, sizeof(e), &actual);
+    return zx_fifo_write(eth->rx_fifo, &e, sizeof(e), &actual);
 }
 
-mx_status_t eth_complete_tx(eth_client_t* eth, void* ctx,
+zx_status_t eth_complete_tx(eth_client_t* eth, void* ctx,
                             void (*func)(void* ctx, void* cookie)) {
     eth_fifo_entry_t entries[eth->tx_size];
-    mx_status_t status;
+    zx_status_t status;
     uint32_t count;
-    if ((status = mx_fifo_read(eth->tx_fifo, entries, sizeof(entries), &count)) < 0) {
-        if (status == MX_ERR_SHOULD_WAIT) {
-            return MX_OK;
+    if ((status = zx_fifo_read(eth->tx_fifo, entries, sizeof(entries), &count)) < 0) {
+        if (status == ZX_ERR_SHOULD_WAIT) {
+            return ZX_OK;
         } else {
             return status;
         }
@@ -115,17 +115,17 @@
                      e->cookie, e->offset, e->length, e->flags);
         func(ctx, e->cookie);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t eth_complete_rx(eth_client_t* eth, void* ctx,
+zx_status_t eth_complete_rx(eth_client_t* eth, void* ctx,
                             void (*func)(void* ctx, void* cookie, size_t len, uint32_t flags)) {
     eth_fifo_entry_t entries[eth->rx_size];
-    mx_status_t status;
+    zx_status_t status;
     uint32_t count;
-    if ((status = mx_fifo_read(eth->rx_fifo, entries, sizeof(entries), &count)) < 0) {
-        if (status == MX_ERR_SHOULD_WAIT) {
-            return MX_OK;
+    if ((status = zx_fifo_read(eth->rx_fifo, entries, sizeof(entries), &count)) < 0) {
+        if (status == ZX_ERR_SHOULD_WAIT) {
+            return ZX_OK;
         } else {
             return status;
         }
@@ -136,25 +136,25 @@
                      e->cookie, e->offset, e->length, e->flags);
         func(ctx, e->cookie, e->length, e->flags);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 
 // Wait for completed rx packets
-// MX_ERR_PEER_CLOSED - far side disconnected
-// MX_ERR_TIMED_OUT - deadline lapsed
-// MX_OK - completed packets are available
-mx_status_t eth_wait_rx(eth_client_t* eth, mx_time_t deadline) {
-    mx_status_t status;
-    mx_signals_t signals;
+// ZX_ERR_PEER_CLOSED - far side disconnected
+// ZX_ERR_TIMED_OUT - deadline lapsed
+// ZX_OK - completed packets are available
+zx_status_t eth_wait_rx(eth_client_t* eth, zx_time_t deadline) {
+    zx_status_t status;
+    zx_signals_t signals;
 
-    if ((status = mx_object_wait_one(eth->rx_fifo,
-                                     MX_FIFO_READABLE | MX_FIFO_PEER_CLOSED,
+    if ((status = zx_object_wait_one(eth->rx_fifo,
+                                     ZX_FIFO_READABLE | ZX_FIFO_PEER_CLOSED,
                                      deadline, &signals)) < 0) {
         return status;
     }
-    if (signals & MX_FIFO_PEER_CLOSED) {
-        return MX_ERR_PEER_CLOSED;
+    if (signals & ZX_FIFO_PEER_CLOSED) {
+        return ZX_ERR_PEER_CLOSED;
     }
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/ulib/inet6/eth-client.h b/system/ulib/inet6/eth-client.h
index 19d0945..58e486b 100644
--- a/system/ulib/inet6/eth-client.h
+++ b/system/ulib/inet6/eth-client.h
@@ -4,44 +4,44 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/device/ethernet.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS;
 
 typedef struct eth_client {
-    mx_handle_t tx_fifo;
-    mx_handle_t rx_fifo;
+    zx_handle_t tx_fifo;
+    zx_handle_t rx_fifo;
     uint32_t tx_size;
     uint32_t rx_size;
     void* iobuf;
 } eth_client_t;
 
-mx_status_t eth_create(int fd, mx_handle_t io_vmo, void* io_mem, eth_client_t** out);
+zx_status_t eth_create(int fd, zx_handle_t io_vmo, void* io_mem, eth_client_t** out);
 
 void eth_destroy(eth_client_t* eth);
 
 // Enqueue a packet for transmit
-mx_status_t eth_queue_tx(eth_client_t* eth, void* cookie,
+zx_status_t eth_queue_tx(eth_client_t* eth, void* cookie,
                          void* data, size_t len, uint32_t options);
 
 // Process all transmitted buffers
-mx_status_t eth_complete_tx(eth_client_t* eth, void* ctx,
+zx_status_t eth_complete_tx(eth_client_t* eth, void* ctx,
                             void (*func)(void* ctx, void* cookie));
 
 // Enqueue a packet for reception.
-mx_status_t eth_queue_rx(eth_client_t* eth, void* cookie,
+zx_status_t eth_queue_rx(eth_client_t* eth, void* cookie,
                          void* data, size_t len, uint32_t options);
 
 // Process all received buffers
-mx_status_t eth_complete_rx(eth_client_t* eth, void* ctx,
+zx_status_t eth_complete_rx(eth_client_t* eth, void* ctx,
                             void (*func)(void* ctx, void* cookie, size_t len, uint32_t flags));
 
 // Wait for completed rx packets
-// MX_ERR_PEER_CLOSED - far side disconnected
-// MX_ERR_TIMED_OUT - deadline lapsed.
-// MX_OK - completed packets are available
-mx_status_t eth_wait_rx(eth_client_t* eth, mx_time_t deadline);
+// ZX_ERR_PEER_CLOSED - far side disconnected
+// ZX_ERR_TIMED_OUT - deadline lapsed.
+// ZX_OK - completed packets are available
+zx_status_t eth_wait_rx(eth_client_t* eth, zx_time_t deadline);
 
 __END_CDECLS;
diff --git a/system/ulib/inet6/netifc.c b/system/ulib/inet6/netifc.c
index 994aba1..93d93e4 100644
--- a/system/ulib/inet6/netifc.c
+++ b/system/ulib/inet6/netifc.c
@@ -16,16 +16,16 @@
 
 #include "eth-client.h"
 
-#include <magenta/device/ethernet.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #include <inet6/inet6.h>
 #include <inet6/netifc.h>
 
-#include <mxio/io.h>
-#include <mxio/watcher.h>
+#include <fdio/io.h>
+#include <fdio/watcher.h>
 
 #define ALIGN(n, a) (((n) + ((a) - 1)) & ~((a) - 1))
 // if nonzero, drop 1 in DROP_PACKETS packets at random
@@ -61,7 +61,7 @@
 static uint8_t netmac[6];
 static size_t netmtu;
 
-static mx_handle_t iovmo;
+static zx_handle_t iovmo;
 static void* iobuf;
 
 #define NET_BUFFERS 64
@@ -186,7 +186,7 @@
     eth_complete_tx(eth, NULL, tx_complete);
 
     ethbuf->state = ETH_BUFFER_TX;
-    mx_status_t status = eth_queue_tx(eth, ethbuf, ethbuf->data + skip, len, 0);
+    zx_status_t status = eth_queue_tx(eth, ethbuf, ethbuf->data + skip, len, 0);
     if (status < 0) {
         printf("eth_fifo_send: queue tx failed: %d\n", status);
         eth_put_buffer_locked(ethbuf, ETH_BUFFER_TX);
@@ -218,14 +218,14 @@
 static volatile uint64_t net_timer = 0;
 
 void netifc_set_timer(uint32_t ms) {
-    net_timer = mx_time_get(MX_CLOCK_MONOTONIC) + MX_MSEC(ms);
+    net_timer = zx_time_get(ZX_CLOCK_MONOTONIC) + ZX_MSEC(ms);
 }
 
 int netifc_timer_expired(void) {
     if (net_timer == 0) {
         return 0;
     }
-    if (mx_time_get(MX_CLOCK_MONOTONIC) > net_timer) {
+    if (zx_time_get(ZX_CLOCK_MONOTONIC) > net_timer) {
         return 1;
     }
     return 0;
@@ -236,34 +236,34 @@
     *mtu = netmtu;
 }
 
-static mx_status_t netifc_open_cb(int dirfd, int event, const char* fn, void* cookie) {
+static zx_status_t netifc_open_cb(int dirfd, int event, const char* fn, void* cookie) {
     if (event != WATCH_EVENT_ADD_FILE) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     printf("netifc: ? /dev/class/ethernet/%s\n", fn);
 
     if ((netfd = openat(dirfd, fn, O_RDWR)) < 0) {
-        return MX_OK;
+        return ZX_OK;
     }
 
     eth_info_t info;
     if (ioctl_ethernet_get_info(netfd, &info) < 0) {
         close(netfd);
         netfd = -1;
-        return MX_OK;
+        return ZX_OK;
     }
     if (info.features & (ETH_FEATURE_WLAN | ETH_FEATURE_SYNTH)) {
         // Don't run netsvc for wireless or synthetic network devices
         close(netfd);
         netfd = -1;
-        return MX_OK;
+        return ZX_OK;
     }
     memcpy(netmac, info.mac, sizeof(netmac));
     netmtu = info.mtu;
 
     mtx_lock(&eth_lock);
-    mx_status_t status;
+    zx_status_t status;
 
     // we only do this the very first time
     if (eth_buffer_base == NULL) {
@@ -278,14 +278,14 @@
     if (iobuf == NULL) {
         // allocate shareable ethernet buffer data heap
         size_t iosize = 2 * NET_BUFFERS * NET_BUFFERSZ;
-        if ((status = mx_vmo_create(iosize, 0, &iovmo)) < 0) {
+        if ((status = zx_vmo_create(iosize, 0, &iovmo)) < 0) {
             goto fail_close_fd;
         }
-        if ((status = mx_vmar_map(mx_vmar_root_self(), 0, iovmo, 0, iosize,
-                                  MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+        if ((status = zx_vmar_map(zx_vmar_root_self(), 0, iovmo, 0, iosize,
+                                  ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                                   (uintptr_t*)&iobuf)) < 0) {
-            mx_handle_close(iovmo);
-            iovmo = MX_HANDLE_INVALID;
+            zx_handle_close(iovmo);
+            iovmo = ZX_HANDLE_INVALID;
             goto fail_close_fd;
         }
         printf("netifc: create %zu eth buffers\n", eth_buffer_count);
@@ -326,7 +326,7 @@
     mtx_unlock(&eth_lock);
 
     // stop polling
-    return MX_ERR_STOP;
+    return ZX_ERR_STOP;
 
 fail_destroy_client:
     eth_destroy(eth);
@@ -335,7 +335,7 @@
     close(netfd);
     netfd = -1;
     mtx_unlock(&eth_lock);
-    return MX_OK;
+    return ZX_OK;
 }
 
 int netifc_open(void) {
@@ -344,12 +344,12 @@
         return -1;
     }
 
-    mx_status_t status = mxio_watch_directory(dirfd, netifc_open_cb, MX_TIME_INFINITE, NULL);
+    zx_status_t status = fdio_watch_directory(dirfd, netifc_open_cb, ZX_TIME_INFINITE, NULL);
     close(dirfd);
 
     // callback returns STOP if it finds and successfully
     // opens a network interface
-    return (status == MX_ERR_STOP) ? 0 : -1;
+    return (status == ZX_ERR_STOP) ? 0 : -1;
 }
 
 void netifc_close(void) {
@@ -396,21 +396,21 @@
 
 int netifc_poll(void) {
     for (;;) {
-        mx_status_t status;
+        zx_status_t status;
         if ((status = eth_complete_rx(eth, NULL, rx_complete)) < 0) {
             printf("netifc: eth rx failed: %d\n", status);
             return -1;
         }
         if (net_timer) {
-            mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+            zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
             if (now > net_timer) {
                 return 0;
             }
-            status = eth_wait_rx(eth, net_timer + MX_MSEC(1));
+            status = eth_wait_rx(eth, net_timer + ZX_MSEC(1));
         } else {
-            status = eth_wait_rx(eth, MX_TIME_INFINITE);
+            status = eth_wait_rx(eth, ZX_TIME_INFINITE);
         }
-        if ((status < 0) && (status != MX_ERR_TIMED_OUT)) {
+        if ((status < 0) && (status != ZX_ERR_TIMED_OUT)) {
             printf("netifc: eth rx wait failed: %d\n", status);
             return -1;
         }
diff --git a/system/ulib/inet6/rules.mk b/system/ulib/inet6/rules.mk
index 3b68163..2f5f3db 100644
--- a/system/ulib/inet6/rules.mk
+++ b/system/ulib/inet6/rules.mk
@@ -13,6 +13,6 @@
     $(LOCAL_DIR)/netifc.c \
     $(LOCAL_DIR)/eth-client.c \
 
-MODULE_LIBS += system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS += system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/launchpad/elf.c b/system/ulib/launchpad/elf.c
index d1d1368..33aa534 100644
--- a/system/ulib/launchpad/elf.c
+++ b/system/ulib/launchpad/elf.c
@@ -6,8 +6,8 @@
 
 #include <elfload/elfload.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <stdlib.h>
 
 struct elf_load_info {
@@ -19,19 +19,19 @@
     free(info);
 }
 
-mx_status_t elf_load_start(mx_handle_t vmo, const void* hdr_buf, size_t buf_sz,
+zx_status_t elf_load_start(zx_handle_t vmo, const void* hdr_buf, size_t buf_sz,
                            elf_load_info_t** infop) {
     elf_load_header_t header;
     uintptr_t phoff;
-    mx_status_t status = elf_load_prepare(vmo, hdr_buf, buf_sz, &header, &phoff);
-    if (status == MX_OK) {
+    zx_status_t status = elf_load_prepare(vmo, hdr_buf, buf_sz, &header, &phoff);
+    if (status == ZX_OK) {
         // Now allocate the data structure and read in the phdrs.
         size_t phdrs_size = (size_t)header.e_phnum * sizeof(elf_phdr_t);
         elf_load_info_t* info = malloc(sizeof(*info) + phdrs_size);
         if (info == NULL)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         status = elf_load_read_phdrs(vmo, info->phdrs, phoff, header.e_phnum);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             info->header = header;
             *infop = info;
         } else {
@@ -41,7 +41,7 @@
     return status;
 }
 
-mx_status_t elf_load_get_interp(elf_load_info_t* info, mx_handle_t vmo,
+zx_status_t elf_load_get_interp(elf_load_info_t* info, zx_handle_t vmo,
                                 char** interp, size_t* interp_len) {
     char *buffer = NULL;
     uintptr_t offset;
@@ -49,9 +49,9 @@
                              &offset, interp_len)) {
         buffer = malloc(*interp_len + 1);
         if (buffer == NULL)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         size_t n;
-        mx_status_t status = mx_vmo_read(vmo, buffer, offset, *interp_len, &n);
+        zx_status_t status = zx_vmo_read(vmo, buffer, offset, *interp_len, &n);
         if (status < 0) {
             free(buffer);
             return status;
@@ -63,13 +63,13 @@
         buffer[*interp_len] = '\0';
     }
     *interp = buffer;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t elf_load_finish(mx_handle_t vmar, elf_load_info_t* info,
-                            mx_handle_t vmo,
-                            mx_handle_t* segments_vmar,
-                            mx_vaddr_t* base, mx_vaddr_t* entry) {
+zx_status_t elf_load_finish(zx_handle_t vmar, elf_load_info_t* info,
+                            zx_handle_t vmo,
+                            zx_handle_t* segments_vmar,
+                            zx_vaddr_t* base, zx_vaddr_t* entry) {
     return elf_load_map_segments(vmar, &info->header, info->phdrs, vmo,
                                  segments_vmar, base, entry);
 }
diff --git a/system/ulib/launchpad/elf.h b/system/ulib/launchpad/elf.h
index 55f1c45..0aa8133 100644
--- a/system/ulib/launchpad/elf.h
+++ b/system/ulib/launchpad/elf.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stddef.h>
 
 #pragma GCC visibility push(hidden)
@@ -13,7 +13,7 @@
 
 // Validate the ELF headers and set up for further use.
 // The pointer returned must be passed to elf_load_destroy when finished.
-mx_status_t elf_load_start(mx_handle_t vmo, const void* buf, size_t buf_sz,
+zx_status_t elf_load_start(zx_handle_t vmo, const void* buf, size_t buf_sz,
                            elf_load_info_t** infop);
 
 // Clean up and free the data structure created by elf_load_start.
@@ -22,7 +22,7 @@
 // Check if the ELF file has a PT_INTERP header.  On success, *interp
 // is NULL if it had none or a malloc'd string of the contents;
 // *interp_len is strlen(*interp).
-mx_status_t elf_load_get_interp(elf_load_info_t* info, mx_handle_t vmo,
+zx_status_t elf_load_get_interp(elf_load_info_t* info, zx_handle_t vmo,
                                 char** interp, size_t* interp_len);
 
 // Check if the ELF file has a PT_GNU_STACK header, and return its p_memsz.
@@ -32,9 +32,9 @@
 // Load the file's segments into the process.
 // If this fails, the state of the process address space is unspecified.
 // Regardless of success/failure this does not consume |vmo|.
-mx_status_t elf_load_finish(mx_handle_t vmar, elf_load_info_t* info,
-                            mx_handle_t vmo,
-                            mx_handle_t* segments_vmar,
-                            mx_vaddr_t* base, mx_vaddr_t* entry);
+zx_status_t elf_load_finish(zx_handle_t vmar, elf_load_info_t* info,
+                            zx_handle_t vmo,
+                            zx_handle_t* segments_vmar,
+                            zx_vaddr_t* base, zx_vaddr_t* entry);
 
 #pragma GCC visibility pop
diff --git a/system/ulib/launchpad/fdio.c b/system/ulib/launchpad/fdio.c
new file mode 100644
index 0000000..2aba9f5
--- /dev/null
+++ b/system/ulib/launchpad/fdio.c
@@ -0,0 +1,83 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <launchpad/launchpad.h>
+#include <launchpad/vmo.h>
+
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/io.h>
+#include <fdio/namespace.h>
+#include <fdio/util.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+static zx_status_t add_fdio(launchpad_t* lp,
+                            zx_handle_t handles[FDIO_MAX_HANDLES],
+                            uint32_t types[FDIO_MAX_HANDLES],
+                            zx_status_t status) {
+    if (status == ZX_ERR_BAD_HANDLE)
+        return ZX_OK;
+    if (status == ZX_ERR_NOT_SUPPORTED)
+        return ZX_OK;
+    if (status > 0) {
+        return launchpad_add_handles(lp, status, handles, types);
+    } else {
+        launchpad_abort(lp, status, "add_fdio: failed");
+        return status;
+    }
+}
+
+zx_status_t launchpad_clone(launchpad_t* lp, uint32_t what) {
+    zx_handle_t handles[FDIO_MAX_HANDLES];
+    uint32_t types[FDIO_MAX_HANDLES];
+    zx_status_t status;
+
+    if (what & LP_CLONE_FDIO_NAMESPACE) {
+        fdio_flat_namespace_t* flat;
+        status = fdio_ns_export_root(&flat);
+        if (status == ZX_OK) {
+            launchpad_set_nametable(lp, flat->count, flat->path);
+            launchpad_add_handles(lp, flat->count, flat->handle, flat->type);
+            free(flat);
+        } else if (status != ZX_ERR_NOT_FOUND) {
+            launchpad_abort(lp, status, "clone: error cloning namespace");
+            return status;
+        }
+    }
+    if (what & LP_CLONE_FDIO_CWD && (status = fdio_clone_cwd(handles, types)) > 0) {
+        add_fdio(lp, handles, types, status);
+    }
+    if (what & LP_CLONE_FDIO_STDIO) {
+        for (int fd = 0; fd < 3; fd++) {
+            add_fdio(lp, handles, types, fdio_clone_fd(fd, fd, handles, types));
+        }
+    }
+    if (what & LP_CLONE_ENVIRON) {
+        launchpad_set_environ(lp, (const char* const*)environ);
+    }
+    if (what & LP_CLONE_DEFAULT_JOB) {
+        zx_handle_t job;
+        if (zx_handle_duplicate(zx_job_default(), ZX_RIGHT_SAME_RIGHTS, &job) == ZX_OK) {
+            launchpad_add_handle(lp, job, PA_HND(PA_JOB_DEFAULT, 0));
+        }
+    }
+    return launchpad_get_status(lp);
+}
+
+zx_status_t launchpad_clone_fd(launchpad_t* lp, int fd, int target_fd) {
+    zx_handle_t handles[FDIO_MAX_HANDLES];
+    uint32_t types[FDIO_MAX_HANDLES];
+    return add_fdio(lp, handles, types,
+                    fdio_clone_fd(fd, target_fd, handles, types));
+}
+
+zx_status_t launchpad_transfer_fd(launchpad_t* lp, int fd, int target_fd) {
+    zx_handle_t handles[FDIO_MAX_HANDLES];
+    uint32_t types[FDIO_MAX_HANDLES];
+    return add_fdio(lp, handles, types,
+                    fdio_transfer_fd(fd, target_fd, handles, types));
+}
diff --git a/system/ulib/launchpad/include/launchpad/launchpad.h b/system/ulib/launchpad/include/launchpad/launchpad.h
index ce0ee02..8aea517 100644
--- a/system/ulib/launchpad/include/launchpad/launchpad.h
+++ b/system/ulib/launchpad/include/launchpad/launchpad.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 #include <stdbool.h>
 #include <stddef.h>
@@ -27,9 +27,9 @@
 //   launchpad_set_args(lp, argc, argv);
 //   launchpad_set_environ(lp, env);
 //   << other launchpad_*() calls to setup initial fds, handles, etc >>
-//   mx_handle_t proc;
+//   zx_handle_t proc;
 //   const char* errmsg;
-//   mx_status_t status = launchpad_go(lp, &proc, &errmsg);
+//   zx_status_t status = launchpad_go(lp, &proc, &errmsg);
 //   if (status < 0)
 //       printf("launchpad failed: %s: %d\n", errmsg, status);
 //
@@ -54,13 +54,13 @@
 // The job handle is used for creation of the process, but is not
 // taken ownership of or closed.
 //
-// If the job handle is 0 (MX_HANDLE_INVALID), the default job for
-// the running process is used, if it exists (mx_job_default()).
+// If the job handle is 0 (ZX_HANDLE_INVALID), the default job for
+// the running process is used, if it exists (zx_job_default()).
 //
 // Unless the new process is provided with a job handle, at time
 // of launch or later, it will not be able to create any more
 // processes.
-mx_status_t launchpad_create(mx_handle_t job, const char* name,
+zx_status_t launchpad_create(zx_handle_t job, const char* name,
                              launchpad_t** lp);
 
 // Create a new process and a launchpad that will set it up.
@@ -70,16 +70,16 @@
 // The transferred_job handle is optional.  If non-zero, it is
 // consumed by the launchpad and will be passed to the new process
 // on successful launch or closed on failure.
-mx_status_t launchpad_create_with_jobs(mx_handle_t creation_job,
-                                       mx_handle_t transferred_job,
+zx_status_t launchpad_create_with_jobs(zx_handle_t creation_job,
+                                       zx_handle_t transferred_job,
                                        const char* name,
                                        launchpad_t** result);
 
 // Create a new launchpad for a given existing process handle and a
 // its root VMAR handle.  On success, the launchpad takes ownership
 // of both handles.
-mx_status_t launchpad_create_with_process(mx_handle_t proc,
-                                          mx_handle_t vmar,
+zx_status_t launchpad_create_with_process(zx_handle_t proc,
+                                          zx_handle_t vmar,
                                           launchpad_t** result);
 
 
@@ -97,7 +97,7 @@
 // The launchpad is destroyed (via launchpad_destroy()) before this returns,
 // all resources are reclaimed, handles are closed, and may not be accessed
 // again.
-mx_status_t launchpad_go(launchpad_t* lp, mx_handle_t* proc, const char** errmsg);
+zx_status_t launchpad_go(launchpad_t* lp, zx_handle_t* proc, const char** errmsg);
 
 // Clean up a launchpad_t, freeing all resources stored therein.
 // TODO(mcgrathr): Currently this closes the process handle but does
@@ -108,14 +108,14 @@
 // any calls to launchpad_go() will fail.
 // If it is not already in an error state, the error state is
 // set to status, and errmsg is set to msg.
-// If status is non-negative, it is interpreted as MX_ERR_INTERNAL.
-void launchpad_abort(launchpad_t* lp, mx_status_t status, const char* msg);
+// If status is non-negative, it is interpreted as ZX_ERR_INTERNAL.
+void launchpad_abort(launchpad_t* lp, zx_status_t status, const char* msg);
 
 // If any launchpad_*() call against this lp has failed, this returns
 // a human-readable detailed message describing the failure that may
 // assist in debugging.
 const char* launchpad_error_message(launchpad_t* lp);
-mx_status_t launchpad_get_status(launchpad_t* lp);
+zx_status_t launchpad_get_status(launchpad_t* lp);
 
 
 // SIMPLIFIED BINARY LOADING
@@ -125,13 +125,13 @@
 // -------------------------------------------------------------------
 
 // Load an ELF PIE binary from path
-mx_status_t launchpad_load_from_file(launchpad_t* lp, const char* path);
+zx_status_t launchpad_load_from_file(launchpad_t* lp, const char* path);
 
 // Load an ELF PIE binary from fd
-mx_status_t launchpad_load_from_fd(launchpad_t* lp, int fd);
+zx_status_t launchpad_load_from_fd(launchpad_t* lp, int fd);
 
 // Load an ELF PIE binary from vmo
-mx_status_t launchpad_load_from_vmo(launchpad_t* lp, mx_handle_t vmo);
+zx_status_t launchpad_load_from_vmo(launchpad_t* lp, zx_handle_t vmo);
 
 
 // ADDING ARGUMENTS, ENVIRONMENT, AND HANDLES
@@ -143,10 +143,10 @@
 // bootstrap message.  All the strings are copied into the launchpad
 // by this call, with no pointers to these argument strings retained.
 // Successive calls replace the previous values.
-mx_status_t launchpad_set_args(launchpad_t* lp,
+zx_status_t launchpad_set_args(launchpad_t* lp,
                                int argc, const char* const* argv);
-mx_status_t launchpad_set_environ(launchpad_t* lp, const char* const* envp);
-mx_status_t launchpad_set_nametable(launchpad_t* lp,
+zx_status_t launchpad_set_environ(launchpad_t* lp, const char* const* envp);
+zx_status_t launchpad_set_nametable(launchpad_t* lp,
                                     size_t count, const char* const* names);
 
 
@@ -155,14 +155,14 @@
 // by launchpad_destroy or transferred by launchpad_start.
 // Successive calls append more handles.  The list of handles to
 // send is cleared only by a successful launchpad_start call.
-// It is an error to add a handle of 0 (MX_HANDLE_INVALID)
-mx_status_t launchpad_add_handle(launchpad_t* lp, mx_handle_t h, uint32_t id);
-mx_status_t launchpad_add_handles(launchpad_t* lp, size_t n,
-                                  const mx_handle_t h[], const uint32_t id[]);
+// It is an error to add a handle of 0 (ZX_HANDLE_INVALID)
+zx_status_t launchpad_add_handle(launchpad_t* lp, zx_handle_t h, uint32_t id);
+zx_status_t launchpad_add_handles(launchpad_t* lp, size_t n,
+                                  const zx_handle_t h[], const uint32_t id[]);
 
-// ADDING MXIO FILE DESCRIPTORS
+// ADDING FDIO FILE DESCRIPTORS
 // These functions configure the initial file descriptors, root directory,
-// and current working directory for processes which use libmxio for the
+// and current working directory for processes which use libfdio for the
 // posix-style io api (open/close/read/write/...)
 // --------------------------------------------------------------------
 
@@ -171,9 +171,9 @@
 // running process to be shared with the process being launched.
 // The items shared are as of the call to launchpad_clone().
 //
-// CLONE_MXIO_NAMESPACE  shares the filestem namespace
-// CLONE_MXIO_CWD        shares the current working directory
-// CLONE_MXIO_STDIO      shares file descriptors 0, 1, and 2
+// CLONE_FDIO_NAMESPACE  shares the filestem namespace
+// CLONE_FDIO_CWD        shares the current working directory
+// CLONE_FDIO_STDIO      shares file descriptors 0, 1, and 2
 // CLONE_ENVIRON         shares the environment
 // CLONE_JOB             shares the default job (if one exists)
 //
@@ -182,37 +182,37 @@
 //
 // launchpad_clone_fd() and launchpad_trasnfer_fd() may be used to
 // add additional file descriptors to the launched process.
-#define LP_CLONE_MXIO_NAMESPACE  (0x0001u)
-#define LP_CLONE_MXIO_CWD        (0x0002u)
-#define LP_CLONE_MXIO_STDIO      (0x0004u)
-#define LP_CLONE_MXIO_ALL        (0x00FFu)
+#define LP_CLONE_FDIO_NAMESPACE  (0x0001u)
+#define LP_CLONE_FDIO_CWD        (0x0002u)
+#define LP_CLONE_FDIO_STDIO      (0x0004u)
+#define LP_CLONE_FDIO_ALL        (0x00FFu)
 #define LP_CLONE_ENVIRON         (0x0100u)
 #define LP_CLONE_DEFAULT_JOB     (0x0200u)
 #define LP_CLONE_ALL             (0xFFFFu)
 
-mx_status_t launchpad_clone(launchpad_t* lp, uint32_t what);
+zx_status_t launchpad_clone(launchpad_t* lp, uint32_t what);
 
 
 // Attempt to duplicate local descriptor fd into target_fd in the
-// new process.  Returns MX_ERR_BAD_HANDLE if fd is not a valid fd, or
-// MX_ERR_NOT_SUPPORTED if it's not possible to transfer this fd.
-mx_status_t launchpad_clone_fd(launchpad_t* lp, int fd, int target_fd);
+// new process.  Returns ZX_ERR_BAD_HANDLE if fd is not a valid fd, or
+// ZX_ERR_NOT_SUPPORTED if it's not possible to transfer this fd.
+zx_status_t launchpad_clone_fd(launchpad_t* lp, int fd, int target_fd);
 
 // Attempt to transfer local descriptor fd into target_fd in the
-// new process.  Returns MX_ERR_BAD_HANDLE if fd is not a valid fd,
+// new process.  Returns ZX_ERR_BAD_HANDLE if fd is not a valid fd,
 // ERR_UNAVILABLE if fd has been duplicated or is in use in an
-// io operation, or MX_ERR_NOT_SUPPORTED if it's not possible to transfer
+// io operation, or ZX_ERR_NOT_SUPPORTED if it's not possible to transfer
 // this fd.
 // Upon success, from the point of view of the calling process, the fd
 // will appear to have been closed.  The underlying "file" will continue
 // to exist until launch succeeds (and it is transferred) or fails (and
 // it is destroyed).
-mx_status_t launchpad_transfer_fd(launchpad_t* lp, int fd, int target_fd);
+zx_status_t launchpad_transfer_fd(launchpad_t* lp, int fd, int target_fd);
 
 // Attempt to create a pipe and install one end of that pipe as
 // target_fd in the new process and return the other end (if
 // successful) via the fd_out parameter.
-mx_status_t launchpad_add_pipe(launchpad_t* lp, int* fd_out, int target_fd);
+zx_status_t launchpad_add_pipe(launchpad_t* lp, int* fd_out, int target_fd);
 
 
 // ACCESSORS for internal state
@@ -220,11 +220,11 @@
 
 // Fetch the process handle.  The launchpad still owns this handle
 // and callers must not close it or transfer it away.
-mx_handle_t launchpad_get_process_handle(launchpad_t* lp);
+zx_handle_t launchpad_get_process_handle(launchpad_t* lp);
 
 // Fetch the process's root VMAR handle.  The launchpad still owns this handle
 // and callers must not close it or transfer it away.
-mx_handle_t launchpad_get_root_vmar_handle(launchpad_t* lp);
+zx_handle_t launchpad_get_root_vmar_handle(launchpad_t* lp);
 
 
 // ADVANCED BINARY LOADING
@@ -240,7 +240,7 @@
 // than a handle, that result is just returned immediately; so this
 // can be passed the result of <launchpad/vmo.h> functions without
 // separate error checking.
-mx_status_t launchpad_elf_load_basic(launchpad_t* lp, mx_handle_t vmo);
+zx_status_t launchpad_elf_load_basic(launchpad_t* lp, zx_handle_t vmo);
 
 // Do general loading of the ELF file image found in a VM object.
 // The interface follows the same rules as launchpad_elf_load_basic.
@@ -250,7 +250,7 @@
 // resulting VM object is loaded instead of the handle passed here,
 // which is instead transferred to the dynamic linker in the
 // bootstrap message.
-mx_status_t launchpad_elf_load(launchpad_t* lp, mx_handle_t vmo);
+zx_status_t launchpad_elf_load(launchpad_t* lp, zx_handle_t vmo);
 
 // Load an extra ELF file image into the process.  This is similar
 // to launchpad_elf_load_basic, but it does not consume the VM
@@ -260,8 +260,8 @@
 // launchpad_start.  Instead, if base is not NULL, it's filled with
 // the address at which the image was loaded; if entry is not NULL,
 // it's filled with the image's entrypoint address.
-mx_status_t launchpad_elf_load_extra(launchpad_t* lp, mx_handle_t vmo,
-                                     mx_vaddr_t* base, mx_vaddr_t* entry);
+zx_status_t launchpad_elf_load_extra(launchpad_t* lp, zx_handle_t vmo,
+                                     zx_vaddr_t* base, zx_vaddr_t* entry);
 
 // Load an executable file into memory. If the file is an ELF file, it
 // will be loaded as per launchpad_elf_load. If it is a script (the
@@ -272,9 +272,9 @@
 // as the first argument to the interpreter, followed by all of the
 // original argv arguments (which includes the script name in argv[0]).
 // The length of the first line of an interpreted script may not exceed
-// 127 characters, or MX_ERR_NOT_FOUND will be returned. If an invalid vmo
-// handle is passed, MX_ERR_INVALID_ARGS will be returned.
-mx_status_t launchpad_file_load(launchpad_t* lp, mx_handle_t vmo);
+// 127 characters, or ZX_ERR_NOT_FOUND will be returned. If an invalid vmo
+// handle is passed, ZX_ERR_INVALID_ARGS will be returned.
+zx_status_t launchpad_file_load(launchpad_t* lp, zx_handle_t vmo);
 
 // The maximum length of the first line of a file that specifies an
 // interpreter, using the #! syntax.
@@ -285,13 +285,13 @@
 
 // Discover the entry-point address after a successful call to
 // launchpad_elf_load or launchpad_elf_load_basic.  This can be used
-// in mx_process_start directly rather than calling launchpad_start,
+// in zx_process_start directly rather than calling launchpad_start,
 // to bypass sending the standard startup message.
-mx_status_t launchpad_get_entry_address(launchpad_t* lp, mx_vaddr_t* entry);
+zx_status_t launchpad_get_entry_address(launchpad_t* lp, zx_vaddr_t* entry);
 
 // Return the base address after a successful call to
 // launchpad_elf_load or launchpad_elf_load_basic.
-mx_status_t launchpad_get_base_address(launchpad_t* lp, mx_vaddr_t* base);
+zx_status_t launchpad_get_base_address(launchpad_t* lp, zx_vaddr_t* base);
 
 // Set the flag saying whether to send an initial bootstrap message
 // for the dynamic linker, and return the old value of the flag.
@@ -307,41 +307,41 @@
 // linker.  This consumes the handle passed, and returns the old
 // handle (passing ownership of it to the caller).  If no handle has
 // been explicitly specified when launchpad_elf_load encounters a
-// PT_INTERP header, it will launch mxio_loader_service and install
+// PT_INTERP header, it will launch fdio_loader_service and install
 // that handle (after using it to look up the PT_INTERP string).
-mx_handle_t launchpad_use_loader_service(launchpad_t* lp, mx_handle_t svc);
+zx_handle_t launchpad_use_loader_service(launchpad_t* lp, zx_handle_t svc);
 
 // This duplicates the globally-held VM object handle for the system
-// vDSO.  The return value is that of mx_handle_duplicate.  If
+// vDSO.  The return value is that of zx_handle_duplicate.  If
 // launchpad_set_vdso_vmo has been called with a valid handle, this
 // just duplicates the handle passed in the last call.  Otherwise,
 // the first time the system vDSO is needed it's fetched with
-// mx_get_startup_handle.
-mx_status_t launchpad_get_vdso_vmo(mx_handle_t* out);
+// zx_get_startup_handle.
+zx_status_t launchpad_get_vdso_vmo(zx_handle_t* out);
 
 // Replace the globally-held VM object handle for the system vDSO.
 // This takes ownership of the given handle, and returns the old
 // handle, of which the caller takes ownership.  It does not check
-// the handle for validity.  If MX_HANDLE_INVALID is passed here,
+// the handle for validity.  If ZX_HANDLE_INVALID is passed here,
 // then the next time the system vDSO is needed it will be fetched
-// with mx_get_startup_handle as if it were the first time.  If
+// with zx_get_startup_handle as if it were the first time.  If
 // the system vDSO has not been needed before this call, then the
-// return value will be MX_HANDLE_INVALID.
-mx_handle_t launchpad_set_vdso_vmo(mx_handle_t vmo);
+// return value will be ZX_HANDLE_INVALID.
+zx_handle_t launchpad_set_vdso_vmo(zx_handle_t vmo);
 
 // Add the VM object handle for the system vDSO to the launchpad, so
 // the launched process will be able to load it into its own
 // children.  This is just shorthand for launchpad_add_handle with
 // the handle returned by launchpad_get_vdso_vmo.
-mx_status_t launchpad_add_vdso_vmo(launchpad_t* lp);
+zx_status_t launchpad_add_vdso_vmo(launchpad_t* lp);
 
 // Load the system vDSO into the launchpad's nascent process.  The
-// given handle is not consumed.  If given MX_HANDLE_INVALID, this
+// given handle is not consumed.  If given ZX_HANDLE_INVALID, this
 // uses the VM object that launchpad_get_vdso_vmo would return
 // instead.  This just calls launchpad_elf_load_extra to do the
 // loading, and records the vDSO's base address for launchpad_start
 // to pass to the new process's initial thread.
-mx_status_t launchpad_load_vdso(launchpad_t* lp, mx_handle_t vmo);
+zx_status_t launchpad_load_vdso(launchpad_t* lp, zx_handle_t vmo);
 
 // Set the size of the initial thread's stack, and return the old setting.
 // The initial setting after launchpad_create is a system default.
@@ -365,7 +365,7 @@
 // process, so on failure the loader-service handle might or might
 // not have been cleared and the handles to transfer might or might
 // not have been cleared.
-mx_handle_t launchpad_start(launchpad_t* lp);
+zx_handle_t launchpad_start(launchpad_t* lp);
 
 // Start a new thread in the process, assuming this was a launchpad
 // created with launchpad_create_with_process and the process has
@@ -376,8 +376,8 @@
 // handle.  The other end of this channel must already be
 // present in the target process, with the given handle value in the
 // target process's handle space.
-mx_status_t launchpad_start_injected(launchpad_t* lp, const char* thread_name,
-                                     mx_handle_t to_child,
+zx_status_t launchpad_start_injected(launchpad_t* lp, const char* thread_name,
+                                     zx_handle_t to_child,
                                      uintptr_t bootstrap_handle_in_child);
 
 
diff --git a/system/ulib/launchpad/include/launchpad/loader-service.h b/system/ulib/launchpad/include/launchpad/loader-service.h
index c859a61..cf1c93d 100644
--- a/system/ulib/launchpad/include/launchpad/loader-service.h
+++ b/system/ulib/launchpad/include/launchpad/loader-service.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/types.h>
-#include <magenta/compiler.h>
+#include <zircon/types.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
@@ -26,22 +26,22 @@
 
 // Type of the hook for loader_service.  The first argument is
 // the one passed to loader_service_simple(), and the second specifies
-// which load service was requested (the opcode from mx_loader_svc_msg_t).
+// which load service was requested (the opcode from zx_loader_svc_msg_t).
 // The remaining arguments' meaning depends on the opcode.
-typedef mx_status_t (*loader_service_fn_t)(void* loader_arg, uint32_t load_cmd,
-                                           mx_handle_t request_handle, const char* file,
-                                           mx_handle_t* out);
+typedef zx_status_t (*loader_service_fn_t)(void* loader_arg, uint32_t load_cmd,
+                                           zx_handle_t request_handle, const char* file,
+                                           zx_handle_t* out);
 
 
 // Obtain a handle to the system loader service, if possible
-mx_status_t loader_service_get_system(mx_handle_t* out);
+zx_status_t loader_service_get_system(zx_handle_t* out);
 
 // Obtain the default loader service for this process
 // Normally it attempts to use the system loader service, and
 // if that fails attempts to create a process-local service
 // (which depends on the process having filesystem access
 // to executables and libraries needing loading)
-mx_status_t loader_service_get_default(mx_handle_t* out);
+zx_status_t loader_service_get_default(zx_handle_t* out);
 
 // After this function returns, loader_service_get_default will no
 // longer attempt to use the system loader service for the current
@@ -51,42 +51,42 @@
 
 // Create a simple single-threaded loader service, which
 // will use the provided service_fn to process load commands
-mx_status_t loader_service_simple(loader_service_fn_t loader,
-                                  void* loader_arg, mx_handle_t* out);
+zx_status_t loader_service_simple(loader_service_fn_t loader,
+                                  void* loader_arg, zx_handle_t* out);
 
 
 typedef struct loader_service loader_service_t;
 
 // Create a new file-system backed loader service capable of handling
 // any number of clients.
-mx_status_t loader_service_create_fs(const char* name, loader_service_t** out);
+zx_status_t loader_service_create_fs(const char* name, loader_service_t** out);
 
 // Returns a new dl_set_loader_service-compatible loader service channel.
-mx_status_t loader_service_connect(loader_service_t* svc, mx_handle_t* out);
+zx_status_t loader_service_connect(loader_service_t* svc, zx_handle_t* out);
 
 // Same as connect except caller provides the channel endpoint (which
 // is connected on success, closed on failure)
-mx_status_t loader_service_attach(loader_service_t* svc, mx_handle_t channel);
+zx_status_t loader_service_attach(loader_service_t* svc, zx_handle_t channel);
 
 typedef struct loader_service_ops {
     // attempt to load a DSO from suitable library paths
-    mx_status_t (*load_object)(void* ctx, const char* name, mx_handle_t* vmo);
+    zx_status_t (*load_object)(void* ctx, const char* name, zx_handle_t* vmo);
 
     // attempt to load a script interpreter or debug config file
-    mx_status_t (*load_abspath)(void* ctx, const char* path, mx_handle_t* vmo);
+    zx_status_t (*load_abspath)(void* ctx, const char* path, zx_handle_t* vmo);
 
     // attempt to publish a data sink
     // takes ownership of the provided vmo on both success and failure
-    mx_status_t (*publish_data_sink)(void* ctx, const char* name, mx_handle_t vmo);
+    zx_status_t (*publish_data_sink)(void* ctx, const char* name, zx_handle_t vmo);
 } loader_service_ops_t;
 
 // Create a loader service backed by custom loader ops
-mx_status_t loader_service_create(const char* name,
+zx_status_t loader_service_create(const char* name,
                                   const loader_service_ops_t* ops, void* ctx,
                                   loader_service_t** out);
 
 // the default publish_data_sink implementation, which publishes
 // into /tmp, provided the fs there supports such publishing
-mx_status_t loader_service_publish_data_sink_fs(const char* name, mx_handle_t vmo);
+zx_status_t loader_service_publish_data_sink_fs(const char* name, zx_handle_t vmo);
 
 __END_CDECLS
diff --git a/system/ulib/launchpad/include/launchpad/vmo.h b/system/ulib/launchpad/include/launchpad/vmo.h
index cbd0a4f..9716ea2 100644
--- a/system/ulib/launchpad/include/launchpad/vmo.h
+++ b/system/ulib/launchpad/include/launchpad/vmo.h
@@ -4,15 +4,15 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <stddef.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
-// This functions MX_ERR_IO to indicate an error in the POSIXish
+// This functions ZX_ERR_IO to indicate an error in the POSIXish
 // underlying calls, meaning errno has been set with a POSIX-style error.
-// Other errors are verbatim from the mx_vm_object_* calls.
-mx_status_t launchpad_vmo_from_file(const char* filename, mx_handle_t* out);
+// Other errors are verbatim from the zx_vm_object_* calls.
+zx_status_t launchpad_vmo_from_file(const char* filename, zx_handle_t* out);
 
 __END_CDECLS
diff --git a/system/ulib/launchpad/launchpad.c b/system/ulib/launchpad/launchpad.c
index 6e8d84a..f4ef5f4 100644
--- a/system/ulib/launchpad/launchpad.c
+++ b/system/ulib/launchpad/launchpad.c
@@ -6,13 +6,13 @@
 #include <launchpad/vmo.h>
 #include "elf.h"
 
-#include <magenta/assert.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/stack.h>
-#include <magenta/syscalls.h>
+#include <zircon/assert.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/stack.h>
+#include <zircon/syscalls.h>
 #include <launchpad/loader-service.h>
-#include <mxio/io.h>
+#include <fdio/io.h>
 #include <assert.h>
 #include <stdatomic.h>
 #include <stdbool.h>
@@ -48,25 +48,25 @@
     char* script_args;
     size_t script_args_len;
 
-    mx_handle_t* handles;
+    zx_handle_t* handles;
     uint32_t* handles_info;
     size_t handle_count;
     size_t handle_alloc;
 
     const char* errmsg;
-    mx_status_t error;
+    zx_status_t error;
 
-    mx_vaddr_t entry;
-    mx_vaddr_t base;
-    mx_vaddr_t vdso_base;
+    zx_vaddr_t entry;
+    zx_vaddr_t base;
+    zx_vaddr_t vdso_base;
 
     size_t stack_size;
     bool set_stack_size;
 
-    mx_handle_t special_handles[HND_SPECIAL_COUNT];
+    zx_handle_t special_handles[HND_SPECIAL_COUNT];
     bool loader_message;
 
-    mx_handle_t reserve_vmar;
+    zx_handle_t reserve_vmar;
     bool fresh_process;
 };
 
@@ -75,23 +75,23 @@
 // which will discard the handles, etc, etc.
 static launchpad_t invalid_launchpad = {
     .errmsg = "create: could not allocate launchpad_t",
-    .error = MX_ERR_NO_MEMORY,
+    .error = ZX_ERR_NO_MEMORY,
 };
 
-static mx_status_t lp_error(launchpad_t* lp, mx_status_t error, const char* msg) {
-    if (lp->error == MX_OK) {
+static zx_status_t lp_error(launchpad_t* lp, zx_status_t error, const char* msg) {
+    if (lp->error == ZX_OK) {
         lp->error = error;
         lp->errmsg = msg;
     }
     return lp->error;
 }
 
-mx_status_t launchpad_get_status(launchpad_t* lp) {
+zx_status_t launchpad_get_status(launchpad_t* lp) {
     return lp->error;
 }
 
-void launchpad_abort(launchpad_t* lp, mx_status_t error, const char* msg) {
-    lp_error(lp, (error < 0) ? error : MX_ERR_INTERNAL, msg);
+void launchpad_abort(launchpad_t* lp, zx_status_t error, const char* msg) {
+    lp_error(lp, (error < 0) ? error : ZX_ERR_INTERNAL, msg);
 }
 
 const char* launchpad_error_message(launchpad_t* lp) {
@@ -104,10 +104,10 @@
 // We always install the vmar handle as the second in the message.
 #define lp_vmar(lp) ((lp)->handles[1])
 
-static void close_handles(mx_handle_t* handles, size_t count) {
+static void close_handles(zx_handle_t* handles, size_t count) {
     for (size_t i = 0; i < count; ++i) {
-        if (handles[i] != MX_HANDLE_INVALID) {
-            mx_handle_close(handles[i]);
+        if (handles[i] != ZX_HANDLE_INVALID) {
+            zx_handle_close(handles[i]);
         }
     }
 }
@@ -126,8 +126,8 @@
     free(lp);
 }
 
-mx_status_t launchpad_create_with_process(mx_handle_t proc,
-                                          mx_handle_t vmar,
+zx_status_t launchpad_create_with_process(zx_handle_t proc,
+                                          zx_handle_t vmar,
                                           launchpad_t** result) {
     launchpad_t* lp = calloc(1, sizeof(*lp));
     if (lp == NULL) {
@@ -136,15 +136,15 @@
         lp->errmsg = "no error";
     }
 
-    if (launchpad_add_handle(lp, proc, PA_PROC_SELF) == MX_OK) {
+    if (launchpad_add_handle(lp, proc, PA_PROC_SELF) == ZX_OK) {
         // If the process has an existing vDSO mapping, record it for
         // use by launchpad_start_extra.
-        mx_status_t status = mx_object_get_property(
-            proc, MX_PROP_PROCESS_VDSO_BASE_ADDRESS,
+        zx_status_t status = zx_object_get_property(
+            proc, ZX_PROP_PROCESS_VDSO_BASE_ADDRESS,
             &lp->vdso_base, sizeof(lp->vdso_base));
-        if (status != MX_OK)
+        if (status != ZX_OK)
             lp_error(lp, status,
-                     "create: cannot get MX_PROP_PROCESS_VDSO_BASE_ADDRESS");
+                     "create: cannot get ZX_PROP_PROCESS_VDSO_BASE_ADDRESS");
     }
     launchpad_add_handle(lp, vmar, PA_VMAR_ROOT);
 
@@ -153,22 +153,22 @@
 }
 
 // Create a new process and a launchpad that will set it up.
-mx_status_t launchpad_create_with_jobs(mx_handle_t creation_job, mx_handle_t transferred_job,
+zx_status_t launchpad_create_with_jobs(zx_handle_t creation_job, zx_handle_t transferred_job,
                                        const char* name, launchpad_t** result) {
     uint32_t name_len = strlen(name);
 
-    mx_handle_t proc = MX_HANDLE_INVALID;
-    mx_handle_t vmar = MX_HANDLE_INVALID;
-    mx_status_t status = mx_process_create(creation_job, name, name_len, 0, &proc, &vmar);
+    zx_handle_t proc = ZX_HANDLE_INVALID;
+    zx_handle_t vmar = ZX_HANDLE_INVALID;
+    zx_status_t status = zx_process_create(creation_job, name, name_len, 0, &proc, &vmar);
 
     launchpad_t* lp;
-    if (launchpad_create_with_process(proc, vmar, &lp) == MX_OK)
+    if (launchpad_create_with_process(proc, vmar, &lp) == ZX_OK)
         lp->fresh_process = true;
 
     if (status < 0)
-        lp_error(lp, status, "create: mx_process_create() failed");
+        lp_error(lp, status, "create: zx_process_create() failed");
 
-    if (transferred_job != MX_HANDLE_INVALID) {
+    if (transferred_job != ZX_HANDLE_INVALID) {
         launchpad_add_handle(lp, transferred_job, PA_JOB_DEFAULT);
     }
 
@@ -176,30 +176,30 @@
     return lp->error;
 }
 
-mx_status_t launchpad_create(mx_handle_t job,
+zx_status_t launchpad_create(zx_handle_t job,
                              const char* name, launchpad_t** result) {
-    if (job == MX_HANDLE_INVALID)
-        job = mx_job_default();
-    mx_handle_t xjob = MX_HANDLE_INVALID;
-    mx_handle_duplicate(job, MX_RIGHT_SAME_RIGHTS, &xjob);
+    if (job == ZX_HANDLE_INVALID)
+        job = zx_job_default();
+    zx_handle_t xjob = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(job, ZX_RIGHT_SAME_RIGHTS, &xjob);
     return launchpad_create_with_jobs(job, xjob, name, result);
 }
 
-mx_handle_t launchpad_get_process_handle(launchpad_t* lp) {
+zx_handle_t launchpad_get_process_handle(launchpad_t* lp) {
     return lp_proc(lp);
 }
 
-mx_handle_t launchpad_get_root_vmar_handle(launchpad_t* lp) {
+zx_handle_t launchpad_get_root_vmar_handle(launchpad_t* lp) {
     return lp_vmar(lp);
 }
 
-static mx_status_t build_stringtable(launchpad_t* lp,
+static zx_status_t build_stringtable(launchpad_t* lp,
                                     int count, const char* const* item,
                                     size_t* total_out, char** out) {
     if (lp->error)
         return lp->error;
     if (count < 0)
-        return lp_error(lp, MX_ERR_INVALID_ARGS, "negative string array count");
+        return lp_error(lp, ZX_ERR_INVALID_ARGS, "negative string array count");
 
     size_t total = 0;
     for (int i = 0; i < count; ++i)
@@ -209,7 +209,7 @@
     if (total > 0) {
         buffer = malloc(total);
         if (buffer == NULL)
-            return lp_error(lp, MX_ERR_NO_MEMORY, "out of memory for string array");
+            return lp_error(lp, ZX_ERR_NO_MEMORY, "out of memory for string array");
 
         char* p = buffer;
         for (int i = 0; i < count; ++i)
@@ -218,20 +218,20 @@
         if ((size_t) (p - buffer) != total) {
             // The strings changed in parallel.  Not kosher!
             free(buffer);
-            return lp_error(lp, MX_ERR_INVALID_ARGS, "string array modified during use");
+            return lp_error(lp, ZX_ERR_INVALID_ARGS, "string array modified during use");
         }
     }
 
     *total_out = total;
     *out = buffer;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t launchpad_set_args(launchpad_t* lp,
+zx_status_t launchpad_set_args(launchpad_t* lp,
                                int argc, const char* const* argv) {
     size_t total;
     char* buffer;
-    mx_status_t r = build_stringtable(lp, argc, argv, &total, &buffer);
+    zx_status_t r = build_stringtable(lp, argc, argv, &total, &buffer);
     if (r < 0)
         return r;
 
@@ -239,14 +239,14 @@
     lp->argc = argc;
     lp->args = buffer;
     lp->args_len = total;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t launchpad_set_nametable(launchpad_t* lp,
+zx_status_t launchpad_set_nametable(launchpad_t* lp,
                                     size_t count, const char* const* names) {
     size_t total;
     char* buffer;
-    mx_status_t r = build_stringtable(lp, count, names, &total, &buffer);
+    zx_status_t r = build_stringtable(lp, count, names, &total, &buffer);
     if (r < 0)
         return r;
 
@@ -254,10 +254,10 @@
     lp->namec = count;
     lp->names = buffer;
     lp->names_len = total;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t launchpad_set_environ(launchpad_t* lp, const char* const* envp) {
+zx_status_t launchpad_set_environ(launchpad_t* lp, const char* const* envp) {
     uint32_t count = 0;
     if (envp != NULL) {
         for (const char* const* ep = envp; *ep != NULL; ++ep) {
@@ -267,7 +267,7 @@
 
     size_t total;
     char* buffer;
-    mx_status_t r = build_stringtable(lp, count, envp, &total, &buffer);
+    zx_status_t r = build_stringtable(lp, count, envp, &total, &buffer);
     if (r < 0)
         return r;
 
@@ -275,87 +275,87 @@
     lp->envc = count;
     lp->env = buffer;
     lp->env_len = total;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t more_handles(launchpad_t* lp, size_t n) {
+static zx_status_t more_handles(launchpad_t* lp, size_t n) {
     if (lp->error)
         return lp->error;
 
     if (lp->handle_alloc - lp->handle_count < n) {
         size_t alloc = lp->handle_alloc == 0 ? 8 : lp->handle_alloc * 2;
-        mx_handle_t* handles = realloc(lp->handles,
+        zx_handle_t* handles = realloc(lp->handles,
                                        alloc * sizeof(handles[0]));
         if (handles == NULL)
-            return lp_error(lp, MX_ERR_NO_MEMORY, "out of memory for handle table");
+            return lp_error(lp, ZX_ERR_NO_MEMORY, "out of memory for handle table");
         lp->handles = handles;
         uint32_t* info = realloc(lp->handles_info, alloc * sizeof(info[0]));
         if (info == NULL)
-            return lp_error(lp, MX_ERR_NO_MEMORY, "out of memory for handle table");
+            return lp_error(lp, ZX_ERR_NO_MEMORY, "out of memory for handle table");
         lp->handles_info = info;
         lp->handle_alloc = alloc;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t launchpad_add_handle(launchpad_t* lp, mx_handle_t h, uint32_t id) {
-    if (h == MX_HANDLE_INVALID)
-        return lp_error(lp, MX_ERR_BAD_HANDLE, "added invalid handle");
-    mx_status_t status = more_handles(lp, 1);
-    if (status == MX_OK) {
+zx_status_t launchpad_add_handle(launchpad_t* lp, zx_handle_t h, uint32_t id) {
+    if (h == ZX_HANDLE_INVALID)
+        return lp_error(lp, ZX_ERR_BAD_HANDLE, "added invalid handle");
+    zx_status_t status = more_handles(lp, 1);
+    if (status == ZX_OK) {
         lp->handles[lp->handle_count] = h;
         lp->handles_info[lp->handle_count] = id;
         ++lp->handle_count;
     } else {
-        mx_handle_close(h);
+        zx_handle_close(h);
     }
     return status;
 }
 
-mx_status_t launchpad_add_handles(launchpad_t* lp, size_t n,
-                                  const mx_handle_t h[],
+zx_status_t launchpad_add_handles(launchpad_t* lp, size_t n,
+                                  const zx_handle_t h[],
                                   const uint32_t id[]) {
-    mx_status_t status = more_handles(lp, n);
-    if (status == MX_OK) {
+    zx_status_t status = more_handles(lp, n);
+    if (status == ZX_OK) {
         memcpy(&lp->handles[lp->handle_count], h, n * sizeof(h[0]));
         memcpy(&lp->handles_info[lp->handle_count], id, n * sizeof(id[0]));
         lp->handle_count += n;
         for (size_t i = 0; i < n; i++) {
-            if (h[i] == MX_HANDLE_INVALID) {
-                return lp_error(lp, MX_ERR_BAD_HANDLE, "added invalid handle");
+            if (h[i] == ZX_HANDLE_INVALID) {
+                return lp_error(lp, ZX_ERR_BAD_HANDLE, "added invalid handle");
             }
         }
     } else {
         for (size_t i = 0; i < n; i++) {
-            mx_handle_close(h[i]);
+            zx_handle_close(h[i]);
         }
     }
     return status;
 }
 
-//TODO: use transfer_fd here and eliminate mxio_pipe_half()
-mx_status_t launchpad_add_pipe(launchpad_t* lp, int* fd_out, int target_fd) {
-    mx_handle_t handle;
+//TODO: use transfer_fd here and eliminate fdio_pipe_half()
+zx_status_t launchpad_add_pipe(launchpad_t* lp, int* fd_out, int target_fd) {
+    zx_handle_t handle;
     uint32_t id;
     int fd;
 
     if (lp->error)
         return lp->error;
-    if ((target_fd < 0) || (target_fd >= MAX_MXIO_FD)) {
-        return lp_error(lp, MX_ERR_INVALID_ARGS, "add_pipe: invalid target fd");
+    if ((target_fd < 0) || (target_fd >= MAX_FDIO_FD)) {
+        return lp_error(lp, ZX_ERR_INVALID_ARGS, "add_pipe: invalid target fd");
     }
-    mx_status_t status;
-    if ((status = mxio_pipe_half(&handle, &id)) < 0) {
+    zx_status_t status;
+    if ((status = fdio_pipe_half(&handle, &id)) < 0) {
         return lp_error(lp, status, "add_pipe: failed to create pipe");
     }
     fd = status;
     if ((status = launchpad_add_handle(lp, handle, PA_HND(PA_HND_TYPE(id), target_fd))) < 0) {
         close(fd);
-        mx_handle_close(handle);
+        zx_handle_close(handle);
         return status;
     }
     *fd_out = fd;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void check_elf_stack_size(launchpad_t* lp, elf_load_info_t* elf) {
@@ -364,43 +364,43 @@
         launchpad_set_stack_size(lp, elf_stack_size);
 }
 
-mx_status_t launchpad_elf_load_basic(launchpad_t* lp, mx_handle_t vmo) {
+zx_status_t launchpad_elf_load_basic(launchpad_t* lp, zx_handle_t vmo) {
     if (INVALID_HANDLE(vmo))
-        return lp_error(lp, MX_ERR_INVALID_ARGS, "elf_load: invalid vmo");
+        return lp_error(lp, ZX_ERR_INVALID_ARGS, "elf_load: invalid vmo");
     if (lp->error)
         goto done;
 
     elf_load_info_t* elf;
-    mx_status_t status;
+    zx_status_t status;
     if ((status = elf_load_start(vmo, NULL, 0, &elf)))
         lp_error(lp, status, "elf_load: elf_load_start() failed");
-    mx_handle_t segments_vmar;
+    zx_handle_t segments_vmar;
     if ((status = elf_load_finish(lp_vmar(lp), elf, vmo,
                                   &segments_vmar, &lp->base, &lp->entry)))
         lp_error(lp, status, "elf_load: elf_load_finish() failed");
     check_elf_stack_size(lp, elf);
     elf_load_destroy(elf);
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         lp->loader_message = false;
         launchpad_add_handle(lp, segments_vmar,
                              PA_HND(PA_VMAR_LOADED, 0));
     }
 
 done:
-    mx_handle_close(vmo);
+    zx_handle_close(vmo);
     return lp->error;
 }
 
-mx_status_t launchpad_elf_load_extra(launchpad_t* lp, mx_handle_t vmo,
-                                     mx_vaddr_t* base, mx_vaddr_t* entry) {
+zx_status_t launchpad_elf_load_extra(launchpad_t* lp, zx_handle_t vmo,
+                                     zx_vaddr_t* base, zx_vaddr_t* entry) {
     if (lp->error)
         return lp->error;
     if (INVALID_HANDLE(vmo))
-        return lp_error(lp, MX_ERR_INVALID_ARGS, "elf_load_extra: invalid vmo");
+        return lp_error(lp, ZX_ERR_INVALID_ARGS, "elf_load_extra: invalid vmo");
 
     elf_load_info_t* elf;
-    mx_status_t status;
+    zx_status_t status;
     if ((status = elf_load_start(vmo, NULL, 0, &elf)))
         lp_error(lp, status, "elf_load_extra: elf_load_start() failed");
     if ((status = elf_load_finish(lp_vmar(lp), elf, vmo, NULL, base, entry)))
@@ -412,17 +412,17 @@
 
 #define LOADER_SVC_MSG_MAX 1024
 
-static mx_status_t loader_svc_rpc(mx_handle_t loader_svc, uint32_t opcode,
-                                  const void* data, size_t len, mx_handle_t* out) {
-    static _Atomic mx_txid_t next_txid;
+static zx_status_t loader_svc_rpc(zx_handle_t loader_svc, uint32_t opcode,
+                                  const void* data, size_t len, zx_handle_t* out) {
+    static _Atomic zx_txid_t next_txid;
 
     struct {
-        mx_loader_svc_msg_t header;
-        uint8_t data[LOADER_SVC_MSG_MAX - sizeof(mx_loader_svc_msg_t)];
+        zx_loader_svc_msg_t header;
+        uint8_t data[LOADER_SVC_MSG_MAX - sizeof(zx_loader_svc_msg_t)];
     } msg;
 
     if (len >= sizeof(msg.data))
-        return MX_ERR_BUFFER_TOO_SMALL;
+        return ZX_ERR_BUFFER_TOO_SMALL;
 
     memset(&msg.header, 0, sizeof(msg.header));
     msg.header.txid = atomic_fetch_add(&next_txid, 1);
@@ -430,8 +430,8 @@
     memcpy(msg.data, data, len);
     msg.data[len] = 0;
 
-    mx_handle_t handle = MX_HANDLE_INVALID;
-    const mx_channel_call_args_t call = {
+    zx_handle_t handle = ZX_HANDLE_INVALID;
+    const zx_channel_call_args_t call = {
         .wr_bytes = &msg,
         .wr_num_bytes = sizeof(msg.header) + len + 1,
         .rd_bytes = &msg,
@@ -441,46 +441,46 @@
     };
     uint32_t reply_size;
     uint32_t handle_count;
-    mx_status_t read_status = MX_OK;
-    mx_status_t status = mx_channel_call(loader_svc, 0, MX_TIME_INFINITE,
+    zx_status_t read_status = ZX_OK;
+    zx_status_t status = zx_channel_call(loader_svc, 0, ZX_TIME_INFINITE,
                                          &call, &reply_size, &handle_count,
                                          &read_status);
-    if (status != MX_OK) {
-        return status == MX_ERR_CALL_FAILED ? read_status : status;
+    if (status != ZX_OK) {
+        return status == ZX_ERR_CALL_FAILED ? read_status : status;
     }
 
     // Check for protocol violations.
     if (reply_size != sizeof(msg.header)) {
     protocol_violation:
-        mx_handle_close(handle);
-        return MX_ERR_BAD_STATE;
+        zx_handle_close(handle);
+        return ZX_ERR_BAD_STATE;
     }
     if (msg.header.opcode != LOADER_SVC_OP_STATUS)
         goto protocol_violation;
 
-    if (msg.header.arg != MX_OK) {
-        if (handle != MX_HANDLE_INVALID)
+    if (msg.header.arg != ZX_OK) {
+        if (handle != ZX_HANDLE_INVALID)
             goto protocol_violation;
         if (msg.header.arg > 0)
             goto protocol_violation;
-        *out = MX_HANDLE_INVALID;
+        *out = ZX_HANDLE_INVALID;
     } else {
-        *out = handle_count ? handle : MX_HANDLE_INVALID;
+        *out = handle_count ? handle : ZX_HANDLE_INVALID;
     }
     return msg.header.arg;
 }
 
-static mx_status_t setup_loader_svc(launchpad_t* lp) {
-    if (lp->special_handles[HND_LOADER_SVC] != MX_HANDLE_INVALID)
-        return MX_OK;
+static zx_status_t setup_loader_svc(launchpad_t* lp) {
+    if (lp->special_handles[HND_LOADER_SVC] != ZX_HANDLE_INVALID)
+        return ZX_OK;
 
-    mx_handle_t loader_svc;
-    mx_status_t status = loader_service_get_default(&loader_svc);
+    zx_handle_t loader_svc;
+    zx_status_t status = loader_service_get_default(&loader_svc);
     if (status < 0)
         return status;
 
     lp->special_handles[HND_LOADER_SVC] = loader_svc;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Reserve roughly the low half of the address space, so the new
@@ -490,49 +490,49 @@
 // allocating the initial stack) stay out of this area, and then destroyed.
 // The process's own allocations can then use the full address space; if
 // it's using a sanitizer, it will set up its shadow memory first thing.
-static mx_status_t reserve_low_address_space(launchpad_t* lp) {
-    if (lp->reserve_vmar != MX_HANDLE_INVALID)
-        return MX_OK;
+static zx_status_t reserve_low_address_space(launchpad_t* lp) {
+    if (lp->reserve_vmar != ZX_HANDLE_INVALID)
+        return ZX_OK;
 
-    mx_info_vmar_t info;
-    mx_status_t status = mx_object_get_info(lp_vmar(lp), MX_INFO_VMAR,
+    zx_info_vmar_t info;
+    zx_status_t status = zx_object_get_info(lp_vmar(lp), ZX_INFO_VMAR,
                                             &info, sizeof(info), NULL, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return lp_error(lp, status,
-                        "mx_object_get_info failed on child root VMAR handle");
+                        "zx_object_get_info failed on child root VMAR handle");
     }
 
     uintptr_t addr;
     size_t reserve_size =
         (((info.base + info.len) / 2) + PAGE_SIZE - 1) & -PAGE_SIZE;
-    status = mx_vmar_allocate(lp_vmar(lp), 0, reserve_size - info.base,
-                              MX_VM_FLAG_SPECIFIC, &lp->reserve_vmar, &addr);
-    if (status != MX_OK) {
+    status = zx_vmar_allocate(lp_vmar(lp), 0, reserve_size - info.base,
+                              ZX_VM_FLAG_SPECIFIC, &lp->reserve_vmar, &addr);
+    if (status != ZX_OK) {
         return lp_error(
             lp, status,
-            "mx_vmar_allocate failed for low address space reservation");
+            "zx_vmar_allocate failed for low address space reservation");
     }
 
     if (addr != info.base) {
-        return lp_error(lp, MX_ERR_BAD_STATE,
-                        "mx_vmar_allocate gave wrong address?!?");
+        return lp_error(lp, ZX_ERR_BAD_STATE,
+                        "zx_vmar_allocate gave wrong address?!?");
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 // Consumes 'vmo' on success, not on failure.
-static mx_status_t handle_interp(launchpad_t* lp, mx_handle_t vmo,
+static zx_status_t handle_interp(launchpad_t* lp, zx_handle_t vmo,
                                  const char* interp, size_t interp_len) {
-    mx_status_t status = setup_loader_svc(lp);
-    if (status != MX_OK)
+    zx_status_t status = setup_loader_svc(lp);
+    if (status != ZX_OK)
         return status;
 
-    mx_handle_t interp_vmo;
+    zx_handle_t interp_vmo;
     status = loader_svc_rpc(
         lp->special_handles[HND_LOADER_SVC], LOADER_SVC_OP_LOAD_OBJECT,
         interp, interp_len, &interp_vmo);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     if (lp->fresh_process) {
@@ -540,26 +540,26 @@
         // supports sanitizers, so in that case (the most common case)
         // keep the mappings launchpad makes out of the low address region.
         status = reserve_low_address_space(lp);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
     }
 
     elf_load_info_t* elf;
-    mx_handle_t segments_vmar;
+    zx_handle_t segments_vmar;
     status = elf_load_start(interp_vmo, NULL, 0, &elf);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         status = elf_load_finish(lp_vmar(lp), elf, interp_vmo,
                                  &segments_vmar, &lp->base, &lp->entry);
         elf_load_destroy(elf);
     }
-    mx_handle_close(interp_vmo);
+    zx_handle_close(interp_vmo);
 
-    if (status == MX_OK) {
-        if (lp->special_handles[HND_EXEC_VMO] != MX_HANDLE_INVALID)
-            mx_handle_close(lp->special_handles[HND_EXEC_VMO]);
+    if (status == ZX_OK) {
+        if (lp->special_handles[HND_EXEC_VMO] != ZX_HANDLE_INVALID)
+            zx_handle_close(lp->special_handles[HND_EXEC_VMO]);
         lp->special_handles[HND_EXEC_VMO] = vmo;
-        if (lp->special_handles[HND_SEGMENTS_VMAR] != MX_HANDLE_INVALID)
-            mx_handle_close(lp->special_handles[HND_SEGMENTS_VMAR]);
+        if (lp->special_handles[HND_SEGMENTS_VMAR] != ZX_HANDLE_INVALID)
+            zx_handle_close(lp->special_handles[HND_SEGMENTS_VMAR]);
         lp->special_handles[HND_SEGMENTS_VMAR] = segments_vmar;
         lp->loader_message = true;
     }
@@ -567,27 +567,27 @@
     return status;
 }
 
-static mx_status_t launchpad_elf_load_body(launchpad_t* lp, const char* hdr_buf,
-                                           size_t buf_sz, mx_handle_t vmo) {
+static zx_status_t launchpad_elf_load_body(launchpad_t* lp, const char* hdr_buf,
+                                           size_t buf_sz, zx_handle_t vmo) {
     elf_load_info_t* elf;
-    mx_status_t status;
+    zx_status_t status;
 
     if (lp->error)
         goto done;
-    if ((status = elf_load_start(vmo, hdr_buf, buf_sz, &elf)) != MX_OK) {
+    if ((status = elf_load_start(vmo, hdr_buf, buf_sz, &elf)) != ZX_OK) {
         lp_error(lp, status, "elf_load: elf_load_start() failed");
     } else {
         char* interp;
         size_t interp_len;
         status = elf_load_get_interp(elf, vmo, &interp, &interp_len);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             lp_error(lp, status, "elf_load: get_interp() failed");
         } else {
             if (interp == NULL) {
-                mx_handle_t segments_vmar;
+                zx_handle_t segments_vmar;
                 status = elf_load_finish(lp_vmar(lp), elf, vmo, &segments_vmar,
                                          &lp->base, &lp->entry);
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     lp_error(lp, status, "elf_load: elf_load_finish() failed");
                 } else {
                     // With no PT_INTERP, we obey PT_GNU_STACK.p_memsz for
@@ -604,7 +604,7 @@
                     lp_error(lp, status, "elf_load: handle_interp failed");
                 } else {
                     // handle_interp() takes ownership of vmo on success
-                    vmo = MX_HANDLE_INVALID;
+                    vmo = ZX_HANDLE_INVALID;
                 }
                 free(interp);
             }
@@ -613,14 +613,14 @@
     }
 done:
     if (vmo)
-        mx_handle_close(vmo);
+        zx_handle_close(vmo);
     return lp->error;
 }
 
 // Find the starting point of the interpreter and the interpreter
 // arguments in a #! script header. Note that the input buffer (line)
 // will be modified to add a NULL after the interpreter name.
-static mx_status_t parse_interp_spec(char *line, char **interp_start,
+static zx_status_t parse_interp_spec(char *line, char **interp_start,
                                      size_t *interp_len, char **args_start)
 {
     *args_start = NULL;
@@ -633,7 +633,7 @@
 
     // No interpreter specified
     if (*next_char == '\0')
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     *interp_start = next_char;
 
@@ -642,7 +642,7 @@
     *interp_len = next_char - *interp_start;
 
     if (*next_char == '\0')
-        return MX_OK;
+        return ZX_OK;
 
     *next_char++ = '\0';
 
@@ -650,15 +650,15 @@
     next_char += strspn(next_char, " \t");
 
     if (*next_char == '\0')
-        return MX_OK;
+        return ZX_OK;
 
     *args_start = next_char;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t launchpad_file_load(launchpad_t* lp, mx_handle_t vmo) {
+zx_status_t launchpad_file_load(launchpad_t* lp, zx_handle_t vmo) {
     if (INVALID_HANDLE(vmo))
-        return lp_error(lp, MX_ERR_INVALID_ARGS, "file_load: invalid vmo");
+        return lp_error(lp, ZX_ERR_INVALID_ARGS, "file_load: invalid vmo");
 
     if (lp->script_args != NULL) {
         free(lp->script_args);
@@ -668,30 +668,30 @@
     lp->num_script_args = 0;
 
     size_t script_nest_level = 0;
-    mx_status_t status;
+    zx_status_t status;
     char first_line[LP_MAX_INTERP_LINE_LEN + 1];
     size_t chars_read;
 
     while (1) {
         // Read enough to get the interpreter specification of a script
-        status = mx_vmo_read(vmo, first_line, 0, sizeof(first_line),
+        status = zx_vmo_read(vmo, first_line, 0, sizeof(first_line),
                              &chars_read);
 
         // This is not a script -- load as an ELF file
-        if ((status == MX_OK)
+        if ((status == ZX_OK)
             && (chars_read < 2 || first_line[0] != '#' || first_line[1] != '!'))
             break;
 
-        mx_handle_close(vmo);
+        zx_handle_close(vmo);
 
-        if (status != MX_OK)
-            return lp_error(lp, status, "file_load: mx_vmo_read() failed");
+        if (status != ZX_OK)
+            return lp_error(lp, status, "file_load: zx_vmo_read() failed");
 
         script_nest_level++;
 
         // No point trying to read an interpreter we're not going to consider
         if (script_nest_level > LP_MAX_SCRIPT_NEST_LEVEL)
-            return lp_error(lp, MX_ERR_NOT_SUPPORTED,
+            return lp_error(lp, ZX_ERR_NOT_SUPPORTED,
                             "file_load: too many levels of script indirection");
 
         // Normalize the line so that it is NULL-terminated
@@ -699,7 +699,7 @@
         if (newline_pos)
             *newline_pos = '\0';
         else if (chars_read == sizeof(first_line))
-            return lp_error(lp, MX_ERR_OUT_OF_RANGE,
+            return lp_error(lp, ZX_ERR_OUT_OF_RANGE,
                             "file_load: first line of script too long");
         else
             first_line[chars_read] = '\0';
@@ -709,7 +709,7 @@
         char* args_start;
         status = parse_interp_spec(first_line, &interp_start, &interp_len,
                                    &args_start);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return lp_error(lp, status,
                             "file_load: failed to parse interpreter spec");
 
@@ -721,7 +721,7 @@
             new_args_len += args_len + 1;
         char *new_buf = malloc(new_args_len + lp->script_args_len);
         if (new_buf == NULL)
-            return lp_error(lp, MX_ERR_NO_MEMORY, "file_load: out of memory");
+            return lp_error(lp, ZX_ERR_NO_MEMORY, "file_load: out of memory");
 
         memcpy(new_buf, interp_start, interp_len + 1);
         lp->num_script_args++;
@@ -742,33 +742,33 @@
 
         // Load the interpreter into memory
         status = setup_loader_svc(lp);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return lp_error(lp, status, "file_load: setup_loader_svc() failed");
 
         status = loader_svc_rpc(lp->special_handles[HND_LOADER_SVC],
                              LOADER_SVC_OP_LOAD_SCRIPT_INTERP,
                              interp_start, interp_len, &vmo);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return lp_error(lp, status, "file_load: loader_svc_rpc() failed");
     }
 
     // Finally, load the interpreter itself
     status = launchpad_elf_load_body(lp, first_line, chars_read, vmo);
 
-    if (status != MX_OK)
+    if (status != ZX_OK)
         lp_error(lp, status, "file_load: failed to load ELF file");
 
     return status;
 }
 
-mx_status_t launchpad_elf_load(launchpad_t* lp, mx_handle_t vmo) {
+zx_status_t launchpad_elf_load(launchpad_t* lp, zx_handle_t vmo) {
     if (INVALID_HANDLE(vmo))
-        return lp_error(lp, MX_ERR_INVALID_ARGS, "elf_load: invalid vmo");
+        return lp_error(lp, ZX_ERR_INVALID_ARGS, "elf_load: invalid vmo");
 
     return launchpad_elf_load_body(lp, NULL, 0, vmo);
 }
 
-static mx_handle_t vdso_vmo = MX_HANDLE_INVALID;
+static zx_handle_t vdso_vmo = ZX_HANDLE_INVALID;
 static mtx_t vdso_mutex = MTX_INIT;
 static void vdso_lock(void) {
     mtx_lock(&vdso_mutex);
@@ -776,62 +776,62 @@
 static void vdso_unlock(void) {
     mtx_unlock(&vdso_mutex);
 }
-static mx_handle_t vdso_get_vmo(void) {
-    if (vdso_vmo == MX_HANDLE_INVALID)
-        vdso_vmo = mx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0));
+static zx_handle_t vdso_get_vmo(void) {
+    if (vdso_vmo == ZX_HANDLE_INVALID)
+        vdso_vmo = zx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0));
     return vdso_vmo;
 }
 
-mx_status_t launchpad_get_vdso_vmo(mx_handle_t* out) {
+zx_status_t launchpad_get_vdso_vmo(zx_handle_t* out) {
     vdso_lock();
-    mx_status_t status = mx_handle_duplicate(vdso_get_vmo(),
-                                             MX_RIGHT_SAME_RIGHTS, out);
+    zx_status_t status = zx_handle_duplicate(vdso_get_vmo(),
+                                             ZX_RIGHT_SAME_RIGHTS, out);
     vdso_unlock();
     return status;
 }
 
-mx_handle_t launchpad_set_vdso_vmo(mx_handle_t new_vdso_vmo) {
+zx_handle_t launchpad_set_vdso_vmo(zx_handle_t new_vdso_vmo) {
     vdso_lock();
-    mx_handle_t old = vdso_vmo;
+    zx_handle_t old = vdso_vmo;
     vdso_vmo = new_vdso_vmo;
     vdso_unlock();
     return old;
 }
 
-mx_status_t launchpad_add_vdso_vmo(launchpad_t* lp) {
+zx_status_t launchpad_add_vdso_vmo(launchpad_t* lp) {
     if (lp->error)
         return lp->error;
-    mx_handle_t vdso;
-    mx_status_t status;
-    if ((status = launchpad_get_vdso_vmo(&vdso)) != MX_OK)
+    zx_handle_t vdso;
+    zx_status_t status;
+    if ((status = launchpad_get_vdso_vmo(&vdso)) != ZX_OK)
         return lp_error(lp, status, "add_vdso_vmo: get_vdso_vmo failed");
     // Takes ownership of 'vdso'.
     return launchpad_add_handle(lp, vdso, PA_HND(PA_VMO_VDSO, 0));
 }
 
-mx_status_t launchpad_load_vdso(launchpad_t* lp, mx_handle_t vmo) {
-    if (vmo != MX_HANDLE_INVALID)
+zx_status_t launchpad_load_vdso(launchpad_t* lp, zx_handle_t vmo) {
+    if (vmo != ZX_HANDLE_INVALID)
         return launchpad_elf_load_extra(lp, vmo, &lp->vdso_base, NULL);
     vdso_lock();
     vmo = vdso_get_vmo();
-    mx_status_t status = launchpad_elf_load_extra(lp, vmo,
+    zx_status_t status = launchpad_elf_load_extra(lp, vmo,
                                                   &lp->vdso_base, NULL);
     vdso_unlock();
     return status;
 }
 
-mx_status_t launchpad_get_entry_address(launchpad_t* lp, mx_vaddr_t* entry) {
+zx_status_t launchpad_get_entry_address(launchpad_t* lp, zx_vaddr_t* entry) {
     if (lp->entry == 0)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     *entry = lp->entry;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t launchpad_get_base_address(launchpad_t* lp, mx_vaddr_t* base) {
+zx_status_t launchpad_get_base_address(launchpad_t* lp, zx_vaddr_t* base) {
     if (lp->base == 0)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
     *base = lp->base;
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool launchpad_send_loader_message(launchpad_t* lp, bool do_send) {
@@ -841,12 +841,12 @@
     return result;
 }
 
-mx_handle_t launchpad_use_loader_service(launchpad_t* lp, mx_handle_t svc) {
+zx_handle_t launchpad_use_loader_service(launchpad_t* lp, zx_handle_t svc) {
     if (lp->error) {
-        mx_handle_close(svc);
+        zx_handle_close(svc);
         return lp->error;
     }
-    mx_handle_t result = lp->special_handles[HND_LOADER_SVC];
+    zx_handle_t result = lp->special_handles[HND_LOADER_SVC];
     lp->special_handles[HND_LOADER_SVC] = svc;
     return result;
 }
@@ -856,12 +856,12 @@
 // by the caller.
 // TODO(mcgrathr): One day we'll have a gather variant of message_write
 // and then we can send this without copying into a temporary buffer.
-static mx_status_t build_message(launchpad_t* lp, size_t num_handles,
+static zx_status_t build_message(launchpad_t* lp, size_t num_handles,
                                  void** msg_buf, size_t* buf_size,
                                  bool with_names) {
 
-    size_t msg_size = sizeof(mx_proc_args_t);
-    static_assert(sizeof(mx_proc_args_t) % sizeof(uint32_t) == 0,
+    size_t msg_size = sizeof(zx_proc_args_t);
+    static_assert(sizeof(zx_proc_args_t) % sizeof(uint32_t) == 0,
                   "handles misaligned in load message");
     msg_size += sizeof(uint32_t) * num_handles;
     msg_size += lp->script_args_len;
@@ -870,13 +870,13 @@
     msg_size += lp->names_len;
     void* msg = malloc(msg_size);
     if (msg == NULL)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    mx_proc_args_t* header = msg;
+    zx_proc_args_t* header = msg;
 
     memset(header, 0, sizeof(*header));
-    header->protocol = MX_PROCARGS_PROTOCOL;
-    header->version = MX_PROCARGS_VERSION;
+    header->protocol = ZX_PROCARGS_PROTOCOL;
+    header->version = ZX_PROCARGS_VERSION;
     header->handle_info_off = sizeof(*header);
 
     // Include the argument strings so the dynamic linker can use argv[0]
@@ -910,28 +910,28 @@
 
     *msg_buf = msg;
     *buf_size = msg_size;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t send_loader_message(launchpad_t* lp,
-                                       mx_handle_t first_thread,
-                                       mx_handle_t tochannel) {
+static zx_status_t send_loader_message(launchpad_t* lp,
+                                       zx_handle_t first_thread,
+                                       zx_handle_t tochannel) {
     void* msg;
     size_t msg_size;
     size_t num_handles = HND_SPECIAL_COUNT + HND_LOADER_COUNT;
 
-    mx_status_t status = build_message(lp, num_handles, &msg, &msg_size, false);
-    if (status != MX_OK)
+    zx_status_t status = build_message(lp, num_handles, &msg, &msg_size, false);
+    if (status != ZX_OK)
         return status;
 
-    mx_proc_args_t* header = msg;
+    zx_proc_args_t* header = msg;
     uint32_t* msg_handle_info;
     msg_handle_info = (uint32_t*) ((uint8_t*)msg + header->handle_info_off);
 
     // This loop should be completely unrolled.  But using a switch here
     // gives us compiler warnings if we forget to handle any of the special
     // types listed in the enum.
-    mx_handle_t handles[HND_SPECIAL_COUNT + HND_LOADER_COUNT];
+    zx_handle_t handles[HND_SPECIAL_COUNT + HND_LOADER_COUNT];
     size_t nhandles = 0;
     for (enum special_handles i = 0; i <= HND_SPECIAL_COUNT; ++i) {
         uint32_t id = 0; // -Wall
@@ -939,24 +939,24 @@
         case HND_SPECIAL_COUNT:;
             // Duplicate the handles for the loader so we can send them in the
             // loader message and still have them later.
-            mx_handle_t proc;
-            status = mx_handle_duplicate(lp_proc(lp), MX_RIGHT_SAME_RIGHTS, &proc);
-            if (status != MX_OK) {
+            zx_handle_t proc;
+            status = zx_handle_duplicate(lp_proc(lp), ZX_RIGHT_SAME_RIGHTS, &proc);
+            if (status != ZX_OK) {
                 free(msg);
                 return status;
             }
-            mx_handle_t vmar;
-            status = mx_handle_duplicate(lp_vmar(lp), MX_RIGHT_SAME_RIGHTS, &vmar);
-            if (status != MX_OK) {
-                mx_handle_close(proc);
+            zx_handle_t vmar;
+            status = zx_handle_duplicate(lp_vmar(lp), ZX_RIGHT_SAME_RIGHTS, &vmar);
+            if (status != ZX_OK) {
+                zx_handle_close(proc);
                 free(msg);
                 return status;
             }
-            mx_handle_t thread;
-            status = mx_handle_duplicate(first_thread, MX_RIGHT_SAME_RIGHTS, &thread);
-            if (status != MX_OK) {
-                mx_handle_close(proc);
-                mx_handle_close(vmar);
+            zx_handle_t thread;
+            status = zx_handle_duplicate(first_thread, ZX_RIGHT_SAME_RIGHTS, &thread);
+            if (status != ZX_OK) {
+                zx_handle_close(proc);
+                zx_handle_close(vmar);
                 free(msg);
                 return status;
             }
@@ -981,24 +981,24 @@
             id = PA_VMAR_LOADED;
             break;
         }
-        if (lp->special_handles[i] != MX_HANDLE_INVALID) {
+        if (lp->special_handles[i] != ZX_HANDLE_INVALID) {
             handles[nhandles] = lp->special_handles[i];
             msg_handle_info[nhandles] = id;
             ++nhandles;
         }
     }
 
-    status = mx_channel_write(tochannel, 0, msg, msg_size, handles, nhandles);
-    if (status == MX_OK) {
+    status = zx_channel_write(tochannel, 0, msg, msg_size, handles, nhandles);
+    if (status == ZX_OK) {
         // message_write consumed all those handles.
         for (enum special_handles i = 0; i < HND_SPECIAL_COUNT; ++i)
-            lp->special_handles[i] = MX_HANDLE_INVALID;
+            lp->special_handles[i] = ZX_HANDLE_INVALID;
         lp->loader_message = false;
     } else {
         // Close the handles we duplicated for the loader.
         // The others remain live in the launchpad.
         for (int i = 1; i <= HND_LOADER_COUNT; i++) {
-          mx_handle_close(handles[nhandles - i]);
+          zx_handle_close(handles[nhandles - i]);
         }
     }
 
@@ -1016,36 +1016,36 @@
         // Round up to page size.
         new_size = (new_size + PAGE_SIZE - 1) & -PAGE_SIZE;
     }
-    if (lp->error == MX_OK) {
+    if (lp->error == ZX_OK) {
         lp->stack_size = new_size;
         lp->set_stack_size = true;
     }
     return old_size;
 }
 
-static mx_status_t prepare_start(launchpad_t* lp, const char* thread_name,
-                                 mx_handle_t to_child,
-                                 mx_handle_t* thread, uintptr_t* sp) {
+static zx_status_t prepare_start(launchpad_t* lp, const char* thread_name,
+                                 zx_handle_t to_child,
+                                 zx_handle_t* thread, uintptr_t* sp) {
     if (lp->entry == 0)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
-    mx_status_t status = mx_thread_create(lp_proc(lp), thread_name,
+    zx_status_t status = zx_thread_create(lp_proc(lp), thread_name,
                                           strlen(thread_name), 0, thread);
     if (status < 0) {
         return lp_error(lp, status, "cannot create initial thread");
     } else {
         // Pass the thread handle down to the child.  The handle we pass
         // will be consumed by message_write.  So we need a duplicate to
-        // pass to mx_process_start later.
-        mx_handle_t thread_copy;
-        status = mx_handle_duplicate(*thread, MX_RIGHT_SAME_RIGHTS, &thread_copy);
+        // pass to zx_process_start later.
+        zx_handle_t thread_copy;
+        status = zx_handle_duplicate(*thread, ZX_RIGHT_SAME_RIGHTS, &thread_copy);
         if (status < 0) {
-            mx_handle_close(*thread);
+            zx_handle_close(*thread);
             return lp_error(lp, status, "cannot duplicate thread handle");
         }
         status = launchpad_add_handle(lp, thread_copy, PA_THREAD_SELF);
-        if (status != MX_OK) {
-            mx_handle_close(*thread);
+        if (status != ZX_OK) {
+            zx_handle_close(*thread);
             return status;
         }
     }
@@ -1053,8 +1053,8 @@
     bool sent_loader_message = lp->loader_message;
     if (lp->loader_message) {
         status = send_loader_message(lp, *thread, to_child);
-        if (status != MX_OK) {
-            mx_handle_close(*thread);
+        if (status != ZX_OK) {
+            zx_handle_close(*thread);
             return lp_error(lp, status, "failed to send loader message");
         }
     }
@@ -1065,11 +1065,11 @@
     size_t size;
 
     if (build_message(lp, lp->handle_count + (allocate_stack ? 1 : 0),
-                      &msg, &size, true) != MX_OK) {
-        mx_handle_close(*thread);
-        return lp_error(lp, MX_ERR_NO_MEMORY, "out of memory assembling procargs message");
+                      &msg, &size, true) != ZX_OK) {
+        zx_handle_close(*thread);
+        return lp_error(lp, ZX_ERR_NO_MEMORY, "out of memory assembling procargs message");
     }
-    mx_proc_args_t* header = msg;
+    zx_proc_args_t* header = msg;
     uint32_t* next_handle = mempcpy((uint8_t*)msg + header->handle_info_off,
                                     lp->handles_info,
                                     lp->handle_count * sizeof(lp->handles_info[0]));
@@ -1077,7 +1077,7 @@
         *next_handle = PA_VMO_STACK;
 
     // Figure out how big an initial thread to allocate.
-    char stack_vmo_name[MX_MAX_NAME_LEN];
+    char stack_vmo_name[ZX_MAX_NAME_LEN];
     size_t stack_size;
     if (sent_loader_message && !lp->set_stack_size) {
         // The initial stack will be used just for startup work and to
@@ -1094,7 +1094,7 @@
     } else {
         // Use the requested or default size.
         stack_size =
-            lp->set_stack_size ? lp->stack_size : MAGENTA_DEFAULT_STACK_SIZE;
+            lp->set_stack_size ? lp->stack_size : ZIRCON_DEFAULT_STACK_SIZE;
         snprintf(stack_vmo_name, sizeof(stack_vmo_name), "stack: %s %#zx",
                  lp->set_stack_size ? "explicit" : "default", stack_size);
 
@@ -1105,8 +1105,8 @@
         // environment strings that are unreasonably large).
         if (stack_size > 0 && size > stack_size / 2) {
             free(msg);
-            mx_handle_close(*thread);
-            return lp_error(lp, MX_ERR_BUFFER_TOO_SMALL,
+            zx_handle_close(*thread);
+            return lp_error(lp, ZX_ERR_BUFFER_TOO_SMALL,
                             "procargs message is too large");
         }
     }
@@ -1114,21 +1114,21 @@
     *sp = 0;
     if (stack_size > 0) {
         // Allocate the initial thread's stack.
-        mx_handle_t stack_vmo;
-        mx_status_t status = mx_vmo_create(stack_size, 0, &stack_vmo);
-        if (status != MX_OK) {
+        zx_handle_t stack_vmo;
+        zx_status_t status = zx_vmo_create(stack_size, 0, &stack_vmo);
+        if (status != ZX_OK) {
             free(msg);
-            mx_handle_close(*thread);
+            zx_handle_close(*thread);
             return lp_error(lp, status, "cannot create stack vmo");
         }
-        mx_object_set_property(stack_vmo, MX_PROP_NAME,
+        zx_object_set_property(stack_vmo, ZX_PROP_NAME,
                                stack_vmo_name, strlen(stack_vmo_name));
-        mx_vaddr_t stack_base;
-        status = mx_vmar_map(lp_vmar(lp), 0, stack_vmo, 0, stack_size,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+        zx_vaddr_t stack_base;
+        status = zx_vmar_map(lp_vmar(lp), 0, stack_vmo, 0, stack_size,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                               &stack_base);
-        if (status == MX_OK) {
-            MX_DEBUG_ASSERT(stack_size % PAGE_SIZE == 0);
+        if (status == ZX_OK) {
+            ZX_DEBUG_ASSERT(stack_size % PAGE_SIZE == 0);
             *sp = compute_initial_stack_pointer(stack_base, stack_size);
             // Pass the stack VMO to the process.  Our protocol with the
             // new process is that we warrant that this is the VMO from
@@ -1143,121 +1143,121 @@
             // final handle will correspond to that slot.
             status = launchpad_add_handle(lp, stack_vmo, PA_VMO_STACK);
         }
-        if (status != MX_OK) {
-            mx_handle_close(stack_vmo);
-            mx_handle_close(*thread);
+        if (status != ZX_OK) {
+            zx_handle_close(stack_vmo);
+            zx_handle_close(*thread);
             free(msg);
             return lp_error(lp, status, "cannot map stack vmo");
         }
     }
 
-    if (lp->reserve_vmar != MX_HANDLE_INVALID) {
+    if (lp->reserve_vmar != ZX_HANDLE_INVALID) {
         // We're done doing mappings, so clear out the reservation VMAR.
-        status = mx_vmar_destroy(lp->reserve_vmar);
-        if (status != MX_OK) {
+        status = zx_vmar_destroy(lp->reserve_vmar);
+        if (status != ZX_OK) {
             return lp_error(lp, status, "\
-mx_vmar_destroy failed on low address space reservation VMAR");
+zx_vmar_destroy failed on low address space reservation VMAR");
         }
-        status = mx_handle_close(lp->reserve_vmar);
-        if (status != MX_OK) {
+        status = zx_handle_close(lp->reserve_vmar);
+        if (status != ZX_OK) {
             return lp_error(lp, status, "\
-mx_handle_close failed on low address space reservation VMAR");
+zx_handle_close failed on low address space reservation VMAR");
         }
-        lp->reserve_vmar = MX_HANDLE_INVALID;
+        lp->reserve_vmar = ZX_HANDLE_INVALID;
     }
 
-    status = mx_channel_write(to_child, 0, msg, size,
+    status = zx_channel_write(to_child, 0, msg, size,
                               lp->handles, lp->handle_count);
     free(msg);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         // message_write consumed all the handles.
         for (size_t i = 0; i < lp->handle_count; ++i)
-            lp->handles[i] = MX_HANDLE_INVALID;
+            lp->handles[i] = ZX_HANDLE_INVALID;
         lp->handle_count = 0;
     } else {
-        mx_handle_close(*thread);
+        zx_handle_close(*thread);
         return lp_error(lp, status, "failed to write procargs message");
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_handle_t launchpad_start(launchpad_t* lp) {
+zx_handle_t launchpad_start(launchpad_t* lp) {
     if (lp->error)
         return lp->error;
 
     // The proc handle in lp->handles[0] will be consumed by message_write.
     // So we'll need a duplicate to do process operations later.
-    mx_handle_t proc;
-    mx_status_t status = mx_handle_duplicate(lp_proc(lp), MX_RIGHT_SAME_RIGHTS, &proc);
+    zx_handle_t proc;
+    zx_status_t status = zx_handle_duplicate(lp_proc(lp), ZX_RIGHT_SAME_RIGHTS, &proc);
     if (status < 0)
         return lp_error(lp, status, "start: cannot duplicate process handle");
 
-    mx_handle_t channelh[2];
-    status = mx_channel_create(0, channelh, channelh + 1);
-    if (status != MX_OK) {
-        mx_handle_close(proc);
+    zx_handle_t channelh[2];
+    status = zx_channel_create(0, channelh, channelh + 1);
+    if (status != ZX_OK) {
+        zx_handle_close(proc);
         return lp_error(lp, status, "start: cannot create channel");
     }
-    mx_handle_t to_child = channelh[0];
-    mx_handle_t child_bootstrap = channelh[1];
+    zx_handle_t to_child = channelh[0];
+    zx_handle_t child_bootstrap = channelh[1];
 
-    mx_handle_t thread;
+    zx_handle_t thread;
     uintptr_t sp;
     status = prepare_start(lp, "initial-thread", to_child, &thread, &sp);
-    mx_handle_close(to_child);
-    if (status != MX_OK) {
+    zx_handle_close(to_child);
+    if (status != ZX_OK) {
         lp_error(lp, status, "start: prepare_start() failed");
     } else {
-        status = mx_process_start(proc, thread, lp->entry, sp,
+        status = zx_process_start(proc, thread, lp->entry, sp,
                                   child_bootstrap, lp->vdso_base);
-        if (status != MX_OK)
-            lp_error(lp, status, "start: mx_process_start() failed");
-        mx_handle_close(thread);
+        if (status != ZX_OK)
+            lp_error(lp, status, "start: zx_process_start() failed");
+        zx_handle_close(thread);
     }
     // process_start consumed child_bootstrap if successful.
-    if (status == MX_OK)
+    if (status == ZX_OK)
         return proc;
 
-    mx_handle_close(proc);
-    mx_handle_close(child_bootstrap);
+    zx_handle_close(proc);
+    zx_handle_close(child_bootstrap);
     return status;
 }
 
-mx_status_t launchpad_start_injected(launchpad_t* lp, const char* thread_name,
-                                     mx_handle_t to_child,
+zx_status_t launchpad_start_injected(launchpad_t* lp, const char* thread_name,
+                                     zx_handle_t to_child,
                                      uintptr_t bootstrap_handle_in_child) {
     if (lp->error)
         return lp->error;
 
-    mx_handle_t thread;
+    zx_handle_t thread;
     uintptr_t sp;
-    mx_status_t status = prepare_start(lp, thread_name, to_child,
+    zx_status_t status = prepare_start(lp, thread_name, to_child,
                                        &thread, &sp);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         lp_error(lp, status, "start_injected: prepare_start() failed");
     } else {
-        status = mx_thread_start(thread, lp->entry, sp,
+        status = zx_thread_start(thread, lp->entry, sp,
                                  bootstrap_handle_in_child, lp->vdso_base);
-        if (status != MX_OK) {
-            lp_error(lp, status, "start_injected: mx_thread_start() failed");
+        if (status != ZX_OK) {
+            lp_error(lp, status, "start_injected: zx_thread_start() failed");
         }
-        mx_handle_close(thread);
+        zx_handle_close(thread);
     }
     return status;
 }
 
-mx_status_t launchpad_go(launchpad_t* lp, mx_handle_t* proc, const char** errmsg) {
-    mx_handle_t h = launchpad_start(lp);
+zx_status_t launchpad_go(launchpad_t* lp, zx_handle_t* proc, const char** errmsg) {
+    zx_handle_t h = launchpad_start(lp);
     if (errmsg)
         *errmsg = lp->errmsg;
     if (h > 0) {
         if (proc) {
             *proc = h;
         } else {
-            mx_handle_close(h);
+            zx_handle_close(h);
         }
-        h = MX_OK;
+        h = ZX_OK;
     }
     launchpad_destroy(lp);
     return h;
@@ -1265,32 +1265,32 @@
 
 #include <launchpad/vmo.h>
 
-static mx_status_t launchpad_file_load_with_vdso(launchpad_t* lp, mx_handle_t vmo) {
+static zx_status_t launchpad_file_load_with_vdso(launchpad_t* lp, zx_handle_t vmo) {
     launchpad_file_load(lp, vmo);
-    launchpad_load_vdso(lp, MX_HANDLE_INVALID);
+    launchpad_load_vdso(lp, ZX_HANDLE_INVALID);
     return launchpad_add_vdso_vmo(lp);
 }
 
-mx_status_t launchpad_load_from_file(launchpad_t* lp, const char* path) {
-    mx_handle_t vmo;
-    mx_status_t status = launchpad_vmo_from_file(path, &vmo);
-    if (status == MX_OK) {
+zx_status_t launchpad_load_from_file(launchpad_t* lp, const char* path) {
+    zx_handle_t vmo;
+    zx_status_t status = launchpad_vmo_from_file(path, &vmo);
+    if (status == ZX_OK) {
         return launchpad_file_load_with_vdso(lp, vmo);
     } else {
         return status;
     }
 }
 
-mx_status_t launchpad_load_from_fd(launchpad_t* lp, int fd) {
-    mx_handle_t vmo;
-    mx_status_t status = mxio_get_vmo(fd, &vmo);
-    if (status == MX_OK) {
+zx_status_t launchpad_load_from_fd(launchpad_t* lp, int fd) {
+    zx_handle_t vmo;
+    zx_status_t status = fdio_get_vmo(fd, &vmo);
+    if (status == ZX_OK) {
         return launchpad_file_load_with_vdso(lp, vmo);
     } else {
         return status;
     }
 }
 
-mx_status_t launchpad_load_from_vmo(launchpad_t* lp, mx_handle_t vmo) {
+zx_status_t launchpad_load_from_vmo(launchpad_t* lp, zx_handle_t vmo) {
     return launchpad_file_load_with_vdso(lp, vmo);
 }
diff --git a/system/ulib/launchpad/loader-service.c b/system/ulib/launchpad/loader-service.c
index 35b0526..9bfd2e5 100644
--- a/system/ulib/launchpad/loader-service.c
+++ b/system/ulib/launchpad/loader-service.c
@@ -4,9 +4,9 @@
 
 #include <launchpad/loader-service.h>
 
-#include <mxio/debug.h>
-#include <mxio/dispatcher.h>
-#include <mxio/io.h>
+#include <fdio/debug.h>
+#include <fdio/dispatcher.h>
+#include <fdio/io.h>
 
 #include <errno.h>
 #include <fcntl.h>
@@ -21,16 +21,16 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/device/dmctl.h>
-#include <magenta/device/vfs.h>
-#include <magenta/processargs.h>
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
-#include <magenta/threads.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/device/dmctl.h>
+#include <zircon/device/vfs.h>
+#include <zircon/processargs.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/threads.h>
+#include <zircon/types.h>
 
-static void __PRINTFLIKE(2, 3) log_printf(mx_handle_t log,
+static void __PRINTFLIKE(2, 3) log_printf(zx_handle_t log,
                                           const char* fmt, ...) {
     if (log <= 0)
         return;
@@ -44,16 +44,16 @@
     if (len < 0)
         return;
     len = (len > (int)sizeof(buf)) ? (int)sizeof(buf) : len;
-    mx_log_write(log, len, buf, 0u);
+    zx_log_write(log, len, buf, 0u);
 }
 
 #define PREFIX_MAX 32
 
 struct loader_service {
-    char name[MX_MAX_NAME_LEN];
+    char name[ZX_MAX_NAME_LEN];
     mtx_t dispatcher_lock;
-    mxio_dispatcher_t* dispatcher;
-    mx_handle_t dispatcher_log;
+    fdio_dispatcher_t* dispatcher;
+    zx_handle_t dispatcher_log;
 
     const loader_service_ops_t* ops;
     void* ctx;
@@ -67,24 +67,24 @@
     "/boot/lib",
 };
 
-mx_status_t loader_service_publish_data_sink_fs(const char* sink_name, mx_handle_t vmo) {
+zx_status_t loader_service_publish_data_sink_fs(const char* sink_name, zx_handle_t vmo) {
     union {
         vmo_create_config_t header;
         struct {
             alignas(vmo_create_config_t) char h[sizeof(vmo_create_config_t)];
-            char name[MX_MAX_NAME_LEN];
+            char name[ZX_MAX_NAME_LEN];
         };
     } config;
 
-    mx_status_t status = mx_object_get_property(
-        vmo, MX_PROP_NAME, config.name, sizeof(config.name));
-    if (status != MX_OK)
+    zx_status_t status = zx_object_get_property(
+        vmo, ZX_PROP_NAME, config.name, sizeof(config.name));
+    if (status != ZX_OK)
         return status;
     if (config.name[0] == '\0') {
-        mx_info_handle_basic_t info;
-        status = mx_object_get_info(vmo, MX_INFO_HANDLE_BASIC,
+        zx_info_handle_basic_t info;
+        status = zx_object_get_info(vmo, ZX_INFO_HANDLE_BASIC,
                                     &info, sizeof(info), NULL, NULL);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return status;
         snprintf(config.name, sizeof(config.name), "unnamed.%" PRIu64,
                  info.koid);
@@ -95,15 +95,15 @@
         fprintf(stderr, "dlsvc: cannot open /tmp for data-sink \"%s\": %m\n",
                 sink_name);
         close(tmp_dir_fd);
-        mx_handle_close(vmo);
-        return MX_ERR_NOT_FOUND;
+        zx_handle_close(vmo);
+        return ZX_ERR_NOT_FOUND;
     }
     if (mkdirat(tmp_dir_fd, sink_name, 0777) != 0 && errno != EEXIST) {
         fprintf(stderr, "dlsvc: cannot mkdir \"/tmp/%s\" for data-sink: %m\n",
                 sink_name);
         close(tmp_dir_fd);
-        mx_handle_close(vmo);
-        return MX_ERR_NOT_FOUND;
+        zx_handle_close(vmo);
+        return ZX_ERR_NOT_FOUND;
     }
     int sink_dir_fd = openat(tmp_dir_fd, sink_name, O_RDONLY | O_DIRECTORY);
     close(tmp_dir_fd);
@@ -111,8 +111,8 @@
         fprintf(stderr,
                 "dlsvc: cannot open data-sink directory \"/tmp/%s\": %m\n",
                 sink_name);
-        mx_handle_close(vmo);
-        return MX_ERR_NOT_FOUND;
+        zx_handle_close(vmo);
+        return ZX_ERR_NOT_FOUND;
     }
 
     config.header.vmo = vmo;
@@ -125,10 +125,10 @@
         fprintf(stderr,
                 "dlsvc: ioctl_vfs_vmo_create failed"
                 " for data-sink \"%s\" item \"%s\": %s\n",
-                sink_name, config.name, mx_status_get_string(result));
+                sink_name, config.name, zx_status_get_string(result));
         return result;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 
@@ -144,31 +144,31 @@
 }
 
 // Always consumes the fd.
-static mx_handle_t load_object_fd(int fd, const char* fn, mx_handle_t* out) {
-    mx_status_t status = mxio_get_vmo(fd, out);
+static zx_handle_t load_object_fd(int fd, const char* fn, zx_handle_t* out) {
+    zx_status_t status = fdio_get_vmo(fd, out);
     close(fd);
-    if (status == MX_OK)
-        mx_object_set_property(*out, MX_PROP_NAME, fn, strlen(fn));
+    if (status == ZX_OK)
+        zx_object_set_property(*out, ZX_PROP_NAME, fn, strlen(fn));
     return status;
 }
 
-static mx_status_t fs_load_object(void *ctx, const char* name, mx_handle_t* out) {
+static zx_status_t fs_load_object(void *ctx, const char* name, zx_handle_t* out) {
     int fd = open_from_libpath(name);
     if (fd >= 0)
         return load_object_fd(fd, name, out);
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
-static mx_status_t fs_load_abspath(void *ctx, const char* path, mx_handle_t* out) {
+static zx_status_t fs_load_abspath(void *ctx, const char* path, zx_handle_t* out) {
     int fd = open(path, O_RDONLY);
     if (fd >= 0)
         return load_object_fd(fd, path, out);
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
 // For now, just publish data-sink VMOs as files under /tmp/<sink-name>/.
 // The individual file is named by its VMO's name.
-static mx_status_t fs_publish_data_sink(void* ctx, const char* name, mx_handle_t vmo) {
+static zx_status_t fs_publish_data_sink(void* ctx, const char* name, zx_handle_t vmo) {
     return loader_service_publish_data_sink_fs(name, vmo);
 }
 
@@ -178,18 +178,18 @@
     .publish_data_sink = fs_publish_data_sink,
 };
 
-static mx_status_t default_load_fn(void* cookie, uint32_t load_op,
-                                   mx_handle_t request_handle,
-                                   const char* fn, mx_handle_t* out) {
+static zx_status_t default_load_fn(void* cookie, uint32_t load_op,
+                                   zx_handle_t request_handle,
+                                   const char* fn, zx_handle_t* out) {
     loader_service_t* svc = cookie;
-    mx_status_t status;
+    zx_status_t status;
 
     switch (load_op) {
     case LOADER_SVC_OP_CONFIG: {
         size_t len = strlen(fn);
         if (len < 2 || len >= sizeof(svc->config_prefix) - 1 ||
             strchr(fn, '/') != NULL) {
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             break;
         }
         strncpy(svc->config_prefix, fn, len + 1);
@@ -200,7 +200,7 @@
         }
         svc->config_prefix[len] = '/';
         svc->config_prefix[len + 1] = '\0';
-        status = MX_OK;
+        status = ZX_OK;
         break;
     }
     case LOADER_SVC_OP_LOAD_OBJECT:
@@ -209,7 +209,7 @@
             size_t maxlen = PREFIX_MAX + strlen(fn) + 1;
             char pfn[maxlen];
             snprintf(pfn, maxlen, "%s%s", svc->config_prefix, fn);
-            if (((status = svc->ops->load_object(svc->ctx, pfn, out)) == MX_OK) ||
+            if (((status = svc->ops->load_object(svc->ctx, pfn, out)) == ZX_OK) ||
                 svc->config_exclusive) {
                 // if loading with prefix succeeds, or loading
                 // with prefix is configured to be exclusive of
@@ -229,26 +229,26 @@
                     load_op == LOADER_SVC_OP_LOAD_SCRIPT_INTERP ?
                     "script interpreter" : "debug config file",
                     fn);
-            return MX_ERR_NOT_FOUND;
+            return ZX_ERR_NOT_FOUND;
         }
         status = svc->ops->load_abspath(svc->ctx, fn, out);
         break;
     case LOADER_SVC_OP_PUBLISH_DATA_SINK:
         status = svc->ops->publish_data_sink(svc->ctx, fn, request_handle);
-        request_handle = MX_HANDLE_INVALID;
+        request_handle = ZX_HANDLE_INVALID;
         break;
     case LOADER_SVC_OP_CLONE:
         status = loader_service_attach(svc, request_handle);
-        request_handle = MX_HANDLE_INVALID;
+        request_handle = ZX_HANDLE_INVALID;
         break;
     default:
         __builtin_trap();
     }
 
-    if (request_handle != MX_HANDLE_INVALID) {
+    if (request_handle != ZX_HANDLE_INVALID) {
         fprintf(stderr, "dlsvc: unused handle (%#x) opcode=%#x data=\"%s\"\n",
                 request_handle, load_op, fn);
-        mx_handle_close(request_handle);
+        zx_handle_close(request_handle);
     }
 
     return status;
@@ -257,39 +257,39 @@
 struct startup {
     loader_service_fn_t loader;
     void* loader_arg;
-    mx_handle_t pipe_handle;
-    mx_handle_t syslog_handle;
+    zx_handle_t pipe_handle;
+    zx_handle_t syslog_handle;
 };
 
-static mx_status_t handle_loader_rpc(mx_handle_t h,
+static zx_status_t handle_loader_rpc(zx_handle_t h,
                                      loader_service_fn_t loader,
-                                     void* loader_arg, mx_handle_t sys_log) {
+                                     void* loader_arg, zx_handle_t sys_log) {
     uint8_t data[1024];
-    mx_loader_svc_msg_t* msg = (void*) data;
+    zx_loader_svc_msg_t* msg = (void*) data;
     uint32_t sz = sizeof(data);
-    mx_handle_t request_handle;
+    zx_handle_t request_handle;
     uint32_t nhandles;
-    mx_status_t r =
-        mx_channel_read(h, 0, msg, &request_handle, sz, 1, &sz, &nhandles);
-    if (r != MX_OK) {
+    zx_status_t r =
+        zx_channel_read(h, 0, msg, &request_handle, sz, 1, &sz, &nhandles);
+    if (r != ZX_OK) {
         // This is the normal error for the other end going away,
         // which happens when the process dies.
-        if (r != MX_ERR_PEER_CLOSED)
-            fprintf(stderr, "dlsvc: msg read error %d: %s\n", r, mx_status_get_string(r));
+        if (r != ZX_ERR_PEER_CLOSED)
+            fprintf(stderr, "dlsvc: msg read error %d: %s\n", r, zx_status_get_string(r));
         return r;
     }
     if (nhandles == 0)
-        request_handle = MX_HANDLE_INVALID;
-    if ((sz <= sizeof(mx_loader_svc_msg_t))) {
-        mx_handle_close(request_handle);
+        request_handle = ZX_HANDLE_INVALID;
+    if ((sz <= sizeof(zx_loader_svc_msg_t))) {
+        zx_handle_close(request_handle);
         fprintf(stderr, "dlsvc: runt message\n");
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
     // forcibly null-terminate the message data argument
     data[sz - 1] = 0;
 
-    mx_handle_t handle = MX_HANDLE_INVALID;
+    zx_handle_t handle = ZX_HANDLE_INVALID;
     switch (msg->opcode) {
     case LOADER_SVC_OP_CONFIG:
     case LOADER_SVC_OP_LOAD_OBJECT:
@@ -301,59 +301,59 @@
         // other starvation attacks.
         r = (*loader)(loader_arg, msg->opcode,
                       request_handle, (const char*) msg->data, &handle);
-        if (r == MX_ERR_NOT_FOUND) {
+        if (r == ZX_ERR_NOT_FOUND) {
             fprintf(stderr, "dlsvc: could not open '%s'\n",
                     (const char*) msg->data);
         }
-        request_handle = MX_HANDLE_INVALID;
+        request_handle = ZX_HANDLE_INVALID;
         msg->arg = r;
         break;
     case LOADER_SVC_OP_DEBUG_PRINT:
         log_printf(sys_log, "dlsvc: debug: %s\n", (const char*) msg->data);
-        msg->arg = MX_OK;
+        msg->arg = ZX_OK;
         break;
     case LOADER_SVC_OP_DONE:
-        mx_handle_close(request_handle);
-        return MX_ERR_PEER_CLOSED;
+        zx_handle_close(request_handle);
+        return ZX_ERR_PEER_CLOSED;
     default:
         fprintf(stderr, "dlsvc: invalid opcode 0x%x\n", msg->opcode);
-        msg->arg = MX_ERR_INVALID_ARGS;
+        msg->arg = ZX_ERR_INVALID_ARGS;
         break;
     }
-    if (request_handle != MX_HANDLE_INVALID) {
+    if (request_handle != ZX_HANDLE_INVALID) {
         fprintf(stderr, "dlsvc: unused handle (%#x) opcode=%#x data=\"%s\"\n",
                 request_handle, msg->opcode, msg->data);
-        mx_handle_close(request_handle);
+        zx_handle_close(request_handle);
     }
 
     // msg->txid returned as received from the client.
     msg->opcode = LOADER_SVC_OP_STATUS;
     msg->reserved0 = 0;
     msg->reserved1 = 0;
-    if ((r = mx_channel_write(h, 0, msg, sizeof(mx_loader_svc_msg_t),
-                              &handle, handle != MX_HANDLE_INVALID ? 1 : 0)) < 0) {
-        fprintf(stderr, "dlsvc: msg write error: %d: %s\n", r, mx_status_get_string(r));
+    if ((r = zx_channel_write(h, 0, msg, sizeof(zx_loader_svc_msg_t),
+                              &handle, handle != ZX_HANDLE_INVALID ? 1 : 0)) < 0) {
+        fprintf(stderr, "dlsvc: msg write error: %d: %s\n", r, zx_status_get_string(r));
         return r;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 static int loader_service_thread(void* arg) {
     struct startup* startup = arg;
-    mx_handle_t h = startup->pipe_handle;
+    zx_handle_t h = startup->pipe_handle;
     loader_service_fn_t loader = startup->loader;
     void* loader_arg = startup->loader_arg;
-    mx_handle_t sys_log = startup->syslog_handle;
+    zx_handle_t sys_log = startup->syslog_handle;
     free(startup);
 
-    mx_status_t r;
+    zx_status_t r;
 
     for (;;) {
-        if ((r = mx_object_wait_one(h, MX_CHANNEL_READABLE, MX_TIME_INFINITE, NULL)) < 0) {
+        if ((r = zx_object_wait_one(h, ZX_CHANNEL_READABLE, ZX_TIME_INFINITE, NULL)) < 0) {
             // This is the normal error for the other end going away,
             // which happens when the process dies.
-            if (r != MX_ERR_BAD_STATE)
-                fprintf(stderr, "dlsvc: wait error %d: %s\n", r, mx_status_get_string(r));
+            if (r != ZX_ERR_BAD_STATE)
+                fprintf(stderr, "dlsvc: wait error %d: %s\n", r, zx_status_get_string(r));
             break;
         }
         if ((r = handle_loader_rpc(h, loader, loader_arg, sys_log)) < 0) {
@@ -361,21 +361,21 @@
         }
     }
 
-    mx_handle_close(h);
+    zx_handle_close(h);
     return 0;
 }
 
-mx_status_t loader_service_create(const char* name,
+zx_status_t loader_service_create(const char* name,
                                   const loader_service_ops_t* ops,
                                   void* ctx,
                                   loader_service_t** out) {
     if (name == NULL || name[0] == '\0' || out == NULL ||
         ops == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     loader_service_t* svc = calloc(1, sizeof(loader_service_t));
     if (svc == NULL) {
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
 
     svc->ops = ops;
@@ -383,15 +383,15 @@
     strncpy(svc->name, name, sizeof(svc->name) - 1);
     *out = svc;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t loader_service_create_fs(const char* name,
+zx_status_t loader_service_create_fs(const char* name,
                                      loader_service_t** out) {
     return loader_service_create(name, &fs_ops, NULL, out);
 }
 
-static mx_status_t multiloader_cb(mx_handle_t h, void* cb, void* cookie) {
+static zx_status_t multiloader_cb(zx_handle_t h, void* cb, void* cookie) {
     if (h == 0) {
         // close notification, which we can ignore
         return 0;
@@ -402,35 +402,35 @@
     return handle_loader_rpc(h, default_load_fn, svc, svc->dispatcher_log);
 }
 
-mx_status_t loader_service_attach(loader_service_t* svc, mx_handle_t h) {
+zx_status_t loader_service_attach(loader_service_t* svc, zx_handle_t h) {
     if (svc == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     mtx_lock(&svc->dispatcher_lock);
-    mx_status_t r;
+    zx_status_t r;
     if (svc->dispatcher == NULL) {
-        if ((r = mxio_dispatcher_create(&svc->dispatcher,
+        if ((r = fdio_dispatcher_create(&svc->dispatcher,
                                         multiloader_cb)) < 0) {
             goto done;
         }
-        if ((r = mxio_dispatcher_start(svc->dispatcher, svc->name)) < 0) {
+        if ((r = fdio_dispatcher_start(svc->dispatcher, svc->name)) < 0) {
             //TODO: destroy dispatcher once support exists
             svc->dispatcher = NULL;
             goto done;
         }
-        if (mx_log_create(0, &svc->dispatcher_log) < 0) {
+        if (zx_log_create(0, &svc->dispatcher_log) < 0) {
             // unlikely to fail, but we'll keep going without it if so
-            svc->dispatcher_log = MX_HANDLE_INVALID;
+            svc->dispatcher_log = ZX_HANDLE_INVALID;
         }
     }
 
-    r = mxio_dispatcher_add(svc->dispatcher, h, NULL, svc);
+    r = fdio_dispatcher_add(svc->dispatcher, h, NULL, svc);
 
 done:
     mtx_unlock(&svc->dispatcher_lock);
-    if (r != MX_OK) {
-        mx_handle_close(r);
+    if (r != ZX_OK) {
+        zx_handle_close(r);
     }
     return r;
 }
@@ -438,18 +438,18 @@
 // TODO(dbort): Provide a name/id for the process that this handle will
 // be used for, to make error messages more useful? Would need to pass
 // the same through IOCTL_DMCTL_GET_LOADER_SERVICE_CHANNEL.
-mx_status_t loader_service_connect(loader_service_t* svc, mx_handle_t* out) {
-    mx_handle_t h0, h1;
-    mx_status_t r;
-    if ((r = mx_channel_create(0, &h0, &h1)) != MX_OK) {
+zx_status_t loader_service_connect(loader_service_t* svc, zx_handle_t* out) {
+    zx_handle_t h0, h1;
+    zx_status_t r;
+    if ((r = zx_channel_create(0, &h0, &h1)) != ZX_OK) {
         return r;
     }
-    if ((r = loader_service_attach(svc, h1)) != MX_OK) {
-        mx_handle_close(h0);
+    if ((r = loader_service_attach(svc, h1)) != ZX_OK) {
+        zx_handle_close(h0);
         return r;
     }
     *out = h0;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static bool force_local_loader_service = false;
@@ -459,20 +459,20 @@
 }
 
 // Returns a channel to the system loader service.
-mx_status_t loader_service_get_system(mx_handle_t* out) {
+zx_status_t loader_service_get_system(zx_handle_t* out) {
     int fd = open("/dev/misc/dmctl", O_RDONLY);
     if (fd < 0) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
-    mx_handle_t h;
+    zx_handle_t h;
     ssize_t s = ioctl_dmctl_get_loader_service_channel(fd, &h);
     close(fd);
-    if (s != (ssize_t)sizeof(mx_handle_t)) {
-        return s < 0 ? s : MX_ERR_INTERNAL;
+    if (s != (ssize_t)sizeof(zx_handle_t)) {
+        return s < 0 ? s : ZX_ERR_INTERNAL;
     }
     *out = h;
-    return MX_OK;
+    return ZX_OK;
 }
 
 // In-process multiloader
@@ -481,35 +481,35 @@
     .ops = &fs_ops,
 };
 
-mx_status_t loader_service_get_default(mx_handle_t* out) {
+zx_status_t loader_service_get_default(zx_handle_t* out) {
     if (!force_local_loader_service) {
         // Try to use the system loader service.
-        if (loader_service_get_system(out) == MX_OK) {
-            return MX_OK;
+        if (loader_service_get_system(out) == ZX_OK) {
+            return ZX_OK;
         }
     }
     // Fall back to an in-process loader service.
     return loader_service_connect(&local_loader_svc, out);
 }
 
-mx_status_t loader_service_simple(loader_service_fn_t loader, void* loader_arg,
-                                  mx_handle_t* out) {
+zx_status_t loader_service_simple(loader_service_fn_t loader, void* loader_arg,
+                                  zx_handle_t* out) {
     struct startup *startup = malloc(sizeof(*startup));
     if (startup == NULL)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
-    mx_handle_t h;
-    mx_status_t r;
+    zx_handle_t h;
+    zx_status_t r;
 
-    if ((r = mx_channel_create(0, &h, &startup->pipe_handle)) < 0) {
+    if ((r = zx_channel_create(0, &h, &startup->pipe_handle)) < 0) {
         free(startup);
         return r;
     }
 
-    mx_handle_t sys_log = MX_HANDLE_INVALID;
-    if ((r = mx_log_create(0u, &sys_log)) < 0)
+    zx_handle_t sys_log = ZX_HANDLE_INVALID;
+    if ((r = zx_log_create(0u, &sys_log)) < 0)
         fprintf(stderr, "dlsvc: log creation failed: error %d: %s\n", r,
-                mx_status_get_string(r));
+                zx_status_get_string(r));
 
     startup->loader = loader;
     startup->loader_arg = loader_arg;
@@ -519,13 +519,13 @@
     int ret = thrd_create_with_name(&t, loader_service_thread, startup,
                                     "local-custom-loader");
     if (ret != thrd_success) {
-        mx_handle_close(h);
-        mx_handle_close(startup->pipe_handle);
+        zx_handle_close(h);
+        zx_handle_close(startup->pipe_handle);
         free(startup);
-        return thrd_status_to_mx_status(ret);
+        return thrd_status_to_zx_status(ret);
     }
 
     thrd_detach(t);
     *out = h;
-    return MX_OK;
+    return ZX_OK;
 }
diff --git a/system/ulib/launchpad/mxio.c b/system/ulib/launchpad/mxio.c
deleted file mode 100644
index bede862..0000000
--- a/system/ulib/launchpad/mxio.c
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <launchpad/launchpad.h>
-#include <launchpad/vmo.h>
-
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/io.h>
-#include <mxio/namespace.h>
-#include <mxio/util.h>
-
-#include <stdlib.h>
-#include <unistd.h>
-
-static mx_status_t add_mxio(launchpad_t* lp,
-                            mx_handle_t handles[MXIO_MAX_HANDLES],
-                            uint32_t types[MXIO_MAX_HANDLES],
-                            mx_status_t status) {
-    if (status == MX_ERR_BAD_HANDLE)
-        return MX_OK;
-    if (status == MX_ERR_NOT_SUPPORTED)
-        return MX_OK;
-    if (status > 0) {
-        return launchpad_add_handles(lp, status, handles, types);
-    } else {
-        launchpad_abort(lp, status, "add_mxio: failed");
-        return status;
-    }
-}
-
-mx_status_t launchpad_clone(launchpad_t* lp, uint32_t what) {
-    mx_handle_t handles[MXIO_MAX_HANDLES];
-    uint32_t types[MXIO_MAX_HANDLES];
-    mx_status_t status;
-
-    if (what & LP_CLONE_MXIO_NAMESPACE) {
-        mxio_flat_namespace_t* flat;
-        status = mxio_ns_export_root(&flat);
-        if (status == MX_OK) {
-            launchpad_set_nametable(lp, flat->count, flat->path);
-            launchpad_add_handles(lp, flat->count, flat->handle, flat->type);
-            free(flat);
-        } else if (status != MX_ERR_NOT_FOUND) {
-            launchpad_abort(lp, status, "clone: error cloning namespace");
-            return status;
-        }
-    }
-    if (what & LP_CLONE_MXIO_CWD && (status = mxio_clone_cwd(handles, types)) > 0) {
-        add_mxio(lp, handles, types, status);
-    }
-    if (what & LP_CLONE_MXIO_STDIO) {
-        for (int fd = 0; fd < 3; fd++) {
-            add_mxio(lp, handles, types, mxio_clone_fd(fd, fd, handles, types));
-        }
-    }
-    if (what & LP_CLONE_ENVIRON) {
-        launchpad_set_environ(lp, (const char* const*)environ);
-    }
-    if (what & LP_CLONE_DEFAULT_JOB) {
-        mx_handle_t job;
-        if (mx_handle_duplicate(mx_job_default(), MX_RIGHT_SAME_RIGHTS, &job) == MX_OK) {
-            launchpad_add_handle(lp, job, PA_HND(PA_JOB_DEFAULT, 0));
-        }
-    }
-    return launchpad_get_status(lp);
-}
-
-mx_status_t launchpad_clone_fd(launchpad_t* lp, int fd, int target_fd) {
-    mx_handle_t handles[MXIO_MAX_HANDLES];
-    uint32_t types[MXIO_MAX_HANDLES];
-    return add_mxio(lp, handles, types,
-                    mxio_clone_fd(fd, target_fd, handles, types));
-}
-
-mx_status_t launchpad_transfer_fd(launchpad_t* lp, int fd, int target_fd) {
-    mx_handle_t handles[MXIO_MAX_HANDLES];
-    uint32_t types[MXIO_MAX_HANDLES];
-    return add_mxio(lp, handles, types,
-                    mxio_transfer_fd(fd, target_fd, handles, types));
-}
diff --git a/system/ulib/launchpad/rules.mk b/system/ulib/launchpad/rules.mk
index 4147b80..74d4ec3 100644
--- a/system/ulib/launchpad/rules.mk
+++ b/system/ulib/launchpad/rules.mk
@@ -12,13 +12,13 @@
     $(LOCAL_DIR)/elf.c \
     $(LOCAL_DIR)/launchpad.c \
     $(LOCAL_DIR)/loader-service.c \
-    $(LOCAL_DIR)/mxio.c \
+    $(LOCAL_DIR)/fdio.c \
     $(LOCAL_DIR)/vmo.c
 
 MODULE_EXPORT := so
 
 MODULE_SO_NAME := launchpad
 MODULE_STATIC_LIBS := system/ulib/elfload
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/launchpad/vmo.c b/system/ulib/launchpad/vmo.c
index 280b37a..59a8f42 100644
--- a/system/ulib/launchpad/vmo.c
+++ b/system/ulib/launchpad/vmo.c
@@ -3,29 +3,29 @@
 // found in the LICENSE file.
 
 #include <launchpad/vmo.h>
-#include <magenta/syscalls.h>
-#include <mxio/io.h>
+#include <zircon/syscalls.h>
+#include <fdio/io.h>
 
 #include <fcntl.h>
 #include <string.h>
 #include <unistd.h>
 
-mx_status_t launchpad_vmo_from_file(const char* filename, mx_handle_t* out) {
+zx_status_t launchpad_vmo_from_file(const char* filename, zx_handle_t* out) {
     int fd = open(filename, O_RDONLY);
     if (fd < 0)
-        return MX_ERR_IO;
-    mx_status_t status = mxio_get_vmo(fd, out);
+        return ZX_ERR_IO;
+    zx_status_t status = fdio_get_vmo(fd, out);
     close(fd);
 
-    if (status == MX_OK) {
-        if (strlen(filename) >= MX_MAX_NAME_LEN) {
+    if (status == ZX_OK) {
+        if (strlen(filename) >= ZX_MAX_NAME_LEN) {
             const char* p = strrchr(filename, '/');
             if (p != NULL) {
                 filename = p + 1;
             }
         }
 
-        mx_object_set_property(*out, MX_PROP_NAME, filename, strlen(filename));
+        zx_object_set_property(*out, ZX_PROP_NAME, filename, strlen(filename));
     }
 
     return status;
diff --git a/system/ulib/magenta/include/magenta/status.h b/system/ulib/magenta/include/magenta/status.h
deleted file mode 100644
index c438db7..0000000
--- a/system/ulib/magenta/include/magenta/status.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Given one of the status codes defined in <magenta/errors.h> (MX_ERR_* or
-// MX_OK), this function returns an identifier string for the status code.
-//
-// For example, mx_status_get_string(MX_ERR_TIMED_OUT) returns the string
-// "MX_ERR_TIMED_OUT".
-const char* _mx_status_get_string(mx_status_t status);
-const char* mx_status_get_string(mx_status_t status);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/system/ulib/magenta/mx_channel_call.cpp b/system/ulib/magenta/mx_channel_call.cpp
deleted file mode 100644
index bdcd48e..0000000
--- a/system/ulib/magenta/mx_channel_call.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "private.h"
-
-mx_status_t _mx_channel_call(mx_handle_t handle, uint32_t options,
-                             mx_time_t deadline,
-                             const mx_channel_call_args_t* args,
-                             uint32_t* actual_bytes,
-                             uint32_t* actual_handles,
-                             mx_status_t* read_status) {
-    mx_status_t internal_read_status;
-    mx_status_t* rd_status_p =
-        read_status ? read_status : &internal_read_status;
-
-    mx_status_t status = SYSCALL_mx_channel_call_noretry(
-        handle, options, deadline, args,
-        actual_bytes, actual_handles, rd_status_p);
-    while (unlikely(status == MX_ERR_CALL_FAILED) &&
-           unlikely(*rd_status_p == MX_ERR_INTERNAL_INTR_RETRY)) {
-        status = SYSCALL_mx_channel_call_finish(
-            deadline, args, actual_bytes, actual_handles, rd_status_p);
-    }
-
-    return status;
-}
-
-VDSO_INTERFACE_FUNCTION(mx_channel_call);
diff --git a/system/ulib/magenta/mx_deadline_after.cpp b/system/ulib/magenta/mx_deadline_after.cpp
deleted file mode 100644
index f07cfeb..0000000
--- a/system/ulib/magenta/mx_deadline_after.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <magenta/syscalls.h>
-
-#include "private.h"
-
-mx_time_t _mx_deadline_after(mx_duration_t nanoseconds) {
-    return nanoseconds + VDSO_mx_time_get(MX_CLOCK_MONOTONIC);
-}
-
-VDSO_INTERFACE_FUNCTION(mx_deadline_after);
diff --git a/system/ulib/magenta/mx_status_get_string.cpp b/system/ulib/magenta/mx_status_get_string.cpp
deleted file mode 100644
index bd7bf8d..0000000
--- a/system/ulib/magenta/mx_status_get_string.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <magenta/status.h>
-
-#include "private.h"
-
-const char* _mx_status_get_string(mx_status_t status) {
-    switch (status) {
-    case MX_OK: return "MX_OK";
-    case MX_ERR_INTERNAL: return "MX_ERR_INTERNAL";
-    case MX_ERR_NOT_SUPPORTED: return "MX_ERR_NOT_SUPPORTED";
-    case MX_ERR_NO_RESOURCES: return "MX_ERR_NO_RESOURCES";
-    case MX_ERR_NO_MEMORY: return "MX_ERR_NO_MEMORY";
-    case MX_ERR_CALL_FAILED: return "MX_ERR_CALL_FAILED";
-    case MX_ERR_INTERNAL_INTR_RETRY: return "MX_ERR_INTERNAL_INTR_KILLED_RETRY";
-    case MX_ERR_INVALID_ARGS: return "MX_ERR_INVALID_ARGS";
-    case MX_ERR_BAD_HANDLE: return "MX_ERR_BAD_HANDLE";
-    case MX_ERR_WRONG_TYPE: return "MX_ERR_WRONG_TYPE";
-    case MX_ERR_BAD_SYSCALL: return "MX_ERR_BAD_SYSCALL";
-    case MX_ERR_OUT_OF_RANGE: return "MX_ERR_OUT_OF_RANGE";
-    case MX_ERR_BUFFER_TOO_SMALL: return "MX_ERR_BUFFER_TOO_SMALL";
-    case MX_ERR_BAD_STATE: return "MX_ERR_BAD_STATE";
-    case MX_ERR_TIMED_OUT: return "MX_ERR_TIMED_OUT";
-    case MX_ERR_SHOULD_WAIT: return "MX_ERR_SHOULD_WAIT";
-    case MX_ERR_CANCELED: return "MX_ERR_CANCELED";
-    case MX_ERR_PEER_CLOSED: return "MX_ERR_PEER_CLOSED";
-    case MX_ERR_NOT_FOUND: return "MX_ERR_NOT_FOUND";
-    case MX_ERR_ALREADY_EXISTS: return "MX_ERR_ALREADY_EXISTS";
-    case MX_ERR_ALREADY_BOUND: return "MX_ERR_ALREADY_BOUND";
-    case MX_ERR_UNAVAILABLE: return "MX_ERR_UNAVAILABLE";
-    case MX_ERR_ACCESS_DENIED: return "MX_ERR_ACCESS_DENIED";
-    case MX_ERR_IO: return "MX_ERR_IO";
-    case MX_ERR_IO_REFUSED: return "MX_ERR_IO_REFUSED";
-    case MX_ERR_IO_DATA_INTEGRITY: return "MX_ERR_IO_DATA_INTEGRITY";
-    case MX_ERR_IO_DATA_LOSS: return "MX_ERR_IO_DATA_LOSS";
-    case MX_ERR_IO_NOT_PRESENT: return "MX_ERR_IO_NOT_PRESENT";
-    case MX_ERR_BAD_PATH: return "MX_ERR_BAD_PATH";
-    case MX_ERR_NOT_DIR: return "MX_ERR_NOT_DIR";
-    case MX_ERR_NOT_FILE: return "MX_ERR_NOT_FILE";
-    case MX_ERR_FILE_BIG: return "MX_ERR_FILE_BIG";
-    case MX_ERR_NO_SPACE: return "MX_ERR_NO_SPACE";
-    case MX_ERR_STOP: return "MX_ERR_STOP";
-    case MX_ERR_NEXT: return "MX_ERR_NEXT";
-    case MX_ERR_PROTOCOL_NOT_SUPPORTED: return "MX_ERR_PROTOCOL_NOT_SUPPORTED";
-    case MX_ERR_ADDRESS_UNREACHABLE: return "MX_ERR_ADDRESS_UNREACHABLE";
-    case MX_ERR_ADDRESS_IN_USE: return "MX_ERR_ADDRESS_IN_USE";
-    case MX_ERR_NOT_CONNECTED: return "MX_ERR_NOT_CONNECTED";
-    case MX_ERR_CONNECTION_REFUSED: return "MX_ERR_CONNECTION_REFUSED";
-    case MX_ERR_CONNECTION_RESET: return "MX_ERR_CONNECTION_RESET";
-    case MX_ERR_CONNECTION_ABORTED: return "MX_ERR_CONNECTION_ABORTED";
-    default: return "(UNKNOWN)";
-
-    // TODO(mcgrathr): Having this extra case here (a value far away from
-    // the other values) forces LLVM to disable its switch->table-lookup
-    // optimization.  That optimization produces a table of pointers in
-    // rodata, which is not PIC-friendly (requires a dynamic reloc for each
-    // element) and so makes the vDSO build bomb out at link time.  Some
-    // day we'll teach LLVM either to disable this optimization in PIC mode
-    // when it would result in dynamic relocs, or (ideally) to generate a
-    // PIC-friendly lookup table like it does for jump tables.
-    case 99999: return "(UNKNOWN)";
-    }
-}
-
-VDSO_INTERFACE_FUNCTION(mx_status_get_string);
-
-// Generated with:
-// grep '#define'  system/public/magenta/errors.h | grep -v MX_OK |
-// sed 's/.*MX_ERR_/MX_ERR_/g' | sed 's/\s.*//g' |
-// awk '{print "case "$1": return \""$1"\";";}'
diff --git a/system/ulib/magenta/mx_system_get_version.cpp b/system/ulib/magenta/mx_system_get_version.cpp
deleted file mode 100644
index 0916275..0000000
--- a/system/ulib/magenta/mx_system_get_version.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <magenta/syscalls.h>
-
-#include "config-buildid.h"
-#include "private.h"
-
-static const char kMagentaVersion[] = BUILDID;
-
-mx_status_t _mx_system_get_version(char* version, uint32_t version_len) {
-    if (version_len < sizeof(kMagentaVersion))
-        return MX_ERR_BUFFER_TOO_SMALL;
-    for (size_t i = 0; i < sizeof(kMagentaVersion); ++i)
-        version[i] = kMagentaVersion[i];
-    return MX_OK;
-}
-
-VDSO_INTERFACE_FUNCTION(mx_system_get_version);
diff --git a/system/ulib/mdi/include/mdi/mdi.h b/system/ulib/mdi/include/mdi/mdi.h
index 31b0b67..9b99205 100644
--- a/system/ulib/mdi/include/mdi/mdi.h
+++ b/system/ulib/mdi/include/mdi/mdi.h
@@ -5,8 +5,8 @@
 #pragma once
 
 #include <stdbool.h>
-#include <magenta/types.h>
-#include <magenta/mdi.h>
+#include <zircon/types.h>
+#include <zircon/mdi.h>
 
 __BEGIN_CDECLS;
 
@@ -21,7 +21,7 @@
 }
 
 // takes pointer to MDI data and returns reference to MDI root node
-mx_status_t mdi_init(const void* mdi_data, size_t length, mdi_node_ref_t* out_ref);
+zx_status_t mdi_init(const void* mdi_data, size_t length, mdi_node_ref_t* out_ref);
 
 // returns the type of a node
 static inline mdi_id_t mdi_id(const mdi_node_ref_t* ref) {
@@ -34,27 +34,27 @@
 }
 
 // node value accessors
-mx_status_t mdi_node_uint8(const mdi_node_ref_t* ref, uint8_t* out_value);
-mx_status_t mdi_node_int32(const mdi_node_ref_t* ref, int32_t* out_value);
-mx_status_t mdi_node_uint32(const mdi_node_ref_t* ref, uint32_t* out_value);
-mx_status_t mdi_node_uint64(const mdi_node_ref_t* ref, uint64_t* out_value);
-mx_status_t mdi_node_boolean(const mdi_node_ref_t* ref, bool* out_value);
+zx_status_t mdi_node_uint8(const mdi_node_ref_t* ref, uint8_t* out_value);
+zx_status_t mdi_node_int32(const mdi_node_ref_t* ref, int32_t* out_value);
+zx_status_t mdi_node_uint32(const mdi_node_ref_t* ref, uint32_t* out_value);
+zx_status_t mdi_node_uint64(const mdi_node_ref_t* ref, uint64_t* out_value);
+zx_status_t mdi_node_boolean(const mdi_node_ref_t* ref, bool* out_value);
 const char* mdi_node_string(const mdi_node_ref_t* ref);
 
 // array element accessors
 const void* mdi_array_values(const mdi_node_ref_t* ref);
 uint32_t mdi_array_length(const mdi_node_ref_t* ref);
-mx_status_t mdi_array_uint8(const mdi_node_ref_t* ref, uint8_t index, uint8_t* out_value);
-mx_status_t mdi_array_int32(const mdi_node_ref_t* ref, uint32_t index, int32_t* out_value);
-mx_status_t mdi_array_uint32(const mdi_node_ref_t* ref, uint32_t index, uint32_t* out_value);
-mx_status_t mdi_array_uint64(const mdi_node_ref_t* ref, uint32_t index, uint64_t* out_value);
-mx_status_t mdi_array_boolean(const mdi_node_ref_t* ref, uint32_t index, bool* out_value);
+zx_status_t mdi_array_uint8(const mdi_node_ref_t* ref, uint8_t index, uint8_t* out_value);
+zx_status_t mdi_array_int32(const mdi_node_ref_t* ref, uint32_t index, int32_t* out_value);
+zx_status_t mdi_array_uint32(const mdi_node_ref_t* ref, uint32_t index, uint32_t* out_value);
+zx_status_t mdi_array_uint64(const mdi_node_ref_t* ref, uint32_t index, uint64_t* out_value);
+zx_status_t mdi_array_boolean(const mdi_node_ref_t* ref, uint32_t index, bool* out_value);
 
 // list traversal
-mx_status_t mdi_first_child(const mdi_node_ref_t* ref, mdi_node_ref_t* out_ref);
-mx_status_t mdi_next_child(const mdi_node_ref_t* ref, mdi_node_ref_t* out_ref);
+zx_status_t mdi_first_child(const mdi_node_ref_t* ref, mdi_node_ref_t* out_ref);
+zx_status_t mdi_next_child(const mdi_node_ref_t* ref, mdi_node_ref_t* out_ref);
 uint32_t mdi_child_count(const mdi_node_ref_t* ref);
-mx_status_t mdi_find_node(const mdi_node_ref_t* ref, mdi_id_t id, mdi_node_ref_t* out_ref);
+zx_status_t mdi_find_node(const mdi_node_ref_t* ref, mdi_id_t id, mdi_node_ref_t* out_ref);
 
 #define mdi_each_child(parent, child) \
     for (mdi_first_child(parent, child); mdi_valid(child); mdi_next_child(child, child))
diff --git a/system/ulib/mdi/mdi.c b/system/ulib/mdi/mdi.c
index 5b9b0ec..d8ffe85 100644
--- a/system/ulib/mdi/mdi.c
+++ b/system/ulib/mdi/mdi.c
@@ -5,7 +5,7 @@
 #include <stdio.h>
 
 #include <mdi/mdi.h>
-#include <magenta/boot/bootdata.h>
+#include <zircon/boot/bootdata.h>
 
 #define DEBUG   0
 
@@ -22,16 +22,16 @@
 #endif
 
 // takes pointer to MDI header and returns reference to MDI root node
-mx_status_t mdi_init(const void* mdi_data, size_t length, mdi_node_ref_t* out_ref) {
+zx_status_t mdi_init(const void* mdi_data, size_t length, mdi_node_ref_t* out_ref) {
     const bootdata_t* header = (const bootdata_t *)mdi_data;
 
     if (length < sizeof(bootdata_t)) {
         xprintf("%s: bad bootdata length\n", __FUNCTION__);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     if (header->type != BOOTDATA_MDI) {
         xprintf("%s: not a MDI bootdata header\n", __FUNCTION__);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     mdi_data += sizeof(bootdata_t);
     length -= sizeof(bootdata_t);
@@ -40,7 +40,7 @@
     if (header->flags & BOOTDATA_FLAG_EXTRA) {
         if (length < sizeof(bootextra_t)) {
             xprintf("%s: bad bootextra length\n", __FUNCTION__);
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
         }
         mdi_data += sizeof(bootextra_t);
         length -= sizeof(bootextra_t);
@@ -49,65 +49,65 @@
     // Sanity check the length. Must be big enough to contain at least one node.
     if (length < header->length || header->length < sizeof(mdi_node_t)) {
         xprintf("%s: bad length\n", __FUNCTION__);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     const mdi_node_t* node = (const mdi_node_t *)(header + 1);
     if (node->length != header->length) {
         xprintf("%s: bad root node length\n", __FUNCTION__);
         out_ref->node = NULL;
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     out_ref->node = node;
     out_ref->siblings_count = 0;
     out_ref->siblings_end = NULL;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_node_uint8(const mdi_node_ref_t* ref, uint8_t* out_value) {
+zx_status_t mdi_node_uint8(const mdi_node_ref_t* ref, uint8_t* out_value) {
     if (mdi_node_type(ref) != MDI_UINT8) {
         xprintf("%s: bad node type for mdi_node_uint8\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     *out_value = ref->node->value.u8;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_node_int32(const mdi_node_ref_t* ref, int32_t* out_value) {
+zx_status_t mdi_node_int32(const mdi_node_ref_t* ref, int32_t* out_value) {
     if (mdi_node_type(ref) != MDI_INT32) {
         xprintf("%s: bad node type for mdi_node_int32\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     *out_value = ref->node->value.i32;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_node_uint32(const mdi_node_ref_t* ref, uint32_t* out_value) {
+zx_status_t mdi_node_uint32(const mdi_node_ref_t* ref, uint32_t* out_value) {
     if (mdi_node_type(ref) != MDI_UINT32) {
         xprintf("%s: bad node type for mdi_node_uint32\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     *out_value = ref->node->value.u32;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_node_uint64(const mdi_node_ref_t* ref, uint64_t* out_value) {
+zx_status_t mdi_node_uint64(const mdi_node_ref_t* ref, uint64_t* out_value) {
     if (mdi_node_type(ref) != MDI_UINT64) {
         xprintf("%s: bad node type for mdi_node_uint64\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     *out_value = ref->node->value.u64;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_node_boolean(const mdi_node_ref_t* ref, bool* out_value) {
+zx_status_t mdi_node_boolean(const mdi_node_ref_t* ref, bool* out_value) {
     if (mdi_node_type(ref) != MDI_BOOLEAN) {
         xprintf("%s: bad node type for mdi_node_boolean\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     *out_value = !!ref->node->value.u8;
-    return MX_OK;
+    return ZX_OK;
 }
 
 const char* mdi_node_string(const mdi_node_ref_t* ref) {
@@ -136,94 +136,94 @@
     }
 }
 
-mx_status_t mdi_array_uint8(const mdi_node_ref_t* ref, uint8_t index, uint8_t* out_value) {
+zx_status_t mdi_array_uint8(const mdi_node_ref_t* ref, uint8_t index, uint8_t* out_value) {
     const mdi_node_t* node = ref->node;
     if ((node->id & (MDI_TYPE_MASK | MDI_ARRAY_TYPE_MASK)) != MDI_MAKE_ARRAY_ID(MDI_UINT8, 0)) {
         xprintf("%s: ref not an uint8 array\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     if (index >= node->value.child_count) {
         xprintf("%s: array index out of range\n", __FUNCTION__);
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     const void* array_data = node + 1;
     *out_value = ((uint8_t *)array_data)[index];
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_array_int32(const mdi_node_ref_t* ref, uint32_t index, int32_t* out_value) {
+zx_status_t mdi_array_int32(const mdi_node_ref_t* ref, uint32_t index, int32_t* out_value) {
     const mdi_node_t* node = ref->node;
     if ((node->id & (MDI_TYPE_MASK | MDI_ARRAY_TYPE_MASK)) != MDI_MAKE_ARRAY_ID(MDI_INT32, 0)) {
         xprintf("%s: ref not an int32 array\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     if (index >= node->value.child_count) {
         xprintf("%s: array index out of range\n", __FUNCTION__);
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     const void* array_data = node + 1;
     *out_value = ((int32_t *)array_data)[index];
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_array_uint32(const mdi_node_ref_t* ref, uint32_t index, uint32_t* out_value) {
+zx_status_t mdi_array_uint32(const mdi_node_ref_t* ref, uint32_t index, uint32_t* out_value) {
     const mdi_node_t* node = ref->node;
     if ((node->id & (MDI_TYPE_MASK | MDI_ARRAY_TYPE_MASK)) != MDI_MAKE_ARRAY_ID(MDI_UINT32, 0)) {
         xprintf("%s: ref not an uint32 array\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     if (index >= node->value.child_count) {
         xprintf("%s: array index out of range\n", __FUNCTION__);
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     const void* array_data = node + 1;
     *out_value = ((uint32_t *)array_data)[index];
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_array_uint64(const mdi_node_ref_t* ref, uint32_t index, uint64_t* out_value) {
+zx_status_t mdi_array_uint64(const mdi_node_ref_t* ref, uint32_t index, uint64_t* out_value) {
     const mdi_node_t* node = ref->node;
     if ((node->id & (MDI_TYPE_MASK | MDI_ARRAY_TYPE_MASK)) != MDI_MAKE_ARRAY_ID(MDI_UINT64, 0)) {
         xprintf("%s: ref not an uint64 array\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     if (index >= node->value.child_count) {
         xprintf("%s: array index out of range\n", __FUNCTION__);
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     const void* array_data = node + 1;
     *out_value = ((uint64_t *)array_data)[index];
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_array_boolean(const mdi_node_ref_t* ref, uint32_t index, bool* out_value) {
+zx_status_t mdi_array_boolean(const mdi_node_ref_t* ref, uint32_t index, bool* out_value) {
     const mdi_node_t* node = ref->node;
     if ((node->id & (MDI_TYPE_MASK | MDI_ARRAY_TYPE_MASK)) != MDI_MAKE_ARRAY_ID(MDI_BOOLEAN, 0)) {
         xprintf("%s: ref not an boolean array\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
     if (index >= node->value.child_count) {
         xprintf("%s: array index out of range\n", __FUNCTION__);
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
     }
     const void* array_data = node + 1;
     *out_value = ((bool *)array_data)[index];
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_first_child(const mdi_node_ref_t* ref, mdi_node_ref_t* out_ref) {
+zx_status_t mdi_first_child(const mdi_node_ref_t* ref, mdi_node_ref_t* out_ref) {
     out_ref->node = NULL;
     out_ref->siblings_count = 0;
     out_ref->siblings_end = NULL;
 
    if (mdi_node_type(ref) != MDI_LIST) {
         xprintf("%s: ref not a list\n", __FUNCTION__);
-        return MX_ERR_WRONG_TYPE;
+        return ZX_ERR_WRONG_TYPE;
     }
 
     const mdi_node_t* node = ref->node;
     if (node->value.child_count == 0) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     // first child immediately follows list node
@@ -231,34 +231,34 @@
     void* siblings_end = (void *)node + node->length;
     if ((void *)child + child->length > siblings_end) {
         xprintf("%s: child length out of range\n", __FUNCTION__);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     out_ref->node = child;
     out_ref->siblings_count = node->value.child_count - 1;
     out_ref->siblings_end = siblings_end;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mdi_next_child(const mdi_node_ref_t* ref, mdi_node_ref_t* out_ref) {
+zx_status_t mdi_next_child(const mdi_node_ref_t* ref, mdi_node_ref_t* out_ref) {
     if (ref->siblings_count == 0) {
         out_ref->node = NULL;
         out_ref->siblings_count = 0;
         out_ref->siblings_end = NULL;
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     const mdi_node_t* node = ref->node;
     const mdi_node_t* next = (const mdi_node_t *)((void *)node + node->length);
     if ((void *)next + next->length > ref->siblings_end) {
         xprintf("%s: child length out of range\n", __FUNCTION__);
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     out_ref->node = next;
     out_ref->siblings_count = ref->siblings_count - 1;
     out_ref->siblings_end = ref->siblings_end;
-    return MX_OK;
+    return ZX_OK;
 }
 
 uint32_t mdi_child_count(const mdi_node_ref_t* ref) {
@@ -269,15 +269,15 @@
     }
 }
 
-mx_status_t mdi_find_node(const mdi_node_ref_t* ref, mdi_id_t id, mdi_node_ref_t* out_ref) {
+zx_status_t mdi_find_node(const mdi_node_ref_t* ref, mdi_id_t id, mdi_node_ref_t* out_ref) {
     out_ref->siblings_count = 0;
     out_ref->siblings_end = NULL;
-    mx_status_t status = mdi_first_child(ref, out_ref);
+    zx_status_t status = mdi_first_child(ref, out_ref);
 
-    while (status == MX_OK && out_ref->node->id != id) {
+    while (status == ZX_OK && out_ref->node->id != id) {
         status = mdi_next_child(out_ref, out_ref);
     }
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         out_ref->node = NULL;
     }
     return status;
diff --git a/system/ulib/mdi/rules.mk b/system/ulib/mdi/rules.mk
index 3c030b7..711a042 100644
--- a/system/ulib/mdi/rules.mk
+++ b/system/ulib/mdi/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_SO_NAME := mdi
 
-MODULE_LIBS := system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/mini-process/include/mini-process/mini-process.h b/system/ulib/mini-process/include/mini-process/mini-process.h
index 2ba3553..5645f31 100644
--- a/system/ulib/mini-process/include/mini-process/mini-process.h
+++ b/system/ulib/mini-process/include/mini-process/mini-process.h
@@ -6,61 +6,61 @@
 
 #include <stdint.h>
 
-#include <magenta/types.h>
-#include <magenta/compiler.h>
+#include <zircon/types.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
 // mini-process available commands. Use mini_process_cmd() to send them.
 //
 // The process echoes a canned message.
-// The return value upon success is MX_OK.
+// The return value upon success is ZX_OK.
 #define MINIP_CMD_ECHO_MSG                   (1 << 0)
 // The process creates an event and sends it back on |handle|.
-// The return value upon success is MX_OK.
+// The return value upon success is ZX_OK.
 #define MINIP_CMD_CREATE_EVENT               (1 << 1)
 // The process creates a channel and sends one end back on |handle|.
-// The return value upon success is MX_OK.
+// The return value upon success is ZX_OK.
 #define MINIP_CMD_CREATE_CHANNEL             (1 << 2)
 // The following two commands cause the process to call a syscall with an
 // invalid handle value.  The return value is the result of that syscall.
 #define MINIP_CMD_USE_BAD_HANDLE_CLOSED      (1 << 3)
 #define MINIP_CMD_USE_BAD_HANDLE_TRANSFERRED (1 << 4)
 // The process will execute __builtin_trap() which causes a fatal exception.
-// The return value upon success is MX_ERR_PEER_CLOSED.
+// The return value upon success is ZX_ERR_PEER_CLOSED.
 #define MINIP_CMD_BUILTIN_TRAP               (1 << 5)
-// The process just calls mx_process_exit() immediately without replying.
-// The return value upon success is MX_ERR_PEER_CLOSED.
+// The process just calls zx_process_exit() immediately without replying.
+// The return value upon success is ZX_ERR_PEER_CLOSED.
 #define MINIP_CMD_EXIT_NORMAL                (1 << 6)
 
 // Create and run a minimal process with one thread that blocks forever.
 // Does not require a host binary.
-mx_status_t start_mini_process(mx_handle_t job, mx_handle_t transferred_handle,
-                               mx_handle_t* process, mx_handle_t* thread);
+zx_status_t start_mini_process(zx_handle_t job, zx_handle_t transferred_handle,
+                               zx_handle_t* process, zx_handle_t* thread);
 
 // Like start_mini_process() but requires caller to create the process,
 // thread and object to transfer.  Pass NULL in |cntrl_channel| to create
 // a minimal process that has no VDSO and loops forever. If |cntrl_channel|
 // is valid then upon successful return it contains the handle to a channel
 // that the new process is listening to for commands via mini_process_cmd().
-mx_status_t start_mini_process_etc(mx_handle_t process, mx_handle_t thread,
-                                   mx_handle_t vmar,
-                                   mx_handle_t transferred_handle,
-                                   mx_handle_t* cntrl_channel);
+zx_status_t start_mini_process_etc(zx_handle_t process, zx_handle_t thread,
+                                   zx_handle_t vmar,
+                                   zx_handle_t transferred_handle,
+                                   zx_handle_t* cntrl_channel);
 
 // Execute in the mini process any set of the MINIP_CMD_ commands above.
 // The |cntrl_channel| should be the same as the one returned by
 // start_mini_process_etc().  The |handle| is an in/out parameter
 // dependent on the command.
-mx_status_t mini_process_cmd(mx_handle_t cntrl_channel,
-                             uint32_t what, mx_handle_t* handle);
+zx_status_t mini_process_cmd(zx_handle_t cntrl_channel,
+                             uint32_t what, zx_handle_t* handle);
 
 // The following pair of functions is equivalent to mini_process_cmd(), but
 // they allow sending the request and receiving the reply to be done
 // separately.  This allows handling the case where the mini process gets
 // suspended as a result of executing the command.
-mx_status_t mini_process_cmd_send(mx_handle_t cntrl_channel, uint32_t what);
-mx_status_t mini_process_cmd_read_reply(mx_handle_t cntrl_channel,
-                                        mx_handle_t* handle);
+zx_status_t mini_process_cmd_send(zx_handle_t cntrl_channel, uint32_t what);
+zx_status_t mini_process_cmd_read_reply(zx_handle_t cntrl_channel,
+                                        zx_handle_t* handle);
 
 __END_CDECLS
diff --git a/system/ulib/mini-process/mini-process.c b/system/ulib/mini-process/mini-process.c
index 4ccdc26..3ffff6b 100644
--- a/system/ulib/mini-process/mini-process.c
+++ b/system/ulib/mini-process/mini-process.c
@@ -9,11 +9,11 @@
 
 #include <elfload/elfload.h>
 
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/stack.h>
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/stack.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
 
 #include "subprocess.h"
 
@@ -24,62 +24,62 @@
     return (void*)(vdso_base + ((uintptr_t)dl_info.dli_saddr - (uintptr_t)dl_info.dli_fbase));
 }
 
-static mx_status_t write_ctx_message(
-    mx_handle_t channel, uintptr_t vdso_base, mx_handle_t transferred_handle) {
+static zx_status_t write_ctx_message(
+    zx_handle_t channel, uintptr_t vdso_base, zx_handle_t transferred_handle) {
     minip_ctx_t ctx = {
-        .handle_close = get_syscall_addr(&mx_handle_close, vdso_base),
-        .object_wait_one = get_syscall_addr(&mx_object_wait_one, vdso_base),
-        .object_signal = get_syscall_addr(&mx_object_signal, vdso_base),
-        .event_create = get_syscall_addr(&mx_event_create, vdso_base),
-        .channel_create = get_syscall_addr(&mx_channel_create, vdso_base),
-        .channel_read = get_syscall_addr(&mx_channel_read, vdso_base),
-        .channel_write = get_syscall_addr(&mx_channel_write, vdso_base),
-        .process_exit = get_syscall_addr(&mx_process_exit, vdso_base)
+        .handle_close = get_syscall_addr(&zx_handle_close, vdso_base),
+        .object_wait_one = get_syscall_addr(&zx_object_wait_one, vdso_base),
+        .object_signal = get_syscall_addr(&zx_object_signal, vdso_base),
+        .event_create = get_syscall_addr(&zx_event_create, vdso_base),
+        .channel_create = get_syscall_addr(&zx_channel_create, vdso_base),
+        .channel_read = get_syscall_addr(&zx_channel_read, vdso_base),
+        .channel_write = get_syscall_addr(&zx_channel_write, vdso_base),
+        .process_exit = get_syscall_addr(&zx_process_exit, vdso_base)
     };
-    return mx_channel_write(channel, 0u, &ctx, sizeof(ctx), &transferred_handle, 1u);
+    return zx_channel_write(channel, 0u, &ctx, sizeof(ctx), &transferred_handle, 1u);
 }
 
-mx_status_t start_mini_process_etc(mx_handle_t process, mx_handle_t thread,
-                                   mx_handle_t vmar,
-                                   mx_handle_t transferred_handle,
-                                   mx_handle_t* control_channel) {
+zx_status_t start_mini_process_etc(zx_handle_t process, zx_handle_t thread,
+                                   zx_handle_t vmar,
+                                   zx_handle_t transferred_handle,
+                                   zx_handle_t* control_channel) {
     // Allocate a single VMO for the child. It doubles as the stack on the top and
     // as the executable code (minipr_thread_loop()) at the bottom. In theory, actual
     // stack usage is minimal, like 160 bytes or less.
     uint64_t stack_size = 16 * 1024u;
-    mx_handle_t stack_vmo = MX_HANDLE_INVALID;
-    mx_status_t status = mx_vmo_create(stack_size, 0, &stack_vmo);
-    if (status != MX_OK)
+    zx_handle_t stack_vmo = ZX_HANDLE_INVALID;
+    zx_status_t status = zx_vmo_create(stack_size, 0, &stack_vmo);
+    if (status != ZX_OK)
         return status;
     // Try to set the name, but ignore any errors since it's purely for
     // debugging and diagnostics.
     static const char vmo_name[] = "mini-process:stack";
-    mx_object_set_property(stack_vmo, MX_PROP_NAME, vmo_name, sizeof(vmo_name));
+    zx_object_set_property(stack_vmo, ZX_PROP_NAME, vmo_name, sizeof(vmo_name));
 
     // We assume that the code to execute is less than kSizeLimit bytes.
     const uint32_t kSizeLimit = 1000;
     size_t actual;
-    status = mx_vmo_write(stack_vmo, &minipr_thread_loop, 0u, kSizeLimit,
+    status = zx_vmo_write(stack_vmo, &minipr_thread_loop, 0u, kSizeLimit,
                           &actual);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         goto exit;
 
-    mx_vaddr_t stack_base;
-    uint32_t perms = MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE;
-    status = mx_vmar_map(vmar, 0, stack_vmo, 0, stack_size, perms, &stack_base);
-    if (status != MX_OK)
+    zx_vaddr_t stack_base;
+    uint32_t perms = ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE;
+    status = zx_vmar_map(vmar, 0, stack_vmo, 0, stack_size, perms, &stack_base);
+    if (status != ZX_OK)
         goto exit;
 
     // Compute a valid starting SP for the machine's ABI.
     uintptr_t sp = compute_initial_stack_pointer(stack_base, stack_size);
-    mx_handle_t chn[2] = { MX_HANDLE_INVALID, MX_HANDLE_INVALID };
+    zx_handle_t chn[2] = { ZX_HANDLE_INVALID, ZX_HANDLE_INVALID };
 
 
     if (!control_channel) {
         // Simple mode /////////////////////////////////////////////////////////////
         // Don't map the VDSO, so the only thing the mini-process can do is busy-loop.
         // The handle sent to the process is just the caller's handle.
-        status = mx_process_start(process, thread, stack_base, sp, transferred_handle, 0);
+        status = zx_process_start(process, thread, stack_base, sp, transferred_handle, 0);
 
     } else {
         // Complex mode ////////////////////////////////////////////////////////////
@@ -90,18 +90,18 @@
         // 3- send a message with the rest of the syscall function addresses.
         // 4- wait for reply.
 
-        status = mx_channel_create(0u, &chn[0], &chn[1]);
-        if (status != MX_OK)
+        status = zx_channel_create(0u, &chn[0], &chn[1]);
+        if (status != ZX_OK)
             goto exit;
 
         // This is not thread-safe.  It steals the startup handle, so it's not
         // compatible with also using launchpad (which also needs to steal the
         // startup handle).
-        static mx_handle_t vdso_vmo = MX_HANDLE_INVALID;
-        if (vdso_vmo == MX_HANDLE_INVALID) {
-            vdso_vmo = mx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0));
-            if (vdso_vmo == MX_HANDLE_INVALID) {
-                status = MX_ERR_INTERNAL;
+        static zx_handle_t vdso_vmo = ZX_HANDLE_INVALID;
+        if (vdso_vmo == ZX_HANDLE_INVALID) {
+            vdso_vmo = zx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0));
+            if (vdso_vmo == ZX_HANDLE_INVALID) {
+                status = ZX_ERR_INTERNAL;
                 goto exit;
             }
         }
@@ -109,127 +109,127 @@
         uintptr_t vdso_base = 0;
         elf_load_header_t header;
         uintptr_t phoff;
-        mx_status_t status = elf_load_prepare(vdso_vmo, NULL, 0,
+        zx_status_t status = elf_load_prepare(vdso_vmo, NULL, 0,
                                               &header, &phoff);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             elf_phdr_t phdrs[header.e_phnum];
             status = elf_load_read_phdrs(vdso_vmo, phdrs, phoff,
                                          header.e_phnum);
-            if (status == MX_OK)
+            if (status == ZX_OK)
                 status = elf_load_map_segments(vmar, &header, phdrs, vdso_vmo,
                                                NULL, &vdso_base, NULL);
         }
-        if (status != MX_OK)
+        if (status != ZX_OK)
             goto exit;
 
         status = write_ctx_message(chn[0], vdso_base, transferred_handle);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             goto exit;
 
-        uintptr_t channel_read = (uintptr_t)get_syscall_addr(&mx_channel_read, vdso_base);
+        uintptr_t channel_read = (uintptr_t)get_syscall_addr(&zx_channel_read, vdso_base);
 
-        status = mx_process_start(process, thread, stack_base, sp, chn[1], channel_read);
-        if (status != MX_OK)
+        status = zx_process_start(process, thread, stack_base, sp, chn[1], channel_read);
+        if (status != ZX_OK)
             goto exit;
 
-        chn[1] = MX_HANDLE_INVALID;
+        chn[1] = ZX_HANDLE_INVALID;
 
         uint32_t observed;
-        status = mx_object_wait_one(chn[0],
-            MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED, MX_TIME_INFINITE, &observed);
+        status = zx_object_wait_one(chn[0],
+            ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, ZX_TIME_INFINITE, &observed);
 
-        if (observed & MX_CHANNEL_PEER_CLOSED) {
+        if (observed & ZX_CHANNEL_PEER_CLOSED) {
             // the child process died prematurely.
-            status = MX_ERR_UNAVAILABLE;
+            status = ZX_ERR_UNAVAILABLE;
             goto exit;
         }
 
-        if (observed & MX_CHANNEL_READABLE) {
+        if (observed & ZX_CHANNEL_READABLE) {
             uint32_t ack[2];
             uint32_t actual_handles;
             uint32_t actual_bytes;
-            status = mx_channel_read(
+            status = zx_channel_read(
                 chn[0], 0u, ack, NULL, sizeof(uint32_t) * 2, 0u, &actual_bytes, &actual_handles);
         }
 
         *control_channel = chn[0];
-        chn[0] = MX_HANDLE_INVALID;
+        chn[0] = ZX_HANDLE_INVALID;
     }
 
 exit:
-    if (stack_vmo != MX_HANDLE_INVALID)
-        mx_handle_close(stack_vmo);
-    if (chn[0] != MX_HANDLE_INVALID)
-        mx_handle_close(chn[0]);
-    if (chn[1] != MX_HANDLE_INVALID)
-        mx_handle_close(chn[1]);
+    if (stack_vmo != ZX_HANDLE_INVALID)
+        zx_handle_close(stack_vmo);
+    if (chn[0] != ZX_HANDLE_INVALID)
+        zx_handle_close(chn[0]);
+    if (chn[1] != ZX_HANDLE_INVALID)
+        zx_handle_close(chn[1]);
 
     return status;
 }
 
-mx_status_t mini_process_cmd_send(mx_handle_t cntrl_channel, uint32_t what) {
+zx_status_t mini_process_cmd_send(zx_handle_t cntrl_channel, uint32_t what) {
     minip_cmd_t cmd = {
         .what = what,
-        .status = MX_OK
+        .status = ZX_OK
     };
 
-    return mx_channel_write(cntrl_channel, 0, &cmd, sizeof(cmd), NULL, 0);
+    return zx_channel_write(cntrl_channel, 0, &cmd, sizeof(cmd), NULL, 0);
 }
 
-mx_status_t mini_process_cmd_read_reply(mx_handle_t cntrl_channel,
-                                        mx_handle_t* handle) {
-    mx_status_t status = mx_object_wait_one(
-        cntrl_channel, MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-        MX_TIME_INFINITE, NULL);
-    if (status != MX_OK)
+zx_status_t mini_process_cmd_read_reply(zx_handle_t cntrl_channel,
+                                        zx_handle_t* handle) {
+    zx_status_t status = zx_object_wait_one(
+        cntrl_channel, ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+        ZX_TIME_INFINITE, NULL);
+    if (status != ZX_OK)
         return status;
     minip_cmd_t reply;
     uint32_t handle_count = handle ? 1 : 0;
     uint32_t actual_bytes = 0;
     uint32_t actual_handles = 0;
-    status = mx_channel_read(cntrl_channel, 0, &reply, handle, sizeof(reply),
+    status = zx_channel_read(cntrl_channel, 0, &reply, handle, sizeof(reply),
                              handle_count, &actual_bytes, &actual_handles);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     return reply.status;
 }
 
-mx_status_t mini_process_cmd(mx_handle_t cntrl_channel, uint32_t what, mx_handle_t* handle) {
-    mx_status_t status = mini_process_cmd_send(cntrl_channel, what);
-    if (status != MX_OK)
+zx_status_t mini_process_cmd(zx_handle_t cntrl_channel, uint32_t what, zx_handle_t* handle) {
+    zx_status_t status = mini_process_cmd_send(cntrl_channel, what);
+    if (status != ZX_OK)
         return status;
     return mini_process_cmd_read_reply(cntrl_channel, handle);
 }
 
-mx_status_t start_mini_process(mx_handle_t job, mx_handle_t transferred_handle,
-                               mx_handle_t* process, mx_handle_t* thread) {
-    *process = MX_HANDLE_INVALID;
-    mx_handle_t vmar = MX_HANDLE_INVALID;
-    mx_handle_t channel = MX_HANDLE_INVALID;
+zx_status_t start_mini_process(zx_handle_t job, zx_handle_t transferred_handle,
+                               zx_handle_t* process, zx_handle_t* thread) {
+    *process = ZX_HANDLE_INVALID;
+    zx_handle_t vmar = ZX_HANDLE_INVALID;
+    zx_handle_t channel = ZX_HANDLE_INVALID;
 
-    mx_status_t status = mx_process_create(job, "minipr", 6u, 0u, process, &vmar);
-    if (status != MX_OK)
+    zx_status_t status = zx_process_create(job, "minipr", 6u, 0u, process, &vmar);
+    if (status != ZX_OK)
         goto exit;
 
-    *thread = MX_HANDLE_INVALID;
-    status = mx_thread_create(*process, "minith", 6u, 0, thread);
-    if (status != MX_OK)
+    *thread = ZX_HANDLE_INVALID;
+    status = zx_thread_create(*process, "minith", 6u, 0, thread);
+    if (status != ZX_OK)
         goto exit;
 
     status = start_mini_process_etc(*process, *thread, vmar, transferred_handle, &channel);
     // On success the transferred_handle gets consumed.
 exit:
-    if (status != MX_OK) {
-        if (transferred_handle != MX_HANDLE_INVALID)
-            mx_handle_close(transferred_handle);
-        if (*process != MX_HANDLE_INVALID)
-            mx_handle_close(*process);
-        if (*thread != MX_HANDLE_INVALID)
-            mx_handle_close(*thread);
+    if (status != ZX_OK) {
+        if (transferred_handle != ZX_HANDLE_INVALID)
+            zx_handle_close(transferred_handle);
+        if (*process != ZX_HANDLE_INVALID)
+            zx_handle_close(*process);
+        if (*thread != ZX_HANDLE_INVALID)
+            zx_handle_close(*thread);
     }
 
-    if (channel != MX_HANDLE_INVALID)
-        mx_handle_close(channel);
+    if (channel != ZX_HANDLE_INVALID)
+        zx_handle_close(channel);
 
     return status;
 }
diff --git a/system/ulib/mini-process/rules.mk b/system/ulib/mini-process/rules.mk
index a60d240..ad754fe 100644
--- a/system/ulib/mini-process/rules.mk
+++ b/system/ulib/mini-process/rules.mk
@@ -16,7 +16,7 @@
 
 MODULE_STATIC_LIBS := system/ulib/elfload
 
-MODULE_LIBS := system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/c
 
 MODULE_COMPILEFLAGS += $(NO_SANCOV)
 
diff --git a/system/ulib/mini-process/subprocess.c b/system/ulib/mini-process/subprocess.c
index c162cd7..24c9537 100644
--- a/system/ulib/mini-process/subprocess.c
+++ b/system/ulib/mini-process/subprocess.c
@@ -6,13 +6,13 @@
 #include <mini-process/mini-process.h>
 
 // This function is the entire program that the child process will execute. It
-// gets directly mapped into the child process via mx_vmo_write() so it must not
+// gets directly mapped into the child process via zx_vmo_write() so it must not
 // reference any addressable entity outside it.
 __NO_SAFESTACK
 #ifdef __clang__
 __attribute__((no_sanitize("all")))
 #endif
-void minipr_thread_loop(mx_handle_t channel, uintptr_t fnptr) {
+void minipr_thread_loop(zx_handle_t channel, uintptr_t fnptr) {
     if (fnptr == 0) {
         // In this mode we don't have a VDSO so we don't care what the handle is
         // and therefore we busy-loop. Unless external steps are taken this will
@@ -25,18 +25,18 @@
         // In this mode we do have a VDSO but we are not a real ELF program so
         // we need to receive from the parent the address of the syscalls we can
         // use. So we can bootstrap, kernel has already transferred the address of
-        // mx_channel_read() and the handle to one end of the channel which already
+        // zx_channel_read() and the handle to one end of the channel which already
         // contains a message with the rest of the syscall addresses.
-        __typeof(mx_channel_read)* read_fn = (__typeof(mx_channel_read)*)fnptr;
+        __typeof(zx_channel_read)* read_fn = (__typeof(zx_channel_read)*)fnptr;
 
         uint32_t actual = 0u;
         uint32_t actual_handles = 0u;
-        mx_handle_t handle[2];
+        zx_handle_t handle[2];
         minip_ctx_t ctx;
 
-        mx_status_t status = (*read_fn)(
+        zx_status_t status = (*read_fn)(
                 channel, 0u, &ctx, handle, sizeof(ctx), 1, &actual, &actual_handles);
-        if ((status != MX_OK) || (actual != sizeof(ctx)))
+        if ((status != ZX_OK) || (actual != sizeof(ctx)))
             __builtin_trap();
 
         // The received handle in the |ctx| message does not have any use other than
@@ -45,14 +45,14 @@
         // Acknowledge the initial message.
         uint32_t ack[2] = { actual, actual_handles };
         status = ctx.channel_write(channel, 0u, ack, sizeof(uint32_t) * 2, NULL, 0u);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             __builtin_trap();
 
         do {
             // wait for the next message.
             status = ctx.object_wait_one(
-                channel, MX_CHANNEL_READABLE, MX_TIME_INFINITE, &actual);
-            if (status != MX_OK)
+                channel, ZX_CHANNEL_READABLE, ZX_TIME_INFINITE, &actual);
+            if (status != ZX_OK)
                 break;
 
             minip_cmd_t cmd;
@@ -69,12 +69,12 @@
                 // makes it likely it will reference the data section which
                 // is outside the memory copied to the child.
 
-                handle[0] = MX_HANDLE_INVALID;
-                handle[1] = MX_HANDLE_INVALID;
+                handle[0] = ZX_HANDLE_INVALID;
+                handle[1] = ZX_HANDLE_INVALID;
 
                 if (what & MINIP_CMD_ECHO_MSG) {
                     what &= ~MINIP_CMD_ECHO_MSG;
-                    cmd.status = MX_OK;
+                    cmd.status = ZX_OK;
                     goto reply;
                 }
                 if (what & MINIP_CMD_CREATE_EVENT) {
@@ -92,9 +92,9 @@
 
                     // Test one case of using an invalid handle.  This
                     // tests a double-close of an event handle.
-                    mx_handle_t handle;
-                    if (ctx.event_create(0u, &handle) != MX_OK ||
-                        ctx.handle_close(handle) != MX_OK)
+                    zx_handle_t handle;
+                    if (ctx.event_create(0u, &handle) != ZX_OK ||
+                        ctx.handle_close(handle) != ZX_OK)
                         __builtin_trap();
                     cmd.status = ctx.handle_close(handle);
                     goto reply;
@@ -107,26 +107,26 @@
                     // out of the process (by writing it to a channel).  In
                     // this case, the Handle object still exists inside the
                     // kernel.
-                    mx_handle_t handle;
-                    mx_handle_t channel1;
-                    mx_handle_t channel2;
-                    if (ctx.event_create(0u, &handle) != MX_OK ||
-                        ctx.channel_create(0u, &channel1, &channel2) != MX_OK ||
+                    zx_handle_t handle;
+                    zx_handle_t channel1;
+                    zx_handle_t channel2;
+                    if (ctx.event_create(0u, &handle) != ZX_OK ||
+                        ctx.channel_create(0u, &channel1, &channel2) != ZX_OK ||
                         ctx.channel_write(channel1, 0, NULL, 0,
-                                          &handle, 1) != MX_OK)
+                                          &handle, 1) != ZX_OK)
                         __builtin_trap();
                     // This should produce an error and/or exception.
                     cmd.status = ctx.handle_close(handle);
                     // Clean up.
-                    if (ctx.handle_close(channel1) != MX_OK ||
-                        ctx.handle_close(channel2) != MX_OK)
+                    if (ctx.handle_close(channel1) != ZX_OK ||
+                        ctx.handle_close(channel2) != ZX_OK)
                         __builtin_trap();
                     goto reply;
                 }
 
                 // Neither MINIP_CMD_BUILTIN_TRAP nor MINIP_CMD_EXIT_NORMAL send a
-                // message so the client will get either MX_CHANNEL_PEER_CLOSED if
-                // it's doing a wait or will get MX_ERR_CALL_FAILED of it's doing a
+                // message so the client will get either ZX_CHANNEL_PEER_CLOSED if
+                // it's doing a wait or will get ZX_ERR_CALL_FAILED of it's doing a
                 // channel_call().
 
                 if (what & MINIP_CMD_BUILTIN_TRAP)
@@ -136,16 +136,16 @@
                     ctx.process_exit(0);
 
                 // Did not match any known message.
-                cmd.status = MX_ERR_WRONG_TYPE;
+                cmd.status = ZX_ERR_WRONG_TYPE;
 reply:
-                actual_handles = (handle[0] == MX_HANDLE_INVALID) ? 0u : 1u;
+                actual_handles = (handle[0] == ZX_HANDLE_INVALID) ? 0u : 1u;
                 status = ctx.channel_write(
                     channel, 0u, &cmd, sizeof(cmd), handle, actual_handles);
 
                 // Loop if there are more commands packed in |what|.
             } while (what);
 
-        } while (status == MX_OK);
+        } while (status == ZX_OK);
     }
 
     __builtin_trap();
diff --git a/system/ulib/mini-process/subprocess.h b/system/ulib/mini-process/subprocess.h
index 8f01021..bf49cc9 100644
--- a/system/ulib/mini-process/subprocess.h
+++ b/system/ulib/mini-process/subprocess.h
@@ -4,25 +4,25 @@
 
 #pragma once
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 // This struct defines the first message that the child process gets.
 typedef struct {
-    __typeof(mx_handle_close)*      handle_close;
-    __typeof(mx_object_wait_one)*   object_wait_one;
-    __typeof(mx_object_signal)*     object_signal;
-    __typeof(mx_event_create)*      event_create;
-    __typeof(mx_channel_create)*    channel_create;
-    __typeof(mx_channel_read)*      channel_read;
-    __typeof(mx_channel_write)*     channel_write;
-    __typeof(mx_process_exit)*      process_exit;
+    __typeof(zx_handle_close)*      handle_close;
+    __typeof(zx_object_wait_one)*   object_wait_one;
+    __typeof(zx_object_signal)*     object_signal;
+    __typeof(zx_event_create)*      event_create;
+    __typeof(zx_channel_create)*    channel_create;
+    __typeof(zx_channel_read)*      channel_read;
+    __typeof(zx_channel_write)*     channel_write;
+    __typeof(zx_process_exit)*      process_exit;
 } minip_ctx_t;
 
 // Subsequent messages and replies are of this format. The |what| parameter is
-// transaction friendly so the client can use mx_channel_call().
+// transaction friendly so the client can use zx_channel_call().
 typedef struct {
-    mx_txid_t what;
-    mx_status_t status;
+    zx_txid_t what;
+    zx_status_t status;
 } minip_cmd_t;
 
-void minipr_thread_loop(mx_handle_t channel, uintptr_t fnptr);
+void minipr_thread_loop(zx_handle_t channel, uintptr_t fnptr);
diff --git a/system/ulib/mx/BUILD.gn b/system/ulib/mx/BUILD.gn
deleted file mode 100644
index be456fb..0000000
--- a/system/ulib/mx/BUILD.gn
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2016 The Fuchsia Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-config("mx_config") {
-  include_dirs = [ "include" ]
-}
-
-static_library("mx") {
-  # Don't forget to update rules.mk as well for the Magenta build.
-  sources = [
-    "channel.cpp",
-    "event.cpp",
-    "eventpair.cpp",
-    "fifo.cpp",
-    "include/mx/channel.h",
-    "include/mx/event.h",
-    "include/mx/eventpair.h",
-    "include/mx/fifo.h",
-    "include/mx/handle.h",
-    "include/mx/job.h",
-    "include/mx/log.h",
-    "include/mx/object.h",
-    "include/mx/object_traits.h",
-    "include/mx/port.h",
-    "include/mx/process.h",
-    "include/mx/socket.h",
-    "include/mx/task.h",
-    "include/mx/thread.h",
-    "include/mx/time.h",
-    "include/mx/timer.h",
-    "include/mx/vmar.h",
-    "include/mx/vmo.h",
-    "job.cpp",
-    "log.cpp",
-    "port.cpp",
-    "process.cpp",
-    "socket.cpp",
-    "thread.cpp",
-    "timer.cpp",
-    "vmar.cpp",
-    "vmo.cpp",
-  ]
-
-  public_configs = [ ":mx_config" ]
-
-  libs = [ "magenta" ]
-}
diff --git a/system/ulib/mx/channel.cpp b/system/ulib/mx/channel.cpp
deleted file mode 100644
index 71dbdb0..0000000
--- a/system/ulib/mx/channel.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/channel.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t channel::create(uint32_t flags, channel* endpoint0,
-                            channel* endpoint1) {
-    mx_handle_t h0, h1;
-    mx_status_t result = mx_channel_create(flags, &h0, &h1);
-    endpoint0->reset(h0);
-    endpoint1->reset(h1);
-    return result;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/event.cpp b/system/ulib/mx/event.cpp
deleted file mode 100644
index 2cdf77e..0000000
--- a/system/ulib/mx/event.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/event.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t event::create(uint32_t options, event* result) {
-    mx_handle_t h;
-    mx_status_t status = mx_event_create(options, &h);
-    if (status < 0) {
-        result->reset(MX_HANDLE_INVALID);
-    } else {
-        result->reset(h);
-    }
-    return status;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/eventpair.cpp b/system/ulib/mx/eventpair.cpp
deleted file mode 100644
index 4557121..0000000
--- a/system/ulib/mx/eventpair.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/eventpair.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t eventpair::create(uint32_t flags, eventpair* endpoint0,
-                              eventpair* endpoint1) {
-    mx_handle_t h0 = MX_HANDLE_INVALID;
-    mx_handle_t h1 = MX_HANDLE_INVALID;
-    mx_status_t result = mx_eventpair_create(flags, &h0, &h1);
-    endpoint0->reset(h0);
-    endpoint1->reset(h1);
-    return result;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/fifo.cpp b/system/ulib/mx/fifo.cpp
deleted file mode 100644
index 4c8411a..0000000
--- a/system/ulib/mx/fifo.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/fifo.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t fifo::create(uint32_t elem_count, uint32_t elem_size,
-                         uint32_t options, fifo* out0, fifo* out1) {
-    mx_handle_t h0 = MX_HANDLE_INVALID, h1 = MX_HANDLE_INVALID;
-    mx_status_t result = mx_fifo_create(elem_count, elem_size, options, &h0, &h1);
-    out0->reset(h0);
-    out1->reset(h1);
-    return result;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/channel.h b/system/ulib/mx/include/mx/channel.h
deleted file mode 100644
index df21f95..0000000
--- a/system/ulib/mx/include/mx/channel.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/handle.h>
-#include <mx/object.h>
-
-namespace mx {
-
-class channel : public object<channel> {
-public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_CHANNEL;
-
-    constexpr channel() = default;
-
-    explicit channel(mx_handle_t value) : object(value) {}
-
-    explicit channel(handle&& h) : object(h.release()) {}
-
-    channel(channel&& other) : object(other.release()) {}
-
-    channel& operator=(channel&& other) {
-        reset(other.release());
-        return *this;
-    }
-
-    static mx_status_t create(uint32_t flags, channel* endpoint0,
-                              channel* endpoint1);
-
-    mx_status_t read(uint32_t flags, void* bytes, uint32_t num_bytes,
-                     uint32_t* actual_bytes, mx_handle_t* handles,
-                     uint32_t num_handles, uint32_t* actual_handles) const {
-        return mx_channel_read(get(), flags, bytes, handles, num_bytes,
-                               num_handles, actual_bytes, actual_handles);
-    }
-
-    mx_status_t write(uint32_t flags, const void* bytes, uint32_t num_bytes,
-                      const mx_handle_t* handles, uint32_t num_handles) const {
-        return mx_channel_write(get(), flags, bytes, num_bytes, handles,
-                                num_handles);
-    }
-
-    mx_status_t call(uint32_t flags, mx_time_t deadline,
-                     const mx_channel_call_args_t* args,
-                     uint32_t* actual_bytes, uint32_t* actual_handles,
-                     mx_status_t* read_status) const {
-        return mx_channel_call(get(), flags, deadline, args, actual_bytes,
-                               actual_handles, read_status);
-    }
-};
-
-using unowned_channel = const unowned<channel>;
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/fifo.h b/system/ulib/mx/include/mx/fifo.h
deleted file mode 100644
index b248e40..0000000
--- a/system/ulib/mx/include/mx/fifo.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/handle.h>
-#include <mx/object.h>
-
-namespace mx {
-
-class fifo : public object<fifo> {
-public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_FIFO;
-
-    constexpr fifo() = default;
-
-    explicit fifo(mx_handle_t value) : object(value) {}
-
-    explicit fifo(handle&& h) : object(h.release()) {}
-
-    fifo(fifo&& other) : object(other.release()) {}
-
-    fifo& operator=(fifo&& other) {
-        reset(other.release());
-        return *this;
-    }
-
-    static mx_status_t create(uint32_t elem_count, uint32_t elem_size,
-                              uint32_t options, fifo* out0, fifo* out1);
-
-    mx_status_t write(const void* buffer, size_t len, uint32_t* actual_entries) const {
-        return mx_fifo_write(get(), buffer, len, actual_entries);
-    }
-
-    mx_status_t read(void* buffer, size_t len, uint32_t* actual_entries) const {
-        return mx_fifo_read(get(), buffer, len, actual_entries);
-    }
-};
-
-using unowned_fifo = const unowned<fifo>;
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/job.h b/system/ulib/mx/include/mx/job.h
deleted file mode 100644
index 5b6e115..0000000
--- a/system/ulib/mx/include/mx/job.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/task.h>
-#include <magenta/process.h>
-
-namespace mx {
-
-class job : public task<job> {
-public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_JOB;
-
-    constexpr job() = default;
-
-    explicit job(mx_handle_t value) : task(value) {}
-
-    explicit job(handle&& h) : task(h.release()) {}
-
-    job(job&& other) : task(other.release()) {}
-
-    job& operator=(job&& other) {
-        reset(other.release());
-        return *this;
-    }
-
-    static mx_status_t create(mx_handle_t parent_job, uint32_t options, job* result);
-
-    mx_status_t set_policy(uint32_t options, uint32_t topic, void* policy, uint32_t count) const {
-      return mx_job_set_policy(get(), options, topic, policy, count);
-    }
-
-    // Ideally this would be called mx::job::default(), but default is a
-    // C++ keyword and cannot be used as a function name.
-    static inline const unowned<job> default_job() {
-        return unowned<job>(mx_job_default());
-    }
-};
-
-using unowned_job = const unowned<job>;
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/log.h b/system/ulib/mx/include/mx/log.h
deleted file mode 100644
index e736e42..0000000
--- a/system/ulib/mx/include/mx/log.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/handle.h>
-#include <mx/object.h>
-
-namespace mx {
-
-class log : public object<log> {
-public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_LOG;
-
-    constexpr log() = default;
-
-    explicit log(mx_handle_t value) : object(value) {}
-
-    explicit log(handle&& h) : object(h.release()) {}
-
-    log(log&& other) : object(other.release()) {}
-
-    log& operator=(log&& other) {
-        reset(other.release());
-        return *this;
-    }
-
-    static mx_status_t create(log* result, uint32_t flags);
-
-    mx_status_t write(uint32_t len, const void* buffer, uint32_t flags) const {
-        return mx_log_write(get(), len, buffer, flags);
-    }
-
-    mx_status_t read(uint32_t len, void* buffer, uint32_t flags) const {
-        return mx_log_read(get(), len, buffer, flags);
-    }
-};
-
-using unowned_log = const unowned<log>;
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/object.h b/system/ulib/mx/include/mx/object.h
deleted file mode 100644
index 90e42bc..0000000
--- a/system/ulib/mx/include/mx/object.h
+++ /dev/null
@@ -1,231 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
-#include <mx/object_traits.h>
-
-namespace mx {
-
-class port;
-
-// Wraps and takes ownership of a handle to an object to provide type-safe
-// access to its operations.  The handle is automatically closed when the
-// wrapper is destroyed.
-template <typename T> class object {
-public:
-    constexpr object() : value_(MX_HANDLE_INVALID) {}
-
-    explicit object(mx_handle_t value) : value_(value) {}
-
-    template <typename U> object(object<U>&& other) : value_(other.release()) {
-        static_assert(is_same<T, void>::value, "Receiver must be compatible.");
-    }
-
-    ~object() { close(); }
-
-    template <typename U> object<T>& operator=(object<U>&& other) {
-        static_assert(is_same<T, void>::value, "Receiver must be compatible.");
-        reset(other.release());
-        return *this;
-    }
-
-    void reset(mx_handle_t value = MX_HANDLE_INVALID) {
-        close();
-        value_ = value;
-    }
-
-    void swap(object<T>& other) {
-        mx_handle_t tmp = value_;
-        value_ = other.value_;
-        other.value_ = tmp;
-    }
-
-    mx_status_t duplicate(mx_rights_t rights, object<T>* result) const {
-        static_assert(object_traits<T>::supports_duplication,
-                      "Receiver must support duplication.");
-        mx_handle_t h = MX_HANDLE_INVALID;
-        mx_status_t status = mx_handle_duplicate(value_, rights, &h);
-        result->reset(h);
-        return status;
-    }
-
-    mx_status_t replace(mx_rights_t rights, object<T>* result) {
-        mx_handle_t h = MX_HANDLE_INVALID;
-        mx_status_t status = mx_handle_replace(value_, rights, &h);
-        // We store MX_HANDLE_INVALID to value_ before calling reset on result
-        // in case result == this.
-        if (status == MX_OK)
-            value_ = MX_HANDLE_INVALID;
-        result->reset(h);
-        return status;
-    }
-
-    mx_status_t wait_one(mx_signals_t signals, mx_time_t deadline,
-                         mx_signals_t* pending) const {
-        return mx_object_wait_one(value_, signals, deadline, pending);
-    }
-
-    mx_status_t wait_async(const object<port>& port, uint64_t key,
-                           mx_signals_t signals, uint32_t options) const {
-        return mx_object_wait_async(value_, port.get(), key, signals, options);
-    }
-
-    static mx_status_t wait_many(mx_wait_item_t* wait_items, uint32_t count, mx_time_t deadline) {
-        return mx_object_wait_many(wait_items, count, deadline);
-    }
-
-    // TODO(abarth): Not all of these methods apply to every type of object. We
-    // should sort out which ones apply where and limit them to the interfaces
-    // where they work.
-
-    mx_status_t signal(uint32_t clear_mask, uint32_t set_mask) const {
-        static_assert(object_traits<T>::supports_user_signal,
-                      "Receiver must support user signals.");
-        return mx_object_signal(get(), clear_mask, set_mask);
-    }
-
-    mx_status_t signal_peer(uint32_t clear_mask, uint32_t set_mask) const {
-        static_assert(object_traits<T>::supports_user_signal,
-                      "Receiver must support user signals.");
-        static_assert(object_traits<T>::has_peer_handle,
-                      "Receiver must have peer object.");
-        return mx_object_signal_peer(get(), clear_mask, set_mask);
-    }
-
-    mx_status_t get_info(uint32_t topic, void* buffer,
-                         size_t buffer_size,
-                         size_t* actual_count, size_t* avail_count) const {
-        return mx_object_get_info(get(), topic, buffer, buffer_size, actual_count, avail_count);
-    }
-
-    mx_status_t get_child(uint64_t koid, mx_rights_t rights,
-                          object<T>* result) const {
-        mx_handle_t h = MX_HANDLE_INVALID;
-        mx_status_t status = mx_object_get_child(value_, koid, rights, &h);
-        result->reset(h);
-        return status;
-    }
-
-    mx_status_t get_property(uint32_t property, void* value,
-                             size_t size) const {
-        return mx_object_get_property(get(), property, value, size);
-    }
-
-    mx_status_t set_property(uint32_t property, const void* value,
-                             size_t size) const {
-        return mx_object_set_property(get(), property, value, size);
-    }
-
-    mx_status_t get_cookie(mx_handle_t scope, uint64_t *cookie) const {
-        return mx_object_get_cookie(get(), scope, cookie);
-    }
-
-    mx_status_t set_cookie(mx_handle_t scope, uint64_t cookie) const {
-        return mx_object_set_cookie(get(), scope, cookie);
-    }
-
-    bool is_valid() const { return value_ != MX_HANDLE_INVALID; }
-    explicit operator bool() const { return is_valid(); }
-
-    mx_handle_t get() const { return value_; }
-
-    // Reset the underlying handle, and then get the address of the
-    // underlying internal handle storage.
-    //
-    // Note: The intended purpose is to facilitate interactions with C
-    // APIs which expect to be provided a pointer to a handle used as
-    // an out parameter.
-    mx_handle_t* reset_and_get_address() {
-        reset();
-        return &value_;
-    }
-
-    __attribute__((warn_unused_result)) mx_handle_t release() {
-        mx_handle_t result = value_;
-        value_ = MX_HANDLE_INVALID;
-        return result;
-    }
-
-private:
-    template <typename A, typename B> struct is_same {
-        static const bool value = false;
-    };
-
-    template <typename A> struct is_same<A, A> {
-        static const bool value = true;
-    };
-
-    object(const object<T>&) = delete;
-
-    void operator=(const object<T>&) = delete;
-
-    void close() {
-        if (value_ != MX_HANDLE_INVALID) {
-            mx_handle_close(value_);
-            value_ = MX_HANDLE_INVALID;
-        }
-    }
-
-    mx_handle_t value_;
-};
-
-template <typename T> bool operator==(const object<T>& a, const object<T>& b) {
-    return a.get() == b.get();
-}
-
-template <typename T> bool operator!=(const object<T>& a, const object<T>& b) {
-    return !(a == b);
-}
-
-template <typename T> bool operator==(mx_handle_t a, const object<T>& b) {
-    return a == b.get();
-}
-
-template <typename T> bool operator!=(mx_handle_t a, const object<T>& b) {
-    return !(a == b);
-}
-
-template <typename T> bool operator==(const object<T>& a, mx_handle_t b) {
-    return a.get() == b;
-}
-
-template <typename T> bool operator!=(const object<T>& a, mx_handle_t b) {
-    return !(a == b);
-}
-
-// Wraps a handle to an object to provide type-safe access to its operations
-// but does not take ownership of it.  The handle is not closed when the
-// wrapper is destroyed.
-//
-// All instances of unowned<T> must be const.  They cannot be stored, copied,
-// or moved but can be passed by reference in the form of a const T& or used
-// as a temporary.
-//
-// void do_something(const mx::event& event);
-//
-// void example(mx_handle_t event_handle) {
-//     do_something(unowned_event::wrap(event_handle));
-// }
-template <typename T>
-class unowned final : public T {
-public:
-    unowned(unowned&& other) : T(other.release()) {}
-
-    ~unowned() {
-        mx_handle_t h = this->release();
-        static_cast<void>(h);
-    }
-
-    static const unowned wrap(mx_handle_t h) { return unowned(h); }
-
-private:
-    friend T;
-
-    explicit unowned(mx_handle_t h) : T(h) {}
-};
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/port.h b/system/ulib/mx/include/mx/port.h
deleted file mode 100644
index da8698a..0000000
--- a/system/ulib/mx/include/mx/port.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/handle.h>
-#include <mx/object.h>
-
-namespace mx {
-
-class port : public object<port> {
-public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_PORT;
-
-    constexpr port() = default;
-
-    explicit port(mx_handle_t value) : object(value) {}
-
-    explicit port(handle&& h) : object(h.release()) {}
-
-    port(port&& other) : object(other.release()) {}
-
-    port& operator=(port&& other) {
-        reset(other.release());
-        return *this;
-    }
-
-    static mx_status_t create(uint32_t options, port* result);
-
-    mx_status_t queue(const void* packet, size_t size) const {
-        return mx_port_queue(get(), packet, size);
-    }
-
-    mx_status_t wait(mx_time_t deadline, void* packet, size_t size) const {
-        return mx_port_wait(get(), deadline, packet, size);
-    }
-
-    mx_status_t cancel(mx_handle_t source, uint64_t key) const {
-        return mx_port_cancel(get(), source, key);
-    }
-};
-
-using unowned_port = const unowned<port>;
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/socket.h b/system/ulib/mx/include/mx/socket.h
deleted file mode 100644
index 63d05ff..0000000
--- a/system/ulib/mx/include/mx/socket.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/handle.h>
-#include <mx/object.h>
-
-namespace mx {
-
-class socket : public object<socket> {
-public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_SOCKET;
-
-    constexpr socket() = default;
-
-    explicit socket(mx_handle_t value) : object(value) {}
-
-    explicit socket(handle&& h) : object(h.release()) {}
-
-    socket(socket&& other) : object(other.release()) {}
-
-    socket& operator=(socket&& other) {
-        reset(other.release());
-        return *this;
-    }
-
-    static mx_status_t create(uint32_t flags, socket* endpoint0,
-                              socket* endpoint1);
-
-    mx_status_t write(uint32_t flags, const void* buffer, size_t len,
-                      size_t* actual) const {
-        return mx_socket_write(get(), flags, buffer, len, actual);
-    }
-
-    mx_status_t read(uint32_t flags, void* buffer, size_t len,
-                     size_t* actual) const {
-        return mx_socket_read(get(), flags, buffer, len, actual);
-    }
-};
-
-using unowned_socket = const unowned<socket>;
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/task.h b/system/ulib/mx/include/mx/task.h
deleted file mode 100644
index 7d3c3aa..0000000
--- a/system/ulib/mx/include/mx/task.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/handle.h>
-#include <mx/object.h>
-
-namespace mx {
-
-template <typename T = void> class task : public object<T> {
-public:
-    constexpr task() = default;
-
-    explicit task(mx_handle_t value) : object<T>(value) {}
-
-    explicit task(handle&& h) : object<T>(h.release()) {}
-
-    task(task&& other) : object<T>(other.release()) {}
-
-    mx_status_t resume(uint32_t options) const {
-        return mx_task_resume(object<T>::get(), options);
-    }
-
-    // TODO(abarth): mx_task_bind_exception_port
-
-    mx_status_t kill() const { return mx_task_kill(object<T>::get()); }
-
-    mx_status_t suspend() const { return mx_task_suspend(object<T>::get()); }
-};
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/time.h b/system/ulib/mx/include/mx/time.h
deleted file mode 100644
index ddb0edf..0000000
--- a/system/ulib/mx/include/mx/time.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-namespace time {
-
-inline mx_time_t get(uint32_t clock_id) {
-    return mx_time_get(clock_id);
-}
-
-} // namespace time
-
-inline mx_status_t nanosleep(mx_time_t deadline) {
-    return mx_nanosleep(deadline);
-}
-
-inline mx_time_t deadline_after(mx_duration_t nanoseconds) {
-    return mx_deadline_after(nanoseconds);
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/timer.h b/system/ulib/mx/include/mx/timer.h
deleted file mode 100644
index a4c983c..0000000
--- a/system/ulib/mx/include/mx/timer.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/handle.h>
-#include <mx/object.h>
-
-#include <magenta/types.h>
-
-namespace mx {
-
-class timer : public object<timer> {
-public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_TIMER;
-
-    constexpr timer() = default;
-
-    explicit timer(mx_handle_t value) : object(value) {}
-
-    explicit timer(handle&& h) : object(h.release()) {}
-
-    timer(timer&& other) : object(other.release()) {}
-
-    timer& operator=(timer&& other) {
-        reset(other.release());
-        return *this;
-    }
-
-    static mx_status_t create(uint32_t options, uint32_t clock_id, timer* result);
-
-    mx_status_t set(mx_time_t deadline, mx_duration_t slack) const {
-        return mx_timer_set(get(), deadline, slack);
-    }
-
-    mx_status_t cancel() const {
-        return mx_timer_cancel(get());
-    }
-};
-
-using unowned_timer = const unowned<timer>;
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/vmar.h b/system/ulib/mx/include/mx/vmar.h
deleted file mode 100644
index 440007c..0000000
--- a/system/ulib/mx/include/mx/vmar.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/object.h>
-#include <mx/vmo.h>
-#include <magenta/process.h>
-
-namespace mx {
-
-// A wrapper for handles to VMARs.  Note that vmar::~vmar() does not execute
-// vmar::destroy(), it just closes the handle.
-class vmar : public object<vmar> {
-public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_VMAR;
-
-    constexpr vmar() = default;
-
-    explicit vmar(mx_handle_t value) : object(value) {}
-
-    explicit vmar(handle&& h) : object(h.release()) {}
-
-    vmar(vmar&& other) : vmar(other.release()) {}
-
-    vmar& operator=(vmar&& other) {
-        reset(other.release());
-        return *this;
-    }
-
-    mx_status_t map(size_t vmar_offset, const vmo& vmo_handle, uint64_t vmo_offset,
-                    size_t len, uint32_t flags, uintptr_t* ptr) const {
-        return mx_vmar_map(get(), vmar_offset, vmo_handle.get(), vmo_offset, len, flags, ptr);
-    }
-
-    mx_status_t unmap(uintptr_t address, size_t len) const {
-        return mx_vmar_unmap(get(), address, len);
-    }
-
-    mx_status_t protect(uintptr_t address, size_t len, uint32_t prot) const {
-        return mx_vmar_protect(get(), address, len, prot);
-    }
-
-    mx_status_t destroy() const {
-        return mx_vmar_destroy(get());
-    }
-
-    mx_status_t allocate(size_t offset, size_t size, uint32_t flags,
-                         vmar* child, uintptr_t* child_addr) const;
-
-    static inline const unowned<vmar> root_self() {
-        return unowned<vmar>(mx_vmar_root_self());
-    }
-};
-
-using unowned_vmar = const unowned<vmar>;
-
-} // namespace mx
diff --git a/system/ulib/mx/include/mx/vmo.h b/system/ulib/mx/include/mx/vmo.h
deleted file mode 100644
index b77f019..0000000
--- a/system/ulib/mx/include/mx/vmo.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <mx/handle.h>
-#include <mx/object.h>
-
-namespace mx {
-
-class vmo : public object<vmo> {
-public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_VMO;
-
-    constexpr vmo() = default;
-
-    explicit vmo(mx_handle_t value) : object(value) {}
-
-    explicit vmo(handle&& h) : object(h.release()) {}
-
-    vmo(vmo&& other) : object(other.release()) {}
-
-    vmo& operator=(vmo&& other) {
-        reset(other.release());
-        return *this;
-    }
-
-    static mx_status_t create(uint64_t size, uint32_t options, vmo* result);
-
-    mx_status_t read(void* data, uint64_t offset, size_t len,
-                     size_t* actual) const {
-        return mx_vmo_read(get(), data, offset, len, actual);
-    }
-
-    mx_status_t write(const void* data, uint64_t offset, size_t len,
-                      size_t* actual) const {
-        return mx_vmo_write(get(), data, offset, len, actual);
-    }
-
-    mx_status_t get_size(uint64_t* size) const {
-        return mx_vmo_get_size(get(), size);
-    }
-
-    mx_status_t set_size(uint64_t size) const {
-        return mx_vmo_set_size(get(), size);
-    }
-
-    mx_status_t clone(uint32_t options, uint64_t offset, uint64_t size, vmo* result) const {
-        mx_handle_t h = MX_HANDLE_INVALID;
-        mx_status_t status = mx_vmo_clone(get(), options, offset, size, &h);
-        result->reset(h);
-        return status;
-    }
-
-    mx_status_t op_range(uint32_t op, uint64_t offset, uint64_t size,
-                         void* buffer, size_t buffer_size) const {
-        return mx_vmo_op_range(get(), op, offset, size, buffer, buffer_size);
-    }
-};
-
-using unowned_vmo = const unowned<vmo>;
-
-} // namespace mx
diff --git a/system/ulib/mx/job.cpp b/system/ulib/mx/job.cpp
deleted file mode 100644
index aab0c5a..0000000
--- a/system/ulib/mx/job.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/job.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t job::create(mx_handle_t parent_job, uint32_t flags, job* result) {
-    mx_handle_t h;
-    mx_status_t status = mx_job_create(parent_job, flags, &h);
-    if (status < 0) {
-        result->reset(MX_HANDLE_INVALID);
-    } else {
-        result->reset(h);
-    }
-    return status;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/log.cpp b/system/ulib/mx/log.cpp
deleted file mode 100644
index 6b0e716..0000000
--- a/system/ulib/mx/log.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/log.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t log::create(log* result, uint32_t flags) {
-    mx_status_t status;
-    mx_handle_t h;
-    if ((status = mx_log_create(flags, &h)) < 0) {
-        result->reset(MX_HANDLE_INVALID);
-        return status;
-    } else {
-        result->reset(h);
-        return MX_OK;
-    }
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/port.cpp b/system/ulib/mx/port.cpp
deleted file mode 100644
index 75f50cd..0000000
--- a/system/ulib/mx/port.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/port.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t port::create(uint32_t options, port* result) {
-    mx_handle_t h;
-    mx_status_t status = mx_port_create(options, &h);
-    if (status < 0) {
-        result->reset(MX_HANDLE_INVALID);
-    } else {
-        result->reset(h);
-    }
-    return status;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/process.cpp b/system/ulib/mx/process.cpp
deleted file mode 100644
index 08b4609..0000000
--- a/system/ulib/mx/process.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/process.h>
-
-#include <magenta/syscalls.h>
-
-#include <mx/job.h>
-#include <mx/thread.h>
-#include <mx/vmar.h>
-
-namespace mx {
-
-mx_status_t process::create(const job& job, const char* name, uint32_t name_len, uint32_t flags,
-                            process* proc, vmar* vmar) {
-    mx_handle_t proc_h;
-    mx_handle_t vmar_h;
-    mx_status_t status = mx_process_create(job.get(), name, name_len, flags, &proc_h, &vmar_h);
-    if (status < 0) {
-        proc->reset(MX_HANDLE_INVALID);
-        vmar->reset(MX_HANDLE_INVALID);
-    } else {
-        proc->reset(proc_h);
-        vmar->reset(vmar_h);
-    }
-    return status;
-}
-
-mx_status_t process::start(const thread& thread_handle, uintptr_t entry,
-                           uintptr_t stack, handle arg_handle,
-                           uintptr_t arg2) const {
-    mx_handle_t arg_h = arg_handle.release();
-    mx_status_t result =
-        mx_process_start(get(), thread_handle.get(), entry, stack, arg_h, arg2);
-    if (result < 0)
-        mx_handle_close(arg_h);
-    return result;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/socket.cpp b/system/ulib/mx/socket.cpp
deleted file mode 100644
index a392004..0000000
--- a/system/ulib/mx/socket.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/socket.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t socket::create(uint32_t flags, socket* endpoint0,
-                           socket* endpoint1) {
-    mx_handle_t h0 = MX_HANDLE_INVALID, h1 = MX_HANDLE_INVALID;
-    mx_status_t result = mx_socket_create(flags, &h0, &h1);
-    endpoint0->reset(h0);
-    endpoint1->reset(h1);
-    return result;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/thread.cpp b/system/ulib/mx/thread.cpp
deleted file mode 100644
index 905e4c9..0000000
--- a/system/ulib/mx/thread.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/thread.h>
-
-#include <magenta/syscalls.h>
-
-#include <mx/process.h>
-
-namespace mx {
-
-mx_status_t thread::create(const process& process, const char* name,
-                           uint32_t name_len, uint32_t flags, thread* result) {
-    mx_handle_t h;
-    mx_status_t status =
-        mx_thread_create(process.get(), name, name_len, flags, &h);
-    if (status < 0) {
-        result->reset(MX_HANDLE_INVALID);
-    } else {
-        result->reset(h);
-    }
-    return status;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/timer.cpp b/system/ulib/mx/timer.cpp
deleted file mode 100644
index a98b1df..0000000
--- a/system/ulib/mx/timer.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/timer.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t timer::create(uint32_t options, uint32_t clock_id, timer* result) {
-    mx_handle_t h = MX_HANDLE_INVALID;
-    mx_status_t status = mx_timer_create(options, clock_id, &h);
-    result->reset(h);
-    return status;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/vmar.cpp b/system/ulib/mx/vmar.cpp
deleted file mode 100644
index d7da82f..0000000
--- a/system/ulib/mx/vmar.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/vmar.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t vmar::allocate(size_t offset, size_t size, uint32_t flags,
-                           vmar* child, uintptr_t* child_addr) const {
-    mx_handle_t h;
-    mx_status_t status = mx_vmar_allocate(get(), offset, size, flags, &h, child_addr);
-    if (status == MX_OK) {
-        child->reset(h);
-    } else {
-        child->reset(MX_HANDLE_INVALID);
-    }
-    return status;
-}
-
-} // namespace mx
diff --git a/system/ulib/mx/vmo.cpp b/system/ulib/mx/vmo.cpp
deleted file mode 100644
index 40ae3f5..0000000
--- a/system/ulib/mx/vmo.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mx/vmo.h>
-
-#include <magenta/syscalls.h>
-
-namespace mx {
-
-mx_status_t vmo::create(uint64_t size, uint32_t options, vmo* result) {
-    mx_handle_t h = MX_HANDLE_INVALID;
-    mx_status_t status = mx_vmo_create(size, options, &h);
-    result->reset(h);
-    return status;
-}
-
-} // namespace mx
diff --git a/system/ulib/mxcpp/BUILD.gn b/system/ulib/mxcpp/BUILD.gn
deleted file mode 100644
index a89d9eb..0000000
--- a/system/ulib/mxcpp/BUILD.gn
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2017 The Fuchsia Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-config("mxcpp_config") {
-  include_dirs = [ "include" ]
-}
-
-static_library("mxcpp") {
-  # Don't forget to update rules.mk as well for the Magenta build.
-  sources = [
-    "include/mxcpp/new.h",
-    "new.cpp",
-    "pure_virtual.cpp",
-  ]
-
-  public_configs = [ ":mxcpp_config" ]
-}
diff --git a/system/ulib/mxio/get-vmo.c b/system/ulib/mxio/get-vmo.c
deleted file mode 100644
index 04adaa3..0000000
--- a/system/ulib/mxio/get-vmo.c
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "private.h"
-#include "unistd.h"
-
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-
-#include <mxio/io.h>
-#include <mxio/remoteio.h>
-#include <mxio/vfs.h>
-
-#define MIN_WINDOW (PAGE_SIZE * 4)
-#define MAX_WINDOW ((size_t)64 << 20)
-
-static mx_status_t read_at(mxio_t* io, void* buf, size_t len, off_t offset,
-                           size_t* actual_len) {
-    mx_status_t status;
-    while ((status = mxio_read_at(io, buf, len, offset)) == MX_ERR_SHOULD_WAIT) {
-        status = mxio_wait(io, MXIO_EVT_READABLE, MX_TIME_INFINITE, NULL);
-        if (status != MX_OK)
-            return status;
-    }
-    if (status < 0)
-        return status;
-    if (status == 0) // EOF (?)
-        return MX_ERR_OUT_OF_RANGE;
-    *actual_len = status;
-    return MX_OK;
-}
-
-static mx_status_t read_file_into_vmo(mxio_t* io, mx_handle_t* out_vmo) {
-    mx_handle_t current_vmar_handle = mx_vmar_root_self();
-
-    vnattr_t attr;
-    int r = io->ops->misc(io, MXRIO_STAT, 0, sizeof(attr), &attr, 0);
-    if (r < 0)
-        return MX_ERR_BAD_HANDLE;
-    if (r < (int)sizeof(attr))
-        return MX_ERR_IO;
-
-    uint64_t size = attr.size;
-    uint64_t offset = 0;
-
-    mx_status_t status = mx_vmo_create(size, 0, out_vmo);
-    if (status != MX_OK)
-        return status;
-
-    while (size > 0) {
-        if (size < MIN_WINDOW) {
-            // There is little enough left that copying is less overhead
-            // than fiddling with the page tables.
-            char buffer[PAGE_SIZE];
-            size_t xfer = size < sizeof(buffer) ? size : sizeof(buffer);
-            size_t nread;
-            status = read_at(io, buffer, xfer, offset, &nread);
-            if (status != MX_OK) {
-                mx_handle_close(*out_vmo);
-                return status;
-            }
-            size_t n;
-            status = mx_vmo_write(*out_vmo, buffer, offset, nread, &n);
-            if (status < 0) {
-                mx_handle_close(*out_vmo);
-                return status;
-            }
-            if (n != (size_t)nread) {
-                mx_handle_close(*out_vmo);
-                return MX_ERR_IO;
-            }
-            offset += nread;
-            size -= nread;
-        } else {
-            // Map the VMO into our own address space so we can read into
-            // it directly and avoid double-buffering.
-            size_t chunk = size < MAX_WINDOW ? size : MAX_WINDOW;
-            size_t window = (chunk + PAGE_SIZE - 1) & -PAGE_SIZE;
-            uintptr_t start = 0;
-            status = mx_vmar_map(
-                current_vmar_handle, 0, *out_vmo, offset, window,
-                MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &start);
-            if (status != MX_OK) {
-                mx_handle_close(*out_vmo);
-                return status;
-            }
-            uint8_t* buffer = (void*)start;
-            while (chunk > 0) {
-                size_t nread;
-                status = read_at(io, buffer, chunk, offset, &nread);
-                if (status != MX_OK) {
-                    mx_vmar_unmap(current_vmar_handle, start, window);
-                    mx_handle_close(*out_vmo);
-                    return status;
-                }
-                buffer += nread;
-                offset += nread;
-                size -= nread;
-                chunk -= nread;
-            }
-            mx_vmar_unmap(current_vmar_handle, start, window);
-        }
-    }
-
-    return MX_OK;
-}
-
-static mx_status_t get_file_vmo(mxio_t* io, mx_handle_t* out_vmo) {
-    mx_handle_t vmo;
-    size_t offset, len;
-    mx_status_t status = io->ops->get_vmo(io, &vmo, &offset, &len);
-    if (status != MX_OK)
-        return status;
-    // Clone a private copy of it at the offset/length returned with
-    // the handle.
-    // TODO(mcgrathr): Create a plain read only clone when the feature
-    // is implemented in the VM.
-    status = mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE, offset, len, out_vmo);
-    mx_handle_close(vmo);
-    return status;
-}
-
-mx_status_t mxio_get_vmo(int fd, mx_handle_t* out_vmo) {
-    mxio_t* io = fd_to_io(fd);
-    if (io == NULL)
-        return MX_ERR_BAD_HANDLE;
-
-    mx_handle_t vmo;
-    mx_status_t status = get_file_vmo(io, &vmo);
-    if (status != MX_OK)
-        status = read_file_into_vmo(io, &vmo);
-    mxio_release(io);
-
-    if (status == MX_OK) {
-        status = mx_handle_replace(
-            vmo,
-            MX_RIGHT_READ | MX_RIGHT_EXECUTE | MX_RIGHT_MAP |
-            MX_RIGHT_TRANSFER | MX_RIGHT_DUPLICATE |
-            MX_RIGHT_GET_PROPERTY | MX_RIGHT_SET_PROPERTY,
-            out_vmo);
-        if (status != MX_OK)
-            mx_handle_close(vmo);
-    }
-
-    return status;
-}
-
-mx_status_t mxio_get_exact_vmo(int fd, mx_handle_t* out_vmo) {
-    mxio_t* io = fd_to_io(fd);
-    if (io == NULL)
-        return MX_ERR_BAD_HANDLE;
-
-    mx_handle_t vmo;
-    size_t offset, len;
-    mx_status_t status = io->ops->get_vmo(io, &vmo, &offset, &len);
-    mxio_release(io);
-
-    if (status != MX_OK)
-        return status;
-
-    size_t vmo_size;
-    if (offset != 0 || mx_vmo_get_size(vmo, &vmo_size) != MX_OK || vmo_size != len) {
-        mx_handle_close(vmo);
-        return MX_ERR_NOT_FOUND;
-     }
-
-    *out_vmo = vmo;
-    return MX_OK;
-}
diff --git a/system/ulib/mxio/include/mxio/io.h b/system/ulib/mxio/include/mxio/io.h
deleted file mode 100644
index 9c905ae..0000000
--- a/system/ulib/mxio/include/mxio/io.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <limits.h>
-#include <poll.h>
-#include <stdbool.h>
-#include <unistd.h> // for ssize_t
-
-#include <magenta/types.h>
-#include <magenta/compiler.h>
-
-#include <mxio/limits.h>
-
-// flag on handle args in processargs
-// instructing that this fd should be dup'd to 0/1/2
-// and be used for all of stdio
-#define MXIO_FLAG_USE_FOR_STDIO 0x8000
-
-#define MXIO_NONBLOCKING 1
-
-#define MXIO_PROTOCOL_UNDEFINED 0
-#define MXIO_PROTOCOL_PIPE 1
-#define MXIO_PROTOCOL_REMOTE 2
-#define MXIO_PROTOCOL_VMOFILE 3
-#define MXIO_PROTOCOL_SOCKET 4
-#define MXIO_PROTOCOL_SERVICE 5
-#define MXIO_PROTOCOL_SOCKET_CONNECTED 6
-
-// events for mxio_wait_fd()
-#define MXIO_EVT_READABLE POLLIN
-#define MXIO_EVT_WRITABLE POLLOUT
-#define MXIO_EVT_ERROR POLLERR
-#define MXIO_EVT_PEER_CLOSED POLLRDHUP
-#define MXIO_EVT_ALL (POLLIN | POLLOUT | POLLERR | POLLRDHUP)
-
-__BEGIN_CDECLS
-
-// wait until one or more events are pending
-mx_status_t mxio_wait_fd(int fd, uint32_t events, uint32_t* pending, mx_time_t deadline);
-
-// create a fd that works with wait APIs (epoll, select, etc.) from a handle
-// and expected signals (signals_in/signals_out correspond to POLLIN/POLLOUT
-// events respectively). the handle will be closed when the fd is closed, unless
-// shared_handle is true.
-int mxio_handle_fd(mx_handle_t h, mx_signals_t signals_in, mx_signals_t signals_out, bool shared_handle);
-
-// invoke a raw mxio ioctl
-ssize_t mxio_ioctl(int fd, int op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len);
-
-// create a pipe, installing one half in a fd, returning the other
-// for transport to another process
-mx_status_t mxio_pipe_half(mx_handle_t* handle, uint32_t* type);
-
-// Get a read-only VMO containing the whole contents of the file.
-// This function creates a clone of the underlying VMO when possible, falling
-// back to eagerly reading the contents into a freshly-created VMO.
-mx_status_t mxio_get_vmo(int fd, mx_handle_t* out_vmo);
-
-// Get a read-only handle to the exact VMO used by the file system server to
-// represent the file. This function fails if the server does not have an exact
-// VMO representation of the file (e.g., if mxio_get_vmo would need to copy the
-// data into a new VMO).
-mx_status_t mxio_get_exact_vmo(int fd, mx_handle_t* out_vmo);
-
-// create a fd that is backed by the given range of the vmo.
-// This function takes ownership of the vmo and will close the vmo when the fd
-// is closed.
-int mxio_vmo_fd(mx_handle_t vmo, uint64_t offset, uint64_t length);
-
-__END_CDECLS
diff --git a/system/ulib/mxio/include/mxio/private.h b/system/ulib/mxio/include/mxio/private.h
deleted file mode 100644
index d980147..0000000
--- a/system/ulib/mxio/include/mxio/private.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <stdint.h>
-
-__BEGIN_CDECLS;
-
-// WARNING: These APIs are subject to change
-
-// __mxio_cleanpath cleans an input path, placing the output
-// in out, which is a buffer of at least "PATH_MAX" bytes.
-//
-// 'outlen' returns the length of the path placed in out, and 'is_dir'
-// is set to true if the returned path must be a directory.
-mx_status_t __mxio_cleanpath(const char* in, char* out, size_t* outlen, bool* is_dir);
-
-// WARNING: These interfaces exist to allow integration of mxio file
-// descriptors with handle-centric message loops.  If used incorrectly
-// they can seriously mess up the state of mxio, fds, etc.
-
-typedef struct mxio mxio_t;
-
-
-// This looks up a file descriptor, and if it exists,
-// upreferences the mxio_t under it and returns that.
-//
-// If the fd does not exist, it returns NULL
-mxio_t* __mxio_fd_to_io(int fd);
-
-// Releases a reference on a mxio_t.  Used to "return"
-// a mxio_t obtained from __mxio_fd_to_io() when you're
-// done with it.
-void __mxio_release(mxio_t* io);
-
-
-// This given a mxio_t, and a bitmask of posix-style events
-// (EPOLLIN, EPOLLOUT, EPOLLERR), this returns a handle that
-// may be waited upon and a  bitmask of which signals to
-// wait on for the desired events.
-//
-// The handle belongs to the mxio_t, is not duplicated,
-// and may be closed() by the mxio library but MUST NOT
-// be closed by the caller.
-//
-// If waiting is not supported by this mxio_t, the returned
-// handle is MX_HANDLE_INVALID.
-//
-// This function is only safe to call on a mxio_t you
-// hold a reference to.
-void __mxio_wait_begin(mxio_t* io, uint32_t events,
-                       mx_handle_t* handle_out, mx_signals_t* signals_out);
-
-// This given a set of signals observed on a handle obtained
-// from __mxio_wait_begin() returns a set of posix-style events
-// that are indicated.
-//
-// This function is only safe to call on a mxio_t you
-// hold a reference to.
-void __mxio_wait_end(mxio_t* io, mx_signals_t signals, uint32_t* events_out);
-
-__END_CDECLS;
diff --git a/system/ulib/mxio/include/mxio/socket.h b/system/ulib/mxio/include/mxio/socket.h
deleted file mode 100644
index bc0b26d..0000000
--- a/system/ulib/mxio/include/mxio/socket.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/compiler.h>
-#include <magenta/types.h>
-#include <magenta/device/ioctl.h>
-
-#include <mxio/io.h>
-
-#include <stdint.h>
-
-#include <sys/socket.h>
-#include <netdb.h>
-
-__BEGIN_CDECLS
-
-#define MXRIO_SOCKET_DIR_NONE   "none"
-#define MXRIO_SOCKET_DIR_SOCKET "socket"
-#define MXRIO_SOCKET_DIR_ACCEPT "accept"
-
-// mxio signals
-#define MXSIO_SIGNAL_INCOMING MX_USER_SIGNAL_0
-#define MXSIO_SIGNAL_OUTGOING MX_USER_SIGNAL_1
-#define MXSIO_SIGNAL_ERROR MX_USER_SIGNAL_2
-#define MXSIO_SIGNAL_CONNECTED MX_USER_SIGNAL_3
-#define MXSIO_SIGNAL_HALFCLOSED MX_USER_SIGNAL_4
-
-// MXRIO_GETADDRINFO
-#define MXRIO_GAI_REQ_NODE_MAXLEN 256
-#define MXRIO_GAI_REQ_SERVICE_MAXLEN 256
-
-typedef struct mxrio_gai_req {
-    uint8_t node_is_null;
-    uint8_t service_is_null;
-    uint8_t hints_is_null;
-    uint8_t reserved;
-    uint32_t reserved2;
-    char node[MXRIO_GAI_REQ_NODE_MAXLEN];
-    char service[MXRIO_GAI_REQ_SERVICE_MAXLEN];
-    struct addrinfo hints;
-} mxrio_gai_req_t;
-
-#define MXRIO_GAI_REPLY_MAX 4
-
-typedef struct mxrio_gai_reply {
-    // 'res[0].ai' should be the first field
-    struct {
-        struct addrinfo ai;
-        struct sockaddr_storage addr;
-    } res[MXRIO_GAI_REPLY_MAX];
-    int32_t nres;
-    int32_t retval;
-} mxrio_gai_reply_t;
-
-typedef union {
-    mxrio_gai_req_t req;
-    mxrio_gai_reply_t reply;
-} mxrio_gai_req_reply_t;
-
-// MXRIO_GETSOCKNAME
-// MXRIO_GETPEERNAME
-typedef struct mxrio_sockaddr_reply {
-    struct sockaddr_storage addr;
-    socklen_t len;
-} mxrio_sockaddr_reply_t;
-
-// MXRIO_GETSOCKOPT
-// MXRIO_SETSOCKOPT
-typedef struct mxrio_sockopt_req_reply {
-    int32_t level;
-    int32_t optname;
-    char optval[8];
-    socklen_t optlen;
-} mxrio_sockopt_req_reply_t;
-
-// wire format for datagram messages
-typedef struct mxio_socket_msg {
-    struct sockaddr_storage addr;
-    socklen_t addrlen;
-    int32_t flags;
-    char data[1]; // variable size
-} mxio_socket_msg_t;
-
-#define MXIO_SOCKET_MSG_HEADER_SIZE offsetof(mxio_socket_msg_t, data)
-
-__END_CDECLS
diff --git a/system/ulib/mxio/include/mxio/util.h b/system/ulib/mxio/include/mxio/util.h
deleted file mode 100644
index dfe2a32..0000000
--- a/system/ulib/mxio/include/mxio/util.h
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-#include <magenta/compiler.h>
-#include <stdint.h>
-#include <unistd.h>
-
-__BEGIN_CDECLS
-
-// These routines are "internal" to mxio but used by some companion
-// code like userboot and devmgr
-
-typedef struct mxio mxio_t;
-
-// Utilities to help assemble handles for a new process
-// may return up to MXIO_MAX_HANDLES
-mx_status_t mxio_clone_root(mx_handle_t* handles, uint32_t* types);
-mx_status_t mxio_clone_cwd(mx_handle_t* handles, uint32_t* types);
-mx_status_t mxio_clone_fd(int fd, int newfd, mx_handle_t* handles, uint32_t* types);
-mx_status_t mxio_pipe_pair_raw(mx_handle_t* handles, uint32_t* types);
-mx_status_t mxio_transfer_fd(int fd, int newfd, mx_handle_t* handles, uint32_t* types);
-
-// Attempt to create an mxio fd from some handles and their associated types,
-// as returned from mxio_transfer_fd.
-//
-// Can only create fds around:
-// - Remote IO objects
-// - Pipes
-// - Connected sockets
-//
-// This function transfers ownership of handles to the fd on success, and
-// closes them on failure.
-mx_status_t mxio_create_fd(mx_handle_t* handles, uint32_t* types, size_t hcount, int* fd_out);
-
-typedef struct bootfs_entry bootfs_entry_t;
-
-typedef struct bootfs {
-    mx_handle_t vmo;
-    uint32_t dirsize;
-    void* dir;
-} bootfs_t;
-
-mx_status_t bootfs_create(bootfs_t* bfs, mx_handle_t vmo);
-void bootfs_destroy(bootfs_t* bfs);
-mx_status_t bootfs_open(bootfs_t* bfs, const char* name, mx_handle_t* vmo);
-mx_status_t bootfs_parse(bootfs_t* bfs,
-                         mx_status_t (*cb)(void* cookie, const bootfs_entry_t* entry),
-                         void* cookie);
-
-// used for bootstrap
-void mxio_install_root(mxio_t* root);
-
-// attempt to install a mxio in the unistd fd table
-// if fd >= 0, request a specific fd, and starting_fd is ignored
-// if fd < 0, request the first available fd >= starting_fd
-// returns fd on success
-// the mxio must have been upref'd on behalf of the fdtab first
-int mxio_bind_to_fd(mxio_t* io, int fd, int starting_fd);
-
-// attempt to detach an mxio_t from the fd table
-// returns MX_ERR_INVALID_ARGS if fd is out of range or doesn't exist
-// returns MX_ERR_UNAVAILABLE if the fd is busy or has been dup'd
-// returns mxio_t via io_out with refcount 1 on success
-mx_status_t mxio_unbind_from_fd(int fd, mxio_t** io_out);
-
-// If this fd represents a "service" (an rpc channel speaking
-// a non-mxio protocol), this call will return MX_OK and
-// return the underlying handle.
-// On both success and failure, the fd is effectively closed.
-mx_status_t mxio_get_service_handle(int fd, mx_handle_t* out);
-
-// creates a do-nothing mxio_t
-mxio_t* mxio_null_create(void);
-
-// Wraps a channel with an mxio_t using remote io.
-// Takes ownership of h and e.
-mxio_t* mxio_remote_create(mx_handle_t h, mx_handle_t e);
-
-// Wraps a channel with an mxio_t using an unknown rpc protocl.
-// Takes ownership of h.
-mxio_t* mxio_service_create(mx_handle_t);
-
-// creates a mxio that wraps a log object
-// this will allocate a per-thread buffer (on demand) to assemble
-// entire log-lines and flush them on newline or buffer full.
-mxio_t* mxio_logger_create(mx_handle_t);
-
-// create a mxio that wraps a function
-// used for plumbing stdout/err to logging subsystems, etc
-mxio_t* mxio_output_create(ssize_t (*func)(void* cookie, const void* data, size_t len),
-                           void* cookie);
-
-// Attempt to connect a channel to a named service.
-// On success the channel is connected.  On failure
-// an error is returned and the handle is closed.
-mx_status_t mxio_service_connect(const char* svcpath, mx_handle_t h);
-
-// Attempt to connect a channel to a named service relative to dir.
-// On success the channel is connected.  On failure
-// an error is returned and the handle is closed.
-mx_status_t mxio_service_connect_at(mx_handle_t dir, const char* path, mx_handle_t h);
-
-// Attempt to clone a sevice handle by doing a pipelined
-// CLONE operation, returning the new channel endpoint,
-// or MX_HANDLE_INVALID.
-mx_handle_t mxio_service_clone(mx_handle_t h);
-
-__END_CDECLS
diff --git a/system/ulib/mxio/include/mxio/watcher.h b/system/ulib/mxio/include/mxio/watcher.h
deleted file mode 100644
index 3203e5d..0000000
--- a/system/ulib/mxio/include/mxio/watcher.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/compiler.h>
-#include <mxio/io.h>
-
-__BEGIN_CDECLS
-
-typedef mx_status_t (*watchdir_func_t)(int dirfd, int event, const char* fn, void* cookie);
-
-// This event occurs when a file is added or removed, including
-// (for mxio_watch_directory()) files that already exist.
-#define WATCH_EVENT_ADD_FILE 1
-#define WATCH_EVENT_REMOVE_FILE 2
-
-// This event occurs, once, when mxio_watch_directory() runs
-// out of existing files and has to start waiting for new
-// files to be added.
-#define WATCH_EVENT_IDLE 3
-
-// Call the provided callback (cb) for each file in directory
-// and each time a new file is added to the directory.
-//
-// If the callback returns a status other than MX_OK, watching
-// stops and the callback's status is returned to the caller
-// of mxio_watch_directory.
-//
-// If the deadline expires, MX_ERR_TIMED_OUT is returned to the
-// caller.  A deadline of MX_TIME_INFINITE will never expire.
-//
-// The callback may use MX_ERR_STOP as a way to signal to the
-// caller that it wants to stop because it found what it was
-// looking for, etc -- since this error code is not returned
-// by syscalls or public APIs, the callback does not need to
-// worry about it turning up normally.
-
-mx_status_t mxio_watch_directory(int dirfd, watchdir_func_t cb, mx_time_t deadline, void* cookie);
-
-
-__END_CDECLS
diff --git a/system/ulib/mxio/logger.c b/system/ulib/mxio/logger.c
deleted file mode 100644
index 1112044..0000000
--- a/system/ulib/mxio/logger.c
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mxio/io.h>
-
-#include <stdatomic.h>
-#include <stdlib.h>
-#include <threads.h>
-
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
-#include <magenta/processargs.h>
-
-#include "private.h"
-
-typedef struct mxio_log mxio_log_t;
-struct mxio_log {
-    mxio_t io;
-    mx_handle_t handle;
-};
-
-#define LOGBUF_MAX (MX_LOG_RECORD_MAX - sizeof(mx_log_record_t))
-
-static ssize_t log_write(mxio_t* io, const void* _data, size_t len) {
-    static thread_local struct {
-        unsigned next;
-        char data[LOGBUF_MAX];
-    }* logbuf = NULL;
-
-    mxio_log_t* log_io = (mxio_log_t*)io;
-
-    if (logbuf == NULL) {
-        if ((logbuf = calloc(1, sizeof(*logbuf))) == NULL) {
-            return len;
-        }
-    }
-
-    const char* data = _data;
-    size_t r = len;
-
-    while (len-- > 0) {
-        char c = *data++;
-        if (c == '\n') {
-            mx_log_write(log_io->handle, logbuf->next, logbuf->data, 0);
-            logbuf->next = 0;
-            continue;
-        }
-        if (c < ' ') {
-            continue;
-        }
-        logbuf->data[logbuf->next++] = c;
-        if (logbuf->next == LOGBUF_MAX) {
-            mx_log_write(log_io->handle, logbuf->next, logbuf->data, 0);
-            logbuf->next = 0;
-            continue;
-        }
-    }
-    return r;
-}
-
-static mx_status_t log_close(mxio_t* io) {
-    mxio_log_t* log_io = (mxio_log_t*)io;
-    mx_handle_t h = log_io->handle;
-    log_io->handle = 0;
-    mx_handle_close(h);
-    return MX_OK;
-}
-
-static mx_status_t log_clone(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
-    mxio_log_t* log_io = (mxio_log_t*)io;
-
-    mx_status_t status = mx_handle_duplicate(log_io->handle, MX_RIGHT_SAME_RIGHTS, &handles[0]);
-    if (status < 0) {
-        return status;
-    }
-    types[0] = PA_MXIO_LOGGER;
-    return 1;
-}
-
-static mxio_ops_t log_io_ops = {
-    .read = mxio_default_read,
-    .read_at = mxio_default_read_at,
-    .write = log_write,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mxio_default_recvfrom,
-    .sendto = mxio_default_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
-    .seek = mxio_default_seek,
-    .misc = mxio_default_misc,
-    .close = log_close,
-    .open = mxio_default_open,
-    .clone = log_clone,
-    .ioctl = mxio_default_ioctl,
-    .wait_begin = mxio_default_wait_begin,
-    .wait_end = mxio_default_wait_end,
-    .unwrap = mxio_default_unwrap,
-    .shutdown = mxio_default_shutdown,
-    .posix_ioctl = mxio_default_posix_ioctl,
-    .get_vmo = mxio_default_get_vmo,
-};
-
-mxio_t* mxio_logger_create(mx_handle_t handle) {
-    mxio_log_t* log = calloc(1, sizeof(mxio_log_t));
-    if (log == NULL) {
-        return NULL;
-    }
-    log->io.ops = &log_io_ops;
-    log->io.magic = MXIO_MAGIC;
-    atomic_init(&log->io.refcount, 1);
-    log->handle = handle;
-    return &log->io;
-}
diff --git a/system/ulib/mxio/null.c b/system/ulib/mxio/null.c
deleted file mode 100644
index 15ccfbc..0000000
--- a/system/ulib/mxio/null.c
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdarg.h>
-#include <stdatomic.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <magenta/types.h>
-#include <mxio/io.h>
-
-#include "private.h"
-
-void mxio_free(mxio_t* io) {
-    io->magic = 0xDEAD0123;
-    io->ops = NULL;
-    free(io);
-}
-
-ssize_t mxio_default_read(mxio_t* io, void* _data, size_t len) {
-    return 0;
-}
-
-ssize_t mxio_default_read_at(mxio_t* io, void* _data, size_t len, off_t offset) {
-    return MX_ERR_WRONG_TYPE;
-}
-
-ssize_t mxio_default_write(mxio_t* io, const void* _data, size_t len) {
-    return len;
-}
-
-ssize_t mxio_default_write_at(mxio_t* io, const void* _data, size_t len, off_t offset) {
-    return MX_ERR_WRONG_TYPE;
-}
-
-ssize_t mxio_default_recvfrom(mxio_t* io, void* data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen) {
-    return MX_ERR_WRONG_TYPE;
-}
-
-ssize_t mxio_default_sendto(mxio_t* io, const void* data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen) {
-    return MX_ERR_WRONG_TYPE;
-}
-
-ssize_t mxio_default_recvmsg(mxio_t* io, struct msghdr* msg, int flags) {
-    return MX_ERR_WRONG_TYPE;
-}
-
-ssize_t mxio_default_sendmsg(mxio_t* io, const struct msghdr* msg, int flags) {
-    return MX_ERR_WRONG_TYPE;
-}
-
-off_t mxio_default_seek(mxio_t* io, off_t offset, int whence) {
-    return MX_ERR_WRONG_TYPE;
-}
-
-mx_status_t mxio_default_misc(mxio_t* io, uint32_t op, int64_t off, uint32_t arg, void* data, size_t len) {
-    return MX_ERR_NOT_SUPPORTED;
-}
-
-mx_status_t mxio_default_open(mxio_t* io, const char* path, int32_t flags, uint32_t mode, mxio_t** out) {
-    return MX_ERR_NOT_SUPPORTED;
-}
-
-mx_status_t mxio_default_clone(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
-    return MX_ERR_NOT_SUPPORTED;
-}
-
-mx_status_t mxio_default_unwrap(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
-    return MX_ERR_NOT_SUPPORTED;
-}
-
-mx_status_t mxio_default_shutdown(mxio_t* io, int how) {
-    return MX_ERR_WRONG_TYPE;
-}
-
-mx_status_t mxio_default_close(mxio_t* io) {
-    return MX_OK;
-}
-
-ssize_t mxio_default_ioctl(mxio_t* io, uint32_t op, const void* in_buf,
-                           size_t in_len, void* out_buf, size_t out_len) {
-    return MX_ERR_NOT_SUPPORTED;
-}
-
-void mxio_default_wait_begin(mxio_t* io, uint32_t events,
-                             mx_handle_t* handle, mx_signals_t* _signals) {
-    *handle = MX_HANDLE_INVALID;
-}
-
-void mxio_default_wait_end(mxio_t* io, mx_signals_t signals, uint32_t* _events) {
-}
-
-ssize_t mxio_default_posix_ioctl(mxio_t* io, int req, va_list va) {
-    return MX_ERR_NOT_SUPPORTED;
-}
-
-mx_status_t mxio_default_get_vmo(mxio_t* io, mx_handle_t* out, size_t* off, size_t* len) {
-    return MX_ERR_NOT_SUPPORTED;
-}
-
-static mxio_ops_t mx_null_ops = {
-    .read = mxio_default_read,
-    .read_at = mxio_default_read_at,
-    .write = mxio_default_write,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mxio_default_recvfrom,
-    .sendto = mxio_default_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
-    .seek = mxio_default_seek,
-    .misc = mxio_default_misc,
-    .close = mxio_default_close,
-    .open = mxio_default_open,
-    .clone = mxio_default_clone,
-    .ioctl = mxio_default_ioctl,
-    .wait_begin = mxio_default_wait_begin,
-    .wait_end = mxio_default_wait_end,
-    .unwrap = mxio_default_unwrap,
-    .shutdown = mxio_default_shutdown,
-    .posix_ioctl = mxio_default_posix_ioctl,
-    .get_vmo = mxio_default_get_vmo,
-};
-
-mxio_t* mxio_null_create(void) {
-    mxio_t* io = calloc(1, sizeof(*io));
-    if (io == NULL) {
-        return NULL;
-    }
-    io->ops = &mx_null_ops;
-    io->magic = MXIO_MAGIC;
-    atomic_init(&io->refcount, 1);
-    return io;
-}
diff --git a/system/ulib/mxio/output.c b/system/ulib/mxio/output.c
deleted file mode 100644
index 0ade2e9..0000000
--- a/system/ulib/mxio/output.c
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <mxio/io.h>
-
-#include <stdatomic.h>
-#include <stdlib.h>
-#include <threads.h>
-
-#include <magenta/syscalls.h>
-
-#include "private.h"
-
-typedef struct mxio_out mxio_out_t;
-
-struct mxio_out {
-    mxio_t io;
-    ssize_t (*func)(void* cookie, const void* data, size_t len);
-    void* cookie;
-};
-
-static ssize_t log_write(mxio_t* io, const void* data, size_t len) {
-    mxio_out_t* out = (void*)io;
-    return out->func(out->cookie, data, len);
-}
-
-static mx_status_t log_close(mxio_t* io) {
-    return MX_OK;
-}
-
-static mxio_ops_t out_io_ops = {
-    .read = mxio_default_read,
-    .read_at = mxio_default_read_at,
-    .write = log_write,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mxio_default_recvfrom,
-    .sendto = mxio_default_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
-    .seek = mxio_default_seek,
-    .misc = mxio_default_misc,
-    .close = mxio_default_close,
-    .open = mxio_default_open,
-    .clone = mxio_default_clone,
-    .ioctl = mxio_default_ioctl,
-    .wait_begin = mxio_default_wait_begin,
-    .wait_end = mxio_default_wait_end,
-    .unwrap = mxio_default_unwrap,
-    .shutdown = mxio_default_shutdown,
-    .posix_ioctl = mxio_default_posix_ioctl,
-    .get_vmo = mxio_default_get_vmo,
-};
-
-mxio_t* mxio_output_create(ssize_t (*func)(void* cookie, const void* data, size_t len),
-                           void* cookie) {
-    mxio_out_t* out = calloc(1, sizeof(mxio_out_t));
-    if (out == NULL) {
-        return NULL;
-    }
-    out->io.ops = &out_io_ops;
-    out->io.magic = MXIO_MAGIC;
-    atomic_init(&out->io.refcount, 1);
-    out->func = func;
-    out->cookie = cookie;
-    return &out->io;
-}
diff --git a/system/ulib/mxio/pipe.c b/system/ulib/mxio/pipe.c
deleted file mode 100644
index ea2034e..0000000
--- a/system/ulib/mxio/pipe.c
+++ /dev/null
@@ -1,299 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <limits.h>
-#include <poll.h>
-#include <stdarg.h>
-#include <stdatomic.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/io.h>
-#include <mxio/remoteio.h>
-#include <mxio/util.h>
-#include <mxio/vfs.h>
-
-#include "pipe.h"
-#include "private.h"
-
-ssize_t mx_pipe_read_internal(mx_handle_t h, void* data, size_t len, int nonblock) {
-    // TODO: let the generic read() to do this loop
-    for (;;) {
-        size_t bytes_read;
-        ssize_t r = mx_socket_read(h, 0, data, len, &bytes_read);
-        if (r == MX_OK) {
-            // mx_socket_read() sets *actual to the number of bytes in the buffer when data is NULL
-            // and len is 0. read() should return 0 in that case.
-            if (len == 0) {
-                return 0;
-            } else {
-                return (ssize_t)bytes_read;
-            }
-        } else if (r == MX_ERR_PEER_CLOSED || r == MX_ERR_BAD_STATE) {
-            return 0;
-        }
-        if (r == MX_ERR_SHOULD_WAIT && !nonblock) {
-            mx_signals_t pending;
-            r = mx_object_wait_one(h,
-                                   MX_SOCKET_READABLE | MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED,
-                                   MX_TIME_INFINITE,
-                                   &pending);
-            if (r < 0) {
-                return r;
-            }
-            if (pending & MX_SOCKET_READABLE) {
-                continue;
-            }
-            if (pending & (MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED)) {
-                return 0;
-            }
-            // impossible
-            return MX_ERR_INTERNAL;
-        }
-        return r;
-    }
-}
-
-ssize_t mx_pipe_write_internal(mx_handle_t h, const void* data, size_t len, int nonblock) {
-    // TODO: let the generic write() to do this loop
-    for (;;) {
-        ssize_t r;
-        if ((r = mx_socket_write(h, 0, data, len, &len)) == MX_OK) {
-            return (ssize_t)len;
-        }
-        if (r == MX_ERR_SHOULD_WAIT && !nonblock) {
-            mx_signals_t pending;
-            r = mx_object_wait_one(h,
-                                   MX_SOCKET_WRITABLE | MX_SOCKET_WRITE_DISABLED | MX_SOCKET_PEER_CLOSED,
-                                   MX_TIME_INFINITE,
-                                   &pending);
-            if (r < 0) {
-                return r;
-            }
-            if (pending & MX_SOCKET_WRITABLE) {
-                continue;
-            }
-            if (pending & (MX_SOCKET_WRITE_DISABLED | MX_SOCKET_PEER_CLOSED)) {
-                return MX_ERR_PEER_CLOSED;
-            }
-            // impossible
-            return MX_ERR_INTERNAL;
-        }
-        return r;
-    }
-}
-
-
-ssize_t mx_pipe_write(mxio_t* io, const void* data, size_t len) {
-    mx_pipe_t* p = (mx_pipe_t*)io;
-    return mx_pipe_write_internal(p->h, data, len, io->flags & MXIO_FLAG_NONBLOCK);
-}
-
-ssize_t mx_pipe_read(mxio_t* io, void* data, size_t len) {
-    mx_pipe_t* p = (mx_pipe_t*)io;
-    return mx_pipe_read_internal(p->h, data, len, io->flags & MXIO_FLAG_NONBLOCK);
-}
-mx_status_t mx_pipe_misc(mxio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* data, size_t len) {
-    switch (op) {
-    default:
-        return MX_ERR_NOT_SUPPORTED;
-
-    case MXRIO_STAT: {
-        vnattr_t attr = {};
-        if (maxreply < sizeof(attr)) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        attr.mode = V_TYPE_PIPE | V_IRUSR | V_IWUSR;
-        vnattr_t* attr_out = data;
-        *attr_out = attr;
-        return sizeof(attr);
-    }
-    case MXRIO_FCNTL: {
-        uint32_t* flags = (uint32_t*) data;
-        if (flags) {
-            *flags = 0;
-        }
-        return 0;
-    }
-    }
-}
-
-mx_status_t mx_pipe_close(mxio_t* io) {
-    mx_pipe_t* p = (mx_pipe_t*)io;
-    mx_handle_t h = p->h;
-    p->h = 0;
-    mx_handle_close(h);
-    return 0;
-}
-
-static void mx_pipe_release(mxio_t* io) {
-    mx_pipe_t* p = (mx_pipe_t*)io;
-    mx_handle_close(p->h);
-    free(io);
-}
-
-void mx_pipe_wait_begin(mxio_t* io, uint32_t events, mx_handle_t* handle, mx_signals_t* _signals) {
-    mx_pipe_t* p = (void*)io;
-    *handle = p->h;
-    mx_signals_t signals = 0;
-    if (events & POLLIN) {
-        signals |= MX_SOCKET_READABLE | MX_SOCKET_PEER_CLOSED | MX_SOCKET_READ_DISABLED;
-    }
-    if (events & POLLOUT) {
-        signals |= MX_SOCKET_WRITABLE | MX_SOCKET_WRITE_DISABLED;
-    }
-    if (events & POLLRDHUP) {
-        signals |= MX_SOCKET_PEER_CLOSED | MX_SOCKET_READ_DISABLED;
-    }
-    *_signals = signals;
-}
-
-void mx_pipe_wait_end(mxio_t* io, mx_signals_t signals, uint32_t* _events) {
-    uint32_t events = 0;
-    if (signals & (MX_SOCKET_READABLE | MX_SOCKET_PEER_CLOSED | MX_SOCKET_READ_DISABLED)) {
-        events |= POLLIN;
-    }
-    if (signals & (MX_SOCKET_WRITABLE | MX_SOCKET_WRITE_DISABLED)) {
-        events |= POLLOUT;
-    }
-    if (signals & (MX_SOCKET_PEER_CLOSED | MX_SOCKET_READ_DISABLED)) {
-        events |= POLLRDHUP;
-    }
-    *_events = events;
-}
-
-mx_status_t mx_pipe_clone(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
-    mx_pipe_t* p = (void*)io;
-    mx_status_t status = mx_handle_duplicate(p->h, MX_RIGHT_SAME_RIGHTS, &handles[0]);
-    if (status < 0) {
-        return status;
-    }
-    types[0] = PA_MXIO_PIPE;
-    return 1;
-}
-
-mx_status_t mx_pipe_unwrap(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
-    mx_pipe_t* p = (void*)io;
-    handles[0] = p->h;
-    types[0] = PA_MXIO_PIPE;
-    free(p);
-    return 1;
-}
-
-ssize_t mx_pipe_posix_ioctl(mxio_t* io, int req, va_list va) {
-    mx_pipe_t* p = (void*)io;
-    switch (req) {
-    case FIONREAD: {
-        mx_status_t r;
-        size_t avail;
-        if ((r = mx_socket_read(p->h, 0, NULL, 0, &avail)) < 0) {
-            return r;
-        }
-        if (avail > INT_MAX) {
-            avail = INT_MAX;
-        }
-        int* actual = va_arg(va, int*);
-        *actual = avail;
-        return MX_OK;
-    }
-    default:
-        return MX_ERR_NOT_SUPPORTED;
-    }
-}
-
-static mxio_ops_t mx_pipe_ops = {
-    .read = mx_pipe_read,
-    .read_at = mxio_default_read_at,
-    .write = mx_pipe_write,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mxio_default_recvfrom,
-    .sendto = mxio_default_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
-    .seek = mxio_default_seek,
-    .misc = mx_pipe_misc,
-    .close = mx_pipe_close,
-    .open = mxio_default_open,
-    .clone = mx_pipe_clone,
-    .ioctl = mxio_default_ioctl,
-    .wait_begin = mx_pipe_wait_begin,
-    .wait_end = mx_pipe_wait_end,
-    .unwrap = mx_pipe_unwrap,
-    .shutdown = mxio_default_shutdown,
-    .posix_ioctl = mx_pipe_posix_ioctl,
-    .get_vmo = mxio_default_get_vmo,
-};
-
-mxio_t* mxio_pipe_create(mx_handle_t h) {
-    mx_pipe_t* p = calloc(1, sizeof(*p));
-    if (p == NULL) {
-        mx_handle_close(h);
-        return NULL;
-    }
-    p->io.ops = &mx_pipe_ops;
-    p->io.magic = MXIO_MAGIC;
-    atomic_init(&p->io.refcount, 1);
-    p->h = h;
-    return &p->io;
-}
-
-int mxio_pipe_pair(mxio_t** _a, mxio_t** _b) {
-    mx_handle_t h0, h1;
-    mxio_t *a, *b;
-    mx_status_t r;
-    if ((r = mx_socket_create(0, &h0, &h1)) < 0) {
-        return r;
-    }
-    if ((a = mxio_pipe_create(h0)) == NULL) {
-        mx_handle_close(h1);
-        return MX_ERR_NO_MEMORY;
-    }
-    if ((b = mxio_pipe_create(h1)) == NULL) {
-        mx_pipe_close(a);
-        return MX_ERR_NO_MEMORY;
-    }
-    *_a = a;
-    *_b = b;
-    return 0;
-}
-
-mx_status_t mxio_pipe_pair_raw(mx_handle_t* handles, uint32_t* types) {
-    mx_status_t r;
-    if ((r = mx_socket_create(0, handles, handles + 1)) < 0) {
-        return r;
-    }
-    types[0] = PA_MXIO_PIPE;
-    types[1] = PA_MXIO_PIPE;
-    return 2;
-}
-
-mx_status_t mxio_pipe_half(mx_handle_t* handle, uint32_t* type) {
-    mx_handle_t h0, h1;
-    mx_status_t r;
-    mxio_t* io;
-    int fd;
-    if ((r = mx_socket_create(0, &h0, &h1)) < 0) {
-        return r;
-    }
-    if ((io = mxio_pipe_create(h0)) == NULL) {
-        r = MX_ERR_NO_MEMORY;
-        goto fail;
-    }
-    if ((fd = mxio_bind_to_fd(io, -1, 0)) < 0) {
-        mxio_release(io);
-        r = MX_ERR_NO_RESOURCES;
-        goto fail;
-    }
-    *handle = h1;
-    *type = PA_MXIO_PIPE;
-    return fd;
-
-fail:
-    mx_handle_close(h1);
-    return r;
-}
diff --git a/system/ulib/mxio/pipe.h b/system/ulib/mxio/pipe.h
deleted file mode 100644
index 14dd895..0000000
--- a/system/ulib/mxio/pipe.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <stdint.h>
-#include <mxio/io.h>
-
-#include "private.h"
-
-// This defines operations shared by pipe(2) and socketpair(2) primitives.
-typedef struct mx_pipe {
-    mxio_t io;
-    mx_handle_t h;
-} mx_pipe_t;
-
-ssize_t mx_pipe_read(mxio_t* io, void* data, size_t len);
-ssize_t mx_pipe_write(mxio_t* io, const void* data, size_t len);
-mx_status_t mx_pipe_misc(mxio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* data, size_t len);
-mx_status_t mx_pipe_close(mxio_t* io);
-mx_status_t mx_pipe_clone(mxio_t* io, mx_handle_t* handles, uint32_t* types);
-void mx_pipe_wait_begin(mxio_t* io, uint32_t events, mx_handle_t* handle, mx_signals_t* _signals);
-void mx_pipe_wait_end(mxio_t* io, mx_signals_t signals, uint32_t* _events);
-mx_status_t mx_pipe_unwrap(mxio_t* io, mx_handle_t* handles, uint32_t* types);
-ssize_t mx_pipe_posix_ioctl(mxio_t* io, int req, va_list va);
-
-ssize_t mx_pipe_read_internal(mx_handle_t h, void* data, size_t len, int nonblock);
-ssize_t mx_pipe_write_internal(mx_handle_t h, const void* data, size_t len, int nonblock);
diff --git a/system/ulib/mxio/private-remoteio.h b/system/ulib/mxio/private-remoteio.h
deleted file mode 100644
index 3d87a98..0000000
--- a/system/ulib/mxio/private-remoteio.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include "private.h"
-
-typedef struct mxrio mxrio_t;
-struct mxrio {
-    // base mxio io object
-    mxio_t io;
-
-    // channel handle for rpc
-    mx_handle_t h;
-
-    // event handle for device state signals, or socket handle
-    mx_handle_t h2;
-
-    // transaction id used for synchronous remoteio calls
-    _Atomic mx_txid_t txid;
-};
-
-// These are for the benefit of namespace.c
-// which needs lower level access to remoteio internals
-
-// open operation directly on remoteio handle
-mx_status_t mxrio_open_handle(mx_handle_t h, const char* path, int32_t flags,
-                              uint32_t mode, mxio_t** out);
-
-// open operation directly on remoteio handle
-// returns new remoteio handle on success
-// fails and discards non-REMOTE protocols
-mx_status_t mxrio_open_handle_raw(mx_handle_t h, const char* path, int32_t flags,
-                                  uint32_t mode, mx_handle_t *out);
-
-// open operation directly on remoteio mxio_t
-mx_status_t mxrio_open(mxio_t* io, const char* path, int32_t flags,
-                       uint32_t mode, mxio_t** out);
-
-// misc operation directly on remoteio mxio_t
-mx_status_t mxrio_misc(mxio_t* io, uint32_t op, int64_t off,
-                       uint32_t maxreply, void* ptr, size_t len);
-
-
-// Shared with remotesocket.c
-
-mx_status_t mxrio_close(mxio_t* io);
-
-ssize_t mxrio_ioctl(mxio_t* io, uint32_t op, const void* in_buf,
-                    size_t in_len, void* out_buf, size_t out_len);
-
-mx_status_t mxrio_getobject(mx_handle_t rio_h, uint32_t op, const char* name,
-                            int32_t flags, uint32_t mode,
-                            mxrio_object_t* info);
diff --git a/system/ulib/mxio/private.h b/system/ulib/mxio/private.h
deleted file mode 100644
index 7810476..0000000
--- a/system/ulib/mxio/private.h
+++ /dev/null
@@ -1,223 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#pragma once
-
-#include <magenta/types.h>
-#include <mxio/limits.h>
-#include <stdarg.h>
-#include <stdatomic.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <threads.h>
-
-typedef struct mxio mxio_t;
-typedef struct mxio_namespace mxio_ns_t;
-
-// MXIO provides open/close/read/write io over various transports
-// via the mxio_t interface abstraction.
-//
-// The PIPE protocol uses message ports as simple, no-flow-control
-// io pipes with a maximum message size of MX_PIPE_SIZE.
-//
-// The REMOTEIO protocol uses message ports to implement simple
-// synchronous remoting of read/write/close operations.
-//
-// The NULL protocol absorbs writes and is never readable.
-
-typedef struct mxio_ops {
-    ssize_t (*read)(mxio_t* io, void* data, size_t len);
-    ssize_t (*read_at)(mxio_t* io, void* data, size_t len, off_t offset);
-    ssize_t (*write)(mxio_t* io, const void* data, size_t len);
-    ssize_t (*write_at)(mxio_t* io, const void* data, size_t len, off_t offset);
-    ssize_t (*recvfrom)(mxio_t* io, void* data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen);
-    ssize_t (*sendto)(mxio_t* io, const void* data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen);
-    ssize_t (*recvmsg)(mxio_t* io, struct msghdr* msg, int flags);
-    ssize_t (*sendmsg)(mxio_t* io, const struct msghdr* msg, int flags);
-    off_t (*seek)(mxio_t* io, off_t offset, int whence);
-    mx_status_t (*misc)(mxio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* data, size_t len);
-    mx_status_t (*close)(mxio_t* io);
-    mx_status_t (*open)(mxio_t* io, const char* path, int32_t flags, uint32_t mode, mxio_t** out);
-    mx_status_t (*clone)(mxio_t* io, mx_handle_t* out_handles, uint32_t* out_types);
-    mx_status_t (*unwrap)(mxio_t* io, mx_handle_t* out_handles, uint32_t* out_types);
-    mx_status_t (*shutdown)(mxio_t* io, int how);
-    void (*wait_begin)(mxio_t* io, uint32_t events, mx_handle_t* handle, mx_signals_t* signals);
-    void (*wait_end)(mxio_t* io, mx_signals_t signals, uint32_t* events);
-    ssize_t (*ioctl)(mxio_t* io, uint32_t op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len);
-    ssize_t (*posix_ioctl)(mxio_t* io, int req, va_list va);
-    mx_status_t (*get_vmo)(mxio_t* io, mx_handle_t* out, size_t* off, size_t* len);
-} mxio_ops_t;
-
-// mxio_t flags
-#define MXIO_FLAG_CLOEXEC ((int32_t)1 << 0)
-#define MXIO_FLAG_SOCKET ((int32_t)1 << 1)
-#define MXIO_FLAG_EPOLL ((int32_t)1 << 2)
-#define MXIO_FLAG_WAITABLE ((int32_t)1 << 3)
-#define MXIO_FLAG_SOCKET_CONNECTING ((int32_t)1 << 4)
-#define MXIO_FLAG_SOCKET_CONNECTED ((int32_t)1 << 5)
-#define MXIO_FLAG_NONBLOCK ((int32_t)1 << 6)
-
-// The subset of mxio_t per-fd flags queryable via fcntl.
-// Static assertions in unistd.c ensure we aren't colliding.
-#define MXIO_FD_FLAGS MXIO_FLAG_CLOEXEC
-
-typedef struct mxio {
-    mxio_ops_t* ops;
-    uint32_t magic;
-    atomic_int_fast32_t refcount;
-    int32_t dupcount;
-    int32_t flags;
-} mxio_t;
-
-// Lifecycle notes:
-//
-// Upon creation, mxio objects have a refcount of 1.
-// mxio_acquire() and mxio_release() are used to upref
-// and downref, respectively.  Upon downref to 0,
-// mxio_free() is called, which poisons the object and
-// free()s it.
-//
-// The close hook must be called before free and should
-// only be called once.  In normal use, mxio objects are
-// accessed through the mxio_fdtab, and when close is
-// called they are removed from the fdtab and the reference
-// that the fdtab itself is holding is released, at which
-// point they will be free()'d unless somebody is holding
-// a ref due to an ongoing io transaction, which will
-// certainly fail doe to underlying handles being closed
-// at which point a downref will happen and destruction
-// will follow.
-//
-// dupcount tracks how many fdtab entries an mxio object
-// is in.  close() reduces the dupcount, and only actually
-// closes the underlying object when it reaches zero.
-
-#define MXIO_MAGIC 0x4f49584d // MXIO
-
-static inline ssize_t mxio_read(mxio_t* io, void* data, size_t len) {
-    return io->ops->read(io, data, len);
-}
-static inline ssize_t mxio_read_at(mxio_t* io, void* data, size_t len, off_t offset) {
-    return io->ops->read_at(io, data, len, offset);
-}
-static inline ssize_t mxio_write(mxio_t* io, const void* data, size_t len) {
-    return io->ops->write(io, data, len);
-}
-static inline ssize_t mxio_write_at(mxio_t* io, const void* data, size_t len, off_t offset) {
-    return io->ops->write_at(io, data, len, offset);
-}
-static inline off_t mxio_seek(mxio_t* io, off_t offset, int whence) {
-    return io->ops->seek(io, offset, whence);
-}
-static inline mx_status_t mxio_misc(mxio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* data, size_t len) {
-    return io->ops->misc(io, op, off, maxreply, data, len);
-}
-static inline mx_status_t mxio_open(mxio_t* io, const char* path, int32_t flags, uint32_t mode, mxio_t** out) {
-    return io->ops->open(io, path, flags, mode, out);
-}
-mx_status_t mxio_close(mxio_t* io);
-mx_status_t mxio_wait(mxio_t* io, uint32_t events, mx_time_t deadline,
-                      uint32_t* out_pending);
-
-// Wraps a socket with an mxio_t using simple io.
-// Takes ownership of h.
-mxio_t* mxio_pipe_create(mx_handle_t h);
-
-mx_status_t mxio_pipe_posix_ioctl(mxio_t* io, int req, va_list va);
-
-// Wraps a vmo, offset, length with an mxio_t providing a readonly file.
-// Takens ownership of h.
-mxio_t* mxio_vmofile_create(mx_handle_t h, mx_off_t off, mx_off_t len);
-
-// Wraps a socket with an mxio_t using socket io.
-// Takes ownership of h and s.
-mxio_t* mxio_socket_create(mx_handle_t h, mx_handle_t s, int flags);
-
-// creates a message port and pair of simple io mxio_t's
-int mxio_pipe_pair(mxio_t** a, mxio_t** b);
-
-// create a mxio (if possible) from type, handles and extradata
-mx_status_t mxio_from_handles(uint32_t type, mx_handle_t* handles, int hcount,
-                              void* extra, uint32_t esize, mxio_t** out);
-
-void mxio_free(mxio_t* io);
-
-static inline void mxio_acquire(mxio_t* io) {
-    atomic_fetch_add(&io->refcount, 1);
-}
-
-static inline void mxio_release(mxio_t* io) {
-    if (atomic_fetch_sub(&io->refcount, 1) == 1) {
-        mxio_free(io);
-    }
-}
-
-mxio_t* mxio_ns_open_root(mxio_ns_t* ns);
-
-// io will be consumed by this and must not be shared
-void mxio_chdir(mxio_t* io, const char* path);
-
-// Wraps an arbitrary handle with a mxio_t that works with wait hooks.
-// Takes ownership of handle unless shared_handle is true.
-mxio_t* mxio_waitable_create(mx_handle_t h, mx_signals_t signals_in, mx_signals_t signals_out, bool shared_handle);
-
-void mxio_socket_set_stream_ops(mxio_t* io);
-void mxio_socket_set_dgram_ops(mxio_t* io);
-
-mx_status_t mxio_socket_posix_ioctl(mxio_t* io, int req, va_list va);
-mx_status_t mxio_socket_shutdown(mxio_t* io, int how);
-mx_status_t mxio_socketpair_shutdown(mxio_t* io, int how);
-
-// unsupported / do-nothing hooks shared by implementations
-ssize_t mxio_default_read(mxio_t* io, void* _data, size_t len);
-ssize_t mxio_default_read_at(mxio_t* io, void* _data, size_t len, off_t offset);
-ssize_t mxio_default_write(mxio_t* io, const void* _data, size_t len);
-ssize_t mxio_default_write_at(mxio_t* io, const void* _data, size_t len, off_t offset);
-ssize_t mxio_default_recvfrom(mxio_t* io, void* _data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen);
-ssize_t mxio_default_sendto(mxio_t* io, const void* _data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen);
-ssize_t mxio_default_recvmsg(mxio_t* io, struct msghdr* msg, int flags);
-ssize_t mxio_default_sendmsg(mxio_t* io, const struct msghdr* msg, int flags);
-off_t mxio_default_seek(mxio_t* io, off_t offset, int whence);
-mx_status_t mxio_default_misc(mxio_t* io, uint32_t op, int64_t off, uint32_t arg, void* data, size_t len);
-mx_status_t mxio_default_close(mxio_t* io);
-mx_status_t mxio_default_open(mxio_t* io, const char* path, int32_t flags, uint32_t mode, mxio_t** out);
-mx_status_t mxio_default_clone(mxio_t* io, mx_handle_t* handles, uint32_t* types);
-ssize_t mxio_default_ioctl(mxio_t* io, uint32_t op, const void* in_buf, size_t in_len, void* out_buf, size_t out_len);
-void mxio_default_wait_begin(mxio_t* io, uint32_t events, mx_handle_t* handle, mx_signals_t* _signals);
-void mxio_default_wait_end(mxio_t* io, mx_signals_t signals, uint32_t* _events);
-mx_status_t mxio_default_unwrap(mxio_t* io, mx_handle_t* handles, uint32_t* types);
-mx_status_t mxio_default_shutdown(mxio_t* io, int how);
-ssize_t mxio_default_posix_ioctl(mxio_t* io, int req, va_list va);
-mx_status_t mxio_default_get_vmo(mxio_t* io, mx_handle_t* out, size_t* off, size_t* len);
-
-void __mxio_startup_handles_init(uint32_t num, mx_handle_t handles[],
-                                 uint32_t handle_info[])
-    __attribute__((visibility("hidden")));
-
-void __mxio_rchannel_init(void) __attribute__((visibility("hidden")));
-
-typedef struct {
-    mtx_t lock;
-    mtx_t cwd_lock;
-    bool init;
-    mode_t umask;
-    mxio_t* root;
-    mxio_t* cwd;
-    mxio_t* fdtab[MAX_MXIO_FD];
-    mxio_ns_t* ns;
-    char cwd_path[PATH_MAX];
-} mxio_state_t;
-
-extern mxio_state_t __mxio_global_state;
-
-#define mxio_lock (__mxio_global_state.lock)
-#define mxio_root_handle (__mxio_global_state.root)
-#define mxio_cwd_handle (__mxio_global_state.cwd)
-#define mxio_cwd_lock (__mxio_global_state.cwd_lock)
-#define mxio_cwd_path (__mxio_global_state.cwd_path)
-#define mxio_fdtab (__mxio_global_state.fdtab)
-#define mxio_root_init (__mxio_global_state.init)
-#define mxio_root_ns (__mxio_global_state.ns)
diff --git a/system/ulib/mxio/remoteio.c b/system/ulib/mxio/remoteio.c
deleted file mode 100644
index 68a7ae6..0000000
--- a/system/ulib/mxio/remoteio.c
+++ /dev/null
@@ -1,959 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <assert.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <poll.h>
-#include <pthread.h>
-#include <stdatomic.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <threads.h>
-
-#include <magenta/device/device.h>
-#include <magenta/device/ioctl.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-
-#include <mxio/debug.h>
-#include <mxio/io.h>
-#include <mxio/namespace.h>
-#include <mxio/remoteio.h>
-#include <mxio/util.h>
-
-#include "private-remoteio.h"
-
-#define MXDEBUG 0
-
-// POLL_MASK and POLL_SHIFT intend to convert the lower five POLL events into
-// MX_USER_SIGNALs and vice-versa. Other events need to be manually converted to
-// an mx_signal_t, if they are desired.
-#define POLL_SHIFT  24
-#define POLL_MASK   0x1F
-
-static_assert(MX_USER_SIGNAL_0 == (1 << POLL_SHIFT), "");
-static_assert((POLLIN << POLL_SHIFT) == DEVICE_SIGNAL_READABLE, "");
-static_assert((POLLPRI << POLL_SHIFT) == DEVICE_SIGNAL_OOB, "");
-static_assert((POLLOUT << POLL_SHIFT) == DEVICE_SIGNAL_WRITABLE, "");
-static_assert((POLLERR << POLL_SHIFT) == DEVICE_SIGNAL_ERROR, "");
-static_assert((POLLHUP << POLL_SHIFT) == DEVICE_SIGNAL_HANGUP, "");
-
-static pthread_key_t rchannel_key;
-
-static void rchannel_cleanup(void* data) {
-    if (data == NULL) {
-        return;
-    }
-    mx_handle_t* handles = (mx_handle_t*)data;
-    if (handles[0] != MX_HANDLE_INVALID)
-        mx_handle_close(handles[0]);
-    if (handles[1] != MX_HANDLE_INVALID)
-        mx_handle_close(handles[1]);
-    free(handles);
-}
-
-void __mxio_rchannel_init(void) {
-    if (pthread_key_create(&rchannel_key, &rchannel_cleanup) != 0)
-        abort();
-}
-
-static const char* _opnames[] = MXRIO_OPNAMES;
-const char* mxio_opname(uint32_t op) {
-    op = MXRIO_OPNAME(op);
-    if (op < MXRIO_NUM_OPS) {
-        return _opnames[op];
-    } else {
-        return "unknown";
-    }
-}
-
-static bool is_message_valid(mxrio_msg_t* msg) {
-    if ((msg->datalen > MXIO_CHUNK_SIZE) ||
-        (msg->hcount > MXIO_MAX_HANDLES)) {
-        return false;
-    }
-    return true;
-}
-
-static bool is_message_reply_valid(mxrio_msg_t* msg, uint32_t size) {
-    if ((size < MXRIO_HDR_SZ) ||
-        (msg->datalen != (size - MXRIO_HDR_SZ))) {
-        return false;
-    }
-    return is_message_valid(msg);
-}
-
-static void discard_handles(mx_handle_t* handles, unsigned count) {
-    while (count-- > 0) {
-        mx_handle_close(*handles++);
-    }
-}
-
-mx_status_t mxrio_handle_rpc(mx_handle_t h, mxrio_msg_t* msg, mxrio_cb_t cb, void* cookie) {
-    mx_status_t r;
-
-    // NOTE: hcount intentionally received out-of-bound from the message to
-    // avoid letting "client-supplied" bytes override the REAL hcount value.
-    uint32_t hcount = 0;
-    uint32_t dsz = sizeof(mxrio_msg_t);
-    if ((r = mx_channel_read(h, 0, msg, msg->handle, dsz, MXIO_MAX_HANDLES, &dsz, &hcount)) < 0) {
-        return r;
-    }
-    // Now, "msg->hcount" can be trusted once again.
-    msg->hcount = hcount;
-
-    if (!is_message_reply_valid(msg, dsz)) {
-        discard_handles(msg->handle, msg->hcount);
-        return MX_ERR_INVALID_ARGS;
-    }
-
-    bool is_close = (MXRIO_OP(msg->op) == MXRIO_CLOSE);
-
-    xprintf("handle_rio: op=%s arg=%d len=%u hsz=%d\n",
-            mxio_opname(msg->op), msg->arg, msg->datalen, msg->hcount);
-
-    if ((msg->arg = cb(msg, cookie)) == ERR_DISPATCHER_INDIRECT) {
-        // callback is handling the reply itself
-        // and took ownership of the reply handle
-        return MX_OK;
-    }
-    if ((msg->arg < 0) || !is_message_valid(msg)) {
-        // in the event of an error response or bad message
-        // release all the handles and data payload
-        discard_handles(msg->handle, msg->hcount);
-        msg->datalen = 0;
-        msg->hcount = 0;
-        // specific errors are prioritized over the bad
-        // message case which we represent as MX_ERR_INTERNAL
-        // to differentiate from MX_ERR_IO on the near side
-        // TODO(MG-974): consider a better error code
-        msg->arg = (msg->arg < 0) ? msg->arg : MX_ERR_INTERNAL;
-    }
-
-    msg->op = MXRIO_STATUS;
-    if ((r = mx_channel_write(h, 0, msg, MXRIO_HDR_SZ + msg->datalen, msg->handle, msg->hcount)) < 0) {
-        discard_handles(msg->handle, msg->hcount);
-    }
-    if (is_close) {
-        // signals to not perform a close callback
-        return ERR_DISPATCHER_DONE;
-    } else {
-        return r;
-    }
-}
-
-mx_status_t mxrio_handle_close(mxrio_cb_t cb, void* cookie) {
-    mxrio_msg_t msg;
-
-    // remote side was closed;
-    msg.op = MXRIO_CLOSE;
-    msg.arg = 0;
-    msg.datalen = 0;
-    msg.hcount = 0;
-    cb(&msg, cookie);
-    return MX_OK;
-}
-
-mx_status_t mxrio_handler(mx_handle_t h, void* _cb, void* cookie) {
-    mxrio_cb_t cb = _cb;
-
-    if (h == MX_HANDLE_INVALID) {
-        return mxrio_handle_close(cb, cookie);
-    } else {
-        mxrio_msg_t msg;
-        return mxrio_handle_rpc(h, &msg, cb, cookie);
-    }
-}
-
-void mxrio_txn_handoff(mx_handle_t srv, mx_handle_t reply, mxrio_msg_t* msg) {
-    msg->txid = 0;
-    msg->handle[0] = reply;
-    msg->hcount = 1;
-
-    mx_status_t r;
-    uint32_t dsize = MXRIO_HDR_SZ + msg->datalen;
-    if ((r = mx_channel_write(srv, 0, msg, dsize, msg->handle, msg->hcount)) < 0) {
-        // nothing to do but inform the caller that we failed
-        struct {
-            mx_status_t status;
-            uint32_t type;
-        } error = { r, 0 };
-        mx_channel_write(reply, 0, &error, sizeof(error), NULL, 0);
-        mx_handle_close(reply);
-    }
-}
-
-// on success, msg->hcount indicates number of valid handles in msg->handle
-// on error there are never any handles
-static mx_status_t mxrio_txn(mxrio_t* rio, mxrio_msg_t* msg) {
-    if (!is_message_valid(msg)) {
-        return MX_ERR_INVALID_ARGS;
-    }
-
-    msg->txid = atomic_fetch_add(&rio->txid, 1);
-    xprintf("txn h=%x txid=%x op=%d len=%u\n", rio->h, msg->txid, msg->op, msg->datalen);
-
-    mx_status_t r;
-    mx_status_t rs = MX_ERR_INTERNAL;
-    uint32_t dsize;
-
-    mx_channel_call_args_t args;
-    args.wr_bytes = msg;
-    args.wr_handles = msg->handle;
-    args.rd_bytes = msg;
-    args.rd_handles = msg->handle;
-    args.wr_num_bytes = MXRIO_HDR_SZ + msg->datalen;
-    args.wr_num_handles = msg->hcount;
-    args.rd_num_bytes = MXRIO_HDR_SZ + MXIO_CHUNK_SIZE;
-    args.rd_num_handles = MXIO_MAX_HANDLES;
-
-    r = mx_channel_call(rio->h, 0, MX_TIME_INFINITE, &args, &dsize, &msg->hcount, &rs);
-    if (r < 0) {
-        if (r == MX_ERR_CALL_FAILED) {
-            // read phase failed, true status is in rs
-            msg->hcount = 0;
-            return rs;
-        } else {
-            // write phase failed, we must discard the handles
-            goto fail_discard_handles;
-        }
-    }
-
-    // check for protocol errors
-    if (!is_message_reply_valid(msg, dsize) ||
-        (MXRIO_OP(msg->op) != MXRIO_STATUS)) {
-        r = MX_ERR_IO;
-        goto fail_discard_handles;
-    }
-    // check for remote error
-    if ((r = msg->arg) < 0) {
-        goto fail_discard_handles;
-    }
-    return r;
-
-fail_discard_handles:
-    // We failed either writing at all (still have the handles)
-    // or after reading (need to abandon any handles we received)
-    discard_handles(msg->handle, msg->hcount);
-    msg->hcount = 0;
-    return r;
-}
-
-ssize_t mxrio_ioctl(mxio_t* io, uint32_t op, const void* in_buf,
-                    size_t in_len, void* out_buf, size_t out_len) {
-    mxrio_t* rio = (mxrio_t*)io;
-    const uint8_t* data = in_buf;
-    mx_status_t r = 0;
-    mxrio_msg_t msg;
-
-    if (in_len > MXIO_IOCTL_MAX_INPUT || out_len > MXIO_CHUNK_SIZE) {
-        return MX_ERR_INVALID_ARGS;
-    }
-
-    memset(&msg, 0, MXRIO_HDR_SZ);
-    msg.op = MXRIO_IOCTL;
-    msg.datalen = in_len;
-    msg.arg = out_len;
-    msg.arg2.op = op;
-
-    switch (IOCTL_KIND(op)) {
-    case IOCTL_KIND_GET_HANDLE:
-        if (out_len < sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        break;
-    case IOCTL_KIND_GET_TWO_HANDLES:
-        if (out_len < 2 * sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        break;
-    case IOCTL_KIND_GET_THREE_HANDLES:
-        if (out_len < 3 * sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        break;
-    case IOCTL_KIND_SET_HANDLE:
-        msg.op = MXRIO_IOCTL_1H;
-        if (in_len < sizeof(mx_handle_t)) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        msg.hcount = 1;
-        msg.handle[0] = *((mx_handle_t*) in_buf);
-        break;
-    }
-
-    memcpy(msg.data, data, in_len);
-
-    if ((r = mxrio_txn(rio, &msg)) < 0) {
-        return r;
-    }
-
-    size_t copy_len = msg.datalen;
-    if (msg.datalen > out_len) {
-        copy_len = out_len;
-    }
-
-    memcpy(out_buf, msg.data, copy_len);
-
-    int handles = 0;
-    switch (IOCTL_KIND(op)) {
-        case IOCTL_KIND_GET_HANDLE:
-            handles = (msg.hcount > 0 ? 1 : 0);
-            if (handles) {
-                memcpy(out_buf, msg.handle, sizeof(mx_handle_t));
-            } else {
-                memset(out_buf, 0, sizeof(mx_handle_t));
-            }
-            break;
-        case IOCTL_KIND_GET_TWO_HANDLES:
-            handles = (msg.hcount > 2 ? 2 : msg.hcount);
-            if (handles) {
-                memcpy(out_buf, msg.handle, handles * sizeof(mx_handle_t));
-            }
-            if (handles < 2) {
-                memset(out_buf, 0, (2 - handles) * sizeof(mx_handle_t));
-            }
-            break;
-        case IOCTL_KIND_GET_THREE_HANDLES:
-            handles = (msg.hcount > 3 ? 3 : msg.hcount);
-            if (handles) {
-                memcpy(out_buf, msg.handle, handles * sizeof(mx_handle_t));
-            }
-            if (handles < 3) {
-                memset(out_buf, 0, (3 - handles) * sizeof(mx_handle_t));
-            }
-            break;
-    }
-    discard_handles(msg.handle + handles, msg.hcount - handles);
-
-    return r;
-}
-
-static ssize_t write_common(uint32_t op, mxio_t* io, const void* _data, size_t len, off_t offset) {
-    mxrio_t* rio = (mxrio_t*)io;
-    const uint8_t* data = _data;
-    ssize_t count = 0;
-    mx_status_t r = 0;
-    mxrio_msg_t msg;
-    ssize_t xfer;
-
-    while (len > 0) {
-        xfer = (len > MXIO_CHUNK_SIZE) ? MXIO_CHUNK_SIZE : len;
-
-        memset(&msg, 0, MXRIO_HDR_SZ);
-        msg.op = op;
-        msg.datalen = xfer;
-        if (op == MXRIO_WRITE_AT)
-            msg.arg2.off = offset;
-        memcpy(msg.data, data, xfer);
-
-        if ((r = mxrio_txn(rio, &msg)) < 0) {
-            break;
-        }
-        discard_handles(msg.handle, msg.hcount);
-
-        if (r > xfer) {
-            r = MX_ERR_IO;
-            break;
-        }
-        count += r;
-        data += r;
-        len -= r;
-        if (op == MXRIO_WRITE_AT)
-            offset += r;
-        // stop at short read
-        if (r < xfer) {
-            break;
-        }
-    }
-    return count ? count : r;
-}
-
-static ssize_t mxrio_write(mxio_t* io, const void* _data, size_t len) {
-    return write_common(MXRIO_WRITE, io, _data, len, 0);
-}
-
-static ssize_t mxrio_write_at(mxio_t* io, const void* _data, size_t len, off_t offset) {
-    return write_common(MXRIO_WRITE_AT, io, _data, len, offset);
-}
-
-static ssize_t read_common(uint32_t op, mxio_t* io, void* _data, size_t len, off_t offset) {
-    mxrio_t* rio = (mxrio_t*)io;
-    uint8_t* data = _data;
-    ssize_t count = 0;
-    mx_status_t r = 0;
-    mxrio_msg_t msg;
-    ssize_t xfer;
-
-    while (len > 0) {
-        xfer = (len > MXIO_CHUNK_SIZE) ? MXIO_CHUNK_SIZE : len;
-
-        memset(&msg, 0, MXRIO_HDR_SZ);
-        msg.op = op;
-        msg.arg = xfer;
-        if (op == MXRIO_READ_AT)
-            msg.arg2.off = offset;
-
-        if ((r = mxrio_txn(rio, &msg)) < 0) {
-            break;
-        }
-        discard_handles(msg.handle, msg.hcount);
-
-        if ((r > (int)msg.datalen) || (r > xfer)) {
-            r = MX_ERR_IO;
-            break;
-        }
-        memcpy(data, msg.data, r);
-        count += r;
-        data += r;
-        len -= r;
-        if (op == MXRIO_READ_AT)
-            offset += r;
-
-        // stop at short read
-        if (r < xfer) {
-            break;
-        }
-    }
-    return count ? count : r;
-}
-
-static ssize_t mxrio_read(mxio_t* io, void* _data, size_t len) {
-    return read_common(MXRIO_READ, io, _data, len, 0);
-}
-
-static ssize_t mxrio_read_at(mxio_t* io, void* _data, size_t len, off_t offset) {
-    return read_common(MXRIO_READ_AT, io, _data, len, offset);
-}
-
-static off_t mxrio_seek(mxio_t* io, off_t offset, int whence) {
-    mxrio_t* rio = (mxrio_t*)io;
-    mxrio_msg_t msg;
-    mx_status_t r;
-
-    memset(&msg, 0, MXRIO_HDR_SZ);
-    msg.op = MXRIO_SEEK;
-    msg.arg2.off = offset;
-    msg.arg = whence;
-
-    if ((r = mxrio_txn(rio, &msg)) < 0) {
-        return r;
-    }
-
-    discard_handles(msg.handle, msg.hcount);
-    return msg.arg2.off;
-}
-
-mx_status_t mxrio_close(mxio_t* io) {
-    mxrio_t* rio = (mxrio_t*)io;
-    mxrio_msg_t msg;
-    mx_status_t r;
-
-    memset(&msg, 0, MXRIO_HDR_SZ);
-    msg.op = MXRIO_CLOSE;
-
-    if ((r = mxrio_txn(rio, &msg)) >= 0) {
-        discard_handles(msg.handle, msg.hcount);
-    }
-
-    mx_handle_t h = rio->h;
-    rio->h = 0;
-    mx_handle_close(h);
-    if (rio->h2 > 0) {
-        h = rio->h2;
-        rio->h2 = 0;
-        mx_handle_close(h);
-    }
-
-    return r;
-}
-
-static mx_status_t mxrio_reply_channel_call(mx_handle_t rio_h, mxrio_msg_t* msg,
-                                            mxrio_object_t* info) {
-    mx_status_t r;
-    mx_handle_t h;
-    if ((r = mx_channel_create(0, &h, &msg->handle[0])) < 0) {
-        return r;
-    }
-    msg->hcount = 1;
-
-    // Write the (one-way) request message
-    if ((r = mx_channel_write(rio_h, 0, msg, MXRIO_HDR_SZ + msg->datalen,
-                              msg->handle, msg->hcount)) < 0) {
-        mx_handle_close(msg->handle[0]);
-        mx_handle_close(h);
-        return r;
-    }
-
-    // Wait
-    mx_object_wait_one(h, MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED, MX_TIME_INFINITE, NULL);
-
-    // Attempt to read the callback response
-    memset(info, 0xfe, sizeof(*info));
-    uint32_t dsize = MXRIO_OBJECT_MAXSIZE;
-    info->hcount = MXIO_MAX_HANDLES;
-    r = mx_channel_read(h, 0, info, &info->handle[1], dsize,
-                        info->hcount, &dsize, &info->hcount);
-    if (r < 0) {
-        mx_handle_close(h);
-        return r;
-    }
-    info->handle[0] = h;
-    info->hcount++;
-    if (dsize < MXRIO_OBJECT_MINSIZE) {
-        r = MX_ERR_IO;
-    } else {
-        info->esize = dsize - MXRIO_OBJECT_MINSIZE;
-        r = info->status;
-    }
-    if (r < 0) {
-        discard_handles(info->handle, info->hcount);
-    }
-    return r;
-}
-
-// This function always consumes the cnxn handle
-// The svc handle is only used to send a message
-static mx_status_t mxrio_connect(mx_handle_t svc, mx_handle_t cnxn,
-                                 uint32_t op, int32_t flags, uint32_t mode,
-                                 const char* name) {
-    size_t len = strlen(name);
-    if (len >= PATH_MAX) {
-        mx_handle_close(cnxn);
-        return MX_ERR_BAD_PATH;
-    }
-
-    mxrio_msg_t msg;
-    memset(&msg, 0, MXRIO_HDR_SZ);
-    msg.op = op;
-    msg.datalen = len;
-    msg.arg = O_PIPELINE | flags;
-    msg.arg2.mode = mode;
-    msg.hcount = 1;
-    msg.handle[0] = cnxn;
-    memcpy(msg.data, name, len);
-
-    mx_status_t r;
-    if ((r = mx_channel_write(svc, 0, &msg, MXRIO_HDR_SZ + msg.datalen, msg.handle, 1)) < 0) {
-        mx_handle_close(cnxn);
-        return r;
-    }
-
-    return MX_OK;
-}
-
-mx_status_t mxio_service_connect(const char* svcpath, mx_handle_t h) {
-    if (svcpath == NULL) {
-        mx_handle_close(h);
-        return MX_ERR_INVALID_ARGS;
-    }
-    // Otherwise attempt to connect through the root namespace
-    if (mxio_root_ns != NULL) {
-        return mxio_ns_connect(mxio_root_ns, svcpath, h);
-    }
-    // Otherwise we fail
-    mx_handle_close(h);
-    return MX_ERR_NOT_FOUND;
-}
-
-mx_status_t mxio_service_connect_at(mx_handle_t dir, const char* path, mx_handle_t h) {
-    if (path == NULL) {
-        mx_handle_close(h);
-        return MX_ERR_INVALID_ARGS;
-    }
-    if (dir == MX_HANDLE_INVALID) {
-        mx_handle_close(h);
-        return MX_ERR_UNAVAILABLE;
-    }
-    return mxrio_connect(dir, h, MXRIO_OPEN, O_RDWR, 0755, path);
-}
-
-mx_handle_t mxio_service_clone(mx_handle_t svc) {
-    mx_handle_t cli, srv;
-    mx_status_t r;
-    if (svc == MX_HANDLE_INVALID) {
-        return MX_HANDLE_INVALID;
-    }
-    if ((r = mx_channel_create(0, &cli, &srv)) < 0) {
-        return MX_HANDLE_INVALID;
-    }
-    if ((r = mxrio_connect(svc, srv, MXRIO_CLONE, O_RDWR, 0755, "")) < 0) {
-        mx_handle_close(cli);
-        return MX_HANDLE_INVALID;
-    }
-    return cli;
-}
-
-mx_status_t mxrio_misc(mxio_t* io, uint32_t op, int64_t off,
-                       uint32_t maxreply, void* ptr, size_t len) {
-    mxrio_t* rio = (mxrio_t*)io;
-    mxrio_msg_t msg;
-    mx_status_t r;
-
-    if ((len > MXIO_CHUNK_SIZE) || (maxreply > MXIO_CHUNK_SIZE)) {
-        return MX_ERR_INVALID_ARGS;
-    }
-
-    memset(&msg, 0, MXRIO_HDR_SZ);
-    msg.op = op;
-    msg.arg = maxreply;
-    msg.arg2.off = off;
-    msg.datalen = len;
-    if (ptr && len > 0) {
-        memcpy(msg.data, ptr, len);
-    }
-    switch (op) {
-    case MXRIO_RENAME:
-    case MXRIO_LINK:
-        // As a hack, 'Rename' and 'Link' take token handles through
-        // the offset argument.
-        msg.handle[0] = (mx_handle_t) off;
-        msg.hcount = 1;
-    }
-
-    if ((r = mxrio_txn(rio, &msg)) < 0) {
-        return r;
-    }
-
-    switch (op) {
-    case MXRIO_MMAP: {
-        // Ops which receive single handles:
-        if ((msg.hcount != 1) || (msg.datalen > maxreply)) {
-            discard_handles(msg.handle, msg.hcount);
-            return MX_ERR_IO;
-        }
-        r = msg.handle[0];
-        memcpy(ptr, msg.data, msg.datalen);
-        break;
-    }
-    case MXRIO_FCNTL:
-        // This is a bit of a hack, but for this case, we
-        // return 'msg.arg2.mode' in the data field to simplify
-        // this call for the client.
-        discard_handles(msg.handle, msg.hcount);
-        if (ptr) {
-            memcpy(ptr, &msg.arg2.mode, sizeof(msg.arg2.mode));
-        }
-        break;
-    default:
-        // Ops which don't receive handles:
-        discard_handles(msg.handle, msg.hcount);
-        if (msg.datalen > maxreply) {
-            return MX_ERR_IO;
-        }
-        if (ptr && msg.datalen > 0) {
-            memcpy(ptr, msg.data, msg.datalen);
-        }
-    }
-    return r;
-}
-
-mx_status_t mxio_create_fd(mx_handle_t* handles, uint32_t* types, size_t hcount,
-                           int* fd_out) {
-    mxio_t* io;
-    mx_status_t r;
-    int fd;
-    uint32_t type;
-
-    switch (PA_HND_TYPE(types[0])) {
-    case PA_MXIO_REMOTE:
-        type = MXIO_PROTOCOL_REMOTE;
-        break;
-    case PA_MXIO_PIPE:
-        type = MXIO_PROTOCOL_PIPE;
-        break;
-    case PA_MXIO_SOCKET:
-        type = MXIO_PROTOCOL_SOCKET_CONNECTED;
-        break;
-    default:
-        r = MX_ERR_IO;
-        goto fail;
-    }
-
-    if ((r = mxio_from_handles(type, handles, hcount, NULL, 0, &io)) != MX_OK) {
-        goto fail;
-    }
-
-    fd = mxio_bind_to_fd(io, -1, 0);
-    if (fd < 0) {
-        mxio_close(io);
-        mxio_release(io);
-        return MX_ERR_BAD_STATE;
-    }
-
-    *fd_out = fd;
-    return MX_OK;
-fail:
-    for (size_t i = 0; i < hcount; i++) {
-        mx_handle_close(handles[i]);
-    }
-    return r;
-}
-
-mx_status_t mxio_from_handles(uint32_t type, mx_handle_t* handles, int hcount,
-                              void* extra, uint32_t esize, mxio_t** out) {
-    // All failure cases which require discard_handles set r and break
-    // to the end. All other cases in which handle ownership is moved
-    // on return locally.
-    mx_status_t r;
-    mxio_t* io;
-    switch (type) {
-    case MXIO_PROTOCOL_REMOTE:
-        if (hcount == 1) {
-            io = mxio_remote_create(handles[0], 0);
-            xprintf("rio (%x,%x) -> %p\n", handles[0], 0, io);
-        } else if (hcount == 2) {
-            io = mxio_remote_create(handles[0], handles[1]);
-            xprintf("rio (%x,%x) -> %p\n", handles[0], handles[1], io);
-        } else {
-            r = MX_ERR_INVALID_ARGS;
-            break;
-        }
-        if (io == NULL) {
-            return MX_ERR_NO_RESOURCES;
-        } else {
-            *out = io;
-            return MX_OK;
-        }
-        break;
-    case MXIO_PROTOCOL_SERVICE:
-        if (hcount != 1) {
-            r = MX_ERR_INVALID_ARGS;
-            break;
-        } else if ((*out = mxio_service_create(handles[0])) == NULL) {
-            return MX_ERR_NO_RESOURCES;
-        } else {
-            return MX_OK;
-        }
-        break;
-    case MXIO_PROTOCOL_PIPE:
-        if (hcount != 1) {
-            r = MX_ERR_INVALID_ARGS;
-            break;
-        } else if ((*out = mxio_pipe_create(handles[0])) == NULL) {
-            return MX_ERR_NO_RESOURCES;
-        } else {
-            return MX_OK;
-        }
-    case MXIO_PROTOCOL_VMOFILE: {
-        mx_off_t* args = extra;
-        if ((hcount != 2) || (esize != (sizeof(mx_off_t) * 2))) {
-            r = MX_ERR_INVALID_ARGS;
-            break;
-        }
-        // Currently, VMO Files don't use a client-side control channel.
-        mx_handle_close(handles[0]);
-        if ((*out = mxio_vmofile_create(handles[1], args[0], args[1])) == NULL) {
-            return MX_ERR_NO_RESOURCES;
-        } else {
-            return MX_OK;
-        }
-    }
-    case MXIO_PROTOCOL_SOCKET_CONNECTED:
-    case MXIO_PROTOCOL_SOCKET: {
-        int flags = (type == MXIO_PROTOCOL_SOCKET_CONNECTED) ? MXIO_FLAG_SOCKET_CONNECTED : 0;
-        if (hcount == 1) {
-            io = mxio_socket_create(handles[0], MX_HANDLE_INVALID, flags);
-        } else if (hcount == 2) {
-            io = mxio_socket_create(handles[0], handles[1], flags);
-        } else {
-            r = MX_ERR_INVALID_ARGS;
-            break;
-        }
-        if (io == NULL) {
-            return MX_ERR_NO_RESOURCES;
-        } else {
-            *out = io;
-            return MX_OK;
-        }
-    }
-    default:
-        r = MX_ERR_NOT_SUPPORTED;
-        break;
-    }
-    discard_handles(handles, hcount);
-    return r;
-}
-
-mx_status_t mxrio_getobject(mx_handle_t rio_h, uint32_t op, const char* name,
-                            int32_t flags, uint32_t mode,
-                            mxrio_object_t* info) {
-    if (name == NULL) {
-        return MX_ERR_INVALID_ARGS;
-    }
-
-    size_t len = strlen(name);
-    if (len >= PATH_MAX) {
-        return MX_ERR_BAD_PATH;
-    }
-
-    if (flags & O_PIPELINE) {
-        mx_handle_t h0, h1;
-        mx_status_t r;
-        if ((r = mx_channel_create(0, &h0, &h1)) < 0) {
-            return r;
-        }
-        if ((r = mxrio_connect(rio_h, h1, MXRIO_OPEN, flags, mode, name)) < 0) {
-            mx_handle_close(h0);
-            return r;
-        }
-        // fake up a reply message since pipelined opens don't generate one
-        info->status = MX_OK;
-        info->type = MXIO_PROTOCOL_REMOTE;
-        info->esize = 0;
-        info->hcount = 1;
-        info->handle[0] = h0;
-        return MX_OK;
-    } else {
-        mxrio_msg_t msg;
-        memset(&msg, 0, MXRIO_HDR_SZ);
-        msg.op = op;
-        msg.datalen = len;
-        msg.arg = flags;
-        msg.arg2.mode = mode;
-        memcpy(msg.data, name, len);
-
-        return mxrio_reply_channel_call(rio_h, &msg, info);
-    }
-}
-
-mx_status_t mxrio_open_handle(mx_handle_t h, const char* path, int32_t flags,
-                              uint32_t mode, mxio_t** out) {
-    mxrio_object_t info;
-    mx_status_t r = mxrio_getobject(h, MXRIO_OPEN, path, flags, mode, &info);
-    if (r < 0) {
-        return r;
-    }
-    return mxio_from_handles(info.type, info.handle, info.hcount, info.extra, info.esize, out);
-}
-
-mx_status_t mxrio_open_handle_raw(mx_handle_t h, const char* path, int32_t flags,
-                                  uint32_t mode, mx_handle_t *out) {
-    mxrio_object_t info;
-    mx_status_t r = mxrio_getobject(h, MXRIO_OPEN, path, flags, mode, &info);
-    if (r < 0) {
-        return r;
-    }
-    if ((info.type == MXIO_PROTOCOL_REMOTE) && (info.hcount > 0)) {
-        for (unsigned n = 1; n < info.hcount; n++) {
-            mx_handle_close(info.handle[n]);
-        }
-        *out = info.handle[0];
-        return MX_OK;
-    }
-    for (unsigned n = 0; n < info.hcount; n++) {
-        mx_handle_close(info.handle[n]);
-    }
-    return MX_ERR_WRONG_TYPE;
-}
-
-mx_status_t mxrio_open(mxio_t* io, const char* path, int32_t flags, uint32_t mode, mxio_t** out) {
-    mxrio_t* rio = (void*)io;
-    mxrio_object_t info;
-    mx_status_t r = mxrio_getobject(rio->h, MXRIO_OPEN, path, flags, mode, &info);
-    if (r < 0) {
-        return r;
-    }
-    return mxio_from_handles(info.type, info.handle, info.hcount, info.extra, info.esize, out);
-}
-
-static mx_status_t mxrio_clone(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
-    mxrio_t* rio = (void*)io;
-    mxrio_object_t info;
-    mx_status_t r = mxrio_getobject(rio->h, MXRIO_CLONE, "", 0, 0, &info);
-    if (r < 0) {
-        return r;
-    }
-    for (unsigned i = 0; i < info.hcount; i++) {
-        types[i] = PA_MXIO_REMOTE;
-    }
-    memcpy(handles, info.handle, info.hcount * sizeof(mx_handle_t));
-    return info.hcount;
-}
-
-mx_status_t __mxrio_clone(mx_handle_t h, mx_handle_t* handles, uint32_t* types) {
-    mxrio_t rio;
-    rio.h = h;
-    return mxrio_clone(&rio.io, handles, types);
-}
-
-static mx_status_t mxrio_unwrap(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
-    mxrio_t* rio = (void*)io;
-    mx_status_t r;
-    handles[0] = rio->h;
-    types[0] = PA_MXIO_REMOTE;
-    if (rio->h2 != 0) {
-        handles[1] = rio->h2;
-        types[1] = PA_MXIO_REMOTE;
-        r = 2;
-    } else {
-        r = 1;
-    }
-    free(io);
-    return r;
-}
-
-static void mxrio_wait_begin(mxio_t* io, uint32_t events, mx_handle_t* handle, mx_signals_t* _signals) {
-    mxrio_t* rio = (void*)io;
-    *handle = rio->h2;
-
-    mx_signals_t signals = 0;
-    // Manually add signals that don't fit within POLL_MASK
-    if (events & POLLRDHUP) {
-        signals |= MX_CHANNEL_PEER_CLOSED;
-    }
-
-    // POLLERR is always detected
-    *_signals = (((POLLERR | events) & POLL_MASK) << POLL_SHIFT) | signals;
-}
-
-static void mxrio_wait_end(mxio_t* io, mx_signals_t signals, uint32_t* _events) {
-    // Manually add events that don't fit within POLL_MASK
-    uint32_t events = 0;
-    if (signals & MX_CHANNEL_PEER_CLOSED) {
-        events |= POLLRDHUP;
-    }
-    *_events = ((signals >> POLL_SHIFT) & POLL_MASK) | events;
-}
-
-static mxio_ops_t mx_remote_ops = {
-    .read = mxrio_read,
-    .read_at = mxrio_read_at,
-    .write = mxrio_write,
-    .write_at = mxrio_write_at,
-    .recvfrom = mxio_default_recvfrom,
-    .sendto = mxio_default_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
-    .misc = mxrio_misc,
-    .seek = mxrio_seek,
-    .close = mxrio_close,
-    .open = mxrio_open,
-    .clone = mxrio_clone,
-    .ioctl = mxrio_ioctl,
-    .wait_begin = mxrio_wait_begin,
-    .wait_end = mxrio_wait_end,
-    .unwrap = mxrio_unwrap,
-    .shutdown = mxio_default_shutdown,
-    .posix_ioctl = mxio_default_posix_ioctl,
-    .get_vmo = mxio_default_get_vmo,
-};
-
-mxio_t* mxio_remote_create(mx_handle_t h, mx_handle_t e) {
-    mxrio_t* rio = calloc(1, sizeof(*rio));
-    if (rio == NULL) {
-        mx_handle_close(h);
-        mx_handle_close(e);
-        return NULL;
-    }
-    rio->io.ops = &mx_remote_ops;
-    rio->io.magic = MXIO_MAGIC;
-    atomic_init(&rio->io.refcount, 1);
-    rio->h = h;
-    rio->h2 = e;
-    return &rio->io;
-}
diff --git a/system/ulib/mxio/remotesocket.c b/system/ulib/mxio/remotesocket.c
deleted file mode 100644
index 80d09da..0000000
--- a/system/ulib/mxio/remotesocket.c
+++ /dev/null
@@ -1,599 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <poll.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-
-#include <mxio/io.h>
-#include <mxio/remoteio.h>
-#include <mxio/socket.h>
-#include <mxio/util.h>
-
-#include "private-remoteio.h"
-
-
-static ssize_t mxsio_read_stream(mxio_t* io, void* data, size_t len) {
-    mxrio_t* rio = (mxrio_t*)io;
-    int nonblock = rio->io.flags & MXIO_FLAG_NONBLOCK;
-
-    // TODO: let the generic read() to do this loop
-    for (;;) {
-        ssize_t r;
-        size_t bytes_read;
-        if ((r = mx_socket_read(rio->h2, 0, data, len, &bytes_read)) == MX_OK) {
-            // mx_socket_read() sets *actual to the number of bytes in the buffer when data is NULL
-            // and len is 0. read() should return 0 in that case.
-            if (len == 0) {
-                return 0;
-            } else {
-                return (ssize_t)bytes_read;
-            }
-        }
-        if (r == MX_ERR_PEER_CLOSED || r == MX_ERR_BAD_STATE) {
-            return 0;
-        } else if (r == MX_ERR_SHOULD_WAIT && !nonblock) {
-            mx_signals_t pending;
-            r = mx_object_wait_one(rio->h2,
-                                   MX_SOCKET_READABLE | MX_SOCKET_PEER_CLOSED | MX_SOCKET_READ_DISABLED,
-                                   MX_TIME_INFINITE, &pending);
-            if (r < 0) {
-                return r;
-            }
-            if (pending & MX_SOCKET_READABLE) {
-                continue;
-            }
-            if (pending & (MX_SOCKET_PEER_CLOSED | MX_SOCKET_READ_DISABLED)) {
-                return 0;
-            }
-            // impossible
-            return MX_ERR_INTERNAL;
-        }
-        return r;
-    }
-}
-
-static ssize_t mxsio_recvfrom(mxio_t* io, void* data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen) {
-    struct iovec iov;
-    iov.iov_base = data;
-    iov.iov_len = len;
-
-    struct msghdr msg;
-    msg.msg_name = addr;
-    // the caller (recvfrom) checks if addrlen is NULL.
-    msg.msg_namelen = (addr == NULL) ? 0 : *addrlen;
-    msg.msg_iov = &iov;
-    msg.msg_iovlen = 1;
-    msg.msg_control = NULL;
-    msg.msg_controllen = 0;
-    msg.msg_flags = 0;
-
-    ssize_t r = io->ops->recvmsg(io, &msg, flags);
-    if (addr != NULL)
-        *addrlen = msg.msg_namelen;
-
-    return r;
-}
-
-static ssize_t mxsio_write_stream(mxio_t* io, const void* data, size_t len) {
-    mxrio_t* rio = (mxrio_t*)io;
-    int nonblock = rio->io.flags & MXIO_FLAG_NONBLOCK;
-
-    // TODO: let the generic write() to do this loop
-    for (;;) {
-        ssize_t r;
-        if ((r = mx_socket_write(rio->h2, 0, data, len, &len)) == MX_OK) {
-            return (ssize_t) len;
-        }
-        if (r == MX_ERR_SHOULD_WAIT && !nonblock) {
-            mx_signals_t pending;
-            r = mx_object_wait_one(rio->h2,
-                                   MX_SOCKET_WRITABLE | MX_SOCKET_WRITE_DISABLED | MX_SOCKET_PEER_CLOSED,
-                                   MX_TIME_INFINITE, &pending);
-            if (r < 0) {
-                return r;
-            }
-            if (pending & (MX_SOCKET_WRITE_DISABLED | MX_SOCKET_PEER_CLOSED)) {
-                return MX_ERR_PEER_CLOSED;
-            }
-            if (pending & MX_SOCKET_WRITABLE) {
-                continue;
-            }
-            // impossible
-            return MX_ERR_INTERNAL;
-        }
-        return r;
-    }
-}
-
-static ssize_t mxsio_sendto(mxio_t* io, const void* data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen) {
-    struct iovec iov;
-    iov.iov_base = (void*)data;
-    iov.iov_len = len;
-
-    struct msghdr msg;
-    msg.msg_name = (void*)addr;
-    msg.msg_namelen = addrlen;
-    msg.msg_iov = &iov;
-    msg.msg_iovlen = 1;
-    msg.msg_control = NULL;
-    msg.msg_controllen = 0;
-    msg.msg_flags = 0; // this field is ignored
-
-    return io->ops->sendmsg(io, &msg, flags);
-}
-
-
-static ssize_t mxsio_recvmsg_stream(mxio_t* io, struct msghdr* msg, int flags) {
-    if (flags != 0) {
-        // TODO: support MSG_OOB
-        return MX_ERR_NOT_SUPPORTED;
-    }
-    if (!(io->flags & MXIO_FLAG_SOCKET_CONNECTED)) {
-        return MX_ERR_BAD_STATE;
-    }
-    // we ignore msg_name and msg_namelen members.
-    // (this is a consistent behavior with other OS implementations for TCP protocol)
-    ssize_t total = 0;
-    for (int i = 0; i < msg->msg_iovlen; i++) {
-        struct iovec *iov = &msg->msg_iov[i];
-        ssize_t n = mxsio_read_stream(io, iov->iov_base, iov->iov_len);
-        if (n < 0) {
-            return n;
-        }
-        total += n;
-        if ((size_t)n != iov->iov_len) {
-            break;
-        }
-    }
-    return total;
-}
-
-static ssize_t mxsio_sendmsg_stream(mxio_t* io, const struct msghdr* msg, int flags) {
-    if (flags != 0) {
-        // TODO: support MSG_OOB
-        return MX_ERR_NOT_SUPPORTED;
-    }
-    // TODO: support flags and control messages
-    if (io->flags & MXIO_FLAG_SOCKET_CONNECTED) {
-        // if connected, can't specify address
-        if (msg->msg_name != NULL || msg->msg_namelen != 0) {
-            return MX_ERR_ALREADY_EXISTS;
-        }
-    } else {
-        return MX_ERR_BAD_STATE;
-    }
-    ssize_t total = 0;
-    for (int i = 0; i < msg->msg_iovlen; i++) {
-        struct iovec *iov = &msg->msg_iov[i];
-        if (iov->iov_len <= 0) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        ssize_t n = mxsio_write_stream(io, iov->iov_base, iov->iov_len);
-        if (n < 0) {
-            return n;
-        }
-        total += n;
-        if ((size_t)n != iov->iov_len) {
-            break;
-        }
-    }
-    return total;
-}
-
-static mx_status_t mxsio_clone_stream(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
-    // TODO: support unconnected sockets
-    if (!(io->flags & MXIO_FLAG_SOCKET_CONNECTED)) {
-        return MX_ERR_BAD_STATE;
-    }
-    mxrio_t* rio = (void*)io;
-    mxrio_object_t info;
-    mx_status_t r = mxrio_getobject(rio->h, MXRIO_CLONE, "", 0, 0, &info);
-    if (r < 0) {
-        return r;
-    }
-    for (unsigned i = 0; i < info.hcount; i++) {
-        types[i] = PA_MXIO_SOCKET;
-    }
-    memcpy(handles, info.handle, info.hcount * sizeof(mx_handle_t));
-    return info.hcount;
-}
-
-static mx_status_t mxsio_unwrap_stream(mxio_t* io, mx_handle_t* handles, uint32_t* types) {
-    // TODO: support unconnected sockets
-    if (!(io->flags & MXIO_FLAG_SOCKET_CONNECTED)) {
-        return MX_ERR_BAD_STATE;
-    }
-    mxrio_t* rio = (void*)io;
-    mx_status_t r;
-    handles[0] = rio->h;
-    types[0] = PA_MXIO_SOCKET;
-    if (rio->h2 != 0) {
-        handles[1] = rio->h2;
-        types[1] = PA_MXIO_SOCKET;
-        r = 2;
-    } else {
-        r = 1;
-    }
-    free(io);
-    return r;
-}
-
-static void mxsio_wait_begin_stream(mxio_t* io, uint32_t events, mx_handle_t* handle, mx_signals_t* _signals) {
-    mxrio_t* rio = (void*)io;
-    *handle = rio->h2;
-    // TODO: locking for flags/state
-    if (io->flags & MXIO_FLAG_SOCKET_CONNECTING) {
-        // check the connection state
-        mx_signals_t observed;
-        mx_status_t r;
-        r = mx_object_wait_one(rio->h2, MXSIO_SIGNAL_CONNECTED, 0u,
-                               &observed);
-        if (r == MX_OK || r == MX_ERR_TIMED_OUT) {
-            if (observed & MXSIO_SIGNAL_CONNECTED) {
-                io->flags &= ~MXIO_FLAG_SOCKET_CONNECTING;
-                io->flags |= MXIO_FLAG_SOCKET_CONNECTED;
-            }
-        }
-    }
-    mx_signals_t signals = MXSIO_SIGNAL_ERROR;
-    if (io->flags & MXIO_FLAG_SOCKET_CONNECTED) {
-        // if socket is connected
-        if (events & POLLIN) {
-            signals |= MX_SOCKET_READABLE | MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED;
-        }
-        if (events & POLLOUT) {
-            signals |= MX_SOCKET_WRITABLE | MX_SOCKET_WRITE_DISABLED;
-        }
-    } else {
-        // if socket is not connected
-        if (events & POLLIN) {
-            // signal when a listening socket gets an incoming connection
-            // or a connecting socket gets connected and receives data
-            signals |= MXSIO_SIGNAL_INCOMING |
-                MX_SOCKET_READABLE | MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED;
-        }
-        if (events & POLLOUT) {
-            // signal when connect() operation is finished
-            signals |= MXSIO_SIGNAL_OUTGOING;
-        }
-    }
-    if (events & POLLRDHUP) {
-        signals |= MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED;
-    }
-    *_signals = signals;
-}
-
-static void mxsio_wait_end_stream(mxio_t* io, mx_signals_t signals, uint32_t* _events) {
-    // check the connection state
-    if (io->flags & MXIO_FLAG_SOCKET_CONNECTING) {
-        if (signals & MXSIO_SIGNAL_CONNECTED) {
-            io->flags &= ~MXIO_FLAG_SOCKET_CONNECTING;
-            io->flags |= MXIO_FLAG_SOCKET_CONNECTED;
-        }
-    }
-    uint32_t events = 0;
-    if (io->flags & MXIO_FLAG_SOCKET_CONNECTED) {
-        if (signals & (MX_SOCKET_READABLE | MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED)) {
-            events |= POLLIN;
-        }
-        if (signals & (MX_SOCKET_WRITABLE | MX_SOCKET_WRITE_DISABLED)) {
-            events |= POLLOUT;
-        }
-    } else {
-        if (signals & (MXSIO_SIGNAL_INCOMING | MX_SOCKET_PEER_CLOSED)) {
-            events |= POLLIN;
-        }
-        if (signals & MXSIO_SIGNAL_OUTGOING) {
-            events |= POLLOUT;
-        }
-    }
-    if (signals & MXSIO_SIGNAL_ERROR) {
-        events |= POLLERR;
-    }
-    if (signals & (MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED)) {
-        events |= POLLRDHUP;
-    }
-    *_events = events;
-}
-
-static ssize_t mxsio_posix_ioctl_stream(mxio_t* io, int req, va_list va) {
-    mxrio_t* rio = (mxrio_t*)io;
-    switch (req) {
-    case FIONREAD: {
-        mx_status_t r;
-        size_t avail;
-        if ((r = mx_socket_read(rio->h2, 0, NULL, 0, &avail)) < 0) {
-            return r;
-        }
-        if (avail > INT_MAX) {
-            avail = INT_MAX;
-        }
-        int* actual = va_arg(va, int*);
-        *actual = avail;
-        return MX_OK;
-    }
-    default:
-        return MX_ERR_NOT_SUPPORTED;
-    }
-}
-
-static ssize_t mxsio_rx_dgram(mxio_t* io, void* buf, size_t buflen) {
-    return mxsio_read_stream(io, buf, buflen);
-}
-
-static ssize_t mxsio_tx_dgram(mxio_t* io, const void* buf, size_t buflen) {
-    mx_status_t r = mxsio_write_stream(io, buf, buflen);
-    return (r < 0) ? r : MX_OK;
-}
-
-static ssize_t mxsio_recvmsg_dgram(mxio_t* io, struct msghdr* msg, int flags);
-static ssize_t mxsio_sendmsg_dgram(mxio_t* io, const struct msghdr* msg, int flags);
-
-static ssize_t mxsio_read_dgram(mxio_t* io, void* data, size_t len) {
-    struct iovec iov;
-    iov.iov_base = data;
-    iov.iov_len = len;
-
-    struct msghdr msg;
-    msg.msg_name = NULL;
-    msg.msg_namelen = 0;
-    msg.msg_iov = &iov;
-    msg.msg_iovlen = 1;
-    msg.msg_control = NULL;
-    msg.msg_controllen = 0;
-    msg.msg_flags = 0;
-
-    return mxsio_recvmsg_dgram(io, &msg, 0);
-}
-
-static ssize_t mxsio_write_dgram(mxio_t* io, const void* data, size_t len) {
-    struct iovec iov;
-    iov.iov_base = (void*)data;
-    iov.iov_len = len;
-
-    struct msghdr msg;
-    msg.msg_name = NULL;
-    msg.msg_namelen = 0;
-    msg.msg_iov = &iov;
-    msg.msg_iovlen = 1;
-    msg.msg_control = NULL;
-    msg.msg_controllen = 0;
-    msg.msg_flags = 0;
-
-    return mxsio_sendmsg_dgram(io, &msg, 0);
-}
-
-static ssize_t mxsio_recvmsg_dgram(mxio_t* io, struct msghdr* msg, int flags) {
-    if (flags != 0) {
-        // TODO: support MSG_OOB
-        return MX_ERR_NOT_SUPPORTED;
-    }
-    // Read 1 extra byte to detect if the buffer is too small to fit the whole
-    // packet, so we can set MSG_TRUNC flag if necessary.
-    size_t mlen = MXIO_SOCKET_MSG_HEADER_SIZE + 1;
-    for (int i = 0; i < msg->msg_iovlen; i++) {
-        struct iovec *iov = &msg->msg_iov[i];
-        if (iov->iov_len <= 0) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        mlen += iov->iov_len;
-    }
-
-    // TODO: avoid malloc
-    mxio_socket_msg_t* m = malloc(mlen);
-    ssize_t n = mxsio_rx_dgram(io, m, mlen);
-    if (n < 0) {
-        free(m);
-        return n;
-    }
-    if ((size_t)n < MXIO_SOCKET_MSG_HEADER_SIZE) {
-        free(m);
-        return MX_ERR_INTERNAL;
-    }
-    n -= MXIO_SOCKET_MSG_HEADER_SIZE;
-    if (msg->msg_name != NULL) {
-        int bytes_to_copy = (msg->msg_namelen < m->addrlen) ? msg->msg_namelen : m->addrlen;
-        memcpy(msg->msg_name, &m->addr, bytes_to_copy);
-    }
-    msg->msg_namelen = m->addrlen;
-    msg->msg_flags = m->flags;
-    char* data = m->data;
-    size_t resid = n;
-    for (int i = 0; i < msg->msg_iovlen; i++) {
-        struct iovec *iov = &msg->msg_iov[i];
-        if (resid == 0) {
-            iov->iov_len = 0;
-        } else {
-            if (resid < iov->iov_len)
-                iov->iov_len = resid;
-            memcpy(iov->iov_base, data, iov->iov_len);
-            data += iov->iov_len;
-            resid -= iov->iov_len;
-        }
-    }
-
-    if (resid > 0) {
-        msg->msg_flags |= MSG_TRUNC;
-        n -= resid;
-    }
-
-    free(m);
-    return n;
-}
-
-static ssize_t mxsio_sendmsg_dgram(mxio_t* io, const struct msghdr* msg, int flags) {
-    if (flags != 0) {
-        // TODO: MSG_OOB
-        return MX_ERR_NOT_SUPPORTED;
-    }
-    // TODO: support flags and control messages
-    if (io->flags & MXIO_FLAG_SOCKET_CONNECTED) {
-        // if connected, can't specify address
-        if (msg->msg_name != NULL || msg->msg_namelen != 0) {
-            return MX_ERR_ALREADY_EXISTS;
-        }
-    }
-    ssize_t n = 0;
-    for (int i = 0; i < msg->msg_iovlen; i++) {
-        struct iovec *iov = &msg->msg_iov[i];
-        if (iov->iov_len <= 0) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        n += iov->iov_len;
-    }
-    size_t mlen = n + MXIO_SOCKET_MSG_HEADER_SIZE;
-
-    // TODO: avoid malloc m
-    mxio_socket_msg_t* m = malloc(mlen);
-    if (msg->msg_name != NULL) {
-        memcpy(&m->addr, msg->msg_name, msg->msg_namelen);
-    }
-    m->addrlen = msg->msg_namelen;
-    m->flags = flags;
-    char* data = m->data;
-    for (int i = 0; i < msg->msg_iovlen; i++) {
-        struct iovec *iov = &msg->msg_iov[i];
-        memcpy(data, iov->iov_base, iov->iov_len);
-        data += iov->iov_len;
-    }
-    ssize_t r = mxsio_tx_dgram(io, m, mlen);
-    free(m);
-    return r == MX_OK ? n : r;
-}
-
-static void mxsio_wait_begin_dgram(mxio_t* io, uint32_t events, mx_handle_t* handle, mx_signals_t* _signals) {
-    mxrio_t* rio = (void*)io;
-    *handle = rio->h2;
-    mx_signals_t signals = MXSIO_SIGNAL_ERROR;
-    if (events & POLLIN) {
-        signals |= MX_SOCKET_READABLE | MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED;
-    }
-    if (events & POLLOUT) {
-        signals |= MX_SOCKET_WRITABLE | MX_SOCKET_WRITE_DISABLED;
-    }
-    if (events & POLLRDHUP) {
-        signals |=  MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED;
-    }
-    *_signals = signals;
-}
-
-static void mxsio_wait_end_dgram(mxio_t* io, mx_signals_t signals, uint32_t* _events) {
-    uint32_t events = 0;
-    if (signals & (MX_SOCKET_READABLE | MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED)) {
-        events |= POLLIN;
-    }
-    if (signals & (MX_SOCKET_WRITABLE | MX_SOCKET_WRITE_DISABLED)) {
-        events |= POLLOUT;
-    }
-    if (signals & MXSIO_SIGNAL_ERROR) {
-        events |= POLLERR;
-    }
-    if (signals & (MX_SOCKET_READ_DISABLED | MX_SOCKET_PEER_CLOSED)) {
-        events |= POLLRDHUP;
-    }
-    *_events = events;
-}
-
-static mxio_ops_t mxio_socket_stream_ops = {
-    .read = mxsio_read_stream,
-    .read_at = mxio_default_read_at,
-    .write = mxsio_write_stream,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mxsio_recvfrom,
-    .sendto = mxsio_sendto,
-    .recvmsg = mxsio_recvmsg_stream,
-    .sendmsg = mxsio_sendmsg_stream,
-    .seek = mxio_default_seek,
-    .misc = mxrio_misc,
-    .close = mxrio_close,
-    .open = mxrio_open,
-    .clone = mxsio_clone_stream,
-    .ioctl = mxrio_ioctl,
-    .wait_begin = mxsio_wait_begin_stream,
-    .wait_end = mxsio_wait_end_stream,
-    .unwrap = mxsio_unwrap_stream,
-    .shutdown = mxio_socket_shutdown,
-    .posix_ioctl = mxsio_posix_ioctl_stream,
-    .get_vmo = mxio_default_get_vmo,
-};
-
-static mxio_ops_t mxio_socket_dgram_ops = {
-    .read = mxsio_read_dgram,
-    .read_at = mxio_default_read_at,
-    .write = mxsio_write_dgram,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mxsio_recvfrom,
-    .sendto = mxsio_sendto,
-    .recvmsg = mxsio_recvmsg_dgram,
-    .sendmsg = mxsio_sendmsg_dgram,
-    .seek = mxio_default_seek,
-    .misc = mxrio_misc,
-    .close = mxrio_close,
-    .open = mxrio_open,
-    .clone = mxio_default_clone,
-    .ioctl = mxrio_ioctl,
-    .wait_begin = mxsio_wait_begin_dgram,
-    .wait_end = mxsio_wait_end_dgram,
-    .unwrap = mxio_default_unwrap,
-    .shutdown = mxio_socket_shutdown,
-    .posix_ioctl = mxio_default_posix_ioctl, // not supported
-    .get_vmo = mxio_default_get_vmo,
-};
-
-mxio_t* mxio_socket_create(mx_handle_t h, mx_handle_t s, int flags) {
-    mxrio_t* rio = calloc(1, sizeof(*rio));
-    if (rio == NULL) {
-        mx_handle_close(h);
-        mx_handle_close(s);
-        return NULL;
-    }
-    rio->io.ops = &mxio_socket_stream_ops; // default is stream
-    rio->io.magic = MXIO_MAGIC;
-    rio->io.refcount = 1;
-    rio->io.flags = MXIO_FLAG_SOCKET | flags;
-    rio->h = h;
-    rio->h2 = s;
-    return &rio->io;
-}
-
-void mxio_socket_set_stream_ops(mxio_t* io) {
-    mxrio_t* rio = (mxrio_t*)io;
-    rio->io.ops = &mxio_socket_stream_ops;
-}
-
-void mxio_socket_set_dgram_ops(mxio_t* io) {
-    mxrio_t* rio = (mxrio_t*)io;
-    rio->io.ops = &mxio_socket_dgram_ops;
-}
-
-mx_status_t mxio_socket_shutdown(mxio_t* io, int how) {
-    if (!(io->flags & MXIO_FLAG_SOCKET_CONNECTED)) {
-        return MX_ERR_BAD_STATE;
-    }
-    mxrio_t* rio = (mxrio_t*)io;
-    if (how == SHUT_WR || how == SHUT_RDWR) {
-        // netstack expects this user signal to be set - raise it to keep that code working until
-        // it learns about the read/write disabled signals.
-        mx_object_signal_peer(rio->h2, 0u, MXSIO_SIGNAL_HALFCLOSED);
-    }
-    uint32_t options = 0;
-    switch (how) {
-    case SHUT_RD:
-        options = MX_SOCKET_SHUTDOWN_READ;
-        break;
-    case SHUT_WR:
-        options = MX_SOCKET_SHUTDOWN_WRITE;
-        break;
-    case SHUT_RDWR:
-        options = MX_SOCKET_SHUTDOWN_READ | MX_SOCKET_SHUTDOWN_WRITE;
-        break;
-    }
-    return mx_socket_write(rio->h2, options, NULL, 0, NULL);
-}
diff --git a/system/ulib/mxio/service.c b/system/ulib/mxio/service.c
deleted file mode 100644
index ac7e98a..0000000
--- a/system/ulib/mxio/service.c
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <errno.h>
-#include <stdatomic.h>
-#include <stdlib.h>
-
-#include <magenta/errors.h>
-#include <magenta/syscalls.h>
-
-#include "private.h"
-#include "unistd.h"
-
-typedef struct {
-    mxio_t io;
-    mx_handle_t h;
-} mxsvc_t;
-
-static mx_status_t mxsvc_close(mxio_t* io) {
-    mxsvc_t* svc = (mxsvc_t*) io;
-    mx_handle_close(svc->h);
-    svc->h = MX_HANDLE_INVALID;
-    return MX_OK;
-}
-
-static mxio_ops_t mx_svc_ops = {
-    .read = mxio_default_read,
-    .read_at = mxio_default_read_at,
-    .write = mxio_default_write,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mxio_default_recvfrom,
-    .sendto = mxio_default_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
-    .seek = mxio_default_seek,
-    .misc = mxio_default_misc,
-    .close = mxsvc_close,
-    .open = mxio_default_open,
-    .clone = mxio_default_clone,
-    .ioctl = mxio_default_ioctl,
-    .wait_begin = mxio_default_wait_begin,
-    .wait_end = mxio_default_wait_end,
-    .unwrap = mxio_default_unwrap,
-    .shutdown = mxio_default_shutdown,
-    .posix_ioctl = mxio_default_posix_ioctl,
-    .get_vmo = mxio_default_get_vmo,
-};
-
-mxio_t* mxio_service_create(mx_handle_t h) {
-    mxsvc_t* svc = calloc(1, sizeof(*svc));
-    if (svc == NULL) {
-        mx_handle_close(h);
-        return NULL;
-    }
-    svc->io.ops = &mx_svc_ops;
-    svc->io.magic = MXIO_MAGIC;
-    svc->h = h;
-    atomic_init(&svc->io.refcount, 1);
-    return &svc->io;
-}
-
-mx_status_t mxio_get_service_handle(int fd, mx_handle_t* out) {
-    mtx_lock(&mxio_lock);
-    if ((fd < 0) || (fd >= MAX_MXIO_FD) || (mxio_fdtab[fd] == NULL)) {
-        mtx_unlock(&mxio_lock);
-        return ERRNO(EBADF);
-    }
-    mxio_t* io = mxio_fdtab[fd];
-    io->dupcount--;
-    mxio_fdtab[fd] = NULL;
-    if (io->dupcount > 0) {
-        // still alive in other fdtab slots
-        // this fd goes away but we can't give away the handle
-        mtx_unlock(&mxio_lock);
-        mxio_release(io);
-        return MX_ERR_UNAVAILABLE;
-    } else {
-        mtx_unlock(&mxio_lock);
-        int r;
-        if (io->ops == &mx_svc_ops) {
-            // is a service, extract handle
-            mxsvc_t* svc = (mxsvc_t*) io;
-            *out = svc->h;
-            svc->h = MX_HANDLE_INVALID;
-            r = MX_OK;
-        } else {
-            r = io->ops->close(io);
-            mxio_release(io);
-        }
-        return STATUS(r);
-    }
-}
diff --git a/system/ulib/mxio/socketpair.c b/system/ulib/mxio/socketpair.c
deleted file mode 100644
index 3ce65a7..0000000
--- a/system/ulib/mxio/socketpair.c
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <sys/socket.h>
-
-#include <magenta/syscalls.h>
-
-#include <errno.h>
-#include <mxio/io.h>
-#include <mxio/socket.h>
-#include <mxio/util.h>
-
-#include "pipe.h"
-#include "private.h"
-#include "unistd.h"
-
-static int checksocket(int fd, int sock_err, int err) {
-    mxio_t* io = fd_to_io(fd);
-    if (io == NULL) {
-        errno = EBADF;
-        return -1;
-    }
-    int32_t is_socket = io->flags & MXIO_FLAG_SOCKET;
-    mxio_release(io);
-    if (!is_socket) {
-        errno = sock_err;
-        return -1;
-    }
-    if (err) {
-        errno = err;
-        return -1;
-    }
-    return 0;
-}
-
-static ssize_t mx_socketpair_recvfrom(mxio_t* io, void* data, size_t len, int flags, struct sockaddr* restrict addr, socklen_t* restrict addrlen) {
-    if (flags != 0 && flags != MSG_DONTWAIT) {
-        return MX_ERR_INVALID_ARGS;
-    }
-    mx_pipe_t* p = (mx_pipe_t*)io;
-    int nonblock = (io->flags & MXIO_FLAG_NONBLOCK) || flags & MSG_DONTWAIT;
-    return mx_pipe_read_internal(p->h, data, len, nonblock);
-}
-
-static ssize_t mx_socketpair_sendto(mxio_t* io, const void* data, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen) {
-    if (flags != 0 && flags != MSG_DONTWAIT) {
-        return MX_ERR_INVALID_ARGS;
-    }
-    if (addr != NULL) {
-        return MX_ERR_INVALID_ARGS;  // should set errno to EISCONN
-    }
-    mx_pipe_t* p = (mx_pipe_t*)io;
-    int nonblock = (io->flags & MXIO_FLAG_NONBLOCK) || flags & MSG_DONTWAIT;
-    return mx_pipe_write_internal(p->h, data, len, nonblock);
-}
-
-
-static mxio_ops_t mx_socketpair_ops = {
-    .read = mx_pipe_read,
-    .read_at = mxio_default_read_at,
-    .write = mx_pipe_write,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mx_socketpair_recvfrom,
-    .sendto = mx_socketpair_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
-    .seek = mxio_default_seek,
-    .misc = mx_pipe_misc,
-    .close = mx_pipe_close,
-    .open = mxio_default_open,
-    .clone = mx_pipe_clone,
-    .ioctl = mxio_default_ioctl,
-    .wait_begin = mx_pipe_wait_begin,
-    .wait_end = mx_pipe_wait_end,
-    .unwrap = mx_pipe_unwrap,
-    .shutdown = mxio_socketpair_shutdown,
-    .posix_ioctl = mx_pipe_posix_ioctl,
-    .get_vmo = mxio_default_get_vmo,
-};
-
-
-int socketpair(int domain, int type, int protocol, int fd[2]) {
-    if (type != SOCK_STREAM) {  // TODO(jamesr): SOCK_DGRAM
-        errno = EPROTOTYPE;
-        return -1;
-    }
-    if (domain != AF_UNIX) {
-        errno = EAFNOSUPPORT;
-        return -1;
-    }
-    if (protocol != 0) {
-        errno = EPROTONOSUPPORT;
-        return -1;
-    }
-
-    mxio_t* io[2];
-    mx_status_t r = mxio_pipe_pair(&io[0], &io[1]);
-    if (r != MX_OK) {
-        errno = ERRNO(r);
-        return -1;
-    }
-    io[0]->ops = &mx_socketpair_ops;
-    io[1]->ops = &mx_socketpair_ops;
-
-    if ((fd[0] = mxio_bind_to_fd(io[0], -1, 0)) < 0) {
-        io[0]->ops->close(io[0]);
-        mxio_release(io[0]);
-        errno = ERRNO(EMFILE);
-        return -1;
-    }
-    if ((fd[1] = mxio_bind_to_fd(io[1], -1, 0)) < 0) {
-        io[1]->ops->close(io[1]);
-        mxio_release(io[1]);
-        close(fd[0]);
-        errno = ERRNO(EMFILE);
-        return -1;
-    }
-    return 0;
-}
-
-int sendmmsg(int fd, struct mmsghdr* msgvec, unsigned int vlen, unsigned int flags) {
-    return checksocket(fd, ENOTSOCK, ENOSYS);
-}
-
-int recvmmsg(int fd, struct mmsghdr* msgvec, unsigned int vlen, unsigned int flags, struct timespec* timeout) {
-    return checksocket(fd, ENOTSOCK, ENOSYS);
-}
-
-int sockatmark(int fd) {
-    // ENOTTY is sic.
-    return checksocket(fd, ENOTTY, ENOSYS);
-}
-
-mx_status_t mxio_socketpair_shutdown(mxio_t* io, int how) {
-    mx_pipe_t* p = (mx_pipe_t*)io;
-
-    uint32_t options = 0;
-    switch (how) {
-    case SHUT_RD:
-        options = MX_SOCKET_SHUTDOWN_READ;
-        break;
-    case SHUT_WR:
-        options = MX_SOCKET_SHUTDOWN_WRITE;
-        break;
-    case SHUT_RDWR:
-        options = MX_SOCKET_SHUTDOWN_READ | MX_SOCKET_SHUTDOWN_WRITE;
-        break;
-    }
-    return mx_socket_write(p->h, options, NULL, 0, NULL);
-}
diff --git a/system/ulib/mxio/vmofile.c b/system/ulib/mxio/vmofile.c
deleted file mode 100644
index 33657c5..0000000
--- a/system/ulib/mxio/vmofile.c
+++ /dev/null
@@ -1,250 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <fcntl.h>
-#include <stdatomic.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <threads.h>
-
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/io.h>
-#include <mxio/util.h>
-
-#include <mxio/remoteio.h>
-#include <mxio/vfs.h>
-
-#include "private.h"
-
-typedef struct vmofile {
-    mxio_t io;
-    mx_handle_t vmo;
-    mx_off_t off;
-    mx_off_t end;
-    mx_off_t ptr;
-    mtx_t lock;
-} vmofile_t;
-
-static ssize_t vmofile_read(mxio_t* io, void* data, size_t len) {
-    vmofile_t* vf = (vmofile_t*)io;
-    mx_off_t at;
-
-    mtx_lock(&vf->lock);
-    if (len > (vf->end - vf->ptr)) {
-        len = vf->end - vf->ptr;
-    }
-    at = vf->ptr;
-    vf->ptr += len;
-    mtx_unlock(&vf->lock);
-
-    mx_status_t status = mx_vmo_read(vf->vmo, data, at, len, &len);
-    if (status < 0) {
-        return status;
-    } else {
-        return len;
-    }
-}
-
-static ssize_t vmofile_read_at(mxio_t* io, void* data, size_t len, off_t at) {
-    vmofile_t* vf = (vmofile_t*)io;
-
-    // make sure we're within the file's bounds
-    if (at > (off_t)(vf->end - vf->off)) {
-        return MX_ERR_INVALID_ARGS;
-    }
-
-    // adjust to vmo offset
-    at += vf->off;
-
-    // clip length to file bounds
-    if (len > (vf->end - at)) {
-        len = vf->end - at;
-    }
-
-    mx_status_t status = mx_vmo_read(vf->vmo, data, at, len, &len);
-    if (status < 0) {
-        return status;
-    } else {
-        return len;
-    }
-}
-
-static ssize_t vmofile_write_at(mxio_t* io, const void* data, size_t len, off_t at) {
-    return MX_ERR_NOT_SUPPORTED;
-}
-
-static off_t vmofile_seek(mxio_t* io, off_t offset, int whence) {
-    vmofile_t* vf = (vmofile_t*)io;
-    mtx_lock(&vf->lock);
-    mx_off_t at;
-    switch (whence) {
-    case SEEK_SET:
-        at = offset;
-        break;
-    case SEEK_CUR:
-        at = (vf->ptr - vf->off) + offset;
-        break;
-    case SEEK_END:
-        at = (vf->end - vf->off) + offset;
-        break;
-    default:
-        mtx_unlock(&vf->lock);
-        return MX_ERR_INVALID_ARGS;
-    }
-    if (at > (vf->end - vf->off)) {
-        at = MX_ERR_OUT_OF_RANGE;
-    } else {
-        vf->ptr = vf->off + at;
-    }
-    mtx_unlock(&vf->lock);
-    return at;
-}
-
-static mx_status_t vmofile_close(mxio_t* io) {
-    vmofile_t* vf = (vmofile_t*)io;
-    mx_handle_t h = vf->vmo;
-    vf->vmo = 0;
-    mx_handle_close(h);
-    return 0;
-}
-
-static void vmofile_release(mxio_t* io) {
-    vmofile_t* vf = (vmofile_t*)io;
-    mx_handle_close(vf->vmo);
-    free(io);
-}
-
-static mx_status_t vmofile_misc(mxio_t* io, uint32_t op, int64_t off, uint32_t maxreply, void* ptr, size_t len) {
-    vmofile_t* vf = (vmofile_t*)io;
-    switch (op) {
-    case MXRIO_STAT: {
-        vnattr_t attr;
-        memset(&attr, 0, sizeof(attr));
-        attr.size = vf->end - vf->off;
-        attr.mode = V_TYPE_FILE | V_IRUSR;
-        if (maxreply < sizeof(attr)) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        memcpy(ptr, &attr, sizeof(attr));
-        return sizeof(attr);
-    }
-    case MXRIO_MMAP: {
-        if (len != sizeof(mxrio_mmap_data_t) || maxreply < sizeof(mxrio_mmap_data_t)) {
-            return MX_ERR_INVALID_ARGS;
-        }
-        mxrio_mmap_data_t* data = ptr;
-        mx_rights_t rights = MX_RIGHT_TRANSFER | MX_RIGHT_MAP |
-                             MX_RIGHT_DUPLICATE | MX_RIGHT_GET_PROPERTY;
-        if (data->flags & MXIO_MMAP_FLAG_WRITE) {
-            return MX_ERR_ACCESS_DENIED;
-        }
-        rights |= (data->flags & MXIO_MMAP_FLAG_READ) ? MX_RIGHT_READ : 0;
-        rights |= (data->flags & MXIO_MMAP_FLAG_EXEC) ? MX_RIGHT_EXECUTE : 0;
-
-        // Make a tiny clone of the portion of the portion of the VMO representing this file
-        mx_handle_t h;
-        // TODO(smklein): In the future, "vf->vmo" will already be a cloned vmo
-        // representing this file (logically, making "vf->off" always zero), and
-        // nothing past "vf->end". As a consequence, we will be able to
-        // duplicate "vf->vmo" instead of cloning it.
-        mx_status_t status = mx_vmo_clone(vf->vmo, MX_VMO_CLONE_COPY_ON_WRITE,
-                                          vf->off, vf->end - vf->off, &h);
-        if (status != MX_OK) {
-            return status;
-        }
-        // Only return this clone with the requested rights
-        mx_handle_t out;
-        if ((status = mx_handle_replace(h, rights, &out)) != MX_OK) {
-            mx_handle_close(h);
-            return status;
-        }
-        return out;
-    }
-    case MXRIO_FCNTL: {
-        uint32_t cmd = maxreply;
-        switch (cmd) {
-        case F_GETFL: {
-            uint32_t* flags = (uint32_t*) ptr;
-            if (flags) {
-                *flags = 0;
-            }
-        }
-        case F_SETFL:
-            return MX_OK;
-        default:
-            return MX_ERR_NOT_SUPPORTED;
-        }
-    }
-    default:
-        return MX_ERR_INVALID_ARGS;
-    }
-}
-
-mx_status_t vmofile_get_vmo(mxio_t* io, mx_handle_t* out, size_t* off, size_t* len) {
-    vmofile_t* vf = (vmofile_t*)io;
-
-    if ((out == NULL) || (off == NULL) || (len == NULL)) {
-        return MX_ERR_INVALID_ARGS;
-    }
-
-    *off = vf->off;
-    *len = vf->end - vf->off;
-    return mx_handle_duplicate(vf->vmo, MX_RIGHT_SAME_RIGHTS, out);
-}
-
-static mxio_ops_t vmofile_ops = {
-    .read = vmofile_read,
-    .read_at = vmofile_read_at,
-    .write = mxio_default_write,
-    .write_at = vmofile_write_at,
-    .recvfrom = mxio_default_recvfrom,
-    .sendto = mxio_default_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
-    .seek = vmofile_seek,
-    .misc = vmofile_misc,
-    .close = vmofile_close,
-    .open = mxio_default_open,
-    .clone = mxio_default_clone,
-    .ioctl = mxio_default_ioctl,
-    .wait_begin = mxio_default_wait_begin,
-    .wait_end = mxio_default_wait_end,
-    .unwrap = mxio_default_unwrap,
-    .shutdown = mxio_default_shutdown,
-    .posix_ioctl = mxio_default_posix_ioctl,
-    .get_vmo = vmofile_get_vmo,
-};
-
-mxio_t* mxio_vmofile_create(mx_handle_t h, mx_off_t off, mx_off_t len) {
-    vmofile_t* vf = calloc(1, sizeof(vmofile_t));
-    if (vf == NULL) {
-        mx_handle_close(h);
-        return NULL;
-    }
-    vf->io.ops = &vmofile_ops;
-    vf->io.magic = MXIO_MAGIC;
-    atomic_init(&vf->io.refcount, 1);
-    vf->vmo = h;
-    vf->off = off;
-    vf->end = off + len;
-    vf->ptr = off;
-    mtx_init(&vf->lock, mtx_plain);
-    return &vf->io;
-}
-
-int mxio_vmo_fd(mx_handle_t vmo, uint64_t offset, uint64_t length) {
-    mxio_t* io;
-    int fd;
-    if ((io = mxio_vmofile_create(vmo, offset, length)) == NULL) {
-        return -1;
-    }
-    if ((fd = mxio_bind_to_fd(io, -1, 0)) < 0) {
-        mxio_close(io);
-        mxio_release(io);
-        return -1;
-    }
-    return fd;
-}
diff --git a/system/ulib/mxio/waitable.c b/system/ulib/mxio/waitable.c
deleted file mode 100644
index 0bb613c..0000000
--- a/system/ulib/mxio/waitable.c
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <poll.h>
-#include <stdbool.h>
-#include <stdlib.h>
-
-#include <magenta/syscalls.h>
-#include <mxio/io.h>
-
-#include "private.h"
-
-typedef struct mxwio mxwio_t;
-struct mxwio {
-    // base mxio io object
-    mxio_t io;
-
-    // arbitrary handle
-    mx_handle_t h;
-
-    // signals that cause POLLIN
-    mx_signals_t signals_in;
-
-    // signals that cause POLLOUT
-    mx_signals_t signals_out;
-
-    // if true, don't close handle on close() op
-    bool shared_handle;
-};
-
-static mx_status_t mxwio_close(mxio_t* io) {
-    mxwio_t* wio = (mxwio_t*)io;
-    mx_handle_t h = wio->h;
-    wio->h = MX_HANDLE_INVALID;
-    if (!wio->shared_handle) {
-        mx_handle_close(h);
-    }
-    return MX_OK;
-}
-
-static void mxwio_wait_begin(mxio_t* io, uint32_t events, mx_handle_t* handle,
-                             mx_signals_t* _signals) {
-    mxwio_t* wio = (void*)io;
-    *handle = wio->h;
-    mx_signals_t signals = 0;
-    if (events & POLLIN) {
-        signals |= wio->signals_in;
-    }
-    if (events & POLLOUT) {
-        signals |= wio->signals_out;
-    }
-    *_signals = signals;
-}
-
-static void mxwio_wait_end(mxio_t* io, mx_signals_t signals, uint32_t* _events) {
-    mxwio_t* wio = (void*)io;
-    uint32_t events = 0;
-    if (signals & wio->signals_in) {
-        events |= POLLIN;
-    }
-    if (signals & wio->signals_out) {
-        events |= POLLOUT;
-    }
-    *_events = events;
-}
-
-static mxio_ops_t mxio_waitable_ops = {
-    .read = mxio_default_read,
-    .read_at = mxio_default_read_at,
-    .write = mxio_default_write,
-    .write_at = mxio_default_write_at,
-    .recvfrom = mxio_default_recvfrom,
-    .sendto = mxio_default_sendto,
-    .recvmsg = mxio_default_recvmsg,
-    .sendmsg = mxio_default_sendmsg,
-    .seek = mxio_default_seek,
-    .misc = mxio_default_misc,
-    .close = mxwio_close,
-    .open = mxio_default_open,
-    .clone = mxio_default_clone,
-    .ioctl = mxio_default_ioctl,
-    .unwrap = mxio_default_unwrap,
-    .shutdown = mxio_default_shutdown,
-    .wait_begin = mxwio_wait_begin,
-    .wait_end = mxwio_wait_end,
-    .posix_ioctl = mxio_default_posix_ioctl,
-};
-
-mxio_t* mxio_waitable_create(mx_handle_t h, mx_signals_t signals_in,
-                             mx_signals_t signals_out, bool shared_handle) {
-    mxwio_t* wio = calloc(1, sizeof(*wio));
-    if (wio == NULL) {
-        if (!shared_handle) {
-            mx_handle_close(h);
-        }
-        return NULL;
-    }
-    wio->io.ops = &mxio_waitable_ops;
-    wio->io.magic = MXIO_MAGIC;
-    wio->io.refcount = 1;
-    wio->io.flags |= MXIO_FLAG_WAITABLE;
-    wio->h = h;
-    wio->signals_in = signals_in;
-    wio->signals_out = signals_out;
-    wio->shared_handle = shared_handle;
-    return &wio->io;
-}
diff --git a/system/ulib/port/include/port/port.h b/system/ulib/port/include/port/port.h
index 9be1fd6..c004747 100644
--- a/system/ulib/port/include/port/port.h
+++ b/system/ulib/port/include/port/port.h
@@ -4,48 +4,48 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
 typedef struct port_handler port_handler_t;
 
 struct port_handler {
-    mx_handle_t handle;
-    mx_signals_t waitfor;
-    mx_status_t (*func)(port_handler_t* ph, mx_signals_t signals, uint32_t evt);
+    zx_handle_t handle;
+    zx_signals_t waitfor;
+    zx_status_t (*func)(port_handler_t* ph, zx_signals_t signals, uint32_t evt);
 };
 
 typedef struct {
-    mx_handle_t handle;
+    zx_handle_t handle;
 } port_t;
 
 // Initialize a port
-mx_status_t port_init(port_t* port);
+zx_status_t port_init(port_t* port);
 
 // Wait for an event on a handle, as specified by
 // the provided port handler.
-mx_status_t port_wait(port_t* port, port_handler_t* ph);
+zx_status_t port_wait(port_t* port, port_handler_t* ph);
 
 // Wait for an event on a handle, as specified by
 // the provided port handler, in repeating mode.
-mx_status_t port_wait_repeating(port_t* port, port_handler_t* ph);
+zx_status_t port_wait_repeating(port_t* port, port_handler_t* ph);
 
 // Wait for a packet to arrive of for the port to timeout
 // If the port wait returns and error or timeout, returns that.
-// If once is true, returns MX_OK after handling a packet.
+// If once is true, returns ZX_OK after handling a packet.
 //
 // If a packet is received, the callback for the port handler
-// is invoked.  If that callback returns MX_OK, port_wait()
+// is invoked.  If that callback returns ZX_OK, port_wait()
 // is invoked on that port handler again.
-mx_status_t port_dispatch(port_t* port, mx_time_t timeout, bool once);
+zx_status_t port_dispatch(port_t* port, zx_time_t timeout, bool once);
 
 // Cancel pending waits for the handler on this port
-mx_status_t port_cancel(port_t* port, port_handler_t* ph);
+zx_status_t port_cancel(port_t* port, port_handler_t* ph);
 
 // Queue an event for the handler on this port
-mx_status_t port_queue(port_t* port, port_handler_t* ph, uint32_t evt);
+zx_status_t port_queue(port_t* port, port_handler_t* ph, uint32_t evt);
 
 
 
@@ -53,15 +53,15 @@
 
 struct port_fd_handler {
     port_handler_t ph;
-    void* mxio_context;
-    mx_status_t (*func)(port_fd_handler_t* fh, unsigned pollevt, uint32_t evt);
+    void* fdio_context;
+    zx_status_t (*func)(port_fd_handler_t* fh, unsigned pollevt, uint32_t evt);
 };
 
 // On success the embedded port_handler is configured to
 // wait on the correct handle and signals to observe the
 // specified pollevt (POLLIN, etc), and a reference is held
 // to the underlying fd.
-mx_status_t port_fd_handler_init(port_fd_handler_t* fh, int fd, unsigned pollevt);
+zx_status_t port_fd_handler_init(port_fd_handler_t* fh, int fd, unsigned pollevt);
 
 // Releases the reference to the fd held by this port_fd_handler
 void port_fd_handler_done(port_fd_handler_t* fh);
diff --git a/system/ulib/port/port.c b/system/ulib/port/port.c
index c54ca25..55fb5c4 100644
--- a/system/ulib/port/port.c
+++ b/system/ulib/port/port.c
@@ -7,10 +7,10 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 
-#include <mxio/private.h>
+#include <fdio/private.h>
 
 #include <port/port.h>
 
@@ -20,101 +20,101 @@
 #define zprintf(fmt...) do {} while (0)
 #endif
 
-mx_status_t port_init(port_t* port) {
-    mx_status_t r = mx_port_create(0, &port->handle);
+zx_status_t port_init(port_t* port) {
+    zx_status_t r = zx_port_create(0, &port->handle);
     zprintf("port_init(%p) port=%x\n", port, port->handle);
     return r;
 }
 
-mx_status_t port_wait(port_t* port, port_handler_t* ph) {
+zx_status_t port_wait(port_t* port, port_handler_t* ph) {
     zprintf("port_wait(%p, %p) obj=%x port=%x\n",
             port, ph, ph->handle, port->handle);
-    return mx_object_wait_async(ph->handle, port->handle,
+    return zx_object_wait_async(ph->handle, port->handle,
                                 (uint64_t)(uintptr_t)ph,
-                                ph->waitfor, MX_WAIT_ASYNC_ONCE);
+                                ph->waitfor, ZX_WAIT_ASYNC_ONCE);
 }
 
-mx_status_t port_wait_repeating(port_t* port, port_handler_t* ph) {
+zx_status_t port_wait_repeating(port_t* port, port_handler_t* ph) {
     zprintf("port_wait_repeating(%p, %p) obj=%x port=%x\n",
             port, ph, ph->handle, port->handle);
-    return mx_object_wait_async(ph->handle, port->handle,
+    return zx_object_wait_async(ph->handle, port->handle,
                                 (uint64_t)(uintptr_t)ph,
-                                ph->waitfor, MX_WAIT_ASYNC_REPEATING);
+                                ph->waitfor, ZX_WAIT_ASYNC_REPEATING);
 }
 
 
-mx_status_t port_cancel(port_t* port, port_handler_t* ph) {
-    mx_status_t r = mx_port_cancel(port->handle, ph->handle,
+zx_status_t port_cancel(port_t* port, port_handler_t* ph) {
+    zx_status_t r = zx_port_cancel(port->handle, ph->handle,
                                    (uint64_t)(uintptr_t)ph);
     zprintf("port_cancel(%p, %p) obj=%x port=%x: r = %d\n",
             port, ph, ph->handle, port->handle, r);
     return r;
 }
 
-mx_status_t port_queue(port_t* port, port_handler_t* ph, uint32_t evt) {
-    mx_port_packet_t pkt;
+zx_status_t port_queue(port_t* port, port_handler_t* ph, uint32_t evt) {
+    zx_port_packet_t pkt;
     pkt.key = (uintptr_t)ph;
     pkt.user.u32[0] = evt;
-    mx_status_t r = mx_port_queue(port->handle, &pkt, 0);
+    zx_status_t r = zx_port_queue(port->handle, &pkt, 0);
     zprintf("port_queue(%p, %p) obj=%x port=%x evt=%x: r=%d\n",
             port, ph, ph->handle, port->handle, r, evt);
     return r;
 }
 
-mx_status_t port_dispatch(port_t* port, mx_time_t deadline, bool once) {
+zx_status_t port_dispatch(port_t* port, zx_time_t deadline, bool once) {
     for (;;) {
-        mx_port_packet_t pkt;
-        mx_status_t r;
-        if ((r = mx_port_wait(port->handle, deadline, &pkt, 0)) != MX_OK) {
-            if (r != MX_ERR_TIMED_OUT) {
+        zx_port_packet_t pkt;
+        zx_status_t r;
+        if ((r = zx_port_wait(port->handle, deadline, &pkt, 0)) != ZX_OK) {
+            if (r != ZX_ERR_TIMED_OUT) {
                 printf("port_dispatch: port wait failed %d\n", r);
             }
             return r;
         }
         port_handler_t* ph = (void*) (uintptr_t) pkt.key;
-        if (pkt.type == MX_PKT_TYPE_USER) {
+        if (pkt.type == ZX_PKT_TYPE_USER) {
             zprintf("port_dispatch(%p) port=%x ph=%p func=%p: evt=%x\n",
                     port, port->handle, ph, ph->func, pkt.user.u32[0]);
             ph->func(ph, 0, pkt.user.u32[0]);
         } else {
             zprintf("port_dispatch(%p) port=%x ph=%p func=%p: signals=%x\n",
                     port, port->handle, ph, ph->func, pkt.signal.observed);
-            if (ph->func(ph, pkt.signal.observed, 0) == MX_OK) {
+            if (ph->func(ph, pkt.signal.observed, 0) == ZX_OK) {
                 port_wait(port, ph);
             }
         }
         if (once) {
-            return MX_OK;
+            return ZX_OK;
         }
     }
 }
 
-static mx_status_t port_fd_handler_func(port_handler_t* ph, mx_signals_t signals, uint32_t evt) {
+static zx_status_t port_fd_handler_func(port_handler_t* ph, zx_signals_t signals, uint32_t evt) {
     port_fd_handler_t* fh = (void*) ph;
 
     if (evt) {
         return fh->func(fh, 0, evt);
     } else {
         uint32_t pollevt;
-        __mxio_wait_end(fh->mxio_context, signals, &pollevt);
+        __fdio_wait_end(fh->fdio_context, signals, &pollevt);
         return fh->func(fh, pollevt, 0);
     }
 }
 
-mx_status_t port_fd_handler_init(port_fd_handler_t* fh, int fd, unsigned pollevt) {
-    mxio_t* io = __mxio_fd_to_io(fd);
+zx_status_t port_fd_handler_init(port_fd_handler_t* fh, int fd, unsigned pollevt) {
+    fdio_t* io = __fdio_fd_to_io(fd);
     if (io == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
-    __mxio_wait_begin(io, pollevt, &fh->ph.handle, &fh->ph.waitfor);
+    __fdio_wait_begin(io, pollevt, &fh->ph.handle, &fh->ph.waitfor);
     fh->ph.func = port_fd_handler_func;
-    fh->mxio_context = io;
-    return MX_OK;
+    fh->fdio_context = io;
+    return ZX_OK;
 }
 
 void port_fd_handler_done(port_fd_handler_t* fh) {
-    __mxio_release(fh->mxio_context);
-    fh->mxio_context = NULL;
-    fh->ph.handle = MX_HANDLE_INVALID;
+    __fdio_release(fh->fdio_context);
+    fh->fdio_context = NULL;
+    fh->ph.handle = ZX_HANDLE_INVALID;
     fh->ph.waitfor = 0;
 }
diff --git a/system/ulib/port/rules.mk b/system/ulib/port/rules.mk
index 2dee170..64e9f63 100644
--- a/system/ulib/port/rules.mk
+++ b/system/ulib/port/rules.mk
@@ -10,7 +10,7 @@
 
 MODULE_SRCS += $(LOCAL_DIR)/port.c
 
-MODULE_LIBS := system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/c
 
 include make/module.mk
 
diff --git a/system/ulib/pretty/BUILD.gn b/system/ulib/pretty/BUILD.gn
index 30b9ca6..7e4d98b 100644
--- a/system/ulib/pretty/BUILD.gn
+++ b/system/ulib/pretty/BUILD.gn
@@ -16,7 +16,7 @@
     "include/pretty/sizes.h",
   ]
   deps = [
-    "//magenta/system/public",
+    "//zircon/system/public",
   ]
   public_configs = [ ":pretty_config" ]
 }
diff --git a/system/ulib/pretty/include/pretty/hexdump.h b/system/ulib/pretty/include/pretty/hexdump.h
index 4f48842..173ef52 100644
--- a/system/ulib/pretty/include/pretty/hexdump.h
+++ b/system/ulib/pretty/include/pretty/hexdump.h
@@ -6,7 +6,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
diff --git a/system/ulib/pretty/include/pretty/sizes.h b/system/ulib/pretty/include/pretty/sizes.h
index 183f728..b7a97fe 100644
--- a/system/ulib/pretty/include/pretty/sizes.h
+++ b/system/ulib/pretty/include/pretty/sizes.h
@@ -6,7 +6,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include <stddef.h>
 
diff --git a/system/ulib/pretty/rules.mk b/system/ulib/pretty/rules.mk
index 5dfa3ad..c1eb439 100644
--- a/system/ulib/pretty/rules.mk
+++ b/system/ulib/pretty/rules.mk
@@ -13,7 +13,7 @@
     $(LOCAL_DIR)/sizes.c
 
 MODULE_LIBS := \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
@@ -29,7 +29,7 @@
 
 MODULE_LIBS := \
     system/ulib/unittest \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/c
 
 MODULE_STATIC_LIBS := \
diff --git a/system/ulib/pretty/sizes.c b/system/ulib/pretty/sizes.c
index 41c880d..9f125c6 100644
--- a/system/ulib/pretty/sizes.c
+++ b/system/ulib/pretty/sizes.c
@@ -9,7 +9,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 char* format_size_fixed(char* str, size_t str_size, size_t bytes, char unit) {
     static const char units[] = "BkMGTPE";
@@ -19,7 +19,7 @@
         // Even if NULL.
         return str;
     }
-    MX_DEBUG_ASSERT(str != NULL);
+    ZX_DEBUG_ASSERT(str != NULL);
     if (str_size == 1) {
         str[0] = '\0';
         return str;
@@ -47,7 +47,7 @@
         if (ui >= num_units) {
             // We probably got an unknown unit. Fall back to a natural unit,
             // but leave a hint that something's wrong.
-            MX_DEBUG_ASSERT(str_size > 1);
+            ZX_DEBUG_ASSERT(str_size > 1);
             *str++ = '?';
             str_size--;
             unit = 0;
diff --git a/system/ulib/region-alloc/include/region-alloc/region-alloc.h b/system/ulib/region-alloc/include/region-alloc/region-alloc.h
index 147a376..6fabbdd 100644
--- a/system/ulib/region-alloc/include/region-alloc/region-alloc.h
+++ b/system/ulib/region-alloc/include/region-alloc/region-alloc.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <fbl/auto_lock.h>
 #include <fbl/mutex.h>
 #include <stdbool.h>
@@ -118,10 +118,10 @@
 //  auto r8 = alloc.GetRegion(80000, 4 << 10);
 //
 //  /* Print some stuff about some of the allocations */
-//  MX_DEBUG_ASSERT(r3 != nullptr);
+//  ZX_DEBUG_ASSERT(r3 != nullptr);
 //  printf("R3 base %llx size %llx\n", r3->base, r3->size)
 //
-//  MX_DEBUG_ASSERT(r8 != nullptr);
+//  ZX_DEBUG_ASSERT(r8 != nullptr);
 //  printf("R8 base %llx size %llx\n", r8->base, r8->size)
 //
 //  /* No need to clean up.  Regions will automatically be returned to the
@@ -158,7 +158,7 @@
 // ++ Release (release the C reference to the object.
 //
 #define REGION_POOL_SLAB_SIZE (4u << 10)
-mx_status_t ralloc_create_pool(size_t max_memory, ralloc_pool_t** out_pool);
+zx_status_t ralloc_create_pool(size_t max_memory, ralloc_pool_t** out_pool);
 void        ralloc_release_pool(ralloc_pool_t* pool);
 
 // RegionAllocator interface.  Valid operations are...
@@ -172,24 +172,24 @@
 // ++ GetBySize (allocates a region based on size/alignment requirements)
 // ++ GetSpecific (allocates a region based on specific base/size requirements)
 //
-mx_status_t ralloc_create_allocator(ralloc_allocator_t** out_allocator);
-mx_status_t ralloc_set_region_pool(ralloc_allocator_t* allocator, ralloc_pool_t* pool);
+zx_status_t ralloc_create_allocator(ralloc_allocator_t** out_allocator);
+zx_status_t ralloc_set_region_pool(ralloc_allocator_t* allocator, ralloc_pool_t* pool);
 void ralloc_reset_allocator(ralloc_allocator_t* allocator);
 void ralloc_destroy_allocator(ralloc_allocator_t* allocator);
-mx_status_t ralloc_add_region(ralloc_allocator_t* allocator,
+zx_status_t ralloc_add_region(ralloc_allocator_t* allocator,
                               const ralloc_region_t* region,
                               bool allow_overlap);
-mx_status_t ralloc_sub_region(ralloc_allocator_t* allocator,
+zx_status_t ralloc_sub_region(ralloc_allocator_t* allocator,
                               const ralloc_region_t* region,
                               bool allow_incomplete);
 
-mx_status_t ralloc_get_sized_region_ex(
+zx_status_t ralloc_get_sized_region_ex(
         ralloc_allocator_t* allocator,
         uint64_t size,
         uint64_t alignment,
         const ralloc_region_t** out_region);
 
-mx_status_t ralloc_get_specific_region_ex(
+zx_status_t ralloc_get_specific_region_ex(
         ralloc_allocator_t* allocator,
         const ralloc_region_t* requested_region,
         const ralloc_region_t** out_region);
@@ -307,7 +307,7 @@
         // with another available region, or when the allocator finally shuts
         // down.
         void fbl_recycle() {
-            MX_DEBUG_ASSERT(owner_ != nullptr);
+            ZX_DEBUG_ASSERT(owner_ != nullptr);
             owner_->ReleaseRegion(this);
         }
 
@@ -355,10 +355,10 @@
     // Set the RegionPool this RegionAllocator will obtain bookkeeping structures from.
     //
     // Possible return values
-    // ++ MX_ERR_BAD_STATE : The RegionAllocator currently has a RegionPool
+    // ++ ZX_ERR_BAD_STATE : The RegionAllocator currently has a RegionPool
     // assigned and currently has allocations from this pool.
-    mx_status_t SetRegionPool(const RegionPool::RefPtr& region_pool);
-    mx_status_t SetRegionPool(RegionPool::RefPtr&& region_pool) {
+    zx_status_t SetRegionPool(const RegionPool::RefPtr& region_pool);
+    zx_status_t SetRegionPool(RegionPool::RefPtr&& region_pool) {
         RegionPool::RefPtr ref(fbl::move(region_pool));
         return SetRegionPool(ref);
     }
@@ -376,16 +376,16 @@
     // region.
     //
     // Possible return values
-    // ++ MX_ERR_BAD_STATE : Allocator has no RegionPool assigned.
-    // ++ MX_ERR_NO_MEMORY : not enough bookkeeping memory available in our
+    // ++ ZX_ERR_BAD_STATE : Allocator has no RegionPool assigned.
+    // ++ ZX_ERR_NO_MEMORY : not enough bookkeeping memory available in our
     // assigned region pool to add the region.
-    // ++ MX_ERR_INVALID_ARGS : One of the following conditions applies.
+    // ++ ZX_ERR_INVALID_ARGS : One of the following conditions applies.
     // ++++ The region is invalid (wraps the space, or size is zero)
     // ++++ The region being added intersects one or more currently
     //      allocated regions.
     // ++++ The region being added intersects one ore more of the currently
     //      available regions, and allow_overlap is false.
-    mx_status_t AddRegion(const ralloc_region_t& region, bool allow_overlap = false);
+    zx_status_t AddRegion(const ralloc_region_t& region, bool allow_overlap = false);
 
     // Subtract a region from the set of allocatable regions.
     //
@@ -399,46 +399,46 @@
     // region.
     //
     // Possible return values
-    // ++ MX_ERR_BAD_STATE : Allocator has no RegionPool assigned.
-    // ++ MX_ERR_NO_MEMORY : not enough bookkeeping memory available in our
+    // ++ ZX_ERR_BAD_STATE : Allocator has no RegionPool assigned.
+    // ++ ZX_ERR_NO_MEMORY : not enough bookkeeping memory available in our
     // assigned region pool to subtract the region.
-    // ++ MX_ERR_INVALID_ARGS : One of the following conditions applies.
+    // ++ ZX_ERR_INVALID_ARGS : One of the following conditions applies.
     // ++++ The region is invalid (wraps the space, or size is zero)
     // ++++ The region being subtracted intersects one or more currently
     //      allocated regions.
     // ++++ The region being subtracted intersects portions of the space which
     //      are absent from both the allocated and available sets, and
     //      allow_incomplete is false.
-    mx_status_t SubtractRegion(const ralloc_region_t& region, bool allow_incomplete = false);
+    zx_status_t SubtractRegion(const ralloc_region_t& region, bool allow_incomplete = false);
 
     // Get a region out of the set of currently available regions which has a
     // specified size and alignment.  Note; the alignment must be a power of
     // two.  Pass 1 if alignment does not matter.
     //
     // Possible return values
-    // ++ MX_ERR_BAD_STATE : Allocator has no RegionPool assigned.
-    // ++ MX_ERR_NO_MEMORY : not enough bookkeeping memory available in our
+    // ++ ZX_ERR_BAD_STATE : Allocator has no RegionPool assigned.
+    // ++ ZX_ERR_NO_MEMORY : not enough bookkeeping memory available in our
     // assigned region pool to perform the allocation.
-    // ++ MX_ERR_INVALID_ARGS : size is zero, or alignment is not a power of two.
-    // ++ MX_ERR_NOT_FOUND : No suitable region could be found in the set of
+    // ++ ZX_ERR_INVALID_ARGS : size is zero, or alignment is not a power of two.
+    // ++ ZX_ERR_NOT_FOUND : No suitable region could be found in the set of
     // currently available regions which can satisfy the request.
-    mx_status_t GetRegion(uint64_t size, uint64_t alignment, Region::UPtr& out_region);
+    zx_status_t GetRegion(uint64_t size, uint64_t alignment, Region::UPtr& out_region);
 
     // Get a region with a specific location and size out of the set of
     // currently available regions.
     //
     // Possible return values
-    // ++ MX_ERR_BAD_STATE : Allocator has no RegionPool assigned.
-    // ++ MX_ERR_NO_MEMORY : not enough bookkeeping memory available in our
+    // ++ ZX_ERR_BAD_STATE : Allocator has no RegionPool assigned.
+    // ++ ZX_ERR_NO_MEMORY : not enough bookkeeping memory available in our
     // assigned region pool to perform the allocation.
-    // ++ MX_ERR_INVALID_ARGS : The size of the requested region is zero.
-    // ++ MX_ERR_NOT_FOUND : No suitable region could be found in the set of
+    // ++ ZX_ERR_INVALID_ARGS : The size of the requested region is zero.
+    // ++ ZX_ERR_NOT_FOUND : No suitable region could be found in the set of
     // currently available regions which can satisfy the request.
-    mx_status_t GetRegion(const ralloc_region_t& requested_region, Region::UPtr& out_region);
+    zx_status_t GetRegion(const ralloc_region_t& requested_region, Region::UPtr& out_region);
 
     // Helper which defaults the alignment of a size/alignment based allocation
     // to pointer-aligned.
-    mx_status_t GetRegion(uint64_t size, Region::UPtr& out_region) {
+    zx_status_t GetRegion(uint64_t size, Region::UPtr& out_region) {
         return GetRegion(size, sizeof(void*), out_region);
     }
 
@@ -474,11 +474,11 @@
     }
 
 private:
-    mx_status_t AddSubtractSanityCheckLocked(const ralloc_region_t& region);
+    zx_status_t AddSubtractSanityCheckLocked(const ralloc_region_t& region);
     void ReleaseRegion(Region* region);
     void AddRegionToAvailLocked(Region* region, bool allow_overlap = false);
 
-    mx_status_t AllocFromAvailLocked(Region::WAVLTreeSortBySize::iterator source,
+    zx_status_t AllocFromAvailLocked(Region::WAVLTreeSortBySize::iterator source,
                                      Region::UPtr& out_region,
                                      uint64_t base,
                                      uint64_t size);
diff --git a/system/ulib/region-alloc/region-alloc-c-api.cpp b/system/ulib/region-alloc/region-alloc-c-api.cpp
index de83735..f744bd4 100644
--- a/system/ulib/region-alloc/region-alloc-c-api.cpp
+++ b/system/ulib/region-alloc/region-alloc-c-api.cpp
@@ -2,28 +2,28 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/listnode.h>   // for contiainerof
+#include <zircon/listnode.h>   // for contiainerof
 #include <region-alloc/region-alloc.h>
 
 extern "C" {
 
-mx_status_t ralloc_create_pool(size_t max_memory, ralloc_pool_t** out_pool) {
+zx_status_t ralloc_create_pool(size_t max_memory, ralloc_pool_t** out_pool) {
     if (out_pool == nullptr)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     auto pool = RegionAllocator::RegionPool::Create(max_memory);
     if (pool == nullptr)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     // Everything looks good.  Deliberately leak our reference out into the cold
     // cruel world of C.  I sure hope that it comes back some day...
     *out_pool = reinterpret_cast<ralloc_pool_t*>(pool.leak_ref());
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void ralloc_release_pool(ralloc_pool_t* pool) {
-    MX_DEBUG_ASSERT(pool != nullptr);
+    ZX_DEBUG_ASSERT(pool != nullptr);
 
     // Relclaim our reference back from the land of C by turning the pointer
     // back into a RefPtr, then deliberately let it go out of scope, dropping
@@ -32,21 +32,21 @@
             reinterpret_cast<RegionAllocator::RegionPool*>(pool));
 }
 
-mx_status_t ralloc_create_allocator(ralloc_allocator_t** out_allocator) {
+zx_status_t ralloc_create_allocator(ralloc_allocator_t** out_allocator) {
     if (!out_allocator)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     void* mem = ::malloc(sizeof(RegionAllocator));
     if (!mem)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     *out_allocator = reinterpret_cast<ralloc_allocator_t*>(new (mem) RegionAllocator());
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t ralloc_set_region_pool(ralloc_allocator_t* allocator, ralloc_pool* pool) {
+zx_status_t ralloc_set_region_pool(ralloc_allocator_t* allocator, ralloc_pool* pool) {
     if (!allocator || !pool)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     RegionAllocator& alloc = *(reinterpret_cast<RegionAllocator*>(allocator));
 
@@ -56,89 +56,89 @@
     // the unmanaged reference held by our C user.
     auto pool_ref = fbl::internal::MakeRefPtrNoAdopt(
             reinterpret_cast<RegionAllocator::RegionPool*>(pool));
-    mx_status_t ret = alloc.SetRegionPool(pool_ref);
+    zx_status_t ret = alloc.SetRegionPool(pool_ref);
     __UNUSED auto leak = pool_ref.leak_ref();
 
     return ret;
 }
 
 void ralloc_reset_allocator(ralloc_allocator_t* allocator) {
-    MX_DEBUG_ASSERT(allocator);
+    ZX_DEBUG_ASSERT(allocator);
     reinterpret_cast<RegionAllocator*>(allocator)->Reset();
 }
 
 void ralloc_destroy_allocator(ralloc_allocator_t* allocator) {
-    MX_DEBUG_ASSERT(allocator);
+    ZX_DEBUG_ASSERT(allocator);
 
     RegionAllocator* alloc = reinterpret_cast<RegionAllocator*>(allocator);
     alloc->~RegionAllocator();
     ::free(alloc);
 }
 
-mx_status_t ralloc_add_region(ralloc_allocator_t* allocator,
+zx_status_t ralloc_add_region(ralloc_allocator_t* allocator,
                               const ralloc_region_t* region,
                               bool allow_overlap) {
     if (!allocator || !region)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     return reinterpret_cast<RegionAllocator*>(allocator)->AddRegion(*region, allow_overlap);
 }
 
-mx_status_t ralloc_sub_region(ralloc_allocator_t* allocator,
+zx_status_t ralloc_sub_region(ralloc_allocator_t* allocator,
                               const ralloc_region_t* region,
                               bool allow_incomplete) {
     if (!allocator || !region)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     return reinterpret_cast<RegionAllocator*>(allocator)->SubtractRegion(*region, allow_incomplete);
 }
 
-mx_status_t ralloc_get_sized_region_ex(ralloc_allocator_t* allocator,
+zx_status_t ralloc_get_sized_region_ex(ralloc_allocator_t* allocator,
                                        uint64_t size,
                                        uint64_t alignment,
                                        const ralloc_region_t** out_region) {
     if (!allocator || !out_region)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     RegionAllocator::Region::UPtr managed_region;
     RegionAllocator& alloc  = *(reinterpret_cast<RegionAllocator*>(allocator));
-    mx_status_t     result = alloc.GetRegion(size, alignment, managed_region);
+    zx_status_t     result = alloc.GetRegion(size, alignment, managed_region);
 
-    if (result == MX_OK) {
+    if (result == ZX_OK) {
         // Everything looks good.  Detach the managed_region our unique_ptr<>
         // and send the unmanaged pointer to the inner ralloc_region_t back
         // to the caller.
-        MX_DEBUG_ASSERT(managed_region != nullptr);
+        ZX_DEBUG_ASSERT(managed_region != nullptr);
         const RegionAllocator::Region* raw_region = managed_region.release();
         *out_region = static_cast<const ralloc_region_t*>(raw_region);
     } else {
-        MX_DEBUG_ASSERT(managed_region == nullptr);
+        ZX_DEBUG_ASSERT(managed_region == nullptr);
         *out_region = nullptr;
     }
 
     return result;
 }
 
-mx_status_t ralloc_get_specific_region_ex(
+zx_status_t ralloc_get_specific_region_ex(
         ralloc_allocator_t*     allocator,
         const ralloc_region_t*  requested_region,
         const ralloc_region_t** out_region) {
     if (!allocator || !requested_region || !out_region)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     RegionAllocator::Region::UPtr managed_region;
     RegionAllocator& alloc  = *(reinterpret_cast<RegionAllocator*>(allocator));
-    mx_status_t     result = alloc.GetRegion(*requested_region, managed_region);
+    zx_status_t     result = alloc.GetRegion(*requested_region, managed_region);
 
-    if (result == MX_OK) {
+    if (result == ZX_OK) {
         // Everything looks good.  Detach the managed_region our unique_ptr<>
         // and send the unmanaged pointer to the inner ralloc_region_t back
         // to the caller.
-        MX_DEBUG_ASSERT(managed_region != nullptr);
+        ZX_DEBUG_ASSERT(managed_region != nullptr);
         const RegionAllocator::Region* raw_region = managed_region.release();
         *out_region = static_cast<const ralloc_region_t*>(raw_region);
     } else {
-        MX_DEBUG_ASSERT(managed_region == nullptr);
+        ZX_DEBUG_ASSERT(managed_region == nullptr);
         *out_region = nullptr;
     }
 
@@ -146,19 +146,19 @@
 }
 
 size_t ralloc_get_allocated_region_count(const ralloc_allocator_t* allocator) {
-    MX_DEBUG_ASSERT(allocator != nullptr);
+    ZX_DEBUG_ASSERT(allocator != nullptr);
     const RegionAllocator& alloc = *(reinterpret_cast<const RegionAllocator*>(allocator));
     return alloc.AllocatedRegionCount();
 }
 
 size_t ralloc_get_available_region_count(const ralloc_allocator_t* allocator) {
-    MX_DEBUG_ASSERT(allocator != nullptr);
+    ZX_DEBUG_ASSERT(allocator != nullptr);
     const RegionAllocator& alloc = *(reinterpret_cast<const RegionAllocator*>(allocator));
     return alloc.AvailableRegionCount();
 }
 
 void ralloc_put_region(const ralloc_region_t* region) {
-    MX_DEBUG_ASSERT(region);
+    ZX_DEBUG_ASSERT(region);
 
     // Relclaim our reference back from the land of C by turning the pointer
     // back into a unique_ptr, then deliberately let it go out of scope, destroying the
diff --git a/system/ulib/region-alloc/region-alloc.cpp b/system/ulib/region-alloc/region-alloc.cpp
index 2272dfc..855fc67 100644
--- a/system/ulib/region-alloc/region-alloc.cpp
+++ b/system/ulib/region-alloc/region-alloc.cpp
@@ -17,15 +17,15 @@
 
 RegionAllocator::~RegionAllocator() {
     // No one should be destroying us while we have allocations in flight.
-    MX_DEBUG_ASSERT(allocated_regions_by_base_.is_empty());
+    ZX_DEBUG_ASSERT(allocated_regions_by_base_.is_empty());
 
     // We should have the same number of regions sorted by base address and by
     // size.
-    MX_DEBUG_ASSERT(avail_regions_by_base_.size() == avail_regions_by_size_.size());
+    ZX_DEBUG_ASSERT(avail_regions_by_base_.size() == avail_regions_by_size_.size());
 
     // We have to have a region pool assigned to us, or our available regions
     // need to be empty.
-    MX_DEBUG_ASSERT((region_pool_ != nullptr) ||
+    ZX_DEBUG_ASSERT((region_pool_ != nullptr) ||
                  (avail_regions_by_base_.is_empty() && avail_regions_by_size_.is_empty()));
 
     // Return all of our bookkeeping to our region pool.
@@ -38,7 +38,7 @@
 void RegionAllocator::Reset() {
     fbl::AutoLock alloc_lock(&alloc_lock_);
 
-    MX_DEBUG_ASSERT((region_pool_ != nullptr) || avail_regions_by_base_.is_empty());
+    ZX_DEBUG_ASSERT((region_pool_ != nullptr) || avail_regions_by_base_.is_empty());
 
     Region* removed;
     while ((removed = avail_regions_by_base_.pop_front()) != nullptr) {
@@ -46,55 +46,55 @@
         region_pool_->Delete(removed);
     }
 
-    MX_DEBUG_ASSERT(avail_regions_by_base_.is_empty());
-    MX_DEBUG_ASSERT(avail_regions_by_size_.is_empty());
+    ZX_DEBUG_ASSERT(avail_regions_by_base_.is_empty());
+    ZX_DEBUG_ASSERT(avail_regions_by_size_.is_empty());
 }
 
-mx_status_t RegionAllocator::SetRegionPool(const RegionPool::RefPtr& region_pool) {
+zx_status_t RegionAllocator::SetRegionPool(const RegionPool::RefPtr& region_pool) {
     fbl::AutoLock alloc_lock(&alloc_lock_);
 
     if (!allocated_regions_by_base_.is_empty() || !avail_regions_by_base_.is_empty())
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     region_pool_ = region_pool;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t RegionAllocator::AddRegion(const ralloc_region_t& region, bool allow_overlap) {
+zx_status_t RegionAllocator::AddRegion(const ralloc_region_t& region, bool allow_overlap) {
     fbl::AutoLock alloc_lock(&alloc_lock_);
 
     // Start with sanity checks
-    mx_status_t ret = AddSubtractSanityCheckLocked(region);
-    if (ret != MX_OK)
+    zx_status_t ret = AddSubtractSanityCheckLocked(region);
+    if (ret != ZX_OK)
         return ret;
 
     // Make sure that we do not intersect with the available regions if we do
     // not allow overlaps.
     if (!allow_overlap && IntersectsLocked(avail_regions_by_base_, region))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // All sanity checks passed.  Grab a piece of free bookeeping from our pool,
     // fill it out, then add it to the sets of available regions (indexed by
     // base address as well as size)
     Region* to_add = region_pool_->New(this);
     if (to_add == nullptr)
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
 
     to_add->base = region.base;
     to_add->size = region.size;
 
     AddRegionToAvailLocked(to_add, allow_overlap);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t RegionAllocator::SubtractRegion(const ralloc_region_t& to_subtract,
+zx_status_t RegionAllocator::SubtractRegion(const ralloc_region_t& to_subtract,
                                             bool allow_incomplete) {
     fbl::AutoLock alloc_lock(&alloc_lock_);
 
     // Start with sanity checks
-    mx_status_t ret = AddSubtractSanityCheckLocked(to_subtract);
-    if (ret != MX_OK)
+    zx_status_t ret = AddSubtractSanityCheckLocked(to_subtract);
+    if (ret != ZX_OK)
         return ret;
 
     // Make a copy of the region to subtract.  We may need to modify the region
@@ -124,10 +124,10 @@
                 Region* removed = avail_regions_by_base_.erase(before);
                 avail_regions_by_size_.erase(*removed);
 
-                MX_DEBUG_ASSERT(region_pool_ != nullptr);
+                ZX_DEBUG_ASSERT(region_pool_ != nullptr);
                 region_pool_->Delete(removed);
 
-                return MX_OK;
+                return ZX_OK;
             }
 
             // Case 2: before completely contains region.  The before region needs
@@ -136,7 +136,7 @@
             if ((region.base != before->base) && (region_end != before_end)) {
                 Region* second = region_pool_->New(this);
                 if (second == nullptr)
-                    return MX_ERR_NO_MEMORY;
+                    return ZX_ERR_NO_MEMORY;
 
                 // Looks like we have the memory we need.  Compute the base/size of
                 // the two regions which will be left over, then update the first
@@ -150,7 +150,7 @@
                 avail_regions_by_size_.insert(first);
                 avail_regions_by_base_.insert(second);
                 avail_regions_by_size_.insert(second);
-                return MX_OK;
+                return ZX_OK;
             }
 
             // Case 3: region trims the front of before.  Update before's base and
@@ -158,26 +158,26 @@
             // no need to recompute its position in the base index, this has not
             // changed.
             if (region.base == before->base) {
-                MX_DEBUG_ASSERT(region_end < before_end);
+                ZX_DEBUG_ASSERT(region_end < before_end);
 
                 Region* bptr = avail_regions_by_size_.erase(*before);
                 bptr->base += region.size;
                 bptr->size -= region.size;
                 avail_regions_by_size_.insert(bptr);
 
-                return MX_OK;
+                return ZX_OK;
             }
 
             // Case 4: region trims the end of before.  Update before's size and
             // recompute its position in the size index.
-            MX_DEBUG_ASSERT(region.base != before->base);
-            MX_DEBUG_ASSERT(region_end == before_end);
+            ZX_DEBUG_ASSERT(region.base != before->base);
+            ZX_DEBUG_ASSERT(region_end == before_end);
 
             Region* bptr = avail_regions_by_size_.erase(*before);
             bptr->size -= region.size;
             avail_regions_by_size_.insert(bptr);
 
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
@@ -185,7 +185,7 @@
     // available set which completely contains the subtraction region.  We
     // cannot continue unless allow_incomplete is true.
     if (!allow_incomplete)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Great!  At this point we know that we are going to succeed, we just need
     // to go about updating all of the bookkeeping.  We may need to trim the end
@@ -195,8 +195,8 @@
     // allocate any more bookkeeping, success is guaranteed.  Start by
     // considering the before region.
     if (before.IsValid()) {
-        MX_DEBUG_ASSERT(region.base >= before->base);
-        MX_DEBUG_ASSERT(region_end  >  before_end);
+        ZX_DEBUG_ASSERT(region.base >= before->base);
+        ZX_DEBUG_ASSERT(region_end  >  before_end);
         if (before_end > region.base) {
             // No matter what, 'before' needs to be removed from the size index.
             Region* bptr = avail_regions_by_size_.erase(*before);
@@ -207,7 +207,7 @@
             if (bptr->base == region.base) {
                 avail_regions_by_base_.erase(*bptr);
 
-                MX_DEBUG_ASSERT(region_pool_ != nullptr);
+                ZX_DEBUG_ASSERT(region_pool_ != nullptr);
                 region_pool_->Delete(bptr);
             } else {
                 bptr->size = region.base - bptr->base;
@@ -218,7 +218,7 @@
             // used to end.
             region.base = before_end;
             region.size = region_end - region.base;
-            MX_DEBUG_ASSERT(region.size > 0);
+            ZX_DEBUG_ASSERT(region.size > 0);
         }
     }
 
@@ -231,7 +231,7 @@
     // 3) Stop because all remaining regions start after the end of our
     //    subtraction region.
     while (after.IsValid()) {
-        MX_DEBUG_ASSERT(after->base > region.base);
+        ZX_DEBUG_ASSERT(after->base > region.base);
 
         // Case #3
         if (after->base >= region_end)
@@ -259,7 +259,7 @@
         region.base = trim_end;
         region.size = region_end - region.base;
 
-        MX_DEBUG_ASSERT(region_pool_ != nullptr);
+        ZX_DEBUG_ASSERT(region_pool_ != nullptr);
         region_pool_->Delete(trim);
 
         if (!region.size)
@@ -269,23 +269,23 @@
 
     // Sanity check.  The number of elements in the base index should match the
     // number of elements in the size index.
-    MX_DEBUG_ASSERT(avail_regions_by_base_.size() == avail_regions_by_size_.size());
-    return MX_OK;
+    ZX_DEBUG_ASSERT(avail_regions_by_base_.size() == avail_regions_by_size_.size());
+    return ZX_OK;
 }
 
-mx_status_t RegionAllocator::GetRegion(uint64_t size,
+zx_status_t RegionAllocator::GetRegion(uint64_t size,
                                        uint64_t alignment,
                                        Region::UPtr& out_region) {
     fbl::AutoLock alloc_lock(&alloc_lock_);
 
     // Check our RegionPool
     if (region_pool_ == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     // Sanity check the arguments.
     out_region = nullptr;
     if (!size || !alignment || !fbl::is_pow2(alignment))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Compute the things we will need round-up align base addresses.
     uint64_t mask     = alignment - 1;
@@ -300,7 +300,7 @@
     // restrictions.
     uint64_t aligned_base;
     while (iter.IsValid()) {
-        MX_DEBUG_ASSERT(iter->size >= size);
+        ZX_DEBUG_ASSERT(iter->size >= size);
         aligned_base = (iter->base + mask) & inv_mask;
         uint64_t overhead = aligned_base - iter->base;
         uint64_t leftover = iter->size - size;
@@ -316,18 +316,18 @@
     }
 
     if (!iter.IsValid())
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     return AllocFromAvailLocked(iter, out_region, aligned_base, size);
 }
 
-mx_status_t RegionAllocator::GetRegion(const ralloc_region_t& requested_region,
+zx_status_t RegionAllocator::GetRegion(const ralloc_region_t& requested_region,
                                        Region::UPtr& out_region) {
     fbl::AutoLock alloc_lock(&alloc_lock_);
 
     // Check our RegionPool
     if (region_pool_ == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     uint64_t base = requested_region.base;
     uint64_t size = requested_region.size;
@@ -335,7 +335,7 @@
     // Sanity check the arguments.
     out_region = nullptr;
     if (!size || ((base + size) < base))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Find the first available region whose base address is strictly greater
     // than the one we are looking for, then back up one.
@@ -346,7 +346,7 @@
     // is valid, then we can satisfy this request if and only if the region we
     // found completely contains the requested region.
     if (!iter.IsValid())
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     // We know that base must be >= iter->base
     // We know that iter->size is non-zero.
@@ -357,12 +357,12 @@
     // So, if request.end <= iter.end, we know that request is completely
     // contained within iter.  It does not matter if we use the inclusive or
     // exclusive end to check, as long as we are consistent.
-    MX_DEBUG_ASSERT(iter->size > 0);
-    MX_DEBUG_ASSERT(iter->base <= base);
+    ZX_DEBUG_ASSERT(iter->size > 0);
+    ZX_DEBUG_ASSERT(iter->base <= base);
     uint64_t req_end  = base + size - 1;
     uint64_t iter_end = iter->base + iter->size - 1;
     if (req_end > iter_end)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     // Great, we have found a region which should be able to satisfy our
     // allocation request.  Get an iterator for the by-size index, then use the
@@ -371,55 +371,55 @@
     return AllocFromAvailLocked(by_size_iter, out_region, base, size);
 }
 
-mx_status_t RegionAllocator::AddSubtractSanityCheckLocked(const ralloc_region_t& region) {
+zx_status_t RegionAllocator::AddSubtractSanityCheckLocked(const ralloc_region_t& region) {
     // Check our RegionPool
     if (region_pool_ == nullptr)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     // Sanity check the region to make sure that it is well formed.  We do not
     // allow a region which is of size zero, or which wraps around the
     // allocation space.
     if ((region.base + region.size) <= region.base)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     // Next, make sure the region we are adding or subtracting does not
     // intersect any region which is currently allocated.
     if (IntersectsLocked(allocated_regions_by_base_, region))
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 void RegionAllocator::ReleaseRegion(Region* region) {
     fbl::AutoLock alloc_lock(&alloc_lock_);
 
-    MX_DEBUG_ASSERT(region != nullptr);
+    ZX_DEBUG_ASSERT(region != nullptr);
 
     // When a region comes back from a user, it should be in the
     // allocated_regions_by_base tree, but not in either of the avail_regions
     // trees, and not in any free list.  Remove it from the allocated_regions
     // bookkeeping and add it back to the available regions.
-    MX_DEBUG_ASSERT(region->ns_tree_sort_by_base_.InContainer());
-    MX_DEBUG_ASSERT(!region->ns_tree_sort_by_size_.InContainer());
+    ZX_DEBUG_ASSERT(region->ns_tree_sort_by_base_.InContainer());
+    ZX_DEBUG_ASSERT(!region->ns_tree_sort_by_size_.InContainer());
 
     allocated_regions_by_base_.erase(*region);
     AddRegionToAvailLocked(region);
 }
 
-mx_status_t RegionAllocator::AllocFromAvailLocked(Region::WAVLTreeSortBySize::iterator source,
+zx_status_t RegionAllocator::AllocFromAvailLocked(Region::WAVLTreeSortBySize::iterator source,
                                                   Region::UPtr& out_region,
                                                   uint64_t base,
                                                   uint64_t size) {
-    MX_DEBUG_ASSERT(out_region == nullptr);
-    MX_DEBUG_ASSERT(source.IsValid());
-    MX_DEBUG_ASSERT(base >= source->base);
-    MX_DEBUG_ASSERT(size <= source->size);
+    ZX_DEBUG_ASSERT(out_region == nullptr);
+    ZX_DEBUG_ASSERT(source.IsValid());
+    ZX_DEBUG_ASSERT(base >= source->base);
+    ZX_DEBUG_ASSERT(size <= source->size);
 
     uint64_t overhead = base - source->base;
-    MX_DEBUG_ASSERT(overhead < source->size);
+    ZX_DEBUG_ASSERT(overhead < source->size);
 
     uint64_t leftover = source->size - size;
-    MX_DEBUG_ASSERT(leftover >= overhead);
+    ZX_DEBUG_ASSERT(leftover >= overhead);
 
     // Great, we found a region.  We may have to split the available region into
     // up to 2 sub regions depedning on where the aligned allocation lies in the
@@ -442,7 +442,7 @@
         // two pieces and return the one which comes first.
         Region* before_region = region_pool_->New(this);
         if (before_region == nullptr)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         Region* after_region = avail_regions_by_size_.erase(source);
 
@@ -462,7 +462,7 @@
         // which comes after.
         Region* after_region = region_pool_->New(this);
         if (after_region == nullptr)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         Region* before_region = avail_regions_by_size_.erase(source);
 
@@ -479,13 +479,13 @@
         // middle chunk.  Start by grabbing the bookkeeping we require first.
         Region* region = region_pool_->New(this);
         if (region == nullptr)
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
 
         Region* after_region = region_pool_->New(this);
         if (after_region == nullptr) {
-            MX_DEBUG_ASSERT(region_pool_ != nullptr);
+            ZX_DEBUG_ASSERT(region_pool_ != nullptr);
             region_pool_->Delete(region);
-            return MX_ERR_NO_MEMORY;
+            return ZX_ERR_NO_MEMORY;
         }
 
         Region* before_region = avail_regions_by_size_.erase(source);
@@ -503,16 +503,16 @@
 
         out_region.reset(region);
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
 void RegionAllocator::AddRegionToAvailLocked(Region* region, bool allow_overlap) {
     // Sanity checks.  This region should not exist in any bookkeeping, and
     // should not overlap with any of the regions we are currently tracking.
-    MX_DEBUG_ASSERT(!region->ns_tree_sort_by_base_.InContainer());
-    MX_DEBUG_ASSERT(!region->ns_tree_sort_by_size_.InContainer());
-    MX_DEBUG_ASSERT(!IntersectsLocked(allocated_regions_by_base_, *region));
-    MX_DEBUG_ASSERT(allow_overlap || !IntersectsLocked(avail_regions_by_base_, *region));
+    ZX_DEBUG_ASSERT(!region->ns_tree_sort_by_base_.InContainer());
+    ZX_DEBUG_ASSERT(!region->ns_tree_sort_by_size_.InContainer());
+    ZX_DEBUG_ASSERT(!IntersectsLocked(allocated_regions_by_base_, *region));
+    ZX_DEBUG_ASSERT(allow_overlap || !IntersectsLocked(avail_regions_by_base_, *region));
 
     // Find the region which comes before us and the region which comes after us
     // in the tree.
@@ -522,7 +522,7 @@
     // Merge with the region which comes before us if we can.
     uint64_t region_end = (region->base + region->size);    // exclusive end
     if (before.IsValid()) {
-        MX_DEBUG_ASSERT(before->base <= region->base);
+        ZX_DEBUG_ASSERT(before->base <= region->base);
 
         uint64_t before_end = (before->base + before->size);    // exclusive end
         if (allow_overlap ? (before_end >= region->base) : (before_end == region->base)) {
@@ -531,7 +531,7 @@
 
             auto removed = avail_regions_by_base_.erase(before);
             avail_regions_by_size_.erase(*removed);
-            MX_DEBUG_ASSERT(region_pool_ != nullptr);
+            ZX_DEBUG_ASSERT(region_pool_ != nullptr);
             region_pool_->Delete(removed);
         }
     }
@@ -539,7 +539,7 @@
     // Merge with the region which comes after us if we can, keep merging if we
     // allow overlaps.
     while (after.IsValid()) {
-        MX_DEBUG_ASSERT(region->base < after->base);
+        ZX_DEBUG_ASSERT(region->base < after->base);
 
         if (!(allow_overlap ? (region_end >= after->base) : (region_end == after->base)))
             break;
@@ -550,7 +550,7 @@
         auto remove_me = after++;
         auto removed  = avail_regions_by_base_.erase(remove_me);
         avail_regions_by_size_.erase(*removed);
-        MX_DEBUG_ASSERT(region_pool_ != nullptr);
+        ZX_DEBUG_ASSERT(region_pool_ != nullptr);
         region_pool_->Delete(removed);
 
         if (!allow_overlap)
diff --git a/system/ulib/region-alloc/rules.mk b/system/ulib/region-alloc/rules.mk
index 04a15b3..7bf9b6e 100644
--- a/system/ulib/region-alloc/rules.mk
+++ b/system/ulib/region-alloc/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_STATIC_LIBS := \
     system/ulib/fbl \
-    system/ulib/mxcpp
+    system/ulib/zxcpp
 
 include make/module.mk
diff --git a/system/ulib/runtime/include/runtime/message.h b/system/ulib/runtime/include/runtime/message.h
index 1c2a842..07996a4 100644
--- a/system/ulib/runtime/include/runtime/message.h
+++ b/system/ulib/runtime/include/runtime/message.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
@@ -13,7 +13,7 @@
 
 // Examine the next message to be read from the pipe, and yield
 // the data size and number of handles in that message.
-mx_status_t mxr_message_size(mx_handle_t msg_pipe,
+zx_status_t zxr_message_size(zx_handle_t msg_pipe,
                              uint32_t* nbytes, uint32_t* nhandles);
 
 #pragma GCC visibility pop
diff --git a/system/ulib/runtime/include/runtime/mutex.h b/system/ulib/runtime/include/runtime/mutex.h
index b7d2e1a..97058fc 100644
--- a/system/ulib/runtime/include/runtime/mutex.h
+++ b/system/ulib/runtime/include/runtime/mutex.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 #include <stdatomic.h>
 
@@ -13,35 +13,35 @@
 
 typedef struct {
     atomic_int futex;
-} mxr_mutex_t;
+} zxr_mutex_t;
 
-#define MXR_MUTEX_INIT ((mxr_mutex_t){})
+#define ZXR_MUTEX_INIT ((zxr_mutex_t){})
 
 #pragma GCC visibility push(hidden)
 
-// Attempts to take the lock without blocking. Returns MX_OK if the
-// lock is obtained, and MX_ERR_BAD_STATE if not.
-mx_status_t mxr_mutex_trylock(mxr_mutex_t* mutex);
+// Attempts to take the lock without blocking. Returns ZX_OK if the
+// lock is obtained, and ZX_ERR_BAD_STATE if not.
+zx_status_t zxr_mutex_trylock(zxr_mutex_t* mutex);
 
 // Attempts to take the lock before the timeout expires. This takes an
-// absolute time. Returns MX_OK if the lock is acquired, and
-// MX_ERR_TIMED_OUT if the timeout expires.
+// absolute time. Returns ZX_OK if the lock is acquired, and
+// ZX_ERR_TIMED_OUT if the timeout expires.
 //
 // This function is only for use by mtx_timedlock().
-mx_status_t __mxr_mutex_timedlock(mxr_mutex_t* mutex, mx_time_t abstime);
+zx_status_t __zxr_mutex_timedlock(zxr_mutex_t* mutex, zx_time_t abstime);
 
 // Blocks until the lock is obtained.
-void mxr_mutex_lock(mxr_mutex_t* mutex);
+void zxr_mutex_lock(zxr_mutex_t* mutex);
 
 // Unlocks the lock.
-void mxr_mutex_unlock(mxr_mutex_t* mutex);
+void zxr_mutex_unlock(zxr_mutex_t* mutex);
 
-// This is the same as mxr_mutex_lock() except that it always marks the
+// This is the same as zxr_mutex_lock() except that it always marks the
 // mutex as having a waiter.  This is intended for use by condvar
 // implementations.  This means that a thread waiting on a condvar futex
 // can be requeued onto the mutex's futex, so that a later call to
-// mxr_mutex_unlock() will wake that thread.
-void mxr_mutex_lock_with_waiter(mxr_mutex_t* mutex);
+// zxr_mutex_unlock() will wake that thread.
+void zxr_mutex_lock_with_waiter(zxr_mutex_t* mutex);
 
 #pragma GCC visibility pop
 
diff --git a/system/ulib/runtime/include/runtime/processargs.h b/system/ulib/runtime/include/runtime/processargs.h
index 82d6bdc..9774417 100644
--- a/system/ulib/runtime/include/runtime/processargs.h
+++ b/system/ulib/runtime/include/runtime/processargs.h
@@ -4,9 +4,9 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/processargs.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/processargs.h>
+#include <zircon/types.h>
 #include <stdalign.h>
 
 __BEGIN_CDECLS
@@ -14,29 +14,29 @@
 #pragma GCC visibility push(hidden)
 
 // Define a properly-aligned buffer on the stack for reading a processargs
-// message.  The nbytes parameter should be gotten from mxr_message_size.
-#define MXR_PROCESSARGS_BUFFER(variable, nbytes) \
-    alignas(mx_proc_args_t) uint8_t variable[nbytes]
+// message.  The nbytes parameter should be gotten from zxr_message_size.
+#define ZXR_PROCESSARGS_BUFFER(variable, nbytes) \
+    alignas(zx_proc_args_t) uint8_t variable[nbytes]
 
-// The buffer provided must be properly aligned (alignas(mx_proc_args_t))
+// The buffer provided must be properly aligned (alignas(zx_proc_args_t))
 // and large enough for the message pending on the given bootstrap
 // message-pipe handle.  This reads the message into that buffer, validates
 // the message format of, and yields pointers into the buffer for the
 // header and the handle-info array.
-mx_status_t mxr_processargs_read(mx_handle_t bootstrap,
+zx_status_t zxr_processargs_read(zx_handle_t bootstrap,
                                  void* buffer, uint32_t nbytes,
-                                 mx_handle_t handles[], uint32_t nhandles,
-                                 mx_proc_args_t** pargs,
+                                 zx_handle_t handles[], uint32_t nhandles,
+                                 zx_proc_args_t** pargs,
                                  uint32_t** handle_info);
 
-// This assumes mxr_processargs_read has already succeeded on the same
+// This assumes zxr_processargs_read has already succeeded on the same
 // buffer.  It unpacks the argument and environment strings into arrays
 // provided by the caller.  If not NULL, the argv[] array must have
-// mx_proc_args_t.args_num + 1 elements.  If not NULL, the envp[] array
-// must have mx_proc_args_t.environ_num + 1 elements.  If not NULL, the
-// names[] array must have mx_proc_args_t.names_num + 1 elements. The
+// zx_proc_args_t.args_num + 1 elements.  If not NULL, the envp[] array
+// must have zx_proc_args_t.environ_num + 1 elements.  If not NULL, the
+// names[] array must have zx_proc_args_t.names_num + 1 elements. The
 // last element of each array is filled with a NULL pointer.
-mx_status_t mxr_processargs_strings(void* msg, uint32_t bytes,
+zx_status_t zxr_processargs_strings(void* msg, uint32_t bytes,
                                     char* argv[], char* envp[],
                                     char* names[]);
 
diff --git a/system/ulib/runtime/include/runtime/thread.h b/system/ulib/runtime/include/runtime/thread.h
index ddec917..2986e96 100644
--- a/system/ulib/runtime/include/runtime/thread.h
+++ b/system/ulib/runtime/include/runtime/thread.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <runtime/mutex.h>
 #include <stdatomic.h>
 #include <stddef.h>
@@ -13,90 +13,90 @@
 
 __BEGIN_CDECLS
 
-typedef void (*mxr_thread_entry_t)(void*);
+typedef void (*zxr_thread_entry_t)(void*);
 
 typedef struct {
-    mxr_thread_entry_t entry;
+    zxr_thread_entry_t entry;
     void* arg;
 
-    mx_handle_t handle;
+    zx_handle_t handle;
 
     atomic_int state;
-} mxr_thread_t;
+} zxr_thread_t;
 
 #pragma GCC visibility push(hidden)
 
-// TODO(kulakowski) Document the possible mx_status_t values from these.
+// TODO(kulakowski) Document the possible zx_status_t values from these.
 
-// Create a thread, filling in the given mxr_thread_t to describe it.
-// The return value is that of mx_thread_create.
-// On failure, the mxr_thread_t is clobbered and cannot be passed to
-// any functions except mxr_thread_create or mxr_thread_adopt.
-// If detached is true, then it's as if mxr_thread_detach were called
+// Create a thread, filling in the given zxr_thread_t to describe it.
+// The return value is that of zx_thread_create.
+// On failure, the zxr_thread_t is clobbered and cannot be passed to
+// any functions except zxr_thread_create or zxr_thread_adopt.
+// If detached is true, then it's as if zxr_thread_detach were called
 // immediately after this returns (but it's more efficient, and can
-// never fail with MX_ERR_BAD_STATE).
-mx_status_t mxr_thread_create(mx_handle_t proc_self, const char* name,
-                              bool detached, mxr_thread_t* thread);
+// never fail with ZX_ERR_BAD_STATE).
+zx_status_t zxr_thread_create(zx_handle_t proc_self, const char* name,
+                              bool detached, zxr_thread_t* thread);
 
-// Fill in the given mxr_thread_t to describe a thread given its handle.
+// Fill in the given zxr_thread_t to describe a thread given its handle.
 // This takes ownership of the given thread handle.
-mx_status_t mxr_thread_adopt(mx_handle_t handle, mxr_thread_t* thread);
+zx_status_t zxr_thread_adopt(zx_handle_t handle, zxr_thread_t* thread);
 
 // Start the thread with the given stack, entrypoint, and
 // argument. stack_addr is taken to be the low address of the stack
 // mapping, and should be page aligned. The size of the stack should
 // be a multiple of PAGE_SIZE. When started, the thread will call
 // entry(arg).
-mx_status_t mxr_thread_start(mxr_thread_t* thread, uintptr_t stack_addr, size_t stack_size, mxr_thread_entry_t entry, void* arg);
+zx_status_t zxr_thread_start(zxr_thread_t* thread, uintptr_t stack_addr, size_t stack_size, zxr_thread_entry_t entry, void* arg);
 
 // Once started, threads can be either joined or detached. It is undefined
 // behavior to join a thread multiple times or to join a detached thread.
 // Some of the resources allocated to a thread are not collected until
 // it returns and it is either joined or detached.
 
-// If a thread is joined, the caller of mxr_thread_join blocks until
+// If a thread is joined, the caller of zxr_thread_join blocks until
 // the other thread is finished running.
-mx_status_t mxr_thread_join(mxr_thread_t* thread);
+zx_status_t zxr_thread_join(zxr_thread_t* thread);
 
 // If a thread is detached, instead of waiting to be joined, it will
 // clean up after itself, and the return value of the thread's
-// entrypoint is ignored.  This returns MX_ERR_BAD_STATE if the thread
+// entrypoint is ignored.  This returns ZX_ERR_BAD_STATE if the thread
 // had already finished running; it didn't know to clean up after itself
 // and it's gone now, so the caller must do any cleanup it would have
-// done after mxr_thread_join.  It is undefined behavior to detach
+// done after zxr_thread_join.  It is undefined behavior to detach
 // a thread that has already been joined or to detach an already detached
 // thread.
-mx_status_t mxr_thread_detach(mxr_thread_t* thread)
+zx_status_t zxr_thread_detach(zxr_thread_t* thread)
     __attribute__((warn_unused_result));
 
 // Indicates whether the thread has been detached.  The result is undefined
 // if the thread is exiting or has exited.
-bool mxr_thread_detached(mxr_thread_t* thread);
+bool zxr_thread_detached(zxr_thread_t* thread);
 
-// Exit from the thread.  Equivalent to mxr_thread_exit unless the
+// Exit from the thread.  Equivalent to zxr_thread_exit unless the
 // thread has been detached.  If it has been detached, then this does
-// mx_vmar_unmap(vmar, addr, len) first, but in a way that permits
+// zx_vmar_unmap(vmar, addr, len) first, but in a way that permits
 // unmapping the caller's own stack.
-_Noreturn void mxr_thread_exit_unmap_if_detached(
-    mxr_thread_t* thread, mx_handle_t vmar, uintptr_t addr, size_t len);
+_Noreturn void zxr_thread_exit_unmap_if_detached(
+    zxr_thread_t* thread, zx_handle_t vmar, uintptr_t addr, size_t len);
 
 // Destroy a thread structure that is either created but unstarted or is
-// known to belong to a thread that has been mx_task_kill'd and has not been
+// known to belong to a thread that has been zx_task_kill'd and has not been
 // joined.  This is only really useful for tests that are intentionally
 // bypassing the normal lifecycle of a thread, for handling tests that can't
 // detach or join.
 // This returns failure if the thread's handle was invalid.
-// Regardless, the mxr_thread_t is destroyed.
-mx_status_t mxr_thread_destroy(mxr_thread_t* thread);
+// Regardless, the zxr_thread_t is destroyed.
+zx_status_t zxr_thread_destroy(zxr_thread_t* thread);
 
-// Get the mx_handle_t corresponding to the given thread.
+// Get the zx_handle_t corresponding to the given thread.
 // WARNING:
 // This is intended for debuggers and so on. Holding this wrong could
-// break internal invariants of mxr_thread_t.  It is unsafe to call this
+// break internal invariants of zxr_thread_t.  It is unsafe to call this
 // function from a different thread once this thread is started, if it might
 // exit.  The returned handle is not a duplicate, and must be duplicated if the caller
-// intends to hold it after mxr_thread_start() is called.
-mx_handle_t mxr_thread_get_handle(mxr_thread_t* thread);
+// intends to hold it after zxr_thread_start() is called.
+zx_handle_t zxr_thread_get_handle(zxr_thread_t* thread);
 
 #pragma GCC visibility pop
 
diff --git a/system/ulib/runtime/include/runtime/tls.h b/system/ulib/runtime/include/runtime/tls.h
index cb74ca6..b97ad00 100644
--- a/system/ulib/runtime/include/runtime/tls.h
+++ b/system/ulib/runtime/include/runtime/tls.h
@@ -4,21 +4,21 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 
 __BEGIN_CDECLS
 
 #pragma GCC visibility push(hidden)
 
 // Get and set the thread pointer.
-static inline void* mxr_tp_get(void);
-static inline void mxr_tp_set(mx_handle_t self, void* tp);
+static inline void* zxr_tp_get(void);
+static inline void zxr_tp_set(zx_handle_t self, void* tp);
 
 #if defined(__aarch64__)
 
-__NO_SAFESTACK static inline void* mxr_tp_get(void) {
+__NO_SAFESTACK static inline void* zxr_tp_get(void) {
     // This just emits "mrs %[reg], tpidr_el0", but the compiler
     // knows what exactly it's doing (unlike an asm).  So it can
     // e.g. CSE it with another implicit thread-pointer fetch it
@@ -26,7 +26,7 @@
     return __builtin_thread_pointer();
 }
 
-__NO_SAFESTACK static inline void mxr_tp_set(mx_handle_t self, void* tp) {
+__NO_SAFESTACK static inline void zxr_tp_set(zx_handle_t self, void* tp) {
     __asm__ volatile("msr tpidr_el0, %0"
                      :
                      : "r"(tp));
@@ -34,11 +34,11 @@
 
 #elif defined(__x86_64__)
 
-__NO_SAFESTACK static inline void* mxr_tp_get(void) {
+__NO_SAFESTACK static inline void* zxr_tp_get(void) {
     // This fetches %fs:0, but the compiler knows what it's doing.
     // LLVM knows that in the Fuchsia ABI %fs:0 always stores the
     // %fs.base address, and its optimizer will see through this
-    // to integrate *(mxr_tp_get() + N) as a direct "mov %fs:N, ...".
+    // to integrate *(zxr_tp_get() + N) as a direct "mov %fs:N, ...".
     // Note that these special pointer types can be used to access
     // memory, but they cannot be cast to a normal pointer type
     // (which in the abstract should add in the base address,
@@ -62,10 +62,10 @@
 # endif
 }
 
-__NO_SAFESTACK static inline void mxr_tp_set(mx_handle_t self, void* tp) {
-    mx_status_t status = _mx_object_set_property(
-        self, MX_PROP_REGISTER_FS, (uintptr_t*)&tp, sizeof(uintptr_t));
-    if (status != MX_OK)
+__NO_SAFESTACK static inline void zxr_tp_set(zx_handle_t self, void* tp) {
+    zx_status_t status = _zx_object_set_property(
+        self, ZX_PROP_REGISTER_FS, (uintptr_t*)&tp, sizeof(uintptr_t));
+    if (status != ZX_OK)
         __builtin_trap();
 }
 
diff --git a/system/ulib/runtime/message.c b/system/ulib/runtime/message.c
index 6609c3c..39c0dfe 100644
--- a/system/ulib/runtime/message.c
+++ b/system/ulib/runtime/message.c
@@ -4,14 +4,14 @@
 
 #include <runtime/message.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <stddef.h>
 
-mx_status_t mxr_message_size(mx_handle_t msg_pipe,
+zx_status_t zxr_message_size(zx_handle_t msg_pipe,
                              uint32_t* nbytes, uint32_t* nhandles) {
-    mx_status_t status = _mx_channel_read(
+    zx_status_t status = _zx_channel_read(
         msg_pipe, 0, NULL, NULL, 0, 0, nbytes, nhandles);
-    if (status == MX_ERR_BUFFER_TOO_SMALL)
-        status = MX_OK;
+    if (status == ZX_ERR_BUFFER_TOO_SMALL)
+        status = ZX_OK;
     return status;
 }
diff --git a/system/ulib/runtime/mutex.c b/system/ulib/runtime/mutex.c
index f413fda..2edbf61 100644
--- a/system/ulib/runtime/mutex.c
+++ b/system/ulib/runtime/mutex.c
@@ -4,14 +4,14 @@
 
 #include <runtime/mutex.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <stdatomic.h>
 
 // This mutex implementation is based on Ulrich Drepper's paper "Futexes
 // Are Tricky" (dated November 5, 2011; see
 // http://www.akkadia.org/drepper/futex.pdf).  We use the approach from
 // "Mutex, Take 2", with one modification: We use an atomic swap in
-// mxr_mutex_unlock() rather than an atomic decrement.
+// zxr_mutex_unlock() rather than an atomic decrement.
 
 // The value of UNLOCKED must be 0 to match mutex.h and so that mutexes can
 // be allocated in BSS segments (zero-initialized data).
@@ -22,7 +22,7 @@
 };
 
 // On success, this will leave the mutex in the LOCKED_WITH_WAITERS state.
-static mx_status_t lock_slow_path(mxr_mutex_t* mutex, mx_time_t abstime,
+static zx_status_t lock_slow_path(zxr_mutex_t* mutex, zx_time_t abstime,
                                   int old_state) {
     for (;;) {
         // If the state shows there are already waiters, or we can update
@@ -31,11 +31,11 @@
             (old_state == LOCKED_WITHOUT_WAITERS &&
              atomic_compare_exchange_strong(&mutex->futex, &old_state,
                                             LOCKED_WITH_WAITERS))) {
-            // TODO(kulakowski) Use MX_CLOCK_UTC when available.
-            mx_status_t status = _mx_futex_wait(
+            // TODO(kulakowski) Use ZX_CLOCK_UTC when available.
+            zx_status_t status = _zx_futex_wait(
                     &mutex->futex, LOCKED_WITH_WAITERS, abstime);
-            if (status == MX_ERR_TIMED_OUT)
-                return MX_ERR_TIMED_OUT;
+            if (status == ZX_ERR_TIMED_OUT)
+                return ZX_ERR_TIMED_OUT;
         }
 
         // Try again to claim the mutex.  On this try, we must set the
@@ -45,49 +45,49 @@
         old_state = UNLOCKED;
         if (atomic_compare_exchange_strong(&mutex->futex, &old_state,
                                            LOCKED_WITH_WAITERS)) {
-            return MX_OK;
+            return ZX_OK;
         }
     }
 }
 
-mx_status_t mxr_mutex_trylock(mxr_mutex_t* mutex) {
+zx_status_t zxr_mutex_trylock(zxr_mutex_t* mutex) {
     int old_state = UNLOCKED;
     if (atomic_compare_exchange_strong(&mutex->futex, &old_state,
                                        LOCKED_WITHOUT_WAITERS)) {
-        return MX_OK;
+        return ZX_OK;
     }
-    return MX_ERR_BAD_STATE;
+    return ZX_ERR_BAD_STATE;
 }
 
-mx_status_t __mxr_mutex_timedlock(mxr_mutex_t* mutex, mx_time_t abstime) {
+zx_status_t __zxr_mutex_timedlock(zxr_mutex_t* mutex, zx_time_t abstime) {
     // Try to claim the mutex.  This compare-and-swap executes the full
     // memory barrier that locking a mutex is required to execute.
     int old_state = UNLOCKED;
     if (atomic_compare_exchange_strong(&mutex->futex, &old_state,
                                        LOCKED_WITHOUT_WAITERS)) {
-        return MX_OK;
+        return ZX_OK;
     }
     return lock_slow_path(mutex, abstime, old_state);
 }
 
-void mxr_mutex_lock(mxr_mutex_t* mutex) {
-    mx_status_t status = __mxr_mutex_timedlock(mutex, MX_TIME_INFINITE);
-    if (status != MX_OK)
+void zxr_mutex_lock(zxr_mutex_t* mutex) {
+    zx_status_t status = __zxr_mutex_timedlock(mutex, ZX_TIME_INFINITE);
+    if (status != ZX_OK)
         __builtin_trap();
 }
 
-void mxr_mutex_lock_with_waiter(mxr_mutex_t* mutex) {
+void zxr_mutex_lock_with_waiter(zxr_mutex_t* mutex) {
     int old_state = UNLOCKED;
     if (atomic_compare_exchange_strong(&mutex->futex, &old_state,
                                        LOCKED_WITH_WAITERS)) {
         return;
     }
-    mx_status_t status = lock_slow_path(mutex, MX_TIME_INFINITE, old_state);
-    if (status != MX_OK)
+    zx_status_t status = lock_slow_path(mutex, ZX_TIME_INFINITE, old_state);
+    if (status != ZX_OK)
         __builtin_trap();
 }
 
-void mxr_mutex_unlock(mxr_mutex_t* mutex) {
+void zxr_mutex_unlock(zxr_mutex_t* mutex) {
     // Attempt to release the mutex.  This atomic swap executes the full
     // memory barrier that unlocking a mutex is required to execute.
     int old_state = atomic_exchange(&mutex->futex, UNLOCKED);
@@ -97,8 +97,8 @@
             break;
 
         case LOCKED_WITH_WAITERS: {
-            mx_status_t status = _mx_futex_wake(&mutex->futex, 1);
-            if (status != MX_OK)
+            zx_status_t status = _zx_futex_wake(&mutex->futex, 1);
+            if (status != ZX_OK)
                 __builtin_trap();
             break;
         }
diff --git a/system/ulib/runtime/processargs.c b/system/ulib/runtime/processargs.c
index fb30603..17c505f 100644
--- a/system/ulib/runtime/processargs.c
+++ b/system/ulib/runtime/processargs.c
@@ -4,36 +4,36 @@
 
 #include <runtime/processargs.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <string.h>
 
 // TODO(mcgrathr): Is there a better error code to use for marshalling
 // protocol violations?
-#define MALFORMED MX_ERR_INVALID_ARGS
+#define MALFORMED ZX_ERR_INVALID_ARGS
 
-mx_status_t mxr_processargs_read(mx_handle_t bootstrap,
+zx_status_t zxr_processargs_read(zx_handle_t bootstrap,
                                  void* buffer, uint32_t nbytes,
-                                 mx_handle_t handles[], uint32_t nhandles,
-                                 mx_proc_args_t** pargs,
+                                 zx_handle_t handles[], uint32_t nhandles,
+                                 zx_proc_args_t** pargs,
                                  uint32_t** handle_info) {
-    if (nbytes < sizeof(mx_proc_args_t))
-        return MX_ERR_INVALID_ARGS;
-    if ((uintptr_t)buffer % alignof(mx_proc_args_t) != 0)
-        return MX_ERR_INVALID_ARGS;
+    if (nbytes < sizeof(zx_proc_args_t))
+        return ZX_ERR_INVALID_ARGS;
+    if ((uintptr_t)buffer % alignof(zx_proc_args_t) != 0)
+        return ZX_ERR_INVALID_ARGS;
 
     uint32_t got_bytes = 0;
     uint32_t got_handles = 0;
-    mx_status_t status = _mx_channel_read(bootstrap, 0, buffer, handles, nbytes,
+    zx_status_t status = _zx_channel_read(bootstrap, 0, buffer, handles, nbytes,
                                           nhandles, &got_bytes, &got_handles);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
     if (got_bytes != nbytes || got_handles != nhandles)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
-    mx_proc_args_t* const pa = buffer;
+    zx_proc_args_t* const pa = buffer;
 
-    if (pa->protocol != MX_PROCARGS_PROTOCOL ||
-        pa->version != MX_PROCARGS_VERSION)
+    if (pa->protocol != ZX_PROCARGS_PROTOCOL ||
+        pa->version != ZX_PROCARGS_VERSION)
         return MALFORMED;
 
     if (pa->handle_info_off < sizeof(*pa) ||
@@ -54,10 +54,10 @@
 
     *pargs = pa;
     *handle_info = (void*)&((uint8_t*)buffer)[pa->handle_info_off];
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t unpack_strings(char* buffer, uint32_t bytes, char* result[],
+static zx_status_t unpack_strings(char* buffer, uint32_t bytes, char* result[],
                                   uint32_t off, uint32_t num) {
     char* p = &buffer[off];
     for (uint32_t i = 0; i < num; ++i) {
@@ -68,21 +68,21 @@
         } while (*p++ != '\0');
     }
     result[num] = NULL;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mxr_processargs_strings(void* msg, uint32_t bytes,
+zx_status_t zxr_processargs_strings(void* msg, uint32_t bytes,
                                     char* argv[], char* envp[], char* names[]) {
-    mx_proc_args_t* const pa = msg;
-    mx_status_t status = MX_OK;
+    zx_proc_args_t* const pa = msg;
+    zx_status_t status = ZX_OK;
     if (argv != NULL) {
         status = unpack_strings(msg, bytes, argv, pa->args_off, pa->args_num);
     }
-    if (envp != NULL && status == MX_OK) {
+    if (envp != NULL && status == ZX_OK) {
         status = unpack_strings(msg, bytes, envp,
                                 pa->environ_off, pa->environ_num);
     }
-    if (names != NULL && status == MX_OK) {
+    if (names != NULL && status == ZX_OK) {
         status = unpack_strings(msg, bytes, names, pa->names_off, pa->names_num);
     }
     return status;
diff --git a/system/ulib/runtime/rules.mk b/system/ulib/runtime/rules.mk
index 18861d6..2d253d7 100644
--- a/system/ulib/runtime/rules.mk
+++ b/system/ulib/runtime/rules.mk
@@ -15,7 +15,7 @@
     $(LOCAL_DIR)/thread.c \
 
 MODULE_LIBS += \
-    system/ulib/magenta
+    system/ulib/zircon
 
 # for stdint.h
 MODULE_HEADER_DEPS += \
diff --git a/system/ulib/runtime/thread.c b/system/ulib/runtime/thread.c
index 1116460..fca6610 100644
--- a/system/ulib/runtime/thread.c
+++ b/system/ulib/runtime/thread.c
@@ -4,15 +4,15 @@
 
 #include <runtime/thread.h>
 
-#include <magenta/stack.h>
-#include <magenta/syscalls.h>
+#include <zircon/stack.h>
+#include <zircon/syscalls.h>
 #include <runtime/mutex.h>
 #include <stddef.h>
 #include <stdint.h>
 
-// An mxr_thread_t starts its life JOINABLE.
-// - If someone calls mxr_thread_join on it, it transitions to JOINED.
-// - If someone calls mxr_thread_detach on it, it transitions to DETACHED.
+// An zxr_thread_t starts its life JOINABLE.
+// - If someone calls zxr_thread_join on it, it transitions to JOINED.
+// - If someone calls zxr_thread_detach on it, it transitions to DETACHED.
 // - When it begins exiting, the EXITING state is entered.
 // - When it is no longer using its memory and handle resources, it transitions
 //   to DONE.  If the thread was DETACHED prior to EXITING, this transition MAY
@@ -27,20 +27,20 @@
     DONE,
 };
 
-mx_status_t mxr_thread_destroy(mxr_thread_t* thread) {
-    mx_handle_t handle = thread->handle;
-    thread->handle = MX_HANDLE_INVALID;
-    return handle == MX_HANDLE_INVALID ? MX_OK : _mx_handle_close(handle);
+zx_status_t zxr_thread_destroy(zxr_thread_t* thread) {
+    zx_handle_t handle = thread->handle;
+    thread->handle = ZX_HANDLE_INVALID;
+    return handle == ZX_HANDLE_INVALID ? ZX_OK : _zx_handle_close(handle);
 }
 
 // Put the thread into EXITING state.  Returns the previous state.
-static int begin_exit(mxr_thread_t* thread) {
+static int begin_exit(zxr_thread_t* thread) {
     return atomic_exchange_explicit(&thread->state, EXITING, memory_order_release);
 }
 
 // Claim the thread as JOINED or DETACHED.  Returns true on success, which only
 // happens if the previous state was JOINABLE.  Always returns the previous state.
-static bool claim_thread(mxr_thread_t* thread, int new_state, int* old_state) {
+static bool claim_thread(zxr_thread_t* thread, int new_state, int* old_state) {
     *old_state = JOINABLE;
     return atomic_compare_exchange_strong_explicit(
             &thread->state, old_state, new_state,
@@ -49,21 +49,21 @@
 
 // Extract the handle from the thread structure.  This must only be called by the thread
 // itself (i.e., this is not thread-safe).
-static mx_handle_t take_handle(mxr_thread_t* thread) {
-    mx_handle_t tmp = thread->handle;
-    thread->handle = MX_HANDLE_INVALID;
+static zx_handle_t take_handle(zxr_thread_t* thread) {
+    zx_handle_t tmp = thread->handle;
+    thread->handle = ZX_HANDLE_INVALID;
     return tmp;
 }
 
-static _Noreturn void exit_non_detached(mxr_thread_t* thread) {
-    // As soon as thread->state has changed to to DONE, a caller of mxr_thread_join
+static _Noreturn void exit_non_detached(zxr_thread_t* thread) {
+    // As soon as thread->state has changed to to DONE, a caller of zxr_thread_join
     // might complete and deallocate the memory containing the thread descriptor.
     // Hence it's no longer safe to touch *thread or read anything out of it.
     // Therefore we must extract the thread handle before that transition
     // happens.
-    mx_handle_t handle = take_handle(thread);
+    zx_handle_t handle = take_handle(thread);
 
-    // Wake the _mx_futex_wait in mxr_thread_join (below), and then die.
+    // Wake the _zx_futex_wait in zxr_thread_join (below), and then die.
     // This has to be done with the special four-in-one vDSO call because
     // as soon as the state transitions to DONE, the joiner is free to unmap
     // our stack out from under us.  Note there is a benign race here still: if
@@ -71,12 +71,12 @@
     // is reused for something else and our futex_wake tickles somebody
     // completely unrelated, well, that's why futex_wait can always have
     // spurious wakeups.
-    _mx_futex_wake_handle_close_thread_exit(&thread->state, 1, DONE, handle);
+    _zx_futex_wake_handle_close_thread_exit(&thread->state, 1, DONE, handle);
     __builtin_trap();
 }
 
 static _Noreturn void thread_trampoline(uintptr_t ctx) {
-    mxr_thread_t* thread = (mxr_thread_t*)ctx;
+    zxr_thread_t* thread = (zxr_thread_t*)ctx;
 
     thread->entry(thread->arg);
 
@@ -97,14 +97,14 @@
     __builtin_trap();
 }
 
-_Noreturn void mxr_thread_exit_unmap_if_detached(
-    mxr_thread_t* thread, mx_handle_t vmar, uintptr_t addr, size_t len) {
+_Noreturn void zxr_thread_exit_unmap_if_detached(
+    zxr_thread_t* thread, zx_handle_t vmar, uintptr_t addr, size_t len) {
 
     int old_state = begin_exit(thread);
     switch (old_state) {
     case DETACHED: {
-        mx_handle_t handle = take_handle(thread);
-        _mx_vmar_unmap_handle_close_thread_exit(vmar, addr, len, handle);
+        zx_handle_t handle = take_handle(thread);
+        _zx_vmar_unmap_handle_close_thread_exit(vmar, addr, len, handle);
         break;
     }
     // See comments in thread_trampoline.
@@ -126,22 +126,22 @@
     return len;
 }
 
-static void initialize_thread(mxr_thread_t* thread,
-                              mx_handle_t handle, bool detached) {
-    *thread = (mxr_thread_t){ .handle = handle, };
+static void initialize_thread(zxr_thread_t* thread,
+                              zx_handle_t handle, bool detached) {
+    *thread = (zxr_thread_t){ .handle = handle, };
     atomic_init(&thread->state, detached ? DETACHED : JOINABLE);
 }
 
-mx_status_t mxr_thread_create(mx_handle_t process, const char* name,
-                              bool detached, mxr_thread_t* thread) {
-    initialize_thread(thread, MX_HANDLE_INVALID, detached);
+zx_status_t zxr_thread_create(zx_handle_t process, const char* name,
+                              bool detached, zxr_thread_t* thread) {
+    initialize_thread(thread, ZX_HANDLE_INVALID, detached);
     if (name == NULL)
         name = "";
     size_t name_length = local_strlen(name) + 1;
-    return _mx_thread_create(process, name, name_length, 0, &thread->handle);
+    return _zx_thread_create(process, name, name_length, 0, &thread->handle);
 }
 
-mx_status_t mxr_thread_start(mxr_thread_t* thread, uintptr_t stack_addr, size_t stack_size, mxr_thread_entry_t entry, void* arg) {
+zx_status_t zxr_thread_start(zxr_thread_t* thread, uintptr_t stack_addr, size_t stack_size, zxr_thread_entry_t entry, void* arg) {
     thread->entry = entry;
     thread->arg = arg;
 
@@ -149,20 +149,20 @@
     uintptr_t sp = compute_initial_stack_pointer(stack_addr, stack_size);
 
     // kick off the new thread
-    mx_status_t status = _mx_thread_start(thread->handle,
+    zx_status_t status = _zx_thread_start(thread->handle,
                                           (uintptr_t)thread_trampoline, sp,
                                           (uintptr_t)thread, 0);
 
-    if (status != MX_OK)
-        mxr_thread_destroy(thread);
+    if (status != ZX_OK)
+        zxr_thread_destroy(thread);
     return status;
 }
 
-static void wait_for_done(mxr_thread_t* thread, int old_state) {
+static void wait_for_done(zxr_thread_t* thread, int old_state) {
     do {
-        switch (_mx_futex_wait(&thread->state, old_state, MX_TIME_INFINITE)) {
-            case MX_ERR_BAD_STATE:   // Never blocked because it had changed.
-            case MX_OK:              // Woke up because it might have changed.
+        switch (_zx_futex_wait(&thread->state, old_state, ZX_TIME_INFINITE)) {
+            case ZX_ERR_BAD_STATE:   // Never blocked because it had changed.
+            case ZX_OK:              // Woke up because it might have changed.
                 old_state = atomic_load_explicit(&thread->state,
                                                  memory_order_acquire);
                 break;
@@ -177,7 +177,7 @@
         __builtin_trap();
 }
 
-mx_status_t mxr_thread_join(mxr_thread_t* thread) {
+zx_status_t zxr_thread_join(zxr_thread_t* thread) {
     int old_state;
     // Try to claim the join slot on this thread.
     if (claim_thread(thread, JOINED, &old_state)) {
@@ -186,9 +186,9 @@
         switch (old_state) {
             case JOINED:
             case DETACHED:
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             case EXITING:
-                // Since it is undefined to call mxr_thread_join on a thread
+                // Since it is undefined to call zxr_thread_join on a thread
                 // that has already been detached or joined, we assume the state
                 // prior to EXITING was JOINABLE, and act as if we had
                 // successfully transitioned to JOINED.
@@ -202,31 +202,31 @@
     }
 
     // The thread has already closed its own handle.
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t mxr_thread_detach(mxr_thread_t* thread) {
+zx_status_t zxr_thread_detach(zxr_thread_t* thread) {
     int old_state;
     // Try to claim the join slot on this thread on behalf of the thread.
     if (!claim_thread(thread, DETACHED, &old_state)) {
         switch (old_state) {
             case DETACHED:
             case JOINED:
-                return MX_ERR_INVALID_ARGS;
+                return ZX_ERR_INVALID_ARGS;
             case EXITING: {
-                // Since it is undefined behavior to call mxr_thread_detach on a
+                // Since it is undefined behavior to call zxr_thread_detach on a
                 // thread that has already been detached or joined, we assume
                 // the state prior to EXITING was JOINABLE.  However, since the
                 // thread is already shutting down, it is too late to tell it to
                 // clean itself up.  Since the thread is still running, we cannot
-                // just return MX_ERR_BAD_STATE, which would suggest we couldn't detach and
+                // just return ZX_ERR_BAD_STATE, which would suggest we couldn't detach and
                 // the thread has already finished running.  Instead, we call join,
                 // which will return soon due to the thread being actively shutting down,
-                // and then return MX_ERR_BAD_STATE to tell the caller that they
+                // and then return ZX_ERR_BAD_STATE to tell the caller that they
                 // must manually perform any post-join work.
-                mx_status_t ret = mxr_thread_join(thread);
-                if (unlikely(ret != MX_OK)) {
-                    if (unlikely(ret != MX_ERR_INVALID_ARGS)) {
+                zx_status_t ret = zxr_thread_join(thread);
+                if (unlikely(ret != ZX_OK)) {
+                    if (unlikely(ret != ZX_ERR_INVALID_ARGS)) {
                         __builtin_trap();
                     }
                     return ret;
@@ -234,25 +234,25 @@
                 // Fall-through to DONE case.
             }
             case DONE:
-                return MX_ERR_BAD_STATE;
+                return ZX_ERR_BAD_STATE;
             default:
                 __builtin_trap();
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-bool mxr_thread_detached(mxr_thread_t* thread) {
+bool zxr_thread_detached(zxr_thread_t* thread) {
     int state = atomic_load_explicit(&thread->state, memory_order_acquire);
     return state == DETACHED;
 }
 
-mx_handle_t mxr_thread_get_handle(mxr_thread_t* thread) {
+zx_handle_t zxr_thread_get_handle(zxr_thread_t* thread) {
     return thread->handle;
 }
 
-mx_status_t mxr_thread_adopt(mx_handle_t handle, mxr_thread_t* thread) {
+zx_status_t zxr_thread_adopt(zx_handle_t handle, zxr_thread_t* thread) {
     initialize_thread(thread, handle, false);
-    return handle == MX_HANDLE_INVALID ? MX_ERR_BAD_HANDLE : MX_OK;
+    return handle == ZX_HANDLE_INVALID ? ZX_ERR_BAD_HANDLE : ZX_OK;
 }
diff --git a/system/ulib/svcfs/BUILD.gn b/system/ulib/svcfs/BUILD.gn
index 9e988c0..2f92239 100644
--- a/system/ulib/svcfs/BUILD.gn
+++ b/system/ulib/svcfs/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 static_library("svcfs") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "include/svcfs/svcfs.h",
     "svcfs.cpp",
@@ -16,8 +16,8 @@
   public_configs = [ ":svcfs_config" ]
 
   public_deps = [
-    "//magenta/system/ulib/fs",
-    "//magenta/system/ulib/mx",
-    "//magenta/system/ulib/fbl",
+    "//zircon/system/ulib/fs",
+    "//zircon/system/ulib/zx",
+    "//zircon/system/ulib/fbl",
   ]
 }
diff --git a/system/ulib/svcfs/include/svcfs/svcfs.h b/system/ulib/svcfs/include/svcfs/svcfs.h
index c16d4db..9ab0a41 100644
--- a/system/ulib/svcfs/include/svcfs/svcfs.h
+++ b/system/ulib/svcfs/include/svcfs/svcfs.h
@@ -7,8 +7,8 @@
 #include <fs/dispatcher.h>
 #include <fs/vfs.h>
 #include <fs/watcher.h>
-#include <magenta/types.h>
-#include <mx/channel.h>
+#include <zircon/types.h>
+#include <zx/channel.h>
 #include <fbl/array.h>
 #include <fbl/intrusive_double_list.h>
 #include <fbl/ref_ptr.h>
@@ -17,7 +17,7 @@
 
 class ServiceProvider {
 public:
-    virtual void Connect(const char* name, size_t len, mx::channel channel) = 0;
+    virtual void Connect(const char* name, size_t len, zx::channel channel) = 0;
 
 protected:
     virtual ~ServiceProvider();
@@ -41,8 +41,8 @@
              ServiceProvider* provider);
     ~VnodeSvc() override;
 
-    mx_status_t Open(uint32_t flags) final;
-    mx_status_t Serve(fs::Vfs* vfs, mx::channel channel, uint32_t flags) final;
+    zx_status_t Open(uint32_t flags) final;
+    zx_status_t Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) final;
 
     uint64_t node_id() const { return node_id_; }
     const fbl::Array<char>& name() const { return name_; }
@@ -67,15 +67,15 @@
     explicit VnodeDir();
     ~VnodeDir() override;
 
-    mx_status_t Open(uint32_t flags) final;
-    mx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
-    mx_status_t Getattr(vnattr_t* a) final;
+    zx_status_t Open(uint32_t flags) final;
+    zx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
+    zx_status_t Getattr(vnattr_t* a) final;
 
     void Notify(const char* name, size_t len, unsigned event) final;
-    mx_status_t WatchDir(mx::channel* out) final;
-    mx_status_t WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) final;
+    zx_status_t WatchDir(zx::channel* out) final;
+    zx_status_t WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) final;
 
-    mx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
+    zx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
 
     bool AddService(const char* name, size_t len, ServiceProvider* provider);
     bool RemoveService(const char* name, size_t len);
@@ -97,9 +97,9 @@
     explicit VnodeProviderDir();
     ~VnodeProviderDir() override;
 
-    mx_status_t Open(uint32_t flags) final;
-    mx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
-    mx_status_t Getattr(vnattr_t* a) final;
+    zx_status_t Open(uint32_t flags) final;
+    zx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
+    zx_status_t Getattr(vnattr_t* a) final;
 
     // Set the service provider to null to prevent further requests.
     void SetServiceProvider(ServiceProvider* provider);
diff --git a/system/ulib/svcfs/rules.mk b/system/ulib/svcfs/rules.mk
index 40210b6..e9bee1c 100644
--- a/system/ulib/svcfs/rules.mk
+++ b/system/ulib/svcfs/rules.mk
@@ -12,13 +12,13 @@
     $(LOCAL_DIR)/svcfs.cpp \
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/fs \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/ulib/svcfs/svcfs.cpp b/system/ulib/svcfs/svcfs.cpp
index 15385d2..78e8699 100644
--- a/system/ulib/svcfs/svcfs.cpp
+++ b/system/ulib/svcfs/svcfs.cpp
@@ -54,16 +54,16 @@
 
 VnodeSvc::~VnodeSvc() = default;
 
-mx_status_t VnodeSvc::Open(uint32_t flags) {
+zx_status_t VnodeSvc::Open(uint32_t flags) {
     if (flags & O_DIRECTORY) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeSvc::Serve(fs::Vfs* vfs, mx::channel channel, uint32_t flags) {
+zx_status_t VnodeSvc::Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) {
     if (!provider_) {
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     }
 
     provider_->Connect(name_.get(), name_.size(), fbl::move(channel));
@@ -74,7 +74,7 @@
     if (!node_id_)
         provider_ = nullptr;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool VnodeSvc::NameMatch(const char* name, size_t len) const {
@@ -92,42 +92,42 @@
 
 VnodeDir::~VnodeDir() = default;
 
-mx_status_t VnodeDir::Open(uint32_t flags) {
-    return MX_OK;
+zx_status_t VnodeDir::Open(uint32_t flags) {
+    return ZX_OK;
 }
 
-mx_status_t VnodeDir::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
+zx_status_t VnodeDir::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
     fbl::RefPtr<VnodeSvc> vn = nullptr;
     for (auto& child : services_) {
         if (child.NameMatch(name, len)) {
             *out = fbl::RefPtr<VnodeSvc>(&child);
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
 
-mx_status_t VnodeDir::Getattr(vnattr_t* attr) {
+zx_status_t VnodeDir::Getattr(vnattr_t* attr) {
     memset(attr, 0, sizeof(vnattr_t));
     attr->mode = V_TYPE_DIR | V_IRUSR;
     attr->nlink = 1;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void VnodeDir::Notify(const char* name, size_t len, unsigned event) { watcher_.Notify(name, len, event); }
-mx_status_t VnodeDir::WatchDir(mx::channel* out) { return watcher_.WatchDir(out); }
-mx_status_t VnodeDir::WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) {
+zx_status_t VnodeDir::WatchDir(zx::channel* out) { return watcher_.WatchDir(out); }
+zx_status_t VnodeDir::WatchDirV2(fs::Vfs* vfs, const vfs_watch_dir_t* cmd) {
     return watcher_.WatchDirV2(vfs, this, cmd);
 }
 
-mx_status_t VnodeDir::Readdir(void* cookie, void* data, size_t len) {
+zx_status_t VnodeDir::Readdir(void* cookie, void* data, size_t len) {
     dircookie_t* c = static_cast<dircookie_t*>(cookie);
     fs::DirentFiller df(data, len);
 
-    mx_status_t r = 0;
+    zx_status_t r = 0;
     if (c->last_id < 1) {
-        if ((r = df.Next(".", 1, VTYPE_TO_DTYPE(V_TYPE_DIR))) != MX_OK) {
+        if ((r = df.Next(".", 1, VTYPE_TO_DTYPE(V_TYPE_DIR))) != ZX_OK) {
             return df.BytesFilled();
         }
         c->last_id = 1;
@@ -138,7 +138,7 @@
             continue;
         }
         if ((r = df.Next(vn.name().get(), vn.name().size(),
-                         VTYPE_TO_DTYPE(V_TYPE_FILE))) != MX_OK) {
+                         VTYPE_TO_DTYPE(V_TYPE_FILE))) != ZX_OK) {
             return df.BytesFilled();
         }
         c->last_id = vn.node_id();
@@ -188,27 +188,27 @@
 
 VnodeProviderDir::~VnodeProviderDir() = default;
 
-mx_status_t VnodeProviderDir::Open(uint32_t flags) {
-    return MX_OK;
+zx_status_t VnodeProviderDir::Open(uint32_t flags) {
+    return ZX_OK;
 }
 
-mx_status_t VnodeProviderDir::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
+zx_status_t VnodeProviderDir::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
     if (!IsValidServiceName(name, len)) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
     fbl::Array<char> array;
     CopyToArray(name, len, &array);
 
     *out = fbl::AdoptRef(new VnodeSvc(0, fbl::move(array), provider_));
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeProviderDir::Getattr(vnattr_t* attr) {
+zx_status_t VnodeProviderDir::Getattr(vnattr_t* attr) {
     memset(attr, 0, sizeof(vnattr_t));
     attr->mode = V_TYPE_DIR | V_IRUSR;
     attr->nlink = 1;
-    return MX_OK;
+    return ZX_OK;
 }
 
 void VnodeProviderDir::SetServiceProvider(ServiceProvider* provider) {
diff --git a/system/ulib/sync/completion.c b/system/ulib/sync/completion.c
index 7f9f905..2e767db 100644
--- a/system/ulib/sync/completion.c
+++ b/system/ulib/sync/completion.c
@@ -5,7 +5,7 @@
 #include <sync/completion.h>
 
 #include <limits.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <stdatomic.h>
 
 enum {
@@ -13,7 +13,7 @@
     SIGNALED = 1,
 };
 
-mx_status_t completion_wait(completion_t* completion, mx_time_t timeout) {
+zx_status_t completion_wait(completion_t* completion, zx_time_t timeout) {
     // TODO(kulakowski): With a little more state (a waiters count),
     // this could optimistically spin before entering the kernel.
 
@@ -22,20 +22,20 @@
     for (;;) {
         int current_value = atomic_load(futex);
         if (current_value == SIGNALED) {
-            return MX_OK;
+            return ZX_OK;
         }
-        mx_time_t deadline = (timeout == MX_TIME_INFINITE) ? timeout : mx_deadline_after(timeout);
-        switch (mx_futex_wait(futex, current_value, deadline)) {
-        case MX_OK:
+        zx_time_t deadline = (timeout == ZX_TIME_INFINITE) ? timeout : zx_deadline_after(timeout);
+        switch (zx_futex_wait(futex, current_value, deadline)) {
+        case ZX_OK:
             continue;
-        case MX_ERR_BAD_STATE:
-            // If we get MX_ERR_BAD_STATE, the value of the futex changed between
+        case ZX_ERR_BAD_STATE:
+            // If we get ZX_ERR_BAD_STATE, the value of the futex changed between
             // our load and the wait. This could only have happened if we
             // were signaled.
-            return MX_OK;
-        case MX_ERR_TIMED_OUT:
-            return MX_ERR_TIMED_OUT;
-        case MX_ERR_INVALID_ARGS:
+            return ZX_OK;
+        case ZX_ERR_TIMED_OUT:
+            return ZX_ERR_TIMED_OUT;
+        case ZX_ERR_INVALID_ARGS:
         default:
             __builtin_trap();
         }
@@ -45,7 +45,7 @@
 void completion_signal(completion_t* completion) {
     atomic_int* futex = &completion->futex;
     atomic_store(futex, SIGNALED);
-    mx_futex_wake(futex, UINT32_MAX);
+    zx_futex_wake(futex, UINT32_MAX);
 }
 
 void completion_reset(completion_t* completion) {
diff --git a/system/ulib/sync/include/sync/completion.h b/system/ulib/sync/include/sync/completion.h
index a735cf9..c4c2421 100644
--- a/system/ulib/sync/include/sync/completion.h
+++ b/system/ulib/sync/include/sync/completion.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/types.h>
-#include <magenta/compiler.h>
+#include <zircon/types.h>
+#include <zircon/compiler.h>
 
 #include <stdatomic.h>
 
@@ -17,10 +17,10 @@
 
 #define COMPLETION_INIT ((completion_t){0})
 
-// Returns MX_ERR_TIMED_OUT if timeout elapses, and MX_OK if woken by
+// Returns ZX_ERR_TIMED_OUT if timeout elapses, and ZX_OK if woken by
 // a call to completion_wake or if the completion has already been
 // signaled.
-mx_status_t completion_wait(completion_t* completion, mx_time_t timeout);
+zx_status_t completion_wait(completion_t* completion, zx_time_t timeout);
 
 // Awakens all waiters on the completion, and marks the it as
 // signaled. Waits after this call but before a reset of the
diff --git a/system/ulib/sync/rules.mk b/system/ulib/sync/rules.mk
index 585beae..61a2af5 100644
--- a/system/ulib/sync/rules.mk
+++ b/system/ulib/sync/rules.mk
@@ -12,7 +12,7 @@
     $(LOCAL_DIR)/completion.c \
 
 MODULE_LIBS := \
-    system/ulib/magenta \
+    system/ulib/zircon \
 
 MODULE_EXPORT := a
 
diff --git a/system/ulib/task-utils/get.c b/system/ulib/task-utils/get.c
index 73ce873..51b3c3a 100644
--- a/system/ulib/task-utils/get.c
+++ b/system/ulib/task-utils/get.c
@@ -4,65 +4,65 @@
 
 #include <task-utils/get.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <task-utils/walker.h>
 
 typedef struct {
-    mx_koid_t desired_koid;
-    mx_handle_t found_handle;
-    mx_obj_type_t found_type;
+    zx_koid_t desired_koid;
+    zx_handle_t found_handle;
+    zx_obj_type_t found_type;
 } get_task_ctx_t;
 
-static mx_status_t common_callback(mx_obj_type_t type, get_task_ctx_t* ctx,
-                                   mx_handle_t handle, mx_koid_t koid) {
+static zx_status_t common_callback(zx_obj_type_t type, get_task_ctx_t* ctx,
+                                   zx_handle_t handle, zx_koid_t koid) {
     if (koid == ctx->desired_koid) {
-        mx_handle_t dup;
-        mx_status_t s = mx_handle_duplicate(handle, MX_RIGHT_SAME_RIGHTS, &dup);
-        if (s != MX_OK) {
+        zx_handle_t dup;
+        zx_status_t s = zx_handle_duplicate(handle, ZX_RIGHT_SAME_RIGHTS, &dup);
+        if (s != ZX_OK) {
             return s;
         }
         ctx->found_handle = dup;
         ctx->found_type = type;
-        return MX_ERR_STOP;
+        return ZX_ERR_STOP;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t job_callback(void* ctx, int depth, mx_handle_t handle,
-                                mx_koid_t koid, mx_koid_t parent_koid) {
-    return common_callback(MX_OBJ_TYPE_JOB, ctx, handle, koid);
+static zx_status_t job_callback(void* ctx, int depth, zx_handle_t handle,
+                                zx_koid_t koid, zx_koid_t parent_koid) {
+    return common_callback(ZX_OBJ_TYPE_JOB, ctx, handle, koid);
 }
 
-static mx_status_t process_callback(void* ctx, int depth, mx_handle_t handle,
-                                    mx_koid_t koid, mx_koid_t parent_koid) {
-    return common_callback(MX_OBJ_TYPE_PROCESS, ctx, handle, koid);
+static zx_status_t process_callback(void* ctx, int depth, zx_handle_t handle,
+                                    zx_koid_t koid, zx_koid_t parent_koid) {
+    return common_callback(ZX_OBJ_TYPE_PROCESS, ctx, handle, koid);
 }
 
-static mx_status_t thread_callback(void* ctx, int depth, mx_handle_t handle,
-                                   mx_koid_t koid, mx_koid_t parent_koid) {
-    return common_callback(MX_OBJ_TYPE_THREAD, ctx, handle, koid);
+static zx_status_t thread_callback(void* ctx, int depth, zx_handle_t handle,
+                                   zx_koid_t koid, zx_koid_t parent_koid) {
+    return common_callback(ZX_OBJ_TYPE_THREAD, ctx, handle, koid);
 }
 
-mx_status_t get_task_by_koid(mx_koid_t koid,
-                             mx_obj_type_t* type, mx_handle_t* out) {
+zx_status_t get_task_by_koid(zx_koid_t koid,
+                             zx_obj_type_t* type, zx_handle_t* out) {
     if (type == NULL || out == NULL) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
     get_task_ctx_t ctx = {
         .desired_koid = koid,
-        .found_handle = MX_HANDLE_INVALID,
-        .found_type = MX_OBJ_TYPE_NONE,
+        .found_handle = ZX_HANDLE_INVALID,
+        .found_type = ZX_OBJ_TYPE_NONE,
     };
-    mx_status_t s = walk_root_job_tree(
+    zx_status_t s = walk_root_job_tree(
         job_callback, process_callback, thread_callback, &ctx);
-    if (s == MX_ERR_STOP) {
+    if (s == ZX_ERR_STOP) {
         *type = ctx.found_type;
         *out = ctx.found_handle;
-        return MX_OK;
+        return ZX_OK;
     }
-    if (s == MX_OK) {
-        // The callback would have returned MX_ERR_STOP if it found anything.
-        return MX_ERR_NOT_FOUND;
+    if (s == ZX_OK) {
+        // The callback would have returned ZX_ERR_STOP if it found anything.
+        return ZX_ERR_NOT_FOUND;
     }
     return s;
 }
diff --git a/system/ulib/task-utils/include/task-utils/get.h b/system/ulib/task-utils/include/task-utils/get.h
index 68ec7f1..ecfca26 100644
--- a/system/ulib/task-utils/include/task-utils/get.h
+++ b/system/ulib/task-utils/include/task-utils/get.h
@@ -4,24 +4,24 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
 // Tries to get a handle to the task with the specified koid.
 // Return values:
-//   MX_OK: The task was found: |*out| is a handle to it, and |*type| indicates
+//   ZX_OK: The task was found: |*out| is a handle to it, and |*type| indicates
 //       whether it's a job, process, or thread
-//       (MX_OBJ_TYPE_JOB/PROCESS/THREAD). The caller is responsible for closing
+//       (ZX_OBJ_TYPE_JOB/PROCESS/THREAD). The caller is responsible for closing
 //       the handle.
-//   MX_ERR_NOT_FOUND: Could not find a task with the specified koid.
-//   MX_ERR_INVALID_ARGS: |type| or |out| is NULL.
+//   ZX_ERR_NOT_FOUND: Could not find a task with the specified koid.
+//   ZX_ERR_INVALID_ARGS: |type| or |out| is NULL.
 // Will fail if the calling process does not have the rights to access the root
 // job.
-mx_status_t get_task_by_koid(
-    mx_koid_t koid, mx_obj_type_t* type, mx_handle_t* out);
+zx_status_t get_task_by_koid(
+    zx_koid_t koid, zx_obj_type_t* type, zx_handle_t* out);
 // TODO(dbort): Add a "desired type" so we don't walk every thread in the
 // system just to find a job.
 
diff --git a/system/ulib/task-utils/include/task-utils/walker.h b/system/ulib/task-utils/include/task-utils/walker.h
index cd4ebbd..42e7881 100644
--- a/system/ulib/task-utils/include/task-utils/walker.h
+++ b/system/ulib/task-utils/include/task-utils/walker.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
@@ -23,17 +23,17 @@
 //     thread, the job that contains the process, or the job that contains the
 //     job).
 //
-// If the callback returns a value other than MX_OK, the job tree walk will
-// terminate without visiting any other node, and the mx_status_t value will be
+// If the callback returns a value other than ZX_OK, the job tree walk will
+// terminate without visiting any other node, and the zx_status_t value will be
 // returned by walk_job_tree().
-typedef mx_status_t(task_callback_t)(
+typedef zx_status_t(task_callback_t)(
     void* context, int depth,
-    mx_handle_t task, mx_koid_t koid, mx_koid_t parent_koid);
+    zx_handle_t task, zx_koid_t koid, zx_koid_t parent_koid);
 
 // Walks the job/process/task tree rooted in root_job. Visits tasks in
 // depth-first pre order. Any callback arg may be NULL.
 // |context| is passed to all callbacks.
-mx_status_t walk_job_tree(mx_handle_t root_job,
+zx_status_t walk_job_tree(zx_handle_t root_job,
                           task_callback_t job_callback,
                           task_callback_t process_callback,
                           task_callback_t thread_callback,
@@ -43,7 +43,7 @@
 // process does not have the rights to access the root job.
 // TODO(dbort): Add a different lib/API to get the system root job and remove
 // this function.
-mx_status_t walk_root_job_tree(task_callback_t job_callback,
+zx_status_t walk_root_job_tree(task_callback_t job_callback,
                                task_callback_t process_callback,
                                task_callback_t thread_callback,
                                void* context);
@@ -56,30 +56,30 @@
 class TaskEnumerator {
 public:
     // Each of these methods visits the corresponding task type. If any On*()
-    // method returns a value other than MX_OK, the enumeration stops. See
+    // method returns a value other than ZX_OK, the enumeration stops. See
     // |task_callback_t| for a description of parameters.
-    virtual mx_status_t OnJob(
-        int depth, mx_handle_t job, mx_koid_t koid, mx_koid_t parent_koid) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t OnJob(
+        int depth, zx_handle_t job, zx_koid_t koid, zx_koid_t parent_koid) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
-    virtual mx_status_t OnProcess(
-        int depth, mx_handle_t process, mx_koid_t koid, mx_koid_t parent_koid) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t OnProcess(
+        int depth, zx_handle_t process, zx_koid_t koid, zx_koid_t parent_koid) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
-    virtual mx_status_t OnThread(
-        int depth, mx_handle_t process, mx_koid_t koid, mx_koid_t parent_koid) {
-        return MX_ERR_NOT_SUPPORTED;
+    virtual zx_status_t OnThread(
+        int depth, zx_handle_t process, zx_koid_t koid, zx_koid_t parent_koid) {
+        return ZX_ERR_NOT_SUPPORTED;
     }
 
     // Walks the job/process/task tree rooted in root_job. Visits tasks in
     // depth-first pre order.
-    mx_status_t WalkJobTree(mx_handle_t root_job);
+    zx_status_t WalkJobTree(zx_handle_t root_job);
 
     // Calls WalkJobTree() on the system's root job. Will fail if the calling
     // process does not have the rights to access the root job.
     // TODO(dbort): Add a different lib/API to get the system root job and
     // remove this function.
-    mx_status_t WalkRootJobTree();
+    zx_status_t WalkRootJobTree();
 
 protected:
     TaskEnumerator() = default;
diff --git a/system/ulib/task-utils/rules.mk b/system/ulib/task-utils/rules.mk
index 7f15624..7282437 100644
--- a/system/ulib/task-utils/rules.mk
+++ b/system/ulib/task-utils/rules.mk
@@ -13,8 +13,8 @@
     $(LOCAL_DIR)/walker.cpp
 
 MODULE_LIBS := \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/ulib/task-utils/walker.cpp b/system/ulib/task-utils/walker.cpp
index 456209d..33ed08e 100644
--- a/system/ulib/task-utils/walker.cpp
+++ b/system/ulib/task-utils/walker.cpp
@@ -11,9 +11,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include <magenta/device/sysinfo.h>
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/sysinfo.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
 
 // Immutable state of a specific call to walk_job_tree, passed along
 // to most helper functions.
@@ -27,7 +27,7 @@
 // A dynamically-managed array of koids.
 // TODO(dbort): Turn into a class now that this is a .cpp file.
 typedef struct {
-    mx_koid_t* entries;
+    zx_koid_t* entries;
     size_t num_entries;
     size_t capacity; // allocation size
 } koid_table_t;
@@ -39,15 +39,15 @@
 // on top of what the kernel says is currently needed
 static const size_t kNumExtraKoids = 10;
 
-static mx_status_t walk_job_tree_internal(
-    const walk_ctx_t* ctx, mx_handle_t job, mx_koid_t job_koid, int depth);
+static zx_status_t walk_job_tree_internal(
+    const walk_ctx_t* ctx, zx_handle_t job, zx_koid_t job_koid, int depth);
 
 static size_t koid_table_byte_capacity(koid_table_t* table) {
     return table->capacity * sizeof(table->entries[0]);
 }
 
 static void realloc_koid_table(koid_table_t* table, size_t new_capacity) {
-    table->entries = reinterpret_cast<mx_koid_t*>(
+    table->entries = reinterpret_cast<zx_koid_t*>(
         realloc(table->entries, new_capacity * sizeof(table->entries[0])));
     table->capacity = new_capacity;
 }
@@ -66,13 +66,13 @@
     free(table);
 }
 
-static mx_status_t fetch_children(mx_handle_t parent, mx_koid_t parent_koid,
+static zx_status_t fetch_children(zx_handle_t parent, zx_koid_t parent_koid,
                                   int children_kind, const char* kind_name,
                                   koid_table_t* koids) {
 
     size_t actual = 0;
     size_t avail = 0;
-    mx_status_t status;
+    zx_status_t status;
 
     // this is inherently racy, but we retry once with a bit of slop to try to
     // get a complete list
@@ -80,16 +80,16 @@
         if (actual < avail) {
             realloc_koid_table(koids, avail + kNumExtraKoids);
         }
-        status = mx_object_get_info(parent, children_kind,
+        status = zx_object_get_info(parent, children_kind,
                                     koids->entries,
                                     koid_table_byte_capacity(koids),
                                     &actual, &avail);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             fprintf(stderr,
-                    "ERROR: mx_object_get_info(%" PRIu64 ", %s, ...) "
+                    "ERROR: zx_object_get_info(%" PRIu64 ", %s, ...) "
                     "failed: %s (%d)\n",
                     parent_koid, kind_name,
-                    mx_status_get_string(status), status);
+                    zx_status_get_string(status), status);
             return status;
         }
         if (actual == avail) {
@@ -100,91 +100,91 @@
     // if we're still too small at least warn the user
     if (actual < avail) {
         fprintf(stderr,
-                "WARNING: mx_object_get_info(%" PRIu64 ", %s, ...) "
+                "WARNING: zx_object_get_info(%" PRIu64 ", %s, ...) "
                 "truncated %zu/%zu results\n",
                 parent_koid, kind_name, avail - actual, avail);
     }
 
     koids->num_entries = actual;
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t do_threads_worker(
+static zx_status_t do_threads_worker(
     const walk_ctx_t* ctx, koid_table_t* koids,
-    mx_handle_t process, mx_koid_t process_koid, int depth) {
+    zx_handle_t process, zx_koid_t process_koid, int depth) {
 
-    mx_status_t status;
+    zx_status_t status;
 
     // get the list of processes under this job
-    status = fetch_children(process, process_koid, MX_INFO_PROCESS_THREADS,
-                            "MX_INFO_PROCESS_THREADS", koids);
-    if (status != MX_OK) {
+    status = fetch_children(process, process_koid, ZX_INFO_PROCESS_THREADS,
+                            "ZX_INFO_PROCESS_THREADS", koids);
+    if (status != ZX_OK) {
         return status;
     }
 
     for (size_t n = 0; n < koids->num_entries; n++) {
-        mx_handle_t child;
-        status = mx_object_get_child(process, koids->entries[n],
-                                     MX_RIGHT_SAME_RIGHTS, &child);
-        if (status == MX_OK) {
+        zx_handle_t child;
+        status = zx_object_get_child(process, koids->entries[n],
+                                     ZX_RIGHT_SAME_RIGHTS, &child);
+        if (status == ZX_OK) {
             // call the thread_callback if supplied
             if (ctx->thread_callback) {
                 status = (ctx->thread_callback)(
                     ctx->callback_context,
                     depth, child, koids->entries[n], process_koid);
                 // abort on failure
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     return status;
                 }
             }
 
-            mx_handle_close(child);
+            zx_handle_close(child);
         } else {
             fprintf(stderr,
-                    "WARNING: mx_object_get_child(%" PRIu64 ", "
+                    "WARNING: zx_object_get_child(%" PRIu64 ", "
                     "(proc)%" PRIu64 ", ...) failed: %s (%d)\n",
                     process_koid, koids->entries[n],
-                    mx_status_get_string(status), status);
+                    zx_status_get_string(status), status);
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t do_threads(
-    const walk_ctx_t* ctx, mx_handle_t job, mx_koid_t job_koid, int depth) {
+static zx_status_t do_threads(
+    const walk_ctx_t* ctx, zx_handle_t job, zx_koid_t job_koid, int depth) {
 
     koid_table_t* koids = make_koid_table();
-    mx_status_t status = do_threads_worker(ctx, koids, job, job_koid, depth);
+    zx_status_t status = do_threads_worker(ctx, koids, job, job_koid, depth);
     free_koid_table(koids);
     return status;
 }
 
-static mx_status_t do_processes_worker(
+static zx_status_t do_processes_worker(
     const walk_ctx_t* ctx, koid_table_t* koids,
-    mx_handle_t job, mx_koid_t job_koid, int depth) {
+    zx_handle_t job, zx_koid_t job_koid, int depth) {
 
-    mx_status_t status;
+    zx_status_t status;
 
     // get the list of processes under this job
-    status = fetch_children(job, job_koid, MX_INFO_JOB_PROCESSES,
-                            "MX_INFO_JOB_PROCESSES", koids);
-    if (status != MX_OK) {
+    status = fetch_children(job, job_koid, ZX_INFO_JOB_PROCESSES,
+                            "ZX_INFO_JOB_PROCESSES", koids);
+    if (status != ZX_OK) {
         return status;
     }
 
     for (size_t n = 0; n < koids->num_entries; n++) {
-        mx_handle_t child;
-        status = mx_object_get_child(job, koids->entries[n],
-                                     MX_RIGHT_SAME_RIGHTS, &child);
-        if (status == MX_OK) {
+        zx_handle_t child;
+        status = zx_object_get_child(job, koids->entries[n],
+                                     ZX_RIGHT_SAME_RIGHTS, &child);
+        if (status == ZX_OK) {
             // call the process_callback if supplied
             if (ctx->process_callback) {
                 status = (ctx->process_callback)(ctx->callback_context,
                                                  depth, child,
                                                  koids->entries[n], job_koid);
                 // abort on failure
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     return status;
                 }
             }
@@ -192,59 +192,59 @@
             if (ctx->thread_callback) {
                 status = do_threads(ctx, child, koids->entries[n], depth + 1);
                 // abort on failure
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     return status;
                 }
             }
 
-            mx_handle_close(child);
+            zx_handle_close(child);
         } else {
             fprintf(stderr,
-                    "WARNING: mx_object_get_child(%" PRIu64 ", "
+                    "WARNING: zx_object_get_child(%" PRIu64 ", "
                     "(proc)%" PRIu64 ", ...) failed: %s (%d)\n",
                     job_koid, koids->entries[n],
-                    mx_status_get_string(status), status);
+                    zx_status_get_string(status), status);
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t do_processes(
-    const walk_ctx_t* ctx, mx_handle_t job, mx_koid_t job_koid, int depth) {
+static zx_status_t do_processes(
+    const walk_ctx_t* ctx, zx_handle_t job, zx_koid_t job_koid, int depth) {
 
     koid_table_t* koids = make_koid_table();
-    mx_status_t status = do_processes_worker(ctx, koids, job, job_koid, depth);
+    zx_status_t status = do_processes_worker(ctx, koids, job, job_koid, depth);
     free_koid_table(koids);
     return status;
 }
 
-static mx_status_t do_jobs_worker(
+static zx_status_t do_jobs_worker(
     const walk_ctx_t* ctx, koid_table_t* koids,
-    mx_handle_t job, mx_koid_t job_koid, int depth) {
+    zx_handle_t job, zx_koid_t job_koid, int depth) {
 
-    mx_status_t status;
+    zx_status_t status;
 
     // get a list of child jobs for this job
-    status = fetch_children(job, job_koid, MX_INFO_JOB_CHILDREN,
-                            "MX_INFO_JOB_CHILDREN", koids);
-    if (status != MX_OK) {
+    status = fetch_children(job, job_koid, ZX_INFO_JOB_CHILDREN,
+                            "ZX_INFO_JOB_CHILDREN", koids);
+    if (status != ZX_OK) {
         return status;
     }
 
     // drill down into the job tree
     for (size_t n = 0; n < koids->num_entries; n++) {
-        mx_handle_t child;
-        status = mx_object_get_child(job, koids->entries[n],
-                                     MX_RIGHT_SAME_RIGHTS, &child);
-        if (status == MX_OK) {
+        zx_handle_t child;
+        status = zx_object_get_child(job, koids->entries[n],
+                                     ZX_RIGHT_SAME_RIGHTS, &child);
+        if (status == ZX_OK) {
             // call the job_callback if supplied
             if (ctx->job_callback) {
                 status = (ctx->job_callback)(ctx->callback_context,
                                              depth, child,
                                              koids->entries[n], job_koid);
                 // abort on failure
-                if (status != MX_OK) {
+                if (status != ZX_OK) {
                     return status;
                 }
             }
@@ -253,38 +253,38 @@
             status = walk_job_tree_internal(
                 ctx, child, koids->entries[n], depth + 1);
             // abort on failure
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
 
-            mx_handle_close(child);
+            zx_handle_close(child);
         } else {
             fprintf(stderr,
-                    "WARNING: mx_object_get_child(%" PRIu64 ", (job)%" PRIu64
+                    "WARNING: zx_object_get_child(%" PRIu64 ", (job)%" PRIu64
                     ", ...) failed: %s (%d)\n",
                     job_koid, koids->entries[n],
-                    mx_status_get_string(status), status);
+                    zx_status_get_string(status), status);
         }
     }
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t do_jobs(
-    const walk_ctx_t* ctx, mx_handle_t job, mx_koid_t job_koid, int depth) {
+static zx_status_t do_jobs(
+    const walk_ctx_t* ctx, zx_handle_t job, zx_koid_t job_koid, int depth) {
 
     koid_table_t* koids = make_koid_table();
-    mx_status_t status = do_jobs_worker(ctx, koids, job, job_koid, depth);
+    zx_status_t status = do_jobs_worker(ctx, koids, job, job_koid, depth);
     free_koid_table(koids);
     return status;
 }
 
-static mx_status_t walk_job_tree_internal(
-    const walk_ctx_t* ctx, mx_handle_t job, mx_koid_t job_koid, int depth) {
+static zx_status_t walk_job_tree_internal(
+    const walk_ctx_t* ctx, zx_handle_t job, zx_koid_t job_koid, int depth) {
 
     if (ctx->process_callback != nullptr || ctx->thread_callback != nullptr) {
-        mx_status_t status = do_processes(ctx, job, job_koid, depth);
-        if (status != MX_OK) {
+        zx_status_t status = do_processes(ctx, job, job_koid, depth);
+        if (status != ZX_OK) {
             return status;
         }
     }
@@ -292,16 +292,16 @@
     return do_jobs(ctx, job, job_koid, depth);
 }
 
-mx_status_t walk_job_tree(mx_handle_t root_job,
+zx_status_t walk_job_tree(zx_handle_t root_job,
                           task_callback_t job_callback,
                           task_callback_t process_callback,
                           task_callback_t thread_callback,
                           void* context) {
-    mx_koid_t root_job_koid = 0;
-    mx_info_handle_basic_t info;
-    mx_status_t status = mx_object_get_info(
-        root_job, MX_INFO_HANDLE_BASIC, &info, sizeof(info), nullptr, nullptr);
-    if (status == MX_OK) {
+    zx_koid_t root_job_koid = 0;
+    zx_info_handle_basic_t info;
+    zx_status_t status = zx_object_get_info(
+        root_job, ZX_INFO_HANDLE_BASIC, &info, sizeof(info), nullptr, nullptr);
+    if (status == ZX_OK) {
         root_job_koid = info.koid;
     }
     // Else keep going with a koid of zero.
@@ -309,7 +309,7 @@
     if (job_callback) {
         status =
             (job_callback)(context, /* depth */ 0, root_job, root_job_koid, 0);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
     }
@@ -323,53 +323,53 @@
         &ctx, root_job, root_job_koid, /* depth */ 1);
 }
 
-mx_status_t walk_root_job_tree(task_callback_t job_callback,
+zx_status_t walk_root_job_tree(task_callback_t job_callback,
                                task_callback_t process_callback,
                                task_callback_t thread_callback,
                                void* context) {
     int fd = open("/dev/misc/sysinfo", O_RDWR);
     if (fd < 0) {
         fprintf(stderr, "task-utils/walker: cannot open sysinfo: %d\n", errno);
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
-    mx_handle_t root_job;
+    zx_handle_t root_job;
     size_t n = ioctl_sysinfo_get_root_job(fd, &root_job);
     close(fd);
     if (n != sizeof(root_job)) {
         fprintf(stderr, "task-utils/walker: cannot obtain root job\n");
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
 
-    mx_status_t s = walk_job_tree(
+    zx_status_t s = walk_job_tree(
         root_job, job_callback, process_callback, thread_callback, context);
-    mx_handle_close(root_job);
+    zx_handle_close(root_job);
     return s;
 }
 
 // C++ interface
 
 namespace {
-static mx_status_t job_cpp_cb(void* ctx, int depth, mx_handle_t handle,
-                              mx_koid_t koid, mx_koid_t parent_koid) {
+static zx_status_t job_cpp_cb(void* ctx, int depth, zx_handle_t handle,
+                              zx_koid_t koid, zx_koid_t parent_koid) {
     return reinterpret_cast<TaskEnumerator*>(ctx)->OnJob(
         depth, handle, koid, parent_koid);
 }
 
-static mx_status_t process_cpp_cb(void* ctx, int depth, mx_handle_t handle,
-                                  mx_koid_t koid, mx_koid_t parent_koid) {
+static zx_status_t process_cpp_cb(void* ctx, int depth, zx_handle_t handle,
+                                  zx_koid_t koid, zx_koid_t parent_koid) {
     return reinterpret_cast<TaskEnumerator*>(ctx)->OnProcess(
         depth, handle, koid, parent_koid);
 }
 
-static mx_status_t thread_cpp_cb(void* ctx, int depth, mx_handle_t handle,
-                                 mx_koid_t koid, mx_koid_t parent_koid) {
+static zx_status_t thread_cpp_cb(void* ctx, int depth, zx_handle_t handle,
+                                 zx_koid_t koid, zx_koid_t parent_koid) {
     return reinterpret_cast<TaskEnumerator*>(ctx)->OnThread(
         depth, handle, koid, parent_koid);
 }
 } // namespace
 
-mx_status_t TaskEnumerator::WalkJobTree(mx_handle_t root_job) {
+zx_status_t TaskEnumerator::WalkJobTree(zx_handle_t root_job) {
     return walk_job_tree(root_job,
                          has_on_job() ? job_cpp_cb : nullptr,
                          has_on_process() ? process_cpp_cb : nullptr,
@@ -377,7 +377,7 @@
                          reinterpret_cast<void*>(this));
 }
 
-mx_status_t TaskEnumerator::WalkRootJobTree() {
+zx_status_t TaskEnumerator::WalkRootJobTree() {
     return walk_root_job_tree(has_on_job() ? job_cpp_cb : nullptr,
                               has_on_process() ? process_cpp_cb : nullptr,
                               has_on_thread() ? thread_cpp_cb : nullptr,
diff --git a/system/ulib/test-utils/include/test-utils/test-utils.h b/system/ulib/test-utils/include/test-utils/test-utils.h
index f2b0f34..e19d39d 100644
--- a/system/ulib/test-utils/include/test-utils/test-utils.h
+++ b/system/ulib/test-utils/include/test-utils/test-utils.h
@@ -15,9 +15,9 @@
 
 #include <stddef.h>
 #include <threads.h>
-#include <magenta/types.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/types.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/object.h>
 #include <launchpad/launchpad.h>
 
 __BEGIN_CDECLS
@@ -37,111 +37,111 @@
 // |what| is typically the name of the function that had the syscall failure,
 // but it can include more descriptive text as desired.
 
-void tu_fatal(const char *what, mx_status_t status);
+void tu_fatal(const char *what, zx_status_t status);
 
-// A wrapper on mx_handle_close.
+// A wrapper on zx_handle_close.
 
-void tu_handle_close(mx_handle_t handle);
+void tu_handle_close(zx_handle_t handle);
 
 // A wrapper on launchpad_launch.
 
-mx_handle_t tu_launch(mx_handle_t job, const char* name,
+zx_handle_t tu_launch(zx_handle_t job, const char* name,
                       int argc, const char* const* argv,
                       const char* const* envp,
-                      size_t num_handles, mx_handle_t* handles,
+                      size_t num_handles, zx_handle_t* handles,
                       uint32_t* handle_ids);
 
-// The first part of launchpad_launch_mxio_etc that creates the
+// The first part of launchpad_launch_fdio_etc that creates the
 // launchpad and initializes the process.
 
-launchpad_t* tu_launch_mxio_init(mx_handle_t job, const char* name,
+launchpad_t* tu_launch_fdio_init(zx_handle_t job, const char* name,
                                  int argc, const char* const* argv,
                                  const char* const* envp,
-                                 size_t num_handles, mx_handle_t* handles,
+                                 size_t num_handles, zx_handle_t* handles,
                                  uint32_t* handle_ids);
 
-// The second part of launchpad_launch_mxio_etc that starts the process.
+// The second part of launchpad_launch_fdio_etc that starts the process.
 // Returns a handle of the started process.
 
-mx_handle_t tu_launch_mxio_fini(launchpad_t* lp);
+zx_handle_t tu_launch_fdio_fini(launchpad_t* lp);
 
 // A wrapper on C11 thrd_create.
 
 void tu_thread_create_c11(thrd_t* thread, thrd_start_t entry, void* arg,
                           const char* name);
 
-// A wrapper on mx_channel_create.
+// A wrapper on zx_channel_create.
 
-void tu_channel_create(mx_handle_t* handle0, mx_handle_t* handle1);
+void tu_channel_create(zx_handle_t* handle0, zx_handle_t* handle1);
 
 
-// A wrapper on mx_channel_write.
+// A wrapper on zx_channel_write.
 
-void tu_channel_write(mx_handle_t handle, uint32_t flags, const void* bytes, uint32_t num_bytes,
-                      const mx_handle_t* handles, uint32_t num_handles);
+void tu_channel_write(zx_handle_t handle, uint32_t flags, const void* bytes, uint32_t num_bytes,
+                      const zx_handle_t* handles, uint32_t num_handles);
 
-// A wrapper on mx_channel_read.
+// A wrapper on zx_channel_read.
 
-void tu_channel_read(mx_handle_t handle, uint32_t flags, void* bytes, uint32_t* num_bytes,
-                     mx_handle_t* handles, uint32_t* num_handles);
+void tu_channel_read(zx_handle_t handle, uint32_t flags, void* bytes, uint32_t* num_bytes,
+                     zx_handle_t* handles, uint32_t* num_handles);
 
 // Wait for |channel| to be readable.
 // Returns true if the channel is readable, and false if the peer has closed its end.
 // The call fails and the process terminates if the call times out within TU_WATCHDOG_DURATION_NANOSECONDS.
-bool tu_channel_wait_readable(mx_handle_t channel);
+bool tu_channel_wait_readable(zx_handle_t channel);
 
-// Wait for |process| to be signaled (MX_PROCESS_TERMINATED).
+// Wait for |process| to be signaled (ZX_PROCESS_TERMINATED).
 // The call fails and the calling process terminates if the call times out within TU_WATCHDOG_DURATION_NANOSECONDS.
 
-void tu_process_wait_signaled(mx_handle_t process);
+void tu_process_wait_signaled(zx_handle_t process);
 
 // Return true if |process| has exited.
 
-bool tu_process_has_exited(mx_handle_t process);
+bool tu_process_has_exited(zx_handle_t process);
 
 // Fetch the return code of |process|.
 
-int tu_process_get_return_code(mx_handle_t process);
+int tu_process_get_return_code(zx_handle_t process);
 
 // Wait for |process| to exit and then fetch its return code.
 
-int tu_process_wait_exit(mx_handle_t process);
+int tu_process_wait_exit(zx_handle_t process);
 
 // Create a child job of |job|.
 
-mx_handle_t tu_job_create(mx_handle_t job);
+zx_handle_t tu_job_create(zx_handle_t job);
 
 // Create an io port.
 
-mx_handle_t tu_io_port_create(void);
+zx_handle_t tu_io_port_create(void);
 
 // Set the system exception port.
 
-void tu_set_system_exception_port(mx_handle_t eport, uint64_t key);
+void tu_set_system_exception_port(zx_handle_t eport, uint64_t key);
 
 // Set the exception port for |handle| which is a process or thread.
 
-void tu_set_exception_port(mx_handle_t handle, mx_handle_t eport, uint64_t key, uint32_t options);
+void tu_set_exception_port(zx_handle_t handle, zx_handle_t eport, uint64_t key, uint32_t options);
 
 // Get basic handle info for |handle|.
 
-void tu_handle_get_basic_info(mx_handle_t handle, mx_info_handle_basic_t* info);
+void tu_handle_get_basic_info(zx_handle_t handle, zx_info_handle_basic_t* info);
 
 // Return the koid of the object of |handle|.
 
-mx_koid_t tu_get_koid(mx_handle_t handle);
+zx_koid_t tu_get_koid(zx_handle_t handle);
 
 // Return the "related" koid of the object of |handle|.
 
-mx_koid_t tu_get_related_koid(mx_handle_t handle);
+zx_koid_t tu_get_related_koid(zx_handle_t handle);
 
 // Return a handle of thread |tid|.
 
-mx_handle_t tu_get_thread(mx_handle_t proc, mx_koid_t tid);
+zx_handle_t tu_get_thread(zx_handle_t proc, zx_koid_t tid);
 
-// Return mx_info_thread_t of |thread|.
+// Return zx_info_thread_t of |thread|.
 
-mx_info_thread_t tu_thread_get_info(mx_handle_t thread);
+zx_info_thread_t tu_thread_get_info(zx_handle_t thread);
 
 // Run a program and wait for it to exit.
 // Any error in trying to run the program is fatal.
diff --git a/system/ulib/test-utils/rules.mk b/system/ulib/test-utils/rules.mk
index b98b394..06b1644 100644
--- a/system/ulib/test-utils/rules.mk
+++ b/system/ulib/test-utils/rules.mk
@@ -22,8 +22,8 @@
 MODULE_LIBS := \
     system/ulib/unittest \
     system/ulib/launchpad \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/c \
-    system/ulib/magenta
+    system/ulib/zircon
 
 include make/module.mk
diff --git a/system/ulib/test-utils/test-utils.c b/system/ulib/test-utils/test-utils.c
index a6839bd..13caed6 100644
--- a/system/ulib/test-utils/test-utils.c
+++ b/system/ulib/test-utils/test-utils.c
@@ -6,10 +6,10 @@
 #include <string.h>
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
-#include <magenta/status.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/status.h>
 #include <runtime/thread.h>
 #include <test-utils/test-utils.h>
 #include <unittest/unittest.h>
@@ -48,17 +48,17 @@
     return result;
 }
 
-void tu_fatal(const char *what, mx_status_t status)
+void tu_fatal(const char *what, zx_status_t status)
 {
-    const char* reason = mx_status_get_string(status);
+    const char* reason = zx_status_get_string(status);
     unittest_printf_critical("%s failed, rc %d (%s)\n", what, status, reason);
     exit(TU_FAIL_ERRCODE);
 }
 
-void tu_handle_close(mx_handle_t handle)
+void tu_handle_close(zx_handle_t handle)
 {
-    mx_status_t status = mx_handle_close(handle);
-    // TODO(dje): It's still an open question as to whether errors other than MX_ERR_BAD_HANDLE are "advisory".
+    zx_status_t status = zx_handle_close(handle);
+    // TODO(dje): It's still an open question as to whether errors other than ZX_ERR_BAD_HANDLE are "advisory".
     if (status < 0) {
         tu_fatal(__func__, status);
     }
@@ -72,55 +72,55 @@
 {
     int ret = thrd_create_with_name(t, entry, arg, name);
     if (ret != thrd_success) {
-        // tu_fatal takes mx_status_t values.
+        // tu_fatal takes zx_status_t values.
         // The translation doesn't have to be perfect.
         switch (ret) {
         case thrd_nomem:
-            tu_fatal(__func__, MX_ERR_NO_MEMORY);
+            tu_fatal(__func__, ZX_ERR_NO_MEMORY);
         default:
-            tu_fatal(__func__, MX_ERR_BAD_STATE);
+            tu_fatal(__func__, ZX_ERR_BAD_STATE);
         }
         __UNREACHABLE;
     }
 }
 
-static mx_status_t tu_wait(const mx_handle_t* handles, const mx_signals_t* signals,
+static zx_status_t tu_wait(const zx_handle_t* handles, const zx_signals_t* signals,
                            uint32_t num_handles, uint32_t* result_index,
-                           mx_time_t timeout,
-                           mx_signals_t* pending)
+                           zx_time_t timeout,
+                           zx_signals_t* pending)
 {
-    mx_wait_item_t items[num_handles];
+    zx_wait_item_t items[num_handles];
     for (uint32_t n = 0; n < num_handles; n++) {
         items[n].handle = handles[n];
         items[n].waitfor = signals[n];
     }
-    mx_time_t deadline = mx_deadline_after(timeout);
-    mx_status_t status = mx_object_wait_many(items, num_handles, deadline);
+    zx_time_t deadline = zx_deadline_after(timeout);
+    zx_status_t status = zx_object_wait_many(items, num_handles, deadline);
     for (uint32_t n = 0; n < num_handles; n++) {
         pending[n] = items[n].pending;
     }
     return status;
 }
 
-void tu_channel_create(mx_handle_t* handle0, mx_handle_t* handle1) {
-    mx_handle_t handles[2];
-    mx_status_t status = mx_channel_create(0, &handles[0], &handles[1]);
+void tu_channel_create(zx_handle_t* handle0, zx_handle_t* handle1) {
+    zx_handle_t handles[2];
+    zx_status_t status = zx_channel_create(0, &handles[0], &handles[1]);
     if (status < 0)
         tu_fatal(__func__, status);
     *handle0 = handles[0];
     *handle1 = handles[1];
 }
 
-void tu_channel_write(mx_handle_t handle, uint32_t flags, const void* bytes, uint32_t num_bytes,
-                      const mx_handle_t* handles, uint32_t num_handles) {
-    mx_status_t status = mx_channel_write(handle, flags, bytes, num_bytes, handles, num_handles);
+void tu_channel_write(zx_handle_t handle, uint32_t flags, const void* bytes, uint32_t num_bytes,
+                      const zx_handle_t* handles, uint32_t num_handles) {
+    zx_status_t status = zx_channel_write(handle, flags, bytes, num_bytes, handles, num_handles);
     if (status < 0)
         tu_fatal(__func__, status);
 }
 
-void tu_channel_read(mx_handle_t handle, uint32_t flags, void* bytes, uint32_t* num_bytes,
-                     mx_handle_t* handles, uint32_t* num_handles) {
-    mx_status_t status = mx_channel_read(handle, flags, bytes, handles,
+void tu_channel_read(zx_handle_t handle, uint32_t flags, void* bytes, uint32_t* num_bytes,
+                     zx_handle_t* handles, uint32_t* num_handles) {
+    zx_status_t status = zx_channel_read(handle, flags, bytes, handles,
                                          num_bytes ? *num_bytes : 0, num_handles ? *num_handles : 0,
                                          num_bytes, num_handles);
     if (status < 0)
@@ -130,25 +130,25 @@
 // Wait until |channel| is readable or peer is closed.
 // Result is true if readable, otherwise false.
 
-bool tu_channel_wait_readable(mx_handle_t channel)
+bool tu_channel_wait_readable(zx_handle_t channel)
 {
-    mx_signals_t signals = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
-    mx_signals_t pending;
+    zx_signals_t signals = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
+    zx_signals_t pending;
     int64_t timeout = TU_WATCHDOG_DURATION_NANOSECONDS;
-    mx_status_t result = tu_wait(&channel, &signals, 1, NULL, timeout, &pending);
-    if (result != MX_OK)
+    zx_status_t result = tu_wait(&channel, &signals, 1, NULL, timeout, &pending);
+    if (result != ZX_OK)
         tu_fatal(__func__, result);
-    if ((pending & MX_CHANNEL_READABLE) == 0) {
+    if ((pending & ZX_CHANNEL_READABLE) == 0) {
         unittest_printf("%s: peer closed\n", __func__);
         return false;
     }
     return true;
 }
 
-mx_handle_t tu_launch(mx_handle_t job, const char* name,
+zx_handle_t tu_launch(zx_handle_t job, const char* name,
                       int argc, const char* const* argv,
                       const char* const* envp,
-                      size_t num_handles, mx_handle_t* handles,
+                      size_t num_handles, zx_handle_t* handles,
                       uint32_t* handle_ids)
 {
     launchpad_t* lp;
@@ -158,8 +158,8 @@
     launchpad_set_environ(lp, envp);
     launchpad_add_handles(lp, num_handles, handles, handle_ids);
 
-    mx_status_t status;
-    mx_handle_t child;
+    zx_status_t status;
+    zx_handle_t child;
     status = launchpad_go(lp, &child, NULL);
 
     if (status < 0)
@@ -167,13 +167,13 @@
     return child;
 }
 
-launchpad_t* tu_launch_mxio_init(mx_handle_t job, const char* name,
+launchpad_t* tu_launch_fdio_init(zx_handle_t job, const char* name,
                                  int argc, const char* const* argv,
                                  const char* const* envp,
-                                 size_t hnds_count, mx_handle_t* handles,
+                                 size_t hnds_count, zx_handle_t* handles,
                                  uint32_t* ids)
 {
-    // This is the first part of launchpad_launch_mxio_etc.
+    // This is the first part of launchpad_launch_fdio_etc.
     // It does everything except start the process running.
     launchpad_t* lp;
 
@@ -185,50 +185,50 @@
     launchpad_load_from_file(lp, filename);
     launchpad_set_args(lp, argc, argv);
     launchpad_set_environ(lp, envp);
-    launchpad_clone(lp, LP_CLONE_MXIO_ALL);
+    launchpad_clone(lp, LP_CLONE_FDIO_ALL);
     launchpad_add_handles(lp, hnds_count, handles, ids);
 
    return lp;
 }
 
-mx_handle_t tu_launch_mxio_fini(launchpad_t* lp)
+zx_handle_t tu_launch_fdio_fini(launchpad_t* lp)
 {
-    mx_handle_t proc;
-    mx_status_t status;
+    zx_handle_t proc;
+    zx_status_t status;
     if ((status = launchpad_go(lp, &proc, NULL)) < 0)
-        tu_fatal("tu_launch_mxio_fini", status);
+        tu_fatal("tu_launch_fdio_fini", status);
     return proc;
 }
 
-void tu_process_wait_signaled(mx_handle_t process)
+void tu_process_wait_signaled(zx_handle_t process)
 {
-    mx_signals_t signals = MX_PROCESS_TERMINATED;
-    mx_signals_t pending;
+    zx_signals_t signals = ZX_PROCESS_TERMINATED;
+    zx_signals_t pending;
     int64_t timeout = TU_WATCHDOG_DURATION_NANOSECONDS;
-    mx_status_t result = tu_wait(&process, &signals, 1, NULL, timeout, &pending);
-    if (result != MX_OK)
+    zx_status_t result = tu_wait(&process, &signals, 1, NULL, timeout, &pending);
+    if (result != ZX_OK)
         tu_fatal(__func__, result);
-    if ((pending & MX_PROCESS_TERMINATED) == 0) {
+    if ((pending & ZX_PROCESS_TERMINATED) == 0) {
         unittest_printf_critical("%s: unexpected return from tu_wait\n", __func__);
         exit(TU_FAIL_ERRCODE);
     }
 }
 
-bool tu_process_has_exited(mx_handle_t process)
+bool tu_process_has_exited(zx_handle_t process)
 {
-    mx_info_process_t info;
-    mx_status_t status;
-    if ((status = mx_object_get_info(process, MX_INFO_PROCESS, &info,
+    zx_info_process_t info;
+    zx_status_t status;
+    if ((status = zx_object_get_info(process, ZX_INFO_PROCESS, &info,
                                      sizeof(info), NULL, NULL)) < 0)
         tu_fatal("get process info", status);
     return info.exited;
 }
 
-int tu_process_get_return_code(mx_handle_t process)
+int tu_process_get_return_code(zx_handle_t process)
 {
-    mx_info_process_t info;
-    mx_status_t status;
-    if ((status = mx_object_get_info(process, MX_INFO_PROCESS, &info,
+    zx_info_process_t info;
+    zx_status_t status;
+    if ((status = zx_object_get_info(process, ZX_INFO_PROCESS, &info,
                                      sizeof(info), NULL, NULL)) < 0)
         tu_fatal("get process info", status);
     if (!info.exited) {
@@ -239,83 +239,83 @@
     return info.return_code;
 }
 
-int tu_process_wait_exit(mx_handle_t process)
+int tu_process_wait_exit(zx_handle_t process)
 {
     tu_process_wait_signaled(process);
     return tu_process_get_return_code(process);
 }
 
-mx_handle_t tu_job_create(mx_handle_t job)
+zx_handle_t tu_job_create(zx_handle_t job)
 {
-    mx_handle_t child_job;
-    mx_status_t status = mx_job_create(job, 0, &child_job);
+    zx_handle_t child_job;
+    zx_status_t status = zx_job_create(job, 0, &child_job);
     if (status < 0)
         tu_fatal(__func__, status);
     return child_job;
 }
 
-mx_handle_t tu_io_port_create(void)
+zx_handle_t tu_io_port_create(void)
 {
-    mx_handle_t handle;
-    mx_status_t status = mx_port_create(0, &handle);
+    zx_handle_t handle;
+    zx_status_t status = zx_port_create(0, &handle);
     if (status < 0)
         tu_fatal(__func__, status);
     return handle;
 }
 
-void tu_set_system_exception_port(mx_handle_t eport, uint64_t key)
+void tu_set_system_exception_port(zx_handle_t eport, uint64_t key)
 {
-    mx_status_t status = mx_task_bind_exception_port(0, eport, key, 0);
+    zx_status_t status = zx_task_bind_exception_port(0, eport, key, 0);
     if (status < 0)
         tu_fatal(__func__, status);
 }
 
-void tu_set_exception_port(mx_handle_t handle, mx_handle_t eport, uint64_t key, uint32_t options)
+void tu_set_exception_port(zx_handle_t handle, zx_handle_t eport, uint64_t key, uint32_t options)
 {
     if (handle == 0)
-        handle = mx_process_self();
-    mx_status_t status = mx_task_bind_exception_port(handle, eport, key, options);
+        handle = zx_process_self();
+    zx_status_t status = zx_task_bind_exception_port(handle, eport, key, options);
     if (status < 0)
         tu_fatal(__func__, status);
 }
 
-void tu_handle_get_basic_info(mx_handle_t handle, mx_info_handle_basic_t* info)
+void tu_handle_get_basic_info(zx_handle_t handle, zx_info_handle_basic_t* info)
 {
-    mx_status_t status = mx_object_get_info(handle, MX_INFO_HANDLE_BASIC,
+    zx_status_t status = zx_object_get_info(handle, ZX_INFO_HANDLE_BASIC,
                                             info, sizeof(*info), NULL, NULL);
     if (status < 0)
         tu_fatal(__func__, status);
 }
 
-mx_koid_t tu_get_koid(mx_handle_t handle)
+zx_koid_t tu_get_koid(zx_handle_t handle)
 {
-    mx_info_handle_basic_t info;
+    zx_info_handle_basic_t info;
     tu_handle_get_basic_info(handle, &info);
     return info.koid;
 }
 
-mx_koid_t tu_get_related_koid(mx_handle_t handle)
+zx_koid_t tu_get_related_koid(zx_handle_t handle)
 {
-    mx_info_handle_basic_t info;
+    zx_info_handle_basic_t info;
     tu_handle_get_basic_info(handle, &info);
     return info.related_koid;
 }
 
-mx_handle_t tu_get_thread(mx_handle_t proc, mx_koid_t tid)
+zx_handle_t tu_get_thread(zx_handle_t proc, zx_koid_t tid)
 {
-    mx_handle_t thread;
-    mx_status_t status = mx_object_get_child(proc, tid, MX_RIGHT_SAME_RIGHTS, &thread);
-    if (status != MX_OK)
+    zx_handle_t thread;
+    zx_status_t status = zx_object_get_child(proc, tid, ZX_RIGHT_SAME_RIGHTS, &thread);
+    if (status != ZX_OK)
         tu_fatal(__func__, status);
     return thread;
 }
 
-mx_info_thread_t tu_thread_get_info(mx_handle_t thread)
+zx_info_thread_t tu_thread_get_info(zx_handle_t thread)
 {
-    mx_info_thread_t info;
-    mx_status_t status = mx_object_get_info(thread, MX_INFO_THREAD, &info, sizeof(info), NULL, NULL);
+    zx_info_thread_t info;
+    zx_status_t status = zx_object_get_info(thread, ZX_INFO_THREAD, &info, sizeof(info), NULL, NULL);
     if (status < 0)
-        tu_fatal("mx_object_get_info(MX_INFO_THREAD)", status);
+        tu_fatal("zx_object_get_info(ZX_INFO_THREAD)", status);
     return info;
 }
 
@@ -325,12 +325,12 @@
 
     unittest_printf("%s: running %s\n", __func__, progname);
 
-    launchpad_create(MX_HANDLE_INVALID, progname, &lp);
+    launchpad_create(ZX_HANDLE_INVALID, progname, &lp);
     launchpad_clone(lp, LP_CLONE_ALL);
     launchpad_load_from_file(lp, argv[0]);
     launchpad_set_args(lp, argc, argv);
-    mx_status_t status;
-    mx_handle_t child;
+    zx_status_t status;
+    zx_handle_t child;
     if ((status = launchpad_go(lp, &child, NULL)) < 0) {
         tu_fatal(__func__, status);
     }
diff --git a/system/ulib/tftp/rules.mk b/system/ulib/tftp/rules.mk
index fbfe561..fa61bcc 100644
--- a/system/ulib/tftp/rules.mk
+++ b/system/ulib/tftp/rules.mk
@@ -13,7 +13,7 @@
 MODULE_EXPORT := a
 
 #MODULE_SO_NAME := tftp
-MODULE_LIBS := system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/c
 
 MODULE_COMPILEFLAGS := -DTFTP_USERLIB
 
@@ -27,9 +27,9 @@
 
 MODULE_NAME := tftp-test
 
-MODULE_STATIC_LIBS := system/ulib/tftp system/ulib/fbl system/ulib/mxcpp
+MODULE_STATIC_LIBS := system/ulib/tftp system/ulib/fbl system/ulib/zxcpp
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/c
 
 include make/module.mk
 
diff --git a/system/ulib/tftp/tftp-example.c b/system/ulib/tftp/tftp-example.c
index 5db72e6..d397644 100644
--- a/system/ulib/tftp/tftp-example.c
+++ b/system/ulib/tftp/tftp-example.c
@@ -232,7 +232,7 @@
     options.err_msg_sz = sizeof(err_msg);
     tftp_status send_result =
         tftp_push_file(session, connection, &file_cookie, filename,
-                       "magenta.bin", &options);
+                       "zircon.bin", &options);
     if (send_result == TFTP_NO_ERROR) {
         return 0;
     }
diff --git a/system/ulib/trace-engine/context.cpp b/system/ulib/trace-engine/context.cpp
index c92233a..e6aff78 100644
--- a/system/ulib/trace-engine/context.cpp
+++ b/system/ulib/trace-engine/context.cpp
@@ -4,15 +4,15 @@
 
 #include "context_impl.h"
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 
 #include <fbl/algorithm.h>
 #include <fbl/atomic.h>
 #include <fbl/intrusive_hash_table.h>
 #include <fbl/unique_ptr.h>
-#include <mx/process.h>
-#include <mx/thread.h>
+#include <zx/process.h>
+#include <zx/thread.h>
 #include <trace-engine/fields.h>
 
 namespace trace {
@@ -20,41 +20,41 @@
 
 // The cached koid of this process.
 // Initialized on first use.
-fbl::atomic<uint64_t> g_process_koid{MX_KOID_INVALID};
+fbl::atomic<uint64_t> g_process_koid{ZX_KOID_INVALID};
 
 // This thread's koid.
 // Initialized on first use.
-thread_local mx_koid_t tls_thread_koid{MX_KOID_INVALID};
+thread_local zx_koid_t tls_thread_koid{ZX_KOID_INVALID};
 
-mx_koid_t GetKoid(mx_handle_t handle) {
-    mx_info_handle_basic_t info;
-    mx_status_t status = mx_object_get_info(handle, MX_INFO_HANDLE_BASIC, &info,
+zx_koid_t GetKoid(zx_handle_t handle) {
+    zx_info_handle_basic_t info;
+    zx_status_t status = zx_object_get_info(handle, ZX_INFO_HANDLE_BASIC, &info,
                                             sizeof(info), nullptr, nullptr);
-    return status == MX_OK ? info.koid : MX_KOID_INVALID;
+    return status == ZX_OK ? info.koid : ZX_KOID_INVALID;
 }
 
-mx_koid_t GetCurrentProcessKoid() {
-    mx_koid_t koid = g_process_koid.load(fbl::memory_order_relaxed);
-    if (unlikely(koid == MX_KOID_INVALID)) {
-        koid = GetKoid(mx::process::self().get());
+zx_koid_t GetCurrentProcessKoid() {
+    zx_koid_t koid = g_process_koid.load(fbl::memory_order_relaxed);
+    if (unlikely(koid == ZX_KOID_INVALID)) {
+        koid = GetKoid(zx::process::self().get());
         g_process_koid.store(koid, fbl::memory_order_relaxed); // idempotent
     }
     return koid;
 }
 
-mx_koid_t GetCurrentThreadKoid() {
-    if (unlikely(tls_thread_koid == MX_KOID_INVALID)) {
-        tls_thread_koid = GetKoid(mx::thread::self().get());
+zx_koid_t GetCurrentThreadKoid() {
+    if (unlikely(tls_thread_koid == ZX_KOID_INVALID)) {
+        tls_thread_koid = GetKoid(zx::thread::self().get());
     }
     return tls_thread_koid;
 }
 
-void GetObjectName(mx_handle_t handle, char* name_buf, size_t name_buf_size,
+void GetObjectName(zx_handle_t handle, char* name_buf, size_t name_buf_size,
                    trace_string_ref* out_name_ref) {
-    mx_status_t status = mx_object_get_property(handle, MX_PROP_NAME,
+    zx_status_t status = zx_object_get_property(handle, ZX_PROP_NAME,
                                                 name_buf, name_buf_size);
     name_buf[name_buf_size - 1] = 0;
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         *out_name_ref = trace_make_inline_c_string_ref(name_buf);
     } else {
         *out_name_ref = trace_make_empty_string_ref();
@@ -202,7 +202,7 @@
         return WordsToBytes(1);
     default:
         // skip unrecognized argument type
-        MX_DEBUG_ASSERT(false);
+        ZX_DEBUG_ASSERT(false);
         return 0u;
     }
 }
@@ -316,7 +316,7 @@
             break;
         default:
             // skip unrecognized argument type
-            MX_DEBUG_ASSERT(false);
+            ZX_DEBUG_ASSERT(false);
             break;
         }
         return *this;
@@ -472,7 +472,7 @@
     const char* string_literal,
     trace_string_ref_t* out_ref) {
     bool result = trace::RegisterString(context, string_literal, false, out_ref);
-    MX_DEBUG_ASSERT(result);
+    ZX_DEBUG_ASSERT(result);
 }
 
 bool trace_context_register_category_literal(
@@ -493,10 +493,10 @@
     }
 
     trace_string_ref name_ref;
-    char name_buf[MX_MAX_NAME_LEN];
-    trace::GetObjectName(mx::thread::self().get(), name_buf, sizeof(name_buf), &name_ref);
-    mx_koid_t process_koid = trace::GetCurrentProcessKoid();
-    mx_koid_t thread_koid = trace::GetCurrentThreadKoid();
+    char name_buf[ZX_MAX_NAME_LEN];
+    trace::GetObjectName(zx::thread::self().get(), name_buf, sizeof(name_buf), &name_ref);
+    zx_koid_t process_koid = trace::GetCurrentProcessKoid();
+    zx_koid_t thread_koid = trace::GetCurrentThreadKoid();
     trace_context_write_thread_info_record(context, process_koid, thread_koid,
                                            &name_ref);
 
@@ -523,7 +523,7 @@
 
 void trace_context_register_thread(
     trace_context_t* context,
-    mx_koid_t process_koid, mx_koid_t thread_koid,
+    zx_koid_t process_koid, zx_koid_t thread_koid,
     trace_thread_ref_t* out_ref) {
     // TODO(MG-1035): Since we can't use the thread-local cache here, cache
     // this registered thread on the trace context structure, guarded by a mutex.
@@ -538,7 +538,7 @@
 
 void trace_context_write_kernel_object_record(
     trace_context_t* context,
-    mx_koid_t koid, mx_obj_type_t type,
+    zx_koid_t koid, zx_obj_type_t type,
     const trace_string_ref_t* name_ref,
     const trace_arg_t* args, size_t num_args) {
     const size_t record_size = sizeof(trace::RecordHeader) +
@@ -562,25 +562,25 @@
 
 void trace_context_write_kernel_object_record_for_handle(
     trace_context_t* context,
-    mx_handle_t handle,
+    zx_handle_t handle,
     const trace_arg_t* args, size_t num_args) {
-    mx_info_handle_basic_t info;
-    mx_status_t status = mx_object_get_info(handle, MX_INFO_HANDLE_BASIC, &info,
+    zx_info_handle_basic_t info;
+    zx_status_t status = zx_object_get_info(handle, ZX_INFO_HANDLE_BASIC, &info,
                                             sizeof(info), nullptr, nullptr);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return;
 
     trace_string_ref name_ref;
-    char name_buf[MX_MAX_NAME_LEN];
+    char name_buf[ZX_MAX_NAME_LEN];
     trace::GetObjectName(handle, name_buf, sizeof(name_buf), &name_ref);
 
-    mx_obj_type_t obj_type = static_cast<mx_obj_type_t>(info.type);
+    zx_obj_type_t obj_type = static_cast<zx_obj_type_t>(info.type);
     switch (obj_type) {
-    case MX_OBJ_TYPE_PROCESS:
+    case ZX_OBJ_TYPE_PROCESS:
         // TODO(MG-1028): Support custom args.
         trace_context_write_process_info_record(context, info.koid, &name_ref);
         break;
-    case MX_OBJ_TYPE_THREAD:
+    case ZX_OBJ_TYPE_THREAD:
         // TODO(MG-1028): Support custom args.
         trace_context_write_thread_info_record(context, info.related_koid, info.koid, &name_ref);
         break;
@@ -593,16 +593,16 @@
 
 void trace_context_write_process_info_record(
     trace_context_t* context,
-    mx_koid_t process_koid,
+    zx_koid_t process_koid,
     const trace_string_ref_t* process_name_ref) {
-    trace_context_write_kernel_object_record(context, process_koid, MX_OBJ_TYPE_PROCESS,
+    trace_context_write_kernel_object_record(context, process_koid, ZX_OBJ_TYPE_PROCESS,
                                              process_name_ref, nullptr, 0u);
 }
 
 void trace_context_write_thread_info_record(
     trace_context_t* context,
-    mx_koid_t process_koid,
-    mx_koid_t thread_koid,
+    zx_koid_t process_koid,
+    zx_koid_t thread_koid,
     const trace_string_ref_t* thread_name_ref) {
     // TODO(MG-1028): We should probably store the related koid in the trace
     // event directly instead of packing it into an argument like this.
@@ -610,7 +610,7 @@
     trace_context_register_string_literal(context, "process", &arg.name_ref);
     arg.value.type = TRACE_ARG_KOID;
     arg.value.koid_value = process_koid;
-    trace_context_write_kernel_object_record(context, process_koid, MX_OBJ_TYPE_THREAD,
+    trace_context_write_kernel_object_record(context, process_koid, ZX_OBJ_TYPE_THREAD,
                                              thread_name_ref, &arg, 1u);
 }
 
@@ -873,8 +873,8 @@
 void trace_context_write_string_record(
     trace_context_t* context,
     trace_string_index_t index, const char* string, size_t length) {
-    MX_DEBUG_ASSERT(index != TRACE_ENCODED_STRING_REF_EMPTY);
-    MX_DEBUG_ASSERT(index <= TRACE_ENCODED_STRING_REF_MAX_INDEX);
+    ZX_DEBUG_ASSERT(index != TRACE_ENCODED_STRING_REF_EMPTY);
+    ZX_DEBUG_ASSERT(index <= TRACE_ENCODED_STRING_REF_MAX_INDEX);
 
     if (length > TRACE_ENCODED_STRING_REF_MAX_LENGTH)
         length = TRACE_ENCODED_STRING_REF_MAX_LENGTH;
@@ -894,10 +894,10 @@
 void trace_context_write_thread_record(
     trace_context_t* context,
     trace_thread_index_t index,
-    mx_koid_t process_koid,
-    mx_koid_t thread_koid) {
-    MX_DEBUG_ASSERT(index != TRACE_ENCODED_THREAD_REF_INLINE);
-    MX_DEBUG_ASSERT(index <= TRACE_ENCODED_THREAD_REF_MAX_INDEX);
+    zx_koid_t process_koid,
+    zx_koid_t thread_koid) {
+    ZX_DEBUG_ASSERT(index != TRACE_ENCODED_THREAD_REF_INLINE);
+    ZX_DEBUG_ASSERT(index <= TRACE_ENCODED_THREAD_REF_MAX_INDEX);
 
     const size_t record_size = sizeof(trace::RecordHeader) +
                                trace::WordsToBytes(2);
@@ -925,13 +925,13 @@
       buffer_current_(reinterpret_cast<uintptr_t>(buffer_start_)),
       buffer_full_mark_(0u),
       handler_(handler) {
-    MX_DEBUG_ASSERT(generation_ != 0u);
+    ZX_DEBUG_ASSERT(generation_ != 0u);
 }
 
 trace_context::~trace_context() = default;
 
 uint64_t* trace_context::AllocRecord(size_t num_bytes) {
-    MX_DEBUG_ASSERT((num_bytes & 7) == 0);
+    ZX_DEBUG_ASSERT((num_bytes & 7) == 0);
     if (unlikely(num_bytes > TRACE_ENCODED_RECORD_MAX_LENGTH))
         return nullptr;
 
@@ -939,7 +939,7 @@
         buffer_current_.fetch_add(num_bytes,
                                   fbl::memory_order_relaxed));
     if (likely(ptr + num_bytes <= buffer_end_)) {
-        MX_DEBUG_ASSERT(ptr + num_bytes >= buffer_start_);
+        ZX_DEBUG_ASSERT(ptr + num_bytes >= buffer_start_);
         return reinterpret_cast<uint64_t*>(ptr); // success!
     }
 
diff --git a/system/ulib/trace-engine/context_impl.h b/system/ulib/trace-engine/context_impl.h
index 81dee05..b5e8fd8 100644
--- a/system/ulib/trace-engine/context_impl.h
+++ b/system/ulib/trace-engine/context_impl.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 #include <fbl/atomic.h>
 
diff --git a/system/ulib/trace-engine/engine.cpp b/system/ulib/trace-engine/engine.cpp
index 3126654..84b32e3 100644
--- a/system/ulib/trace-engine/engine.cpp
+++ b/system/ulib/trace-engine/engine.cpp
@@ -6,10 +6,10 @@
 
 #include <string.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 #include <async/wait.h>
-#include <mx/event.h>
+#include <zx/event.h>
 #include <fbl/atomic.h>
 #include <fbl/auto_lock.h>
 #include <fbl/mutex.h>
@@ -39,7 +39,7 @@
 // trace finishes.
 // Rules:
 //   - can only be accessed or modified while holding g_engine_mutex
-mx_status_t g_disposition{MX_OK};
+zx_status_t g_disposition{ZX_OK};
 
 // Trace asynchronous dispatcher.
 // Rules:
@@ -56,7 +56,7 @@
 // Trace observer table.
 // Rules:
 //   - can only be accessed or modified while holding g_engine_mutex
-fbl::Vector<mx_handle_t> g_observers;
+fbl::Vector<zx_handle_t> g_observers;
 
 // Trace context reference count.
 // This functions as a non-exclusive lock for the engine's trace context.
@@ -70,12 +70,12 @@
 fbl::atomic_uint32_t g_context_refs{0u};
 
 // Trace context released event.
-// Used by |trace_release_context()| to signal (with MX_EVENT_SIGNALED) when
+// Used by |trace_release_context()| to signal (with ZX_EVENT_SIGNALED) when
 // the trace context reference count has dropped to zero.
 // Rules:
 //   - can only be modified while holding g_engine_mutex and engine is stopped
 //   - can be read outside the lock while the engine is not stopped
-mx::event g_context_released_event;
+zx::event g_context_released_event;
 
 // Trace context.
 // Rules:
@@ -88,19 +88,19 @@
 async_wait_t g_context_released_wait;
 
 async_wait_result_t handle_context_released(async_t* async, async_wait_t* wait,
-                                            mx_status_t status,
-                                            const mx_packet_signal_t* signal);
+                                            zx_status_t status,
+                                            const zx_packet_signal_t* signal);
 
 // must hold g_engine_mutex
-inline void update_disposition_locked(mx_status_t disposition) {
-    if (g_disposition == MX_OK)
+inline void update_disposition_locked(zx_status_t disposition) {
+    if (g_disposition == ZX_OK)
         g_disposition = disposition;
 }
 
 void notify_observers_locked() {
-    for (mx_handle_t observer : g_observers) {
-        mx_status_t status = mx_object_signal(observer, 0u, MX_EVENT_SIGNALED);
-        MX_DEBUG_ASSERT(status == MX_OK);
+    for (zx_handle_t observer : g_observers) {
+        zx_status_t status = zx_object_signal(observer, 0u, ZX_EVENT_SIGNALED);
+        ZX_DEBUG_ASSERT(status == ZX_OK);
     }
 }
 
@@ -109,24 +109,24 @@
 /*** Trace engine functions ***/
 
 // thread-safe
-mx_status_t trace_start_engine(async_t* async,
+zx_status_t trace_start_engine(async_t* async,
                                trace_handler_t* handler,
                                void* buffer,
                                size_t buffer_num_bytes) {
-    MX_DEBUG_ASSERT(async);
-    MX_DEBUG_ASSERT(handler);
-    MX_DEBUG_ASSERT(buffer);
+    ZX_DEBUG_ASSERT(async);
+    ZX_DEBUG_ASSERT(handler);
+    ZX_DEBUG_ASSERT(buffer);
 
     fbl::AutoLock lock(&g_engine_mutex);
 
     // We must have fully stopped a prior tracing session before starting a new one.
     if (g_state.load(fbl::memory_order_relaxed) != TRACE_STOPPED)
-        return MX_ERR_BAD_STATE;
-    MX_DEBUG_ASSERT(g_context_refs.load(fbl::memory_order_relaxed) == 0u);
+        return ZX_ERR_BAD_STATE;
+    ZX_DEBUG_ASSERT(g_context_refs.load(fbl::memory_order_relaxed) == 0u);
 
-    mx::event context_released_event;
-    mx_status_t status = mx::event::create(0u, &context_released_event);
-    if (status != MX_OK)
+    zx::event context_released_event;
+    zx_status_t status = zx::event::create(0u, &context_released_event);
+    if (status != ZX_OK)
         return status;
 
     // Schedule a wait for the buffer to be released.
@@ -134,48 +134,48 @@
         .state = {ASYNC_STATE_INIT},
         .handler = &handle_context_released,
         .object = context_released_event.get(),
-        .trigger = MX_EVENT_SIGNALED,
+        .trigger = ZX_EVENT_SIGNALED,
         .flags = ASYNC_FLAG_HANDLE_SHUTDOWN,
         .reserved = 0};
     status = async_begin_wait(async, &g_context_released_wait);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     // Initialize the trace engine state and context.
     g_state.store(TRACE_STARTED, fbl::memory_order_relaxed);
     g_async = async;
     g_handler = handler;
-    g_disposition = MX_OK;
+    g_disposition = ZX_OK;
     g_context = new trace_context(buffer, buffer_num_bytes, handler);
     g_context_released_event = fbl::move(context_released_event);
 
     // Write the trace initialization record first before allowing clients to
     // get in and write their own trace records.
-    trace_context_write_initialization_record(g_context, mx_ticks_per_second());
+    trace_context_write_initialization_record(g_context, zx_ticks_per_second());
 
     // After this point clients can acquire references to the trace context.
     g_context_refs.store(1u, fbl::memory_order_release);
 
     // Notify observers that the state changed.
     notify_observers_locked();
-    return MX_OK;
+    return ZX_OK;
 }
 
 // thread-safe
-mx_status_t trace_stop_engine(mx_status_t disposition) {
+zx_status_t trace_stop_engine(zx_status_t disposition) {
     fbl::AutoLock lock(&g_engine_mutex);
 
     // We must have have an active trace in order to stop it.
     int state = g_state.load(fbl::memory_order_relaxed);
     if (state == TRACE_STOPPED)
-        return MX_ERR_BAD_STATE;
+        return ZX_ERR_BAD_STATE;
 
     update_disposition_locked(disposition);
     if (state == TRACE_STOPPING)
-        return MX_OK; // already stopping
+        return ZX_OK; // already stopping
 
-    MX_DEBUG_ASSERT(state == TRACE_STARTED);
-    MX_DEBUG_ASSERT(g_context_refs.load(fbl::memory_order_relaxed) != 0u);
+    ZX_DEBUG_ASSERT(state == TRACE_STARTED);
+    ZX_DEBUG_ASSERT(g_context_refs.load(fbl::memory_order_relaxed) != 0u);
 
     // Begin stopping the trace.
     g_state.store(TRACE_STOPPING, fbl::memory_order_relaxed);
@@ -187,20 +187,20 @@
     // |handle_context_released()| will be called asynchronously when the last
     // reference is released.
     trace_release_context(g_context);
-    return MX_OK;
+    return ZX_OK;
 }
 
 namespace {
 
 async_wait_result_t handle_context_released(async_t* async, async_wait_t* wait,
-                                            mx_status_t status,
-                                            const mx_packet_signal_t* signal) {
+                                            zx_status_t status,
+                                            const zx_packet_signal_t* signal) {
     // Handle the case where the asynchronous dispatcher is being shut down.
-    if (status != MX_OK) {
-        MX_DEBUG_ASSERT(status == MX_ERR_CANCELED);
+    if (status != ZX_OK) {
+        ZX_DEBUG_ASSERT(status == ZX_ERR_CANCELED);
 
         // Stop the engine, in case it hasn't noticed yet.
-        trace_stop_engine(MX_ERR_CANCELED);
+        trace_stop_engine(ZX_ERR_CANCELED);
 
         // There may still be outstanding references to the trace context.
         // We don't know when or whether they will be cleared but we can't complete
@@ -211,10 +211,10 @@
         // only occurs when the asynchronous dispatcher is shutting down, typically
         // just prior to process exit.
         status = g_context_released_event.wait_one(
-            MX_EVENT_SIGNALED,
-            mx_deadline_after(MX_MSEC(kSynchronousShutdownTimeoutMilliseconds)),
+            ZX_EVENT_SIGNALED,
+            zx_deadline_after(ZX_MSEC(kSynchronousShutdownTimeoutMilliseconds)),
             nullptr);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             // Uh oh.
             printf("Timed out waiting for %u trace context references to be released "
                    "after %u ms while the asynchronous dispatcher was shutting down.\n"
@@ -227,19 +227,19 @@
 
     // All ready to clean up.
     // Grab the mutex while modifying shared state.
-    mx_status_t disposition;
+    zx_status_t disposition;
     trace_handler_t* handler;
     size_t buffer_bytes_written;
     {
         fbl::AutoLock lock(&g_engine_mutex);
 
-        MX_DEBUG_ASSERT(g_state.load(fbl::memory_order_relaxed) == TRACE_STOPPING);
-        MX_DEBUG_ASSERT(g_context_refs.load(fbl::memory_order_relaxed) == 0u);
-        MX_DEBUG_ASSERT(g_context != nullptr);
+        ZX_DEBUG_ASSERT(g_state.load(fbl::memory_order_relaxed) == TRACE_STOPPING);
+        ZX_DEBUG_ASSERT(g_context_refs.load(fbl::memory_order_relaxed) == 0u);
+        ZX_DEBUG_ASSERT(g_context != nullptr);
 
         // Get final disposition.
         if (g_context->is_buffer_full())
-            update_disposition_locked(MX_ERR_NO_MEMORY);
+            update_disposition_locked(ZX_ERR_NO_MEMORY);
         disposition = g_disposition;
         handler = g_handler;
         buffer_bytes_written = g_context->bytes_allocated();
@@ -247,7 +247,7 @@
         // Tidy up.
         g_async = nullptr;
         g_handler = nullptr;
-        g_disposition = MX_OK;
+        g_disposition = ZX_OK;
         g_context_released_event.reset();
         delete g_context;
         g_context = nullptr;
@@ -322,38 +322,38 @@
 
 // thread-safe, never-fail, lock-free
 void trace_release_context(trace_context_t* context) {
-    MX_DEBUG_ASSERT(context == g_context);
-    MX_DEBUG_ASSERT(g_context_refs.load(fbl::memory_order_relaxed) != 0u);
+    ZX_DEBUG_ASSERT(context == g_context);
+    ZX_DEBUG_ASSERT(g_context_refs.load(fbl::memory_order_relaxed) != 0u);
 
     // Note the RELEASE fence here since the trace context and trace buffer
     // contents may have changes from the perspective of other threads.
     if (unlikely(g_context_refs.fetch_sub(1u, fbl::memory_order_release) == 1u)) {
         // Notify the engine that the last reference was released.
-        mx_status_t status = g_context_released_event.signal(0u, MX_EVENT_SIGNALED);
-        MX_DEBUG_ASSERT(status == MX_OK);
+        zx_status_t status = g_context_released_event.signal(0u, ZX_EVENT_SIGNALED);
+        ZX_DEBUG_ASSERT(status == ZX_OK);
     }
 }
 
-mx_status_t trace_register_observer(mx_handle_t event) {
+zx_status_t trace_register_observer(zx_handle_t event) {
     fbl::AutoLock lock(&g_engine_mutex);
 
     for (auto item : g_observers) {
         if (item == event)
-            return MX_ERR_INVALID_ARGS;
+            return ZX_ERR_INVALID_ARGS;
     }
 
     g_observers.push_back(event);
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t trace_unregister_observer(mx_handle_t event) {
+zx_status_t trace_unregister_observer(zx_handle_t event) {
     fbl::AutoLock lock(&g_engine_mutex);
 
     for (size_t i = 0; i < g_observers.size(); i++) {
         if (g_observers[i] == event) {
             g_observers.erase(i);
-            return MX_OK;
+            return ZX_OK;
         }
     }
-    return MX_ERR_NOT_FOUND;
+    return ZX_ERR_NOT_FOUND;
 }
diff --git a/system/ulib/trace-engine/include/trace-engine/context.h b/system/ulib/trace-engine/include/trace-engine/context.h
index c3e1d93..6c8f318 100644
--- a/system/ulib/trace-engine/include/trace-engine/context.h
+++ b/system/ulib/trace-engine/include/trace-engine/context.h
@@ -27,10 +27,10 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <magenta/assert.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/assert.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 
 #include <trace-engine/types.h>
 
@@ -166,14 +166,14 @@
 // This function is thread-safe.
 void trace_context_register_thread(
     trace_context_t* context,
-    mx_koid_t process_koid, mx_koid_t thread_koid,
+    zx_koid_t process_koid, zx_koid_t thread_koid,
     trace_thread_ref_t* out_ref);
 
 // Registers a thread and returns its thread ref.
 // Helper for |trace_context_register_thread()|.
 inline trace_thread_ref_t trace_context_make_registered_thread(
     trace_context_t* context,
-    mx_koid_t process_koid, mx_koid_t thread_koid) {
+    zx_koid_t process_koid, zx_koid_t thread_koid) {
     trace_thread_ref_t ref;
     trace_context_register_thread(context, process_koid, thread_koid, &ref);
     return ref;
@@ -191,7 +191,7 @@
 // This function is thread-safe.
 void trace_context_write_kernel_object_record(
     trace_context_t* context,
-    mx_koid_t koid, mx_obj_type_t type,
+    zx_koid_t koid, zx_obj_type_t type,
     const trace_string_ref_t* name_ref,
     const trace_arg_t* args, size_t num_args);
 
@@ -206,7 +206,7 @@
 // This function is thread-safe.
 void trace_context_write_kernel_object_record_for_handle(
     trace_context_t* context,
-    mx_handle_t handle,
+    zx_handle_t handle,
     const trace_arg_t* args, size_t num_args);
 
 // Writes a kernel object record for the specified process into the trace buffer.
@@ -219,7 +219,7 @@
 // This function is thread-safe.
 void trace_context_write_process_info_record(
     trace_context_t* context,
-    mx_koid_t process_koid,
+    zx_koid_t process_koid,
     const trace_string_ref_t* process_name_ref);
 
 // Writes a kernel object record for the specified thread into the trace buffer.
@@ -233,7 +233,7 @@
 // This function is thread-safe.
 void trace_context_write_thread_info_record(
     trace_context_t* context,
-    mx_koid_t process_koid, mx_koid_t thread_koid,
+    zx_koid_t process_koid, zx_koid_t thread_koid,
     const trace_string_ref_t* thread_name_ref);
 
 // Writes a context switch record into the trace buffer.
@@ -545,8 +545,8 @@
 void trace_context_write_thread_record(
     trace_context_t* context,
     trace_thread_index_t index,
-    mx_koid_t process_koid,
-    mx_koid_t thread_koid);
+    zx_koid_t process_koid,
+    zx_koid_t thread_koid);
 
 // Allocates space for a record in the trace buffer.
 //
diff --git a/system/ulib/trace-engine/include/trace-engine/handler.h b/system/ulib/trace-engine/include/trace-engine/handler.h
index 73e379d..da36947 100644
--- a/system/ulib/trace-engine/include/trace-engine/handler.h
+++ b/system/ulib/trace-engine/include/trace-engine/handler.h
@@ -19,8 +19,8 @@
 
 #include <stdbool.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 #include <async/dispatcher.h>
 #include <trace-engine/instrumentation.h>
@@ -52,18 +52,18 @@
 
     // Called by the trace engine when tracing has stopped.
     //
-    // The trace collection status is |MX_OK| if trace collection was successful.
+    // The trace collection status is |ZX_OK| if trace collection was successful.
     // An error indicates that the trace data may be inaccurate or incomplete.
     //
     // |handler| is the trace handler object itself.
     // |async| is the trace engine's asynchronous dispatcher.
-    // |disposition| is |MX_OK| if tracing stopped normally, otherwise indicates
+    // |disposition| is |ZX_OK| if tracing stopped normally, otherwise indicates
     // that tracing was aborted due to an error.
     // |buffer_bytes_written| is number of bytes which were written to the trace buffer.
     //
     // Called on an asynchronous dispatch thread.
     void (*trace_stopped)(trace_handler_t* handler, async_t* async,
-                          mx_status_t disposition, size_t buffer_bytes_written);
+                          zx_status_t disposition, size_t buffer_bytes_written);
 };
 
 // Asynchronously starts the trace engine.
@@ -73,9 +73,9 @@
 // |buffer| is the trace buffer into which the trace engine will write trace events.
 // |buffer_num_bytes| is the size of the trace buffer in bytes.
 //
-// Returns |MX_OK| if tracing is ready to go.
-// Returns |MX_ERR_BAD_STATE| if tracing is already in progress.
-// Returns |MX_ERR_NO_MEMORY| if allocation failed.
+// Returns |ZX_OK| if tracing is ready to go.
+// Returns |ZX_ERR_BAD_STATE| if tracing is already in progress.
+// Returns |ZX_ERR_NO_MEMORY| if allocation failed.
 //
 // This function is thread-safe.
 //
@@ -87,7 +87,7 @@
 // the trace engine may fail to come to a complete stop if there remain outstanding
 // references to the trace context during dispatcher shutdown.  When this happens,
 // the trace handler will not be notified of trace completion and subsequent calls
-// to |trace_start_engine()| will return |MX_ERR_BAD_STATE|.
+// to |trace_start_engine()| will return |ZX_ERR_BAD_STATE|.
 //
 // For this reason, it is a good idea to call |trace_stop_engine()| and wait
 // for the handler to receive the |trace_handler_ops.trace_stopped()| callback
@@ -95,7 +95,7 @@
 //
 // Better yet, don't shut down the trace engine's asynchronous dispatcher unless
 // the process is already about to exit.
-mx_status_t trace_start_engine(async_t* async,
+zx_status_t trace_start_engine(async_t* async,
                                trace_handler_t* handler,
                                void* buffer,
                                size_t buffer_num_bytes);
@@ -105,13 +105,13 @@
 // The trace handler's |trace_stopped()| method will be invoked asynchronously
 // when the trace engine transitions to the |TRACE_STOPPED| states.
 //
-// |disposition| is |MX_OK| if tracing is being stopped normally, otherwise indicates
+// |disposition| is |ZX_OK| if tracing is being stopped normally, otherwise indicates
 // that tracing is being aborted due to an error.
 //
-// Returns |MX_OK| if the current state is |TRACE_STARTED| or |TRACE_STOPPING|.
-// Returns |MX_ERR_BAD_STATE| if current state is |TRACE_STOPPED|.
+// Returns |ZX_OK| if the current state is |TRACE_STARTED| or |TRACE_STOPPING|.
+// Returns |ZX_ERR_BAD_STATE| if current state is |TRACE_STOPPED|.
 //
 // This function is thread-safe.
-mx_status_t trace_stop_engine(mx_status_t disposition);
+zx_status_t trace_stop_engine(zx_status_t disposition);
 
 __END_CDECLS
diff --git a/system/ulib/trace-engine/include/trace-engine/instrumentation.h b/system/ulib/trace-engine/include/trace-engine/instrumentation.h
index d353124..c674e5f 100644
--- a/system/ulib/trace-engine/include/trace-engine/instrumentation.h
+++ b/system/ulib/trace-engine/include/trace-engine/instrumentation.h
@@ -28,7 +28,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include <trace-engine/context.h>
 
@@ -139,30 +139,30 @@
 //
 // The protocol works like this:
 //
-// 1. The trace observer creates an event object (using |mx_event_create()| or
+// 1. The trace observer creates an event object (using |zx_event_create()| or
 //    equivalent) then calls |trace_register_observer()| to register itself.
 // 2. The trace observer queries the current trace state and set of enabled categories.
 // 3. If tracing is enabled, the trace observer configures itself to collect data
 //    and write trace records relevant to the set of enabled categories.
 // 4. When the trace state and/or set of enabled categories changes, the trace engine
-//    sets the |MX_EVENT_SIGNALED| signal bit of each |event| associated with
+//    sets the |ZX_EVENT_SIGNALED| signal bit of each |event| associated with
 //    currently registered observers.
-// 5. In response to observing the |MX_EVENT_SIGNALED| signal, the trace observer
-//    first clears the |MX_EVENT_SIGNALED| bit (using |mx_object_signal()| or equivalent)
+// 5. In response to observing the |ZX_EVENT_SIGNALED| signal, the trace observer
+//    first clears the |ZX_EVENT_SIGNALED| bit (using |zx_object_signal()| or equivalent)
 //    then adjusts its behavior as in step 2 and 3 above.
 // 6. When no longer interested in receiving events, the trace observer calls
 //    |trace_unregister_observer()| to unregister itself then closes the event handle.
 //
-// Returns |MX_OK| if successful.
-// Returns |MX_ERR_INVALID_ARGS| if the event was already registered.
-mx_status_t trace_register_observer(mx_handle_t event);
+// Returns |ZX_OK| if successful.
+// Returns |ZX_ERR_INVALID_ARGS| if the event was already registered.
+zx_status_t trace_register_observer(zx_handle_t event);
 
 // Unregisters the observer event handle previously registered with
 // |trace_register_observer|.
 //
-// Returns |MX_OK| if successful.
-// Returns |MX_ERR_NOT_FOUND| if the event was not previously registered.
-mx_status_t trace_unregister_observer(mx_handle_t event);
+// Returns |ZX_OK| if successful.
+// Returns |ZX_ERR_NOT_FOUND| if the event was not previously registered.
+zx_status_t trace_unregister_observer(zx_handle_t event);
 
 __END_CDECLS
 
diff --git a/system/ulib/trace-engine/include/trace-engine/types.h b/system/ulib/trace-engine/include/trace-engine/types.h
index 94c8dbf..9d12da9 100644
--- a/system/ulib/trace-engine/include/trace-engine/types.h
+++ b/system/ulib/trace-engine/include/trace-engine/types.h
@@ -12,14 +12,14 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <magenta/assert.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/assert.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 
 __BEGIN_CDECLS
 
-// Timebase recorded into trace files, as returned by mx_ticks_get().
+// Timebase recorded into trace files, as returned by zx_ticks_get().
 typedef uint64_t trace_ticks_t;
 
 // The ids used to correlate related counters, asynchronous operations, and flows.
@@ -38,7 +38,7 @@
 } trace_scope_t;
 
 // Thread states used to describe context switches.
-// Use the |MX_THREAD_STATE_XXX| values defined in <magenta/syscalls/object.h>.
+// Use the |ZX_THREAD_STATE_XXX| values defined in <zircon/syscalls/object.h>.
 typedef uint32_t trace_thread_state_t;
 
 // Identifies a particular CPU in a context switch trace record.
@@ -110,7 +110,7 @@
     if (!length)
         return trace_make_empty_string_ref();
 
-    MX_DEBUG_ASSERT(string != NULL);
+    ZX_DEBUG_ASSERT(string != NULL);
     if (length > TRACE_ENCODED_STRING_REF_MAX_LENGTH)
         length = TRACE_ENCODED_STRING_REF_MAX_LENGTH;
     trace_string_ref_t ref = {
@@ -131,7 +131,7 @@
 // The |index| must be >= |TRACE_ENCODED_STRING_REF_MIN_INDEX|
 // and <= |TRACE_ENCODED_STRING_REF_MAX_INDEX|.
 inline trace_string_ref_t trace_make_indexed_string_ref(trace_string_index_t index) {
-    MX_DEBUG_ASSERT(index >= TRACE_ENCODED_STRING_REF_MIN_INDEX &&
+    ZX_DEBUG_ASSERT(index >= TRACE_ENCODED_STRING_REF_MIN_INDEX &&
                     index <= TRACE_ENCODED_STRING_REF_MAX_INDEX);
     trace_string_ref_t ref = {
         .encoded_value = index,
@@ -142,15 +142,15 @@
 // A thread reference which is either encoded inline or indirectly by thread table index.
 typedef struct trace_thread_ref {
     trace_encoded_thread_ref_t encoded_value;
-    mx_koid_t inline_process_koid;
-    mx_koid_t inline_thread_koid;
+    zx_koid_t inline_process_koid;
+    zx_koid_t inline_thread_koid;
 } trace_thread_ref_t;
 
 // Returns true if the thread ref's value is unknown.
 inline bool trace_is_unknown_thread_ref(const trace_thread_ref_t* thread_ref) {
     return thread_ref->encoded_value == TRACE_ENCODED_THREAD_REF_INLINE &&
-           thread_ref->inline_process_koid == MX_KOID_INVALID &&
-           thread_ref->inline_thread_koid == MX_KOID_INVALID;
+           thread_ref->inline_process_koid == ZX_KOID_INVALID &&
+           thread_ref->inline_thread_koid == ZX_KOID_INVALID;
 }
 
 // Returns true if the thread ref's content is stored as an index into the thread table.
@@ -162,8 +162,8 @@
 // Returns true if the thread ref's value is stored inline (rather than unknown or indexed).
 inline bool trace_is_inline_thread_ref(const trace_thread_ref_t* thread_ref) {
     return thread_ref->encoded_value == TRACE_ENCODED_THREAD_REF_INLINE &&
-           (thread_ref->inline_process_koid != MX_KOID_INVALID ||
-            thread_ref->inline_thread_koid != MX_KOID_INVALID);
+           (thread_ref->inline_process_koid != ZX_KOID_INVALID ||
+            thread_ref->inline_thread_koid != ZX_KOID_INVALID);
 }
 
 // Makes a thread ref representing an unknown thread.
@@ -172,17 +172,17 @@
 inline trace_thread_ref_t trace_make_unknown_thread_ref(void) {
     trace_thread_ref_t ref = {
         .encoded_value = TRACE_ENCODED_THREAD_REF_INLINE,
-        .inline_process_koid = MX_KOID_INVALID,
-        .inline_thread_koid = MX_KOID_INVALID};
+        .inline_process_koid = ZX_KOID_INVALID,
+        .inline_thread_koid = ZX_KOID_INVALID};
     return ref;
 }
 
 // Makes a thread ref with an inline value.
 // The process and thread koids must not both be invalid.
-inline trace_thread_ref_t trace_make_inline_thread_ref(mx_koid_t process_koid,
-                                                       mx_koid_t thread_koid) {
-    MX_DEBUG_ASSERT(process_koid != MX_KOID_INVALID ||
-                    thread_koid != MX_KOID_INVALID);
+inline trace_thread_ref_t trace_make_inline_thread_ref(zx_koid_t process_koid,
+                                                       zx_koid_t thread_koid) {
+    ZX_DEBUG_ASSERT(process_koid != ZX_KOID_INVALID ||
+                    thread_koid != ZX_KOID_INVALID);
     trace_thread_ref_t ref = {
         .encoded_value = TRACE_ENCODED_THREAD_REF_INLINE,
         .inline_process_koid = process_koid,
@@ -194,12 +194,12 @@
 // The index must be >= |TRACE_ENCODED_THREAD_REF_MIN_INDEX|
 // and <= |TRACE_ENCODED_THREAD_REF_MAX_INDEX|.
 inline trace_thread_ref_t trace_make_indexed_thread_ref(trace_thread_index_t index) {
-    MX_DEBUG_ASSERT(index >= TRACE_ENCODED_THREAD_REF_MIN_INDEX &&
+    ZX_DEBUG_ASSERT(index >= TRACE_ENCODED_THREAD_REF_MIN_INDEX &&
                     index <= TRACE_ENCODED_THREAD_REF_MAX_INDEX);
     trace_thread_ref_t ref = {
         .encoded_value = (trace_encoded_thread_ref_t)index,
-        .inline_process_koid = MX_KOID_INVALID,
-        .inline_thread_koid = MX_KOID_INVALID};
+        .inline_process_koid = ZX_KOID_INVALID,
+        .inline_thread_koid = ZX_KOID_INVALID};
     return ref;
 }
 
@@ -232,7 +232,7 @@
         double double_value;
         trace_string_ref_t string_value_ref;
         uintptr_t pointer_value;
-        mx_koid_t koid_value;
+        zx_koid_t koid_value;
         uintptr_t reserved_for_future_expansion[2];
     };
 } trace_arg_value_t;
@@ -293,7 +293,7 @@
 }
 
 // Makes a koid argument value.
-inline trace_arg_value_t trace_make_koid_arg_value(mx_koid_t value) {
+inline trace_arg_value_t trace_make_koid_arg_value(zx_koid_t value) {
     trace_arg_value_t arg_value = {.type = TRACE_ARG_KOID,
                                    {.koid_value = value}};
     return arg_value;
@@ -379,12 +379,12 @@
 
 // Thread states used to describe context switches.
 enum class ThreadState {
-    kNew = MX_THREAD_STATE_NEW,
-    kRunning = MX_THREAD_STATE_RUNNING,
-    kSuspended = MX_THREAD_STATE_SUSPENDED,
-    kBlocked = MX_THREAD_STATE_BLOCKED,
-    kDying = MX_THREAD_STATE_DYING,
-    kDead = MX_THREAD_STATE_DEAD,
+    kNew = ZX_THREAD_STATE_NEW,
+    kRunning = ZX_THREAD_STATE_RUNNING,
+    kSuspended = ZX_THREAD_STATE_SUSPENDED,
+    kBlocked = ZX_THREAD_STATE_BLOCKED,
+    kDying = ZX_THREAD_STATE_DYING,
+    kDead = ZX_THREAD_STATE_DEAD,
 };
 
 using ArgumentHeader = uint64_t;
diff --git a/system/ulib/trace-engine/rules.mk b/system/ulib/trace-engine/rules.mk
index 810ab4f..3aa3fb5 100644
--- a/system/ulib/trace-engine/rules.mk
+++ b/system/ulib/trace-engine/rules.mk
@@ -18,12 +18,12 @@
 
 MODULE_STATIC_LIBS := \
     system/ulib/async \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta
+    system/ulib/zircon
 
 include make/module.mk
diff --git a/system/ulib/trace-provider/BUILD.gn b/system/ulib/trace-provider/BUILD.gn
index 461ddba..3d8c6c9 100644
--- a/system/ulib/trace-provider/BUILD.gn
+++ b/system/ulib/trace-provider/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 source_set("trace-provider") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "handler_impl.cpp",
     "handler_impl.h",
@@ -17,7 +17,7 @@
   ]
 
   public_deps = [
-    "//magenta/system/ulib/trace",
+    "//zircon/system/ulib/trace",
   ]
 
   public_configs = [ ":trace_config" ]
diff --git a/system/ulib/trace-provider/handler_impl.cpp b/system/ulib/trace-provider/handler_impl.cpp
index 88d63f5..a1ed551 100644
--- a/system/ulib/trace-provider/handler_impl.cpp
+++ b/system/ulib/trace-provider/handler_impl.cpp
@@ -4,57 +4,57 @@
 
 #include "handler_impl.h"
 
-#include <magenta/assert.h>
-#include <magenta/syscalls.h>
+#include <zircon/assert.h>
+#include <zircon/syscalls.h>
 
-#include <mx/vmar.h>
+#include <zx/vmar.h>
 #include <fbl/type_support.h>
 
 namespace trace {
 namespace internal {
 
 TraceHandlerImpl::TraceHandlerImpl(void* buffer, size_t buffer_num_bytes,
-                                   mx::eventpair fence)
+                                   zx::eventpair fence)
     : buffer_(buffer), buffer_num_bytes_(buffer_num_bytes), fence_(fbl::move(fence)) {}
 
 TraceHandlerImpl::~TraceHandlerImpl() {
-    mx_status_t status = mx::vmar::root_self().unmap(
+    zx_status_t status = zx::vmar::root_self().unmap(
         reinterpret_cast<uintptr_t>(buffer_), buffer_num_bytes_);
-    MX_DEBUG_ASSERT(status == MX_OK);
+    ZX_DEBUG_ASSERT(status == ZX_OK);
 }
 
-mx_status_t TraceHandlerImpl::StartEngine(async_t* async,
-                                          mx::vmo buffer, mx::eventpair fence) {
-    MX_DEBUG_ASSERT(buffer);
-    MX_DEBUG_ASSERT(fence);
+zx_status_t TraceHandlerImpl::StartEngine(async_t* async,
+                                          zx::vmo buffer, zx::eventpair fence) {
+    ZX_DEBUG_ASSERT(buffer);
+    ZX_DEBUG_ASSERT(fence);
 
     uint64_t buffer_num_bytes;
-    mx_status_t status = buffer.get_size(&buffer_num_bytes);
-    if (status != MX_OK)
+    zx_status_t status = buffer.get_size(&buffer_num_bytes);
+    if (status != ZX_OK)
         return status;
 
     uintptr_t buffer_ptr;
-    status = mx::vmar::root_self().map(
+    status = zx::vmar::root_self().map(
         0u, buffer, 0u, buffer_num_bytes,
-        MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &buffer_ptr);
-    if (status != MX_OK)
+        ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &buffer_ptr);
+    if (status != ZX_OK)
         return status;
 
     auto handler = new TraceHandlerImpl(reinterpret_cast<void*>(buffer_ptr),
                                         buffer_num_bytes, fbl::move(fence));
     status = trace_start_engine(async, handler,
                                 handler->buffer_, handler->buffer_num_bytes_);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         delete handler;
         return status;
     }
 
     // The handler will be destroyed in |TraceStopped()|.
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t TraceHandlerImpl::StopEngine() {
-    return trace_stop_engine(MX_OK);
+zx_status_t TraceHandlerImpl::StopEngine() {
+    return trace_stop_engine(ZX_OK);
 }
 
 bool TraceHandlerImpl::IsCategoryEnabled(const char* category) {
@@ -62,7 +62,7 @@
     return true;
 }
 
-void TraceHandlerImpl::TraceStopped(async_t* async, mx_status_t disposition,
+void TraceHandlerImpl::TraceStopped(async_t* async, zx_status_t disposition,
                                     size_t buffer_bytes_written) {
     // TODO: Report the disposition and bytes written back to the tracing system
     // so it has a better idea of what happened.
diff --git a/system/ulib/trace-provider/handler_impl.h b/system/ulib/trace-provider/handler_impl.h
index 58b22c8..19db9bc 100644
--- a/system/ulib/trace-provider/handler_impl.h
+++ b/system/ulib/trace-provider/handler_impl.h
@@ -6,8 +6,8 @@
 
 #include <trace/handler.h>
 
-#include <mx/eventpair.h>
-#include <mx/vmo.h>
+#include <zx/eventpair.h>
+#include <zx/vmo.h>
 #include <fbl/macros.h>
 
 namespace trace {
@@ -15,21 +15,21 @@
 
 class TraceHandlerImpl final : public trace::TraceHandler {
 public:
-    static mx_status_t StartEngine(async_t* async, mx::vmo buffer, mx::eventpair fence);
-    static mx_status_t StopEngine();
+    static zx_status_t StartEngine(async_t* async, zx::vmo buffer, zx::eventpair fence);
+    static zx_status_t StopEngine();
 
 private:
-    TraceHandlerImpl(void* buffer, size_t buffer_num_bytes, mx::eventpair fence);
+    TraceHandlerImpl(void* buffer, size_t buffer_num_bytes, zx::eventpair fence);
     ~TraceHandlerImpl() override;
 
     // |trace::TraceHandler|
     bool IsCategoryEnabled(const char* category) override;
     void TraceStopped(async_t* async,
-                      mx_status_t disposition, size_t buffer_bytes_written) override;
+                      zx_status_t disposition, size_t buffer_bytes_written) override;
 
     void* buffer_;
     size_t buffer_num_bytes_;
-    mx::eventpair fence_;
+    zx::eventpair fence_;
 
     DISALLOW_COPY_ASSIGN_AND_MOVE(TraceHandlerImpl);
 };
diff --git a/system/ulib/trace-provider/include/trace-provider/provider.h b/system/ulib/trace-provider/include/trace-provider/provider.h
index aaeeb35..9c8cd91 100644
--- a/system/ulib/trace-provider/include/trace-provider/provider.h
+++ b/system/ulib/trace-provider/include/trace-provider/provider.h
@@ -8,7 +8,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include <async/dispatcher.h>
 
@@ -56,7 +56,7 @@
     }
 
     // Returns true if the trace provider was created successfully.
-    mx_status_t is_valid() const {
+    zx_status_t is_valid() const {
         return provider_ != nullptr;
     }
 
diff --git a/system/ulib/trace-provider/provider_impl.cpp b/system/ulib/trace-provider/provider_impl.cpp
index 90fdaee..60e3160 100644
--- a/system/ulib/trace-provider/provider_impl.cpp
+++ b/system/ulib/trace-provider/provider_impl.cpp
@@ -4,10 +4,10 @@
 
 #include "provider_impl.h"
 
-#include <magenta/assert.h>
-#include <magenta/syscalls.h>
+#include <zircon/assert.h>
+#include <zircon/syscalls.h>
 
-#include <mxio/util.h>
+#include <fdio/util.h>
 #include <fbl/algorithm.h>
 #include <fbl/type_support.h>
 
@@ -57,19 +57,19 @@
 namespace trace {
 namespace internal {
 
-TraceProviderImpl::TraceProviderImpl(async_t* async, mx::channel channel)
+TraceProviderImpl::TraceProviderImpl(async_t* async, zx::channel channel)
     : async_(async), connection_(this, fbl::move(channel)) {
 }
 
 TraceProviderImpl::~TraceProviderImpl() = default;
 
-bool TraceProviderImpl::Start(mx::vmo buffer, mx::eventpair fence) {
+bool TraceProviderImpl::Start(zx::vmo buffer, zx::eventpair fence) {
     if (running_)
         return false;
 
-    mx_status_t status = TraceHandlerImpl::StartEngine(
+    zx_status_t status = TraceHandlerImpl::StartEngine(
         async_, fbl::move(buffer), fbl::move(fence));
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return false;
 
     running_ = true;
@@ -85,14 +85,14 @@
 }
 
 TraceProviderImpl::Connection::Connection(TraceProviderImpl* impl,
-                                          mx::channel channel)
+                                          zx::channel channel)
     : impl_(impl), channel_(fbl::move(channel)),
       wait_(channel_.get(),
-            MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED) {
+            ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED) {
     wait_.set_handler(fbl::BindMember(this, &Connection::Handle));
 
-    mx_status_t status = wait_.Begin(impl_->async_);
-    MX_DEBUG_ASSERT(status == MX_OK || status == MX_ERR_BAD_STATE);
+    zx_status_t status = wait_.Begin(impl_->async_);
+    ZX_DEBUG_ASSERT(status == ZX_OK || status == ZX_ERR_BAD_STATE);
 }
 
 TraceProviderImpl::Connection::~Connection() {
@@ -100,18 +100,18 @@
 }
 
 async_wait_result_t TraceProviderImpl::Connection::Handle(
-    async_t* async, mx_status_t status, const mx_packet_signal_t* signal) {
-    if (status != MX_OK) {
+    async_t* async, zx_status_t status, const zx_packet_signal_t* signal) {
+    if (status != ZX_OK) {
         printf("TraceProvider wait failed: status=%d\n", status);
         return ASYNC_WAIT_FINISHED;
     }
 
-    if (signal->observed & MX_CHANNEL_READABLE) {
+    if (signal->observed & ZX_CHANNEL_READABLE) {
         if (ReadMessage())
             return ASYNC_WAIT_AGAIN;
         printf("TraceProvider received invalid FIDL message or failed to send reply.\n");
     } else {
-        MX_DEBUG_ASSERT(signal->observed & MX_CHANNEL_PEER_CLOSED);
+        ZX_DEBUG_ASSERT(signal->observed & ZX_CHANNEL_PEER_CLOSED);
     }
 
     Close();
@@ -122,16 +122,16 @@
     // Using handrolled FIDL.
 
     uint8_t buffer[16 * 1024];
-    mx_handle_t unowned_handles[2];
+    zx_handle_t unowned_handles[2];
     uint32_t num_bytes = 0u;
     uint32_t num_handles = 0u;
-    mx_status_t status = channel_.read(
+    zx_status_t status = channel_.read(
         0u, buffer, sizeof(buffer), &num_bytes,
         unowned_handles, fbl::count_of(unowned_handles), &num_handles);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return false;
 
-    mx::handle handles[2];
+    zx::handle handles[2];
     for (size_t i = 0; i < num_handles; i++) {
         handles[i].reset(unowned_handles[i]); // take ownership
     }
@@ -177,8 +177,8 @@
             return false;
 
         bool success = impl_->Start(
-            mx::vmo(fbl::move(handles[s->buffer])),
-            mx::eventpair(fbl::move(handles[s->fence])));
+            zx::vmo(fbl::move(handles[s->buffer])),
+            zx::eventpair(fbl::move(handles[s->fence])));
 
         // Send reply.
         struct {
@@ -194,7 +194,7 @@
         reply.m.version = 0;
         reply.m.success = success ? 1 : 0;
         status = channel_.write(0u, &reply, sizeof(reply), nullptr, 0u);
-        if (status != MX_OK)
+        if (status != ZX_OK)
             return false;
         return true;
     }
@@ -222,30 +222,30 @@
 } // namespace trace
 
 trace_provider_t* trace_provider_create(async_t* async) {
-    MX_DEBUG_ASSERT(async);
+    ZX_DEBUG_ASSERT(async);
 
     // Connect to the trace registry.
-    mx::channel registry_client;
-    mx::channel registry_service;
-    mx_status_t status = mx::channel::create(0u, &registry_client, &registry_service);
-    if (status != MX_OK)
+    zx::channel registry_client;
+    zx::channel registry_service;
+    zx_status_t status = zx::channel::create(0u, &registry_client, &registry_service);
+    if (status != ZX_OK)
         return nullptr;
 
-    status = mxio_service_connect("/svc/tracing::TraceRegistry",
+    status = fdio_service_connect("/svc/tracing::TraceRegistry",
                                   registry_service.release()); // takes ownership
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return nullptr;
 
     // Create the channel to which we will bind the trace provider.
-    mx::channel provider_client;
-    mx::channel provider_service;
-    status = mx::channel::create(0u, &provider_client, &provider_service);
-    if (status != MX_OK)
+    zx::channel provider_client;
+    zx::channel provider_service;
+    status = zx::channel::create(0u, &provider_client, &provider_service);
+    if (status != ZX_OK)
         return nullptr;
 
     // Invoke TraceRegistry::RegisterTraceProvider(TraceProvider provider, string? label)
     // TODO(MG-1036): We currently set the label to null.  Once tracing fully migrates
-    // to Magenta and we publish the provider via the hub we will no longer need to
+    // to Zircon and we publish the provider via the hub we will no longer need to
     // specify a label at all since we will be able to identify providers based on their
     // path within the hub's directory structure.
     struct {
@@ -260,10 +260,10 @@
     call.m.version = 0;
     call.m.provider = 0;
     call.m.label = 0;
-    mx_handle_t handles[] = {provider_client.release()};
+    zx_handle_t handles[] = {provider_client.release()};
     status = registry_client.write(0u, &call, sizeof(call),
                                    handles, fbl::count_of(handles));
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         provider_client.reset(handles[0]); // take back ownership after failure
         return nullptr;
     }
@@ -272,6 +272,6 @@
 }
 
 void trace_provider_destroy(trace_provider_t* provider) {
-    MX_DEBUG_ASSERT(provider);
+    ZX_DEBUG_ASSERT(provider);
     delete static_cast<trace::internal::TraceProviderImpl*>(provider);
 }
diff --git a/system/ulib/trace-provider/provider_impl.h b/system/ulib/trace-provider/provider_impl.h
index c245dad..7a17f72 100644
--- a/system/ulib/trace-provider/provider_impl.h
+++ b/system/ulib/trace-provider/provider_impl.h
@@ -5,9 +5,9 @@
 #pragma once
 
 #include <async/wait.h>
-#include <mx/channel.h>
-#include <mx/eventpair.h>
-#include <mx/vmo.h>
+#include <zx/channel.h>
+#include <zx/eventpair.h>
+#include <zx/vmo.h>
 #include <fbl/macros.h>
 #include <trace-provider/provider.h>
 
@@ -19,29 +19,29 @@
 
 class TraceProviderImpl final : public trace_provider_t {
 public:
-    TraceProviderImpl(async_t* async, mx::channel channel);
+    TraceProviderImpl(async_t* async, zx::channel channel);
     ~TraceProviderImpl();
 
 private:
     class Connection final {
     public:
-        Connection(TraceProviderImpl* impl, mx::channel channel);
+        Connection(TraceProviderImpl* impl, zx::channel channel);
         ~Connection();
 
     private:
         async_wait_result_t Handle(async_t* async,
-                                   mx_status_t status,
-                                   const mx_packet_signal_t* signal);
+                                   zx_status_t status,
+                                   const zx_packet_signal_t* signal);
 
         bool ReadMessage();
         void Close();
 
         TraceProviderImpl* const impl_;
-        mx::channel channel_;
+        zx::channel channel_;
         async::Wait wait_;
     };
 
-    bool Start(mx::vmo buffer, mx::eventpair fence);
+    bool Start(zx::vmo buffer, zx::eventpair fence);
     void Stop();
 
     async_t* const async_;
diff --git a/system/ulib/trace-provider/rules.mk b/system/ulib/trace-provider/rules.mk
index 57e778f..e3f3ee0 100644
--- a/system/ulib/trace-provider/rules.mk
+++ b/system/ulib/trace-provider/rules.mk
@@ -15,13 +15,13 @@
 MODULE_STATIC_LIBS := \
     system/ulib/trace \
     system/ulib/async \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/trace-engine
 
 include make/module.mk
diff --git a/system/ulib/trace-reader/BUILD.gn b/system/ulib/trace-reader/BUILD.gn
index c79c64b..30f77ea 100644
--- a/system/ulib/trace-reader/BUILD.gn
+++ b/system/ulib/trace-reader/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 source_set("trace-provider") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "include/trace-reader/reader.h",
     "include/trace-reader/records.h",
@@ -16,7 +16,7 @@
   ]
 
   public_deps = [
-    "//magenta/system/ulib/fbl",
+    "//zircon/system/ulib/fbl",
   ]
 
   public_configs = [ ":trace_config" ]
diff --git a/system/ulib/trace-reader/include/trace-reader/records.h b/system/ulib/trace-reader/include/trace-reader/records.h
index aa2c394..5f54493 100644
--- a/system/ulib/trace-reader/include/trace-reader/records.h
+++ b/system/ulib/trace-reader/include/trace-reader/records.h
@@ -6,10 +6,10 @@
 
 #include <stdint.h>
 
-#include <magenta/assert.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/assert.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 
 #include <fbl/macros.h>
 #include <fbl/new.h>
@@ -25,8 +25,8 @@
 class ProcessThread final {
 public:
     constexpr ProcessThread()
-        : process_koid_(MX_KOID_INVALID), thread_koid_(MX_KOID_INVALID) {}
-    constexpr explicit ProcessThread(mx_koid_t process_koid, mx_koid_t thread_koid)
+        : process_koid_(ZX_KOID_INVALID), thread_koid_(ZX_KOID_INVALID) {}
+    constexpr explicit ProcessThread(zx_koid_t process_koid, zx_koid_t thread_koid)
         : process_koid_(process_koid), thread_koid_(thread_koid) {}
     constexpr ProcessThread(const ProcessThread& other)
         : process_koid_(other.process_koid_), thread_koid_(other.thread_koid_) {}
@@ -51,8 +51,8 @@
         return thread_koid_ < other.thread_koid_;
     }
 
-    constexpr mx_koid_t process_koid() const { return process_koid_; }
-    constexpr mx_koid_t thread_koid() const { return thread_koid_; }
+    constexpr zx_koid_t process_koid() const { return process_koid_; }
+    constexpr zx_koid_t thread_koid() const { return thread_koid_; }
 
     ProcessThread& operator=(const ProcessThread& other) {
         process_koid_ = other.process_koid_;
@@ -63,8 +63,8 @@
     fbl::String ToString() const;
 
 private:
-    mx_koid_t process_koid_;
-    mx_koid_t thread_koid_;
+    zx_koid_t process_koid_;
+    zx_koid_t thread_koid_;
 };
 
 // A typed argument value.
@@ -94,7 +94,7 @@
         return ArgumentValue(PointerTag(), value);
     }
 
-    static ArgumentValue MakeKoid(mx_koid_t value) {
+    static ArgumentValue MakeKoid(zx_koid_t value) {
         return ArgumentValue(KoidTag(), value);
     }
 
@@ -111,42 +111,42 @@
     ArgumentType type() const { return type_; }
 
     int32_t GetInt32() const {
-        MX_DEBUG_ASSERT(type_ == ArgumentType::kInt32);
+        ZX_DEBUG_ASSERT(type_ == ArgumentType::kInt32);
         return int32_;
     }
 
     uint32_t GetUint32() const {
-        MX_DEBUG_ASSERT(type_ == ArgumentType::kUint32);
+        ZX_DEBUG_ASSERT(type_ == ArgumentType::kUint32);
         return uint32_;
     }
 
     int64_t GetInt64() const {
-        MX_DEBUG_ASSERT(type_ == ArgumentType::kInt64);
+        ZX_DEBUG_ASSERT(type_ == ArgumentType::kInt64);
         return int64_;
     }
 
     uint64_t GetUint64() const {
-        MX_DEBUG_ASSERT(type_ == ArgumentType::kUint64);
+        ZX_DEBUG_ASSERT(type_ == ArgumentType::kUint64);
         return uint64_;
     }
 
     double GetDouble() const {
-        MX_DEBUG_ASSERT(type_ == ArgumentType::kDouble);
+        ZX_DEBUG_ASSERT(type_ == ArgumentType::kDouble);
         return double_;
     }
 
     const fbl::String& GetString() const {
-        MX_DEBUG_ASSERT(type_ == ArgumentType::kString);
+        ZX_DEBUG_ASSERT(type_ == ArgumentType::kString);
         return string_;
     }
 
     uint64_t GetPointer() const {
-        MX_DEBUG_ASSERT(type_ == ArgumentType::kPointer);
+        ZX_DEBUG_ASSERT(type_ == ArgumentType::kPointer);
         return pointer_;
     }
 
-    mx_koid_t GetKoid() const {
-        MX_DEBUG_ASSERT(type_ == ArgumentType::kKoid);
+    zx_koid_t GetKoid() const {
+        ZX_DEBUG_ASSERT(type_ == ArgumentType::kKoid);
         return koid_;
     }
 
@@ -182,7 +182,7 @@
     explicit ArgumentValue(PointerTag, uint64_t pointer)
         : type_(ArgumentType::kPointer), pointer_(pointer) {}
 
-    explicit ArgumentValue(KoidTag, mx_koid_t koid)
+    explicit ArgumentValue(KoidTag, zx_koid_t koid)
         : type_(ArgumentType::kKoid), koid_(koid) {}
 
     void Destroy();
@@ -197,7 +197,7 @@
         double double_;
         fbl::String string_;
         uint64_t pointer_;
-        mx_koid_t koid_;
+        zx_koid_t koid_;
     };
 
     DISALLOW_COPY_AND_ASSIGN_ALLOW_MOVE(ArgumentValue);
@@ -252,12 +252,12 @@
           provider_section_(fbl::move(provider_section)) {}
 
     const ProviderInfo& GetProviderInfo() const {
-        MX_DEBUG_ASSERT(type_ == MetadataType::kProviderInfo);
+        ZX_DEBUG_ASSERT(type_ == MetadataType::kProviderInfo);
         return provider_info_;
     };
 
     const ProviderSection& GetProviderSection() const {
-        MX_DEBUG_ASSERT(type_ == MetadataType::kProviderSection);
+        ZX_DEBUG_ASSERT(type_ == MetadataType::kProviderSection);
         return provider_section_;
     }
 
@@ -377,52 +377,52 @@
     }
 
     const Instant& GetInstant() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kInstant);
+        ZX_DEBUG_ASSERT(type_ == EventType::kInstant);
         return instant_;
     }
 
     const Counter& GetCounter() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kCounter);
+        ZX_DEBUG_ASSERT(type_ == EventType::kCounter);
         return counter_;
     }
 
     const DurationBegin& GetDurationBegin() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kDurationBegin);
+        ZX_DEBUG_ASSERT(type_ == EventType::kDurationBegin);
         return duration_begin_;
     }
 
     const DurationEnd& GetDurationEnd() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kDurationEnd);
+        ZX_DEBUG_ASSERT(type_ == EventType::kDurationEnd);
         return duration_end_;
     }
 
     const AsyncBegin& GetAsyncBegin() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kAsyncBegin);
+        ZX_DEBUG_ASSERT(type_ == EventType::kAsyncBegin);
         return async_begin_;
     };
 
     const AsyncInstant& GetAsyncInstant() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kAsyncInstant);
+        ZX_DEBUG_ASSERT(type_ == EventType::kAsyncInstant);
         return async_instant_;
     }
 
     const AsyncEnd& GetAsyncEnd() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kAsyncEnd);
+        ZX_DEBUG_ASSERT(type_ == EventType::kAsyncEnd);
         return async_end_;
     }
 
     const FlowBegin& GetFlowBegin() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kFlowBegin);
+        ZX_DEBUG_ASSERT(type_ == EventType::kFlowBegin);
         return flow_begin_;
     }
 
     const FlowStep& GetFlowStep() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kFlowStep);
+        ZX_DEBUG_ASSERT(type_ == EventType::kFlowStep);
         return flow_step_;
     }
 
     const FlowEnd& GetFlowEnd() const {
-        MX_DEBUG_ASSERT(type_ == EventType::kFlowEnd);
+        ZX_DEBUG_ASSERT(type_ == EventType::kFlowEnd);
         return flow_end_;
     }
 
@@ -490,8 +490,8 @@
 
     // Kernel Object record data.
     struct KernelObject {
-        mx_koid_t koid;
-        mx_obj_type_t object_type;
+        zx_koid_t koid;
+        zx_obj_type_t object_type;
         fbl::String name;
         fbl::Vector<Argument> arguments;
     };
@@ -559,42 +559,42 @@
     }
 
     const Metadata& GetMetadata() const {
-        MX_DEBUG_ASSERT(type_ == RecordType::kMetadata);
+        ZX_DEBUG_ASSERT(type_ == RecordType::kMetadata);
         return metadata_;
     }
 
     const Initialization& GetInitialization() const {
-        MX_DEBUG_ASSERT(type_ == RecordType::kInitialization);
+        ZX_DEBUG_ASSERT(type_ == RecordType::kInitialization);
         return initialization_;
     }
 
     const String& GetString() const {
-        MX_DEBUG_ASSERT(type_ == RecordType::kString);
+        ZX_DEBUG_ASSERT(type_ == RecordType::kString);
         return string_;
     }
 
     const Thread& GetThread() const {
-        MX_DEBUG_ASSERT(type_ == RecordType::kThread);
+        ZX_DEBUG_ASSERT(type_ == RecordType::kThread);
         return thread_;
     };
 
     const Event& GetEvent() const {
-        MX_DEBUG_ASSERT(type_ == RecordType::kEvent);
+        ZX_DEBUG_ASSERT(type_ == RecordType::kEvent);
         return event_;
     }
 
     const KernelObject& GetKernelObject() const {
-        MX_DEBUG_ASSERT(type_ == RecordType::kKernelObject);
+        ZX_DEBUG_ASSERT(type_ == RecordType::kKernelObject);
         return kernel_object_;
     }
 
     const ContextSwitch& GetContextSwitch() const {
-        MX_DEBUG_ASSERT(type_ == RecordType::kContextSwitch);
+        ZX_DEBUG_ASSERT(type_ == RecordType::kContextSwitch);
         return context_switch_;
     }
 
     const Log& GetLog() const {
-        MX_DEBUG_ASSERT(type_ == RecordType::kLog);
+        ZX_DEBUG_ASSERT(type_ == RecordType::kLog);
         return log_;
     }
 
diff --git a/system/ulib/trace-reader/reader.cpp b/system/ulib/trace-reader/reader.cpp
index 054804d..8379163 100644
--- a/system/ulib/trace-reader/reader.cpp
+++ b/system/ulib/trace-reader/reader.cpp
@@ -26,7 +26,7 @@
             ReportError("Unexpected record of size 0");
             return false; // fatal error
         }
-        MX_DEBUG_ASSERT(size <= RecordFields::kMaxRecordSizeWords);
+        ZX_DEBUG_ASSERT(size <= RecordFields::kMaxRecordSizeWords);
 
         Chunk record;
         if (!chunk.ReadChunk(size - 1, &record))
@@ -166,7 +166,7 @@
         return false;
     }
 
-    mx_koid_t process_koid, thread_koid;
+    zx_koid_t process_koid, thread_koid;
     if (!record.ReadUint64(&process_koid) ||
         !record.ReadUint64(&thread_koid))
         return false;
@@ -296,13 +296,13 @@
 
 bool TraceReader::ReadKernelObjectRecord(Chunk& record, RecordHeader header) {
     auto object_type =
-        KernelObjectRecordFields::ObjectType::Get<mx_obj_type_t>(header);
+        KernelObjectRecordFields::ObjectType::Get<zx_obj_type_t>(header);
     auto name_ref =
         KernelObjectRecordFields::NameStringRef::Get<trace_encoded_string_ref_t>(header);
     auto argument_count =
         KernelObjectRecordFields::ArgumentCount::Get<size_t>(header);
 
-    mx_koid_t koid;
+    zx_koid_t koid;
     fbl::String name;
     fbl::Vector<Argument> arguments;
     if (!record.ReadUint64(&koid) ||
@@ -459,7 +459,7 @@
             break;
         }
         case ArgumentType::kKoid: {
-            mx_koid_t value;
+            zx_koid_t value;
             if (!arg.ReadUint64(&value)) {
                 ReportError("Failed to read koid argument value");
                 return false;
@@ -506,7 +506,7 @@
 }
 
 void TraceReader::RegisterString(trace_string_index_t index, fbl::String string) {
-    MX_DEBUG_ASSERT(index >= TRACE_ENCODED_STRING_REF_MIN_INDEX &&
+    ZX_DEBUG_ASSERT(index >= TRACE_ENCODED_STRING_REF_MIN_INDEX &&
                     index <= TRACE_ENCODED_STRING_REF_MAX_INDEX);
 
     auto entry = fbl::make_unique<StringTableEntry>(index, string);
@@ -515,7 +515,7 @@
 
 void TraceReader::RegisterThread(trace_thread_index_t index,
                                  const ProcessThread& process_thread) {
-    MX_DEBUG_ASSERT(index >= TRACE_ENCODED_THREAD_REF_MIN_INDEX &&
+    ZX_DEBUG_ASSERT(index >= TRACE_ENCODED_THREAD_REF_MIN_INDEX &&
                     index <= TRACE_ENCODED_THREAD_REF_MAX_INDEX);
 
     auto entry = fbl::make_unique<ThreadTableEntry>(index, process_thread);
@@ -555,7 +555,7 @@
                                   trace_encoded_thread_ref_t thread_ref,
                                   ProcessThread* out_process_thread) const {
     if (thread_ref == TRACE_ENCODED_THREAD_REF_INLINE) {
-        mx_koid_t process_koid, thread_koid;
+        zx_koid_t process_koid, thread_koid;
         if (!chunk.ReadUint64(&process_koid) ||
             !chunk.ReadUint64(&thread_koid)) {
             ReportError("Could not read inline process and thread");
diff --git a/system/ulib/trace-reader/records.cpp b/system/ulib/trace-reader/records.cpp
index ef0cfff..0d487c6 100644
--- a/system/ulib/trace-reader/records.cpp
+++ b/system/ulib/trace-reader/records.cpp
@@ -42,45 +42,45 @@
     return "???";
 }
 
-const char* ObjectTypeToString(mx_obj_type_t type) {
-    static_assert(MX_OBJ_TYPE_LAST == 23, "need to update switch below");
+const char* ObjectTypeToString(zx_obj_type_t type) {
+    static_assert(ZX_OBJ_TYPE_LAST == 23, "need to update switch below");
 
     switch (type) {
-    case MX_OBJ_TYPE_PROCESS:
+    case ZX_OBJ_TYPE_PROCESS:
         return "process";
-    case MX_OBJ_TYPE_THREAD:
+    case ZX_OBJ_TYPE_THREAD:
         return "thread";
-    case MX_OBJ_TYPE_VMO:
+    case ZX_OBJ_TYPE_VMO:
         return "vmo";
-    case MX_OBJ_TYPE_CHANNEL:
+    case ZX_OBJ_TYPE_CHANNEL:
         return "channel";
-    case MX_OBJ_TYPE_EVENT:
+    case ZX_OBJ_TYPE_EVENT:
         return "event";
-    case MX_OBJ_TYPE_PORT:
+    case ZX_OBJ_TYPE_PORT:
         return "port";
-    case MX_OBJ_TYPE_INTERRUPT:
+    case ZX_OBJ_TYPE_INTERRUPT:
         return "interrupt";
-    case MX_OBJ_TYPE_PCI_DEVICE:
+    case ZX_OBJ_TYPE_PCI_DEVICE:
         return "pci-device";
-    case MX_OBJ_TYPE_LOG:
+    case ZX_OBJ_TYPE_LOG:
         return "log";
-    case MX_OBJ_TYPE_SOCKET:
+    case ZX_OBJ_TYPE_SOCKET:
         return "socket";
-    case MX_OBJ_TYPE_RESOURCE:
+    case ZX_OBJ_TYPE_RESOURCE:
         return "resource";
-    case MX_OBJ_TYPE_EVENT_PAIR:
+    case ZX_OBJ_TYPE_EVENT_PAIR:
         return "event-pair";
-    case MX_OBJ_TYPE_JOB:
+    case ZX_OBJ_TYPE_JOB:
         return "job";
-    case MX_OBJ_TYPE_VMAR:
+    case ZX_OBJ_TYPE_VMAR:
         return "vmar";
-    case MX_OBJ_TYPE_FIFO:
+    case ZX_OBJ_TYPE_FIFO:
         return "fifo";
-    case MX_OBJ_TYPE_GUEST:
+    case ZX_OBJ_TYPE_GUEST:
         return "guest";
-    case MX_OBJ_TYPE_VCPU:
+    case ZX_OBJ_TYPE_VCPU:
         return "vcpu";
-    case MX_OBJ_TYPE_TIMER:
+    case ZX_OBJ_TYPE_TIMER:
         return "timer";
     default:
         return "???";
@@ -179,7 +179,7 @@
     case ArgumentType::kKoid:
         return fbl::StringPrintf("koid(%" PRIu64 ")", koid_);
     }
-    MX_ASSERT(false);
+    ZX_ASSERT(false);
 }
 
 fbl::String Argument::ToString() const {
@@ -218,7 +218,7 @@
         return fbl::StringPrintf("ProviderSection(id: %" PRId32 ")",
                                   provider_section_.id);
     }
-    MX_ASSERT(false);
+    ZX_ASSERT(false);
 }
 
 void EventData::Destroy() {
@@ -323,7 +323,7 @@
         return fbl::StringPrintf("FlowEnd(id: %" PRIu64 ")",
                                   flow_end_.id);
     }
-    MX_ASSERT(false);
+    ZX_ASSERT(false);
 }
 
 void Record::Destroy() {
@@ -426,7 +426,7 @@
                                   log_.timestamp, log_.process_thread.ToString().c_str(),
                                   log_.message.c_str());
     }
-    MX_ASSERT(false);
+    ZX_ASSERT(false);
 }
 
 } // namespace trace
diff --git a/system/ulib/trace-reader/rules.mk b/system/ulib/trace-reader/rules.mk
index 90ac54e..2981e2a 100644
--- a/system/ulib/trace-reader/rules.mk
+++ b/system/ulib/trace-reader/rules.mk
@@ -16,7 +16,7 @@
 
 MODULE_STATIC_LIBS := \
     system/ulib/trace-engine \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl
 
 MODULE_LIBS := \
diff --git a/system/ulib/trace/BUILD.gn b/system/ulib/trace/BUILD.gn
index 5298f5b..2b1c7f1 100644
--- a/system/ulib/trace/BUILD.gn
+++ b/system/ulib/trace/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 source_set("trace") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "event.cpp",
     "handler.cpp",
@@ -20,14 +20,14 @@
   ]
 
   libs = [
-    "magenta",
+    "zircon",
     "trace-engine",
   ]
 
   public_deps = [
-    "//magenta/system/ulib/async",
-    "//magenta/system/ulib/mx",
-    "//magenta/system/ulib/fbl",
+    "//zircon/system/ulib/async",
+    "//zircon/system/ulib/zx",
+    "//zircon/system/ulib/fbl",
   ]
 
   public_configs = [ ":trace_config" ]
diff --git a/system/ulib/trace/event.cpp b/system/ulib/trace/event.cpp
index 86d7541..222641b 100644
--- a/system/ulib/trace/event.cpp
+++ b/system/ulib/trace/event.cpp
@@ -4,14 +4,14 @@
 
 #include <trace/event.h>
 
-#include <magenta/assert.h>
-#include <magenta/syscalls.h>
+#include <zircon/assert.h>
+#include <zircon/syscalls.h>
 
 namespace {
 
 struct EventHelper {
     EventHelper(trace_context_t* context, const char* name_literal)
-        : ticks(mx_ticks_get()) {
+        : ticks(zx_ticks_get()) {
         trace_context_register_current_thread(context, &thread_ref);
         trace_context_register_string_literal(context, name_literal, &name_ref);
     }
@@ -153,7 +153,7 @@
 
 void trace_internal_write_kernel_object_record_for_handle_and_release_context(
     trace_context_t* context,
-    mx_handle_t handle,
+    zx_handle_t handle,
     const trace_arg_t* args, size_t num_args) {
     trace_context_write_kernel_object_record_for_handle(
         context, handle, args, num_args);
diff --git a/system/ulib/trace/handler.cpp b/system/ulib/trace/handler.cpp
index 2caebfb..92a2cca 100644
--- a/system/ulib/trace/handler.cpp
+++ b/system/ulib/trace/handler.cpp
@@ -20,7 +20,7 @@
 }
 
 void TraceHandler::CallTraceStopped(trace_handler_t* handler, async_t* async,
-                                    mx_status_t disposition, size_t buffer_bytes_written) {
+                                    zx_status_t disposition, size_t buffer_bytes_written) {
     static_cast<TraceHandler*>(handler)->TraceStopped(async,
                                                       disposition, buffer_bytes_written);
 }
diff --git a/system/ulib/trace/include/trace/event.h b/system/ulib/trace/include/trace/event.h
index 33a278a..7c70a2d 100644
--- a/system/ulib/trace/include/trace/event.h
+++ b/system/ulib/trace/include/trace/event.h
@@ -53,7 +53,7 @@
 //     size_t length = ...;
 //     const char* c_string = ...;
 //     void* ptr = ...;
-//     mx_koid_t koid = ...;
+//     zx_koid_t koid = ...;
 //
 //     TRACE_DURATION("category", "name", "arg", TA_NULL());
 //     TRACE_DURATION("category", "name", "arg", TA_INT32(-10));
@@ -75,7 +75,7 @@
 //     fbl::String fbl_string = ...;
 //     std::string std_string = ...;
 //     void* ptr = ...;
-//     mx_koid_t koid = ...;
+//     zx_koid_t koid = ...;
 //
 //     TRACE_DURATION("category", "name", "arg", nullptr);
 //     TRACE_DURATION("category", "name", "arg", -10);
@@ -435,7 +435,7 @@
 //
 // Usage:
 //
-//     mx_handle_t handle = ...;
+//     zx_handle_t handle = ...;
 //     TRACE_KERNEL_OBJECT(handle, "description", TA_STRING("some object"));
 //
 #define TRACE_KERNEL_OBJECT(handle, args...) \
diff --git a/system/ulib/trace/include/trace/event_internal.h b/system/ulib/trace/include/trace/event_internal.h
index 91ad2ea..b5d4088 100644
--- a/system/ulib/trace/include/trace/event_internal.h
+++ b/system/ulib/trace/include/trace/event_internal.h
@@ -11,7 +11,7 @@
 
 #include <assert.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include <trace-engine/instrumentation.h>
 #include <trace/pairs_internal.h>
@@ -286,7 +286,7 @@
 
 void trace_internal_write_kernel_object_record_for_handle_and_release_context(
     trace_context_t* context,
-    mx_handle_t handle,
+    zx_handle_t handle,
     const trace_arg_t* args, size_t num_args);
 
 #ifndef NTRACE
diff --git a/system/ulib/trace/include/trace/handler.h b/system/ulib/trace/include/trace/handler.h
index 8762e5f..2507981 100644
--- a/system/ulib/trace/include/trace/handler.h
+++ b/system/ulib/trace/include/trace/handler.h
@@ -37,22 +37,22 @@
 
     // Called by the trace engine when tracing has stopped.
     //
-    // The trace collection status is |MX_OK| if trace collection was successful.
+    // The trace collection status is |ZX_OK| if trace collection was successful.
     // An error indicates that the trace data may be inaccurate or incomplete.
     //
     // |async| is the trace engine's asynchronous dispatcher.
-    // |disposition| is |MX_OK| if tracing stopped normally, otherwise indicates
+    // |disposition| is |ZX_OK| if tracing stopped normally, otherwise indicates
     // that tracing was aborted due to an error.
     // |buffer_bytes_written| is number of bytes which were written to the trace buffer.
     //
     // Called on an asynchronous dispatch thread.
     virtual void TraceStopped(async_t* async,
-                              mx_status_t disposition, size_t buffer_bytes_written) {}
+                              zx_status_t disposition, size_t buffer_bytes_written) {}
 
 private:
     static bool CallIsCategoryEnabled(trace_handler_t* handler, const char* category);
     static void CallTraceStopped(trace_handler_t* handler, async_t* async,
-                                 mx_status_t disposition, size_t buffer_bytes_written);
+                                 zx_status_t disposition, size_t buffer_bytes_written);
 
     static const trace_handler_ops_t kOps;
 };
diff --git a/system/ulib/trace/include/trace/observer.h b/system/ulib/trace/include/trace/observer.h
index e8003cf..336e008 100644
--- a/system/ulib/trace/include/trace/observer.h
+++ b/system/ulib/trace/include/trace/observer.h
@@ -17,7 +17,7 @@
 #ifdef __cplusplus
 
 #include <async/wait.h>
-#include <mx/event.h>
+#include <zx/event.h>
 #include <fbl/function.h>
 
 namespace trace {
@@ -41,12 +41,12 @@
     void Stop();
 
 private:
-    async_wait_result_t Handle(async_t* async, mx_status_t status,
-                               const mx_packet_signal_t* signal);
+    async_wait_result_t Handle(async_t* async, zx_status_t status,
+                               const zx_packet_signal_t* signal);
 
     async_t* async_ = nullptr;
     fbl::Closure callback_;
-    mx::event event_;
+    zx::event event_;
     async::Wait wait_;
 };
 
diff --git a/system/ulib/trace/observer.cpp b/system/ulib/trace/observer.cpp
index da88406..9e0ee91 100644
--- a/system/ulib/trace/observer.cpp
+++ b/system/ulib/trace/observer.cpp
@@ -4,7 +4,7 @@
 
 #include <trace/observer.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 namespace trace {
 
@@ -17,20 +17,20 @@
 }
 
 void TraceObserver::Start(async_t* async, fbl::Closure callback) {
-    MX_DEBUG_ASSERT(async);
-    MX_DEBUG_ASSERT(callback);
+    ZX_DEBUG_ASSERT(async);
+    ZX_DEBUG_ASSERT(callback);
 
     Stop();
     async_ = async;
     callback_ = fbl::move(callback);
 
-    mx_status_t status = mx::event::create(0u, &event_);
-    MX_ASSERT(status == MX_OK);
+    zx_status_t status = zx::event::create(0u, &event_);
+    ZX_ASSERT(status == ZX_OK);
 
     wait_.set_object(event_.get());
-    wait_.set_trigger(MX_EVENT_SIGNALED);
+    wait_.set_trigger(ZX_EVENT_SIGNALED);
     status = wait_.Begin(async_);
-    MX_DEBUG_ASSERT(status == MX_OK);
+    ZX_DEBUG_ASSERT(status == ZX_OK);
 
     trace_register_observer(event_.get());
 }
@@ -41,20 +41,20 @@
 
     trace_unregister_observer(event_.get());
 
-    mx_status_t status = wait_.Cancel(async_);
-    MX_DEBUG_ASSERT(status == MX_OK);
+    zx_status_t status = wait_.Cancel(async_);
+    ZX_DEBUG_ASSERT(status == ZX_OK);
 
     async_ = nullptr;
     callback_ = nullptr;
 }
 
-async_wait_result_t TraceObserver::Handle(async_t* async, mx_status_t status,
-                                          const mx_packet_signal_t* signal) {
-    MX_DEBUG_ASSERT(status == MX_OK);
-    MX_DEBUG_ASSERT(signal->observed & MX_EVENT_SIGNALED);
+async_wait_result_t TraceObserver::Handle(async_t* async, zx_status_t status,
+                                          const zx_packet_signal_t* signal) {
+    ZX_DEBUG_ASSERT(status == ZX_OK);
+    ZX_DEBUG_ASSERT(signal->observed & ZX_EVENT_SIGNALED);
 
     // Clear the signal before invoking the callback.
-    event_.signal(MX_EVENT_SIGNALED, 0u);
+    event_.signal(ZX_EVENT_SIGNALED, 0u);
 
     // Invoke the callback.
     callback_();
diff --git a/system/ulib/trace/rules.mk b/system/ulib/trace/rules.mk
index 2a7bbc2..c1388ef 100644
--- a/system/ulib/trace/rules.mk
+++ b/system/ulib/trace/rules.mk
@@ -15,12 +15,12 @@
 
 MODULE_STATIC_LIBS := \
     system/ulib/async \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/trace-engine
 
 include make/module.mk
diff --git a/system/ulib/unittest/BUILD.gn b/system/ulib/unittest/BUILD.gn
index 2bc9d26..456df42 100644
--- a/system/ulib/unittest/BUILD.gn
+++ b/system/ulib/unittest/BUILD.gn
@@ -17,8 +17,8 @@
     "include/unittest/unittest.h",
   ]
   deps = [
-    "//magenta/system/public",
-    "//magenta/system/ulib/pretty",
+    "//zircon/system/public",
+    "//zircon/system/ulib/pretty",
   ]
   public_configs = [ ":unittest_config" ]
 }
diff --git a/system/ulib/unittest/README.md b/system/ulib/unittest/README.md
index 45c0e10..1f96031 100644
--- a/system/ulib/unittest/README.md
+++ b/system/ulib/unittest/README.md
@@ -2,5 +2,5 @@
 
 This directory contains a harness for writing tests used by system/utest.
 
-N.B. This library cannot use mxio since system/utest/core uses it
-and system/utest/core cannot use mxio. See system/utest/core/README.md.
+N.B. This library cannot use fdio since system/utest/core uses it
+and system/utest/core cannot use fdio. See system/utest/core/README.md.
diff --git a/system/ulib/unittest/crash-handler.c b/system/ulib/unittest/crash-handler.c
index 7fc9108..14af667 100644
--- a/system/ulib/unittest/crash-handler.c
+++ b/system/ulib/unittest/crash-handler.c
@@ -6,11 +6,11 @@
 
 #include <inttypes.h>
 
-#include <magenta/process.h>
-#include <magenta/status.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/port.h>
-#include <magenta/threads.h>
+#include <zircon/process.h>
+#include <zircon/status.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/threads.h>
 
 #define EXCEPTION_PORT_KEY 1
 // The test completed without the test thread crashing.
@@ -20,8 +20,8 @@
 
 // Signals sent from the test thread to the crash handler port to indicate
 // the test result.
-#define TEST_PASSED_SIGNAL MX_USER_SIGNAL_0
-#define TEST_FAILED_SIGNAL MX_USER_SIGNAL_1
+#define TEST_PASSED_SIGNAL ZX_USER_SIGNAL_0
+#define TEST_FAILED_SIGNAL ZX_USER_SIGNAL_1
 
 /**
  * Kills the crashing process or thread found in the registered list matching
@@ -34,90 +34,90 @@
  * and then the test will be terminated.
  */
 static void process_exception(crash_list_t crash_list,
-                              const mx_packet_exception_t* exception) {
+                              const zx_packet_exception_t* exception) {
     // Check if the crashed process is in the registered list and remove
     // it if so.
-    mx_handle_t match = crash_list_delete_koid(crash_list, exception->pid);
-    if (match == MX_HANDLE_INVALID) {
+    zx_handle_t match = crash_list_delete_koid(crash_list, exception->pid);
+    if (match == ZX_HANDLE_INVALID) {
         // The test may have registered a thread handle instead.
         match = crash_list_delete_koid(crash_list, exception->tid);
     }
 
     // The crash was not registered. We should let crashlogger print out the
     // details and then fail the test.
-    if (match == MX_HANDLE_INVALID) {
+    if (match == ZX_HANDLE_INVALID) {
         UNITTEST_TRACEF(
             "FATAL: process [%" PRIu64 "] crashed but was not registered\n",
             exception->pid);
-        mx_handle_t process;
-        mx_status_t status = mx_object_get_child(MX_HANDLE_INVALID,
+        zx_handle_t process;
+        zx_status_t status = zx_object_get_child(ZX_HANDLE_INVALID,
                                                  exception->pid,
-                                                 MX_RIGHT_SAME_RIGHTS,
+                                                 ZX_RIGHT_SAME_RIGHTS,
                                                  &process);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             UNITTEST_TRACEF(
                 "FATAL: failed to get a handle to [%" PRIu64 "] : error %s\n",
-                exception->pid, mx_status_get_string(status));
-            exit(MX_ERR_INTERNAL);
+                exception->pid, zx_status_get_string(status));
+            exit(ZX_ERR_INTERNAL);
         }
-        mx_handle_t thread;
-        status = mx_object_get_child(process, exception->tid,
-                                     MX_RIGHT_SAME_RIGHTS, &thread);
-        if (status != MX_OK) {
+        zx_handle_t thread;
+        status = zx_object_get_child(process, exception->tid,
+                                     ZX_RIGHT_SAME_RIGHTS, &thread);
+        if (status != ZX_OK) {
             UNITTEST_TRACEF(
                 "FATAL: failed to get a handle to [%" PRIu64 ".%" PRIu64 "] : error %s\n",
-                exception->pid, exception->tid, mx_status_get_string(status));
-            mx_handle_close(process);
-            exit(MX_ERR_INTERNAL);
+                exception->pid, exception->tid, zx_status_get_string(status));
+            zx_handle_close(process);
+            exit(ZX_ERR_INTERNAL);
         }
         // Pass the exception up to crashlogger.
-        status = mx_task_resume(thread,
-                                MX_RESUME_EXCEPTION | MX_RESUME_TRY_NEXT);
-        if (status == MX_OK) {
+        status = zx_task_resume(thread,
+                                ZX_RESUME_EXCEPTION | ZX_RESUME_TRY_NEXT);
+        if (status == ZX_OK) {
             // Give crashlogger a little time to print info about the crashed
             // thread.
-            mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+            zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
         } else {
             UNITTEST_TRACEF(
                 "FATAL: could not pass exception from [%" PRIu64 ".%" PRIu64 "] : error %s\n",
-                exception->pid, exception->tid, mx_status_get_string(status));
+                exception->pid, exception->tid, zx_status_get_string(status));
         }
         // This may not be reached if the test process itself crashed,
         // as crashlogger will kill the crashed process.
-        mx_handle_close(process);
-        mx_handle_close(thread);
+        zx_handle_close(process);
+        zx_handle_close(thread);
         // TODO: fail the test more gracefully.
-        exit(MX_ERR_INTERNAL);
+        exit(ZX_ERR_INTERNAL);
     }
-    mx_status_t status = mx_task_kill(match);
-    if (status != MX_OK) {
+    zx_status_t status = zx_task_kill(match);
+    if (status != ZX_OK) {
         UNITTEST_TRACEF(
             "FATAL: failed to kill [%" PRIu64 ".%" PRIu64 "]  : error %s\n",
-            exception->pid, exception->tid, mx_status_get_string(status));
-        exit(MX_ERR_INTERNAL);
+            exception->pid, exception->tid, zx_status_get_string(status));
+        exit(ZX_ERR_INTERNAL);
     }
 
     // The exception is still unprocessed. We should wait for termination so
     // there is no race condition with when we unbind the exception port.
-    status = mx_object_wait_one(match, MX_TASK_TERMINATED, MX_TIME_INFINITE, NULL);
-    if (status != MX_OK) {
+    status = zx_object_wait_one(match, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, NULL);
+    if (status != ZX_OK) {
         UNITTEST_TRACEF("FATAL: failed to wait for termination  : error %s\n",
-                        mx_status_get_string(status));
-        exit(MX_ERR_INTERNAL);
+                        zx_status_get_string(status));
+        exit(ZX_ERR_INTERNAL);
     }
-    mx_handle_close(match);
+    zx_handle_close(match);
 }
 
 // Returns the test result if it completes, else true if the test thread
 // had a registered crash.
-static test_result_t watch_test_thread(mx_handle_t port, crash_list_t crash_list) {
-    mx_port_packet_t packet;
+static test_result_t watch_test_thread(zx_handle_t port, crash_list_t crash_list) {
+    zx_port_packet_t packet;
     while (true) {
-        mx_status_t status = mx_port_wait(port, MX_TIME_INFINITE, &packet, 0);
-        if (status != MX_OK) {
+        zx_status_t status = zx_port_wait(port, ZX_TIME_INFINITE, &packet, 0);
+        if (status != ZX_OK) {
             UNITTEST_TRACEF("failed to wait on port: error %s\n",
-                            mx_status_get_string(status));
-            exit(MX_ERR_INTERNAL);
+                            zx_status_get_string(status));
+            exit(ZX_ERR_INTERNAL);
         }
         switch (packet.key) {
         case EXCEPTION_PORT_KEY:
@@ -131,7 +131,7 @@
             } else {
                 UNITTEST_TRACEF("unknown test ended event signal: %u\n",
                                 packet.signal.observed);
-                exit(MX_ERR_INTERNAL);
+                exit(ZX_ERR_INTERNAL);
             }
         case TEST_THREAD_TERMINATED_KEY:
             // The test thread exited without sending the
@@ -150,9 +150,9 @@
     void* test_function_arg;
 
     // For signaling TEST_PASSED_SIGNAL or TEST_FAILED_SIGNAL.
-    mx_handle_t test_ended_event;
+    zx_handle_t test_ended_event;
     // For registering test termination.
-    mx_handle_t port;
+    zx_handle_t port;
 
     // For registering the test thread, if it is expected to crash.
     crash_list_t crash_list;
@@ -164,32 +164,32 @@
 // status values.
 static int run_test(void* arg) {
     test_data_t* data = (test_data_t*)arg;
-    mx_handle_t self = mx_thread_self();
+    zx_handle_t self = zx_thread_self();
 
     // We need to register for thread termination here instead of the main
     // thread. The main thread can't get a handle to this thread before it has
     // started, at which point the test may have run and crashed already,
     // leading to an invalid handle.
-    mx_status_t status = mx_object_wait_async(self, data->port,
+    zx_status_t status = zx_object_wait_async(self, data->port,
                                               TEST_THREAD_TERMINATED_KEY,
-                                              MX_THREAD_TERMINATED,
-                                              MX_WAIT_ASYNC_ONCE);
-    if (status != MX_OK) {
+                                              ZX_THREAD_TERMINATED,
+                                              ZX_WAIT_ASYNC_ONCE);
+    if (status != ZX_OK) {
         UNITTEST_TRACEF(
             "FATAL: failed to wait on test thread termination : error %s\n",
-            mx_status_get_string(status));
-        exit(MX_ERR_INTERNAL);
+            zx_status_get_string(status));
+        exit(ZX_ERR_INTERNAL);
     }
 
     // We also can't do this in the main thread as we wouldn't have the
     // thread handle yet.
     if (data->bind_to_thread) {
-        status = mx_task_bind_exception_port(self, data->port,
+        status = zx_task_bind_exception_port(self, data->port,
                                              EXCEPTION_PORT_KEY, 0);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             UNITTEST_TRACEF("FATAL: failed to bind to exception port: error %s\n",
-                            mx_status_get_string(status));
-            exit(MX_ERR_INTERNAL);
+                            zx_status_get_string(status));
+            exit(ZX_ERR_INTERNAL);
         }
         crash_list_register(data->crash_list, self);
     }
@@ -200,11 +200,11 @@
     // We can't just return the test result as the test thread could
     // be registered to crash, so the crash handler can't use thrd_join.
     uint32_t signal = test_result ? TEST_PASSED_SIGNAL : TEST_FAILED_SIGNAL;
-    status = mx_object_signal(data->test_ended_event, 0, signal);
-    if (status != MX_OK) {
+    status = zx_object_signal(data->test_ended_event, 0, signal);
+    if (status != ZX_OK) {
         UNITTEST_TRACEF("FATAL: failed to signal test result : error %s\n",
-                        mx_status_get_string(status));
-        exit(MX_ERR_INTERNAL);
+                        zx_status_get_string(status));
+        exit(ZX_ERR_INTERNAL);
     }
     return 0;
 }
@@ -215,45 +215,45 @@
 // before starting the test.
 // If false, this will bind to the test thread's exception port once started
 // and add the thread to the expected crashes list.
-mx_status_t run_with_crash_handler(crash_list_t crash_list,
+zx_status_t run_with_crash_handler(crash_list_t crash_list,
                                    bool (*fn_to_run)(void*), void* arg,
                                    bool bind_to_job,
                                    test_result_t* test_result) {
-    mx_handle_t port;
-    mx_status_t status = mx_port_create(0, &port);
-    if (status != MX_OK) {
+    zx_handle_t port;
+    zx_status_t status = zx_port_create(0, &port);
+    if (status != ZX_OK) {
         UNITTEST_TRACEF("failed to create port: error %s\n",
-                        mx_status_get_string(status));
+                        zx_status_get_string(status));
         return status;
     }
     if (bind_to_job) {
-        status = mx_task_bind_exception_port(mx_job_default(), port,
+        status = zx_task_bind_exception_port(zx_job_default(), port,
                                              EXCEPTION_PORT_KEY, 0);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             UNITTEST_TRACEF("failed to bind to exception port: error %s\n",
-                            mx_status_get_string(status));
-            mx_handle_close(port);
+                            zx_status_get_string(status));
+            zx_handle_close(port);
             return status;
         }
     }
 
-    mx_handle_t test_ended_event;
-    status = mx_event_create(0, &test_ended_event);
-    if (status != MX_OK) {
+    zx_handle_t test_ended_event;
+    status = zx_event_create(0, &test_ended_event);
+    if (status != ZX_OK) {
         UNITTEST_TRACEF("failed to create event: error %s\n",
-                        mx_status_get_string(status));
-        mx_handle_close(port);
+                        zx_status_get_string(status));
+        zx_handle_close(port);
         return status;
     }
-    status = mx_object_wait_async(test_ended_event, port, TEST_ENDED_EVENT_KEY,
+    status = zx_object_wait_async(test_ended_event, port, TEST_ENDED_EVENT_KEY,
                                   TEST_PASSED_SIGNAL | TEST_FAILED_SIGNAL,
-                                  MX_WAIT_ASYNC_ONCE);
-    if (status != MX_OK) {
+                                  ZX_WAIT_ASYNC_ONCE);
+    if (status != ZX_OK) {
         UNITTEST_TRACEF(
             "failed to wait on test_ended_event: error %s\n",
-            mx_status_get_string(status));
-        mx_handle_close(port);
-        mx_handle_close(test_ended_event);
+            zx_status_get_string(status));
+        zx_handle_close(port);
+        zx_handle_close(test_ended_event);
         return status;
     }
 
@@ -270,19 +270,19 @@
     int thrd_res = thrd_create(&test_thread, run_test, (void*)&test_data);
     if (thrd_res != thrd_success) {
         UNITTEST_TRACEF("failed to create test thread\n");
-        mx_handle_close(port);
-        mx_handle_close(test_ended_event);
-        return thrd_status_to_mx_status(thrd_res);
+        zx_handle_close(port);
+        zx_handle_close(test_ended_event);
+        return thrd_status_to_zx_status(thrd_res);
     }
 
     // The test thread will signal on the test_ended event when it completes,
     // or the crash handler will catch it crashing.
     *test_result = watch_test_thread(port, crash_list);
 
-    mx_handle_close(port);
-    mx_handle_close(test_ended_event);
+    zx_handle_close(port);
+    zx_handle_close(test_ended_event);
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 typedef struct {
@@ -293,7 +293,7 @@
     return ((test_wrapper_arg_t*)arg)->fn();
 }
 
-mx_status_t run_test_with_crash_handler(crash_list_t crash_list,
+zx_status_t run_test_with_crash_handler(crash_list_t crash_list,
                                         bool (*test_to_run)(void),
                                         test_result_t* test_result) {
     test_wrapper_arg_t twarg = {.fn = test_to_run};
@@ -314,12 +314,12 @@
     return false;
 }
 
-mx_status_t run_fn_with_crash_handler(void (*fn_to_run)(void*), void* arg,
+zx_status_t run_fn_with_crash_handler(void (*fn_to_run)(void*), void* arg,
                                       test_result_t* test_result) {
     crash_list_t crash_list = crash_list_new();
     crash_fn_wrapper_arg_t cfwarg = {.fn = fn_to_run, .arg = arg};
 
-    mx_status_t status = run_with_crash_handler(crash_list,
+    zx_status_t status = run_with_crash_handler(crash_list,
                                                 crash_fn_wrapper, &cfwarg,
                                                 false, test_result);
 
diff --git a/system/ulib/unittest/crash-handler.h b/system/ulib/unittest/crash-handler.h
index 54f4c39..6df015a 100644
--- a/system/ulib/unittest/crash-handler.h
+++ b/system/ulib/unittest/crash-handler.h
@@ -30,10 +30,10 @@
  *
  * If an unexpected crash occurs, the test will be terminated immediately.
  *
- * Returns MX_OK if setup succeeded, otherwise a negative error value is
- * returned. If the return value is MX_OK, test_result will also be populated.
+ * Returns ZX_OK if setup succeeded, otherwise a negative error value is
+ * returned. If the return value is ZX_OK, test_result will also be populated.
  */
-mx_status_t run_test_with_crash_handler(crash_list_t crash_list,
+zx_status_t run_test_with_crash_handler(crash_list_t crash_list,
                                         bool (*test_to_run)(void),
                                         test_result_t* test_result);
 
@@ -41,10 +41,10 @@
  * Runs the function in a separate thread, passing in the given argument.
  * This will block until the function either crashes or returns.
  *
- * Returns MX_OK if setup succeeded, otherwise a negative error value is
- * returned. If the return value is MX_OK, test_result will also be populated.
+ * Returns ZX_OK if setup succeeded, otherwise a negative error value is
+ * returned. If the return value is ZX_OK, test_result will also be populated.
  */
-mx_status_t run_fn_with_crash_handler(void (*fn_to_run)(void*), void* arg,
+zx_status_t run_fn_with_crash_handler(void (*fn_to_run)(void*), void* arg,
                                       test_result_t* test_result);
 
 __END_CDECLS
diff --git a/system/ulib/unittest/crash-list.c b/system/ulib/unittest/crash-list.c
index cc7e4eb..6200e87 100644
--- a/system/ulib/unittest/crash-list.c
+++ b/system/ulib/unittest/crash-list.c
@@ -7,15 +7,15 @@
 #include <stdlib.h>
 #include <threads.h>
 
-#include <magenta/listnode.h>
-#include <magenta/status.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/listnode.h>
+#include <zircon/status.h>
+#include <zircon/syscalls/object.h>
 #include <unittest/unittest.h>
 
 // Details of process or thread registered as expected to crash.
 typedef struct crash_proc {
-    mx_handle_t handle;
-    mx_koid_t koid;
+    zx_handle_t handle;
+    zx_koid_t koid;
     // Node stored in crash handler list.
     list_node_t node;
 } crash_proc_t;
@@ -31,43 +31,43 @@
     crash_list_t crash_list = malloc(sizeof(struct crash_list));
     if (crash_list == NULL) {
         UNITTEST_TRACEF("FATAL: could not malloc crash list\n");
-        exit(MX_ERR_INTERNAL);
+        exit(ZX_ERR_INTERNAL);
     }
     int ret = mtx_init(&crash_list->mutex, mtx_plain);
     if (ret != thrd_success) {
         UNITTEST_TRACEF("FATAL: could not create crash list mutex : error %s\n",
-            mx_status_get_string(ret));
-        exit(MX_ERR_INTERNAL);
+            zx_status_get_string(ret));
+        exit(ZX_ERR_INTERNAL);
     }
     crash_list->should_crash_procs =
         (list_node_t) LIST_INITIAL_VALUE(crash_list->should_crash_procs);
     return crash_list;
 }
 
-void crash_list_register(crash_list_t crash_list, mx_handle_t handle) {
+void crash_list_register(crash_list_t crash_list, zx_handle_t handle) {
     if (crash_list == NULL) {
         UNITTEST_TRACEF("FATAL: crash list was NULL, run test with RUN_TEST_ENABLE_CRASH_HANDLER\n");
-        exit(MX_ERR_INTERNAL);
+        exit(ZX_ERR_INTERNAL);
     }
-    mx_info_handle_basic_t info;
-    mx_status_t status = mx_object_get_info(handle, MX_INFO_HANDLE_BASIC,
+    zx_info_handle_basic_t info;
+    zx_status_t status = zx_object_get_info(handle, ZX_INFO_HANDLE_BASIC,
                                             &info, sizeof(info), NULL, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         UNITTEST_TRACEF("FATAL: could not get handle info : error %s\n",
-            mx_status_get_string(status));
-        exit(MX_ERR_INTERNAL);
+            zx_status_get_string(status));
+        exit(ZX_ERR_INTERNAL);
     }
-    mx_handle_t copy;
-    status = mx_handle_duplicate(handle, MX_RIGHT_SAME_RIGHTS, &copy);
-    if (status != MX_OK) {
+    zx_handle_t copy;
+    status = zx_handle_duplicate(handle, ZX_RIGHT_SAME_RIGHTS, &copy);
+    if (status != ZX_OK) {
         UNITTEST_TRACEF("FATAL: could not duplicate handle : error %s\n",
-            mx_status_get_string(status));
-        exit(MX_ERR_INTERNAL);
+            zx_status_get_string(status));
+        exit(ZX_ERR_INTERNAL);
     }
     crash_proc_t* crash_proc = malloc(sizeof(crash_proc_t));
     if (crash_list == NULL) {
         UNITTEST_TRACEF("FATAL: could not malloc crash proc\n");
-        exit(MX_ERR_INTERNAL);
+        exit(ZX_ERR_INTERNAL);
     }
     crash_proc->handle = copy;
     crash_proc->koid = info.koid;
@@ -77,13 +77,13 @@
     mtx_unlock(&crash_list->mutex);
 }
 
-mx_handle_t crash_list_delete_koid(crash_list_t crash_list,
-                                   mx_koid_t koid) {
+zx_handle_t crash_list_delete_koid(crash_list_t crash_list,
+                                   zx_koid_t koid) {
     if (crash_list == NULL) {
         UNITTEST_TRACEF("FATAL: crash list was NULL, run test with RUN_TEST_ENABLE_CRASH_HANDLER\n");
-        exit(MX_ERR_INTERNAL);
+        exit(ZX_ERR_INTERNAL);
     }
-    mx_handle_t deleted_proc = MX_HANDLE_INVALID;
+    zx_handle_t deleted_proc = ZX_HANDLE_INVALID;
     crash_proc_t* cur = NULL;
     crash_proc_t* tmp = NULL;
 
@@ -103,14 +103,14 @@
 bool crash_list_delete(crash_list_t crash_list) {
     if (crash_list == NULL) {
         UNITTEST_TRACEF("FATAL: crash list was NULL, run test with RUN_TEST_ENABLE_CRASH_HANDLER\n");
-        exit(MX_ERR_INTERNAL);
+        exit(ZX_ERR_INTERNAL);
     }
     crash_proc_t* cur = NULL;
     crash_proc_t* tmp = NULL;
 
     bool deleted = false;
     list_for_every_entry_safe(&crash_list->should_crash_procs, cur, tmp, crash_proc_t, node) {
-        mx_handle_close(cur->handle);
+        zx_handle_close(cur->handle);
         deleted = true;
         list_delete(&cur->node);
         free(cur);
diff --git a/system/ulib/unittest/crash-list.h b/system/ulib/unittest/crash-list.h
index 2e62ece..28a4891 100644
--- a/system/ulib/unittest/crash-list.h
+++ b/system/ulib/unittest/crash-list.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include <unittest/unittest.h>
 
@@ -16,14 +16,14 @@
 /**
  * Registers the process or thread as expected to crash.
  */
-void crash_list_register(crash_list_t crash_list, mx_handle_t handle);
+void crash_list_register(crash_list_t crash_list, zx_handle_t handle);
 
 /**
  * Deletes the node with the given koid and returns the process or thread handle, or
- * MX_HANDLE_INVALID if no match was found.
+ * ZX_HANDLE_INVALID if no match was found.
  */
-mx_handle_t crash_list_delete_koid(crash_list_t crash_list,
-                                   mx_koid_t koid);
+zx_handle_t crash_list_delete_koid(crash_list_t crash_list,
+                                   zx_koid_t koid);
 
 /**
  * Deletes the list. Returns whether any elements were deleted.
diff --git a/system/ulib/unittest/include/unittest/unittest.h b/system/ulib/unittest/include/unittest/unittest.h
index 7e2e35a..462ed5b 100644
--- a/system/ulib/unittest/include/unittest/unittest.h
+++ b/system/ulib/unittest/include/unittest/unittest.h
@@ -40,7 +40,7 @@
  *      EXPECT_EQ(1, foo_value, "foo_func failed");
  *      ... there are EXPECT_* macros for many conditions...
  *      EXPECT_TRUE(foo_condition(), "condition should be true");
- *      EXPECT_NE(MX_ERR_TIMED_OUT, foo_event(), "event timed out");
+ *      EXPECT_NE(ZX_ERR_TIMED_OUT, foo_event(), "event timed out");
  *
  *      END_TEST;
  * }
@@ -53,10 +53,10 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #ifdef __Fuchsia__
-#include <magenta/types.h>
+#include <zircon/types.h>
 #define UNITTEST_CRASH_HANDLER_SUPPORTED
 #endif // __Fuchsia__
 
@@ -79,15 +79,15 @@
 
 // A workaround to help static analyzer identify assertion failures
 #if defined(__clang__)
-#define MX_ANALYZER_CREATE_SINK     __attribute__((annotate("mx_create_sink")))
+#define ZX_ANALYZER_CREATE_SINK     __attribute__((annotate("zx_create_sink")))
 #else
-#define MX_ANALYZER_CREATE_SINK     //no-op
+#define ZX_ANALYZER_CREATE_SINK     //no-op
 #endif
 // This function will help terminate the static analyzer when it reaches
 // an assertion failure site which returns from test case function. The bugs
 // discovered by the static analyzer will be suppressed as they are expected
 // by the test cases.
-static inline void unittest_returns_early(void) MX_ANALYZER_CREATE_SINK {}
+static inline void unittest_returns_early(void) ZX_ANALYZER_CREATE_SINK {}
 
 __BEGIN_CDECLS
 
@@ -249,11 +249,11 @@
  *      BEGIN_TEST;
  *
  *      ...create a process...
- *      mx_handle_t process;
- *      mx_handle_t vmar;
- *      ASSERT_EQ(mx_process_create(mx_job_default(), fooName, sizeof(fooName),
+ *      zx_handle_t process;
+ *      zx_handle_t vmar;
+ *      ASSERT_EQ(zx_process_create(zx_job_default(), fooName, sizeof(fooName),
  *                                  0, &process, &vmar),
- *                MX_OK, ""));
+ *                ZX_OK, ""));
  *      ...register the process as expected to crash...
  *      REGISTER_CRASH(process);
  *      ...trigger the crash...
@@ -586,7 +586,7 @@
                              bool* all_success, bool enable_crash_handler);
 
 #ifdef UNITTEST_CRASH_HANDLER_SUPPORTED
-void unittest_register_crash(struct test_info* current_test_info, mx_handle_t handle);
+void unittest_register_crash(struct test_info* current_test_info, zx_handle_t handle);
 bool unittest_run_death_fn(void (*fn_to_run)(void*), void* arg);
 #endif // UNITTEST_CRASH_HANDLER_SUPPORTED
 
diff --git a/system/ulib/unittest/rules.mk b/system/ulib/unittest/rules.mk
index e2c7c66..1536d2c 100644
--- a/system/ulib/unittest/rules.mk
+++ b/system/ulib/unittest/rules.mk
@@ -17,8 +17,8 @@
 
 MODULE_SO_NAME := unittest
 
-# N.B. mxio, and thus launchpad, cannot appear here. See ./README.md.
-MODULE_LIBS := system/ulib/c system/ulib/magenta
+# N.B. fdio, and thus launchpad, cannot appear here. See ./README.md.
+MODULE_LIBS := system/ulib/c system/ulib/zircon
 
 MODULE_STATIC_LIBS := system/ulib/pretty
 
diff --git a/system/ulib/unittest/unittest.c b/system/ulib/unittest/unittest.c
index c181efb..32c8244 100644
--- a/system/ulib/unittest/unittest.c
+++ b/system/ulib/unittest/unittest.c
@@ -22,7 +22,7 @@
 
 static nsecs_t now(void) {
 #ifdef __Fuchsia__
-    return mx_time_get(MX_CLOCK_MONOTONIC);
+    return zx_time_get(ZX_CLOCK_MONOTONIC);
 #else
     // clock_gettime(CLOCK_MONOTONIC) would be better but may not exist on the host
     struct timeval tv;
@@ -111,14 +111,14 @@
 }
 
 #ifdef UNITTEST_CRASH_HANDLER_SUPPORTED
-void unittest_register_crash(struct test_info* current_test_info, mx_handle_t handle) {
+void unittest_register_crash(struct test_info* current_test_info, zx_handle_t handle) {
     crash_list_register(current_test_info->crash_list, handle);
 }
 
 bool unittest_run_death_fn(void (*fn_to_run)(void*), void* arg) {
     test_result_t test_result;
-    mx_status_t status = run_fn_with_crash_handler(fn_to_run, arg, &test_result);
-    return status == MX_OK && test_result == TEST_CRASHED;
+    zx_status_t status = run_fn_with_crash_handler(fn_to_run, arg, &test_result);
+    return status == ZX_OK && test_result == TEST_CRASHED;
 }
 #endif // UNITTEST_CRASH_HANDLER_SUPPORTED
 
@@ -138,10 +138,10 @@
             test_info.crash_list = crash_list_new();
 
             test_result_t test_result;
-            mx_status_t status = run_test_with_crash_handler(test_info.crash_list,
+            zx_status_t status = run_test_with_crash_handler(test_info.crash_list,
                                                              test,
                                                              &test_result);
-            if (status != MX_OK || test_result == TEST_FAILED) {
+            if (status != ZX_OK || test_result == TEST_FAILED) {
                 test_info.all_ok = false;
             }
 
diff --git a/system/ulib/virtio/include/virtio/balloon.h b/system/ulib/virtio/include/virtio/balloon.h
index 59aad7b..4a2a094 100644
--- a/system/ulib/virtio/include/virtio/balloon.h
+++ b/system/ulib/virtio/include/virtio/balloon.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 // clang-format off
 #define VIRTIO_BALLOON_F_MUST_TELL_HOST   (1u << 0)
diff --git a/system/ulib/virtio/include/virtio/block.h b/system/ulib/virtio/include/virtio/block.h
index 28f8269..eabdd3f 100644
--- a/system/ulib/virtio/include/virtio/block.h
+++ b/system/ulib/virtio/include/virtio/block.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 // clang-format off
 #define VIRTIO_BLK_F_BARRIER    (1u << 0)
diff --git a/system/ulib/virtio/include/virtio/net.h b/system/ulib/virtio/include/virtio/net.h
index 792d498..dd3c73f 100644
--- a/system/ulib/virtio/include/virtio/net.h
+++ b/system/ulib/virtio/include/virtio/net.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <ddk/protocol/ethernet.h>
 
 // clang-format off
diff --git a/system/ulib/virtio/include/virtio/virtio.h b/system/ulib/virtio/include/virtio/virtio.h
index 904b1d4..81ff006 100644
--- a/system/ulib/virtio/include/virtio/virtio.h
+++ b/system/ulib/virtio/include/virtio/virtio.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #define VIRTIO_STATUS_ACKNOWLEDGE                   (1u << 0)
 #define VIRTIO_STATUS_DRIVER                        (1u << 1)
diff --git a/system/ulib/vmofs/BUILD.gn b/system/ulib/vmofs/BUILD.gn
index 0c6ec02..a1e3ad9 100644
--- a/system/ulib/vmofs/BUILD.gn
+++ b/system/ulib/vmofs/BUILD.gn
@@ -7,7 +7,7 @@
 }
 
 static_library("vmofs") {
-  # Don't forget to update rules.mk as well for the Magenta build.
+  # Don't forget to update rules.mk as well for the Zircon build.
   sources = [
     "vmofs.cpp",
   ]
@@ -15,9 +15,9 @@
   public_configs = [ ":vmofs_config" ]
 
   public_deps = [
-    "//magenta/system/ulib/fs",
-    "//magenta/system/ulib/mx",
-    "//magenta/system/ulib/mxcpp",
-    "//magenta/system/ulib/fbl",
+    "//zircon/system/ulib/fs",
+    "//zircon/system/ulib/zx",
+    "//zircon/system/ulib/zxcpp",
+    "//zircon/system/ulib/fbl",
   ]
 }
diff --git a/system/ulib/vmofs/include/vmofs/vmofs.h b/system/ulib/vmofs/include/vmofs/vmofs.h
index cc40d62..539b1e8 100644
--- a/system/ulib/vmofs/include/vmofs/vmofs.h
+++ b/system/ulib/vmofs/include/vmofs/vmofs.h
@@ -6,7 +6,7 @@
 
 #include <fs/dispatcher.h>
 #include <fs/vfs.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 #include <fbl/array.h>
 #include <fbl/ref_ptr.h>
 #include <fbl/string_piece.h>
@@ -15,7 +15,7 @@
 
 class Vnode : public fs::Vnode {
 public:
-    mx_status_t Close() final;
+    zx_status_t Close() final;
 
     Vnode();
     ~Vnode() override;
@@ -26,24 +26,24 @@
 class VnodeFile : public Vnode {
 public:
     // The creator retains ownership of |vmo|.
-    VnodeFile(mx_handle_t vmo,
-              mx_off_t offset,
-              mx_off_t length);
+    VnodeFile(zx_handle_t vmo,
+              zx_off_t offset,
+              zx_off_t length);
     ~VnodeFile() override;
 
-    mx_status_t Open(uint32_t flags) final;
-    mx_status_t Serve(fs::Vfs* vfs, mx::channel channel, uint32_t flags) final;
+    zx_status_t Open(uint32_t flags) final;
+    zx_status_t Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) final;
     ssize_t Read(void* data, size_t len, size_t off) final;
-    mx_status_t Getattr(vnattr_t* a) final;
-    mx_status_t GetHandles(uint32_t flags, mx_handle_t* hnds,
+    zx_status_t Getattr(vnattr_t* a) final;
+    zx_status_t GetHandles(uint32_t flags, zx_handle_t* hnds,
                            uint32_t* type, void* extra, uint32_t* esize) final;
 
     uint32_t GetVType() final;
 
 private:
-    mx_handle_t vmo_;
-    mx_off_t offset_;
-    mx_off_t length_;
+    zx_handle_t vmo_;
+    zx_off_t offset_;
+    zx_off_t length_;
     bool have_local_clone_;
 };
 
@@ -55,10 +55,10 @@
              fbl::Array<fbl::RefPtr<Vnode>> children);
     ~VnodeDir() override;
 
-    mx_status_t Open(uint32_t flags) final;
-    mx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
-    mx_status_t Getattr(vnattr_t* a) final;
-    mx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
+    zx_status_t Open(uint32_t flags) final;
+    zx_status_t Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) final;
+    zx_status_t Getattr(vnattr_t* a) final;
+    zx_status_t Readdir(void* cookie, void* dirents, size_t len) final;
 
     uint32_t GetVType() final;
 
diff --git a/system/ulib/vmofs/rules.mk b/system/ulib/vmofs/rules.mk
index 7ef7620..6b29ac4 100644
--- a/system/ulib/vmofs/rules.mk
+++ b/system/ulib/vmofs/rules.mk
@@ -12,13 +12,13 @@
     $(LOCAL_DIR)/vmofs.cpp \
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/fs \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
 
 include make/module.mk
diff --git a/system/ulib/vmofs/vmofs.cpp b/system/ulib/vmofs/vmofs.cpp
index 7255789..9aab2e5 100644
--- a/system/ulib/vmofs/vmofs.cpp
+++ b/system/ulib/vmofs/vmofs.cpp
@@ -9,7 +9,7 @@
 
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 namespace vmofs {
 
@@ -26,21 +26,21 @@
 
 Vnode::~Vnode() = default;
 
-mx_status_t Vnode::Close() {
-    return MX_OK;
+zx_status_t Vnode::Close() {
+    return ZX_OK;
 }
 
 // VnodeFile --------------------------------------------------------------------
 
-VnodeFile::VnodeFile(mx_handle_t vmo,
-                     mx_off_t offset,
-                     mx_off_t length)
+VnodeFile::VnodeFile(zx_handle_t vmo,
+                     zx_off_t offset,
+                     zx_off_t length)
     : vmo_(vmo), offset_(offset), length_(length),
       have_local_clone_(false) {}
 
 VnodeFile::~VnodeFile() {
     if (have_local_clone_) {
-        mx_handle_close(vmo_);
+        zx_handle_close(vmo_);
     }
 }
 
@@ -48,20 +48,20 @@
     return V_TYPE_FILE;
 }
 
-mx_status_t VnodeFile::Open(uint32_t flags) {
+zx_status_t VnodeFile::Open(uint32_t flags) {
     if (flags & O_DIRECTORY) {
-        return MX_ERR_NOT_DIR;
+        return ZX_ERR_NOT_DIR;
     }
     switch (flags & O_ACCMODE) {
     case O_WRONLY:
     case O_RDWR:
-        return MX_ERR_ACCESS_DENIED;
+        return ZX_ERR_ACCESS_DENIED;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeFile::Serve(fs::Vfs* vfs, mx::channel channel, uint32_t flags) {
-    return MX_OK;
+zx_status_t VnodeFile::Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) {
+    return ZX_OK;
 }
 
 ssize_t VnodeFile::Read(void* data, size_t length, size_t offset) {
@@ -72,7 +72,7 @@
     if (length > remaining_length) {
         length = remaining_length;
     }
-    mx_status_t r = mx_vmo_read(vmo_, data, offset_ + offset, length, &length);
+    zx_status_t r = zx_vmo_read(vmo_, data, offset_ + offset, length, &length);
     if (r < 0) {
         return r;
     }
@@ -81,35 +81,35 @@
 
 constexpr uint64_t kVmofsBlksize = PAGE_SIZE;
 
-mx_status_t VnodeFile::Getattr(vnattr_t* attr) {
+zx_status_t VnodeFile::Getattr(vnattr_t* attr) {
     memset(attr, 0, sizeof(vnattr_t));
     attr->mode = V_TYPE_FILE | V_IRUSR;
     attr->size = length_;
     attr->blksize = kVmofsBlksize;
     attr->blkcount = fbl::roundup(attr->size, kVmofsBlksize) / VNATTR_BLKSIZE;
     attr->nlink = 1;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeFile::GetHandles(uint32_t flags, mx_handle_t* hnds,
+zx_status_t VnodeFile::GetHandles(uint32_t flags, zx_handle_t* hnds,
                                   uint32_t* type, void* extra, uint32_t* esize) {
-    mx_off_t* offset = static_cast<mx_off_t*>(extra);
-    mx_off_t* length = offset + 1;
-    mx_handle_t vmo;
-    mx_status_t status;
+    zx_off_t* offset = static_cast<zx_off_t*>(extra);
+    zx_off_t* length = offset + 1;
+    zx_handle_t vmo;
+    zx_status_t status;
 
     if (!have_local_clone_) {
-        status = mx_vmo_clone(vmo_, MX_VMO_CLONE_COPY_ON_WRITE, offset_, length_, &vmo_);
+        status = zx_vmo_clone(vmo_, ZX_VMO_CLONE_COPY_ON_WRITE, offset_, length_, &vmo_);
         if (status < 0)
             return status;
         offset_ = 0;
         have_local_clone_ = true;
     }
 
-    status = mx_handle_duplicate(
+    status = zx_handle_duplicate(
         vmo_,
-        MX_RIGHT_READ | MX_RIGHT_EXECUTE | MX_RIGHT_MAP |
-        MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_GET_PROPERTY,
+        ZX_RIGHT_READ | ZX_RIGHT_EXECUTE | ZX_RIGHT_MAP |
+        ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_GET_PROPERTY,
         &vmo);
     if (status < 0) {
         return status;
@@ -118,8 +118,8 @@
     *offset = offset_;
     *length = length_;
     hnds[0] = vmo;
-    *type = MXIO_PROTOCOL_VMOFILE;
-    *esize = sizeof(mx_off_t) * 2;
+    *type = FDIO_PROTOCOL_VMOFILE;
+    *esize = sizeof(zx_off_t) * 2;
     return 1;
 }
 
@@ -129,7 +129,7 @@
                    fbl::Array<fbl::RefPtr<Vnode>> children)
     : names_(fbl::move(names)),
       children_(fbl::move(children)) {
-    MX_DEBUG_ASSERT(names_.size() == children_.size());
+    ZX_DEBUG_ASSERT(names_.size() == children_.size());
 }
 
 VnodeDir::~VnodeDir() = default;
@@ -138,35 +138,35 @@
     return V_TYPE_DIR;
 }
 
-mx_status_t VnodeDir::Open(uint32_t flags) {
-    return MX_OK;
+zx_status_t VnodeDir::Open(uint32_t flags) {
+    return ZX_OK;
 }
 
-mx_status_t VnodeDir::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
+zx_status_t VnodeDir::Lookup(fbl::RefPtr<fs::Vnode>* out, const char* name, size_t len) {
     fbl::StringPiece value(name, len);
     auto* it = fbl::lower_bound(names_.begin(), names_.end(), value);
     if (it == names_.end() || *it != value) {
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
     }
     *out = children_[it - names_.begin()];
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeDir::Getattr(vnattr_t* attr) {
+zx_status_t VnodeDir::Getattr(vnattr_t* attr) {
     memset(attr, 0, sizeof(vnattr_t));
     attr->mode = V_TYPE_DIR | V_IRUSR;
     attr->blksize = kVmofsBlksize;
     attr->blkcount = fbl::roundup(attr->size, kVmofsBlksize) / VNATTR_BLKSIZE;
     attr->nlink = 1;
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t VnodeDir::Readdir(void* cookie, void* data, size_t len) {
+zx_status_t VnodeDir::Readdir(void* cookie, void* data, size_t len) {
     dircookie_t* c = static_cast<dircookie_t*>(cookie);
     fs::DirentFiller df(data, len);
-    mx_status_t r = 0;
+    zx_status_t r = 0;
     if (c->last_id < 1) {
-        if ((r = df.Next(".", 1, VTYPE_TO_DTYPE(V_TYPE_DIR))) != MX_OK) {
+        if ((r = df.Next(".", 1, VTYPE_TO_DTYPE(V_TYPE_DIR))) != ZX_OK) {
             return df.BytesFilled();
         }
         c->last_id = 1;
@@ -176,7 +176,7 @@
         fbl::StringPiece name = names_[i];
         const auto& child = children_[i];
         uint32_t vtype = child->GetVType();
-        if ((r = df.Next(name.data(), name.length(), VTYPE_TO_DTYPE(vtype))) != MX_OK) {
+        if ((r = df.Next(name.data(), name.length(), VTYPE_TO_DTYPE(vtype))) != ZX_OK) {
             break;
         }
         c->last_id = i + 2;
diff --git a/system/ulib/magenta/data.S b/system/ulib/zircon/data.S
similarity index 100%
rename from system/ulib/magenta/data.S
rename to system/ulib/zircon/data.S
diff --git a/system/ulib/zircon/include/zircon/status.h b/system/ulib/zircon/include/zircon/status.h
new file mode 100644
index 0000000..5d83c72
--- /dev/null
+++ b/system/ulib/zircon/include/zircon/status.h
@@ -0,0 +1,23 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Given one of the status codes defined in <zircon/errors.h> (ZX_ERR_* or
+// ZX_OK), this function returns an identifier string for the status code.
+//
+// For example, zx_status_get_string(ZX_ERR_TIMED_OUT) returns the string
+// "ZX_ERR_TIMED_OUT".
+const char* _zx_status_get_string(zx_status_t status);
+const char* zx_status_get_string(zx_status_t status);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/system/ulib/magenta/private.h b/system/ulib/zircon/private.h
similarity index 67%
rename from system/ulib/magenta/private.h
rename to system/ulib/zircon/private.h
index 3d1f2b6..09c47cd 100644
--- a/system/ulib/magenta/private.h
+++ b/system/ulib/zircon/private.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 
 // This defines the struct shared with the kernel.
 #include <lib/vdso-constants.h>
@@ -14,17 +14,17 @@
 
 extern "C" {
 
-// This declares the VDSO_mx_* aliases for the vDSO entry points.
+// This declares the VDSO_zx_* aliases for the vDSO entry points.
 // Calls made from within the vDSO must use these names rather than
 // the public names so as to avoid PLT entries.
-#include <magenta/syscall-vdso-definitions.h>
+#include <zircon/syscall-vdso-definitions.h>
 
-__LOCAL decltype(mx_ticks_get) CODE_soft_ticks_get;
+__LOCAL decltype(zx_ticks_get) CODE_soft_ticks_get;
 
 };
 
-// Code should define '_mx_foo' and then do 'VDSO_INTERFACE_FUNCTION(mx_foo);'
-// to define the public name 'mx_foo' and the vDSO-private name 'VDSO_mx_foo'.
+// Code should define '_zx_foo' and then do 'VDSO_INTERFACE_FUNCTION(zx_foo);'
+// to define the public name 'zx_foo' and the vDSO-private name 'VDSO_zx_foo'.
 #define VDSO_INTERFACE_FUNCTION(name) \
     decltype(name) name __WEAK_ALIAS("_" #name); \
     decltype(name) VDSO_##name __LOCAL __ALIAS("_" #name)
diff --git a/system/ulib/magenta/rules.mk b/system/ulib/zircon/rules.mk
similarity index 63%
rename from system/ulib/magenta/rules.mk
rename to system/ulib/zircon/rules.mk
index 5002d47..04029dc 100644
--- a/system/ulib/magenta/rules.mk
+++ b/system/ulib/zircon/rules.mk
@@ -15,33 +15,33 @@
 
 MODULE_SRCS := \
     $(LOCAL_DIR)/data.S \
-    $(LOCAL_DIR)/mx_cache_flush.cpp \
-    $(LOCAL_DIR)/mx_channel_call.cpp \
-    $(LOCAL_DIR)/mx_deadline_after.cpp \
-    $(LOCAL_DIR)/mx_status_get_string.cpp \
-    $(LOCAL_DIR)/mx_system_get_num_cpus.cpp \
-    $(LOCAL_DIR)/mx_system_get_physmem.cpp \
-    $(LOCAL_DIR)/mx_system_get_version.cpp \
-    $(LOCAL_DIR)/mx_ticks_get.cpp \
-    $(LOCAL_DIR)/mx_ticks_per_second.cpp \
+    $(LOCAL_DIR)/zx_cache_flush.cpp \
+    $(LOCAL_DIR)/zx_channel_call.cpp \
+    $(LOCAL_DIR)/zx_deadline_after.cpp \
+    $(LOCAL_DIR)/zx_status_get_string.cpp \
+    $(LOCAL_DIR)/zx_system_get_num_cpus.cpp \
+    $(LOCAL_DIR)/zx_system_get_physmem.cpp \
+    $(LOCAL_DIR)/zx_system_get_version.cpp \
+    $(LOCAL_DIR)/zx_ticks_get.cpp \
+    $(LOCAL_DIR)/zx_ticks_per_second.cpp \
     $(LOCAL_DIR)/syscall-wrappers.cpp \
 
 ifeq ($(ARCH),arm64)
 MODULE_SRCS += \
-    $(LOCAL_DIR)/mx_futex_wake_handle_close_thread_exit-arm64.S \
-    $(LOCAL_DIR)/mx_vmar_unmap_handle_close_thread_exit-arm64.S \
+    $(LOCAL_DIR)/zx_futex_wake_handle_close_thread_exit-arm64.S \
+    $(LOCAL_DIR)/zx_vmar_unmap_handle_close_thread_exit-arm64.S \
     $(LOCAL_DIR)/syscalls-arm64.S
 else ifeq ($(ARCH),x86)
 MODULE_SRCS += \
-    $(LOCAL_DIR)/mx_futex_wake_handle_close_thread_exit-x86-64.S \
-    $(LOCAL_DIR)/mx_vmar_unmap_handle_close_thread_exit-x86-64.S \
+    $(LOCAL_DIR)/zx_futex_wake_handle_close_thread_exit-x86-64.S \
+    $(LOCAL_DIR)/zx_vmar_unmap_handle_close_thread_exit-x86-64.S \
     $(LOCAL_DIR)/syscalls-x86-64.S
 endif
 
 # This gets an ABI stub installed in sysroots, but the DSO never gets
 # installed on disk because it's delivered magically by the kernel.
 MODULE_EXPORT := so
-MODULE_SO_NAME := magenta
+MODULE_SO_NAME := zircon
 MODULE_SO_INSTALL_NAME := -
 
 # All the code this DSO is pure read-only/reentrant code that
@@ -51,7 +51,7 @@
 
 # Explicit dependency to make sure the file gets generated first.
 # MODULE_SRCDEPS is overkill for this since only one file uses it.
-$(BUILDDIR)/$(LOCAL_DIR)/$(LOCAL_DIR)/mx_system_get_version.cpp.o: \
+$(BUILDDIR)/$(LOCAL_DIR)/$(LOCAL_DIR)/zx_system_get_version.cpp.o: \
     $(BUILDDIR)/config-buildid.h
 MODULE_COMPILEFLAGS += -I$(BUILDDIR)
 
diff --git a/system/ulib/magenta/syscall-entry.h b/system/ulib/zircon/syscall-entry.h
similarity index 100%
rename from system/ulib/magenta/syscall-entry.h
rename to system/ulib/zircon/syscall-entry.h
diff --git a/system/ulib/magenta/syscall-wrappers.cpp b/system/ulib/zircon/syscall-wrappers.cpp
similarity index 80%
rename from system/ulib/magenta/syscall-wrappers.cpp
rename to system/ulib/zircon/syscall-wrappers.cpp
index f6fbaf2..ebbf2d9 100644
--- a/system/ulib/magenta/syscall-wrappers.cpp
+++ b/system/ulib/zircon/syscall-wrappers.cpp
@@ -4,4 +4,4 @@
 
 #include "private.h"
 
-#include <magenta/syscall-vdso-wrappers.inc>
+#include <zircon/syscall-vdso-wrappers.inc>
diff --git a/system/ulib/magenta/syscalls-arm64.S b/system/ulib/zircon/syscalls-arm64.S
similarity index 68%
rename from system/ulib/magenta/syscalls-arm64.S
rename to system/ulib/zircon/syscalls-arm64.S
index d075303..eebfabc 100644
--- a/system/ulib/magenta/syscalls-arm64.S
+++ b/system/ulib/zircon/syscalls-arm64.S
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-/* define and implement the magenta syscall wrappers for arm64 */
+/* define and implement the zircon syscall wrappers for arm64 */
 
 #include "syscall-entry.h"
-#include "magenta-syscall-arm64.S"
+#include "zircon-syscall-arm64.S"
 
 .text
 
@@ -13,11 +13,11 @@
 
 .macro m_syscall name, num, nargs, public
 syscall_entry_begin \name
-    magenta_syscall \num, \name, \name
+    zircon_syscall \num, \name, \name
     ret
 syscall_entry_end \name \public
 .endm
 
-#include <magenta/syscalls-arm64.S>
+#include <zircon/syscalls-arm64.S>
 
 #include "syscalls-stubs.S"
diff --git a/system/ulib/magenta/syscalls-stubs.S b/system/ulib/zircon/syscalls-stubs.S
similarity index 100%
rename from system/ulib/magenta/syscalls-stubs.S
rename to system/ulib/zircon/syscalls-stubs.S
diff --git a/system/ulib/magenta/syscalls-x86-64.S b/system/ulib/zircon/syscalls-x86-64.S
similarity index 80%
rename from system/ulib/magenta/syscalls-x86-64.S
rename to system/ulib/zircon/syscalls-x86-64.S
index 5a73cc8..d103ce1 100644
--- a/system/ulib/magenta/syscalls-x86-64.S
+++ b/system/ulib/zircon/syscalls-x86-64.S
@@ -2,17 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-/* define and implement the magenta syscall wrappers for x86-64 */
+/* define and implement the zircon syscall wrappers for x86-64 */
 
 #include "syscall-entry.h"
-#include "magenta-syscall-x86-64.S"
+#include "zircon-syscall-x86-64.S"
 
 .text
 
 .cfi_sections .eh_frame, .debug_frame
 
 // The following assembly code converts arguments from the x86-64 SysV
-// ABI's function calling conventions to the conventions used for Magenta
+// ABI's function calling conventions to the conventions used for Zircon
 // syscalls:
 //
 //   arg 1: stays in %rdi
@@ -29,17 +29,17 @@
     .cfi_same_value %r12
     .cfi_same_value %r13
 .if \nargs <= 3
-    magenta_syscall \num, \name, \name
+    zircon_syscall \num, \name, \name
     ret
 .elseif \nargs <= 6
     mov      %rcx, %r10  // Argument 4
-    magenta_syscall \num, \name, \name
+    zircon_syscall \num, \name, \name
     ret
 .elseif \nargs == 7
     push_reg %r12
     mov      0x10(%rsp), %r12  // Argument 7
     mov      %rcx, %r10  // Argument 4
-    magenta_syscall \num, \name, \name
+    zircon_syscall \num, \name, \name
     pop_reg  %r12
     ret
 .elseif \nargs == 8
@@ -48,7 +48,7 @@
     mov      0x18(%rsp), %r12  // Argument 7
     mov      0x20(%rsp), %r13  // Argument 8
     mov      %rcx, %r10  // Argument 4
-    magenta_syscall \num, \name, \name
+    zircon_syscall \num, \name, \name
     pop_reg  %r13
     pop_reg  %r12
     ret
@@ -56,6 +56,6 @@
 syscall_entry_end \name \public
 .endm
 
-#include <magenta/syscalls-x86-64.S>
+#include <zircon/syscalls-x86-64.S>
 
 #include "syscalls-stubs.S"
diff --git a/system/ulib/magenta/magenta-syscall-arm64.S b/system/ulib/zircon/zircon-syscall-arm64.S
similarity index 94%
rename from system/ulib/magenta/magenta-syscall-arm64.S
rename to system/ulib/zircon/zircon-syscall-arm64.S
index 7ba2157..13a6e0d 100644
--- a/system/ulib/magenta/magenta-syscall-arm64.S
+++ b/system/ulib/zircon/zircon-syscall-arm64.S
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-.macro magenta_syscall num, name, caller
+.macro zircon_syscall num, name, caller
     mov x16, #\num
     svc #0x0
 // This symbol at the return address identifies this as an approved call site.
diff --git a/system/ulib/magenta/magenta-syscall-x86-64.S b/system/ulib/zircon/zircon-syscall-x86-64.S
similarity index 93%
rename from system/ulib/magenta/magenta-syscall-x86-64.S
rename to system/ulib/zircon/zircon-syscall-x86-64.S
index 861e37f..decfb71 100644
--- a/system/ulib/magenta/magenta-syscall-x86-64.S
+++ b/system/ulib/zircon/zircon-syscall-x86-64.S
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-.macro magenta_syscall num, name, caller
+.macro zircon_syscall num, name, caller
     mov $\num, %eax
     syscall
 // This symbol at the return address identifies this as an approved call site.
diff --git a/system/ulib/magenta/mx_cache_flush.cpp b/system/ulib/zircon/zx_cache_flush.cpp
similarity index 81%
rename from system/ulib/magenta/mx_cache_flush.cpp
rename to system/ulib/zircon/zx_cache_flush.cpp
index e3b836a..eb2d2ef 100644
--- a/system/ulib/magenta/mx_cache_flush.cpp
+++ b/system/ulib/zircon/zx_cache_flush.cpp
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include "private.h"
 
-mx_status_t _mx_cache_flush(const void* addr, size_t len, uint32_t flags) {
-    if (flags == 0 || (flags & ~(MX_CACHE_FLUSH_INSN | MX_CACHE_FLUSH_DATA)))
-        return MX_ERR_INVALID_ARGS;
+zx_status_t _zx_cache_flush(const void* addr, size_t len, uint32_t flags) {
+    if (flags == 0 || (flags & ~(ZX_CACHE_FLUSH_INSN | ZX_CACHE_FLUSH_DATA)))
+        return ZX_ERR_INVALID_ARGS;
 
 #if defined(__x86_64__)
 
@@ -17,7 +17,7 @@
 
 #elif defined(__aarch64__)
 
-    if (flags & MX_CACHE_FLUSH_DATA) {
+    if (flags & ZX_CACHE_FLUSH_DATA) {
         for (uintptr_t p = ((uintptr_t)addr &
                             -((uintptr_t)DATA_CONSTANTS.dcache_line_size));
              p < (uintptr_t)addr + len;
@@ -27,10 +27,10 @@
         }
     }
 
-    if (flags & MX_CACHE_FLUSH_INSN) {
+    if (flags & ZX_CACHE_FLUSH_INSN) {
         // If we didn't already clean the dcache all the way to the point
         // of coherency, clean it the point to unification.
-        if (!(flags & MX_CACHE_FLUSH_DATA)) {
+        if (!(flags & ZX_CACHE_FLUSH_DATA)) {
             for (uintptr_t p = ((uintptr_t)addr &
                                 -((uintptr_t)DATA_CONSTANTS.dcache_line_size));
                  p < (uintptr_t)addr + len;
@@ -59,7 +59,7 @@
 
 #endif
 
-    return MX_OK;
+    return ZX_OK;
 }
 
-VDSO_INTERFACE_FUNCTION(mx_cache_flush);
+VDSO_INTERFACE_FUNCTION(zx_cache_flush);
diff --git a/system/ulib/zircon/zx_channel_call.cpp b/system/ulib/zircon/zx_channel_call.cpp
new file mode 100644
index 0000000..94d725e
--- /dev/null
+++ b/system/ulib/zircon/zx_channel_call.cpp
@@ -0,0 +1,29 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "private.h"
+
+zx_status_t _zx_channel_call(zx_handle_t handle, uint32_t options,
+                             zx_time_t deadline,
+                             const zx_channel_call_args_t* args,
+                             uint32_t* actual_bytes,
+                             uint32_t* actual_handles,
+                             zx_status_t* read_status) {
+    zx_status_t internal_read_status;
+    zx_status_t* rd_status_p =
+        read_status ? read_status : &internal_read_status;
+
+    zx_status_t status = SYSCALL_zx_channel_call_noretry(
+        handle, options, deadline, args,
+        actual_bytes, actual_handles, rd_status_p);
+    while (unlikely(status == ZX_ERR_CALL_FAILED) &&
+           unlikely(*rd_status_p == ZX_ERR_INTERNAL_INTR_RETRY)) {
+        status = SYSCALL_zx_channel_call_finish(
+            deadline, args, actual_bytes, actual_handles, rd_status_p);
+    }
+
+    return status;
+}
+
+VDSO_INTERFACE_FUNCTION(zx_channel_call);
diff --git a/system/ulib/zircon/zx_deadline_after.cpp b/system/ulib/zircon/zx_deadline_after.cpp
new file mode 100644
index 0000000..a72bd79
--- /dev/null
+++ b/system/ulib/zircon/zx_deadline_after.cpp
@@ -0,0 +1,13 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zircon/syscalls.h>
+
+#include "private.h"
+
+zx_time_t _zx_deadline_after(zx_duration_t nanoseconds) {
+    return nanoseconds + VDSO_zx_time_get(ZX_CLOCK_MONOTONIC);
+}
+
+VDSO_INTERFACE_FUNCTION(zx_deadline_after);
diff --git a/system/ulib/magenta/mx_futex_wake_handle_close_thread_exit-arm64.S b/system/ulib/zircon/zx_futex_wake_handle_close_thread_exit-arm64.S
similarity index 68%
rename from system/ulib/magenta/mx_futex_wake_handle_close_thread_exit-arm64.S
rename to system/ulib/zircon/zx_futex_wake_handle_close_thread_exit-arm64.S
index 1275697..8704cc4 100644
--- a/system/ulib/magenta/mx_futex_wake_handle_close_thread_exit-arm64.S
+++ b/system/ulib/zircon/zx_futex_wake_handle_close_thread_exit-arm64.S
@@ -3,15 +3,15 @@
 // found in the LICENSE file.
 
 #include "syscall-entry.h"
-#include "magenta-syscall-arm64.S"
-#include <magenta/mx-syscall-numbers.h>
+#include "zircon-syscall-arm64.S"
+#include <zircon/zx-syscall-numbers.h>
 
 .text
 
 .cfi_sections .eh_frame, .debug_frame
 
 // (value_ptr: x0, wake_count: w1, new_value: w2, handle: w3)
-syscall_entry_begin mx_futex_wake_handle_close_thread_exit
+syscall_entry_begin zx_futex_wake_handle_close_thread_exit
 
     // Store the value into the futex, which should signal that the stack is no longer in use.
     // atomic_store_explicit(value_ptr, new_value, memory_order_release)
@@ -23,14 +23,14 @@
     // Since this function cannot return, do not bother preserving the old contents.
     mov w19, w3
 
-    magenta_syscall MX_SYS_futex_wake, mx_futex_wake, mx_futex_wake_handle_close_thread_exit
+    zircon_syscall ZX_SYS_futex_wake, zx_futex_wake, zx_futex_wake_handle_close_thread_exit
     cbnz x0, .Lfutex_wake_fail
 
     mov w0, w19
-    magenta_syscall MX_SYS_handle_close, mx_handle_close, mx_futex_wake_handle_close_thread_exit
+    zircon_syscall ZX_SYS_handle_close, zx_handle_close, zx_futex_wake_handle_close_thread_exit
     cbnz x0, .Lhandle_close_fail
 
-    magenta_syscall MX_SYS_thread_exit, mx_thread_exit, mx_futex_wake_handle_close_thread_exit
+    zircon_syscall ZX_SYS_thread_exit, zx_thread_exit, zx_futex_wake_handle_close_thread_exit
 
     // It should be impossible to get here.
 .Lthread_exit_returned:
@@ -42,4 +42,4 @@
 .Lhandle_close_fail:
     brk #1000
 
-syscall_entry_end mx_futex_wake_handle_close_thread_exit
+syscall_entry_end zx_futex_wake_handle_close_thread_exit
diff --git a/system/ulib/magenta/mx_futex_wake_handle_close_thread_exit-x86-64.S b/system/ulib/zircon/zx_futex_wake_handle_close_thread_exit-x86-64.S
similarity index 68%
rename from system/ulib/magenta/mx_futex_wake_handle_close_thread_exit-x86-64.S
rename to system/ulib/zircon/zx_futex_wake_handle_close_thread_exit-x86-64.S
index 503031d..695f42b 100644
--- a/system/ulib/magenta/mx_futex_wake_handle_close_thread_exit-x86-64.S
+++ b/system/ulib/zircon/zx_futex_wake_handle_close_thread_exit-x86-64.S
@@ -3,15 +3,15 @@
 // found in the LICENSE file.
 
 #include "syscall-entry.h"
-#include "magenta-syscall-x86-64.S"
-#include <magenta/mx-syscall-numbers.h>
+#include "zircon-syscall-x86-64.S"
+#include <zircon/zx-syscall-numbers.h>
 
 .text
 
 .cfi_sections .eh_frame, .debug_frame
 
 // (value_ptr: %rdi, wake_count: %esi, new_value: %edx, handle: %ecx)
-syscall_entry_begin mx_futex_wake_handle_close_thread_exit
+syscall_entry_begin zx_futex_wake_handle_close_thread_exit
 
     // Store the value into the futex, which should signal that the stack is no longer in use.
     // atomic_store_explicit(value_ptr, new_value, memory_order_release)
@@ -23,16 +23,16 @@
     // Since this function cannot return, do not bother preserving the old contents.
     mov %ecx, %ebx
 
-    magenta_syscall MX_SYS_futex_wake, mx_futex_wake, mx_futex_wake_handle_close_thread_exit
+    zircon_syscall ZX_SYS_futex_wake, zx_futex_wake, zx_futex_wake_handle_close_thread_exit
     test %eax, %eax
     jnz .Lfutex_wake_fail
 
     mov %ebx, %edi
-    magenta_syscall MX_SYS_handle_close, mx_handle_close, mx_futex_wake_handle_close_thread_exit
+    zircon_syscall ZX_SYS_handle_close, zx_handle_close, zx_futex_wake_handle_close_thread_exit
     test %eax, %eax
     jnz .Lhandle_close_fail
 
-    magenta_syscall MX_SYS_thread_exit, mx_thread_exit, mx_futex_wake_handle_close_thread_exit
+    zircon_syscall ZX_SYS_thread_exit, zx_thread_exit, zx_futex_wake_handle_close_thread_exit
 
     // It should be impossible to get here.
 .Lthread_exit_returned:
@@ -44,4 +44,4 @@
 .Lhandle_close_fail:
     ud2
 
-syscall_entry_end mx_futex_wake_handle_close_thread_exit
+syscall_entry_end zx_futex_wake_handle_close_thread_exit
diff --git a/system/ulib/zircon/zx_status_get_string.cpp b/system/ulib/zircon/zx_status_get_string.cpp
new file mode 100644
index 0000000..7cbb0ac
--- /dev/null
+++ b/system/ulib/zircon/zx_status_get_string.cpp
@@ -0,0 +1,72 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zircon/status.h>
+
+#include "private.h"
+
+const char* _zx_status_get_string(zx_status_t status) {
+    switch (status) {
+    case ZX_OK: return "ZX_OK";
+    case ZX_ERR_INTERNAL: return "ZX_ERR_INTERNAL";
+    case ZX_ERR_NOT_SUPPORTED: return "ZX_ERR_NOT_SUPPORTED";
+    case ZX_ERR_NO_RESOURCES: return "ZX_ERR_NO_RESOURCES";
+    case ZX_ERR_NO_MEMORY: return "ZX_ERR_NO_MEMORY";
+    case ZX_ERR_CALL_FAILED: return "ZX_ERR_CALL_FAILED";
+    case ZX_ERR_INTERNAL_INTR_RETRY: return "ZX_ERR_INTERNAL_INTR_KILLED_RETRY";
+    case ZX_ERR_INVALID_ARGS: return "ZX_ERR_INVALID_ARGS";
+    case ZX_ERR_BAD_HANDLE: return "ZX_ERR_BAD_HANDLE";
+    case ZX_ERR_WRONG_TYPE: return "ZX_ERR_WRONG_TYPE";
+    case ZX_ERR_BAD_SYSCALL: return "ZX_ERR_BAD_SYSCALL";
+    case ZX_ERR_OUT_OF_RANGE: return "ZX_ERR_OUT_OF_RANGE";
+    case ZX_ERR_BUFFER_TOO_SMALL: return "ZX_ERR_BUFFER_TOO_SMALL";
+    case ZX_ERR_BAD_STATE: return "ZX_ERR_BAD_STATE";
+    case ZX_ERR_TIMED_OUT: return "ZX_ERR_TIMED_OUT";
+    case ZX_ERR_SHOULD_WAIT: return "ZX_ERR_SHOULD_WAIT";
+    case ZX_ERR_CANCELED: return "ZX_ERR_CANCELED";
+    case ZX_ERR_PEER_CLOSED: return "ZX_ERR_PEER_CLOSED";
+    case ZX_ERR_NOT_FOUND: return "ZX_ERR_NOT_FOUND";
+    case ZX_ERR_ALREADY_EXISTS: return "ZX_ERR_ALREADY_EXISTS";
+    case ZX_ERR_ALREADY_BOUND: return "ZX_ERR_ALREADY_BOUND";
+    case ZX_ERR_UNAVAILABLE: return "ZX_ERR_UNAVAILABLE";
+    case ZX_ERR_ACCESS_DENIED: return "ZX_ERR_ACCESS_DENIED";
+    case ZX_ERR_IO: return "ZX_ERR_IO";
+    case ZX_ERR_IO_REFUSED: return "ZX_ERR_IO_REFUSED";
+    case ZX_ERR_IO_DATA_INTEGRITY: return "ZX_ERR_IO_DATA_INTEGRITY";
+    case ZX_ERR_IO_DATA_LOSS: return "ZX_ERR_IO_DATA_LOSS";
+    case ZX_ERR_IO_NOT_PRESENT: return "ZX_ERR_IO_NOT_PRESENT";
+    case ZX_ERR_BAD_PATH: return "ZX_ERR_BAD_PATH";
+    case ZX_ERR_NOT_DIR: return "ZX_ERR_NOT_DIR";
+    case ZX_ERR_NOT_FILE: return "ZX_ERR_NOT_FILE";
+    case ZX_ERR_FILE_BIG: return "ZX_ERR_FILE_BIG";
+    case ZX_ERR_NO_SPACE: return "ZX_ERR_NO_SPACE";
+    case ZX_ERR_STOP: return "ZX_ERR_STOP";
+    case ZX_ERR_NEXT: return "ZX_ERR_NEXT";
+    case ZX_ERR_PROTOCOL_NOT_SUPPORTED: return "ZX_ERR_PROTOCOL_NOT_SUPPORTED";
+    case ZX_ERR_ADDRESS_UNREACHABLE: return "ZX_ERR_ADDRESS_UNREACHABLE";
+    case ZX_ERR_ADDRESS_IN_USE: return "ZX_ERR_ADDRESS_IN_USE";
+    case ZX_ERR_NOT_CONNECTED: return "ZX_ERR_NOT_CONNECTED";
+    case ZX_ERR_CONNECTION_REFUSED: return "ZX_ERR_CONNECTION_REFUSED";
+    case ZX_ERR_CONNECTION_RESET: return "ZX_ERR_CONNECTION_RESET";
+    case ZX_ERR_CONNECTION_ABORTED: return "ZX_ERR_CONNECTION_ABORTED";
+    default: return "(UNKNOWN)";
+
+    // TODO(mcgrathr): Having this extra case here (a value far away from
+    // the other values) forces LLVM to disable its switch->table-lookup
+    // optimization.  That optimization produces a table of pointers in
+    // rodata, which is not PIC-friendly (requires a dynamic reloc for each
+    // element) and so makes the vDSO build bomb out at link time.  Some
+    // day we'll teach LLVM either to disable this optimization in PIC mode
+    // when it would result in dynamic relocs, or (ideally) to generate a
+    // PIC-friendly lookup table like it does for jump tables.
+    case 99999: return "(UNKNOWN)";
+    }
+}
+
+VDSO_INTERFACE_FUNCTION(zx_status_get_string);
+
+// Generated with:
+// grep '#define'  system/public/zircon/errors.h | grep -v ZX_OK |
+// sed 's/.*ZX_ERR_/ZX_ERR_/g' | sed 's/\s.*//g' |
+// awk '{print "case "$1": return \""$1"\";";}'
diff --git a/system/ulib/magenta/mx_system_get_num_cpus.cpp b/system/ulib/zircon/zx_system_get_num_cpus.cpp
similarity index 60%
rename from system/ulib/magenta/mx_system_get_num_cpus.cpp
rename to system/ulib/zircon/zx_system_get_num_cpus.cpp
index 3b4f684..a75b297 100644
--- a/system/ulib/magenta/mx_system_get_num_cpus.cpp
+++ b/system/ulib/zircon/zx_system_get_num_cpus.cpp
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include "private.h"
 
-uint32_t _mx_system_get_num_cpus(void) {
+uint32_t _zx_system_get_num_cpus(void) {
     return DATA_CONSTANTS.max_num_cpus;
 }
 
-VDSO_INTERFACE_FUNCTION(mx_system_get_num_cpus);
+VDSO_INTERFACE_FUNCTION(zx_system_get_num_cpus);
diff --git a/system/ulib/magenta/mx_system_get_physmem.cpp b/system/ulib/zircon/zx_system_get_physmem.cpp
similarity index 65%
rename from system/ulib/magenta/mx_system_get_physmem.cpp
rename to system/ulib/zircon/zx_system_get_physmem.cpp
index f91d34f..d97527a 100644
--- a/system/ulib/magenta/mx_system_get_physmem.cpp
+++ b/system/ulib/zircon/zx_system_get_physmem.cpp
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include "private.h"
 
-uint64_t _mx_system_get_physmem(void) {
+uint64_t _zx_system_get_physmem(void) {
     return DATA_CONSTANTS.physmem;
 }
 
-VDSO_INTERFACE_FUNCTION(mx_system_get_physmem);
+VDSO_INTERFACE_FUNCTION(zx_system_get_physmem);
diff --git a/system/ulib/zircon/zx_system_get_version.cpp b/system/ulib/zircon/zx_system_get_version.cpp
new file mode 100644
index 0000000..edef681
--- /dev/null
+++ b/system/ulib/zircon/zx_system_get_version.cpp
@@ -0,0 +1,20 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zircon/syscalls.h>
+
+#include "config-buildid.h"
+#include "private.h"
+
+static const char kZirconVersion[] = BUILDID;
+
+zx_status_t _zx_system_get_version(char* version, uint32_t version_len) {
+    if (version_len < sizeof(kZirconVersion))
+        return ZX_ERR_BUFFER_TOO_SMALL;
+    for (size_t i = 0; i < sizeof(kZirconVersion); ++i)
+        version[i] = kZirconVersion[i];
+    return ZX_OK;
+}
+
+VDSO_INTERFACE_FUNCTION(zx_system_get_version);
diff --git a/system/ulib/magenta/mx_ticks_get.cpp b/system/ulib/zircon/zx_ticks_get.cpp
similarity index 75%
rename from system/ulib/magenta/mx_ticks_get.cpp
rename to system/ulib/zircon/zx_ticks_get.cpp
index 8147b75..1b247ee 100644
--- a/system/ulib/magenta/mx_ticks_get.cpp
+++ b/system/ulib/zircon/zx_ticks_get.cpp
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include "private.h"
 
-uint64_t _mx_ticks_get(void) {
+uint64_t _zx_ticks_get(void) {
 #if __aarch64__
     uint64_t ticks;
     __asm__ volatile("mrs %0, pmccntr_el0" : "=r" (ticks));
@@ -21,10 +21,10 @@
 #endif
 }
 
-VDSO_INTERFACE_FUNCTION(mx_ticks_get);
+VDSO_INTERFACE_FUNCTION(zx_ticks_get);
 
-// At boot time the kernel can decide to redirect the {_,}mx_ticks_get
+// At boot time the kernel can decide to redirect the {_,}zx_ticks_get
 // dynamic symbol table entries to point to this instead.  See VDso::VDso.
 VDSO_KERNEL_EXPORT uint64_t CODE_soft_ticks_get(void) {
-    return VDSO_mx_time_get(MX_CLOCK_MONOTONIC);
+    return VDSO_zx_time_get(ZX_CLOCK_MONOTONIC);
 }
diff --git a/system/ulib/magenta/mx_ticks_per_second.cpp b/system/ulib/zircon/zx_ticks_per_second.cpp
similarity index 62%
rename from system/ulib/magenta/mx_ticks_per_second.cpp
rename to system/ulib/zircon/zx_ticks_per_second.cpp
index 9446d29..adbeb68 100644
--- a/system/ulib/magenta/mx_ticks_per_second.cpp
+++ b/system/ulib/zircon/zx_ticks_per_second.cpp
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include "private.h"
 
-uint64_t _mx_ticks_per_second(void) {
+uint64_t _zx_ticks_per_second(void) {
     return DATA_CONSTANTS.ticks_per_second;
 }
 
-VDSO_INTERFACE_FUNCTION(mx_ticks_per_second);
+VDSO_INTERFACE_FUNCTION(zx_ticks_per_second);
diff --git a/system/ulib/magenta/mx_vmar_unmap_handle_close_thread_exit-arm64.S b/system/ulib/zircon/zx_vmar_unmap_handle_close_thread_exit-arm64.S
similarity index 65%
rename from system/ulib/magenta/mx_vmar_unmap_handle_close_thread_exit-arm64.S
rename to system/ulib/zircon/zx_vmar_unmap_handle_close_thread_exit-arm64.S
index 9280222..c0f26e2 100644
--- a/system/ulib/magenta/mx_vmar_unmap_handle_close_thread_exit-arm64.S
+++ b/system/ulib/zircon/zx_vmar_unmap_handle_close_thread_exit-arm64.S
@@ -3,15 +3,15 @@
 // found in the LICENSE file.
 
 #include "syscall-entry.h"
-#include "magenta-syscall-arm64.S"
-#include <magenta/mx-syscall-numbers.h>
+#include "zircon-syscall-arm64.S"
+#include <zircon/zx-syscall-numbers.h>
 
 .text
 
 .cfi_sections .eh_frame, .debug_frame
 
 // (vmar_handle: x0, addr: x1, len: x2, handle: x3)
-syscall_entry_begin mx_vmar_unmap_handle_close_thread_exit
+syscall_entry_begin zx_vmar_unmap_handle_close_thread_exit
 
     // Save the handle argument in a callee-saves register (x19).
     // Callee-save that register so we can unwind in the error case.
@@ -20,16 +20,16 @@
     push_regpair x19, x20
     mov x19, x3
 
-    magenta_syscall MX_SYS_vmar_unmap, mx_vmar_unmap, mx_vmar_unmap_handle_close_thread_exit
+    zircon_syscall ZX_SYS_vmar_unmap, zx_vmar_unmap, zx_vmar_unmap_handle_close_thread_exit
     cbnz x0, .Lvmar_unmap_fail
 
     // Now the stack is gone and we can never return!
 
     mov x0, x19
-    magenta_syscall MX_SYS_handle_close, mx_handle_close, mx_vmar_unmap_handle_close_thread_exit
+    zircon_syscall ZX_SYS_handle_close, zx_handle_close, zx_vmar_unmap_handle_close_thread_exit
     cbnz x0, .Lhandle_close_fail
 
-    magenta_syscall MX_SYS_thread_exit, mx_thread_exit, mx_vmar_unmap_handle_close_thread_exit
+    zircon_syscall ZX_SYS_thread_exit, zx_thread_exit, zx_vmar_unmap_handle_close_thread_exit
 
     // It should be impossible to get here.
 .Lthread_exit_returned:
@@ -42,4 +42,4 @@
 .Lhandle_close_fail:
     brk #1000
 
-syscall_entry_end mx_vmar_unmap_handle_close_thread_exit
+syscall_entry_end zx_vmar_unmap_handle_close_thread_exit
diff --git a/system/ulib/magenta/mx_vmar_unmap_handle_close_thread_exit-x86-64.S b/system/ulib/zircon/zx_vmar_unmap_handle_close_thread_exit-x86-64.S
similarity index 62%
rename from system/ulib/magenta/mx_vmar_unmap_handle_close_thread_exit-x86-64.S
rename to system/ulib/zircon/zx_vmar_unmap_handle_close_thread_exit-x86-64.S
index ed3a14f..74903ca 100644
--- a/system/ulib/magenta/mx_vmar_unmap_handle_close_thread_exit-x86-64.S
+++ b/system/ulib/zircon/zx_vmar_unmap_handle_close_thread_exit-x86-64.S
@@ -3,33 +3,33 @@
 // found in the LICENSE file.
 
 #include "syscall-entry.h"
-#include "magenta-syscall-x86-64.S"
-#include <magenta/mx-syscall-numbers.h>
+#include "zircon-syscall-x86-64.S"
+#include <zircon/zx-syscall-numbers.h>
 
 .text
 
 .cfi_sections .eh_frame, .debug_frame
 
 // (vmar_handle: %rdi, addr: %rsi, len: %rdx, handle: %ecx)
-syscall_entry_begin mx_vmar_unmap_handle_close_thread_exit
+syscall_entry_begin zx_vmar_unmap_handle_close_thread_exit
 
     // Save the handle argument in a callee-saves register (%rbx).
     // Callee-save that register so we can unwind in the error case.
     push_reg %rbx
     mov %ecx, %ebx
 
-    magenta_syscall MX_SYS_vmar_unmap, mx_vmar_unmap, mx_vmar_unmap_handle_close_thread_exit
+    zircon_syscall ZX_SYS_vmar_unmap, zx_vmar_unmap, zx_vmar_unmap_handle_close_thread_exit
     test %eax, %eax
     jnz .Lvmar_unmap_fail
 
     // Now the stack is gone and we can never return!
 
     mov %ebx, %edi
-    magenta_syscall MX_SYS_handle_close, mx_handle_close, mx_vmar_unmap_handle_close_thread_exit
+    zircon_syscall ZX_SYS_handle_close, zx_handle_close, zx_vmar_unmap_handle_close_thread_exit
     test %eax, %eax
     jnz .Lhandle_close_fail
 
-    magenta_syscall MX_SYS_thread_exit, mx_thread_exit, mx_vmar_unmap_handle_close_thread_exit
+    zircon_syscall ZX_SYS_thread_exit, zx_thread_exit, zx_vmar_unmap_handle_close_thread_exit
 
     // It should be impossible to get here.
 .Lthread_exit_returned:
@@ -42,4 +42,4 @@
 .Lhandle_close_fail:
     ud2
 
-syscall_entry_end mx_vmar_unmap_handle_close_thread_exit
+syscall_entry_end zx_vmar_unmap_handle_close_thread_exit
diff --git a/system/ulib/zx/BUILD.gn b/system/ulib/zx/BUILD.gn
new file mode 100644
index 0000000..748cb1e
--- /dev/null
+++ b/system/ulib/zx/BUILD.gn
@@ -0,0 +1,48 @@
+# Copyright 2016 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+config("zx_config") {
+  include_dirs = [ "include" ]
+}
+
+static_library("zx") {
+  # Don't forget to update rules.mk as well for the Zircon build.
+  sources = [
+    "channel.cpp",
+    "event.cpp",
+    "eventpair.cpp",
+    "fifo.cpp",
+    "include/zx/channel.h",
+    "include/zx/event.h",
+    "include/zx/eventpair.h",
+    "include/zx/fifo.h",
+    "include/zx/handle.h",
+    "include/zx/job.h",
+    "include/zx/log.h",
+    "include/zx/object.h",
+    "include/zx/object_traits.h",
+    "include/zx/port.h",
+    "include/zx/process.h",
+    "include/zx/socket.h",
+    "include/zx/task.h",
+    "include/zx/thread.h",
+    "include/zx/time.h",
+    "include/zx/timer.h",
+    "include/zx/vmar.h",
+    "include/zx/vmo.h",
+    "job.cpp",
+    "log.cpp",
+    "port.cpp",
+    "process.cpp",
+    "socket.cpp",
+    "thread.cpp",
+    "timer.cpp",
+    "vmar.cpp",
+    "vmo.cpp",
+  ]
+
+  public_configs = [ ":zx_config" ]
+
+  libs = [ "zircon" ]
+}
diff --git a/system/ulib/mx/README.md b/system/ulib/zx/README.md
similarity index 73%
rename from system/ulib/mx/README.md
rename to system/ulib/zx/README.md
index cde3455..1b87e78 100644
--- a/system/ulib/mx/README.md
+++ b/system/ulib/zx/README.md
@@ -1,7 +1,7 @@
-# The C++ mx library
+# The C++ zx library
 
 The intention of this library is to provide an idiomatic C++ interface
-to using Magenta handles and syscalls. This library provides type
+to using Zircon handles and syscalls. This library provides type
 safety and move semantics on top of the C calls.
 
 This library does not do more than that. In particular, thread and
@@ -10,5 +10,5 @@
 use the libc (or libc++ etc.) calls, and for process creation the
 launchpad APIs.
 
-This library is usable both within the Magenta repo as well as the
+This library is usable both within the Zircon repo as well as the
 general Fuchsia gn build.
diff --git a/system/ulib/zx/channel.cpp b/system/ulib/zx/channel.cpp
new file mode 100644
index 0000000..187aa03
--- /dev/null
+++ b/system/ulib/zx/channel.cpp
@@ -0,0 +1,20 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/channel.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t channel::create(uint32_t flags, channel* endpoint0,
+                            channel* endpoint1) {
+    zx_handle_t h0, h1;
+    zx_status_t result = zx_channel_create(flags, &h0, &h1);
+    endpoint0->reset(h0);
+    endpoint1->reset(h1);
+    return result;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/event.cpp b/system/ulib/zx/event.cpp
new file mode 100644
index 0000000..3067cbb
--- /dev/null
+++ b/system/ulib/zx/event.cpp
@@ -0,0 +1,22 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/event.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t event::create(uint32_t options, event* result) {
+    zx_handle_t h;
+    zx_status_t status = zx_event_create(options, &h);
+    if (status < 0) {
+        result->reset(ZX_HANDLE_INVALID);
+    } else {
+        result->reset(h);
+    }
+    return status;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/eventpair.cpp b/system/ulib/zx/eventpair.cpp
new file mode 100644
index 0000000..ab78c0e
--- /dev/null
+++ b/system/ulib/zx/eventpair.cpp
@@ -0,0 +1,21 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/eventpair.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t eventpair::create(uint32_t flags, eventpair* endpoint0,
+                              eventpair* endpoint1) {
+    zx_handle_t h0 = ZX_HANDLE_INVALID;
+    zx_handle_t h1 = ZX_HANDLE_INVALID;
+    zx_status_t result = zx_eventpair_create(flags, &h0, &h1);
+    endpoint0->reset(h0);
+    endpoint1->reset(h1);
+    return result;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/fifo.cpp b/system/ulib/zx/fifo.cpp
new file mode 100644
index 0000000..0354dea
--- /dev/null
+++ b/system/ulib/zx/fifo.cpp
@@ -0,0 +1,20 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/fifo.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t fifo::create(uint32_t elem_count, uint32_t elem_size,
+                         uint32_t options, fifo* out0, fifo* out1) {
+    zx_handle_t h0 = ZX_HANDLE_INVALID, h1 = ZX_HANDLE_INVALID;
+    zx_status_t result = zx_fifo_create(elem_count, elem_size, options, &h0, &h1);
+    out0->reset(h0);
+    out1->reset(h1);
+    return result;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/channel.h b/system/ulib/zx/include/zx/channel.h
new file mode 100644
index 0000000..0af7876
--- /dev/null
+++ b/system/ulib/zx/include/zx/channel.h
@@ -0,0 +1,56 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/handle.h>
+#include <zx/object.h>
+
+namespace zx {
+
+class channel : public object<channel> {
+public:
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_CHANNEL;
+
+    constexpr channel() = default;
+
+    explicit channel(zx_handle_t value) : object(value) {}
+
+    explicit channel(handle&& h) : object(h.release()) {}
+
+    channel(channel&& other) : object(other.release()) {}
+
+    channel& operator=(channel&& other) {
+        reset(other.release());
+        return *this;
+    }
+
+    static zx_status_t create(uint32_t flags, channel* endpoint0,
+                              channel* endpoint1);
+
+    zx_status_t read(uint32_t flags, void* bytes, uint32_t num_bytes,
+                     uint32_t* actual_bytes, zx_handle_t* handles,
+                     uint32_t num_handles, uint32_t* actual_handles) const {
+        return zx_channel_read(get(), flags, bytes, handles, num_bytes,
+                               num_handles, actual_bytes, actual_handles);
+    }
+
+    zx_status_t write(uint32_t flags, const void* bytes, uint32_t num_bytes,
+                      const zx_handle_t* handles, uint32_t num_handles) const {
+        return zx_channel_write(get(), flags, bytes, num_bytes, handles,
+                                num_handles);
+    }
+
+    zx_status_t call(uint32_t flags, zx_time_t deadline,
+                     const zx_channel_call_args_t* args,
+                     uint32_t* actual_bytes, uint32_t* actual_handles,
+                     zx_status_t* read_status) const {
+        return zx_channel_call(get(), flags, deadline, args, actual_bytes,
+                               actual_handles, read_status);
+    }
+};
+
+using unowned_channel = const unowned<channel>;
+
+} // namespace zx
diff --git a/system/ulib/mx/include/mx/event.h b/system/ulib/zx/include/zx/event.h
similarity index 66%
rename from system/ulib/mx/include/mx/event.h
rename to system/ulib/zx/include/zx/event.h
index 2d16f1c..0d4ef83 100644
--- a/system/ulib/mx/include/mx/event.h
+++ b/system/ulib/zx/include/zx/event.h
@@ -4,18 +4,18 @@
 
 #pragma once
 
-#include <mx/handle.h>
-#include <mx/object.h>
+#include <zx/handle.h>
+#include <zx/object.h>
 
-namespace mx {
+namespace zx {
 
 class event : public object<event> {
 public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_EVENT;
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_EVENT;
 
     constexpr event() = default;
 
-    explicit event(mx_handle_t value) : object(value) {}
+    explicit event(zx_handle_t value) : object(value) {}
 
     explicit event(handle&& h) : object(h.release()) {}
 
@@ -26,9 +26,9 @@
         return *this;
     }
 
-    static mx_status_t create(uint32_t options, event* result);
+    static zx_status_t create(uint32_t options, event* result);
 };
 
 using unowned_event = const unowned<event>;
 
-} // namespace mx
+} // namespace zx
diff --git a/system/ulib/mx/include/mx/eventpair.h b/system/ulib/zx/include/zx/eventpair.h
similarity index 69%
rename from system/ulib/mx/include/mx/eventpair.h
rename to system/ulib/zx/include/zx/eventpair.h
index 2be86bb..2d51ef5 100644
--- a/system/ulib/mx/include/mx/eventpair.h
+++ b/system/ulib/zx/include/zx/eventpair.h
@@ -4,18 +4,18 @@
 
 #pragma once
 
-#include <mx/handle.h>
-#include <mx/object.h>
+#include <zx/handle.h>
+#include <zx/object.h>
 
-namespace mx {
+namespace zx {
 
 class eventpair : public object<eventpair> {
 public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_EVENT_PAIR;
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_EVENT_PAIR;
 
     constexpr eventpair() = default;
 
-    explicit eventpair(mx_handle_t value) : object(value) {}
+    explicit eventpair(zx_handle_t value) : object(value) {}
 
     explicit eventpair(handle&& h) : object(h.release()) {}
 
@@ -26,10 +26,10 @@
         return *this;
     }
 
-    static mx_status_t create(uint32_t options, eventpair* endpoint0,
+    static zx_status_t create(uint32_t options, eventpair* endpoint0,
                               eventpair* endpoint1);
 };
 
 using unowned_eventpair = const unowned<eventpair>;
 
-} // namespace mx
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/fifo.h b/system/ulib/zx/include/zx/fifo.h
new file mode 100644
index 0000000..c72adff
--- /dev/null
+++ b/system/ulib/zx/include/zx/fifo.h
@@ -0,0 +1,43 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/handle.h>
+#include <zx/object.h>
+
+namespace zx {
+
+class fifo : public object<fifo> {
+public:
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_FIFO;
+
+    constexpr fifo() = default;
+
+    explicit fifo(zx_handle_t value) : object(value) {}
+
+    explicit fifo(handle&& h) : object(h.release()) {}
+
+    fifo(fifo&& other) : object(other.release()) {}
+
+    fifo& operator=(fifo&& other) {
+        reset(other.release());
+        return *this;
+    }
+
+    static zx_status_t create(uint32_t elem_count, uint32_t elem_size,
+                              uint32_t options, fifo* out0, fifo* out1);
+
+    zx_status_t write(const void* buffer, size_t len, uint32_t* actual_entries) const {
+        return zx_fifo_write(get(), buffer, len, actual_entries);
+    }
+
+    zx_status_t read(void* buffer, size_t len, uint32_t* actual_entries) const {
+        return zx_fifo_read(get(), buffer, len, actual_entries);
+    }
+};
+
+using unowned_fifo = const unowned<fifo>;
+
+} // namespace zx
diff --git a/system/ulib/mx/include/mx/handle.h b/system/ulib/zx/include/zx/handle.h
similarity index 81%
rename from system/ulib/mx/include/mx/handle.h
rename to system/ulib/zx/include/zx/handle.h
index 855d729..1efa4a7 100644
--- a/system/ulib/mx/include/mx/handle.h
+++ b/system/ulib/zx/include/zx/handle.h
@@ -4,11 +4,11 @@
 
 #pragma once
 
-#include <mx/object.h>
+#include <zx/object.h>
 
-namespace mx {
+namespace zx {
 
 using handle = object<void>;
 using unowned_handle = const unowned<handle>;
 
-} // namespace mx
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/job.h b/system/ulib/zx/include/zx/job.h
new file mode 100644
index 0000000..8de7d1a
--- /dev/null
+++ b/system/ulib/zx/include/zx/job.h
@@ -0,0 +1,44 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/task.h>
+#include <zircon/process.h>
+
+namespace zx {
+
+class job : public task<job> {
+public:
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_JOB;
+
+    constexpr job() = default;
+
+    explicit job(zx_handle_t value) : task(value) {}
+
+    explicit job(handle&& h) : task(h.release()) {}
+
+    job(job&& other) : task(other.release()) {}
+
+    job& operator=(job&& other) {
+        reset(other.release());
+        return *this;
+    }
+
+    static zx_status_t create(zx_handle_t parent_job, uint32_t options, job* result);
+
+    zx_status_t set_policy(uint32_t options, uint32_t topic, void* policy, uint32_t count) const {
+      return zx_job_set_policy(get(), options, topic, policy, count);
+    }
+
+    // Ideally this would be called zx::job::default(), but default is a
+    // C++ keyword and cannot be used as a function name.
+    static inline const unowned<job> default_job() {
+        return unowned<job>(zx_job_default());
+    }
+};
+
+using unowned_job = const unowned<job>;
+
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/log.h b/system/ulib/zx/include/zx/log.h
new file mode 100644
index 0000000..d1a9b2b
--- /dev/null
+++ b/system/ulib/zx/include/zx/log.h
@@ -0,0 +1,42 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/handle.h>
+#include <zx/object.h>
+
+namespace zx {
+
+class log : public object<log> {
+public:
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_LOG;
+
+    constexpr log() = default;
+
+    explicit log(zx_handle_t value) : object(value) {}
+
+    explicit log(handle&& h) : object(h.release()) {}
+
+    log(log&& other) : object(other.release()) {}
+
+    log& operator=(log&& other) {
+        reset(other.release());
+        return *this;
+    }
+
+    static zx_status_t create(log* result, uint32_t flags);
+
+    zx_status_t write(uint32_t len, const void* buffer, uint32_t flags) const {
+        return zx_log_write(get(), len, buffer, flags);
+    }
+
+    zx_status_t read(uint32_t len, void* buffer, uint32_t flags) const {
+        return zx_log_read(get(), len, buffer, flags);
+    }
+};
+
+using unowned_log = const unowned<log>;
+
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/object.h b/system/ulib/zx/include/zx/object.h
new file mode 100644
index 0000000..9c78b8a
--- /dev/null
+++ b/system/ulib/zx/include/zx/object.h
@@ -0,0 +1,231 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
+#include <zx/object_traits.h>
+
+namespace zx {
+
+class port;
+
+// Wraps and takes ownership of a handle to an object to provide type-safe
+// access to its operations.  The handle is automatically closed when the
+// wrapper is destroyed.
+template <typename T> class object {
+public:
+    constexpr object() : value_(ZX_HANDLE_INVALID) {}
+
+    explicit object(zx_handle_t value) : value_(value) {}
+
+    template <typename U> object(object<U>&& other) : value_(other.release()) {
+        static_assert(is_same<T, void>::value, "Receiver must be compatible.");
+    }
+
+    ~object() { close(); }
+
+    template <typename U> object<T>& operator=(object<U>&& other) {
+        static_assert(is_same<T, void>::value, "Receiver must be compatible.");
+        reset(other.release());
+        return *this;
+    }
+
+    void reset(zx_handle_t value = ZX_HANDLE_INVALID) {
+        close();
+        value_ = value;
+    }
+
+    void swap(object<T>& other) {
+        zx_handle_t tmp = value_;
+        value_ = other.value_;
+        other.value_ = tmp;
+    }
+
+    zx_status_t duplicate(zx_rights_t rights, object<T>* result) const {
+        static_assert(object_traits<T>::supports_duplication,
+                      "Receiver must support duplication.");
+        zx_handle_t h = ZX_HANDLE_INVALID;
+        zx_status_t status = zx_handle_duplicate(value_, rights, &h);
+        result->reset(h);
+        return status;
+    }
+
+    zx_status_t replace(zx_rights_t rights, object<T>* result) {
+        zx_handle_t h = ZX_HANDLE_INVALID;
+        zx_status_t status = zx_handle_replace(value_, rights, &h);
+        // We store ZX_HANDLE_INVALID to value_ before calling reset on result
+        // in case result == this.
+        if (status == ZX_OK)
+            value_ = ZX_HANDLE_INVALID;
+        result->reset(h);
+        return status;
+    }
+
+    zx_status_t wait_one(zx_signals_t signals, zx_time_t deadline,
+                         zx_signals_t* pending) const {
+        return zx_object_wait_one(value_, signals, deadline, pending);
+    }
+
+    zx_status_t wait_async(const object<port>& port, uint64_t key,
+                           zx_signals_t signals, uint32_t options) const {
+        return zx_object_wait_async(value_, port.get(), key, signals, options);
+    }
+
+    static zx_status_t wait_many(zx_wait_item_t* wait_items, uint32_t count, zx_time_t deadline) {
+        return zx_object_wait_many(wait_items, count, deadline);
+    }
+
+    // TODO(abarth): Not all of these methods apply to every type of object. We
+    // should sort out which ones apply where and limit them to the interfaces
+    // where they work.
+
+    zx_status_t signal(uint32_t clear_mask, uint32_t set_mask) const {
+        static_assert(object_traits<T>::supports_user_signal,
+                      "Receiver must support user signals.");
+        return zx_object_signal(get(), clear_mask, set_mask);
+    }
+
+    zx_status_t signal_peer(uint32_t clear_mask, uint32_t set_mask) const {
+        static_assert(object_traits<T>::supports_user_signal,
+                      "Receiver must support user signals.");
+        static_assert(object_traits<T>::has_peer_handle,
+                      "Receiver must have peer object.");
+        return zx_object_signal_peer(get(), clear_mask, set_mask);
+    }
+
+    zx_status_t get_info(uint32_t topic, void* buffer,
+                         size_t buffer_size,
+                         size_t* actual_count, size_t* avail_count) const {
+        return zx_object_get_info(get(), topic, buffer, buffer_size, actual_count, avail_count);
+    }
+
+    zx_status_t get_child(uint64_t koid, zx_rights_t rights,
+                          object<T>* result) const {
+        zx_handle_t h = ZX_HANDLE_INVALID;
+        zx_status_t status = zx_object_get_child(value_, koid, rights, &h);
+        result->reset(h);
+        return status;
+    }
+
+    zx_status_t get_property(uint32_t property, void* value,
+                             size_t size) const {
+        return zx_object_get_property(get(), property, value, size);
+    }
+
+    zx_status_t set_property(uint32_t property, const void* value,
+                             size_t size) const {
+        return zx_object_set_property(get(), property, value, size);
+    }
+
+    zx_status_t get_cookie(zx_handle_t scope, uint64_t *cookie) const {
+        return zx_object_get_cookie(get(), scope, cookie);
+    }
+
+    zx_status_t set_cookie(zx_handle_t scope, uint64_t cookie) const {
+        return zx_object_set_cookie(get(), scope, cookie);
+    }
+
+    bool is_valid() const { return value_ != ZX_HANDLE_INVALID; }
+    explicit operator bool() const { return is_valid(); }
+
+    zx_handle_t get() const { return value_; }
+
+    // Reset the underlying handle, and then get the address of the
+    // underlying internal handle storage.
+    //
+    // Note: The intended purpose is to facilitate interactions with C
+    // APIs which expect to be provided a pointer to a handle used as
+    // an out parameter.
+    zx_handle_t* reset_and_get_address() {
+        reset();
+        return &value_;
+    }
+
+    __attribute__((warn_unused_result)) zx_handle_t release() {
+        zx_handle_t result = value_;
+        value_ = ZX_HANDLE_INVALID;
+        return result;
+    }
+
+private:
+    template <typename A, typename B> struct is_same {
+        static const bool value = false;
+    };
+
+    template <typename A> struct is_same<A, A> {
+        static const bool value = true;
+    };
+
+    object(const object<T>&) = delete;
+
+    void operator=(const object<T>&) = delete;
+
+    void close() {
+        if (value_ != ZX_HANDLE_INVALID) {
+            zx_handle_close(value_);
+            value_ = ZX_HANDLE_INVALID;
+        }
+    }
+
+    zx_handle_t value_;
+};
+
+template <typename T> bool operator==(const object<T>& a, const object<T>& b) {
+    return a.get() == b.get();
+}
+
+template <typename T> bool operator!=(const object<T>& a, const object<T>& b) {
+    return !(a == b);
+}
+
+template <typename T> bool operator==(zx_handle_t a, const object<T>& b) {
+    return a == b.get();
+}
+
+template <typename T> bool operator!=(zx_handle_t a, const object<T>& b) {
+    return !(a == b);
+}
+
+template <typename T> bool operator==(const object<T>& a, zx_handle_t b) {
+    return a.get() == b;
+}
+
+template <typename T> bool operator!=(const object<T>& a, zx_handle_t b) {
+    return !(a == b);
+}
+
+// Wraps a handle to an object to provide type-safe access to its operations
+// but does not take ownership of it.  The handle is not closed when the
+// wrapper is destroyed.
+//
+// All instances of unowned<T> must be const.  They cannot be stored, copied,
+// or moved but can be passed by reference in the form of a const T& or used
+// as a temporary.
+//
+// void do_something(const zx::event& event);
+//
+// void example(zx_handle_t event_handle) {
+//     do_something(unowned_event::wrap(event_handle));
+// }
+template <typename T>
+class unowned final : public T {
+public:
+    unowned(unowned&& other) : T(other.release()) {}
+
+    ~unowned() {
+        zx_handle_t h = this->release();
+        static_cast<void>(h);
+    }
+
+    static const unowned wrap(zx_handle_t h) { return unowned(h); }
+
+private:
+    friend T;
+
+    explicit unowned(zx_handle_t h) : T(h) {}
+};
+
+} // namespace zx
diff --git a/system/ulib/mx/include/mx/object_traits.h b/system/ulib/zx/include/zx/object_traits.h
similarity index 97%
rename from system/ulib/mx/include/mx/object_traits.h
rename to system/ulib/zx/include/zx/object_traits.h
index 3705f3d..a4e3bfd 100644
--- a/system/ulib/mx/include/mx/object_traits.h
+++ b/system/ulib/zx/include/zx/object_traits.h
@@ -4,7 +4,7 @@
 
 #pragma once
 
-namespace mx {
+namespace zx {
 
 class channel;
 class eventpair;
@@ -49,4 +49,4 @@
     static const bool has_peer_handle = true;
 };
 
-} // namespace mx
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/port.h b/system/ulib/zx/include/zx/port.h
new file mode 100644
index 0000000..e580918
--- /dev/null
+++ b/system/ulib/zx/include/zx/port.h
@@ -0,0 +1,46 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/handle.h>
+#include <zx/object.h>
+
+namespace zx {
+
+class port : public object<port> {
+public:
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_PORT;
+
+    constexpr port() = default;
+
+    explicit port(zx_handle_t value) : object(value) {}
+
+    explicit port(handle&& h) : object(h.release()) {}
+
+    port(port&& other) : object(other.release()) {}
+
+    port& operator=(port&& other) {
+        reset(other.release());
+        return *this;
+    }
+
+    static zx_status_t create(uint32_t options, port* result);
+
+    zx_status_t queue(const void* packet, size_t size) const {
+        return zx_port_queue(get(), packet, size);
+    }
+
+    zx_status_t wait(zx_time_t deadline, void* packet, size_t size) const {
+        return zx_port_wait(get(), deadline, packet, size);
+    }
+
+    zx_status_t cancel(zx_handle_t source, uint64_t key) const {
+        return zx_port_cancel(get(), source, key);
+    }
+};
+
+using unowned_port = const unowned<port>;
+
+} // namespace zx
diff --git a/system/ulib/mx/include/mx/process.h b/system/ulib/zx/include/zx/process.h
similarity index 69%
rename from system/ulib/mx/include/mx/process.h
rename to system/ulib/zx/include/zx/process.h
index 8913c5e..38ec5ce 100644
--- a/system/ulib/mx/include/mx/process.h
+++ b/system/ulib/zx/include/zx/process.h
@@ -4,23 +4,23 @@
 
 #pragma once
 
-#include <mx/object.h>
-#include <mx/task.h>
-#include <mx/vmar.h>
-#include <mx/vmo.h>
-#include <magenta/process.h>
+#include <zx/object.h>
+#include <zx/task.h>
+#include <zx/vmar.h>
+#include <zx/vmo.h>
+#include <zircon/process.h>
 
-namespace mx {
+namespace zx {
 class job;
 class thread;
 
 class process : public task<process> {
 public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_PROCESS;
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_PROCESS;
 
     constexpr process() = default;
 
-    explicit process(mx_handle_t value) : task(value) {}
+    explicit process(zx_handle_t value) : task(value) {}
 
     explicit process(handle&& h) : task(h.release()) {}
 
@@ -35,17 +35,17 @@
     // consider using the launchpad library, which properly sets up
     // the many details of creating a process beyond simply creating
     // the kernel structure.
-    static mx_status_t create(const job& job, const char* name, uint32_t name_len,
+    static zx_status_t create(const job& job, const char* name, uint32_t name_len,
                               uint32_t flags, process* proc, vmar* root_vmar);
 
-    mx_status_t start(const thread& thread_handle, uintptr_t entry,
+    zx_status_t start(const thread& thread_handle, uintptr_t entry,
                       uintptr_t stack, handle arg_handle, uintptr_t arg2) const;
 
     static inline const unowned<process> self() {
-        return unowned<process>(mx_process_self());
+        return unowned<process>(zx_process_self());
     }
 };
 
 using unowned_process = const unowned<process>;
 
-} // namespace mx
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/socket.h b/system/ulib/zx/include/zx/socket.h
new file mode 100644
index 0000000..4568d61
--- /dev/null
+++ b/system/ulib/zx/include/zx/socket.h
@@ -0,0 +1,45 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/handle.h>
+#include <zx/object.h>
+
+namespace zx {
+
+class socket : public object<socket> {
+public:
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_SOCKET;
+
+    constexpr socket() = default;
+
+    explicit socket(zx_handle_t value) : object(value) {}
+
+    explicit socket(handle&& h) : object(h.release()) {}
+
+    socket(socket&& other) : object(other.release()) {}
+
+    socket& operator=(socket&& other) {
+        reset(other.release());
+        return *this;
+    }
+
+    static zx_status_t create(uint32_t flags, socket* endpoint0,
+                              socket* endpoint1);
+
+    zx_status_t write(uint32_t flags, const void* buffer, size_t len,
+                      size_t* actual) const {
+        return zx_socket_write(get(), flags, buffer, len, actual);
+    }
+
+    zx_status_t read(uint32_t flags, void* buffer, size_t len,
+                     size_t* actual) const {
+        return zx_socket_read(get(), flags, buffer, len, actual);
+    }
+};
+
+using unowned_socket = const unowned<socket>;
+
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/task.h b/system/ulib/zx/include/zx/task.h
new file mode 100644
index 0000000..e75de6a
--- /dev/null
+++ b/system/ulib/zx/include/zx/task.h
@@ -0,0 +1,33 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/handle.h>
+#include <zx/object.h>
+
+namespace zx {
+
+template <typename T = void> class task : public object<T> {
+public:
+    constexpr task() = default;
+
+    explicit task(zx_handle_t value) : object<T>(value) {}
+
+    explicit task(handle&& h) : object<T>(h.release()) {}
+
+    task(task&& other) : object<T>(other.release()) {}
+
+    zx_status_t resume(uint32_t options) const {
+        return zx_task_resume(object<T>::get(), options);
+    }
+
+    // TODO(abarth): zx_task_bind_exception_port
+
+    zx_status_t kill() const { return zx_task_kill(object<T>::get()); }
+
+    zx_status_t suspend() const { return zx_task_suspend(object<T>::get()); }
+};
+
+} // namespace zx
diff --git a/system/ulib/mx/include/mx/thread.h b/system/ulib/zx/include/zx/thread.h
similarity index 64%
rename from system/ulib/mx/include/mx/thread.h
rename to system/ulib/zx/include/zx/thread.h
index dd50d43..ba7c39e 100644
--- a/system/ulib/mx/include/mx/thread.h
+++ b/system/ulib/zx/include/zx/thread.h
@@ -4,20 +4,20 @@
 
 #pragma once
 
-#include <mx/object.h>
-#include <mx/task.h>
-#include <magenta/process.h>
+#include <zx/object.h>
+#include <zx/task.h>
+#include <zircon/process.h>
 
-namespace mx {
+namespace zx {
 class process;
 
 class thread : public task<thread> {
 public:
-    static constexpr mx_obj_type_t TYPE = MX_OBJ_TYPE_THREAD;
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_THREAD;
 
     constexpr thread() = default;
 
-    explicit thread(mx_handle_t value) : task(value) {}
+    explicit thread(zx_handle_t value) : task(value) {}
 
     explicit thread(handle&& h) : task(h.release()) {}
 
@@ -31,23 +31,23 @@
     // Rather than creating a thread directly with this syscall, consider using
     // std::thread or thrd_create, which properly integrates with the
     // thread-local data structures in libc.
-    static mx_status_t create(const process& process, const char* name,
+    static zx_status_t create(const process& process, const char* name,
                               uint32_t name_len, uint32_t flags,
                               thread* result);
 
-    mx_status_t start(uintptr_t thread_entry, uintptr_t stack, uintptr_t arg1,
+    zx_status_t start(uintptr_t thread_entry, uintptr_t stack, uintptr_t arg1,
                       uintptr_t arg2) const {
-        return mx_thread_start(get(), thread_entry, stack, arg1, arg2);
+        return zx_thread_start(get(), thread_entry, stack, arg1, arg2);
     }
 
-    // TODO(abarth): mx_thread_read_state
-    // TODO(abarth): mx_thread_write_state
+    // TODO(abarth): zx_thread_read_state
+    // TODO(abarth): zx_thread_write_state
 
     static inline const unowned<thread> self() {
-        return unowned<thread>(mx_thread_self());
+        return unowned<thread>(zx_thread_self());
     }
 };
 
 using unowned_thread = const unowned<thread>;
 
-} // namespace mx
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/time.h b/system/ulib/zx/include/zx/time.h
new file mode 100644
index 0000000..f2262e4
--- /dev/null
+++ b/system/ulib/zx/include/zx/time.h
@@ -0,0 +1,27 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+namespace time {
+
+inline zx_time_t get(uint32_t clock_id) {
+    return zx_time_get(clock_id);
+}
+
+} // namespace time
+
+inline zx_status_t nanosleep(zx_time_t deadline) {
+    return zx_nanosleep(deadline);
+}
+
+inline zx_time_t deadline_after(zx_duration_t nanoseconds) {
+    return zx_deadline_after(nanoseconds);
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/timer.h b/system/ulib/zx/include/zx/timer.h
new file mode 100644
index 0000000..4481797
--- /dev/null
+++ b/system/ulib/zx/include/zx/timer.h
@@ -0,0 +1,44 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/handle.h>
+#include <zx/object.h>
+
+#include <zircon/types.h>
+
+namespace zx {
+
+class timer : public object<timer> {
+public:
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_TIMER;
+
+    constexpr timer() = default;
+
+    explicit timer(zx_handle_t value) : object(value) {}
+
+    explicit timer(handle&& h) : object(h.release()) {}
+
+    timer(timer&& other) : object(other.release()) {}
+
+    timer& operator=(timer&& other) {
+        reset(other.release());
+        return *this;
+    }
+
+    static zx_status_t create(uint32_t options, uint32_t clock_id, timer* result);
+
+    zx_status_t set(zx_time_t deadline, zx_duration_t slack) const {
+        return zx_timer_set(get(), deadline, slack);
+    }
+
+    zx_status_t cancel() const {
+        return zx_timer_cancel(get());
+    }
+};
+
+using unowned_timer = const unowned<timer>;
+
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/vmar.h b/system/ulib/zx/include/zx/vmar.h
new file mode 100644
index 0000000..dce4950
--- /dev/null
+++ b/system/ulib/zx/include/zx/vmar.h
@@ -0,0 +1,59 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/object.h>
+#include <zx/vmo.h>
+#include <zircon/process.h>
+
+namespace zx {
+
+// A wrapper for handles to VMARs.  Note that vmar::~vmar() does not execute
+// vmar::destroy(), it just closes the handle.
+class vmar : public object<vmar> {
+public:
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_VMAR;
+
+    constexpr vmar() = default;
+
+    explicit vmar(zx_handle_t value) : object(value) {}
+
+    explicit vmar(handle&& h) : object(h.release()) {}
+
+    vmar(vmar&& other) : vmar(other.release()) {}
+
+    vmar& operator=(vmar&& other) {
+        reset(other.release());
+        return *this;
+    }
+
+    zx_status_t map(size_t vmar_offset, const vmo& vmo_handle, uint64_t vmo_offset,
+                    size_t len, uint32_t flags, uintptr_t* ptr) const {
+        return zx_vmar_map(get(), vmar_offset, vmo_handle.get(), vmo_offset, len, flags, ptr);
+    }
+
+    zx_status_t unmap(uintptr_t address, size_t len) const {
+        return zx_vmar_unmap(get(), address, len);
+    }
+
+    zx_status_t protect(uintptr_t address, size_t len, uint32_t prot) const {
+        return zx_vmar_protect(get(), address, len, prot);
+    }
+
+    zx_status_t destroy() const {
+        return zx_vmar_destroy(get());
+    }
+
+    zx_status_t allocate(size_t offset, size_t size, uint32_t flags,
+                         vmar* child, uintptr_t* child_addr) const;
+
+    static inline const unowned<vmar> root_self() {
+        return unowned<vmar>(zx_vmar_root_self());
+    }
+};
+
+using unowned_vmar = const unowned<vmar>;
+
+} // namespace zx
diff --git a/system/ulib/zx/include/zx/vmo.h b/system/ulib/zx/include/zx/vmo.h
new file mode 100644
index 0000000..bfdb0e0
--- /dev/null
+++ b/system/ulib/zx/include/zx/vmo.h
@@ -0,0 +1,64 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <zx/handle.h>
+#include <zx/object.h>
+
+namespace zx {
+
+class vmo : public object<vmo> {
+public:
+    static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_VMO;
+
+    constexpr vmo() = default;
+
+    explicit vmo(zx_handle_t value) : object(value) {}
+
+    explicit vmo(handle&& h) : object(h.release()) {}
+
+    vmo(vmo&& other) : object(other.release()) {}
+
+    vmo& operator=(vmo&& other) {
+        reset(other.release());
+        return *this;
+    }
+
+    static zx_status_t create(uint64_t size, uint32_t options, vmo* result);
+
+    zx_status_t read(void* data, uint64_t offset, size_t len,
+                     size_t* actual) const {
+        return zx_vmo_read(get(), data, offset, len, actual);
+    }
+
+    zx_status_t write(const void* data, uint64_t offset, size_t len,
+                      size_t* actual) const {
+        return zx_vmo_write(get(), data, offset, len, actual);
+    }
+
+    zx_status_t get_size(uint64_t* size) const {
+        return zx_vmo_get_size(get(), size);
+    }
+
+    zx_status_t set_size(uint64_t size) const {
+        return zx_vmo_set_size(get(), size);
+    }
+
+    zx_status_t clone(uint32_t options, uint64_t offset, uint64_t size, vmo* result) const {
+        zx_handle_t h = ZX_HANDLE_INVALID;
+        zx_status_t status = zx_vmo_clone(get(), options, offset, size, &h);
+        result->reset(h);
+        return status;
+    }
+
+    zx_status_t op_range(uint32_t op, uint64_t offset, uint64_t size,
+                         void* buffer, size_t buffer_size) const {
+        return zx_vmo_op_range(get(), op, offset, size, buffer, buffer_size);
+    }
+};
+
+using unowned_vmo = const unowned<vmo>;
+
+} // namespace zx
diff --git a/system/ulib/zx/job.cpp b/system/ulib/zx/job.cpp
new file mode 100644
index 0000000..af11e13
--- /dev/null
+++ b/system/ulib/zx/job.cpp
@@ -0,0 +1,22 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/job.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t job::create(zx_handle_t parent_job, uint32_t flags, job* result) {
+    zx_handle_t h;
+    zx_status_t status = zx_job_create(parent_job, flags, &h);
+    if (status < 0) {
+        result->reset(ZX_HANDLE_INVALID);
+    } else {
+        result->reset(h);
+    }
+    return status;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/log.cpp b/system/ulib/zx/log.cpp
new file mode 100644
index 0000000..be9f9f1
--- /dev/null
+++ b/system/ulib/zx/log.cpp
@@ -0,0 +1,23 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/log.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t log::create(log* result, uint32_t flags) {
+    zx_status_t status;
+    zx_handle_t h;
+    if ((status = zx_log_create(flags, &h)) < 0) {
+        result->reset(ZX_HANDLE_INVALID);
+        return status;
+    } else {
+        result->reset(h);
+        return ZX_OK;
+    }
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/port.cpp b/system/ulib/zx/port.cpp
new file mode 100644
index 0000000..0952da3
--- /dev/null
+++ b/system/ulib/zx/port.cpp
@@ -0,0 +1,22 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/port.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t port::create(uint32_t options, port* result) {
+    zx_handle_t h;
+    zx_status_t status = zx_port_create(options, &h);
+    if (status < 0) {
+        result->reset(ZX_HANDLE_INVALID);
+    } else {
+        result->reset(h);
+    }
+    return status;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/process.cpp b/system/ulib/zx/process.cpp
new file mode 100644
index 0000000..c5d7195
--- /dev/null
+++ b/system/ulib/zx/process.cpp
@@ -0,0 +1,41 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/process.h>
+
+#include <zircon/syscalls.h>
+
+#include <zx/job.h>
+#include <zx/thread.h>
+#include <zx/vmar.h>
+
+namespace zx {
+
+zx_status_t process::create(const job& job, const char* name, uint32_t name_len, uint32_t flags,
+                            process* proc, vmar* vmar) {
+    zx_handle_t proc_h;
+    zx_handle_t vmar_h;
+    zx_status_t status = zx_process_create(job.get(), name, name_len, flags, &proc_h, &vmar_h);
+    if (status < 0) {
+        proc->reset(ZX_HANDLE_INVALID);
+        vmar->reset(ZX_HANDLE_INVALID);
+    } else {
+        proc->reset(proc_h);
+        vmar->reset(vmar_h);
+    }
+    return status;
+}
+
+zx_status_t process::start(const thread& thread_handle, uintptr_t entry,
+                           uintptr_t stack, handle arg_handle,
+                           uintptr_t arg2) const {
+    zx_handle_t arg_h = arg_handle.release();
+    zx_status_t result =
+        zx_process_start(get(), thread_handle.get(), entry, stack, arg_h, arg2);
+    if (result < 0)
+        zx_handle_close(arg_h);
+    return result;
+}
+
+} // namespace zx
diff --git a/system/ulib/mx/rules.mk b/system/ulib/zx/rules.mk
similarity index 95%
rename from system/ulib/mx/rules.mk
rename to system/ulib/zx/rules.mk
index 5a07bf3..732e5b1 100644
--- a/system/ulib/mx/rules.mk
+++ b/system/ulib/zx/rules.mk
@@ -24,6 +24,6 @@
     $(LOCAL_DIR)/vmar.cpp \
     $(LOCAL_DIR)/vmo.cpp \
 
-MODULE_LIBS := system/ulib/magenta
+MODULE_LIBS := system/ulib/zircon
 
 include make/module.mk
diff --git a/system/ulib/zx/socket.cpp b/system/ulib/zx/socket.cpp
new file mode 100644
index 0000000..788b49b
--- /dev/null
+++ b/system/ulib/zx/socket.cpp
@@ -0,0 +1,20 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/socket.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t socket::create(uint32_t flags, socket* endpoint0,
+                           socket* endpoint1) {
+    zx_handle_t h0 = ZX_HANDLE_INVALID, h1 = ZX_HANDLE_INVALID;
+    zx_status_t result = zx_socket_create(flags, &h0, &h1);
+    endpoint0->reset(h0);
+    endpoint1->reset(h1);
+    return result;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/thread.cpp b/system/ulib/zx/thread.cpp
new file mode 100644
index 0000000..616b839
--- /dev/null
+++ b/system/ulib/zx/thread.cpp
@@ -0,0 +1,26 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/thread.h>
+
+#include <zircon/syscalls.h>
+
+#include <zx/process.h>
+
+namespace zx {
+
+zx_status_t thread::create(const process& process, const char* name,
+                           uint32_t name_len, uint32_t flags, thread* result) {
+    zx_handle_t h;
+    zx_status_t status =
+        zx_thread_create(process.get(), name, name_len, flags, &h);
+    if (status < 0) {
+        result->reset(ZX_HANDLE_INVALID);
+    } else {
+        result->reset(h);
+    }
+    return status;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/timer.cpp b/system/ulib/zx/timer.cpp
new file mode 100644
index 0000000..0123dc7
--- /dev/null
+++ b/system/ulib/zx/timer.cpp
@@ -0,0 +1,18 @@
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/timer.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t timer::create(uint32_t options, uint32_t clock_id, timer* result) {
+    zx_handle_t h = ZX_HANDLE_INVALID;
+    zx_status_t status = zx_timer_create(options, clock_id, &h);
+    result->reset(h);
+    return status;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/vmar.cpp b/system/ulib/zx/vmar.cpp
new file mode 100644
index 0000000..9543069
--- /dev/null
+++ b/system/ulib/zx/vmar.cpp
@@ -0,0 +1,23 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/vmar.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t vmar::allocate(size_t offset, size_t size, uint32_t flags,
+                           vmar* child, uintptr_t* child_addr) const {
+    zx_handle_t h;
+    zx_status_t status = zx_vmar_allocate(get(), offset, size, flags, &h, child_addr);
+    if (status == ZX_OK) {
+        child->reset(h);
+    } else {
+        child->reset(ZX_HANDLE_INVALID);
+    }
+    return status;
+}
+
+} // namespace zx
diff --git a/system/ulib/zx/vmo.cpp b/system/ulib/zx/vmo.cpp
new file mode 100644
index 0000000..9bc3d41
--- /dev/null
+++ b/system/ulib/zx/vmo.cpp
@@ -0,0 +1,18 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <zx/vmo.h>
+
+#include <zircon/syscalls.h>
+
+namespace zx {
+
+zx_status_t vmo::create(uint64_t size, uint32_t options, vmo* result) {
+    zx_handle_t h = ZX_HANDLE_INVALID;
+    zx_status_t status = zx_vmo_create(size, options, &h);
+    result->reset(h);
+    return status;
+}
+
+} // namespace zx
diff --git a/system/ulib/zxcpp/BUILD.gn b/system/ulib/zxcpp/BUILD.gn
new file mode 100644
index 0000000..ae3a675
--- /dev/null
+++ b/system/ulib/zxcpp/BUILD.gn
@@ -0,0 +1,18 @@
+# Copyright 2017 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+config("zxcpp_config") {
+  include_dirs = [ "include" ]
+}
+
+static_library("zxcpp") {
+  # Don't forget to update rules.mk as well for the Zircon build.
+  sources = [
+    "include/zxcpp/new.h",
+    "new.cpp",
+    "pure_virtual.cpp",
+  ]
+
+  public_configs = [ ":zxcpp_config" ]
+}
diff --git a/system/ulib/mxcpp/include/mxcpp/new.h b/system/ulib/zxcpp/include/zxcpp/new.h
similarity index 100%
rename from system/ulib/mxcpp/include/mxcpp/new.h
rename to system/ulib/zxcpp/include/zxcpp/new.h
diff --git a/system/ulib/mxcpp/new.cpp b/system/ulib/zxcpp/new.cpp
similarity index 87%
rename from system/ulib/mxcpp/new.cpp
rename to system/ulib/zxcpp/new.cpp
index b6c766c..b4bbc5a 100644
--- a/system/ulib/mxcpp/new.cpp
+++ b/system/ulib/zxcpp/new.cpp
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <mxcpp/new.h>
+#include <zxcpp/new.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 #include <stdlib.h>
 
 // The kernel does not want non-AllocCheckered non-placement new
@@ -13,7 +13,7 @@
 void* operator new(size_t s) {
     auto mem = ::malloc(s);
     if (!mem) {
-        MX_PANIC("Out of memory (new)\n");
+        ZX_PANIC("Out of memory (new)\n");
     }
     return mem;
 }
@@ -21,7 +21,7 @@
 void* operator new[](size_t s) {
     auto mem = ::malloc(s);
     if (!mem) {
-        MX_PANIC("Out of memory (new[])\n");
+        ZX_PANIC("Out of memory (new[])\n");
     }
     return mem;
 }
diff --git a/system/ulib/mxcpp/pure_virtual.cpp b/system/ulib/zxcpp/pure_virtual.cpp
similarity index 75%
rename from system/ulib/mxcpp/pure_virtual.cpp
rename to system/ulib/zxcpp/pure_virtual.cpp
index a59d147..8ddb56e 100644
--- a/system/ulib/mxcpp/pure_virtual.cpp
+++ b/system/ulib/zxcpp/pure_virtual.cpp
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 extern "C" void __cxa_pure_virtual(void)
 {
-    MX_PANIC("pure virtual called\n");
+    ZX_PANIC("pure virtual called\n");
 }
 
diff --git a/system/ulib/mxcpp/rules.mk b/system/ulib/zxcpp/rules.mk
similarity index 100%
rename from system/ulib/mxcpp/rules.mk
rename to system/ulib/zxcpp/rules.mk
diff --git a/system/ulib/mxcpp/thread_atexit.cpp b/system/ulib/zxcpp/thread_atexit.cpp
similarity index 100%
rename from system/ulib/mxcpp/thread_atexit.cpp
rename to system/ulib/zxcpp/thread_atexit.cpp
diff --git a/system/utest/async/async_stub.cpp b/system/utest/async/async_stub.cpp
index 0fb27f5..579ca6b 100644
--- a/system/utest/async/async_stub.cpp
+++ b/system/utest/async/async_stub.cpp
@@ -6,24 +6,24 @@
 
 namespace {
 
-mx_status_t stub_begin_wait(async_t* async, async_wait_t* wait) {
+zx_status_t stub_begin_wait(async_t* async, async_wait_t* wait) {
     return static_cast<AsyncStub*>(async)->BeginWait(wait);
 }
 
-mx_status_t stub_cancel_wait(async_t* async, async_wait_t* wait) {
+zx_status_t stub_cancel_wait(async_t* async, async_wait_t* wait) {
     return static_cast<AsyncStub*>(async)->CancelWait(wait);
 }
 
-mx_status_t stub_post_task(async_t* async, async_task_t* task) {
+zx_status_t stub_post_task(async_t* async, async_task_t* task) {
     return static_cast<AsyncStub*>(async)->PostTask(task);
 }
 
-mx_status_t stub_cancel_task(async_t* async, async_task_t* task) {
+zx_status_t stub_cancel_task(async_t* async, async_task_t* task) {
     return static_cast<AsyncStub*>(async)->CancelTask(task);
 }
 
-mx_status_t stub_queue_packet(async_t* async, async_receiver_t* receiver,
-                              const mx_packet_user_t* data) {
+zx_status_t stub_queue_packet(async_t* async, async_receiver_t* receiver,
+                              const zx_packet_user_t* data) {
     return static_cast<AsyncStub*>(async)->QueuePacket(receiver, data);
 }
 
@@ -42,23 +42,23 @@
 
 AsyncStub::~AsyncStub() {}
 
-mx_status_t AsyncStub::BeginWait(async_wait_t* wait) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t AsyncStub::BeginWait(async_wait_t* wait) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t AsyncStub::CancelWait(async_wait_t* wait) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t AsyncStub::CancelWait(async_wait_t* wait) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t AsyncStub::PostTask(async_task_t* task) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t AsyncStub::PostTask(async_task_t* task) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t AsyncStub::CancelTask(async_task_t* task) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t AsyncStub::CancelTask(async_task_t* task) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
 
-mx_status_t AsyncStub::QueuePacket(async_receiver_t* receiver,
-                                   const mx_packet_user_t* data) {
-    return MX_ERR_NOT_SUPPORTED;
+zx_status_t AsyncStub::QueuePacket(async_receiver_t* receiver,
+                                   const zx_packet_user_t* data) {
+    return ZX_ERR_NOT_SUPPORTED;
 }
diff --git a/system/utest/async/async_stub.h b/system/utest/async/async_stub.h
index 727b9e3..dfb3646 100644
--- a/system/utest/async/async_stub.h
+++ b/system/utest/async/async_stub.h
@@ -11,10 +11,10 @@
     AsyncStub();
     virtual ~AsyncStub();
 
-    virtual mx_status_t BeginWait(async_wait_t* wait);
-    virtual mx_status_t CancelWait(async_wait_t* wait);
-    virtual mx_status_t PostTask(async_task_t* task);
-    virtual mx_status_t CancelTask(async_task_t* task);
-    virtual mx_status_t QueuePacket(async_receiver_t* receiver,
-                                    const mx_packet_user_t* data);
+    virtual zx_status_t BeginWait(async_wait_t* wait);
+    virtual zx_status_t CancelWait(async_wait_t* wait);
+    virtual zx_status_t PostTask(async_task_t* task);
+    virtual zx_status_t CancelTask(async_task_t* task);
+    virtual zx_status_t QueuePacket(async_receiver_t* receiver,
+                                    const zx_packet_user_t* data);
 };
diff --git a/system/utest/async/loop_tests.cpp b/system/utest/async/loop_tests.cpp
index 36bb4c4..b1b3d53 100644
--- a/system/utest/async/loop_tests.cpp
+++ b/system/utest/async/loop_tests.cpp
@@ -4,14 +4,14 @@
 
 #include <threads.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include <async/loop.h>
 #include <async/receiver.h>
 #include <async/task.h>
 #include <async/wait.h>
 
-#include <mx/event.h>
+#include <zx/event.h>
 #include <fbl/atomic.h>
 #include <fbl/auto_lock.h>
 #include <fbl/function.h>
@@ -20,13 +20,13 @@
 
 namespace {
 
-inline mx_time_t now() {
-    return mx_time_get(MX_CLOCK_MONOTONIC);
+inline zx_time_t now() {
+    return zx_time_get(ZX_CLOCK_MONOTONIC);
 }
 
 class TestWait {
 public:
-    TestWait(mx_handle_t object, mx_signals_t trigger)
+    TestWait(zx_handle_t object, zx_signals_t trigger)
         : op(object, trigger) {
         op.set_handler(fbl::BindMember(this, &TestWait::Handle));
     }
@@ -35,12 +35,12 @@
 
     async::Wait op;
     uint32_t run_count = 0u;
-    mx_status_t last_status = MX_ERR_INTERNAL;
-    const mx_packet_signal_t* last_signal = nullptr;
+    zx_status_t last_status = ZX_ERR_INTERNAL;
+    const zx_packet_signal_t* last_signal = nullptr;
 
 protected:
-    virtual async_wait_result_t Handle(async_t* async, mx_status_t status,
-                                       const mx_packet_signal_t* signal) {
+    virtual async_wait_result_t Handle(async_t* async, zx_status_t status,
+                                       const zx_packet_signal_t* signal) {
         run_count++;
         last_status = status;
         if (signal) {
@@ -53,13 +53,13 @@
     }
 
 private:
-    mx_packet_signal_t last_signal_storage_;
+    zx_packet_signal_t last_signal_storage_;
 };
 
 class CascadeWait : public TestWait {
 public:
-    CascadeWait(mx_handle_t object, mx_signals_t trigger,
-                mx_signals_t signals_to_clear, mx_signals_t signals_to_set,
+    CascadeWait(zx_handle_t object, zx_signals_t trigger,
+                zx_signals_t signals_to_clear, zx_signals_t signals_to_set,
                 bool repeat)
         : TestWait(object, trigger),
           signals_to_clear_(signals_to_clear),
@@ -67,21 +67,21 @@
           repeat_(repeat) {}
 
 protected:
-    mx_signals_t signals_to_clear_;
-    mx_signals_t signals_to_set_;
+    zx_signals_t signals_to_clear_;
+    zx_signals_t signals_to_set_;
     bool repeat_;
 
-    async_wait_result_t Handle(async_t* async, mx_status_t status,
-                               const mx_packet_signal_t* signal) override {
+    async_wait_result_t Handle(async_t* async, zx_status_t status,
+                               const zx_packet_signal_t* signal) override {
         TestWait::Handle(async, status, signal);
-        mx::unowned_event::wrap(op.object()).signal(signals_to_clear_, signals_to_set_);
-        return repeat_ && status == MX_OK ? ASYNC_WAIT_AGAIN : ASYNC_WAIT_FINISHED;
+        zx::unowned_event::wrap(op.object()).signal(signals_to_clear_, signals_to_set_);
+        return repeat_ && status == ZX_OK ? ASYNC_WAIT_AGAIN : ASYNC_WAIT_FINISHED;
     }
 };
 
 class TestTask {
 public:
-    TestTask(mx_time_t deadline)
+    TestTask(zx_time_t deadline)
         : op(deadline) {
         op.set_handler(fbl::BindMember(this, &TestTask::Handle));
     }
@@ -90,10 +90,10 @@
 
     async::Task op;
     uint32_t run_count = 0u;
-    mx_status_t last_status = MX_ERR_INTERNAL;
+    zx_status_t last_status = ZX_ERR_INTERNAL;
 
 protected:
-    virtual async_task_result_t Handle(async_t* async, mx_status_t status) {
+    virtual async_task_result_t Handle(async_t* async, zx_status_t status) {
         run_count++;
         last_status = status;
         return ASYNC_TASK_FINISHED;
@@ -102,11 +102,11 @@
 
 class QuitTask : public TestTask {
 public:
-    QuitTask(mx_time_t deadline = now())
+    QuitTask(zx_time_t deadline = now())
         : TestTask(deadline) {}
 
 protected:
-    async_task_result_t Handle(async_t* async, mx_status_t status) override {
+    async_task_result_t Handle(async_t* async, zx_status_t status) override {
         TestTask::Handle(async, status);
         async_loop_quit(async);
         return ASYNC_TASK_FINISHED;
@@ -115,13 +115,13 @@
 
 class ResetQuitTask : public TestTask {
 public:
-    ResetQuitTask(mx_time_t deadline = now())
+    ResetQuitTask(zx_time_t deadline = now())
         : TestTask(deadline) {}
 
-    mx_status_t result = MX_ERR_INTERNAL;
+    zx_status_t result = ZX_ERR_INTERNAL;
 
 protected:
-    async_task_result_t Handle(async_t* async, mx_status_t status) override {
+    async_task_result_t Handle(async_t* async, zx_status_t status) override {
         TestTask::Handle(async, status);
         result = async_loop_reset_quit(async);
         return ASYNC_TASK_FINISHED;
@@ -130,7 +130,7 @@
 
 class RepeatingTask : public TestTask {
 public:
-    RepeatingTask(mx_time_t deadline, mx_duration_t interval, uint32_t repeat_count)
+    RepeatingTask(zx_time_t deadline, zx_duration_t interval, uint32_t repeat_count)
         : TestTask(deadline), interval_(interval), repeat_count_(repeat_count) {}
 
     void set_finish_callback(fbl::Closure callback) {
@@ -138,11 +138,11 @@
     }
 
 protected:
-    mx_duration_t interval_;
+    zx_duration_t interval_;
     uint32_t repeat_count_;
     fbl::Closure finish_callback_;
 
-    async_task_result_t Handle(async_t* async, mx_status_t status) override {
+    async_task_result_t Handle(async_t* async, zx_status_t status) override {
         TestTask::Handle(async, status);
         op.set_deadline(op.deadline() + interval_);
         if (repeat_count_ == 0) {
@@ -151,7 +151,7 @@
             return ASYNC_TASK_FINISHED;
         }
         repeat_count_ -= 1;
-        return status == MX_OK ? ASYNC_TASK_REPEAT : ASYNC_TASK_FINISHED;
+        return status == ZX_OK ? ASYNC_TASK_REPEAT : ASYNC_TASK_FINISHED;
     }
 };
 
@@ -165,11 +165,11 @@
 
     async::Receiver op;
     uint32_t run_count = 0u;
-    mx_status_t last_status = MX_ERR_INTERNAL;
-    const mx_packet_user_t* last_data;
+    zx_status_t last_status = ZX_ERR_INTERNAL;
+    const zx_packet_user_t* last_data;
 
 protected:
-    virtual void Handle(async_t* async, mx_status_t status, const mx_packet_user_t* data) {
+    virtual void Handle(async_t* async, zx_status_t status, const zx_packet_user_t* data) {
         run_count++;
         last_status = status;
         if (data) {
@@ -181,7 +181,7 @@
     }
 
 private:
-    mx_packet_user_t last_data_storage_{};
+    zx_packet_user_t last_data_storage_{};
 };
 
 // The C++ loop wrapper is one-to-one with the underlying C API so for the
@@ -191,18 +191,18 @@
     BEGIN_TEST;
 
     async_t* async;
-    ASSERT_EQ(MX_OK, async_loop_create(nullptr, &async), "create");
+    ASSERT_EQ(ZX_OK, async_loop_create(nullptr, &async), "create");
     ASSERT_NONNULL(async, "async");
 
     EXPECT_EQ(ASYNC_LOOP_RUNNABLE, async_loop_get_state(async), "runnable");
 
     async_loop_quit(async);
     EXPECT_EQ(ASYNC_LOOP_QUIT, async_loop_get_state(async), "quitting");
-    async_loop_run(async, MX_TIME_INFINITE, false);
-    EXPECT_EQ(MX_OK, async_loop_reset_quit(async));
+    async_loop_run(async, ZX_TIME_INFINITE, false);
+    EXPECT_EQ(ZX_OK, async_loop_reset_quit(async));
 
     thrd_t thread{};
-    EXPECT_EQ(MX_OK, async_loop_start_thread(async, "name", &thread), "thread start");
+    EXPECT_EQ(ZX_OK, async_loop_start_thread(async, "name", &thread), "thread start");
     EXPECT_NE(thrd_t{}, thread, "thread ws initialized");
     async_loop_quit(async);
     async_loop_join_threads(async);
@@ -249,31 +249,31 @@
 
     loop.Quit();
     EXPECT_EQ(ASYNC_LOOP_QUIT, loop.GetState(), "quitting when quit");
-    EXPECT_EQ(MX_ERR_CANCELED, loop.Run(), "run returns immediately");
+    EXPECT_EQ(ZX_ERR_CANCELED, loop.Run(), "run returns immediately");
     EXPECT_EQ(ASYNC_LOOP_QUIT, loop.GetState(), "still quitting");
 
     ResetQuitTask reset_quit_task;
-    EXPECT_EQ(MX_OK, reset_quit_task.op.Post(loop.async()), "can post tasks even after quit");
+    EXPECT_EQ(ZX_OK, reset_quit_task.op.Post(loop.async()), "can post tasks even after quit");
     QuitTask quit_task;
-    EXPECT_EQ(MX_OK, quit_task.op.Post(loop.async()), "can post tasks even after quit");
+    EXPECT_EQ(ZX_OK, quit_task.op.Post(loop.async()), "can post tasks even after quit");
 
-    EXPECT_EQ(MX_OK, loop.ResetQuit());
+    EXPECT_EQ(ZX_OK, loop.ResetQuit());
     EXPECT_EQ(ASYNC_LOOP_RUNNABLE, loop.GetState(), "not quitting after reset");
 
-    EXPECT_EQ(MX_OK, loop.Run(MX_TIME_INFINITE, true /*once*/), "run tasks");
+    EXPECT_EQ(ZX_OK, loop.Run(ZX_TIME_INFINITE, true /*once*/), "run tasks");
 
     EXPECT_EQ(1u, reset_quit_task.run_count, "reset quit task ran");
-    EXPECT_EQ(MX_ERR_BAD_STATE, reset_quit_task.result, "can't reset quit while loop is running");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, reset_quit_task.result, "can't reset quit while loop is running");
 
     EXPECT_EQ(1u, quit_task.run_count, "quit task ran");
     EXPECT_EQ(ASYNC_LOOP_QUIT, loop.GetState(), "quitted");
 
-    EXPECT_EQ(MX_ERR_CANCELED, loop.Run(), "runs returns immediately when quitted");
+    EXPECT_EQ(ZX_ERR_CANCELED, loop.Run(), "runs returns immediately when quitted");
 
     loop.Shutdown();
     EXPECT_EQ(ASYNC_LOOP_SHUTDOWN, loop.GetState(), "shut down");
-    EXPECT_EQ(MX_ERR_BAD_STATE, loop.Run(), "run returns immediately when shut down");
-    EXPECT_EQ(MX_ERR_BAD_STATE, loop.ResetQuit());
+    EXPECT_EQ(ZX_ERR_BAD_STATE, loop.Run(), "run returns immediately when shut down");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, loop.ResetQuit());
 
     END_TEST;
 }
@@ -282,88 +282,88 @@
     BEGIN_TEST;
 
     async::Loop loop;
-    mx::event event;
-    EXPECT_EQ(MX_OK, mx::event::create(0u, &event), "create event");
+    zx::event event;
+    EXPECT_EQ(ZX_OK, zx::event::create(0u, &event), "create event");
 
-    CascadeWait wait1(event.get(), MX_USER_SIGNAL_1,
-                      0u, MX_USER_SIGNAL_2, false);
-    CascadeWait wait2(event.get(), MX_USER_SIGNAL_2,
-                      MX_USER_SIGNAL_1 | MX_USER_SIGNAL_2, 0u, true);
-    CascadeWait wait3(event.get(), MX_USER_SIGNAL_3,
-                      MX_USER_SIGNAL_3, 0u, true);
-    EXPECT_EQ(MX_OK, wait1.op.Begin(loop.async()), "wait 1");
-    EXPECT_EQ(MX_OK, wait2.op.Begin(loop.async()), "wait 2");
-    EXPECT_EQ(MX_OK, wait3.op.Begin(loop.async()), "wait 3");
+    CascadeWait wait1(event.get(), ZX_USER_SIGNAL_1,
+                      0u, ZX_USER_SIGNAL_2, false);
+    CascadeWait wait2(event.get(), ZX_USER_SIGNAL_2,
+                      ZX_USER_SIGNAL_1 | ZX_USER_SIGNAL_2, 0u, true);
+    CascadeWait wait3(event.get(), ZX_USER_SIGNAL_3,
+                      ZX_USER_SIGNAL_3, 0u, true);
+    EXPECT_EQ(ZX_OK, wait1.op.Begin(loop.async()), "wait 1");
+    EXPECT_EQ(ZX_OK, wait2.op.Begin(loop.async()), "wait 2");
+    EXPECT_EQ(ZX_OK, wait3.op.Begin(loop.async()), "wait 3");
 
     // Initially nothing is signaled.
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(0u, wait1.run_count, "run count 1");
     EXPECT_EQ(0u, wait2.run_count, "run count 2");
     EXPECT_EQ(0u, wait3.run_count, "run count 3");
 
     // Set signal 1: notifies |wait1| which sets signal 2 and notifies |wait2|
     // which clears signal 1 and 2 again.
-    EXPECT_EQ(MX_OK, event.signal(0u, MX_USER_SIGNAL_1), "signal 1");
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    EXPECT_EQ(ZX_OK, event.signal(0u, ZX_USER_SIGNAL_1), "signal 1");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(1u, wait1.run_count, "run count 1");
-    EXPECT_EQ(MX_OK, wait1.last_status, "status 1");
+    EXPECT_EQ(ZX_OK, wait1.last_status, "status 1");
     EXPECT_NONNULL(wait1.last_signal);
-    EXPECT_EQ(MX_USER_SIGNAL_1, wait1.last_signal->trigger & MX_USER_SIGNAL_ALL, "trigger 1");
-    EXPECT_EQ(MX_USER_SIGNAL_1, wait1.last_signal->observed & MX_USER_SIGNAL_ALL, "observed 1");
+    EXPECT_EQ(ZX_USER_SIGNAL_1, wait1.last_signal->trigger & ZX_USER_SIGNAL_ALL, "trigger 1");
+    EXPECT_EQ(ZX_USER_SIGNAL_1, wait1.last_signal->observed & ZX_USER_SIGNAL_ALL, "observed 1");
     EXPECT_EQ(1u, wait1.last_signal->count, "count 1");
     EXPECT_EQ(1u, wait2.run_count, "run count 2");
-    EXPECT_EQ(MX_OK, wait2.last_status, "status 2");
+    EXPECT_EQ(ZX_OK, wait2.last_status, "status 2");
     EXPECT_NONNULL(wait2.last_signal);
-    EXPECT_EQ(MX_USER_SIGNAL_2, wait2.last_signal->trigger & MX_USER_SIGNAL_ALL, "trigger 2");
-    EXPECT_EQ(MX_USER_SIGNAL_1 | MX_USER_SIGNAL_2, wait2.last_signal->observed & MX_USER_SIGNAL_ALL, "observed 2");
+    EXPECT_EQ(ZX_USER_SIGNAL_2, wait2.last_signal->trigger & ZX_USER_SIGNAL_ALL, "trigger 2");
+    EXPECT_EQ(ZX_USER_SIGNAL_1 | ZX_USER_SIGNAL_2, wait2.last_signal->observed & ZX_USER_SIGNAL_ALL, "observed 2");
     EXPECT_EQ(1u, wait2.last_signal->count, "count 2");
     EXPECT_EQ(0u, wait3.run_count, "run count 3");
 
     // Set signal 1 again: does nothing because |wait1| was a one-shot.
-    EXPECT_EQ(MX_OK, event.signal(0u, MX_USER_SIGNAL_1), "signal 1");
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    EXPECT_EQ(ZX_OK, event.signal(0u, ZX_USER_SIGNAL_1), "signal 1");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(1u, wait1.run_count, "run count 1");
     EXPECT_EQ(1u, wait2.run_count, "run count 2");
     EXPECT_EQ(0u, wait3.run_count, "run count 3");
 
     // Set signal 2 again: notifies |wait2| which clears signal 1 and 2 again.
-    EXPECT_EQ(MX_OK, event.signal(0u, MX_USER_SIGNAL_2), "signal 2");
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    EXPECT_EQ(ZX_OK, event.signal(0u, ZX_USER_SIGNAL_2), "signal 2");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(1u, wait1.run_count, "run count 1");
     EXPECT_EQ(2u, wait2.run_count, "run count 2");
-    EXPECT_EQ(MX_OK, wait2.last_status, "status 2");
+    EXPECT_EQ(ZX_OK, wait2.last_status, "status 2");
     EXPECT_NONNULL(wait2.last_signal);
-    EXPECT_EQ(MX_USER_SIGNAL_2, wait2.last_signal->trigger & MX_USER_SIGNAL_ALL, "trigger 2");
-    EXPECT_EQ(MX_USER_SIGNAL_1 | MX_USER_SIGNAL_2, wait2.last_signal->observed & MX_USER_SIGNAL_ALL, "observed 2");
+    EXPECT_EQ(ZX_USER_SIGNAL_2, wait2.last_signal->trigger & ZX_USER_SIGNAL_ALL, "trigger 2");
+    EXPECT_EQ(ZX_USER_SIGNAL_1 | ZX_USER_SIGNAL_2, wait2.last_signal->observed & ZX_USER_SIGNAL_ALL, "observed 2");
     EXPECT_EQ(1u, wait2.last_signal->count, "count 2");
     EXPECT_EQ(0u, wait3.run_count, "run count 3");
 
     // Set signal 3: notifies |wait3| which clears signal 3.
     // Do this a couple of times.
     for (uint32_t i = 0; i < 3; i++) {
-        EXPECT_EQ(MX_OK, event.signal(0u, MX_USER_SIGNAL_3), "signal 3");
-        EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+        EXPECT_EQ(ZX_OK, event.signal(0u, ZX_USER_SIGNAL_3), "signal 3");
+        EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
         EXPECT_EQ(1u, wait1.run_count, "run count 1");
         EXPECT_EQ(2u, wait2.run_count, "run count 2");
         EXPECT_EQ(i + 1u, wait3.run_count, "run count 3");
-        EXPECT_EQ(MX_OK, wait3.last_status, "status 3");
+        EXPECT_EQ(ZX_OK, wait3.last_status, "status 3");
         EXPECT_NONNULL(wait3.last_signal);
-        EXPECT_EQ(MX_USER_SIGNAL_3, wait3.last_signal->trigger & MX_USER_SIGNAL_ALL, "trigger 3");
-        EXPECT_EQ(MX_USER_SIGNAL_3, wait3.last_signal->observed & MX_USER_SIGNAL_ALL, "observed 3");
+        EXPECT_EQ(ZX_USER_SIGNAL_3, wait3.last_signal->trigger & ZX_USER_SIGNAL_ALL, "trigger 3");
+        EXPECT_EQ(ZX_USER_SIGNAL_3, wait3.last_signal->observed & ZX_USER_SIGNAL_ALL, "observed 3");
         EXPECT_EQ(1u, wait3.last_signal->count, "count 3");
     }
 
     // Cancel wait 3 then set signal 3 again: nothing happens this time.
-    EXPECT_EQ(MX_OK, wait3.op.Cancel(loop.async()), "cancel");
-    EXPECT_EQ(MX_OK, event.signal(0u, MX_USER_SIGNAL_3), "signal 3");
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    EXPECT_EQ(ZX_OK, wait3.op.Cancel(loop.async()), "cancel");
+    EXPECT_EQ(ZX_OK, event.signal(0u, ZX_USER_SIGNAL_3), "signal 3");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(1u, wait1.run_count, "run count 1");
     EXPECT_EQ(2u, wait2.run_count, "run count 2");
     EXPECT_EQ(3u, wait3.run_count, "run count 3");
 
     // Redundant cancel returns an error.
-    EXPECT_EQ(MX_ERR_NOT_FOUND, wait3.op.Cancel(loop.async()), "cancel again");
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, wait3.op.Cancel(loop.async()), "cancel again");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(1u, wait1.run_count, "run count 1");
     EXPECT_EQ(2u, wait2.run_count, "run count 2");
     EXPECT_EQ(3u, wait3.run_count, "run count 3");
@@ -376,10 +376,10 @@
 
     async::Loop loop;
 
-    TestWait wait(MX_HANDLE_INVALID, MX_USER_SIGNAL_0);
-    EXPECT_EQ(MX_ERR_BAD_HANDLE, wait.op.Begin(loop.async()), "begin");
-    EXPECT_EQ(MX_ERR_BAD_HANDLE, wait.op.Cancel(loop.async()), "cancel");
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    TestWait wait(ZX_HANDLE_INVALID, ZX_USER_SIGNAL_0);
+    EXPECT_EQ(ZX_ERR_BAD_HANDLE, wait.op.Begin(loop.async()), "begin");
+    EXPECT_EQ(ZX_ERR_BAD_HANDLE, wait.op.Cancel(loop.async()), "cancel");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(0u, wait.run_count, "run count");
 
     END_TEST;
@@ -389,43 +389,43 @@
     BEGIN_TEST;
 
     async::Loop loop;
-    mx::event event;
-    EXPECT_EQ(MX_OK, mx::event::create(0u, &event), "create event");
+    zx::event event;
+    EXPECT_EQ(ZX_OK, zx::event::create(0u, &event), "create event");
 
-    CascadeWait wait1(event.get(), MX_USER_SIGNAL_0, 0u, 0u, false);
+    CascadeWait wait1(event.get(), ZX_USER_SIGNAL_0, 0u, 0u, false);
     wait1.op.set_flags(ASYNC_FLAG_HANDLE_SHUTDOWN);
-    CascadeWait wait2(event.get(), MX_USER_SIGNAL_0, MX_USER_SIGNAL_0, 0u, true);
+    CascadeWait wait2(event.get(), ZX_USER_SIGNAL_0, ZX_USER_SIGNAL_0, 0u, true);
     wait2.op.set_flags(ASYNC_FLAG_HANDLE_SHUTDOWN);
-    TestWait wait3(event.get(), MX_USER_SIGNAL_1);
+    TestWait wait3(event.get(), ZX_USER_SIGNAL_1);
     wait3.op.set_flags(ASYNC_FLAG_HANDLE_SHUTDOWN);
-    TestWait wait4(event.get(), MX_USER_SIGNAL_1);
+    TestWait wait4(event.get(), ZX_USER_SIGNAL_1);
 
-    EXPECT_EQ(MX_OK, wait1.op.Begin(loop.async()), "begin 1");
-    EXPECT_EQ(MX_OK, wait2.op.Begin(loop.async()), "begin 2");
-    EXPECT_EQ(MX_OK, wait3.op.Begin(loop.async()), "begin 3");
-    EXPECT_EQ(MX_OK, wait4.op.Begin(loop.async()), "begin 4");
+    EXPECT_EQ(ZX_OK, wait1.op.Begin(loop.async()), "begin 1");
+    EXPECT_EQ(ZX_OK, wait2.op.Begin(loop.async()), "begin 2");
+    EXPECT_EQ(ZX_OK, wait3.op.Begin(loop.async()), "begin 3");
+    EXPECT_EQ(ZX_OK, wait4.op.Begin(loop.async()), "begin 4");
 
     // Nothing signaled so nothing happens at first.
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(0u, wait1.run_count, "run count 1");
     EXPECT_EQ(0u, wait2.run_count, "run count 2");
     EXPECT_EQ(0u, wait3.run_count, "run count 3");
     EXPECT_EQ(0u, wait4.run_count, "run count 4");
 
     // Set signal 1: notifies both waiters, |wait2| clears the signal and repeats
-    EXPECT_EQ(MX_OK, event.signal(0u, MX_USER_SIGNAL_0), "signal 1");
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    EXPECT_EQ(ZX_OK, event.signal(0u, ZX_USER_SIGNAL_0), "signal 1");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(1u, wait1.run_count, "run count 1");
-    EXPECT_EQ(MX_OK, wait1.last_status, "status 1");
+    EXPECT_EQ(ZX_OK, wait1.last_status, "status 1");
     EXPECT_NONNULL(wait1.last_signal);
-    EXPECT_EQ(MX_USER_SIGNAL_0, wait1.last_signal->trigger & MX_USER_SIGNAL_ALL, "trigger 1");
-    EXPECT_EQ(MX_USER_SIGNAL_0, wait1.last_signal->observed & MX_USER_SIGNAL_ALL, "observed 1");
+    EXPECT_EQ(ZX_USER_SIGNAL_0, wait1.last_signal->trigger & ZX_USER_SIGNAL_ALL, "trigger 1");
+    EXPECT_EQ(ZX_USER_SIGNAL_0, wait1.last_signal->observed & ZX_USER_SIGNAL_ALL, "observed 1");
     EXPECT_EQ(1u, wait1.last_signal->count, "count 1");
     EXPECT_EQ(1u, wait2.run_count, "run count 2");
-    EXPECT_EQ(MX_OK, wait2.last_status, "status 2");
+    EXPECT_EQ(ZX_OK, wait2.last_status, "status 2");
     EXPECT_NONNULL(wait2.last_signal);
-    EXPECT_EQ(MX_USER_SIGNAL_0, wait2.last_signal->trigger & MX_USER_SIGNAL_ALL, "trigger 2");
-    EXPECT_EQ(MX_USER_SIGNAL_0, wait2.last_signal->observed & MX_USER_SIGNAL_ALL, "observed 2");
+    EXPECT_EQ(ZX_USER_SIGNAL_0, wait2.last_signal->trigger & ZX_USER_SIGNAL_ALL, "trigger 2");
+    EXPECT_EQ(ZX_USER_SIGNAL_0, wait2.last_signal->observed & ZX_USER_SIGNAL_ALL, "observed 2");
     EXPECT_EQ(1u, wait2.last_signal->count, "count 2");
     EXPECT_EQ(0u, wait3.run_count, "run count 3");
     EXPECT_EQ(0u, wait4.run_count, "run count 4");
@@ -438,17 +438,17 @@
     loop.Shutdown();
     EXPECT_EQ(1u, wait1.run_count, "run count 1");
     EXPECT_EQ(2u, wait2.run_count, "run count 2");
-    EXPECT_EQ(MX_ERR_CANCELED, wait2.last_status, "status 2");
+    EXPECT_EQ(ZX_ERR_CANCELED, wait2.last_status, "status 2");
     EXPECT_NULL(wait2.last_signal, "signal 2");
     EXPECT_EQ(1u, wait3.run_count, "run count 3");
-    EXPECT_EQ(MX_ERR_CANCELED, wait3.last_status, "status 3");
+    EXPECT_EQ(ZX_ERR_CANCELED, wait3.last_status, "status 3");
     EXPECT_NULL(wait3.last_signal, "signal 3");
     EXPECT_EQ(0u, wait4.run_count, "run count 4");
 
     // Try to add or cancel work after shutdown.
-    TestWait wait5(event.get(), MX_USER_SIGNAL_0);
-    EXPECT_EQ(MX_ERR_BAD_STATE, wait5.op.Begin(loop.async()), "begin after shutdown");
-    EXPECT_EQ(MX_ERR_NOT_FOUND, wait5.op.Cancel(loop.async()), "cancel after shutdown");
+    TestWait wait5(event.get(), ZX_USER_SIGNAL_0);
+    EXPECT_EQ(ZX_ERR_BAD_STATE, wait5.op.Begin(loop.async()), "begin after shutdown");
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, wait5.op.Cancel(loop.async()), "cancel after shutdown");
     EXPECT_EQ(0u, wait5.run_count, "run count 5");
 
     END_TEST;
@@ -459,50 +459,50 @@
 
     async::Loop loop;
 
-    mx_time_t start_time = now();
-    TestTask task1(start_time + MX_MSEC(1));
-    RepeatingTask task2(start_time + MX_MSEC(1), MX_MSEC(1), 3u);
+    zx_time_t start_time = now();
+    TestTask task1(start_time + ZX_MSEC(1));
+    RepeatingTask task2(start_time + ZX_MSEC(1), ZX_MSEC(1), 3u);
     TestTask task3(start_time);
-    QuitTask task4(start_time + MX_MSEC(10));
-    TestTask task5(start_time + MX_MSEC(10)); // posted after quit
+    QuitTask task4(start_time + ZX_MSEC(10));
+    TestTask task5(start_time + ZX_MSEC(10)); // posted after quit
 
-    EXPECT_EQ(MX_OK, task1.op.Post(loop.async()), "post 1");
-    EXPECT_EQ(MX_OK, task2.op.Post(loop.async()), "post 2");
-    EXPECT_EQ(MX_OK, task3.op.Post(loop.async()), "post 3");
+    EXPECT_EQ(ZX_OK, task1.op.Post(loop.async()), "post 1");
+    EXPECT_EQ(ZX_OK, task2.op.Post(loop.async()), "post 2");
+    EXPECT_EQ(ZX_OK, task3.op.Post(loop.async()), "post 3");
     task2.set_finish_callback([&loop, &task4, &task5] {
         task4.op.Post(loop.async());
         task5.op.Post(loop.async());
     });
 
     // Cancel task 3.
-    EXPECT_EQ(MX_OK, task3.op.Cancel(loop.async()), "cancel 3");
+    EXPECT_EQ(ZX_OK, task3.op.Cancel(loop.async()), "cancel 3");
 
     // Run until quit.
-    EXPECT_EQ(MX_ERR_CANCELED, loop.Run(), "run loop");
+    EXPECT_EQ(ZX_ERR_CANCELED, loop.Run(), "run loop");
     EXPECT_EQ(ASYNC_LOOP_QUIT, loop.GetState(), "quitting");
     EXPECT_EQ(1u, task1.run_count, "run count 1");
-    EXPECT_EQ(MX_OK, task1.last_status, "status 1");
+    EXPECT_EQ(ZX_OK, task1.last_status, "status 1");
     EXPECT_EQ(4u, task2.run_count, "run count 2");
-    EXPECT_EQ(MX_OK, task2.last_status, "status 2");
+    EXPECT_EQ(ZX_OK, task2.last_status, "status 2");
     EXPECT_EQ(0u, task3.run_count, "run count 3");
     EXPECT_EQ(1u, task4.run_count, "run count 4");
-    EXPECT_EQ(MX_OK, task4.last_status, "status 4");
+    EXPECT_EQ(ZX_OK, task4.last_status, "status 4");
     EXPECT_EQ(0u, task5.run_count, "run count 5");
 
     // Reset quit and keep running, now task5 should go ahead followed
     // by any subsequently posted tasks even if they have earlier deadlines.
     QuitTask task6(start_time);
     TestTask task7(start_time);
-    EXPECT_EQ(MX_OK, task6.op.Post(loop.async()), "post 6");
-    EXPECT_EQ(MX_OK, task7.op.Post(loop.async()), "post 7");
-    EXPECT_EQ(MX_OK, loop.ResetQuit());
-    EXPECT_EQ(MX_ERR_CANCELED, loop.Run(), "run loop");
+    EXPECT_EQ(ZX_OK, task6.op.Post(loop.async()), "post 6");
+    EXPECT_EQ(ZX_OK, task7.op.Post(loop.async()), "post 7");
+    EXPECT_EQ(ZX_OK, loop.ResetQuit());
+    EXPECT_EQ(ZX_ERR_CANCELED, loop.Run(), "run loop");
     EXPECT_EQ(ASYNC_LOOP_QUIT, loop.GetState(), "quitting");
 
     EXPECT_EQ(1u, task5.run_count, "run count 5");
-    EXPECT_EQ(MX_OK, task5.last_status, "status 5");
+    EXPECT_EQ(ZX_OK, task5.last_status, "status 5");
     EXPECT_EQ(1u, task6.run_count, "run count 6");
-    EXPECT_EQ(MX_OK, task6.last_status, "status 6");
+    EXPECT_EQ(ZX_OK, task6.last_status, "status 6");
     EXPECT_EQ(0u, task7.run_count, "run count 7");
 
     END_TEST;
@@ -513,39 +513,39 @@
 
     async::Loop loop;
 
-    mx_time_t start_time = now();
-    TestTask task1(start_time + MX_MSEC(1));
+    zx_time_t start_time = now();
+    TestTask task1(start_time + ZX_MSEC(1));
     task1.op.set_flags(ASYNC_FLAG_HANDLE_SHUTDOWN);
-    RepeatingTask task2(start_time + MX_MSEC(1), MX_MSEC(1000), 1u);
+    RepeatingTask task2(start_time + ZX_MSEC(1), ZX_MSEC(1000), 1u);
     task2.op.set_flags(ASYNC_FLAG_HANDLE_SHUTDOWN);
-    TestTask task3(MX_TIME_INFINITE);
+    TestTask task3(ZX_TIME_INFINITE);
     task3.op.set_flags(ASYNC_FLAG_HANDLE_SHUTDOWN);
-    TestTask task4(MX_TIME_INFINITE);
+    TestTask task4(ZX_TIME_INFINITE);
     task4.op.set_flags(ASYNC_FLAG_HANDLE_SHUTDOWN);
-    TestTask task5(MX_TIME_INFINITE);
-    QuitTask task6(start_time + MX_MSEC(1));
+    TestTask task5(ZX_TIME_INFINITE);
+    QuitTask task6(start_time + ZX_MSEC(1));
 
-    EXPECT_EQ(MX_OK, task1.op.Post(loop.async()), "post 1");
-    EXPECT_EQ(MX_OK, task2.op.Post(loop.async()), "post 2");
-    EXPECT_EQ(MX_OK, task3.op.Post(loop.async()), "post 3");
-    EXPECT_EQ(MX_OK, task4.op.Post(loop.async()), "post 4");
-    EXPECT_EQ(MX_OK, task5.op.Post(loop.async()), "post 5");
-    EXPECT_EQ(MX_OK, task6.op.Post(loop.async()), "post 6");
+    EXPECT_EQ(ZX_OK, task1.op.Post(loop.async()), "post 1");
+    EXPECT_EQ(ZX_OK, task2.op.Post(loop.async()), "post 2");
+    EXPECT_EQ(ZX_OK, task3.op.Post(loop.async()), "post 3");
+    EXPECT_EQ(ZX_OK, task4.op.Post(loop.async()), "post 4");
+    EXPECT_EQ(ZX_OK, task5.op.Post(loop.async()), "post 5");
+    EXPECT_EQ(ZX_OK, task6.op.Post(loop.async()), "post 6");
 
     // Run tasks which are due up to the time when the quit task runs.
-    EXPECT_EQ(MX_ERR_CANCELED, loop.Run(), "run loop");
+    EXPECT_EQ(ZX_ERR_CANCELED, loop.Run(), "run loop");
     EXPECT_EQ(1u, task1.run_count, "run count 1");
-    EXPECT_EQ(MX_OK, task1.last_status, "status 1");
+    EXPECT_EQ(ZX_OK, task1.last_status, "status 1");
     EXPECT_EQ(1u, task2.run_count, "run count 2");
-    EXPECT_EQ(MX_OK, task2.last_status, "status 2");
+    EXPECT_EQ(ZX_OK, task2.last_status, "status 2");
     EXPECT_EQ(0u, task3.run_count, "run count 3");
     EXPECT_EQ(0u, task4.run_count, "run count 4");
     EXPECT_EQ(0u, task5.run_count, "run count 5");
     EXPECT_EQ(1u, task6.run_count, "run count 6");
-    EXPECT_EQ(MX_OK, task6.last_status, "status 6");
+    EXPECT_EQ(ZX_OK, task6.last_status, "status 6");
 
     // Cancel task 4.
-    EXPECT_EQ(MX_OK, task4.op.Cancel(loop.async()), "cancel 4");
+    EXPECT_EQ(ZX_OK, task4.op.Cancel(loop.async()), "cancel 4");
 
     // When the loop shuts down:
     //   |task1| not notified because it was serviced
@@ -557,27 +557,27 @@
     loop.Shutdown();
     EXPECT_EQ(1u, task1.run_count, "run count 1");
     EXPECT_EQ(2u, task2.run_count, "run count 2");
-    EXPECT_EQ(MX_ERR_CANCELED, task2.last_status, "status 2");
+    EXPECT_EQ(ZX_ERR_CANCELED, task2.last_status, "status 2");
     EXPECT_EQ(1u, task3.run_count, "run count 3");
-    EXPECT_EQ(MX_ERR_CANCELED, task3.last_status, "status 3");
+    EXPECT_EQ(ZX_ERR_CANCELED, task3.last_status, "status 3");
     EXPECT_EQ(0u, task4.run_count, "run count 4");
     EXPECT_EQ(0u, task5.run_count, "run count 5");
     EXPECT_EQ(1u, task6.run_count, "run count 6");
 
     // Try to add or cancel work after shutdown.
-    TestTask task7(MX_TIME_INFINITE);
-    EXPECT_EQ(MX_ERR_BAD_STATE, task7.op.Post(loop.async()), "post after shutdown");
-    EXPECT_EQ(MX_ERR_NOT_FOUND, task7.op.Cancel(loop.async()), "cancel after shutdown");
+    TestTask task7(ZX_TIME_INFINITE);
+    EXPECT_EQ(ZX_ERR_BAD_STATE, task7.op.Post(loop.async()), "post after shutdown");
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, task7.op.Cancel(loop.async()), "cancel after shutdown");
     EXPECT_EQ(0u, task7.run_count, "run count 7");
 
     END_TEST;
 }
 
 bool receiver_test() {
-    const mx_packet_user_t data1{.u64 = {11, 12, 13, 14}};
-    const mx_packet_user_t data2{.u64 = {21, 22, 23, 24}};
-    const mx_packet_user_t data3{.u64 = {31, 32, 33, 34}};
-    const mx_packet_user_t data_default{};
+    const zx_packet_user_t data1{.u64 = {11, 12, 13, 14}};
+    const zx_packet_user_t data2{.u64 = {21, 22, 23, 24}};
+    const zx_packet_user_t data3{.u64 = {31, 32, 33, 34}};
+    const zx_packet_user_t data_default{};
 
     BEGIN_TEST;
 
@@ -587,24 +587,24 @@
     TestReceiver receiver2;
     TestReceiver receiver3;
 
-    EXPECT_EQ(MX_OK, receiver1.op.Queue(loop.async(), &data1), "queue 1");
-    EXPECT_EQ(MX_OK, receiver1.op.Queue(loop.async(), &data3), "queue 1, again");
-    EXPECT_EQ(MX_OK, receiver2.op.Queue(loop.async(), &data2), "queue 2");
-    EXPECT_EQ(MX_OK, receiver3.op.Queue(loop.async()), "queue 3");
+    EXPECT_EQ(ZX_OK, receiver1.op.Queue(loop.async(), &data1), "queue 1");
+    EXPECT_EQ(ZX_OK, receiver1.op.Queue(loop.async(), &data3), "queue 1, again");
+    EXPECT_EQ(ZX_OK, receiver2.op.Queue(loop.async(), &data2), "queue 2");
+    EXPECT_EQ(ZX_OK, receiver3.op.Queue(loop.async()), "queue 3");
 
-    EXPECT_EQ(MX_ERR_TIMED_OUT, loop.Run(mx_deadline_after(MX_MSEC(1))), "run loop");
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, loop.Run(zx_deadline_after(ZX_MSEC(1))), "run loop");
     EXPECT_EQ(2u, receiver1.run_count, "run count 1");
-    EXPECT_EQ(MX_OK, receiver1.last_status, "status 1");
+    EXPECT_EQ(ZX_OK, receiver1.last_status, "status 1");
     EXPECT_NONNULL(receiver1.last_data);
-    EXPECT_EQ(0, memcmp(&data3, receiver1.last_data, sizeof(mx_packet_user_t)), "data 1");
+    EXPECT_EQ(0, memcmp(&data3, receiver1.last_data, sizeof(zx_packet_user_t)), "data 1");
     EXPECT_EQ(1u, receiver2.run_count, "run count 2");
-    EXPECT_EQ(MX_OK, receiver2.last_status, "status 2");
+    EXPECT_EQ(ZX_OK, receiver2.last_status, "status 2");
     EXPECT_NONNULL(receiver2.last_data);
-    EXPECT_EQ(0, memcmp(&data2, receiver2.last_data, sizeof(mx_packet_user_t)), "data 2");
+    EXPECT_EQ(0, memcmp(&data2, receiver2.last_data, sizeof(zx_packet_user_t)), "data 2");
     EXPECT_EQ(1u, receiver3.run_count, "run count 3");
-    EXPECT_EQ(MX_OK, receiver3.last_status, "status 3");
+    EXPECT_EQ(ZX_OK, receiver3.last_status, "status 3");
     EXPECT_NONNULL(receiver3.last_data);
-    EXPECT_EQ(0, memcmp(&data_default, receiver3.last_data, sizeof(mx_packet_user_t)), "data 3");
+    EXPECT_EQ(0, memcmp(&data_default, receiver3.last_data, sizeof(zx_packet_user_t)), "data 3");
 
     END_TEST;
 }
@@ -617,7 +617,7 @@
 
     // Try to add work after shutdown.
     TestReceiver receiver;
-    EXPECT_EQ(MX_ERR_BAD_STATE, receiver.op.Queue(loop.async()), "queue after shutdown");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, receiver.op.Queue(loop.async()), "queue after shutdown");
     EXPECT_EQ(0u, receiver.run_count, "run count 1");
 
     END_TEST;
@@ -628,7 +628,7 @@
     async_t* last_default_dispatcher;
 
 protected:
-    async_task_result_t Handle(async_t* async, mx_status_t status) override {
+    async_task_result_t Handle(async_t* async, zx_status_t status) override {
         QuitTask::Handle(async, status);
         last_default_dispatcher = async_get_default();
         return ASYNC_TASK_FINISHED;
@@ -656,7 +656,7 @@
                                                      fbl::memory_order_acquire));
 
         // Pretend to do work.
-        mx_nanosleep(mx_deadline_after(MX_MSEC(1)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(1)));
 
         // Decrement count of active threads.
         fbl::atomic_fetch_sub(&active_threads_, 1u, fbl::memory_order_acq_rel);
@@ -675,14 +675,14 @@
 
 class ThreadAssertWait : public TestWait {
 public:
-    ThreadAssertWait(mx_handle_t object, mx_signals_t trigger, ConcurrencyMeasure* measure)
+    ThreadAssertWait(zx_handle_t object, zx_signals_t trigger, ConcurrencyMeasure* measure)
         : TestWait(object, trigger), measure_(measure) {}
 
 protected:
     ConcurrencyMeasure* measure_;
 
-    async_wait_result_t Handle(async_t* async, mx_status_t status,
-                               const mx_packet_signal_t* signal) override {
+    async_wait_result_t Handle(async_t* async, zx_status_t status,
+                               const zx_packet_signal_t* signal) override {
         TestWait::Handle(async, status, signal);
         measure_->Tally(async);
         return ASYNC_WAIT_FINISHED;
@@ -691,13 +691,13 @@
 
 class ThreadAssertTask : public TestTask {
 public:
-    ThreadAssertTask(mx_time_t deadline, ConcurrencyMeasure* measure)
+    ThreadAssertTask(zx_time_t deadline, ConcurrencyMeasure* measure)
         : TestTask(deadline), measure_(measure) {}
 
 protected:
     ConcurrencyMeasure* measure_;
 
-    async_task_result_t Handle(async_t* async, mx_status_t status) override {
+    async_task_result_t Handle(async_t* async, zx_status_t status) override {
         TestTask::Handle(async, status);
         measure_->Tally(async);
         return ASYNC_TASK_FINISHED;
@@ -716,7 +716,7 @@
     // (unlike the Waits and Tasks) so we must guard its state.
     fbl::Mutex mutex_;
 
-    void Handle(async_t* async, mx_status_t status, const mx_packet_user_t* data) override {
+    void Handle(async_t* async, zx_status_t status, const zx_packet_user_t* data) override {
         {
             fbl::AutoLock lock(&mutex_);
             TestReceiver::Handle(async, status, data);
@@ -729,14 +729,14 @@
     BEGIN_TEST;
 
     async::Loop loop;
-    EXPECT_EQ(MX_OK, loop.StartThread(), "start thread");
+    EXPECT_EQ(ZX_OK, loop.StartThread(), "start thread");
 
     GetDefaultDispatcherTask task;
-    EXPECT_EQ(MX_OK, task.op.Post(loop.async()), "post task");
+    EXPECT_EQ(ZX_OK, task.op.Post(loop.async()), "post task");
     loop.JoinThreads();
 
     EXPECT_EQ(1u, task.run_count, "run count");
-    EXPECT_EQ(MX_OK, task.last_status, "status");
+    EXPECT_EQ(ZX_OK, task.last_status, "status");
     EXPECT_EQ(loop.async(), task.last_default_dispatcher, "default dispatcher");
 
     END_TEST;
@@ -750,7 +750,7 @@
 
     async::Loop loop;
     for (size_t i = 0; i < num_threads; i++) {
-        EXPECT_EQ(MX_OK, loop.StartThread());
+        EXPECT_EQ(ZX_OK, loop.StartThread());
     }
     loop.Quit();
     loop.JoinThreads();
@@ -767,14 +767,14 @@
 
     async::Loop loop;
     for (size_t i = 0; i < num_threads; i++) {
-        EXPECT_EQ(MX_OK, loop.StartThread());
+        EXPECT_EQ(ZX_OK, loop.StartThread());
     }
     loop.Shutdown();
     EXPECT_EQ(ASYNC_LOOP_SHUTDOWN, loop.GetState());
 
     loop.JoinThreads(); // should be a no-op
 
-    EXPECT_EQ(MX_ERR_BAD_STATE, loop.StartThread(), "can't start threads after shutdown");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, loop.StartThread(), "can't start threads after shutdown");
 
     END_TEST;
 }
@@ -789,19 +789,19 @@
 
     async::Loop loop;
     for (size_t i = 0; i < num_threads; i++) {
-        EXPECT_EQ(MX_OK, loop.StartThread(), "start thread");
+        EXPECT_EQ(ZX_OK, loop.StartThread(), "start thread");
     }
 
     ConcurrencyMeasure measure(num_items);
-    mx::event event;
-    EXPECT_EQ(MX_OK, mx::event::create(0u, &event), "create event");
-    EXPECT_EQ(MX_OK, event.signal(0u, MX_USER_SIGNAL_0), "signal");
+    zx::event event;
+    EXPECT_EQ(ZX_OK, zx::event::create(0u, &event), "create event");
+    EXPECT_EQ(ZX_OK, event.signal(0u, ZX_USER_SIGNAL_0), "signal");
 
     // Post a number of work items to run all at once.
     ThreadAssertWait* items[num_items];
     for (size_t i = 0; i < num_items; i++) {
-        items[i] = new ThreadAssertWait(event.get(), MX_USER_SIGNAL_0, &measure);
-        EXPECT_EQ(MX_OK, items[i]->op.Begin(loop.async()), "begin wait");
+        items[i] = new ThreadAssertWait(event.get(), ZX_USER_SIGNAL_0, &measure);
+        EXPECT_EQ(ZX_OK, items[i]->op.Begin(loop.async()), "begin wait");
     }
 
     // Wait until quitted.
@@ -811,9 +811,9 @@
     EXPECT_EQ(num_items, measure.count(), "item count");
     for (size_t i = 0; i < num_items; i++) {
         EXPECT_EQ(1u, items[i]->run_count, "run count");
-        EXPECT_EQ(MX_OK, items[i]->last_status, "status");
+        EXPECT_EQ(ZX_OK, items[i]->last_status, "status");
         EXPECT_NONNULL(items[i]->last_signal, "signal");
-        EXPECT_EQ(MX_USER_SIGNAL_0, items[i]->last_signal->observed & MX_USER_SIGNAL_ALL, "observed");
+        EXPECT_EQ(ZX_USER_SIGNAL_0, items[i]->last_signal->observed & ZX_USER_SIGNAL_ALL, "observed");
         delete items[i];
     }
 
@@ -833,17 +833,17 @@
 
     async::Loop loop;
     for (size_t i = 0; i < num_threads; i++) {
-        EXPECT_EQ(MX_OK, loop.StartThread(), "start thread");
+        EXPECT_EQ(ZX_OK, loop.StartThread(), "start thread");
     }
 
     ConcurrencyMeasure measure(num_items);
 
     // Post a number of work items to run all at once.
     ThreadAssertTask* items[num_items];
-    mx_time_t start_time = now();
+    zx_time_t start_time = now();
     for (size_t i = 0; i < num_items; i++) {
-        items[i] = new ThreadAssertTask(start_time + MX_MSEC(i), &measure);
-        EXPECT_EQ(MX_OK, items[i]->op.Post(loop.async()), "post task");
+        items[i] = new ThreadAssertTask(start_time + ZX_MSEC(i), &measure);
+        EXPECT_EQ(ZX_OK, items[i]->op.Post(loop.async()), "post task");
     }
 
     // Wait until quitted.
@@ -853,7 +853,7 @@
     EXPECT_EQ(num_items, measure.count(), "item count");
     for (size_t i = 0; i < num_items; i++) {
         EXPECT_EQ(1u, items[i]->run_count, "run count");
-        EXPECT_EQ(MX_OK, items[i]->last_status, "status");
+        EXPECT_EQ(ZX_OK, items[i]->last_status, "status");
         delete items[i];
     }
 
@@ -874,7 +874,7 @@
 
     async::Loop loop;
     for (size_t i = 0; i < num_threads; i++) {
-        EXPECT_EQ(MX_OK, loop.StartThread(), "start thread");
+        EXPECT_EQ(ZX_OK, loop.StartThread(), "start thread");
     }
 
     ConcurrencyMeasure measure(num_items);
@@ -882,7 +882,7 @@
     // Post a number of packets all at once.
     ThreadAssertReceiver receiver(&measure);
     for (size_t i = 0; i < num_items; i++) {
-        EXPECT_EQ(MX_OK, receiver.op.Queue(loop.async()), "queue packet");
+        EXPECT_EQ(ZX_OK, receiver.op.Queue(loop.async()), "queue packet");
     }
 
     // Wait until quitted.
@@ -891,7 +891,7 @@
     // Ensure all work items completed.
     EXPECT_EQ(num_items, measure.count(), "item count");
     EXPECT_EQ(num_items, receiver.run_count, "run count");
-    EXPECT_EQ(MX_OK, receiver.last_status, "status");
+    EXPECT_EQ(ZX_OK, receiver.last_status, "status");
 
     // Ensure that we actually processed many packets concurrently on different threads.
     EXPECT_NE(1u, measure.max_threads(), "packets handled concurrently");
diff --git a/system/utest/async/receiver_tests.cpp b/system/utest/async/receiver_tests.cpp
index d3329db..555a11b 100644
--- a/system/utest/async/receiver_tests.cpp
+++ b/system/utest/async/receiver_tests.cpp
@@ -19,21 +19,21 @@
 
     Op last_op = Op::NONE;
     async_receiver_t* last_receiver = nullptr;
-    const mx_packet_user_t* last_data = nullptr;
+    const zx_packet_user_t* last_data = nullptr;
 
-    mx_status_t QueuePacket(async_receiver_t* receiver,
-                            const mx_packet_user_t* data) override {
+    zx_status_t QueuePacket(async_receiver_t* receiver,
+                            const zx_packet_user_t* data) override {
         last_op = Op::QUEUE_PACKET;
         last_receiver = receiver;
         last_data = data;
-        return MX_OK;
+        return ZX_OK;
     }
 };
 
 struct Handler {
     Handler(async::Receiver* receiver) {
-        receiver->set_handler([this](async_t* async, mx_status_t status,
-                                     const mx_packet_user_t* data) {
+        receiver->set_handler([this](async_t* async, zx_status_t status,
+                                     const zx_packet_user_t* data) {
             handler_ran = true;
             last_status = status;
             last_data = data;
@@ -41,13 +41,13 @@
     }
 
     bool handler_ran = false;
-    mx_status_t last_status = MX_ERR_INTERNAL;
-    const mx_packet_user_t* last_data = nullptr;
+    zx_status_t last_status = ZX_ERR_INTERNAL;
+    const zx_packet_user_t* last_data = nullptr;
 };
 
 bool wrapper_test() {
     const uint32_t dummy_flags = ASYNC_FLAG_HANDLE_SHUTDOWN;
-    const mx_packet_user_t dummy_data{};
+    const zx_packet_user_t dummy_data{};
 
     BEGIN_TEST;
 
@@ -71,24 +71,24 @@
 
         MockAsync async;
 
-        EXPECT_EQ(MX_OK, explicit_receiver.Queue(&async, nullptr), "queue, null data");
+        EXPECT_EQ(ZX_OK, explicit_receiver.Queue(&async, nullptr), "queue, null data");
         EXPECT_EQ(MockAsync::Op::QUEUE_PACKET, async.last_op, "op");
         EXPECT_EQ(dummy_flags, async.last_receiver->flags, "flags");
         EXPECT_NULL(async.last_data, "data");
 
-        EXPECT_EQ(MX_OK, explicit_receiver.Queue(&async, &dummy_data), "queue, non-null data");
+        EXPECT_EQ(ZX_OK, explicit_receiver.Queue(&async, &dummy_data), "queue, non-null data");
         EXPECT_EQ(MockAsync::Op::QUEUE_PACKET, async.last_op, "op");
         EXPECT_EQ(dummy_flags, async.last_receiver->flags, "flags");
         EXPECT_EQ(&dummy_data, async.last_data, "data");
 
-        async.last_receiver->handler(&async, async.last_receiver, MX_OK, nullptr);
+        async.last_receiver->handler(&async, async.last_receiver, ZX_OK, nullptr);
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_OK, handler.last_status, "status");
+        EXPECT_EQ(ZX_OK, handler.last_status, "status");
         EXPECT_NULL(handler.last_data, "data");
 
-        async.last_receiver->handler(&async, async.last_receiver, MX_OK, &dummy_data);
+        async.last_receiver->handler(&async, async.last_receiver, ZX_OK, &dummy_data);
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_OK, handler.last_status, "status");
+        EXPECT_EQ(ZX_OK, handler.last_status, "status");
         EXPECT_EQ(&dummy_data, handler.last_data, "data");
     }
 
@@ -100,9 +100,9 @@
 
     AsyncStub async;
     async_receiver_t receiver{};
-    EXPECT_EQ(MX_ERR_NOT_SUPPORTED, async_queue_packet(&async, &receiver, nullptr), "valid args without data");
-    mx_packet_user_t data;
-    EXPECT_EQ(MX_ERR_NOT_SUPPORTED, async_queue_packet(&async, &receiver, &data), "valid args with data");
+    EXPECT_EQ(ZX_ERR_NOT_SUPPORTED, async_queue_packet(&async, &receiver, nullptr), "valid args without data");
+    zx_packet_user_t data;
+    EXPECT_EQ(ZX_ERR_NOT_SUPPORTED, async_queue_packet(&async, &receiver, &data), "valid args with data");
 
     END_TEST;
 }
diff --git a/system/utest/async/rules.mk b/system/utest/async/rules.mk
index 6b4249d..086d0b9 100644
--- a/system/utest/async/rules.mk
+++ b/system/utest/async/rules.mk
@@ -23,15 +23,15 @@
 MODULE_STATIC_LIBS := \
     system/ulib/async \
     system/ulib/async.loop \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl
 
 MODULE_LIBS := \
     system/ulib/async.default \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/unittest
 
 include make/module.mk
diff --git a/system/utest/async/task_tests.cpp b/system/utest/async/task_tests.cpp
index 72a69b0..e7716f0 100644
--- a/system/utest/async/task_tests.cpp
+++ b/system/utest/async/task_tests.cpp
@@ -22,16 +22,16 @@
     Op last_op = Op::NONE;
     async_task_t* last_task = nullptr;
 
-    mx_status_t PostTask(async_task_t* task) override {
+    zx_status_t PostTask(async_task_t* task) override {
         last_op = Op::POST_TASK;
         last_task = task;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t CancelTask(async_task_t* task) override {
+    zx_status_t CancelTask(async_task_t* task) override {
         last_op = Op::CANCEL_TASK;
         last_task = task;
-        return MX_OK;
+        return ZX_OK;
     }
 };
 
@@ -39,7 +39,7 @@
 struct Handler {
     Handler(TTask* task, async_task_result_t result = ASYNC_TASK_REPEAT)
         : result(result) {
-        task->set_handler([this](async_t* async, mx_status_t status) {
+        task->set_handler([this](async_t* async, zx_status_t status) {
             handler_ran = true;
             last_status = status;
             return this->result;
@@ -48,18 +48,18 @@
 
     async_task_result_t result;
     bool handler_ran = false;
-    mx_status_t last_status = MX_ERR_INTERNAL;
+    zx_status_t last_status = ZX_ERR_INTERNAL;
 };
 
 bool task_test() {
-    const mx_time_t dummy_deadline = 1;
+    const zx_time_t dummy_deadline = 1;
     const uint32_t dummy_flags = ASYNC_FLAG_HANDLE_SHUTDOWN;
 
     BEGIN_TEST;
 
     {
         async::Task default_task;
-        EXPECT_EQ(MX_TIME_INFINITE, default_task.deadline(), "default deadline");
+        EXPECT_EQ(ZX_TIME_INFINITE, default_task.deadline(), "default deadline");
         EXPECT_EQ(0u, default_task.flags(), "default flags");
 
         default_task.set_deadline(dummy_deadline);
@@ -81,19 +81,19 @@
         EXPECT_TRUE(!!explicit_task.handler(), "handler");
 
         MockAsync async;
-        EXPECT_EQ(MX_OK, explicit_task.Post(&async), "post, valid args");
+        EXPECT_EQ(ZX_OK, explicit_task.Post(&async), "post, valid args");
         EXPECT_EQ(MockAsync::Op::POST_TASK, async.last_op, "op");
         EXPECT_EQ(dummy_deadline, async.last_task->deadline, "deadline");
         EXPECT_EQ(dummy_flags, async.last_task->flags, "flags");
 
         EXPECT_EQ(ASYNC_TASK_REPEAT,
-                  async.last_task->handler(&async, async.last_task, MX_OK),
+                  async.last_task->handler(&async, async.last_task, ZX_OK),
                   "invoke handler");
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_OK, handler.last_status, "status");
+        EXPECT_EQ(ZX_OK, handler.last_status, "status");
 
         // cancel the task
-        EXPECT_EQ(MX_OK, explicit_task.Cancel(&async), "cancel, valid args");
+        EXPECT_EQ(ZX_OK, explicit_task.Cancel(&async), "cancel, valid args");
         EXPECT_EQ(MockAsync::Op::CANCEL_TASK, async.last_op, "op");
     }
 
@@ -101,7 +101,7 @@
 }
 
 bool auto_task_test() {
-    const mx_time_t dummy_deadline = 1;
+    const zx_time_t dummy_deadline = 1;
     const uint32_t dummy_flags = ASYNC_FLAG_HANDLE_SHUTDOWN;
 
     BEGIN_TEST;
@@ -111,7 +111,7 @@
         async::AutoTask default_task(&async);
         EXPECT_EQ(&async, default_task.async());
         EXPECT_FALSE(default_task.is_pending());
-        EXPECT_EQ(MX_TIME_INFINITE, default_task.deadline(), "default deadline");
+        EXPECT_EQ(ZX_TIME_INFINITE, default_task.deadline(), "default deadline");
         EXPECT_EQ(0u, default_task.flags(), "default flags");
 
         default_task.set_deadline(dummy_deadline);
@@ -135,32 +135,32 @@
         Handler<async::AutoTask> handler(&explicit_task, ASYNC_TASK_FINISHED);
         EXPECT_TRUE(!!explicit_task.handler(), "handler");
 
-        EXPECT_EQ(MX_OK, explicit_task.Post(), "post, valid args");
+        EXPECT_EQ(ZX_OK, explicit_task.Post(), "post, valid args");
         EXPECT_TRUE(explicit_task.is_pending());
         EXPECT_EQ(MockAsync::Op::POST_TASK, async.last_op, "op");
         EXPECT_EQ(dummy_deadline, async.last_task->deadline, "deadline");
         EXPECT_EQ(dummy_flags, async.last_task->flags, "flags");
 
         EXPECT_EQ(ASYNC_TASK_FINISHED,
-                  async.last_task->handler(&async, async.last_task, MX_OK),
+                  async.last_task->handler(&async, async.last_task, ZX_OK),
                   "invoke handler");
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_OK, handler.last_status, "status");
+        EXPECT_EQ(ZX_OK, handler.last_status, "status");
 
         // post a repeating task
         handler.result = ASYNC_TASK_REPEAT;
 
-        EXPECT_EQ(MX_OK, explicit_task.Post(), "post, valid args");
+        EXPECT_EQ(ZX_OK, explicit_task.Post(), "post, valid args");
         EXPECT_TRUE(explicit_task.is_pending());
         EXPECT_EQ(MockAsync::Op::POST_TASK, async.last_op, "op");
         EXPECT_EQ(dummy_deadline, async.last_task->deadline, "deadline");
         EXPECT_EQ(dummy_flags, async.last_task->flags, "flags");
 
         EXPECT_EQ(ASYNC_TASK_REPEAT,
-                  async.last_task->handler(&async, async.last_task, MX_OK),
+                  async.last_task->handler(&async, async.last_task, ZX_OK),
                   "invoke handler");
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_OK, handler.last_status, "status");
+        EXPECT_EQ(ZX_OK, handler.last_status, "status");
 
         // cancel the task
         explicit_task.Cancel();
@@ -168,7 +168,7 @@
         EXPECT_FALSE(explicit_task.is_pending());
 
         // post the task again then let it go out of scope
-        EXPECT_EQ(MX_OK, explicit_task.Post(), "post, valid args");
+        EXPECT_EQ(ZX_OK, explicit_task.Post(), "post, valid args");
         EXPECT_TRUE(explicit_task.is_pending());
         EXPECT_EQ(MockAsync::Op::POST_TASK, async.last_op, "op");
     }
@@ -182,7 +182,7 @@
 
     AsyncStub async;
     async_task_t task{};
-    EXPECT_EQ(MX_ERR_NOT_SUPPORTED, async_post_task(&async, &task), "valid args");
+    EXPECT_EQ(ZX_ERR_NOT_SUPPORTED, async_post_task(&async, &task), "valid args");
 
     END_TEST;
 }
@@ -192,7 +192,7 @@
 
     AsyncStub async;
     async_task_t task{};
-    EXPECT_EQ(MX_ERR_NOT_SUPPORTED, async_cancel_task(&async, &task), "valid args");
+    EXPECT_EQ(ZX_ERR_NOT_SUPPORTED, async_cancel_task(&async, &task), "valid args");
 
     END_TEST;
 }
diff --git a/system/utest/async/wait_tests.cpp b/system/utest/async/wait_tests.cpp
index d2ea6ac..ea42f5c 100644
--- a/system/utest/async/wait_tests.cpp
+++ b/system/utest/async/wait_tests.cpp
@@ -22,16 +22,16 @@
     Op last_op = Op::NONE;
     async_wait_t* last_wait = nullptr;
 
-    mx_status_t BeginWait(async_wait_t* wait) override {
+    zx_status_t BeginWait(async_wait_t* wait) override {
         last_op = Op::BEGIN_WAIT;
         last_wait = wait;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t CancelWait(async_wait_t* wait) override {
+    zx_status_t CancelWait(async_wait_t* wait) override {
         last_op = Op::CANCEL_WAIT;
         last_wait = wait;
-        return MX_OK;
+        return ZX_OK;
     }
 };
 
@@ -39,8 +39,8 @@
 struct Handler {
     Handler(TWait* wait, async_wait_result_t result)
         : result(result) {
-        wait->set_handler([this](async_t* async, mx_status_t status,
-                                 const mx_packet_signal_t* signal) {
+        wait->set_handler([this](async_t* async, zx_status_t status,
+                                 const zx_packet_signal_t* signal) {
             handler_ran = true;
             last_status = status;
             last_signal = signal;
@@ -50,16 +50,16 @@
 
     async_wait_result_t result;
     bool handler_ran = false;
-    mx_status_t last_status = MX_ERR_INTERNAL;
-    const mx_packet_signal_t* last_signal = nullptr;
+    zx_status_t last_status = ZX_ERR_INTERNAL;
+    const zx_packet_signal_t* last_signal = nullptr;
 };
 
 bool wait_test() {
-    const mx_handle_t dummy_handle = 1;
-    const mx_signals_t dummy_trigger = MX_USER_SIGNAL_0;
-    const mx_packet_signal_t dummy_signal{
+    const zx_handle_t dummy_handle = 1;
+    const zx_signals_t dummy_trigger = ZX_USER_SIGNAL_0;
+    const zx_packet_signal_t dummy_signal{
         .trigger = dummy_trigger,
-        .observed = MX_USER_SIGNAL_0 | MX_USER_SIGNAL_1,
+        .observed = ZX_USER_SIGNAL_0 | ZX_USER_SIGNAL_1,
         .count = 0u,
         .reserved0 = 0u,
         .reserved1 = 0u};
@@ -69,8 +69,8 @@
 
     {
         async::Wait default_wait;
-        EXPECT_EQ(MX_HANDLE_INVALID, default_wait.object(), "default object");
-        EXPECT_EQ(MX_SIGNAL_NONE, default_wait.trigger(), "default trigger");
+        EXPECT_EQ(ZX_HANDLE_INVALID, default_wait.object(), "default object");
+        EXPECT_EQ(ZX_SIGNAL_NONE, default_wait.trigger(), "default trigger");
         EXPECT_EQ(0u, default_wait.flags(), "default flags");
 
         default_wait.set_object(dummy_handle);
@@ -95,21 +95,21 @@
         EXPECT_TRUE(!!explicit_wait.handler());
 
         MockAsync async;
-        EXPECT_EQ(MX_OK, explicit_wait.Begin(&async), "begin, valid args");
+        EXPECT_EQ(ZX_OK, explicit_wait.Begin(&async), "begin, valid args");
         EXPECT_EQ(MockAsync::Op::BEGIN_WAIT, async.last_op, "op");
         EXPECT_EQ(dummy_handle, async.last_wait->object, "handle");
         EXPECT_EQ(dummy_trigger, async.last_wait->trigger, "trigger");
         EXPECT_EQ(dummy_flags, async.last_wait->flags, "flags");
 
         EXPECT_EQ(ASYNC_WAIT_AGAIN,
-                  async.last_wait->handler(&async, async.last_wait, MX_OK, &dummy_signal),
+                  async.last_wait->handler(&async, async.last_wait, ZX_OK, &dummy_signal),
                   "invoke handler");
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_OK, handler.last_status, "status");
+        EXPECT_EQ(ZX_OK, handler.last_status, "status");
         EXPECT_EQ(&dummy_signal, handler.last_signal, "signal");
 
         // cancel the wait
-        EXPECT_EQ(MX_OK, explicit_wait.Cancel(&async), "cancel, valid args");
+        EXPECT_EQ(ZX_OK, explicit_wait.Cancel(&async), "cancel, valid args");
         EXPECT_EQ(MockAsync::Op::CANCEL_WAIT, async.last_op, "op");
     }
 
@@ -119,11 +119,11 @@
 bool auto_wait_test() {
     BEGIN_TEST;
 
-    const mx_handle_t dummy_handle = 1;
-    const mx_signals_t dummy_trigger = MX_USER_SIGNAL_0;
-    const mx_packet_signal_t dummy_signal{
+    const zx_handle_t dummy_handle = 1;
+    const zx_signals_t dummy_trigger = ZX_USER_SIGNAL_0;
+    const zx_packet_signal_t dummy_signal{
         .trigger = dummy_trigger,
-        .observed = MX_USER_SIGNAL_0 | MX_USER_SIGNAL_1,
+        .observed = ZX_USER_SIGNAL_0 | ZX_USER_SIGNAL_1,
         .count = 0u,
         .reserved0 = 0u,
         .reserved1 = 0u};
@@ -136,8 +136,8 @@
         async::AutoWait default_wait(&async);
         EXPECT_EQ(&async, default_wait.async());
         EXPECT_FALSE(default_wait.is_pending());
-        EXPECT_EQ(MX_HANDLE_INVALID, default_wait.object(), "default object");
-        EXPECT_EQ(MX_SIGNAL_NONE, default_wait.trigger(), "default trigger");
+        EXPECT_EQ(ZX_HANDLE_INVALID, default_wait.object(), "default object");
+        EXPECT_EQ(ZX_SIGNAL_NONE, default_wait.trigger(), "default trigger");
         EXPECT_EQ(0u, default_wait.flags(), "default flags");
 
         default_wait.set_object(dummy_handle);
@@ -164,7 +164,7 @@
         Handler<async::AutoWait> handler(&explicit_wait, ASYNC_WAIT_FINISHED);
         EXPECT_TRUE(!!explicit_wait.handler());
 
-        EXPECT_EQ(MX_OK, explicit_wait.Begin(), "begin, valid args");
+        EXPECT_EQ(ZX_OK, explicit_wait.Begin(), "begin, valid args");
         EXPECT_TRUE(explicit_wait.is_pending());
         EXPECT_EQ(MockAsync::Op::BEGIN_WAIT, async.last_op, "op");
         EXPECT_EQ(dummy_handle, async.last_wait->object, "handle");
@@ -172,17 +172,17 @@
         EXPECT_EQ(dummy_flags, async.last_wait->flags, "flags");
 
         EXPECT_EQ(ASYNC_WAIT_FINISHED,
-                  async.last_wait->handler(&async, async.last_wait, MX_OK, &dummy_signal),
+                  async.last_wait->handler(&async, async.last_wait, ZX_OK, &dummy_signal),
                   "invoke handler");
         EXPECT_FALSE(explicit_wait.is_pending());
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_OK, handler.last_status, "status");
+        EXPECT_EQ(ZX_OK, handler.last_status, "status");
         EXPECT_EQ(&dummy_signal, handler.last_signal, "signal");
 
         // begin a repeating wait
         handler.result = ASYNC_WAIT_AGAIN;
 
-        EXPECT_EQ(MX_OK, explicit_wait.Begin(), "begin, valid args");
+        EXPECT_EQ(ZX_OK, explicit_wait.Begin(), "begin, valid args");
         EXPECT_TRUE(explicit_wait.is_pending());
         EXPECT_EQ(MockAsync::Op::BEGIN_WAIT, async.last_op, "op");
         EXPECT_EQ(dummy_handle, async.last_wait->object, "handle");
@@ -190,11 +190,11 @@
         EXPECT_EQ(dummy_flags, async.last_wait->flags, "flags");
 
         EXPECT_EQ(ASYNC_WAIT_AGAIN,
-                  async.last_wait->handler(&async, async.last_wait, MX_OK, &dummy_signal),
+                  async.last_wait->handler(&async, async.last_wait, ZX_OK, &dummy_signal),
                   "invoke handler");
         EXPECT_TRUE(explicit_wait.is_pending());
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_OK, handler.last_status, "status");
+        EXPECT_EQ(ZX_OK, handler.last_status, "status");
         EXPECT_EQ(&dummy_signal, handler.last_signal, "signal");
 
         // cancel the wait
@@ -203,7 +203,7 @@
         EXPECT_FALSE(explicit_wait.is_pending());
 
         // begin the wait again then let it go out of scope
-        EXPECT_EQ(MX_OK, explicit_wait.Begin(), "begin, valid args");
+        EXPECT_EQ(ZX_OK, explicit_wait.Begin(), "begin, valid args");
         EXPECT_TRUE(explicit_wait.is_pending());
         EXPECT_EQ(MockAsync::Op::BEGIN_WAIT, async.last_op, "op");
     }
@@ -217,7 +217,7 @@
 
     AsyncStub async;
     async_wait_t wait{};
-    EXPECT_EQ(MX_ERR_NOT_SUPPORTED, async_begin_wait(&async, &wait), "valid args");
+    EXPECT_EQ(ZX_ERR_NOT_SUPPORTED, async_begin_wait(&async, &wait), "valid args");
 
     END_TEST;
 }
@@ -227,7 +227,7 @@
 
     AsyncStub async;
     async_wait_t wait{};
-    EXPECT_EQ(MX_ERR_NOT_SUPPORTED, async_cancel_wait(&async, &wait), "valid args");
+    EXPECT_EQ(ZX_ERR_NOT_SUPPORTED, async_cancel_wait(&async, &wait), "valid args");
 
     END_TEST;
 }
diff --git a/system/utest/async/wait_with_timeout_tests.cpp b/system/utest/async/wait_with_timeout_tests.cpp
index 52ec200..e9ffb56 100644
--- a/system/utest/async/wait_with_timeout_tests.cpp
+++ b/system/utest/async/wait_with_timeout_tests.cpp
@@ -16,27 +16,27 @@
     async_wait_t* last_cancel_wait = nullptr;
     async_task_t* last_post_task = nullptr;
     async_task_t* last_cancel_task = nullptr;
-    mx_status_t next_begin_wait_status = MX_OK;
-    mx_status_t next_cancel_wait_status = MX_OK;
-    mx_status_t next_post_task_status = MX_OK;
-    mx_status_t next_cancel_task_status = MX_OK;
+    zx_status_t next_begin_wait_status = ZX_OK;
+    zx_status_t next_cancel_wait_status = ZX_OK;
+    zx_status_t next_post_task_status = ZX_OK;
+    zx_status_t next_cancel_task_status = ZX_OK;
 
-    mx_status_t BeginWait(async_wait_t* wait) override {
+    zx_status_t BeginWait(async_wait_t* wait) override {
         last_begin_wait = wait;
         return next_begin_wait_status;
     }
 
-    mx_status_t CancelWait(async_wait_t* wait) override {
+    zx_status_t CancelWait(async_wait_t* wait) override {
         last_cancel_wait = wait;
         return next_cancel_wait_status;
     }
 
-    mx_status_t PostTask(async_task_t* task) override {
+    zx_status_t PostTask(async_task_t* task) override {
         last_post_task = task;
         return next_post_task_status;
     }
 
-    mx_status_t CancelTask(async_task_t* task) override {
+    zx_status_t CancelTask(async_task_t* task) override {
         last_cancel_task = task;
         return next_cancel_task_status;
     }
@@ -44,40 +44,40 @@
 
 struct Handler {
     Handler(async::WaitWithTimeout* wait) {
-        wait->set_handler([this, wait](async_t* async, mx_status_t status,
-                                       const mx_packet_signal_t* signal) {
+        wait->set_handler([this, wait](async_t* async, zx_status_t status,
+                                       const zx_packet_signal_t* signal) {
             handler_ran = true;
             last_status = status;
             last_signal = signal;
             wait->set_deadline(wait->deadline() + 100u);
-            return status == MX_OK ? ASYNC_WAIT_AGAIN : ASYNC_WAIT_FINISHED;
+            return status == ZX_OK ? ASYNC_WAIT_AGAIN : ASYNC_WAIT_FINISHED;
         });
     }
 
     bool handler_ran = false;
-    mx_status_t last_status = MX_ERR_INTERNAL;
-    const mx_packet_signal_t* last_signal = nullptr;
+    zx_status_t last_status = ZX_ERR_INTERNAL;
+    const zx_packet_signal_t* last_signal = nullptr;
 };
 
 bool timeout_test() {
-    const mx_handle_t dummy_handle = 1;
-    const mx_signals_t dummy_trigger = MX_USER_SIGNAL_0;
-    const mx_packet_signal_t dummy_signal{
+    const zx_handle_t dummy_handle = 1;
+    const zx_signals_t dummy_trigger = ZX_USER_SIGNAL_0;
+    const zx_packet_signal_t dummy_signal{
         .trigger = dummy_trigger,
-        .observed = MX_USER_SIGNAL_0 | MX_USER_SIGNAL_1,
+        .observed = ZX_USER_SIGNAL_0 | ZX_USER_SIGNAL_1,
         .count = 0u,
         .reserved0 = 0u,
         .reserved1 = 0u};
-    const mx_time_t dummy_deadline = 100u;
+    const zx_time_t dummy_deadline = 100u;
     const uint32_t dummy_flags = ASYNC_FLAG_HANDLE_SHUTDOWN;
 
     BEGIN_TEST;
 
     {
         async::WaitWithTimeout default_wait;
-        EXPECT_EQ(MX_HANDLE_INVALID, default_wait.object(), "default object");
-        EXPECT_EQ(MX_SIGNAL_NONE, default_wait.trigger(), "default trigger");
-        EXPECT_EQ(MX_TIME_INFINITE, default_wait.deadline(), "default deadline");
+        EXPECT_EQ(ZX_HANDLE_INVALID, default_wait.object(), "default object");
+        EXPECT_EQ(ZX_SIGNAL_NONE, default_wait.trigger(), "default trigger");
+        EXPECT_EQ(ZX_TIME_INFINITE, default_wait.deadline(), "default deadline");
         EXPECT_EQ(0u, default_wait.flags(), "default flags");
 
         default_wait.set_object(dummy_handle);
@@ -93,8 +93,8 @@
 
         // Begin waiting without timeout (will be canceled immediately).
         MockAsync async;
-        default_wait.set_deadline(MX_TIME_INFINITE);
-        EXPECT_EQ(MX_OK, default_wait.Begin(&async), "begin, valid args");
+        default_wait.set_deadline(ZX_TIME_INFINITE);
+        EXPECT_EQ(ZX_OK, default_wait.Begin(&async), "begin, valid args");
         EXPECT_NONNULL(async.last_begin_wait, "begin wait called");
         EXPECT_NULL(async.last_post_task, "post task not called");
         EXPECT_EQ(dummy_handle, async.last_begin_wait->object, "handle");
@@ -103,7 +103,7 @@
         async.last_begin_wait = nullptr;
 
         // Cancel waiting without timeout.
-        EXPECT_EQ(MX_OK, default_wait.Cancel(&async), "cancel, valid args");
+        EXPECT_EQ(ZX_OK, default_wait.Cancel(&async), "cancel, valid args");
         EXPECT_NONNULL(async.last_cancel_wait, "cancel wait called");
         EXPECT_NULL(async.last_cancel_task, "cancel task not called");
         async.last_cancel_wait = nullptr;
@@ -122,7 +122,7 @@
 
         // Begin waiting without timeout.
         MockAsync async;
-        EXPECT_EQ(MX_OK, explicit_wait.Begin(&async), "begin, valid args");
+        EXPECT_EQ(ZX_OK, explicit_wait.Begin(&async), "begin, valid args");
         EXPECT_NONNULL(async.last_begin_wait, "begin wait called");
         EXPECT_NONNULL(async.last_post_task, "post task called");
         EXPECT_EQ(dummy_handle, async.last_begin_wait->object, "handle");
@@ -135,10 +135,10 @@
         async.last_post_task = nullptr;
 
         // Handle wait.
-        EXPECT_EQ(ASYNC_WAIT_AGAIN, wait_context->handler(&async, wait_context, MX_OK, &dummy_signal),
+        EXPECT_EQ(ASYNC_WAIT_AGAIN, wait_context->handler(&async, wait_context, ZX_OK, &dummy_signal),
                   "invoke wait handler");
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_OK, handler.last_status, "status");
+        EXPECT_EQ(ZX_OK, handler.last_status, "status");
         EXPECT_EQ(&dummy_signal, handler.last_signal, "signal");
         EXPECT_NONNULL(async.last_cancel_task, "cancel task called");
         EXPECT_NONNULL(async.last_post_task, "post task called");
@@ -148,15 +148,15 @@
         async.last_post_task = nullptr;
 
         // Handle timeout.
-        EXPECT_EQ(ASYNC_TASK_FINISHED, task_context->handler(&async, task_context, MX_OK),
+        EXPECT_EQ(ASYNC_TASK_FINISHED, task_context->handler(&async, task_context, ZX_OK),
                   "invoke timeout handler");
         EXPECT_TRUE(handler.handler_ran, "handler ran");
-        EXPECT_EQ(MX_ERR_TIMED_OUT, handler.last_status, "status");
+        EXPECT_EQ(ZX_ERR_TIMED_OUT, handler.last_status, "status");
         EXPECT_NULL(handler.last_signal, "signal");
         handler.handler_ran = false;
 
         // Cancel waiting with timeout.
-        EXPECT_EQ(MX_OK, explicit_wait.Cancel(&async), "cancel, valid args");
+        EXPECT_EQ(ZX_OK, explicit_wait.Cancel(&async), "cancel, valid args");
         EXPECT_NONNULL(async.last_cancel_wait, "cancel wait called");
         EXPECT_NONNULL(async.last_cancel_task, "cancel task called");
     }
@@ -165,9 +165,9 @@
 }
 
 bool begin_wait_cleans_up() {
-    const mx_handle_t dummy_handle = 1;
-    const mx_signals_t dummy_trigger = MX_USER_SIGNAL_0;
-    const mx_time_t dummy_deadline = 100u;
+    const zx_handle_t dummy_handle = 1;
+    const zx_signals_t dummy_trigger = ZX_USER_SIGNAL_0;
+    const zx_time_t dummy_deadline = 100u;
     const uint32_t dummy_flags = ASYNC_FLAG_HANDLE_SHUTDOWN;
 
     BEGIN_TEST;
@@ -176,8 +176,8 @@
 
     // If an error occurs while setting the timeout, cancel the wait.
     MockAsync async;
-    async.next_post_task_status = MX_ERR_BAD_STATE;
-    EXPECT_EQ(MX_ERR_BAD_STATE, wait.Begin(&async), "begin, will fail to post task");
+    async.next_post_task_status = ZX_ERR_BAD_STATE;
+    EXPECT_EQ(ZX_ERR_BAD_STATE, wait.Begin(&async), "begin, will fail to post task");
     EXPECT_NONNULL(async.last_begin_wait, "begin wait called");
     EXPECT_NONNULL(async.last_post_task, "post task called");
     EXPECT_NONNULL(async.last_cancel_wait, "cancel wait called");
diff --git a/system/utest/bad-kernel-access/bad-kernel-access.c b/system/utest/bad-kernel-access/bad-kernel-access.c
index 0c155b34..70c98b0 100644
--- a/system/utest/bad-kernel-access/bad-kernel-access.c
+++ b/system/utest/bad-kernel-access/bad-kernel-access.c
@@ -6,21 +6,21 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls-ddk.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls-ddk.h>
 
 static int val = 5;
 
 void bad_kernel_access_read(void) {
     char cmd[50];
     snprintf(cmd, sizeof(cmd), "db %p 1", &val);
-    mx_debug_send_command(cmd, strlen(cmd));
+    zx_debug_send_command(cmd, strlen(cmd));
 }
 
 void bad_kernel_access_write(void) {
     char cmd[50];
     snprintf(cmd, sizeof(cmd), "mb %p 1 1", &val);
-    mx_debug_send_command(cmd, strlen(cmd));
+    zx_debug_send_command(cmd, strlen(cmd));
 }
 
 int main(int argc, char **argv) {
diff --git a/system/utest/bad-kernel-access/rules.mk b/system/utest/bad-kernel-access/rules.mk
index a782bb5..b3ce47f 100644
--- a/system/utest/bad-kernel-access/rules.mk
+++ b/system/utest/bad-kernel-access/rules.mk
@@ -17,7 +17,7 @@
 MODULE_NAME := bad-kernel-access-test-crashes
 
 MODULE_STATIC_LIBS := system/ulib/ddk
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
 
diff --git a/system/utest/bitmap/raw-bitmap-tests.cpp b/system/utest/bitmap/raw-bitmap-tests.cpp
index 39cb604..bd5b01b 100644
--- a/system/utest/bitmap/raw-bitmap-tests.cpp
+++ b/system/utest/bitmap/raw-bitmap-tests.cpp
@@ -17,17 +17,17 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(0), MX_OK);
+    EXPECT_EQ(bitmap.Reset(0), ZX_OK);
     EXPECT_EQ(bitmap.size(), 0U, "get size");
 
     EXPECT_TRUE(bitmap.GetOne(0), "get one bit");
-    EXPECT_EQ(bitmap.SetOne(0), MX_ERR_INVALID_ARGS, "set one bit");
-    EXPECT_EQ(bitmap.ClearOne(0), MX_ERR_INVALID_ARGS, "clear one bit");
+    EXPECT_EQ(bitmap.SetOne(0), ZX_ERR_INVALID_ARGS, "set one bit");
+    EXPECT_EQ(bitmap.ClearOne(0), ZX_ERR_INVALID_ARGS, "clear one bit");
 
-    EXPECT_EQ(bitmap.Reset(1), MX_OK);
+    EXPECT_EQ(bitmap.Reset(1), ZX_OK);
     EXPECT_FALSE(bitmap.GetOne(0), "get one bit");
-    EXPECT_EQ(bitmap.SetOne(0), MX_OK, "set one bit");
-    EXPECT_EQ(bitmap.ClearOne(0), MX_OK, "clear one bit");
+    EXPECT_EQ(bitmap.SetOne(0), ZX_OK, "set one bit");
+    EXPECT_EQ(bitmap.ClearOne(0), ZX_OK, "clear one bit");
 
     END_TEST;
 }
@@ -37,15 +37,15 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
     EXPECT_FALSE(bitmap.GetOne(2), "get bit before setting");
 
-    EXPECT_EQ(bitmap.SetOne(2), MX_OK, "set bit");
+    EXPECT_EQ(bitmap.SetOne(2), ZX_OK, "set bit");
     EXPECT_TRUE(bitmap.GetOne(2), "get bit after setting");
 
-    EXPECT_EQ(bitmap.ClearOne(2), MX_OK, "clear bit");
+    EXPECT_EQ(bitmap.ClearOne(2), ZX_OK, "clear bit");
     EXPECT_FALSE(bitmap.GetOne(2), "get bit after clearing");
 
     END_TEST;
@@ -56,13 +56,13 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
-    EXPECT_EQ(bitmap.SetOne(2), MX_OK, "set bit");
+    EXPECT_EQ(bitmap.SetOne(2), ZX_OK, "set bit");
     EXPECT_TRUE(bitmap.GetOne(2), "get bit after setting");
 
-    EXPECT_EQ(bitmap.SetOne(2), MX_OK, "set bit again");
+    EXPECT_EQ(bitmap.SetOne(2), ZX_OK, "set bit again");
     EXPECT_TRUE(bitmap.GetOne(2), "get bit after setting again");
 
     END_TEST;
@@ -73,15 +73,15 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
-    EXPECT_EQ(bitmap.SetOne(2), MX_OK, "set bit");
+    EXPECT_EQ(bitmap.SetOne(2), ZX_OK, "set bit");
 
-    EXPECT_EQ(bitmap.ClearOne(2), MX_OK, "clear bit");
+    EXPECT_EQ(bitmap.ClearOne(2), ZX_OK, "clear bit");
     EXPECT_FALSE(bitmap.GetOne(2), "get bit after clearing");
 
-    EXPECT_EQ(bitmap.ClearOne(2), MX_OK, "clear bit again");
+    EXPECT_EQ(bitmap.ClearOne(2), ZX_OK, "clear bit again");
     EXPECT_FALSE(bitmap.GetOne(2), "get bit after clearing again");
 
     END_TEST;
@@ -92,7 +92,7 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
     size_t first_unset = 0;
@@ -100,7 +100,7 @@
     EXPECT_FALSE(bitmap.Get(2, 3, &first_unset), "get bit with nonnull");
     EXPECT_EQ(first_unset, 2U, "check returned arg");
 
-    EXPECT_EQ(bitmap.SetOne(2), MX_OK, "set bit");
+    EXPECT_EQ(bitmap.SetOne(2), ZX_OK, "set bit");
     EXPECT_TRUE(bitmap.Get(2, 3, &first_unset), "get bit after setting");
     EXPECT_EQ(first_unset, 3U, "check returned arg");
 
@@ -108,7 +108,7 @@
     EXPECT_FALSE(bitmap.Get(2, 4, &first_unset), "get larger range after setting");
     EXPECT_EQ(first_unset, 3U, "check returned arg");
 
-    EXPECT_EQ(bitmap.SetOne(3), MX_OK, "set another bit");
+    EXPECT_EQ(bitmap.SetOne(3), ZX_OK, "set another bit");
     EXPECT_FALSE(bitmap.Get(2, 5, &first_unset), "get larger range after setting another");
     EXPECT_EQ(first_unset, 4U, "check returned arg");
 
@@ -120,10 +120,10 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
-    EXPECT_EQ(bitmap.Set(2, 100), MX_OK, "set range");
+    EXPECT_EQ(bitmap.Set(2, 100), ZX_OK, "set range");
 
     size_t first_unset = 0;
     EXPECT_TRUE(bitmap.Get(2, 3, &first_unset), "get first bit in range");
@@ -159,87 +159,87 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
     size_t bitoff_start;
 
     // Invalid finds
-    EXPECT_EQ(bitmap.Find(false, 0, 0, 1, &bitoff_start), MX_ERR_INVALID_ARGS, "bad range");
-    EXPECT_EQ(bitmap.Find(false, 1, 0, 1, &bitoff_start), MX_ERR_INVALID_ARGS, "bad range");
-    EXPECT_EQ(bitmap.Find(false, 0, 1, 1, nullptr), MX_ERR_INVALID_ARGS, "bad output");
+    EXPECT_EQ(bitmap.Find(false, 0, 0, 1, &bitoff_start), ZX_ERR_INVALID_ARGS, "bad range");
+    EXPECT_EQ(bitmap.Find(false, 1, 0, 1, &bitoff_start), ZX_ERR_INVALID_ARGS, "bad range");
+    EXPECT_EQ(bitmap.Find(false, 0, 1, 1, nullptr), ZX_ERR_INVALID_ARGS, "bad output");
 
     // Finds from offset zero
-    EXPECT_EQ(bitmap.Find(false, 0, 100, 1, &bitoff_start), MX_OK, "find unset");
+    EXPECT_EQ(bitmap.Find(false, 0, 100, 1, &bitoff_start), ZX_OK, "find unset");
     EXPECT_EQ(bitoff_start, 0, "check returned arg");
-    EXPECT_EQ(bitmap.Find(true, 0, 100, 1, &bitoff_start), MX_ERR_NO_RESOURCES, "find set");
+    EXPECT_EQ(bitmap.Find(true, 0, 100, 1, &bitoff_start), ZX_ERR_NO_RESOURCES, "find set");
     EXPECT_EQ(bitoff_start, 100, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 0, 100, 5, &bitoff_start), MX_OK, "find more unset");
+    EXPECT_EQ(bitmap.Find(false, 0, 100, 5, &bitoff_start), ZX_OK, "find more unset");
     EXPECT_EQ(bitoff_start, 0, "check returned arg");
-    EXPECT_EQ(bitmap.Find(true, 0, 100, 5, &bitoff_start), MX_ERR_NO_RESOURCES, "find more set");
+    EXPECT_EQ(bitmap.Find(true, 0, 100, 5, &bitoff_start), ZX_ERR_NO_RESOURCES, "find more set");
     EXPECT_EQ(bitoff_start, 100, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 0, 100, 100, &bitoff_start), MX_OK, "find all uset");
+    EXPECT_EQ(bitmap.Find(false, 0, 100, 100, &bitoff_start), ZX_OK, "find all uset");
     EXPECT_EQ(bitoff_start, 0, "check returned arg");
-    EXPECT_EQ(bitmap.Find(true, 0, 100, 100, &bitoff_start), MX_ERR_NO_RESOURCES, "find all set");
+    EXPECT_EQ(bitmap.Find(true, 0, 100, 100, &bitoff_start), ZX_ERR_NO_RESOURCES, "find all set");
     EXPECT_EQ(bitoff_start, 100, "check returned arg");
 
     // Finds at an offset
-    EXPECT_EQ(bitmap.Find(false, 50, 100, 3, &bitoff_start), MX_OK, "find at offset");
+    EXPECT_EQ(bitmap.Find(false, 50, 100, 3, &bitoff_start), ZX_OK, "find at offset");
     EXPECT_EQ(bitoff_start, 50, "check returned arg");
-    EXPECT_EQ(bitmap.Find(true, 50, 100, 3, &bitoff_start), MX_ERR_NO_RESOURCES, "fail at offset");
+    EXPECT_EQ(bitmap.Find(true, 50, 100, 3, &bitoff_start), ZX_ERR_NO_RESOURCES, "fail at offset");
     EXPECT_EQ(bitoff_start, 100, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 90, 100, 10, &bitoff_start), MX_OK, "find at offset end");
+    EXPECT_EQ(bitmap.Find(false, 90, 100, 10, &bitoff_start), ZX_OK, "find at offset end");
     EXPECT_EQ(bitoff_start, 90, "check returned arg");
 
     // Invalid scans
-    EXPECT_EQ(bitmap.Find(false, 0, 100, 101, &bitoff_start), MX_ERR_NO_RESOURCES, "no space");
+    EXPECT_EQ(bitmap.Find(false, 0, 100, 101, &bitoff_start), ZX_ERR_NO_RESOURCES, "no space");
     EXPECT_EQ(bitoff_start, 100, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 91, 100, 10, &bitoff_start), MX_ERR_NO_RESOURCES, "no space");
+    EXPECT_EQ(bitmap.Find(false, 91, 100, 10, &bitoff_start), ZX_ERR_NO_RESOURCES, "no space");
     EXPECT_EQ(bitoff_start, 100, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 90, 100, 11, &bitoff_start), MX_ERR_NO_RESOURCES, "no space");
+    EXPECT_EQ(bitmap.Find(false, 90, 100, 11, &bitoff_start), ZX_ERR_NO_RESOURCES, "no space");
     EXPECT_EQ(bitoff_start, 100, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 90, 95, 6, &bitoff_start), MX_ERR_NO_RESOURCES, "no space");
+    EXPECT_EQ(bitmap.Find(false, 90, 95, 6, &bitoff_start), ZX_ERR_NO_RESOURCES, "no space");
     EXPECT_EQ(bitoff_start, 95, "check returned arg");
 
     // Fill the bitmap
-    EXPECT_EQ(bitmap.Set(5, 10), MX_OK, "set range");
-    EXPECT_EQ(bitmap.Set(20, 30), MX_OK, "set range");
-    EXPECT_EQ(bitmap.Set(32, 35), MX_OK, "set range");
+    EXPECT_EQ(bitmap.Set(5, 10), ZX_OK, "set range");
+    EXPECT_EQ(bitmap.Set(20, 30), ZX_OK, "set range");
+    EXPECT_EQ(bitmap.Set(32, 35), ZX_OK, "set range");
 
-    EXPECT_EQ(bitmap.Find(false, 0, 50, 5, &bitoff_start), MX_OK, "find in first group");
+    EXPECT_EQ(bitmap.Find(false, 0, 50, 5, &bitoff_start), ZX_OK, "find in first group");
     EXPECT_EQ(bitoff_start, 0, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 0, 50, 10, &bitoff_start), MX_OK, "find in second group");
+    EXPECT_EQ(bitmap.Find(false, 0, 50, 10, &bitoff_start), ZX_OK, "find in second group");
     EXPECT_EQ(bitoff_start, 10, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 0, 50, 15, &bitoff_start), MX_OK, "find in third group");
+    EXPECT_EQ(bitmap.Find(false, 0, 50, 15, &bitoff_start), ZX_OK, "find in third group");
     EXPECT_EQ(bitoff_start, 35, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 0, 50, 16, &bitoff_start), MX_ERR_NO_RESOURCES, "fail to find");
+    EXPECT_EQ(bitmap.Find(false, 0, 50, 16, &bitoff_start), ZX_ERR_NO_RESOURCES, "fail to find");
     EXPECT_EQ(bitoff_start, 50, "check returned arg");
 
-    EXPECT_EQ(bitmap.Find(false, 5, 20, 10, &bitoff_start), MX_OK, "find space (offset)");
+    EXPECT_EQ(bitmap.Find(false, 5, 20, 10, &bitoff_start), ZX_OK, "find space (offset)");
     EXPECT_EQ(bitoff_start, 10, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 5, 25, 10, &bitoff_start), MX_OK, "find space (offset)");
+    EXPECT_EQ(bitmap.Find(false, 5, 25, 10, &bitoff_start), ZX_OK, "find space (offset)");
     EXPECT_EQ(bitoff_start, 10, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 5, 15, 6, &bitoff_start), MX_ERR_NO_RESOURCES, "fail to find (offset)");
+    EXPECT_EQ(bitmap.Find(false, 5, 15, 6, &bitoff_start), ZX_ERR_NO_RESOURCES, "fail to find (offset)");
     EXPECT_EQ(bitoff_start, 15, "check returned arg");
 
-    EXPECT_EQ(bitmap.Find(true, 0, 15, 2, &bitoff_start), MX_OK, "find set bits");
+    EXPECT_EQ(bitmap.Find(true, 0, 15, 2, &bitoff_start), ZX_OK, "find set bits");
     EXPECT_EQ(bitoff_start, 5, "check returned arg");
-    EXPECT_EQ(bitmap.Find(true, 0, 15, 6, &bitoff_start), MX_ERR_NO_RESOURCES, "find set bits (fail)");
+    EXPECT_EQ(bitmap.Find(true, 0, 15, 6, &bitoff_start), ZX_ERR_NO_RESOURCES, "find set bits (fail)");
     EXPECT_EQ(bitoff_start, 15, "check returned arg");
 
-    EXPECT_EQ(bitmap.Find(false, 32, 35, 3, &bitoff_start), MX_ERR_NO_RESOURCES, "fail to find");
+    EXPECT_EQ(bitmap.Find(false, 32, 35, 3, &bitoff_start), ZX_ERR_NO_RESOURCES, "fail to find");
     EXPECT_EQ(bitoff_start, 35, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 32, 35, 4, &bitoff_start), MX_ERR_NO_RESOURCES, "fail to find");
+    EXPECT_EQ(bitmap.Find(false, 32, 35, 4, &bitoff_start), ZX_ERR_NO_RESOURCES, "fail to find");
     EXPECT_EQ(bitoff_start, 35, "check returned arg");
-    EXPECT_EQ(bitmap.Find(true, 32, 35, 4, &bitoff_start), MX_ERR_NO_RESOURCES, "fail to find (set)");
+    EXPECT_EQ(bitmap.Find(true, 32, 35, 4, &bitoff_start), ZX_ERR_NO_RESOURCES, "fail to find (set)");
     EXPECT_EQ(bitoff_start, 35, "check returned arg");
 
     // Fill the whole bitmap
-    EXPECT_EQ(bitmap.Set(0, 128), MX_OK, "set range");
+    EXPECT_EQ(bitmap.Set(0, 128), ZX_OK, "set range");
 
-    EXPECT_EQ(bitmap.Find(false, 0, 1, 1, &bitoff_start), MX_ERR_NO_RESOURCES, "fail to find (small)");
+    EXPECT_EQ(bitmap.Find(false, 0, 1, 1, &bitoff_start), ZX_ERR_NO_RESOURCES, "fail to find (small)");
     EXPECT_EQ(bitoff_start, 1, "check returned arg");
-    EXPECT_EQ(bitmap.Find(false, 0, 128, 1, &bitoff_start), MX_ERR_NO_RESOURCES, "fail to find (large)");
+    EXPECT_EQ(bitmap.Find(false, 0, 128, 1, &bitoff_start), ZX_ERR_NO_RESOURCES, "fail to find (large)");
     EXPECT_EQ(bitoff_start, 128, "check returned arg");
 
     END_TEST;
@@ -250,10 +250,10 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
-    EXPECT_EQ(bitmap.Set(0, 100), MX_OK, "set range");
+    EXPECT_EQ(bitmap.Set(0, 100), ZX_OK, "set range");
 
     bitmap.ClearAll();
 
@@ -261,7 +261,7 @@
     EXPECT_FALSE(bitmap.Get(2, 100, &first), "get range");
     EXPECT_EQ(first, 2U, "all clear");
 
-    EXPECT_EQ(bitmap.Set(0, 99), MX_OK, "set range");
+    EXPECT_EQ(bitmap.Set(0, 99), ZX_OK, "set range");
     EXPECT_FALSE(bitmap.Get(0, 100, &first), "get range");
     EXPECT_EQ(first, 99U, "all clear");
 
@@ -273,11 +273,11 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
-    EXPECT_EQ(bitmap.Set(2, 100), MX_OK, "set range");
-    EXPECT_EQ(bitmap.Clear(50, 80), MX_OK, "clear range");
+    EXPECT_EQ(bitmap.Set(2, 100), ZX_OK, "set range");
+    EXPECT_EQ(bitmap.Clear(50, 80), ZX_OK, "clear range");
 
     size_t first_unset = 0;
     EXPECT_FALSE(bitmap.Get(2, 100, &first_unset), "get whole original range");
@@ -301,16 +301,16 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
-    EXPECT_EQ(bitmap.Set(0, 0), MX_OK, "range contains no bits");
-    EXPECT_EQ(bitmap.Set(5, 4), MX_ERR_INVALID_ARGS, "max is less than off");
-    EXPECT_EQ(bitmap.Set(5, 5), MX_OK, "range contains no bits");
+    EXPECT_EQ(bitmap.Set(0, 0), ZX_OK, "range contains no bits");
+    EXPECT_EQ(bitmap.Set(5, 4), ZX_ERR_INVALID_ARGS, "max is less than off");
+    EXPECT_EQ(bitmap.Set(5, 5), ZX_OK, "range contains no bits");
 
-    EXPECT_EQ(bitmap.Clear(0, 0), MX_OK, "range contains no bits");
-    EXPECT_EQ(bitmap.Clear(5, 4), MX_ERR_INVALID_ARGS, "max is less than off");
-    EXPECT_EQ(bitmap.Clear(5, 5), MX_OK, "range contains no bits");
+    EXPECT_EQ(bitmap.Clear(0, 0), ZX_OK, "range contains no bits");
+    EXPECT_EQ(bitmap.Clear(5, 4), ZX_ERR_INVALID_ARGS, "max is less than off");
+    EXPECT_EQ(bitmap.Clear(5, 5), ZX_OK, "range contains no bits");
 
     EXPECT_TRUE(bitmap.Get(0, 0), "range contains no bits, so all are true");
     EXPECT_TRUE(bitmap.Get(5, 4), "range contains no bits, so all are true");
@@ -324,11 +324,11 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128U, "get size");
 
-    EXPECT_EQ(bitmap.SetOne(0x64), MX_OK, "setting later");
-    EXPECT_EQ(bitmap.SetOne(0x60), MX_OK, "setting earlier");
+    EXPECT_EQ(bitmap.SetOne(0x64), ZX_OK, "setting later");
+    EXPECT_EQ(bitmap.SetOne(0x60), ZX_OK, "setting earlier");
 
     EXPECT_TRUE(bitmap.GetOne(0x64), "getting first set");
     EXPECT_TRUE(bitmap.GetOne(0x60), "getting second set");
@@ -340,27 +340,27 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128u);
 
     EXPECT_FALSE(bitmap.GetOne(100));
-    EXPECT_EQ(bitmap.SetOne(100), MX_OK);
+    EXPECT_EQ(bitmap.SetOne(100), ZX_OK);
     EXPECT_TRUE(bitmap.GetOne(100));
 
     size_t bitoff_start;
-    EXPECT_EQ(bitmap.Find(true, 101, 128, 1, &bitoff_start), MX_ERR_NO_RESOURCES,
+    EXPECT_EQ(bitmap.Find(true, 101, 128, 1, &bitoff_start), ZX_ERR_NO_RESOURCES,
               "Expected tail end of bitmap to be unset");
 
     // We can't set bits out of range
-    EXPECT_NE(bitmap.SetOne(16 * PAGE_SIZE - 1), MX_OK);
+    EXPECT_NE(bitmap.SetOne(16 * PAGE_SIZE - 1), ZX_OK);
 
-    EXPECT_EQ(bitmap.Grow(16 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(bitmap.Grow(16 * PAGE_SIZE), ZX_OK);
     EXPECT_EQ(bitmap.Find(true, 101, 16 * PAGE_SIZE, 1, &bitoff_start),
-              MX_ERR_NO_RESOURCES, "Expected tail end of bitmap to be unset");
+              ZX_ERR_NO_RESOURCES, "Expected tail end of bitmap to be unset");
 
     // Now we can set the previously inaccessible bits
     EXPECT_FALSE(bitmap.GetOne(16 * PAGE_SIZE - 1));
-    EXPECT_EQ(bitmap.SetOne(16 * PAGE_SIZE - 1), MX_OK);
+    EXPECT_EQ(bitmap.SetOne(16 * PAGE_SIZE - 1), ZX_OK);
     EXPECT_TRUE(bitmap.GetOne(16 * PAGE_SIZE - 1));
 
     // But our orignal 'set bit' is still set
@@ -368,8 +368,8 @@
 
     // If we shrink and re-expand the bitmap, it should
     // have cleared the underlying bits
-    EXPECT_EQ(bitmap.Shrink(99), MX_OK);
-    EXPECT_EQ(bitmap.Grow(16 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(bitmap.Shrink(99), ZX_OK);
+    EXPECT_EQ(bitmap.Grow(16 * PAGE_SIZE), ZX_OK);
     EXPECT_FALSE(bitmap.GetOne(100));
     EXPECT_FALSE(bitmap.GetOne(16 * PAGE_SIZE - 1));
 
@@ -381,11 +381,11 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128u);
 
     EXPECT_FALSE(bitmap.GetOne(100));
-    EXPECT_EQ(bitmap.SetOne(100), MX_OK);
+    EXPECT_EQ(bitmap.SetOne(100), ZX_OK);
     EXPECT_TRUE(bitmap.GetOne(100));
 
     for (size_t i = 8; i < 16; i++) {
@@ -393,21 +393,21 @@
             size_t bitmap_size = (1 << i) + j;
 
             for (size_t shrink_len = 1; shrink_len < 32; shrink_len++) {
-                EXPECT_EQ(bitmap.Reset(bitmap_size), MX_OK);
+                EXPECT_EQ(bitmap.Reset(bitmap_size), ZX_OK);
                 EXPECT_EQ(bitmap.size(), bitmap_size);
 
                 // This bit will be eliminated by shrink / grow
                 EXPECT_FALSE(bitmap.GetOne(bitmap_size - shrink_len));
-                EXPECT_EQ(bitmap.SetOne(bitmap_size - shrink_len), MX_OK);
+                EXPECT_EQ(bitmap.SetOne(bitmap_size - shrink_len), ZX_OK);
                 EXPECT_TRUE(bitmap.GetOne(bitmap_size - shrink_len));
 
                 // This bit will stay
                 EXPECT_FALSE(bitmap.GetOne(bitmap_size - shrink_len - 1));
-                EXPECT_EQ(bitmap.SetOne(bitmap_size - shrink_len - 1), MX_OK);
+                EXPECT_EQ(bitmap.SetOne(bitmap_size - shrink_len - 1), ZX_OK);
                 EXPECT_TRUE(bitmap.GetOne(bitmap_size - shrink_len - 1));
 
-                EXPECT_EQ(bitmap.Shrink(bitmap_size - shrink_len), MX_OK);
-                EXPECT_EQ(bitmap.Grow(bitmap_size), MX_OK);
+                EXPECT_EQ(bitmap.Shrink(bitmap_size - shrink_len), ZX_OK);
+                EXPECT_EQ(bitmap.Grow(bitmap_size), ZX_OK);
 
                 EXPECT_FALSE(bitmap.GetOne(bitmap_size - shrink_len),
                              "Expected 'shrunk' bit to be unset");
@@ -417,7 +417,7 @@
                 size_t bitoff_start;
                 EXPECT_EQ(bitmap.Find(true, bitmap_size - shrink_len,
                                       bitmap_size, 1, &bitoff_start),
-                          MX_ERR_NO_RESOURCES,
+                          ZX_ERR_NO_RESOURCES,
                           "Expected tail end of bitmap to be unset");
             }
         }
@@ -431,13 +431,13 @@
     BEGIN_TEST;
 
     RawBitmap bitmap;
-    EXPECT_EQ(bitmap.Reset(128), MX_OK);
+    EXPECT_EQ(bitmap.Reset(128), ZX_OK);
     EXPECT_EQ(bitmap.size(), 128u);
 
-    EXPECT_EQ(bitmap.Grow(64), MX_ERR_NO_RESOURCES);
-    EXPECT_EQ(bitmap.Grow(128), MX_ERR_NO_RESOURCES);
-    EXPECT_EQ(bitmap.Grow(128 + 1), MX_ERR_NO_RESOURCES);
-    EXPECT_EQ(bitmap.Grow(8 * PAGE_SIZE), MX_ERR_NO_RESOURCES);
+    EXPECT_EQ(bitmap.Grow(64), ZX_ERR_NO_RESOURCES);
+    EXPECT_EQ(bitmap.Grow(128), ZX_ERR_NO_RESOURCES);
+    EXPECT_EQ(bitmap.Grow(128 + 1), ZX_ERR_NO_RESOURCES);
+    EXPECT_EQ(bitmap.Grow(8 * PAGE_SIZE), ZX_ERR_NO_RESOURCES);
     END_TEST;
 }
 
diff --git a/system/utest/bitmap/rle-bitmap-tests.cpp b/system/utest/bitmap/rle-bitmap-tests.cpp
index f00a51e..f04c5e0 100644
--- a/system/utest/bitmap/rle-bitmap-tests.cpp
+++ b/system/utest/bitmap/rle-bitmap-tests.cpp
@@ -28,7 +28,7 @@
     RleBitmap bitmap;
     EXPECT_FALSE(bitmap.Get(2, 3), "get bit before setting");
 
-    ASSERT_EQ(bitmap.Set(2, 3), MX_OK, "set bit");
+    ASSERT_EQ(bitmap.Set(2, 3), ZX_OK, "set bit");
     EXPECT_TRUE(bitmap.Get(2, 3), "get bit after setting");
 
     size_t count = 0;
@@ -40,7 +40,7 @@
     EXPECT_EQ(count, 1U, "bitmap has single range");
     EXPECT_EQ(count, bitmap.num_ranges(), "count is number of elements");
 
-    ASSERT_EQ(bitmap.Clear(2, 3), MX_OK, "clear bit");
+    ASSERT_EQ(bitmap.Clear(2, 3), ZX_OK, "clear bit");
     EXPECT_FALSE(bitmap.Get(2, 3), "get bit after clearing");
 
     END_TEST;
@@ -51,10 +51,10 @@
 
     RleBitmap bitmap;
 
-    ASSERT_EQ(bitmap.SetOne(2), MX_OK, "set bit");
+    ASSERT_EQ(bitmap.SetOne(2), ZX_OK, "set bit");
     EXPECT_TRUE(bitmap.GetOne(2), "get bit after setting");
 
-    ASSERT_EQ(bitmap.SetOne(2), MX_OK, "set bit again");
+    ASSERT_EQ(bitmap.SetOne(2), ZX_OK, "set bit again");
     EXPECT_TRUE(bitmap.GetOne(2), "get bit after setting again");
 
     size_t count = 0;
@@ -74,12 +74,12 @@
 
     RleBitmap bitmap;
 
-    ASSERT_EQ(bitmap.SetOne(2), MX_OK, "set bit");
+    ASSERT_EQ(bitmap.SetOne(2), ZX_OK, "set bit");
 
-    ASSERT_EQ(bitmap.ClearOne(2), MX_OK, "clear bit");
+    ASSERT_EQ(bitmap.ClearOne(2), ZX_OK, "clear bit");
     EXPECT_FALSE(bitmap.GetOne(2), "get bit after clearing");
 
-    ASSERT_EQ(bitmap.ClearOne(2), MX_OK, "clear bit again");
+    ASSERT_EQ(bitmap.ClearOne(2), ZX_OK, "clear bit again");
     EXPECT_FALSE(bitmap.GetOne(2), "get bit after clearing again");
 
     for (__UNUSED auto& range : bitmap) {
@@ -99,7 +99,7 @@
     EXPECT_FALSE(bitmap.Get(2, 3, &first_unset), "get bit with nonnull");
     EXPECT_EQ(first_unset, 2U, "check returned arg");
 
-    ASSERT_EQ(bitmap.SetOne(2), MX_OK, "set bit");
+    ASSERT_EQ(bitmap.SetOne(2), ZX_OK, "set bit");
     EXPECT_TRUE(bitmap.Get(2, 3, &first_unset), "get bit after setting");
     EXPECT_EQ(first_unset, 3U, "check returned arg");
 
@@ -107,7 +107,7 @@
     EXPECT_FALSE(bitmap.Get(2, 4, &first_unset), "get larger range after setting");
     EXPECT_EQ(first_unset, 3U, "check returned arg");
 
-    ASSERT_EQ(bitmap.Set(3, 4), MX_OK, "set another bit");
+    ASSERT_EQ(bitmap.Set(3, 4), ZX_OK, "set another bit");
     EXPECT_FALSE(bitmap.Get(2, 5, &first_unset), "get larger range after setting another");
     EXPECT_EQ(first_unset, 4U, "check returned arg");
 
@@ -119,7 +119,7 @@
 
     RleBitmap bitmap;
 
-    ASSERT_EQ(bitmap.Set(2, 100), MX_OK, "set range");
+    ASSERT_EQ(bitmap.Set(2, 100), ZX_OK, "set range");
 
     size_t first_unset = 0;
     EXPECT_TRUE(bitmap.Get(2, 3, &first_unset), "get first bit in range");
@@ -148,7 +148,7 @@
 
     RleBitmap bitmap;
 
-    ASSERT_EQ(bitmap.Set(2, 100), MX_OK, "set range");
+    ASSERT_EQ(bitmap.Set(2, 100), ZX_OK, "set range");
 
     bitmap.ClearAll();
 
@@ -156,7 +156,7 @@
         EXPECT_FALSE(true, "iterating on empty set");
     }
 
-    ASSERT_EQ(bitmap.Set(2, 100), MX_OK, "set range");
+    ASSERT_EQ(bitmap.Set(2, 100), ZX_OK, "set range");
     for (auto& range : bitmap) {
         EXPECT_EQ(range.bitoff, 2U, "bitoff");
         EXPECT_EQ(range.bitlen, 100U - 2U, "bitlen");
@@ -170,8 +170,8 @@
 
     RleBitmap bitmap;
 
-    ASSERT_EQ(bitmap.Set(2, 100), MX_OK, "set range");
-    ASSERT_EQ(bitmap.Clear(50, 80), MX_OK, "clear range");
+    ASSERT_EQ(bitmap.Set(2, 100), ZX_OK, "set range");
+    ASSERT_EQ(bitmap.Clear(50, 80), ZX_OK, "clear range");
 
     size_t first_unset = 0;
     EXPECT_FALSE(bitmap.Get(2, 100, &first_unset), "get whole original range");
@@ -212,7 +212,7 @@
     constexpr size_t kMaxVal = 100;
 
     for (size_t i = 0; i < kMaxVal; i += 2) {
-        ASSERT_EQ(bitmap.SetOne(i), MX_OK, "setting even bits");
+        ASSERT_EQ(bitmap.SetOne(i), ZX_OK, "setting even bits");
     }
 
     size_t count = 0;
@@ -224,7 +224,7 @@
     EXPECT_EQ(count, kMaxVal / 2, "check range count");
 
     for (size_t i = 1; i < kMaxVal; i += 4) {
-        ASSERT_EQ(bitmap.SetOne(i), MX_OK, "setting congruent 1 mod 4 bits");
+        ASSERT_EQ(bitmap.SetOne(i), ZX_OK, "setting congruent 1 mod 4 bits");
     }
 
     count = 0;
@@ -245,10 +245,10 @@
     RleBitmap bitmap;
 
     constexpr size_t kMaxVal = 100;
-    ASSERT_EQ(bitmap.Set(0, kMaxVal), MX_OK, "setting all bits");
+    ASSERT_EQ(bitmap.Set(0, kMaxVal), ZX_OK, "setting all bits");
 
     for (size_t i = 1; i < kMaxVal; i += 4) {
-        ASSERT_EQ(bitmap.ClearOne(i), MX_OK, "clearing congruent 1 mod 4 bits");
+        ASSERT_EQ(bitmap.ClearOne(i), ZX_OK, "clearing congruent 1 mod 4 bits");
     }
 
     size_t count = 0;
@@ -268,7 +268,7 @@
     EXPECT_EQ(count, bitmap.num_ranges(), "count is number of elements");
 
     for (size_t i = 0; i < kMaxVal; i += 2) {
-        ASSERT_EQ(bitmap.ClearOne(i), MX_OK, "clearing even bits");
+        ASSERT_EQ(bitmap.ClearOne(i), ZX_OK, "clearing even bits");
     }
 
     count = 0;
@@ -288,13 +288,13 @@
 
     RleBitmap bitmap;
 
-    EXPECT_EQ(bitmap.Set(0, 0), MX_OK, "range contains no bits");
-    EXPECT_EQ(bitmap.Set(5, 4), MX_ERR_INVALID_ARGS, "max is less than off");
-    EXPECT_EQ(bitmap.Set(5, 5), MX_OK, "range contains no bits");
+    EXPECT_EQ(bitmap.Set(0, 0), ZX_OK, "range contains no bits");
+    EXPECT_EQ(bitmap.Set(5, 4), ZX_ERR_INVALID_ARGS, "max is less than off");
+    EXPECT_EQ(bitmap.Set(5, 5), ZX_OK, "range contains no bits");
 
-    EXPECT_EQ(bitmap.Clear(0, 0), MX_OK, "range contains no bits");
-    EXPECT_EQ(bitmap.Clear(5, 4), MX_ERR_INVALID_ARGS, "max is less than off");
-    EXPECT_EQ(bitmap.Clear(5, 5), MX_OK, "range contains no bits");
+    EXPECT_EQ(bitmap.Clear(0, 0), ZX_OK, "range contains no bits");
+    EXPECT_EQ(bitmap.Clear(5, 4), ZX_ERR_INVALID_ARGS, "max is less than off");
+    EXPECT_EQ(bitmap.Clear(5, 5), ZX_OK, "range contains no bits");
 
     EXPECT_TRUE(bitmap.Get(0, 0), "range contains no bits, so all are true");
     EXPECT_TRUE(bitmap.Get(5, 4), "range contains no bits, so all are true");
@@ -308,24 +308,24 @@
 
     RleBitmap bitmap;
 
-    EXPECT_EQ(bitmap.SetNoAlloc(0, 65536, nullptr), MX_ERR_INVALID_ARGS, "set bits with nullptr freelist");
-    EXPECT_EQ(bitmap.ClearNoAlloc(0, 65536, nullptr), MX_ERR_INVALID_ARGS, "clear bits with nullptr freelist");
+    EXPECT_EQ(bitmap.SetNoAlloc(0, 65536, nullptr), ZX_ERR_INVALID_ARGS, "set bits with nullptr freelist");
+    EXPECT_EQ(bitmap.ClearNoAlloc(0, 65536, nullptr), ZX_ERR_INVALID_ARGS, "clear bits with nullptr freelist");
 
     RleBitmap::FreeList free_list;
-    EXPECT_EQ(bitmap.SetNoAlloc(0, 65536, &free_list), MX_ERR_NO_MEMORY, "set bits with empty freelist");
+    EXPECT_EQ(bitmap.SetNoAlloc(0, 65536, &free_list), ZX_ERR_NO_MEMORY, "set bits with empty freelist");
 
     fbl::AllocChecker ac;
     free_list.push_back(fbl::unique_ptr<RleBitmapElement>(new (&ac) RleBitmapElement()));
     ASSERT_TRUE(ac.check(), "alloc check");
-    EXPECT_EQ(bitmap.SetNoAlloc(0, 65536, &free_list), MX_OK, "set bits");
+    EXPECT_EQ(bitmap.SetNoAlloc(0, 65536, &free_list), ZX_OK, "set bits");
     EXPECT_TRUE(bitmap.Get(0, 65536), "get bit after setting");
     EXPECT_EQ(free_list.size_slow(), 0U, "free list empty after alloc");
 
-    EXPECT_EQ(bitmap.ClearNoAlloc(1, 65535, &free_list), MX_ERR_NO_MEMORY, "clear bits with empty freelist and alloc needed");
+    EXPECT_EQ(bitmap.ClearNoAlloc(1, 65535, &free_list), ZX_ERR_NO_MEMORY, "clear bits with empty freelist and alloc needed");
 
     free_list.push_back(fbl::unique_ptr<RleBitmapElement>(new (&ac) RleBitmapElement()));
     ASSERT_TRUE(ac.check(), "alloc check");
-    EXPECT_EQ(bitmap.ClearNoAlloc(1, 65535, &free_list), MX_OK, "clear bits");
+    EXPECT_EQ(bitmap.ClearNoAlloc(1, 65535, &free_list), ZX_OK, "clear bits");
     size_t first_unset = 0;
     EXPECT_FALSE(bitmap.Get(0, 65536, &first_unset), "get bit after clearing");
     EXPECT_EQ(first_unset, 1U, "check first_unset");
@@ -333,10 +333,10 @@
 
     free_list.push_back(fbl::unique_ptr<RleBitmapElement>(new (&ac) RleBitmapElement()));
     ASSERT_TRUE(ac.check(), "alloc check");
-    EXPECT_EQ(bitmap.SetNoAlloc(1, 65535, &free_list), MX_OK, "add range back in");
+    EXPECT_EQ(bitmap.SetNoAlloc(1, 65535, &free_list), ZX_OK, "add range back in");
     EXPECT_EQ(free_list.size_slow(), 2U, "free list has two entries after starting with one and merging two existing ranges");
 
-    EXPECT_EQ(bitmap.ClearNoAlloc(0, 65536, &free_list), MX_OK, "remove everything we allocated");
+    EXPECT_EQ(bitmap.ClearNoAlloc(0, 65536, &free_list), ZX_OK, "remove everything we allocated");
     EXPECT_EQ(free_list.size_slow(), 3U, "free list has as many entries as we allocated");
 
     END_TEST;
@@ -346,8 +346,8 @@
     BEGIN_TEST;
 
     RleBitmap bitmap;
-    EXPECT_EQ(bitmap.Set(0x64, 0x65), MX_OK, "setting later");
-    EXPECT_EQ(bitmap.Set(0x60, 0x61), MX_OK, "setting earlier");
+    EXPECT_EQ(bitmap.Set(0x64, 0x65), ZX_OK, "setting later");
+    EXPECT_EQ(bitmap.Set(0x60, 0x61), ZX_OK, "setting earlier");
 
     EXPECT_TRUE(bitmap.Get(0x64, 0x65), "getting first set");
     EXPECT_TRUE(bitmap.Get(0x60, 0x61), "getting second set");
diff --git a/system/utest/bitmap/rules.mk b/system/utest/bitmap/rules.mk
index ded2552..d6fa8c1 100644
--- a/system/utest/bitmap/rules.mk
+++ b/system/utest/bitmap/rules.mk
@@ -16,14 +16,14 @@
 MODULE_NAME := bitmap-test
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/bitmap \
     system/ulib/unittest \
 
diff --git a/system/utest/blobstore-bench/blobstore-bench.cpp b/system/utest/blobstore-bench/blobstore-bench.cpp
index c6f090b..2a551cc 100644
--- a/system/utest/blobstore-bench/blobstore-bench.cpp
+++ b/system/utest/blobstore-bench/blobstore-bench.cpp
@@ -12,9 +12,9 @@
 #include <unistd.h>
 
 #include <digest/merkle-tree.h>
-#include <magenta/device/vfs.h>
-#include <magenta/device/rtc.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/vfs.h>
+#include <zircon/device/rtc.h>
+#include <zircon/syscalls.h>
 #include <fbl/new.h>
 #include <fbl/unique_ptr.h>
 #include <fbl/vector.h>
@@ -72,7 +72,7 @@
     EXPECT_EQ(ac.check(), true);
     info->data.reset(new (&ac) char[blob_size]);
     EXPECT_EQ(ac.check(), true);
-    unsigned int seed = static_cast<unsigned int>(mx_ticks_get());
+    unsigned int seed = static_cast<unsigned int>(zx_ticks_get());
     for (size_t i = 0; i < blob_size; i++) {
         info->data[i] = (char)rand_r(&seed);
     }
@@ -89,7 +89,7 @@
     Digest digest;
     ASSERT_EQ(MerkleTree::Create(&info->data[0], info->size_data, &info->merkle[0],
                                  info->size_merkle, &digest),
-              MX_OK, "Couldn't create Merkle Tree");
+              ZX_OK, "Couldn't create Merkle Tree");
     strcpy(info->path, MOUNT_PATH "/");
     size_t prefix_len = strlen(info->path);
     digest.ToString(info->path + prefix_len, sizeof(info->path) - prefix_len);
@@ -97,7 +97,7 @@
     // Sanity-check the merkle tree
     ASSERT_EQ(MerkleTree::Verify(&info->data[0], info->size_data, &info->merkle[0],
                                  info->size_merkle, 0, info->size_data, digest),
-              MX_OK, "Failed to validate Merkle Tree");
+              ZX_OK, "Failed to validate Merkle Tree");
 
     *out = fbl::move(info);
     return true;
@@ -121,11 +121,11 @@
 
 TestData::TestData(size_t blob_size, size_t blob_count, traversal_order_t order) : blob_size(blob_size), blob_count(blob_count), order(order) {
     indices = new size_t[blob_count];
-    samples = new mx_time_t*[NAME_COUNT];
+    samples = new zx_time_t*[NAME_COUNT];
     paths = new char*[blob_count];
 
     for (int i = 0; i < NAME_COUNT; i++) {
-        samples[i] = new mx_time_t[get_max_count()];
+        samples[i] = new zx_time_t[get_max_count()];
     }
 
     for(size_t i = 0; i < blob_count; i++) {
@@ -161,7 +161,7 @@
 
     if (order == RANDOM) {
         memset(indices, 0, sizeof(size_t) * blob_count);
-        srand(static_cast<unsigned>(mx_ticks_get()));
+        srand(static_cast<unsigned>(zx_ticks_get()));
     }
 
     while (true) {
@@ -268,19 +268,19 @@
     }
 }
 
-inline void TestData::sample_end(mx_time_t start, test_name_t name, size_t index) {
-    mx_time_t now = mx_ticks_get();
+inline void TestData::sample_end(zx_time_t start, test_name_t name, size_t index) {
+    zx_time_t now = zx_ticks_get();
     samples[name][index] = now - start;
 }
 
 bool TestData::report_test(test_name_t name) {
-    mx_time_t ticks_per_msec =  mx_ticks_per_second() / 1000;
+    zx_time_t ticks_per_msec =  zx_ticks_per_second() / 1000;
 
     double min = DBL_MAX;
     double max = 0;
     double avg = 0;
     double stddev = 0;
-    mx_time_t total = 0;
+    zx_time_t total = 0;
 
     size_t sample_count = get_max_count();
 
@@ -351,19 +351,19 @@
         strcpy(paths[i], info->path);
 
         // create
-        mx_time_t start = mx_ticks_get();
+        zx_time_t start = zx_ticks_get();
         int fd = open(info->path, O_CREAT | O_RDWR);
         if (record) { sample_end(start, CREATE, sample_index); }
 
         ASSERT_GT(fd, 0, "Failed to create blob");
 
         // truncate
-        start = mx_ticks_get();
+        start = zx_ticks_get();
         ASSERT_EQ(ftruncate(fd, blob_size), 0, "Failed to truncate blob");
         if (record) { sample_end(start, TRUNCATE, sample_index); }
 
         // write
-        start = mx_ticks_get();
+        start = zx_ticks_get();
         ASSERT_EQ(StreamAll(write, fd, info->data.get(), blob_size), 0, "Failed to write Data");
         if (record) { sample_end(start, WRITE, sample_index); }
 
@@ -387,7 +387,7 @@
         const char* path = paths[index];
 
         // open
-        mx_time_t start = mx_ticks_get();
+        zx_time_t start = zx_ticks_get();
         int fd = open(path, O_RDONLY);
         sample_end(start, OPEN, i);
         ASSERT_GT(fd, 0, "Failed to open blob");
@@ -398,12 +398,12 @@
         ASSERT_EQ(lseek(fd, 0, SEEK_SET), 0);
 
         // read
-        start = mx_ticks_get();
+        start = zx_ticks_get();
         bool success = StreamAll(read, fd, &buf[0], blob_size);
         sample_end(start, READ, i);
 
         // close
-        start = mx_ticks_get();
+        start = zx_ticks_get();
         ASSERT_EQ(close(fd), 0,  "Failed to close blob");
         sample_end(start, CLOSE, i);
 
@@ -422,7 +422,7 @@
         const char* path = paths[index];
 
         // unlink
-        mx_time_t start = mx_ticks_get();
+        zx_time_t start = zx_ticks_get();
         ASSERT_EQ(unlink(path), 0, "Failed to unlink");
         sample_end(start, UNLINK, i);
     }
diff --git a/system/utest/blobstore-bench/blobstore-bench.h b/system/utest/blobstore-bench/blobstore-bench.h
index 0f5fbc7..b62fa5c 100644
--- a/system/utest/blobstore-bench/blobstore-bench.h
+++ b/system/utest/blobstore-bench/blobstore-bench.h
@@ -51,7 +51,7 @@
     void print_order();
 
     // reporting
-    inline void sample_end(mx_time_t start, test_name_t name, size_t index);
+    inline void sample_end(zx_time_t start, test_name_t name, size_t index);
     bool report_test(test_name_t name);
 
     // tests
@@ -64,6 +64,6 @@
     size_t blob_count;
     traversal_order_t order;
     size_t* indices;
-    mx_time_t** samples;
+    zx_time_t** samples;
     char** paths;
 };
diff --git a/system/utest/blobstore-bench/rules.mk b/system/utest/blobstore-bench/rules.mk
index a471a12..a72ef99 100644
--- a/system/utest/blobstore-bench/rules.mk
+++ b/system/utest/blobstore-bench/rules.mk
@@ -16,13 +16,13 @@
 MODULE_STATIC_LIBS := \
     system/ulib/digest \
     third_party/ulib/cryptolib \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/blobstore/blobstore.cpp b/system/utest/blobstore/blobstore.cpp
index 6fa9974..dd25841 100644
--- a/system/utest/blobstore/blobstore.cpp
+++ b/system/utest/blobstore/blobstore.cpp
@@ -24,10 +24,10 @@
 #include <fs-management/mount.h>
 #include <fs-management/ramdisk.h>
 #include <fvm/fvm.h>
-#include <magenta/device/device.h>
-#include <magenta/device/ramdisk.h>
-#include <magenta/device/vfs.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/device.h>
+#include <zircon/device/ramdisk.h>
+#include <zircon/device/vfs.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/auto_lock.h>
@@ -35,7 +35,7 @@
 #include <fbl/unique_ptr.h>
 #include <unittest/unittest.h>
 
-#define MOUNT_PATH "/tmp/magenta-blobstore-test"
+#define MOUNT_PATH "/tmp/zircon-blobstore-test"
 
 using digest::Digest;
 using digest::MerkleTree;
@@ -90,16 +90,16 @@
 // Unmounts a blobstore and removes the backing ramdisk device.
 template <fs_test_type_t TestType>
 static int EndBlobstoreTest(const char* ramdisk_path, const char* fvm_path) {
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     ASSERT_TRUE(CheckBlobstoreInfo(MOUNT_PATH));
 
-    if ((status = umount(MOUNT_PATH)) != MX_OK) {
+    if ((status = umount(MOUNT_PATH)) != ZX_OK) {
         fprintf(stderr, "Failed to unmount filesystem: %d\n", status);
         return -1;
     }
 
-    if ((status = fsck(ramdisk_path, DISK_FORMAT_BLOBFS, &test_fsck_options, launch_stdio_sync)) != MX_OK) {
+    if ((status = fsck(ramdisk_path, DISK_FORMAT_BLOBFS, &test_fsck_options, launch_stdio_sync)) != ZX_OK) {
         fprintf(stderr, "Filesystem fsck failed: %d\n", status);
         return -1;
     }
@@ -120,9 +120,9 @@
 
     // fd consumed by mount. By default, mount waits until the filesystem is
     // ready to accept commands.
-    mx_status_t status;
+    zx_status_t status;
     if ((status = mount(fd, MOUNT_PATH, DISK_FORMAT_BLOBFS, &default_mount_options,
-                        launch_stdio_async)) != MX_OK) {
+                        launch_stdio_async)) != ZX_OK) {
         fprintf(stderr, "Could not mount blobstore: %d\n", status);
         destroy_ramdisk(ramdisk_path);
         return -1;
@@ -155,7 +155,7 @@
         if (fd < 0) {
             fprintf(stderr, "[FAILED]: Could not open test disk\n");
             return -1;
-        } else if (fvm_init(fd, slice_size) != MX_OK) {
+        } else if (fvm_init(fd, slice_size) != ZX_OK) {
             fprintf(stderr, "[FAILED]: Could not format disk with FVM\n");
             return -1;
         } else if (ioctl_device_bind(fd, FVM_DRIVER_LIB, STRLEN(FVM_DRIVER_LIB)) < 0) {
@@ -200,9 +200,9 @@
         close(fd);
     }
 
-    mx_status_t status;
+    zx_status_t status;
     if ((status = mkfs(ramdisk_path_out, DISK_FORMAT_BLOBFS, launch_stdio_sync,
-                       &default_mkfs_options)) != MX_OK) {
+                       &default_mkfs_options)) != ZX_OK) {
         fprintf(stderr, "Could not mkfs blobstore: %d", status);
         destroy_ramdisk(ramdisk_path_out);
         return -1;
@@ -308,7 +308,7 @@
     EXPECT_EQ(ac.check(), true);
     info->data.reset(new (&ac) char[size_data]);
     EXPECT_EQ(ac.check(), true);
-    static unsigned int seed = static_cast<unsigned int>(mx_ticks_get());
+    static unsigned int seed = static_cast<unsigned int>(zx_ticks_get());
 
     for (size_t i = 0; i < size_data; i++) {
         info->data[i] = (char)rand_r(&seed);
@@ -326,7 +326,7 @@
     Digest digest;
     ASSERT_EQ(MerkleTree::Create(&info->data[0], info->size_data, &info->merkle[0],
                                  info->size_merkle, &digest),
-              MX_OK, "Couldn't create Merkle Tree");
+              ZX_OK, "Couldn't create Merkle Tree");
     strcpy(info->path, MOUNT_PATH "/");
     size_t prefix_len = strlen(info->path);
     digest.ToString(info->path + prefix_len, sizeof(info->path) - prefix_len);
@@ -334,7 +334,7 @@
     // Sanity-check the merkle tree
     ASSERT_EQ(MerkleTree::Verify(&info->data[0], info->size_data, &info->merkle[0],
                                  info->size_merkle, 0, info->size_data, digest),
-              MX_OK, "Failed to validate Merkle Tree");
+              ZX_OK, "Failed to validate Merkle Tree");
 
     *out = fbl::move(info);
     return true;
@@ -733,7 +733,7 @@
                              info->data.get(), info->size_data, &fd));
         // Close fd, unmount filesystem
         ASSERT_EQ(close(fd), 0);
-        ASSERT_EQ(umount(MOUNT_PATH), MX_OK, "Could not unmount blobstore");
+        ASSERT_EQ(umount(MOUNT_PATH), ZX_OK, "Could not unmount blobstore");
         ASSERT_EQ(MountBlobstore(ramdisk_path), 0, "Could not re-mount blobstore");
 
         fd = open(info->path, O_RDONLY);
@@ -876,7 +876,7 @@
     // TODO(smklein): Here, and elsewhere in this file, remove this source
     // of randomness to make the unit test deterministic -- fuzzing should
     // be the tool responsible for introducing randomness into the system.
-    unsigned int seed = static_cast<unsigned int>(mx_ticks_get());
+    unsigned int seed = static_cast<unsigned int>(zx_ticks_get());
     unittest_printf("unmount_remount test using seed: %u\n", seed);
 
     // Do some operations...
@@ -907,7 +907,7 @@
     }
 
     // Unmount, remount
-    ASSERT_EQ(umount(MOUNT_PATH), MX_OK, "Could not unmount blobstore");
+    ASSERT_EQ(umount(MOUNT_PATH), ZX_OK, "Could not unmount blobstore");
     ASSERT_EQ(MountBlobstore(ramdisk_path), 0, "Could not re-mount blobstore");
 
     for (auto& state : bl.list) {
@@ -931,7 +931,7 @@
 
 int unmount_remount_thread(void* arg) {
     blob_list_t* bl = static_cast<blob_list_t*>(arg);
-    unsigned int seed = static_cast<unsigned int>(mx_ticks_get());
+    unsigned int seed = static_cast<unsigned int>(zx_ticks_get());
     unittest_printf("unmount_remount thread using seed: %u\n", seed);
 
     // Do some operations...
@@ -992,7 +992,7 @@
     }
 
     // Unmount, remount
-    ASSERT_EQ(umount(MOUNT_PATH), MX_OK, "Could not unmount blobstore");
+    ASSERT_EQ(umount(MOUNT_PATH), ZX_OK, "Could not unmount blobstore");
     ASSERT_EQ(MountBlobstore(ramdisk_path), 0, "Could not re-mount blobstore");
 
     for (auto& state : bl.list) {
@@ -1409,7 +1409,7 @@
     }
 
     // Remount partition
-    ASSERT_EQ(umount(MOUNT_PATH), MX_OK, "Could not unmount blobstore");
+    ASSERT_EQ(umount(MOUNT_PATH), ZX_OK, "Could not unmount blobstore");
     ASSERT_EQ(MountBlobstore(ramdisk_path), 0, "Could not re-mount blobstore");
 
     DIR* dir = opendir(MOUNT_PATH);
diff --git a/system/utest/blobstore/rules.mk b/system/utest/blobstore/rules.mk
index 58f7fca..31da2eb 100644
--- a/system/utest/blobstore/rules.mk
+++ b/system/utest/blobstore/rules.mk
@@ -18,15 +18,15 @@
     system/ulib/digest \
     system/ulib/fs \
     system/ulib/gpt \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     third_party/ulib/cryptolib \
 
 MODULE_LIBS := \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/c \
     system/ulib/fs-management \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/unittest \
 
 include make/module.mk
\ No newline at end of file
diff --git a/system/utest/channel-fatal/channel-fatal-test.c b/system/utest/channel-fatal/channel-fatal-test.c
index 3d092df..74dcf6d 100644
--- a/system/utest/channel-fatal/channel-fatal-test.c
+++ b/system/utest/channel-fatal/channel-fatal-test.c
@@ -10,17 +10,17 @@
 #include <unistd.h>
 
 #include <launchpad/launchpad.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/port.h>
 #include <unittest/unittest.h>
 
 static const char* process_bin;
 
-// SYSCALL_mx_channel_call_noretry is an internal system call used in the
-// vDSO's implementation of mx_channel_call.  It's not part of the ABI and
+// SYSCALL_zx_channel_call_noretry is an internal system call used in the
+// vDSO's implementation of zx_channel_call.  It's not part of the ABI and
 // so it's not exported from the vDSO.  It's hard to test the kernel's
 // invariants without calling this directly.  So use some chicanery to
 // find its address in the vDSO despite it not being public.
@@ -29,19 +29,19 @@
 // the offsets of the internal functions.  So take a public vDSO function,
 // subtract its offset to discover the vDSO base (could do this other ways,
 // but this is the simplest), and then add the offset of the internal
-// SYSCALL_mx_channel_call_noretry function we want to call.
+// SYSCALL_zx_channel_call_noretry function we want to call.
 #include "vdso-code.h"
-static mx_status_t mx_channel_call_noretry(mx_handle_t handle,
+static zx_status_t zx_channel_call_noretry(zx_handle_t handle,
                                            uint32_t options,
-                                           mx_time_t deadline,
-                                           const mx_channel_call_args_t* args,
+                                           zx_time_t deadline,
+                                           const zx_channel_call_args_t* args,
                                            uint32_t* actual_bytes,
                                            uint32_t* actual_handles,
-                                           mx_status_t* read_status) {
+                                           zx_status_t* read_status) {
     uintptr_t vdso_base =
-        (uintptr_t)&mx_handle_close - VDSO_SYSCALL_mx_handle_close;
-    uintptr_t fnptr = vdso_base + VDSO_SYSCALL_mx_channel_call_noretry;
-    return (*(__typeof(mx_channel_call_noretry)*)fnptr)(
+        (uintptr_t)&zx_handle_close - VDSO_SYSCALL_zx_handle_close;
+    uintptr_t fnptr = vdso_base + VDSO_SYSCALL_zx_channel_call_noretry;
+    return (*(__typeof(zx_channel_call_noretry)*)fnptr)(
         handle, options, deadline, args, actual_bytes, actual_handles, read_status);
 }
 
@@ -51,7 +51,7 @@
 static void bad_channel_call(void) {
     char msg[8] = { 0, };
 
-    mx_channel_call_args_t args = {
+    zx_channel_call_args_t args = {
         .wr_bytes = msg,
         .wr_handles = NULL,
         .wr_num_bytes = sizeof(msg),
@@ -65,38 +65,38 @@
     uint32_t act_bytes = UINT32_MAX;
     uint32_t act_handles = UINT32_MAX;
 
-    mx_handle_t chan = mx_get_startup_handle(PA_HND(PA_USER0, 0));
-    mx_handle_t event = mx_get_startup_handle(PA_HND(PA_USER0, 1));
+    zx_handle_t chan = zx_get_startup_handle(PA_HND(PA_USER0, 0));
+    zx_handle_t event = zx_get_startup_handle(PA_HND(PA_USER0, 1));
 
     // Send a copy of the thread handle to the parent, so the parent can suspend
     // this thread.
-    mx_handle_t thread;
-    mx_status_t status = mx_handle_duplicate(mx_thread_self(), MX_RIGHT_SAME_RIGHTS, &thread);
-    if (status != MX_OK) {
-        mx_object_signal(event, 0, MX_USER_SIGNAL_0);
+    zx_handle_t thread;
+    zx_status_t status = zx_handle_duplicate(zx_thread_self(), ZX_RIGHT_SAME_RIGHTS, &thread);
+    if (status != ZX_OK) {
+        zx_object_signal(event, 0, ZX_USER_SIGNAL_0);
         __builtin_trap();
     }
-    status = mx_channel_write(chan, 0, NULL, 0, &thread, 1);
-    if (status != MX_OK) {
-        mx_object_signal(event, 0, MX_USER_SIGNAL_0);
+    status = zx_channel_write(chan, 0, NULL, 0, &thread, 1);
+    if (status != ZX_OK) {
+        zx_object_signal(event, 0, ZX_USER_SIGNAL_0);
         __builtin_trap();
     }
 
-    mx_status_t rs = MX_OK;
-    status = mx_channel_call_noretry(chan, 0, MX_TIME_INFINITE, &args,
+    zx_status_t rs = ZX_OK;
+    status = zx_channel_call_noretry(chan, 0, ZX_TIME_INFINITE, &args,
                                      &act_bytes, &act_handles, &rs);
-    if (status != MX_ERR_CALL_FAILED || rs != MX_ERR_INTERNAL_INTR_RETRY) {
-        mx_object_signal(event, 0, MX_USER_SIGNAL_0);
+    if (status != ZX_ERR_CALL_FAILED || rs != ZX_ERR_INTERNAL_INTR_RETRY) {
+        zx_object_signal(event, 0, ZX_USER_SIGNAL_0);
         __builtin_trap();
     }
 
-    mx_object_signal(event, 0, MX_USER_SIGNAL_1);
+    zx_object_signal(event, 0, ZX_USER_SIGNAL_1);
 
     // Doing another channel call at this point violates the VDSO contract,
-    // since we haven't called SYSCALL_mx_channel_call_finish().
-    mx_channel_call_noretry(chan, 0, MX_TIME_INFINITE, &args,
+    // since we haven't called SYSCALL_zx_channel_call_finish().
+    zx_channel_call_noretry(chan, 0, ZX_TIME_INFINITE, &args,
                             &act_bytes, &act_handles, &rs);
-    mx_object_signal(event, 0, MX_USER_SIGNAL_0);
+    zx_object_signal(event, 0, ZX_USER_SIGNAL_0);
     __builtin_trap();
 }
 
@@ -105,14 +105,14 @@
 static bool bad_channel_call_contract_violation(void) {
     BEGIN_TEST;
 
-    mx_handle_t chan, remote, event, event_copy;
-    ASSERT_EQ(mx_channel_create(0, &chan, &remote), MX_OK, "");
-    ASSERT_EQ(mx_event_create(0, &event), MX_OK, "");
-    ASSERT_EQ(mx_handle_duplicate(event, MX_RIGHT_SAME_RIGHTS, &event_copy), MX_OK, "");
+    zx_handle_t chan, remote, event, event_copy;
+    ASSERT_EQ(zx_channel_create(0, &chan, &remote), ZX_OK, "");
+    ASSERT_EQ(zx_event_create(0, &event), ZX_OK, "");
+    ASSERT_EQ(zx_handle_duplicate(event, ZX_RIGHT_SAME_RIGHTS, &event_copy), ZX_OK, "");
 
     launchpad_t* lp;
     launchpad_create(0, process_bin, &lp);
-    launchpad_clone(lp, LP_CLONE_MXIO_STDIO | LP_CLONE_ENVIRON | LP_CLONE_DEFAULT_JOB);
+    launchpad_clone(lp, LP_CLONE_FDIO_STDIO | LP_CLONE_ENVIRON | LP_CLONE_DEFAULT_JOB);
     const char* args[] = {
         process_bin,
         "child",
@@ -122,17 +122,17 @@
     launchpad_add_handle(lp, event_copy, PA_HND(PA_USER0, 1));
     launchpad_load_from_file(lp, process_bin);
     const char* errmsg;
-    mx_handle_t proc;
-    ASSERT_EQ(launchpad_go(lp, &proc, &errmsg), MX_OK, "");
+    zx_handle_t proc;
+    ASSERT_EQ(launchpad_go(lp, &proc, &errmsg), ZX_OK, "");
 
     uint32_t act_bytes = UINT32_MAX;
     uint32_t act_handles = UINT32_MAX;
-    mx_handle_t thread;
+    zx_handle_t thread;
 
     // Get the thread handle from our child
-    ASSERT_EQ(mx_object_wait_one(chan, MX_CHANNEL_READABLE, MX_TIME_INFINITE, NULL), MX_OK, "");
-    ASSERT_EQ(mx_channel_read(chan, 0, NULL, &thread, 0, 1, &act_bytes, &act_handles),
-              MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(chan, ZX_CHANNEL_READABLE, ZX_TIME_INFINITE, NULL), ZX_OK, "");
+    ASSERT_EQ(zx_channel_read(chan, 0, NULL, &thread, 0, 1, &act_bytes, &act_handles),
+              ZX_OK, "");
     ASSERT_EQ(act_handles, 1u, "");
 
     // Wait for the channel call and pull its message out of the pipe.  This
@@ -141,46 +141,46 @@
     // until it reaches the wait.  So if we see the message written to the
     // channel, we know the other thread is in the call, and so when we see
     // it has suspended, it will have attempted the wait first.
-    EXPECT_EQ(mx_object_wait_one(chan, MX_CHANNEL_READABLE, MX_TIME_INFINITE, NULL), MX_OK, "");
+    EXPECT_EQ(zx_object_wait_one(chan, ZX_CHANNEL_READABLE, ZX_TIME_INFINITE, NULL), ZX_OK, "");
     char msg[8] = { 0 };
-    ASSERT_EQ(mx_channel_read(chan, 0, msg, NULL, sizeof(msg), 0, &act_bytes, &act_handles),
-              MX_OK, "");
+    ASSERT_EQ(zx_channel_read(chan, 0, msg, NULL, sizeof(msg), 0, &act_bytes, &act_handles),
+              ZX_OK, "");
 
-    // Attach to debugger port so we can see MX_EXCP_THREAD_SUSPENDED
-    mx_handle_t eport;
-    ASSERT_EQ(mx_port_create(0, &eport), MX_OK, "");
-    ASSERT_EQ(mx_task_bind_exception_port(proc, eport, 0,
-                                          MX_EXCEPTION_PORT_DEBUGGER),
-              MX_OK, "");
+    // Attach to debugger port so we can see ZX_EXCP_THREAD_SUSPENDED
+    zx_handle_t eport;
+    ASSERT_EQ(zx_port_create(0, &eport), ZX_OK, "");
+    ASSERT_EQ(zx_task_bind_exception_port(proc, eport, 0,
+                                          ZX_EXCEPTION_PORT_DEBUGGER),
+              ZX_OK, "");
 
-    ASSERT_EQ(mx_task_suspend(thread), MX_OK, "");
+    ASSERT_EQ(zx_task_suspend(thread), ZX_OK, "");
 
     // Wait for the thread to suspend
-    mx_port_packet_t packet;
-    ASSERT_EQ(mx_port_wait(eport, MX_TIME_INFINITE, &packet, 0), MX_OK, "");
-    ASSERT_EQ(packet.type, (uint32_t) MX_EXCP_THREAD_SUSPENDED, "");
-    ASSERT_EQ(mx_handle_close(eport), MX_OK, "");
+    zx_port_packet_t packet;
+    ASSERT_EQ(zx_port_wait(eport, ZX_TIME_INFINITE, &packet, 0), ZX_OK, "");
+    ASSERT_EQ(packet.type, (uint32_t) ZX_EXCP_THREAD_SUSPENDED, "");
+    ASSERT_EQ(zx_handle_close(eport), ZX_OK, "");
 
     // Resume the thread
-    ASSERT_EQ(mx_task_resume(thread, 0), MX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread, 0), ZX_OK, "");
 
     // Wait for signal 0 or 1, meaning either it's going to try its second call,
     // or something unexpected happened.
     uint32_t observed;
-    ASSERT_EQ(mx_object_wait_one(event, MX_USER_SIGNAL_0 | MX_USER_SIGNAL_1,
-                                 MX_TIME_INFINITE, &observed), MX_OK, "");
-    ASSERT_TRUE(observed & MX_USER_SIGNAL_1, "");
-    ASSERT_FALSE(observed & MX_USER_SIGNAL_0, "");
+    ASSERT_EQ(zx_object_wait_one(event, ZX_USER_SIGNAL_0 | ZX_USER_SIGNAL_1,
+                                 ZX_TIME_INFINITE, &observed), ZX_OK, "");
+    ASSERT_TRUE(observed & ZX_USER_SIGNAL_1, "");
+    ASSERT_FALSE(observed & ZX_USER_SIGNAL_0, "");
 
     // Process should have been shot
-    ASSERT_EQ(mx_object_wait_one(proc, MX_PROCESS_TERMINATED, MX_TIME_INFINITE, NULL), MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(proc, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, NULL), ZX_OK, "");
     // Make sure we don't see the "unexpected thing happened" signal.
-    ASSERT_EQ(mx_object_wait_one(event, MX_USER_SIGNAL_0, 0, &observed), MX_ERR_TIMED_OUT, "");
+    ASSERT_EQ(zx_object_wait_one(event, ZX_USER_SIGNAL_0, 0, &observed), ZX_ERR_TIMED_OUT, "");
 
-    ASSERT_EQ(mx_handle_close(event), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(chan), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(proc), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(event), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(chan), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(proc), ZX_OK, "");
 
     END_TEST;
 }
diff --git a/system/utest/channel-fatal/rules.mk b/system/utest/channel-fatal/rules.mk
index aebf13a..581bdf8 100644
--- a/system/utest/channel-fatal/rules.mk
+++ b/system/utest/channel-fatal/rules.mk
@@ -17,8 +17,8 @@
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/launchpad \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 # We need a header file generated by kernel/lib/vdso/rules.mk.
diff --git a/system/utest/cleanup/cleanup.c b/system/utest/cleanup/cleanup.c
index ef3f18e..97732dd 100644
--- a/system/utest/cleanup/cleanup.c
+++ b/system/utest/cleanup/cleanup.c
@@ -6,8 +6,8 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <unittest/unittest.h>
 
 static const char* msg = "This is a test message, please discard.";
@@ -22,9 +22,9 @@
 
 bool cleanup_test(void) {
     BEGIN_TEST;
-    mx_handle_t p0[2], p1[2];
-    mx_signals_t pending;
-    mx_status_t r;
+    zx_handle_t p0[2], p1[2];
+    zx_signals_t pending;
+    zx_status_t r;
 
     thrd_t thread;
     thrd_create_with_name(&thread, watchdog, NULL, "watchdog");
@@ -33,18 +33,18 @@
     // TEST1
     // Create a channel, close one end, try to wait on the other.
     test_state = 1;
-    r = mx_channel_create(0, p1, p1 + 1);
+    r = zx_channel_create(0, p1, p1 + 1);
     ASSERT_EQ(r, 0, "cleanup-test: channel create 1 failed");
 
-    mx_handle_close(p1[1]);
+    zx_handle_close(p1[1]);
     unittest_printf("cleanup-test: about to wait, should return immediately with PEER_CLOSED\n");
-    r = mx_object_wait_one(p1[0], MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                                 MX_TIME_INFINITE, &pending);
+    r = zx_object_wait_one(p1[0], ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                                 ZX_TIME_INFINITE, &pending);
     ASSERT_EQ(r, 0, "cleanup-test: FAILED");
 
-    ASSERT_EQ(pending, MX_CHANNEL_PEER_CLOSED | MX_SIGNAL_LAST_HANDLE, "cleanup-test: FAILED");
+    ASSERT_EQ(pending, ZX_CHANNEL_PEER_CLOSED | ZX_SIGNAL_LAST_HANDLE, "cleanup-test: FAILED");
     unittest_printf("cleanup-test: SUCCESS, observed PEER_CLOSED signal\n\n");
-    mx_handle_close(p1[0]);
+    zx_handle_close(p1[0]);
 
     // TEST2
     // Create a channel, close one end. Then create an event and write a
@@ -53,23 +53,23 @@
     // fails (because the other end is closed) The event should still
     // be usable from this process.
     test_state = 2;
-    r = mx_channel_create(0, p1, p1 + 1);
+    r = zx_channel_create(0, p1, p1 + 1);
     ASSERT_EQ(r, 0, "cleanup-test: channel create 1 failed");
-    mx_handle_close(p1[1]);
+    zx_handle_close(p1[1]);
 
-    mx_handle_t event = MX_HANDLE_INVALID;
-    r = mx_event_create(0u, &event);
+    zx_handle_t event = ZX_HANDLE_INVALID;
+    r = zx_event_create(0u, &event);
     ASSERT_EQ(r, 0, "");
-    ASSERT_NE(event, MX_HANDLE_INVALID, "cleanup-test: event create failed");
-    r = mx_channel_write(p1[0], 0, &msg, sizeof(msg), &event, 1);
-    ASSERT_EQ(r, MX_ERR_PEER_CLOSED, "cleanup-test: unexpected message_write return code");
+    ASSERT_NE(event, ZX_HANDLE_INVALID, "cleanup-test: event create failed");
+    r = zx_channel_write(p1[0], 0, &msg, sizeof(msg), &event, 1);
+    ASSERT_EQ(r, ZX_ERR_PEER_CLOSED, "cleanup-test: unexpected message_write return code");
 
-    r = mx_object_signal(event, 0u, MX_EVENT_SIGNALED);
+    r = zx_object_signal(event, 0u, ZX_EVENT_SIGNALED);
     ASSERT_GE(r, 0, "cleanup-test: unable to signal event!");
     unittest_printf("cleanup-test: SUCCESS, event is alive\n\n");
 
-    mx_handle_close(event);
-    mx_handle_close(p1[0]);
+    zx_handle_close(event);
+    zx_handle_close(p1[0]);
 
     // TEST3
     // Simulates the case where we prepare a message channel with a
@@ -81,25 +81,25 @@
     // be closed and waiting on the opposing handle should
     // signal PEER_CLOSED.
     test_state = 3;
-    r = mx_channel_create(0, p0, p0 + 1);
+    r = zx_channel_create(0, p0, p0 + 1);
     ASSERT_EQ(r, 0, "cleanup-test: channel create 0 failed");
 
-    r = mx_channel_create(0, p1, p1 + 1);
+    r = zx_channel_create(0, p1, p1 + 1);
     ASSERT_EQ(r, 0, "cleanup-test: channel create 1 failed");
 
-    r = mx_channel_write(p0[0], 0, &msg, sizeof(msg), &p1[1], 1);
+    r = zx_channel_write(p0[0], 0, &msg, sizeof(msg), &p1[1], 1);
     ASSERT_GE(r, 0, "cleanup-test: channel write failed");
 
-    mx_handle_close(p0[0]);
-    mx_handle_close(p0[1]);
+    zx_handle_close(p0[0]);
+    zx_handle_close(p0[1]);
 
     unittest_printf("cleanup-test: about to wait, should return immediately with PEER_CLOSED\n");
-    r = mx_object_wait_one(p1[0], MX_CHANNEL_PEER_CLOSED, MX_TIME_INFINITE, NULL);
+    r = zx_object_wait_one(p1[0], ZX_CHANNEL_PEER_CLOSED, ZX_TIME_INFINITE, NULL);
     ASSERT_EQ(r, 0, "cleanup-test: FAILED");
 
     test_state = 100;
     unittest_printf("cleanup-test: PASSED\n");
-    mx_handle_close(p1[0]);
+    zx_handle_close(p1[0]);
     END_TEST;
 }
 
diff --git a/system/utest/cleanup/rules.mk b/system/utest/cleanup/rules.mk
index f9cfaf0..b6aa15e 100644
--- a/system/utest/cleanup/rules.mk
+++ b/system/utest/cleanup/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := cleanup-test
 
-MODULE_LIBS := system/ulib/mxio system/ulib/unittest system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/unittest system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/README.md b/system/utest/core/README.md
index d9be9d9..91f8c89 100644
--- a/system/utest/core/README.md
+++ b/system/utest/core/README.md
@@ -10,7 +10,7 @@
 ## Example usage
 
 ```
-./scripts/run-magenta-x86-64 -c userboot=bin/core-tests
+./scripts/run-zircon-x86-64 -c userboot=bin/core-tests
 ```
 
 ## Notes
@@ -18,8 +18,8 @@
 The tests here are for "core" functionality (channels, etc.), but
 not all "core" functionality can go here.  For example, you can't
 start a process in your test with launchpad because core tests are for
-when that functionality isn't working.  Core tests can't use mxio and
-launchpad uses mxio.
+when that functionality isn't working.  Core tests can't use fdio and
+launchpad uses fdio.
 
-Since these tests can't use mxio core/main.c stubs out the needed
-functions from mxio.
+Since these tests can't use fdio core/main.c stubs out the needed
+functions from fdio.
diff --git a/system/utest/core/bad-syscall/bad-syscall.c b/system/utest/core/bad-syscall/bad-syscall.c
index 2c71316..3171ad0 100644
--- a/system/utest/core/bad-syscall/bad-syscall.c
+++ b/system/utest/core/bad-syscall/bad-syscall.c
@@ -6,32 +6,32 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/mx-syscall-numbers.h>
-#include <magenta/syscalls.h>
+#include <zircon/zx-syscall-numbers.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
-extern mx_status_t bad_syscall(uint64_t num);
+extern zx_status_t bad_syscall(uint64_t num);
 
 bool bad_access_test(void) {
     BEGIN_TEST;
     void* unmapped_addr = (void*)4096;
-    mx_handle_t h[2];
-    EXPECT_EQ(mx_channel_create(0, h, h + 1),
+    zx_handle_t h[2];
+    EXPECT_EQ(zx_channel_create(0, h, h + 1),
               0, "Error: channel create failed");
-    EXPECT_LT(mx_channel_write(0, h[0], unmapped_addr, 1, NULL, 0),
+    EXPECT_LT(zx_channel_write(0, h[0], unmapped_addr, 1, NULL, 0),
               0, "Error: reading unmapped addr");
-    EXPECT_LT(mx_channel_write(h[0], 0, (void*)KERNEL_ASPACE_BASE - 1, 5, NULL, 0),
+    EXPECT_LT(zx_channel_write(h[0], 0, (void*)KERNEL_ASPACE_BASE - 1, 5, NULL, 0),
               0, "Error: read crossing kernel boundary");
-    EXPECT_LT(mx_channel_write(h[0], 0, (void*)KERNEL_ASPACE_BASE, 1, NULL, 0),
+    EXPECT_LT(zx_channel_write(h[0], 0, (void*)KERNEL_ASPACE_BASE, 1, NULL, 0),
               0, "Error: read into kernel space");
-    EXPECT_EQ(mx_channel_write(h[0], 0, (void*)&unmapped_addr, sizeof(void*), NULL, 0),
+    EXPECT_EQ(zx_channel_write(h[0], 0, (void*)&unmapped_addr, sizeof(void*), NULL, 0),
               0, "Good syscall failed");
     END_TEST;
 }
 
 static void try_bad_syscall(void* arg) {
     uint64_t num = (uintptr_t)arg;
-    mx_status_t status = bad_syscall(num);
+    zx_status_t status = bad_syscall(num);
     UNITTEST_TRACEF("bad syscall %#" PRIx64 " returned %d", num, status);
 }
 
@@ -41,7 +41,7 @@
 
 bool bad_syscall_num_test(void) {
     BEGIN_TEST;
-    TRY_BAD_SYSCALL(MX_SYS_COUNT);
+    TRY_BAD_SYSCALL(ZX_SYS_COUNT);
     TRY_BAD_SYSCALL(0x80000000ull);
     TRY_BAD_SYSCALL(0xff00ff0000000000ull);
     TRY_BAD_SYSCALL(0xff00ff0000000010ull);
diff --git a/system/utest/core/bad-syscall/rules.mk b/system/utest/core/bad-syscall/rules.mk
index 2f9d68c..2c8d5d1 100644
--- a/system/utest/core/bad-syscall/rules.mk
+++ b/system/utest/core/bad-syscall/rules.mk
@@ -15,6 +15,6 @@
 
 MODULE_NAME := bad-syscall-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/bad-syscall/syscall.S b/system/utest/core/bad-syscall/syscall.S
index 120a5aa..39353bc 100644
--- a/system/utest/core/bad-syscall/syscall.S
+++ b/system/utest/core/bad-syscall/syscall.S
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// mx_status_t bad_syscall(uint64_t num)
+// zx_status_t bad_syscall(uint64_t num)
 .global bad_syscall
 .type bad_syscall, STT_FUNC
 bad_syscall:
diff --git a/system/utest/core/c11-condvar/rules.mk b/system/utest/core/c11-condvar/rules.mk
index 05ac84b..cfaa2a6 100644
--- a/system/utest/core/c11-condvar/rules.mk
+++ b/system/utest/core/c11-condvar/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := c11-condvar-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/c11-mutex/mutex.c b/system/utest/core/c11-mutex/mutex.c
index 9643e45..1e5efe2 100644
--- a/system/utest/core/c11-mutex/mutex.c
+++ b/system/utest/core/c11-mutex/mutex.c
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 #include <inttypes.h>
 #include <stddef.h>
@@ -14,7 +14,7 @@
 static mtx_t g_mutex = MTX_INIT;
 
 static void xlog(const char* str) {
-    uint64_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+    uint64_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
     unittest_printf("[%08" PRIu64 ".%08" PRIu64 "]: %s",
                     now / 1000000000, now % 1000000000, str);
 }
@@ -24,7 +24,7 @@
 
     for (int times = 0; times < 300; times++) {
         mtx_lock(&g_mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(1)));
+        zx_nanosleep(zx_deadline_after(ZX_USEC(1)));
         mtx_unlock(&g_mutex);
     }
 
@@ -37,7 +37,7 @@
 
     for (int times = 0; times < 150; times++) {
         mtx_lock(&g_mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(2)));
+        zx_nanosleep(zx_deadline_after(ZX_USEC(2)));
         mtx_unlock(&g_mutex);
     }
 
@@ -50,7 +50,7 @@
 
     for (int times = 0; times < 100; times++) {
         mtx_lock(&g_mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(3)));
+        zx_nanosleep(zx_deadline_after(ZX_USEC(3)));
         mtx_unlock(&g_mutex);
     }
 
@@ -67,7 +67,7 @@
 
     for (int times = 0; times < 300 || !got_lock_1; times++) {
         int status = mtx_trylock(&g_mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(1)));
+        zx_nanosleep(zx_deadline_after(ZX_USEC(1)));
         if (status == thrd_success) {
             got_lock_1 = true;
             mtx_unlock(&g_mutex);
@@ -83,7 +83,7 @@
 
     for (int times = 0; times < 150 || !got_lock_2; times++) {
         int status = mtx_trylock(&g_mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(2)));
+        zx_nanosleep(zx_deadline_after(ZX_USEC(2)));
         if (status == thrd_success) {
             got_lock_2 = true;
             mtx_unlock(&g_mutex);
@@ -99,7 +99,7 @@
 
     for (int times = 0; times < 100 || !got_lock_3; times++) {
         int status = mtx_trylock(&g_mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(3)));
+        zx_nanosleep(zx_deadline_after(ZX_USEC(3)));
         if (status == thrd_success) {
             got_lock_3 = true;
             mtx_unlock(&g_mutex);
@@ -168,19 +168,19 @@
 
 typedef struct {
     mtx_t mutex;
-    mx_handle_t start_event;
-    mx_handle_t done_event;
+    zx_handle_t start_event;
+    zx_handle_t done_event;
 } timeout_args;
 
 static int test_timeout_helper(void* ctx) {
     timeout_args* args = ctx;
     ASSERT_EQ(mtx_lock(&args->mutex), thrd_success, "f to lock");
     // Inform the main thread that we have acquired the lock.
-    ASSERT_EQ(mx_object_signal(args->start_event, 0, MX_EVENT_SIGNALED), MX_OK,
+    ASSERT_EQ(zx_object_signal(args->start_event, 0, ZX_EVENT_SIGNALED), ZX_OK,
               "failed to signal");
     // Wait until the main thread has completed its test.
-    ASSERT_EQ(mx_object_wait_one(args->done_event, MX_EVENT_SIGNALED, MX_TIME_INFINITE, NULL),
-              MX_OK, "failed to wait");
+    ASSERT_EQ(zx_object_wait_one(args->done_event, ZX_EVENT_SIGNALED, ZX_TIME_INFINITE, NULL),
+              ZX_OK, "failed to wait");
     ASSERT_EQ(mtx_unlock(&args->mutex), thrd_success, "failed to unlock");
     return 0;
 }
@@ -188,37 +188,37 @@
 static bool test_timeout_elapsed(void) {
     BEGIN_TEST;
 
-    const mx_time_t kRelativeDeadline = MX_MSEC(100);
+    const zx_time_t kRelativeDeadline = ZX_MSEC(100);
     // TODO(kulakowski) The kernel can currently return up to a
     // millisecond short in its internal conversion to lk_time_t. For
     // now, just accept this.
-    const mx_time_t kAcceptableElapsedTime = MX_MSEC(99);
+    const zx_time_t kAcceptableElapsedTime = ZX_MSEC(99);
 
     timeout_args args;
     ASSERT_EQ(thrd_success, mtx_init(&args.mutex, mtx_plain), "could not create mutex");
-    ASSERT_EQ(mx_event_create(0, &args.start_event), MX_OK, "could not create event");
-    ASSERT_EQ(mx_event_create(0, &args.done_event), MX_OK, "could not create event");
+    ASSERT_EQ(zx_event_create(0, &args.start_event), ZX_OK, "could not create event");
+    ASSERT_EQ(zx_event_create(0, &args.done_event), ZX_OK, "could not create event");
 
     thrd_t helper;
     ASSERT_EQ(thrd_create(&helper, test_timeout_helper, &args), thrd_success, "");
     // Wait for the helper thread to acquire the lock.
-    ASSERT_EQ(mx_object_wait_one(args.start_event, MX_EVENT_SIGNALED, MX_TIME_INFINITE, NULL),
-              MX_OK, "failed to wait");
+    ASSERT_EQ(zx_object_wait_one(args.start_event, ZX_EVENT_SIGNALED, ZX_TIME_INFINITE, NULL),
+              ZX_OK, "failed to wait");
 
     for (int i = 0; i < 5; ++i) {
-        mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+        zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
         struct timespec then = {
-            .tv_sec = now / MX_SEC(1),
-            .tv_nsec = now % MX_SEC(1),
+            .tv_sec = now / ZX_SEC(1),
+            .tv_nsec = now % ZX_SEC(1),
         };
         then.tv_nsec += kRelativeDeadline;
-        if (then.tv_nsec > (long)MX_SEC(1)) {
-            then.tv_nsec -= MX_SEC(1);
+        if (then.tv_nsec > (long)ZX_SEC(1)) {
+            then.tv_nsec -= ZX_SEC(1);
             then.tv_sec += 1;
         }
         int rc = mtx_timedlock(&args.mutex, &then);
         ASSERT_EQ(rc, thrd_timedout, "wait should time out");
-        mx_time_t elapsed = mx_time_get(MX_CLOCK_MONOTONIC) - now;
+        zx_time_t elapsed = zx_time_get(ZX_CLOCK_MONOTONIC) - now;
         if (elapsed < kAcceptableElapsedTime) {
             unittest_printf_critical("\nelapsed %" PRIu64
                             " < kAcceptableElapsedTime: %" PRIu64 "\n",
@@ -228,13 +228,13 @@
     }
 
     // Inform the helper thread that we are done.
-    ASSERT_EQ(mx_object_signal(args.done_event, 0, MX_EVENT_SIGNALED),
-              MX_OK, "failed to signal");
+    ASSERT_EQ(zx_object_signal(args.done_event, 0, ZX_EVENT_SIGNALED),
+              ZX_OK, "failed to signal");
     ASSERT_EQ(thrd_join(helper, NULL), thrd_success, "failed to join");
 
     mtx_destroy(&args.mutex);
-    ASSERT_EQ(mx_handle_close(args.start_event), MX_OK, "failed to close event");
-    ASSERT_EQ(mx_handle_close(args.done_event), MX_OK, "failed to close event");
+    ASSERT_EQ(zx_handle_close(args.start_event), ZX_OK, "failed to close event");
+    ASSERT_EQ(zx_handle_close(args.done_event), ZX_OK, "failed to close event");
 
     END_TEST;
 }
diff --git a/system/utest/core/c11-mutex/rules.mk b/system/utest/core/c11-mutex/rules.mk
index 5ce9ab2..a9c0bf9 100644
--- a/system/utest/core/c11-mutex/rules.mk
+++ b/system/utest/core/c11-mutex/rules.mk
@@ -15,6 +15,6 @@
 
 MODULE_NAME := c11-mutex-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/c11-thread/rules.mk b/system/utest/core/c11-thread/rules.mk
index 07a2d0e..754684d 100644
--- a/system/utest/core/c11-thread/rules.mk
+++ b/system/utest/core/c11-thread/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := c11-thread-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/c11-thread/thread.c b/system/utest/core/c11-thread/thread.c
index d2bc344..3d53db4 100644
--- a/system/utest/core/c11-thread/thread.c
+++ b/system/utest/core/c11-thread/thread.c
@@ -8,8 +8,8 @@
 #include <stdlib.h>
 #include <threads.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/threads.h>
+#include <zircon/syscalls.h>
+#include <zircon/threads.h>
 #include <unittest/unittest.h>
 
 volatile int threads_done[7];
@@ -18,7 +18,7 @@
     int thread_number = (int)(intptr_t)arg;
     errno = thread_number;
     unittest_printf("thread %d sleeping for .1 seconds\n", thread_number);
-    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
     EXPECT_EQ(errno, thread_number, "errno changed by someone!");
     threads_done[thread_number] = 1;
     return thread_number;
@@ -46,16 +46,16 @@
     unittest_printf("Attempting to create thread with a null name. This should succeed\n");
     int ret = thrd_create_with_name(&thread, thread_entry, (void*)(intptr_t)4, NULL);
     ASSERT_EQ(ret, thrd_success, "Error returned from thread creation");
-    mx_handle_t handle = thrd_get_mx_handle(thread);
-    ASSERT_NE(handle, MX_HANDLE_INVALID, "got invalid thread handle");
+    zx_handle_t handle = thrd_get_zx_handle(thread);
+    ASSERT_NE(handle, ZX_HANDLE_INVALID, "got invalid thread handle");
     // Prove this is a valid handle by duplicating it.
-    mx_handle_t dup_handle;
-    mx_status_t status = mx_handle_duplicate(handle, MX_RIGHT_SAME_RIGHTS, &dup_handle);
+    zx_handle_t dup_handle;
+    zx_status_t status = zx_handle_duplicate(handle, ZX_RIGHT_SAME_RIGHTS, &dup_handle);
     ASSERT_EQ(status, 0, "failed to duplicate thread handle");
 
     ret = thrd_join(thread, &return_value);
     ASSERT_EQ(ret, thrd_success, "Error while thread join");
-    ASSERT_EQ(mx_handle_close(dup_handle), MX_OK, "failed to close duplicate handle");
+    ASSERT_EQ(zx_handle_close(dup_handle), ZX_OK, "failed to close duplicate handle");
     ASSERT_EQ(return_value, 4, "Incorrect return from thread");
 
     ret = thrd_create_with_name(&thread, thread_entry, (void*)(intptr_t)5, NULL);
@@ -64,7 +64,7 @@
     ASSERT_EQ(ret, thrd_success, "Error while thread detach");
 
     while (!threads_done[5])
-        mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
 
     thread_entry((void*)(intptr_t)6);
     ASSERT_TRUE(threads_done[6], "All threads should have completed");
@@ -79,7 +79,7 @@
     static const char long_name[] =
         "0123456789012345678901234567890123456789"
         "0123456789012345678901234567890123456789";
-    ASSERT_GT(strlen(long_name), (size_t)MX_MAX_NAME_LEN-1,
+    ASSERT_GT(strlen(long_name), (size_t)ZX_MAX_NAME_LEN-1,
               "too short to truncate");
 
     thrd_t thread;
diff --git a/system/utest/core/channel/channel.c b/system/utest/core/channel/channel.c
index 1fa5f91..70e89ac 100644
--- a/system/utest/core/channel/channel.c
+++ b/system/utest/core/channel/channel.c
@@ -3,9 +3,9 @@
 // found in the LICENSE file.
 
 #include <assert.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <unittest/unittest.h>
 #include <stdbool.h>
 #include <stdio.h>
@@ -13,7 +13,7 @@
 #include <threads.h>
 #include <unistd.h>
 
-mx_handle_t _channel[4];
+zx_handle_t _channel[4];
 
 /**
  * Channel tests with wait multiple.
@@ -39,34 +39,34 @@
 
 static int reader_thread(void* arg) {
     const unsigned int index = 2;
-    mx_handle_t* channel = &_channel[index];
-    __UNUSED mx_status_t status;
+    zx_handle_t* channel = &_channel[index];
+    __UNUSED zx_status_t status;
     unsigned int packets[2] = {0, 0};
     bool closed[2] = {false, false};
-    mx_wait_item_t items[2];
+    zx_wait_item_t items[2];
     items[0].handle = channel[0];
     items[1].handle = channel[1];
-    items[0].waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
-    items[1].waitfor = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
+    items[0].waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
+    items[1].waitfor = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
     do {
-        status = mx_object_wait_many(items, 2, MX_TIME_INFINITE);
-        assert(status == MX_OK);
+        status = zx_object_wait_many(items, 2, ZX_TIME_INFINITE);
+        assert(status == ZX_OK);
         uint32_t data;
         uint32_t num_bytes = sizeof(uint32_t);
-        if (items[0].pending & MX_CHANNEL_READABLE) {
-            status = mx_channel_read(channel[0], 0u, &data, NULL,
+        if (items[0].pending & ZX_CHANNEL_READABLE) {
+            status = zx_channel_read(channel[0], 0u, &data, NULL,
                                      num_bytes, 0, &num_bytes, NULL);
-            assert(status == MX_OK);
+            assert(status == ZX_OK);
             packets[0] += 1;
-        } else if (items[1].pending & MX_CHANNEL_READABLE) {
-            status = mx_channel_read(channel[1], 0u, &data, NULL,
+        } else if (items[1].pending & ZX_CHANNEL_READABLE) {
+            status = zx_channel_read(channel[1], 0u, &data, NULL,
                                      num_bytes, 0, &num_bytes, NULL);
-            assert(status == MX_OK);
+            assert(status == ZX_OK);
             packets[1] += 1;
         } else {
-            if (items[0].pending & MX_CHANNEL_PEER_CLOSED)
+            if (items[0].pending & ZX_CHANNEL_PEER_CLOSED)
                 closed[0] = true;
-            if (items[1].pending & MX_CHANNEL_PEER_CLOSED)
+            if (items[1].pending & ZX_CHANNEL_PEER_CLOSED)
                 closed[1] = true;
         }
     } while (!closed[0] || !closed[1]);
@@ -75,38 +75,38 @@
     return 0;
 }
 
-static mx_signals_t get_satisfied_signals(mx_handle_t handle) {
-    mx_signals_t pending = 0;
-    __UNUSED mx_status_t status = mx_object_wait_one(handle, 0u, 0u, &pending);
-    assert(status == MX_ERR_TIMED_OUT);
+static zx_signals_t get_satisfied_signals(zx_handle_t handle) {
+    zx_signals_t pending = 0;
+    __UNUSED zx_status_t status = zx_object_wait_one(handle, 0u, 0u, &pending);
+    assert(status == ZX_ERR_TIMED_OUT);
     return pending;
 }
 
 static bool channel_test(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t h[2];
-    status = mx_channel_create(0, &h[0], &h[1]);
-    ASSERT_EQ(status, MX_OK, "error in channel create");
+    zx_handle_t h[2];
+    status = zx_channel_create(0, &h[0], &h[1]);
+    ASSERT_EQ(status, ZX_OK, "error in channel create");
 
-    ASSERT_EQ(get_satisfied_signals(h[0]), MX_CHANNEL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    ASSERT_EQ(get_satisfied_signals(h[1]), MX_CHANNEL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(get_satisfied_signals(h[0]), ZX_CHANNEL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(get_satisfied_signals(h[1]), ZX_CHANNEL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
     _channel[0] = h[0];
     _channel[2] = h[1];
 
     static const uint32_t write_data = 0xdeadbeef;
-    status = mx_channel_write(_channel[0], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
-    ASSERT_EQ(status, MX_OK, "error in message write");
+    status = zx_channel_write(_channel[0], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
+    ASSERT_EQ(status, ZX_OK, "error in message write");
     ASSERT_EQ(get_satisfied_signals(
-        _channel[0]), MX_CHANNEL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+        _channel[0]), ZX_CHANNEL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
     ASSERT_EQ(get_satisfied_signals(
-        _channel[2]), MX_CHANNEL_READABLE | MX_CHANNEL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+        _channel[2]), ZX_CHANNEL_READABLE | ZX_CHANNEL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_channel_create(0, &h[0], &h[1]);
-    ASSERT_EQ(status, MX_OK, "error in channel create");
+    status = zx_channel_create(0, &h[0], &h[1]);
+    ASSERT_EQ(status, ZX_OK, "error in channel create");
 
     _channel[1] = h[0];
     _channel[3] = h[1];
@@ -114,118 +114,118 @@
     thrd_t thread;
     ASSERT_EQ(thrd_create(&thread, reader_thread, NULL), thrd_success, "error in thread create");
 
-    status = mx_channel_write(_channel[1], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
-    ASSERT_EQ(status, MX_OK, "error in message write");
+    status = zx_channel_write(_channel[1], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
+    ASSERT_EQ(status, ZX_OK, "error in message write");
 
     usleep(1);
 
-    status = mx_channel_write(_channel[0], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
-    ASSERT_EQ(status, MX_OK, "error in message write");
+    status = zx_channel_write(_channel[0], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
+    ASSERT_EQ(status, ZX_OK, "error in message write");
 
-    status = mx_channel_write(_channel[0], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
-    ASSERT_EQ(status, MX_OK, "error in message write");
+    status = zx_channel_write(_channel[0], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
+    ASSERT_EQ(status, ZX_OK, "error in message write");
 
     usleep(1);
 
-    status = mx_channel_write(_channel[1], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
-    ASSERT_EQ(status, MX_OK, "error in message write");
+    status = zx_channel_write(_channel[1], 0u, &write_data, sizeof(uint32_t), NULL, 0u);
+    ASSERT_EQ(status, ZX_OK, "error in message write");
 
-    mx_handle_close(_channel[1]);
+    zx_handle_close(_channel[1]);
     // The reader thread is reading from _channel[3], so we may or may not have "readable".
-    ASSERT_TRUE((get_satisfied_signals(_channel[3]) & MX_CHANNEL_PEER_CLOSED), "");
+    ASSERT_TRUE((get_satisfied_signals(_channel[3]) & ZX_CHANNEL_PEER_CLOSED), "");
 
     usleep(1);
-    mx_handle_close(_channel[0]);
+    zx_handle_close(_channel[0]);
 
     EXPECT_EQ(thrd_join(thread, NULL), thrd_success, "error in thread join");
 
     // Since the the other side of _channel[3] is closed, and the read thread read everything
     // from it, the only satisfied/satisfiable signals should be "peer closed".
     ASSERT_EQ(get_satisfied_signals(
-        _channel[3]), MX_CHANNEL_PEER_CLOSED | MX_SIGNAL_LAST_HANDLE, "");
+        _channel[3]), ZX_CHANNEL_PEER_CLOSED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    mx_handle_close(_channel[2]);
-    mx_handle_close(_channel[3]);
+    zx_handle_close(_channel[2]);
+    zx_handle_close(_channel[3]);
 
     END_TEST;
 }
 
 static bool channel_read_error_test(void) {
     BEGIN_TEST;
-    mx_handle_t channel[2];
-    mx_status_t status = mx_channel_create(0, &channel[0], &channel[1]);
-    ASSERT_EQ(status, MX_OK, "error in channel create");
+    zx_handle_t channel[2];
+    zx_status_t status = zx_channel_create(0, &channel[0], &channel[1]);
+    ASSERT_EQ(status, ZX_OK, "error in channel create");
 
     // Read from an empty channel.
-    status = mx_channel_read(channel[0], 0u, NULL, NULL, 0, 0, NULL, NULL);
-    ASSERT_EQ(status, MX_ERR_SHOULD_WAIT, "read on empty non-closed channel produced incorrect error");
+    status = zx_channel_read(channel[0], 0u, NULL, NULL, 0, 0, NULL, NULL);
+    ASSERT_EQ(status, ZX_ERR_SHOULD_WAIT, "read on empty non-closed channel produced incorrect error");
 
     char data = 'x';
-    status = mx_channel_write(channel[1], 0u, &data, 1u, NULL, 0u);
-    ASSERT_EQ(status, MX_OK, "write failed");
+    status = zx_channel_write(channel[1], 0u, &data, 1u, NULL, 0u);
+    ASSERT_EQ(status, ZX_OK, "write failed");
 
-    mx_handle_close(channel[1]);
+    zx_handle_close(channel[1]);
 
     // Read a message with the peer closed, should yield the message.
     char read_data = '\0';
     uint32_t read_data_size = 1u;
-    status = mx_channel_read(channel[0], 0u, &read_data, NULL,
+    status = zx_channel_read(channel[0], 0u, &read_data, NULL,
                              read_data_size, 0, &read_data_size, NULL);
-    ASSERT_EQ(status, MX_OK, "read failed with peer closed but message in the channel");
+    ASSERT_EQ(status, ZX_OK, "read failed with peer closed but message in the channel");
     ASSERT_EQ(read_data_size, 1u, "read returned incorrect number of bytes");
     ASSERT_EQ(read_data, 'x', "read returned incorrect data");
 
     // Read from an empty channel with a closed peer, should yield a channel closed error.
-    status = mx_channel_read(channel[0], 0u, NULL, NULL, 0, 0, NULL, NULL);
-    ASSERT_EQ(status, MX_ERR_PEER_CLOSED, "read on empty closed channel produced incorrect error");
+    status = zx_channel_read(channel[0], 0u, NULL, NULL, 0, 0, NULL, NULL);
+    ASSERT_EQ(status, ZX_ERR_PEER_CLOSED, "read on empty closed channel produced incorrect error");
 
     END_TEST;
 }
 
 static bool channel_close_test(void) {
     BEGIN_TEST;
-    mx_handle_t channel[2];
+    zx_handle_t channel[2];
 
     // Channels should gain PEER_CLOSED (and lose WRITABLE) if their peer is closed
-    ASSERT_EQ(mx_channel_create(0, &channel[0], &channel[1]), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(channel[1]), MX_OK, "");
+    ASSERT_EQ(zx_channel_create(0, &channel[0], &channel[1]), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(channel[1]), ZX_OK, "");
     ASSERT_EQ(get_satisfied_signals(
-        channel[0]), MX_CHANNEL_PEER_CLOSED | MX_SIGNAL_LAST_HANDLE, "");
-    ASSERT_EQ(mx_handle_close(channel[0]), MX_OK, "");
+        channel[0]), ZX_CHANNEL_PEER_CLOSED | ZX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(zx_handle_close(channel[0]), ZX_OK, "");
 
-    ASSERT_EQ(mx_channel_create(0, &channel[0], &channel[1]), MX_OK, "");
-    mx_handle_t channel1[2];
-    ASSERT_EQ(mx_channel_create(0, &channel1[0], &channel1[1]), MX_OK, "");
-    mx_handle_t channel2[2];
-    ASSERT_EQ(mx_channel_create(0, &channel2[0], &channel2[1]), MX_OK, "");
+    ASSERT_EQ(zx_channel_create(0, &channel[0], &channel[1]), ZX_OK, "");
+    zx_handle_t channel1[2];
+    ASSERT_EQ(zx_channel_create(0, &channel1[0], &channel1[1]), ZX_OK, "");
+    zx_handle_t channel2[2];
+    ASSERT_EQ(zx_channel_create(0, &channel2[0], &channel2[1]), ZX_OK, "");
 
     // Write channel1[0] to channel[0] (to be received by channel[1])
     // and channel2[0] to channel[1] (to be received by channel[0]).
-    ASSERT_EQ(mx_channel_write(channel[0], 0u, NULL, 0u, &channel1[0], 1u), MX_OK, "");
-    channel1[0] = MX_HANDLE_INVALID;
-    ASSERT_EQ(mx_channel_write(channel[1], 0u, NULL, 0u, &channel2[0], 1u), MX_OK, "");
-    channel2[0] = MX_HANDLE_INVALID;
+    ASSERT_EQ(zx_channel_write(channel[0], 0u, NULL, 0u, &channel1[0], 1u), ZX_OK, "");
+    channel1[0] = ZX_HANDLE_INVALID;
+    ASSERT_EQ(zx_channel_write(channel[1], 0u, NULL, 0u, &channel2[0], 1u), ZX_OK, "");
+    channel2[0] = ZX_HANDLE_INVALID;
 
     // Close channel[1]; the former channel1[0] should be closed, so channel1[1] should have
     // peer closed.
-    ASSERT_EQ(mx_handle_close(channel[1]), MX_OK, "");
-    channel[1] = MX_HANDLE_INVALID;
-    ASSERT_EQ(mx_object_wait_one(
-        channel1[1], MX_CHANNEL_PEER_CLOSED, MX_TIME_INFINITE, NULL), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(channel[1]), ZX_OK, "");
+    channel[1] = ZX_HANDLE_INVALID;
+    ASSERT_EQ(zx_object_wait_one(
+        channel1[1], ZX_CHANNEL_PEER_CLOSED, ZX_TIME_INFINITE, NULL), ZX_OK, "");
     ASSERT_EQ(get_satisfied_signals(
-        channel2[1]), MX_CHANNEL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+        channel2[1]), ZX_CHANNEL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
     // Close channel[0]; the former channel2[0] should be closed, so channel2[1]
     // should have peer closed.
-    ASSERT_EQ(mx_handle_close(channel[0]), MX_OK, "");
-    channel[0] = MX_HANDLE_INVALID;
+    ASSERT_EQ(zx_handle_close(channel[0]), ZX_OK, "");
+    channel[0] = ZX_HANDLE_INVALID;
     ASSERT_EQ(get_satisfied_signals(
-        channel1[1]), MX_CHANNEL_PEER_CLOSED | MX_SIGNAL_LAST_HANDLE, "");
-    ASSERT_EQ(mx_object_wait_one(
-        channel2[1], MX_CHANNEL_PEER_CLOSED, MX_TIME_INFINITE, NULL), MX_OK, "");
+        channel1[1]), ZX_CHANNEL_PEER_CLOSED | ZX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(zx_object_wait_one(
+        channel2[1], ZX_CHANNEL_PEER_CLOSED, ZX_TIME_INFINITE, NULL), ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(channel1[1]), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(channel2[1]), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(channel1[1]), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(channel2[1]), ZX_OK, "");
 
     END_TEST;
 }
@@ -233,26 +233,26 @@
 static bool channel_non_transferable(void) {
     BEGIN_TEST;
 
-    mx_handle_t channel[2];
-    ASSERT_EQ(mx_channel_create(0, &channel[0], &channel[1]), MX_OK, "");
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), 0, "failed to create event");
-    mx_info_handle_basic_t event_handle_info;
+    zx_handle_t channel[2];
+    ASSERT_EQ(zx_channel_create(0, &channel[0], &channel[1]), ZX_OK, "");
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), 0, "failed to create event");
+    zx_info_handle_basic_t event_handle_info;
 
-    mx_status_t status = mx_object_get_info(event, MX_INFO_HANDLE_BASIC, &event_handle_info,
+    zx_status_t status = zx_object_get_info(event, ZX_INFO_HANDLE_BASIC, &event_handle_info,
                                             sizeof(event_handle_info), NULL, NULL);
-    ASSERT_EQ(status, MX_OK, "failed to get event info");
-    mx_rights_t initial_event_rights = event_handle_info.rights;
-    mx_handle_t non_transferable_event;
-    mx_handle_duplicate(
-        event, initial_event_rights & ~MX_RIGHT_TRANSFER, &non_transferable_event);
+    ASSERT_EQ(status, ZX_OK, "failed to get event info");
+    zx_rights_t initial_event_rights = event_handle_info.rights;
+    zx_handle_t non_transferable_event;
+    zx_handle_duplicate(
+        event, initial_event_rights & ~ZX_RIGHT_TRANSFER, &non_transferable_event);
 
-    mx_status_t write_result = mx_channel_write(
+    zx_status_t write_result = zx_channel_write(
         channel[0], 0u, NULL, 0, &non_transferable_event, 1u);
-    EXPECT_EQ(write_result, MX_ERR_ACCESS_DENIED, "message_write should fail with ACCESS_DENIED");
+    EXPECT_EQ(write_result, ZX_ERR_ACCESS_DENIED, "message_write should fail with ACCESS_DENIED");
 
-    mx_status_t close_result = mx_handle_close(non_transferable_event);
-    EXPECT_EQ(close_result, MX_OK, "");
+    zx_status_t close_result = zx_handle_close(non_transferable_event);
+    EXPECT_EQ(close_result, ZX_OK, "");
 
     END_TEST;
 }
@@ -260,22 +260,22 @@
 static bool channel_duplicate_handles(void) {
     BEGIN_TEST;
 
-    mx_handle_t channel[2];
-    ASSERT_EQ(mx_channel_create(0, &channel[0], &channel[1]), MX_OK, "");
+    zx_handle_t channel[2];
+    ASSERT_EQ(zx_channel_create(0, &channel[0], &channel[1]), ZX_OK, "");
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), 0, "failed to create event");
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), 0, "failed to create event");
 
-    mx_handle_t dup_handles[2] = { event, event };
-    mx_status_t write_result = mx_channel_write(channel[0], 0u, NULL, 0, dup_handles, 2u);
-    EXPECT_EQ(write_result, MX_ERR_INVALID_ARGS, "message_write should fail with MX_ERR_INVALID_ARGS");
+    zx_handle_t dup_handles[2] = { event, event };
+    zx_status_t write_result = zx_channel_write(channel[0], 0u, NULL, 0, dup_handles, 2u);
+    EXPECT_EQ(write_result, ZX_ERR_INVALID_ARGS, "message_write should fail with ZX_ERR_INVALID_ARGS");
 
-    mx_status_t close_result = mx_handle_close(event);
-    EXPECT_EQ(close_result, MX_OK, "");
-    close_result = mx_handle_close(channel[0]);
-    EXPECT_EQ(close_result, MX_OK, "");
-    close_result = mx_handle_close(channel[1]);
-    EXPECT_EQ(close_result, MX_OK, "");
+    zx_status_t close_result = zx_handle_close(event);
+    EXPECT_EQ(close_result, ZX_OK, "");
+    close_result = zx_handle_close(channel[0]);
+    EXPECT_EQ(close_result, ZX_OK, "");
+    close_result = zx_handle_close(channel[1]);
+    EXPECT_EQ(close_result, ZX_OK, "");
 
     END_TEST;
 }
@@ -291,9 +291,9 @@
     for (uint32_t i = 0; i < multithread_read_num_messages / 2; i++) {
         uint32_t msg = MSG_UNSET;
         uint32_t msg_size = sizeof(msg);
-        mx_status_t status = mx_channel_read(_channel[0], 0u, &msg, NULL,
+        zx_status_t status = zx_channel_read(_channel[0], 0u, &msg, NULL,
                                              msg_size, 0, &msg_size, NULL);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             ((uint32_t*)arg)[i] = MSG_READ_FAILED;
             break;
         }
@@ -315,11 +315,11 @@
     BEGIN_TEST;
 
     // We'll write from channel[0] and read from channel[1].
-    mx_handle_t channel[2];
-    ASSERT_EQ(mx_channel_create(0, &channel[0], &channel[1]), MX_OK, "");
+    zx_handle_t channel[2];
+    ASSERT_EQ(zx_channel_create(0, &channel[0], &channel[1]), ZX_OK, "");
 
     for (uint32_t i = 0; i < multithread_read_num_messages; i++)
-        ASSERT_EQ(mx_channel_write(channel[0], 0, &i, sizeof(i), NULL, 0), MX_OK, "");
+        ASSERT_EQ(zx_channel_write(channel[0], 0, &i, sizeof(i), NULL, 0), ZX_OK, "");
 
     _channel[0] = channel[1];
 
@@ -340,8 +340,8 @@
     EXPECT_EQ(thrd_join(reader0, NULL), thrd_success, "");
     EXPECT_EQ(thrd_join(reader1, NULL), thrd_success, "");
 
-    EXPECT_EQ(mx_handle_close(channel[0]), MX_OK, "");
-    EXPECT_EQ(mx_handle_close(channel[1]), MX_OK, "");
+    EXPECT_EQ(zx_handle_close(channel[0]), ZX_OK, "");
+    EXPECT_EQ(zx_handle_close(channel[1]), ZX_OK, "");
 
     // Check data.
     bool* received_flags = calloc(multithread_read_num_messages, sizeof(bool));
@@ -367,90 +367,90 @@
     free(received1);
     free(received_flags);
 
-    _channel[0] = MX_HANDLE_INVALID;
+    _channel[0] = ZX_HANDLE_INVALID;
 
     END_TEST;
 }
 
 // |handle| must be valid (and duplicatable and transferable) if |num_handles > 0|.
-static void write_test_message(mx_handle_t channel,
-                               mx_handle_t handle,
+static void write_test_message(zx_handle_t channel,
+                               zx_handle_t handle,
                                uint32_t size,
                                uint32_t num_handles) {
     static const char data[1000] = {};
-    mx_handle_t handles[10] = {};
+    zx_handle_t handles[10] = {};
 
     assert(size <= sizeof(data));
     assert(num_handles <= countof(handles));
 
     for (uint32_t i = 0; i < num_handles; i++) {
-        mx_status_t status = mx_handle_duplicate(handle, MX_RIGHT_TRANSFER, &handles[i]);
-        assert(status == MX_OK);
+        zx_status_t status = zx_handle_duplicate(handle, ZX_RIGHT_TRANSFER, &handles[i]);
+        assert(status == ZX_OK);
     }
 
-    __UNUSED mx_status_t status = mx_channel_write(channel, 0u, data, size, handles, num_handles);
-    assert(status == MX_OK);
+    __UNUSED zx_status_t status = zx_channel_write(channel, 0u, data, size, handles, num_handles);
+    assert(status == ZX_OK);
 }
 
 static bool channel_may_discard(void) {
     BEGIN_TEST;
 
-    mx_handle_t channel[2];
-    ASSERT_EQ(mx_channel_create(0, &channel[0], &channel[1]), MX_OK, "");
+    zx_handle_t channel[2];
+    ASSERT_EQ(zx_channel_create(0, &channel[0], &channel[1]), ZX_OK, "");
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), 0, "failed to create event");
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), 0, "failed to create event");
 
-    EXPECT_EQ(mx_object_wait_one(channel[1], MX_CHANNEL_READABLE, 0u, NULL), MX_ERR_TIMED_OUT, "");
+    EXPECT_EQ(zx_object_wait_one(channel[1], ZX_CHANNEL_READABLE, 0u, NULL), ZX_ERR_TIMED_OUT, "");
 
     write_test_message(channel[0], event, 10u, 0u);
-    EXPECT_EQ(mx_channel_read(channel[1], MX_CHANNEL_READ_MAY_DISCARD, NULL, NULL, 0, 0, NULL, NULL),
-              MX_ERR_BUFFER_TOO_SMALL, "");
+    EXPECT_EQ(zx_channel_read(channel[1], ZX_CHANNEL_READ_MAY_DISCARD, NULL, NULL, 0, 0, NULL, NULL),
+              ZX_ERR_BUFFER_TOO_SMALL, "");
 
-    EXPECT_EQ(mx_object_wait_one(channel[1], MX_CHANNEL_READABLE, 0u, NULL), MX_ERR_TIMED_OUT, "");
+    EXPECT_EQ(zx_object_wait_one(channel[1], ZX_CHANNEL_READABLE, 0u, NULL), ZX_ERR_TIMED_OUT, "");
 
     char data[1000];
     uint32_t size;
 
     write_test_message(channel[0], event, 100u, 0u);
     size = 10u;
-    EXPECT_EQ(mx_channel_read(channel[1], MX_CHANNEL_READ_MAY_DISCARD, data, NULL, size, 0, &size, NULL),
-              MX_ERR_BUFFER_TOO_SMALL, "");
+    EXPECT_EQ(zx_channel_read(channel[1], ZX_CHANNEL_READ_MAY_DISCARD, data, NULL, size, 0, &size, NULL),
+              ZX_ERR_BUFFER_TOO_SMALL, "");
     EXPECT_EQ(size, 100u, "wrong size");
 
-    EXPECT_EQ(mx_object_wait_one(channel[1], MX_CHANNEL_READABLE, 0u, NULL), MX_ERR_TIMED_OUT, "");
+    EXPECT_EQ(zx_object_wait_one(channel[1], ZX_CHANNEL_READABLE, 0u, NULL), ZX_ERR_TIMED_OUT, "");
 
-    mx_handle_t handles[10];
+    zx_handle_t handles[10];
     uint32_t num_handles;
 
     write_test_message(channel[0], event, 0u, 5u);
     size = 10u;
     num_handles = 1u;
-    EXPECT_EQ(mx_channel_read(channel[1], MX_CHANNEL_READ_MAY_DISCARD, data, handles,
+    EXPECT_EQ(zx_channel_read(channel[1], ZX_CHANNEL_READ_MAY_DISCARD, data, handles,
                               size, num_handles, &size, &num_handles),
-              MX_ERR_BUFFER_TOO_SMALL, "");
+              ZX_ERR_BUFFER_TOO_SMALL, "");
     EXPECT_EQ(size, 0u, "wrong size");
     EXPECT_EQ(num_handles, 5u, "wrong number of handles");
 
-    EXPECT_EQ(mx_object_wait_one(channel[1], MX_CHANNEL_READABLE, 0u, NULL), MX_ERR_TIMED_OUT, "");
+    EXPECT_EQ(zx_object_wait_one(channel[1], ZX_CHANNEL_READABLE, 0u, NULL), ZX_ERR_TIMED_OUT, "");
 
     write_test_message(channel[0], event, 100u, 5u);
     size = 10u;
     num_handles = 1u;
-    EXPECT_EQ(mx_channel_read(channel[1], MX_CHANNEL_READ_MAY_DISCARD, data, handles,
+    EXPECT_EQ(zx_channel_read(channel[1], ZX_CHANNEL_READ_MAY_DISCARD, data, handles,
                               size, num_handles, &size, &num_handles),
-              MX_ERR_BUFFER_TOO_SMALL, "");
+              ZX_ERR_BUFFER_TOO_SMALL, "");
     EXPECT_EQ(size, 100u, "wrong size");
     EXPECT_EQ(num_handles, 5u, "wrong number of handles");
 
-    EXPECT_EQ(mx_object_wait_one(channel[1], MX_CHANNEL_READABLE, 0u, NULL), MX_ERR_TIMED_OUT, "");
+    EXPECT_EQ(zx_object_wait_one(channel[1], ZX_CHANNEL_READABLE, 0u, NULL), ZX_ERR_TIMED_OUT, "");
 
-    mx_status_t close_result = mx_handle_close(event);
-    EXPECT_EQ(close_result, MX_OK, "");
-    close_result = mx_handle_close(channel[0]);
-    EXPECT_EQ(close_result, MX_OK, "");
-    close_result = mx_handle_close(channel[1]);
-    EXPECT_EQ(close_result, MX_OK, "");
+    zx_status_t close_result = zx_handle_close(event);
+    EXPECT_EQ(close_result, ZX_OK, "");
+    close_result = zx_handle_close(channel[0]);
+    EXPECT_EQ(close_result, ZX_OK, "");
+    close_result = zx_handle_close(channel[1]);
+    EXPECT_EQ(close_result, ZX_OK, "");
 
     END_TEST;
 }
@@ -463,16 +463,16 @@
 // we use txid_t for cmd here so that the test
 // works with both 32bit and 64bit txids
 typedef struct {
-    mx_txid_t txid;
-    mx_txid_t cmd;
+    zx_txid_t txid;
+    zx_txid_t cmd;
     uint32_t bit;
     unsigned action;
-    mx_status_t expect;
-    mx_status_t expect_rs;
+    zx_status_t expect;
+    zx_status_t expect_rs;
     const char* name;
     const char* err;
     int val;
-    mx_handle_t h;
+    zx_handle_t h;
     thrd_t t;
 } ccargs_t;
 
@@ -485,15 +485,15 @@
 
 static int call_client(void* _args) {
     ccargs_t* ccargs = _args;
-    mx_channel_call_args_t args;
+    zx_channel_call_args_t args;
 
-    mx_txid_t data[2];
-    mx_handle_t txhandle = 0;
-    mx_handle_t rxhandle = 0;
+    zx_txid_t data[2];
+    zx_handle_t txhandle = 0;
+    zx_handle_t rxhandle = 0;
 
-    mx_status_t r;
+    zx_status_t r;
     if (ccargs->action & CLI_SEND_HANDLE) {
-        if ((r = mx_event_create(0, &txhandle)) != MX_OK) {
+        if ((r = zx_event_create(0, &txhandle)) != ZX_OK) {
             ccargs->err = "failed to create event";
             goto done;
         }
@@ -511,26 +511,26 @@
     uint32_t act_bytes = 0xffffffff;
     uint32_t act_handles = 0xffffffff;
 
-    mx_time_t deadline = (ccargs->action & CLI_SHORT_WAIT) ? mx_deadline_after(MX_MSEC(250)) :
-            MX_TIME_INFINITE;
-    mx_status_t rs = MX_OK;
-    if ((r = mx_channel_call(ccargs->h, 0, deadline, &args, &act_bytes, &act_handles, &rs)) != ccargs->expect) {
+    zx_time_t deadline = (ccargs->action & CLI_SHORT_WAIT) ? zx_deadline_after(ZX_MSEC(250)) :
+            ZX_TIME_INFINITE;
+    zx_status_t rs = ZX_OK;
+    if ((r = zx_channel_call(ccargs->h, 0, deadline, &args, &act_bytes, &act_handles, &rs)) != ccargs->expect) {
         ccargs->err = "channel call returned";
         ccargs->val = r;
     }
     if (txhandle && (r < 0)) {
-        mx_handle_close(txhandle);
+        zx_handle_close(txhandle);
     }
     if (rxhandle) {
-        mx_handle_close(rxhandle);
+        zx_handle_close(rxhandle);
     }
-    if (r == MX_ERR_CALL_FAILED) {
+    if (r == ZX_ERR_CALL_FAILED) {
         if (ccargs->expect_rs && (ccargs->expect_rs != rs)) {
             ccargs->err = "read_status not what was expected";
             ccargs->val = ccargs->expect_rs;
         }
     }
-    if (r == MX_OK) {
+    if (r == ZX_OK) {
         if (act_bytes != sizeof(data)) {
             ccargs->err = "expected 8 bytes";
             ccargs->val = act_bytes;
@@ -557,13 +557,13 @@
     {
         .name = "too large reply",
         .action = SRV_SEND_DATA,
-        .expect = MX_ERR_CALL_FAILED,
-        .expect_rs = MX_ERR_BUFFER_TOO_SMALL,
+        .expect = ZX_ERR_CALL_FAILED,
+        .expect_rs = ZX_ERR_BUFFER_TOO_SMALL,
     },
     {
         .name = "no reply",
         .action = SRV_DISCARD | CLI_SHORT_WAIT,
-        .expect = MX_ERR_TIMED_OUT,
+        .expect = ZX_ERR_TIMED_OUT,
     },
     {
         .name = "reply handle",
@@ -572,8 +572,8 @@
     {
         .name = "unwanted reply handle",
         .action = SRV_SEND_HANDLE,
-        .expect = MX_ERR_CALL_FAILED,
-        .expect_rs = MX_ERR_BUFFER_TOO_SMALL,
+        .expect = ZX_ERR_CALL_FAILED,
+        .expect_rs = ZX_ERR_BUFFER_TOO_SMALL,
     },
     {
         .name = "send-handle",
@@ -598,24 +598,24 @@
 };
 
 static int call_server(void* ptr) {
-    mx_handle_t h = (mx_handle_t) (uintptr_t) ptr;
+    zx_handle_t h = (zx_handle_t) (uintptr_t) ptr;
 
     ccargs_t msg[countof(ccargs)];
     memset(msg, 0, sizeof(msg));
 
     // received the expected number of messages
     for (unsigned n = 0; n < countof(ccargs); n++) {
-        mx_object_wait_one(h, MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED, MX_TIME_INFINITE, NULL);
+        zx_object_wait_one(h, ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, ZX_TIME_INFINITE, NULL);
 
         uint32_t bytes = sizeof(msg[0]);
         uint32_t handles = 1;
-        mx_handle_t handle = 0;
-        if (mx_channel_read(h, 0, &msg[n], &handle, bytes, handles, &bytes, &handles) != MX_OK) {
+        zx_handle_t handle = 0;
+        if (zx_channel_read(h, 0, &msg[n], &handle, bytes, handles, &bytes, &handles) != ZX_OK) {
             fprintf(stderr, "call_server() read failed\n");
             break;
         }
         if (handle) {
-            mx_handle_close(handle);
+            zx_handle_close(handle);
         }
     }
 
@@ -627,19 +627,19 @@
             continue;
         }
 
-        mx_txid_t data[4];
+        zx_txid_t data[4];
         data[0] = m->txid;
         data[1] = m->txid * 31337;
         data[2] = 0x22222222;
         data[3] = 0x33333333;
 
-        uint32_t bytes = sizeof(mx_txid_t) * ((m->action & SRV_SEND_DATA) ? 4 : 2);
+        uint32_t bytes = sizeof(zx_txid_t) * ((m->action & SRV_SEND_DATA) ? 4 : 2);
         uint32_t handles = (m->action & SRV_SEND_HANDLE) ? 1 : 0;
-        mx_handle_t handle = 0;
+        zx_handle_t handle = 0;
         if (handles) {
-            mx_event_create(0, &handle);
+            zx_event_create(0, &handle);
         }
-        if (mx_channel_write(h, 0, data, bytes, &handle, handles) != MX_OK) {
+        if (zx_channel_write(h, 0, data, bytes, &handle, handles) != ZX_OK) {
             fprintf(stderr, "call_server() write failed\n");
             break;
         }
@@ -653,8 +653,8 @@
     mtx_init(&call_test_lock, mtx_plain);
     cnd_init(&call_test_cvar);
 
-    mx_handle_t cli, srv;
-    ASSERT_EQ(mx_channel_create(0, &cli, &srv), MX_OK, "");
+    zx_handle_t cli, srv;
+    ASSERT_EQ(zx_channel_create(0, &cli, &srv), ZX_OK, "");
 
     // start test server
     thrd_t srvt;
@@ -701,46 +701,46 @@
     }
     mtx_unlock(&call_test_lock);
 
-    mx_handle_close(cli);
-    mx_handle_close(srv);
+    zx_handle_close(cli);
+    zx_handle_close(srv);
     END_TEST;
 }
 
-static bool create_and_nest(mx_handle_t out, mx_handle_t* end, size_t n) {
+static bool create_and_nest(zx_handle_t out, zx_handle_t* end, size_t n) {
     BEGIN_TEST;
 
-    mx_handle_t channel[2];
+    zx_handle_t channel[2];
     if (n == 1) {
-        ASSERT_EQ(mx_channel_create(0, &channel[0], end), MX_OK, "");
-        ASSERT_EQ(mx_channel_write(out, 0u, NULL, 0u, channel, 1u), MX_OK, "");
+        ASSERT_EQ(zx_channel_create(0, &channel[0], end), ZX_OK, "");
+        ASSERT_EQ(zx_channel_write(out, 0u, NULL, 0u, channel, 1u), ZX_OK, "");
         return true;
     }
 
-    ASSERT_EQ(mx_channel_create(0, &channel[0], &channel[1]), MX_OK, "");
+    ASSERT_EQ(zx_channel_create(0, &channel[0], &channel[1]), ZX_OK, "");
     ASSERT_TRUE(create_and_nest(channel[0], end, n - 1), "");
-    ASSERT_EQ(mx_channel_write(out, 0u, NULL, 0u, channel, 2u), MX_OK, "");
+    ASSERT_EQ(zx_channel_write(out, 0u, NULL, 0u, channel, 2u), ZX_OK, "");
 
     END_TEST;
 }
 
 static int call_server2(void* ptr) {
-    mx_handle_t h = (mx_handle_t) (uintptr_t) ptr;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(250)));
-    mx_handle_close(h);
+    zx_handle_t h = (zx_handle_t) (uintptr_t) ptr;
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(250)));
+    zx_handle_close(h);
     return 0;
 }
 
 static bool channel_call2(void) {
     BEGIN_TEST;
 
-    mx_handle_t cli, srv;
-    ASSERT_EQ(mx_channel_create(0, &cli, &srv), MX_OK, "");
+    zx_handle_t cli, srv;
+    ASSERT_EQ(zx_channel_create(0, &cli, &srv), ZX_OK, "");
 
     thrd_t t;
     ASSERT_EQ(thrd_create(&t, call_server2, (void*) (uintptr_t) srv), thrd_success, "");
 
     char msg[8] = { 0, };
-    mx_channel_call_args_t args = {
+    zx_channel_call_args_t args = {
         .wr_bytes = msg,
         .wr_handles = NULL,
         .wr_num_bytes = sizeof(msg),
@@ -754,20 +754,20 @@
     uint32_t act_bytes = 0xffffffff;
     uint32_t act_handles = 0xffffffff;
 
-    mx_status_t rs = MX_OK;
-    mx_status_t r = mx_channel_call(cli, 0, mx_deadline_after(MX_MSEC(1000)), &args, &act_bytes,
+    zx_status_t rs = ZX_OK;
+    zx_status_t r = zx_channel_call(cli, 0, zx_deadline_after(ZX_MSEC(1000)), &args, &act_bytes,
                                     &act_handles, &rs);
 
-    mx_handle_close(cli);
+    zx_handle_close(cli);
 
-    EXPECT_EQ(r, MX_ERR_CALL_FAILED, "");
-    EXPECT_EQ(rs, MX_ERR_PEER_CLOSED, "");
+    EXPECT_EQ(r, ZX_ERR_CALL_FAILED, "");
+    EXPECT_EQ(rs, ZX_ERR_PEER_CLOSED, "");
 
     END_TEST;
 }
 
-// SYSCALL_mx_channel_call_finish is an internal system call used in the
-// vDSO's implementation of mx_channel_call.  It's not part of the ABI and
+// SYSCALL_zx_channel_call_finish is an internal system call used in the
+// vDSO's implementation of zx_channel_call.  It's not part of the ABI and
 // so it's not exported from the vDSO.  It's hard to test the kernel's
 // invariants without calling this directly.  So use some chicanery to
 // find its address in the vDSO despite it not being public.
@@ -776,17 +776,17 @@
 // the offsets of the internal functions.  So take a public vDSO function,
 // subtract its offset to discover the vDSO base (could do this other ways,
 // but this is the simplest), and then add the offset of the internal
-// SYSCALL_mx_channel_call_finish function we want to call.
+// SYSCALL_zx_channel_call_finish function we want to call.
 #include "vdso-code.h"
-static mx_status_t mx_channel_call_finish(mx_time_t deadline,
-                                          const mx_channel_call_args_t* args,
+static zx_status_t zx_channel_call_finish(zx_time_t deadline,
+                                          const zx_channel_call_args_t* args,
                                           uint32_t* actual_bytes,
                                           uint32_t* actual_handles,
-                                          mx_status_t* read_status) {
+                                          zx_status_t* read_status) {
     uintptr_t vdso_base =
-        (uintptr_t)&mx_handle_close - VDSO_SYSCALL_mx_handle_close;
-    uintptr_t fnptr = vdso_base + VDSO_SYSCALL_mx_channel_call_finish;
-    return (*(__typeof(mx_channel_call_finish)*)fnptr)(
+        (uintptr_t)&zx_handle_close - VDSO_SYSCALL_zx_handle_close;
+    uintptr_t fnptr = vdso_base + VDSO_SYSCALL_zx_channel_call_finish;
+    return (*(__typeof(zx_channel_call_finish)*)fnptr)(
         deadline, args, actual_bytes, actual_handles, read_status);
 }
 
@@ -794,7 +794,7 @@
     BEGIN_TEST;
 
     char msg[8] = { 0, };
-    mx_channel_call_args_t args = {
+    zx_channel_call_args_t args = {
         .wr_bytes = msg,
         .wr_handles = NULL,
         .wr_num_bytes = sizeof(msg),
@@ -809,31 +809,31 @@
     uint32_t act_handles = 0xffffffff;
 
     // Call channel_call_finish without having had a channel call interrupted
-    mx_status_t rs = MX_OK;
-    mx_status_t r = mx_channel_call_finish(mx_deadline_after(MX_MSEC(1000)), &args, &act_bytes,
+    zx_status_t rs = ZX_OK;
+    zx_status_t r = zx_channel_call_finish(zx_deadline_after(ZX_MSEC(1000)), &args, &act_bytes,
                                            &act_handles, &rs);
 
-    EXPECT_EQ(r, MX_ERR_BAD_STATE, "");
-    EXPECT_EQ(rs, MX_OK, ""); // The syscall leaves this unchanged.
+    EXPECT_EQ(r, ZX_ERR_BAD_STATE, "");
+    EXPECT_EQ(rs, ZX_OK, ""); // The syscall leaves this unchanged.
 
     END_TEST;
 }
 
 static bool channel_nest(void) {
     BEGIN_TEST;
-    mx_handle_t channel[2];
+    zx_handle_t channel[2];
 
-    ASSERT_EQ(mx_channel_create(0, &channel[0], &channel[1]), MX_OK, "");
+    ASSERT_EQ(zx_channel_create(0, &channel[0], &channel[1]), ZX_OK, "");
 
-    mx_handle_t end;
+    zx_handle_t end;
     ASSERT_TRUE(create_and_nest(channel[0], &end, 10), "");
-    EXPECT_EQ(mx_handle_close(channel[1]), MX_OK, "");
-    EXPECT_EQ(mx_object_wait_one(channel[0], MX_CHANNEL_PEER_CLOSED, MX_TIME_INFINITE, NULL), MX_OK, "");
+    EXPECT_EQ(zx_handle_close(channel[1]), ZX_OK, "");
+    EXPECT_EQ(zx_object_wait_one(channel[0], ZX_CHANNEL_PEER_CLOSED, ZX_TIME_INFINITE, NULL), ZX_OK, "");
 
-    EXPECT_EQ(mx_object_wait_one(end, MX_CHANNEL_PEER_CLOSED, MX_TIME_INFINITE, NULL), MX_OK, "");
-    EXPECT_EQ(mx_handle_close(end), MX_OK, "");
+    EXPECT_EQ(zx_object_wait_one(end, ZX_CHANNEL_PEER_CLOSED, ZX_TIME_INFINITE, NULL), ZX_OK, "");
+    EXPECT_EQ(zx_handle_close(end), ZX_OK, "");
 
-    EXPECT_EQ(mx_handle_close(channel[0]), MX_OK, "");
+    EXPECT_EQ(zx_handle_close(channel[0]), ZX_OK, "");
 
     END_TEST;
 }
@@ -844,13 +844,13 @@
 static bool channel_disallow_write_to_self(void) {
     BEGIN_TEST;
 
-    mx_handle_t channel[2];
-    ASSERT_EQ(mx_channel_create(0, &channel[0], &channel[1]), MX_OK, "");
-    EXPECT_EQ(mx_channel_write(channel[0], 0, NULL, 0, &channel[0], 1),
-              MX_ERR_NOT_SUPPORTED, "");
+    zx_handle_t channel[2];
+    ASSERT_EQ(zx_channel_create(0, &channel[0], &channel[1]), ZX_OK, "");
+    EXPECT_EQ(zx_channel_write(channel[0], 0, NULL, 0, &channel[0], 1),
+              ZX_ERR_NOT_SUPPORTED, "");
     // Clean up.
-    EXPECT_EQ(mx_handle_close(channel[0]), MX_OK, "");
-    EXPECT_EQ(mx_handle_close(channel[1]), MX_OK, "");
+    EXPECT_EQ(zx_handle_close(channel[0]), ZX_OK, "");
+    EXPECT_EQ(zx_handle_close(channel[1]), ZX_OK, "");
 
     END_TEST;
 }
diff --git a/system/utest/core/channel/rules.mk b/system/utest/core/channel/rules.mk
index 25a3a7d..9b00f11 100644
--- a/system/utest/core/channel/rules.mk
+++ b/system/utest/core/channel/rules.mk
@@ -16,7 +16,7 @@
 MODULE_NAME := channel-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 # We need a header file generated by kernel/lib/vdso/rules.mk.
 MODULE_COMPILEFLAGS += -I$(BUILDDIR)/kernel/lib/vdso
diff --git a/system/utest/core/cookies/cookies.c b/system/utest/core/cookies/cookies.c
index 209a85f..05f77a0 100644
--- a/system/utest/core/cookies/cookies.c
+++ b/system/utest/core/cookies/cookies.c
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/process.h>
-#include <magenta/types.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/types.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 #include <stdio.h>
 
@@ -16,46 +16,46 @@
     static const uint64_t magic2 = 0x1122334455667788;
 
     // create some objects
-    mx_handle_t scope1, scope2, token;
-    ASSERT_EQ(mx_event_create(0, &scope1), MX_OK, "");
-    ASSERT_EQ(mx_event_create(0, &scope2), MX_OK, "");
-    ASSERT_EQ(mx_event_create(0, &token), MX_OK, "");
+    zx_handle_t scope1, scope2, token;
+    ASSERT_EQ(zx_event_create(0, &scope1), ZX_OK, "");
+    ASSERT_EQ(zx_event_create(0, &scope2), ZX_OK, "");
+    ASSERT_EQ(zx_event_create(0, &token), ZX_OK, "");
 
     // cookies are not readable before being set
     uint64_t cookie;
-    ASSERT_EQ(mx_object_get_cookie(token, scope1, &cookie), MX_ERR_ACCESS_DENIED, "");
+    ASSERT_EQ(zx_object_get_cookie(token, scope1, &cookie), ZX_ERR_ACCESS_DENIED, "");
 
     // cookies may be read back using the scope they were set with
-    ASSERT_EQ(mx_object_set_cookie(token, scope1, magic1), MX_OK, "");
-    ASSERT_EQ(mx_object_get_cookie(token, scope1, &cookie), MX_OK, "");
+    ASSERT_EQ(zx_object_set_cookie(token, scope1, magic1), ZX_OK, "");
+    ASSERT_EQ(zx_object_get_cookie(token, scope1, &cookie), ZX_OK, "");
     ASSERT_EQ(cookie, magic1, "");
 
     // cookies are only settable on objects that support them
-    ASSERT_EQ(mx_object_set_cookie(mx_process_self(), scope1, magic1), MX_ERR_NOT_SUPPORTED, "");
+    ASSERT_EQ(zx_object_set_cookie(zx_process_self(), scope1, magic1), ZX_ERR_NOT_SUPPORTED, "");
 
     // cookies are only gettable on objects that support them
-    ASSERT_EQ(mx_object_get_cookie(mx_process_self(), scope1, &cookie), MX_ERR_NOT_SUPPORTED, "");
+    ASSERT_EQ(zx_object_get_cookie(zx_process_self(), scope1, &cookie), ZX_ERR_NOT_SUPPORTED, "");
 
     // cookies are not readable with a different scope
-    ASSERT_EQ(mx_object_get_cookie(token, scope2, &cookie), MX_ERR_ACCESS_DENIED, "");
+    ASSERT_EQ(zx_object_get_cookie(token, scope2, &cookie), ZX_ERR_ACCESS_DENIED, "");
 
     // cookies are not writeable with a different scope
-    ASSERT_EQ(mx_object_set_cookie(token, scope2, magic1), MX_ERR_ACCESS_DENIED, "");
+    ASSERT_EQ(zx_object_set_cookie(token, scope2, magic1), ZX_ERR_ACCESS_DENIED, "");
 
     // cookies are modifyable with the original scope
-    ASSERT_EQ(mx_object_set_cookie(token, scope1, magic2), MX_OK, "");
-    ASSERT_EQ(mx_object_get_cookie(token, scope1, &cookie), MX_OK, "");
+    ASSERT_EQ(zx_object_set_cookie(token, scope1, magic2), ZX_OK, "");
+    ASSERT_EQ(zx_object_get_cookie(token, scope1, &cookie), ZX_OK, "");
     ASSERT_EQ(cookie, magic2, "");
 
     // bogus handles
-    ASSERT_EQ(mx_object_get_cookie(token, MX_HANDLE_INVALID, &cookie), MX_ERR_BAD_HANDLE, "");
-    ASSERT_EQ(mx_object_get_cookie(MX_HANDLE_INVALID, scope1, &cookie), MX_ERR_BAD_HANDLE, "");
-    ASSERT_EQ(mx_object_set_cookie(token, MX_HANDLE_INVALID, magic1), MX_ERR_BAD_HANDLE, "");
-    ASSERT_EQ(mx_object_set_cookie(MX_HANDLE_INVALID, scope1, magic1), MX_ERR_BAD_HANDLE, "");
+    ASSERT_EQ(zx_object_get_cookie(token, ZX_HANDLE_INVALID, &cookie), ZX_ERR_BAD_HANDLE, "");
+    ASSERT_EQ(zx_object_get_cookie(ZX_HANDLE_INVALID, scope1, &cookie), ZX_ERR_BAD_HANDLE, "");
+    ASSERT_EQ(zx_object_set_cookie(token, ZX_HANDLE_INVALID, magic1), ZX_ERR_BAD_HANDLE, "");
+    ASSERT_EQ(zx_object_set_cookie(ZX_HANDLE_INVALID, scope1, magic1), ZX_ERR_BAD_HANDLE, "");
 
-    ASSERT_EQ(mx_handle_close(token), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(scope1), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(scope2), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(token), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(scope1), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(scope2), ZX_OK, "");
 
     END_TEST;
 }
@@ -68,29 +68,29 @@
     static const uint64_t magic2 = 0x1122334455667788;
 
     // create some objects
-    mx_handle_t scope1, side1, side2;
+    zx_handle_t scope1, side1, side2;
 
-    ASSERT_EQ(mx_event_create(0, &scope1), MX_OK, "");
-    ASSERT_EQ(mx_eventpair_create(0, &side1, &side2), MX_OK, "");
+    ASSERT_EQ(zx_event_create(0, &scope1), ZX_OK, "");
+    ASSERT_EQ(zx_eventpair_create(0, &side1, &side2), ZX_OK, "");
 
     uint64_t cookie;
-    ASSERT_EQ(mx_object_set_cookie(side1, scope1, magic1), MX_OK, "");
-    ASSERT_EQ(mx_object_get_cookie(side1, scope1, &cookie), MX_OK, "");
+    ASSERT_EQ(zx_object_set_cookie(side1, scope1, magic1), ZX_OK, "");
+    ASSERT_EQ(zx_object_get_cookie(side1, scope1, &cookie), ZX_OK, "");
     ASSERT_EQ(cookie, magic1, "");
 
-    mx_handle_close(side2);
-    ASSERT_EQ(mx_object_get_cookie(side1, scope1, &cookie), MX_ERR_ACCESS_DENIED, "");
-    mx_handle_close(side1);
+    zx_handle_close(side2);
+    ASSERT_EQ(zx_object_get_cookie(side1, scope1, &cookie), ZX_ERR_ACCESS_DENIED, "");
+    zx_handle_close(side1);
 
     // Make sure it works from both sides.
-    ASSERT_EQ(mx_eventpair_create(0, &side1, &side2), MX_OK, "");
-    ASSERT_EQ(mx_object_set_cookie(side2, scope1, magic2), MX_OK, "");
-    ASSERT_EQ(mx_object_get_cookie(side2, scope1, &cookie), MX_OK, "");
+    ASSERT_EQ(zx_eventpair_create(0, &side1, &side2), ZX_OK, "");
+    ASSERT_EQ(zx_object_set_cookie(side2, scope1, magic2), ZX_OK, "");
+    ASSERT_EQ(zx_object_get_cookie(side2, scope1, &cookie), ZX_OK, "");
     ASSERT_EQ(cookie, magic2, "");
 
-    mx_handle_close(side1);
-    ASSERT_EQ(mx_object_get_cookie(side2, scope1, &cookie), MX_ERR_ACCESS_DENIED, "");
-    mx_handle_close(side2);
+    zx_handle_close(side1);
+    ASSERT_EQ(zx_object_get_cookie(side2, scope1, &cookie), ZX_ERR_ACCESS_DENIED, "");
+    zx_handle_close(side2);
 
     END_TEST;
 }
diff --git a/system/utest/core/cookies/rules.mk b/system/utest/core/cookies/rules.mk
index e67963e..3043763 100644
--- a/system/utest/core/cookies/rules.mk
+++ b/system/utest/core/cookies/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_NAME := cookies-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/ddk-completion/completion.c b/system/utest/core/ddk-completion/completion.c
index 5f3ba51..51c6922 100644
--- a/system/utest/core/ddk-completion/completion.c
+++ b/system/utest/core/ddk-completion/completion.c
@@ -4,7 +4,7 @@
 
 #include <sync/completion.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -18,8 +18,8 @@
 
 static int completion_thread_wait(void* arg) {
     for (int iteration = 0u; iteration < ITERATIONS; iteration++) {
-        mx_status_t status = completion_wait(&completion, MX_TIME_INFINITE);
-        ASSERT_EQ(status, MX_OK, "completion wait failed!");
+        zx_status_t status = completion_wait(&completion, ZX_TIME_INFINITE);
+        ASSERT_EQ(status, ZX_OK, "completion wait failed!");
     }
 
     return 0;
@@ -28,7 +28,7 @@
 static int completion_thread_signal(void* arg) {
     for (int iteration = 0u; iteration < ITERATIONS; iteration++) {
         completion_reset(&completion);
-        mx_nanosleep(mx_deadline_after(MX_USEC(10)));
+        zx_nanosleep(zx_deadline_after(ZX_USEC(10)));
         completion_signal(&completion);
     }
 
@@ -65,12 +65,12 @@
 
 static bool test_timeout(void) {
     BEGIN_TEST;
-    mx_time_t timeout = 0u;
+    zx_time_t timeout = 0u;
     completion_t completion = COMPLETION_INIT;
     for (int iteration = 0; iteration < 1000; iteration++) {
         timeout += 2000u;
-        mx_status_t status = completion_wait(&completion, timeout);
-        ASSERT_EQ(status, MX_ERR_TIMED_OUT, "wait returned spuriously!");
+        zx_status_t status = completion_wait(&completion, timeout);
+        ASSERT_EQ(status, ZX_ERR_TIMED_OUT, "wait returned spuriously!");
     }
     END_TEST;
 }
diff --git a/system/utest/core/ddk-completion/rules.mk b/system/utest/core/ddk-completion/rules.mk
index c2b774e..e6de306 100644
--- a/system/utest/core/ddk-completion/rules.mk
+++ b/system/utest/core/ddk-completion/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := ddk-completion-test
 
 MODULE_STATIC_LIBS := system/ulib/ddk system/ulib/sync
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/echo/echo.c b/system/utest/core/echo/echo.c
index aaac3b0..2da036f 100644
--- a/system/utest/core/echo/echo.c
+++ b/system/utest/core/echo/echo.c
@@ -8,41 +8,41 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 #include "message.h"
 #include "struct.h"
 
-bool wait_for_readable(mx_handle_t handle) {
+bool wait_for_readable(zx_handle_t handle) {
     unittest_printf("waiting for handle %u to be readable (or closed)\n", handle);
     // Wait for |handle| to become readable or closed.
-    mx_signals_t signals = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
-    mx_signals_t pending;
-    mx_status_t wait_status = mx_object_wait_one(handle, signals, MX_TIME_INFINITE,
+    zx_signals_t signals = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
+    zx_signals_t pending;
+    zx_status_t wait_status = zx_object_wait_one(handle, signals, ZX_TIME_INFINITE,
                                                        &pending);
-    if (wait_status != MX_OK) {
+    if (wait_status != ZX_OK) {
         return false;
     }
-    if (!(pending & MX_CHANNEL_READABLE)) {
+    if (!(pending & ZX_CHANNEL_READABLE)) {
         return false;
     }
     return true;
 }
 
-bool serve_echo_request(mx_handle_t handle) {
+bool serve_echo_request(zx_handle_t handle) {
     ASSERT_TRUE(wait_for_readable(handle), "handle not readable");
 
     // Try to read a message from |in_handle|.
     // First, figure out size.
     uint32_t in_msg_size = 0u;
-    mx_status_t read_status = mx_channel_read(handle, 0u, NULL, NULL, 0, 0, &in_msg_size, NULL);
-    ASSERT_NE(read_status, MX_ERR_NO_MEMORY, "unexpected sizing read status");
+    zx_status_t read_status = zx_channel_read(handle, 0u, NULL, NULL, 0, 0, &in_msg_size, NULL);
+    ASSERT_NE(read_status, ZX_ERR_NO_MEMORY, "unexpected sizing read status");
 
     unittest_printf("reading message of size %u\n", in_msg_size);
     void* in_msg_buf = calloc(in_msg_size, 1u);
-    read_status = mx_channel_read(handle, 0u, in_msg_buf, NULL, in_msg_size, 0, &in_msg_size, NULL);
-    ASSERT_EQ(read_status, MX_OK, "read failed with status");
+    read_status = zx_channel_read(handle, 0u, in_msg_buf, NULL, in_msg_size, 0, &in_msg_size, NULL);
+    ASSERT_EQ(read_status, ZX_OK, "read failed with status");
 
     // Try to parse message data.
     ASSERT_TRUE(mojo_validate_struct_header(in_msg_buf, in_msg_size),
@@ -104,11 +104,11 @@
     }
     free(in_msg_buf);
 
-    mx_status_t write_status =
-        mx_channel_write(handle, 0u, out_msg_buf, out_msg_size, NULL, 0u);
+    zx_status_t write_status =
+        zx_channel_write(handle, 0u, out_msg_buf, out_msg_size, NULL, 0u);
     free(out_msg_buf);
 
-    ASSERT_EQ(write_status, MX_OK, "Error while message writing");
+    ASSERT_EQ(write_status, ZX_OK, "Error while message writing");
 
     unittest_printf("served request!\n\n");
     return true;
@@ -116,8 +116,8 @@
 
 bool echo_test(void) {
     BEGIN_TEST;
-    mx_handle_t handles[2] = {0};
-    mx_status_t status = mx_channel_create(0, handles, handles + 1);
+    zx_handle_t handles[2] = {0};
+    zx_status_t status = zx_channel_create(0, handles, handles + 1);
     ASSERT_EQ(status, 0, "could not create channel");
     unittest_printf("created channel with handle values %u and %u\n", handles[0], handles[1]);
     for (int i = 0; i < 3; i++) {
@@ -132,14 +132,14 @@
             4,          // array header: num elems
             0x42424143, // array contents: 'CABB'
         };
-        mx_status_t status = mx_channel_write(handles[1], 0u, (void*)buf, sizeof(buf), NULL, 0u);
-        ASSERT_EQ(status, MX_OK, "could not write echo request");
+        zx_status_t status = zx_channel_write(handles[1], 0u, (void*)buf, sizeof(buf), NULL, 0u);
+        ASSERT_EQ(status, ZX_OK, "could not write echo request");
 
         ASSERT_TRUE(serve_echo_request(handles[0]), "serve_echo_request failed");
     }
-    mx_handle_close(handles[1]);
+    zx_handle_close(handles[1]);
     EXPECT_FALSE(wait_for_readable(handles[0]), "handle should not readable");
-    mx_handle_close(handles[0]);
+    zx_handle_close(handles[0]);
     END_TEST;
 }
 
diff --git a/system/utest/core/echo/echo.h b/system/utest/core/echo/echo.h
index eb88e14..d0dd54d 100644
--- a/system/utest/core/echo/echo.h
+++ b/system/utest/core/echo/echo.h
@@ -6,10 +6,10 @@
 
 #include <stdbool.h>
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 // Waits for an incoming echo request on channel |handle|,
 // parses the message, sends a reply on |handle|. Returns false if either
 // channel handle is closed or any error occurs. Returns true if a reply is
 // successfully sent.
-bool serve_echo_request(mx_handle_t handle);
+bool serve_echo_request(zx_handle_t handle);
diff --git a/system/utest/core/echo/rules.mk b/system/utest/core/echo/rules.mk
index 629a985..7c77040 100644
--- a/system/utest/core/echo/rules.mk
+++ b/system/utest/core/echo/rules.mk
@@ -18,6 +18,6 @@
 MODULE_NAME := echo-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/elf-tls/rules.mk b/system/utest/core/elf-tls/rules.mk
index fb5fbd1..4d5259b 100644
--- a/system/utest/core/elf-tls/rules.mk
+++ b/system/utest/core/elf-tls/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := elf-tls-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/event-pair/event-pair.c b/system/utest/core/event-pair/event-pair.c
index 89b73a8..b15bf78 100644
--- a/system/utest/core/event-pair/event-pair.c
+++ b/system/utest/core/event-pair/event-pair.c
@@ -4,13 +4,13 @@
 
 #include <string.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <unittest/unittest.h>
 
-static void check_signals_state(mx_handle_t h, mx_signals_t satisfied) {
-    mx_signals_t pending = 0;
-    EXPECT_EQ(mx_object_wait_one(h, 0u, 0u, &pending), MX_ERR_TIMED_OUT, "wrong wait result");
+static void check_signals_state(zx_handle_t h, zx_signals_t satisfied) {
+    zx_signals_t pending = 0;
+    EXPECT_EQ(zx_object_wait_one(h, 0u, 0u, &pending), ZX_ERR_TIMED_OUT, "wrong wait result");
     EXPECT_EQ(pending, satisfied, "wrong satisfied state");
 }
 
@@ -18,39 +18,39 @@
     BEGIN_TEST;
 
     {
-        mx_handle_t h[2] = {MX_HANDLE_INVALID, MX_HANDLE_INVALID};
-        ASSERT_EQ(mx_eventpair_create(0, &h[0], &h[1]), MX_OK, "eventpair_create failed");
-        ASSERT_NE(h[0], MX_HANDLE_INVALID, "invalid handle from eventpair_create");
-        ASSERT_NE(h[1], MX_HANDLE_INVALID, "invalid handle from eventpair_create");
+        zx_handle_t h[2] = {ZX_HANDLE_INVALID, ZX_HANDLE_INVALID};
+        ASSERT_EQ(zx_eventpair_create(0, &h[0], &h[1]), ZX_OK, "eventpair_create failed");
+        ASSERT_NE(h[0], ZX_HANDLE_INVALID, "invalid handle from eventpair_create");
+        ASSERT_NE(h[1], ZX_HANDLE_INVALID, "invalid handle from eventpair_create");
 
-        mx_info_handle_basic_t info;
+        zx_info_handle_basic_t info;
         memset(&info, 0, sizeof(info));
-        mx_status_t status = mx_object_get_info(h[0], MX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
-        ASSERT_EQ(status, MX_OK, "");
+        zx_status_t status = zx_object_get_info(h[0], ZX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
+        ASSERT_EQ(status, ZX_OK, "");
         EXPECT_EQ(info.rights,
-                  MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ |
-                  MX_RIGHT_WRITE | MX_RIGHT_SIGNAL | MX_RIGHT_SIGNAL_PEER,
+                  ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ |
+                  ZX_RIGHT_WRITE | ZX_RIGHT_SIGNAL | ZX_RIGHT_SIGNAL_PEER,
                   "wrong rights");
-        EXPECT_EQ(info.type, (uint32_t)MX_OBJ_TYPE_EVENT_PAIR, "wrong type");
+        EXPECT_EQ(info.type, (uint32_t)ZX_OBJ_TYPE_EVENT_PAIR, "wrong type");
         memset(&info, 0, sizeof(info));
-        status = mx_object_get_info(h[1], MX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
-        ASSERT_EQ(status, MX_OK, "");
+        status = zx_object_get_info(h[1], ZX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
+        ASSERT_EQ(status, ZX_OK, "");
         EXPECT_EQ(info.rights,
-                  MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER | MX_RIGHT_READ |
-                  MX_RIGHT_WRITE | MX_RIGHT_SIGNAL | MX_RIGHT_SIGNAL_PEER,
+                  ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER | ZX_RIGHT_READ |
+                  ZX_RIGHT_WRITE | ZX_RIGHT_SIGNAL | ZX_RIGHT_SIGNAL_PEER,
                   "wrong rights");
-        EXPECT_EQ(info.type, (uint32_t)MX_OBJ_TYPE_EVENT_PAIR, "wrong type");
+        EXPECT_EQ(info.type, (uint32_t)ZX_OBJ_TYPE_EVENT_PAIR, "wrong type");
 
-        EXPECT_EQ(mx_handle_close(h[0]), MX_OK, "failed to close event pair handle");
-        EXPECT_EQ(mx_handle_close(h[1]), MX_OK, "failed to close event pair handle");
+        EXPECT_EQ(zx_handle_close(h[0]), ZX_OK, "failed to close event pair handle");
+        EXPECT_EQ(zx_handle_close(h[1]), ZX_OK, "failed to close event pair handle");
     }
 
     // Currently no flags are supported.
     {
-        mx_handle_t h[2] = {MX_HANDLE_INVALID, MX_HANDLE_INVALID};
-        EXPECT_EQ(mx_eventpair_create(1u, &h[0], &h[1]), MX_ERR_NOT_SUPPORTED, "eventpair_create failed to fail");
-        EXPECT_EQ(h[0], MX_HANDLE_INVALID, "valid handle from failed eventpair_create?");
-        EXPECT_EQ(h[1], MX_HANDLE_INVALID, "valid handle from failed eventpair_create?");
+        zx_handle_t h[2] = {ZX_HANDLE_INVALID, ZX_HANDLE_INVALID};
+        EXPECT_EQ(zx_eventpair_create(1u, &h[0], &h[1]), ZX_ERR_NOT_SUPPORTED, "eventpair_create failed to fail");
+        EXPECT_EQ(h[0], ZX_HANDLE_INVALID, "valid handle from failed eventpair_create?");
+        EXPECT_EQ(h[1], ZX_HANDLE_INVALID, "valid handle from failed eventpair_create?");
     }
 
     END_TEST;
@@ -58,58 +58,58 @@
 
 static bool signal_test(void) {
     BEGIN_TEST;
-    mx_handle_t h[2] = {MX_HANDLE_INVALID, MX_HANDLE_INVALID};
-    ASSERT_EQ(mx_eventpair_create(0, &h[0], &h[1]), MX_OK, "eventpair_create failed");
-    ASSERT_NE(h[0], MX_HANDLE_INVALID, "invalid handle from eventpair_create");
-    ASSERT_NE(h[1], MX_HANDLE_INVALID, "invalid handle from eventpair_create");
+    zx_handle_t h[2] = {ZX_HANDLE_INVALID, ZX_HANDLE_INVALID};
+    ASSERT_EQ(zx_eventpair_create(0, &h[0], &h[1]), ZX_OK, "eventpair_create failed");
+    ASSERT_NE(h[0], ZX_HANDLE_INVALID, "invalid handle from eventpair_create");
+    ASSERT_NE(h[1], ZX_HANDLE_INVALID, "invalid handle from eventpair_create");
 
-    check_signals_state(h[0], MX_SIGNAL_LAST_HANDLE);
-    check_signals_state(h[1], MX_SIGNAL_LAST_HANDLE);
+    check_signals_state(h[0], ZX_SIGNAL_LAST_HANDLE);
+    check_signals_state(h[1], ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_object_signal(h[0], 0u, MX_USER_SIGNAL_0), MX_OK, "object_signal failed");
-    check_signals_state(h[1], MX_SIGNAL_LAST_HANDLE);
-    check_signals_state(h[0], MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE);
+    EXPECT_EQ(zx_object_signal(h[0], 0u, ZX_USER_SIGNAL_0), ZX_OK, "object_signal failed");
+    check_signals_state(h[1], ZX_SIGNAL_LAST_HANDLE);
+    check_signals_state(h[0], ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_object_signal(h[0], MX_USER_SIGNAL_0, 0u), MX_OK, "object_signal failed");
-    check_signals_state(h[1], MX_SIGNAL_LAST_HANDLE);
-    check_signals_state(h[0], MX_SIGNAL_LAST_HANDLE);
+    EXPECT_EQ(zx_object_signal(h[0], ZX_USER_SIGNAL_0, 0u), ZX_OK, "object_signal failed");
+    check_signals_state(h[1], ZX_SIGNAL_LAST_HANDLE);
+    check_signals_state(h[0], ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_handle_close(h[0]), MX_OK, "failed to close event pair handle");
-    check_signals_state(h[1], MX_EPAIR_PEER_CLOSED | MX_SIGNAL_LAST_HANDLE);
-    EXPECT_EQ(mx_handle_close(h[1]), MX_OK, "failed to close event pair handle");
+    EXPECT_EQ(zx_handle_close(h[0]), ZX_OK, "failed to close event pair handle");
+    check_signals_state(h[1], ZX_EPAIR_PEER_CLOSED | ZX_SIGNAL_LAST_HANDLE);
+    EXPECT_EQ(zx_handle_close(h[1]), ZX_OK, "failed to close event pair handle");
     END_TEST;
 }
 
 static bool signal_peer_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t h[2] = {MX_HANDLE_INVALID, MX_HANDLE_INVALID};
-    ASSERT_EQ(mx_eventpair_create(0, &h[0], &h[1]), MX_OK, "eventpair_create failed");
-    ASSERT_NE(h[0], MX_HANDLE_INVALID, "invalid handle from eventpair_create");
-    ASSERT_NE(h[1], MX_HANDLE_INVALID, "invalid handle from eventpair_create");
+    zx_handle_t h[2] = {ZX_HANDLE_INVALID, ZX_HANDLE_INVALID};
+    ASSERT_EQ(zx_eventpair_create(0, &h[0], &h[1]), ZX_OK, "eventpair_create failed");
+    ASSERT_NE(h[0], ZX_HANDLE_INVALID, "invalid handle from eventpair_create");
+    ASSERT_NE(h[1], ZX_HANDLE_INVALID, "invalid handle from eventpair_create");
 
-    EXPECT_EQ(mx_object_signal_peer(h[0], 0u, MX_USER_SIGNAL_0), MX_OK, "object_signal failed");
-    check_signals_state(h[0], MX_SIGNAL_LAST_HANDLE);
-    check_signals_state(h[1], MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE);
+    EXPECT_EQ(zx_object_signal_peer(h[0], 0u, ZX_USER_SIGNAL_0), ZX_OK, "object_signal failed");
+    check_signals_state(h[0], ZX_SIGNAL_LAST_HANDLE);
+    check_signals_state(h[1], ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_object_signal_peer(h[1], 0u, MX_USER_SIGNAL_1 | MX_USER_SIGNAL_2), MX_OK,
+    EXPECT_EQ(zx_object_signal_peer(h[1], 0u, ZX_USER_SIGNAL_1 | ZX_USER_SIGNAL_2), ZX_OK,
               "object_signal failed");
-    check_signals_state(h[0], MX_USER_SIGNAL_1 | MX_USER_SIGNAL_2 | MX_SIGNAL_LAST_HANDLE);
-    check_signals_state(h[1], MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE);
+    check_signals_state(h[0], ZX_USER_SIGNAL_1 | ZX_USER_SIGNAL_2 | ZX_SIGNAL_LAST_HANDLE);
+    check_signals_state(h[1], ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_object_signal_peer(h[0], MX_USER_SIGNAL_0, MX_USER_SIGNAL_3 | MX_USER_SIGNAL_4),
-              MX_OK, "object_signal failed");
-    check_signals_state(h[0], MX_USER_SIGNAL_1 | MX_USER_SIGNAL_2 | MX_SIGNAL_LAST_HANDLE);
-    check_signals_state(h[1], MX_USER_SIGNAL_3 | MX_USER_SIGNAL_4 | MX_SIGNAL_LAST_HANDLE);
+    EXPECT_EQ(zx_object_signal_peer(h[0], ZX_USER_SIGNAL_0, ZX_USER_SIGNAL_3 | ZX_USER_SIGNAL_4),
+              ZX_OK, "object_signal failed");
+    check_signals_state(h[0], ZX_USER_SIGNAL_1 | ZX_USER_SIGNAL_2 | ZX_SIGNAL_LAST_HANDLE);
+    check_signals_state(h[1], ZX_USER_SIGNAL_3 | ZX_USER_SIGNAL_4 | ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_handle_close(h[0]), MX_OK, "failed to close event pair handle");
+    EXPECT_EQ(zx_handle_close(h[0]), ZX_OK, "failed to close event pair handle");
 
     // Signaled flags should remain satisfied but now should now also get peer closed (and
     // unsignaled flags should be unsatisfiable).
     check_signals_state(h[1],
-        MX_EPAIR_PEER_CLOSED | MX_USER_SIGNAL_3 | MX_USER_SIGNAL_4 | MX_SIGNAL_LAST_HANDLE);
+        ZX_EPAIR_PEER_CLOSED | ZX_USER_SIGNAL_3 | ZX_USER_SIGNAL_4 | ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_handle_close(h[1]), MX_OK, "failed to close event pair handle");
+    EXPECT_EQ(zx_handle_close(h[1]), ZX_OK, "failed to close event pair handle");
 
     END_TEST;
 }
diff --git a/system/utest/core/event-pair/rules.mk b/system/utest/core/event-pair/rules.mk
index bf7d950..591c63a 100644
--- a/system/utest/core/event-pair/rules.mk
+++ b/system/utest/core/event-pair/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := event-pair-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/fifo/fifo.c b/system/utest/core/fifo/fifo.c
index 17dc81a..d2a8bfe 100644
--- a/system/utest/core/fifo/fifo.c
+++ b/system/utest/core/fifo/fifo.c
@@ -9,13 +9,13 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
-static mx_signals_t get_signals(mx_handle_t h) {
-    mx_signals_t pending;
-    mx_status_t status = mx_object_wait_one(h, 0xFFFFFFFF, 0u, &pending);
-    if ((status != MX_OK) && (status != MX_ERR_TIMED_OUT)) {
+static zx_signals_t get_signals(zx_handle_t h) {
+    zx_signals_t pending;
+    zx_status_t status = zx_object_wait_one(h, 0xFFFFFFFF, 0u, &pending);
+    if ((status != ZX_OK) && (status != ZX_ERR_TIMED_OUT)) {
         return 0xFFFFFFFF;
     }
     return pending;
@@ -25,36 +25,36 @@
 
 static bool basic_test(void) {
     BEGIN_TEST;
-    mx_handle_t a, b;
+    zx_handle_t a, b;
     uint64_t n[8] = { 1, 2, 3, 4, 5, 6, 7, 8};
 
     // ensure parameter validation works
-    EXPECT_EQ(mx_fifo_create(0, 0, 0, &a, &b), MX_ERR_OUT_OF_RANGE, ""); // too small
-    EXPECT_EQ(mx_fifo_create(35, 32, 0, &a, &b), MX_ERR_OUT_OF_RANGE, ""); // not power of two
-    EXPECT_EQ(mx_fifo_create(128, 33, 0, &a, &b), MX_ERR_OUT_OF_RANGE, ""); // too large
-    EXPECT_EQ(mx_fifo_create(0, 0, 1, &a, &b), MX_ERR_OUT_OF_RANGE, ""); // invalid options
+    EXPECT_EQ(zx_fifo_create(0, 0, 0, &a, &b), ZX_ERR_OUT_OF_RANGE, ""); // too small
+    EXPECT_EQ(zx_fifo_create(35, 32, 0, &a, &b), ZX_ERR_OUT_OF_RANGE, ""); // not power of two
+    EXPECT_EQ(zx_fifo_create(128, 33, 0, &a, &b), ZX_ERR_OUT_OF_RANGE, ""); // too large
+    EXPECT_EQ(zx_fifo_create(0, 0, 1, &a, &b), ZX_ERR_OUT_OF_RANGE, ""); // invalid options
 
     // simple 8 x 8 fifo
-    EXPECT_EQ(mx_fifo_create(8, 8, 0, &a, &b), MX_OK, "");
-    EXPECT_SIGNALS(a, MX_FIFO_WRITABLE | MX_SIGNAL_LAST_HANDLE);
-    EXPECT_SIGNALS(b, MX_FIFO_WRITABLE | MX_SIGNAL_LAST_HANDLE);
+    EXPECT_EQ(zx_fifo_create(8, 8, 0, &a, &b), ZX_OK, "");
+    EXPECT_SIGNALS(a, ZX_FIFO_WRITABLE | ZX_SIGNAL_LAST_HANDLE);
+    EXPECT_SIGNALS(b, ZX_FIFO_WRITABLE | ZX_SIGNAL_LAST_HANDLE);
 
     // should not be able to read any entries from an empty fifo
     uint32_t actual;
-    EXPECT_EQ(mx_fifo_read(a, n, sizeof(n), &actual), MX_ERR_SHOULD_WAIT, "");
+    EXPECT_EQ(zx_fifo_read(a, n, sizeof(n), &actual), ZX_ERR_SHOULD_WAIT, "");
 
     // should be able to write all entries into empty fifo
-    ASSERT_EQ(mx_fifo_write(a, n, sizeof(n), &actual), MX_OK, "");
+    ASSERT_EQ(zx_fifo_write(a, n, sizeof(n), &actual), ZX_OK, "");
     ASSERT_EQ(actual, 8u, "");
-    EXPECT_SIGNALS(b, MX_FIFO_READABLE | MX_FIFO_WRITABLE | MX_SIGNAL_LAST_HANDLE);
+    EXPECT_SIGNALS(b, ZX_FIFO_READABLE | ZX_FIFO_WRITABLE | ZX_SIGNAL_LAST_HANDLE);
 
     // should be able to write no entries into a full fifo
-    ASSERT_EQ(mx_fifo_write(a, n, sizeof(n), &actual), MX_ERR_SHOULD_WAIT, "");
-    EXPECT_SIGNALS(a, MX_SIGNAL_LAST_HANDLE);
+    ASSERT_EQ(zx_fifo_write(a, n, sizeof(n), &actual), ZX_ERR_SHOULD_WAIT, "");
+    EXPECT_SIGNALS(a, ZX_SIGNAL_LAST_HANDLE);
 
     // read half the entries, make sure they're what we expect
     memset(n, 0, sizeof(n));
-    EXPECT_EQ(mx_fifo_read(b, n, sizeof(n) / 2, &actual), MX_OK, "");
+    EXPECT_EQ(zx_fifo_read(b, n, sizeof(n) / 2, &actual), ZX_OK, "");
     ASSERT_EQ(actual, 4u, "");
     ASSERT_EQ(n[0], 1u, "");
     ASSERT_EQ(n[1], 2u, "");
@@ -62,16 +62,16 @@
     ASSERT_EQ(n[3], 4u, "");
 
     // should be writable again now
-    EXPECT_SIGNALS(a, MX_FIFO_WRITABLE | MX_SIGNAL_LAST_HANDLE);
+    EXPECT_SIGNALS(a, ZX_FIFO_WRITABLE | ZX_SIGNAL_LAST_HANDLE);
 
     // write some more, wrapping to the front again
     n[0] = 9u;
     n[1] = 10u;
-    ASSERT_EQ(mx_fifo_write(a, n, sizeof(uint64_t) * 2, &actual), MX_OK, "");
+    ASSERT_EQ(zx_fifo_write(a, n, sizeof(uint64_t) * 2, &actual), ZX_OK, "");
     ASSERT_EQ(actual, 2u, "");
 
     // read across the wrap, test partial read
-    ASSERT_EQ(mx_fifo_read(b, n, sizeof(n), &actual), MX_OK, "");
+    ASSERT_EQ(zx_fifo_read(b, n, sizeof(n), &actual), ZX_OK, "");
     ASSERT_EQ(actual, 6u, "");
     ASSERT_EQ(n[0], 5u, "");
     ASSERT_EQ(n[1], 6u, "");
@@ -81,29 +81,29 @@
     ASSERT_EQ(n[5], 10u, "");
 
     // should no longer be readable
-    EXPECT_SIGNALS(b, MX_FIFO_WRITABLE | MX_SIGNAL_LAST_HANDLE);
+    EXPECT_SIGNALS(b, ZX_FIFO_WRITABLE | ZX_SIGNAL_LAST_HANDLE);
 
     // write across the wrap
     n[0] = 11u; n[1] = 12u; n[2] = 13u; n[3] = 14u; n[4] = 15u;
-    ASSERT_EQ(mx_fifo_write(a, n, sizeof(uint64_t) * 5, &actual), MX_OK, "");
+    ASSERT_EQ(zx_fifo_write(a, n, sizeof(uint64_t) * 5, &actual), ZX_OK, "");
     ASSERT_EQ(actual, 5u, "");
 
     // partial write test
     n[0] = 16u; n[1] = 17u; n[2] = 18u;
-    ASSERT_EQ(mx_fifo_write(a, n, sizeof(n), &actual), MX_OK, "");
+    ASSERT_EQ(zx_fifo_write(a, n, sizeof(n), &actual), ZX_OK, "");
     ASSERT_EQ(actual, 3u, "");
 
     // small reads
     for (unsigned i = 0; i < 8; i++) {
-        ASSERT_EQ(mx_fifo_read(b, n, sizeof(uint64_t), &actual), MX_OK, "");
+        ASSERT_EQ(zx_fifo_read(b, n, sizeof(uint64_t), &actual), ZX_OK, "");
         ASSERT_EQ(actual, 1u, "");
         ASSERT_EQ(n[0], 11u + i, "");
     }
 
-    mx_handle_close(b);
-    EXPECT_SIGNALS(a, MX_FIFO_PEER_CLOSED | MX_SIGNAL_LAST_HANDLE);
+    zx_handle_close(b);
+    EXPECT_SIGNALS(a, ZX_FIFO_PEER_CLOSED | ZX_SIGNAL_LAST_HANDLE);
 
-    mx_handle_close(a);
+    zx_handle_close(a);
 
     END_TEST;
 }
@@ -111,9 +111,9 @@
 static bool options_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t fifos[2];
-    ASSERT_EQ(mx_fifo_create(23, 8, 8, &fifos[0], &fifos[1]),
-              MX_ERR_INVALID_ARGS, "");
+    zx_handle_t fifos[2];
+    ASSERT_EQ(zx_fifo_create(23, 8, 8, &fifos[0], &fifos[1]),
+              ZX_ERR_INVALID_ARGS, "");
 
     END_TEST;
 }
diff --git a/system/utest/core/fifo/rules.mk b/system/utest/core/fifo/rules.mk
index 1e6ecf5..a184545 100644
--- a/system/utest/core/fifo/rules.mk
+++ b/system/utest/core/fifo/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_NAME := fifo-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/futex/futex.cpp b/system/utest/core/futex/futex.cpp
index 01eac86..dfe5239 100644
--- a/system/utest/core/futex/futex.cpp
+++ b/system/utest/core/futex/futex.cpp
@@ -4,8 +4,8 @@
 
 #include <inttypes.h>
 #include <limits.h>
-#include <magenta/syscalls.h>
-#include <magenta/threads.h>
+#include <zircon/syscalls.h>
+#include <zircon/threads.h>
 #include <unittest/unittest.h>
 #include <sched.h>
 #include <stdio.h>
@@ -19,17 +19,17 @@
 static bool test_futex_wait_value_mismatch() {
     BEGIN_TEST;
     int futex_value = 123;
-    mx_status_t rc = mx_futex_wait(&futex_value, futex_value + 1,
-                                         MX_TIME_INFINITE);
-    ASSERT_EQ(rc, MX_ERR_BAD_STATE, "Futex wait should have reurned bad state");
+    zx_status_t rc = zx_futex_wait(&futex_value, futex_value + 1,
+                                         ZX_TIME_INFINITE);
+    ASSERT_EQ(rc, ZX_ERR_BAD_STATE, "Futex wait should have reurned bad state");
     END_TEST;
 }
 
 static bool test_futex_wait_timeout() {
     BEGIN_TEST;
     int futex_value = 123;
-    mx_status_t rc = mx_futex_wait(&futex_value, futex_value, 0);
-    ASSERT_EQ(rc, MX_ERR_TIMED_OUT, "Futex wait should have reurned timeout");
+    zx_status_t rc = zx_futex_wait(&futex_value, futex_value, 0);
+    ASSERT_EQ(rc, ZX_ERR_TIMED_OUT, "Futex wait should have reurned timeout");
     END_TEST;
 }
 
@@ -37,12 +37,12 @@
 static bool test_futex_wait_timeout_elapsed() {
     BEGIN_TEST;
     int futex_value = 0;
-    constexpr mx_duration_t kRelativeDeadline = MX_MSEC(500);
+    constexpr zx_duration_t kRelativeDeadline = ZX_MSEC(500);
     for (int i = 0; i < 5; ++i) {
-        mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
-        mx_status_t rc = mx_futex_wait(&futex_value, 0, mx_deadline_after(kRelativeDeadline));
-        ASSERT_EQ(rc, MX_ERR_TIMED_OUT, "wait should time out");
-        mx_time_t elapsed = mx_time_get(MX_CLOCK_MONOTONIC) - now;
+        zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
+        zx_status_t rc = zx_futex_wait(&futex_value, 0, zx_deadline_after(kRelativeDeadline));
+        ASSERT_EQ(rc, ZX_ERR_TIMED_OUT, "wait should time out");
+        zx_time_t elapsed = zx_time_get(ZX_CLOCK_MONOTONIC) - now;
         if (elapsed < kRelativeDeadline) {
             unittest_printf("\nelapsed %" PRIu64
                             " < kRelativeDeadline: %" PRIu64 "\n",
@@ -57,8 +57,8 @@
 static bool test_futex_wait_bad_address() {
     BEGIN_TEST;
     // Check that the wait address is checked for validity.
-    mx_status_t rc = mx_futex_wait(nullptr, 123, MX_TIME_INFINITE);
-    ASSERT_EQ(rc, MX_ERR_INVALID_ARGS, "Futex wait should have reurned invalid_arg");
+    zx_status_t rc = zx_futex_wait(nullptr, 123, ZX_TIME_INFINITE);
+    ASSERT_EQ(rc, ZX_ERR_INVALID_ARGS, "Futex wait should have reurned invalid_arg");
     END_TEST;
 }
 
@@ -67,7 +67,7 @@
 class TestThread {
 public:
     TestThread(volatile int* futex_addr,
-               mx_duration_t timeout_in_us = MX_TIME_INFINITE)
+               zx_duration_t timeout_in_us = ZX_TIME_INFINITE)
         : futex_addr_(futex_addr),
           timeout_in_ns_(timeout_in_us) {
         auto ret = thrd_create_with_name(&thread_, wakeup_test_thread, this, "wakeup_test_thread");
@@ -89,14 +89,14 @@
     TestThread& operator=(const TestThread &) = delete;
 
     ~TestThread() {
-        if (handle_ != MX_HANDLE_INVALID) {
+        if (handle_ != ZX_HANDLE_INVALID) {
             // kill_thread() was used, so the thrd_t is in undefined state.
             // Use the kernel handle to ensure the thread has died.
-            EXPECT_EQ(mx_object_wait_one(handle_, MX_THREAD_TERMINATED,
-                                         MX_TIME_INFINITE, NULL), MX_OK,
-                      "mx_object_wait_one failed on killed thread");
-            EXPECT_EQ(mx_handle_close(handle_), MX_OK,
-                      "mx_handle_close failed on killed thread's handle");
+            EXPECT_EQ(zx_object_wait_one(handle_, ZX_THREAD_TERMINATED,
+                                         ZX_TIME_INFINITE, NULL), ZX_OK,
+                      "zx_object_wait_one failed on killed thread");
+            EXPECT_EQ(zx_handle_close(handle_), ZX_OK,
+                      "zx_handle_close failed on killed thread's handle");
             // The thrd_t and state associated with it is leaked at this point.
         } else {
             EXPECT_EQ(thrd_join(thread_, NULL), thrd_success,
@@ -126,29 +126,29 @@
     }
 
     void kill_thread() {
-        EXPECT_EQ(handle_, MX_HANDLE_INVALID, "kill_thread called twice??");
-        EXPECT_EQ(mx_handle_duplicate(thrd_get_mx_handle(thread_),
-                                      MX_RIGHT_SAME_RIGHTS, &handle_),
-                  MX_OK, "mx_handle_duplicate failed on thread handle");
-        EXPECT_EQ(mx_task_kill(handle_), MX_OK, "mx_task_kill() failed");
+        EXPECT_EQ(handle_, ZX_HANDLE_INVALID, "kill_thread called twice??");
+        EXPECT_EQ(zx_handle_duplicate(thrd_get_zx_handle(thread_),
+                                      ZX_RIGHT_SAME_RIGHTS, &handle_),
+                  ZX_OK, "zx_handle_duplicate failed on thread handle");
+        EXPECT_EQ(zx_task_kill(handle_), ZX_OK, "zx_task_kill() failed");
     }
 
-    mx_handle_t get_thread_handle() {
-        return thrd_get_mx_handle(thread_);
+    zx_handle_t get_thread_handle() {
+        return thrd_get_zx_handle(thread_);
     }
 
 private:
     static int wakeup_test_thread(void* thread_arg) {
         TestThread* thread = reinterpret_cast<TestThread*>(thread_arg);
         thread->state_ = STATE_ABOUT_TO_WAIT;
-        mx_time_t deadline = thread->timeout_in_ns_ == MX_TIME_INFINITE ? MX_TIME_INFINITE :
-                mx_deadline_after(thread->timeout_in_ns_);
-        mx_status_t rc = mx_futex_wait(const_cast<int*>(thread->futex_addr_),
+        zx_time_t deadline = thread->timeout_in_ns_ == ZX_TIME_INFINITE ? ZX_TIME_INFINITE :
+                zx_deadline_after(thread->timeout_in_ns_);
+        zx_status_t rc = zx_futex_wait(const_cast<int*>(thread->futex_addr_),
                                        *thread->futex_addr_, deadline);
-        if (thread->timeout_in_ns_ == MX_TIME_INFINITE) {
-            EXPECT_EQ(rc, MX_OK, "Error while wait");
+        if (thread->timeout_in_ns_ == ZX_TIME_INFINITE) {
+            EXPECT_EQ(rc, ZX_OK, "Error while wait");
         } else {
-            EXPECT_EQ(rc, MX_ERR_TIMED_OUT, "wait should have timedout");
+            EXPECT_EQ(rc, ZX_ERR_TIMED_OUT, "wait should have timedout");
         }
         thread->state_ = STATE_WAIT_RETURNED;
         return 0;
@@ -156,8 +156,8 @@
 
     thrd_t thread_;
     volatile int* futex_addr_;
-    mx_duration_t timeout_in_ns_;
-    mx_handle_t handle_ = MX_HANDLE_INVALID;
+    zx_duration_t timeout_in_ns_;
+    zx_handle_t handle_ = ZX_HANDLE_INVALID;
     volatile enum {
         STATE_STARTED = 100,
         STATE_ABOUT_TO_WAIT = 200,
@@ -173,8 +173,8 @@
     // success result.
     (*futex_addr)++;
 
-    mx_status_t rc = mx_futex_wake(const_cast<int*>(futex_addr), nwake);
-    EXPECT_EQ(rc, MX_OK, "error during futex wait");
+    zx_status_t rc = zx_futex_wake(const_cast<int*>(futex_addr), nwake);
+    EXPECT_EQ(rc, ZX_OK, "error during futex wait");
 }
 
 // Test that we can wake up a single thread.
@@ -199,7 +199,7 @@
     check_futex_wake(&futex_value, 2);
     // Test that threads are woken up in the order that they were added to
     // the wait queue.  This is not necessarily true for the Linux
-    // implementation of futexes, but it is true for Magenta's
+    // implementation of futexes, but it is true for Zircon's
     // implementation.
     thread1.assert_thread_woken();
     thread2.assert_thread_woken();
@@ -243,9 +243,9 @@
 bool test_futex_unqueued_on_timeout() {
     BEGIN_TEST;
     volatile int futex_value = 1;
-    mx_status_t rc = mx_futex_wait(const_cast<int*>(&futex_value),
-                                   futex_value, mx_deadline_after(1));
-    ASSERT_EQ(rc, MX_ERR_TIMED_OUT, "wait should have timedout");
+    zx_status_t rc = zx_futex_wait(const_cast<int*>(&futex_value),
+                                   futex_value, zx_deadline_after(1));
+    ASSERT_EQ(rc, ZX_ERR_TIMED_OUT, "wait should have timedout");
     TestThread thread(&futex_value);
     // If the earlier futex_wait() did not remove itself from the wait
     // queue properly, the following futex_wake() call will attempt to wake
@@ -261,7 +261,7 @@
     BEGIN_TEST;
     volatile int futex_value = 10;
     TestThread thread1(&futex_value);
-    TestThread thread2(&futex_value, MX_MSEC(200));
+    TestThread thread2(&futex_value, ZX_MSEC(200));
     ASSERT_TRUE(thread2.wait_for_timeout());
     // With the bug present, thread2 was removed but the futex wait queue's
     // tail pointer still points to thread2.  When another thread is
@@ -278,7 +278,7 @@
 bool test_futex_unqueued_on_timeout_3() {
     BEGIN_TEST;
     volatile int futex_value = 10;
-    TestThread thread1(&futex_value, MX_MSEC(400));
+    TestThread thread1(&futex_value, ZX_MSEC(400));
     TestThread thread2(&futex_value);
     TestThread thread3(&futex_value);
     ASSERT_TRUE(thread1.wait_for_timeout());
@@ -299,18 +299,18 @@
     BEGIN_TEST;
     int futex_value1 = 100;
     int futex_value2 = 200;
-    mx_status_t rc = mx_futex_requeue(&futex_value1, 1, futex_value1 + 1,
+    zx_status_t rc = zx_futex_requeue(&futex_value1, 1, futex_value1 + 1,
                                             &futex_value2, 1);
-    ASSERT_EQ(rc, MX_ERR_BAD_STATE, "requeue should have returned bad state");
+    ASSERT_EQ(rc, ZX_ERR_BAD_STATE, "requeue should have returned bad state");
     END_TEST;
 }
 
 bool test_futex_requeue_same_addr() {
     BEGIN_TEST;
     int futex_value = 100;
-    mx_status_t rc = mx_futex_requeue(&futex_value, 1, futex_value,
+    zx_status_t rc = zx_futex_requeue(&futex_value, 1, futex_value,
                                             &futex_value, 1);
-    ASSERT_EQ(rc, MX_ERR_INVALID_ARGS, "requeue should have returned invalid args");
+    ASSERT_EQ(rc, ZX_ERR_INVALID_ARGS, "requeue should have returned invalid args");
     END_TEST;
 }
 
@@ -326,10 +326,10 @@
     TestThread thread5(&futex_value1);
     TestThread thread6(&futex_value1);
 
-    mx_status_t rc = mx_futex_requeue(
+    zx_status_t rc = zx_futex_requeue(
         const_cast<int*>(&futex_value1), 3, futex_value1,
         const_cast<int*>(&futex_value2), 2);
-    ASSERT_EQ(rc, MX_OK, "Error in requeue");
+    ASSERT_EQ(rc, ZX_OK, "Error in requeue");
     // 3 of the threads should have been woken.
     thread1.assert_thread_woken();
     thread2.assert_thread_woken();
@@ -356,14 +356,14 @@
 // itself from the correct queue in that case.
 bool test_futex_requeue_unqueued_on_timeout() {
     BEGIN_TEST;
-    mx_duration_t timeout_in_ns = MX_MSEC(300);
+    zx_duration_t timeout_in_ns = ZX_MSEC(300);
     volatile int futex_value1 = 100;
     volatile int futex_value2 = 200;
     TestThread thread1(&futex_value1, timeout_in_ns);
-    mx_status_t rc = mx_futex_requeue(
+    zx_status_t rc = zx_futex_requeue(
         const_cast<int*>(&futex_value1), 0, futex_value1,
         const_cast<int*>(&futex_value2), INT_MAX);
-    ASSERT_EQ(rc, MX_OK, "Error in requeue");
+    ASSERT_EQ(rc, ZX_OK, "Error in requeue");
     TestThread thread2(&futex_value2);
     // thread1 and thread2 should now both be waiting on futex_value2.
 
@@ -400,19 +400,19 @@
 
 // Test that the futex_wait() syscall is restarted properly if the thread
 // calling it gets suspended and resumed.  (This tests for a bug where the
-// futex_wait() syscall would return MX_ERR_TIMED_OUT and not get restarted by
+// futex_wait() syscall would return ZX_ERR_TIMED_OUT and not get restarted by
 // the syscall wrapper in the VDSO.)
 static bool test_futex_thread_suspended() {
     BEGIN_TEST;
     volatile int futex_value = 1;
     TestThread thread(&futex_value);
 
-    ASSERT_EQ(mx_task_suspend(thread.get_thread_handle()), MX_OK);
+    ASSERT_EQ(zx_task_suspend(thread.get_thread_handle()), ZX_OK);
     // Wait some time for the thread suspension to take effect.
     struct timespec wait_time = {0, 10 * 1000000 /* nanoseconds */};
     ASSERT_EQ(nanosleep(&wait_time, NULL), 0, "Error during sleep");
 
-    ASSERT_EQ(mx_task_resume(thread.get_thread_handle(), 0), MX_OK);
+    ASSERT_EQ(zx_task_resume(thread.get_thread_handle(), 0), ZX_OK);
     // Wait some time for the thread to resume and execute.
     ASSERT_EQ(nanosleep(&wait_time, NULL), 0, "Error during sleep");
 
@@ -429,31 +429,31 @@
 
     // Make sure the whole thing is aligned, so the 'futex' member will
     // definitely be misaligned.
-    alignas(mx_futex_t) struct {
+    alignas(zx_futex_t) struct {
         uint8_t misalign;
-        mx_futex_t futex[2];
+        zx_futex_t futex[2];
     } __attribute__((packed)) buffer;
-    mx_futex_t* const futex = &buffer.futex[0];
-    mx_futex_t* const futex_2 = &buffer.futex[1];
-    ASSERT_GT(alignof(mx_futex_t), 1);
-    ASSERT_NE((uintptr_t)futex % alignof(mx_futex_t), 0);
-    ASSERT_NE((uintptr_t)futex_2 % alignof(mx_futex_t), 0);
+    zx_futex_t* const futex = &buffer.futex[0];
+    zx_futex_t* const futex_2 = &buffer.futex[1];
+    ASSERT_GT(alignof(zx_futex_t), 1);
+    ASSERT_NE((uintptr_t)futex % alignof(zx_futex_t), 0);
+    ASSERT_NE((uintptr_t)futex_2 % alignof(zx_futex_t), 0);
 
-    // mx_futex_requeue might check the waited-for value before it
+    // zx_futex_requeue might check the waited-for value before it
     // checks the second futex's alignment, so make sure the call is
     // valid other than the alignment.  (Also don't ask anybody to
     // look at uninitialized stack space!)
     memset(&buffer, 0, sizeof(buffer));
 
-    ASSERT_EQ(mx_futex_wait(futex, 0, MX_TIME_INFINITE), MX_ERR_INVALID_ARGS);
-    ASSERT_EQ(mx_futex_wake(futex, 1), MX_ERR_INVALID_ARGS);
-    ASSERT_EQ(mx_futex_requeue(futex, 1, 0, futex_2, 1), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(zx_futex_wait(futex, 0, ZX_TIME_INFINITE), ZX_ERR_INVALID_ARGS);
+    ASSERT_EQ(zx_futex_wake(futex, 1), ZX_ERR_INVALID_ARGS);
+    ASSERT_EQ(zx_futex_requeue(futex, 1, 0, futex_2, 1), ZX_ERR_INVALID_ARGS);
 
     END_TEST;
 }
 
 static void log(const char* str) {
-    uint64_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+    uint64_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
     unittest_printf("[%08" PRIu64 ".%08" PRIu64 "]: %s",
                     now / 1000000000, now % 1000000000, str);
 }
@@ -465,14 +465,14 @@
 
     void wait() {
         if (signaled_ == 0) {
-            mx_futex_wait(&signaled_, signaled_, MX_TIME_INFINITE);
+            zx_futex_wait(&signaled_, signaled_, ZX_TIME_INFINITE);
         }
     }
 
     void signal() {
         if (signaled_ == 0) {
             signaled_ = 1;
-            mx_futex_wake(&signaled_, UINT32_MAX);
+            zx_futex_wake(&signaled_, UINT32_MAX);
         }
     }
 
@@ -512,7 +512,7 @@
     thrd_create_with_name(&thread2, signal_thread2, NULL, "thread 2");
     thrd_create_with_name(&thread3, signal_thread3, NULL, "thread 3");
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(300)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(300)));
     log("signaling event\n");
     event.signal();
 
diff --git a/system/utest/core/futex/rules.mk b/system/utest/core/futex/rules.mk
index 5a3bfb9..b021e8b 100644
--- a/system/utest/core/futex/rules.mk
+++ b/system/utest/core/futex/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := futex-test
 
 MODULE_LIBS := \
-    system/ulib/mxio system/ulib/magenta system/ulib/unittest system/ulib/c
+    system/ulib/fdio system/ulib/zircon system/ulib/unittest system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/handle-info/handle-info.c b/system/utest/core/handle-info/handle-info.c
index 651dabf..f54ab32 100644
--- a/system/utest/core/handle-info/handle-info.c
+++ b/system/utest/core/handle-info/handle-info.c
@@ -5,44 +5,44 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <unittest/unittest.h>
 
 static bool handle_info_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), 0, "");
-    mx_handle_t duped;
-    mx_status_t status = mx_handle_duplicate(event, MX_RIGHT_SAME_RIGHTS, &duped);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), 0, "");
+    zx_handle_t duped;
+    zx_status_t status = zx_handle_duplicate(event, ZX_RIGHT_SAME_RIGHTS, &duped);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    ASSERT_EQ(mx_object_get_info(event, MX_INFO_HANDLE_VALID, NULL, 0u, NULL, NULL), MX_OK,
+    ASSERT_EQ(zx_object_get_info(event, ZX_INFO_HANDLE_VALID, NULL, 0u, NULL, NULL), ZX_OK,
               "handle should be valid");
-    ASSERT_EQ(mx_handle_close(event), MX_OK, "failed to close the handle");
-    ASSERT_EQ(mx_object_get_info(event, MX_INFO_HANDLE_VALID, NULL, 0u, NULL, NULL), MX_ERR_BAD_HANDLE,
+    ASSERT_EQ(zx_handle_close(event), ZX_OK, "failed to close the handle");
+    ASSERT_EQ(zx_object_get_info(event, ZX_INFO_HANDLE_VALID, NULL, 0u, NULL, NULL), ZX_ERR_BAD_HANDLE,
               "handle should be valid");
 
-    mx_info_handle_basic_t info = {};
-    ASSERT_EQ(mx_object_get_info(duped, MX_INFO_HANDLE_BASIC, &info, 4u, NULL, NULL),
-              MX_ERR_BUFFER_TOO_SMALL, "bad struct size validation");
+    zx_info_handle_basic_t info = {};
+    ASSERT_EQ(zx_object_get_info(duped, ZX_INFO_HANDLE_BASIC, &info, 4u, NULL, NULL),
+              ZX_ERR_BUFFER_TOO_SMALL, "bad struct size validation");
 
-    status = mx_object_get_info(duped, MX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
-    ASSERT_EQ(status, MX_OK, "handle should be valid");
+    status = zx_object_get_info(duped, ZX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
+    ASSERT_EQ(status, ZX_OK, "handle should be valid");
 
-    const mx_rights_t evr = MX_RIGHT_DUPLICATE | MX_RIGHT_TRANSFER |
-                            MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_SIGNAL;
+    const zx_rights_t evr = ZX_RIGHT_DUPLICATE | ZX_RIGHT_TRANSFER |
+                            ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_SIGNAL;
 
     EXPECT_GT(info.koid, 0ULL, "object id should be positive");
-    EXPECT_EQ(info.type, (uint32_t)MX_OBJ_TYPE_EVENT, "handle should be an event");
+    EXPECT_EQ(info.type, (uint32_t)ZX_OBJ_TYPE_EVENT, "handle should be an event");
     EXPECT_EQ(info.rights, evr, "wrong set of rights");
-    EXPECT_EQ(info.props, (uint32_t)MX_OBJ_PROP_WAITABLE, "");
+    EXPECT_EQ(info.props, (uint32_t)ZX_OBJ_PROP_WAITABLE, "");
     EXPECT_EQ(info.related_koid, 0ULL, "events don't have associated koid");
 
-    mx_handle_close(event);
-    mx_handle_close(duped);
+    zx_handle_close(event);
+    zx_handle_close(duped);
 
     END_TEST;
 }
@@ -50,31 +50,31 @@
 static bool handle_related_koid_test(void) {
     BEGIN_TEST;
 
-    mx_info_handle_basic_t info0 = {};
-    mx_info_handle_basic_t info1 = {};
+    zx_info_handle_basic_t info0 = {};
+    zx_info_handle_basic_t info1 = {};
 
-    mx_status_t status = mx_object_get_info(
-        mx_job_default(), MX_INFO_HANDLE_BASIC, &info0, sizeof(info0), NULL, NULL);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_status_t status = zx_object_get_info(
+        zx_job_default(), ZX_INFO_HANDLE_BASIC, &info0, sizeof(info0), NULL, NULL);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    status = mx_object_get_info(
-        mx_process_self(), MX_INFO_HANDLE_BASIC, &info1, sizeof(info1), NULL, NULL);
-    ASSERT_EQ(status, MX_OK, "");
+    status = zx_object_get_info(
+        zx_process_self(), ZX_INFO_HANDLE_BASIC, &info1, sizeof(info1), NULL, NULL);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    EXPECT_EQ(info0.type, (uint32_t)MX_OBJ_TYPE_JOB, "");
-    EXPECT_EQ(info1.type, (uint32_t)MX_OBJ_TYPE_PROCESS, "");
+    EXPECT_EQ(info0.type, (uint32_t)ZX_OBJ_TYPE_JOB, "");
+    EXPECT_EQ(info1.type, (uint32_t)ZX_OBJ_TYPE_PROCESS, "");
 
-    mx_handle_t thread;
-    status = mx_thread_create(mx_process_self(), "hitr", 4, 0u, &thread);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t thread;
+    status = zx_thread_create(zx_process_self(), "hitr", 4, 0u, &thread);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    mx_info_handle_basic_t info2 = {};
+    zx_info_handle_basic_t info2 = {};
 
-    status = mx_object_get_info(
-        thread, MX_INFO_HANDLE_BASIC, &info2, sizeof(info2), NULL, NULL);
-    ASSERT_EQ(status, MX_OK, "");
+    status = zx_object_get_info(
+        thread, ZX_INFO_HANDLE_BASIC, &info2, sizeof(info2), NULL, NULL);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    EXPECT_EQ(info2.type, (uint32_t)MX_OBJ_TYPE_THREAD, "");
+    EXPECT_EQ(info2.type, (uint32_t)ZX_OBJ_TYPE_THREAD, "");
 
     // The related koid of a process is its job and this test assumes that the
     // default job is in fact the parent job of this test. Equivalently, a thread's
@@ -82,64 +82,64 @@
     EXPECT_EQ(info1.related_koid, info0.koid, "");
     EXPECT_EQ(info2.related_koid, info1.koid, "");
 
-    mx_handle_close(thread);
+    zx_handle_close(thread);
 
-    mx_handle_t sock0, sock1;
-    status = mx_socket_create(0u, &sock0, &sock1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t sock0, sock1;
+    status = zx_socket_create(0u, &sock0, &sock1);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    status = mx_object_get_info(
-        sock0, MX_INFO_HANDLE_BASIC, &info0, sizeof(info0), NULL, NULL);
-    ASSERT_EQ(status, MX_OK, "");
+    status = zx_object_get_info(
+        sock0, ZX_INFO_HANDLE_BASIC, &info0, sizeof(info0), NULL, NULL);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    status = mx_object_get_info(
-        sock1, MX_INFO_HANDLE_BASIC, &info1, sizeof(info1), NULL, NULL);
-    ASSERT_EQ(status, MX_OK, "");
+    status = zx_object_get_info(
+        sock1, ZX_INFO_HANDLE_BASIC, &info1, sizeof(info1), NULL, NULL);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    EXPECT_EQ(info0.type, (uint32_t)MX_OBJ_TYPE_SOCKET, "");
-    EXPECT_EQ(info1.type, (uint32_t)MX_OBJ_TYPE_SOCKET, "");
+    EXPECT_EQ(info0.type, (uint32_t)ZX_OBJ_TYPE_SOCKET, "");
+    EXPECT_EQ(info1.type, (uint32_t)ZX_OBJ_TYPE_SOCKET, "");
 
     // The related koid of a socket pair are each other koids.
     EXPECT_EQ(info0.related_koid, info1.koid, "");
     EXPECT_EQ(info1.related_koid, info0.koid, "");
 
-    mx_handle_close(sock0);
-    mx_handle_close(sock1);
+    zx_handle_close(sock0);
+    zx_handle_close(sock1);
     END_TEST;
 }
 
 static bool handle_rights_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), 0, "");
-    mx_handle_t duped_ro;
-    mx_status_t status = mx_handle_duplicate(event, MX_RIGHT_READ, &duped_ro);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), 0, "");
+    zx_handle_t duped_ro;
+    zx_status_t status = zx_handle_duplicate(event, ZX_RIGHT_READ, &duped_ro);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    mx_info_handle_basic_t info = {};
-    status = mx_object_get_info(duped_ro, MX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
-    ASSERT_EQ(status, MX_OK, "handle should be valid");
+    zx_info_handle_basic_t info = {};
+    status = zx_object_get_info(duped_ro, ZX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
+    ASSERT_EQ(status, ZX_OK, "handle should be valid");
 
-    ASSERT_EQ(info.rights, MX_RIGHT_READ, "wrong set of rights");
+    ASSERT_EQ(info.rights, ZX_RIGHT_READ, "wrong set of rights");
 
-    mx_handle_t h;
-    status = mx_handle_duplicate(duped_ro, MX_RIGHT_SAME_RIGHTS, &h);
-    ASSERT_EQ(status, MX_ERR_ACCESS_DENIED, "should fail rights check");
+    zx_handle_t h;
+    status = zx_handle_duplicate(duped_ro, ZX_RIGHT_SAME_RIGHTS, &h);
+    ASSERT_EQ(status, ZX_ERR_ACCESS_DENIED, "should fail rights check");
 
-    status = mx_handle_duplicate(event, MX_RIGHT_EXECUTE | MX_RIGHT_READ, &h);
-    ASSERT_EQ(status, MX_ERR_INVALID_ARGS, "cannot upgrade rights");
+    status = zx_handle_duplicate(event, ZX_RIGHT_EXECUTE | ZX_RIGHT_READ, &h);
+    ASSERT_EQ(status, ZX_ERR_INVALID_ARGS, "cannot upgrade rights");
 
-    ASSERT_EQ(mx_handle_replace(duped_ro, MX_RIGHT_EXECUTE | MX_RIGHT_READ, &h), MX_ERR_INVALID_ARGS,
+    ASSERT_EQ(zx_handle_replace(duped_ro, ZX_RIGHT_EXECUTE | ZX_RIGHT_READ, &h), ZX_ERR_INVALID_ARGS,
               "cannot upgrade rights");
 
-    status = mx_handle_replace(duped_ro, MX_RIGHT_SAME_RIGHTS, &h);
-    ASSERT_EQ(status, MX_OK, "should be able to replace handle");
+    status = zx_handle_replace(duped_ro, ZX_RIGHT_SAME_RIGHTS, &h);
+    ASSERT_EQ(status, ZX_OK, "should be able to replace handle");
     // duped_ro should now be invalid.
 
-    ASSERT_EQ(mx_handle_close(event), MX_OK, "failed to close original handle");
-    ASSERT_EQ(mx_handle_close(duped_ro), MX_ERR_BAD_HANDLE, "replaced handle should be invalid");
-    ASSERT_EQ(mx_handle_close(h), MX_OK, "failed to close replacement handle");
+    ASSERT_EQ(zx_handle_close(event), ZX_OK, "failed to close original handle");
+    ASSERT_EQ(zx_handle_close(duped_ro), ZX_ERR_BAD_HANDLE, "replaced handle should be invalid");
+    ASSERT_EQ(zx_handle_close(h), ZX_OK, "failed to close replacement handle");
 
     END_TEST;
 }
diff --git a/system/utest/core/handle-info/rules.mk b/system/utest/core/handle-info/rules.mk
index f477c2f..ee01dd1 100644
--- a/system/utest/core/handle-info/rules.mk
+++ b/system/utest/core/handle-info/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := handle-info-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/handle-transfer/handle-transfer.c b/system/utest/core/handle-transfer/handle-transfer.c
index ac287b6..688d808 100644
--- a/system/utest/core/handle-transfer/handle-transfer.c
+++ b/system/utest/core/handle-transfer/handle-transfer.c
@@ -6,7 +6,7 @@
 #include <threads.h>
 #include <time.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 // This example tests transferring channel handles through channels. To do so, it:
@@ -19,58 +19,58 @@
 //   Reads from H until empty. Should read "1", "2", "3" in that order.
 bool handle_transfer_test(void) {
     BEGIN_TEST;
-    mx_handle_t A[2];
-    mx_status_t status = mx_channel_create(0, A, A + 1);
+    zx_handle_t A[2];
+    zx_status_t status = zx_channel_create(0, A, A + 1);
     char msg[512];
     snprintf(msg, sizeof(msg), "failed to create channel A: %d\n", status);
     EXPECT_EQ(status, 0, msg);
 
-    mx_handle_t B[2];
-    status = mx_channel_create(0, B, B + 1);
+    zx_handle_t B[2];
+    status = zx_channel_create(0, B, B + 1);
     snprintf(msg, sizeof(msg), "failed to create channel B: %d\n", status);
     EXPECT_EQ(status, 0, msg);
 
-    status = mx_channel_write(A[0], 0u, "1", 1u, NULL, 0u);
+    status = zx_channel_write(A[0], 0u, "1", 1u, NULL, 0u);
     snprintf(msg, sizeof(msg), "failed to write message \"1\" into A0: %u\n", status);
-    EXPECT_EQ(status, MX_OK, msg);
+    EXPECT_EQ(status, ZX_OK, msg);
 
-    status = mx_channel_write(B[0], 0u, NULL, 0u, &A[1], 1u);
+    status = zx_channel_write(B[0], 0u, NULL, 0u, &A[1], 1u);
     snprintf(msg, sizeof(msg), "failed to write message with handle A[1]: %u\n", status);
-    EXPECT_EQ(status, MX_OK, msg);
+    EXPECT_EQ(status, ZX_OK, msg);
 
-    A[1] = MX_HANDLE_INVALID;
-    status = mx_channel_write(A[0], 0u, "2", 1u, NULL, 0u);
+    A[1] = ZX_HANDLE_INVALID;
+    status = zx_channel_write(A[0], 0u, "2", 1u, NULL, 0u);
     snprintf(msg, sizeof(msg), "failed to write message \"2\" into A0: %u\n", status);
-    EXPECT_EQ(status, MX_OK, msg);
+    EXPECT_EQ(status, ZX_OK, msg);
 
-    mx_handle_t H;
+    zx_handle_t H;
     uint32_t num_bytes = 0u;
     uint32_t num_handles = 1u;
-    status = mx_channel_read(B[1], 0u, NULL, &H, 0, num_handles, &num_bytes, &num_handles);
+    status = zx_channel_read(B[1], 0u, NULL, &H, 0, num_handles, &num_bytes, &num_handles);
     snprintf(msg, sizeof(msg), "failed to read message from B1: %u\n", status);
-    EXPECT_EQ(status, MX_OK, msg);
+    EXPECT_EQ(status, ZX_OK, msg);
 
     snprintf(msg, sizeof(msg), "failed to read actual handle value from B1\n");
-    EXPECT_FALSE((num_handles != 1u || H == MX_HANDLE_INVALID), msg);
+    EXPECT_FALSE((num_handles != 1u || H == ZX_HANDLE_INVALID), msg);
 
-    status = mx_channel_write(A[0], 0u, "3", 1u, NULL, 0u);
+    status = zx_channel_write(A[0], 0u, "3", 1u, NULL, 0u);
     snprintf(msg, sizeof(msg), "failed to write message \"3\" into A0: %u\n", status);
-    EXPECT_EQ(status, MX_OK, msg);
+    EXPECT_EQ(status, ZX_OK, msg);
 
     for (int i = 0; i < 3; ++i) {
         char buf[1];
         num_bytes = 1u;
         num_handles = 0u;
-        status = mx_channel_read(H, 0u, buf, NULL, num_bytes, 0, &num_bytes, &num_handles);
+        status = zx_channel_read(H, 0u, buf, NULL, num_bytes, 0, &num_bytes, &num_handles);
         snprintf(msg, sizeof(msg), "failed to read message from H: %u\n", status);
-        EXPECT_EQ(status, MX_OK, msg);
+        EXPECT_EQ(status, ZX_OK, msg);
         unittest_printf("read message: %c\n", buf[0]);
     }
 
-    mx_handle_close(A[0]);
-    mx_handle_close(B[0]);
-    mx_handle_close(B[1]);
-    mx_handle_close(H);
+    zx_handle_close(A[0]);
+    zx_handle_close(B[0]);
+    zx_handle_close(B[1]);
+    zx_handle_close(H);
     END_TEST;
 }
 
@@ -86,19 +86,19 @@
     nanosleep(&t, NULL);
 
     // Send A0 through B1 to B0.
-    mx_handle_t* A = (mx_handle_t*)arg;
-    mx_handle_t* B = A + 2;
-    mx_status_t status = mx_channel_write(B[1], 0, NULL, 0u, &A[0], 1);
-    if (status != MX_OK) {
+    zx_handle_t* A = (zx_handle_t*)arg;
+    zx_handle_t* B = A + 2;
+    zx_status_t status = zx_channel_write(B[1], 0, NULL, 0u, &A[0], 1);
+    if (status != ZX_OK) {
         UNITTEST_TRACEF("failed to write message with handle A0 to B1: %d\n", status);
         goto thread_exit;
     }
 
     // Read from B0 into H, thus canceling any waits on A0.
-    mx_handle_t H;
+    zx_handle_t H;
     uint32_t num_handles = 1;
-    status = mx_channel_read(B[0], 0, NULL, &H, 0, num_handles, NULL, &num_handles);
-    if (status != MX_OK || num_handles < 1) {
+    status = zx_channel_read(B[0], 0, NULL, &H, 0, num_handles, NULL, &num_handles);
+    if (status != ZX_OK || num_handles < 1) {
         UNITTEST_TRACEF("failed to read message handle H from B0: %d\n", status);
     }
 
@@ -114,13 +114,13 @@
 // See [MG-103].
 bool handle_transfer_cancel_wait_test(void) {
     BEGIN_TEST;
-    mx_handle_t A[4];
-    mx_handle_t* B = &A[2];
-    mx_status_t status = mx_channel_create(0, A, A + 1);
+    zx_handle_t A[4];
+    zx_handle_t* B = &A[2];
+    zx_status_t status = zx_channel_create(0, A, A + 1);
     char msg[512];
     snprintf(msg, sizeof(msg), "failed to create channel A[0,1]: %d\n", status);
     EXPECT_EQ(status, 0, msg);
-    status = mx_channel_create(0, B, B + 1);
+    status = zx_channel_create(0, B, B + 1);
     snprintf(msg, sizeof(msg), "failed to create channel B[0,1]: %d\n", status);
     EXPECT_EQ(status, 0, msg);
 
@@ -128,15 +128,15 @@
     int ret = thrd_create_with_name(&thr, thread, A, "write thread");
     EXPECT_EQ(ret, thrd_success, "failed to create write thread");
 
-    mx_signals_t signals = MX_CHANNEL_PEER_CLOSED;
-    status = mx_object_wait_one(A[0], signals, mx_deadline_after(MX_SEC(1)), NULL);
-    EXPECT_NE(MX_ERR_TIMED_OUT, status, "failed to complete wait when handle transferred");
+    zx_signals_t signals = ZX_CHANNEL_PEER_CLOSED;
+    status = zx_object_wait_one(A[0], signals, zx_deadline_after(ZX_SEC(1)), NULL);
+    EXPECT_NE(ZX_ERR_TIMED_OUT, status, "failed to complete wait when handle transferred");
 
     thrd_join(thr, NULL);
-    mx_handle_close(B[1]);
-    mx_handle_close(B[0]);
-    mx_handle_close(A[1]);
-    mx_handle_close(A[0]);
+    zx_handle_close(B[1]);
+    zx_handle_close(B[0]);
+    zx_handle_close(A[1]);
+    zx_handle_close(A[0]);
     END_TEST;
 }
 
diff --git a/system/utest/core/handle-transfer/rules.mk b/system/utest/core/handle-transfer/rules.mk
index 6a90b0c..487de13 100644
--- a/system/utest/core/handle-transfer/rules.mk
+++ b/system/utest/core/handle-transfer/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := handle-transfer-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/handle-wait/handle-wait.c b/system/utest/core/handle-wait/handle-wait.c
index 9668238..f718071 100644
--- a/system/utest/core/handle-wait/handle-wait.c
+++ b/system/utest/core/handle-wait/handle-wait.c
@@ -11,10 +11,10 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #define ASSERT_NOT_REACHED() \
     assert(0)
@@ -39,36 +39,36 @@
 
 typedef struct thread_data {
     int thread_num;
-    mx_handle_t channel;
+    zx_handle_t channel;
 } thread_data_t;
 
 typedef struct wait_data {
-    mx_handle_t handle;
-    mx_handle_t signals;
-    mx_time_t timeout;
-    mx_status_t status;
+    zx_handle_t handle;
+    zx_handle_t signals;
+    zx_time_t timeout;
+    zx_status_t status;
 } wait_data_t;
 
 // [0] is used by main thread
 // [1] is used by worker thread
-static mx_handle_t thread1_channel[2];
-static mx_handle_t thread2_channel[2];
+static zx_handle_t thread1_channel[2];
+static zx_handle_t thread2_channel[2];
 
-static mx_handle_t event_handle;
+static zx_handle_t event_handle;
 
 // Wait until |handle| is readable or peer is closed (or wait is cancelled).
 
-static bool wait_readable(mx_handle_t handle, enum wait_result* result) {
-    mx_signals_t pending;
-    mx_signals_t signals = MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED;
-    mx_time_t deadline = MX_TIME_INFINITE;
-    mx_status_t status = mx_object_wait_one(handle, signals, deadline, &pending);
-    if (status == MX_ERR_CANCELED) {
+static bool wait_readable(zx_handle_t handle, enum wait_result* result) {
+    zx_signals_t pending;
+    zx_signals_t signals = ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED;
+    zx_time_t deadline = ZX_TIME_INFINITE;
+    zx_status_t status = zx_object_wait_one(handle, signals, deadline, &pending);
+    if (status == ZX_ERR_CANCELED) {
         *result = WAIT_CANCELLED;
         return true;
     }
     ASSERT_GE(status, 0, "handle wait one failed");
-    if ((pending & MX_CHANNEL_READABLE) != 0) {
+    if ((pending & ZX_CHANNEL_READABLE) != 0) {
         *result = WAIT_READABLE;
         return true;
     }
@@ -77,36 +77,36 @@
     return true;
 }
 
-static bool wait_signaled(mx_handle_t handle, enum wait_result* result) {
-    mx_signals_t pending;
-    mx_signals_t signals = MX_EVENT_SIGNALED;
-    mx_time_t deadline = MX_TIME_INFINITE;
-    mx_status_t status = mx_object_wait_one(handle, signals, deadline, &pending);
-    if (status == MX_ERR_CANCELED) {
+static bool wait_signaled(zx_handle_t handle, enum wait_result* result) {
+    zx_signals_t pending;
+    zx_signals_t signals = ZX_EVENT_SIGNALED;
+    zx_time_t deadline = ZX_TIME_INFINITE;
+    zx_status_t status = zx_object_wait_one(handle, signals, deadline, &pending);
+    if (status == ZX_ERR_CANCELED) {
         *result = WAIT_CANCELLED;
         return true;
     }
     ASSERT_GE(status, 0, "handle wait one failed");
-    ASSERT_NE(pending & MX_EVENT_SIGNALED, 0u,
+    ASSERT_NE(pending & ZX_EVENT_SIGNALED, 0u,
               "unexpected return in wait_signaled");
     *result = WAIT_SIGNALED;
     return true;
 }
 
-static mx_status_t channel_create(mx_handle_t* handle0, mx_handle_t* handle1) {
-    return mx_channel_create(0, handle0, handle1);
+static zx_status_t channel_create(zx_handle_t* handle0, zx_handle_t* handle1) {
+    return zx_channel_create(0, handle0, handle1);
 }
 
-static bool send_msg(mx_handle_t handle, enum message msg) {
+static bool send_msg(zx_handle_t handle, enum message msg) {
     uint64_t data = msg;
     unittest_printf("sending message %d on handle %u\n", msg, handle);
-    mx_status_t status =
-        mx_channel_write(handle, 0, &data, sizeof(data), NULL, 0);
+    zx_status_t status =
+        zx_channel_write(handle, 0, &data, sizeof(data), NULL, 0);
     ASSERT_GE(status, 0, "message write failed");
     return true;
 }
 
-static bool recv_msg(mx_handle_t handle, enum message* msg) {
+static bool recv_msg(zx_handle_t handle, enum message* msg) {
     uint64_t data;
 
     unittest_printf("waiting for message on handle %u\n", handle);
@@ -126,18 +126,18 @@
 
     uint32_t num_bytes = sizeof(data);
 
-    ASSERT_GE(mx_channel_read(handle, 0, &data, NULL, num_bytes, 0, &num_bytes, NULL), 0,
+    ASSERT_GE(zx_channel_read(handle, 0, &data, NULL, num_bytes, 0, &num_bytes, NULL), 0,
               "Error while reading message");
     EXPECT_EQ(num_bytes, sizeof(data), "unexpected message size");
     if (num_bytes != sizeof(data)) {
-        mx_thread_exit();
+        zx_thread_exit();
     }
     *msg = (enum message)data;
     unittest_printf("received message %d\n", *msg);
     return true;
 }
 
-static bool msg_loop(mx_handle_t channel) {
+static bool msg_loop(zx_handle_t channel) {
     bool my_done_tests = false;
     while (!my_done_tests) {
         enum message msg;
@@ -182,8 +182,8 @@
 
 static int wait_thread_func(void* arg) {
     wait_data_t* data = arg;
-    mx_signals_t observed;
-    data->status = mx_object_wait_one(data->handle, data->signals, mx_deadline_after(data->timeout),
+    zx_signals_t observed;
+    data->status = zx_object_wait_one(data->handle, data->signals, zx_deadline_after(data->timeout),
                                       &observed);
     return 0;
 }
@@ -205,9 +205,9 @@
               "thread creation failed");
     unittest_printf("threads started\n");
 
-    event_handle = MX_HANDLE_INVALID;
-    ASSERT_EQ(mx_event_create(0u, &event_handle), 0, "");
-    ASSERT_NE(event_handle, MX_HANDLE_INVALID, "event creation failed");
+    event_handle = ZX_HANDLE_INVALID;
+    ASSERT_EQ(zx_event_create(0u, &event_handle), 0, "");
+    ASSERT_NE(event_handle, ZX_HANDLE_INVALID, "event creation failed");
 
     enum message msg;
     send_msg(thread1_channel[0], MSG_PING);
@@ -224,13 +224,13 @@
     // when there exists a duplicate of the handle.
     // N.B. We're assuming thread 1 is waiting on event_handle at this point.
     // TODO(vtl): This is a flaky assumption, though the following sleep should help.
-    mx_nanosleep(mx_deadline_after(MX_MSEC(20)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(20)));
 
-    mx_handle_t event_handle_dup = MX_HANDLE_INVALID;
-    mx_status_t status = mx_handle_duplicate(event_handle, MX_RIGHT_SAME_RIGHTS, &event_handle_dup);
-    ASSERT_EQ(status, MX_OK, "");
-    ASSERT_NE(event_handle_dup, MX_HANDLE_INVALID, "handle duplication failed");
-    ASSERT_EQ(mx_handle_close(event_handle), MX_OK, "handle close failed");
+    zx_handle_t event_handle_dup = ZX_HANDLE_INVALID;
+    zx_status_t status = zx_handle_duplicate(event_handle, ZX_RIGHT_SAME_RIGHTS, &event_handle_dup);
+    ASSERT_EQ(status, ZX_OK, "");
+    ASSERT_NE(event_handle_dup, ZX_HANDLE_INVALID, "handle duplication failed");
+    ASSERT_EQ(zx_handle_close(event_handle), ZX_OK, "handle close failed");
 
     ASSERT_TRUE(recv_msg(thread1_channel[0], &msg), "Error while receiving msg");
     ASSERT_EQ(msg, (enum message)MSG_WAIT_EVENT_CANCELLED,
@@ -240,7 +240,7 @@
     send_msg(thread2_channel[0], MSG_EXIT);
     EXPECT_EQ(thrd_join(thread1, NULL), thrd_success, "failed to join thread");
     EXPECT_EQ(thrd_join(thread2, NULL), thrd_success, "failed to join thread");
-    EXPECT_EQ(mx_handle_close(event_handle_dup), MX_OK, "handle close failed");
+    EXPECT_EQ(zx_handle_close(event_handle_dup), ZX_OK, "handle close failed");
     END_TEST;
 }
 
diff --git a/system/utest/core/handle-wait/rules.mk b/system/utest/core/handle-wait/rules.mk
index c8a3378..862dc25 100644
--- a/system/utest/core/handle-wait/rules.mk
+++ b/system/utest/core/handle-wait/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := handle-wait-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/job/jobs.c b/system/utest/core/job/jobs.c
index 74b6233..9731c3b 100644
--- a/system/utest/core/job/jobs.c
+++ b/system/utest/core/job/jobs.c
@@ -7,36 +7,36 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/policy.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/policy.h>
 
 #include <mini-process/mini-process.h>
 #include <unittest/unittest.h>
 
 static const char process_name[] = "job-test-p";
 
-extern mx_handle_t root_job;
+extern zx_handle_t root_job;
 
 static bool basic_test(void) {
     BEGIN_TEST;
 
     // Never close the launchpad job.
-    mx_handle_t job_parent = mx_job_default();
-    ASSERT_NE(job_parent, MX_HANDLE_INVALID, "");
+    zx_handle_t job_parent = zx_job_default();
+    ASSERT_NE(job_parent, ZX_HANDLE_INVALID, "");
 
     // If the parent job is valid, one should be able to create a child job
     // and a child job of the child job.
-    mx_handle_t job_child, job_grandchild;
-    ASSERT_EQ(mx_job_create(job_parent, 0u, &job_child), MX_OK, "");
-    ASSERT_EQ(mx_job_create(job_child, 0u, &job_grandchild), MX_OK, "");
+    zx_handle_t job_child, job_grandchild;
+    ASSERT_EQ(zx_job_create(job_parent, 0u, &job_child), ZX_OK, "");
+    ASSERT_EQ(zx_job_create(job_child, 0u, &job_grandchild), ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(job_child), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(job_grandchild), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(job_child), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(job_grandchild), ZX_OK, "");
 
     // If the parent job is not valid it should fail.
-    mx_handle_t job_fail;
-    ASSERT_EQ(mx_job_create(MX_HANDLE_INVALID, 0u, &job_fail), MX_ERR_BAD_HANDLE, "");
+    zx_handle_t job_fail;
+    ASSERT_EQ(zx_job_create(ZX_HANDLE_INVALID, 0u, &job_fail), ZX_ERR_BAD_HANDLE, "");
 
     END_TEST;
 }
@@ -44,26 +44,26 @@
 static bool create_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t job_parent = mx_job_default();
-    ASSERT_NE(job_parent, MX_HANDLE_INVALID, "");
+    zx_handle_t job_parent = zx_job_default();
+    ASSERT_NE(job_parent, ZX_HANDLE_INVALID, "");
 
-    mx_handle_t job_child;
-    ASSERT_EQ(mx_job_create(job_parent, 0u, &job_child), MX_OK, "");
+    zx_handle_t job_child;
+    ASSERT_EQ(zx_job_create(job_parent, 0u, &job_child), ZX_OK, "");
 
     // Make sure we can create process object with both the parent job and a child job.
-    mx_handle_t process1, vmar1;
-    ASSERT_EQ(mx_process_create(
-        job_parent, process_name, sizeof(process_name), 0u, &process1, &vmar1), MX_OK, "");
+    zx_handle_t process1, vmar1;
+    ASSERT_EQ(zx_process_create(
+        job_parent, process_name, sizeof(process_name), 0u, &process1, &vmar1), ZX_OK, "");
 
-    mx_handle_t process2, vmar2;
-    ASSERT_EQ(mx_process_create(
-        job_child, process_name, sizeof(process_name), 0u, &process2, &vmar2), MX_OK, "");
+    zx_handle_t process2, vmar2;
+    ASSERT_EQ(zx_process_create(
+        job_child, process_name, sizeof(process_name), 0u, &process2, &vmar2), ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(job_child), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(process1), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(process2), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(vmar1), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(vmar2), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(job_child), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(process1), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(process2), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(vmar1), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(vmar2), ZX_OK, "");
 
     END_TEST;
 }
@@ -71,50 +71,50 @@
 static bool policy_basic_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t job_parent = mx_job_default();
-    ASSERT_NE(job_parent, MX_HANDLE_INVALID, "");
+    zx_handle_t job_parent = zx_job_default();
+    ASSERT_NE(job_parent, ZX_HANDLE_INVALID, "");
 
-    mx_handle_t job_child;
-    ASSERT_EQ(mx_job_create(job_parent, 0u, &job_child), MX_OK, "");
+    zx_handle_t job_child;
+    ASSERT_EQ(zx_job_create(job_parent, 0u, &job_child), ZX_OK, "");
 
-    mx_policy_basic_t policy[] = {
-        { MX_POL_BAD_HANDLE, MX_POL_ACTION_KILL },
-        { MX_POL_NEW_CHANNEL, MX_POL_ACTION_ALLOW | MX_POL_ACTION_EXCEPTION },
-        { MX_POL_NEW_FIFO, MX_POL_ACTION_DENY },
+    zx_policy_basic_t policy[] = {
+        { ZX_POL_BAD_HANDLE, ZX_POL_ACTION_KILL },
+        { ZX_POL_NEW_CHANNEL, ZX_POL_ACTION_ALLOW | ZX_POL_ACTION_EXCEPTION },
+        { ZX_POL_NEW_FIFO, ZX_POL_ACTION_DENY },
     };
 
-    ASSERT_EQ(mx_job_set_policy(job_child, MX_JOB_POL_RELATIVE,
-        MX_JOB_POL_BASIC, policy, countof(policy)), MX_OK, "");
+    ASSERT_EQ(zx_job_set_policy(job_child, ZX_JOB_POL_RELATIVE,
+        ZX_JOB_POL_BASIC, policy, countof(policy)), ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(job_child), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(job_child), ZX_OK, "");
     END_TEST;
 }
 
 static bool kill_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t job_parent = mx_job_default();
-    ASSERT_NE(job_parent, MX_HANDLE_INVALID, "");
+    zx_handle_t job_parent = zx_job_default();
+    ASSERT_NE(job_parent, ZX_HANDLE_INVALID, "");
 
-    mx_handle_t job_child;
-    ASSERT_EQ(mx_job_create(job_parent, 0u, &job_child), MX_OK, "");
+    zx_handle_t job_child;
+    ASSERT_EQ(zx_job_create(job_parent, 0u, &job_child), ZX_OK, "");
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), MX_OK, "");
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), ZX_OK, "");
 
-    mx_handle_t process, thread;
-    ASSERT_EQ(start_mini_process(job_child, event, &process, &thread), MX_OK, "");
+    zx_handle_t process, thread;
+    ASSERT_EQ(start_mini_process(job_child, event, &process, &thread), ZX_OK, "");
 
-    ASSERT_EQ(mx_task_kill(job_child), MX_OK, "");
+    ASSERT_EQ(zx_task_kill(job_child), ZX_OK, "");
 
-    mx_signals_t signals;
-    ASSERT_EQ(mx_object_wait_one(
-        process, MX_TASK_TERMINATED, MX_TIME_INFINITE, &signals), MX_OK, "");
-    ASSERT_EQ(signals, MX_TASK_TERMINATED | MX_SIGNAL_LAST_HANDLE, "");
+    zx_signals_t signals;
+    ASSERT_EQ(zx_object_wait_one(
+        process, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, &signals), ZX_OK, "");
+    ASSERT_EQ(signals, ZX_TASK_TERMINATED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    ASSERT_EQ(mx_object_wait_one(
-        job_child, MX_JOB_NO_PROCESSES, MX_TIME_INFINITE, &signals), MX_OK, "");
-    ASSERT_EQ(signals, MX_JOB_NO_PROCESSES | MX_JOB_NO_JOBS | MX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(zx_object_wait_one(
+        job_child, ZX_JOB_NO_PROCESSES, ZX_TIME_INFINITE, &signals), ZX_OK, "");
+    ASSERT_EQ(signals, ZX_JOB_NO_PROCESSES | ZX_JOB_NO_JOBS | ZX_SIGNAL_LAST_HANDLE, "");
 
     END_TEST;
 }
@@ -122,43 +122,43 @@
 static bool wait_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t job_parent = mx_job_default();
-    ASSERT_NE(job_parent, MX_HANDLE_INVALID, "");
+    zx_handle_t job_parent = zx_job_default();
+    ASSERT_NE(job_parent, ZX_HANDLE_INVALID, "");
 
-    mx_handle_t job_child;
-    ASSERT_EQ(mx_job_create(job_parent, 0u, &job_child), MX_OK, "");
+    zx_handle_t job_child;
+    ASSERT_EQ(zx_job_create(job_parent, 0u, &job_child), ZX_OK, "");
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), MX_OK, "");
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), ZX_OK, "");
 
-    mx_handle_t process, thread;
-    ASSERT_EQ(start_mini_process(job_child, event, &process, &thread), MX_OK, "");
+    zx_handle_t process, thread;
+    ASSERT_EQ(start_mini_process(job_child, event, &process, &thread), ZX_OK, "");
 
-    mx_signals_t signals;
-    ASSERT_EQ(mx_object_wait_one(
-        job_child, MX_JOB_NO_JOBS, MX_TIME_INFINITE, &signals), MX_OK, "");
-    ASSERT_EQ(signals, MX_JOB_NO_JOBS | MX_SIGNAL_LAST_HANDLE, "");
+    zx_signals_t signals;
+    ASSERT_EQ(zx_object_wait_one(
+        job_child, ZX_JOB_NO_JOBS, ZX_TIME_INFINITE, &signals), ZX_OK, "");
+    ASSERT_EQ(signals, ZX_JOB_NO_JOBS | ZX_SIGNAL_LAST_HANDLE, "");
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(5)));
-    ASSERT_EQ(mx_task_kill(process), MX_OK, "");
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(5)));
+    ASSERT_EQ(zx_task_kill(process), ZX_OK, "");
 
-    ASSERT_EQ(mx_object_wait_one(
-        job_child, MX_JOB_NO_PROCESSES, MX_TIME_INFINITE, &signals), MX_OK, "");
-    ASSERT_EQ(signals, MX_JOB_NO_PROCESSES | MX_JOB_NO_JOBS | MX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(zx_object_wait_one(
+        job_child, ZX_JOB_NO_PROCESSES, ZX_TIME_INFINITE, &signals), ZX_OK, "");
+    ASSERT_EQ(signals, ZX_JOB_NO_PROCESSES | ZX_JOB_NO_JOBS | ZX_SIGNAL_LAST_HANDLE, "");
 
-    ASSERT_EQ(mx_handle_close(thread), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(process), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(job_child), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(process), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(job_child), ZX_OK, "");
 
     END_TEST;
 }
 
 static bool info_task_stats_fails(void) {
     BEGIN_TEST;
-    mx_info_task_stats_t info;
-    ASSERT_NE(mx_object_get_info(mx_job_default(), MX_INFO_TASK_STATS,
+    zx_info_task_stats_t info;
+    ASSERT_NE(zx_object_get_info(zx_job_default(), ZX_INFO_TASK_STATS,
                                  &info, sizeof(info), NULL, NULL),
-              MX_OK,
+              ZX_OK,
               "Just added job support to info_task_status?");
     // If so, replace this with a real test; see example in process.cpp.
     END_TEST;
@@ -169,19 +169,19 @@
     BEGIN_TEST;
 
     // Get our parent job.
-    mx_handle_t parent_job = mx_job_default();
+    zx_handle_t parent_job = zx_job_default();
 
     // Stack of handles that we need to close.
     static const int kNumJobs = 128;
-    mx_handle_t *handles = calloc(kNumJobs, sizeof(*handles));
+    zx_handle_t *handles = calloc(kNumJobs, sizeof(*handles));
     ASSERT_NONNULL(handles, "");
-    mx_handle_t *htop = handles;
+    zx_handle_t *htop = handles;
 
     // Eat up our max height.
     while (true) {
-        mx_handle_t child_job;
-        mx_status_t s = mx_job_create(parent_job, 0u, &child_job);
-        if (s != MX_OK) {
+        zx_handle_t child_job;
+        zx_status_t s = zx_job_create(parent_job, 0u, &child_job);
+        if (s != ZX_OK) {
             break;
         }
         // We should hit the max before running out of entries;
@@ -193,21 +193,21 @@
     }
 
     // We've hit the bottom. Creating a child under this job should fail.
-    mx_handle_t child_job;
-    EXPECT_EQ(mx_job_create(parent_job, 0u, &child_job), MX_ERR_OUT_OF_RANGE, "");
+    zx_handle_t child_job;
+    EXPECT_EQ(zx_job_create(parent_job, 0u, &child_job), ZX_ERR_OUT_OF_RANGE, "");
 
     // Creating a process should succeed, though.
-    mx_handle_t child_proc;
-    mx_handle_t vmar;
-    ASSERT_EQ(mx_process_create(
+    zx_handle_t child_proc;
+    zx_handle_t vmar;
+    ASSERT_EQ(zx_process_create(
                   parent_job, "test", sizeof("test"), 0u, &child_proc, &vmar),
-              MX_OK, "");
-    mx_handle_close(vmar);
-    mx_handle_close(child_proc);
+              ZX_OK, "");
+    zx_handle_close(vmar);
+    zx_handle_close(child_proc);
 
     // Clean up.
     while (htop > handles) {
-        EXPECT_EQ(mx_handle_close(*--htop), MX_OK, "");
+        EXPECT_EQ(zx_handle_close(*--htop), ZX_OK, "");
     }
     free(handles);
 
diff --git a/system/utest/core/main.c b/system/utest/core/main.c
index de076bf..df83fba 100644
--- a/system/utest/core/main.c
+++ b/system/utest/core/main.c
@@ -7,22 +7,22 @@
 #include <unistd.h>
 #include <sys/uio.h>
 
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
 
 #include <unittest/unittest.h>
 
 // output via debuglog syscalls
 
-static mx_handle_t log_handle;
+static zx_handle_t log_handle;
 
-#define LOGBUF_MAX (MX_LOG_RECORD_MAX - sizeof(mx_log_record_t))
+#define LOGBUF_MAX (ZX_LOG_RECORD_MAX - sizeof(zx_log_record_t))
 
 static void log_write(const void* data, size_t len) {
     while (len > 0) {
         size_t xfer = (len > LOGBUF_MAX) ? LOGBUF_MAX : len;
-        mx_log_write(log_handle, xfer, data, 0);
+        zx_log_write(log_handle, xfer, data, 0);
         data += xfer;
         len -= xfer;
     }
@@ -31,11 +31,11 @@
 
 // libc init and io stubs
 // The reason these are here is that the "core" tests intentionally do not
-// use mxio. See ./README.md.
+// use fdio. See ./README.md.
 
-mx_handle_t root_resource;
+zx_handle_t root_resource;
 
-void __libc_extensions_init(uint32_t count, mx_handle_t handle[], uint32_t info[]) {
+void __libc_extensions_init(uint32_t count, zx_handle_t handle[], uint32_t info[]) {
     for (unsigned n = 0; n < count; n++) {
         if (info[n] == PA_HND(PA_RESOURCE, 0)) {
             root_resource = handle[n];
@@ -46,7 +46,7 @@
     }
 }
 
-mx_handle_t get_root_resource(void) {
+zx_handle_t get_root_resource(void) {
     return root_resource;
 }
 
@@ -92,9 +92,9 @@
 }
 
 int main(int argc, char** argv) {
-    if (mx_log_create(0, &log_handle) < 0) {
+    if (zx_log_create(0, &log_handle) < 0) {
         return -2;
     }
-    mx_log_write(log_handle, 4, "TEST", 0);
+    zx_log_write(log_handle, 4, "TEST", 0);
     return unittest_run_all_tests(argc, argv) ? 0 : -1;
 }
diff --git a/system/utest/core/memory-mapping/memory-mapping.cpp b/system/utest/core/memory-mapping/memory-mapping.cpp
index b2c8167..af1bf24 100644
--- a/system/utest/core/memory-mapping/memory-mapping.cpp
+++ b/system/utest/core/memory-mapping/memory-mapping.cpp
@@ -5,9 +5,9 @@
 #include <errno.h>
 #include <unistd.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <unittest/unittest.h>
 #include <sys/mman.h>
 
@@ -33,8 +33,8 @@
 
 #if defined(__x86_64__)
     size_t page_size = getpagesize();
-    mx_handle_t vmo;
-    EXPECT_EQ(mx_vmo_create(page_size, 0, &vmo), MX_OK);
+    zx_handle_t vmo;
+    EXPECT_EQ(zx_vmo_create(page_size, 0, &vmo), ZX_OK);
     EXPECT_LT(0, vmo, "vm_object_create");
 
     // This is the lowest non-canonical address on x86-64.  We want to
@@ -44,45 +44,45 @@
     uintptr_t noncanon_addr =
         ((uintptr_t) 1) << (x86_linear_address_width() - 1);
 
-    mx_info_vmar_t vmar_info;
-    mx_status_t status = mx_object_get_info(mx_vmar_root_self(), MX_INFO_VMAR,
+    zx_info_vmar_t vmar_info;
+    zx_status_t status = zx_object_get_info(zx_vmar_root_self(), ZX_INFO_VMAR,
                                             &vmar_info, sizeof(vmar_info),
                                             NULL, NULL);
-    EXPECT_EQ(MX_OK, status, "get_info");
+    EXPECT_EQ(ZX_OK, status, "get_info");
 
     // Check that we cannot map a page ending at |noncanon_addr|.
     size_t offset = noncanon_addr - page_size - vmar_info.base;
     uintptr_t addr;
-    status = mx_vmar_map(
-        mx_vmar_root_self(), offset, vmo, 0, page_size,
-        MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    status = zx_vmar_map(
+        zx_vmar_root_self(), offset, vmo, 0, page_size,
+        ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
         &addr);
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, status, "vm_map");
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, status, "vm_map");
 
     // Check that we can map at the next address down.  This helps to
     // verify that the previous check didn't fail for some unexpected
     // reason.
     offset = noncanon_addr - page_size * 2 - vmar_info.base;
-    status = mx_vmar_map(
-        mx_vmar_root_self(), offset, vmo, 0, page_size,
-        MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    status = zx_vmar_map(
+        zx_vmar_root_self(), offset, vmo, 0, page_size,
+        ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
         &addr);
-    EXPECT_EQ(MX_OK, status, "vm_map");
+    EXPECT_EQ(ZX_OK, status, "vm_map");
 
-    // Check that MX_VM_FLAG_SPECIFIC fails on already-mapped locations.
+    // Check that ZX_VM_FLAG_SPECIFIC fails on already-mapped locations.
     // Otherwise, the previous mapping could have overwritten
     // something that was in use, which could cause problems later.
-    status = mx_vmar_map(
-        mx_vmar_root_self(), offset, vmo, 0, page_size,
-        MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    status = zx_vmar_map(
+        zx_vmar_root_self(), offset, vmo, 0, page_size,
+        ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
         &addr);
-    EXPECT_EQ(MX_ERR_NO_MEMORY, status, "vm_map");
+    EXPECT_EQ(ZX_ERR_NO_MEMORY, status, "vm_map");
 
     // Clean up.
-    status = mx_vmar_unmap(mx_vmar_root_self(), addr, page_size);
-    EXPECT_EQ(MX_OK, status, "vm_unmap");
-    status = mx_handle_close(vmo);
-    EXPECT_EQ(MX_OK, status, "handle_close");
+    status = zx_vmar_unmap(zx_vmar_root_self(), addr, page_size);
+    EXPECT_EQ(ZX_OK, status, "vm_unmap");
+    status = zx_handle_close(vmo);
+    EXPECT_EQ(ZX_OK, status, "handle_close");
 #endif
 
     END_TEST;
diff --git a/system/utest/core/memory-mapping/rules.mk b/system/utest/core/memory-mapping/rules.mk
index fb919dd..20e532f 100644
--- a/system/utest/core/memory-mapping/rules.mk
+++ b/system/utest/core/memory-mapping/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := memory-mapping-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/mxr-mutex/mutex.c b/system/utest/core/mxr-mutex/mutex.c
index 04d79a1..e9d69d4 100644
--- a/system/utest/core/mxr-mutex/mutex.c
+++ b/system/utest/core/mxr-mutex/mutex.c
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <runtime/mutex.h>
 #include <unittest/unittest.h>
 #include <inttypes.h>
@@ -12,10 +12,10 @@
 #include <string.h>
 #include <threads.h>
 
-static mxr_mutex_t mutex = MXR_MUTEX_INIT;
+static zxr_mutex_t mutex = ZXR_MUTEX_INIT;
 
 static void xlog(const char* str) {
-    uint64_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+    uint64_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
     unittest_printf("[%08" PRIu64 ".%08" PRIu64 "]: %s",
                     now / 1000000000, now % 1000000000, str);
 }
@@ -24,9 +24,9 @@
     xlog("thread 1 started\n");
 
     for (int times = 0; times < 300; times++) {
-        mxr_mutex_lock(&mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(1)));
-        mxr_mutex_unlock(&mutex);
+        zxr_mutex_lock(&mutex);
+        zx_nanosleep(zx_deadline_after(ZX_USEC(1)));
+        zxr_mutex_unlock(&mutex);
     }
 
     xlog("thread 1 done\n");
@@ -37,9 +37,9 @@
     xlog("thread 2 started\n");
 
     for (int times = 0; times < 150; times++) {
-        mxr_mutex_lock(&mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(2)));
-        mxr_mutex_unlock(&mutex);
+        zxr_mutex_lock(&mutex);
+        zx_nanosleep(zx_deadline_after(ZX_USEC(2)));
+        zxr_mutex_unlock(&mutex);
     }
 
     xlog("thread 2 done\n");
@@ -50,9 +50,9 @@
     xlog("thread 3 started\n");
 
     for (int times = 0; times < 100; times++) {
-        mxr_mutex_lock(&mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(3)));
-        mxr_mutex_unlock(&mutex);
+        zxr_mutex_lock(&mutex);
+        zx_nanosleep(zx_deadline_after(ZX_USEC(3)));
+        zxr_mutex_unlock(&mutex);
     }
 
     xlog("thread 3 done\n");
@@ -67,11 +67,11 @@
     xlog("thread 1 started\n");
 
     for (int times = 0; times < 300 || !got_lock_1; times++) {
-        mx_status_t status = mxr_mutex_trylock(&mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(1)));
-        if (status == MX_OK) {
+        zx_status_t status = zxr_mutex_trylock(&mutex);
+        zx_nanosleep(zx_deadline_after(ZX_USEC(1)));
+        if (status == ZX_OK) {
             got_lock_1 = true;
-            mxr_mutex_unlock(&mutex);
+            zxr_mutex_unlock(&mutex);
         }
     }
 
@@ -83,11 +83,11 @@
     xlog("thread 2 started\n");
 
     for (int times = 0; times < 150 || !got_lock_2; times++) {
-        mx_status_t status = mxr_mutex_trylock(&mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(2)));
-        if (status == MX_OK) {
+        zx_status_t status = zxr_mutex_trylock(&mutex);
+        zx_nanosleep(zx_deadline_after(ZX_USEC(2)));
+        if (status == ZX_OK) {
             got_lock_2 = true;
-            mxr_mutex_unlock(&mutex);
+            zxr_mutex_unlock(&mutex);
         }
     }
 
@@ -99,11 +99,11 @@
     xlog("thread 3 started\n");
 
     for (int times = 0; times < 100 || !got_lock_3; times++) {
-        mx_status_t status = mxr_mutex_trylock(&mutex);
-        mx_nanosleep(mx_deadline_after(MX_USEC(3)));
-        if (status == MX_OK) {
+        zx_status_t status = zxr_mutex_trylock(&mutex);
+        zx_nanosleep(zx_deadline_after(ZX_USEC(3)));
+        if (status == ZX_OK) {
             got_lock_3 = true;
-            mxr_mutex_unlock(&mutex);
+            zxr_mutex_unlock(&mutex);
         }
     }
 
@@ -114,10 +114,10 @@
 static bool test_initializer(void) {
     BEGIN_TEST;
     // Let's not accidentally break .bss'd mutexes
-    static mxr_mutex_t static_mutex;
-    mxr_mutex_t mutex = MXR_MUTEX_INIT;
-    int status = memcmp(&static_mutex, &mutex, sizeof(mxr_mutex_t));
-    EXPECT_EQ(status, 0, "mxr_mutex's initializer is not all zeroes");
+    static zxr_mutex_t static_mutex;
+    zxr_mutex_t mutex = ZXR_MUTEX_INIT;
+    int status = memcmp(&static_mutex, &mutex, sizeof(zxr_mutex_t));
+    EXPECT_EQ(status, 0, "zxr_mutex's initializer is not all zeroes");
     END_TEST;
 }
 
@@ -156,11 +156,11 @@
 }
 
 
-BEGIN_TEST_CASE(mxr_mutex_tests)
+BEGIN_TEST_CASE(zxr_mutex_tests)
 RUN_TEST(test_initializer)
 RUN_TEST(test_mutexes)
 RUN_TEST(test_try_mutexes)
-END_TEST_CASE(mxr_mutex_tests)
+END_TEST_CASE(zxr_mutex_tests)
 
 #ifndef BUILD_COMBINED_TESTS
 int main(int argc, char** argv) {
diff --git a/system/utest/core/mxr-mutex/rules.mk b/system/utest/core/mxr-mutex/rules.mk
index 38fc56b..9acf78b 100644
--- a/system/utest/core/mxr-mutex/rules.mk
+++ b/system/utest/core/mxr-mutex/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := mxr-mutex-test
 
 MODULE_STATIC_LIBS := system/ulib/runtime
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/object-info/object-info.cpp b/system/utest/core/object-info/object-info.cpp
index ea1e585..f501f26 100644
--- a/system/utest/core/object-info/object-info.cpp
+++ b/system/utest/core/object-info/object-info.cpp
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/process.h>
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/process.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/object.h>
 #include <mini-process/mini-process.h>
 #include <unittest/unittest.h>
 
@@ -26,41 +26,41 @@
 namespace {
 
 // A function that returns a handle to get the info of.
-// Typically get_test_process, get_test_job, mx_process_self, mx_job_default.
-typedef mx_handle_t (*handle_source_fn)();
+// Typically get_test_process, get_test_job, zx_process_self, zx_job_default.
+typedef zx_handle_t (*handle_source_fn)();
 
 bool handle_valid_on_valid_handle_succeeds() {
     BEGIN_TEST;
-    EXPECT_EQ(mx_object_get_info(mx_process_self(), MX_INFO_HANDLE_VALID,
+    EXPECT_EQ(zx_object_get_info(zx_process_self(), ZX_INFO_HANDLE_VALID,
                                  nullptr, 0, nullptr, nullptr),
-              MX_OK);
+              ZX_OK);
     END_TEST;
 }
 
 bool handle_valid_on_closed_handle_fails() {
     BEGIN_TEST;
     // Create an event and show that it's valid.
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), MX_OK);
-    EXPECT_EQ(mx_object_get_info(event, MX_INFO_HANDLE_VALID,
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), ZX_OK);
+    EXPECT_EQ(zx_object_get_info(event, ZX_INFO_HANDLE_VALID,
                                  nullptr, 0, nullptr, nullptr),
-              MX_OK);
+              ZX_OK);
 
     // Close the handle and show that it becomes invalid.
-    mx_handle_close(event);
-    EXPECT_NE(mx_object_get_info(event, MX_INFO_HANDLE_VALID,
+    zx_handle_close(event);
+    EXPECT_NE(zx_object_get_info(event, ZX_INFO_HANDLE_VALID,
                                  nullptr, 0, nullptr, nullptr),
-              MX_OK);
+              ZX_OK);
     END_TEST;
 }
 
-// Tests that MX_INFO_TASK_STATS seems to work.
+// Tests that ZX_INFO_TASK_STATS seems to work.
 bool task_stats_smoke() {
     BEGIN_TEST;
-    mx_info_task_stats_t info;
-    ASSERT_EQ(mx_object_get_info(mx_process_self(), MX_INFO_TASK_STATS,
+    zx_info_task_stats_t info;
+    ASSERT_EQ(zx_object_get_info(zx_process_self(), ZX_INFO_TASK_STATS,
                                  &info, sizeof(info), nullptr, nullptr),
-              MX_OK);
+              ZX_OK);
     ASSERT_GT(info.mem_private_bytes, 0u);
     ASSERT_GT(info.mem_shared_bytes, 0u);
     ASSERT_GE(info.mem_mapped_bytes,
@@ -75,14 +75,14 @@
 typedef struct test_mapping {
     uintptr_t base;
     size_t size;
-    uint32_t flags; // MX_INFO_MAPS_MMU_FLAG_PERM_{READ,WRITE,EXECUTE}
+    uint32_t flags; // ZX_INFO_MAPS_MMU_FLAG_PERM_{READ,WRITE,EXECUTE}
 } test_mapping_t;
 
 // A VMO that the test process maps or has a handle to.
 typedef struct test_vmo {
-    mx_koid_t koid;
+    zx_koid_t koid;
     size_t size;
-    uint32_t flags; // MX_INFO_VMO_VIA_{HANDLE,MAPPING}
+    uint32_t flags; // ZX_INFO_VMO_VIA_{HANDLE,MAPPING}
 } test_vmo_t;
 
 typedef struct test_mapping_info {
@@ -95,82 +95,82 @@
 } test_mapping_info_t;
 
 // Gets the koid of the object pointed to by |handle|.
-mx_status_t get_koid(mx_handle_t handle, mx_koid_t* koid) {
-    mx_info_handle_basic_t info;
-    mx_status_t s = mx_object_get_info(handle, MX_INFO_HANDLE_BASIC,
+zx_status_t get_koid(zx_handle_t handle, zx_koid_t* koid) {
+    zx_info_handle_basic_t info;
+    zx_status_t s = zx_object_get_info(handle, ZX_INFO_HANDLE_BASIC,
                                        &info, sizeof(info), nullptr, nullptr);
-    if (s == MX_OK) {
+    if (s == ZX_OK) {
         *koid = info.koid;
     }
     return s;
 }
 
-// Returns a process singleton. MX_INFO_PROCESS_MAPS can't run on the current
+// Returns a process singleton. ZX_INFO_PROCESS_MAPS can't run on the current
 // process, so tests should use this instead.
 // This handle is leaked, and we expect our process teardown to clean it up
 // naturally.
-mx_handle_t get_test_process_etc(const test_mapping_info_t** info) {
-    static mx_handle_t test_process = MX_HANDLE_INVALID;
+zx_handle_t get_test_process_etc(const test_mapping_info_t** info) {
+    static zx_handle_t test_process = ZX_HANDLE_INVALID;
     static test_mapping_info_t* test_info = nullptr;
 
     if (info != nullptr) {
         *info = nullptr;
     }
-    if (test_process == MX_HANDLE_INVALID) {
+    if (test_process == ZX_HANDLE_INVALID) {
         // Create a VMO whose handle we'll give to the test process.
         // It will not be mapped into the test process's VMAR.
         const size_t unmapped_vmo_size = PAGE_SIZE;
-        mx_handle_t unmapped_vmo;
-        mx_status_t s = mx_vmo_create(
+        zx_handle_t unmapped_vmo;
+        zx_status_t s = zx_vmo_create(
             unmapped_vmo_size, /* options */ 0u, &unmapped_vmo);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "mx_vmo_create"); // Poison the test.
-            return MX_HANDLE_INVALID;
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "zx_vmo_create"); // Poison the test.
+            return ZX_HANDLE_INVALID;
         }
-        mx_koid_t unmapped_vmo_koid;
+        zx_koid_t unmapped_vmo_koid;
         s = get_koid(unmapped_vmo, &unmapped_vmo_koid);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "get_koid");
-            return MX_HANDLE_INVALID;
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "get_koid");
+            return ZX_HANDLE_INVALID;
         }
         // Try to set the name, but ignore any errors.
         static const char unmapped_vmo_name[] = "test:unmapped";
-        mx_object_set_property(unmapped_vmo, MX_PROP_NAME,
+        zx_object_set_property(unmapped_vmo, ZX_PROP_NAME,
                                unmapped_vmo_name, sizeof(unmapped_vmo_name));
 
         // Failures from here on will start to leak handles, but they'll
         // be cleaned up when this binary exits.
 
-        mx_handle_t process;
-        mx_handle_t vmar;
+        zx_handle_t process;
+        zx_handle_t vmar;
         static const char pname[] = "object-info-minipr";
-        s = mx_process_create(mx_job_default(), pname, sizeof(pname),
+        s = zx_process_create(zx_job_default(), pname, sizeof(pname),
                               /* options */ 0u, &process, &vmar);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "mx_process_create");
-            return MX_HANDLE_INVALID;
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "zx_process_create");
+            return ZX_HANDLE_INVALID;
         }
 
-        mx_handle_t thread;
+        zx_handle_t thread;
         static const char tname[] = "object-info-minith";
-        s = mx_thread_create(process, tname, sizeof(tname),
+        s = zx_thread_create(process, tname, sizeof(tname),
                              /* options */ 0u, &thread);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "mx_thread_create");
-            return MX_HANDLE_INVALID;
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "zx_thread_create");
+            return ZX_HANDLE_INVALID;
         }
 
-        mx_handle_t minip_channel;
+        zx_handle_t minip_channel;
         // Start the process before we mess with the VMAR,
         // so we don't step on the mapping done by start_mini_process_etc.
         s = start_mini_process_etc(process, thread, vmar, unmapped_vmo,
                                    &minip_channel);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "start_mini_process_etc");
-            return MX_HANDLE_INVALID;
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "start_mini_process_etc");
+            return ZX_HANDLE_INVALID;
         }
-        unmapped_vmo = MX_HANDLE_INVALID; // Transferred to the test process.
-        mx_handle_close(minip_channel);
+        unmapped_vmo = ZX_HANDLE_INVALID; // Transferred to the test process.
+        zx_handle_close(minip_channel);
 
         // Create a child VMAR and a mapping under it, so we have
         // something interesting to look at when getting the process's
@@ -191,44 +191,44 @@
 
         // Big enough to fit all of the mappings with some slop.
         ti->vmar_size = PAGE_SIZE * kNumMappings * 16;
-        mx_handle_t sub_vmar;
-        s = mx_vmar_allocate(vmar, /* offset */ 0,
+        zx_handle_t sub_vmar;
+        s = zx_vmar_allocate(vmar, /* offset */ 0,
                              ti->vmar_size,
-                             MX_VM_FLAG_CAN_MAP_READ |
-                                 MX_VM_FLAG_CAN_MAP_WRITE |
-                                 MX_VM_FLAG_CAN_MAP_EXECUTE,
+                             ZX_VM_FLAG_CAN_MAP_READ |
+                                 ZX_VM_FLAG_CAN_MAP_WRITE |
+                                 ZX_VM_FLAG_CAN_MAP_EXECUTE,
                              &sub_vmar, &ti->vmar_base);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "mx_vmar_allocate");
-            return MX_HANDLE_INVALID;
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "zx_vmar_allocate");
+            return ZX_HANDLE_INVALID;
         }
 
-        mx_handle_t vmo;
+        zx_handle_t vmo;
         const size_t vmo_size = PAGE_SIZE * kNumMappings;
-        s = mx_vmo_create(vmo_size, /* options */ 0u, &vmo);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "mx_vmo_create");
-            return MX_HANDLE_INVALID;
+        s = zx_vmo_create(vmo_size, /* options */ 0u, &vmo);
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "zx_vmo_create");
+            return ZX_HANDLE_INVALID;
         }
-        mx_koid_t vmo_koid;
+        zx_koid_t vmo_koid;
         s = get_koid(vmo, &vmo_koid);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "get_koid");
-            return MX_HANDLE_INVALID;
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "get_koid");
+            return ZX_HANDLE_INVALID;
         }
         // Try to set the name, but ignore any errors.
         static const char vmo_name[] = "test:mapped";
-        mx_object_set_property(vmo, MX_PROP_NAME, vmo_name, sizeof(vmo_name));
+        zx_object_set_property(vmo, ZX_PROP_NAME, vmo_name, sizeof(vmo_name));
 
         // Record the VMOs now that we have both of them.
         ti->num_vmos = 2;
         ti->vmos = (test_vmo_t*)malloc(2 * sizeof(test_vmo_t));
         ti->vmos[0].koid = unmapped_vmo_koid;
         ti->vmos[0].size = unmapped_vmo_size;
-        ti->vmos[0].flags = MX_INFO_VMO_VIA_HANDLE;
+        ti->vmos[0].flags = ZX_INFO_VMO_VIA_HANDLE;
         ti->vmos[1].koid = vmo_koid;
         ti->vmos[1].size = vmo_size;
-        ti->vmos[1].flags = MX_INFO_VMO_VIA_MAPPING;
+        ti->vmos[1].flags = ZX_INFO_VMO_VIA_MAPPING;
 
         // Map each page of the VMO to some arbitray location in the VMAR.
         for (size_t i = 0; i < kNumMappings; i++) {
@@ -238,28 +238,28 @@
             // Pick flags for this mapping; cycle through different
             // combinations for the test. Must always have READ set
             // to be mapped.
-            m->flags = MX_VM_FLAG_PERM_READ;
+            m->flags = ZX_VM_FLAG_PERM_READ;
             if (i & 1) {
-                m->flags |= MX_VM_FLAG_PERM_WRITE;
+                m->flags |= ZX_VM_FLAG_PERM_WRITE;
             }
             if (i & 2) {
-                m->flags |= MX_VM_FLAG_PERM_EXECUTE;
+                m->flags |= ZX_VM_FLAG_PERM_EXECUTE;
             }
 
-            s = mx_vmar_map(sub_vmar, /* vmar_offset (ignored) */ 0,
+            s = zx_vmar_map(sub_vmar, /* vmar_offset (ignored) */ 0,
                             vmo, /* vmo_offset */ i * PAGE_SIZE,
                             /* len */ PAGE_SIZE,
                             m->flags,
                             &m->base);
-            if (s != MX_OK) {
+            if (s != ZX_OK) {
                 char msg[32];
-                snprintf(msg, sizeof(msg), "mx_vmar_map: [%zd]", i);
-                EXPECT_EQ(s, MX_OK, msg);
-                return MX_HANDLE_INVALID;
+                snprintf(msg, sizeof(msg), "zx_vmar_map: [%zd]", i);
+                EXPECT_EQ(s, ZX_OK, msg);
+                return ZX_HANDLE_INVALID;
             }
         }
-        mx_handle_close(vmo); // Kept alive by the VMAR.
-        mx_handle_close(sub_vmar); // Kept alive by the process.
+        zx_handle_close(vmo); // Kept alive by the VMAR.
+        zx_handle_close(sub_vmar); // Kept alive by the process.
 
         test_process = process;
         test_info = ti;
@@ -270,36 +270,36 @@
     return test_process;
 }
 
-mx_handle_t get_test_process() {
+zx_handle_t get_test_process() {
     return get_test_process_etc(nullptr);
 }
 
-// Tests that MX_INFO_PROCESS_MAPS seems to work.
+// Tests that ZX_INFO_PROCESS_MAPS seems to work.
 bool process_maps_smoke() {
     BEGIN_TEST;
     const test_mapping_info_t* test_info;
-    const mx_handle_t process = get_test_process_etc(&test_info);
+    const zx_handle_t process = get_test_process_etc(&test_info);
     ASSERT_NONNULL(test_info, "get_test_process_etc");
 
     // Buffer big enough to read all of the test process's map entries.
-    const size_t bufsize = test_info->num_mappings * 4 * sizeof(mx_info_maps_t);
-    mx_info_maps_t* maps = (mx_info_maps_t*)malloc(bufsize);
+    const size_t bufsize = test_info->num_mappings * 4 * sizeof(zx_info_maps_t);
+    zx_info_maps_t* maps = (zx_info_maps_t*)malloc(bufsize);
 
     // Read the map entries.
     size_t actual;
     size_t avail;
-    ASSERT_EQ(mx_object_get_info(process, MX_INFO_PROCESS_MAPS,
+    ASSERT_EQ(zx_object_get_info(process, ZX_INFO_PROCESS_MAPS,
                                  maps, bufsize,
                                  &actual, &avail),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(actual, avail, "Should have read all entries");
 
     // The first two entries should always be the ASpace and root VMAR.
     ASSERT_GE(actual, 2u, "Root aspace/vmar missing?");
-    EXPECT_EQ(maps[0].type, (uint32_t)MX_INFO_MAPS_TYPE_ASPACE);
+    EXPECT_EQ(maps[0].type, (uint32_t)ZX_INFO_MAPS_TYPE_ASPACE);
     EXPECT_EQ(maps[0].depth, 0u, "ASpace depth");
     EXPECT_GT(maps[0].size, 1u * 1024 * 1024 * 1024 * 1024, "ASpace size");
-    EXPECT_EQ(maps[1].type, (uint32_t)MX_INFO_MAPS_TYPE_VMAR);
+    EXPECT_EQ(maps[1].type, (uint32_t)ZX_INFO_MAPS_TYPE_VMAR);
     EXPECT_EQ(maps[1].depth, 1u, "Root VMAR depth");
     EXPECT_GT(maps[1].size, 1u * 1024 * 1024 * 1024 * 1024, "Root VMAR size");
 
@@ -312,7 +312,7 @@
 
     LTRACEF("\n");
     for (size_t i = 2; i < actual; i++) {
-        mx_info_maps_t* entry = maps + i;
+        zx_info_maps_t* entry = maps + i;
         char msg[128];
         snprintf(msg, sizeof(msg),
                  "[%2zd] %*stype:%u base:0x%" PRIx64 " size:%" PRIu64,
@@ -321,11 +321,11 @@
         LTRACEF("%s\n", msg);
         // All entries should be children of the root VMAR.
         EXPECT_GT(entry->depth, 1u, msg);
-        EXPECT_TRUE(entry->type >= MX_INFO_MAPS_TYPE_ASPACE &&
-                        entry->type < MX_INFO_MAPS_TYPE_LAST,
+        EXPECT_TRUE(entry->type >= ZX_INFO_MAPS_TYPE_ASPACE &&
+                        entry->type < ZX_INFO_MAPS_TYPE_LAST,
                     msg);
 
-        if (entry->type == MX_INFO_MAPS_TYPE_VMAR &&
+        if (entry->type == ZX_INFO_MAPS_TYPE_VMAR &&
             entry->base == test_info->vmar_base &&
             entry->size == test_info->vmar_size) {
             saw_vmar = true;
@@ -337,7 +337,7 @@
                 vmar_depth = 0;
             } else {
                 // |entry| should be a child mapping of our VMAR.
-                EXPECT_EQ((uint32_t)MX_INFO_MAPS_TYPE_MAPPING, entry->type,
+                EXPECT_EQ((uint32_t)ZX_INFO_MAPS_TYPE_MAPPING, entry->type,
                           msg);
                 // The mapping should fit inside the VMAR.
                 EXPECT_LE(test_info->vmar_base, entry->base, msg);
@@ -367,14 +367,14 @@
     EXPECT_EQ((uint32_t)(1 << test_info->num_mappings) - 1, saw_mapping);
 
     // Do one more read with a short buffer to test actual < avail.
-    const size_t bufsize2 = actual * 3 / 4 * sizeof(mx_info_maps_t);
-    mx_info_maps_t* maps2 = (mx_info_maps_t*)malloc(bufsize2);
+    const size_t bufsize2 = actual * 3 / 4 * sizeof(zx_info_maps_t);
+    zx_info_maps_t* maps2 = (zx_info_maps_t*)malloc(bufsize2);
     size_t actual2;
     size_t avail2;
-    ASSERT_EQ(mx_object_get_info(process, MX_INFO_PROCESS_MAPS,
+    ASSERT_EQ(zx_object_get_info(process, ZX_INFO_PROCESS_MAPS,
                                  maps2, bufsize2,
                                  &actual2, &avail2),
-              MX_OK);
+              ZX_OK);
     EXPECT_LT(actual2, avail2);
     // mini-process is very simple, and won't have modified its own memory
     // maps since the previous dump. Its "committed_pages" values could be
@@ -383,8 +383,8 @@
     LTRACEF("\n");
     EXPECT_GT(actual2, 3u); // Make sure we're looking at something.
     for (size_t i = 0; i < actual2; i++) {
-        mx_info_maps_t* e1 = maps + i;
-        mx_info_maps_t* e2 = maps2 + i;
+        zx_info_maps_t* e1 = maps + i;
+        zx_info_maps_t* e2 = maps2 + i;
         char msg[128];
         snprintf(msg, sizeof(msg),
                  "[%2zd] %*stype:%u/%u base:0x%" PRIx64 "/0x%" PRIx64
@@ -396,7 +396,7 @@
         EXPECT_EQ(e1->size, e2->size, msg);
         EXPECT_EQ(e1->depth, e2->depth, msg);
         EXPECT_EQ(e1->type, e2->type, msg);
-        if (e1->type == e2->type && e2->type == MX_INFO_MAPS_TYPE_MAPPING) {
+        if (e1->type == e2->type && e2->type == ZX_INFO_MAPS_TYPE_MAPPING) {
             EXPECT_EQ(e1->u.mapping.mmu_flags, e2->u.mapping.mmu_flags, msg);
         }
     }
@@ -414,9 +414,9 @@
     size_t avail;
     // It's illegal to look at your own entries, because the output buffer
     // lives inside the address space that's being examined.
-    EXPECT_EQ(mx_object_get_info(mx_process_self(), Topic,
+    EXPECT_EQ(zx_object_get_info(zx_process_self(), Topic,
                                  entries, sizeof(entries), &actual, &avail),
-              MX_ERR_ACCESS_DENIED);
+              ZX_ERR_ACCESS_DENIED);
     END_TEST;
 }
 
@@ -426,10 +426,10 @@
     EntryType entries[2];
     size_t actual;
     size_t avail;
-    // Passing MX_HANDLE_INVALID should fail.
-    EXPECT_EQ(mx_object_get_info(MX_HANDLE_INVALID, Topic,
+    // Passing ZX_HANDLE_INVALID should fail.
+    EXPECT_EQ(zx_object_get_info(ZX_HANDLE_INVALID, Topic,
                                  entries, sizeof(entries), &actual, &avail),
-              MX_ERR_BAD_HANDLE);
+              ZX_ERR_BAD_HANDLE);
     END_TEST;
 }
 
@@ -440,45 +440,45 @@
     size_t actual;
     size_t avail;
     // Passing a handle to an unsupported object type should fail.
-    EXPECT_NE(mx_object_get_info(GetWrongHandle(), Topic,
+    EXPECT_NE(zx_object_get_info(GetWrongHandle(), Topic,
                                  entries, sizeof(entries), &actual, &avail),
-              MX_OK);
+              ZX_OK);
     END_TEST;
 }
 
 template <uint32_t Topic, typename EntryType,
-          handle_source_fn GetHandle, mx_rights_t MissingRights>
+          handle_source_fn GetHandle, zx_rights_t MissingRights>
 bool missing_rights_fails() {
     BEGIN_TEST;
     // Call should succeed with the default rights.
-    mx_handle_t obj = GetHandle();
+    zx_handle_t obj = GetHandle();
     EntryType entries[2];
     size_t actual;
     size_t avail;
-    EXPECT_EQ(mx_object_get_info(obj, Topic,
+    EXPECT_EQ(zx_object_get_info(obj, Topic,
                                  entries, sizeof(entries), &actual, &avail),
-              MX_OK);
+              ZX_OK);
 
     // Get the test object handle rights.
-    mx_info_handle_basic_t hi;
-    ASSERT_EQ(mx_object_get_info(obj, MX_INFO_HANDLE_BASIC,
+    zx_info_handle_basic_t hi;
+    ASSERT_EQ(zx_object_get_info(obj, ZX_INFO_HANDLE_BASIC,
                                  &hi, sizeof(hi), nullptr, nullptr),
-              MX_OK);
+              ZX_OK);
     char msg[32];
     snprintf(msg, sizeof(msg), "rights 0x%" PRIx32, hi.rights);
     EXPECT_EQ(hi.rights & MissingRights, MissingRights, msg);
 
     // Create a handle without the important rights.
-    mx_handle_t handle;
-    ASSERT_EQ(mx_handle_duplicate(obj, hi.rights & ~MissingRights, &handle),
-              MX_OK);
+    zx_handle_t handle;
+    ASSERT_EQ(zx_handle_duplicate(obj, hi.rights & ~MissingRights, &handle),
+              ZX_OK);
 
     // Call should fail without these rights.
-    EXPECT_EQ(mx_object_get_info(handle, Topic,
+    EXPECT_EQ(zx_object_get_info(handle, Topic,
                                  entries, sizeof(entries), &actual, &avail),
-              MX_ERR_ACCESS_DENIED);
+              ZX_ERR_ACCESS_DENIED);
 
-    mx_handle_close(handle);
+    zx_handle_close(handle);
     END_TEST;
 }
 
@@ -490,11 +490,11 @@
     size_t avail;
     // Passing a zero-sized buffer to a topic that expects a single
     // in/out entry should fail.
-    EXPECT_EQ(mx_object_get_info(GetHandle(), Topic,
+    EXPECT_EQ(zx_object_get_info(GetHandle(), Topic,
                                  &entry, // buffer
                                  0, // len
                                  &actual, &avail),
-              MX_ERR_BUFFER_TOO_SMALL);
+              ZX_ERR_BUFFER_TOO_SMALL);
     EXPECT_EQ(0u, actual);
     EXPECT_GT(avail, 0u);
     END_TEST;
@@ -507,11 +507,11 @@
     size_t avail;
     // Passing a zero-sized null buffer to a topic that can handle multiple
     // in/out entries should succeed.
-    EXPECT_EQ(mx_object_get_info(GetHandle(), Topic,
+    EXPECT_EQ(zx_object_get_info(GetHandle(), Topic,
                                  nullptr, // buffer
                                  0, // len
                                  &actual, &avail),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(0u, actual);
     EXPECT_GT(avail, 0u);
     END_TEST;
@@ -524,11 +524,11 @@
     size_t actual;
     size_t avail;
     // Passing a buffer shorter than avail should succeed.
-    EXPECT_EQ(mx_object_get_info(GetHandle(), Topic,
+    EXPECT_EQ(zx_object_get_info(GetHandle(), Topic,
                                  entries,
                                  sizeof(entries),
                                  &actual, &avail),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(1u, actual);
     EXPECT_GT(avail, actual);
     END_TEST;
@@ -538,11 +538,11 @@
 bool null_avail_actual_succeeds() {
     BEGIN_TEST;
     EntryType entries[2];
-    EXPECT_EQ(mx_object_get_info(GetHandle(), Topic,
+    EXPECT_EQ(zx_object_get_info(GetHandle(), Topic,
                                  entries, sizeof(entries),
                                  nullptr, // actual
                                  nullptr), // avail
-              MX_OK);
+              ZX_OK);
     END_TEST;
 }
 
@@ -551,12 +551,12 @@
     BEGIN_TEST;
     size_t actual;
     size_t avail;
-    EXPECT_EQ(mx_object_get_info(GetHandle(), Topic,
+    EXPECT_EQ(zx_object_get_info(GetHandle(), Topic,
                                  // Bad buffer pointer value.
                                  (EntryType*)1,
                                  sizeof(EntryType),
                                  &actual, &avail),
-              MX_ERR_INVALID_ARGS);
+              ZX_ERR_INVALID_ARGS);
     END_TEST;
 }
 
@@ -566,28 +566,28 @@
 bool partially_unmapped_buffer_fails() {
     BEGIN_TEST;
     // Create a two-page VMAR.
-    mx_handle_t vmar;
+    zx_handle_t vmar;
     uintptr_t vmar_addr;
-    ASSERT_EQ(mx_vmar_allocate(mx_vmar_root_self(),
+    ASSERT_EQ(zx_vmar_allocate(zx_vmar_root_self(),
                                0, 2 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ |
-                                   MX_VM_FLAG_CAN_MAP_WRITE |
-                                   MX_VM_FLAG_CAN_MAP_SPECIFIC,
+                               ZX_VM_FLAG_CAN_MAP_READ |
+                                   ZX_VM_FLAG_CAN_MAP_WRITE |
+                                   ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                &vmar, &vmar_addr),
-              MX_OK);
+              ZX_OK);
 
     // Create a one-page VMO.
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &vmo), MX_OK);
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &vmo), ZX_OK);
 
     // Map the first page of the VMAR.
     uintptr_t vmo_addr;
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_SPECIFIC |
-                              MX_VM_FLAG_PERM_READ |
-                              MX_VM_FLAG_PERM_WRITE,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_SPECIFIC |
+                              ZX_VM_FLAG_PERM_READ |
+                              ZX_VM_FLAG_PERM_WRITE,
                           &vmo_addr),
-              MX_OK);
+              ZX_OK);
     ASSERT_EQ(vmar_addr, vmo_addr);
 
     // Point to a spot in the mapped page just before the unmapped region:
@@ -597,15 +597,15 @@
 
     size_t actual;
     size_t avail;
-    EXPECT_EQ(mx_object_get_info(GetHandle(), Topic,
+    EXPECT_EQ(zx_object_get_info(GetHandle(), Topic,
                                  entries, sizeof(EntryType) * 4,
                                  &actual, &avail),
-              // Bad user buffer should return MX_ERR_INVALID_ARGS.
-              MX_ERR_INVALID_ARGS);
+              // Bad user buffer should return ZX_ERR_INVALID_ARGS.
+              ZX_ERR_INVALID_ARGS);
 
-    mx_vmar_destroy(vmar);
-    mx_handle_close(vmar);
-    mx_handle_close(vmo);
+    zx_vmar_destroy(vmar);
+    zx_handle_close(vmar);
+    zx_handle_close(vmo);
     END_TEST;
 }
 
@@ -614,12 +614,12 @@
     BEGIN_TEST;
     EntryType entries[2];
     size_t avail;
-    EXPECT_EQ(mx_object_get_info(GetHandle(), Topic,
+    EXPECT_EQ(zx_object_get_info(GetHandle(), Topic,
                                  entries, sizeof(entries),
                                  // Bad actual pointer value.
                                  (size_t*)1,
                                  &avail),
-              MX_ERR_INVALID_ARGS);
+              ZX_ERR_INVALID_ARGS);
     END_TEST;
 }
 
@@ -628,35 +628,35 @@
     BEGIN_TEST;
     EntryType entries[2];
     size_t actual;
-    EXPECT_EQ(mx_object_get_info(GetHandle(), Topic,
+    EXPECT_EQ(zx_object_get_info(GetHandle(), Topic,
                                  entries, sizeof(entries), &actual,
                                  // Bad available pointer value.
                                  (size_t*)1),
-              MX_ERR_INVALID_ARGS);
+              ZX_ERR_INVALID_ARGS);
     END_TEST;
 }
 
-// Tests that MX_INFO_PROCESS_VMOS seems to work.
+// Tests that ZX_INFO_PROCESS_VMOS seems to work.
 bool process_vmos_smoke() {
     BEGIN_TEST;
     const test_mapping_info_t* test_info;
-    const mx_handle_t process = get_test_process_etc(&test_info);
+    const zx_handle_t process = get_test_process_etc(&test_info);
     ASSERT_NONNULL(test_info, "get_test_process_etc");
 
     // Buffer big enough to read all of the test process's VMO entries.
     // There'll be one per mapping, one for the unmapped VMO, plus some
     // extras (at least the vDSO and the mini-process stack).
     const size_t bufsize =
-        (test_info->num_mappings + 1 + 8) * sizeof(mx_info_vmo_t);
-    mx_info_vmo_t* vmos = (mx_info_vmo_t*)malloc(bufsize);
+        (test_info->num_mappings + 1 + 8) * sizeof(zx_info_vmo_t);
+    zx_info_vmo_t* vmos = (zx_info_vmo_t*)malloc(bufsize);
 
     // Read the VMO entries.
     size_t actual;
     size_t avail;
-    ASSERT_EQ(mx_object_get_info(process, MX_INFO_PROCESS_VMOS,
+    ASSERT_EQ(zx_object_get_info(process, ZX_INFO_PROCESS_VMOS,
                                  vmos, bufsize,
                                  &actual, &avail),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(actual, avail, "Should have read all entries");
 
     // Look for the expected VMOs.
@@ -665,7 +665,7 @@
 
     LTRACEF("\n");
     for (size_t i = 0; i < actual; i++) {
-        mx_info_vmo_t* entry = vmos + i;
+        zx_info_vmo_t* entry = vmos + i;
         char msg[128];
         snprintf(msg, sizeof(msg),
                  "[%2zd] koid:%" PRIu64 " name:'%s' size:%" PRIu64
@@ -687,14 +687,14 @@
                 EXPECT_EQ(entry->num_children, 0u, msg);
                 EXPECT_EQ(entry->share_count, 1u, msg);
                 EXPECT_EQ(t->flags & entry->flags, t->flags, msg);
-                if (entry->flags & MX_INFO_VMO_VIA_HANDLE) {
+                if (entry->flags & ZX_INFO_VMO_VIA_HANDLE) {
                     EXPECT_EQ(entry->num_mappings, 0u, msg);
                 } else {
-                    EXPECT_NE(entry->flags & MX_INFO_VMO_VIA_MAPPING, 0u, msg);
+                    EXPECT_NE(entry->flags & ZX_INFO_VMO_VIA_MAPPING, 0u, msg);
                     EXPECT_EQ(
                         entry->num_mappings, test_info->num_mappings, msg);
                 }
-                EXPECT_EQ(entry->flags & MX_INFO_VMO_IS_COW_CLONE, 0u, msg);
+                EXPECT_EQ(entry->flags & ZX_INFO_VMO_IS_COW_CLONE, 0u, msg);
 
                 saw_vmo |= 1 << j; // Duplicates are fine and expected
                 break;
@@ -702,16 +702,16 @@
         }
 
         // All of our VMOs should be paged, not physical.
-        EXPECT_EQ(MX_INFO_VMO_TYPE(entry->flags), MX_INFO_VMO_TYPE_PAGED, msg);
+        EXPECT_EQ(ZX_INFO_VMO_TYPE(entry->flags), ZX_INFO_VMO_TYPE_PAGED, msg);
 
         // Each entry should be via either map or handle, but not both.
         // NOTE: This could change in the future, but currently reflects
         // the way things work.
         const uint32_t kViaMask =
-            MX_INFO_VMO_VIA_HANDLE | MX_INFO_VMO_VIA_MAPPING;
+            ZX_INFO_VMO_VIA_HANDLE | ZX_INFO_VMO_VIA_MAPPING;
         EXPECT_NE(entry->flags & kViaMask, kViaMask, msg);
 
-        // TODO(dbort): Test more fields/flags of mx_info_vmo_t by adding some
+        // TODO(dbort): Test more fields/flags of zx_info_vmo_t by adding some
         // clones, shared VMOs, mapped+handle VMOs, physical VMOs if possible.
         // All but committed_bytes should be predictable.
     }
@@ -720,14 +720,14 @@
     EXPECT_EQ((uint32_t)(1 << test_info->num_vmos) - 1, saw_vmo);
 
     // Do one more read with a short buffer to test actual < avail.
-    const size_t bufsize2 = actual * 3 / 4 * sizeof(mx_info_vmo_t);
-    mx_info_vmo_t* vmos2 = (mx_info_vmo_t*)malloc(bufsize2);
+    const size_t bufsize2 = actual * 3 / 4 * sizeof(zx_info_vmo_t);
+    zx_info_vmo_t* vmos2 = (zx_info_vmo_t*)malloc(bufsize2);
     size_t actual2;
     size_t avail2;
-    ASSERT_EQ(mx_object_get_info(process, MX_INFO_PROCESS_VMOS,
+    ASSERT_EQ(zx_object_get_info(process, ZX_INFO_PROCESS_VMOS,
                                  vmos2, bufsize2,
                                  &actual2, &avail2),
-              MX_OK);
+              ZX_OK);
     EXPECT_LT(actual2, avail2);
     // mini-process is very simple, and won't have modified its own set of VMOs
     // since the previous dump.
@@ -735,8 +735,8 @@
     LTRACEF("\n");
     EXPECT_GT(actual2, 3u); // Make sure we're looking at something.
     for (size_t i = 0; i < actual2; i++) {
-        mx_info_vmo_t* e1 = vmos + i;
-        mx_info_vmo_t* e2 = vmos2 + i;
+        zx_info_vmo_t* e1 = vmos + i;
+        zx_info_vmo_t* e2 = vmos2 + i;
         char msg[128];
         snprintf(msg, sizeof(msg),
                  "[%2zd] koid:%" PRIu64 "/%" PRIu64 " name:'%s'/'%s' "
@@ -747,7 +747,7 @@
         EXPECT_EQ(e1->koid, e2->koid, msg);
         EXPECT_EQ(e1->size_bytes, e2->size_bytes, msg);
         EXPECT_EQ(e1->flags, e2->flags, msg);
-        if (e1->flags == e2->flags && e2->flags & MX_INFO_VMO_VIA_HANDLE) {
+        if (e1->flags == e2->flags && e2->flags & ZX_INFO_VMO_VIA_HANDLE) {
             EXPECT_EQ(e1->handle_rights, e2->handle_rights, msg);
         }
     }
@@ -757,7 +757,7 @@
     END_TEST;
 }
 
-// MX_INFO_JOB_PROCESS/MX_INFO_JOB_CHILDREN tests
+// ZX_INFO_JOB_PROCESS/ZX_INFO_JOB_CHILDREN tests
 
 // Returns a job with the structure:
 // - returned job
@@ -772,53 +772,53 @@
 //     - grandchild job 2.1
 const size_t kTestJobChildProcs = 3;
 const size_t kTestJobChildJobs = 2;
-mx_handle_t get_test_job() {
-    static mx_handle_t test_job = MX_HANDLE_INVALID;
+zx_handle_t get_test_job() {
+    static zx_handle_t test_job = ZX_HANDLE_INVALID;
 
-    if (test_job == MX_HANDLE_INVALID) {
+    if (test_job == ZX_HANDLE_INVALID) {
         char msg[64];
-        mx_handle_t root;
-        mx_status_t s = mx_job_create(mx_job_default(), 0, &root);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "mx_job_create"); // Poison the test.
-            return MX_HANDLE_INVALID;
+        zx_handle_t root;
+        zx_status_t s = zx_job_create(zx_job_default(), 0, &root);
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "zx_job_create"); // Poison the test.
+            return ZX_HANDLE_INVALID;
         }
         for (size_t i = 0; i < kTestJobChildProcs; i++) {
-            mx_handle_t proc;
-            mx_handle_t vmar;
-            s = mx_process_create(root, "child", 6, 0, &proc, &vmar);
-            if (s != MX_OK) {
-                snprintf(msg, sizeof(msg), "mx_process_create(child %zu)", i);
+            zx_handle_t proc;
+            zx_handle_t vmar;
+            s = zx_process_create(root, "child", 6, 0, &proc, &vmar);
+            if (s != ZX_OK) {
+                snprintf(msg, sizeof(msg), "zx_process_create(child %zu)", i);
                 goto fail;
             }
         }
         for (size_t i = 0; i < kTestJobChildJobs; i++) {
-            mx_handle_t job;
-            s = mx_job_create(root, 0, &job);
-            if (s != MX_OK) {
-                snprintf(msg, sizeof(msg), "mx_job_create(child %zu)", i);
+            zx_handle_t job;
+            s = zx_job_create(root, 0, &job);
+            if (s != ZX_OK) {
+                snprintf(msg, sizeof(msg), "zx_job_create(child %zu)", i);
                 goto fail;
             }
-            mx_handle_t proc;
-            mx_handle_t vmar;
-            s = mx_process_create(job, "grandchild", 6, 0, &proc, &vmar);
-            if (s != MX_OK) {
-                snprintf(msg, sizeof(msg), "mx_process_create(grandchild)");
+            zx_handle_t proc;
+            zx_handle_t vmar;
+            s = zx_process_create(job, "grandchild", 6, 0, &proc, &vmar);
+            if (s != ZX_OK) {
+                snprintf(msg, sizeof(msg), "zx_process_create(grandchild)");
                 goto fail;
             }
-            mx_handle_t subjob;
-            s = mx_job_create(job, 0, &subjob);
-            if (s != MX_OK) {
-                snprintf(msg, sizeof(msg), "mx_job_create(grandchild)");
+            zx_handle_t subjob;
+            s = zx_job_create(job, 0, &subjob);
+            if (s != ZX_OK) {
+                snprintf(msg, sizeof(msg), "zx_job_create(grandchild)");
                 goto fail;
             }
         }
 
         if (false) {
         fail:
-            EXPECT_EQ(s, MX_OK, msg); // Poison the test
-            mx_task_kill(root); // Clean up all tasks; leaks handles
-            return MX_HANDLE_INVALID;
+            EXPECT_EQ(s, ZX_OK, msg); // Poison the test
+            zx_task_kill(root); // Clean up all tasks; leaks handles
+            return ZX_HANDLE_INVALID;
         }
         test_job = root;
     }
@@ -827,38 +827,38 @@
 }
 
 // The jobch_helper_* (job child helper) functions allow testing both
-// MX_INFO_JOB_PROCESS and MX_INFO_JOB_CHILDREN.
+// ZX_INFO_JOB_PROCESS and ZX_INFO_JOB_CHILDREN.
 bool jobch_helper_smoke(uint32_t topic, size_t expected_count) {
     BEGIN_TEST;
-    mx_koid_t koids[32];
+    zx_koid_t koids[32];
     size_t actual;
     size_t avail;
-    EXPECT_EQ(mx_object_get_info(get_test_job(), topic,
+    EXPECT_EQ(zx_object_get_info(get_test_job(), topic,
                                  koids, sizeof(koids), &actual, &avail),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(expected_count, actual);
     EXPECT_EQ(expected_count, avail);
 
     // All returned koids should produce a valid handle when passed to
-    // mx_object_get_child.
+    // zx_object_get_child.
     for (size_t i = 0; i < actual; i++) {
         char msg[32];
         snprintf(msg, sizeof(msg), "koid %zu", koids[i]);
-        mx_handle_t h = MX_HANDLE_INVALID;
-        EXPECT_EQ(mx_object_get_child(get_test_job(), koids[i],
-                                      MX_RIGHT_SAME_RIGHTS, &h),
-                  MX_OK, msg);
-        mx_handle_close(h);
+        zx_handle_t h = ZX_HANDLE_INVALID;
+        EXPECT_EQ(zx_object_get_child(get_test_job(), koids[i],
+                                      ZX_RIGHT_SAME_RIGHTS, &h),
+                  ZX_OK, msg);
+        zx_handle_close(h);
     }
     END_TEST;
 }
 
 bool job_processes_smoke() {
-    return jobch_helper_smoke(MX_INFO_JOB_PROCESSES, kTestJobChildProcs);
+    return jobch_helper_smoke(ZX_INFO_JOB_PROCESSES, kTestJobChildProcs);
 }
 
 bool job_children_smoke() {
-    return jobch_helper_smoke(MX_INFO_JOB_CHILDREN, kTestJobChildJobs);
+    return jobch_helper_smoke(ZX_INFO_JOB_CHILDREN, kTestJobChildJobs);
 }
 
 } // namespace
@@ -888,92 +888,92 @@
 
 BEGIN_TEST_CASE(object_info_tests)
 
-// MX_INFO_HANDLE_VALID is an oddball that doesn't care about its buffer,
+// ZX_INFO_HANDLE_VALID is an oddball that doesn't care about its buffer,
 // so we can't use the normal topic test suites.
 RUN_TEST(handle_valid_on_valid_handle_succeeds);
 RUN_TEST(handle_valid_on_closed_handle_fails);
-RUN_TEST((invalid_handle_fails<MX_INFO_HANDLE_VALID, void*>));
+RUN_TEST((invalid_handle_fails<ZX_INFO_HANDLE_VALID, void*>));
 
 RUN_TEST(task_stats_smoke);
-RUN_SINGLE_ENTRY_TESTS(MX_INFO_TASK_STATS, mx_info_task_stats_t, mx_process_self);
-RUN_TEST((wrong_handle_type_fails<MX_INFO_TASK_STATS, mx_info_task_stats_t, get_test_job>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_TASK_STATS, mx_info_task_stats_t, mx_thread_self>));
+RUN_SINGLE_ENTRY_TESTS(ZX_INFO_TASK_STATS, zx_info_task_stats_t, zx_process_self);
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_TASK_STATS, zx_info_task_stats_t, get_test_job>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_TASK_STATS, zx_info_task_stats_t, zx_thread_self>));
 
 RUN_TEST(process_maps_smoke);
-RUN_MULTI_ENTRY_TESTS(MX_INFO_PROCESS_MAPS, mx_info_maps_t, get_test_process);
-RUN_TEST((self_fails<MX_INFO_PROCESS_MAPS, mx_info_maps_t>))
-RUN_TEST((wrong_handle_type_fails<MX_INFO_PROCESS_MAPS, mx_info_maps_t, get_test_job>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_PROCESS_MAPS, mx_info_maps_t, mx_thread_self>));
-RUN_TEST((missing_rights_fails<MX_INFO_PROCESS_MAPS, mx_info_maps_t, get_test_process,
-                               MX_RIGHT_READ>));
+RUN_MULTI_ENTRY_TESTS(ZX_INFO_PROCESS_MAPS, zx_info_maps_t, get_test_process);
+RUN_TEST((self_fails<ZX_INFO_PROCESS_MAPS, zx_info_maps_t>))
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_PROCESS_MAPS, zx_info_maps_t, get_test_job>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_PROCESS_MAPS, zx_info_maps_t, zx_thread_self>));
+RUN_TEST((missing_rights_fails<ZX_INFO_PROCESS_MAPS, zx_info_maps_t, get_test_process,
+                               ZX_RIGHT_READ>));
 
 RUN_TEST(process_vmos_smoke);
-RUN_MULTI_ENTRY_TESTS(MX_INFO_PROCESS_VMOS, mx_info_vmo_t, get_test_process);
-RUN_TEST((self_fails<MX_INFO_PROCESS_VMOS, mx_info_vmo_t>))
-RUN_TEST((wrong_handle_type_fails<MX_INFO_PROCESS_VMOS, mx_info_vmo_t, get_test_job>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_PROCESS_VMOS, mx_info_vmo_t, mx_thread_self>));
-RUN_TEST((missing_rights_fails<MX_INFO_PROCESS_VMOS, mx_info_vmo_t, get_test_process,
-                               MX_RIGHT_READ>));
+RUN_MULTI_ENTRY_TESTS(ZX_INFO_PROCESS_VMOS, zx_info_vmo_t, get_test_process);
+RUN_TEST((self_fails<ZX_INFO_PROCESS_VMOS, zx_info_vmo_t>))
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_PROCESS_VMOS, zx_info_vmo_t, get_test_job>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_PROCESS_VMOS, zx_info_vmo_t, zx_thread_self>));
+RUN_TEST((missing_rights_fails<ZX_INFO_PROCESS_VMOS, zx_info_vmo_t, get_test_process,
+                               ZX_RIGHT_READ>));
 
 RUN_TEST(job_processes_smoke);
-RUN_MULTI_ENTRY_TESTS(MX_INFO_JOB_PROCESSES, mx_koid_t, get_test_job);
-RUN_TEST((wrong_handle_type_fails<MX_INFO_JOB_PROCESSES, mx_koid_t, get_test_process>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_JOB_PROCESSES, mx_koid_t, mx_thread_self>));
-RUN_TEST((missing_rights_fails<MX_INFO_JOB_PROCESSES, mx_koid_t, get_test_job,
-                               MX_RIGHT_ENUMERATE>));
+RUN_MULTI_ENTRY_TESTS(ZX_INFO_JOB_PROCESSES, zx_koid_t, get_test_job);
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_JOB_PROCESSES, zx_koid_t, get_test_process>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_JOB_PROCESSES, zx_koid_t, zx_thread_self>));
+RUN_TEST((missing_rights_fails<ZX_INFO_JOB_PROCESSES, zx_koid_t, get_test_job,
+                               ZX_RIGHT_ENUMERATE>));
 
 RUN_TEST(job_children_smoke);
-RUN_MULTI_ENTRY_TESTS(MX_INFO_JOB_CHILDREN, mx_koid_t, get_test_job);
-RUN_TEST((wrong_handle_type_fails<MX_INFO_JOB_CHILDREN, mx_koid_t, get_test_process>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_JOB_CHILDREN, mx_koid_t, mx_thread_self>));
-RUN_TEST((missing_rights_fails<MX_INFO_JOB_CHILDREN, mx_koid_t, get_test_job,
-                               MX_RIGHT_ENUMERATE>));
+RUN_MULTI_ENTRY_TESTS(ZX_INFO_JOB_CHILDREN, zx_koid_t, get_test_job);
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_JOB_CHILDREN, zx_koid_t, get_test_process>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_JOB_CHILDREN, zx_koid_t, zx_thread_self>));
+RUN_TEST((missing_rights_fails<ZX_INFO_JOB_CHILDREN, zx_koid_t, get_test_job,
+                               ZX_RIGHT_ENUMERATE>));
 
 // Basic tests for all other topics.
 
-RUN_SINGLE_ENTRY_TESTS(MX_INFO_HANDLE_BASIC, mx_info_handle_basic_t, get_test_job);
-RUN_SINGLE_ENTRY_TESTS(MX_INFO_HANDLE_BASIC, mx_info_handle_basic_t, get_test_process);
-RUN_SINGLE_ENTRY_TESTS(MX_INFO_HANDLE_BASIC, mx_info_handle_basic_t, mx_thread_self);
-RUN_SINGLE_ENTRY_TESTS(MX_INFO_HANDLE_BASIC, mx_info_handle_basic_t, mx_vmar_root_self);
+RUN_SINGLE_ENTRY_TESTS(ZX_INFO_HANDLE_BASIC, zx_info_handle_basic_t, get_test_job);
+RUN_SINGLE_ENTRY_TESTS(ZX_INFO_HANDLE_BASIC, zx_info_handle_basic_t, get_test_process);
+RUN_SINGLE_ENTRY_TESTS(ZX_INFO_HANDLE_BASIC, zx_info_handle_basic_t, zx_thread_self);
+RUN_SINGLE_ENTRY_TESTS(ZX_INFO_HANDLE_BASIC, zx_info_handle_basic_t, zx_vmar_root_self);
 
-RUN_SINGLE_ENTRY_TESTS(MX_INFO_PROCESS, mx_info_process_t, get_test_process);
-RUN_TEST((wrong_handle_type_fails<MX_INFO_PROCESS, mx_info_process_t, get_test_job>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_PROCESS, mx_info_process_t, mx_thread_self>));
+RUN_SINGLE_ENTRY_TESTS(ZX_INFO_PROCESS, zx_info_process_t, get_test_process);
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_PROCESS, zx_info_process_t, get_test_job>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_PROCESS, zx_info_process_t, zx_thread_self>));
 
-RUN_SINGLE_ENTRY_TESTS(MX_INFO_VMAR, mx_info_vmar_t, mx_vmar_root_self);
-RUN_TEST((wrong_handle_type_fails<MX_INFO_VMAR, mx_info_vmar_t, get_test_job>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_VMAR, mx_info_vmar_t, get_test_process>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_VMAR, mx_info_vmar_t, mx_thread_self>));
+RUN_SINGLE_ENTRY_TESTS(ZX_INFO_VMAR, zx_info_vmar_t, zx_vmar_root_self);
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_VMAR, zx_info_vmar_t, get_test_job>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_VMAR, zx_info_vmar_t, get_test_process>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_VMAR, zx_info_vmar_t, zx_thread_self>));
 
-RUN_SINGLE_ENTRY_TESTS(MX_INFO_THREAD, mx_info_thread_t, mx_thread_self);
-RUN_TEST((wrong_handle_type_fails<MX_INFO_THREAD, mx_info_thread_t, get_test_job>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_THREAD, mx_info_thread_t, get_test_process>));
+RUN_SINGLE_ENTRY_TESTS(ZX_INFO_THREAD, zx_info_thread_t, zx_thread_self);
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_THREAD, zx_info_thread_t, get_test_job>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_THREAD, zx_info_thread_t, get_test_process>));
 
-RUN_SINGLE_ENTRY_TESTS(MX_INFO_THREAD_STATS, mx_info_thread_stats_t, mx_thread_self);
-RUN_TEST((wrong_handle_type_fails<MX_INFO_THREAD_STATS, mx_info_thread_t, get_test_job>));
-RUN_TEST((wrong_handle_type_fails<MX_INFO_THREAD_STATS, mx_info_thread_t, get_test_process>));
+RUN_SINGLE_ENTRY_TESTS(ZX_INFO_THREAD_STATS, zx_info_thread_stats_t, zx_thread_self);
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_THREAD_STATS, zx_info_thread_t, get_test_job>));
+RUN_TEST((wrong_handle_type_fails<ZX_INFO_THREAD_STATS, zx_info_thread_t, get_test_process>));
 
-// MX_INFO_PROCESS_THREADS tests.
+// ZX_INFO_PROCESS_THREADS tests.
 // TODO(dbort): Use RUN_MULTI_ENTRY_TESTS instead. |short_buffer_succeeds| and
 // |partially_unmapped_buffer_fails| currently fail because those tests expect
 // avail > 1, but the test process only has one thread and it's not trivial to
 // add more.
-RUN_TEST((invalid_handle_fails<MX_INFO_PROCESS_THREADS, mx_koid_t>));
-RUN_TEST((null_avail_actual_succeeds<MX_INFO_PROCESS_THREADS, mx_koid_t, get_test_process>));
-RUN_TEST((bad_buffer_fails<MX_INFO_PROCESS_THREADS, mx_koid_t, get_test_process>));
-RUN_TEST((bad_actual_fails<MX_INFO_PROCESS_THREADS, mx_koid_t, get_test_process>));
-RUN_TEST((bad_avail_fails<MX_INFO_PROCESS_THREADS, mx_koid_t, get_test_process>))
-RUN_TEST((multi_zero_buffer_succeeds<MX_INFO_PROCESS_THREADS, get_test_process>));
+RUN_TEST((invalid_handle_fails<ZX_INFO_PROCESS_THREADS, zx_koid_t>));
+RUN_TEST((null_avail_actual_succeeds<ZX_INFO_PROCESS_THREADS, zx_koid_t, get_test_process>));
+RUN_TEST((bad_buffer_fails<ZX_INFO_PROCESS_THREADS, zx_koid_t, get_test_process>));
+RUN_TEST((bad_actual_fails<ZX_INFO_PROCESS_THREADS, zx_koid_t, get_test_process>));
+RUN_TEST((bad_avail_fails<ZX_INFO_PROCESS_THREADS, zx_koid_t, get_test_process>))
+RUN_TEST((multi_zero_buffer_succeeds<ZX_INFO_PROCESS_THREADS, get_test_process>));
 
-// Skip most tests for MX_INFO_THREAD_EXCEPTION_REPORT, which is tested
+// Skip most tests for ZX_INFO_THREAD_EXCEPTION_REPORT, which is tested
 // elsewhere and requires the target thread to be in a certain state.
-RUN_TEST((invalid_handle_fails<MX_INFO_THREAD_EXCEPTION_REPORT, mx_exception_report_t>));
+RUN_TEST((invalid_handle_fails<ZX_INFO_THREAD_EXCEPTION_REPORT, zx_exception_report_t>));
 
 // TODO(dbort): Test resource topics
-// RUN_MULTI_ENTRY_TESTS(MX_INFO_RESOURCE_CHILDREN, mx_rrec_t, get_root_resource);
-// RUN_MULTI_ENTRY_TESTS(MX_INFO_RESOURCE_RECORDS, mx_rrec_t, get_root_resource);
-// RUN_MULTI_ENTRY_TESTS(MX_INFO_CPU_STATS, mx_info_cpu_stats_t, get_root_resource);
-// RUN_SINGLE_ENTRY_TESTS(MX_INFO_KMEM_STATS, mx_info_kmem_stats_t, get_root_resource);
+// RUN_MULTI_ENTRY_TESTS(ZX_INFO_RESOURCE_CHILDREN, zx_rrec_t, get_root_resource);
+// RUN_MULTI_ENTRY_TESTS(ZX_INFO_RESOURCE_RECORDS, zx_rrec_t, get_root_resource);
+// RUN_MULTI_ENTRY_TESTS(ZX_INFO_CPU_STATS, zx_info_cpu_stats_t, get_root_resource);
+// RUN_SINGLE_ENTRY_TESTS(ZX_INFO_KMEM_STATS, zx_info_kmem_stats_t, get_root_resource);
 
 END_TEST_CASE(object_info_tests)
 
diff --git a/system/utest/core/object-info/rules.mk b/system/utest/core/object-info/rules.mk
index e7efb2f..82b8dcd 100644
--- a/system/utest/core/object-info/rules.mk
+++ b/system/utest/core/object-info/rules.mk
@@ -17,6 +17,6 @@
 
 MODULE_LIBS := \
     system/ulib/mini-process system/ulib/unittest \
-	system/ulib/mxio system/ulib/magenta system/ulib/c
+	system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/port/ports.cpp b/system/utest/core/port/ports.cpp
index 11b6c42..184e07f 100644
--- a/system/utest/core/port/ports.cpp
+++ b/system/utest/core/port/ports.cpp
@@ -5,163 +5,163 @@
 #include <stdio.h>
 #include <threads.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/port.h>
 #include <fbl/algorithm.h>
 
 #include <unittest/unittest.h>
 
 static bool basic_test(void) {
     BEGIN_TEST;
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t port;
-    status = mx_port_create(0, &port);
+    zx_handle_t port;
+    status = zx_port_create(0, &port);
     EXPECT_EQ(status, 0, "could not create port");
 
-    const mx_port_packet_t in = {
+    const zx_port_packet_t in = {
         12ull,
-        MX_PKT_TYPE_USER + 5u,    // kernel overrides the |type|.
+        ZX_PKT_TYPE_USER + 5u,    // kernel overrides the |type|.
         -3,
         { {} }
     };
 
-    mx_port_packet_t out = {};
+    zx_port_packet_t out = {};
 
-    status = mx_port_queue(port, nullptr, 0u);
-    EXPECT_EQ(status, MX_ERR_INVALID_ARGS);
+    status = zx_port_queue(port, nullptr, 0u);
+    EXPECT_EQ(status, ZX_ERR_INVALID_ARGS);
 
-    status = mx_port_queue(port, &in, 0u);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_port_queue(port, &in, 0u);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_port_wait(port, MX_TIME_INFINITE, &out, 0u);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_port_wait(port, ZX_TIME_INFINITE, &out, 0u);
+    EXPECT_EQ(status, ZX_OK);
 
     EXPECT_EQ(out.key, 12u);
-    EXPECT_EQ(out.type, MX_PKT_TYPE_USER);
+    EXPECT_EQ(out.type, ZX_PKT_TYPE_USER);
     EXPECT_EQ(out.status, -3);
 
-    EXPECT_EQ(memcmp(&in.user, &out.user, sizeof(mx_port_packet_t::user)), 0);
+    EXPECT_EQ(memcmp(&in.user, &out.user, sizeof(zx_port_packet_t::user)), 0);
 
-    status = mx_handle_close(port);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(port);
+    EXPECT_EQ(status, ZX_OK);
 
     END_TEST;
 }
 
 static bool queue_and_close_test(void) {
     BEGIN_TEST;
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t port;
-    status = mx_port_create(0, &port);
-    EXPECT_EQ(status, MX_OK, "could not create port");
+    zx_handle_t port;
+    status = zx_port_create(0, &port);
+    EXPECT_EQ(status, ZX_OK, "could not create port");
 
-    mx_port_packet_t out0 = {};
-    status = mx_port_wait(port, mx_deadline_after(MX_USEC(1)), &out0, 0u);
-    EXPECT_EQ(status, MX_ERR_TIMED_OUT);
+    zx_port_packet_t out0 = {};
+    status = zx_port_wait(port, zx_deadline_after(ZX_USEC(1)), &out0, 0u);
+    EXPECT_EQ(status, ZX_ERR_TIMED_OUT);
 
-    const mx_port_packet_t in = {
+    const zx_port_packet_t in = {
         1ull,
-        MX_PKT_TYPE_USER,
+        ZX_PKT_TYPE_USER,
         0,
         { {} }
     };
 
-    status = mx_port_queue(port, &in, 0u);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_port_queue(port, &in, 0u);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_handle_close(port);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(port);
+    EXPECT_EQ(status, ZX_OK);
 
     END_TEST;
 }
 
 static bool async_wait_channel_test(void) {
     BEGIN_TEST;
-    mx_status_t status;
+    zx_status_t status;
 
     const uint64_t key0 = 6567ull;
 
-    mx_handle_t port;
-    status = mx_port_create(0, &port);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t port;
+    status = zx_port_create(0, &port);
+    EXPECT_EQ(status, ZX_OK);
 
-    mx_handle_t ch[2];
-    status = mx_channel_create(0u, &ch[0], &ch[1]);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t ch[2];
+    status = zx_channel_create(0u, &ch[0], &ch[1]);
+    EXPECT_EQ(status, ZX_OK);
 
     for (int ix = 0; ix != 5; ++ix) {
-        mx_port_packet_t out = {};
-        status = mx_object_wait_async(ch[1], port, key0, MX_CHANNEL_READABLE, MX_WAIT_ASYNC_ONCE);
-        EXPECT_EQ(status, MX_OK);
+        zx_port_packet_t out = {};
+        status = zx_object_wait_async(ch[1], port, key0, ZX_CHANNEL_READABLE, ZX_WAIT_ASYNC_ONCE);
+        EXPECT_EQ(status, ZX_OK);
 
-        status = mx_port_wait(port, mx_deadline_after(MX_USEC(200)), &out, 0u);
-        EXPECT_EQ(status, MX_ERR_TIMED_OUT);
+        status = zx_port_wait(port, zx_deadline_after(ZX_USEC(200)), &out, 0u);
+        EXPECT_EQ(status, ZX_ERR_TIMED_OUT);
 
-        status = mx_channel_write(ch[0], 0u, "here", 4, nullptr, 0u);
-        EXPECT_EQ(status, MX_OK);
+        status = zx_channel_write(ch[0], 0u, "here", 4, nullptr, 0u);
+        EXPECT_EQ(status, ZX_OK);
 
-        status = mx_port_wait(port, MX_TIME_INFINITE, &out, 0u);
-        EXPECT_EQ(status, MX_OK);
+        status = zx_port_wait(port, ZX_TIME_INFINITE, &out, 0u);
+        EXPECT_EQ(status, ZX_OK);
 
         EXPECT_EQ(out.key, key0);
-        EXPECT_EQ(out.type, MX_PKT_TYPE_SIGNAL_ONE);
+        EXPECT_EQ(out.type, ZX_PKT_TYPE_SIGNAL_ONE);
         EXPECT_EQ(out.signal.observed,
-            MX_CHANNEL_WRITABLE | MX_CHANNEL_READABLE | MX_SIGNAL_LAST_HANDLE);
-        EXPECT_EQ(out.signal.trigger, MX_CHANNEL_READABLE);
+            ZX_CHANNEL_WRITABLE | ZX_CHANNEL_READABLE | ZX_SIGNAL_LAST_HANDLE);
+        EXPECT_EQ(out.signal.trigger, ZX_CHANNEL_READABLE);
         EXPECT_EQ(out.signal.count, 1u);
 
-        status = mx_channel_read(ch[1], MX_CHANNEL_READ_MAY_DISCARD,
+        status = zx_channel_read(ch[1], ZX_CHANNEL_READ_MAY_DISCARD,
                                  nullptr, nullptr, 0u, 0, nullptr, nullptr);
-        EXPECT_EQ(status, MX_ERR_BUFFER_TOO_SMALL);
+        EXPECT_EQ(status, ZX_ERR_BUFFER_TOO_SMALL);
     }
 
-    mx_port_packet_t out1 = {};
+    zx_port_packet_t out1 = {};
 
-    status = mx_port_wait(port, mx_deadline_after(MX_USEC(200)), &out1, 0u);
-    EXPECT_EQ(status, MX_ERR_TIMED_OUT);
+    status = zx_port_wait(port, zx_deadline_after(ZX_USEC(200)), &out1, 0u);
+    EXPECT_EQ(status, ZX_ERR_TIMED_OUT);
 
-    status = mx_object_wait_async(ch[1], port, key0, MX_CHANNEL_READABLE, MX_WAIT_ASYNC_ONCE);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_object_wait_async(ch[1], port, key0, ZX_CHANNEL_READABLE, ZX_WAIT_ASYNC_ONCE);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_handle_close(ch[1]);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(ch[1]);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_handle_close(ch[0]);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(ch[0]);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_handle_close(port);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(port);
+    EXPECT_EQ(status, ZX_OK);
 
     END_TEST;
 }
 
 static bool async_wait_close_order(const int order[3], uint32_t wait_option) {
     BEGIN_TEST;
-    mx_status_t status;
+    zx_status_t status;
 
     const uint64_t key0 = 1122ull;
 
-    mx_handle_t port;
-    status = mx_port_create(0, &port);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t port;
+    status = zx_port_create(0, &port);
+    EXPECT_EQ(status, ZX_OK);
 
-    mx_handle_t ch[2];
-    status = mx_channel_create(0u, &ch[0], &ch[1]);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t ch[2];
+    status = zx_channel_create(0u, &ch[0], &ch[1]);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_object_wait_async(ch[1], port, key0,
-        MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED, wait_option);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_object_wait_async(ch[1], port, key0,
+        ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, wait_option);
+    EXPECT_EQ(status, ZX_OK);
 
     for (int ix = 0; ix != 3; ++ix) {
         switch (order[ix]) {
-        case 0: status = mx_handle_close(ch[1]); break;
-        case 1: status = mx_handle_close(ch[0]); break;
-        case 2: status = mx_handle_close(port); break;
+        case 0: status = zx_handle_close(ch[1]); break;
+        case 1: status = zx_handle_close(ch[0]); break;
+        case 2: status = zx_handle_close(port); break;
         }
-        EXPECT_EQ(status, MX_OK);
+        EXPECT_EQ(status, ZX_OK);
     }
 
     END_TEST;
@@ -169,328 +169,328 @@
 
 static bool async_wait_close_order_1() {
     int order[] = {0, 1, 2};
-    return async_wait_close_order(order, MX_WAIT_ASYNC_ONCE) &&
-           async_wait_close_order(order, MX_WAIT_ASYNC_REPEATING);
+    return async_wait_close_order(order, ZX_WAIT_ASYNC_ONCE) &&
+           async_wait_close_order(order, ZX_WAIT_ASYNC_REPEATING);
 }
 
 static bool async_wait_close_order_2() {
     int order[] = {0, 2, 1};
-    return async_wait_close_order(order, MX_WAIT_ASYNC_ONCE) &&
-           async_wait_close_order(order, MX_WAIT_ASYNC_REPEATING);
+    return async_wait_close_order(order, ZX_WAIT_ASYNC_ONCE) &&
+           async_wait_close_order(order, ZX_WAIT_ASYNC_REPEATING);
 }
 
 static bool async_wait_close_order_3() {
     int order[] = {1, 2, 0};
-    return async_wait_close_order(order, MX_WAIT_ASYNC_ONCE) &&
-           async_wait_close_order(order, MX_WAIT_ASYNC_REPEATING);
+    return async_wait_close_order(order, ZX_WAIT_ASYNC_ONCE) &&
+           async_wait_close_order(order, ZX_WAIT_ASYNC_REPEATING);
 }
 
 static bool async_wait_close_order_4() {
     int order[] = {1, 0, 2};
-    return async_wait_close_order(order, MX_WAIT_ASYNC_ONCE) &&
-           async_wait_close_order(order, MX_WAIT_ASYNC_REPEATING);
+    return async_wait_close_order(order, ZX_WAIT_ASYNC_ONCE) &&
+           async_wait_close_order(order, ZX_WAIT_ASYNC_REPEATING);
 }
 
 static bool async_wait_close_order_5() {
     int order[] = {2, 1, 0};
-    return async_wait_close_order(order, MX_WAIT_ASYNC_ONCE) &&
-           async_wait_close_order(order, MX_WAIT_ASYNC_REPEATING);
+    return async_wait_close_order(order, ZX_WAIT_ASYNC_ONCE) &&
+           async_wait_close_order(order, ZX_WAIT_ASYNC_REPEATING);
 }
 
 static bool async_wait_close_order_6() {
     int order[] = {2, 0, 1};
-    return async_wait_close_order(order, MX_WAIT_ASYNC_ONCE) &&
-           async_wait_close_order(order, MX_WAIT_ASYNC_REPEATING);
+    return async_wait_close_order(order, ZX_WAIT_ASYNC_ONCE) &&
+           async_wait_close_order(order, ZX_WAIT_ASYNC_REPEATING);
 }
 
 static bool async_wait_event_test_single(void) {
     BEGIN_TEST;
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t port;
-    status = mx_port_create(0, &port);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t port;
+    status = zx_port_create(0, &port);
+    EXPECT_EQ(status, ZX_OK);
 
-    mx_handle_t ev;
-    status = mx_event_create(0u, &ev);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t ev;
+    status = zx_event_create(0u, &ev);
+    EXPECT_EQ(status, ZX_OK);
 
     const uint32_t kNumAwaits = 7;
 
     for (uint32_t ix = 0; ix != kNumAwaits; ++ix) {
-        status = mx_object_wait_async(ev, port, ix, MX_EVENT_SIGNALED, MX_WAIT_ASYNC_ONCE);
-        EXPECT_EQ(status, MX_OK);
+        status = zx_object_wait_async(ev, port, ix, ZX_EVENT_SIGNALED, ZX_WAIT_ASYNC_ONCE);
+        EXPECT_EQ(status, ZX_OK);
     }
 
-    status = mx_object_signal(ev, 0u, MX_EVENT_SIGNALED);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_object_signal(ev, 0u, ZX_EVENT_SIGNALED);
+    EXPECT_EQ(status, ZX_OK);
 
-    mx_port_packet_t out = {};
+    zx_port_packet_t out = {};
     uint64_t key_sum = 0u;
 
     for (uint32_t ix = 0; ix != (kNumAwaits - 2); ++ix) {
-        EXPECT_EQ(status, MX_OK);
-        status = mx_port_wait(port, MX_TIME_INFINITE, &out, 0u);
-        EXPECT_EQ(status, MX_OK);
+        EXPECT_EQ(status, ZX_OK);
+        status = zx_port_wait(port, ZX_TIME_INFINITE, &out, 0u);
+        EXPECT_EQ(status, ZX_OK);
         key_sum += out.key;
-        EXPECT_EQ(out.type, MX_PKT_TYPE_SIGNAL_ONE);
+        EXPECT_EQ(out.type, ZX_PKT_TYPE_SIGNAL_ONE);
         EXPECT_EQ(out.signal.count, 1u);
     }
 
     EXPECT_EQ(key_sum, 20u);
 
     // The port has packets left in it.
-    status = mx_handle_close(port);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(port);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_handle_close(ev);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(ev);
+    EXPECT_EQ(status, ZX_OK);
 
     END_TEST;
 }
 
 static bool async_wait_event_test_repeat(void) {
     BEGIN_TEST;
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t port;
-    status = mx_port_create(0, &port);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t port;
+    status = zx_port_create(0, &port);
+    EXPECT_EQ(status, ZX_OK);
 
-    mx_handle_t ev;
-    status = mx_event_create(0u, &ev);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t ev;
+    status = zx_event_create(0u, &ev);
+    EXPECT_EQ(status, ZX_OK);
 
     const uint64_t key0 = 1122ull;
 
-    status = mx_object_wait_async(ev, port, key0,
-        MX_EVENT_SIGNALED | MX_USER_SIGNAL_2, MX_WAIT_ASYNC_REPEATING);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_object_wait_async(ev, port, key0,
+        ZX_EVENT_SIGNALED | ZX_USER_SIGNAL_2, ZX_WAIT_ASYNC_REPEATING);
+    EXPECT_EQ(status, ZX_OK);
 
-    mx_port_packet_t out = {};
+    zx_port_packet_t out = {};
     uint64_t count[3] = {};
 
     for (int ix = 0; ix != 24; ++ix) {
-        uint32_t ub = (ix % 2) ? 0u : MX_USER_SIGNAL_2;
-        EXPECT_EQ(mx_object_signal(ev, 0u, MX_EVENT_SIGNALED | ub), MX_OK);
-        EXPECT_EQ(mx_object_signal(ev, MX_EVENT_SIGNALED | ub, 0u), MX_OK);
+        uint32_t ub = (ix % 2) ? 0u : ZX_USER_SIGNAL_2;
+        EXPECT_EQ(zx_object_signal(ev, 0u, ZX_EVENT_SIGNALED | ub), ZX_OK);
+        EXPECT_EQ(zx_object_signal(ev, ZX_EVENT_SIGNALED | ub, 0u), ZX_OK);
 
-        ASSERT_EQ(mx_port_wait(port, 0ull, &out, 0u), MX_OK);
-        ASSERT_EQ(out.type, MX_PKT_TYPE_SIGNAL_REP);
+        ASSERT_EQ(zx_port_wait(port, 0ull, &out, 0u), ZX_OK);
+        ASSERT_EQ(out.type, ZX_PKT_TYPE_SIGNAL_REP);
         ASSERT_EQ(out.signal.count, 1u);
-        count[0] += (out.signal.observed & MX_EVENT_SIGNALED) ? 1 : 0;
-        count[1] += (out.signal.observed & MX_USER_SIGNAL_2) ? 1 : 0;
+        count[0] += (out.signal.observed & ZX_EVENT_SIGNALED) ? 1 : 0;
+        count[1] += (out.signal.observed & ZX_USER_SIGNAL_2) ? 1 : 0;
         count[2] += (out.signal.observed &
-            ~(MX_EVENT_SIGNALED|MX_USER_SIGNAL_2|MX_SIGNAL_LAST_HANDLE)) ? 1 : 0;
+            ~(ZX_EVENT_SIGNALED|ZX_USER_SIGNAL_2|ZX_SIGNAL_LAST_HANDLE)) ? 1 : 0;
     }
 
     EXPECT_EQ(count[0], 24u);
     EXPECT_EQ(count[1], 12u);
     EXPECT_EQ(count[2], 0u);
 
-    status = mx_handle_close(port);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(port);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_object_signal(ev, 0u, MX_EVENT_SIGNALED | MX_USER_SIGNAL_2);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_object_signal(ev, 0u, ZX_EVENT_SIGNALED | ZX_USER_SIGNAL_2);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_handle_close(ev);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(ev);
+    EXPECT_EQ(status, ZX_OK);
 
     END_TEST;
 }
 
 static bool pre_writes_channel_test(uint32_t mode) {
     BEGIN_TEST;
-    mx_status_t status;
+    zx_status_t status;
 
     const uint64_t key0 = 65667ull;
 
-    mx_handle_t ch[2];
-    status = mx_channel_create(0u, &ch[0], &ch[1]);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t ch[2];
+    status = zx_channel_create(0u, &ch[0], &ch[1]);
+    EXPECT_EQ(status, ZX_OK);
 
     for (int ix = 0; ix != 5; ++ix) {
-        EXPECT_EQ(mx_channel_write(ch[0], 0u, "123456", 6, nullptr, 0u), MX_OK);
+        EXPECT_EQ(zx_channel_write(ch[0], 0u, "123456", 6, nullptr, 0u), ZX_OK);
     }
 
-    status = mx_handle_close(ch[0]);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(ch[0]);
+    EXPECT_EQ(status, ZX_OK);
 
-    mx_handle_t port;
-    status = mx_port_create(0, &port);
-    EXPECT_EQ(status, MX_OK);
+    zx_handle_t port;
+    status = zx_port_create(0, &port);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_object_wait_async(ch[1], port, key0,
-        MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED, mode);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_object_wait_async(ch[1], port, key0,
+        ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, mode);
+    EXPECT_EQ(status, ZX_OK);
 
-    mx_port_packet_t out = {};
+    zx_port_packet_t out = {};
     int wait_count = 0;
     uint64_t read_count = 0u;
 
     while (true) {
-        status = mx_port_wait(port, 0ull, &out, 0u);
-        if (status != MX_OK)
+        status = zx_port_wait(port, 0ull, &out, 0u);
+        if (status != ZX_OK)
             break;
         wait_count++;
-        if (out.signal.trigger != MX_CHANNEL_PEER_CLOSED)
+        if (out.signal.trigger != ZX_CHANNEL_PEER_CLOSED)
             read_count += out.signal.count;
         EXPECT_NE(out.signal.count, 0u);
     }
 
     EXPECT_EQ(wait_count, 1u);
-    EXPECT_EQ(out.signal.trigger, MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED);
+    EXPECT_EQ(out.signal.trigger, ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED);
     EXPECT_EQ(read_count, 5u);
 
-    status = mx_handle_close(port);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(port);
+    EXPECT_EQ(status, ZX_OK);
 
-    status = mx_handle_close(ch[1]);
-    EXPECT_EQ(status, MX_OK);
+    status = zx_handle_close(ch[1]);
+    EXPECT_EQ(status, ZX_OK);
 
     END_TEST;
 }
 
 static bool channel_pre_writes_once() {
-    return pre_writes_channel_test(MX_WAIT_ASYNC_ONCE);
+    return pre_writes_channel_test(ZX_WAIT_ASYNC_ONCE);
 }
 
 static bool channel_pre_writes_repeat() {
-    return pre_writes_channel_test(MX_WAIT_ASYNC_REPEATING);
+    return pre_writes_channel_test(ZX_WAIT_ASYNC_REPEATING);
 }
 
 static bool cancel_event(uint32_t wait_mode) {
     BEGIN_TEST;
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t port;
-    mx_handle_t ev;
+    zx_handle_t port;
+    zx_handle_t ev;
 
-    EXPECT_EQ(mx_port_create(0, &port), MX_OK);
-    EXPECT_EQ(mx_event_create(0u, &ev), MX_OK);
+    EXPECT_EQ(zx_port_create(0, &port), ZX_OK);
+    EXPECT_EQ(zx_event_create(0u, &ev), ZX_OK);
 
     // Notice repeated key below.
     const uint64_t keys[] = {128u, 13u, 7u, 13u};
 
     for (uint32_t ix = 0; ix != fbl::count_of(keys); ++ix) {
-        EXPECT_EQ(mx_object_wait_async(
-            ev, port, keys[ix], MX_EVENT_SIGNALED, wait_mode), MX_OK);
+        EXPECT_EQ(zx_object_wait_async(
+            ev, port, keys[ix], ZX_EVENT_SIGNALED, wait_mode), ZX_OK);
     }
 
     // We cancel before it is signaled so no packets from |13| are seen.
-    EXPECT_EQ(mx_port_cancel(port, ev, 13u), MX_OK);
+    EXPECT_EQ(zx_port_cancel(port, ev, 13u), ZX_OK);
 
     for (int ix = 0; ix != 2; ++ix) {
-        EXPECT_EQ(mx_object_signal(ev, 0u, MX_EVENT_SIGNALED), MX_OK);
-        EXPECT_EQ(mx_object_signal(ev, MX_EVENT_SIGNALED, 0u), MX_OK);
+        EXPECT_EQ(zx_object_signal(ev, 0u, ZX_EVENT_SIGNALED), ZX_OK);
+        EXPECT_EQ(zx_object_signal(ev, ZX_EVENT_SIGNALED, 0u), ZX_OK);
     }
 
-    mx_port_packet_t out = {};
+    zx_port_packet_t out = {};
     int wait_count = 0;
     uint64_t key_sum = 0;
 
     while (true) {
-        status = mx_port_wait(port, 0ull, &out, 0u);
-        if (status != MX_OK)
+        status = zx_port_wait(port, 0ull, &out, 0u);
+        if (status != ZX_OK)
             break;
         wait_count++;
         key_sum += out.key;
-        EXPECT_EQ(out.signal.trigger, MX_EVENT_SIGNALED);
-        EXPECT_EQ(out.signal.observed, MX_EVENT_SIGNALED | MX_SIGNAL_LAST_HANDLE);
+        EXPECT_EQ(out.signal.trigger, ZX_EVENT_SIGNALED);
+        EXPECT_EQ(out.signal.observed, ZX_EVENT_SIGNALED | ZX_SIGNAL_LAST_HANDLE);
     }
 
-    if (wait_mode == MX_WAIT_ASYNC_ONCE) {
+    if (wait_mode == ZX_WAIT_ASYNC_ONCE) {
         // We cancel after the packet has been delivered.
-        EXPECT_EQ(mx_port_cancel(port, ev, 128u), MX_ERR_NOT_FOUND);
+        EXPECT_EQ(zx_port_cancel(port, ev, 128u), ZX_ERR_NOT_FOUND);
     }
 
     EXPECT_EQ(wait_count, 2);
     EXPECT_EQ(key_sum, keys[0] + keys[2]);
 
-    EXPECT_EQ(mx_handle_close(port), MX_OK);
-    EXPECT_EQ(mx_handle_close(ev), MX_OK);
+    EXPECT_EQ(zx_handle_close(port), ZX_OK);
+    EXPECT_EQ(zx_handle_close(ev), ZX_OK);
     END_TEST;
 }
 
 static bool cancel_event_key_once() {
-    return cancel_event(MX_WAIT_ASYNC_ONCE);
+    return cancel_event(ZX_WAIT_ASYNC_ONCE);
 }
 
 static bool cancel_event_key_repeat() {
-    return cancel_event(MX_WAIT_ASYNC_REPEATING);
+    return cancel_event(ZX_WAIT_ASYNC_REPEATING);
 }
 
 static bool cancel_event_after(uint32_t wait_mode) {
     BEGIN_TEST;
 
-    mx_status_t status;
-    mx_handle_t port;
+    zx_status_t status;
+    zx_handle_t port;
 
-    EXPECT_EQ(mx_port_create(0, &port), MX_OK);
+    EXPECT_EQ(zx_port_create(0, &port), ZX_OK);
 
-    mx_handle_t ev[3];
+    zx_handle_t ev[3];
     const uint64_t keys[] = {128u, 3u, 3u};
 
     for (uint32_t ix = 0; ix != fbl::count_of(keys); ++ix) {
 
-        EXPECT_EQ(mx_event_create(0u, &ev[ix]), MX_OK);
-        EXPECT_EQ(mx_object_wait_async(
-            ev[ix], port, keys[ix], MX_EVENT_SIGNALED, wait_mode), MX_OK);
+        EXPECT_EQ(zx_event_create(0u, &ev[ix]), ZX_OK);
+        EXPECT_EQ(zx_object_wait_async(
+            ev[ix], port, keys[ix], ZX_EVENT_SIGNALED, wait_mode), ZX_OK);
     }
 
-    EXPECT_EQ(mx_object_signal(ev[0], 0u, MX_EVENT_SIGNALED), MX_OK);
-    EXPECT_EQ(mx_object_signal(ev[1], 0u, MX_EVENT_SIGNALED), MX_OK);
+    EXPECT_EQ(zx_object_signal(ev[0], 0u, ZX_EVENT_SIGNALED), ZX_OK);
+    EXPECT_EQ(zx_object_signal(ev[1], 0u, ZX_EVENT_SIGNALED), ZX_OK);
 
     // We cancel after the first two signals and before the third. So it should
     // test both cases with queued packets and no-yet-fired packets.
-    EXPECT_EQ(mx_port_cancel(port, ev[1], 3u), MX_OK);
-    EXPECT_EQ(mx_port_cancel(port, ev[2], 3u), MX_OK);
+    EXPECT_EQ(zx_port_cancel(port, ev[1], 3u), ZX_OK);
+    EXPECT_EQ(zx_port_cancel(port, ev[2], 3u), ZX_OK);
 
-    EXPECT_EQ(mx_object_signal(ev[2], 0u, MX_EVENT_SIGNALED), MX_OK);
+    EXPECT_EQ(zx_object_signal(ev[2], 0u, ZX_EVENT_SIGNALED), ZX_OK);
 
-    mx_port_packet_t out = {};
+    zx_port_packet_t out = {};
     int wait_count = 0;
     uint64_t key_sum = 0;
 
     while (true) {
-        status = mx_port_wait(port, 0ull, &out, 0u);
-        if (status != MX_OK)
+        status = zx_port_wait(port, 0ull, &out, 0u);
+        if (status != ZX_OK)
             break;
         wait_count++;
         key_sum += out.key;
-        EXPECT_EQ(out.signal.trigger, MX_EVENT_SIGNALED);
-        EXPECT_EQ(out.signal.observed, MX_EVENT_SIGNALED | MX_SIGNAL_LAST_HANDLE);
+        EXPECT_EQ(out.signal.trigger, ZX_EVENT_SIGNALED);
+        EXPECT_EQ(out.signal.observed, ZX_EVENT_SIGNALED | ZX_SIGNAL_LAST_HANDLE);
     }
 
     EXPECT_EQ(wait_count, 1);
     EXPECT_EQ(key_sum, keys[0]);
 
-    EXPECT_EQ(mx_handle_close(port), MX_OK);
-    EXPECT_EQ(mx_handle_close(ev[0]), MX_OK);
-    EXPECT_EQ(mx_handle_close(ev[1]), MX_OK);
+    EXPECT_EQ(zx_handle_close(port), ZX_OK);
+    EXPECT_EQ(zx_handle_close(ev[0]), ZX_OK);
+    EXPECT_EQ(zx_handle_close(ev[1]), ZX_OK);
     END_TEST;
 }
 
 static bool cancel_event_key_once_after() {
-    return cancel_event_after(MX_WAIT_ASYNC_ONCE);
+    return cancel_event_after(ZX_WAIT_ASYNC_ONCE);
 }
 
 static bool cancel_event_key_repeat_after() {
-    return cancel_event_after(MX_WAIT_ASYNC_REPEATING);
+    return cancel_event_after(ZX_WAIT_ASYNC_REPEATING);
 }
 
 struct test_context {
-    mx_handle_t port;
+    zx_handle_t port;
     uint32_t count;
 };
 
 static int port_reader_thread(void* arg) {
     auto ctx = reinterpret_cast<test_context*>(arg);
-    mx_port_packet_t out = {};
+    zx_port_packet_t out = {};
     uint64_t received = 0;
     do {
-        auto st = mx_port_wait(ctx->port, MX_TIME_INFINITE, &out, 0u);
+        auto st = zx_port_wait(ctx->port, ZX_TIME_INFINITE, &out, 0u);
         if (st < 0)
             return st;
         ++received;
@@ -501,11 +501,11 @@
 static bool threads_event(uint32_t wait_mode) {
     BEGIN_TEST;
 
-    mx_handle_t port;
-    mx_handle_t ev;
+    zx_handle_t port;
+    zx_handle_t ev;
 
-    EXPECT_EQ(mx_port_create(0, &port), MX_OK);
-    EXPECT_EQ(mx_event_create(0u, &ev), MX_OK);
+    EXPECT_EQ(zx_port_create(0, &port), ZX_OK);
+    EXPECT_EQ(zx_event_create(0u, &ev), ZX_OK);
 
     thrd_t threads[3];
     test_context ctx[3];
@@ -514,13 +514,13 @@
         // and exit. See bug MG-648 for the case this is testing.
         ctx[ix] = { port, 1u };
 
-        EXPECT_EQ(mx_object_wait_async(
-                  ev, port, (500u + ix), MX_EVENT_SIGNALED, wait_mode), MX_OK);
+        EXPECT_EQ(zx_object_wait_async(
+                  ev, port, (500u + ix), ZX_EVENT_SIGNALED, wait_mode), ZX_OK);
         EXPECT_EQ(thrd_create(&threads[ix], port_reader_thread, &ctx[ix]),
                   thrd_success);
     }
 
-    EXPECT_EQ(mx_object_signal(ev, 0u, MX_EVENT_SIGNALED), MX_OK);
+    EXPECT_EQ(zx_object_signal(ev, 0u, ZX_EVENT_SIGNALED), ZX_OK);
 
     for (size_t ix = 0; ix != fbl::count_of(threads); ++ix) {
         int res;
@@ -529,18 +529,18 @@
         EXPECT_EQ(ctx[ix].count, 1u);
     }
 
-    EXPECT_EQ(mx_handle_close(port), MX_OK);
-    EXPECT_EQ(mx_handle_close(ev), MX_OK);
+    EXPECT_EQ(zx_handle_close(port), ZX_OK);
+    EXPECT_EQ(zx_handle_close(ev), ZX_OK);
 
     END_TEST;
 }
 
 static bool threads_event_once() {
-    return threads_event(MX_WAIT_ASYNC_ONCE);
+    return threads_event(ZX_WAIT_ASYNC_ONCE);
 }
 
 static bool threads_event_repeat() {
-    return threads_event(MX_WAIT_ASYNC_REPEATING);
+    return threads_event(ZX_WAIT_ASYNC_REPEATING);
 }
 
 
@@ -548,19 +548,19 @@
 static constexpr uint64_t kSleeps[] = { 0, 10, 2, 0, 15, 0};
 
 static int signaler_thread(void* arg) {
-    auto ev = *reinterpret_cast<mx_handle_t*>(arg);
+    auto ev = *reinterpret_cast<zx_handle_t*>(arg);
 
     uint64_t count = 0;
 
     while (true) {
-        auto st = mx_object_signal(ev, 0u, MX_EVENT_SIGNALED);
-        if (st != MX_OK)
+        auto st = zx_object_signal(ev, 0u, ZX_EVENT_SIGNALED);
+        if (st != ZX_OK)
             return 1;
         auto duration = kSleeps[count % fbl::count_of(kSleeps)];
         if (duration > 0)
-            mx_nanosleep(mx_deadline_after(duration));
-        st = mx_object_signal(ev, MX_EVENT_SIGNALED, 0u);
-        if (st != MX_OK)
+            zx_nanosleep(zx_deadline_after(duration));
+        st = zx_object_signal(ev, ZX_EVENT_SIGNALED, 0u);
+        if (st != ZX_OK)
             return 1;
 
         ++count;
@@ -570,7 +570,7 @@
 }
 
 static int waiter_thread(void* arg) {
-    auto ob = reinterpret_cast<mx_handle_t*>(arg);
+    auto ob = reinterpret_cast<zx_handle_t*>(arg);
     auto& port = ob[0];
     auto& ev   = ob[1];
     const auto key = 919u;
@@ -579,22 +579,22 @@
 
     auto count = kStressCount;
     while (--count) {
-        st = mx_object_wait_async(ev, port, key, MX_EVENT_SIGNALED, MX_WAIT_ASYNC_ONCE);
-        if (st != MX_OK)
+        st = zx_object_wait_async(ev, port, key, ZX_EVENT_SIGNALED, ZX_WAIT_ASYNC_ONCE);
+        if (st != ZX_OK)
             break;
 
-        mx_signals_t observed;
-        st = mx_object_wait_one(ev, MX_EVENT_SIGNALED, MX_TIME_INFINITE, &observed);
-        if (st != MX_OK)
+        zx_signals_t observed;
+        st = zx_object_wait_one(ev, ZX_EVENT_SIGNALED, ZX_TIME_INFINITE, &observed);
+        if (st != ZX_OK)
             break;
 
-        st = mx_port_cancel(port, ev, key);
-        if (st != MX_OK)
+        st = zx_port_cancel(port, ev, key);
+        if (st != ZX_OK)
             break;
     }
 
     // Done, close the event so the other thread exits.
-    mx_handle_close(ev);
+    zx_handle_close(ev);
     return st;
 }
 
@@ -605,15 +605,15 @@
     // This tests a race that existed between the port observer
     // removing itself from the event and the cancelation logic which is
     // also working with the same internal object. The net effect of the
-    // bug is that port_cancel() would fail with MX_ERR_NOT_FOUND.
+    // bug is that port_cancel() would fail with ZX_ERR_NOT_FOUND.
     //
     // When running on real hardware or KVM-accelerated emulation
     // a good number to set for kStressCount is 50000000.
 
-    mx_handle_t ob[2];
+    zx_handle_t ob[2];
 
-    EXPECT_EQ(mx_port_create(0, &ob[0]), MX_OK);
-    EXPECT_EQ(mx_event_create(0u, &ob[1]), MX_OK);
+    EXPECT_EQ(zx_port_create(0, &ob[0]), ZX_OK);
+    EXPECT_EQ(zx_event_create(0u, &ob[1]), ZX_OK);
 
     thrd_t thread[2];
     EXPECT_EQ(thrd_create(&thread[0], waiter_thread, ob), thrd_success);
@@ -621,7 +621,7 @@
 
     int res;
     EXPECT_EQ(thrd_join(thread[0], &res), thrd_success, "waiter");
-    EXPECT_EQ(res, MX_OK);
+    EXPECT_EQ(res, ZX_OK);
 
     EXPECT_EQ(thrd_join(thread[1], &res), thrd_success, "signaler");
     EXPECT_EQ(res, 1);
diff --git a/system/utest/core/port/rules.mk b/system/utest/core/port/rules.mk
index b78344e..46a672c 100644
--- a/system/utest/core/port/rules.mk
+++ b/system/utest/core/port/rules.mk
@@ -16,7 +16,7 @@
 MODULE_NAME := port-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 MODULE_STATIC_LIBS := system/ulib/fbl
 
diff --git a/system/utest/core/process/process.cpp b/system/utest/core/process/process.cpp
index 0e6b10a..d76aac0 100644
--- a/system/utest/core/process/process.cpp
+++ b/system/utest/core/process/process.cpp
@@ -4,10 +4,10 @@
 
 #include <assert.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/types.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/types.h>
 
 #include <mini-process/mini-process.h>
 
@@ -15,351 +15,351 @@
 
 namespace {
 
-const mx_time_t kTimeoutNs = MX_MSEC(250);
+const zx_time_t kTimeoutNs = ZX_MSEC(250);
 
 bool mini_process_sanity() {
     BEGIN_TEST;
 
-    mx_handle_t proc;
-    mx_handle_t thread;
-    mx_handle_t vmar;
+    zx_handle_t proc;
+    zx_handle_t thread;
+    zx_handle_t vmar;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), "mini-p", 3u, 0, &proc, &vmar), MX_OK);
-    ASSERT_EQ(mx_thread_create(proc, "mini-p", 2u, 0u, &thread), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), "mini-p", 3u, 0, &proc, &vmar), ZX_OK);
+    ASSERT_EQ(zx_thread_create(proc, "mini-p", 2u, 0u, &thread), ZX_OK);
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), MX_OK);
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), ZX_OK);
 
-    mx_handle_t cmd_channel;
-    EXPECT_EQ(start_mini_process_etc(proc, thread, vmar, event, &cmd_channel), MX_OK);
+    zx_handle_t cmd_channel;
+    EXPECT_EQ(start_mini_process_etc(proc, thread, vmar, event, &cmd_channel), ZX_OK);
 
-    EXPECT_EQ(mini_process_cmd(cmd_channel, MINIP_CMD_ECHO_MSG, nullptr), MX_OK);
+    EXPECT_EQ(mini_process_cmd(cmd_channel, MINIP_CMD_ECHO_MSG, nullptr), ZX_OK);
 
-    mx_handle_t oev;
-    EXPECT_EQ(mini_process_cmd(cmd_channel, MINIP_CMD_CREATE_EVENT, &oev), MX_OK);
+    zx_handle_t oev;
+    EXPECT_EQ(mini_process_cmd(cmd_channel, MINIP_CMD_CREATE_EVENT, &oev), ZX_OK);
 
-    EXPECT_EQ(mini_process_cmd(cmd_channel, MINIP_CMD_EXIT_NORMAL, nullptr), MX_ERR_PEER_CLOSED);
+    EXPECT_EQ(mini_process_cmd(cmd_channel, MINIP_CMD_EXIT_NORMAL, nullptr), ZX_ERR_PEER_CLOSED);
 
-    mx_handle_close(thread);
-    mx_handle_close(proc);
-    mx_handle_close(vmar);
+    zx_handle_close(thread);
+    zx_handle_close(proc);
+    zx_handle_close(vmar);
     END_TEST;
 }
 
 bool process_start_fail() {
     BEGIN_TEST;
 
-    mx_handle_t event1, event2;
-    mx_handle_t process;
-    mx_handle_t thread;
+    zx_handle_t event1, event2;
+    zx_handle_t process;
+    zx_handle_t thread;
 
-    ASSERT_EQ(mx_event_create(0u, &event1), MX_OK);
-    ASSERT_EQ(mx_event_create(0u, &event2), MX_OK);
+    ASSERT_EQ(zx_event_create(0u, &event1), ZX_OK);
+    ASSERT_EQ(zx_event_create(0u, &event2), ZX_OK);
 
-    ASSERT_EQ(start_mini_process(mx_job_default(), event1, &process, &thread), MX_OK);
+    ASSERT_EQ(start_mini_process(zx_job_default(), event1, &process, &thread), ZX_OK);
 
-    mx_handle_t other_thread;
-    ASSERT_EQ(mx_thread_create(process, "test", 4u, 0, &other_thread), MX_OK);
+    zx_handle_t other_thread;
+    ASSERT_EQ(zx_thread_create(process, "test", 4u, 0, &other_thread), ZX_OK);
 
     // Test that calling process_start() again for an existing process fails in a
     // reasonable way. Also test that the transfered object is back into this process.
-    EXPECT_EQ(mx_process_start(process, other_thread, 0, 0, event2, 0), MX_ERR_BAD_STATE);
-    EXPECT_EQ(mx_object_signal(event2, 0u, MX_EVENT_SIGNALED), MX_OK);
+    EXPECT_EQ(zx_process_start(process, other_thread, 0, 0, event2, 0), ZX_ERR_BAD_STATE);
+    EXPECT_EQ(zx_object_signal(event2, 0u, ZX_EVENT_SIGNALED), ZX_OK);
 
-    mx_handle_close(event2);
-    mx_handle_close(process);
-    mx_handle_close(thread);
-    mx_handle_close(other_thread);
+    zx_handle_close(event2);
+    zx_handle_close(process);
+    zx_handle_close(thread);
+    zx_handle_close(other_thread);
     END_TEST;
 }
 
 bool kill_process_via_thread_close() {
     BEGIN_TEST;
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), MX_OK);
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), ZX_OK);
 
-    mx_handle_t process;
-    mx_handle_t thread;
-    ASSERT_EQ(start_mini_process(mx_job_default(), event, &process, &thread), MX_OK);
+    zx_handle_t process;
+    zx_handle_t thread;
+    ASSERT_EQ(start_mini_process(zx_job_default(), event, &process, &thread), ZX_OK);
 
     // closing the only thread handle should cause the process to terminate.
-    EXPECT_EQ(mx_handle_close(thread), MX_OK);
+    EXPECT_EQ(zx_handle_close(thread), ZX_OK);
 
-    mx_signals_t signals;
-    EXPECT_EQ(mx_object_wait_one(
-        process, MX_TASK_TERMINATED, MX_TIME_INFINITE, &signals), MX_OK);
-    EXPECT_EQ(signals, MX_TASK_TERMINATED | MX_SIGNAL_LAST_HANDLE);
+    zx_signals_t signals;
+    EXPECT_EQ(zx_object_wait_one(
+        process, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, &signals), ZX_OK);
+    EXPECT_EQ(signals, ZX_TASK_TERMINATED | ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
     END_TEST;
 }
 
 bool kill_process_via_process_close() {
     BEGIN_TEST;
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), MX_OK);
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), ZX_OK);
 
-    mx_handle_t process;
-    mx_handle_t thread;
-    ASSERT_EQ(start_mini_process(mx_job_default(), event, &process, &thread), MX_OK);
+    zx_handle_t process;
+    zx_handle_t thread;
+    ASSERT_EQ(start_mini_process(zx_job_default(), event, &process, &thread), ZX_OK);
 
     // closing the only process handle should cause the process to terminate.
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
-    mx_signals_t signals;
-    EXPECT_EQ(mx_object_wait_one(
-        thread, MX_TASK_TERMINATED, MX_TIME_INFINITE, &signals), MX_OK);
-    EXPECT_EQ(signals, MX_TASK_TERMINATED | MX_SIGNAL_LAST_HANDLE);
+    zx_signals_t signals;
+    EXPECT_EQ(zx_object_wait_one(
+        thread, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, &signals), ZX_OK);
+    EXPECT_EQ(signals, ZX_TASK_TERMINATED | ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_handle_close(thread), MX_OK);
+    EXPECT_EQ(zx_handle_close(thread), ZX_OK);
     END_TEST;
 }
 
 bool kill_process_via_thread_kill() {
     BEGIN_TEST;
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), MX_OK);
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), ZX_OK);
 
-    mx_handle_t process;
-    mx_handle_t thread;
-    ASSERT_EQ(start_mini_process(mx_job_default(), event, &process, &thread), MX_OK);
+    zx_handle_t process;
+    zx_handle_t thread;
+    ASSERT_EQ(start_mini_process(zx_job_default(), event, &process, &thread), ZX_OK);
 
     // Killing the only thread should cause the process to terminate.
-    EXPECT_EQ(mx_task_kill(thread), MX_OK);
+    EXPECT_EQ(zx_task_kill(thread), ZX_OK);
 
-    mx_signals_t signals;
-    EXPECT_EQ(mx_object_wait_one(
-        process, MX_TASK_TERMINATED, MX_TIME_INFINITE, &signals), MX_OK);
-    EXPECT_EQ(signals, MX_TASK_TERMINATED | MX_SIGNAL_LAST_HANDLE);
+    zx_signals_t signals;
+    EXPECT_EQ(zx_object_wait_one(
+        process, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, &signals), ZX_OK);
+    EXPECT_EQ(signals, ZX_TASK_TERMINATED | ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
-    EXPECT_EQ(mx_handle_close(thread), MX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
+    EXPECT_EQ(zx_handle_close(thread), ZX_OK);
     END_TEST;
 }
 
 bool kill_process_via_vmar_destroy() {
     BEGIN_TEST;
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), MX_OK);
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), ZX_OK);
 
-    mx_handle_t proc;
-    mx_handle_t vmar;
-    ASSERT_EQ(mx_process_create(mx_job_default(), "ttp", 3u, 0, &proc, &vmar), MX_OK);
+    zx_handle_t proc;
+    zx_handle_t vmar;
+    ASSERT_EQ(zx_process_create(zx_job_default(), "ttp", 3u, 0, &proc, &vmar), ZX_OK);
 
-    mx_handle_t thread;
-    ASSERT_EQ(mx_thread_create(proc, "th", 2u, 0u, &thread), MX_OK);
+    zx_handle_t thread;
+    ASSERT_EQ(zx_thread_create(proc, "th", 2u, 0u, &thread), ZX_OK);
 
     // Make the process busy-wait rather than using a vDSO call because
-    // if it maps in the vDSO then mx_vmar_destroy is prohibited.
+    // if it maps in the vDSO then zx_vmar_destroy is prohibited.
     EXPECT_EQ(start_mini_process_etc(proc, thread, vmar, event, nullptr),
-              MX_OK);
+              ZX_OK);
 
     // Destroying the root VMAR should cause the process to terminate.
     REGISTER_CRASH(proc);
-    EXPECT_EQ(mx_vmar_destroy(vmar), MX_OK);
+    EXPECT_EQ(zx_vmar_destroy(vmar), ZX_OK);
 
-    mx_signals_t signals;
-    EXPECT_EQ(mx_object_wait_one(
-        proc, MX_TASK_TERMINATED, MX_TIME_INFINITE, &signals), MX_OK);
-    signals &= MX_TASK_TERMINATED;
-    EXPECT_EQ(signals, MX_TASK_TERMINATED);
+    zx_signals_t signals;
+    EXPECT_EQ(zx_object_wait_one(
+        proc, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, &signals), ZX_OK);
+    signals &= ZX_TASK_TERMINATED;
+    EXPECT_EQ(signals, ZX_TASK_TERMINATED);
 
-    EXPECT_EQ(mx_handle_close(proc), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(thread), MX_OK);
+    EXPECT_EQ(zx_handle_close(proc), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(thread), ZX_OK);
     END_TEST;
 }
 
 bool kill_process_handle_cycle() {
     BEGIN_TEST;
 
-    mx_handle_t proc1, proc2;
-    mx_handle_t vmar1, vmar2;
+    zx_handle_t proc1, proc2;
+    zx_handle_t vmar1, vmar2;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), "ttp1", 4u, 0u, &proc1, &vmar1), MX_OK);
-    ASSERT_EQ(mx_process_create(mx_job_default(), "ttp2", 4u, 0u, &proc2, &vmar2), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), "ttp1", 4u, 0u, &proc1, &vmar1), ZX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), "ttp2", 4u, 0u, &proc2, &vmar2), ZX_OK);
 
-    mx_handle_t thread1, thread2;
+    zx_handle_t thread1, thread2;
 
-    ASSERT_EQ(mx_thread_create(proc1, "th1", 3u, 0u, &thread1), MX_OK);
-    ASSERT_EQ(mx_thread_create(proc2, "th2", 3u, 0u, &thread2), MX_OK);
+    ASSERT_EQ(zx_thread_create(proc1, "th1", 3u, 0u, &thread1), ZX_OK);
+    ASSERT_EQ(zx_thread_create(proc2, "th2", 3u, 0u, &thread2), ZX_OK);
 
-    mx_handle_t dup1, dup2;
+    zx_handle_t dup1, dup2;
 
-    EXPECT_EQ(mx_handle_duplicate(proc1, MX_RIGHT_SAME_RIGHTS, &dup1), MX_OK);
-    EXPECT_EQ(mx_handle_duplicate(proc2, MX_RIGHT_SAME_RIGHTS, &dup2), MX_OK);
+    EXPECT_EQ(zx_handle_duplicate(proc1, ZX_RIGHT_SAME_RIGHTS, &dup1), ZX_OK);
+    EXPECT_EQ(zx_handle_duplicate(proc2, ZX_RIGHT_SAME_RIGHTS, &dup2), ZX_OK);
 
-    mx_handle_t minip_chn[2];
+    zx_handle_t minip_chn[2];
 
     EXPECT_EQ(start_mini_process_etc(proc1, thread1, vmar1, dup2, &minip_chn[0]),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(start_mini_process_etc(proc2, thread2, vmar2, dup1, &minip_chn[1]),
-              MX_OK);
+              ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(vmar2), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar1), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmar2), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar1), ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(proc1), MX_OK);
-    EXPECT_EQ(mx_handle_close(proc2), MX_OK);
+    EXPECT_EQ(zx_handle_close(proc1), ZX_OK);
+    EXPECT_EQ(zx_handle_close(proc2), ZX_OK);
 
     // At this point each processes have each other last process handle.  Make sure
     // they are running.
 
-    mx_signals_t signals;
-    EXPECT_EQ(mx_object_wait_one(
-        thread1, MX_TASK_TERMINATED, mx_deadline_after(kTimeoutNs), &signals), MX_ERR_TIMED_OUT);
+    zx_signals_t signals;
+    EXPECT_EQ(zx_object_wait_one(
+        thread1, ZX_TASK_TERMINATED, zx_deadline_after(kTimeoutNs), &signals), ZX_ERR_TIMED_OUT);
 
-    EXPECT_EQ(mx_object_wait_one(
-        thread2, MX_TASK_TERMINATED, mx_deadline_after(kTimeoutNs), &signals), MX_ERR_TIMED_OUT);
+    EXPECT_EQ(zx_object_wait_one(
+        thread2, ZX_TASK_TERMINATED, zx_deadline_after(kTimeoutNs), &signals), ZX_ERR_TIMED_OUT);
 
-    EXPECT_EQ(mx_handle_close(thread1), MX_OK);
+    EXPECT_EQ(zx_handle_close(thread1), ZX_OK);
 
     // Closing thread1 should cause process 1 to exit which should cause process 2 to
     // exit which we test by waiting on the second process thread handle.
 
-    EXPECT_EQ(mx_object_wait_one(
-        thread2, MX_TASK_TERMINATED, MX_TIME_INFINITE, &signals), MX_OK);
-    EXPECT_EQ(signals, MX_TASK_TERMINATED | MX_SIGNAL_LAST_HANDLE);
+    EXPECT_EQ(zx_object_wait_one(
+        thread2, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, &signals), ZX_OK);
+    EXPECT_EQ(signals, ZX_TASK_TERMINATED | ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(mx_handle_close(thread2), MX_OK);
+    EXPECT_EQ(zx_handle_close(thread2), ZX_OK);
 
     END_TEST;
 }
 
-static mx_status_t dup_send_handle(mx_handle_t channel, mx_handle_t handle) {
-    mx_handle_t dup;
-    mx_status_t st = mx_handle_duplicate(handle, MX_RIGHT_SAME_RIGHTS, &dup);
+static zx_status_t dup_send_handle(zx_handle_t channel, zx_handle_t handle) {
+    zx_handle_t dup;
+    zx_status_t st = zx_handle_duplicate(handle, ZX_RIGHT_SAME_RIGHTS, &dup);
     if (st < 0)
         return st;
-    return mx_channel_write(channel, 0u, nullptr, 0u, &dup, 1u);
+    return zx_channel_write(channel, 0u, nullptr, 0u, &dup, 1u);
 }
 
 bool kill_channel_handle_cycle() {
     BEGIN_TEST;
 
-    mx_handle_t chan[2] = {MX_HANDLE_INVALID, MX_HANDLE_INVALID};
-    ASSERT_EQ(mx_channel_create(0u, &chan[0], &chan[1]), MX_OK);
+    zx_handle_t chan[2] = {ZX_HANDLE_INVALID, ZX_HANDLE_INVALID};
+    ASSERT_EQ(zx_channel_create(0u, &chan[0], &chan[1]), ZX_OK);
 
-    mx_handle_t proc1, proc2;
-    mx_handle_t vmar1, vmar2;
+    zx_handle_t proc1, proc2;
+    zx_handle_t vmar1, vmar2;
 
-    mx_handle_t job_child;
-    ASSERT_EQ(mx_job_create(mx_job_default(), 0u, &job_child), MX_OK);
+    zx_handle_t job_child;
+    ASSERT_EQ(zx_job_create(zx_job_default(), 0u, &job_child), ZX_OK);
 
-    ASSERT_EQ(mx_process_create(job_child, "ttp1", 4u, 0u, &proc1, &vmar1), MX_OK);
-    ASSERT_EQ(mx_process_create(job_child, "ttp2", 4u, 0u, &proc2, &vmar2), MX_OK);
+    ASSERT_EQ(zx_process_create(job_child, "ttp1", 4u, 0u, &proc1, &vmar1), ZX_OK);
+    ASSERT_EQ(zx_process_create(job_child, "ttp2", 4u, 0u, &proc2, &vmar2), ZX_OK);
 
-    mx_handle_t thread1, thread2;
+    zx_handle_t thread1, thread2;
 
-    ASSERT_EQ(mx_thread_create(proc1, "th1", 3u, 0u, &thread1), MX_OK);
-    ASSERT_EQ(mx_thread_create(proc2, "th2", 3u, 0u, &thread2), MX_OK);
+    ASSERT_EQ(zx_thread_create(proc1, "th1", 3u, 0u, &thread1), ZX_OK);
+    ASSERT_EQ(zx_thread_create(proc2, "th2", 3u, 0u, &thread2), ZX_OK);
 
     // Now we stuff duplicated process and thread handles into each side of the channel.
 
-    EXPECT_EQ(dup_send_handle(chan[0], proc2), MX_OK);
-    EXPECT_EQ(dup_send_handle(chan[0], thread2), MX_OK);
+    EXPECT_EQ(dup_send_handle(chan[0], proc2), ZX_OK);
+    EXPECT_EQ(dup_send_handle(chan[0], thread2), ZX_OK);
 
-    EXPECT_EQ(dup_send_handle(chan[1], proc1), MX_OK);
-    EXPECT_EQ(dup_send_handle(chan[1], thread1), MX_OK);
+    EXPECT_EQ(dup_send_handle(chan[1], proc1), ZX_OK);
+    EXPECT_EQ(dup_send_handle(chan[1], thread1), ZX_OK);
 
     // The process start with each one side of the channel. We don't have access to the
     // channel anymore.
 
-    mx_handle_t minip_chn[2];
+    zx_handle_t minip_chn[2];
 
     EXPECT_EQ(start_mini_process_etc(proc1, thread1, vmar1, chan[0], &minip_chn[0]),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(start_mini_process_etc(proc2, thread2, vmar2, chan[1], &minip_chn[1]),
-              MX_OK);
+              ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(vmar2), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar1), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmar2), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar1), ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(proc1), MX_OK);
-    EXPECT_EQ(mx_handle_close(proc2), MX_OK);
+    EXPECT_EQ(zx_handle_close(proc1), ZX_OK);
+    EXPECT_EQ(zx_handle_close(proc2), ZX_OK);
 
     // Make (relatively) certain the processes are alive.
 
-    mx_signals_t signals;
-    EXPECT_EQ(mx_object_wait_one(
-        thread1, MX_TASK_TERMINATED, mx_deadline_after(kTimeoutNs), &signals), MX_ERR_TIMED_OUT);
+    zx_signals_t signals;
+    EXPECT_EQ(zx_object_wait_one(
+        thread1, ZX_TASK_TERMINATED, zx_deadline_after(kTimeoutNs), &signals), ZX_ERR_TIMED_OUT);
 
-    EXPECT_EQ(mx_object_wait_one(
-        thread2, MX_TASK_TERMINATED, mx_deadline_after(kTimeoutNs), &signals), MX_ERR_TIMED_OUT);
+    EXPECT_EQ(zx_object_wait_one(
+        thread2, ZX_TASK_TERMINATED, zx_deadline_after(kTimeoutNs), &signals), ZX_ERR_TIMED_OUT);
 
     // At this point the two processes have each other thread/process handles. For example
     // if we close the thread handles, unlike the previous test, the processes will
     // still be alive.
 
-    EXPECT_EQ(mx_handle_close(thread1), MX_OK);
+    EXPECT_EQ(zx_handle_close(thread1), ZX_OK);
 
-    EXPECT_EQ(mx_object_wait_one(
-        thread2, MX_TASK_TERMINATED, mx_deadline_after(kTimeoutNs), &signals), MX_ERR_TIMED_OUT);
+    EXPECT_EQ(zx_object_wait_one(
+        thread2, ZX_TASK_TERMINATED, zx_deadline_after(kTimeoutNs), &signals), ZX_ERR_TIMED_OUT);
 
     // The only way out of this situation is to use the job handle.
 
-    EXPECT_EQ(mx_task_kill(job_child), MX_OK);
+    EXPECT_EQ(zx_task_kill(job_child), ZX_OK);
 
-    EXPECT_EQ(mx_object_wait_one(
-        thread2, MX_TASK_TERMINATED, MX_TIME_INFINITE, &signals), MX_OK);
-    signals &= MX_TASK_TERMINATED;
-    EXPECT_EQ(signals, MX_TASK_TERMINATED);
+    EXPECT_EQ(zx_object_wait_one(
+        thread2, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, &signals), ZX_OK);
+    signals &= ZX_TASK_TERMINATED;
+    EXPECT_EQ(signals, ZX_TASK_TERMINATED);
 
-    EXPECT_EQ(mx_handle_close(thread2), MX_OK);
-    EXPECT_EQ(mx_handle_close(job_child), MX_OK);
+    EXPECT_EQ(zx_handle_close(thread2), ZX_OK);
+    EXPECT_EQ(zx_handle_close(job_child), ZX_OK);
 
     END_TEST;
 }
 
-// Tests that |mx_info_process_t| fields reflect the current state of a process.
+// Tests that |zx_info_process_t| fields reflect the current state of a process.
 bool info_reflects_process_state() {
     BEGIN_TEST;
 
     // Create a process with one thread.
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0u, &event), MX_OK);
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0u, &event), ZX_OK);
 
-    mx_handle_t job_child;
-    ASSERT_EQ(mx_job_create(mx_job_default(), 0u, &job_child), MX_OK);
+    zx_handle_t job_child;
+    ASSERT_EQ(zx_job_create(zx_job_default(), 0u, &job_child), ZX_OK);
 
-    mx_handle_t proc;
-    mx_handle_t vmar;
-    ASSERT_EQ(mx_process_create(job_child, "ttp", 4u, 0u, &proc, &vmar), MX_OK);
+    zx_handle_t proc;
+    zx_handle_t vmar;
+    ASSERT_EQ(zx_process_create(job_child, "ttp", 4u, 0u, &proc, &vmar), ZX_OK);
 
-    mx_handle_t thread;
-    ASSERT_EQ(mx_thread_create(proc, "th", 3u, 0u, &thread), MX_OK);
+    zx_handle_t thread;
+    ASSERT_EQ(zx_thread_create(proc, "th", 3u, 0u, &thread), ZX_OK);
 
-    mx_info_process_t info;
-    ASSERT_EQ(mx_object_get_info(
-            proc, MX_INFO_PROCESS, &info, sizeof(info), NULL, NULL), MX_OK);
+    zx_info_process_t info;
+    ASSERT_EQ(zx_object_get_info(
+            proc, ZX_INFO_PROCESS, &info, sizeof(info), NULL, NULL), ZX_OK);
     EXPECT_FALSE(info.started, "process should not appear as started");
     EXPECT_FALSE(info.exited, "process should not appear as exited");
 
-    mx_handle_t minip_chn;
+    zx_handle_t minip_chn;
     // Start the process and make (relatively) certain it's alive.
     ASSERT_EQ(start_mini_process_etc(proc, thread, vmar, event, &minip_chn),
-              MX_OK);
-    mx_signals_t signals;
-    ASSERT_EQ(mx_object_wait_one(
-        proc, MX_TASK_TERMINATED, mx_deadline_after(kTimeoutNs), &signals), MX_ERR_TIMED_OUT);
+              ZX_OK);
+    zx_signals_t signals;
+    ASSERT_EQ(zx_object_wait_one(
+        proc, ZX_TASK_TERMINATED, zx_deadline_after(kTimeoutNs), &signals), ZX_ERR_TIMED_OUT);
 
-    ASSERT_EQ(mx_object_get_info(
-            proc, MX_INFO_PROCESS, &info, sizeof(info), NULL, NULL), MX_OK);
+    ASSERT_EQ(zx_object_get_info(
+            proc, ZX_INFO_PROCESS, &info, sizeof(info), NULL, NULL), ZX_OK);
     EXPECT_TRUE(info.started, "process should appear as started");
     EXPECT_FALSE(info.exited, "process should not appear as exited");
 
     // Kill the process and wait for it to terminate.
-    ASSERT_EQ(mx_task_kill(proc), MX_OK);
-    ASSERT_EQ(mx_object_wait_one(
-        proc, MX_TASK_TERMINATED, MX_TIME_INFINITE, &signals), MX_OK);
-    ASSERT_EQ(signals, MX_TASK_TERMINATED | MX_SIGNAL_LAST_HANDLE);
+    ASSERT_EQ(zx_task_kill(proc), ZX_OK);
+    ASSERT_EQ(zx_object_wait_one(
+        proc, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, &signals), ZX_OK);
+    ASSERT_EQ(signals, ZX_TASK_TERMINATED | ZX_SIGNAL_LAST_HANDLE);
 
-    ASSERT_EQ(mx_object_get_info(
-            proc, MX_INFO_PROCESS, &info, sizeof(info), NULL, NULL), MX_OK);
+    ASSERT_EQ(zx_object_get_info(
+            proc, ZX_INFO_PROCESS, &info, sizeof(info), NULL, NULL), ZX_OK);
     EXPECT_TRUE(info.started, "process should appear as started");
     EXPECT_TRUE(info.exited, "process should appear as exited");
     EXPECT_NE(info.return_code, 0, "killed process should have non-zero return code");
diff --git a/system/utest/core/process/rules.mk b/system/utest/core/process/rules.mk
index 1605094..dc5a9ac 100644
--- a/system/utest/core/process/rules.mk
+++ b/system/utest/core/process/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := process-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c system/ulib/mini-process
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c system/ulib/mini-process
 
 include make/module.mk
diff --git a/system/utest/core/pthread-barrier/rules.mk b/system/utest/core/pthread-barrier/rules.mk
index a95d2af..8e71170 100644
--- a/system/utest/core/pthread-barrier/rules.mk
+++ b/system/utest/core/pthread-barrier/rules.mk
@@ -15,6 +15,6 @@
 
 MODULE_NAME := pthread-barrier-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/pthread-tls/rules.mk b/system/utest/core/pthread-tls/rules.mk
index 0fa79fd..207cc39 100644
--- a/system/utest/core/pthread-tls/rules.mk
+++ b/system/utest/core/pthread-tls/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := pthread-tls-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/pthread-tls/tls-test.c b/system/utest/core/pthread-tls/tls-test.c
index c7a2b55..98c2957 100644
--- a/system/utest/core/pthread-tls/tls-test.c
+++ b/system/utest/core/pthread-tls/tls-test.c
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include <assert.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 #include <pthread.h>
 #include <stdatomic.h>
@@ -25,7 +25,7 @@
               "Error while setting tls value");
     EXPECT_EQ(pthread_setspecific(tsd_key_dtor, &value2), 0,
               "Error while setting tls value");
-    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
     int* v = pthread_getspecific(tsd_key);
     EXPECT_EQ(*v, value1, "wrong TLS value for key");
     v = pthread_getspecific(tsd_key_dtor);
diff --git a/system/utest/core/pthread/pthread.cpp b/system/utest/core/pthread/pthread.cpp
index 4bbd97f..dc30f9d 100644
--- a/system/utest/core/pthread/pthread.cpp
+++ b/system/utest/core/pthread/pthread.cpp
@@ -13,7 +13,7 @@
 #include <time.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -32,7 +32,7 @@
     pthread_mutex_lock(&mutex);
     log("thread 1 got mutex\n");
     thread_with_lock = 1;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(300)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(300)));
 
     // Make sure no other thread woke up
     EXPECT_EQ(thread_with_lock, 1, "Only thread 1 should have woken up");
@@ -43,13 +43,13 @@
 }
 
 static void* mutex_thread_2(void* arg) {
-    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
     log("thread 2 grabbing mutex\n");
     pthread_mutex_lock(&mutex);
     log("thread 2 got mutex\n");
     thread_with_lock = 2;
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(300)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(300)));
 
     // Make sure no other thread woke up
     EXPECT_EQ(thread_with_lock, 2, "Only thread 2 should have woken up");
@@ -61,13 +61,13 @@
 }
 
 static void* mutex_thread_3(void* arg) {
-    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
     log("thread 3 grabbing mutex\n");
     pthread_mutex_lock(&mutex);
     log("thread 3 got mutex\n");
     thread_with_lock = 3;
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(300)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(300)));
 
     // Make sure no other thread woke up
     EXPECT_EQ(thread_with_lock, 3, "Only thread 3 should have woken up");
@@ -129,25 +129,25 @@
     pthread_create(&thread2, NULL, cond_thread2, NULL);
     pthread_create(&thread3, NULL, cond_thread3, NULL);
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(300)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(300)));
 
     log("calling pthread_cond_broadcast\n");
     pthread_cond_broadcast(&cond);
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
     log("calling pthread_cond_signal\n");
     pthread_cond_signal(&cond);
-    mx_nanosleep(mx_deadline_after(MX_MSEC(300)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(300)));
     EXPECT_EQ(process_waked, 1, "Only 1 process should have woken up");
 
     log("calling pthread_cond_signal\n");
     pthread_cond_signal(&cond);
-    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
     EXPECT_EQ(process_waked, 2, "Only 2 processes should have woken up");
 
     log("calling pthread_cond_signal\n");
     pthread_cond_signal(&cond);
-    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
     EXPECT_EQ(process_waked, 3, "Only 3 processes should have woken up");
 
     log("joining cond threads\n");
diff --git a/system/utest/core/pthread/rules.mk b/system/utest/core/pthread/rules.mk
index 4189d4c..f3f9347 100644
--- a/system/utest/core/pthread/rules.mk
+++ b/system/utest/core/pthread/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := pthread-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/resource/resource.c b/system/utest/core/resource/resource.c
index bd9eaf6..70c99cb 100644
--- a/system/utest/core/resource/resource.c
+++ b/system/utest/core/resource/resource.c
@@ -2,54 +2,54 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/types.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/syscalls/port.h>
-#include <magenta/syscalls/resource.h>
+#include <zircon/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/syscalls/resource.h>
 #include <unittest/unittest.h>
 #include <stdio.h>
 
-extern mx_handle_t root_resource;
+extern zx_handle_t root_resource;
 
 static bool test_resource_actions(void) {
     BEGIN_TEST;
 
-    mx_handle_t rrh = root_resource;
-    ASSERT_NE(rrh, MX_HANDLE_INVALID, "no root resource handle");
+    zx_handle_t rrh = root_resource;
+    ASSERT_NE(rrh, ZX_HANDLE_INVALID, "no root resource handle");
 
-    mx_handle_t h;
+    zx_handle_t h;
 
     // root resources can be used to create any resources
-    ASSERT_EQ(mx_resource_create(rrh, MX_RSRC_KIND_ROOT, 1, 2, &h), MX_OK, "");
+    ASSERT_EQ(zx_resource_create(rrh, ZX_RSRC_KIND_ROOT, 1, 2, &h), ZX_OK, "");
 
-    mx_info_resource_t info;
+    zx_info_resource_t info;
 
-    ASSERT_EQ(mx_object_get_info(h, MX_INFO_RESOURCE, &info, sizeof(info), NULL, NULL), MX_OK, "");
-    ASSERT_EQ(info.kind, MX_RSRC_KIND_ROOT, "");
+    ASSERT_EQ(zx_object_get_info(h, ZX_INFO_RESOURCE, &info, sizeof(info), NULL, NULL), ZX_OK, "");
+    ASSERT_EQ(info.kind, ZX_RSRC_KIND_ROOT, "");
     ASSERT_EQ(info.low, 1u, "");
     ASSERT_EQ(info.high, 2u, "");
 
     // but ranges may not be backwards for any resource
-    ASSERT_EQ(mx_resource_create(rrh, MX_RSRC_KIND_ROOT, 2, 1, &h), MX_ERR_INVALID_ARGS, "");
+    ASSERT_EQ(zx_resource_create(rrh, ZX_RSRC_KIND_ROOT, 2, 1, &h), ZX_ERR_INVALID_ARGS, "");
 
     // create a non-root resource
-    ASSERT_EQ(mx_resource_create(rrh, 0x12345678, 0x1000, 0x2000, &h), MX_OK, "");
+    ASSERT_EQ(zx_resource_create(rrh, 0x12345678, 0x1000, 0x2000, &h), ZX_OK, "");
 
-    ASSERT_EQ(mx_object_get_info(h, MX_INFO_RESOURCE, &info, sizeof(info), NULL, NULL), MX_OK, "");
+    ASSERT_EQ(zx_object_get_info(h, ZX_INFO_RESOURCE, &info, sizeof(info), NULL, NULL), ZX_OK, "");
     ASSERT_EQ(info.kind, 0x12345678u, "");
     ASSERT_EQ(info.low, 0x1000u, "");
     ASSERT_EQ(info.high, 0x2000u, "");
 
-    mx_handle_t h1;
+    zx_handle_t h1;
 
     // verify range checks
-    ASSERT_EQ(mx_resource_create(h, 0x12345678, 0, 1, &h1), MX_ERR_OUT_OF_RANGE, "");
-    ASSERT_EQ(mx_resource_create(h, 0x12345678, 0x1F00, 0x2010, &h1), MX_ERR_OUT_OF_RANGE, "");
+    ASSERT_EQ(zx_resource_create(h, 0x12345678, 0, 1, &h1), ZX_ERR_OUT_OF_RANGE, "");
+    ASSERT_EQ(zx_resource_create(h, 0x12345678, 0x1F00, 0x2010, &h1), ZX_ERR_OUT_OF_RANGE, "");
 
     // verify permission checks
-    ASSERT_EQ(mx_resource_create(h, MX_RSRC_KIND_ROOT, 0x1000, 0x1001, &h), MX_ERR_ACCESS_DENIED, "");
-    ASSERT_EQ(mx_resource_create(h, 0x11111111, 0x1000, 0x1001, &h), MX_ERR_ACCESS_DENIED, "");
+    ASSERT_EQ(zx_resource_create(h, ZX_RSRC_KIND_ROOT, 0x1000, 0x1001, &h), ZX_ERR_ACCESS_DENIED, "");
+    ASSERT_EQ(zx_resource_create(h, 0x11111111, 0x1000, 0x1001, &h), ZX_ERR_ACCESS_DENIED, "");
 
     END_TEST;
 }
diff --git a/system/utest/core/rules.mk b/system/utest/core/rules.mk
index fc0780e..fdbeefa216 100644
--- a/system/utest/core/rules.mk
+++ b/system/utest/core/rules.mk
@@ -30,7 +30,7 @@
 MODULE_LIBS := \
     system/ulib/unittest \
     system/ulib/mini-process \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c
 
 MODULE_DEFINES := BUILD_COMBINED_TESTS=1
diff --git a/system/utest/core/socket/rules.mk b/system/utest/core/socket/rules.mk
index fc5a8b3..e1680ea 100644
--- a/system/utest/core/socket/rules.mk
+++ b/system/utest/core/socket/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := socket-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/socket/socket.c b/system/utest/core/socket/socket.c
index ca55225..c635a5a 100644
--- a/system/utest/core/socket/socket.c
+++ b/system/utest/core/socket/socket.c
@@ -3,80 +3,80 @@
 // found in the LICENSE file.
 
 #include <assert.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
-static mx_signals_t get_satisfied_signals(mx_handle_t handle) {
-    mx_signals_t pending = 0;
-    mx_object_wait_one(handle, 0u, 0u, &pending);
+static zx_signals_t get_satisfied_signals(zx_handle_t handle) {
+    zx_signals_t pending = 0;
+    zx_object_wait_one(handle, 0u, 0u, &pending);
     return pending;
 }
 
 static bool socket_basic(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
     size_t count;
 
-    mx_handle_t h[2];
+    zx_handle_t h[2];
     uint32_t read_data[] = { 0, 0 };
 
-    status = mx_socket_create(0, h, h + 1);
-    ASSERT_EQ(status, MX_OK, "");
+    status = zx_socket_create(0, h, h + 1);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    status = mx_socket_read(h[0], 0u, read_data, sizeof(read_data), &count);
-    EXPECT_EQ(status, MX_ERR_SHOULD_WAIT, "");
+    status = zx_socket_read(h[0], 0u, read_data, sizeof(read_data), &count);
+    EXPECT_EQ(status, ZX_ERR_SHOULD_WAIT, "");
 
     static const uint32_t write_data[] = { 0xdeadbeef, 0xc0ffee };
-    status = mx_socket_write(h[0], 0u, &write_data[0], sizeof(write_data[0]), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h[0], 0u, &write_data[0], sizeof(write_data[0]), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(write_data[0]), "");
-    status = mx_socket_write(h[0], 0u, &write_data[1], sizeof(write_data[1]), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h[0], 0u, &write_data[1], sizeof(write_data[1]), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(write_data[1]), "");
 
-    status = mx_socket_read(h[1], 0u, read_data, sizeof(read_data), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h[1], 0u, read_data, sizeof(read_data), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(read_data), "");
     EXPECT_EQ(read_data[0], write_data[0], "");
     EXPECT_EQ(read_data[1], write_data[1], "");
 
-    status = mx_socket_write(h[0], 0u, write_data, sizeof(write_data), NULL);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h[0], 0u, write_data, sizeof(write_data), NULL);
+    EXPECT_EQ(status, ZX_OK, "");
     memset(read_data, 0, sizeof(read_data));
-    status = mx_socket_read(h[1], 0u, read_data, sizeof(read_data), NULL);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h[1], 0u, read_data, sizeof(read_data), NULL);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(read_data[0], write_data[0], "");
     EXPECT_EQ(read_data[1], write_data[1], "");
 
-    mx_handle_close(h[1]);
+    zx_handle_close(h[1]);
 
-    status = mx_socket_write(h[0], 0u, &write_data[1], sizeof(write_data[1]), &count);
-    EXPECT_EQ(status, MX_ERR_PEER_CLOSED, "");
+    status = zx_socket_write(h[0], 0u, &write_data[1], sizeof(write_data[1]), &count);
+    EXPECT_EQ(status, ZX_ERR_PEER_CLOSED, "");
 
-    mx_handle_close(h[0]);
+    zx_handle_close(h[0]);
     END_TEST;
 }
 
 static bool socket_signals(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
     size_t count;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(0, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(0, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    mx_signals_t signals0 = get_satisfied_signals(h0);
-    mx_signals_t signals1 = get_satisfied_signals(h1);
+    zx_signals_t signals0 = get_satisfied_signals(h0);
+    zx_signals_t signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
     const size_t kAllSize = 128 * 1024;
     char* big_buf =  (char*) malloc(kAllSize);
@@ -84,44 +84,44 @@
 
     memset(big_buf, 0x66, kAllSize);
 
-    status = mx_socket_write(h0, 0u, big_buf, kAllSize / 16, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, 0u, big_buf, kAllSize / 16, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, kAllSize / 16, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_READABLE | MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_READABLE | ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_read(h1, 0u, big_buf, kAllSize, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, big_buf, kAllSize, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, kAllSize / 16, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_object_signal_peer(h0, MX_SOCKET_WRITABLE, 0u);
-    EXPECT_EQ(status, MX_ERR_INVALID_ARGS, "");
+    status = zx_object_signal_peer(h0, ZX_SOCKET_WRITABLE, 0u);
+    EXPECT_EQ(status, ZX_ERR_INVALID_ARGS, "");
 
-    status = mx_object_signal_peer(h0, 0u, MX_USER_SIGNAL_1);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_object_signal_peer(h0, 0u, ZX_USER_SIGNAL_1);
+    EXPECT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_USER_SIGNAL_1 | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_USER_SIGNAL_1 | ZX_SIGNAL_LAST_HANDLE, "");
 
-    mx_handle_close(h1);
+    zx_handle_close(h1);
 
     signals0 = get_satisfied_signals(h0);
-    EXPECT_EQ(signals0, MX_SOCKET_PEER_CLOSED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_PEER_CLOSED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    mx_handle_close(h0);
+    zx_handle_close(h0);
 
     free(big_buf);
     END_TEST;
@@ -130,73 +130,73 @@
 static bool socket_shutdown_write(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
     size_t count;
-    mx_signals_t signals0, signals1;
+    zx_signals_t signals0, signals1;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(0, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(0, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, 0u, "12345", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, 0u, "12345", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
-    status = mx_socket_write(h1, MX_SOCKET_SHUTDOWN_WRITE, NULL, 0u, NULL);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, ZX_SOCKET_SHUTDOWN_WRITE, NULL, 0u, NULL);
+    EXPECT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
     EXPECT_EQ(signals0,
-        MX_SOCKET_WRITABLE | MX_SOCKET_READABLE | MX_SIGNAL_LAST_HANDLE,
+        ZX_SOCKET_WRITABLE | ZX_SOCKET_READABLE | ZX_SIGNAL_LAST_HANDLE,
         "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITE_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITE_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h0, 0u, "abcde", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, 0u, "abcde", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals1, MX_SOCKET_READABLE | MX_SOCKET_WRITE_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_READABLE | ZX_SOCKET_WRITE_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, 0u, "fghij", 5u, &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_write(h1, 0u, "fghij", 5u, &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     char rbuf[10] = {0};
 
-    status = mx_socket_read(h0, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h0, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     EXPECT_EQ(memcmp(rbuf, "12345", 5), 0, "");
 
-    status = mx_socket_read(h0, 0u, rbuf, 1u, &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_read(h0, 0u, rbuf, 1u, &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     signals0 = get_satisfied_signals(h0);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_READ_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_READ_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     EXPECT_EQ(memcmp(rbuf, "abcde", 5), 0, "");
 
-    mx_handle_close(h0);
+    zx_handle_close(h0);
 
     // Calling shutdown after the peer is closed is completely valid.
-    status = mx_socket_write(h1, MX_SOCKET_SHUTDOWN_READ, NULL, 0u, NULL);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, ZX_SOCKET_SHUTDOWN_READ, NULL, 0u, NULL);
+    EXPECT_EQ(status, ZX_OK, "");
 
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals1, MX_SOCKET_READ_DISABLED | MX_SOCKET_WRITE_DISABLED | MX_SOCKET_PEER_CLOSED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_READ_DISABLED | ZX_SOCKET_WRITE_DISABLED | ZX_SOCKET_PEER_CLOSED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    mx_handle_close(h1);
+    zx_handle_close(h1);
 
     END_TEST;
 }
@@ -204,63 +204,63 @@
 static bool socket_shutdown_read(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
     size_t count;
-    mx_signals_t signals0, signals1;
+    zx_signals_t signals0, signals1;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(0, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(0, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, 0u, "12345", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, 0u, "12345", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
-    status = mx_socket_write(h0, MX_SOCKET_SHUTDOWN_READ, NULL, 0u, NULL);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, ZX_SOCKET_SHUTDOWN_READ, NULL, 0u, NULL);
+    EXPECT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_READABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITE_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_READABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITE_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h0, 0u, "abcde", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, 0u, "abcde", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals1, MX_SOCKET_READABLE | MX_SOCKET_WRITE_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_READABLE | ZX_SOCKET_WRITE_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, 0u, "fghij", 5u, &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_write(h1, 0u, "fghij", 5u, &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     char rbuf[10] = {0};
 
-    status = mx_socket_read(h0, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h0, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     EXPECT_EQ(memcmp(rbuf, "12345", 5), 0, "");
 
-    status = mx_socket_read(h0, 0u, rbuf, 1u, &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_read(h0, 0u, rbuf, 1u, &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     signals0 = get_satisfied_signals(h0);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_READ_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_READ_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     EXPECT_EQ(memcmp(rbuf, "abcde", 5), 0, "");
 
-    mx_handle_close(h0);
-    mx_handle_close(h1);
+    zx_handle_close(h0);
+    zx_handle_close(h1);
 
     END_TEST;
 }
@@ -268,44 +268,44 @@
 static bool socket_bytes_outstanding(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
     size_t count;
 
-    mx_handle_t h[2];
+    zx_handle_t h[2];
     uint32_t read_data[] = { 0, 0 };
 
-    status = mx_socket_create(0, h, h + 1);
-    ASSERT_EQ(status, MX_OK, "");
+    status = zx_socket_create(0, h, h + 1);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    status = mx_socket_read(h[0], 0u, read_data, sizeof(read_data), &count);
-    EXPECT_EQ(status, MX_ERR_SHOULD_WAIT, "");
+    status = zx_socket_read(h[0], 0u, read_data, sizeof(read_data), &count);
+    EXPECT_EQ(status, ZX_ERR_SHOULD_WAIT, "");
 
     static const uint32_t write_data[] = { 0xdeadbeef, 0xc0ffee };
-    status = mx_socket_write(h[0], 0u, &write_data[0], sizeof(write_data[0]), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h[0], 0u, &write_data[0], sizeof(write_data[0]), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(write_data[0]), "");
-    status = mx_socket_write(h[0], 0u, &write_data[1], sizeof(write_data[1]), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h[0], 0u, &write_data[1], sizeof(write_data[1]), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(write_data[1]), "");
 
     // Check the number of bytes outstanding.
     size_t outstanding = 0u;
-    status = mx_socket_read(h[1], 0u, NULL, 0, &outstanding);
+    status = zx_socket_read(h[1], 0u, NULL, 0, &outstanding);
     EXPECT_EQ(outstanding, sizeof(write_data), "");
 
-    // Check that the prior mx_socket_read call didn't disturb the pending data.
-    status = mx_socket_read(h[1], 0u, read_data, sizeof(read_data), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    // Check that the prior zx_socket_read call didn't disturb the pending data.
+    status = zx_socket_read(h[1], 0u, read_data, sizeof(read_data), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(read_data), "");
     EXPECT_EQ(read_data[0], write_data[0], "");
     EXPECT_EQ(read_data[1], write_data[1], "");
 
-    mx_handle_close(h[1]);
+    zx_handle_close(h[1]);
 
-    status = mx_socket_write(h[0], 0u, &write_data[1], sizeof(write_data[1]), &count);
-    EXPECT_EQ(status, MX_ERR_PEER_CLOSED, "");
+    status = zx_socket_write(h[0], 0u, &write_data[1], sizeof(write_data[1]), &count);
+    EXPECT_EQ(status, ZX_ERR_PEER_CLOSED, "");
 
-    mx_handle_close(h[0]);
+    zx_handle_close(h[0]);
 
     END_TEST;
 }
@@ -313,70 +313,70 @@
 static bool socket_bytes_outstanding_shutdown_write(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
     size_t count;
-    mx_signals_t signals0, signals1;
+    zx_signals_t signals0, signals1;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(0, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(0, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, 0u, "12345", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, 0u, "12345", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
-    status = mx_socket_write(h1, MX_SOCKET_SHUTDOWN_WRITE, NULL, 0u, NULL);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, ZX_SOCKET_SHUTDOWN_WRITE, NULL, 0u, NULL);
+    EXPECT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
     EXPECT_EQ(signals0,
-        MX_SOCKET_WRITABLE | MX_SOCKET_READABLE | MX_SIGNAL_LAST_HANDLE,
+        ZX_SOCKET_WRITABLE | ZX_SOCKET_READABLE | ZX_SIGNAL_LAST_HANDLE,
         "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITE_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITE_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h0, 0u, "abcde", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, 0u, "abcde", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals1, MX_SOCKET_READABLE | MX_SOCKET_WRITE_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_READABLE | ZX_SOCKET_WRITE_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, 0u, "fghij", 5u, &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_write(h1, 0u, "fghij", 5u, &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     char rbuf[10] = {0};
 
-    status = mx_socket_read(h0, 0u, NULL, 0, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h0, 0u, NULL, 0, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     count = 0;
 
-    status = mx_socket_read(h0, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h0, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     EXPECT_EQ(memcmp(rbuf, "12345", 5), 0, "");
 
-    status = mx_socket_read(h0, 0u, rbuf, 1u, &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_read(h0, 0u, rbuf, 1u, &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     signals0 = get_satisfied_signals(h0);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_READ_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_READ_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     EXPECT_EQ(memcmp(rbuf, "abcde", 5), 0, "");
 
-    mx_handle_close(h0);
-    mx_handle_close(h1);
+    zx_handle_close(h0);
+    zx_handle_close(h1);
 
     END_TEST;
 }
@@ -385,68 +385,68 @@
 static bool socket_bytes_outstanding_shutdown_read(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
     size_t count;
-    mx_signals_t signals0, signals1;
+    zx_signals_t signals0, signals1;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(0, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(0, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, 0u, "12345", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, 0u, "12345", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
-    status = mx_socket_write(h0, MX_SOCKET_SHUTDOWN_READ, NULL, 0u, NULL);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, ZX_SOCKET_SHUTDOWN_READ, NULL, 0u, NULL);
+    EXPECT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
 
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_READABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITE_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_READABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITE_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h0, 0u, "abcde", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, 0u, "abcde", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals1, MX_SOCKET_READABLE | MX_SOCKET_WRITE_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_READABLE | ZX_SOCKET_WRITE_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, 0u, "fghij", 5u, &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_write(h1, 0u, "fghij", 5u, &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     char rbuf[10] = {0};
 
-    status = mx_socket_read(h0, 0u, NULL, 0, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h0, 0u, NULL, 0, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     count = 0;
 
-    status = mx_socket_read(h0, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h0, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     EXPECT_EQ(memcmp(rbuf, "12345", 5), 0, "");
 
-    status = mx_socket_read(h0, 0u, rbuf, 1u, &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_read(h0, 0u, rbuf, 1u, &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     signals0 = get_satisfied_signals(h0);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_READ_DISABLED | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_READ_DISABLED | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     EXPECT_EQ(memcmp(rbuf, "abcde", 5), 0, "");
 
-    mx_handle_close(h0);
-    mx_handle_close(h1);
+    zx_handle_close(h0);
+    zx_handle_close(h1);
 
     END_TEST;
 }
@@ -454,23 +454,23 @@
 static bool socket_short_write(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(0, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(0, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
     // TODO(qsr): Request socket buffer and use (socket_buffer + 1).
     const size_t buffer_size = 256 * 1024 + 1;
     char* buffer = malloc(buffer_size);
     size_t written = ~(size_t)0; // This should get overwritten by the syscall.
-    status = mx_socket_write(h0, 0u, buffer, buffer_size, &written);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, 0u, buffer, buffer_size, &written);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_LT(written, buffer_size, "");
 
     free(buffer);
-    mx_handle_close(h0);
-    mx_handle_close(h1);
+    zx_handle_close(h0);
+    zx_handle_close(h1);
 
     END_TEST;
 }
@@ -479,19 +479,19 @@
     BEGIN_TEST;
 
     size_t count;
-    mx_status_t status;
-    mx_handle_t h0, h1;
+    zx_status_t status;
+    zx_handle_t h0, h1;
     unsigned char rbuf[4096] = {0}; // bigger than an mbuf
 
-    status = mx_socket_create(MX_SOCKET_DATAGRAM, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    status = zx_socket_create(ZX_SOCKET_DATAGRAM, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    status = mx_socket_write(h0, 0u, "packet1", 8u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, 0u, "packet1", 8u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 8u, "");
 
-    status = mx_socket_write(h0, 0u, "pkt2", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, 0u, "pkt2", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
     rbuf[0] = 'a';
@@ -500,34 +500,34 @@
     rbuf[3000] = 'd';
     rbuf[4000] = 'e';
     rbuf[4095] = 'f';
-    status = mx_socket_write(h0, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(rbuf), "");
 
-    status = mx_socket_read(h1, 0u, NULL, 0, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, NULL, 0, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(rbuf) + 8u + 5u, "");
     count = 0;
 
     bzero(rbuf, sizeof(rbuf));
-    status = mx_socket_read(h1, 0u, rbuf, 3, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, rbuf, 3, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 3u, "");
     EXPECT_EQ(memcmp(rbuf, "pac", 4), 0, ""); // short read "packet1"
     count = 0;
 
-    status = mx_socket_read(h1, 0u, NULL, 0, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, NULL, 0, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(rbuf) + 5u, "");
     count = 0;
 
-    status = mx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
     EXPECT_EQ(memcmp(rbuf, "pkt2", 5), 0, "");
 
-    status = mx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, sizeof(rbuf), "");
     EXPECT_EQ(rbuf[0], 'a', "");
     EXPECT_EQ(rbuf[1000], 'b', "");
@@ -536,8 +536,8 @@
     EXPECT_EQ(rbuf[4000], 'e', "");
     EXPECT_EQ(rbuf[4095], 'f', "");
 
-    status = mx_socket_read(h1, 0u, NULL, 0, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0u, NULL, 0, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 0u, "");
 
     END_TEST;
@@ -546,25 +546,25 @@
 static bool socket_datagram_no_short_write(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(MX_SOCKET_DATAGRAM, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(ZX_SOCKET_DATAGRAM, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
     // TODO(qsr): Request socket buffer and use (socket_buffer + 1).
     const size_t buffer_size = 256 * 1024 + 1;
     char* buffer = malloc(buffer_size);
     size_t written = 999;
-    status = mx_socket_write(h0, 0u, buffer, buffer_size, &written);
-    EXPECT_EQ(status, MX_ERR_SHOULD_WAIT, "");
+    status = zx_socket_write(h0, 0u, buffer, buffer_size, &written);
+    EXPECT_EQ(status, ZX_ERR_SHOULD_WAIT, "");
     // Since the syscall failed, it should not have overwritten this output
     // parameter.
     EXPECT_EQ(written, 999u, "");
 
     free(buffer);
-    mx_handle_close(h0);
-    mx_handle_close(h1);
+    zx_handle_close(h0);
+    zx_handle_close(h1);
 
     END_TEST;
 }
@@ -572,26 +572,26 @@
 static bool socket_control_plane_absent(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(0, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(0, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    status = mx_socket_write(h0, MX_SOCKET_CONTROL, "hi", 2u, NULL);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_write(h0, ZX_SOCKET_CONTROL, "hi", 2u, NULL);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
-    status = mx_socket_write(h1, MX_SOCKET_CONTROL, "hi", 2u, NULL);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_write(h1, ZX_SOCKET_CONTROL, "hi", 2u, NULL);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     size_t count;
     char rbuf[10] = {0};
 
-    status = mx_socket_read(h0, MX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_read(h0, ZX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
-    status = mx_socket_read(h1, MX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_ERR_BAD_STATE, "");
+    status = zx_socket_read(h1, ZX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_ERR_BAD_STATE, "");
 
     END_TEST;
 }
@@ -599,79 +599,79 @@
 static bool socket_control_plane(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(MX_SOCKET_HAS_CONTROL, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(ZX_SOCKET_HAS_CONTROL, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    mx_signals_t signals0 = get_satisfied_signals(h0);
-    mx_signals_t signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    zx_signals_t signals0 = get_satisfied_signals(h0);
+    zx_signals_t signals1 = get_satisfied_signals(h1);
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
     // Write to the control plane.
     size_t count;
-    status = mx_socket_write(h0, MX_SOCKET_CONTROL, "hello1", 6u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, ZX_SOCKET_CONTROL, "hello1", 6u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 6u, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_READABLE | MX_SOCKET_CONTROL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_READABLE | ZX_SOCKET_CONTROL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h0, MX_SOCKET_CONTROL, "hi", 2u, NULL);
-    EXPECT_EQ(status, MX_ERR_SHOULD_WAIT, "");
+    status = zx_socket_write(h0, ZX_SOCKET_CONTROL, "hi", 2u, NULL);
+    EXPECT_EQ(status, ZX_ERR_SHOULD_WAIT, "");
 
-    status = mx_socket_write(h1, MX_SOCKET_CONTROL, "hello0", 6u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, ZX_SOCKET_CONTROL, "hello0", 6u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 6u, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_READABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_READABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_READABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_READABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, MX_SOCKET_CONTROL, "hi", 2u, NULL);
-    EXPECT_EQ(status, MX_ERR_SHOULD_WAIT, "");
+    status = zx_socket_write(h1, ZX_SOCKET_CONTROL, "hi", 2u, NULL);
+    EXPECT_EQ(status, ZX_ERR_SHOULD_WAIT, "");
 
     char rbuf[10] = {0};
 
     // The control plane is independent of normal reads and writes.
-    status = mx_socket_read(h0, 0, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_ERR_SHOULD_WAIT, "");
-    status = mx_socket_read(h1, 0, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_ERR_SHOULD_WAIT, "");
-    status = mx_socket_write(h0, 0, "normal", 7u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h0, 0, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_ERR_SHOULD_WAIT, "");
+    status = zx_socket_read(h1, 0, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_ERR_SHOULD_WAIT, "");
+    status = zx_socket_write(h0, 0, "normal", 7u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 7u, "");
-    status = mx_socket_read(h1, 0, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, 0, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 7u, "");
     EXPECT_EQ(memcmp(rbuf, "normal", 7), 0, "");
 
     // Read from the control plane.
-    status = mx_socket_read(h0, MX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h0, ZX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 6u, "");
     EXPECT_EQ(memcmp(rbuf, "hello0", 6), 0, "");
 
-    status = mx_socket_read(h0, MX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_ERR_SHOULD_WAIT, "");
+    status = zx_socket_read(h0, ZX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_ERR_SHOULD_WAIT, "");
 
-    status = mx_socket_read(h1, MX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_read(h1, ZX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 6u, "");
     EXPECT_EQ(memcmp(rbuf, "hello1", 6), 0, "");
 
-    status = mx_socket_read(h1, MX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
-    EXPECT_EQ(status, MX_ERR_SHOULD_WAIT, "");
+    status = zx_socket_read(h1, ZX_SOCKET_CONTROL, rbuf, sizeof(rbuf), &count);
+    EXPECT_EQ(status, ZX_ERR_SHOULD_WAIT, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
     END_TEST;
 }
@@ -679,42 +679,42 @@
 static bool socket_control_plane_shutdown(void) {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
     size_t count;
 
-    mx_handle_t h0, h1;
-    status = mx_socket_create(MX_SOCKET_HAS_CONTROL, &h0, &h1);
-    ASSERT_EQ(status, MX_OK, "");
+    zx_handle_t h0, h1;
+    status = zx_socket_create(ZX_SOCKET_HAS_CONTROL, &h0, &h1);
+    ASSERT_EQ(status, ZX_OK, "");
 
-    mx_signals_t signals0 = get_satisfied_signals(h0);
-    mx_signals_t signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    zx_signals_t signals0 = get_satisfied_signals(h0);
+    zx_signals_t signals1 = get_satisfied_signals(h1);
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h1, 0u, "12345", 5u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, 0u, "12345", 5u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 5u, "");
 
-    status = mx_socket_write(h1, MX_SOCKET_SHUTDOWN_WRITE, NULL, 0u, NULL);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, ZX_SOCKET_SHUTDOWN_WRITE, NULL, 0u, NULL);
+    EXPECT_EQ(status, ZX_OK, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_WRITABLE | MX_SOCKET_READABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITE_DISABLED | MX_SOCKET_CONTROL_WRITABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_WRITABLE | ZX_SOCKET_READABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITE_DISABLED | ZX_SOCKET_CONTROL_WRITABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_socket_write(h0, MX_SOCKET_CONTROL, "hello1", 6u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h0, ZX_SOCKET_CONTROL, "hello1", 6u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 6u, "");
 
-    status = mx_socket_write(h1, MX_SOCKET_CONTROL, "hello0", 6u, &count);
-    EXPECT_EQ(status, MX_OK, "");
+    status = zx_socket_write(h1, ZX_SOCKET_CONTROL, "hello0", 6u, &count);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(count, 6u, "");
 
     signals0 = get_satisfied_signals(h0);
     signals1 = get_satisfied_signals(h1);
-    EXPECT_EQ(signals0, MX_SOCKET_WRITABLE | MX_SOCKET_CONTROL_READABLE | MX_SOCKET_READABLE | MX_SIGNAL_LAST_HANDLE, "");
-    EXPECT_EQ(signals1, MX_SOCKET_WRITE_DISABLED | MX_SOCKET_CONTROL_READABLE | MX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals0, ZX_SOCKET_WRITABLE | ZX_SOCKET_CONTROL_READABLE | ZX_SOCKET_READABLE | ZX_SIGNAL_LAST_HANDLE, "");
+    EXPECT_EQ(signals1, ZX_SOCKET_WRITE_DISABLED | ZX_SOCKET_CONTROL_READABLE | ZX_SIGNAL_LAST_HANDLE, "");
 
     END_TEST;
 }
diff --git a/system/utest/core/stack/rules.mk b/system/utest/core/stack/rules.mk
index 790424d..1e27fac 100644
--- a/system/utest/core/stack/rules.mk
+++ b/system/utest/core/stack/rules.mk
@@ -16,7 +16,7 @@
 MODULE_NAME := stack-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 MODULE_HEADER_DEPS := system/ulib/runtime
 
diff --git a/system/utest/core/stack/stack-test.c b/system/utest/core/stack/stack-test.c
index bc8c239..c28f55c 100644
--- a/system/utest/core/stack/stack-test.c
+++ b/system/utest/core/stack/stack-test.c
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include <limits.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <pthread.h>
 #include <runtime/tls.h>
 #include <stdint.h>
@@ -24,13 +24,13 @@
     // The compiler sees this pointer escape, so it should know
     // that this belongs on the unsafe stack.
     char unsafe_stack[64];
-    (void)mx_system_get_version(unsafe_stack, sizeof(unsafe_stack));
+    (void)zx_system_get_version(unsafe_stack, sizeof(unsafe_stack));
 
     // Likewise, the tls_buf is used.
     static thread_local char tls_buf[64];
-    (void)mx_system_get_version(tls_buf, sizeof(tls_buf));
+    (void)zx_system_get_version(tls_buf, sizeof(tls_buf));
 
-    const void* tp = mxr_tp_get();
+    const void* tp = zxr_tp_get();
 
     EXPECT_NONNULL(environ, "environ unset");
     EXPECT_NONNULL(safe_stack, "CFA is null");
diff --git a/system/utest/core/threads/register-set.c b/system/utest/core/threads/register-set.c
index 3f140f0..880d69d 100644
--- a/system/utest/core/threads/register-set.c
+++ b/system/utest/core/threads/register-set.c
@@ -7,7 +7,7 @@
 
 #include "register-set.h"
 
-void regs_fill_test_values(mx_general_regs_t* regs) {
+void regs_fill_test_values(zx_general_regs_t* regs) {
     for (uint32_t index = 0; index < sizeof(*regs); ++index) {
         ((uint8_t*)regs)[index] = index + 1;
     }
@@ -41,7 +41,7 @@
 #endif
 }
 
-bool regs_expect_eq(mx_general_regs_t* regs1, mx_general_regs_t* regs2) {
+bool regs_expect_eq(zx_general_regs_t* regs1, zx_general_regs_t* regs2) {
     BEGIN_HELPER;
 #define CHECK_REG(FIELD) EXPECT_EQ(regs1->FIELD, regs2->FIELD, "Reg " #FIELD)
 #if defined(__x86_64__)
@@ -82,25 +82,25 @@
 
 // spin_with_regs() function.
 #if defined(__x86_64__)
-static_assert(offsetof(mx_general_regs_t, rax) == 8*0, "");
-static_assert(offsetof(mx_general_regs_t, rbx) == 8*1, "");
-static_assert(offsetof(mx_general_regs_t, rcx) == 8*2, "");
-static_assert(offsetof(mx_general_regs_t, rdx) == 8*3, "");
-static_assert(offsetof(mx_general_regs_t, rsi) == 8*4, "");
-static_assert(offsetof(mx_general_regs_t, rdi) == 8*5, "");
-static_assert(offsetof(mx_general_regs_t, rbp) == 8*6, "");
-static_assert(offsetof(mx_general_regs_t, rsp) == 8*7, "");
-static_assert(offsetof(mx_general_regs_t, r8) == 8*8, "");
-static_assert(offsetof(mx_general_regs_t, r9) == 8*9, "");
-static_assert(offsetof(mx_general_regs_t, r10) == 8*10, "");
-static_assert(offsetof(mx_general_regs_t, r11) == 8*11, "");
-static_assert(offsetof(mx_general_regs_t, r12) == 8*12, "");
-static_assert(offsetof(mx_general_regs_t, r13) == 8*13, "");
-static_assert(offsetof(mx_general_regs_t, r14) == 8*14, "");
-static_assert(offsetof(mx_general_regs_t, r15) == 8*15, "");
-static_assert(offsetof(mx_general_regs_t, rip) == 8*16, "");
-static_assert(offsetof(mx_general_regs_t, rflags) == 8*17, "");
-static_assert(sizeof(mx_general_regs_t) == 8*18, "");
+static_assert(offsetof(zx_general_regs_t, rax) == 8*0, "");
+static_assert(offsetof(zx_general_regs_t, rbx) == 8*1, "");
+static_assert(offsetof(zx_general_regs_t, rcx) == 8*2, "");
+static_assert(offsetof(zx_general_regs_t, rdx) == 8*3, "");
+static_assert(offsetof(zx_general_regs_t, rsi) == 8*4, "");
+static_assert(offsetof(zx_general_regs_t, rdi) == 8*5, "");
+static_assert(offsetof(zx_general_regs_t, rbp) == 8*6, "");
+static_assert(offsetof(zx_general_regs_t, rsp) == 8*7, "");
+static_assert(offsetof(zx_general_regs_t, r8) == 8*8, "");
+static_assert(offsetof(zx_general_regs_t, r9) == 8*9, "");
+static_assert(offsetof(zx_general_regs_t, r10) == 8*10, "");
+static_assert(offsetof(zx_general_regs_t, r11) == 8*11, "");
+static_assert(offsetof(zx_general_regs_t, r12) == 8*12, "");
+static_assert(offsetof(zx_general_regs_t, r13) == 8*13, "");
+static_assert(offsetof(zx_general_regs_t, r14) == 8*14, "");
+static_assert(offsetof(zx_general_regs_t, r15) == 8*15, "");
+static_assert(offsetof(zx_general_regs_t, rip) == 8*16, "");
+static_assert(offsetof(zx_general_regs_t, rflags) == 8*17, "");
+static_assert(sizeof(zx_general_regs_t) == 8*18, "");
 __asm__(".pushsection .text, \"ax\", @progbits\n"
         ".global spin_with_regs\n"
         "spin_with_regs:\n"
@@ -131,13 +131,13 @@
         "jmp spin_with_regs_spin_address\n"
         ".popsection\n");
 #elif defined(__aarch64__)
-static_assert(offsetof(mx_general_regs_t, r[0]) == 8*0, "");
-static_assert(offsetof(mx_general_regs_t, r[1]) == 8*1, "");
-static_assert(offsetof(mx_general_regs_t, lr) == 8*30, "");
-static_assert(offsetof(mx_general_regs_t, sp) == 8*31, "");
-static_assert(offsetof(mx_general_regs_t, pc) == 8*32, "");
-static_assert(offsetof(mx_general_regs_t, cpsr) == 8*33, "");
-static_assert(sizeof(mx_general_regs_t) == 8*34, "");
+static_assert(offsetof(zx_general_regs_t, r[0]) == 8*0, "");
+static_assert(offsetof(zx_general_regs_t, r[1]) == 8*1, "");
+static_assert(offsetof(zx_general_regs_t, lr) == 8*30, "");
+static_assert(offsetof(zx_general_regs_t, sp) == 8*31, "");
+static_assert(offsetof(zx_general_regs_t, pc) == 8*32, "");
+static_assert(offsetof(zx_general_regs_t, cpsr) == 8*33, "");
+static_assert(sizeof(zx_general_regs_t) == 8*34, "");
 __asm__(".pushsection .text, \"ax\", %progbits\n"
         ".global spin_with_regs\n"
         "spin_with_regs:\n"
@@ -201,7 +201,7 @@
         // Fill out the rip field with known value.
         "leaq save_regs_and_exit_thread(%rip), %rax\n"
         "movq %rax, 8*16(%rsp)\n"
-        "call mx_thread_exit@PLT\n"
+        "call zx_thread_exit@PLT\n"
         "ud2\n"
         ".popsection\n");
 #elif defined(__aarch64__)
@@ -233,7 +233,7 @@
         // Save NZCV flags, a subset of the PSTATE/CPSR register.
         "mrs x0, nzcv\n"
         "str x0, [sp, #8*33]\n"
-        "bl mx_thread_exit\n"
+        "bl zx_thread_exit\n"
         "brk 0\n"
         ".popsection\n");
 #else
diff --git a/system/utest/core/threads/register-set.h b/system/utest/core/threads/register-set.h
index 95fe1e5..52a7366 100644
--- a/system/utest/core/threads/register-set.h
+++ b/system/utest/core/threads/register-set.h
@@ -4,17 +4,17 @@
 
 #pragma once
 
-#include <magenta/syscalls/debug.h>
+#include <zircon/syscalls/debug.h>
 
 // This provides some utilities for testing that sets of register values
 // are reported correctly.
 
 #if defined(__x86_64__)
-typedef mx_x86_64_general_regs_t mx_general_regs_t;
+typedef zx_x86_64_general_regs_t zx_general_regs_t;
 #define REG_PC rip
 #define REG_STACK_PTR rsp
 #elif defined(__aarch64__)
-typedef mx_arm64_general_regs_t mx_general_regs_t;
+typedef zx_arm64_general_regs_t zx_general_regs_t;
 #define REG_PC pc
 #define REG_STACK_PTR sp
 #else
@@ -22,17 +22,17 @@
 #endif
 
 // This initializes the register set with arbitrary test data.
-void regs_fill_test_values(mx_general_regs_t* regs);
+void regs_fill_test_values(zx_general_regs_t* regs);
 
 // This returns whether the two register sets' values are equal.
-bool regs_expect_eq(mx_general_regs_t* regs1, mx_general_regs_t* regs2);
+bool regs_expect_eq(zx_general_regs_t* regs1, zx_general_regs_t* regs2);
 
 // This function sets the registers to the state specified by |regs| and
 // then spins, executing a single-instruction infinite loop whose address
 // is |spin_address|.
-void spin_with_regs(mx_general_regs_t* regs);
+void spin_with_regs(zx_general_regs_t* regs);
 void spin_with_regs_spin_address(void);
 
-// This assembly code routine saves the registers into an mx_general_regs_t
-// pointed to by the stack pointer, and then calls mx_thread_exit().
+// This assembly code routine saves the registers into an zx_general_regs_t
+// pointed to by the stack pointer, and then calls zx_thread_exit().
 void save_regs_and_exit_thread(void);
diff --git a/system/utest/core/threads/rules.mk b/system/utest/core/threads/rules.mk
index 01bd5e8..a19cdc5 100644
--- a/system/utest/core/threads/rules.mk
+++ b/system/utest/core/threads/rules.mk
@@ -17,7 +17,7 @@
 MODULE_NAME := threads-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 MODULE_STATIC_LIBS := system/ulib/runtime system/utest/core/threads/test-threads
 
 include make/module.mk
diff --git a/system/utest/core/threads/test-threads/rules.mk b/system/utest/core/threads/test-threads/rules.mk
index 70c807e..ecbd2e4 100644
--- a/system/utest/core/threads/test-threads/rules.mk
+++ b/system/utest/core/threads/test-threads/rules.mk
@@ -16,7 +16,7 @@
 MODULE_NAME := threads-test-threads
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 MODULE_STATIC_LIBS := system/ulib/runtime
 
 include make/module.mk
diff --git a/system/utest/core/threads/test-threads/threads.c b/system/utest/core/threads/test-threads/threads.c
index 0f2885d..855a941 100644
--- a/system/utest/core/threads/test-threads/threads.c
+++ b/system/utest/core/threads/test-threads/threads.c
@@ -6,9 +6,9 @@
 #include <stddef.h>
 #include <string.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/syscalls/port.h>
 
 #include <runtime/thread.h>
 
@@ -16,21 +16,21 @@
 
 void threads_test_sleep_fn(void* arg) {
     // Note: You shouldn't use C standard library functions from this thread.
-    mx_time_t time = (mx_time_t)arg;
-    mx_nanosleep(time);
+    zx_time_t time = (zx_time_t)arg;
+    zx_nanosleep(time);
 }
 
 void threads_test_wait_fn(void* arg) {
-    mx_handle_t event = *(mx_handle_t*)arg;
-    mx_object_wait_one(event, MX_USER_SIGNAL_0, MX_TIME_INFINITE, NULL);
-    mx_object_signal(event, 0u, MX_USER_SIGNAL_1);
+    zx_handle_t event = *(zx_handle_t*)arg;
+    zx_object_wait_one(event, ZX_USER_SIGNAL_0, ZX_TIME_INFINITE, NULL);
+    zx_object_signal(event, 0u, ZX_USER_SIGNAL_1);
 }
 
 void threads_test_wait_detach_fn(void* arg) {
     threads_test_wait_fn(arg);
-    // Since we're detached, we are not allowed to return into the default mxr_thread
+    // Since we're detached, we are not allowed to return into the default zxr_thread
     // exit path.
-    mx_thread_exit();
+    zx_thread_exit();
 }
 
 void threads_test_busy_fn(void* arg) {
@@ -42,22 +42,22 @@
 }
 
 void threads_test_infinite_sleep_fn(void* arg) {
-    mx_nanosleep(UINT64_MAX);
+    zx_nanosleep(UINT64_MAX);
     __builtin_trap();
 }
 
 void threads_test_infinite_wait_fn(void* arg) {
-    mx_handle_t event = *(mx_handle_t*)arg;
-    mx_object_wait_one(event, MX_USER_SIGNAL_0, MX_TIME_INFINITE, NULL);
+    zx_handle_t event = *(zx_handle_t*)arg;
+    zx_object_wait_one(event, ZX_USER_SIGNAL_0, ZX_TIME_INFINITE, NULL);
     __builtin_trap();
 }
 
 void threads_test_port_fn(void* arg) {
-    mx_handle_t* port = (mx_handle_t*)arg;
-    mx_port_packet_t packet = {};
-    mx_port_wait(port[0], MX_TIME_INFINITE, &packet, 0u);
+    zx_handle_t* port = (zx_handle_t*)arg;
+    zx_port_packet_t packet = {};
+    zx_port_wait(port[0], ZX_TIME_INFINITE, &packet, 0u);
     packet.key += 5u;
-    mx_port_queue(port[1], &packet, 0u);
+    zx_port_queue(port[1], &packet, 0u);
 }
 
 void threads_test_channel_call_fn(void* arg_) {
@@ -67,7 +67,7 @@
     uint8_t recv_buf[9];
     uint32_t actual_bytes, actual_handles;
 
-    mx_channel_call_args_t call_args = {
+    zx_channel_call_args_t call_args = {
         .wr_bytes = send_buf,
         .wr_handles = NULL,
         .rd_bytes = recv_buf,
@@ -78,16 +78,16 @@
         .rd_num_handles = 0,
     };
 
-    arg->read_status = MX_OK;
-    arg->call_status = mx_channel_call(arg->channel, 0, MX_TIME_INFINITE, &call_args,
+    arg->read_status = ZX_OK;
+    arg->call_status = zx_channel_call(arg->channel, 0, ZX_TIME_INFINITE, &call_args,
                                        &actual_bytes, &actual_handles, &arg->read_status);
 
-    if (arg->call_status == MX_OK) {
-        arg->read_status = MX_OK;
+    if (arg->call_status == ZX_OK) {
+        arg->read_status = ZX_OK;
         if (actual_bytes != sizeof(recv_buf) || memcmp(recv_buf, "abcdefghj", sizeof(recv_buf))) {
-            arg->call_status = MX_ERR_BAD_STATE;
+            arg->call_status = ZX_ERR_BAD_STATE;
         }
     }
 
-    mx_handle_close(arg->channel);
+    zx_handle_close(arg->channel);
 }
diff --git a/system/utest/core/threads/test-threads/threads.h b/system/utest/core/threads/test-threads/threads.h
index 43c0e1c..d2e591f 100644
--- a/system/utest/core/threads/test-threads/threads.h
+++ b/system/utest/core/threads/test-threads/threads.h
@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 void threads_test_sleep_fn(void* arg);
 void threads_test_wait_fn(void* arg);
@@ -17,7 +17,7 @@
 void threads_test_channel_call_fn(void* arg);
 
 struct channel_call_suspend_test_arg {
-    mx_handle_t channel;
-    mx_status_t call_status;
-    mx_status_t read_status;
+    zx_handle_t channel;
+    zx_status_t call_status;
+    zx_status_t read_status;
 };
diff --git a/system/utest/core/threads/threads.c b/system/utest/core/threads/threads.c
index 96b3f0a..5e8d52c 100644
--- a/system/utest/core/threads/threads.c
+++ b/system/utest/core/threads/threads.c
@@ -6,12 +6,12 @@
 #include <stddef.h>
 #include <unistd.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/debug.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/debug.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/syscalls/port.h>
 
 #include <unittest/unittest.h>
 #include <runtime/thread.h>
@@ -23,22 +23,22 @@
 
 static const unsigned kExceptionPortKey = 42u;
 
-static bool get_koid(mx_handle_t handle, mx_koid_t* koid) {
-    mx_info_handle_basic_t info;
+static bool get_koid(zx_handle_t handle, zx_koid_t* koid) {
+    zx_info_handle_basic_t info;
     size_t records_read;
-    ASSERT_EQ(mx_object_get_info(
-                  handle, MX_INFO_HANDLE_BASIC, &info, sizeof(info),
-                  &records_read, NULL), MX_OK, "");
+    ASSERT_EQ(zx_object_get_info(
+                  handle, ZX_INFO_HANDLE_BASIC, &info, sizeof(info),
+                  &records_read, NULL), ZX_OK, "");
     ASSERT_EQ(records_read, 1u, "");
     *koid = info.koid;
     return true;
 }
 
-static bool check_reported_pid_and_tid(mx_handle_t thread,
-                                       mx_port_packet_t* packet) {
-    mx_koid_t pid;
-    mx_koid_t tid;
-    if (!get_koid(mx_process_self(), &pid))
+static bool check_reported_pid_and_tid(zx_handle_t thread,
+                                       zx_port_packet_t* packet) {
+    zx_koid_t pid;
+    zx_koid_t tid;
+    if (!get_koid(zx_process_self(), &pid))
         return false;
     if (!get_koid(thread, &tid))
         return false;
@@ -49,114 +49,114 @@
 
 // Suspend the given thread.  This waits for the thread suspension to take
 // effect, using the given exception port.
-static bool suspend_thread_synchronous(mx_handle_t thread, mx_handle_t eport) {
-    ASSERT_EQ(mx_task_suspend(thread), MX_OK, "");
+static bool suspend_thread_synchronous(zx_handle_t thread, zx_handle_t eport) {
+    ASSERT_EQ(zx_task_suspend(thread), ZX_OK, "");
 
     // Wait for the thread to suspend.
     for (;;) {
-        mx_port_packet_t packet;
-        ASSERT_EQ(mx_port_wait(eport, MX_TIME_INFINITE, &packet, 0), MX_OK, "");
-        if (packet.type == MX_EXCP_THREAD_EXITING) {
+        zx_port_packet_t packet;
+        ASSERT_EQ(zx_port_wait(eport, ZX_TIME_INFINITE, &packet, 0), ZX_OK, "");
+        if (packet.type == ZX_EXCP_THREAD_EXITING) {
             // Ignore this "thread exiting" event and retry.  This event
             // was probably caused by a thread from an earlier test case.
             // We can get these events even if the previous test case
-            // joined the thread or used mx_object_wait_one() to wait for
+            // joined the thread or used zx_object_wait_one() to wait for
             // the thread to terminate.
             continue;
         }
         EXPECT_TRUE(check_reported_pid_and_tid(thread, &packet), "");
         ASSERT_EQ(packet.key, kExceptionPortKey, "");
-        ASSERT_EQ(packet.type, (uint32_t)MX_EXCP_THREAD_SUSPENDED, "");
+        ASSERT_EQ(packet.type, (uint32_t)ZX_EXCP_THREAD_SUSPENDED, "");
         break;
     }
 
     return true;
 }
 
-static bool start_thread(mxr_thread_entry_t entry, void* arg,
-                         mxr_thread_t* thread_out, mx_handle_t* thread_h) {
+static bool start_thread(zxr_thread_entry_t entry, void* arg,
+                         zxr_thread_t* thread_out, zx_handle_t* thread_h) {
     // TODO: Don't leak these when the thread dies.
     const size_t stack_size = 256u << 10;
-    mx_handle_t thread_stack_vmo = MX_HANDLE_INVALID;
-    ASSERT_EQ(mx_vmo_create(stack_size, 0, &thread_stack_vmo), MX_OK, "");
-    ASSERT_NE(thread_stack_vmo, MX_HANDLE_INVALID, "");
+    zx_handle_t thread_stack_vmo = ZX_HANDLE_INVALID;
+    ASSERT_EQ(zx_vmo_create(stack_size, 0, &thread_stack_vmo), ZX_OK, "");
+    ASSERT_NE(thread_stack_vmo, ZX_HANDLE_INVALID, "");
 
     uintptr_t stack = 0u;
-    ASSERT_EQ(mx_vmar_map(mx_vmar_root_self(), 0, thread_stack_vmo, 0, stack_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &stack), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread_stack_vmo), MX_OK, "");
+    ASSERT_EQ(zx_vmar_map(zx_vmar_root_self(), 0, thread_stack_vmo, 0, stack_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &stack), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_stack_vmo), ZX_OK, "");
 
-    ASSERT_EQ(mxr_thread_create(mx_process_self(), "test_thread", false,
+    ASSERT_EQ(zxr_thread_create(zx_process_self(), "test_thread", false,
                                 thread_out),
-              MX_OK, "");
+              ZX_OK, "");
 
     if (thread_h) {
-        ASSERT_EQ(mx_handle_duplicate(mxr_thread_get_handle(thread_out), MX_RIGHT_SAME_RIGHTS,
-                                      thread_h), MX_OK, "");
+        ASSERT_EQ(zx_handle_duplicate(zxr_thread_get_handle(thread_out), ZX_RIGHT_SAME_RIGHTS,
+                                      thread_h), ZX_OK, "");
     }
-    ASSERT_EQ(mxr_thread_start(thread_out, stack, stack_size, entry, arg),
-              MX_OK, "");
+    ASSERT_EQ(zxr_thread_start(thread_out, stack, stack_size, entry, arg),
+              ZX_OK, "");
     return true;
 }
 
-static bool start_and_kill_thread(mxr_thread_entry_t entry, void* arg) {
-    mxr_thread_t thread;
-    mx_handle_t thread_h;
+static bool start_and_kill_thread(zxr_thread_entry_t entry, void* arg) {
+    zxr_thread_t thread;
+    zx_handle_t thread_h;
     ASSERT_TRUE(start_thread(entry, arg, &thread, &thread_h), "");
-    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
-    ASSERT_EQ(mx_task_kill(thread_h), MX_OK, "");
-    ASSERT_EQ(mx_object_wait_one(thread_h, MX_THREAD_TERMINATED,
-                                 MX_TIME_INFINITE, NULL),
-              MX_OK, "");
-    mxr_thread_destroy(&thread);
-    ASSERT_EQ(mx_handle_close(thread_h), MX_OK, "");
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
+    ASSERT_EQ(zx_task_kill(thread_h), ZX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_h, ZX_THREAD_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL),
+              ZX_OK, "");
+    zxr_thread_destroy(&thread);
+    ASSERT_EQ(zx_handle_close(thread_h), ZX_OK, "");
     return true;
 }
 
-static bool set_debugger_exception_port(mx_handle_t* eport_out) {
-    ASSERT_EQ(mx_port_create(0, eport_out), MX_OK, "");
-    mx_handle_t self = mx_process_self();
-    ASSERT_EQ(mx_task_bind_exception_port(self, *eport_out, kExceptionPortKey,
-                                          MX_EXCEPTION_PORT_DEBUGGER),
-              MX_OK, "");
+static bool set_debugger_exception_port(zx_handle_t* eport_out) {
+    ASSERT_EQ(zx_port_create(0, eport_out), ZX_OK, "");
+    zx_handle_t self = zx_process_self();
+    ASSERT_EQ(zx_task_bind_exception_port(self, *eport_out, kExceptionPortKey,
+                                          ZX_EXCEPTION_PORT_DEBUGGER),
+              ZX_OK, "");
     return true;
 }
 
 static bool test_basics(void) {
     BEGIN_TEST;
-    mxr_thread_t thread;
-    mx_handle_t thread_h;
-    ASSERT_TRUE(start_thread(threads_test_sleep_fn, (void*)mx_deadline_after(MX_MSEC(100)),
+    zxr_thread_t thread;
+    zx_handle_t thread_h;
+    ASSERT_TRUE(start_thread(threads_test_sleep_fn, (void*)zx_deadline_after(ZX_MSEC(100)),
                              &thread, &thread_h), "");
-    ASSERT_EQ(mx_object_wait_one(thread_h, MX_THREAD_TERMINATED, MX_TIME_INFINITE, NULL),
-              MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread_h), MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_h, ZX_THREAD_TERMINATED, ZX_TIME_INFINITE, NULL),
+              ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_h), ZX_OK, "");
     END_TEST;
 }
 
 static bool test_detach(void) {
     BEGIN_TEST;
-    mxr_thread_t thread;
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0, &event), MX_OK, "");
+    zxr_thread_t thread;
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0, &event), ZX_OK, "");
 
-    mx_handle_t thread_h;
+    zx_handle_t thread_h;
     ASSERT_TRUE(start_thread(threads_test_wait_detach_fn, &event, &thread, &thread_h), "");
     // We're not detached yet
-    ASSERT_FALSE(mxr_thread_detached(&thread), "");
+    ASSERT_FALSE(zxr_thread_detached(&thread), "");
 
-    ASSERT_EQ(mxr_thread_detach(&thread), MX_OK, "");
-    ASSERT_TRUE(mxr_thread_detached(&thread), "");
+    ASSERT_EQ(zxr_thread_detach(&thread), ZX_OK, "");
+    ASSERT_TRUE(zxr_thread_detached(&thread), "");
 
     // Tell thread to exit
-    ASSERT_EQ(mx_object_signal(event, 0, MX_USER_SIGNAL_0), MX_OK, "");
+    ASSERT_EQ(zx_object_signal(event, 0, ZX_USER_SIGNAL_0), ZX_OK, "");
 
     // Wait for thread to exit
-    ASSERT_EQ(mx_object_wait_one(thread_h,
-                                 MX_THREAD_TERMINATED, MX_TIME_INFINITE, NULL),
-              MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_h,
+                                 ZX_THREAD_TERMINATED, ZX_TIME_INFINITE, NULL),
+              ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(thread_h), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_h), ZX_OK, "");
 
     END_TEST;
 }
@@ -167,65 +167,65 @@
     static const char long_name[] =
         "0123456789012345678901234567890123456789"
         "0123456789012345678901234567890123456789";
-    ASSERT_GT(strlen(long_name), (size_t)MX_MAX_NAME_LEN-1,
+    ASSERT_GT(strlen(long_name), (size_t)ZX_MAX_NAME_LEN-1,
               "too short to truncate");
 
-    mxr_thread_t thread;
-    ASSERT_EQ(mxr_thread_create(mx_process_self(), long_name, false, &thread),
-              MX_OK, "");
-    mxr_thread_destroy(&thread);
+    zxr_thread_t thread;
+    ASSERT_EQ(zxr_thread_create(zx_process_self(), long_name, false, &thread),
+              ZX_OK, "");
+    zxr_thread_destroy(&thread);
     END_TEST;
 }
 
-// mx_thread_start() is not supposed to be usable for creating a
-// process's first thread.  That's what mx_process_start() is for.
-// Check that mx_thread_start() returns an error in this case.
+// zx_thread_start() is not supposed to be usable for creating a
+// process's first thread.  That's what zx_process_start() is for.
+// Check that zx_thread_start() returns an error in this case.
 static bool test_thread_start_on_initial_thread(void) {
     BEGIN_TEST;
 
     static const char kProcessName[] = "test-proc-thread1";
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t thread;
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK, "");
-    ASSERT_EQ(mx_thread_create(process, kThreadName, sizeof(kThreadName) - 1,
-                               0, &thread), MX_OK, "");
-    ASSERT_EQ(mx_thread_start(thread, 1, 1, 1, 1), MX_ERR_BAD_STATE, "");
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t thread;
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK, "");
+    ASSERT_EQ(zx_thread_create(process, kThreadName, sizeof(kThreadName) - 1,
+                               0, &thread), ZX_OK, "");
+    ASSERT_EQ(zx_thread_start(thread, 1, 1, 1, 1), ZX_ERR_BAD_STATE, "");
 
-    ASSERT_EQ(mx_handle_close(thread), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(vmar), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(process), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(vmar), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(process), ZX_OK, "");
 
     END_TEST;
 }
 
 // Test that we don't get an assertion failure (and kernel panic) if we
 // pass a zero instruction pointer when starting a thread (in this case via
-// mx_process_start()).
+// zx_process_start()).
 static bool test_thread_start_with_zero_instruction_pointer(void) {
     BEGIN_TEST;
 
     static const char kProcessName[] = "test-proc-thread2";
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t thread;
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK, "");
-    ASSERT_EQ(mx_thread_create(process, kThreadName, sizeof(kThreadName) - 1,
-                               0, &thread), MX_OK, "");
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t thread;
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK, "");
+    ASSERT_EQ(zx_thread_create(process, kThreadName, sizeof(kThreadName) - 1,
+                               0, &thread), ZX_OK, "");
 
     REGISTER_CRASH(process);
-    ASSERT_EQ(mx_process_start(process, thread, 0, 0, thread, 0), MX_OK, "");
+    ASSERT_EQ(zx_process_start(process, thread, 0, 0, thread, 0), ZX_OK, "");
 
-    mx_signals_t signals;
-    EXPECT_EQ(mx_object_wait_one(
-        process, MX_TASK_TERMINATED, MX_TIME_INFINITE, &signals), MX_OK, "");
-    signals &= MX_TASK_TERMINATED;
-    EXPECT_EQ(signals, MX_TASK_TERMINATED, "");
+    zx_signals_t signals;
+    EXPECT_EQ(zx_object_wait_one(
+        process, ZX_TASK_TERMINATED, ZX_TIME_INFINITE, &signals), ZX_OK, "");
+    signals &= ZX_TASK_TERMINATED;
+    EXPECT_EQ(signals, ZX_TASK_TERMINATED, "");
 
-    ASSERT_EQ(mx_handle_close(process), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(vmar), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(process), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(vmar), ZX_OK, "");
 
     END_TEST;
 }
@@ -249,10 +249,10 @@
 static bool test_kill_wait_thread(void) {
     BEGIN_TEST;
 
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0, &event), MX_OK, "");
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0, &event), ZX_OK, "");
     ASSERT_TRUE(start_and_kill_thread(threads_test_infinite_wait_fn, &event), "");
-    ASSERT_EQ(mx_handle_close(event), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(event), ZX_OK, "");
 
     END_TEST;
 }
@@ -261,68 +261,68 @@
     BEGIN_TEST;
 
     // perform a bunch of apis against non started threads (in the INITIAL STATE)
-    mx_handle_t thread;
+    zx_handle_t thread;
 
-    ASSERT_EQ(mx_thread_create(mx_process_self(), "thread", 5, 0, &thread), MX_OK, "");
-    ASSERT_EQ(mx_task_resume(thread, 0), MX_ERR_BAD_STATE, "");
-    ASSERT_EQ(mx_task_resume(thread, 0), MX_ERR_BAD_STATE, "");
-    ASSERT_EQ(mx_handle_close(thread), MX_OK, "");
+    ASSERT_EQ(zx_thread_create(zx_process_self(), "thread", 5, 0, &thread), ZX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread, 0), ZX_ERR_BAD_STATE, "");
+    ASSERT_EQ(zx_task_resume(thread, 0), ZX_ERR_BAD_STATE, "");
+    ASSERT_EQ(zx_handle_close(thread), ZX_OK, "");
 
-    ASSERT_EQ(mx_thread_create(mx_process_self(), "thread", 5, 0, &thread), MX_OK, "");
-    ASSERT_EQ(mx_task_resume(thread, 0), MX_ERR_BAD_STATE, "");
-    ASSERT_EQ(mx_task_suspend(thread), MX_ERR_BAD_STATE, "");
-    ASSERT_EQ(mx_handle_close(thread), MX_OK, "");
+    ASSERT_EQ(zx_thread_create(zx_process_self(), "thread", 5, 0, &thread), ZX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread, 0), ZX_ERR_BAD_STATE, "");
+    ASSERT_EQ(zx_task_suspend(thread), ZX_ERR_BAD_STATE, "");
+    ASSERT_EQ(zx_handle_close(thread), ZX_OK, "");
 
-    ASSERT_EQ(mx_thread_create(mx_process_self(), "thread", 5, 0, &thread), MX_OK, "");
-    ASSERT_EQ(mx_task_kill(thread), MX_OK, "");
-    ASSERT_EQ(mx_task_kill(thread), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread), MX_OK, "");
+    ASSERT_EQ(zx_thread_create(zx_process_self(), "thread", 5, 0, &thread), ZX_OK, "");
+    ASSERT_EQ(zx_task_kill(thread), ZX_OK, "");
+    ASSERT_EQ(zx_task_kill(thread), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread), ZX_OK, "");
 
-    ASSERT_EQ(mx_thread_create(mx_process_self(), "thread", 5, 0, &thread), MX_OK, "");
-    ASSERT_EQ(mx_task_kill(thread), MX_OK, "");
-    ASSERT_EQ(mx_task_resume(thread, 0), MX_ERR_BAD_STATE, "");
-    ASSERT_EQ(mx_handle_close(thread), MX_OK, "");
+    ASSERT_EQ(zx_thread_create(zx_process_self(), "thread", 5, 0, &thread), ZX_OK, "");
+    ASSERT_EQ(zx_task_kill(thread), ZX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread, 0), ZX_ERR_BAD_STATE, "");
+    ASSERT_EQ(zx_handle_close(thread), ZX_OK, "");
 
-    ASSERT_EQ(mx_thread_create(mx_process_self(), "thread", 5, 0, &thread), MX_OK, "");
-    ASSERT_EQ(mx_task_kill(thread), MX_OK, "");
-    ASSERT_EQ(mx_task_suspend(thread), MX_ERR_BAD_STATE, "");
-    ASSERT_EQ(mx_handle_close(thread), MX_OK, "");
+    ASSERT_EQ(zx_thread_create(zx_process_self(), "thread", 5, 0, &thread), ZX_OK, "");
+    ASSERT_EQ(zx_task_kill(thread), ZX_OK, "");
+    ASSERT_EQ(zx_task_suspend(thread), ZX_ERR_BAD_STATE, "");
+    ASSERT_EQ(zx_handle_close(thread), ZX_OK, "");
 
     END_TEST;
 }
 
 // Arguments for self_killing_fn().
 struct self_killing_thread_args {
-    mxr_thread_t thread; // Used for the thread to kill itself.
+    zxr_thread_t thread; // Used for the thread to kill itself.
     uint32_t test_value; // Used for testing what the thread does.
 };
 
 __NO_SAFESTACK static void self_killing_fn(void* arg) {
     struct self_killing_thread_args* args = arg;
     // Kill the current thread.
-    mx_task_kill(mxr_thread_get_handle(&args->thread));
+    zx_task_kill(zxr_thread_get_handle(&args->thread));
     // We should not reach here -- the syscall should not have returned.
     args->test_value = 999;
-    mx_thread_exit();
+    zx_thread_exit();
 }
 
-// This tests that the mx_task_kill() syscall does not return when a thread
+// This tests that the zx_task_kill() syscall does not return when a thread
 // uses it to kill itself.
 static bool test_thread_kills_itself(void) {
     BEGIN_TEST;
 
     struct self_killing_thread_args args;
     args.test_value = 111;
-    mx_handle_t thread_handle;
+    zx_handle_t thread_handle;
     ASSERT_TRUE(start_thread(self_killing_fn, &args, &args.thread, &thread_handle), "");
-    ASSERT_EQ(mx_object_wait_one(thread_handle, MX_THREAD_TERMINATED,
-                                 MX_TIME_INFINITE, NULL), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread_handle), MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_handle, ZX_THREAD_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_handle), ZX_OK, "");
     // Check that the thread did not continue execution and modify test_value.
     ASSERT_EQ(args.test_value, 111u, "");
     // We have to destroy the thread afterwards to clean up its internal
     // handle, since it did not properly exit.
-    mxr_thread_destroy(&args.thread);
+    zxr_thread_destroy(&args.thread);
 
     END_TEST;
 }
@@ -330,52 +330,52 @@
 static bool test_info_task_stats_fails(void) {
     BEGIN_TEST;
     // Spin up a thread.
-    mxr_thread_t thread;
-    mx_handle_t thandle;
-    ASSERT_TRUE(start_thread(threads_test_sleep_fn, (void*)mx_deadline_after(MX_MSEC(100)), &thread,
+    zxr_thread_t thread;
+    zx_handle_t thandle;
+    ASSERT_TRUE(start_thread(threads_test_sleep_fn, (void*)zx_deadline_after(ZX_MSEC(100)), &thread,
                              &thandle), "");
-    ASSERT_EQ(mx_object_wait_one(thandle,
-                                 MX_THREAD_TERMINATED, MX_TIME_INFINITE, NULL),
-              MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thandle,
+                                 ZX_THREAD_TERMINATED, ZX_TIME_INFINITE, NULL),
+              ZX_OK, "");
 
     // Ensure that task_stats doesn't work on it.
-    mx_info_task_stats_t info;
-    EXPECT_NE(mx_object_get_info(thandle, MX_INFO_TASK_STATS,
+    zx_info_task_stats_t info;
+    EXPECT_NE(zx_object_get_info(thandle, ZX_INFO_TASK_STATS,
                                  &info, sizeof(info), NULL, NULL),
-              MX_OK,
+              ZX_OK,
               "Just added thread support to info_task_status?");
     // If so, replace this with a real test; see example in process.cpp.
 
-    ASSERT_EQ(mx_handle_close(thandle), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(thandle), ZX_OK, "");
     END_TEST;
 }
 
 static bool test_resume_suspended(void) {
     BEGIN_TEST;
 
-    mx_handle_t event;
-    mxr_thread_t thread;
-    mx_handle_t thread_h;
+    zx_handle_t event;
+    zxr_thread_t thread;
+    zx_handle_t thread_h;
 
-    ASSERT_EQ(mx_event_create(0, &event), MX_OK, "");
+    ASSERT_EQ(zx_event_create(0, &event), ZX_OK, "");
     ASSERT_TRUE(start_thread(threads_test_wait_fn, &event, &thread, &thread_h), "");
-    ASSERT_EQ(mx_task_suspend(thread_h), MX_OK, "");
-    ASSERT_EQ(mx_task_resume(thread_h, 0), MX_OK, "");
+    ASSERT_EQ(zx_task_suspend(thread_h), ZX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread_h, 0), ZX_OK, "");
 
     // The thread should still be blocked on the event when it wakes up
-    ASSERT_EQ(mx_object_wait_one(thread_h, MX_THREAD_TERMINATED, mx_deadline_after(MX_MSEC(100)),
-                                 NULL), MX_ERR_TIMED_OUT, "");
+    ASSERT_EQ(zx_object_wait_one(thread_h, ZX_THREAD_TERMINATED, zx_deadline_after(ZX_MSEC(100)),
+                                 NULL), ZX_ERR_TIMED_OUT, "");
 
     // Verify thread is blocked
-    mx_info_thread_t info;
-    ASSERT_EQ(mx_object_get_info(thread_h, MX_INFO_THREAD,
+    zx_info_thread_t info;
+    ASSERT_EQ(zx_object_get_info(thread_h, ZX_INFO_THREAD,
                                  &info, sizeof(info), NULL, NULL),
-              MX_OK, "");
-    ASSERT_EQ(info.wait_exception_port_type, MX_EXCEPTION_PORT_TYPE_NONE, "");
-    ASSERT_EQ(info.state, MX_THREAD_STATE_BLOCKED, "");
+              ZX_OK, "");
+    ASSERT_EQ(info.wait_exception_port_type, ZX_EXCEPTION_PORT_TYPE_NONE, "");
+    ASSERT_EQ(info.state, ZX_THREAD_STATE_BLOCKED, "");
 
-    // Attach to debugger port so we can see MX_EXCP_THREAD_SUSPENDED
-    mx_handle_t eport;
+    // Attach to debugger port so we can see ZX_EXCP_THREAD_SUSPENDED
+    zx_handle_t eport;
     ASSERT_TRUE(set_debugger_exception_port(&eport),"");
 
     // Check that signaling the event while suspended results in the expected
@@ -383,25 +383,25 @@
     ASSERT_TRUE(suspend_thread_synchronous(thread_h, eport), "");
 
     // Verify thread is suspended
-    ASSERT_EQ(mx_object_get_info(thread_h, MX_INFO_THREAD,
+    ASSERT_EQ(zx_object_get_info(thread_h, ZX_INFO_THREAD,
                                  &info, sizeof(info), NULL, NULL),
-              MX_OK, "");
-    ASSERT_EQ(info.state, MX_THREAD_STATE_SUSPENDED, "");
-    ASSERT_EQ(info.wait_exception_port_type, MX_EXCEPTION_PORT_TYPE_NONE, "");
+              ZX_OK, "");
+    ASSERT_EQ(info.state, ZX_THREAD_STATE_SUSPENDED, "");
+    ASSERT_EQ(info.wait_exception_port_type, ZX_EXCEPTION_PORT_TYPE_NONE, "");
 
     // Since the thread is suspended the signaling should not take effect.
-    ASSERT_EQ(mx_object_signal(event, 0, MX_USER_SIGNAL_0), MX_OK, "");
-    ASSERT_EQ(mx_object_wait_one(event, MX_USER_SIGNAL_1, mx_deadline_after(MX_MSEC(100)), NULL), MX_ERR_TIMED_OUT, "");
+    ASSERT_EQ(zx_object_signal(event, 0, ZX_USER_SIGNAL_0), ZX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(event, ZX_USER_SIGNAL_1, zx_deadline_after(ZX_MSEC(100)), NULL), ZX_ERR_TIMED_OUT, "");
 
-    ASSERT_EQ(mx_task_resume(thread_h, 0), MX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread_h, 0), ZX_OK, "");
 
-    ASSERT_EQ(mx_object_wait_one(event, MX_USER_SIGNAL_1, MX_TIME_INFINITE, NULL), MX_OK, "");
-    ASSERT_EQ(mx_object_wait_one(
-        thread_h, MX_THREAD_TERMINATED, MX_TIME_INFINITE, NULL), MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(event, ZX_USER_SIGNAL_1, ZX_TIME_INFINITE, NULL), ZX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(
+        thread_h, ZX_THREAD_TERMINATED, ZX_TIME_INFINITE, NULL), ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(eport), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(event), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread_h), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(eport), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(event), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_h), ZX_OK, "");
 
     END_TEST;
 }
@@ -409,90 +409,90 @@
 static bool test_suspend_sleeping(void) {
     BEGIN_TEST;
 
-    const mx_time_t sleep_deadline = mx_deadline_after(MX_MSEC(100));
-    mxr_thread_t thread;
+    const zx_time_t sleep_deadline = zx_deadline_after(ZX_MSEC(100));
+    zxr_thread_t thread;
 
     // TODO(teisenbe): This code could be made less racy with a deadline sleep
     // mode when we get one.
-    mx_handle_t thread_h;
+    zx_handle_t thread_h;
     ASSERT_TRUE(start_thread(threads_test_sleep_fn, (void*)sleep_deadline, &thread, &thread_h), "");
 
-    mx_nanosleep(sleep_deadline - MX_MSEC(50));
+    zx_nanosleep(sleep_deadline - ZX_MSEC(50));
 
     // Suspend the thread.  Use the debugger port to wait for the suspension.
-    mx_handle_t eport;
+    zx_handle_t eport;
     ASSERT_TRUE(set_debugger_exception_port(&eport), "");
     ASSERT_TRUE(suspend_thread_synchronous(thread_h, eport), "");
-    ASSERT_EQ(mx_handle_close(eport), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(eport), ZX_OK, "");
 
-    ASSERT_EQ(mx_task_resume(thread_h, 0), MX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread_h, 0), ZX_OK, "");
 
     // Wait for the sleep to finish
-    ASSERT_EQ(mx_object_wait_one(thread_h, MX_THREAD_TERMINATED, sleep_deadline + MX_MSEC(50), NULL),
-              MX_OK, "");
-    const mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+    ASSERT_EQ(zx_object_wait_one(thread_h, ZX_THREAD_TERMINATED, sleep_deadline + ZX_MSEC(50), NULL),
+              ZX_OK, "");
+    const zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
     ASSERT_GE(now, sleep_deadline, "thread did not sleep long enough");
 
-    ASSERT_EQ(mx_handle_close(thread_h), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_h), ZX_OK, "");
     END_TEST;
 }
 
 static bool test_suspend_channel_call(void) {
     BEGIN_TEST;
 
-    mxr_thread_t thread;
+    zxr_thread_t thread;
 
-    mx_handle_t channel;
+    zx_handle_t channel;
     struct channel_call_suspend_test_arg thread_arg;
-    ASSERT_EQ(mx_channel_create(0, &thread_arg.channel, &channel), MX_OK, "");
-    thread_arg.call_status = MX_ERR_BAD_STATE;
+    ASSERT_EQ(zx_channel_create(0, &thread_arg.channel, &channel), ZX_OK, "");
+    thread_arg.call_status = ZX_ERR_BAD_STATE;
 
-    mx_handle_t thread_h;
+    zx_handle_t thread_h;
     ASSERT_TRUE(start_thread(threads_test_channel_call_fn, &thread_arg, &thread, &thread_h), "");
 
     // Wait for the thread to send a channel call before suspending it
-    ASSERT_EQ(mx_object_wait_one(channel, MX_CHANNEL_READABLE, MX_TIME_INFINITE, NULL),
-              MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(channel, ZX_CHANNEL_READABLE, ZX_TIME_INFINITE, NULL),
+              ZX_OK, "");
 
     // Suspend the thread.  Use the debugger port to wait for the suspension.
-    mx_handle_t eport;
+    zx_handle_t eport;
     ASSERT_TRUE(set_debugger_exception_port(&eport), "");
     ASSERT_TRUE(suspend_thread_synchronous(thread_h, eport), "");
-    ASSERT_EQ(mx_handle_close(eport), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(eport), ZX_OK, "");
 
     // Read the message
     uint8_t buf[9];
     uint32_t actual_bytes;
-    ASSERT_EQ(mx_channel_read(channel, 0, buf, NULL, sizeof(buf), 0, &actual_bytes, NULL),
-              MX_OK, "");
+    ASSERT_EQ(zx_channel_read(channel, 0, buf, NULL, sizeof(buf), 0, &actual_bytes, NULL),
+              ZX_OK, "");
     ASSERT_EQ(actual_bytes, sizeof(buf), "");
     ASSERT_EQ(memcmp(buf, "abcdefghi", sizeof(buf)), 0, "");
 
     // Write a reply
     buf[8] = 'j';
-    ASSERT_EQ(mx_channel_write(channel, 0, buf, sizeof(buf), NULL, 0), MX_OK, "");
+    ASSERT_EQ(zx_channel_write(channel, 0, buf, sizeof(buf), NULL, 0), ZX_OK, "");
 
     // Make sure the remote channel didn't get signaled
-    EXPECT_EQ(mx_object_wait_one(thread_arg.channel, MX_CHANNEL_READABLE, 0, NULL),
-              MX_ERR_TIMED_OUT, "");
+    EXPECT_EQ(zx_object_wait_one(thread_arg.channel, ZX_CHANNEL_READABLE, 0, NULL),
+              ZX_ERR_TIMED_OUT, "");
 
     // Make sure we can't read from the remote channel (the message should have
     // been reserved for the other thread, even though it is suspended).
-    EXPECT_EQ(mx_channel_read(thread_arg.channel, 0, buf, NULL, sizeof(buf), 0,
+    EXPECT_EQ(zx_channel_read(thread_arg.channel, 0, buf, NULL, sizeof(buf), 0,
                               &actual_bytes, NULL),
-              MX_ERR_SHOULD_WAIT, "");
+              ZX_ERR_SHOULD_WAIT, "");
 
     // Wake the suspended thread
-    ASSERT_EQ(mx_task_resume(thread_h, 0), MX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread_h, 0), ZX_OK, "");
 
     // Wait for the thread to finish
-    ASSERT_EQ(mx_object_wait_one(thread_h, MX_THREAD_TERMINATED, MX_TIME_INFINITE, NULL),
-              MX_OK, "");
-    EXPECT_EQ(thread_arg.call_status, MX_OK, "");
-    EXPECT_EQ(thread_arg.read_status, MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_h, ZX_THREAD_TERMINATED, ZX_TIME_INFINITE, NULL),
+              ZX_OK, "");
+    EXPECT_EQ(thread_arg.call_status, ZX_OK, "");
+    EXPECT_EQ(thread_arg.read_status, ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(channel), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread_h), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(channel), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_h), ZX_OK, "");
 
     END_TEST;
 }
@@ -500,40 +500,40 @@
 static bool test_suspend_port_call(void) {
     BEGIN_TEST;
 
-    mxr_thread_t thread;
-    mx_handle_t port[2];
-    ASSERT_EQ(mx_port_create(0, &port[0]), MX_OK, "");
-    ASSERT_EQ(mx_port_create(0, &port[1]), MX_OK, "");
+    zxr_thread_t thread;
+    zx_handle_t port[2];
+    ASSERT_EQ(zx_port_create(0, &port[0]), ZX_OK, "");
+    ASSERT_EQ(zx_port_create(0, &port[1]), ZX_OK, "");
 
-    mx_handle_t thread_h;
+    zx_handle_t thread_h;
     ASSERT_TRUE(start_thread(threads_test_port_fn, port, &thread, &thread_h), "");
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
-    ASSERT_EQ(mx_task_suspend(thread_h), MX_OK, "");
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
+    ASSERT_EQ(zx_task_suspend(thread_h), ZX_OK, "");
 
-    mx_port_packet_t packet1 = { 100ull, MX_PKT_TYPE_USER, 0u, {} };
-    mx_port_packet_t packet2 = { 300ull, MX_PKT_TYPE_USER, 0u, {} };
+    zx_port_packet_t packet1 = { 100ull, ZX_PKT_TYPE_USER, 0u, {} };
+    zx_port_packet_t packet2 = { 300ull, ZX_PKT_TYPE_USER, 0u, {} };
 
-    ASSERT_EQ(mx_port_queue(port[0], &packet1, 0u), MX_OK, "");
-    ASSERT_EQ(mx_port_queue(port[0], &packet2, 0u), MX_OK, "");
+    ASSERT_EQ(zx_port_queue(port[0], &packet1, 0u), ZX_OK, "");
+    ASSERT_EQ(zx_port_queue(port[0], &packet2, 0u), ZX_OK, "");
 
-    mx_port_packet_t packet;
-    ASSERT_EQ(mx_port_wait(port[1], mx_deadline_after(MX_MSEC(100)), &packet, 0u), MX_ERR_TIMED_OUT, "");
+    zx_port_packet_t packet;
+    ASSERT_EQ(zx_port_wait(port[1], zx_deadline_after(ZX_MSEC(100)), &packet, 0u), ZX_ERR_TIMED_OUT, "");
 
-    ASSERT_EQ(mx_task_resume(thread_h, 0), MX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread_h, 0), ZX_OK, "");
 
-    ASSERT_EQ(mx_port_wait(port[1], MX_TIME_INFINITE, &packet, 0u), MX_OK, "");
+    ASSERT_EQ(zx_port_wait(port[1], ZX_TIME_INFINITE, &packet, 0u), ZX_OK, "");
     EXPECT_EQ(packet.key, 105ull, "");
 
-    ASSERT_EQ(mx_port_wait(port[0], MX_TIME_INFINITE, &packet, 0u), MX_OK, "");
+    ASSERT_EQ(zx_port_wait(port[0], ZX_TIME_INFINITE, &packet, 0u), ZX_OK, "");
     EXPECT_EQ(packet.key, 300ull, "");
 
-    ASSERT_EQ(mx_object_wait_one(
-        thread_h, MX_THREAD_TERMINATED, MX_TIME_INFINITE, NULL), MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(
+        thread_h, ZX_THREAD_TERMINATED, ZX_TIME_INFINITE, NULL), ZX_OK, "");
 
-    ASSERT_EQ(mx_handle_close(thread_h), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(port[0]), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(port[1]), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_h), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(port[0]), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(port[1]), ZX_OK, "");
 
     END_TEST;
 }
@@ -553,34 +553,34 @@
 static bool test_suspend_stops_thread(void) {
     BEGIN_TEST;
 
-    mxr_thread_t thread;
+    zxr_thread_t thread;
 
     struct test_writing_thread_arg arg = { .v = 0 };
-    mx_handle_t thread_h;
+    zx_handle_t thread_h;
     ASSERT_TRUE(start_thread(test_writing_thread_fn, &arg, &thread, &thread_h), "");
 
     while (arg.v != 1) {
-        mx_nanosleep(0);
+        zx_nanosleep(0);
     }
-    ASSERT_EQ(mx_task_suspend(thread_h), MX_OK, "");
+    ASSERT_EQ(zx_task_suspend(thread_h), ZX_OK, "");
     while (arg.v != 2) {
         arg.v = 2;
         // Give the thread a chance to clobber the value
-        mx_nanosleep(mx_deadline_after(MX_MSEC(50)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(50)));
     }
-    ASSERT_EQ(mx_task_resume(thread_h, 0), MX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread_h, 0), ZX_OK, "");
     while (arg.v != 1) {
-        mx_nanosleep(0);
+        zx_nanosleep(0);
     }
 
     // Clean up.
-    ASSERT_EQ(mx_task_kill(thread_h), MX_OK, "");
+    ASSERT_EQ(zx_task_kill(thread_h), ZX_OK, "");
     // Wait for the thread termination to complete.  We should do this so
     // that any later tests which use set_debugger_exception_port() do not
-    // receive an MX_EXCP_THREAD_EXITING event.
-    ASSERT_EQ(mx_object_wait_one(thread_h, MX_THREAD_TERMINATED,
-                                 MX_TIME_INFINITE, NULL), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread_h), MX_OK, "");
+    // receive an ZX_EXCP_THREAD_EXITING event.
+    ASSERT_EQ(zx_object_wait_one(thread_h, ZX_THREAD_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_h), ZX_OK, "");
 
     END_TEST;
 }
@@ -590,129 +590,129 @@
 static bool test_kill_suspended_thread(void) {
     BEGIN_TEST;
 
-    mxr_thread_t thread;
+    zxr_thread_t thread;
     struct test_writing_thread_arg arg = { .v = 0 };
-    mx_handle_t thread_h;
+    zx_handle_t thread_h;
     ASSERT_TRUE(start_thread(test_writing_thread_fn, &arg, &thread, &thread_h), "");
 
     // Wait until the thread has started and has modified arg.v.
     while (arg.v != 1) {
-        mx_nanosleep(0);
+        zx_nanosleep(0);
     }
 
-    // Attach to debugger port so we can see MX_EXCP_THREAD_SUSPENDED.
-    mx_handle_t eport;
+    // Attach to debugger port so we can see ZX_EXCP_THREAD_SUSPENDED.
+    zx_handle_t eport;
     ASSERT_TRUE(set_debugger_exception_port(&eport),"");
 
     ASSERT_TRUE(suspend_thread_synchronous(thread_h, eport), "");
 
     // Reset the test memory location.
     arg.v = 100;
-    ASSERT_EQ(mx_task_kill(thread_h), MX_OK, "");
+    ASSERT_EQ(zx_task_kill(thread_h), ZX_OK, "");
     // Wait for the thread termination to complete.
-    ASSERT_EQ(mx_object_wait_one(thread_h, MX_THREAD_TERMINATED,
-                                 MX_TIME_INFINITE, NULL), MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_h, ZX_THREAD_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL), ZX_OK, "");
     // Check for the bug.  The thread should not have resumed execution and
     // so should not have modified arg.v.
     EXPECT_EQ(arg.v, 100, "");
 
     // Check that the thread is reported as exiting and not as resumed.
-    mx_port_packet_t packet;
-    ASSERT_EQ(mx_port_wait(eport, MX_TIME_INFINITE, &packet, 0), MX_OK, "");
+    zx_port_packet_t packet;
+    ASSERT_EQ(zx_port_wait(eport, ZX_TIME_INFINITE, &packet, 0), ZX_OK, "");
     ASSERT_EQ(packet.key, kExceptionPortKey, "");
-    ASSERT_EQ(packet.type, (uint32_t)MX_EXCP_THREAD_EXITING, "");
+    ASSERT_EQ(packet.type, (uint32_t)ZX_EXCP_THREAD_EXITING, "");
 
     // Clean up.
-    ASSERT_EQ(mx_handle_close(eport), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread_h), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(eport), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_h), ZX_OK, "");
 
     END_TEST;
 }
 
-// This tests the registers reported by mx_thread_read_state() for a
+// This tests the registers reported by zx_thread_read_state() for a
 // suspended thread.  It starts a thread which sets all the registers to
 // known test values.
 static bool test_reading_register_state(void) {
     BEGIN_TEST;
 
-    mx_general_regs_t regs_expected;
+    zx_general_regs_t regs_expected;
     regs_fill_test_values(&regs_expected);
     regs_expected.REG_PC = (uintptr_t)spin_with_regs_spin_address;
 
-    mxr_thread_t thread;
-    mx_handle_t thread_handle;
+    zxr_thread_t thread;
+    zx_handle_t thread_handle;
     ASSERT_TRUE(start_thread((void (*)(void*))spin_with_regs, &regs_expected,
                              &thread, &thread_handle), "");
 
     // Allow some time for the thread to begin execution and reach the
     // instruction that spins.
-    ASSERT_EQ(mx_nanosleep(mx_deadline_after(MX_MSEC(10))), MX_OK, "");
+    ASSERT_EQ(zx_nanosleep(zx_deadline_after(ZX_MSEC(10))), ZX_OK, "");
 
-    // Attach to debugger port so we can see MX_EXCP_THREAD_SUSPENDED.
-    mx_handle_t eport;
+    // Attach to debugger port so we can see ZX_EXCP_THREAD_SUSPENDED.
+    zx_handle_t eport;
     ASSERT_TRUE(set_debugger_exception_port(&eport),"");
 
     ASSERT_TRUE(suspend_thread_synchronous(thread_handle, eport), "");
 
-    mx_general_regs_t regs;
+    zx_general_regs_t regs;
     uint32_t size_read;
-    ASSERT_EQ(mx_thread_read_state(thread_handle, MX_THREAD_STATE_REGSET0,
-                                   &regs, sizeof(regs), &size_read), MX_OK, "");
+    ASSERT_EQ(zx_thread_read_state(thread_handle, ZX_THREAD_STATE_REGSET0,
+                                   &regs, sizeof(regs), &size_read), ZX_OK, "");
     ASSERT_EQ(size_read, sizeof(regs), "");
     ASSERT_TRUE(regs_expect_eq(&regs, &regs_expected), "");
 
     // Clean up.
-    ASSERT_EQ(mx_handle_close(eport), MX_OK, "");
-    ASSERT_EQ(mx_task_kill(thread_handle), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(eport), ZX_OK, "");
+    ASSERT_EQ(zx_task_kill(thread_handle), ZX_OK, "");
     // Wait for the thread termination to complete.
-    ASSERT_EQ(mx_object_wait_one(thread_handle, MX_THREAD_TERMINATED,
-                                 MX_TIME_INFINITE, NULL), MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_handle, ZX_THREAD_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL), ZX_OK, "");
 
     END_TEST;
 }
 
-// This tests writing registers using mx_thread_write_state().  After
+// This tests writing registers using zx_thread_write_state().  After
 // setting registers using that syscall, it reads back the registers and
 // checks their values.
 static bool test_writing_register_state(void) {
     BEGIN_TEST;
 
-    mxr_thread_t thread;
-    mx_handle_t thread_handle;
+    zxr_thread_t thread;
+    zx_handle_t thread_handle;
     ASSERT_TRUE(start_thread(threads_test_busy_fn, NULL, &thread,
                              &thread_handle), "");
 
     // Allow some time for the thread to begin execution and reach the
     // instruction that spins.
-    ASSERT_EQ(mx_nanosleep(mx_deadline_after(MX_MSEC(10))), MX_OK, "");
+    ASSERT_EQ(zx_nanosleep(zx_deadline_after(ZX_MSEC(10))), ZX_OK, "");
 
-    // Attach to debugger port so we can see MX_EXCP_THREAD_SUSPENDED.
-    mx_handle_t eport;
+    // Attach to debugger port so we can see ZX_EXCP_THREAD_SUSPENDED.
+    zx_handle_t eport;
     ASSERT_TRUE(set_debugger_exception_port(&eport),"");
 
     ASSERT_TRUE(suspend_thread_synchronous(thread_handle, eport), "");
 
     struct {
-        // A small stack that is used for calling mx_thread_exit().
+        // A small stack that is used for calling zx_thread_exit().
         char stack[1024];
-        mx_general_regs_t regs_got;
+        zx_general_regs_t regs_got;
     } stack;
 
-    mx_general_regs_t regs_to_set;
+    zx_general_regs_t regs_to_set;
     regs_fill_test_values(&regs_to_set);
     regs_to_set.REG_PC = (uintptr_t)save_regs_and_exit_thread;
     regs_to_set.REG_STACK_PTR = (uintptr_t)&stack.regs_got;
-    ASSERT_EQ(mx_thread_write_state(
-                  thread_handle, MX_THREAD_STATE_REGSET0,
-                  &regs_to_set, sizeof(regs_to_set)), MX_OK, "");
-    ASSERT_EQ(mx_task_resume(thread_handle, 0), MX_OK, "");
-    ASSERT_EQ(mx_object_wait_one(thread_handle, MX_THREAD_TERMINATED,
-                                 MX_TIME_INFINITE, NULL), MX_OK, "");
+    ASSERT_EQ(zx_thread_write_state(
+                  thread_handle, ZX_THREAD_STATE_REGSET0,
+                  &regs_to_set, sizeof(regs_to_set)), ZX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread_handle, 0), ZX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_handle, ZX_THREAD_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL), ZX_OK, "");
     EXPECT_TRUE(regs_expect_eq(&regs_to_set, &stack.regs_got), "");
 
     // Clean up.
-    ASSERT_EQ(mx_handle_close(eport), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread_handle), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(eport), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_handle), ZX_OK, "");
 
     END_TEST;
 }
@@ -732,7 +732,7 @@
 
 #endif
 
-// Test that mx_thread_write_state() does not allow setting RIP to a
+// Test that zx_thread_write_state() does not allow setting RIP to a
 // non-canonical address for a thread that was suspended inside a syscall,
 // because if the kernel returns to that address using SYSRET, that can
 // cause a fault in kernel mode that is exploitable.  See
@@ -741,26 +741,26 @@
     BEGIN_TEST;
 
 #if defined(__x86_64__)
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0, &event), MX_OK, "");
-    mxr_thread_t thread;
-    mx_handle_t thread_handle;
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0, &event), ZX_OK, "");
+    zxr_thread_t thread;
+    zx_handle_t thread_handle;
     ASSERT_TRUE(start_thread(threads_test_wait_fn, &event, &thread, &thread_handle), "");
 
     // Allow some time for the thread to begin execution and block inside
     // the syscall.
-    ASSERT_EQ(mx_nanosleep(mx_deadline_after(MX_MSEC(10))), MX_OK, "");
+    ASSERT_EQ(zx_nanosleep(zx_deadline_after(ZX_MSEC(10))), ZX_OK, "");
 
-    // Attach to debugger port so we can see MX_EXCP_THREAD_SUSPENDED.
-    mx_handle_t eport;
+    // Attach to debugger port so we can see ZX_EXCP_THREAD_SUSPENDED.
+    zx_handle_t eport;
     ASSERT_TRUE(set_debugger_exception_port(&eport),"");
 
     ASSERT_TRUE(suspend_thread_synchronous(thread_handle, eport), "");
 
-    struct mx_x86_64_general_regs regs;
+    struct zx_x86_64_general_regs regs;
     uint32_t size_read;
-    ASSERT_EQ(mx_thread_read_state(thread_handle, MX_THREAD_STATE_REGSET0,
-                                   &regs, sizeof(regs), &size_read), MX_OK, "");
+    ASSERT_EQ(zx_thread_read_state(thread_handle, ZX_THREAD_STATE_REGSET0,
+                                   &regs, sizeof(regs), &size_read), ZX_OK, "");
     ASSERT_EQ(size_read, sizeof(regs), "");
 
     // Example addresses to test.
@@ -769,48 +769,48 @@
     uintptr_t canonical_addr = noncanonical_addr - 1;
     uint64_t kKernelAddr = 0xffff800000000000;
 
-    struct mx_x86_64_general_regs regs_modified = regs;
+    struct zx_x86_64_general_regs regs_modified = regs;
 
     // This RIP address must be disallowed.
     regs_modified.rip = noncanonical_addr;
-    ASSERT_EQ(mx_thread_write_state(thread_handle, MX_THREAD_STATE_REGSET0,
+    ASSERT_EQ(zx_thread_write_state(thread_handle, ZX_THREAD_STATE_REGSET0,
                                     &regs_modified, sizeof(regs_modified)),
-              MX_ERR_INVALID_ARGS, "");
+              ZX_ERR_INVALID_ARGS, "");
 
     regs_modified.rip = canonical_addr;
-    ASSERT_EQ(mx_thread_write_state(thread_handle, MX_THREAD_STATE_REGSET0,
+    ASSERT_EQ(zx_thread_write_state(thread_handle, ZX_THREAD_STATE_REGSET0,
                                     &regs_modified, sizeof(regs_modified)),
-              MX_OK, "");
+              ZX_OK, "");
 
     // This RIP address does not need to be disallowed, but it is currently
     // disallowed because this simplifies the check and it's not useful to
     // allow this address.
     regs_modified.rip = kKernelAddr;
-    ASSERT_EQ(mx_thread_write_state(thread_handle, MX_THREAD_STATE_REGSET0,
+    ASSERT_EQ(zx_thread_write_state(thread_handle, ZX_THREAD_STATE_REGSET0,
                                     &regs_modified, sizeof(regs_modified)),
-              MX_ERR_INVALID_ARGS, "");
+              ZX_ERR_INVALID_ARGS, "");
 
     // Clean up: Restore the original register state.
-    ASSERT_EQ(mx_thread_write_state(thread_handle, MX_THREAD_STATE_REGSET0,
-                                    &regs, sizeof(regs)), MX_OK, "");
+    ASSERT_EQ(zx_thread_write_state(thread_handle, ZX_THREAD_STATE_REGSET0,
+                                    &regs, sizeof(regs)), ZX_OK, "");
     // Allow the child thread to resume and exit.
-    ASSERT_EQ(mx_task_resume(thread_handle, 0), MX_OK, "");
-    ASSERT_EQ(mx_object_signal(event, 0, MX_USER_SIGNAL_0), MX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread_handle, 0), ZX_OK, "");
+    ASSERT_EQ(zx_object_signal(event, 0, ZX_USER_SIGNAL_0), ZX_OK, "");
     // Wait for the child thread to signal that it has continued.
-    ASSERT_EQ(mx_object_wait_one(event, MX_USER_SIGNAL_1, MX_TIME_INFINITE,
-                                 NULL), MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(event, ZX_USER_SIGNAL_1, ZX_TIME_INFINITE,
+                                 NULL), ZX_OK, "");
     // Wait for the child thread to exit.
-    ASSERT_EQ(mx_object_wait_one(thread_handle, MX_THREAD_TERMINATED, MX_TIME_INFINITE,
-                                 NULL), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(eport), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(event), MX_OK, "");
-    ASSERT_EQ(mx_handle_close(thread_handle), MX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_handle, ZX_THREAD_TERMINATED, ZX_TIME_INFINITE,
+                                 NULL), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(eport), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(event), ZX_OK, "");
+    ASSERT_EQ(zx_handle_close(thread_handle), ZX_OK, "");
 #endif
 
     END_TEST;
 }
 
-// Test that, on ARM64, userland cannot use mx_thread_write_state() to
+// Test that, on ARM64, userland cannot use zx_thread_write_state() to
 // modify flag bits such as I and F (bits 7 and 6), which are the IRQ and
 // FIQ interrupt disable flags.  We don't want userland to be able to set
 // those flags to 1, since that would disable interrupts.  Also, userland
@@ -820,26 +820,26 @@
 
 #if defined(__aarch64__)
     struct test_writing_thread_arg arg = { .v = 0 };
-    mxr_thread_t thread;
-    mx_handle_t thread_handle;
+    zxr_thread_t thread;
+    zx_handle_t thread_handle;
     ASSERT_TRUE(start_thread(test_writing_thread_fn, &arg, &thread,
                              &thread_handle), "");
     // Wait for the thread to start executing and enter its main loop.
     while (arg.v != 1) {
-        ASSERT_EQ(mx_nanosleep(mx_deadline_after(MX_USEC(1))), MX_OK, "");
+        ASSERT_EQ(zx_nanosleep(zx_deadline_after(ZX_USEC(1))), ZX_OK, "");
     }
-    // Attach to debugger port so we can see MX_EXCP_THREAD_SUSPENDED.
-    mx_handle_t eport;
+    // Attach to debugger port so we can see ZX_EXCP_THREAD_SUSPENDED.
+    zx_handle_t eport;
     ASSERT_TRUE(set_debugger_exception_port(&eport), "");
     ASSERT_TRUE(suspend_thread_synchronous(thread_handle, eport), "");
 
-    mx_general_regs_t regs;
+    zx_general_regs_t regs;
     uint32_t size_read;
-    ASSERT_EQ(mx_thread_read_state(thread_handle, MX_THREAD_STATE_REGSET0,
-                                   &regs, sizeof(regs), &size_read), MX_OK, "");
+    ASSERT_EQ(zx_thread_read_state(thread_handle, ZX_THREAD_STATE_REGSET0,
+                                   &regs, sizeof(regs), &size_read), ZX_OK, "");
     ASSERT_EQ(size_read, sizeof(regs), "");
 
-    // Check that mx_thread_read_state() does not report any more flag bits
+    // Check that zx_thread_read_state() does not report any more flag bits
     // than are readable via userland instructions.
     const uint64_t kUserVisibleFlags = 0xf0000000;
     EXPECT_EQ(regs.cpsr & ~kUserVisibleFlags, 0u, "");
@@ -847,32 +847,32 @@
     // Try setting more flag bits.
     uint64_t original_cpsr = regs.cpsr;
     regs.cpsr |= ~kUserVisibleFlags;
-    ASSERT_EQ(mx_thread_write_state(thread_handle, MX_THREAD_STATE_REGSET0,
-                                    &regs, sizeof(regs)), MX_OK, "");
+    ASSERT_EQ(zx_thread_write_state(thread_handle, ZX_THREAD_STATE_REGSET0,
+                                    &regs, sizeof(regs)), ZX_OK, "");
 
     // Firstly, if we read back the register flag, the extra flag bits
     // should have been ignored and should not be reported as set.
-    ASSERT_EQ(mx_thread_read_state(thread_handle, MX_THREAD_STATE_REGSET0,
-                                   &regs, sizeof(regs), &size_read), MX_OK, "");
+    ASSERT_EQ(zx_thread_read_state(thread_handle, ZX_THREAD_STATE_REGSET0,
+                                   &regs, sizeof(regs), &size_read), ZX_OK, "");
     ASSERT_EQ(size_read, sizeof(regs), "");
     EXPECT_EQ(regs.cpsr, original_cpsr, "");
 
     // Secondly, if we resume the thread, we should be able to kill it.  If
-    // mx_thread_write_state() set the interrupt disable flags, then if the
+    // zx_thread_write_state() set the interrupt disable flags, then if the
     // thread gets scheduled, it will never get interrupted and we will not
     // be able to kill and join the thread.
     arg.v = 0;
-    ASSERT_EQ(mx_task_resume(thread_handle, 0), MX_OK, "");
+    ASSERT_EQ(zx_task_resume(thread_handle, 0), ZX_OK, "");
     // Wait until the thread has actually resumed execution.
     while (arg.v != 1) {
-        ASSERT_EQ(mx_nanosleep(mx_deadline_after(MX_USEC(1))), MX_OK, "");
+        ASSERT_EQ(zx_nanosleep(zx_deadline_after(ZX_USEC(1))), ZX_OK, "");
     }
-    ASSERT_EQ(mx_task_kill(thread_handle), MX_OK, "");
-    ASSERT_EQ(mx_object_wait_one(thread_handle, MX_THREAD_TERMINATED,
-                                 MX_TIME_INFINITE, NULL), MX_OK, "");
+    ASSERT_EQ(zx_task_kill(thread_handle), ZX_OK, "");
+    ASSERT_EQ(zx_object_wait_one(thread_handle, ZX_THREAD_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL), ZX_OK, "");
 
     // Clean up.
-    ASSERT_EQ(mx_handle_close(eport), MX_OK, "");
+    ASSERT_EQ(zx_handle_close(eport), ZX_OK, "");
 #endif
 
     END_TEST;
diff --git a/system/utest/core/time/rules.mk b/system/utest/core/time/rules.mk
index 33c7416..60c3622 100644
--- a/system/utest/core/time/rules.mk
+++ b/system/utest/core/time/rules.mk
@@ -16,7 +16,7 @@
 MODULE_NAME := time-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 MODULE_STATIC_LIBS := system/ulib/runtime
 
 include make/module.mk
diff --git a/system/utest/core/time/ticks.c b/system/utest/core/time/ticks.c
index c613560..15ad34f 100644
--- a/system/utest/core/time/ticks.c
+++ b/system/utest/core/time/ticks.c
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 #include <inttypes.h>
 
@@ -11,12 +11,12 @@
 static bool elapsed_time_using_ticks(void) {
     BEGIN_TEST;
 
-    uint64_t per_second = mx_ticks_per_second();
+    uint64_t per_second = zx_ticks_per_second();
     ASSERT_GT(per_second, 0u, "Invalid ticks per second");
     unittest_printf("Ticks per second: %" PRIu64 "\n", per_second);
 
-    uint64_t x = mx_ticks_get();
-    uint64_t y = mx_ticks_get();
+    uint64_t x = zx_ticks_get();
+    uint64_t y = zx_ticks_get();
     ASSERT_GE(y, x, "Ticks went backwards");
 
     double seconds = (y - x) / (double)per_second;
diff --git a/system/utest/core/vmar/rules.mk b/system/utest/core/vmar/rules.mk
index e90f0bf..d209a62 100644
--- a/system/utest/core/vmar/rules.mk
+++ b/system/utest/core/vmar/rules.mk
@@ -17,8 +17,8 @@
 
 MODULE_LIBS := \
 	system/ulib/c \
-	system/ulib/magenta \
-	system/ulib/mxio \
+	system/ulib/zircon \
+	system/ulib/fdio \
     system/ulib/unittest \
 
 MODULE_STATIC_LIBS := \
diff --git a/system/utest/core/vmar/vmar.cpp b/system/utest/core/vmar/vmar.cpp
index 5df529f..3058696 100644
--- a/system/utest/core/vmar/vmar.cpp
+++ b/system/utest/core/vmar/vmar.cpp
@@ -8,11 +8,11 @@
 #include <stdalign.h>
 #include <unistd.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/syscalls/port.h>
 #include <fbl/atomic.h>
 #include <fbl/algorithm.h>
 #include <fbl/limits.h>
@@ -29,21 +29,21 @@
 const char kProcessName[] = "test-proc-vmar";
 
 const uint32_t kRwxMapPerm =
-        MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE;
+        ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE;
 const uint32_t kRwxAllocPerm =
-        MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE | MX_VM_FLAG_CAN_MAP_EXECUTE;
+        ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE | ZX_VM_FLAG_CAN_MAP_EXECUTE;
 
 
 // Helper routine for other tests.  If bit i (< *page_count*) in *bitmap* is set, then
 // checks that *base* + i * PAGE_SIZE is mapped.  Otherwise checks that it is not mapped.
-bool check_pages_mapped(mx_handle_t process, uintptr_t base, uint64_t bitmap, size_t page_count) {
+bool check_pages_mapped(zx_handle_t process, uintptr_t base, uint64_t bitmap, size_t page_count) {
     uint8_t buf[1];
     size_t len;
 
     size_t i = 0;
     while (bitmap && i < page_count) {
-        mx_status_t expected = (bitmap & 1) ? MX_OK : MX_ERR_NO_MEMORY;
-        if (mx_process_read_memory(process, base + i * PAGE_SIZE, buf, 1, &len) != expected) {
+        zx_status_t expected = (bitmap & 1) ? ZX_OK : ZX_ERR_NO_MEMORY;
+        if (zx_process_read_memory(process, base + i * PAGE_SIZE, buf, 1, &len) != expected) {
             return false;
         }
         ++i;
@@ -58,7 +58,7 @@
     p->store(5);
     *success = true;
 
-    mx_thread_exit();
+    zx_thread_exit();
 }
 // Thread run by test_local_address, used to attempt an access to memory
 void test_read_address_thread(uintptr_t address, bool* success) {
@@ -66,44 +66,44 @@
     (void)p->load();
     *success = true;
 
-    mx_thread_exit();
+    zx_thread_exit();
 }
 
 // Helper routine for testing via direct access whether or not an address in the
 // test process's address space is accessible.
-mx_status_t test_local_address(uintptr_t address, bool write, bool* success) {
+zx_status_t test_local_address(uintptr_t address, bool write, bool* success) {
     *success = false;
 
     alignas(16) static uint8_t thread_stack[PAGE_SIZE];
 
-    mx_port_packet_t packet;
+    zx_port_packet_t packet;
     bool saw_page_fault = false;
 
-    mx_handle_t thread = MX_HANDLE_INVALID;
-    mx_handle_t port = MX_HANDLE_INVALID;
+    zx_handle_t thread = ZX_HANDLE_INVALID;
+    zx_handle_t port = ZX_HANDLE_INVALID;
     uintptr_t entry = reinterpret_cast<uintptr_t>(write ? test_write_address_thread :
                                                           test_read_address_thread);
     uintptr_t stack = reinterpret_cast<uintptr_t>(thread_stack + sizeof(thread_stack));
 
-    mx_status_t status = mx_thread_create(mx_process_self(), "vmar_test_addr", 14, 0, &thread);
-    if (status != MX_OK) {
+    zx_status_t status = zx_thread_create(zx_process_self(), "vmar_test_addr", 14, 0, &thread);
+    if (status != ZX_OK) {
         goto err;
     }
 
     // Create an exception port and bind it to the thread to prevent the
     // thread's illegal access from killing the process.
-    status = mx_port_create(0, &port);
-    if (status != MX_OK) {
+    status = zx_port_create(0, &port);
+    if (status != ZX_OK) {
         goto err;
     }
-    status = mx_task_bind_exception_port(thread, port, 0, 0);
-    if (status != MX_OK) {
+    status = zx_task_bind_exception_port(thread, port, 0, 0);
+    if (status != ZX_OK) {
         goto err;
     }
 
-    status = mx_thread_start(thread, entry, stack,
+    status = zx_thread_start(thread, entry, stack,
                              address, reinterpret_cast<uintptr_t>(success));
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         goto err;
     }
 
@@ -111,63 +111,63 @@
     // Keep looping until the thread is gone so that crashlogger doesn't
     // see the page fault.
     do {
-        mx_status_t s;
+        zx_status_t s;
 
-        s = mx_port_wait(port, MX_TIME_INFINITE, &packet, 0);
-        if (s != MX_OK && status != MX_OK) {
+        s = zx_port_wait(port, ZX_TIME_INFINITE, &packet, 0);
+        if (s != ZX_OK && status != ZX_OK) {
             status = s;
             break;
         }
-        if (!MX_PKT_IS_EXCEPTION(packet.type)) {
-            status = MX_ERR_BAD_STATE;
+        if (!ZX_PKT_IS_EXCEPTION(packet.type)) {
+            status = ZX_ERR_BAD_STATE;
             break;
         }
-        if (packet.type == MX_EXCP_FATAL_PAGE_FAULT) {
-            mx_task_kill(thread);
+        if (packet.type == ZX_EXCP_FATAL_PAGE_FAULT) {
+            zx_task_kill(thread);
             saw_page_fault = true;
             // Leave status as is.
         }
-        else if (packet.type == MX_EXCP_GONE) {
+        else if (packet.type == ZX_EXCP_GONE) {
             // Leave status as is.
         }
         else {
-            mx_task_kill(thread);
-            if (status != MX_OK)
-                status = MX_ERR_BAD_STATE;
+            zx_task_kill(thread);
+            if (status != ZX_OK)
+                status = ZX_ERR_BAD_STATE;
         }
-    } while (packet.type != MX_EXCP_GONE);
+    } while (packet.type != ZX_EXCP_GONE);
 
-    if (status == MX_OK && !saw_page_fault)
+    if (status == ZX_OK && !saw_page_fault)
         *success = true;
 
     // fallthrough to cleanup
 err:
-    if (thread != MX_HANDLE_INVALID)
-        mx_task_bind_exception_port(thread, MX_HANDLE_INVALID, 0, 0);
-    mx_handle_close(port);
-    mx_handle_close(thread);
+    if (thread != ZX_HANDLE_INVALID)
+        zx_task_bind_exception_port(thread, ZX_HANDLE_INVALID, 0, 0);
+    zx_handle_close(port);
+    zx_handle_close(thread);
     return status;
 }
 
 bool destroy_root_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    zx_handle_t process;
+    zx_handle_t vmar;
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
-    EXPECT_EQ(mx_vmar_destroy(vmar), MX_OK);
+    EXPECT_EQ(zx_vmar_destroy(vmar), ZX_OK);
 
-    mx_handle_t region;
+    zx_handle_t region;
     uintptr_t region_addr;
-    EXPECT_EQ(mx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    EXPECT_EQ(zx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region, &region_addr),
-              MX_ERR_BAD_STATE);
+              ZX_ERR_BAD_STATE);
 
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -175,33 +175,33 @@
 bool basic_allocate_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t region1, region2;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t region1, region2;
     uintptr_t region1_addr, region2_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
     const size_t region1_size = PAGE_SIZE * 10;
     const size_t region2_size = PAGE_SIZE;
 
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, region1_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, region1_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region1, &region1_addr),
-              MX_OK);
+              ZX_OK);
 
-    ASSERT_EQ(mx_vmar_allocate(region1, 0, region2_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    ASSERT_EQ(zx_vmar_allocate(region1, 0, region2_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region2, &region2_addr),
-              MX_OK);
+              ZX_OK);
     EXPECT_GE(region2_addr, region1_addr);
     EXPECT_LE(region2_addr + region2_size, region1_addr + region1_size);
 
-    EXPECT_EQ(mx_handle_close(region1), MX_OK);
-    EXPECT_EQ(mx_handle_close(region2), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(region1), ZX_OK);
+    EXPECT_EQ(zx_handle_close(region2), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -209,41 +209,41 @@
 bool map_in_compact_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
-    mx_handle_t region;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
+    zx_handle_t region;
     uintptr_t region_addr, map_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
     const size_t region_size = PAGE_SIZE * 10;
     const size_t map_size = PAGE_SIZE;
 
-    ASSERT_EQ(mx_vmo_create(map_size, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(map_size, 0, &vmo), ZX_OK);
 
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, region_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE | MX_VM_FLAG_COMPACT,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, region_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE | ZX_VM_FLAG_COMPACT,
                                &region, &region_addr),
-              MX_OK);
+              ZX_OK);
 
-    ASSERT_EQ(mx_vmar_map(region, 0, vmo, 0, map_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &map_addr),
-              MX_OK);
+    ASSERT_EQ(zx_vmar_map(region, 0, vmo, 0, map_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &map_addr),
+              ZX_OK);
     EXPECT_GE(map_addr, region_addr);
     EXPECT_LE(map_addr + map_size, region_addr + region_size);
 
     // Make a second allocation
-    ASSERT_EQ(mx_vmar_map(region, 0, vmo, 0, map_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &map_addr),
-              MX_OK);
+    ASSERT_EQ(zx_vmar_map(region, 0, vmo, 0, map_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &map_addr),
+              ZX_OK);
     EXPECT_GE(map_addr, region_addr);
     EXPECT_LE(map_addr + map_size, region_addr + region_size);
 
-    EXPECT_EQ(mx_handle_close(region), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(region), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -252,36 +252,36 @@
 bool allocate_oob_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t region1, region2;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t region1, region2;
     uintptr_t region1_addr, region2_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
     const size_t region1_size = PAGE_SIZE * 10;
 
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, region1_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_CAN_MAP_SPECIFIC,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, region1_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                &region1, &region1_addr),
-              MX_OK);
+              ZX_OK);
 
-    EXPECT_EQ(mx_vmar_allocate(region1, region1_size, PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_SPECIFIC, &region2, &region2_addr),
-              MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_allocate(region1, region1_size, PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_SPECIFIC, &region2, &region2_addr),
+              ZX_ERR_INVALID_ARGS);
 
-    EXPECT_EQ(mx_vmar_allocate(region1, region1_size - PAGE_SIZE, PAGE_SIZE * 2,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_SPECIFIC,
+    EXPECT_EQ(zx_vmar_allocate(region1, region1_size - PAGE_SIZE, PAGE_SIZE * 2,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_SPECIFIC,
                                &region2, &region2_addr),
-              MX_ERR_INVALID_ARGS);
+              ZX_ERR_INVALID_ARGS);
 
-    EXPECT_EQ(mx_handle_close(region1), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(region1), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -290,45 +290,45 @@
 bool allocate_unsatisfiable_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t region1, region2, region3;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t region1, region2, region3;
     uintptr_t region1_addr, region2_addr, region3_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
     const size_t region1_size = PAGE_SIZE * 10;
 
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, region1_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_CAN_MAP_SPECIFIC,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, region1_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                &region1, &region1_addr),
-              MX_OK);
+              ZX_OK);
 
-    // Too large to fit in the region should get MX_ERR_INVALID_ARGS
-    EXPECT_EQ(mx_vmar_allocate(region1, 0, region1_size + PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    // Too large to fit in the region should get ZX_ERR_INVALID_ARGS
+    EXPECT_EQ(zx_vmar_allocate(region1, 0, region1_size + PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region2, &region2_addr),
-              MX_ERR_INVALID_ARGS);
+              ZX_ERR_INVALID_ARGS);
 
     // Allocate the whole range, should work
-    ASSERT_EQ(mx_vmar_allocate(region1, 0, region1_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    ASSERT_EQ(zx_vmar_allocate(region1, 0, region1_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region2, &region2_addr),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(region2_addr, region1_addr);
 
     // Attempt to allocate a page inside of the full region
-    EXPECT_EQ(mx_vmar_allocate(region1, 0, PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    EXPECT_EQ(zx_vmar_allocate(region1, 0, PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region3, &region3_addr),
-              MX_ERR_NO_MEMORY);
+              ZX_ERR_NO_MEMORY);
 
-    EXPECT_EQ(mx_handle_close(region2), MX_OK);
-    EXPECT_EQ(mx_handle_close(region1), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(region2), ZX_OK);
+    EXPECT_EQ(zx_handle_close(region1), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -338,98 +338,98 @@
 bool destroyed_vmar_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
-    mx_handle_t region[3] = {0};
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
+    zx_handle_t region[3] = {0};
     uintptr_t region_addr[3];
     uintptr_t map_addr[2];
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &vmo), ZX_OK);
 
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region[0], &region_addr[0]),
-              MX_OK);
+              ZX_OK);
 
     // Create a mapping in region[0], so we can try to unmap it later
-    ASSERT_EQ(mx_vmar_map(region[0], 0, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &map_addr[0]),
-              MX_OK);
+    ASSERT_EQ(zx_vmar_map(region[0], 0, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &map_addr[0]),
+              ZX_OK);
 
     // Create a subregion in region[0], so we can try to operate on it later
-    ASSERT_EQ(mx_vmar_allocate(region[0], 0, PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    ASSERT_EQ(zx_vmar_allocate(region[0], 0, PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region[1], &region_addr[1]),
-              MX_OK);
+              ZX_OK);
 
     // Create a mapping in region[1], so we can try to unmap it later
-    ASSERT_EQ(mx_vmar_map(region[1], 0, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &map_addr[1]),
-              MX_OK);
+    ASSERT_EQ(zx_vmar_map(region[1], 0, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &map_addr[1]),
+              ZX_OK);
 
     // Check that both mappings work
     {
         uint8_t buf = 5;
         size_t len;
-        EXPECT_EQ(mx_process_write_memory(process, map_addr[0], &buf, 1, &len),
-                  MX_OK);
+        EXPECT_EQ(zx_process_write_memory(process, map_addr[0], &buf, 1, &len),
+                  ZX_OK);
         EXPECT_EQ(len, 1U);
 
         buf = 0;
-        EXPECT_EQ(mx_process_read_memory(process, map_addr[1], &buf, 1, &len),
-                  MX_OK);
+        EXPECT_EQ(zx_process_read_memory(process, map_addr[1], &buf, 1, &len),
+                  ZX_OK);
         EXPECT_EQ(len, 1U);
         EXPECT_EQ(buf, 5U);
     }
 
     // Destroy region[0], which should also destroy region[1]
-    ASSERT_EQ(mx_vmar_destroy(region[0]), MX_OK);
+    ASSERT_EQ(zx_vmar_destroy(region[0]), ZX_OK);
 
     for (size_t i = 0; i < 2; ++i) {
         // Make sure the handles are still valid
-        EXPECT_EQ(mx_object_get_info(region[i], MX_INFO_HANDLE_VALID, NULL, 0u, NULL, NULL),
-                  MX_OK);
+        EXPECT_EQ(zx_object_get_info(region[i], ZX_INFO_HANDLE_VALID, NULL, 0u, NULL, NULL),
+                  ZX_OK);
 
         // Make sure we can't access the memory mappings anymore
         {
             uint8_t buf;
             size_t read;
-            EXPECT_EQ(mx_process_read_memory(process, map_addr[i], &buf, 1, &read),
-                      MX_ERR_NO_MEMORY);
+            EXPECT_EQ(zx_process_read_memory(process, map_addr[i], &buf, 1, &read),
+                      ZX_ERR_NO_MEMORY);
         }
 
-        // All operations on region[0] and region[1] should fail with MX_ERR_BAD_STATE
-        EXPECT_EQ(mx_vmar_destroy(region[i]), MX_ERR_BAD_STATE);
-        EXPECT_EQ(mx_vmar_allocate(region[i], 0, PAGE_SIZE,
-                                   MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+        // All operations on region[0] and region[1] should fail with ZX_ERR_BAD_STATE
+        EXPECT_EQ(zx_vmar_destroy(region[i]), ZX_ERR_BAD_STATE);
+        EXPECT_EQ(zx_vmar_allocate(region[i], 0, PAGE_SIZE,
+                                   ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                    &region[1], &region_addr[2]),
-                  MX_ERR_BAD_STATE);
-        EXPECT_EQ(mx_vmar_unmap(region[i], map_addr[i], PAGE_SIZE),
-                  MX_ERR_BAD_STATE);
-        EXPECT_EQ(mx_vmar_protect(region[i], map_addr[i], PAGE_SIZE, MX_VM_FLAG_PERM_READ),
-                  MX_ERR_BAD_STATE);
-        EXPECT_EQ(mx_vmar_map(region[i], 0, vmo, 0, PAGE_SIZE, MX_VM_FLAG_PERM_READ, &map_addr[i]),
-                  MX_ERR_BAD_STATE);
+                  ZX_ERR_BAD_STATE);
+        EXPECT_EQ(zx_vmar_unmap(region[i], map_addr[i], PAGE_SIZE),
+                  ZX_ERR_BAD_STATE);
+        EXPECT_EQ(zx_vmar_protect(region[i], map_addr[i], PAGE_SIZE, ZX_VM_FLAG_PERM_READ),
+                  ZX_ERR_BAD_STATE);
+        EXPECT_EQ(zx_vmar_map(region[i], 0, vmo, 0, PAGE_SIZE, ZX_VM_FLAG_PERM_READ, &map_addr[i]),
+                  ZX_ERR_BAD_STATE);
     }
 
     // Make sure we can still operate on the parent of region[0]
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region[2], &region_addr[2]),
-              MX_OK);
+              ZX_OK);
 
 
-    for (mx_handle_t h : region) {
-        EXPECT_EQ(mx_handle_close(h), MX_OK);
+    for (zx_handle_t h : region) {
+        EXPECT_EQ(zx_handle_close(h), ZX_OK);
     }
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -439,86 +439,86 @@
 bool map_over_destroyed_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo, vmo2;
-    mx_handle_t region[2] = {0};
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo, vmo2;
+    zx_handle_t region[2] = {0};
     uintptr_t region_addr[2];
     uintptr_t map_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &vmo), MX_OK);
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &vmo2), MX_OK);
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &vmo), ZX_OK);
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &vmo2), ZX_OK);
 
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_CAN_MAP_SPECIFIC,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                &region[0], &region_addr[0]),
-              MX_OK);
+              ZX_OK);
 
     // Create a subregion in region[0], so we can try to operate on it later
-    ASSERT_EQ(mx_vmar_allocate(region[0], 0, PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    ASSERT_EQ(zx_vmar_allocate(region[0], 0, PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region[1], &region_addr[1]),
-              MX_OK);
+              ZX_OK);
 
     // Create a mapping in region[1], so we can try to unmap it later
-    ASSERT_EQ(mx_vmar_map(region[1], 0, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &map_addr),
-              MX_OK);
+    ASSERT_EQ(zx_vmar_map(region[1], 0, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &map_addr),
+              ZX_OK);
 
     // Check that the mapping worked
     {
         uint8_t buf = 5;
         size_t len;
-        ASSERT_EQ(mx_vmo_write(vmo, &buf, 0, 1, &len), MX_OK);
+        ASSERT_EQ(zx_vmo_write(vmo, &buf, 0, 1, &len), ZX_OK);
         EXPECT_EQ(len, 1U);
 
         buf = 0;
-        EXPECT_EQ(mx_process_read_memory(process, map_addr, &buf, 1, &len),
-                  MX_OK);
+        EXPECT_EQ(zx_process_read_memory(process, map_addr, &buf, 1, &len),
+                  ZX_OK);
         EXPECT_EQ(len, 1U);
         EXPECT_EQ(buf, 5U);
     }
 
     // Destroy region[1], which should unmap the VMO
-    ASSERT_EQ(mx_vmar_destroy(region[1]), MX_OK);
+    ASSERT_EQ(zx_vmar_destroy(region[1]), ZX_OK);
 
     // Make sure we can't access the memory mappings anymore
     {
         uint8_t buf;
         size_t read;
-        EXPECT_EQ(mx_process_read_memory(process, map_addr, &buf, 1, &read),
-                  MX_ERR_NO_MEMORY);
+        EXPECT_EQ(zx_process_read_memory(process, map_addr, &buf, 1, &read),
+                  ZX_ERR_NO_MEMORY);
     }
 
     uintptr_t new_map_addr;
-    EXPECT_EQ(mx_vmar_map(region[0], map_addr - region_addr[0], vmo2, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC, &new_map_addr),
-              MX_OK);
+    EXPECT_EQ(zx_vmar_map(region[0], map_addr - region_addr[0], vmo2, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC, &new_map_addr),
+              ZX_OK);
     EXPECT_EQ(new_map_addr, map_addr);
 
     // Make sure we can read, and we don't see the old memory mapping
     {
         uint8_t buf;
         size_t read;
-        EXPECT_EQ(mx_process_read_memory(process, map_addr, &buf, 1, &read),
-                  MX_OK);
+        EXPECT_EQ(zx_process_read_memory(process, map_addr, &buf, 1, &read),
+                  ZX_OK);
         EXPECT_EQ(read, 1U);
         EXPECT_EQ(buf, 0U);
     }
 
-    for (mx_handle_t h : region) {
-        EXPECT_EQ(mx_handle_close(h), MX_OK);
+    for (zx_handle_t h : region) {
+        EXPECT_EQ(zx_handle_close(h), ZX_OK);
     }
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo2), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo2), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -528,98 +528,98 @@
 bool overmapping_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t region[3] = {0};
-    mx_handle_t vmar;
-    mx_handle_t vmo, vmo2;
+    zx_handle_t process;
+    zx_handle_t region[3] = {0};
+    zx_handle_t vmar;
+    zx_handle_t vmo, vmo2;
     uintptr_t region_addr[3];
     uintptr_t map_addr[2];
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &vmo), MX_OK);
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE * 4, 0, &vmo2), MX_OK);
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &vmo), ZX_OK);
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE * 4, 0, &vmo2), ZX_OK);
 
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_CAN_MAP_SPECIFIC,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                &region[0], &region_addr[0]),
-              MX_OK);
+              ZX_OK);
 
     // Create a mapping, and try to map on top of it
-    ASSERT_EQ(mx_vmar_map(region[0], PAGE_SIZE, vmo, 0, 2 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(region[0], PAGE_SIZE, vmo, 0, 2 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &map_addr[0]),
-              MX_OK);
+              ZX_OK);
 
     // Attempt a full overmapping
-    EXPECT_EQ(mx_vmar_map(region[0], map_addr[0] - region_addr[0], vmo2, 0, 2 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC, &map_addr[1]),
-              MX_ERR_NO_MEMORY);
+    EXPECT_EQ(zx_vmar_map(region[0], map_addr[0] - region_addr[0], vmo2, 0, 2 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC, &map_addr[1]),
+              ZX_ERR_NO_MEMORY);
 
     // Attempt a partial overmapping
-    EXPECT_EQ(mx_vmar_map(region[0], map_addr[0] - region_addr[0], vmo2, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC, &map_addr[1]),
-              MX_ERR_NO_MEMORY);
+    EXPECT_EQ(zx_vmar_map(region[0], map_addr[0] - region_addr[0], vmo2, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC, &map_addr[1]),
+              ZX_ERR_NO_MEMORY);
 
     // Attempt an overmapping that is larger than the original mapping
-    EXPECT_EQ(mx_vmar_map(region[0], map_addr[0] - region_addr[0], vmo2, 0,
-                          4 * PAGE_SIZE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC, &map_addr[1]),
-              MX_ERR_NO_MEMORY);
+    EXPECT_EQ(zx_vmar_map(region[0], map_addr[0] - region_addr[0], vmo2, 0,
+                          4 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC, &map_addr[1]),
+              ZX_ERR_NO_MEMORY);
 
     // Attempt to allocate a region on top
-    EXPECT_EQ(mx_vmar_allocate(region[0], map_addr[0] - region_addr[0], PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_SPECIFIC,
+    EXPECT_EQ(zx_vmar_allocate(region[0], map_addr[0] - region_addr[0], PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_SPECIFIC,
                                &region[1], &region_addr[1]),
-              MX_ERR_NO_MEMORY);
+              ZX_ERR_NO_MEMORY);
 
     // Unmap the mapping
-    ASSERT_EQ(mx_vmar_unmap(region[0], map_addr[0], 2 * PAGE_SIZE), MX_OK);
+    ASSERT_EQ(zx_vmar_unmap(region[0], map_addr[0], 2 * PAGE_SIZE), ZX_OK);
 
 
     // Create a region, and try to map on top of it
-    ASSERT_EQ(mx_vmar_allocate(region[0], PAGE_SIZE, 2 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_allocate(region[0], PAGE_SIZE, 2 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_SPECIFIC,
                                &region[1], &region_addr[1]),
-              MX_OK);
+              ZX_OK);
 
     // Attempt a full overmapping
-    EXPECT_EQ(mx_vmar_map(region[0], region_addr[1] - region_addr[0], vmo2, 0, 2 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC, &map_addr[1]),
-              MX_ERR_NO_MEMORY);
+    EXPECT_EQ(zx_vmar_map(region[0], region_addr[1] - region_addr[0], vmo2, 0, 2 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC, &map_addr[1]),
+              ZX_ERR_NO_MEMORY);
 
     // Attempt a partial overmapping
-    EXPECT_EQ(mx_vmar_map(region[0], region_addr[1] - region_addr[0], vmo2, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC, &map_addr[1]),
-              MX_ERR_NO_MEMORY);
+    EXPECT_EQ(zx_vmar_map(region[0], region_addr[1] - region_addr[0], vmo2, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC, &map_addr[1]),
+              ZX_ERR_NO_MEMORY);
 
     // Attempt an overmapping that is larger than the original region
-    EXPECT_EQ(mx_vmar_map(region[0], region_addr[1] - region_addr[0], vmo2, 0,
-                          4 * PAGE_SIZE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC, &map_addr[1]),
-              MX_ERR_NO_MEMORY);
+    EXPECT_EQ(zx_vmar_map(region[0], region_addr[1] - region_addr[0], vmo2, 0,
+                          4 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC, &map_addr[1]),
+              ZX_ERR_NO_MEMORY);
 
     // Attempt to allocate a region on top
-    EXPECT_EQ(mx_vmar_allocate(region[0], region_addr[1] - region_addr[0], PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_SPECIFIC,
+    EXPECT_EQ(zx_vmar_allocate(region[0], region_addr[1] - region_addr[0], PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_SPECIFIC,
                                &region[2], &region_addr[2]),
-              MX_ERR_NO_MEMORY);
+              ZX_ERR_NO_MEMORY);
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo2), MX_OK);
-    EXPECT_EQ(mx_handle_close(region[0]), MX_OK);
-    EXPECT_EQ(mx_handle_close(region[1]), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo2), ZX_OK);
+    EXPECT_EQ(zx_handle_close(region[0]), ZX_OK);
+    EXPECT_EQ(zx_handle_close(region[1]), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -628,188 +628,188 @@
 bool invalid_args_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
-    mx_handle_t region;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
+    zx_handle_t region;
     uintptr_t region_addr, map_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
-    ASSERT_EQ(mx_vmo_create(4 * PAGE_SIZE, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
+    ASSERT_EQ(zx_vmo_create(4 * PAGE_SIZE, 0, &vmo), ZX_OK);
 
     // Bad handle
-    EXPECT_EQ(mx_vmar_destroy(vmo), MX_ERR_WRONG_TYPE);
-    EXPECT_EQ(mx_vmar_allocate(vmo, 0, 10 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    EXPECT_EQ(zx_vmar_destroy(vmo), ZX_ERR_WRONG_TYPE);
+    EXPECT_EQ(zx_vmar_allocate(vmo, 0, 10 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region, &region_addr),
-              MX_ERR_WRONG_TYPE);
-    EXPECT_EQ(mx_vmar_map(vmo, 0, vmo, 0,
-                          4 * PAGE_SIZE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+              ZX_ERR_WRONG_TYPE);
+    EXPECT_EQ(zx_vmar_map(vmo, 0, vmo, 0,
+                          4 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_ERR_WRONG_TYPE);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, process, 0,
-                          4 * PAGE_SIZE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+              ZX_ERR_WRONG_TYPE);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, process, 0,
+                          4 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_ERR_WRONG_TYPE);
-    EXPECT_EQ(mx_vmar_unmap(vmo, 0, 0), MX_ERR_WRONG_TYPE);
-    EXPECT_EQ(mx_vmar_protect(vmo, 0, 0, MX_VM_FLAG_PERM_READ), MX_ERR_WRONG_TYPE);
+              ZX_ERR_WRONG_TYPE);
+    EXPECT_EQ(zx_vmar_unmap(vmo, 0, 0), ZX_ERR_WRONG_TYPE);
+    EXPECT_EQ(zx_vmar_protect(vmo, 0, 0, ZX_VM_FLAG_PERM_READ), ZX_ERR_WRONG_TYPE);
 
     // Allocating with non-zero offset and without FLAG_SPECIFIC
-    EXPECT_EQ(mx_vmar_allocate(vmar, PAGE_SIZE, 10 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    EXPECT_EQ(zx_vmar_allocate(vmar, PAGE_SIZE, 10 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region, &region_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, PAGE_SIZE, vmo, 0,
-                          4 * PAGE_SIZE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, PAGE_SIZE, vmo, 0,
+                          4 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_ERR_INVALID_ARGS);
+              ZX_ERR_INVALID_ARGS);
 
     // Bad OUT pointers
     uintptr_t *bad_addr_ptr = reinterpret_cast<uintptr_t*>(1);
-    mx_handle_t *bad_handle_ptr = reinterpret_cast<mx_handle_t*>(1);
-    EXPECT_EQ(mx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    zx_handle_t *bad_handle_ptr = reinterpret_cast<zx_handle_t*>(1);
+    EXPECT_EQ(zx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region, bad_addr_ptr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                bad_handle_ptr, &region_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0,
-                          4 * PAGE_SIZE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0,
+                          4 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           bad_addr_ptr),
-              MX_ERR_INVALID_ARGS);
+              ZX_ERR_INVALID_ARGS);
 
     // Non-page-aligned arguments
-    EXPECT_EQ(mx_vmar_allocate(vmar, 0, PAGE_SIZE - 1,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    EXPECT_EQ(zx_vmar_allocate(vmar, 0, PAGE_SIZE - 1,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region, &region_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_allocate(vmar, PAGE_SIZE - 1, PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_CAN_MAP_SPECIFIC,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_allocate(vmar, PAGE_SIZE - 1, PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                &region, &region_addr),
-              MX_ERR_INVALID_ARGS);
-    // Try the invalid maps with and without MX_VM_FLAG_MAP_RANGE.
+              ZX_ERR_INVALID_ARGS);
+    // Try the invalid maps with and without ZX_VM_FLAG_MAP_RANGE.
     for (size_t i = 0; i < 2; ++i) {
-        const uint32_t map_range = i ? MX_VM_FLAG_MAP_RANGE : 0;
+        const uint32_t map_range = i ? ZX_VM_FLAG_MAP_RANGE : 0;
         // Specific, misaligned vmar offset
-        EXPECT_EQ(mx_vmar_map(vmar, PAGE_SIZE - 1, vmo, 0,
+        EXPECT_EQ(zx_vmar_map(vmar, PAGE_SIZE - 1, vmo, 0,
                               4 * PAGE_SIZE,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC | map_range,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC | map_range,
                               &map_addr),
-                  MX_ERR_INVALID_ARGS);
+                  ZX_ERR_INVALID_ARGS);
         // Specific, misaligned vmo offset
-        EXPECT_EQ(mx_vmar_map(vmar, PAGE_SIZE, vmo, PAGE_SIZE - 1,
+        EXPECT_EQ(zx_vmar_map(vmar, PAGE_SIZE, vmo, PAGE_SIZE - 1,
                               3 * PAGE_SIZE,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC | map_range,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC | map_range,
                               &map_addr),
-                  MX_ERR_INVALID_ARGS);
+                  ZX_ERR_INVALID_ARGS);
         // Non-specific, misaligned vmo offset
-        EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, PAGE_SIZE - 1,
+        EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, PAGE_SIZE - 1,
                               3 * PAGE_SIZE,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | map_range,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | map_range,
                               &map_addr),
-                  MX_ERR_INVALID_ARGS);
+                  ZX_ERR_INVALID_ARGS);
     }
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0,
-                          4 * PAGE_SIZE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0,
+                          4 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_unmap(vmar, map_addr + 1, PAGE_SIZE), MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_protect(vmar, map_addr + 1, PAGE_SIZE, MX_VM_FLAG_PERM_READ),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE), MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, map_addr + 1, PAGE_SIZE), ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_protect(vmar, map_addr + 1, PAGE_SIZE, ZX_VM_FLAG_PERM_READ),
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE), ZX_OK);
 
     // Overflowing vmo_offset
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, UINT64_MAX + 1 - PAGE_SIZE,
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, UINT64_MAX + 1 - PAGE_SIZE,
                           PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, UINT64_MAX + 1 - 2 * PAGE_SIZE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, UINT64_MAX + 1 - 2 * PAGE_SIZE,
                           PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_unmap(vmar, map_addr, PAGE_SIZE), MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, map_addr, PAGE_SIZE), ZX_OK);
 
     // size=0
-    EXPECT_EQ(mx_vmar_allocate(vmar, 0, 0,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    EXPECT_EQ(zx_vmar_allocate(vmar, 0, 0,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region, &region_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 0, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 0, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0,
-                          4 * PAGE_SIZE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0,
+                          4 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_unmap(vmar, map_addr, 0), MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_protect(vmar, map_addr, 0, MX_VM_FLAG_PERM_READ),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE), MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, map_addr, 0), ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_protect(vmar, map_addr, 0, ZX_VM_FLAG_PERM_READ),
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE), ZX_OK);
 
     // size rounds up to 0
     constexpr size_t bad_size = fbl::numeric_limits<size_t>::max() - PAGE_SIZE + 2;
     static_assert(((bad_size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) == 0, "");
-    EXPECT_EQ(mx_vmar_allocate(vmar, 0, bad_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    EXPECT_EQ(zx_vmar_allocate(vmar, 0, bad_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region, &region_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0, bad_size, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0, bad_size, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0, bad_size, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_MAP_RANGE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0, bad_size, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_MAP_RANGE,
                           &map_addr),
-              MX_ERR_INVALID_ARGS);
+              ZX_ERR_INVALID_ARGS);
     // Attempt bad protect/unmaps
-    EXPECT_EQ(mx_vmar_map(vmar, PAGE_SIZE, vmo, 0,
+    EXPECT_EQ(zx_vmar_map(vmar, PAGE_SIZE, vmo, 0,
                           4 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &map_addr),
-              MX_OK);
+              ZX_OK);
     for (ssize_t i = -1; i < 2; ++i) {
-        EXPECT_EQ(mx_vmar_protect(vmar, map_addr + PAGE_SIZE * i, bad_size, MX_VM_FLAG_PERM_READ),
-                  MX_ERR_INVALID_ARGS);
-        EXPECT_EQ(mx_vmar_unmap(vmar, map_addr + PAGE_SIZE * i, bad_size), MX_ERR_INVALID_ARGS);
+        EXPECT_EQ(zx_vmar_protect(vmar, map_addr + PAGE_SIZE * i, bad_size, ZX_VM_FLAG_PERM_READ),
+                  ZX_ERR_INVALID_ARGS);
+        EXPECT_EQ(zx_vmar_unmap(vmar, map_addr + PAGE_SIZE * i, bad_size), ZX_ERR_INVALID_ARGS);
     }
-    EXPECT_EQ(mx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE), ZX_OK);
 
     // Flags with invalid bits set
-    EXPECT_EQ(mx_vmar_allocate(vmar, 0, 4 * PAGE_SIZE,
-                               MX_VM_FLAG_PERM_READ | MX_VM_FLAG_CAN_MAP_READ |
-                               MX_VM_FLAG_CAN_MAP_WRITE, &region, &region_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_allocate(vmar, 0, 4 * PAGE_SIZE,
-                               MX_VM_FLAG_CAN_MAP_READ | (1<<31),
+    EXPECT_EQ(zx_vmar_allocate(vmar, 0, 4 * PAGE_SIZE,
+                               ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_CAN_MAP_READ |
+                               ZX_VM_FLAG_CAN_MAP_WRITE, &region, &region_addr),
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_allocate(vmar, 0, 4 * PAGE_SIZE,
+                               ZX_VM_FLAG_CAN_MAP_READ | (1<<31),
                                &region, &region_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_CAN_MAP_EXECUTE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_CAN_MAP_EXECUTE,
                           &map_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | (1<<31),
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | (1<<31),
                           &map_addr),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &map_addr),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, map_addr, 4 * PAGE_SIZE,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_CAN_MAP_WRITE),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_protect(vmar, map_addr, 4 * PAGE_SIZE,
-                              MX_VM_FLAG_PERM_READ | (1<<31)),
-              MX_ERR_INVALID_ARGS);
-    EXPECT_EQ(mx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE), MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, map_addr, 4 * PAGE_SIZE,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_CAN_MAP_WRITE),
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_protect(vmar, map_addr, 4 * PAGE_SIZE,
+                              ZX_VM_FLAG_PERM_READ | (1<<31)),
+              ZX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE), ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -818,33 +818,33 @@
 bool unaligned_len_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
     uintptr_t map_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
-    ASSERT_EQ(mx_vmo_create(4 * PAGE_SIZE, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
+    ASSERT_EQ(zx_vmo_create(4 * PAGE_SIZE, 0, &vmo), ZX_OK);
 
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE, MX_VM_FLAG_PERM_READ, &map_addr),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, map_addr, 4 * PAGE_SIZE - 1,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE - 1), MX_OK);
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ, &map_addr),
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, map_addr, 4 * PAGE_SIZE - 1,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE),
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE - 1), ZX_OK);
 
     // Make sure we can't access the last page of the memory mappings anymore
     {
         uint8_t buf;
         size_t read;
-        EXPECT_EQ(mx_process_read_memory(process, map_addr + 3 * PAGE_SIZE, &buf, 1, &read),
-                  MX_ERR_NO_MEMORY);
+        EXPECT_EQ(zx_process_read_memory(process, map_addr + 3 * PAGE_SIZE, &buf, 1, &read),
+                  ZX_ERR_NO_MEMORY);
     }
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -853,42 +853,42 @@
 bool unaligned_len_map_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
     uintptr_t map_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
-    ASSERT_EQ(mx_vmo_create(4 * PAGE_SIZE, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
+    ASSERT_EQ(zx_vmo_create(4 * PAGE_SIZE, 0, &vmo), ZX_OK);
 
     for (size_t i = 0; i < 2; ++i) {
-        const uint32_t map_range = i ? MX_VM_FLAG_MAP_RANGE : 0;
-        ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE - 1, MX_VM_FLAG_PERM_READ | map_range,
+        const uint32_t map_range = i ? ZX_VM_FLAG_MAP_RANGE : 0;
+        ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE - 1, ZX_VM_FLAG_PERM_READ | map_range,
                               &map_addr),
-                 MX_OK);
+                 ZX_OK);
 
         // Make sure we can access the last page of the memory mapping
         {
             uint8_t buf;
             size_t read;
-            EXPECT_EQ(mx_process_read_memory(process, map_addr + 3 * PAGE_SIZE, &buf, 1, &read),
-                      MX_OK);
+            EXPECT_EQ(zx_process_read_memory(process, map_addr + 3 * PAGE_SIZE, &buf, 1, &read),
+                      ZX_OK);
         }
 
-        EXPECT_EQ(mx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE - 1), MX_OK);
+        EXPECT_EQ(zx_vmar_unmap(vmar, map_addr, 4 * PAGE_SIZE - 1), ZX_OK);
         // Make sure we can't access the last page of the memory mappings anymore
         {
             uint8_t buf;
             size_t read;
-            EXPECT_EQ(mx_process_read_memory(process, map_addr + 3 * PAGE_SIZE, &buf, 1, &read),
-                      MX_ERR_NO_MEMORY);
+            EXPECT_EQ(zx_process_read_memory(process, map_addr + 3 * PAGE_SIZE, &buf, 1, &read),
+                      ZX_ERR_NO_MEMORY);
         }
     }
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -897,54 +897,54 @@
 bool rights_drop_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
-    mx_handle_t region;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
+    zx_handle_t region;
     uintptr_t map_addr;
     uintptr_t region_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &vmo), ZX_OK);
 
     const uint32_t test_rights[][3] = {
-        { MX_RIGHT_READ, MX_VM_FLAG_PERM_READ },
-        { MX_RIGHT_READ | MX_RIGHT_WRITE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE },
-        { MX_RIGHT_READ | MX_RIGHT_EXECUTE, MX_VM_FLAG_PERM_READ |  MX_VM_FLAG_PERM_EXECUTE },
+        { ZX_RIGHT_READ, ZX_VM_FLAG_PERM_READ },
+        { ZX_RIGHT_READ | ZX_RIGHT_WRITE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE },
+        { ZX_RIGHT_READ | ZX_RIGHT_EXECUTE, ZX_VM_FLAG_PERM_READ |  ZX_VM_FLAG_PERM_EXECUTE },
     };
     for (size_t i = 0; i < fbl::count_of(test_rights); ++i) {
         uint32_t right = test_rights[i][0];
         uint32_t perm = test_rights[i][1];
 
-        mx_handle_t new_h;
-        ASSERT_EQ(mx_handle_duplicate(vmar, right, &new_h), MX_OK);
+        zx_handle_t new_h;
+        ASSERT_EQ(zx_handle_duplicate(vmar, right, &new_h), ZX_OK);
 
         // Try to create a mapping with permissions we don't have
-        EXPECT_EQ(mx_vmar_map(new_h, 0, vmo, 0, PAGE_SIZE, kRwxMapPerm, &map_addr),
-                  MX_ERR_ACCESS_DENIED);
+        EXPECT_EQ(zx_vmar_map(new_h, 0, vmo, 0, PAGE_SIZE, kRwxMapPerm, &map_addr),
+                  ZX_ERR_ACCESS_DENIED);
 
         // Try to create a mapping with permissions we do have
-        ASSERT_EQ(mx_vmar_map(new_h, 0, vmo, 0, PAGE_SIZE, perm, &map_addr),
-                  MX_OK);
+        ASSERT_EQ(zx_vmar_map(new_h, 0, vmo, 0, PAGE_SIZE, perm, &map_addr),
+                  ZX_OK);
 
         // Attempt to use protect to increase privileges
-        EXPECT_EQ(mx_vmar_protect(new_h, map_addr, PAGE_SIZE, kRwxMapPerm),
-                  MX_ERR_ACCESS_DENIED);
+        EXPECT_EQ(zx_vmar_protect(new_h, map_addr, PAGE_SIZE, kRwxMapPerm),
+                  ZX_ERR_ACCESS_DENIED);
 
-        EXPECT_EQ(mx_vmar_unmap(new_h, map_addr, PAGE_SIZE), MX_OK);
+        EXPECT_EQ(zx_vmar_unmap(new_h, map_addr, PAGE_SIZE), ZX_OK);
 
         // Attempt to create a region that can map write (this would allow us to
         // then make writeable mappings inside of it).
-        EXPECT_EQ(mx_vmar_allocate(new_h, 0, 10 * PAGE_SIZE, kRwxAllocPerm, &region, &region_addr),
-                  MX_ERR_ACCESS_DENIED);
+        EXPECT_EQ(zx_vmar_allocate(new_h, 0, 10 * PAGE_SIZE, kRwxAllocPerm, &region, &region_addr),
+                  ZX_ERR_ACCESS_DENIED);
 
-        EXPECT_EQ(mx_handle_close(new_h), MX_OK);
+        EXPECT_EQ(zx_handle_close(new_h), ZX_OK);
     }
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -954,52 +954,52 @@
 bool protect_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
     uintptr_t map_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &vmo), ZX_OK);
 
     const uint32_t test_rights[][3] = {
-        { MX_RIGHT_READ, MX_VM_FLAG_PERM_READ },
-        { MX_RIGHT_READ | MX_RIGHT_WRITE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE },
-        { MX_RIGHT_READ | MX_RIGHT_EXECUTE, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE },
+        { ZX_RIGHT_READ, ZX_VM_FLAG_PERM_READ },
+        { ZX_RIGHT_READ | ZX_RIGHT_WRITE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE },
+        { ZX_RIGHT_READ | ZX_RIGHT_EXECUTE, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE },
     };
     for (size_t i = 0; i < fbl::count_of(test_rights); ++i) {
         uint32_t right = test_rights[i][0];
         uint32_t perm = test_rights[i][1];
 
-        mx_handle_t new_h;
-        ASSERT_EQ(mx_handle_duplicate(vmo, right | MX_RIGHT_MAP, &new_h), MX_OK);
+        zx_handle_t new_h;
+        ASSERT_EQ(zx_handle_duplicate(vmo, right | ZX_RIGHT_MAP, &new_h), ZX_OK);
 
         // Try to create a mapping with permissions we don't have
-        EXPECT_EQ(mx_vmar_map(vmar, 0, new_h, 0, PAGE_SIZE, kRwxMapPerm, &map_addr),
-                  MX_ERR_ACCESS_DENIED);
+        EXPECT_EQ(zx_vmar_map(vmar, 0, new_h, 0, PAGE_SIZE, kRwxMapPerm, &map_addr),
+                  ZX_ERR_ACCESS_DENIED);
 
         // Try to create a mapping with permissions we do have
-        ASSERT_EQ(mx_vmar_map(vmar, 0, new_h, 0, PAGE_SIZE, perm, &map_addr),
-                  MX_OK);
+        ASSERT_EQ(zx_vmar_map(vmar, 0, new_h, 0, PAGE_SIZE, perm, &map_addr),
+                  ZX_OK);
 
         // Attempt to use protect to increase privileges to a level allowed by
         // the VMAR but not by the VMO handle
-        EXPECT_EQ(mx_vmar_protect(vmar, map_addr, PAGE_SIZE, kRwxMapPerm),
-                  MX_ERR_ACCESS_DENIED);
+        EXPECT_EQ(zx_vmar_protect(vmar, map_addr, PAGE_SIZE, kRwxMapPerm),
+                  ZX_ERR_ACCESS_DENIED);
 
-        EXPECT_EQ(mx_handle_close(new_h), MX_OK);
+        EXPECT_EQ(zx_handle_close(new_h), ZX_OK);
 
         // Try again now that we closed the VMO handle
-        EXPECT_EQ(mx_vmar_protect(vmar, map_addr, PAGE_SIZE, kRwxMapPerm),
-                  MX_ERR_ACCESS_DENIED);
+        EXPECT_EQ(zx_vmar_protect(vmar, map_addr, PAGE_SIZE, kRwxMapPerm),
+                  ZX_ERR_ACCESS_DENIED);
 
-        EXPECT_EQ(mx_vmar_unmap(vmar, map_addr, PAGE_SIZE), MX_OK);
+        EXPECT_EQ(zx_vmar_unmap(vmar, map_addr, PAGE_SIZE), ZX_OK);
     }
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -1009,81 +1009,81 @@
 bool nested_region_perms_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
-    mx_handle_t region[2] = {0};
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
+    zx_handle_t region[2] = {0};
     uintptr_t region_addr[2];
     uintptr_t map_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &vmo), ZX_OK);
 
     // List of pairs of alloc/map perms to try to exclude
     const uint32_t test_perm[][2] = {
-        { MX_VM_FLAG_CAN_MAP_READ, MX_VM_FLAG_PERM_READ },
-        { MX_VM_FLAG_CAN_MAP_WRITE, MX_VM_FLAG_PERM_WRITE },
-        { MX_VM_FLAG_CAN_MAP_EXECUTE, MX_VM_FLAG_PERM_EXECUTE },
+        { ZX_VM_FLAG_CAN_MAP_READ, ZX_VM_FLAG_PERM_READ },
+        { ZX_VM_FLAG_CAN_MAP_WRITE, ZX_VM_FLAG_PERM_WRITE },
+        { ZX_VM_FLAG_CAN_MAP_EXECUTE, ZX_VM_FLAG_PERM_EXECUTE },
     };
 
     for (size_t i = 0; i < fbl::count_of(test_perm); ++i) {
         const uint32_t excluded_alloc_perm = test_perm[i][0];
         const uint32_t excluded_map_perm = test_perm[i][1];
 
-        ASSERT_EQ(mx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
+        ASSERT_EQ(zx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
                                    kRwxAllocPerm ^ excluded_alloc_perm,
                                    &region[0], &region_addr[0]),
-                  MX_OK);
+                  ZX_OK);
 
         // Should fail since region[0] does not have the right perms
-        EXPECT_EQ(mx_vmar_allocate(region[0], 0, PAGE_SIZE, kRwxAllocPerm,
+        EXPECT_EQ(zx_vmar_allocate(region[0], 0, PAGE_SIZE, kRwxAllocPerm,
                                    &region[1], &region_addr[1]),
-                  MX_ERR_ACCESS_DENIED);
+                  ZX_ERR_ACCESS_DENIED);
 
         // Try to create a mapping in region[0] with the dropped rights
-        EXPECT_EQ(mx_vmar_map(region[0], 0, vmo, 0, PAGE_SIZE, kRwxMapPerm, &map_addr),
-                  MX_ERR_ACCESS_DENIED);
+        EXPECT_EQ(zx_vmar_map(region[0], 0, vmo, 0, PAGE_SIZE, kRwxMapPerm, &map_addr),
+                  ZX_ERR_ACCESS_DENIED);
 
         // Successfully create a mapping in region[0] (skip if we excluded READ,
         // since all mappings must be readable on most CPUs)
-        if (excluded_map_perm != MX_VM_FLAG_PERM_READ) {
-            EXPECT_EQ(mx_vmar_map(region[0], 0, vmo, 0, PAGE_SIZE,
+        if (excluded_map_perm != ZX_VM_FLAG_PERM_READ) {
+            EXPECT_EQ(zx_vmar_map(region[0], 0, vmo, 0, PAGE_SIZE,
                                   kRwxMapPerm ^ excluded_map_perm, &map_addr),
-                      MX_OK);
-            EXPECT_EQ(mx_vmar_unmap(region[0], map_addr, PAGE_SIZE), MX_OK);
+                      ZX_OK);
+            EXPECT_EQ(zx_vmar_unmap(region[0], map_addr, PAGE_SIZE), ZX_OK);
         }
 
         // Successfully create a subregion in region[0]
-        EXPECT_EQ(mx_vmar_allocate(region[0], 0, PAGE_SIZE,
+        EXPECT_EQ(zx_vmar_allocate(region[0], 0, PAGE_SIZE,
                                    kRwxAllocPerm ^ excluded_alloc_perm,
                                    &region[1], &region_addr[1]),
-                  MX_OK);
-        EXPECT_EQ(mx_vmar_destroy(region[1]), MX_OK);
-        EXPECT_EQ(mx_handle_close(region[1]), MX_OK);
+                  ZX_OK);
+        EXPECT_EQ(zx_vmar_destroy(region[1]), ZX_OK);
+        EXPECT_EQ(zx_handle_close(region[1]), ZX_OK);
 
-        EXPECT_EQ(mx_vmar_destroy(region[0]), MX_OK);
-        EXPECT_EQ(mx_handle_close(region[0]), MX_OK);
+        EXPECT_EQ(zx_vmar_destroy(region[0]), ZX_OK);
+        EXPECT_EQ(zx_handle_close(region[0]), ZX_OK);
     }
 
     // Make sure we can't use SPECIFIC in a region without CAN_MAP_SPECIFIC
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, 10 * PAGE_SIZE,
                                kRwxAllocPerm,
                                &region[0], &region_addr[0]),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_map(region[0], PAGE_SIZE, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_SPECIFIC | MX_VM_FLAG_PERM_READ, &map_addr),
-              MX_ERR_ACCESS_DENIED);
-    EXPECT_EQ(mx_vmar_map(region[0], PAGE_SIZE, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_SPECIFIC_OVERWRITE | MX_VM_FLAG_PERM_READ,
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_map(region[0], PAGE_SIZE, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_SPECIFIC | ZX_VM_FLAG_PERM_READ, &map_addr),
+              ZX_ERR_ACCESS_DENIED);
+    EXPECT_EQ(zx_vmar_map(region[0], PAGE_SIZE, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_SPECIFIC_OVERWRITE | ZX_VM_FLAG_PERM_READ,
                           &map_addr),
-              MX_ERR_ACCESS_DENIED);
-    EXPECT_EQ(mx_vmar_destroy(region[0]), MX_OK);
-    EXPECT_EQ(mx_handle_close(region[0]), MX_OK);
+              ZX_ERR_ACCESS_DENIED);
+    EXPECT_EQ(zx_vmar_destroy(region[0]), ZX_OK);
+    EXPECT_EQ(zx_handle_close(region[0]), ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -1091,30 +1091,30 @@
 bool object_info_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t region;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t region;
     uintptr_t region_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
     const size_t region_size = PAGE_SIZE * 10;
 
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, region_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, region_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
                                &region, &region_addr),
-              MX_OK);
+              ZX_OK);
 
-    mx_info_vmar_t info;
-    ASSERT_EQ(mx_object_get_info(region, MX_INFO_VMAR, &info, sizeof(info), NULL, NULL),
-              MX_OK);
+    zx_info_vmar_t info;
+    ASSERT_EQ(zx_object_get_info(region, ZX_INFO_VMAR, &info, sizeof(info), NULL, NULL),
+              ZX_OK);
     EXPECT_EQ(info.base, region_addr);
     EXPECT_EQ(info.len, region_size);
 
-    EXPECT_EQ(mx_handle_close(region), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(region), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -1123,64 +1123,64 @@
 bool unmap_split_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
     uintptr_t mapping_addr[3];
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
-    ASSERT_EQ(mx_vmo_create(4 * PAGE_SIZE, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(4 * PAGE_SIZE, 0, &vmo), ZX_OK);
 
     // Set up mappings to test on
     for (uintptr_t& addr : mapping_addr) {
-        EXPECT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+        EXPECT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                               &addr),
-                  MX_OK);
+                  ZX_OK);
     }
 
     // Unmap from the left
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], 2 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], 2 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1100, 4));
     // Unmap the rest
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0] + 2 * PAGE_SIZE, 2 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0] + 2 * PAGE_SIZE, 2 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000, 4));
 
     // Unmap from the right
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[1] + 2 * PAGE_SIZE, 2 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[1] + 2 * PAGE_SIZE, 2 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[1], 0b0011, 4));
     // Unmap the rest
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[1], 2 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[1], 2 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[1], 0b0000, 4));
 
     // Unmap from the center
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[2] + PAGE_SIZE, 2 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[2] + PAGE_SIZE, 2 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[2], 0b1001, 4));
     // Unmap the rest
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[2], PAGE_SIZE), MX_OK);
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[2] + 3 * PAGE_SIZE, PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[2], PAGE_SIZE), ZX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[2] + 3 * PAGE_SIZE, PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[2], 0b0000, 4));
 
-    mx_info_vmar_t info;
-    ASSERT_EQ(mx_object_get_info(vmar, MX_INFO_VMAR, &info, sizeof(info), NULL, NULL),
-              MX_OK);
+    zx_info_vmar_t info;
+    ASSERT_EQ(zx_object_get_info(vmar, ZX_INFO_VMAR, &info, sizeof(info), NULL, NULL),
+              ZX_OK);
 
     // Make sure we can map over these again
     for (uintptr_t addr : mapping_addr) {
         const size_t offset = addr - info.base;
-        EXPECT_EQ(mx_vmar_map(vmar, offset, vmo, 0, 4 * PAGE_SIZE,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+        EXPECT_EQ(zx_vmar_map(vmar, offset, vmo, 0, 4 * PAGE_SIZE,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                               &addr),
-                  MX_OK);
+                  ZX_OK);
         EXPECT_TRUE(check_pages_mapped(process, addr, 0b1111, 4));
-        EXPECT_EQ(mx_vmar_unmap(vmar, addr, 4 * PAGE_SIZE), MX_OK);
+        EXPECT_EQ(zx_vmar_unmap(vmar, addr, 4 * PAGE_SIZE), ZX_OK);
     }
 
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -1189,158 +1189,158 @@
 bool unmap_multiple_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
-    mx_handle_t subregion;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
+    zx_handle_t subregion;
     uintptr_t mapping_addr[3];
     uintptr_t subregion_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
     const size_t mapping_size = 4 * PAGE_SIZE;
-    ASSERT_EQ(mx_vmo_create(mapping_size, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(mapping_size, 0, &vmo), ZX_OK);
 
     // Create two mappings
     for (size_t i = 0; i < 2; ++i) {
-        ASSERT_EQ(mx_vmar_map(vmar, i * mapping_size, vmo, 0, mapping_size,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+        ASSERT_EQ(zx_vmar_map(vmar, i * mapping_size, vmo, 0, mapping_size,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                               &mapping_addr[i]),
-                  MX_OK);
+                  ZX_OK);
     }
     EXPECT_EQ(mapping_addr[0] + mapping_size, mapping_addr[1]);
     // Unmap from the right of the first and the left of the second
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0] + 2 * PAGE_SIZE, 3 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0] + 2 * PAGE_SIZE, 3 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1110'0011, 8), "");
     // Unmap the rest
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], 2 * PAGE_SIZE), MX_OK, "");
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[1] + 1 * PAGE_SIZE, 3 * PAGE_SIZE), MX_OK, "");
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], 2 * PAGE_SIZE), ZX_OK, "");
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[1] + 1 * PAGE_SIZE, 3 * PAGE_SIZE), ZX_OK, "");
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000, 8));
 
     // Create two mappings with a gap, and verify we can unmap them
     for (size_t i = 0; i < 2; ++i) {
-        ASSERT_EQ(mx_vmar_map(vmar, 2 * i * mapping_size, vmo, 0, mapping_size,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+        ASSERT_EQ(zx_vmar_map(vmar, 2 * i * mapping_size, vmo, 0, mapping_size,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                               &mapping_addr[i]),
-                  MX_OK);
+                  ZX_OK);
     }
     EXPECT_EQ(mapping_addr[0] + 2 * mapping_size, mapping_addr[1]);
     // Unmap all of the left one and some of the right one
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], 2 * mapping_size + PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], 2 * mapping_size + PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1110'0000'0000, 12));
     // Unmap the rest
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[1] + 1 * PAGE_SIZE, 3 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[1] + 1 * PAGE_SIZE, 3 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000'0000, 12));
 
     // Create two mappings with a subregion between, should be able to unmap
     // them (and destroy the subregion in the process).
     for (size_t i = 0; i < 2; ++i) {
-        ASSERT_EQ(mx_vmar_map(vmar, 2 * i * mapping_size, vmo, 0, mapping_size,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+        ASSERT_EQ(zx_vmar_map(vmar, 2 * i * mapping_size, vmo, 0, mapping_size,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                               &mapping_addr[i]),
-                  MX_OK);
+                  ZX_OK);
     }
-    ASSERT_EQ(mx_vmar_allocate(vmar, mapping_size, mapping_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_CAN_MAP_SPECIFIC | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_allocate(vmar, mapping_size, mapping_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_CAN_MAP_SPECIFIC | ZX_VM_FLAG_SPECIFIC,
                                &subregion, &subregion_addr),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(subregion, 0, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(subregion, 0, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(mapping_addr[0] + 2 * mapping_size, mapping_addr[1]);
     EXPECT_EQ(mapping_addr[0] + mapping_size, mapping_addr[2]);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1111'0001'1111, 12));
     // Unmap all of the left one and some of the right one
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], 2 * mapping_size + PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], 2 * mapping_size + PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1110'0000'0000, 12));
     // Try to map in the subregion again, should fail due to being destroyed
-    ASSERT_EQ(mx_vmar_map(subregion, PAGE_SIZE, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(subregion, PAGE_SIZE, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_ERR_BAD_STATE);
+              ZX_ERR_BAD_STATE);
     // Unmap the rest
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[1] + 1 * PAGE_SIZE, 3 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[1] + 1 * PAGE_SIZE, 3 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000'0000, 12));
-    EXPECT_EQ(mx_handle_close(subregion), MX_OK);
+    EXPECT_EQ(zx_handle_close(subregion), ZX_OK);
 
     // Create two mappings with a subregion after.  Partial unmap of the
     // subregion should fail, full unmap should succeed.
     for (size_t i = 0; i < 2; ++i) {
-        ASSERT_EQ(mx_vmar_map(vmar, i * mapping_size, vmo, 0, mapping_size,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+        ASSERT_EQ(zx_vmar_map(vmar, i * mapping_size, vmo, 0, mapping_size,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                               &mapping_addr[i]),
-                  MX_OK);
+                  ZX_OK);
     }
-    ASSERT_EQ(mx_vmar_allocate(vmar, 2 * mapping_size, mapping_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_CAN_MAP_SPECIFIC | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 2 * mapping_size, mapping_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_CAN_MAP_SPECIFIC | ZX_VM_FLAG_SPECIFIC,
                                &subregion, &subregion_addr),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(subregion, 0, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(subregion, 0, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(mapping_addr[0] + mapping_size, mapping_addr[1]);
     EXPECT_EQ(mapping_addr[0] + 2 * mapping_size, mapping_addr[2]);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0001'1111'1111, 12));
     // Unmap some of the left one through to all but the last page of the subregion
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0] + PAGE_SIZE, 3 * mapping_size - 2 * PAGE_SIZE),
-              MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0] + PAGE_SIZE, 3 * mapping_size - 2 * PAGE_SIZE),
+              ZX_ERR_INVALID_ARGS);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0001'1111'1111, 12));
     // Try again, but unmapping all of the subregion
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0] + PAGE_SIZE, 3 * mapping_size - PAGE_SIZE),
-              MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0] + PAGE_SIZE, 3 * mapping_size - PAGE_SIZE),
+              ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000'0001, 12));
     // Try to map in the subregion again, should fail due to being destroyed
-    ASSERT_EQ(mx_vmar_map(subregion, PAGE_SIZE, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(subregion, PAGE_SIZE, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_ERR_BAD_STATE);
+              ZX_ERR_BAD_STATE);
     // Unmap the rest
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000'0000, 12));
-    EXPECT_EQ(mx_handle_close(subregion), MX_OK);
+    EXPECT_EQ(zx_handle_close(subregion), ZX_OK);
 
     // Create two mappings with a subregion before.  Partial unmap of the
     // subregion should fail, full unmap should succeed.
     for (size_t i = 0; i < 2; ++i) {
-        ASSERT_EQ(mx_vmar_map(vmar, (i + 1) * mapping_size, vmo, 0, mapping_size,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+        ASSERT_EQ(zx_vmar_map(vmar, (i + 1) * mapping_size, vmo, 0, mapping_size,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                               &mapping_addr[i]),
-                  MX_OK);
+                  ZX_OK);
     }
-    ASSERT_EQ(mx_vmar_allocate(vmar, 0, mapping_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_CAN_MAP_SPECIFIC | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_allocate(vmar, 0, mapping_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_CAN_MAP_SPECIFIC | ZX_VM_FLAG_SPECIFIC,
                                &subregion, &subregion_addr),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(subregion, mapping_size - PAGE_SIZE, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(subregion, mapping_size - PAGE_SIZE, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(subregion_addr + mapping_size, mapping_addr[0]);
     EXPECT_EQ(subregion_addr + 2 * mapping_size, mapping_addr[1]);
     EXPECT_TRUE(check_pages_mapped(process, subregion_addr, 0b1111'1111'1000, 12));
     // Try to unmap everything except the first page of the subregion
-    EXPECT_EQ(mx_vmar_unmap(vmar, subregion_addr + PAGE_SIZE, 3 * mapping_size - PAGE_SIZE),
-              MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_unmap(vmar, subregion_addr + PAGE_SIZE, 3 * mapping_size - PAGE_SIZE),
+              ZX_ERR_INVALID_ARGS);
     EXPECT_TRUE(check_pages_mapped(process, subregion_addr, 0b1111'1111'1000, 12));
     // Try again, but unmapping all of the subregion
-    EXPECT_EQ(mx_vmar_unmap(vmar, subregion_addr, 3 * mapping_size), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, subregion_addr, 3 * mapping_size), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, subregion_addr, 0b0000'0000'0000, 12));
     // Try to map in the subregion again, should fail due to being destroyed
-    ASSERT_EQ(mx_vmar_map(subregion, PAGE_SIZE, vmo, 0, PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(subregion, PAGE_SIZE, vmo, 0, PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_ERR_BAD_STATE);
-    EXPECT_EQ(mx_handle_close(subregion), MX_OK);
+              ZX_ERR_BAD_STATE);
+    EXPECT_EQ(zx_handle_close(subregion), ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -1349,41 +1349,41 @@
 bool unmap_base_not_mapped_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
     uintptr_t mapping_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
     const size_t mapping_size = 4 * PAGE_SIZE;
-    ASSERT_EQ(mx_vmo_create(mapping_size, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(mapping_size, 0, &vmo), ZX_OK);
 
-    ASSERT_EQ(mx_vmar_map(vmar, PAGE_SIZE, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(vmar, PAGE_SIZE, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_unmap(vmar, mapping_addr - PAGE_SIZE, mapping_size + PAGE_SIZE),
-              MX_OK);
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_unmap(vmar, mapping_addr - PAGE_SIZE, mapping_size + PAGE_SIZE),
+              ZX_OK);
 
     // Try again, but this time with a mapping below where base is
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr),
-              MX_OK);
+              ZX_OK);
     for (size_t gap = PAGE_SIZE; gap < 3 * PAGE_SIZE; gap += PAGE_SIZE) {
-        ASSERT_EQ(mx_vmar_map(vmar, mapping_size + gap, vmo, 0, mapping_size,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+        ASSERT_EQ(zx_vmar_map(vmar, mapping_size + gap, vmo, 0, mapping_size,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                               &mapping_addr),
-                  MX_OK);
-        ASSERT_EQ(mx_vmar_unmap(vmar, mapping_addr - PAGE_SIZE, mapping_size + PAGE_SIZE),
-                  MX_OK);
+                  ZX_OK);
+        ASSERT_EQ(zx_vmar_unmap(vmar, mapping_addr - PAGE_SIZE, mapping_size + PAGE_SIZE),
+                  ZX_OK);
     }
 
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -1392,86 +1392,86 @@
 bool map_specific_overwrite_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo, vmo2;
-    mx_handle_t subregion;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo, vmo2;
+    zx_handle_t subregion;
     uintptr_t mapping_addr[2];
     uintptr_t subregion_addr;
     uint8_t buf[1];
     size_t len;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
     const size_t mapping_size = 4 * PAGE_SIZE;
-    ASSERT_EQ(mx_vmo_create(mapping_size * 2, 0, &vmo), MX_OK);
-    ASSERT_EQ(mx_vmo_create(mapping_size * 2, 0, &vmo2), MX_OK);
+    ASSERT_EQ(zx_vmo_create(mapping_size * 2, 0, &vmo), ZX_OK);
+    ASSERT_EQ(zx_vmo_create(mapping_size * 2, 0, &vmo2), ZX_OK);
 
     // Tag each page of the VMOs so we can identify which mappings are from
     // which.
     for (size_t i = 0; i < mapping_size / PAGE_SIZE; ++i) {
         buf[0] = 1;
-        ASSERT_EQ(mx_vmo_write(vmo, buf, i * PAGE_SIZE, 1, &len), MX_OK);
+        ASSERT_EQ(zx_vmo_write(vmo, buf, i * PAGE_SIZE, 1, &len), ZX_OK);
         buf[0] = 2;
-        ASSERT_EQ(mx_vmo_write(vmo2, buf, i * PAGE_SIZE, 1, &len), MX_OK);
+        ASSERT_EQ(zx_vmo_write(vmo2, buf, i * PAGE_SIZE, 1, &len), ZX_OK);
     }
 
     // Create a single mapping and overwrite it
-    ASSERT_EQ(mx_vmar_map(vmar, PAGE_SIZE, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(vmar, PAGE_SIZE, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[0]),
-              MX_OK);
+              ZX_OK);
     // Try over mapping with SPECIFIC but not SPECIFIC_OVERWRITE
-    EXPECT_EQ(mx_vmar_map(vmar, PAGE_SIZE, vmo2, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC, &mapping_addr[1]),
-              MX_ERR_NO_MEMORY);
+    EXPECT_EQ(zx_vmar_map(vmar, PAGE_SIZE, vmo2, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC, &mapping_addr[1]),
+              ZX_ERR_NO_MEMORY);
     // Try again with SPECIFIC_OVERWRITE
-    EXPECT_EQ(mx_vmar_map(vmar, PAGE_SIZE, vmo2, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC_OVERWRITE, &mapping_addr[1]),
-              MX_OK);
+    EXPECT_EQ(zx_vmar_map(vmar, PAGE_SIZE, vmo2, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC_OVERWRITE, &mapping_addr[1]),
+              ZX_OK);
     EXPECT_EQ(mapping_addr[0], mapping_addr[1]);
     for (size_t i = 0; i < mapping_size / PAGE_SIZE; ++i) {
-        EXPECT_EQ(mx_process_read_memory(process, mapping_addr[0] + i * PAGE_SIZE, buf, 1, &len),
-                  MX_OK);
+        EXPECT_EQ(zx_process_read_memory(process, mapping_addr[0] + i * PAGE_SIZE, buf, 1, &len),
+                  ZX_OK);
         EXPECT_EQ(buf[0], 2u);
     }
 
     // Overmap the middle of it
-    EXPECT_EQ(mx_vmar_map(vmar, 2 * PAGE_SIZE, vmo, 0, 2 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC_OVERWRITE, &mapping_addr[0]),
-              MX_OK);
+    EXPECT_EQ(zx_vmar_map(vmar, 2 * PAGE_SIZE, vmo, 0, 2 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC_OVERWRITE, &mapping_addr[0]),
+              ZX_OK);
     EXPECT_EQ(mapping_addr[0], mapping_addr[1] + PAGE_SIZE);
     for (size_t i = 0; i < mapping_size / PAGE_SIZE; ++i) {
-        EXPECT_EQ(mx_process_read_memory(process, mapping_addr[1] + i * PAGE_SIZE, buf, 1, &len),
-                  MX_OK);
+        EXPECT_EQ(zx_process_read_memory(process, mapping_addr[1] + i * PAGE_SIZE, buf, 1, &len),
+                  ZX_OK);
         EXPECT_EQ(buf[0], (i == 0 || i == 3) ? 2u : 1u);
     }
 
     // Create an adjacent sub-region, try to overmap it
-    ASSERT_EQ(mx_vmar_allocate(vmar, PAGE_SIZE + mapping_size, mapping_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_allocate(vmar, PAGE_SIZE + mapping_size, mapping_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_SPECIFIC,
                                &subregion, &subregion_addr),
-              MX_OK);
+              ZX_OK);
     EXPECT_EQ(subregion_addr, mapping_addr[1] + mapping_size);
-    EXPECT_EQ(mx_vmar_map(vmar, PAGE_SIZE, vmo2, 0, 2 * mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC_OVERWRITE, &mapping_addr[0]),
-              MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(zx_vmar_map(vmar, PAGE_SIZE, vmo2, 0, 2 * mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC_OVERWRITE, &mapping_addr[0]),
+              ZX_ERR_INVALID_ARGS);
     // Tear it all down
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[1], 2 * mapping_size),
-              MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[1], 2 * mapping_size),
+              ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(subregion), MX_OK);
+    EXPECT_EQ(zx_handle_close(subregion), ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo2), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo2), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -1480,60 +1480,60 @@
 bool protect_split_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo;
     uintptr_t mapping_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
 
-    ASSERT_EQ(mx_vmo_create(4 * PAGE_SIZE, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(4 * PAGE_SIZE, 0, &vmo), ZX_OK);
 
     // Protect from the left
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &mapping_addr),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, mapping_addr, 2 * PAGE_SIZE, MX_VM_FLAG_PERM_READ),
-              MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, mapping_addr, 2 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ),
+              ZX_OK);
     // TODO(teisenbe): Test to validate perms changed, need to export more debug
     // info
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr, 0b1111, 4));
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr, 4 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr, 4 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr, 0b0000, 4));
 
     // Protect from the right
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &mapping_addr),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, mapping_addr + 2 * PAGE_SIZE,
-                              2 * PAGE_SIZE, MX_VM_FLAG_PERM_READ),
-              MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, mapping_addr + 2 * PAGE_SIZE,
+                              2 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ),
+              ZX_OK);
     // TODO(teisenbe): Test to validate perms changed, need to export more debug
     // info
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr, 0b1111, 4));
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr, 4 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr, 4 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr, 0b0000, 4));
 
     // Protect from the center
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, 4 * PAGE_SIZE,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &mapping_addr),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, mapping_addr + PAGE_SIZE,
-                              2 * PAGE_SIZE, MX_VM_FLAG_PERM_READ),
-              MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, mapping_addr + PAGE_SIZE,
+                              2 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ),
+              ZX_OK);
     // TODO(teisenbe): Test to validate perms changed, need to export more debug
     // info
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr, 0b1111, 4));
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr, 4 * PAGE_SIZE), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr, 4 * PAGE_SIZE), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr, 0b0000, 4));
 
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -1543,139 +1543,139 @@
 bool protect_multiple_test() {
     BEGIN_TEST;
 
-    mx_handle_t process;
-    mx_handle_t vmar;
-    mx_handle_t vmo, vmo2;
-    mx_handle_t subregion;
+    zx_handle_t process;
+    zx_handle_t vmar;
+    zx_handle_t vmo, vmo2;
+    zx_handle_t subregion;
     uintptr_t mapping_addr[3];
     uintptr_t subregion_addr;
 
-    ASSERT_EQ(mx_process_create(mx_job_default(), kProcessName, sizeof(kProcessName) - 1,
-                                0, &process, &vmar), MX_OK);
+    ASSERT_EQ(zx_process_create(zx_job_default(), kProcessName, sizeof(kProcessName) - 1,
+                                0, &process, &vmar), ZX_OK);
     const size_t mapping_size = 4 * PAGE_SIZE;
-    ASSERT_EQ(mx_vmo_create(mapping_size, 0, &vmo), MX_OK);
-    ASSERT_EQ(mx_handle_duplicate(vmo, MX_RIGHT_MAP | MX_RIGHT_READ, &vmo2), MX_OK);
+    ASSERT_EQ(zx_vmo_create(mapping_size, 0, &vmo), ZX_OK);
+    ASSERT_EQ(zx_handle_duplicate(vmo, ZX_RIGHT_MAP | ZX_RIGHT_READ, &vmo2), ZX_OK);
 
     // Protect from the right on the first mapping, all of the second mapping,
     // and from the left on the third mapping.
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[0]),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(vmar, mapping_size, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(vmar, mapping_size, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[1]),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
-                              3 * mapping_size - 2 * PAGE_SIZE, MX_VM_FLAG_PERM_READ),
-              MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
+                              3 * mapping_size - 2 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ),
+              ZX_OK);
     // TODO(teisenbe): Test to validate perms changed, need to export more debug
     // info
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1111'1111'1111, 12));
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000'0000, 12));
 
     // Same thing, but map middle region with a VMO without the WRITE right
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[0]),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(vmar, mapping_size, vmo2, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(vmar, mapping_size, vmo2, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[1]),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
                               3 * mapping_size - 2 * PAGE_SIZE,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE),
-              MX_ERR_ACCESS_DENIED);
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE),
+              ZX_ERR_ACCESS_DENIED);
     // TODO(teisenbe): Test to validate no perms changed, need to export more debug
     // info
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1111'1111'1111, 12));
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000'0000, 12));
 
     // Try to protect across a gap
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[0]),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
-                              3 * mapping_size - 2 * PAGE_SIZE, MX_VM_FLAG_PERM_READ),
-              MX_ERR_NOT_FOUND);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
+                              3 * mapping_size - 2 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ),
+              ZX_ERR_NOT_FOUND);
     // TODO(teisenbe): Test to validate no perms changed, need to export more debug
     // info
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1111'0000'1111, 12));
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000'0000, 12));
 
     // Try to protect across an empty subregion
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[0]),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_allocate(vmar, mapping_size, mapping_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_allocate(vmar, mapping_size, mapping_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_SPECIFIC,
                                &subregion, &subregion_addr),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
-                              3 * mapping_size - 2 * PAGE_SIZE, MX_VM_FLAG_PERM_READ),
-              MX_ERR_INVALID_ARGS);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
+                              3 * mapping_size - 2 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ),
+              ZX_ERR_INVALID_ARGS);
     // TODO(teisenbe): Test to validate no perms changed, need to export more debug
     // info
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1111'0000'1111, 12));
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000'0000, 12));
-    EXPECT_EQ(mx_handle_close(subregion), MX_OK);
+    EXPECT_EQ(zx_handle_close(subregion), ZX_OK);
 
     // Try to protect across a subregion filled with mappings
-    ASSERT_EQ(mx_vmar_map(vmar, 0, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+    ASSERT_EQ(zx_vmar_map(vmar, 0, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[0]),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_allocate(vmar, mapping_size, mapping_size,
-                               MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE |
-                               MX_VM_FLAG_SPECIFIC | MX_VM_FLAG_CAN_MAP_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_allocate(vmar, mapping_size, mapping_size,
+                               ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE |
+                               ZX_VM_FLAG_SPECIFIC | ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                &subregion, &subregion_addr),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(subregion, 0, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(subregion, 0, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[1]),
-              MX_OK);
-    ASSERT_EQ(mx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_SPECIFIC,
+              ZX_OK);
+    ASSERT_EQ(zx_vmar_map(vmar, 2 * mapping_size, vmo, 0, mapping_size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_SPECIFIC,
                           &mapping_addr[2]),
-              MX_OK);
-    EXPECT_EQ(mx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
-                              3 * mapping_size - 2 * PAGE_SIZE, MX_VM_FLAG_PERM_READ),
-              MX_ERR_INVALID_ARGS);
+              ZX_OK);
+    EXPECT_EQ(zx_vmar_protect(vmar, mapping_addr[0] + PAGE_SIZE,
+                              3 * mapping_size - 2 * PAGE_SIZE, ZX_VM_FLAG_PERM_READ),
+              ZX_ERR_INVALID_ARGS);
     // TODO(teisenbe): Test to validate no perms changed, need to export more debug
     // info
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b1111'1111'1111, 12));
-    EXPECT_EQ(mx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(vmar, mapping_addr[0], 3 * mapping_size), ZX_OK);
     EXPECT_TRUE(check_pages_mapped(process, mapping_addr[0], 0b0000'0000'0000, 12));
-    EXPECT_EQ(mx_handle_close(subregion), MX_OK);
+    EXPECT_EQ(zx_handle_close(subregion), ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo2), MX_OK);
-    EXPECT_EQ(mx_handle_close(vmar), MX_OK);
-    EXPECT_EQ(mx_handle_close(process), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo2), ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmar), ZX_OK);
+    EXPECT_EQ(zx_handle_close(process), ZX_OK);
 
     END_TEST;
 }
@@ -1684,18 +1684,18 @@
 bool protect_over_demand_paged_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     const size_t size = 100 * PAGE_SIZE;
-    ASSERT_EQ(mx_vmo_create(size, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(size, 0, &vmo), ZX_OK);
 
     // TODO(teisenbe): Move this into a separate process; currently we don't
     // have an easy way to run a small test routine in another process.
     uintptr_t mapping_addr;
-    ASSERT_EQ(mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    ASSERT_EQ(zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &mapping_addr),
-              MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
 
     fbl::atomic_uint8_t* target =
         reinterpret_cast<fbl::atomic_uint8_t*>(mapping_addr);
@@ -1703,22 +1703,22 @@
     target[size / 2].store(6);
     target[size - 1].store(7);
 
-    ASSERT_EQ(mx_vmar_protect(mx_vmar_root_self(), mapping_addr, size,
-                              MX_VM_FLAG_PERM_READ),
-              MX_OK);
+    ASSERT_EQ(zx_vmar_protect(zx_vmar_root_self(), mapping_addr, size,
+                              ZX_VM_FLAG_PERM_READ),
+              ZX_OK);
 
     // Attempt to write to the mapping again
     bool success;
-    EXPECT_EQ(test_local_address(mapping_addr, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
-    EXPECT_EQ(test_local_address(mapping_addr + size / 4, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr + size / 4, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
-    EXPECT_EQ(test_local_address(mapping_addr + size / 2, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr + size / 2, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
-    EXPECT_EQ(test_local_address(mapping_addr + size - 1, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr + size - 1, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
 
-    EXPECT_EQ(mx_vmar_unmap(mx_vmar_root_self(), mapping_addr, size), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(zx_vmar_root_self(), mapping_addr, size), ZX_OK);
 
     END_TEST;
 }
@@ -1727,19 +1727,19 @@
 bool protect_large_uncommitted_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     // Create a 1GB VMO
     const size_t size = 1ull << 30;
-    ASSERT_EQ(mx_vmo_create(size, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(size, 0, &vmo), ZX_OK);
 
     // TODO(teisenbe): Move this into a separate process; currently we don't
     // have an easy way to run a small test routine in another process.
     uintptr_t mapping_addr;
-    ASSERT_EQ(mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    ASSERT_EQ(zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &mapping_addr),
-              MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
 
     // Make sure some pages exist
     fbl::atomic_uint8_t* target =
@@ -1752,22 +1752,22 @@
     // TODO(teisenbe): Would be nice for this to be more arch aware.
     const uintptr_t base = ROUNDUP(mapping_addr, 512 * PAGE_SIZE) + PAGE_SIZE;
     const size_t protect_size = mapping_addr + size - base;
-    ASSERT_EQ(mx_vmar_protect(mx_vmar_root_self(), base, protect_size,
-                              MX_VM_FLAG_PERM_READ),
-              MX_OK);
+    ASSERT_EQ(zx_vmar_protect(zx_vmar_root_self(), base, protect_size,
+                              ZX_VM_FLAG_PERM_READ),
+              ZX_OK);
 
     // Attempt to write to the mapping again
     bool success;
-    EXPECT_EQ(test_local_address(mapping_addr, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr, true, &success), ZX_OK);
     EXPECT_TRUE(success, "mapping should still be writeable");
-    EXPECT_EQ(test_local_address(mapping_addr + size / 4, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr + size / 4, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
-    EXPECT_EQ(test_local_address(mapping_addr + size / 2, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr + size / 2, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
-    EXPECT_EQ(test_local_address(mapping_addr + size - 1, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr + size - 1, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
 
-    EXPECT_EQ(mx_vmar_unmap(mx_vmar_root_self(), mapping_addr, size), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(zx_vmar_root_self(), mapping_addr, size), ZX_OK);
 
     END_TEST;
 }
@@ -1776,19 +1776,19 @@
 bool unmap_large_uncommitted_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     // Create a 1GB VMO
     const size_t size = 1ull << 30;
-    ASSERT_EQ(mx_vmo_create(size, 0, &vmo), MX_OK);
+    ASSERT_EQ(zx_vmo_create(size, 0, &vmo), ZX_OK);
 
     // TODO(teisenbe): Move this into a separate process; currently we don't
     // have an easy way to run a small test routine in another process.
     uintptr_t mapping_addr;
-    ASSERT_EQ(mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size,
-                          MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+    ASSERT_EQ(zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size,
+                          ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                           &mapping_addr),
-              MX_OK);
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
+              ZX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
 
     // Make sure some pages exist
     fbl::atomic_uint8_t* target =
@@ -1801,20 +1801,20 @@
     // TODO(teisenbe): Would be nice for this to be more arch aware.
     const uintptr_t base = ROUNDUP(mapping_addr, 512 * PAGE_SIZE) + PAGE_SIZE;
     const size_t unmap_size = mapping_addr + size - base;
-    ASSERT_EQ(mx_vmar_unmap(mx_vmar_root_self(), base, unmap_size), MX_OK);
+    ASSERT_EQ(zx_vmar_unmap(zx_vmar_root_self(), base, unmap_size), ZX_OK);
 
     // Attempt to write to the mapping again
     bool success;
-    EXPECT_EQ(test_local_address(mapping_addr, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr, true, &success), ZX_OK);
     EXPECT_TRUE(success, "mapping should still be writeable");
-    EXPECT_EQ(test_local_address(mapping_addr + size / 4, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr + size / 4, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
-    EXPECT_EQ(test_local_address(mapping_addr + size / 2, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr + size / 2, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
-    EXPECT_EQ(test_local_address(mapping_addr + size - 1, true, &success), MX_OK);
+    EXPECT_EQ(test_local_address(mapping_addr + size - 1, true, &success), ZX_OK);
     EXPECT_FALSE(success, "mapping should no longer be writeable");
 
-    EXPECT_EQ(mx_vmar_unmap(mx_vmar_root_self(), mapping_addr, size), MX_OK);
+    EXPECT_EQ(zx_vmar_unmap(zx_vmar_root_self(), mapping_addr, size), ZX_OK);
 
     END_TEST;
 }
diff --git a/system/utest/core/vmo-signal/rules.mk b/system/utest/core/vmo-signal/rules.mk
index b824692..864949b 100644
--- a/system/utest/core/vmo-signal/rules.mk
+++ b/system/utest/core/vmo-signal/rules.mk
@@ -16,6 +16,6 @@
 MODULE_NAME := vmo-signal-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/core/vmo-signal/vmo-signal.c b/system/utest/core/vmo-signal/vmo-signal.c
index 091c540..88b1630 100644
--- a/system/utest/core/vmo-signal/vmo-signal.c
+++ b/system/utest/core/vmo-signal/vmo-signal.c
@@ -5,8 +5,8 @@
 #include <assert.h>
 #include <stdbool.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 
 #include <unittest/unittest.h>
 
@@ -14,22 +14,22 @@
 bool vmo_signal_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t vmo = MX_HANDLE_INVALID;
-    ASSERT_EQ(mx_vmo_create(4096, 0, &vmo), MX_OK, "");
-    ASSERT_NE(vmo, MX_HANDLE_INVALID, "mx_vmo_create() failed");
+    zx_handle_t vmo = ZX_HANDLE_INVALID;
+    ASSERT_EQ(zx_vmo_create(4096, 0, &vmo), ZX_OK, "");
+    ASSERT_NE(vmo, ZX_HANDLE_INVALID, "zx_vmo_create() failed");
 
-    mx_signals_t out_signals = 0;
-    ASSERT_EQ(mx_object_wait_one(vmo, MX_USER_SIGNAL_0, mx_deadline_after(1), &out_signals),
-              MX_ERR_TIMED_OUT, "");
-    ASSERT_EQ(out_signals, MX_SIGNAL_LAST_HANDLE, "out_signals not zero after wait timed out");
-    ASSERT_EQ(mx_object_signal(vmo, 0, MX_USER_SIGNAL_0), MX_OK, "");
+    zx_signals_t out_signals = 0;
+    ASSERT_EQ(zx_object_wait_one(vmo, ZX_USER_SIGNAL_0, zx_deadline_after(1), &out_signals),
+              ZX_ERR_TIMED_OUT, "");
+    ASSERT_EQ(out_signals, ZX_SIGNAL_LAST_HANDLE, "out_signals not zero after wait timed out");
+    ASSERT_EQ(zx_object_signal(vmo, 0, ZX_USER_SIGNAL_0), ZX_OK, "");
     ASSERT_EQ(
-        mx_object_wait_one(vmo, MX_USER_SIGNAL_0, MX_TIME_INFINITE, &out_signals), MX_OK, "");
+        zx_object_wait_one(vmo, ZX_USER_SIGNAL_0, ZX_TIME_INFINITE, &out_signals), ZX_OK, "");
     ASSERT_EQ(
-        out_signals, MX_USER_SIGNAL_0 | MX_SIGNAL_LAST_HANDLE,
-        "MX_USER_SIGNAL_0 not set after successful wait");
+        out_signals, ZX_USER_SIGNAL_0 | ZX_SIGNAL_LAST_HANDLE,
+        "ZX_USER_SIGNAL_0 not set after successful wait");
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK, "");
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK, "");
 
     END_TEST;
 }
diff --git a/system/utest/cprng/cprng.c b/system/utest/cprng/cprng.c
index ad1a8a5..983e548 100644
--- a/system/utest/cprng/cprng.c
+++ b/system/utest/cprng/cprng.c
@@ -6,33 +6,33 @@
 #include <stdlib.h>
 #include <time.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 bool cprng_test_draw_buf_too_large(void) {
-    uint8_t buf[MX_CPRNG_DRAW_MAX_LEN + 1];
+    uint8_t buf[ZX_CPRNG_DRAW_MAX_LEN + 1];
     BEGIN_TEST;
     size_t sz;
-    mx_status_t status = mx_cprng_draw(buf, sizeof(buf), &sz);
-    EXPECT_EQ(status, MX_ERR_INVALID_ARGS, "");
+    zx_status_t status = zx_cprng_draw(buf, sizeof(buf), &sz);
+    EXPECT_EQ(status, ZX_ERR_INVALID_ARGS, "");
     END_TEST;
 }
 
 bool cprng_test_draw_bad_buf(void) {
-    uint8_t buf[MX_CPRNG_DRAW_MAX_LEN];
+    uint8_t buf[ZX_CPRNG_DRAW_MAX_LEN];
     BEGIN_TEST;
     size_t sz;
-    mx_status_t status = mx_cprng_draw((void*)4, sizeof(buf), &sz);
-    EXPECT_EQ(status, MX_ERR_INVALID_ARGS, "");
+    zx_status_t status = zx_cprng_draw((void*)4, sizeof(buf), &sz);
+    EXPECT_EQ(status, ZX_ERR_INVALID_ARGS, "");
     END_TEST;
 }
 
 bool cprng_test_draw_success(void) {
-    uint8_t buf[MX_CPRNG_DRAW_MAX_LEN] = { 0 };
+    uint8_t buf[ZX_CPRNG_DRAW_MAX_LEN] = { 0 };
     BEGIN_TEST;
     size_t sz;
-    mx_status_t status = mx_cprng_draw(buf, sizeof(buf), &sz);
-    EXPECT_EQ(status, MX_OK, "");
+    zx_status_t status = zx_cprng_draw(buf, sizeof(buf), &sz);
+    EXPECT_EQ(status, ZX_OK, "");
     EXPECT_EQ(sz, sizeof(buf), "");
 
     int num_zeros = 0;
@@ -48,18 +48,18 @@
 }
 
 bool cprng_test_add_entropy_bad_buf(void) {
-    uint8_t buf[MX_CPRNG_ADD_ENTROPY_MAX_LEN];
+    uint8_t buf[ZX_CPRNG_ADD_ENTROPY_MAX_LEN];
     BEGIN_TEST;
-    mx_status_t status = mx_cprng_add_entropy((void*)4, sizeof(buf));
-    EXPECT_EQ(status, MX_ERR_INVALID_ARGS, "");
+    zx_status_t status = zx_cprng_add_entropy((void*)4, sizeof(buf));
+    EXPECT_EQ(status, ZX_ERR_INVALID_ARGS, "");
     END_TEST;
 }
 
 bool cprng_test_add_entropy_buf_too_large(void) {
-    uint8_t buf[MX_CPRNG_ADD_ENTROPY_MAX_LEN + 1];
+    uint8_t buf[ZX_CPRNG_ADD_ENTROPY_MAX_LEN + 1];
     BEGIN_TEST;
-    mx_status_t status = mx_cprng_add_entropy(buf, sizeof(buf));
-    EXPECT_EQ(status, MX_ERR_INVALID_ARGS, "");
+    zx_status_t status = zx_cprng_add_entropy(buf, sizeof(buf));
+    EXPECT_EQ(status, ZX_ERR_INVALID_ARGS, "");
     END_TEST;
 }
 
diff --git a/system/utest/cprng/rules.mk b/system/utest/cprng/rules.mk
index ddd36d8..ec34d3c 100644
--- a/system/utest/cprng/rules.mk
+++ b/system/utest/cprng/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := cprng-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/crashlogger/crashlogger-test.cpp b/system/utest/crashlogger/crashlogger-test.cpp
index e6f6bef..b860983 100644
--- a/system/utest/crashlogger/crashlogger-test.cpp
+++ b/system/utest/crashlogger/crashlogger-test.cpp
@@ -6,8 +6,8 @@
 #include <regex.h>
 #include <unistd.h>
 
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 #include <fbl/unique_ptr.h>
 #include <launchpad/launchpad.h>
@@ -86,18 +86,18 @@
 
     // Make sure we bind an exception port to the process before we start
     // it running.
-    mx_handle_t crasher_proc = launchpad_get_process_handle(crasher_lp);
-    mx_handle_t exception_port;
-    ASSERT_EQ(mx_port_create(0, &exception_port), MX_OK);
-    ASSERT_EQ(mx_task_bind_exception_port(crasher_proc, exception_port,
-                                          kSysExceptionKey, 0), MX_OK);
+    zx_handle_t crasher_proc = launchpad_get_process_handle(crasher_lp);
+    zx_handle_t exception_port;
+    ASSERT_EQ(zx_port_create(0, &exception_port), ZX_OK);
+    ASSERT_EQ(zx_task_bind_exception_port(crasher_proc, exception_port,
+                                          kSysExceptionKey, 0), ZX_OK);
 
     // Launch the crasher process.
     launchpad_load_from_file(crasher_lp, argv[0]);
     launchpad_clone(crasher_lp, LP_CLONE_ALL);
     launchpad_set_args(crasher_lp, fbl::count_of(argv), argv);
     const char* errmsg;
-    ASSERT_EQ(launchpad_go(crasher_lp, &crasher_proc, &errmsg), MX_OK);
+    ASSERT_EQ(launchpad_go(crasher_lp, &crasher_proc, &errmsg), ZX_OK);
 
     // Launch a test instance of crashlogger.
     const char* crashlogger_argv[] = { "/boot/bin/crashlogger" };
@@ -107,14 +107,14 @@
     launchpad_clone(crasher_lp, LP_CLONE_ALL);
     launchpad_set_args(crashlogger_lp, fbl::count_of(crashlogger_argv),
                        crashlogger_argv);
-    mx_handle_t handles[] = { exception_port };
+    zx_handle_t handles[] = { exception_port };
     uint32_t handle_types[] = { PA_HND(PA_USER0, 0) };
     launchpad_add_handles(crashlogger_lp, fbl::count_of(handles), handles,
                           handle_types);
     int pipe_fd;
     launchpad_add_pipe(crashlogger_lp, &pipe_fd, STDOUT_FILENO);
-    mx_handle_t crashlogger_proc;
-    ASSERT_EQ(launchpad_go(crashlogger_lp, &crashlogger_proc, &errmsg), MX_OK);
+    zx_handle_t crashlogger_proc;
+    ASSERT_EQ(launchpad_go(crashlogger_lp, &crashlogger_proc, &errmsg), ZX_OK);
 
     // Read crashlogger's output into a buffer.  Stop reading when we get
     // an end-of-backtrace line which matches the following regular
@@ -144,13 +144,13 @@
     ASSERT_TRUE(overall_regex.Matches(output.get()));
 
     // Clean up.
-    ASSERT_EQ(mx_object_wait_one(crasher_proc, MX_PROCESS_TERMINATED,
-                                 MX_TIME_INFINITE, NULL), MX_OK);
-    ASSERT_EQ(mx_handle_close(crasher_proc), MX_OK);
-    ASSERT_EQ(mx_task_kill(crashlogger_proc), MX_OK);
-    ASSERT_EQ(mx_object_wait_one(crashlogger_proc, MX_PROCESS_TERMINATED,
-                                 MX_TIME_INFINITE, NULL), MX_OK);
-    ASSERT_EQ(mx_handle_close(crashlogger_proc), MX_OK);
+    ASSERT_EQ(zx_object_wait_one(crasher_proc, ZX_PROCESS_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL), ZX_OK);
+    ASSERT_EQ(zx_handle_close(crasher_proc), ZX_OK);
+    ASSERT_EQ(zx_task_kill(crashlogger_proc), ZX_OK);
+    ASSERT_EQ(zx_object_wait_one(crashlogger_proc, ZX_PROCESS_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL), ZX_OK);
+    ASSERT_EQ(zx_handle_close(crashlogger_proc), ZX_OK);
     return true;
 }
 
diff --git a/system/utest/crashlogger/rules.mk b/system/utest/crashlogger/rules.mk
index c913d1e..bd58147 100644
--- a/system/utest/crashlogger/rules.mk
+++ b/system/utest/crashlogger/rules.mk
@@ -14,14 +14,14 @@
 MODULE_NAME := crashlogger-test
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/launchpad \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/ctor/dso-ctor/rules.mk b/system/utest/ctor/dso-ctor/rules.mk
index fca1103..9fb4cc7 100644
--- a/system/utest/ctor/dso-ctor/rules.mk
+++ b/system/utest/ctor/dso-ctor/rules.mk
@@ -12,7 +12,7 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/dso-ctor.cpp
 
-MODULE_STATIC_LIBS := system/ulib/mxcpp
+MODULE_STATIC_LIBS := system/ulib/zxcpp
 MODULE_LIBS := system/ulib/unittest system/ulib/c
 
 MODULE_SO_NAME := dso-ctor
diff --git a/system/utest/ctor/rules.mk b/system/utest/ctor/rules.mk
index cde7197..e614e07 100644
--- a/system/utest/ctor/rules.mk
+++ b/system/utest/ctor/rules.mk
@@ -13,8 +13,8 @@
 
 MODULE_NAME := ctor-test
 
-MODULE_STATIC_LIBS := system/ulib/mxcpp
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/c
+MODULE_STATIC_LIBS := system/ulib/zxcpp
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/c
 MODULE_LIBS += system/utest/ctor/dso-ctor
 
 include make/module.mk
diff --git a/system/utest/debugger/debugger.c b/system/utest/debugger/debugger.c
index 2d8d8d8..bf68d90 100644
--- a/system/utest/debugger/debugger.c
+++ b/system/utest/debugger/debugger.c
@@ -11,27 +11,27 @@
 
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
-#include <magenta/crashlogger.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/debug.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/crashlogger.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/debug.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/syscalls/port.h>
 #include <test-utils/test-utils.h>
 #include <unittest/unittest.h>
 
 #include "utils.h"
 
-typedef bool (wait_inferior_exception_handler_t)(mx_handle_t inferior,
-                                                 const mx_port_packet_t* packet,
+typedef bool (wait_inferior_exception_handler_t)(zx_handle_t inferior,
+                                                 const zx_port_packet_t* packet,
                                                  void* handler_arg);
 
 // Sleep interval in the watchdog thread. Make this short so we don't need to
 // wait too long when tearing down in the success case.  This is especially
 // helpful when running "while /boot/test/debugger-test; do true; done".
-#define WATCHDOG_DURATION_TICK ((int64_t)MX_MSEC(30))  // 0.03 seconds
+#define WATCHDOG_DURATION_TICK ((int64_t)ZX_MSEC(30))  // 0.03 seconds
 
 // Number of sleep intervals until the watchdog fires.
 #define WATCHDOG_DURATION_TICKS 100  // 3 seconds
@@ -65,16 +65,16 @@
 
 static atomic_int extra_thread_count = ATOMIC_VAR_INIT(0);
 
-static void test_memory_ops(mx_handle_t inferior, mx_handle_t thread)
+static void test_memory_ops(zx_handle_t inferior, zx_handle_t thread)
 {
     uint64_t test_data_addr = 0;
     uint8_t test_data[TEST_MEMORY_SIZE];
 
 #ifdef __x86_64__
-    test_data_addr = get_uint64_register(thread, offsetof(mx_x86_64_general_regs_t, r9));
+    test_data_addr = get_uint64_register(thread, offsetof(zx_x86_64_general_regs_t, r9));
 #endif
 #ifdef __aarch64__
-    test_data_addr = get_uint64_register(thread, offsetof(mx_arm64_general_regs_t, r[9]));
+    test_data_addr = get_uint64_register(thread, offsetof(zx_arm64_general_regs_t, r[9]));
 #endif
 
     size_t size = read_inferior_memory(inferior, test_data_addr, test_data, sizeof(test_data));
@@ -93,40 +93,40 @@
     // Note: Verification of the write is done in the inferior.
 }
 
-static void fix_inferior_segv(mx_handle_t thread)
+static void fix_inferior_segv(zx_handle_t thread)
 {
     unittest_printf("Fixing inferior segv\n");
 
 #ifdef __x86_64__
     // The segv was because r8 == 0, change it to a usable value.
     // See test_prep_and_segv.
-    uint64_t rsp = get_uint64_register(thread, offsetof(mx_x86_64_general_regs_t, rsp));
-    set_uint64_register(thread, offsetof(mx_x86_64_general_regs_t, r8), rsp);
+    uint64_t rsp = get_uint64_register(thread, offsetof(zx_x86_64_general_regs_t, rsp));
+    set_uint64_register(thread, offsetof(zx_x86_64_general_regs_t, r8), rsp);
 #endif
 
 #ifdef __aarch64__
     // The segv was because r8 == 0, change it to a usable value.
     // See test_prep_and_segv.
-    uint64_t sp = get_uint64_register(thread, offsetof(mx_arm64_general_regs_t, sp));
-    set_uint64_register(thread, offsetof(mx_arm64_general_regs_t, r[8]), sp);
+    uint64_t sp = get_uint64_register(thread, offsetof(zx_arm64_general_regs_t, sp));
+    set_uint64_register(thread, offsetof(zx_arm64_general_regs_t, r[8]), sp);
 #endif
 }
 
-static bool test_segv_pc(mx_handle_t thread)
+static bool test_segv_pc(zx_handle_t thread)
 {
 #ifdef __x86_64__
     uint64_t pc = get_uint64_register(
-        thread, offsetof(mx_x86_64_general_regs_t, rip));
+        thread, offsetof(zx_x86_64_general_regs_t, rip));
     uint64_t r10 = get_uint64_register(
-        thread, offsetof(mx_x86_64_general_regs_t, r10));
+        thread, offsetof(zx_x86_64_general_regs_t, r10));
     ASSERT_EQ(pc, r10, "fault PC does not match r10");
 #endif
 
 #ifdef __aarch64__
     uint64_t pc = get_uint64_register(
-        thread, offsetof(mx_arm64_general_regs_t, pc));
+        thread, offsetof(zx_arm64_general_regs_t, pc));
     uint64_t x10 = get_uint64_register(
-        thread, offsetof(mx_arm64_general_regs_t, r[10]));
+        thread, offsetof(zx_arm64_general_regs_t, r[10]));
     ASSERT_EQ(pc, x10, "fault PC does not match x10");
 #endif
 
@@ -138,18 +138,18 @@
 // Returns false if a test fails.
 // Otherwise waits for the inferior to exit and returns true.
 
-static bool wait_inferior_thread_worker(mx_handle_t inferior,
-                                        mx_handle_t eport,
+static bool wait_inferior_thread_worker(zx_handle_t inferior,
+                                        zx_handle_t eport,
                                         wait_inferior_exception_handler_t* handler,
                                         void* handler_arg)
 {
     while (true) {
-        mx_port_packet_t packet;
+        zx_port_packet_t packet;
         if (!read_exception(eport, inferior, &packet))
             return false;
 
         // Is the inferior gone?
-        if (packet.type == MX_EXCP_GONE && packet.exception.tid == 0) {
+        if (packet.type == ZX_EXCP_GONE && packet.exception.tid == 0) {
             unittest_printf("wait-inf: inferior gone\n");
             return true;
         }
@@ -160,8 +160,8 @@
 }
 
 typedef struct {
-    mx_handle_t inferior;
-    mx_handle_t eport;
+    zx_handle_t inferior;
+    zx_handle_t eport;
     wait_inferior_exception_handler_t* handler;
     void* handler_arg;
 } wait_inf_args_t;
@@ -169,8 +169,8 @@
 static int wait_inferior_thread_func(void* arg)
 {
     wait_inf_args_t* args = arg;
-    mx_handle_t inferior = args->inferior;
-    mx_handle_t eport = args->eport;
+    zx_handle_t inferior = args->inferior;
+    zx_handle_t eport = args->eport;
     wait_inferior_exception_handler_t* handler = args->handler;
     void* handler_arg = args->handler_arg;
     free(args);
@@ -182,7 +182,7 @@
 static int watchdog_thread_func(void* arg)
 {
     for (int i = 0; i < WATCHDOG_DURATION_TICKS; ++i) {
-        mx_nanosleep(mx_deadline_after(WATCHDOG_DURATION_TICK));
+        zx_nanosleep(zx_deadline_after(WATCHDOG_DURATION_TICK));
         if (atomic_load(&done_tests))
             return 0;
     }
@@ -193,12 +193,12 @@
     exit(5);
 }
 
-static thrd_t start_wait_inf_thread(mx_handle_t inferior,
-                                    mx_handle_t* out_eport,
+static thrd_t start_wait_inf_thread(zx_handle_t inferior,
+                                    zx_handle_t* out_eport,
                                     wait_inferior_exception_handler_t* handler,
                                     void* handler_arg)
 {
-    mx_handle_t eport = attach_inferior(inferior);
+    zx_handle_t eport = attach_inferior(inferior);
     wait_inf_args_t* args = calloc(1, sizeof(*args));
 
     // Both handles are loaned to the thread. The caller of this function
@@ -226,12 +226,12 @@
 }
 
 static bool expect_debugger_attached_eq(
-        mx_handle_t inferior, bool expected, const char* msg)
+        zx_handle_t inferior, bool expected, const char* msg)
 {
-    mx_info_process_t info;
-    // MX_ASSERT returns false if the check fails.
-    ASSERT_EQ(mx_object_get_info(
-            inferior, MX_INFO_PROCESS, &info, sizeof(info), NULL, NULL), MX_OK, "");
+    zx_info_process_t info;
+    // ZX_ASSERT returns false if the check fails.
+    ASSERT_EQ(zx_object_get_info(
+            inferior, ZX_INFO_PROCESS, &info, sizeof(info), NULL, NULL), ZX_OK, "");
     ASSERT_EQ(info.debugger_attached, expected, msg);
     return true;
 }
@@ -239,33 +239,33 @@
 // This returns a bool as it's a unittest "helper" routine.
 // N.B. This runs on the wait-inferior thread.
 
-static bool handle_thread_exiting(mx_handle_t inferior,
-                                  const mx_port_packet_t* packet)
+static bool handle_thread_exiting(zx_handle_t inferior,
+                                  const zx_port_packet_t* packet)
 {
     BEGIN_HELPER;
 
-    mx_koid_t tid = packet->exception.tid;
-    mx_handle_t thread;
-    mx_status_t status = mx_object_get_child(inferior, tid, MX_RIGHT_SAME_RIGHTS, &thread);
+    zx_koid_t tid = packet->exception.tid;
+    zx_handle_t thread;
+    zx_status_t status = zx_object_get_child(inferior, tid, ZX_RIGHT_SAME_RIGHTS, &thread);
     // If the process has exited then the kernel may have reaped the
     // thread already. Check.
-    if (status != MX_ERR_NOT_FOUND) {
-        mx_info_thread_t info = tu_thread_get_info(thread);
+    if (status != ZX_ERR_NOT_FOUND) {
+        zx_info_thread_t info = tu_thread_get_info(thread);
         // The thread could still transition to DEAD here (if the
         // process exits), so check for either DYING or DEAD.
-        EXPECT_TRUE(info.state == MX_THREAD_STATE_DYING ||
-                    info.state == MX_THREAD_STATE_DEAD, "");
+        EXPECT_TRUE(info.state == ZX_THREAD_STATE_DYING ||
+                    info.state == ZX_THREAD_STATE_DEAD, "");
         // If the state is DYING it would be nice to check that the
         // value of |info.wait_exception_port_type| is DEBUGGER. Alas
         // if the process has exited then the thread will get
         // THREAD_SIGNAL_KILL which will cause
         // UserThread::ExceptionHandlerExchange to exit before we've
-        // told the thread to "resume" from MX_EXCP_THREAD_EXITING.
+        // told the thread to "resume" from ZX_EXCP_THREAD_EXITING.
         // The thread is still in the DYING state but it is no longer
         // in an exception. Thus |info.wait_exception_port_type| can
         // either be DEBUGGER or NONE.
-        EXPECT_TRUE(info.wait_exception_port_type == MX_EXCEPTION_PORT_TYPE_NONE ||
-                    info.wait_exception_port_type == MX_EXCEPTION_PORT_TYPE_DEBUGGER, "");
+        EXPECT_TRUE(info.wait_exception_port_type == ZX_EXCEPTION_PORT_TYPE_NONE ||
+                    info.wait_exception_port_type == ZX_EXCEPTION_PORT_TYPE_DEBUGGER, "");
         tu_handle_close(thread);
     } else {
         EXPECT_TRUE(tu_process_has_exited(inferior), "");
@@ -281,16 +281,16 @@
 // This returns a bool as it's a unittest "helper" routine.
 // N.B. This runs on the wait-inferior thread.
 
-static bool handle_expected_page_fault(mx_handle_t inferior,
-                                       const mx_port_packet_t* packet,
+static bool handle_expected_page_fault(zx_handle_t inferior,
+                                       const zx_port_packet_t* packet,
                                        atomic_int* segv_count)
 {
     BEGIN_HELPER;
 
     unittest_printf("wait-inf: got page fault exception\n");
 
-    mx_koid_t tid = packet->exception.tid;
-    mx_handle_t thread = tu_get_thread(inferior, tid);
+    zx_koid_t tid = packet->exception.tid;
+    zx_handle_t thread = tu_get_thread(inferior, tid);
 
     dump_inferior_regs(thread);
 
@@ -310,17 +310,17 @@
     // before we can increment it.
     atomic_fetch_add(segv_count, 1);
 
-    mx_status_t status = mx_task_resume(thread, MX_RESUME_EXCEPTION);
+    zx_status_t status = zx_task_resume(thread, ZX_RESUME_EXCEPTION);
     tu_handle_close(thread);
-    ASSERT_EQ(status, MX_OK, "");
+    ASSERT_EQ(status, ZX_OK, "");
 
     END_HELPER;
 }
 
 // N.B. This runs on the wait-inferior thread.
 
-static bool debugger_test_exception_handler(mx_handle_t inferior,
-                                            const mx_port_packet_t* packet,
+static bool debugger_test_exception_handler(zx_handle_t inferior,
+                                            const zx_port_packet_t* packet,
                                             void* handler_arg)
 {
     BEGIN_HELPER;
@@ -328,25 +328,25 @@
     // Note: This may be NULL if the test is not expecting a page fault.
     atomic_int* segv_count = handler_arg;
 
-    mx_koid_t tid = packet->exception.tid;
+    zx_koid_t tid = packet->exception.tid;
 
     switch (packet->type) {
-        case MX_EXCP_THREAD_STARTING:
+        case ZX_EXCP_THREAD_STARTING:
             unittest_printf("wait-inf: inferior started\n");
             if (!resume_inferior(inferior, tid))
                 return false;
             break;
 
-        case MX_EXCP_THREAD_EXITING:
+        case ZX_EXCP_THREAD_EXITING:
             EXPECT_TRUE(handle_thread_exiting(inferior, packet), "");
             break;
 
-        case MX_EXCP_GONE:
+        case ZX_EXCP_GONE:
             // A thread is gone, but we only care about the process which is
             // handled by the caller.
             break;
 
-        case MX_EXCP_FATAL_PAGE_FAULT:
+        case ZX_EXCP_FATAL_PAGE_FAULT:
             ASSERT_NONNULL(segv_count, "");
             ASSERT_TRUE(handle_expected_page_fault(inferior, packet, segv_count), "");
             break;
@@ -368,18 +368,18 @@
     BEGIN_TEST;
 
     launchpad_t* lp;
-    mx_handle_t inferior, channel;
+    zx_handle_t inferior, channel;
     if (!setup_inferior(test_inferior_child_name, &lp, &inferior, &channel))
         return false;
 
     atomic_int segv_count;
 
     expect_debugger_attached_eq(inferior, false, "debugger should not appear attached");
-    mx_handle_t eport = MX_HANDLE_INVALID;
+    zx_handle_t eport = ZX_HANDLE_INVALID;
     thrd_t wait_inf_thread =
         start_wait_inf_thread(inferior, &eport,
                               debugger_test_exception_handler, &segv_count);
-    EXPECT_NE(eport, MX_HANDLE_INVALID, "");
+    EXPECT_NE(eport, ZX_HANDLE_INVALID, "");
     expect_debugger_attached_eq(inferior, true, "debugger should appear attached");
 
     if (!start_inferior(lp))
@@ -416,15 +416,15 @@
     BEGIN_TEST;
 
     launchpad_t* lp;
-    mx_handle_t inferior, channel;
+    zx_handle_t inferior, channel;
     if (!setup_inferior(test_inferior_child_name, &lp, &inferior, &channel))
         return false;
 
-    mx_handle_t eport = MX_HANDLE_INVALID;
+    zx_handle_t eport = ZX_HANDLE_INVALID;
     thrd_t wait_inf_thread =
         start_wait_inf_thread(inferior, &eport,
                               debugger_test_exception_handler, NULL);
-    EXPECT_NE(eport, MX_HANDLE_INVALID, "");
+    EXPECT_NE(eport, ZX_HANDLE_INVALID, "");
 
     if (!start_inferior(lp))
         return false;
@@ -437,25 +437,25 @@
         return false;
     EXPECT_EQ(msg, MSG_EXTRA_THREADS_STARTED, "unexpected response when starting extra threads");
 
-    uint32_t buf_size = 100 * sizeof(mx_koid_t);
+    uint32_t buf_size = 100 * sizeof(zx_koid_t);
     size_t num_threads;
-    mx_koid_t* threads = tu_malloc(buf_size);
-    mx_status_t status = mx_object_get_info(inferior, MX_INFO_PROCESS_THREADS,
+    zx_koid_t* threads = tu_malloc(buf_size);
+    zx_status_t status = zx_object_get_info(inferior, ZX_INFO_PROCESS_THREADS,
                                             threads, buf_size, &num_threads, NULL);
-    ASSERT_EQ(status, MX_OK, "");
+    ASSERT_EQ(status, ZX_OK, "");
 
     // There should be at least 1+NUM_EXTRA_THREADS threads in the result.
-    ASSERT_GE(num_threads, (unsigned)(1 + NUM_EXTRA_THREADS), "mx_object_get_info failed");
+    ASSERT_GE(num_threads, (unsigned)(1 + NUM_EXTRA_THREADS), "zx_object_get_info failed");
 
     // Verify each entry is valid.
     for (uint32_t i = 0; i < num_threads; ++i) {
-        mx_koid_t koid = threads[i];
+        zx_koid_t koid = threads[i];
         unittest_printf("Looking up thread %llu\n", (long long) koid);
-        mx_handle_t thread = tu_get_thread(inferior, koid);
-        mx_info_handle_basic_t info;
-        status = mx_object_get_info(thread, MX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
-        EXPECT_EQ(status, MX_OK, "mx_object_get_info failed");
-        EXPECT_EQ(info.type, (uint32_t) MX_OBJ_TYPE_THREAD, "not a thread");
+        zx_handle_t thread = tu_get_thread(inferior, koid);
+        zx_info_handle_basic_t info;
+        status = zx_object_get_info(thread, ZX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL);
+        EXPECT_EQ(status, ZX_OK, "zx_object_get_info failed");
+        EXPECT_EQ(info.type, (uint32_t) ZX_OBJ_TYPE_THREAD, "not a thread");
     }
 
     if (!shutdown_inferior(channel, inferior))
@@ -475,19 +475,19 @@
 {
     BEGIN_TEST;
 
-    mx_handle_t self = mx_process_self();
+    zx_handle_t self = zx_process_self();
 
     // We shouldn't be able to set it.
     uintptr_t debug_addr = 42;
-    mx_status_t status = mx_object_set_property(self, MX_PROP_PROCESS_DEBUG_ADDR,
+    zx_status_t status = zx_object_set_property(self, ZX_PROP_PROCESS_DEBUG_ADDR,
                                                 &debug_addr, sizeof(debug_addr));
-    ASSERT_EQ(status, MX_ERR_ACCESS_DENIED, "");
+    ASSERT_EQ(status, ZX_ERR_ACCESS_DENIED, "");
 
     // Some minimal verification that the value is correct.
 
-    status = mx_object_get_property(self, MX_PROP_PROCESS_DEBUG_ADDR,
+    status = zx_object_get_property(self, ZX_PROP_PROCESS_DEBUG_ADDR,
                                     &debug_addr, sizeof(debug_addr));
-    ASSERT_EQ(status, MX_OK, "");
+    ASSERT_EQ(status, ZX_OK, "");
 
     // These are all dsos we link with. See rules.mk.
     const char* launchpad_so = "liblaunchpad.so";
@@ -538,7 +538,7 @@
 {
     BEGIN_TEST;
 
-    mx_handle_t self = mx_process_self();
+    zx_handle_t self = zx_process_self();
 
     // Exercise MG-739
     // Pretend we're writing a s/w breakpoint to the start of this function.
@@ -632,13 +632,13 @@
     atomic_fetch_add(&extra_thread_count, 1);
     unittest_printf("Extra thread started.\n");
     while (true)
-        mx_nanosleep(mx_deadline_after(MX_SEC(1)));
+        zx_nanosleep(zx_deadline_after(ZX_SEC(1)));
     return 0;
 }
 
 // This returns a bool as it's a unittest "helper" routine.
 
-static bool msg_loop(mx_handle_t channel)
+static bool msg_loop(zx_handle_t channel)
 {
     BEGIN_HELPER;  // Don't stomp on the main thread's current_test_info.
 
@@ -671,9 +671,9 @@
                 tu_thread_create_c11(&thread, extra_thread_func, NULL, "extra-thread");
             }
             // Wait for all threads to be started.
-            // Each will require an MX_EXCP_STARTING exchange with the "debugger".
+            // Each will require an ZX_EXCP_STARTING exchange with the "debugger".
             while (atomic_load(&extra_thread_count) < NUM_EXTRA_THREADS)
-                mx_nanosleep(mx_deadline_after(MX_USEC(1)));
+                zx_nanosleep(zx_deadline_after(ZX_USEC(1)));
             send_msg(channel, MSG_EXTRA_THREADS_STARTED);
             break;
         default:
@@ -687,7 +687,7 @@
 
 void test_inferior(void)
 {
-    mx_handle_t channel = mx_get_startup_handle(PA_USER0);
+    zx_handle_t channel = zx_get_startup_handle(PA_USER0);
     unittest_printf("test_inferior: got handle %d\n", channel);
 
     if (!msg_loop(channel))
diff --git a/system/utest/debugger/rules.mk b/system/utest/debugger/rules.mk
index 1734896..aeea44d 100644
--- a/system/utest/debugger/rules.mk
+++ b/system/utest/debugger/rules.mk
@@ -19,7 +19,7 @@
     system/ulib/test-utils \
     system/ulib/unittest \
     system/ulib/launchpad \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/debugger/utils.c b/system/utest/debugger/utils.c
index 860fca6..021dd94 100644
--- a/system/utest/debugger/utils.c
+++ b/system/utest/debugger/utils.c
@@ -9,12 +9,12 @@
 
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
-#include <magenta/compiler.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/debug.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/compiler.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/debug.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/syscalls/port.h>
 #include <test-utils/test-utils.h>
 #include <unittest/unittest.h>
 
@@ -44,16 +44,16 @@
     memcpy(buf, &value, sizeof (value));
 }
 
-uint32_t get_uint32_property(mx_handle_t handle, uint32_t prop)
+uint32_t get_uint32_property(zx_handle_t handle, uint32_t prop)
 {
     uint32_t value;
-    mx_status_t status = mx_object_get_property(handle, prop, &value, sizeof(value));
-    if (status != MX_OK)
-        tu_fatal("mx_object_get_property failed", status);
+    zx_status_t status = zx_object_get_property(handle, prop, &value, sizeof(value));
+    if (status != ZX_OK)
+        tu_fatal("zx_object_get_property failed", status);
     return value;
 }
 
-void send_msg(mx_handle_t handle, enum message msg)
+void send_msg(zx_handle_t handle, enum message msg)
 {
     uint64_t data = msg;
     unittest_printf("sending message %d on handle %u\n", msg, handle);
@@ -62,7 +62,7 @@
 
 // This returns "bool" because it uses ASSERT_*.
 
-bool recv_msg(mx_handle_t handle, enum message* msg)
+bool recv_msg(zx_handle_t handle, enum message* msg)
 {
     BEGIN_HELPER;
 
@@ -91,7 +91,7 @@
 
 #ifdef __x86_64__
 
-#define R(reg) { #reg, offsetof(mx_x86_64_general_regs_t, reg), 1, 64 }
+#define R(reg) { #reg, offsetof(zx_x86_64_general_regs_t, reg), 1, 64 }
 
 static const regspec_t general_regs[] =
 {
@@ -121,11 +121,11 @@
 
 #ifdef __aarch64__
 
-#define R(reg) { #reg, offsetof(mx_arm64_general_regs_t, reg), 1, 64 }
+#define R(reg) { #reg, offsetof(zx_arm64_general_regs_t, reg), 1, 64 }
 
 static const regspec_t general_regs[] =
 {
-    { "r", offsetof(mx_arm64_general_regs_t, r), 30, 64 },
+    { "r", offsetof(zx_arm64_general_regs_t, r), 30, 64 },
     R(lr),
     R(sp),
     R(pc),
@@ -136,7 +136,7 @@
 
 #endif
 
-void dump_gregs(mx_handle_t thread_handle, void* buf)
+void dump_gregs(zx_handle_t thread_handle, void* buf)
 {
 #if defined(__x86_64__) || defined(__aarch64__)
     unittest_printf("Registers for thread %d\n", thread_handle);
@@ -164,7 +164,7 @@
 #endif
 }
 
-void dump_arch_regs (mx_handle_t thread_handle, int regset, void* buf)
+void dump_arch_regs (zx_handle_t thread_handle, int regset, void* buf)
 {
     switch (regset)
     {
@@ -176,33 +176,33 @@
     }
 }
 
-bool dump_inferior_regs(mx_handle_t thread)
+bool dump_inferior_regs(zx_handle_t thread)
 {
     BEGIN_HELPER;
 
-    mx_status_t status;
-    uint32_t num_regsets = get_uint32_property(thread, MX_PROP_NUM_STATE_KINDS);
+    zx_status_t status;
+    uint32_t num_regsets = get_uint32_property(thread, ZX_PROP_NUM_STATE_KINDS);
     for (unsigned i = 0; i < num_regsets; ++i) {
         uint32_t regset_size = 0;
-        status = mx_thread_read_state(thread, MX_THREAD_STATE_REGSET0 + i, NULL, regset_size, &regset_size);
-        ASSERT_EQ(status, MX_ERR_BUFFER_TOO_SMALL, "getting regset size failed");
+        status = zx_thread_read_state(thread, ZX_THREAD_STATE_REGSET0 + i, NULL, regset_size, &regset_size);
+        ASSERT_EQ(status, ZX_ERR_BUFFER_TOO_SMALL, "getting regset size failed");
         void* buf = tu_malloc(regset_size);
-        status = mx_thread_read_state(thread, MX_THREAD_STATE_REGSET0 + i, buf, regset_size, &regset_size);
+        status = zx_thread_read_state(thread, ZX_THREAD_STATE_REGSET0 + i, buf, regset_size, &regset_size);
         // Regset reads can fail for legitimate reasons:
-        // MX_ERR_NOT_SUPPORTED - the regset is not supported on this chip
-        // MX_ERR_UNAVAILABLE - the regset may be currently unavailable
+        // ZX_ERR_NOT_SUPPORTED - the regset is not supported on this chip
+        // ZX_ERR_UNAVAILABLE - the regset may be currently unavailable
         switch (status) {
-        case MX_OK:
+        case ZX_OK:
             dump_arch_regs(thread, i, buf);
             break;
-        case MX_ERR_NOT_SUPPORTED:
+        case ZX_ERR_NOT_SUPPORTED:
             unittest_printf("Regset %u not supported\n", i);
             break;
-        case MX_ERR_UNAVAILABLE:
+        case ZX_ERR_UNAVAILABLE:
             unittest_printf("Regset %u unavailable\n", i);
             break;
         default:
-            ASSERT_EQ(status, MX_OK, "getting regset failed");
+            ASSERT_EQ(status, ZX_OK, "getting regset failed");
         }
         free(buf);
     }
@@ -210,40 +210,40 @@
     END_HELPER;
 }
 
-uint32_t get_inferior_greg_buf_size(mx_handle_t thread)
+uint32_t get_inferior_greg_buf_size(zx_handle_t thread)
 {
     // The general regs are defined to be in regset zero.
     uint32_t regset_size = 0;
-    mx_status_t status = mx_thread_read_state(thread, MX_THREAD_STATE_REGSET0, NULL, regset_size, &regset_size);
+    zx_status_t status = zx_thread_read_state(thread, ZX_THREAD_STATE_REGSET0, NULL, regset_size, &regset_size);
     // It's easier to just terminate if this fails.
-    if (status != MX_ERR_BUFFER_TOO_SMALL)
-        tu_fatal("get_inferior_greg_buf_size: mx_thread_read_state", status);
+    if (status != ZX_ERR_BUFFER_TOO_SMALL)
+        tu_fatal("get_inferior_greg_buf_size: zx_thread_read_state", status);
     return regset_size;
 }
 
 // N.B. It is assumed |buf_size| is large enough.
 
-void read_inferior_gregs(mx_handle_t thread, void* buf, unsigned buf_size)
+void read_inferior_gregs(zx_handle_t thread, void* buf, unsigned buf_size)
 {
     // By convention the general regs are in regset 0.
-    mx_status_t status = mx_thread_read_state(thread, MX_THREAD_STATE_REGSET0, buf, buf_size, &buf_size);
+    zx_status_t status = zx_thread_read_state(thread, ZX_THREAD_STATE_REGSET0, buf, buf_size, &buf_size);
     // It's easier to just terminate if this fails.
-    if (status != MX_OK)
-        tu_fatal("read_inferior_gregs: mx_thread_read_state", status);
+    if (status != ZX_OK)
+        tu_fatal("read_inferior_gregs: zx_thread_read_state", status);
 }
 
-void write_inferior_gregs(mx_handle_t thread, const void* buf, unsigned buf_size)
+void write_inferior_gregs(zx_handle_t thread, const void* buf, unsigned buf_size)
 {
     // By convention the general regs are in regset 0.
-    mx_status_t status = mx_thread_write_state(thread, MX_THREAD_STATE_REGSET0, buf, buf_size);
+    zx_status_t status = zx_thread_write_state(thread, ZX_THREAD_STATE_REGSET0, buf, buf_size);
     // It's easier to just terminate if this fails.
-    if (status != MX_OK)
-        tu_fatal("write_inferior_gregs: mx_thread_write_state", status);
+    if (status != ZX_OK)
+        tu_fatal("write_inferior_gregs: zx_thread_write_state", status);
 }
 
 // This assumes |regno| is in an array of uint64_t values.
 
-uint64_t get_uint64_register(mx_handle_t thread, size_t offset) {
+uint64_t get_uint64_register(zx_handle_t thread, size_t offset) {
     unsigned greg_buf_size = get_inferior_greg_buf_size(thread);
     char* buf = tu_malloc(greg_buf_size);
     read_inferior_gregs(thread, buf, greg_buf_size);
@@ -254,7 +254,7 @@
 
 // This assumes |regno| is in an array of uint64_t values.
 
-void set_uint64_register(mx_handle_t thread, size_t offset, uint64_t value) {
+void set_uint64_register(zx_handle_t thread, size_t offset, uint64_t value) {
     unsigned greg_buf_size = get_inferior_greg_buf_size(thread);
     char* buf = tu_malloc(greg_buf_size);
     read_inferior_gregs(thread, buf, greg_buf_size);
@@ -263,32 +263,32 @@
     free(buf);
 }
 
-size_t read_inferior_memory(mx_handle_t proc, uintptr_t vaddr, void* buf, size_t len)
+size_t read_inferior_memory(zx_handle_t proc, uintptr_t vaddr, void* buf, size_t len)
 {
-    mx_status_t status = mx_process_read_memory(proc, vaddr, buf, len, &len);
+    zx_status_t status = zx_process_read_memory(proc, vaddr, buf, len, &len);
     if (status < 0)
         tu_fatal("read_inferior_memory", status);
     return len;
 }
 
-size_t write_inferior_memory(mx_handle_t proc, uintptr_t vaddr, const void* buf, size_t len)
+size_t write_inferior_memory(zx_handle_t proc, uintptr_t vaddr, const void* buf, size_t len)
 {
-    mx_status_t status = mx_process_write_memory(proc, vaddr, buf, len, &len);
+    zx_status_t status = zx_process_write_memory(proc, vaddr, buf, len, &len);
     if (status < 0)
         tu_fatal("write_inferior_memory", status);
     return len;
 }
 
-// This does everything that launchpad_launch_mxio_etc does except
+// This does everything that launchpad_launch_fdio_etc does except
 // start the inferior. We want to attach to it first.
 // TODO(dje): Are there other uses of such a wrapper? Move to launchpad?
 // Plus there's a fair bit of code here. IWBN to not have to update it as
-// launchpad_launch_mxio_etc changes.
+// launchpad_launch_fdio_etc changes.
 
-mx_status_t create_inferior(const char* name,
+zx_status_t create_inferior(const char* name,
                             int argc, const char* const* argv,
                             const char* const* envp,
-                            size_t hnds_count, mx_handle_t* handles,
+                            size_t hnds_count, zx_handle_t* handles,
                             uint32_t* ids, launchpad_t** out_launchpad)
 {
     launchpad_t* lp = NULL;
@@ -297,12 +297,12 @@
     if (name == NULL)
         name = filename;
 
-    mx_status_t status;
+    zx_status_t status;
     launchpad_create(0u, name, &lp);
     launchpad_load_from_file(lp, filename);
     launchpad_set_args(lp, argc, argv);
     launchpad_set_environ(lp, envp);
-    launchpad_clone(lp, LP_CLONE_MXIO_ALL);
+    launchpad_clone(lp, LP_CLONE_FDIO_ALL);
     status = launchpad_add_handles(lp, hnds_count, handles, ids);
 
     if (status < 0) {
@@ -313,31 +313,31 @@
     return status;
 }
 
-bool setup_inferior(const char* name, launchpad_t** out_lp, mx_handle_t* out_inferior, mx_handle_t* out_channel)
+bool setup_inferior(const char* name, launchpad_t** out_lp, zx_handle_t* out_inferior, zx_handle_t* out_channel)
 {
     BEGIN_HELPER;
 
-    mx_status_t status;
-    mx_handle_t channel1, channel2;
+    zx_status_t status;
+    zx_handle_t channel1, channel2;
     tu_channel_create(&channel1, &channel2);
 
     const char verbosity_string[] = { 'v', '=', utest_verbosity_level + '0', '\0' };
     const char* test_child_path = program_path;
     const char* const argv[] = { test_child_path, name, verbosity_string };
-    mx_handle_t handles[1] = { channel2 };
+    zx_handle_t handles[1] = { channel2 };
     uint32_t handle_ids[1] = { PA_USER0 };
 
     launchpad_t* lp;
     unittest_printf("Creating process \"%s\"\n", name);
     status = create_inferior(name, countof(argv), argv, NULL,
                              countof(handles), handles, handle_ids, &lp);
-    ASSERT_EQ(status, MX_OK, "failed to create inferior");
+    ASSERT_EQ(status, ZX_OK, "failed to create inferior");
 
     // Note: |inferior| is a borrowed handle here.
-    mx_handle_t inferior = launchpad_get_process_handle(lp);
-    ASSERT_NE(inferior, MX_HANDLE_INVALID, "can't get launchpad process handle");
+    zx_handle_t inferior = launchpad_get_process_handle(lp);
+    ASSERT_NE(inferior, ZX_HANDLE_INVALID, "can't get launchpad process handle");
 
-    mx_info_handle_basic_t process_info;
+    zx_info_handle_basic_t process_info;
     tu_handle_get_basic_info(inferior, &process_info);
     unittest_printf("Inferior pid = %llu\n", (long long) process_info.koid);
 
@@ -346,8 +346,8 @@
     // it before we call launchpad_start in order to attach to the debugging
     // exception port. We could leave this to our caller to do, but since every
     // caller needs this for convenience sake we do this here.
-    status = mx_handle_duplicate(inferior, MX_RIGHT_SAME_RIGHTS, &inferior);
-    ASSERT_EQ(status, MX_OK, "mx_handle_duplicate failed");
+    status = zx_handle_duplicate(inferior, ZX_RIGHT_SAME_RIGHTS, &inferior);
+    ASSERT_EQ(status, ZX_OK, "zx_handle_duplicate failed");
 
     *out_lp = lp;
     *out_inferior = inferior;
@@ -360,17 +360,17 @@
 // inferior's handle, we later want to test attaching to an already running
 // inferior.
 
-mx_handle_t attach_inferior(mx_handle_t inferior)
+zx_handle_t attach_inferior(zx_handle_t inferior)
 {
-    mx_handle_t eport = tu_io_port_create();
-    tu_set_exception_port(inferior, eport, exception_port_key, MX_EXCEPTION_PORT_DEBUGGER);
+    zx_handle_t eport = tu_io_port_create();
+    tu_set_exception_port(inferior, eport, exception_port_key, ZX_EXCEPTION_PORT_DEBUGGER);
     unittest_printf("Attached to inferior\n");
     return eport;
 }
 
 bool start_inferior(launchpad_t* lp)
 {
-    mx_handle_t dup_inferior = tu_launch_mxio_fini(lp);
+    zx_handle_t dup_inferior = tu_launch_fdio_fini(lp);
     unittest_printf("Inferior started\n");
     // launchpad_start returns a dup of |inferior|. The original inferior
     // handle is given to the child. However we don't need it, we already
@@ -379,7 +379,7 @@
     return true;
 }
 
-bool verify_inferior_running(mx_handle_t channel)
+bool verify_inferior_running(zx_handle_t channel)
 {
     BEGIN_HELPER;
 
@@ -392,35 +392,35 @@
     END_HELPER;
 }
 
-bool resume_inferior(mx_handle_t inferior, mx_koid_t tid)
+bool resume_inferior(zx_handle_t inferior, zx_koid_t tid)
 {
     BEGIN_HELPER;
 
-    mx_handle_t thread;
-    mx_status_t status = mx_object_get_child(inferior, tid, MX_RIGHT_SAME_RIGHTS, &thread);
-    if (status == MX_ERR_NOT_FOUND) {
+    zx_handle_t thread;
+    zx_status_t status = zx_object_get_child(inferior, tid, ZX_RIGHT_SAME_RIGHTS, &thread);
+    if (status == ZX_ERR_NOT_FOUND) {
         // If the process has exited then the kernel may have reaped the
         // thread already. Check.
         if (tu_process_has_exited(inferior))
             return true;
     }
-    ASSERT_EQ(status, MX_OK, "mx_object_get_child failed");
+    ASSERT_EQ(status, ZX_OK, "zx_object_get_child failed");
 
     unittest_printf("Resuming inferior ...\n");
-    status = mx_task_resume(thread, MX_RESUME_EXCEPTION);
+    status = zx_task_resume(thread, ZX_RESUME_EXCEPTION);
     tu_handle_close(thread);
-    if (status == MX_ERR_BAD_STATE) {
+    if (status == ZX_ERR_BAD_STATE) {
         // If the process has exited then the thread may have exited
         // ExceptionHandlerExchange already. Check.
         if (tu_process_has_exited(inferior))
             return true;
     }
-    ASSERT_EQ(status, MX_OK, "mx_task_resume failed");
+    ASSERT_EQ(status, ZX_OK, "zx_task_resume failed");
 
     END_HELPER;
 }
 
-bool shutdown_inferior(mx_handle_t channel, mx_handle_t inferior)
+bool shutdown_inferior(zx_handle_t channel, zx_handle_t inferior)
 {
     BEGIN_HELPER;
 
@@ -437,13 +437,13 @@
 
 // Wait for and receive an exception on |eport|.
 
-bool read_exception(mx_handle_t eport, mx_handle_t inferior,
-                    mx_port_packet_t* packet)
+bool read_exception(zx_handle_t eport, zx_handle_t inferior,
+                    zx_port_packet_t* packet)
 {
     BEGIN_HELPER;
 
     unittest_printf("Waiting for exception on eport %d\n", eport);
-    ASSERT_EQ(mx_port_wait(eport, MX_TIME_INFINITE, packet, 0), MX_OK, "mx_port_wait failed");
+    ASSERT_EQ(zx_port_wait(eport, ZX_TIME_INFINITE, packet, 0), ZX_OK, "zx_port_wait failed");
     ASSERT_EQ(packet->key, exception_port_key, "bad report key");
 
     unittest_printf("read_exception: got exception %d\n", packet->type);
diff --git a/system/utest/debugger/utils.h b/system/utest/debugger/utils.h
index 5ebe3da..975a4e3 100644
--- a/system/utest/debugger/utils.h
+++ b/system/utest/debugger/utils.h
@@ -8,8 +8,8 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/exception.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/exception.h>
 
 enum message {
     // Force the type to be signed, avoids mismatch clashes in unittest macros.
@@ -31,52 +31,52 @@
 
 extern void set_uint64(char* buf, uint64_t value);
 
-extern uint32_t get_uint32_property(mx_handle_t handle, uint32_t prop);
+extern uint32_t get_uint32_property(zx_handle_t handle, uint32_t prop);
 
-extern void send_msg(mx_handle_t handle, enum message msg);
+extern void send_msg(zx_handle_t handle, enum message msg);
 
-extern bool recv_msg(mx_handle_t handle, enum message* msg);
+extern bool recv_msg(zx_handle_t handle, enum message* msg);
 
-extern void dump_gregs(mx_handle_t thread_handle, void* buf);
+extern void dump_gregs(zx_handle_t thread_handle, void* buf);
 
-extern void dump_arch_regs (mx_handle_t thread_handle, int regset, void* buf);
+extern void dump_arch_regs (zx_handle_t thread_handle, int regset, void* buf);
 
-extern bool dump_inferior_regs(mx_handle_t thread);
+extern bool dump_inferior_regs(zx_handle_t thread);
 
-extern uint32_t get_inferior_greg_buf_size(mx_handle_t thread);
+extern uint32_t get_inferior_greg_buf_size(zx_handle_t thread);
 
-extern void read_inferior_gregs(mx_handle_t thread, void* buf, unsigned buf_size);
+extern void read_inferior_gregs(zx_handle_t thread, void* buf, unsigned buf_size);
 
-extern void write_inferior_gregs(mx_handle_t thread, const void* buf, unsigned buf_size);
+extern void write_inferior_gregs(zx_handle_t thread, const void* buf, unsigned buf_size);
 
-extern uint64_t get_uint64_register(mx_handle_t thread, size_t offset);
+extern uint64_t get_uint64_register(zx_handle_t thread, size_t offset);
 
-extern void set_uint64_register(mx_handle_t thread, size_t offset, uint64_t value);
+extern void set_uint64_register(zx_handle_t thread, size_t offset, uint64_t value);
 
-extern size_t read_inferior_memory(mx_handle_t proc, uintptr_t vaddr, void* buf, size_t len);
+extern size_t read_inferior_memory(zx_handle_t proc, uintptr_t vaddr, void* buf, size_t len);
 
-extern size_t write_inferior_memory(mx_handle_t proc, uintptr_t vaddr, const void* buf, size_t len);
+extern size_t write_inferior_memory(zx_handle_t proc, uintptr_t vaddr, const void* buf, size_t len);
 
-extern mx_status_t create_inferior(const char* name,
+extern zx_status_t create_inferior(const char* name,
                                    int argc, const char* const* argv,
                                    const char* const* envp,
-                                   size_t hnds_count, mx_handle_t* handles,
+                                   size_t hnds_count, zx_handle_t* handles,
                                    uint32_t* ids, launchpad_t** out_launchpad);
 
 extern bool setup_inferior(const char* name,
                            launchpad_t** out_lp,
-                           mx_handle_t* out_inferior,
-                           mx_handle_t* out_channel);
+                           zx_handle_t* out_inferior,
+                           zx_handle_t* out_channel);
 
-extern mx_handle_t attach_inferior(mx_handle_t inferior);
+extern zx_handle_t attach_inferior(zx_handle_t inferior);
 
 extern bool start_inferior(launchpad_t* lp);
 
-extern bool verify_inferior_running(mx_handle_t channel);
+extern bool verify_inferior_running(zx_handle_t channel);
 
-extern bool resume_inferior(mx_handle_t inferior, mx_koid_t tid);
+extern bool resume_inferior(zx_handle_t inferior, zx_koid_t tid);
 
-extern bool shutdown_inferior(mx_handle_t channel, mx_handle_t inferior);
+extern bool shutdown_inferior(zx_handle_t channel, zx_handle_t inferior);
 
-extern bool read_exception(mx_handle_t eport, mx_handle_t inferior,
-                           mx_port_packet_t* packet);
+extern bool read_exception(zx_handle_t eport, zx_handle_t inferior,
+                           zx_port_packet_t* packet);
diff --git a/system/utest/digest/digest.cpp b/system/utest/digest/digest.cpp
index 7f5921b..7d07692 100644
--- a/system/utest/digest/digest.cpp
+++ b/system/utest/digest/digest.cpp
@@ -6,7 +6,7 @@
 
 #include <stdlib.h>
 
-#include <magenta/status.h>
+#include <zircon/status.h>
 #include <unittest/unittest.h>
 
 // These unit tests are for the Digest object in ulib/digest.
@@ -31,10 +31,10 @@
 bool DigestStrings(void) {
     BEGIN_TEST;
     Digest actual;
-    mx_status_t rc = actual.Parse(kZeroDigest, strlen(kZeroDigest));
+    zx_status_t rc = actual.Parse(kZeroDigest, strlen(kZeroDigest));
     char buf[(Digest::kLength * 2) + 1];
     rc = actual.ToString(buf, sizeof(buf));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     ASSERT_EQ(strncmp(kZeroDigest, buf, sizeof(buf)), 0, __FUNCTION__);
     END_TEST;
 }
@@ -42,8 +42,8 @@
 bool DigestZero(void) {
     BEGIN_TEST;
     Digest actual, expected;
-    mx_status_t rc = expected.Parse(kZeroDigest, strlen(kZeroDigest));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    zx_status_t rc = expected.Parse(kZeroDigest, strlen(kZeroDigest));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     actual.Hash(nullptr, 0);
     ASSERT_TRUE(actual == expected, __FUNCTION__);
     END_TEST;
@@ -52,14 +52,14 @@
 bool DigestSelf(void) {
     BEGIN_TEST;
     Digest actual, expected;
-    mx_status_t rc =
+    zx_status_t rc =
         expected.Parse(kDoubleZeroDigest, strlen(kDoubleZeroDigest));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     rc = actual.Parse(kZeroDigest, strlen(kZeroDigest));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     uint8_t buf[Digest::kLength];
     rc = actual.CopyTo(buf, sizeof(buf));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     actual.Hash(buf, Digest::kLength);
     ASSERT_TRUE(actual == expected, __FUNCTION__);
     END_TEST;
@@ -84,21 +84,21 @@
 bool DigestCWrappers(void) {
     BEGIN_TEST;
     uint8_t buf[Digest::kLength];
-    mx_status_t rc = digest_hash(nullptr, 0, buf, sizeof(buf) - 1);
-    ASSERT_EQ(rc, MX_ERR_BUFFER_TOO_SMALL, "Small buffer should be rejected");
+    zx_status_t rc = digest_hash(nullptr, 0, buf, sizeof(buf) - 1);
+    ASSERT_EQ(rc, ZX_ERR_BUFFER_TOO_SMALL, "Small buffer should be rejected");
     rc = digest_hash(nullptr, 0, buf, sizeof(buf));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     Digest expected;
     rc = expected.Parse(kZeroDigest, strlen(kZeroDigest));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     ASSERT_TRUE(expected == buf, __FUNCTION__);
     digest_t* digest = nullptr;
     rc = digest_init(&digest);
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     expected.Hash(buf, sizeof(buf));
     digest_update(digest, buf, sizeof(buf));
     rc = digest_final(digest, buf, sizeof(buf));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     ASSERT_TRUE(expected == buf, __FUNCTION__);
     END_TEST;
 }
@@ -106,10 +106,10 @@
 bool DigestEquality(void) {
     BEGIN_TEST;
     Digest actual, expected;
-    mx_status_t rc = expected.Parse(kZeroDigest, strlen(kZeroDigest));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    zx_status_t rc = expected.Parse(kZeroDigest, strlen(kZeroDigest));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     rc = actual.Parse(kZeroDigest, strlen(kZeroDigest));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     ASSERT_FALSE(actual == nullptr, "Does not equal NULL");
     ASSERT_TRUE(actual == actual, "Equals self");
     const uint8_t* actual_bytes = actual.AcquireBytes();
diff --git a/system/utest/digest/merkle-tree.cpp b/system/utest/digest/merkle-tree.cpp
index 856ab6b..5034558 100644
--- a/system/utest/digest/merkle-tree.cpp
+++ b/system/utest/digest/merkle-tree.cpp
@@ -7,8 +7,8 @@
 #include <stdlib.h>
 
 #include <digest/digest.h>
-#include <magenta/assert.h>
-#include <magenta/status.h>
+#include <zircon/assert.h>
+#include <zircon/status.h>
 #include <unittest/unittest.h>
 
 namespace {
@@ -16,14 +16,14 @@
 ////////////////
 // Test support.
 
-// Helper defines for the typical case of checking a mx_status_t
+// Helper defines for the typical case of checking a zx_status_t
 #define BEGIN_TEST_WITH_RC                                                     \
     BEGIN_TEST;                                                                \
-    mx_status_t rc
+    zx_status_t rc
 #define ASSERT_ERR(expected, expr)                                             \
     rc = (expr);                                                               \
-    ASSERT_EQ(expected, rc, mx_status_get_string(rc))
-#define ASSERT_OK(expr) ASSERT_ERR(MX_OK, (expr))
+    ASSERT_EQ(expected, rc, zx_status_get_string(rc))
+#define ASSERT_OK(expr) ASSERT_ERR(ZX_OK, (expr))
 
 // These unit tests are for the MerkleTree object in ulib/digest.
 using digest::Digest;
@@ -75,8 +75,8 @@
 bool GetTreeLength(void) {
     BEGIN_TEST;
     for (size_t i = 0; i < kNumCases; ++i) {
-        MX_DEBUG_ASSERT(kCases[i].data_len <= sizeof(gData));
-        MX_DEBUG_ASSERT(kCases[i].tree_len <= sizeof(gTree));
+        ZX_DEBUG_ASSERT(kCases[i].data_len <= sizeof(gData));
+        ZX_DEBUG_ASSERT(kCases[i].tree_len <= sizeof(gTree));
         ASSERT_EQ(kCases[i].tree_len,
                   MerkleTree::GetTreeLength(kCases[i].data_len),
                   "Wrong tree length");
@@ -112,7 +112,7 @@
     BEGIN_TEST_WITH_RC;
     size_t tree_len = MerkleTree::GetTreeLength(kLarge);
     MerkleTree merkleTree;
-    ASSERT_ERR(MX_ERR_BUFFER_TOO_SMALL,
+    ASSERT_ERR(ZX_ERR_BUFFER_TOO_SMALL,
                merkleTree.CreateInit(kLarge, tree_len - 1));
     END_TEST;
 }
@@ -129,7 +129,7 @@
 bool CreateUpdateMissingInit(void) {
     BEGIN_TEST_WITH_RC;
     MerkleTree merkleTree;
-    ASSERT_ERR(MX_ERR_BAD_STATE, merkleTree.CreateUpdate(gData, kLarge, gTree));
+    ASSERT_ERR(ZX_ERR_BAD_STATE, merkleTree.CreateUpdate(gData, kLarge, gTree));
     END_TEST;
 }
 
@@ -138,7 +138,7 @@
     size_t tree_len = MerkleTree::GetTreeLength(kLarge);
     MerkleTree merkleTree;
     ASSERT_OK(merkleTree.CreateInit(kLarge, tree_len));
-    ASSERT_ERR(MX_ERR_INVALID_ARGS,
+    ASSERT_ERR(ZX_ERR_INVALID_ARGS,
                merkleTree.CreateUpdate(nullptr, kLarge, gTree));
     END_TEST;
 }
@@ -148,7 +148,7 @@
     size_t tree_len = MerkleTree::GetTreeLength(kLarge);
     MerkleTree merkleTree;
     ASSERT_OK(merkleTree.CreateInit(kLarge, tree_len));
-    ASSERT_ERR(MX_ERR_INVALID_ARGS,
+    ASSERT_ERR(ZX_ERR_INVALID_ARGS,
                merkleTree.CreateUpdate(gData, kLarge, nullptr));
     END_TEST;
 }
@@ -176,7 +176,7 @@
     size_t tree_len = MerkleTree::GetTreeLength(kLarge);
     MerkleTree merkleTree;
     ASSERT_OK(merkleTree.CreateInit(kLarge, tree_len));
-    ASSERT_ERR(MX_ERR_OUT_OF_RANGE,
+    ASSERT_ERR(ZX_ERR_OUT_OF_RANGE,
                merkleTree.CreateUpdate(gData, kLarge + 1, gTree));
     END_TEST;
 }
@@ -185,14 +185,14 @@
     BEGIN_TEST_WITH_RC;
     MerkleTree merkleTree;
     Digest digest;
-    ASSERT_ERR(MX_ERR_BAD_STATE, merkleTree.CreateFinal(gTree, &digest));
+    ASSERT_ERR(ZX_ERR_BAD_STATE, merkleTree.CreateFinal(gTree, &digest));
     END_TEST;
 }
 
 // Used by CreateFinalAll, CreateFinalWithoutData, and CreateFinalWithoutTree
 // below
 bool CreateFinal(size_t data_len, const char* digest, void* data, void* tree) {
-    mx_status_t rc;
+    zx_status_t rc;
     size_t tree_len = MerkleTree::GetTreeLength(data_len);
     MerkleTree merkleTree;
     ASSERT_OK(merkleTree.CreateInit(data_len, tree_len));
@@ -261,7 +261,7 @@
     MerkleTree merkleTree;
     ASSERT_OK(merkleTree.CreateInit(kLarge, tree_len));
     ASSERT_OK(merkleTree.CreateUpdate(gData, kLarge, gTree));
-    ASSERT_ERR(MX_ERR_INVALID_ARGS, merkleTree.CreateFinal(gTree, nullptr));
+    ASSERT_ERR(ZX_ERR_INVALID_ARGS, merkleTree.CreateFinal(gTree, nullptr));
     END_TEST;
 }
 
@@ -272,13 +272,13 @@
     ASSERT_OK(merkleTree.CreateInit(kLarge, tree_len));
     ASSERT_OK(merkleTree.CreateUpdate(gData, kLarge - 1, gTree));
     Digest digest;
-    ASSERT_ERR(MX_ERR_BAD_STATE, merkleTree.CreateFinal(gTree, &digest));
+    ASSERT_ERR(ZX_ERR_BAD_STATE, merkleTree.CreateFinal(gTree, &digest));
     END_TEST;
 }
 
 // Used by CreateAll below.
 bool Create(size_t data_len, const char* digest) {
-    mx_status_t rc;
+    zx_status_t rc;
     size_t tree_len = MerkleTree::GetTreeLength(data_len);
     Digest actual;
     ASSERT_OK(MerkleTree::Create(gData, data_len, gTree, tree_len, &actual));
@@ -302,7 +302,7 @@
 
 // Used by CreateFinalCAll below.
 bool CreateFinalC(size_t data_len, const char* digest) {
-    mx_status_t rc;
+    zx_status_t rc;
     // Init
     size_t tree_len = merkle_tree_get_tree_length(data_len);
     merkle_tree_t* mt = nullptr;
@@ -338,7 +338,7 @@
 
 // Used by CreateCAll below.
 bool CreateC(size_t data_len, const char* digest) {
-    mx_status_t rc;
+    zx_status_t rc;
     size_t tree_len = merkle_tree_get_tree_length(data_len);
     uint8_t actual[Digest::kLength];
     ASSERT_OK(merkle_tree_create(gData, data_len, gTree, tree_len, &actual,
@@ -382,7 +382,7 @@
     BEGIN_TEST_WITH_RC;
     size_t tree_len = MerkleTree::GetTreeLength(kSmall);
     Digest digest;
-    ASSERT_ERR(MX_ERR_INVALID_ARGS,
+    ASSERT_ERR(ZX_ERR_INVALID_ARGS,
                MerkleTree::Create(nullptr, kSmall, gTree, tree_len, &digest));
     END_TEST;
 }
@@ -390,7 +390,7 @@
 bool CreateMissingTree(void) {
     BEGIN_TEST_WITH_RC;
     Digest digest;
-    ASSERT_ERR(MX_ERR_INVALID_ARGS,
+    ASSERT_ERR(ZX_ERR_INVALID_ARGS,
                MerkleTree::Create(gData, kSmall, nullptr, kNodeSize, &digest));
     END_TEST;
 }
@@ -398,17 +398,17 @@
 bool CreateTreeTooSmall(void) {
     BEGIN_TEST_WITH_RC;
     Digest digest;
-    ASSERT_ERR(MX_ERR_BUFFER_TOO_SMALL,
+    ASSERT_ERR(ZX_ERR_BUFFER_TOO_SMALL,
                MerkleTree::Create(gData, kSmall, nullptr, 0, &digest));
     ASSERT_ERR(
-        MX_ERR_BUFFER_TOO_SMALL,
+        ZX_ERR_BUFFER_TOO_SMALL,
         MerkleTree::Create(gData, kNodeSize * 257, gTree, kNodeSize, &digest));
     END_TEST;
 }
 
 // Used by VerifyAll below.
 bool Verify(size_t data_len) {
-    mx_status_t rc;
+    zx_status_t rc;
     size_t tree_len = MerkleTree::GetTreeLength(data_len);
     Digest digest;
     ASSERT_OK(MerkleTree::Create(gData, data_len, gTree, tree_len, &digest));
@@ -432,7 +432,7 @@
 
 // Used by VerifyCAll below.
 bool VerifyC(size_t data_len) {
-    mx_status_t rc;
+    zx_status_t rc;
     size_t tree_len = merkle_tree_get_tree_length(data_len);
     uint8_t digest[Digest::kLength];
     ASSERT_OK(merkle_tree_create(gData, data_len, gTree, tree_len, digest,
@@ -472,7 +472,7 @@
     size_t tree_len = MerkleTree::GetTreeLength(kSmall);
     Digest digest;
     ASSERT_OK(MerkleTree::Create(gData, kSmall, gTree, tree_len, &digest));
-    ASSERT_ERR(MX_ERR_INVALID_ARGS,
+    ASSERT_ERR(ZX_ERR_INVALID_ARGS,
                MerkleTree::Verify(nullptr, kSmall, gTree, tree_len, 0, kSmall,
                                   digest));
     END_TEST;
@@ -483,7 +483,7 @@
     size_t tree_len = MerkleTree::GetTreeLength(kSmall);
     Digest digest;
     ASSERT_OK(MerkleTree::Create(gData, kSmall, gTree, tree_len, &digest));
-    ASSERT_ERR(MX_ERR_INVALID_ARGS,
+    ASSERT_ERR(ZX_ERR_INVALID_ARGS,
                MerkleTree::Verify(gData, kNodeSize + 1, nullptr, tree_len, 0,
                                   kNodeSize, digest));
     END_TEST;
@@ -515,7 +515,7 @@
     Digest digest;
     ASSERT_OK(MerkleTree::Create(gData, kSmall, gTree, tree_len, &digest));
     tree_len = MerkleTree::GetTreeLength(kSmall);
-    ASSERT_ERR(MX_ERR_BUFFER_TOO_SMALL,
+    ASSERT_ERR(ZX_ERR_BUFFER_TOO_SMALL,
                MerkleTree::Verify(gData, kSmall, gTree, tree_len - 1, 0, kSmall,
                                   digest));
     END_TEST;
@@ -546,7 +546,7 @@
     size_t tree_len = MerkleTree::GetTreeLength(kSmall);
     Digest digest;
     ASSERT_OK(MerkleTree::Create(gData, kSmall, gTree, tree_len, &digest));
-    ASSERT_ERR(MX_ERR_OUT_OF_RANGE,
+    ASSERT_ERR(ZX_ERR_OUT_OF_RANGE,
                MerkleTree::Verify(gData, kSmall, gTree, tree_len,
                                   kSmall - kNodeSize, kNodeSize * 2, digest));
     END_TEST;
@@ -571,10 +571,10 @@
     ASSERT_OK(digest.ToString(str, sizeof(str)));
     str[0] = (str[0] == '0' ? '1' : '0');
     rc = digest.Parse(str, strlen(str));
-    ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+    ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
     // Verify
     ASSERT_ERR(
-        MX_ERR_IO_DATA_INTEGRITY,
+        ZX_ERR_IO_DATA_INTEGRITY,
         MerkleTree::Verify(gData, kLarge, gTree, tree_len, 0, kLarge, digest));
     END_TEST;
 }
@@ -598,7 +598,7 @@
     ASSERT_OK(MerkleTree::Create(gData, kLarge, gTree, tree_len, &digest));
     gTree[0] ^= 1;
     ASSERT_ERR(
-        MX_ERR_IO_DATA_INTEGRITY,
+        ZX_ERR_IO_DATA_INTEGRITY,
         MerkleTree::Verify(gData, kLarge, gTree, tree_len, 0, 1, digest));
     END_TEST;
 }
@@ -621,7 +621,7 @@
     ASSERT_OK(MerkleTree::Create(gData, kSmall, gTree, tree_len, &digest));
     gData[0] ^= 1;
     ASSERT_ERR(
-        MX_ERR_IO_DATA_INTEGRITY,
+        ZX_ERR_IO_DATA_INTEGRITY,
         MerkleTree::Verify(gData, kSmall, gTree, tree_len, 0, kSmall, digest));
     END_TEST;
 }
@@ -652,7 +652,7 @@
                     static_cast<uint8_t>(1 << tmp);
             }
             digest = buffer;
-            ASSERT_ERR(MX_ERR_IO_DATA_INTEGRITY,
+            ASSERT_ERR(ZX_ERR_IO_DATA_INTEGRITY,
                        MerkleTree::Verify(gData, data_len, gTree, tree_len, 0,
                                           data_len, digest));
             break;
@@ -662,7 +662,7 @@
                 uint8_t tmp = static_cast<uint8_t>(rand()) % 8;
                 gData[rand() % data_len] ^= static_cast<uint8_t>(1 << tmp);
             }
-            ASSERT_ERR(MX_ERR_IO_DATA_INTEGRITY,
+            ASSERT_ERR(ZX_ERR_IO_DATA_INTEGRITY,
                        MerkleTree::Verify(gData, data_len, gTree, tree_len, 0,
                                           data_len, digest));
             break;
@@ -676,10 +676,10 @@
                                     data_len, digest);
 
             if (tree_len <= kNodeSize) {
-                ASSERT_EQ(rc, MX_OK, mx_status_get_string(rc));
+                ASSERT_EQ(rc, ZX_OK, zx_status_get_string(rc));
             } else {
-                ASSERT_EQ(rc, MX_ERR_IO_DATA_INTEGRITY,
-                          mx_status_get_string(rc));
+                ASSERT_EQ(rc, ZX_ERR_IO_DATA_INTEGRITY,
+                          zx_status_get_string(rc));
             }
             break;
         default:
diff --git a/system/utest/digest/rules.mk b/system/utest/digest/rules.mk
index cff4152..e9e278d 100644
--- a/system/utest/digest/rules.mk
+++ b/system/utest/digest/rules.mk
@@ -18,13 +18,13 @@
 MODULE_LIBS := \
     system/ulib/unittest \
     system/ulib/digest \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
 
 MODULE_STATIC_LIBS := \
     third_party/ulib/cryptolib \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 include make/module.mk
diff --git a/system/utest/dlfcn/dlfcn.c b/system/utest/dlfcn/dlfcn.c
index 2eaec24..bfe9d4c 100644
--- a/system/utest/dlfcn/dlfcn.c
+++ b/system/utest/dlfcn/dlfcn.c
@@ -6,10 +6,10 @@
 #include <inttypes.h>
 #include <launchpad/vmo.h>
 #include <launchpad/loader-service.h>
-#include <magenta/device/dmctl.h>
-#include <magenta/dlfcn.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/dmctl.h>
+#include <zircon/dlfcn.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 
 #include <stdatomic.h>
 #include <stdio.h>
@@ -27,15 +27,15 @@
 bool dlopen_vmo_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t vmo = MX_HANDLE_INVALID;
-    mx_status_t status = launchpad_vmo_from_file(LIBPREFIX "liblaunchpad.so", &vmo);
-    EXPECT_EQ(status, MX_OK, "");
-    EXPECT_NE(vmo, MX_HANDLE_INVALID, "launchpad_vmo_from_file");
+    zx_handle_t vmo = ZX_HANDLE_INVALID;
+    zx_status_t status = launchpad_vmo_from_file(LIBPREFIX "liblaunchpad.so", &vmo);
+    EXPECT_EQ(status, ZX_OK, "");
+    EXPECT_NE(vmo, ZX_HANDLE_INVALID, "launchpad_vmo_from_file");
 
     void* obj = dlopen_vmo(vmo, RTLD_LOCAL);
     EXPECT_NONNULL(obj, "dlopen_vmo");
 
-    mx_handle_close(vmo);
+    zx_handle_close(vmo);
 
     void* sym = dlsym(obj, "launchpad_create");
     EXPECT_NONNULL(sym, "dlsym");
@@ -47,47 +47,47 @@
 }
 
 // This should be some library that this program links against.
-#define TEST_SONAME "libmxio.so"
+#define TEST_SONAME "libfdio.so"
 #define TEST_NAME "foobar"
 #define TEST_ACTUAL_NAME LIBPREFIX TEST_SONAME
 
 static atomic_bool my_loader_service_ok = false;
 static atomic_int my_loader_service_calls = 0;
 
-static mx_status_t my_loader_service(void* arg, uint32_t load_op,
-                                     mx_handle_t request_handle,
+static zx_status_t my_loader_service(void* arg, uint32_t load_op,
+                                     zx_handle_t request_handle,
                                      const char* name,
-                                     mx_handle_t* out) {
+                                     zx_handle_t* out) {
     ++my_loader_service_calls;
 
-    EXPECT_EQ(request_handle, MX_HANDLE_INVALID,
+    EXPECT_EQ(request_handle, ZX_HANDLE_INVALID,
               "called with a request handle");
 
     int cmp = strcmp(name, TEST_NAME);
     EXPECT_EQ(cmp, 0, "called with unexpected name");
     if (cmp != 0) {
         unittest_printf("        saw \"%s\", expected \"%s\"", name, TEST_NAME);
-        return MX_HANDLE_INVALID;
+        return ZX_HANDLE_INVALID;
     }
     EXPECT_EQ(load_op, (uint32_t) LOADER_SVC_OP_LOAD_OBJECT,
               "called with unexpected load op");
     if (load_op != (uint32_t) LOADER_SVC_OP_LOAD_OBJECT) {
         unittest_printf("        saw %" PRIu32 ", expected %" PRIu32, load_op,
                         LOADER_SVC_OP_LOAD_OBJECT);
-        return MX_HANDLE_INVALID;
+        return ZX_HANDLE_INVALID;
     }
 
-    mx_handle_t vmo = MX_HANDLE_INVALID;
-    mx_status_t status = launchpad_vmo_from_file(arg, &vmo);
-    EXPECT_EQ(status, MX_OK, "");
-    EXPECT_NE(vmo, MX_HANDLE_INVALID, "launchpad_vmo_from_file");
+    zx_handle_t vmo = ZX_HANDLE_INVALID;
+    zx_status_t status = launchpad_vmo_from_file(arg, &vmo);
+    EXPECT_EQ(status, ZX_OK, "");
+    EXPECT_NE(vmo, ZX_HANDLE_INVALID, "launchpad_vmo_from_file");
     if (status < 0) {
         return status;
     }
 
     my_loader_service_ok = true;
     *out = vmo;
-    return MX_OK;
+    return ZX_OK;
 }
 
 static void show_dlerror(void) {
@@ -104,13 +104,13 @@
         show_dlerror();
 
     // Spin up our test service.
-    mx_handle_t my_service;
-    mx_status_t status = loader_service_simple(&my_loader_service, (void*)TEST_ACTUAL_NAME, &my_service);
-    EXPECT_EQ(status, MX_OK, "mxio_loader_service");
+    zx_handle_t my_service;
+    zx_status_t status = loader_service_simple(&my_loader_service, (void*)TEST_ACTUAL_NAME, &my_service);
+    EXPECT_EQ(status, ZX_OK, "fdio_loader_service");
 
     // Install the service.
-    mx_handle_t old = dl_set_loader_service(my_service);
-    EXPECT_NE(old, MX_HANDLE_INVALID, "dl_set_loader_service");
+    zx_handle_t old = dl_set_loader_service(my_service);
+    EXPECT_NE(old, ZX_HANDLE_INVALID, "dl_set_loader_service");
 
     // Now to a lookup that should go through our service.  It
     // should load up the new copy of the file, find that its
@@ -141,9 +141,9 @@
         show_dlerror();
 
     // Put things back to how they were.
-    mx_handle_t old2 = dl_set_loader_service(old);
+    zx_handle_t old2 = dl_set_loader_service(old);
     EXPECT_EQ(old2, my_service, "unexpected previous service handle");
-    mx_handle_close(old2);
+    zx_handle_close(old2);
 
     END_TEST;
 }
@@ -156,15 +156,15 @@
     int fd = open(DMCTL_PATH, O_RDONLY);
     ASSERT_GE(fd, 0, "can't open " DMCTL_PATH);
 
-    mx_handle_t h = MX_HANDLE_INVALID;
+    zx_handle_t h = ZX_HANDLE_INVALID;
     ssize_t s = ioctl_dmctl_get_loader_service_channel(fd, &h);
     close(fd);
 
-    EXPECT_EQ(s, (ssize_t)sizeof(mx_handle_t),
+    EXPECT_EQ(s, (ssize_t)sizeof(zx_handle_t),
               "unexpected return value from ioctl");
-    EXPECT_NE(h, MX_HANDLE_INVALID, "invalid handle from ioctl");
+    EXPECT_NE(h, ZX_HANDLE_INVALID, "invalid handle from ioctl");
 
-    mx_handle_close(h);
+    zx_handle_close(h);
 
     END_TEST;
 }
diff --git a/system/utest/dlfcn/rules.mk b/system/utest/dlfcn/rules.mk
index fb13450..f9c6e7c 100644
--- a/system/utest/dlfcn/rules.mk
+++ b/system/utest/dlfcn/rules.mk
@@ -17,6 +17,6 @@
 # We don't want it to already be there when we call dlopen, but
 # we use launchpad_vmo_from_file to load it!  So link it statically.
 MODULE_STATIC_LIBS := system/ulib/launchpad system/ulib/elfload
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/dlopen-indirect-deps/rules.mk b/system/utest/dlopen-indirect-deps/rules.mk
index 8d33d5a..55a3de9 100644
--- a/system/utest/dlopen-indirect-deps/rules.mk
+++ b/system/utest/dlopen-indirect-deps/rules.mk
@@ -15,7 +15,7 @@
 
 MODULE_LIBS := \
     system/ulib/unittest \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/driver-tests/main.c b/system/utest/driver-tests/main.c
index fc3fc22..f5ae07e 100644
--- a/system/utest/driver-tests/main.c
+++ b/system/utest/driver-tests/main.c
@@ -12,15 +12,15 @@
 #include <errno.h>
 #include <threads.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/device/device.h>
-#include <magenta/device/test.h>
+#include <zircon/syscalls.h>
+#include <zircon/device/device.h>
+#include <zircon/device/test.h>
 #include <unittest/unittest.h>
 
 #define DRIVER_TEST_DIR "/boot/driver/test"
 #define DEV_TEST "/dev/misc/test"
 
-static void do_one_test(int tfd, const char* drv_libname, mx_handle_t output, test_ioctl_test_report_t* report) {
+static void do_one_test(int tfd, const char* drv_libname, zx_handle_t output, test_ioctl_test_report_t* report) {
     char devpath[1024];
     ssize_t rc = ioctl_test_create_device(tfd, drv_libname, strlen(drv_libname) + 1, devpath, sizeof(devpath));
     if (rc < 0) {
@@ -60,9 +60,9 @@
         goto end_device_opened;
     }
 
-    mx_handle_t h;
-    mx_status_t status = mx_handle_duplicate(output, MX_RIGHT_SAME_RIGHTS, &h);
-    if (status != MX_OK) {
+    zx_handle_t h;
+    zx_status_t status = zx_handle_duplicate(output, ZX_RIGHT_SAME_RIGHTS, &h);
+    if (status != ZX_OK) {
         printf("driver-tests: error %d duplicating output socket\n", status);
         report->n_tests = 1;
         report->n_failed = 1;
@@ -85,16 +85,16 @@
 }
 
 static int output_thread(void* arg) {
-    mx_handle_t h = *(mx_handle_t*)arg;
+    zx_handle_t h = *(zx_handle_t*)arg;
     char buf[1024];
     for (;;) {
-        mx_status_t status = mx_object_wait_one(h, MX_SOCKET_READABLE | MX_SOCKET_PEER_CLOSED, MX_TIME_INFINITE, NULL);
-        if (status != MX_OK) {
+        zx_status_t status = zx_object_wait_one(h, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED, ZX_TIME_INFINITE, NULL);
+        if (status != ZX_OK) {
             break;
         }
         size_t bytes = 0;
-        status = mx_socket_read(h, 0u, buf, sizeof(buf), &bytes);
-        if (status != MX_OK) {
+        status = zx_socket_read(h, 0u, buf, sizeof(buf), &bytes);
+        if (status != ZX_OK) {
             break;
         }
         size_t written = 0;
@@ -110,9 +110,9 @@
 }
 
 int main(int argc, char** argv) {
-    mx_handle_t socket[2];
-    mx_status_t status = mx_socket_create(0u, socket, socket + 1);
-    if (status != MX_OK) {
+    zx_handle_t socket[2];
+    zx_status_t status = zx_socket_create(0u, socket, socket + 1);
+    if (status != ZX_OK) {
         printf("driver-tests: error creating socket\n");
         return -1;
     }
@@ -128,8 +128,8 @@
     if (rc != thrd_success) {
         printf("driver-tests: error %d creating output thread\n", rc);
         close(fd);
-        mx_handle_close(socket[0]);
-        mx_handle_close(socket[1]);
+        zx_handle_close(socket[0]);
+        zx_handle_close(socket[1]);
         return -1;
     }
 
@@ -162,10 +162,10 @@
     close(fd);
 
     // close this handle before thrd_join to get PEER_CLOSED in output thread
-    mx_handle_close(socket[1]);
+    zx_handle_close(socket[1]);
 
     thrd_join(t, NULL);
-    mx_handle_close(socket[0]);
+    zx_handle_close(socket[0]);
 
     unittest_printf_critical(
             "\n====================================================\n");
diff --git a/system/utest/driver-tests/rules.mk b/system/utest/driver-tests/rules.mk
index aa1a16d..71694c2 100644
--- a/system/utest/driver-tests/rules.mk
+++ b/system/utest/driver-tests/rules.mk
@@ -15,6 +15,6 @@
 
 MODULE_NAME := driver-tests
 
-MODULE_LIBS := system/ulib/mxio system/ulib/c system/ulib/magenta system/ulib/unittest
+MODULE_LIBS := system/ulib/fdio system/ulib/c system/ulib/zircon system/ulib/unittest
 
 include make/module.mk
diff --git a/system/utest/dump1/rules.mk b/system/utest/dump1/rules.mk
index eda372e..93799eb 100644
--- a/system/utest/dump1/rules.mk
+++ b/system/utest/dump1/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_NAME := dump1
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/entropy/rules.mk b/system/utest/entropy/rules.mk
index 23be894..5631951 100644
--- a/system/utest/entropy/rules.mk
+++ b/system/utest/entropy/rules.mk
@@ -14,14 +14,14 @@
 MODULE_NAME := entropy-test
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
 
 MODULE_LIBS := \
     system/ulib/unittest \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/errno/errno.c b/system/utest/errno/errno.c
index 47ba66d..d579127 100644
--- a/system/utest/errno/errno.c
+++ b/system/utest/errno/errno.c
@@ -4,7 +4,7 @@
 
 #include <assert.h>
 #include <errno.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 #include <pthread.h>
 #include <stdio.h>
@@ -13,7 +13,7 @@
     int thread_no = *(int*)arg;
     unittest_printf("do_test for thread: %d\n", thread_no);
     errno = -thread_no;
-    mx_nanosleep(mx_deadline_after(MX_MSEC(300)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(300)));
     unittest_printf("comparing result for: %d\n", thread_no);
     EXPECT_EQ(errno, -thread_no, "Incorrect errno for this thread");
     return NULL;
diff --git a/system/utest/errno/rules.mk b/system/utest/errno/rules.mk
index dfe08b8..a8caa8a 100644
--- a/system/utest/errno/rules.mk
+++ b/system/utest/errno/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := errno-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/ethernet/ethernet.cpp b/system/utest/ethernet/ethernet.cpp
index 8d77980..a0eba0c 100644
--- a/system/utest/ethernet/ethernet.cpp
+++ b/system/utest/ethernet/ethernet.cpp
@@ -2,18 +2,18 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/compiler.h>
-#include <magenta/device/device.h>
-#include <magenta/device/ethernet.h>
-#include <magenta/device/ethertap.h>
-#include <magenta/status.h>
-#include <magenta/types.h>
-#include <mx/fifo.h>
-#include <mx/socket.h>
-#include <mx/time.h>
-#include <mx/vmar.h>
-#include <mx/vmo.h>
-#include <mxio/watcher.h>
+#include <zircon/compiler.h>
+#include <zircon/device/device.h>
+#include <zircon/device/ethernet.h>
+#include <zircon/device/ethertap.h>
+#include <zircon/status.h>
+#include <zircon/types.h>
+#include <zx/fifo.h>
+#include <zx/socket.h>
+#include <zx/time.h>
+#include <zx/vmar.h>
+#include <zx/vmo.h>
+#include <fdio/watcher.h>
 #include <fbl/auto_call.h>
 #include <fbl/intrusive_single_list.h>
 #include <fbl/type_support.h>
@@ -36,19 +36,19 @@
 const char kTapDevName[] = "test";
 const uint8_t kTapMac[] = { 0x12, 0x20, 0x30, 0x40, 0x50, 0x60 };
 
-const char* mxstrerror(mx_status_t status) {
-    return mx_status_get_string(status);
+const char* mxstrerror(zx_status_t status) {
+    return zx_status_get_string(status);
 }
 
-mx_status_t CreateEthertap(uint32_t mtu, mx::socket* sock) {
+zx_status_t CreateEthertap(uint32_t mtu, zx::socket* sock) {
     if (sock == nullptr) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     int ctlfd = open(kTapctl, O_RDONLY);
     if (ctlfd < 0) {
         fprintf(stderr, "could not open %s: %s\n", kTapctl, strerror(errno));
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
     auto closer = fbl::MakeAutoCall([ctlfd]() { close(ctlfd); });
 
@@ -61,20 +61,20 @@
 
     ssize_t rc = ioctl_ethertap_config(ctlfd, &config, sock->reset_and_get_address());
     if (rc < 0) {
-        mx_status_t status = static_cast<mx_status_t>(rc);
+        zx_status_t status = static_cast<zx_status_t>(rc);
         fprintf(stderr, "could not configure ethertap device: %s\n", mxstrerror(status));
         return status;
     }
-    return MX_OK;
+    return ZX_OK;
 }
 
-mx_status_t WatchCb(int dirfd, int event, const char* fn, void* cookie) {
-    if (event != WATCH_EVENT_ADD_FILE) return MX_OK;
-    if (!strcmp(fn, ".") || !strcmp(fn, "..")) return MX_OK;
+zx_status_t WatchCb(int dirfd, int event, const char* fn, void* cookie) {
+    if (event != WATCH_EVENT_ADD_FILE) return ZX_OK;
+    if (!strcmp(fn, ".") || !strcmp(fn, "..")) return ZX_OK;
 
     int devfd = openat(dirfd, fn, O_RDONLY);
     if (devfd < 0) {
-        return MX_OK;
+        return ZX_OK;
     }
     auto closer = fbl::MakeAutoCall([devfd]() { close(devfd); });
 
@@ -82,15 +82,15 @@
     eth_info_t info;
     ssize_t rc = ioctl_ethernet_get_info(devfd, &info);
     if (rc < 0) {
-        mx_status_t status = static_cast<mx_status_t>(rc);
+        zx_status_t status = static_cast<zx_status_t>(rc);
         fprintf(stderr, "could not get ethernet info for %s/%s: %s\n", kEthernetDir, fn,
                         mxstrerror(status));
-        // Return MX_OK to keep watching for devices.
-        return MX_OK;
+        // Return ZX_OK to keep watching for devices.
+        return ZX_OK;
     }
     if (!(info.features & ETH_FEATURE_SYNTH)) {
         // Not a match, keep looking.
-        return MX_OK;
+        return ZX_OK;
     }
 
     // Found it!
@@ -100,24 +100,24 @@
     auto fd = reinterpret_cast<int*>(cookie);
     *fd = devfd;
     closer.cancel();
-    return MX_ERR_STOP;
+    return ZX_ERR_STOP;
 }
 
-mx_status_t OpenEthertapDev(int* fd) {
+zx_status_t OpenEthertapDev(int* fd) {
     if (fd == nullptr) {
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
     }
 
     int ethdir = open(kEthernetDir, O_RDONLY);
     if (ethdir < 0) {
         fprintf(stderr, "could not open %s: %s\n", kEthernetDir, strerror(errno));
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     }
 
-    mx_status_t status = mxio_watch_directory(ethdir, WatchCb, mx::deadline_after(MX_SEC(2)),
+    zx_status_t status = fdio_watch_directory(ethdir, WatchCb, zx::deadline_after(ZX_SEC(2)),
                                               reinterpret_cast<void*>(fd));
-    if (status == MX_ERR_STOP) {
-        return MX_OK;
+    if (status == ZX_ERR_STOP) {
+        return ZX_OK;
     } else {
         return status;
     }
@@ -132,21 +132,21 @@
     explicit EthernetClient(int fd) : fd_(fd) {}
     ~EthernetClient() {
         if (mapped_ > 0) {
-            mx::vmar::root_self().unmap(mapped_, vmo_size_);
+            zx::vmar::root_self().unmap(mapped_, vmo_size_);
         }
         close(fd_);
     }
 
-    mx_status_t Register(const char* name, uint32_t nbufs, uint16_t bufsize) {
+    zx_status_t Register(const char* name, uint32_t nbufs, uint16_t bufsize) {
         ssize_t rc = ioctl_ethernet_set_client_name(fd_, name, strlen(name) + 1);
         if (rc < 0) {
-            return static_cast<mx_status_t>(rc);
+            return static_cast<zx_status_t>(rc);
         }
 
         eth_fifos_t fifos;
         rc = ioctl_ethernet_get_fifos(fd_, &fifos);
         if (rc < 0) {
-            return static_cast<mx_status_t>(rc);
+            return static_cast<zx_status_t>(rc);
         }
 
         tx_.reset(fifos.tx_fifo);
@@ -158,28 +158,28 @@
         bufsize_ = bufsize;
 
         vmo_size_ = 2 * nbufs_ * bufsize_;
-        mx_status_t status = mx::vmo::create(vmo_size_, 0u, &buf_);
-        if (status != MX_OK) {
+        zx_status_t status = zx::vmo::create(vmo_size_, 0u, &buf_);
+        if (status != ZX_OK) {
             return status;
         }
 
-        status = mx::vmar::root_self().map(0, buf_, 0, vmo_size_,
-                                           MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+        status = zx::vmar::root_self().map(0, buf_, 0, vmo_size_,
+                                           ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                                            &mapped_);
-        if (status != MX_OK) {
+        if (status != ZX_OK) {
             return status;
         }
 
-        mx::vmo buf_copy;
-        status = buf_.duplicate(MX_RIGHT_SAME_RIGHTS, &buf_copy);
-        if (status != MX_OK) {
+        zx::vmo buf_copy;
+        status = buf_.duplicate(ZX_RIGHT_SAME_RIGHTS, &buf_copy);
+        if (status != ZX_OK) {
             return status;
         }
 
-        mx_handle_t bufh = buf_copy.release();
+        zx_handle_t bufh = buf_copy.release();
         rc = ioctl_ethernet_set_iobuf(fd_, &bufh);
         if (rc < 0) {
-            return static_cast<mx_status_t>(rc);
+            return static_cast<zx_status_t>(rc);
         }
 
         uint32_t idx = 0;
@@ -192,7 +192,7 @@
             };
             uint32_t actual;
             status = rx_.write(&entry, sizeof(entry), &actual);
-            if (status != MX_OK) {
+            if (status != ZX_OK) {
                 return status;
             }
         }
@@ -206,26 +206,26 @@
             tx_available_.push_front(fbl::move(entry));
         }
 
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t Start() {
+    zx_status_t Start() {
         ssize_t rc = ioctl_ethernet_start(fd_);
-        return rc < 0 ? static_cast<mx_status_t>(rc) : MX_OK;
+        return rc < 0 ? static_cast<zx_status_t>(rc) : ZX_OK;
     }
 
-    mx_status_t Stop() {
+    zx_status_t Stop() {
         ssize_t rc = ioctl_ethernet_stop(fd_);
-        return rc < 0 ? static_cast<mx_status_t>(rc) : MX_OK;
+        return rc < 0 ? static_cast<zx_status_t>(rc) : ZX_OK;
     }
 
-    mx_status_t GetStatus(uint32_t* eth_status) {
+    zx_status_t GetStatus(uint32_t* eth_status) {
         ssize_t rc = ioctl_ethernet_get_status(fd_, eth_status);
-        return rc < 0 ? static_cast<mx_status_t>(rc) : MX_OK;
+        return rc < 0 ? static_cast<zx_status_t>(rc) : ZX_OK;
     }
 
-    mx::fifo* tx_fifo() { return &tx_; }
-    mx::fifo* rx_fifo() { return &rx_; }
+    zx::fifo* tx_fifo() { return &tx_; }
+    zx::fifo* rx_fifo() { return &rx_; }
     uint32_t tx_depth() { return tx_depth_; }
     uint32_t rx_depth() { return rx_depth_; }
 
@@ -255,13 +255,13 @@
     int fd_;
 
     uint64_t vmo_size_ = 0;
-    mx::vmo buf_;
+    zx::vmo buf_;
     uintptr_t mapped_ = 0;
     uint32_t nbufs_ = 0;
     uint16_t bufsize_ = 0;
 
-    mx::fifo tx_;
-    mx::fifo rx_;
+    zx::fifo tx_;
+    zx::fifo rx_;
     uint32_t tx_depth_ = 0;
     uint32_t rx_depth_ = 0;
 
@@ -274,43 +274,43 @@
 
 static bool EthernetStartTest() {
     // Create the ethertap device
-    mx::socket sock;
-    ASSERT_EQ(MX_OK, CreateEthertap(1500, &sock));
+    zx::socket sock;
+    ASSERT_EQ(ZX_OK, CreateEthertap(1500, &sock));
 
     // Open the ethernet device
     int devfd = -1;
-    ASSERT_EQ(MX_OK, OpenEthertapDev(&devfd));
+    ASSERT_EQ(ZX_OK, OpenEthertapDev(&devfd));
     ASSERT_GE(devfd, 0);
 
     // Set up an ethernet client
     EthernetClient client(devfd);
-    ASSERT_EQ(MX_OK, client.Register(kTapDevName, 32, 2048));
+    ASSERT_EQ(ZX_OK, client.Register(kTapDevName, 32, 2048));
 
     // Verify no signals asserted on the rx fifo
-    mx_signals_t obs;
+    zx_signals_t obs;
     client.rx_fifo()->wait_one(ETH_SIGNAL_STATUS, 0, &obs);
     EXPECT_FALSE(obs & ETH_SIGNAL_STATUS);
 
     // Start the ethernet client
-    EXPECT_EQ(MX_OK, client.Start());
+    EXPECT_EQ(ZX_OK, client.Start());
 
     // Default link status should be OFFLINE
     uint32_t eth_status = 0;
-    EXPECT_EQ(MX_OK, client.GetStatus(&eth_status));
+    EXPECT_EQ(ZX_OK, client.GetStatus(&eth_status));
     EXPECT_EQ(0, eth_status);
 
     // Set the link status to online and verify
     sock.signal_peer(0, ETHERTAP_SIGNAL_ONLINE);
 
-    EXPECT_EQ(MX_OK,
-            client.rx_fifo()->wait_one(ETH_SIGNAL_STATUS, mx::deadline_after(MX_MSEC(10)), &obs));
+    EXPECT_EQ(ZX_OK,
+            client.rx_fifo()->wait_one(ETH_SIGNAL_STATUS, zx::deadline_after(ZX_MSEC(10)), &obs));
     EXPECT_TRUE(obs & ETH_SIGNAL_STATUS);
 
-    EXPECT_EQ(MX_OK, client.GetStatus(&eth_status));
+    EXPECT_EQ(ZX_OK, client.GetStatus(&eth_status));
     EXPECT_EQ(ETH_STATUS_ONLINE, eth_status);
 
     // Shutdown the ethernet client
-    EXPECT_EQ(MX_OK, client.Stop());
+    EXPECT_EQ(ZX_OK, client.Stop());
 
     // Clean up the ethertap device
     sock.reset();
@@ -320,43 +320,43 @@
 
 static bool EthernetLinkStatusTest() {
     // Create the ethertap device
-    mx::socket sock;
-    ASSERT_EQ(MX_OK, CreateEthertap(1500, &sock));
+    zx::socket sock;
+    ASSERT_EQ(ZX_OK, CreateEthertap(1500, &sock));
 
     // Set the link status to online
     sock.signal_peer(0, ETHERTAP_SIGNAL_ONLINE);
 
     // Open the ethernet device
     int devfd = -1;
-    ASSERT_EQ(MX_OK, OpenEthertapDev(&devfd));
+    ASSERT_EQ(ZX_OK, OpenEthertapDev(&devfd));
     ASSERT_GE(devfd, 0);
 
     // Set up an ethernet client
     EthernetClient client(devfd);
-    ASSERT_EQ(MX_OK, client.Register(kTapDevName, 32, 2048));
+    ASSERT_EQ(ZX_OK, client.Register(kTapDevName, 32, 2048));
 
     // Start the ethernet client
-    EXPECT_EQ(MX_OK, client.Start());
+    EXPECT_EQ(ZX_OK, client.Start());
 
     // Link status should be ONLINE since we set it before starting the client
     uint32_t eth_status = 0;
-    EXPECT_EQ(MX_OK, client.GetStatus(&eth_status));
+    EXPECT_EQ(ZX_OK, client.GetStatus(&eth_status));
     EXPECT_EQ(ETH_STATUS_ONLINE, eth_status);
 
     // Now the device goes offline
     sock.signal_peer(0, ETHERTAP_SIGNAL_OFFLINE);
 
     // Verify the link status
-    mx_signals_t obs;
-    EXPECT_EQ(MX_OK,
-            client.rx_fifo()->wait_one(ETH_SIGNAL_STATUS, mx::deadline_after(MX_MSEC(10)), &obs));
+    zx_signals_t obs;
+    EXPECT_EQ(ZX_OK,
+            client.rx_fifo()->wait_one(ETH_SIGNAL_STATUS, zx::deadline_after(ZX_MSEC(10)), &obs));
     EXPECT_TRUE(obs & ETH_SIGNAL_STATUS);
 
-    EXPECT_EQ(MX_OK, client.GetStatus(&eth_status));
+    EXPECT_EQ(ZX_OK, client.GetStatus(&eth_status));
     EXPECT_EQ(0, eth_status);
 
     // Shutdown the ethernet client
-    EXPECT_EQ(MX_OK, client.Stop());
+    EXPECT_EQ(ZX_OK, client.Stop());
 
     // Clean up the ethertap device
     sock.reset();
@@ -366,23 +366,23 @@
 
 static bool EthernetDataTest_Send() {
     // Set up the tap device and the ethernet client
-    mx::socket sock;
-    ASSERT_EQ(MX_OK, CreateEthertap(1500, &sock));
+    zx::socket sock;
+    ASSERT_EQ(ZX_OK, CreateEthertap(1500, &sock));
 
     int devfd = -1;
-    ASSERT_EQ(MX_OK, OpenEthertapDev(&devfd));
+    ASSERT_EQ(ZX_OK, OpenEthertapDev(&devfd));
     ASSERT_GE(devfd, 0);
 
     EthernetClient client(devfd);
-    ASSERT_EQ(MX_OK, client.Register(kTapDevName, 32, 2048));
-    ASSERT_EQ(MX_OK, client.Start());
+    ASSERT_EQ(ZX_OK, client.Register(kTapDevName, 32, 2048));
+    ASSERT_EQ(ZX_OK, client.Start());
 
     sock.signal_peer(0, ETHERTAP_SIGNAL_ONLINE);
 
     // Ensure that the fifo is writable
-    mx_signals_t obs;
-    EXPECT_EQ(MX_OK, client.tx_fifo()->wait_one(MX_FIFO_WRITABLE, 0, &obs));
-    ASSERT_TRUE(obs & MX_FIFO_WRITABLE);
+    zx_signals_t obs;
+    EXPECT_EQ(ZX_OK, client.tx_fifo()->wait_one(ZX_FIFO_WRITABLE, 0, &obs));
+    ASSERT_TRUE(obs & ZX_FIFO_WRITABLE);
 
     // Grab an available TX fifo entry
     auto entry = client.GetTxBuffer();
@@ -397,27 +397,27 @@
 
     // Write to the TX fifo
     uint32_t actual = 0;
-    ASSERT_EQ(MX_OK, client.tx_fifo()->write(entry, sizeof(eth_fifo_entry_t), &actual));
+    ASSERT_EQ(ZX_OK, client.tx_fifo()->write(entry, sizeof(eth_fifo_entry_t), &actual));
     EXPECT_EQ(1u, actual);
 
     // The socket should be readable
-    EXPECT_EQ(MX_OK, sock.wait_one(MX_SOCKET_READABLE, mx::deadline_after(MX_MSEC(10)), &obs));
-    ASSERT_TRUE(obs & MX_SOCKET_READABLE);
+    EXPECT_EQ(ZX_OK, sock.wait_one(ZX_SOCKET_READABLE, zx::deadline_after(ZX_MSEC(10)), &obs));
+    ASSERT_TRUE(obs & ZX_SOCKET_READABLE);
 
     // Read the data from the socket, which should match what was written to the fifo
     uint8_t read_buf[32];
     size_t actual_sz = 0;
-    EXPECT_EQ(MX_OK, sock.read(0u, static_cast<void*>(read_buf), 32, &actual_sz));
+    EXPECT_EQ(ZX_OK, sock.read(0u, static_cast<void*>(read_buf), 32, &actual_sz));
     ASSERT_EQ(32, actual_sz);
     EXPECT_BYTES_EQ(buf, read_buf, 32, "");
 
     // Now the TX completion entry should be available to read from the TX fifo
-    EXPECT_EQ(MX_OK,
-            client.tx_fifo()->wait_one(MX_FIFO_READABLE, mx::deadline_after(MX_MSEC(10)), &obs));
-    ASSERT_TRUE(obs & MX_FIFO_READABLE);
+    EXPECT_EQ(ZX_OK,
+            client.tx_fifo()->wait_one(ZX_FIFO_READABLE, zx::deadline_after(ZX_MSEC(10)), &obs));
+    ASSERT_TRUE(obs & ZX_FIFO_READABLE);
 
     eth_fifo_entry_t return_entry;
-    ASSERT_EQ(MX_OK, client.tx_fifo()->read(&return_entry, sizeof(eth_fifo_entry_t), &actual));
+    ASSERT_EQ(ZX_OK, client.tx_fifo()->read(&return_entry, sizeof(eth_fifo_entry_t), &actual));
     EXPECT_EQ(1u, actual);
 
     // Check the flags on the returned entry
@@ -434,7 +434,7 @@
     client.ReturnTxBuffer(&return_entry);
 
     // Shutdown the client and cleanup the tap device
-    EXPECT_EQ(MX_OK, client.Stop());
+    EXPECT_EQ(ZX_OK, client.Stop());
     sock.reset();
 
     return true;
@@ -442,23 +442,23 @@
 
 static bool EthernetDataTest_Recv() {
     // Set up the tap device and the ethernet client
-    mx::socket sock;
-    ASSERT_EQ(MX_OK, CreateEthertap(1500, &sock));
+    zx::socket sock;
+    ASSERT_EQ(ZX_OK, CreateEthertap(1500, &sock));
 
     int devfd = -1;
-    ASSERT_EQ(MX_OK, OpenEthertapDev(&devfd));
+    ASSERT_EQ(ZX_OK, OpenEthertapDev(&devfd));
     ASSERT_GE(devfd, 0);
 
     EthernetClient client(devfd);
-    ASSERT_EQ(MX_OK, client.Register(kTapDevName, 32, 2048));
-    ASSERT_EQ(MX_OK, client.Start());
+    ASSERT_EQ(ZX_OK, client.Register(kTapDevName, 32, 2048));
+    ASSERT_EQ(ZX_OK, client.Start());
 
     sock.signal_peer(0, ETHERTAP_SIGNAL_ONLINE);
 
     // The socket should be writable
-    mx_signals_t obs;
-    EXPECT_EQ(MX_OK, sock.wait_one(MX_SOCKET_WRITABLE, 0, &obs));
-    ASSERT_TRUE(obs & MX_SOCKET_WRITABLE);
+    zx_signals_t obs;
+    EXPECT_EQ(ZX_OK, sock.wait_one(ZX_SOCKET_WRITABLE, 0, &obs));
+    ASSERT_TRUE(obs & ZX_SOCKET_WRITABLE);
 
     // Send a buffer through the socket
     uint8_t buf[32];
@@ -466,18 +466,18 @@
         buf[i] = static_cast<uint8_t>(i & 0xff);
     }
     size_t actual = 0;
-    EXPECT_EQ(MX_OK, sock.write(0, static_cast<void*>(buf), 32, &actual));
+    EXPECT_EQ(ZX_OK, sock.write(0, static_cast<void*>(buf), 32, &actual));
     EXPECT_EQ(32, actual);
 
     // The fifo should be readable
-    EXPECT_EQ(MX_OK,
-            client.rx_fifo()->wait_one(MX_FIFO_READABLE, mx::deadline_after(MX_MSEC(10)), &obs));
-    ASSERT_TRUE(obs & MX_FIFO_READABLE);
+    EXPECT_EQ(ZX_OK,
+            client.rx_fifo()->wait_one(ZX_FIFO_READABLE, zx::deadline_after(ZX_MSEC(10)), &obs));
+    ASSERT_TRUE(obs & ZX_FIFO_READABLE);
 
     // Read the RX fifo
     eth_fifo_entry_t entry;
     uint32_t actual_entries = 0;
-    EXPECT_EQ(MX_OK, client.rx_fifo()->read(&entry, sizeof(eth_fifo_entry_t), &actual_entries));
+    EXPECT_EQ(ZX_OK, client.rx_fifo()->read(&entry, sizeof(eth_fifo_entry_t), &actual_entries));
     EXPECT_EQ(1, actual_entries);
 
     // Check the bytes in the VMO compared to what we sent through the socket
@@ -485,15 +485,15 @@
     EXPECT_BYTES_EQ(buf, return_buf, entry.length, "");
 
     // RX fifo should be readable, and we can return the buffer to the driver
-    EXPECT_EQ(MX_OK, client.rx_fifo()->wait_one(MX_FIFO_WRITABLE, 0, &obs));
-    ASSERT_TRUE(obs & MX_FIFO_WRITABLE);
+    EXPECT_EQ(ZX_OK, client.rx_fifo()->wait_one(ZX_FIFO_WRITABLE, 0, &obs));
+    ASSERT_TRUE(obs & ZX_FIFO_WRITABLE);
 
     entry.length = 2048;
-    EXPECT_EQ(MX_OK, client.rx_fifo()->write(&entry, sizeof(eth_fifo_entry_t), &actual_entries));
+    EXPECT_EQ(ZX_OK, client.rx_fifo()->write(&entry, sizeof(eth_fifo_entry_t), &actual_entries));
     EXPECT_EQ(1, actual_entries);
 
     // Shutdown the client and cleanup the tap device
-    EXPECT_EQ(MX_OK, client.Stop());
+    EXPECT_EQ(ZX_OK, client.Stop());
     sock.reset();
 
     return true;
diff --git a/system/utest/ethernet/rules.mk b/system/utest/ethernet/rules.mk
index d2c88d8..a17d122 100644
--- a/system/utest/ethernet/rules.mk
+++ b/system/utest/ethernet/rules.mk
@@ -14,13 +14,13 @@
 MODULE_NAME := ethernet-test
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/unittest \
     system/ulib/c \
 
diff --git a/system/utest/events/events.c b/system/utest/events/events.c
index 78cce59..346f80e 100644
--- a/system/utest/events/events.c
+++ b/system/utest/events/events.c
@@ -9,59 +9,59 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
-static bool wait(mx_handle_t event, mx_handle_t quit_event) {
-    mx_status_t ms;
-    mx_wait_item_t items[2];
-    items[0].waitfor = MX_EVENT_SIGNALED;
+static bool wait(zx_handle_t event, zx_handle_t quit_event) {
+    zx_status_t ms;
+    zx_wait_item_t items[2];
+    items[0].waitfor = ZX_EVENT_SIGNALED;
     items[0].handle = event;
-    items[1].waitfor = MX_EVENT_SIGNALED;
+    items[1].waitfor = ZX_EVENT_SIGNALED;
     items[1].handle = quit_event;
 
-    ms = mx_object_wait_many(items, 2, MX_TIME_INFINITE);
+    ms = zx_object_wait_many(items, 2, ZX_TIME_INFINITE);
     if (ms < 0)
         return false;
 
-    return (items[1].pending & MX_EVENT_SIGNALED);
+    return (items[1].pending & ZX_EVENT_SIGNALED);
 }
 
-static bool wait_user(mx_handle_t event, mx_handle_t quit_event, mx_signals_t user_signal) {
-    mx_status_t ms;
+static bool wait_user(zx_handle_t event, zx_handle_t quit_event, zx_signals_t user_signal) {
+    zx_status_t ms;
 
-    mx_wait_item_t items[2];
+    zx_wait_item_t items[2];
     items[0].waitfor = user_signal;
     items[0].handle = event;
-    items[1].waitfor = MX_EVENT_SIGNALED;
+    items[1].waitfor = ZX_EVENT_SIGNALED;
     items[1].handle = quit_event;
 
-    ms = mx_object_wait_many(items, 2, MX_TIME_INFINITE);
+    ms = zx_object_wait_many(items, 2, ZX_TIME_INFINITE);
     if (ms < 0)
         return false;
 
-    return (items[1].pending & MX_EVENT_SIGNALED);
+    return (items[1].pending & ZX_EVENT_SIGNALED);
 }
 
 static int thread_fn_1(void* arg) {
-    mx_handle_t* events = (mx_handle_t*)(arg);
+    zx_handle_t* events = (zx_handle_t*)(arg);
 
     do {
-        mx_nanosleep(mx_deadline_after(MX_MSEC(200)));
-        mx_status_t status = mx_object_signal(events[1], 0u, MX_EVENT_SIGNALED);
-        assert(status == MX_OK);
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(200)));
+        zx_status_t status = zx_object_signal(events[1], 0u, ZX_EVENT_SIGNALED);
+        assert(status == ZX_OK);
     } while (!wait(events[2], events[0]));
 
     return 0;
 }
 
 static int thread_fn_2(void* arg) {
-    mx_handle_t* events = (mx_handle_t*)(arg);
+    zx_handle_t* events = (zx_handle_t*)(arg);
 
     while (!wait(events[1], events[0])) {
-        mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
-        mx_status_t status = mx_object_signal(events[2], 0u, MX_EVENT_SIGNALED);
-        assert(status == MX_OK);
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
+        zx_status_t status = zx_object_signal(events[2], 0u, ZX_EVENT_SIGNALED);
+        assert(status == ZX_OK);
     }
 
     return 0;
@@ -70,10 +70,10 @@
 static bool basic_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t events[3];
-    ASSERT_EQ(mx_event_create(0u, &events[0]), 0, "Error during event create");
-    ASSERT_EQ(mx_event_create(0u, &events[1]), 0, "Error during event create");
-    ASSERT_EQ(mx_event_create(0u, &events[2]), 0, "Error during event create");
+    zx_handle_t events[3];
+    ASSERT_EQ(zx_event_create(0u, &events[0]), 0, "Error during event create");
+    ASSERT_EQ(zx_event_create(0u, &events[1]), 0, "Error during event create");
+    ASSERT_EQ(zx_event_create(0u, &events[2]), 0, "Error during event create");
 
     thrd_t threads[4];
     int ret = thrd_create_with_name(&threads[3], thread_fn_1, events, "master");
@@ -84,36 +84,36 @@
         ASSERT_EQ(ret, thrd_success, "Error during thread creation");
     }
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(400)));
-    mx_object_signal(events[0], 0u, MX_EVENT_SIGNALED);
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(400)));
+    zx_object_signal(events[0], 0u, ZX_EVENT_SIGNALED);
 
     for (int ix = 0; ix != 4; ++ix) {
         ASSERT_EQ(thrd_join(threads[ix], NULL), thrd_success, "Error during wait");
     }
 
-    ASSERT_GE(mx_handle_close(events[0]), 0, "Error during event-0 close");
-    ASSERT_GE(mx_handle_close(events[1]), 0, "Error during event-1 close");
-    ASSERT_GE(mx_handle_close(events[2]), 0, "Error during event-2 close");
+    ASSERT_GE(zx_handle_close(events[0]), 0, "Error during event-0 close");
+    ASSERT_GE(zx_handle_close(events[1]), 0, "Error during event-1 close");
+    ASSERT_GE(zx_handle_close(events[2]), 0, "Error during event-2 close");
     END_TEST;
 }
 
 static int thread_fn_3(void* arg) {
-    mx_handle_t* events = (mx_handle_t*)(arg);
+    zx_handle_t* events = (zx_handle_t*)(arg);
 
     do {
-        mx_nanosleep(mx_deadline_after(MX_MSEC(200)));
-        mx_object_signal(events[1], MX_USER_SIGNAL_ALL, MX_USER_SIGNAL_1);
-    } while (!wait_user(events[2], events[0], MX_USER_SIGNAL_2));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(200)));
+        zx_object_signal(events[1], ZX_USER_SIGNAL_ALL, ZX_USER_SIGNAL_1);
+    } while (!wait_user(events[2], events[0], ZX_USER_SIGNAL_2));
 
     return 0;
 }
 
 static int thread_fn_4(void* arg) {
-    mx_handle_t* events = (mx_handle_t*)(arg);
+    zx_handle_t* events = (zx_handle_t*)(arg);
 
-    while (!wait_user(events[1], events[0], MX_USER_SIGNAL_1)) {
-        mx_nanosleep(mx_deadline_after(MX_MSEC(100)));
-        mx_object_signal(events[2], MX_USER_SIGNAL_ALL, MX_USER_SIGNAL_2);
+    while (!wait_user(events[1], events[0], ZX_USER_SIGNAL_1)) {
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(100)));
+        zx_object_signal(events[2], ZX_USER_SIGNAL_ALL, ZX_USER_SIGNAL_2);
     }
 
     return 0;
@@ -122,10 +122,10 @@
 static bool user_signals_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t events[3];
-    ASSERT_GE(mx_event_create(0U, &events[0]), 0, "Error during event create");
-    ASSERT_GE(mx_event_create(0U, &events[1]), 0, "Error during event create");
-    ASSERT_GE(mx_event_create(0U, &events[2]), 0, "Error during event create");
+    zx_handle_t events[3];
+    ASSERT_GE(zx_event_create(0U, &events[0]), 0, "Error during event create");
+    ASSERT_GE(zx_event_create(0U, &events[1]), 0, "Error during event create");
+    ASSERT_GE(zx_event_create(0U, &events[2]), 0, "Error during event create");
 
     thrd_t threads[4];
     int ret = thrd_create_with_name(&threads[3], thread_fn_3, events, "master");
@@ -136,24 +136,24 @@
         ASSERT_EQ(ret, thrd_success, "Error during thread creation");
     }
 
-    mx_nanosleep(mx_deadline_after(MX_MSEC(400)));
-    mx_object_signal(events[0], 0u, MX_EVENT_SIGNALED);
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(400)));
+    zx_object_signal(events[0], 0u, ZX_EVENT_SIGNALED);
 
     for (int ix = 0; ix != 4; ++ix) {
         ASSERT_EQ(thrd_join(threads[ix], NULL), thrd_success, "Error during wait");
     }
 
-    ASSERT_GE(mx_handle_close(events[0]), 0, "Error during event-0 close");
-    ASSERT_GE(mx_handle_close(events[1]), 0, "Error during event-1 close");
-    ASSERT_GE(mx_handle_close(events[2]), 0, "Error during event-2 close");
+    ASSERT_GE(zx_handle_close(events[0]), 0, "Error during event-0 close");
+    ASSERT_GE(zx_handle_close(events[1]), 0, "Error during event-1 close");
+    ASSERT_GE(zx_handle_close(events[2]), 0, "Error during event-2 close");
     END_TEST;
 }
 
 static int thread_fn_closer(void* arg) {
-    mx_nanosleep(mx_deadline_after(MX_MSEC(200)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(200)));
 
-    mx_handle_t handle = *((mx_handle_t*)arg);
-    int rc = (int)mx_handle_close(handle);
+    zx_handle_t handle = *((zx_handle_t*)arg);
+    int rc = (int)zx_handle_close(handle);
 
     return rc;
 }
@@ -161,91 +161,91 @@
 static bool wait_signals_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t events[3];
-    ASSERT_EQ(mx_event_create(0U, &events[0]), 0, "Error during event create");
-    ASSERT_EQ(mx_event_create(0U, &events[1]), 0, "Error during event create");
-    ASSERT_EQ(mx_event_create(0U, &events[2]), 0, "Error during event create");
+    zx_handle_t events[3];
+    ASSERT_EQ(zx_event_create(0U, &events[0]), 0, "Error during event create");
+    ASSERT_EQ(zx_event_create(0U, &events[1]), 0, "Error during event create");
+    ASSERT_EQ(zx_event_create(0U, &events[2]), 0, "Error during event create");
 
-    mx_status_t status;
-    mx_signals_t pending;
+    zx_status_t status;
+    zx_signals_t pending;
 
-    mx_wait_item_t items[3];
-    items[0].waitfor = MX_EVENT_SIGNALED;
+    zx_wait_item_t items[3];
+    items[0].waitfor = ZX_EVENT_SIGNALED;
     items[0].handle = events[0];
-    items[1].waitfor = MX_EVENT_SIGNALED;
+    items[1].waitfor = ZX_EVENT_SIGNALED;
     items[1].handle = events[1];
-    items[2].waitfor = MX_EVENT_SIGNALED;
+    items[2].waitfor = ZX_EVENT_SIGNALED;
     items[2].handle = events[2];
 
-    status = mx_object_wait_one(events[0], MX_EVENT_SIGNALED, mx_deadline_after(1u), &pending);
-    ASSERT_EQ(status, MX_ERR_TIMED_OUT, "wait should have timeout");
-    ASSERT_EQ(pending, MX_SIGNAL_LAST_HANDLE, "");
+    status = zx_object_wait_one(events[0], ZX_EVENT_SIGNALED, zx_deadline_after(1u), &pending);
+    ASSERT_EQ(status, ZX_ERR_TIMED_OUT, "wait should have timeout");
+    ASSERT_EQ(pending, ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_object_wait_many(items, 3, mx_deadline_after(1));
-    ASSERT_EQ(status, MX_ERR_TIMED_OUT, "wait should have timeout");
-    ASSERT_EQ(items[0].pending, MX_SIGNAL_LAST_HANDLE, "");
-    ASSERT_EQ(items[1].pending, MX_SIGNAL_LAST_HANDLE, "");
-    ASSERT_EQ(items[2].pending, MX_SIGNAL_LAST_HANDLE, "");
+    status = zx_object_wait_many(items, 3, zx_deadline_after(1));
+    ASSERT_EQ(status, ZX_ERR_TIMED_OUT, "wait should have timeout");
+    ASSERT_EQ(items[0].pending, ZX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(items[1].pending, ZX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(items[2].pending, ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_object_wait_one(events[0], MX_EVENT_SIGNALED, 0u, &pending);
-    ASSERT_EQ(status, MX_ERR_TIMED_OUT, "wait should have timeout");
-    ASSERT_EQ(pending, MX_SIGNAL_LAST_HANDLE, "");
+    status = zx_object_wait_one(events[0], ZX_EVENT_SIGNALED, 0u, &pending);
+    ASSERT_EQ(status, ZX_ERR_TIMED_OUT, "wait should have timeout");
+    ASSERT_EQ(pending, ZX_SIGNAL_LAST_HANDLE, "");
 
-    status = mx_object_wait_many(items, 3, 0);
-    ASSERT_EQ(status, MX_ERR_TIMED_OUT, "wait should have timeout");
-    ASSERT_EQ(items[0].pending, MX_SIGNAL_LAST_HANDLE, "");
-    ASSERT_EQ(items[1].pending, MX_SIGNAL_LAST_HANDLE, "");
-    ASSERT_EQ(items[2].pending, MX_SIGNAL_LAST_HANDLE, "");
+    status = zx_object_wait_many(items, 3, 0);
+    ASSERT_EQ(status, ZX_ERR_TIMED_OUT, "wait should have timeout");
+    ASSERT_EQ(items[0].pending, ZX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(items[1].pending, ZX_SIGNAL_LAST_HANDLE, "");
+    ASSERT_EQ(items[2].pending, ZX_SIGNAL_LAST_HANDLE, "");
 
-    ASSERT_GE(mx_object_signal(events[0], 0u, MX_EVENT_SIGNALED), 0, "Error during event signal");
+    ASSERT_GE(zx_object_signal(events[0], 0u, ZX_EVENT_SIGNALED), 0, "Error during event signal");
 
-    status = mx_object_wait_one(events[0], MX_EVENT_SIGNALED, mx_deadline_after(1u), &pending);
+    status = zx_object_wait_one(events[0], ZX_EVENT_SIGNALED, zx_deadline_after(1u), &pending);
     ASSERT_EQ(status, 0, "wait failed");
-    ASSERT_EQ(pending, MX_EVENT_SIGNALED | MX_SIGNAL_LAST_HANDLE, "Error during wait call");
+    ASSERT_EQ(pending, ZX_EVENT_SIGNALED | ZX_SIGNAL_LAST_HANDLE, "Error during wait call");
 
-    status = mx_object_wait_many(items, 3, mx_deadline_after(1));
+    status = zx_object_wait_many(items, 3, zx_deadline_after(1));
     ASSERT_EQ(status, 0, "wait failed");
     ASSERT_EQ(items[0].pending,
-        MX_EVENT_SIGNALED | MX_SIGNAL_LAST_HANDLE, "Error during wait call");
+        ZX_EVENT_SIGNALED | ZX_SIGNAL_LAST_HANDLE, "Error during wait call");
 
-    status = mx_object_wait_one(events[0], MX_EVENT_SIGNALED, 0u, &pending);
-    ASSERT_EQ(status, MX_OK, "wait failed");
-    ASSERT_EQ(pending, MX_EVENT_SIGNALED | MX_SIGNAL_LAST_HANDLE, "Error during wait call");
+    status = zx_object_wait_one(events[0], ZX_EVENT_SIGNALED, 0u, &pending);
+    ASSERT_EQ(status, ZX_OK, "wait failed");
+    ASSERT_EQ(pending, ZX_EVENT_SIGNALED | ZX_SIGNAL_LAST_HANDLE, "Error during wait call");
 
-    ASSERT_GE(mx_object_signal(events[0], MX_EVENT_SIGNALED, 0u), 0, "Error during event reset");
-    ASSERT_GE(mx_object_signal(events[2], 0u, MX_EVENT_SIGNALED), 0, "Error during event signal");
-    status = mx_object_wait_many(items, 3, mx_deadline_after(1));
+    ASSERT_GE(zx_object_signal(events[0], ZX_EVENT_SIGNALED, 0u), 0, "Error during event reset");
+    ASSERT_GE(zx_object_signal(events[2], 0u, ZX_EVENT_SIGNALED), 0, "Error during event signal");
+    status = zx_object_wait_many(items, 3, zx_deadline_after(1));
     ASSERT_EQ(status, 0, "wait failed");
     ASSERT_EQ(items[2].pending,
-        MX_EVENT_SIGNALED | MX_SIGNAL_LAST_HANDLE, "Error during wait call");
+        ZX_EVENT_SIGNALED | ZX_SIGNAL_LAST_HANDLE, "Error during wait call");
 
     thrd_t thread;
     int ret = thrd_create_with_name(&thread, thread_fn_closer, &events[1], "closer");
     ASSERT_EQ(ret, thrd_success, "Error during thread creation");
 
-    status = mx_object_wait_one(events[1], MX_EVENT_SIGNALED, MX_TIME_INFINITE, NULL);
-    ASSERT_EQ(status, MX_ERR_CANCELED, "Error during wait");
+    status = zx_object_wait_one(events[1], ZX_EVENT_SIGNALED, ZX_TIME_INFINITE, NULL);
+    ASSERT_EQ(status, ZX_ERR_CANCELED, "Error during wait");
 
     ASSERT_EQ(thrd_join(thread, NULL), thrd_success, "Error during thread close");
 
-    ASSERT_GE(mx_handle_close(events[0]), 0, "Error during event-0 close");
-    ASSERT_GE(mx_handle_close(events[2]), 0, "Error during event-2 close");
+    ASSERT_GE(zx_handle_close(events[0]), 0, "Error during event-0 close");
+    ASSERT_GE(zx_handle_close(events[2]), 0, "Error during event-2 close");
 
     END_TEST;
 }
 
 static bool reset_test(void) {
     BEGIN_TEST;
-    mx_handle_t event;
-    ASSERT_EQ(mx_event_create(0U, &event), 0, "Error during event creation");
-    ASSERT_GE(mx_object_signal(event, 0u, MX_EVENT_SIGNALED), 0, "Error during event signal");
-    ASSERT_GE(mx_object_signal(event, MX_EVENT_SIGNALED, 0u), 0, "Error during event reset");
+    zx_handle_t event;
+    ASSERT_EQ(zx_event_create(0U, &event), 0, "Error during event creation");
+    ASSERT_GE(zx_object_signal(event, 0u, ZX_EVENT_SIGNALED), 0, "Error during event signal");
+    ASSERT_GE(zx_object_signal(event, ZX_EVENT_SIGNALED, 0u), 0, "Error during event reset");
 
-    mx_status_t status;
-    status = mx_object_wait_one(event, MX_EVENT_SIGNALED, mx_deadline_after(1u), NULL);
-    ASSERT_EQ(status, MX_ERR_TIMED_OUT, "wait should have timeout");
+    zx_status_t status;
+    status = zx_object_wait_one(event, ZX_EVENT_SIGNALED, zx_deadline_after(1u), NULL);
+    ASSERT_EQ(status, ZX_ERR_TIMED_OUT, "wait should have timeout");
 
-    ASSERT_EQ(mx_handle_close(event), MX_OK, "error during handle close");
+    ASSERT_EQ(zx_handle_close(event), ZX_OK, "error during handle close");
 
     END_TEST;
 }
@@ -253,28 +253,28 @@
 static bool wait_many_failures_test(void) {
     BEGIN_TEST;
 
-    ASSERT_EQ(mx_object_wait_many(NULL, 0, mx_deadline_after(1)),
-              MX_ERR_TIMED_OUT, "wait_many on zero handles should have timed out");
+    ASSERT_EQ(zx_object_wait_many(NULL, 0, zx_deadline_after(1)),
+              ZX_ERR_TIMED_OUT, "wait_many on zero handles should have timed out");
 
-    mx_handle_t handles[2] = { MX_HANDLE_INVALID, MX_HANDLE_INVALID};
-    ASSERT_EQ(mx_event_create(0u, &handles[0]), 0, "Error during event creation");
+    zx_handle_t handles[2] = { ZX_HANDLE_INVALID, ZX_HANDLE_INVALID};
+    ASSERT_EQ(zx_event_create(0u, &handles[0]), 0, "Error during event creation");
 
-    mx_wait_item_t items[2];
+    zx_wait_item_t items[2];
     items[0].handle = handles[0];
-    items[0].waitfor = MX_EVENT_SIGNALED;
+    items[0].waitfor = ZX_EVENT_SIGNALED;
     items[1].handle = handles[1];
-    items[1].waitfor = MX_EVENT_SIGNALED;
-    ASSERT_EQ(mx_object_wait_many(items, 2, MX_TIME_INFINITE),
-              MX_ERR_BAD_HANDLE, "Wait-many should have failed with MX_ERR_BAD_HANDLE");
+    items[1].waitfor = ZX_EVENT_SIGNALED;
+    ASSERT_EQ(zx_object_wait_many(items, 2, ZX_TIME_INFINITE),
+              ZX_ERR_BAD_HANDLE, "Wait-many should have failed with ZX_ERR_BAD_HANDLE");
 
     // Signal the event, to check that wait-many cleaned up correctly.
-    ASSERT_EQ(mx_object_signal(handles[0], 0u, MX_EVENT_SIGNALED), MX_OK,
+    ASSERT_EQ(zx_object_signal(handles[0], 0u, ZX_EVENT_SIGNALED), ZX_OK,
               "Error during event signal");
 
     // TODO(vtl): Also test other failure code paths: 1. a handle not supporting waiting (i.e., not
     // having a Waiter), 2. a handle having an I/O port bound.
 
-    ASSERT_EQ(mx_handle_close(handles[0]), MX_OK, "Error during handle close");
+    ASSERT_EQ(zx_handle_close(handles[0]), ZX_OK, "Error during handle close");
 
     END_TEST;
 }
diff --git a/system/utest/events/rules.mk b/system/utest/events/rules.mk
index f406fbe..04d3d84 100644
--- a/system/utest/events/rules.mk
+++ b/system/utest/events/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := events-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/evil/evil.c b/system/utest/evil/evil.c
index 7b6590e..4b9af54 100644
--- a/system/utest/evil/evil.c
+++ b/system/utest/evil/evil.c
@@ -11,8 +11,8 @@
 
 #include <pthread.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 
 #define TICKS 0
 
@@ -43,12 +43,12 @@
 
 static void _ftxlock(atomic_int* lock) {
     while (atomic_exchange(lock, 1) != 0) {
-        mx_futex_wait(lock, 1, MX_TIME_INFINITE);
+        zx_futex_wait(lock, 1, ZX_TIME_INFINITE);
     }
 }
 static void _ftxunlock(atomic_int* lock) {
     atomic_store(lock, 0);
-    mx_futex_wake(lock, 1);
+    zx_futex_wake(lock, 1);
 }
 
 #if USE_PTHREAD_MUTEXES
@@ -182,11 +182,11 @@
 static uint8_t data[65534];
 
 int writespam(int opt) {
-    mx_handle_t p[2];
-    mx_status_t r;
+    zx_handle_t p[2];
+    zx_status_t r;
     uint64_t count = 0;
 
-    if ((r = mx_channel_create(0, p, p + 1)) < 0) {
+    if ((r = zx_channel_create(0, p, p + 1)) < 0) {
         printf("cleanup-test: channel create 0 failed: %d\n", r);
         return -1;
     }
@@ -194,7 +194,7 @@
     printf("evil-tests: about to spam data into a channel\n");
     for (;;) {
         count++;
-        if ((r = mx_channel_write(p[0], 0, data, sizeof(data), NULL, 0)) < 0) {
+        if ((r = zx_channel_write(p[0], 0, data, sizeof(data), NULL, 0)) < 0) {
             printf("evil-tests: SUCCESS, writespammer error %d after only %" PRIu64 " writes\n", r, count);
             return 0;
         }
@@ -204,8 +204,8 @@
     }
     if (opt == 0) {
         printf("evil-tests: closing the channel (full of messages)\n");
-        mx_handle_close(p[0]);
-        mx_handle_close(p[1]);
+        zx_handle_close(p[0]);
+        zx_handle_close(p[1]);
     } else {
         printf("evil-tests: leaving the channel open (full of messages)\n");
     }
@@ -213,13 +213,13 @@
 }
 
 int handlespam(void) {
-    mx_handle_t p[2];
+    zx_handle_t p[2];
     uint64_t count = 0;
 
     printf("evil-tests: about to create all the handles\n");
     for (;;) {
-        mx_status_t status;
-        if ((status = mx_channel_create(0, p, p + 1)) < 0) {
+        zx_status_t status;
+        if ((status = zx_channel_create(0, p, p + 1)) < 0) {
             printf("evil-tests: SUCCESS, channel create failed %d after %" PRIu64 " created\n", status, count);
             return 0;
         }
diff --git a/system/utest/evil/rules.mk b/system/utest/evil/rules.mk
index 8944eb8..f4f6ec7 100644
--- a/system/utest/evil/rules.mk
+++ b/system/utest/evil/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_NAME := evil-tests
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/exception/exception.c b/system/utest/exception/exception.c
index e96f559..7e7f67a 100644
--- a/system/utest/exception/exception.c
+++ b/system/utest/exception/exception.c
@@ -15,18 +15,18 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <magenta/compiler.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/port.h>
-#include <magenta/threads.h>
+#include <zircon/compiler.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/threads.h>
 #include <test-utils/test-utils.h>
 #include <unittest/unittest.h>
 
 // 0.5 seconds
-#define WATCHDOG_DURATION_TICK MX_MSEC(500)
+#define WATCHDOG_DURATION_TICK ZX_MSEC(500)
 // 5 seconds
 #define WATCHDOG_DURATION_TICKS 10
 
@@ -68,7 +68,7 @@
     *p = 42;
 }
 
-static void send_msg_new_thread_handle(mx_handle_t handle, mx_handle_t thread)
+static void send_msg_new_thread_handle(zx_handle_t handle, zx_handle_t thread)
 {
     // Note: The handle is transferred to the receiver.
     uint64_t data = MSG_AUX_THREAD_HANDLE;
@@ -76,14 +76,14 @@
     tu_channel_write(handle, 0, &data, sizeof(data), &thread, 1);
 }
 
-static void send_msg(mx_handle_t handle, enum message msg)
+static void send_msg(zx_handle_t handle, enum message msg)
 {
     uint64_t data = msg;
     unittest_printf("sending message %d on handle %u\n", msg, handle);
     tu_channel_write(handle, 0, &data, sizeof(data), NULL, 0);
 }
 
-static bool recv_msg(mx_handle_t handle, enum message* msg)
+static bool recv_msg(zx_handle_t handle, enum message* msg)
 {
     uint64_t data;
     uint32_t num_bytes = sizeof(data);
@@ -109,7 +109,7 @@
 
 // This returns "bool" because it uses ASSERT_*.
 
-static bool recv_msg_new_thread_handle(mx_handle_t handle, mx_handle_t* thread)
+static bool recv_msg_new_thread_handle(zx_handle_t handle, zx_handle_t* thread)
 {
     uint64_t data;
     uint32_t num_bytes = sizeof(data);
@@ -134,32 +134,32 @@
 // This test assumes no presence of the "debugger API" and therefore we can't
 // resume from a segfault. Such a test is for the debugger API anyway.
 
-static void resume_thread_from_exception(mx_handle_t process, mx_koid_t tid,
+static void resume_thread_from_exception(zx_handle_t process, zx_koid_t tid,
                                          uint32_t excp_port_type,
                                          uint32_t flags)
 {
-    mx_handle_t thread;
-    mx_status_t status = mx_object_get_child(process, tid, MX_RIGHT_SAME_RIGHTS, &thread);
+    zx_handle_t thread;
+    zx_status_t status = zx_object_get_child(process, tid, ZX_RIGHT_SAME_RIGHTS, &thread);
     if (status < 0)
-        tu_fatal("mx_object_get_child", status);
+        tu_fatal("zx_object_get_child", status);
 
-    mx_info_thread_t info = tu_thread_get_info(thread);
-    EXPECT_EQ(info.state, MX_THREAD_STATE_BLOCKED, "");
-    if (excp_port_type != MX_EXCEPTION_PORT_TYPE_NONE) {
+    zx_info_thread_t info = tu_thread_get_info(thread);
+    EXPECT_EQ(info.state, ZX_THREAD_STATE_BLOCKED, "");
+    if (excp_port_type != ZX_EXCEPTION_PORT_TYPE_NONE) {
         EXPECT_EQ(info.wait_exception_port_type, excp_port_type, "");
     }
 
-    status = mx_task_resume(thread, MX_RESUME_EXCEPTION | flags);
+    status = zx_task_resume(thread, ZX_RESUME_EXCEPTION | flags);
     if (status < 0)
-        tu_fatal("mx_mark_exception_handled", status);
-    mx_handle_close(thread);
+        tu_fatal("zx_mark_exception_handled", status);
+    zx_handle_close(thread);
 }
 
 // Wait for and receive an exception on |eport|.
 
-static bool read_exception(mx_handle_t eport, mx_port_packet_t* packet)
+static bool read_exception(zx_handle_t eport, zx_port_packet_t* packet)
 {
-    ASSERT_EQ(mx_port_wait(eport, MX_TIME_INFINITE, packet, 0), MX_OK, "mx_port_wait failed");
+    ASSERT_EQ(zx_port_wait(eport, ZX_TIME_INFINITE, packet, 0), ZX_OK, "zx_port_wait failed");
     ASSERT_EQ(packet->key, 0u, "bad report key");
     unittest_printf("exception received: pid %"
                     PRIu64 ", tid %" PRIu64 ", type %d\n",
@@ -169,15 +169,15 @@
 
 // The bool result is because we use the unittest EXPECT/ASSERT macros.
 
-static bool verify_exception(const mx_port_packet_t* packet,
-                             mx_handle_t process,
-                             mx_excp_type_t expected_type)
+static bool verify_exception(const zx_port_packet_t* packet,
+                             zx_handle_t process,
+                             zx_excp_type_t expected_type)
 {
     EXPECT_EQ(packet->type, expected_type, "unexpected exception type");
 
     // Verify the exception was from |process|.
-    if (process != MX_HANDLE_INVALID) {
-        mx_info_handle_basic_t process_info;
+    if (process != ZX_HANDLE_INVALID) {
+        zx_info_handle_basic_t process_info;
         tu_handle_get_basic_info(process, &process_info);
         EXPECT_EQ(process_info.koid, packet->exception.pid, "wrong process in exception report");
     }
@@ -185,12 +185,12 @@
     return true;
 }
 
-static bool read_and_verify_exception(mx_handle_t eport,
-                                      mx_handle_t process,
-                                      mx_excp_type_t expected_type,
-                                      mx_koid_t* tid)
+static bool read_and_verify_exception(zx_handle_t eport,
+                                      zx_handle_t process,
+                                      zx_excp_type_t expected_type,
+                                      zx_koid_t* tid)
 {
-    mx_port_packet_t packet;
+    zx_port_packet_t packet;
     if (!read_exception(eport, &packet))
         return false;
     *tid = packet.exception.tid;
@@ -200,32 +200,32 @@
 // Wait for a process to exit, and while it's exiting verify we get the
 // expected exception reports.
 // We may receive thread-exit reports while the process is terminating but
-// any other kind of exception besides MX_EXCP_GONE is an error.
+// any other kind of exception besides ZX_EXCP_GONE is an error.
 // This may be used when attached to the process or debugger exception port.
 // The bool result is because we use the unittest EXPECT/ASSERT macros.
 
-static bool wait_process_exit(mx_handle_t eport, mx_handle_t process) {
-    mx_port_packet_t packet;
+static bool wait_process_exit(zx_handle_t eport, zx_handle_t process) {
+    zx_port_packet_t packet;
 
     for (;;) {
         if (!read_exception(eport, &packet))
             return false;
         // If we get a process gone report then all threads have exited.
-        if (packet.type == MX_EXCP_GONE)
+        if (packet.type == ZX_EXCP_GONE)
             break;
-        if (!verify_exception(&packet, process, MX_EXCP_THREAD_EXITING))
+        if (!verify_exception(&packet, process, ZX_EXCP_THREAD_EXITING))
             return false;
-        // MX_EXCP_THREAD_EXITING reports must normally be responded to.
+        // ZX_EXCP_THREAD_EXITING reports must normally be responded to.
         // However, when the process exits it kills all threads which will
         // kick them out of the ExceptionHandlerExchange. Thus there's no
         // need to resume them here.
     }
 
-    verify_exception(&packet, process, MX_EXCP_GONE);
+    verify_exception(&packet, process, ZX_EXCP_GONE);
     EXPECT_EQ(packet.exception.tid, 0u, "non-zero tid in process gone report");
     // There is no reply to a "process gone" notification.
 
-    // The MX_TASK_TERMINATED signal comes last.
+    // The ZX_TASK_TERMINATED signal comes last.
     tu_process_wait_signaled(process);
     return true;
 }
@@ -240,40 +240,40 @@
 // report from a thread.
 // The bool result is because we use the unittest EXPECT/ASSERT macros.
 
-static bool wait_process_exit_from_debugger(mx_handle_t eport, mx_handle_t process, mx_koid_t tid) {
+static bool wait_process_exit_from_debugger(zx_handle_t eport, zx_handle_t process, zx_koid_t tid) {
     bool tid_seen = false;
-    mx_port_packet_t packet;
+    zx_port_packet_t packet;
 
-    ASSERT_NE(tid, MX_KOID_INVALID, "invalid koid");
+    ASSERT_NE(tid, ZX_KOID_INVALID, "invalid koid");
 
     for (;;) {
         if (!read_exception(eport, &packet))
             return false;
         // If we get a process gone report then all threads have exited.
-        if (packet.type == MX_EXCP_GONE)
+        if (packet.type == ZX_EXCP_GONE)
             break;
-        if (!verify_exception(&packet, process, MX_EXCP_THREAD_EXITING))
+        if (!verify_exception(&packet, process, ZX_EXCP_THREAD_EXITING))
             return false;
         if (packet.exception.tid == tid)
             tid_seen = true;
-        // MX_EXCP_THREAD_EXITING reports must normally be responded to.
+        // ZX_EXCP_THREAD_EXITING reports must normally be responded to.
         // However, when the process exits it kills all threads which will
         // kick them out of the ExceptionHandlerExchange. Thus there's no
         // need to resume them here.
     }
 
-    EXPECT_TRUE(tid_seen, "missing MX_EXCP_THREAD_EXITING report");
+    EXPECT_TRUE(tid_seen, "missing ZX_EXCP_THREAD_EXITING report");
 
-    verify_exception(&packet, process, MX_EXCP_GONE);
+    verify_exception(&packet, process, ZX_EXCP_GONE);
     EXPECT_EQ(packet.exception.tid, 0u, "non-zero tid in process gone report");
     // There is no reply to a "process gone" notification.
 
-    // The MX_TASK_TERMINATED signal comes last.
+    // The ZX_TASK_TERMINATED signal comes last.
     tu_process_wait_signaled(process);
     return true;
 }
 
-static bool ensure_child_running(mx_handle_t channel) {
+static bool ensure_child_running(zx_handle_t channel) {
     // Note: This function is called from external threads and thus does
     // not use EXPECT_*/ASSERT_*.
     enum message msg;
@@ -289,10 +289,10 @@
     return true;
 }
 
-static void msg_loop(mx_handle_t channel)
+static void msg_loop(zx_handle_t channel)
 {
     bool my_done_tests = false;
-    mx_handle_t channel_to_thread = MX_HANDLE_INVALID;
+    zx_handle_t channel_to_thread = ZX_HANDLE_INVALID;
 
     while (!done_tests && !my_done_tests)
     {
@@ -315,29 +315,29 @@
         case MSG_CREATE_AUX_THREAD:
             // Spin up a thread that we can talk to.
             {
-                if (channel_to_thread != MX_HANDLE_INVALID) {
+                if (channel_to_thread != ZX_HANDLE_INVALID) {
                     unittest_printf("previous thread connection not shutdown");
                     return;
                 }
-                mx_handle_t channel_from_thread;
+                zx_handle_t channel_from_thread;
                 tu_channel_create(&channel_to_thread, &channel_from_thread);
                 thrd_t thread;
                 tu_thread_create_c11(&thread, thread_func, (void*) (uintptr_t) channel_from_thread, "msg-loop-subthread");
                 // Make sure the new thread is up and running before sending
                 // its handle back: this removes potential problems like
-                // needing to handle MX_EXCP_THREAD_STARTING exceptions if the
+                // needing to handle ZX_EXCP_THREAD_STARTING exceptions if the
                 // debugger exception port is bound later.
                 if (ensure_child_running(channel_to_thread)) {
-                    mx_handle_t thread_handle = thrd_get_mx_handle(thread);
-                    mx_handle_t copy = MX_HANDLE_INVALID;
-                    mx_handle_duplicate(thread_handle, MX_RIGHT_SAME_RIGHTS, &copy);
+                    zx_handle_t thread_handle = thrd_get_zx_handle(thread);
+                    zx_handle_t copy = ZX_HANDLE_INVALID;
+                    zx_handle_duplicate(thread_handle, ZX_RIGHT_SAME_RIGHTS, &copy);
                     send_msg_new_thread_handle(channel, copy);
                 } else {
                     // We could terminate the thread or some such, but the
                     // process will be killed by our "caller".
-                    send_msg_new_thread_handle(channel, MX_HANDLE_INVALID);
-                    mx_handle_close(channel_to_thread);
-                    channel_to_thread = MX_HANDLE_INVALID;
+                    send_msg_new_thread_handle(channel, ZX_HANDLE_INVALID);
+                    zx_handle_close(channel_to_thread);
+                    channel_to_thread = ZX_HANDLE_INVALID;
                 }
             }
             break;
@@ -346,8 +346,8 @@
             break;
         case MSG_SHUTDOWN_AUX_THREAD:
             send_msg(channel_to_thread, MSG_DONE);
-            mx_handle_close(channel_to_thread);
-            channel_to_thread = MX_HANDLE_INVALID;
+            zx_handle_close(channel_to_thread);
+            channel_to_thread = ZX_HANDLE_INVALID;
             break;
         default:
             unittest_printf("unknown message received: %d\n", msg);
@@ -359,7 +359,7 @@
 static int thread_func(void* arg)
 {
     unittest_printf("test thread starting\n");
-    mx_handle_t msg_channel = (mx_handle_t) (uintptr_t) arg;
+    zx_handle_t msg_channel = (zx_handle_t) (uintptr_t) arg;
     msg_loop(msg_channel);
     unittest_printf("test thread exiting\n");
     tu_handle_close(msg_channel);
@@ -369,22 +369,22 @@
 static void __NO_RETURN test_child(void)
 {
     unittest_printf("Test child starting.\n");
-    mx_handle_t channel = mx_get_startup_handle(PA_USER0);
-    if (channel == MX_HANDLE_INVALID)
-        tu_fatal("mx_get_startup_handle", MX_ERR_BAD_HANDLE - 1000);
+    zx_handle_t channel = zx_get_startup_handle(PA_USER0);
+    if (channel == ZX_HANDLE_INVALID)
+        tu_fatal("zx_get_startup_handle", ZX_ERR_BAD_HANDLE - 1000);
     msg_loop(channel);
     unittest_printf("Test child exiting.\n");
     exit(0);
 }
 
-static launchpad_t* setup_test_child(mx_handle_t job, const char* arg,
-                                     mx_handle_t* out_channel)
+static launchpad_t* setup_test_child(zx_handle_t job, const char* arg,
+                                     zx_handle_t* out_channel)
 {
     if (arg)
         unittest_printf("Starting test child %s.\n", arg);
     else
         unittest_printf("Starting test child.\n");
-    mx_handle_t our_channel, their_channel;
+    zx_handle_t our_channel, their_channel;
     tu_channel_create(&our_channel, &their_channel);
     const char* test_child_path = program_path;
     const char verbosity_string[] = { 'v', '=', utest_verbosity_level + '0', '\0' };
@@ -395,34 +395,34 @@
         arg,
     };
     int argc = countof(argv) - (arg == NULL);
-    mx_handle_t handles[1] = { their_channel };
+    zx_handle_t handles[1] = { their_channel };
     uint32_t handle_ids[1] = { PA_USER0 };
     *out_channel = our_channel;
-    launchpad_t* lp = tu_launch_mxio_init(job, test_child_name, argc, argv,
+    launchpad_t* lp = tu_launch_fdio_init(job, test_child_name, argc, argv,
                                           NULL, 1, handles, handle_ids);
     unittest_printf("Test child setup.\n");
     return lp;
 }
 
-static void start_test_child(mx_handle_t job, const char* arg,
-                             mx_handle_t* out_child, mx_handle_t* out_channel)
+static void start_test_child(zx_handle_t job, const char* arg,
+                             zx_handle_t* out_child, zx_handle_t* out_channel)
 {
     launchpad_t* lp = setup_test_child(job, arg, out_channel);
-    *out_child = tu_launch_mxio_fini(lp);
+    *out_child = tu_launch_fdio_fini(lp);
     unittest_printf("Test child started.\n");
 }
 
-static void setup_test_child_with_eport(mx_handle_t job, const char* arg,
-                                        mx_handle_t* out_child,
-                                        mx_handle_t* out_eport,
-                                        mx_handle_t* out_channel)
+static void setup_test_child_with_eport(zx_handle_t job, const char* arg,
+                                        zx_handle_t* out_child,
+                                        zx_handle_t* out_eport,
+                                        zx_handle_t* out_channel)
 {
-    launchpad_t* lp = setup_test_child(mx_job_default(), arg, out_channel);
-    mx_handle_t eport = tu_io_port_create();
+    launchpad_t* lp = setup_test_child(zx_job_default(), arg, out_channel);
+    zx_handle_t eport = tu_io_port_create();
     // Note: child is a borrowed handle, launchpad still owns it at this point.
-    mx_handle_t child = launchpad_get_process_handle(lp);
-    tu_set_exception_port(child, eport, 0, MX_EXCEPTION_PORT_DEBUGGER);
-    child = tu_launch_mxio_fini(lp);
+    zx_handle_t child = launchpad_get_process_handle(lp);
+    tu_set_exception_port(child, eport, 0, ZX_EXCEPTION_PORT_DEBUGGER);
+    child = tu_launch_fdio_fini(lp);
     // Now we own the child handle, and lp is destroyed.
     *out_child = child;
     *out_eport = eport;
@@ -432,7 +432,7 @@
 {
     for (int i = 0; i < WATCHDOG_DURATION_TICKS; ++i)
     {
-        mx_nanosleep(mx_deadline_after(WATCHDOG_DURATION_TICK));
+        zx_nanosleep(zx_deadline_after(WATCHDOG_DURATION_TICK));
         if (atomic_load(&done_tests))
             return 0;
     }
@@ -447,20 +447,20 @@
 // tests the behavior of binding the debugger eport; otherwise, binds
 // the non-debugger exception port.
 // This returns "bool" because it uses ASSERT_*.
-static bool test_set_close_set(mx_handle_t object, bool debugger) {
-    ASSERT_NE(object, MX_HANDLE_INVALID, "invalid handle");
-    uint32_t options = debugger ? MX_EXCEPTION_PORT_DEBUGGER : 0;
+static bool test_set_close_set(zx_handle_t object, bool debugger) {
+    ASSERT_NE(object, ZX_HANDLE_INVALID, "invalid handle");
+    uint32_t options = debugger ? ZX_EXCEPTION_PORT_DEBUGGER : 0;
 
     // Bind an exception port to the object.
-    mx_handle_t eport = tu_io_port_create();
-    mx_status_t status;
-    status = mx_task_bind_exception_port(object, eport, 0, options);
-    ASSERT_EQ(status, MX_OK, "error setting exception port");
+    zx_handle_t eport = tu_io_port_create();
+    zx_status_t status;
+    status = zx_task_bind_exception_port(object, eport, 0, options);
+    ASSERT_EQ(status, ZX_OK, "error setting exception port");
 
     // Try binding another exception port to the same object, which should fail.
-    mx_handle_t eport2 = tu_io_port_create();
-    status = mx_task_bind_exception_port(object, eport, 0, options);
-    ASSERT_NE(status, MX_OK, "setting exception port errantly succeeded");
+    zx_handle_t eport2 = tu_io_port_create();
+    status = zx_task_bind_exception_port(object, eport, 0, options);
+    ASSERT_NE(status, ZX_OK, "setting exception port errantly succeeded");
 
     // Close the ports.
     tu_handle_close(eport2);
@@ -469,14 +469,14 @@
     // Verify the close removed the previous handler by successfully
     // adding a new one.
     eport = tu_io_port_create();
-    status = mx_task_bind_exception_port(object, eport, 0, options);
-    ASSERT_EQ(status, MX_OK, "error setting exception port (#2)");
+    status = zx_task_bind_exception_port(object, eport, 0, options);
+    ASSERT_EQ(status, ZX_OK, "error setting exception port (#2)");
     tu_handle_close(eport);
 
     // Try unbinding from an object without a bound port, which should fail.
     status =
-        mx_task_bind_exception_port(object, MX_HANDLE_INVALID, 0, options);
-    ASSERT_NE(status, MX_OK,
+        zx_task_bind_exception_port(object, ZX_HANDLE_INVALID, 0, options);
+    ASSERT_NE(status, ZX_OK,
               "resetting unbound exception port errantly succeeded");
 
     return true;
@@ -485,7 +485,7 @@
 static bool job_set_close_set_test(void)
 {
     BEGIN_TEST;
-    mx_handle_t job = tu_job_create(mx_job_default());
+    zx_handle_t job = tu_job_create(zx_job_default());
     test_set_close_set(job, /* debugger */ false);
     tu_handle_close(job);
     END_TEST;
@@ -494,26 +494,26 @@
 static bool process_set_close_set_test(void)
 {
     BEGIN_TEST;
-    test_set_close_set(mx_process_self(), /* debugger */ false);
+    test_set_close_set(zx_process_self(), /* debugger */ false);
     END_TEST;
 }
 
 static bool process_debugger_set_close_set_test(void)
 {
     BEGIN_TEST;
-    test_set_close_set(mx_process_self(), /* debugger */ true);
+    test_set_close_set(zx_process_self(), /* debugger */ true);
     END_TEST;
 }
 
 static bool thread_set_close_set_test(void)
 {
     BEGIN_TEST;
-    mx_handle_t our_channel, their_channel;
+    zx_handle_t our_channel, their_channel;
     tu_channel_create(&our_channel, &their_channel);
     thrd_t thread;
     tu_thread_create_c11(&thread, thread_func, (void*)(uintptr_t)their_channel,
                          "thread-set-close-set");
-    mx_handle_t thread_handle = thrd_get_mx_handle(thread);
+    zx_handle_t thread_handle = thrd_get_zx_handle(thread);
     test_set_close_set(thread_handle, /* debugger */ false);
     send_msg(our_channel, MSG_DONE);
     // thrd_join doesn't provide a timeout, but we have the watchdog for that.
@@ -522,18 +522,18 @@
 }
 
 typedef struct {
-    mx_handle_t proc;
-    mx_handle_t vmar;
+    zx_handle_t proc;
+    zx_handle_t vmar;
 } proc_handles;
 
 // Creates but does not start a process, returning its handles in |*ph|.
 // Returns false if an assertion fails.
 static bool create_non_running_process(const char* name, proc_handles* ph) {
     memset(ph, 0, sizeof(*ph));
-    mx_status_t status = mx_process_create(
-        mx_job_default(), name, strlen(name), 0, &ph->proc, &ph->vmar);
-    ASSERT_EQ(status, MX_OK, "mx_process_create");
-    ASSERT_NE(ph->proc, MX_HANDLE_INVALID, "proc handle");
+    zx_status_t status = zx_process_create(
+        zx_job_default(), name, strlen(name), 0, &ph->proc, &ph->vmar);
+    ASSERT_EQ(status, ZX_OK, "zx_process_create");
+    ASSERT_NE(ph->proc, ZX_HANDLE_INVALID, "proc handle");
     return true;
 }
 
@@ -541,11 +541,11 @@
 static void close_proc_handles(proc_handles *ph) {
     if (ph->proc > 0) {
         tu_handle_close(ph->proc);
-        ph->proc = MX_HANDLE_INVALID;
+        ph->proc = ZX_HANDLE_INVALID;
     }
     if (ph->vmar > 0) {
         tu_handle_close(ph->vmar);
-        ph->vmar = MX_HANDLE_INVALID;
+        ph->vmar = ZX_HANDLE_INVALID;
     }
 }
 
@@ -585,11 +585,11 @@
     ASSERT_TRUE(create_non_running_process(__func__, &ph), "");
 
     // Create but do not start a thread in that process.
-    mx_handle_t thread = MX_HANDLE_INVALID;
-    mx_status_t status =
-        mx_thread_create(ph.proc, __func__, sizeof(__func__)-1, 0, &thread);
-    ASSERT_EQ(status, MX_OK, "mx_thread_create");
-    ASSERT_NE(thread, MX_HANDLE_INVALID, "thread handle");
+    zx_handle_t thread = ZX_HANDLE_INVALID;
+    zx_status_t status =
+        zx_thread_create(ph.proc, __func__, sizeof(__func__)-1, 0, &thread);
+    ASSERT_EQ(status, ZX_OK, "zx_thread_create");
+    ASSERT_NE(thread, ZX_HANDLE_INVALID, "thread handle");
 
     // Make sure binding and unbinding behaves.
     test_set_close_set(thread, /* debugger */ false);
@@ -602,18 +602,18 @@
 // Creates a process, possibly binds an eport to it (if |bind_while_alive| is set),
 // then tries to unbind the eport, checking for the expected status.
 static bool dead_process_unbind_helper(bool debugger, bool bind_while_alive) {
-    const uint32_t options = debugger ? MX_EXCEPTION_PORT_DEBUGGER : 0;
+    const uint32_t options = debugger ? ZX_EXCEPTION_PORT_DEBUGGER : 0;
 
     // Start a new process.
-    mx_handle_t child, our_channel;
-    start_test_child(mx_job_default(), NULL, &child, &our_channel);
+    zx_handle_t child, our_channel;
+    start_test_child(zx_job_default(), NULL, &child, &our_channel);
 
     // Possibly bind an eport to it.
-    mx_handle_t eport = MX_HANDLE_INVALID;
+    zx_handle_t eport = ZX_HANDLE_INVALID;
     if (bind_while_alive) {
         // If we're binding to the debugger exception port make sure the
         // child is running first so that we don't have to process
-        // MX_EXCP_THREAD_STARTING.
+        // ZX_EXCP_THREAD_STARTING.
         if (debugger) {
             ASSERT_TRUE(ensure_child_running(our_channel), "");
         }
@@ -632,17 +632,17 @@
     }
 
     // Try unbinding.
-    mx_status_t status =
-        mx_task_bind_exception_port(child, MX_HANDLE_INVALID, 0, options);
+    zx_status_t status =
+        zx_task_bind_exception_port(child, ZX_HANDLE_INVALID, 0, options);
     if (bind_while_alive) {
-        EXPECT_EQ(status, MX_OK, "matched unbind should have succeeded");
+        EXPECT_EQ(status, ZX_OK, "matched unbind should have succeeded");
     } else {
-        EXPECT_NE(status, MX_OK, "unmatched unbind should have failed");
+        EXPECT_NE(status, ZX_OK, "unmatched unbind should have failed");
     }
 
     // Clean up.
     tu_handle_close(child);
-    if (eport != MX_HANDLE_INVALID) {
+    if (eport != ZX_HANDLE_INVALID) {
         tu_handle_close(eport);
     }
     tu_handle_close(our_channel);
@@ -689,22 +689,22 @@
 // then tries to unbind the eport, checking for the expected status.
 static bool dead_thread_unbind_helper(bool bind_while_alive) {
     // Start a new thread.
-    mx_handle_t our_channel, their_channel;
+    zx_handle_t our_channel, their_channel;
     tu_channel_create(&our_channel, &their_channel);
     thrd_t cthread;
     tu_thread_create_c11(&cthread, thread_func, (void*)(uintptr_t)their_channel,
                          "thread-set-close-set");
-    mx_handle_t thread = thrd_get_mx_handle(cthread);
-    ASSERT_NE(thread, MX_HANDLE_INVALID, "failed to get thread handle");
+    zx_handle_t thread = thrd_get_zx_handle(cthread);
+    ASSERT_NE(thread, ZX_HANDLE_INVALID, "failed to get thread handle");
 
     // Duplicate the thread's handle. thrd_join() will close the |thread|
     // handle, but we need to be able to refer to the thread after that.
-    mx_handle_t thread_copy = MX_HANDLE_INVALID;
-    mx_handle_duplicate(thread, MX_RIGHT_SAME_RIGHTS, &thread_copy);
-    ASSERT_NE(thread_copy, MX_HANDLE_INVALID, "failed to copy thread handle");
+    zx_handle_t thread_copy = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(thread, ZX_RIGHT_SAME_RIGHTS, &thread_copy);
+    ASSERT_NE(thread_copy, ZX_HANDLE_INVALID, "failed to copy thread handle");
 
     // Possibly bind an eport to it.
-    mx_handle_t eport = MX_HANDLE_INVALID;
+    zx_handle_t eport = ZX_HANDLE_INVALID;
     if (bind_while_alive) {
         eport = tu_io_port_create();
         tu_set_exception_port(thread, eport, 0, 0);
@@ -716,18 +716,18 @@
     thrd_join(cthread, NULL);
 
     // Try unbinding.
-    mx_status_t status =
-        mx_task_bind_exception_port(thread_copy, MX_HANDLE_INVALID, 0, 0);
+    zx_status_t status =
+        zx_task_bind_exception_port(thread_copy, ZX_HANDLE_INVALID, 0, 0);
     if (bind_while_alive) {
-        EXPECT_EQ(status, MX_OK, "matched unbind should have succeeded");
+        EXPECT_EQ(status, ZX_OK, "matched unbind should have succeeded");
     } else {
-        EXPECT_NE(status, MX_OK, "unmatched unbind should have failed");
+        EXPECT_NE(status, ZX_OK, "unmatched unbind should have failed");
     }
 
     // Clean up. The |thread| and |their_channel| handles died
     // along with the thread.
     tu_handle_close(thread_copy);
-    if (eport != MX_HANDLE_INVALID) {
+    if (eport != ZX_HANDLE_INVALID) {
         tu_handle_close(eport);
     }
     tu_handle_close(our_channel);
@@ -750,15 +750,15 @@
     END_TEST;
 }
 
-static void finish_basic_test(mx_handle_t child,
-                              mx_handle_t eport, mx_handle_t our_channel,
+static void finish_basic_test(zx_handle_t child,
+                              zx_handle_t eport, zx_handle_t our_channel,
                               enum message crash_msg, uint32_t excp_port_type)
 {
     send_msg(our_channel, crash_msg);
 
-    mx_koid_t tid;
-    if (read_and_verify_exception(eport, child, MX_EXCP_FATAL_PAGE_FAULT, &tid)) {
-        resume_thread_from_exception(child, tid, excp_port_type, MX_RESUME_TRY_NEXT);
+    zx_koid_t tid;
+    if (read_and_verify_exception(eport, child, ZX_EXCP_FATAL_PAGE_FAULT, &tid)) {
+        resume_thread_from_exception(child, tid, excp_port_type, ZX_RESUME_TRY_NEXT);
         tu_process_wait_signaled(child);
     }
 
@@ -771,14 +771,14 @@
 {
     BEGIN_TEST;
 
-    mx_handle_t job = tu_job_create(mx_job_default());
-    mx_handle_t child, our_channel;
+    zx_handle_t job = tu_job_create(zx_job_default());
+    zx_handle_t child, our_channel;
     start_test_child(job, NULL, &child, &our_channel);
-    mx_handle_t eport = tu_io_port_create();
+    zx_handle_t eport = tu_io_port_create();
     tu_set_exception_port(job, eport, 0, 0);
     REGISTER_CRASH(child);
 
-    finish_basic_test(child, eport, our_channel, MSG_CRASH, MX_EXCEPTION_PORT_TYPE_JOB);
+    finish_basic_test(child, eport, our_channel, MSG_CRASH, ZX_EXCEPTION_PORT_TYPE_JOB);
     tu_handle_close(job);
     END_TEST;
 }
@@ -787,16 +787,16 @@
 {
     BEGIN_TEST;
 
-    mx_handle_t grandparent_job = tu_job_create(mx_job_default());
-    mx_handle_t parent_job = tu_job_create(grandparent_job);
-    mx_handle_t job = tu_job_create(parent_job);
-    mx_handle_t child, our_channel;
+    zx_handle_t grandparent_job = tu_job_create(zx_job_default());
+    zx_handle_t parent_job = tu_job_create(grandparent_job);
+    zx_handle_t job = tu_job_create(parent_job);
+    zx_handle_t child, our_channel;
     start_test_child(job, NULL, &child, &our_channel);
-    mx_handle_t eport = tu_io_port_create();
+    zx_handle_t eport = tu_io_port_create();
     tu_set_exception_port(grandparent_job, eport, 0, 0);
     REGISTER_CRASH(child);
 
-    finish_basic_test(child, eport, our_channel, MSG_CRASH, MX_EXCEPTION_PORT_TYPE_JOB);
+    finish_basic_test(child, eport, our_channel, MSG_CRASH, ZX_EXCEPTION_PORT_TYPE_JOB);
     tu_handle_close(job);
     tu_handle_close(parent_job);
     tu_handle_close(grandparent_job);
@@ -808,13 +808,13 @@
     BEGIN_TEST;
     unittest_printf("process exception handler basic test\n");
 
-    mx_handle_t child, our_channel;
-    start_test_child(mx_job_default(), NULL, &child, &our_channel);
-    mx_handle_t eport = tu_io_port_create();
+    zx_handle_t child, our_channel;
+    start_test_child(zx_job_default(), NULL, &child, &our_channel);
+    zx_handle_t eport = tu_io_port_create();
     tu_set_exception_port(child, eport, 0, 0);
     REGISTER_CRASH(child);
 
-    finish_basic_test(child, eport, our_channel, MSG_CRASH, MX_EXCEPTION_PORT_TYPE_PROCESS);
+    finish_basic_test(child, eport, our_channel, MSG_CRASH, ZX_EXCEPTION_PORT_TYPE_PROCESS);
     END_TEST;
 }
 
@@ -823,20 +823,20 @@
     BEGIN_TEST;
     unittest_printf("thread exception handler basic test\n");
 
-    mx_handle_t child, our_channel;
-    start_test_child(mx_job_default(), NULL, &child, &our_channel);
-    mx_handle_t eport = tu_io_port_create();
+    zx_handle_t child, our_channel;
+    start_test_child(zx_job_default(), NULL, &child, &our_channel);
+    zx_handle_t eport = tu_io_port_create();
     send_msg(our_channel, MSG_CREATE_AUX_THREAD);
-    mx_handle_t thread;
+    zx_handle_t thread;
     recv_msg_new_thread_handle(our_channel, &thread);
-    if (thread != MX_HANDLE_INVALID) {
+    if (thread != ZX_HANDLE_INVALID) {
         tu_set_exception_port(thread, eport, 0, 0);
         REGISTER_CRASH(child);
-        finish_basic_test(child, eport, our_channel, MSG_CRASH_AUX_THREAD, MX_EXCEPTION_PORT_TYPE_THREAD);
+        finish_basic_test(child, eport, our_channel, MSG_CRASH_AUX_THREAD, ZX_EXCEPTION_PORT_TYPE_THREAD);
         tu_handle_close(thread);
     } else {
-        mx_task_kill(child);
-        ASSERT_NE(thread, MX_HANDLE_INVALID, "");
+        zx_task_kill(child);
+        ASSERT_NE(thread, ZX_HANDLE_INVALID, "");
     }
 
     END_TEST;
@@ -847,18 +847,18 @@
     BEGIN_TEST;
     unittest_printf("debugger exception handler basic test\n");
 
-    mx_handle_t child, our_channel;
-    start_test_child(mx_job_default(), NULL, &child, &our_channel);
+    zx_handle_t child, our_channel;
+    start_test_child(zx_job_default(), NULL, &child, &our_channel);
 
     // We're binding to the debugger exception port so make sure the
     // child is running first so that we don't have to process
-    // MX_EXCP_THREAD_STARTING.
+    // ZX_EXCP_THREAD_STARTING.
     ASSERT_TRUE(ensure_child_running(our_channel), "");
 
-    mx_handle_t eport = tu_io_port_create();
-    tu_set_exception_port(child, eport, 0, MX_EXCEPTION_PORT_DEBUGGER);
+    zx_handle_t eport = tu_io_port_create();
+    tu_set_exception_port(child, eport, 0, ZX_EXCEPTION_PORT_DEBUGGER);
 
-    finish_basic_test(child, eport, our_channel, MSG_CRASH, MX_EXCEPTION_PORT_TYPE_DEBUGGER);
+    finish_basic_test(child, eport, our_channel, MSG_CRASH, ZX_EXCEPTION_PORT_TYPE_DEBUGGER);
     END_TEST;
 }
 
@@ -866,23 +866,23 @@
 {
     BEGIN_TEST;
 
-    mx_handle_t child, eport, our_channel;
-    setup_test_child_with_eport(mx_job_default(), NULL, &child, &eport, &our_channel);
+    zx_handle_t child, eport, our_channel;
+    setup_test_child_with_eport(zx_job_default(), NULL, &child, &eport, &our_channel);
 
-    mx_info_handle_basic_t child_info;
+    zx_info_handle_basic_t child_info;
     tu_handle_get_basic_info(child, &child_info);
 
-    mx_port_packet_t start_packet;
+    zx_port_packet_t start_packet;
     ASSERT_TRUE(read_exception(eport, &start_packet), "error reading start exception");
-    ASSERT_TRUE(verify_exception(&start_packet, child, MX_EXCP_THREAD_STARTING),
+    ASSERT_TRUE(verify_exception(&start_packet, child, ZX_EXCP_THREAD_STARTING),
                 "unexpected exception");
-    mx_koid_t packet_pid = start_packet.exception.pid;
-    mx_koid_t packet_tid = start_packet.exception.tid;
+    zx_koid_t packet_pid = start_packet.exception.pid;
+    zx_koid_t packet_tid = start_packet.exception.tid;
 
     EXPECT_EQ(child_info.koid, packet_pid, "packet pid mismatch");
 
     send_msg(our_channel, MSG_DONE);
-    resume_thread_from_exception(child, packet_tid, MX_EXCEPTION_PORT_TYPE_DEBUGGER, 0);
+    resume_thread_from_exception(child, packet_tid, ZX_EXCEPTION_PORT_TYPE_DEBUGGER, 0);
     wait_process_exit_from_debugger(eport, child, packet_tid);
 
     tu_handle_close(child);
@@ -897,13 +897,13 @@
     BEGIN_TEST;
     unittest_printf("process start test\n");
 
-    mx_handle_t child, eport, our_channel;
-    setup_test_child_with_eport(mx_job_default(), NULL, &child, &eport, &our_channel);
+    zx_handle_t child, eport, our_channel;
+    setup_test_child_with_eport(zx_job_default(), NULL, &child, &eport, &our_channel);
 
-    mx_koid_t tid;
-    if (read_and_verify_exception(eport, child, MX_EXCP_THREAD_STARTING, &tid)) {
+    zx_koid_t tid;
+    if (read_and_verify_exception(eport, child, ZX_EXCP_THREAD_STARTING, &tid)) {
         send_msg(our_channel, MSG_DONE);
-        resume_thread_from_exception(child, tid, MX_EXCEPTION_PORT_TYPE_DEBUGGER, 0);
+        resume_thread_from_exception(child, tid, ZX_EXCEPTION_PORT_TYPE_DEBUGGER, 0);
         wait_process_exit_from_debugger(eport, child, tid);
     }
 
@@ -919,10 +919,10 @@
     BEGIN_TEST;
     unittest_printf("process gone notification test\n");
 
-    mx_handle_t child, our_channel;
-    start_test_child(mx_job_default(), NULL, &child, &our_channel);
+    zx_handle_t child, our_channel;
+    start_test_child(zx_job_default(), NULL, &child, &our_channel);
 
-    mx_handle_t eport = tu_io_port_create();
+    zx_handle_t eport = tu_io_port_create();
     tu_set_exception_port(child, eport, 0, 0);
 
     send_msg(our_channel, MSG_DONE);
@@ -941,20 +941,20 @@
     BEGIN_TEST;
     unittest_printf("thread gone notification test\n");
 
-    mx_handle_t our_channel, their_channel;
+    zx_handle_t our_channel, their_channel;
     tu_channel_create(&our_channel, &their_channel);
-    mx_handle_t eport = tu_io_port_create();
+    zx_handle_t eport = tu_io_port_create();
     thrd_t thread;
     tu_thread_create_c11(&thread, thread_func, (void*) (uintptr_t) their_channel, "thread-gone-test-thread");
-    mx_handle_t thread_handle = thrd_get_mx_handle(thread);
-    // Attach to the thread exception report as we're testing for MX_EXCP_GONE
+    zx_handle_t thread_handle = thrd_get_zx_handle(thread);
+    // Attach to the thread exception report as we're testing for ZX_EXCP_GONE
     // reports from the thread here.
     tu_set_exception_port(thread_handle, eport, 0, 0);
 
     send_msg(our_channel, MSG_DONE);
     // TODO(dje): The passing of "self" here is wip.
-    mx_koid_t tid;
-    if (read_and_verify_exception(eport, MX_HANDLE_INVALID /*self*/, MX_EXCP_GONE, &tid)) {
+    zx_koid_t tid;
+    if (read_and_verify_exception(eport, ZX_HANDLE_INVALID /*self*/, ZX_EXCP_GONE, &tid)) {
         ASSERT_GT(tid, 0u, "tid not >= 0");
     }
     // there's no reply to a "gone" notification
@@ -1025,16 +1025,16 @@
 }
 
 static const struct {
-    mx_excp_type_t type;
+    zx_excp_type_t type;
     const char* name;
     bool crashes;
     void __NO_RETURN (*trigger_function) (void);
 } exceptions[] = {
-    { MX_EXCP_GENERAL, "general", false, trigger_general },
-    { MX_EXCP_FATAL_PAGE_FAULT, "page-fault", true, trigger_fatal_page_fault },
-    { MX_EXCP_UNDEFINED_INSTRUCTION, "undefined-insn", true, trigger_undefined_insn },
-    { MX_EXCP_SW_BREAKPOINT, "sw-bkpt", true, trigger_sw_bkpt },
-    { MX_EXCP_HW_BREAKPOINT, "hw-bkpt", false, trigger_hw_bkpt },
+    { ZX_EXCP_GENERAL, "general", false, trigger_general },
+    { ZX_EXCP_FATAL_PAGE_FAULT, "page-fault", true, trigger_fatal_page_fault },
+    { ZX_EXCP_UNDEFINED_INSTRUCTION, "undefined-insn", true, trigger_undefined_insn },
+    { ZX_EXCP_SW_BREAKPOINT, "sw-bkpt", true, trigger_sw_bkpt },
+    { ZX_EXCP_HW_BREAKPOINT, "hw-bkpt", false, trigger_hw_bkpt },
 };
 
 static void __NO_RETURN trigger_exception(const char* excp_name)
@@ -1063,11 +1063,11 @@
     unittest_printf("exception trigger tests\n");
 
     for (size_t i = 0; i < countof(exceptions); ++i) {
-        mx_excp_type_t excp_type = exceptions[i].type;
+        zx_excp_type_t excp_type = exceptions[i].type;
         const char *excp_name = exceptions[i].name;
-        mx_handle_t child, eport, our_channel;
+        zx_handle_t child, eport, our_channel;
         char* arg = tu_asprintf("trigger=%s", excp_name);
-        setup_test_child_with_eport(mx_job_default(), arg,
+        setup_test_child_with_eport(zx_job_default(), arg,
                                     &child, &eport, &our_channel);
         free(arg);
 
@@ -1075,24 +1075,24 @@
             REGISTER_CRASH(child);
         }
 
-        mx_koid_t tid = MX_KOID_INVALID;
-        (void) read_and_verify_exception(eport, child, MX_EXCP_THREAD_STARTING, &tid);
-        resume_thread_from_exception(child, tid, MX_EXCEPTION_PORT_TYPE_DEBUGGER, 0);
+        zx_koid_t tid = ZX_KOID_INVALID;
+        (void) read_and_verify_exception(eport, child, ZX_EXCP_THREAD_STARTING, &tid);
+        resume_thread_from_exception(child, tid, ZX_EXCEPTION_PORT_TYPE_DEBUGGER, 0);
 
-        mx_port_packet_t packet;
+        zx_port_packet_t packet;
         if (read_exception(eport, &packet)) {
-            // MX_EXCP_THREAD_EXITING reports must normally be responded to.
+            // ZX_EXCP_THREAD_EXITING reports must normally be responded to.
             // However, when the process exits it kills all threads which will
             // kick them out of the ExceptionHandlerExchange. Thus there's no
             // need to resume them here.
-            if (packet.type != MX_EXCP_THREAD_EXITING) {
+            if (packet.type != ZX_EXCP_THREAD_EXITING) {
                 tid = packet.exception.tid;
                 verify_exception(&packet, child, excp_type);
                 resume_thread_from_exception(child, tid,
-                                             MX_EXCEPTION_PORT_TYPE_DEBUGGER,
-                                             MX_RESUME_TRY_NEXT);
-                mx_koid_t tid2;
-                if (read_and_verify_exception(eport, child, MX_EXCP_THREAD_EXITING, &tid2)) {
+                                             ZX_EXCEPTION_PORT_TYPE_DEBUGGER,
+                                             ZX_RESUME_TRY_NEXT);
+                zx_koid_t tid2;
+                if (read_and_verify_exception(eport, child, ZX_EXCP_THREAD_EXITING, &tid2)) {
                     ASSERT_EQ(tid2, tid, "exiting tid mismatch");
                 }
             }
@@ -1115,33 +1115,33 @@
     // crashlogger to see the exception: causes excessive noise in test output.
     // It doesn't stop at the parent job as we want to exercise finding threads
     // of processes of child jobs.
-    mx_handle_t grandparent_job;
-    mx_handle_t parent_job;
-    mx_handle_t job;
+    zx_handle_t grandparent_job;
+    zx_handle_t parent_job;
+    zx_handle_t job;
 
     // the test process
-    mx_handle_t child;
+    zx_handle_t child;
 
     // the test thread and its koid
-    mx_handle_t thread;
-    mx_koid_t tid;
+    zx_handle_t thread;
+    zx_koid_t tid;
 
-    mx_handle_t grandparent_job_eport;
-    mx_handle_t parent_job_eport;
-    mx_handle_t job_eport;
-    mx_handle_t child_eport;
-    mx_handle_t thread_eport;
-    mx_handle_t debugger_eport;
+    zx_handle_t grandparent_job_eport;
+    zx_handle_t parent_job_eport;
+    zx_handle_t job_eport;
+    zx_handle_t child_eport;
+    zx_handle_t thread_eport;
+    zx_handle_t debugger_eport;
 
     // the communication channel to the test process
-    mx_handle_t our_channel;
+    zx_handle_t our_channel;
 } walkthrough_state_t;
 
 static bool walkthrough_setup(walkthrough_state_t* state)
 {
     memset(state, 0, sizeof(*state));
 
-    state->grandparent_job = tu_job_create(mx_job_default());
+    state->grandparent_job = tu_job_create(zx_job_default());
     state->parent_job = tu_job_create(state->grandparent_job);
     state->job = tu_job_create(state->parent_job);
 
@@ -1156,7 +1156,7 @@
 
     send_msg(state->our_channel, MSG_CREATE_AUX_THREAD);
     recv_msg_new_thread_handle(state->our_channel, &state->thread);
-    ASSERT_NE(state->thread, MX_HANDLE_INVALID, "");
+    ASSERT_NE(state->thread, ZX_HANDLE_INVALID, "");
     state->tid = tu_get_koid(state->thread);
 
     tu_set_exception_port(state->grandparent_job, state->grandparent_job_eport, 0, 0);
@@ -1164,25 +1164,25 @@
     tu_set_exception_port(state->job, state->job_eport, 0, 0);
     tu_set_exception_port(state->child, state->child_eport, 0, 0);
     tu_set_exception_port(state->thread, state->thread_eport, 0, 0);
-    tu_set_exception_port(state->child, state->debugger_eport, 0, MX_EXCEPTION_PORT_DEBUGGER);
+    tu_set_exception_port(state->child, state->debugger_eport, 0, ZX_EXCEPTION_PORT_DEBUGGER);
 
     // Non-debugger exception ports don't get synthetic exceptions like
-    // MX_EXCP_THREAD_STARTING. We have to trigger an architectural exception.
+    // ZX_EXCP_THREAD_STARTING. We have to trigger an architectural exception.
     send_msg(state->our_channel, MSG_CRASH_AUX_THREAD);
     return true;
 }
 
-static void walkthrough_close(mx_handle_t* handle)
+static void walkthrough_close(zx_handle_t* handle)
 {
-    if (*handle != MX_HANDLE_INVALID) {
+    if (*handle != ZX_HANDLE_INVALID) {
         tu_handle_close(*handle);
-        *handle = MX_HANDLE_INVALID;
+        *handle = ZX_HANDLE_INVALID;
     }
 }
 
 static void walkthrough_teardown(walkthrough_state_t* state)
 {
-    mx_task_kill(state->child);
+    zx_task_kill(state->child);
     tu_process_wait_signaled(state->child);
 
     walkthrough_close(&state->thread);
@@ -1201,10 +1201,10 @@
 }
 
 static void walkthrough_read_and_verify_exception(const walkthrough_state_t* state,
-                                                  mx_handle_t eport)
+                                                  zx_handle_t eport)
 {
-    mx_koid_t exception_tid;
-    if (read_and_verify_exception(eport, state->child, MX_EXCP_FATAL_PAGE_FAULT, &exception_tid)) {
+    zx_koid_t exception_tid;
+    if (read_and_verify_exception(eport, state->child, ZX_EXCP_FATAL_PAGE_FAULT, &exception_tid)) {
         EXPECT_EQ(exception_tid, state->tid, "");
     }
 }
@@ -1223,19 +1223,19 @@
 
     walkthrough_read_and_verify_exception(&state, state.debugger_eport);
 
-    tu_set_exception_port(state.child, MX_HANDLE_INVALID, 0, MX_EXCEPTION_PORT_DEBUGGER);
+    tu_set_exception_port(state.child, ZX_HANDLE_INVALID, 0, ZX_EXCEPTION_PORT_DEBUGGER);
     walkthrough_read_and_verify_exception(&state, state.thread_eport);
 
-    tu_set_exception_port(state.thread, MX_HANDLE_INVALID, 0, 0);
+    tu_set_exception_port(state.thread, ZX_HANDLE_INVALID, 0, 0);
     walkthrough_read_and_verify_exception(&state, state.child_eport);
 
-    tu_set_exception_port(state.child, MX_HANDLE_INVALID, 0, 0);
+    tu_set_exception_port(state.child, ZX_HANDLE_INVALID, 0, 0);
     walkthrough_read_and_verify_exception(&state, state.job_eport);
 
-    tu_set_exception_port(state.job, MX_HANDLE_INVALID, 0, 0);
+    tu_set_exception_port(state.job, ZX_HANDLE_INVALID, 0, 0);
     walkthrough_read_and_verify_exception(&state, state.parent_job_eport);
 
-    tu_set_exception_port(state.parent_job, MX_HANDLE_INVALID, 0, 0);
+    tu_set_exception_port(state.parent_job, ZX_HANDLE_INVALID, 0, 0);
     walkthrough_read_and_verify_exception(&state, state.grandparent_job_eport);
 
 Fail:
@@ -1287,20 +1287,20 @@
     BEGIN_TEST;
     unittest_printf("unbind_while_stopped tests\n");
 
-    mx_handle_t child, eport, our_channel;
+    zx_handle_t child, eport, our_channel;
     const char* arg = "";
-    setup_test_child_with_eport(mx_job_default(), arg,
+    setup_test_child_with_eport(zx_job_default(), arg,
                                 &child, &eport, &our_channel);
 
     {
-        mx_koid_t tid;
-        (void) read_and_verify_exception(eport, child, MX_EXCP_THREAD_STARTING, &tid);
+        zx_koid_t tid;
+        (void) read_and_verify_exception(eport, child, ZX_EXCP_THREAD_STARTING, &tid);
     }
 
     // Now unbind the exception port and wait for the child to cleanly exit.
     // If this doesn't work the thread will stay blocked, we'll timeout, and
     // the watchdog will trigger.
-    tu_set_exception_port(child, MX_HANDLE_INVALID, 0, MX_EXCEPTION_PORT_DEBUGGER);
+    tu_set_exception_port(child, ZX_HANDLE_INVALID, 0, ZX_EXCEPTION_PORT_DEBUGGER);
     send_msg(our_channel, MSG_DONE);
     tu_process_wait_signaled(child);
 
@@ -1316,65 +1316,65 @@
     BEGIN_TEST;
     unittest_printf("unbind_rebind_while_stopped tests\n");
 
-    mx_handle_t child, eport, our_channel;
+    zx_handle_t child, eport, our_channel;
     const char* arg = "";
-    setup_test_child_with_eport(mx_job_default(), arg,
+    setup_test_child_with_eport(zx_job_default(), arg,
                                 &child, &eport, &our_channel);
 
-    mx_port_packet_t start_packet;
+    zx_port_packet_t start_packet;
     // Assert reading the start packet succeeds because otherwise the rest
     // of the test is moot.
     ASSERT_TRUE(read_exception(eport, &start_packet), "error reading start exception");
-    ASSERT_TRUE(verify_exception(&start_packet, child, MX_EXCP_THREAD_STARTING),
+    ASSERT_TRUE(verify_exception(&start_packet, child, ZX_EXCP_THREAD_STARTING),
                 "unexpected exception");
-    mx_koid_t tid = start_packet.exception.tid;
+    zx_koid_t tid = start_packet.exception.tid;
 
-    mx_handle_t thread;
-    mx_status_t status = mx_object_get_child(child, tid, MX_RIGHT_SAME_RIGHTS, &thread);
+    zx_handle_t thread;
+    zx_status_t status = zx_object_get_child(child, tid, ZX_RIGHT_SAME_RIGHTS, &thread);
     if (status < 0)
-        tu_fatal("mx_object_get_child", status);
+        tu_fatal("zx_object_get_child", status);
 
     // The thread may still be running: There's a window between sending the
     // exception report and the thread going to sleep that is exposed to us.
     // We want to verify the thread is still waiting for an exception after we
     // unbind, so wait for the thread to go to sleep before we unbind.
     // Note that there's no worry of this hanging due to our watchdog.
-    mx_info_thread_t info;
+    zx_info_thread_t info;
     do {
-        mx_nanosleep(0);
+        zx_nanosleep(0);
         info = tu_thread_get_info(thread);
-    } while (info.state != MX_THREAD_STATE_BLOCKED);
+    } while (info.state != ZX_THREAD_STATE_BLOCKED);
 
     // Unbind the exception port quietly, meaning to leave the thread
     // waiting for an exception response.
-    tu_set_exception_port(child, MX_HANDLE_INVALID, 0,
-                          MX_EXCEPTION_PORT_DEBUGGER | MX_EXCEPTION_PORT_UNBIND_QUIETLY);
+    tu_set_exception_port(child, ZX_HANDLE_INVALID, 0,
+                          ZX_EXCEPTION_PORT_DEBUGGER | ZX_EXCEPTION_PORT_UNBIND_QUIETLY);
 
     // Rebind and fetch the exception report, it should match the one
     // we just got.
 
-    tu_set_exception_port(child, eport, 0, MX_EXCEPTION_PORT_DEBUGGER);
+    tu_set_exception_port(child, eport, 0, ZX_EXCEPTION_PORT_DEBUGGER);
 
     // Verify exception report matches current exception.
-    mx_exception_report_t report;
-    status = mx_object_get_info(thread, MX_INFO_THREAD_EXCEPTION_REPORT, &report, sizeof(report), NULL, NULL);
+    zx_exception_report_t report;
+    status = zx_object_get_info(thread, ZX_INFO_THREAD_EXCEPTION_REPORT, &report, sizeof(report), NULL, NULL);
     if (status < 0)
-        tu_fatal("mx_object_get_info(MX_INFO_THREAD_EXCEPTION_REPORT)", status);
+        tu_fatal("zx_object_get_info(ZX_INFO_THREAD_EXCEPTION_REPORT)", status);
     EXPECT_EQ(report.header.type, start_packet.type, "type mismatch");
     // The "thread-start" report is a synthetic exception and doesn't contain
     // any arch info yet, so we can't test report.context.arch.
 
     // Done verifying we got the same exception, send the child on its way
     // and tell it we're done.
-    resume_thread_from_exception(child, tid, MX_EXCEPTION_PORT_TYPE_DEBUGGER, 0);
+    resume_thread_from_exception(child, tid, ZX_EXCEPTION_PORT_TYPE_DEBUGGER, 0);
     send_msg(our_channel, MSG_DONE);
 
     wait_process_exit_from_debugger(eport, child, tid);
 
     // We should still be able to get info on the thread.
     info = tu_thread_get_info(thread);
-    EXPECT_EQ(info.state, MX_THREAD_STATE_DEAD, "unexpected thread state");
-    EXPECT_EQ(info.wait_exception_port_type, MX_EXCEPTION_PORT_TYPE_NONE, "wrong exception port type at thread exit");
+    EXPECT_EQ(info.state, ZX_THREAD_STATE_DEAD, "unexpected thread state");
+    EXPECT_EQ(info.wait_exception_port_type, ZX_EXCEPTION_PORT_TYPE_NONE, "wrong exception port type at thread exit");
 
     tu_handle_close(thread);
     tu_handle_close(child);
@@ -1389,22 +1389,22 @@
     BEGIN_TEST;
     unittest_printf("kill_while_stopped_at_start tests\n");
 
-    mx_handle_t child, eport, our_channel;
+    zx_handle_t child, eport, our_channel;
     const char* arg = "";
-    setup_test_child_with_eport(mx_job_default(), arg,
+    setup_test_child_with_eport(zx_job_default(), arg,
                                 &child, &eport, &our_channel);
 
-    mx_koid_t tid;
-    if (read_and_verify_exception(eport, child, MX_EXCP_THREAD_STARTING, &tid)) {
+    zx_koid_t tid;
+    if (read_and_verify_exception(eport, child, ZX_EXCP_THREAD_STARTING, &tid)) {
         // Now kill the thread and wait for the child to exit.
         // This assumes the inferior only has the one thread.
         // If this doesn't work the thread will stay blocked, we'll timeout, and
         // the watchdog will trigger.
-        mx_handle_t thread;
-        mx_status_t status = mx_object_get_child(child, tid, MX_RIGHT_SAME_RIGHTS, &thread);
+        zx_handle_t thread;
+        zx_status_t status = zx_object_get_child(child, tid, ZX_RIGHT_SAME_RIGHTS, &thread);
         if (status < 0)
-            tu_fatal("mx_object_get_child", status);
-        mx_task_kill(thread);
+            tu_fatal("zx_object_get_child", status);
+        zx_task_kill(thread);
         tu_process_wait_signaled(child);
 
         // Keep the thread handle open until after we know the process has exited
@@ -1438,15 +1438,15 @@
 {
     BEGIN_TEST;
 
-    REGISTER_CRASH(mx_thread_self());
+    REGISTER_CRASH(zx_thread_self());
     crash_me();
 
     END_TEST;
 }
 
 typedef struct thread_info {
-    mx_handle_t our_channel, their_channel;
-    mx_handle_t thread_handle;
+    zx_handle_t our_channel, their_channel;
+    zx_handle_t thread_handle;
 } thread_info_t;
 
 static bool multiple_threads_registered_death_test(void)
@@ -1467,7 +1467,7 @@
         tu_thread_create_c11(&thread, thread_func,
                              (void*)(uintptr_t)thread_info[i].their_channel,
                              "registered-death-thread");
-        thread_info[i].thread_handle = thrd_get_mx_handle(thread);
+        thread_info[i].thread_handle = thrd_get_zx_handle(thread);
         REGISTER_CRASH(thread_info[i].thread_handle);
     }
 
@@ -1477,10 +1477,10 @@
     for (unsigned int i = 0; i < num_threads; i++) {
         send_msg(thread_info[i].our_channel, MSG_CRASH);
 
-        ASSERT_EQ(mx_object_wait_one(thread_info[i].thread_handle,
-                                     MX_THREAD_TERMINATED,
-                                     mx_deadline_after(MX_MSEC(500)), NULL),
-                  MX_OK, "failed to wait for thread termination");
+        ASSERT_EQ(zx_object_wait_one(thread_info[i].thread_handle,
+                                     ZX_THREAD_TERMINATED,
+                                     zx_deadline_after(ZX_MSEC(500)), NULL),
+                  ZX_OK, "failed to wait for thread termination");
 
         tu_handle_close(thread_info[i].thread_handle);
         tu_handle_close(thread_info[i].our_channel);
diff --git a/system/utest/exception/rules.mk b/system/utest/exception/rules.mk
index 7e4cb3e..20760d9 100644
--- a/system/utest/exception/rules.mk
+++ b/system/utest/exception/rules.mk
@@ -16,7 +16,7 @@
     system/ulib/unittest \
     system/ulib/test-utils \
     system/ulib/launchpad \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/exit/rules.mk b/system/utest/exit/rules.mk
index 8e6aabe..6970459 100644
--- a/system/utest/exit/rules.mk
+++ b/system/utest/exit/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := exit-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/fbl/include/fbl/tests/intrusive_containers/associative_container_test_environment.h b/system/utest/fbl/include/fbl/tests/intrusive_containers/associative_container_test_environment.h
index ed6301e..4c56f12 100644
--- a/system/utest/fbl/include/fbl/tests/intrusive_containers/associative_container_test_environment.h
+++ b/system/utest/fbl/include/fbl/tests/intrusive_containers/associative_container_test_environment.h
@@ -82,8 +82,8 @@
                 break;
         }
 
-        MX_DEBUG_ASSERT(key != kBannedKeyValue);
-        MX_DEBUG_ASSERT(other_key != kBannedOtherKeyValue);
+        ZX_DEBUG_ASSERT(key != kBannedKeyValue);
+        ZX_DEBUG_ASSERT(other_key != kBannedOtherKeyValue);
 
         // Set the primary key on the object.  Offset the "other" key by OBJ_COUNT
         test_obj->SetKey(key);
diff --git a/system/utest/fbl/include/fbl/tests/intrusive_containers/base_test_environments.h b/system/utest/fbl/include/fbl/tests/intrusive_containers/base_test_environments.h
index ec69d81..1bc68bd 100644
--- a/system/utest/fbl/include/fbl/tests/intrusive_containers/base_test_environments.h
+++ b/system/utest/fbl/include/fbl/tests/intrusive_containers/base_test_environments.h
@@ -940,7 +940,7 @@
         // properly, and that containers of such pointers automatically clean up
         // when the container goes out of scope and destructs.  Note: Don't try
         // this with an unmanaged pointer.  Lists of unmanaged pointers will
-        // MX_ASSERT if they destruct with elements still in them.
+        // ZX_ASSERT if they destruct with elements still in them.
         EXPECT_EQ(0U, ObjType::live_obj_count(), "");
 
         {  // Begin scope for container
diff --git a/system/utest/fbl/ref_counted_tests.cpp b/system/utest/fbl/ref_counted_tests.cpp
index ec94a7d..e96c15d 100644
--- a/system/utest/fbl/ref_counted_tests.cpp
+++ b/system/utest/fbl/ref_counted_tests.cpp
@@ -4,7 +4,7 @@
 
 #include <pthread.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
@@ -236,7 +236,7 @@
         fbl::AutoLock al(&mutex);
         int res = pthread_create(&thread, NULL, &adopt_and_reset, raw);
         ASSERT_LE(0, res);
-        mx_nanosleep(mx_deadline_after(MX_MSEC(300)));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(300)));
         EXPECT_TRUE(destroying);
         // The RawUpgradeTester must be blocked in the destructor, the upgrade will fail.
         auto upgrade1 = fbl::internal::MakeRefPtrUpgradeFromRaw(raw, mutex);
diff --git a/system/utest/fbl/rules.mk b/system/utest/fbl/rules.mk
index a569053..7d1f5a0 100644
--- a/system/utest/fbl/rules.mk
+++ b/system/utest/fbl/rules.mk
@@ -51,14 +51,14 @@
 MODULE_SRCS := $(fbl_device_tests)
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/unittest \
-    system/ulib/magenta \
+    system/ulib/zircon \
 
 include make/module.mk
 
diff --git a/system/utest/fbl/vector_tests.cpp b/system/utest/fbl/vector_tests.cpp
index e0ff865..12f947f 100644
--- a/system/utest/fbl/vector_tests.cpp
+++ b/system/utest/fbl/vector_tests.cpp
@@ -83,7 +83,7 @@
     static ItemType Create(ValueType val) {
         AllocChecker ac;
         ItemType ptr(new (&ac) TestObject(val));
-        MX_ASSERT(ac.check());
+        ZX_ASSERT(ac.check());
         return ptr;
     }
     static ValueType GetValue(const ItemType& c) { return c->value(); }
@@ -104,7 +104,7 @@
     static ItemType Create(ValueType val) {
         AllocChecker ac;
         auto ptr = AdoptRef(new (&ac) RefCountedItem<TestObject>(TestObject(val)));
-        MX_ASSERT(ac.check());
+        ZX_ASSERT(ac.check());
         return ptr;
     }
     static ValueType GetValue(const ItemType& c) { return c->val.value(); }
diff --git a/system/utest/mxio/mxio_handle_fd.c b/system/utest/fdio/fdio_handle_fd.c
similarity index 74%
rename from system/utest/mxio/mxio_handle_fd.c
rename to system/utest/fdio/fdio_handle_fd.c
index fb97bbb..7507c78 100644
--- a/system/utest/mxio/mxio_handle_fd.c
+++ b/system/utest/fdio/fdio_handle_fd.c
@@ -10,37 +10,37 @@
 #include <sys/ioctl.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
-#include <mxio/io.h>
-#include <mxio/util.h>
+#include <zircon/syscalls.h>
+#include <fdio/io.h>
+#include <fdio/util.h>
 #include <unittest/unittest.h>
 
 bool close_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t h = MX_HANDLE_INVALID;
-    ASSERT_EQ(MX_OK, mx_event_create(0u, &h), "mx_event_create() failed");
-    ASSERT_NE(h, MX_HANDLE_INVALID, "");
+    zx_handle_t h = ZX_HANDLE_INVALID;
+    ASSERT_EQ(ZX_OK, zx_event_create(0u, &h), "zx_event_create() failed");
+    ASSERT_NE(h, ZX_HANDLE_INVALID, "");
 
-    // mxio_handle_fd() with shared_handle = true
-    int fd = mxio_handle_fd(h, MX_USER_SIGNAL_0, MX_USER_SIGNAL_1, true);
-    ASSERT_GT(fd, 0, "mxio_handle_fd() failed");
+    // fdio_handle_fd() with shared_handle = true
+    int fd = fdio_handle_fd(h, ZX_USER_SIGNAL_0, ZX_USER_SIGNAL_1, true);
+    ASSERT_GT(fd, 0, "fdio_handle_fd() failed");
 
     close(fd);
 
     // close(fd) has not closed the wrapped handle
-    EXPECT_EQ(MX_OK, mx_object_signal(h, 0, MX_USER_SIGNAL_0),
-              "mx_object_signal() should succeed");
+    EXPECT_EQ(ZX_OK, zx_object_signal(h, 0, ZX_USER_SIGNAL_0),
+              "zx_object_signal() should succeed");
 
-    // mxio_handle_fd() with shared_handle = false
-    fd = mxio_handle_fd(h, MX_USER_SIGNAL_0, MX_USER_SIGNAL_1, false);
-    ASSERT_GT(fd, 0, "mxio_handle_fd() failed");
+    // fdio_handle_fd() with shared_handle = false
+    fd = fdio_handle_fd(h, ZX_USER_SIGNAL_0, ZX_USER_SIGNAL_1, false);
+    ASSERT_GT(fd, 0, "fdio_handle_fd() failed");
 
     close(fd);
 
     // close(fd) has closed the wrapped handle
-    EXPECT_EQ(MX_ERR_BAD_HANDLE, mx_object_signal(h, 0, MX_USER_SIGNAL_0),
-              "mx_object_signal() should fail");
+    EXPECT_EQ(ZX_ERR_BAD_HANDLE, zx_object_signal(h, 0, ZX_USER_SIGNAL_0),
+              "zx_object_signal() should fail");
 
     END_TEST;
 }
@@ -105,13 +105,13 @@
 
 
     // fd --> handles
-    mx_handle_t handles[MXIO_MAX_HANDLES];
-    uint32_t types[MXIO_MAX_HANDLES];
-    mx_status_t r = mxio_transfer_fd(fds[0], 0, handles, types);
+    zx_handle_t handles[FDIO_MAX_HANDLES];
+    uint32_t types[FDIO_MAX_HANDLES];
+    zx_status_t r = fdio_transfer_fd(fds[0], 0, handles, types);
     ASSERT_GT(r, 0, "failed to transfer fds to handles");
 
     // handles --> fd
-    ASSERT_EQ(mxio_create_fd(handles, types, r, &fds[0]), MX_OK,
+    ASSERT_EQ(fdio_create_fd(handles, types, r, &fds[0]), ZX_OK,
               "failed to transfer handles to fds");
 
     // Read message
@@ -127,8 +127,8 @@
     END_TEST;
 }
 
-BEGIN_TEST_CASE(mxio_handle_fd_test)
+BEGIN_TEST_CASE(fdio_handle_fd_test)
 RUN_TEST(close_test);
 RUN_TEST(pipe_test);
 RUN_TEST(transfer_fd_test);
-END_TEST_CASE(mxio_handle_fd_test)
+END_TEST_CASE(fdio_handle_fd_test)
diff --git a/system/utest/mxio/mxio_path_canonicalize.c b/system/utest/fdio/fdio_path_canonicalize.c
similarity index 93%
rename from system/utest/mxio/mxio_path_canonicalize.c
rename to system/utest/fdio/fdio_path_canonicalize.c
index f6cacad..b6eaabc 100644
--- a/system/utest/mxio/mxio_path_canonicalize.c
+++ b/system/utest/fdio/fdio_path_canonicalize.c
@@ -6,7 +6,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-#include <mxio/private.h>
+#include <fdio/private.h>
 
 #include <unittest/unittest.h>
 
@@ -16,7 +16,7 @@
         const char out_gold[] = (p2);                                         \
         size_t outlen;                                                        \
         bool is_dir;                                                          \
-        EXPECT_EQ(__mxio_cleanpath(in, out, &outlen, &is_dir), MX_OK, ""); \
+        EXPECT_EQ(__fdio_cleanpath(in, out, &outlen, &is_dir), ZX_OK, ""); \
         EXPECT_EQ(is_dir, dir, "");                                           \
         char msg[PATH_MAX * 3 + 128];                                         \
         sprintf(msg, "[%s] --> [%s], expected [%s]", in, out, out_gold);      \
@@ -77,9 +77,9 @@
     END_TEST;
 }
 
-BEGIN_TEST_CASE(mxio_path_canonicalization_test)
+BEGIN_TEST_CASE(fdio_path_canonicalization_test)
 RUN_TEST(basic_test);
 RUN_TEST(dotdot_test);
 RUN_TEST(dot_test);
 RUN_TEST(minimal_test);
-END_TEST_CASE(mxio_path_canonicalization_test)
+END_TEST_CASE(fdio_path_canonicalization_test)
diff --git a/system/utest/mxio/mxio_root.c b/system/utest/fdio/fdio_root.c
similarity index 88%
rename from system/utest/mxio/mxio_root.c
rename to system/utest/fdio/fdio_root.c
index e05d57c..80aaff6 100644
--- a/system/utest/mxio/mxio_root.c
+++ b/system/utest/fdio/fdio_root.c
@@ -8,11 +8,11 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
-#include <mxio/private.h>
+#include <fdio/private.h>
 
 #include <unittest/unittest.h>
 
-// These tests poke at some "global" behavior of mxio
+// These tests poke at some "global" behavior of fdio
 // that are not easily tested through filesystem tests,
 // since they (for example) rely on a global root.
 //
@@ -47,7 +47,7 @@
     END_TEST;
 }
 
-BEGIN_TEST_CASE(mxio_root_test)
+BEGIN_TEST_CASE(fdio_root_test)
 RUN_TEST(stat_test)
 RUN_TEST(remove_test)
-END_TEST_CASE(mxio_root_test)
+END_TEST_CASE(fdio_root_test)
diff --git a/system/utest/mxio/mxio_socketpair.c b/system/utest/fdio/fdio_socketpair.c
similarity index 97%
rename from system/utest/mxio/mxio_socketpair.c
rename to system/utest/fdio/fdio_socketpair.c
index aedc1fe..4fe9a64 100644
--- a/system/utest/mxio/mxio_socketpair.c
+++ b/system/utest/fdio/fdio_socketpair.c
@@ -12,7 +12,7 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include <unittest/unittest.h>
 
@@ -182,7 +182,7 @@
 typedef struct poll_for_read_args {
     int fd;
     int poll_result;
-    mx_time_t poll_time;
+    zx_time_t poll_time;
 } poll_for_read_args_t;
 
 int poll_for_read_with_timeout(void* arg) {
@@ -193,9 +193,9 @@
     pollfd.revents = 0;
 
     int timeout_ms = 100;
-    mx_time_t time_before = mx_time_get(CLOCK_MONOTONIC);
+    zx_time_t time_before = zx_time_get(CLOCK_MONOTONIC);
     poll_args->poll_result = poll(&pollfd, 1, timeout_ms);
-    mx_time_t time_after = mx_time_get(CLOCK_MONOTONIC);
+    zx_time_t time_after = zx_time_get(CLOCK_MONOTONIC);
     poll_args->poll_time = time_after - time_before;
 
     int num_readable = 0;
@@ -397,7 +397,7 @@
     END_TEST;
 }
 
-BEGIN_TEST_CASE(mxio_socketpair_test)
+BEGIN_TEST_CASE(fdio_socketpair_test)
 RUN_TEST(socketpair_test);
 RUN_TEST(socketpair_shutdown_rd_test);
 RUN_TEST(socketpair_shutdown_wr_test);
@@ -408,4 +408,4 @@
 RUN_TEST(socketpair_shutdown_peer_wr_during_recv_test);
 RUN_TEST(socketpair_shutdown_self_wr_during_send_test);
 RUN_TEST(socketpair_shutdown_peer_rd_during_send_test);
-END_TEST_CASE(mxio_socketpair_test)
+END_TEST_CASE(fdio_socketpair_test)
diff --git a/system/utest/mxio/main.c b/system/utest/fdio/main.c
similarity index 100%
rename from system/utest/mxio/main.c
rename to system/utest/fdio/main.c
diff --git a/system/utest/mxio/rules.mk b/system/utest/fdio/rules.mk
similarity index 63%
rename from system/utest/mxio/rules.mk
rename to system/utest/fdio/rules.mk
index 6b5ca2a..23d614d 100644
--- a/system/utest/mxio/rules.mk
+++ b/system/utest/fdio/rules.mk
@@ -10,17 +10,17 @@
 
 MODULE_SRCS += \
     $(LOCAL_DIR)/main.c \
-    $(LOCAL_DIR)/mxio_handle_fd.c \
-    $(LOCAL_DIR)/mxio_root.c \
-    $(LOCAL_DIR)/mxio_path_canonicalize.c \
-    $(LOCAL_DIR)/mxio_socketpair.c
+    $(LOCAL_DIR)/fdio_handle_fd.c \
+    $(LOCAL_DIR)/fdio_root.c \
+    $(LOCAL_DIR)/fdio_path_canonicalize.c \
+    $(LOCAL_DIR)/fdio_socketpair.c
 
-MODULE_NAME := mxio-test
+MODULE_NAME := fdio-test
 
 MODULE_LIBS := \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/fpu/fputest.c b/system/utest/fpu/fputest.c
index 13c95db..21222f5 100644
--- a/system/utest/fpu/fputest.c
+++ b/system/utest/fpu/fputest.c
@@ -9,8 +9,8 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 #define THREAD_COUNT 8
@@ -63,7 +63,7 @@
     /* test lazy fpu load on separate thread */
     thrd_t t[THREAD_COUNT];
     double val[countof(t)];
-    char name[MX_MAX_NAME_LEN];
+    char name[ZX_MAX_NAME_LEN];
 
     unittest_printf("creating %zu floating point threads\n", countof(t));
     for (unsigned int i = 0; i < countof(t); i++) {
diff --git a/system/utest/fpu/rules.mk b/system/utest/fpu/rules.mk
index f006db9..3ffced1 100644
--- a/system/utest/fpu/rules.mk
+++ b/system/utest/fpu/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := fpu-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/fs-bench/bench-basic.cpp b/system/utest/fs-bench/bench-basic.cpp
index 2b2afb9..7b34c89 100644
--- a/system/utest/fs-bench/bench-basic.cpp
+++ b/system/utest/fs-bench/bench-basic.cpp
@@ -13,8 +13,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <magenta/device/vfs.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/vfs.h>
+#include <zircon/syscalls.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/string_piece.h>
 #include <fbl/unique_ptr.h>
@@ -43,8 +43,8 @@
 }
 
 inline void time_end(const char *str, uint64_t start) {
-    uint64_t end = mx_ticks_get();
-    uint64_t ticks_per_msec = mx_ticks_per_second() / 1000;
+    uint64_t end = zx_ticks_get();
+    uint64_t ticks_per_msec = zx_ticks_per_second() / 1000;
     printf("Benchmark %s: [%10lu] msec\n", str, (end - start) / ticks_per_msec);
 }
 
@@ -78,7 +78,7 @@
         char str[100];
         snprintf(str, sizeof(str), "write %d", i);
 
-        start = mx_ticks_get();
+        start = zx_ticks_get();
         count = NumOps;
         while (count--) {
             ASSERT_EQ(write(fd, data.get(), DataSize), DataSize);
@@ -88,7 +88,7 @@
         ASSERT_EQ(lseek(fd, 0, SEEK_SET), 0);
         snprintf(str, sizeof(str), "read %d", i);
 
-        start = mx_ticks_get();
+        start = zx_ticks_get();
         count = NumOps;
         while (count--) {
             ASSERT_EQ(read(fd, data.get(), DataSize), DataSize);
@@ -176,16 +176,16 @@
     strcpy(path, MOUNT_POINT);
     uint64_t start;
 
-    start = mx_ticks_get();
+    start = zx_ticks_get();
     ASSERT_TRUE(walk_down_path_components<MaxComponents>(path, mkdir_callback));
     time_end("mkdir", start);
 
     strcpy(path, MOUNT_POINT);
-    start = mx_ticks_get();
+    start = zx_ticks_get();
     ASSERT_TRUE(walk_down_path_components<MaxComponents>(path, stat_callback));
     time_end("stat", start);
 
-    start = mx_ticks_get();
+    start = zx_ticks_get();
     ASSERT_TRUE(walk_up_path_components(path, unlink_callback));
     time_end("unlink", start);
     END_TEST;
diff --git a/system/utest/fs-bench/rules.mk b/system/utest/fs-bench/rules.mk
index 23af58a..1a2058d 100644
--- a/system/utest/fs-bench/rules.mk
+++ b/system/utest/fs-bench/rules.mk
@@ -17,14 +17,14 @@
     $(LOCAL_DIR)/bench-basic.cpp \
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/fs-management \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/fs-management/fs-management.c b/system/utest/fs-management/fs-management.c
index a36d4fe..8ebacae 100644
--- a/system/utest/fs-management/fs-management.c
+++ b/system/utest/fs-management/fs-management.c
@@ -14,10 +14,10 @@
 #include <time.h>
 #include <unistd.h>
 
-#include <magenta/device/block.h>
-#include <magenta/device/vfs.h>
-#include <magenta/device/ramdisk.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/block.h>
+#include <zircon/device/vfs.h>
+#include <zircon/device/ramdisk.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 #include <fs-management/mount.h>
@@ -52,16 +52,16 @@
 
     BEGIN_TEST;
     ASSERT_EQ(create_ramdisk(512, 1 << 16, ramdisk_path), 0, "");
-    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), MX_OK, "");
+    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), ZX_OK, "");
     ASSERT_EQ(mkdir(mount_path, 0666), 0, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "memfs", strlen("memfs")), "");
     int fd = open(ramdisk_path, O_RDWR);
     ASSERT_GT(fd, 0, "");
     ASSERT_EQ(mount(fd, mount_path, DISK_FORMAT_MINFS, &default_mount_options,
                     launch_stdio_async),
-              MX_OK, "");
+              ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "minfs", strlen("minfs")), "");
-    ASSERT_EQ(umount(mount_path), MX_OK, "");
+    ASSERT_EQ(umount(mount_path), ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "memfs", strlen("memfs")), "");
     ASSERT_EQ(destroy_ramdisk(ramdisk_path), 0, "");
     ASSERT_EQ(unlink(mount_path), 0, "");
@@ -74,16 +74,16 @@
 
     BEGIN_TEST;
     ASSERT_EQ(create_ramdisk(512, 1 << 16, ramdisk_path), 0, "");
-    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), MX_OK, "");
+    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), ZX_OK, "");
     int fd = open(ramdisk_path, O_RDWR);
     ASSERT_GT(fd, 0, "");
     mount_options_t options = default_mount_options;
     options.create_mountpoint = true;
     ASSERT_EQ(mount(fd, mount_path, DISK_FORMAT_MINFS, &options,
                     launch_stdio_async),
-              MX_OK, "");
+              ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "minfs", strlen("minfs")), "");
-    ASSERT_EQ(umount(mount_path), MX_OK, "");
+    ASSERT_EQ(umount(mount_path), ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "memfs", strlen("memfs")), "");
     ASSERT_EQ(destroy_ramdisk(ramdisk_path), 0, "");
     ASSERT_EQ(unlink(mount_path), 0, "");
@@ -96,7 +96,7 @@
 
     BEGIN_TEST;
     ASSERT_EQ(create_ramdisk(512, 1 << 16, ramdisk_path), 0, "");
-    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), MX_OK, "");
+    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), ZX_OK, "");
     ASSERT_EQ(mkdir(mount_path, 0666), 0, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "memfs", strlen("memfs")), "");
     int fd = open(ramdisk_path, O_RDWR);
@@ -106,9 +106,9 @@
     ASSERT_GT(mountfd, 0, "Couldn't open mount point");
     ASSERT_EQ(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options,
                     launch_stdio_async),
-              MX_OK, "");
+              ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "minfs", strlen("minfs")), "");
-    ASSERT_EQ(fumount(mountfd), MX_OK, "");
+    ASSERT_EQ(fumount(mountfd), ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "memfs", strlen("memfs")), "");
     ASSERT_EQ(destroy_ramdisk(ramdisk_path), 0, "");
     ASSERT_EQ(close(mountfd), 0, "Couldn't close ex-mount point");
@@ -121,7 +121,7 @@
 bool do_mount_evil(const char* parentfs_name, const char* mount_path) {
     char ramdisk_path[PATH_MAX];
     ASSERT_EQ(create_ramdisk(512, 1 << 16, ramdisk_path), 0, "");
-    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), MX_OK, "");
+    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), ZX_OK, "");
     ASSERT_EQ(mkdir(mount_path, 0666), 0, "");
 
     int fd = open(ramdisk_path, O_RDWR);
@@ -135,8 +135,8 @@
     // The directory was unlinked! We can't mount now!
     ASSERT_NE(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options,
                    launch_stdio_async),
-              MX_OK, "");
-    ASSERT_NE(fumount(mountfd), MX_OK, "");
+              ZX_OK, "");
+    ASSERT_NE(fumount(mountfd), ZX_OK, "");
     ASSERT_EQ(close(mountfd), 0, "Couldn't close unlinked not-mount point");
 
     // Re-acquire the ramdisk mount point; it's always consumed...
@@ -149,8 +149,8 @@
     // Wait a sec, that was a file, not a directory! We can't mount that!
     ASSERT_NE(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options,
                      launch_stdio_async),
-              MX_OK, "");
-    ASSERT_NE(fumount(mountfd), MX_OK, "");
+              ZX_OK, "");
+    ASSERT_NE(fumount(mountfd), ZX_OK, "");
     ASSERT_EQ(close(mountfd), 0, "Couldn't close file not-mount point");
     ASSERT_EQ(unlink(mount_path), 0, "");
 
@@ -162,7 +162,7 @@
     mountfd = open(mount_path, O_RDONLY | O_DIRECTORY);
     ASSERT_GT(mountfd, 0, "Couldn't open mount point");
     ASSERT_EQ(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options,
-                     launch_stdio_async), MX_ERR_ACCESS_DENIED, "");
+                     launch_stdio_async), ZX_ERR_ACCESS_DENIED, "");
     ASSERT_EQ(close(mountfd), 0, "Couldn't close the unpriviledged mount point");
 
     // Okay, fine, let's mount successfully...
@@ -172,13 +172,13 @@
     ASSERT_GT(mountfd, 0, "Couldn't open mount point");
     ASSERT_EQ(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options,
                     launch_stdio_async),
-              MX_OK, "");
+              ZX_OK, "");
     // Awesome, that worked. But we shouldn't be able to mount again!
     fd = open(ramdisk_path, O_RDWR);
     ASSERT_GT(fd, 0, "");
     ASSERT_NE(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options,
                    launch_stdio_async),
-              MX_OK, "");
+              ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "minfs", strlen("minfs")), "");
 
     // Let's try removing the mount point (we shouldn't be allowed to do so)
@@ -189,18 +189,18 @@
     // WITHOUT O_ADMIN
     int badfd = open(mount_path, O_RDONLY | O_DIRECTORY);
     ASSERT_GT(badfd, 0, "");
-    ASSERT_EQ(ioctl_vfs_unmount_fs(badfd), MX_ERR_ACCESS_DENIED, "");
+    ASSERT_EQ(ioctl_vfs_unmount_fs(badfd), ZX_ERR_ACCESS_DENIED, "");
     ASSERT_EQ(close(badfd), 0, "");
 
     // Let's try unmounting the filesystem WITHOUT O_ADMIN
     // (unpinning the remote handle from the parent FS).
     badfd = open(mount_path, O_RDONLY | O_DIRECTORY);
-    mx_handle_t h;
-    ASSERT_EQ(ioctl_vfs_unmount_node(badfd, &h), MX_ERR_ACCESS_DENIED, "");
+    zx_handle_t h;
+    ASSERT_EQ(ioctl_vfs_unmount_node(badfd, &h), ZX_ERR_ACCESS_DENIED, "");
     ASSERT_EQ(close(badfd), 0, "");
 
     // When we unmount with an O_ADMIN handle, it should successfully detach.
-    ASSERT_EQ(fumount(mountfd), MX_OK, "");
+    ASSERT_EQ(fumount(mountfd), ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, parentfs_name, strlen(parentfs_name)), "");
     ASSERT_EQ(close(mountfd), 0, "");
     ASSERT_EQ(rmdir(mount_path), 0, "");
@@ -220,7 +220,7 @@
 
     BEGIN_TEST;
     ASSERT_EQ(create_ramdisk(512, 1 << 16, ramdisk_path), 0, "");
-    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), MX_OK, "");
+    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), ZX_OK, "");
     const char* parent_path = "/tmp/parent";
     ASSERT_EQ(mkdir(parent_path, 0666), 0, "");
     int mountfd = open(parent_path, O_RDONLY | O_DIRECTORY | O_ADMIN);
@@ -229,7 +229,7 @@
     ASSERT_GT(ramdiskfd, 0, "");
     ASSERT_EQ(fmount(ramdiskfd, mountfd, DISK_FORMAT_MINFS, &default_mount_options,
                     launch_stdio_async),
-              MX_OK, "");
+              ZX_OK, "");
     ASSERT_EQ(close(mountfd), 0, "");
 
     const char* mount_path = "/tmp/parent/mount_evil";
@@ -247,7 +247,7 @@
 
     BEGIN_TEST;
     ASSERT_EQ(create_ramdisk(512, 1 << 16, ramdisk_path), 0, "");
-    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), MX_OK, "");
+    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), ZX_OK, "");
     ASSERT_EQ(mkdir(mount_path, 0666), 0, "");
 
     // We should still be able to mount and unmount the filesystem multiple times
@@ -256,8 +256,8 @@
         ASSERT_GE(fd, 0, "");
         ASSERT_EQ(mount(fd, mount_path, DISK_FORMAT_MINFS, &default_mount_options,
                         launch_stdio_async),
-                  MX_OK, "");
-        ASSERT_EQ(umount(mount_path), MX_OK, "");
+                  ZX_OK, "");
+        ASSERT_EQ(umount(mount_path), ZX_OK, "");
     }
     ASSERT_EQ(destroy_ramdisk(ramdisk_path), 0, "");
     ASSERT_EQ(unlink(mount_path), 0, "");
@@ -270,17 +270,17 @@
 
     BEGIN_TEST;
     ASSERT_EQ(create_ramdisk(512, 1 << 16, ramdisk_path), 0, "");
-    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), MX_OK, "");
+    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), ZX_OK, "");
     ASSERT_EQ(mkdir(mount_path, 0666), 0, "");
     int fd = open(ramdisk_path, O_RDWR);
     ASSERT_GE(fd, 0, "Could not open ramdisk device");
     ASSERT_EQ(mount(fd, mount_path, DISK_FORMAT_MINFS, &default_mount_options,
                     launch_stdio_async),
-              MX_OK, "");
-    ASSERT_EQ(umount(mount_path), MX_OK, "");
+              ZX_OK, "");
+    ASSERT_EQ(umount(mount_path), ZX_OK, "");
     // fsck shouldn't require any user input for a newly mkfs'd filesystem
     ASSERT_EQ(fsck(ramdisk_path, DISK_FORMAT_MINFS, &default_fsck_options, launch_stdio_sync),
-              MX_OK, "");
+              ZX_OK, "");
     ASSERT_EQ(destroy_ramdisk(ramdisk_path), 0, "");
     ASSERT_EQ(unlink(mount_path), 0, "");
     END_TEST;
@@ -294,14 +294,14 @@
 
     // Create a ramdisk, mount minfs
     ASSERT_EQ(create_ramdisk(512, 1 << 16, ramdisk_path), 0, "");
-    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), MX_OK, "");
+    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), ZX_OK, "");
     ASSERT_EQ(mkdir(mount_path, 0666), 0, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "memfs", strlen("memfs")), "");
     int fd = open(ramdisk_path, O_RDWR);
     ASSERT_GT(fd, 0, "");
     ASSERT_EQ(mount(fd, mount_path, DISK_FORMAT_MINFS, &default_mount_options,
                     launch_stdio_async),
-              MX_OK, "");
+              ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "minfs", strlen("minfs")), "");
 
     // Try re-opening the root without O_ADMIN. We shouldn't be able to umount.
@@ -324,7 +324,7 @@
 
     // Finally, umount using O_NOREMOTE and acquiring the connection
     // that has "O_ADMIN" set.
-    ASSERT_EQ(umount(mount_path), MX_OK, "");
+    ASSERT_EQ(umount(mount_path), ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "memfs", strlen("memfs")), "");
     ASSERT_EQ(destroy_ramdisk(ramdisk_path), 0, "");
     ASSERT_EQ(unlink(mount_path), 0, "");
@@ -337,7 +337,7 @@
 
     BEGIN_TEST;
     ASSERT_EQ(create_ramdisk(512, 1 << 16, ramdisk_path), 0, "");
-    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), MX_OK, "");
+    ASSERT_EQ(mkfs(ramdisk_path, DISK_FORMAT_MINFS, launch_stdio_sync, &default_mkfs_options), ZX_OK, "");
     ASSERT_EQ(mkdir(mount_path, 0666), 0, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "memfs", strlen("memfs")), "");
 
@@ -352,7 +352,7 @@
     ASSERT_GT(fd, 0, "");
     ASSERT_EQ(mount(fd, mount_path, DISK_FORMAT_MINFS, &default_mount_options,
                     launch_stdio_async),
-              MX_OK, "");
+              ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "minfs", strlen("minfs")), "");
 
     mountfd = open(mount_path, O_RDONLY | O_ADMIN);
@@ -368,7 +368,7 @@
     ASSERT_LT(path_len, 0, "");
     ASSERT_EQ(close(mountfd), 0, "");
 
-    ASSERT_EQ(umount(mount_path), MX_OK, "");
+    ASSERT_EQ(umount(mount_path), ZX_OK, "");
     ASSERT_TRUE(check_mounted_fs(mount_path, "memfs", strlen("memfs")), "");
 
     mountfd = open(mount_path, O_RDONLY | O_ADMIN);
diff --git a/system/utest/fs-management/rules.mk b/system/utest/fs-management/rules.mk
index bf0563a..29599d0 100644
--- a/system/utest/fs-management/rules.mk
+++ b/system/utest/fs-management/rules.mk
@@ -17,9 +17,9 @@
 
 MODULE_LIBS := \
     system/ulib/fs-management \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/fs/filesystems.cpp b/system/utest/fs/filesystems.cpp
index cb82ef5..8c279f0 100644
--- a/system/utest/fs/filesystems.cpp
+++ b/system/utest/fs/filesystems.cpp
@@ -15,9 +15,9 @@
 #include <fvm/fvm.h>
 #include <fs-management/mount.h>
 #include <fs-management/ramdisk.h>
-#include <magenta/device/block.h>
-#include <magenta/device/device.h>
-#include <magenta/device/ramdisk.h>
+#include <zircon/device/block.h>
+#include <zircon/device/device.h>
+#include <zircon/device/ramdisk.h>
 
 #include "filesystems.h"
 
@@ -71,7 +71,7 @@
         if (fd < 0) {
             fprintf(stderr, "[FAILED]: Could not open test disk\n");
             exit(-1);
-        } else if (fvm_init(fd, TEST_FVM_SLICE_SIZE) != MX_OK) {
+        } else if (fvm_init(fd, TEST_FVM_SLICE_SIZE) != ZX_OK) {
             fprintf(stderr, "[FAILED]: Could not format disk with FVM\n");
             exit(-1);
         } else if (ioctl_device_bind(fd, FVM_DRIVER_LIB, STRLEN(FVM_DRIVER_LIB)) < 0) {
@@ -222,9 +222,9 @@
 }
 
 int mkfs_minfs(const char* disk_path) {
-    mx_status_t status;
+    zx_status_t status;
     if ((status = mkfs(disk_path, DISK_FORMAT_MINFS, launch_stdio_sync,
-                       &default_mkfs_options)) != MX_OK) {
+                       &default_mkfs_options)) != ZX_OK) {
         fprintf(stderr, "Could not mkfs filesystem");
         return -1;
     }
@@ -232,8 +232,8 @@
 }
 
 int fsck_minfs(const char* disk_path) {
-    mx_status_t status;
-    if ((status = fsck(disk_path, DISK_FORMAT_MINFS, &test_fsck_options, launch_stdio_sync)) != MX_OK) {
+    zx_status_t status;
+    if ((status = fsck(disk_path, DISK_FORMAT_MINFS, &test_fsck_options, launch_stdio_sync)) != ZX_OK) {
         fprintf(stderr, "fsck on MinFS failed");
         return -1;
     }
@@ -249,9 +249,9 @@
 
     // fd consumed by mount. By default, mount waits until the filesystem is ready to accept
     // commands.
-    mx_status_t status;
+    zx_status_t status;
     if ((status = mount(fd, mount_path, DISK_FORMAT_MINFS, &default_mount_options,
-                        launch_stdio_async)) != MX_OK) {
+                        launch_stdio_async)) != ZX_OK) {
         fprintf(stderr, "Could not mount filesystem\n");
         return status;
     }
@@ -260,8 +260,8 @@
 }
 
 int unmount_minfs(const char* mount_path) {
-    mx_status_t status = umount(mount_path);
-    if (status != MX_OK) {
+    zx_status_t status = umount(mount_path);
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to unmount filesystem\n");
         return status;
     }
@@ -274,9 +274,9 @@
 }
 
 int mkfs_thinfs(const char* disk_path) {
-    mx_status_t status;
+    zx_status_t status;
     if ((status = mkfs(disk_path, DISK_FORMAT_FAT, launch_stdio_sync,
-                       &default_mkfs_options)) != MX_OK) {
+                       &default_mkfs_options)) != ZX_OK) {
         fprintf(stderr, "Could not mkfs filesystem");
         return -1;
     }
@@ -284,8 +284,8 @@
 }
 
 int fsck_thinfs(const char* disk_path) {
-    mx_status_t status;
-    if ((status = fsck(disk_path, DISK_FORMAT_FAT, &test_fsck_options, launch_stdio_sync)) != MX_OK) {
+    zx_status_t status;
+    if ((status = fsck(disk_path, DISK_FORMAT_FAT, &test_fsck_options, launch_stdio_sync)) != ZX_OK) {
         fprintf(stderr, "fsck on FAT failed");
         return -1;
     }
@@ -301,9 +301,9 @@
 
     // fd consumed by mount. By default, mount waits until the filesystem is ready to accept
     // commands.
-    mx_status_t status;
+    zx_status_t status;
     if ((status = mount(fd, mount_path, DISK_FORMAT_FAT, &default_mount_options,
-                        launch_stdio_async)) != MX_OK) {
+                        launch_stdio_async)) != ZX_OK) {
         fprintf(stderr, "Could not mount filesystem\n");
         return status;
     }
@@ -312,8 +312,8 @@
 }
 
 int unmount_thinfs(const char* mount_path) {
-    mx_status_t status = umount(mount_path);
-    if (status != MX_OK) {
+    zx_status_t status = umount(mount_path);
+    if (status != ZX_OK) {
         fprintf(stderr, "Failed to unmount filesystem\n");
         return status;
     }
@@ -352,6 +352,6 @@
         .supports_create_by_vmo = false,
         .supports_mmap = false,
         .supports_resize = false,
-        .nsec_granularity = MX_SEC(2),
+        .nsec_granularity = ZX_SEC(2),
     },
 };
diff --git a/system/utest/fs/filesystems.h b/system/utest/fs/filesystems.h
index 7a333b8..39c2203 100644
--- a/system/utest/fs/filesystems.h
+++ b/system/utest/fs/filesystems.h
@@ -10,7 +10,7 @@
 #include <string.h>
 
 #include <fs-management/mount.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <unittest/unittest.h>
 
 __BEGIN_CDECLS;
@@ -33,7 +33,7 @@
 } fs_info_t;
 
 // Path to mounted filesystem currently being tested
-#define MOUNT_PATH "/tmp/magenta-fs-test"
+#define MOUNT_PATH "/tmp/zircon-fs-test"
 extern const char* test_root_path;
 
 // Path to the mounted filesystem's backing store (if it exists)
diff --git a/system/utest/fs/misc.h b/system/utest/fs/misc.h
index 875aacf..70c7418 100644
--- a/system/utest/fs/misc.h
+++ b/system/utest/fs/misc.h
@@ -11,7 +11,7 @@
 #include <string.h>
 #include <sys/types.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 // Filesystem test utilities
 
diff --git a/system/utest/fs/rules.mk b/system/utest/fs/rules.mk
index 50106f4..356d630 100644
--- a/system/utest/fs/rules.mk
+++ b/system/utest/fs/rules.mk
@@ -53,16 +53,16 @@
     system/ulib/fs \
     system/ulib/gpt \
     system/ulib/digest \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     third_party/ulib/cryptolib \
 
 MODULE_LIBS := \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/c \
     system/ulib/fs-management \
     system/ulib/launchpad \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/fs/test-attr.c b/system/utest/fs/test-attr.c
index 69c6eb5..530fa40 100644
--- a/system/utest/fs/test-attr.c
+++ b/system/utest/fs/test-attr.c
@@ -12,41 +12,41 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
-#include <magenta/syscalls.h>
-#include <mxio/vfs.h>
+#include <zircon/syscalls.h>
+#include <fdio/vfs.h>
 
 #include "filesystems.h"
 
 #define ROUND_DOWN(t, granularity) ((t) - ((t) % (granularity)))
 
-mx_time_t nstimespec(struct timespec ts) {
+zx_time_t nstimespec(struct timespec ts) {
     // assumes very small number of seconds in deltas
-    return ts.tv_sec * MX_SEC(1) + ts.tv_nsec;
+    return ts.tv_sec * ZX_SEC(1) + ts.tv_nsec;
 }
 
 bool test_attr(void) {
     BEGIN_TEST;
-    mx_time_t now = mx_time_get(MX_CLOCK_UTC);
-    ASSERT_NE(now, 0u, "mx_time_get only returns zero on error");
+    zx_time_t now = zx_time_get(ZX_CLOCK_UTC);
+    ASSERT_NE(now, 0u, "zx_time_get only returns zero on error");
 
     int fd1 = open("::file.txt", O_CREAT | O_RDWR, 0644);
     ASSERT_GT(fd1, 0, "");
 
     struct timespec ts[2];
     ts[0].tv_nsec = UTIME_OMIT;
-    ts[1].tv_sec = (long)(now / MX_SEC(1));
-    ts[1].tv_nsec = (long)(now % MX_SEC(1));
+    ts[1].tv_sec = (long)(now / ZX_SEC(1));
+    ts[1].tv_nsec = (long)(now % ZX_SEC(1));
 
     // make sure we get back "now" from stat()
     ASSERT_EQ(futimens(fd1, ts), 0, "");
     struct stat statb1;
     ASSERT_EQ(fstat(fd1, &statb1), 0, "");
     now = ROUND_DOWN(now, test_info->nsec_granularity);
-    ASSERT_EQ(statb1.st_mtim.tv_sec, (long)(now / MX_SEC(1)), "");
-    ASSERT_EQ(statb1.st_mtim.tv_nsec, (long)(now % MX_SEC(1)), "");
+    ASSERT_EQ(statb1.st_mtim.tv_sec, (long)(now / ZX_SEC(1)), "");
+    ASSERT_EQ(statb1.st_mtim.tv_nsec, (long)(now % ZX_SEC(1)), "");
     ASSERT_EQ(close(fd1), 0, "");
 
-    mx_nanosleep(mx_deadline_after(test_info->nsec_granularity));
+    zx_nanosleep(zx_deadline_after(test_info->nsec_granularity));
 
     ASSERT_EQ(utimes("::file.txt", NULL), 0, "");
     struct stat statb2;
@@ -97,11 +97,11 @@
         return true;
     }
 
-    mx_time_t now = mx_time_get(MX_CLOCK_UTC);
-    ASSERT_NE(now, 0u, "mx_time_get only returns zero on error");
+    zx_time_t now = zx_time_get(ZX_CLOCK_UTC);
+    ASSERT_NE(now, 0u, "zx_time_get only returns zero on error");
 
     // Create a parent directory to contain new contents
-    mx_nanosleep(mx_deadline_after(test_info->nsec_granularity));
+    zx_nanosleep(zx_deadline_after(test_info->nsec_granularity));
     ASSERT_EQ(mkdir("::parent", 0666), 0, "");
     ASSERT_EQ(mkdir("::parent2", 0666), 0, "");
 
@@ -114,7 +114,7 @@
     now = nstimespec(statb.st_ctim);
 
     // Create a file in the parent directory
-    mx_nanosleep(mx_deadline_after(test_info->nsec_granularity));
+    zx_nanosleep(zx_deadline_after(test_info->nsec_granularity));
     int fd = open("::parent/child", O_CREAT | O_RDWR);
     ASSERT_GT(fd, 0, "");
     ASSERT_EQ(close(fd), 0, "");
@@ -128,7 +128,7 @@
     now = nstimespec(statb.st_mtim);
 
     // Link the child into a second directory
-    mx_nanosleep(mx_deadline_after(test_info->nsec_granularity));
+    zx_nanosleep(zx_deadline_after(test_info->nsec_granularity));
     ASSERT_EQ(link("::parent/child", "::parent2/child"), 0, "");
     // Source directory is not impacted
     ASSERT_EQ(stat("::parent", &statb), 0, "");
@@ -140,7 +140,7 @@
 
     // Unlink the child, and the parent's time should
     // move forward again
-    mx_nanosleep(mx_deadline_after(test_info->nsec_granularity));
+    zx_nanosleep(zx_deadline_after(test_info->nsec_granularity));
     ASSERT_EQ(unlink("::parent2/child"), 0, "");
     ASSERT_EQ(stat("::parent2", &statb), 0, "");
     ASSERT_GT(nstimespec(statb.st_mtim), now, "");
@@ -148,7 +148,7 @@
 
     // Rename the child, and both the source and dest
     // directories should be updated
-    mx_nanosleep(mx_deadline_after(test_info->nsec_granularity));
+    zx_nanosleep(zx_deadline_after(test_info->nsec_granularity));
     ASSERT_EQ(rename("::parent/child", "::parent2/child"), 0, "");
     ASSERT_EQ(stat("::parent", &statb), 0, "");
     ASSERT_GT(nstimespec(statb.st_mtim), now, "");
diff --git a/system/utest/fs/test-directory.c b/system/utest/fs/test-directory.c
index 34dc6ef..95fd6fd 100644
--- a/system/utest/fs/test-directory.c
+++ b/system/utest/fs/test-directory.c
@@ -14,7 +14,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include "filesystems.h"
 #include "misc.h"
diff --git a/system/utest/fs/test-dot-dot.c b/system/utest/fs/test-dot-dot.c
index cae0134..e7df9ac 100644
--- a/system/utest/fs/test-dot-dot.c
+++ b/system/utest/fs/test-dot-dot.c
@@ -11,7 +11,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include "filesystems.h"
 #include "misc.h"
diff --git a/system/utest/fs/test-fcntl.cpp b/system/utest/fs/test-fcntl.cpp
index b9ea27c..84a9451 100644
--- a/system/utest/fs/test-fcntl.cpp
+++ b/system/utest/fs/test-fcntl.cpp
@@ -10,7 +10,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 #include "filesystems.h"
diff --git a/system/utest/fs/test-link.c b/system/utest/fs/test-link.c
index 1018732..e24c83d 100644
--- a/system/utest/fs/test-link.c
+++ b/system/utest/fs/test-link.c
@@ -15,7 +15,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include "filesystems.h"
 #include "misc.h"
diff --git a/system/utest/fs/test-mmap.cpp b/system/utest/fs/test-mmap.cpp
index 6431c9e..ee43dc5 100644
--- a/system/utest/fs/test-mmap.cpp
+++ b/system/utest/fs/test-mmap.cpp
@@ -12,8 +12,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 #include "filesystems.h"
diff --git a/system/utest/fs/test-persist.cpp b/system/utest/fs/test-persist.cpp
index e018d01..792c505 100644
--- a/system/utest/fs/test-persist.cpp
+++ b/system/utest/fs/test-persist.cpp
@@ -12,8 +12,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/array.h>
@@ -110,7 +110,7 @@
         "::and-another-file-filled-with-data",
     };
     fbl::unique_ptr<uint8_t[]> buffers[fbl::count_of(files)];
-    unsigned int seed = static_cast<unsigned int>(mx_ticks_get());
+    unsigned int seed = static_cast<unsigned int>(zx_ticks_get());
     unittest_printf("Persistent data test using seed: %u\n", seed);
     fbl::AllocChecker ac;
     for (size_t i = 0; i < fbl::count_of(files); i++) {
diff --git a/system/utest/fs/test-random-op.c b/system/utest/fs/test-random-op.c
index 5d9f6f8..895ca51 100644
--- a/system/utest/fs/test-random-op.c
+++ b/system/utest/fs/test-random-op.c
@@ -19,9 +19,9 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#include <magenta/compiler.h>
-#include <magenta/listnode.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/listnode.h>
+#include <zircon/types.h>
 
 #include "filesystems.h"
 
diff --git a/system/utest/fs/test-realpath.cpp b/system/utest/fs/test-realpath.cpp
index 95d68d2..c4782bf 100644
--- a/system/utest/fs/test-realpath.cpp
+++ b/system/utest/fs/test-realpath.cpp
@@ -10,7 +10,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 #include "filesystems.h"
diff --git a/system/utest/fs/test-rename.c b/system/utest/fs/test-rename.c
index 048360a..f2326b0 100644
--- a/system/utest/fs/test-rename.c
+++ b/system/utest/fs/test-rename.c
@@ -12,7 +12,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #include "filesystems.h"
 #include "misc.h"
diff --git a/system/utest/fs/test-resize.cpp b/system/utest/fs/test-resize.cpp
index 41a42c6..fb58596 100644
--- a/system/utest/fs/test-resize.cpp
+++ b/system/utest/fs/test-resize.cpp
@@ -11,8 +11,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 #include <fbl/new.h>
 #include <fbl/unique_ptr.h>
 #include <unittest/unittest.h>
diff --git a/system/utest/fs/test-rw-workers.c b/system/utest/fs/test-rw-workers.c
index e15d4ac..0700b87 100644
--- a/system/utest/fs/test-rw-workers.c
+++ b/system/utest/fs/test-rw-workers.c
@@ -13,9 +13,9 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/listnode.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/listnode.h>
+#include <zircon/types.h>
 
 #include "filesystems.h"
 #include "misc.h"
@@ -278,7 +278,7 @@
             w->status == DONE ? "finished" : "failed");
     EXPECT_EQ(unlink(w->name), 0, "");
 
-    mx_status_t status = w->status;
+    zx_status_t status = w->status;
     free(w);
     return status;
 }
diff --git a/system/utest/fs/test-sparse.cpp b/system/utest/fs/test-sparse.cpp
index e662088..b20dcc9 100644
--- a/system/utest/fs/test-sparse.cpp
+++ b/system/utest/fs/test-sparse.cpp
@@ -9,7 +9,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/unique_ptr.h>
 #include <unittest/unittest.h>
@@ -27,7 +27,7 @@
     fbl::AllocChecker ac;
     fbl::unique_ptr<uint8_t[]> wbuf(new (&ac) uint8_t[WriteSize]);
     ASSERT_EQ(ac.check(), true);
-    unsigned int seed = static_cast<unsigned int>(mx_ticks_get());
+    unsigned int seed = static_cast<unsigned int>(zx_ticks_get());
     unittest_printf("Sparse test using seed: %u\n", seed);
     for (size_t i = 0; i < WriteSize; i++) {
         wbuf[i] = (uint8_t) rand_r(&seed);
diff --git a/system/utest/fs/test-threading.cpp b/system/utest/fs/test-threading.cpp
index db4245a..8a3f8d5 100644
--- a/system/utest/fs/test-threading.cpp
+++ b/system/utest/fs/test-threading.cpp
@@ -12,7 +12,7 @@
 #include <threads.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <fbl/atomic.h>
 #include <unittest/unittest.h>
 
diff --git a/system/utest/fs/test-truncate.cpp b/system/utest/fs/test-truncate.cpp
index ee099f3..076d6e5 100644
--- a/system/utest/fs/test-truncate.cpp
+++ b/system/utest/fs/test-truncate.cpp
@@ -11,7 +11,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/unique_ptr.h>
 
@@ -159,7 +159,7 @@
     fbl::unique_ptr<uint8_t[]> buf(new (&ac) uint8_t[BufSize]);
     ASSERT_TRUE(ac.check());
 
-    unsigned seed = static_cast<unsigned>(mx_ticks_get());
+    unsigned seed = static_cast<unsigned>(zx_ticks_get());
     unittest_printf("Truncate test using seed: %u\n", seed);
     srand(seed);
     for (unsigned n = 0; n < BufSize; n++) {
diff --git a/system/utest/fs/test-unlink.cpp b/system/utest/fs/test-unlink.cpp
index e403186..cce5c6b 100644
--- a/system/utest/fs/test-unlink.cpp
+++ b/system/utest/fs/test-unlink.cpp
@@ -13,7 +13,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <fbl/algorithm.h>
 
 #include "filesystems.h"
diff --git a/system/utest/fs/test-utils.cpp b/system/utest/fs/test-utils.cpp
index ec36db4..ad4dcb2 100644
--- a/system/utest/fs/test-utils.cpp
+++ b/system/utest/fs/test-utils.cpp
@@ -4,7 +4,7 @@
 
 #include <fs/mapped-vmo.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include <unittest/unittest.h>
 
@@ -19,7 +19,7 @@
     fbl::unique_ptr<uint8_t[]> buf(new (&ac) uint8_t[max_size]);
     ASSERT_TRUE(ac.check());
 
-    unsigned seed = static_cast<unsigned>(mx_ticks_get());
+    unsigned seed = static_cast<unsigned>(zx_ticks_get());
     srand(seed);
     for (unsigned n = 0; n < max_size; n++) {
         buf[n] = static_cast<uint8_t>(rand_r(&seed));
@@ -27,7 +27,7 @@
 
     // Create MappedVmo
     fbl::unique_ptr<MappedVmo> mvmo;
-    ASSERT_EQ(MappedVmo::Create(init_size, "test-vmo", &mvmo), MX_OK);
+    ASSERT_EQ(MappedVmo::Create(init_size, "test-vmo", &mvmo), ZX_OK);
 
     // Verify size & data
     ASSERT_EQ(mvmo->GetSize(), init_size);
@@ -35,16 +35,16 @@
     ASSERT_EQ(memcmp(buf.get(), mvmo->GetData(), init_size), 0);
 
     // Grow vmo with size not divisable by page size, check size
-    ASSERT_EQ(mvmo->Grow(init_size + 1), MX_OK);
+    ASSERT_EQ(mvmo->Grow(init_size + 1), ZX_OK);
     ASSERT_EQ(mvmo->GetSize(), init_size + PAGE_SIZE);
 
     // Shrink vmo, verify size & data
-    ASSERT_EQ(mvmo->Shrink(0, min_size), MX_OK);
+    ASSERT_EQ(mvmo->Shrink(0, min_size), ZX_OK);
     ASSERT_EQ(mvmo->GetSize(), min_size);
     ASSERT_EQ(memcmp(buf.get(), mvmo->GetData(), min_size), 0);
 
     // Grow vmo, verify size & data
-    ASSERT_EQ(mvmo->Grow(max_size), MX_OK);
+    ASSERT_EQ(mvmo->Grow(max_size), ZX_OK);
     ASSERT_EQ(mvmo->GetSize(), max_size);
     ASSERT_EQ(memcmp(buf.get(), mvmo->GetData(), min_size), 0);
     uintptr_t addr = reinterpret_cast<uintptr_t>(mvmo->GetData());
diff --git a/system/utest/fs/test-vmo.cpp b/system/utest/fs/test-vmo.cpp
index 5efaa6e..83f993b 100644
--- a/system/utest/fs/test-vmo.cpp
+++ b/system/utest/fs/test-vmo.cpp
@@ -10,9 +10,9 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/device/vfs.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/device/vfs.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 #include "filesystems.h"
@@ -29,8 +29,8 @@
     ASSERT_GT(dirfd, 0);
 
     size_t vmosize = PAGE_SIZE;
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(vmosize, 0, &vmo), MX_OK);
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(vmosize, 0, &vmo), ZX_OK);
 
     char buf[1024];
     vmo_create_config_t* config = reinterpret_cast<vmo_create_config_t*>(buf);
@@ -38,7 +38,7 @@
     strcpy(config->name, "vmofile");
 
     size_t config_size = sizeof(vmo_create_config_t) + strlen("vmofile") + 1;
-    ASSERT_EQ(ioctl_vfs_vmo_create(dirfd, config, config_size), MX_OK);
+    ASSERT_EQ(ioctl_vfs_vmo_create(dirfd, config, config_size), ZX_OK);
     int fd = open("::dir/vmofile", O_RDWR);
     ASSERT_GT(fd, 0);
     ASSERT_EQ(close(fd), 0);
@@ -61,10 +61,10 @@
     ASSERT_GT(dirfd, 0);
 
     size_t vmosize = PAGE_SIZE;
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(vmosize, 0, &vmo), MX_OK);
-    mx_handle_t backup_handle;
-    ASSERT_EQ(mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &backup_handle), MX_OK);
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(vmosize, 0, &vmo), ZX_OK);
+    zx_handle_t backup_handle;
+    ASSERT_EQ(zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &backup_handle), ZX_OK);
 
     char buf[1024];
     vmo_create_config_t* config = reinterpret_cast<vmo_create_config_t*>(buf);
@@ -73,12 +73,12 @@
 
     size_t config_size = sizeof(vmo_create_config_t) + strlen("vmofile") + 1;
     // When we have both "vmo" and the "backup_handle" open, the call will fail.
-    ASSERT_EQ(ioctl_vfs_vmo_create(dirfd, config, config_size), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(ioctl_vfs_vmo_create(dirfd, config, config_size), ZX_ERR_INVALID_ARGS);
 
     // vmo_create always consumes the incoming handle;
     // now "backup_handle" is the ONLY handle to the vmo left open.
     config->vmo = backup_handle;
-    ASSERT_EQ(ioctl_vfs_vmo_create(dirfd, config, config_size), MX_OK);
+    ASSERT_EQ(ioctl_vfs_vmo_create(dirfd, config, config_size), ZX_OK);
 
     ASSERT_EQ(unlink("::dir/vmofile"), 0);
     ASSERT_EQ(close(dirfd), 0);
diff --git a/system/utest/fs/test-watcher.cpp b/system/utest/fs/test-watcher.cpp
index bdbb30d..a65bd42 100644
--- a/system/utest/fs/test-watcher.cpp
+++ b/system/utest/fs/test-watcher.cpp
@@ -15,9 +15,9 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/device/vfs.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/vfs.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 
 #include "filesystems.h"
 #include "misc.h"
@@ -32,11 +32,11 @@
 } watch_buffer_t;
 
 // Try to read from the channel when it should be empty.
-bool check_for_empty(watch_buffer_t* wb, mx_handle_t h) {
+bool check_for_empty(watch_buffer_t* wb, zx_handle_t h) {
     char name[NAME_MAX + 1];
     ASSERT_NULL(wb->ptr);
-    ASSERT_EQ(mx_channel_read(h, 0, &name, nullptr, sizeof(name), 0, nullptr, nullptr),
-              MX_ERR_SHOULD_WAIT);
+    ASSERT_EQ(zx_channel_read(h, 0, &name, nullptr, sizeof(name), 0, nullptr, nullptr),
+              ZX_ERR_SHOULD_WAIT);
     return true;
 }
 
@@ -58,19 +58,19 @@
 }
 
 // Try to read the 'expected' name off the channel.
-bool check_for_event(watch_buffer_t* wb, mx_handle_t h, const char* expected, uint8_t event) {
+bool check_for_event(watch_buffer_t* wb, zx_handle_t h, const char* expected, uint8_t event) {
     if (wb->ptr != nullptr) {
         return check_local_event(wb, expected, event);
     }
 
-    mx_signals_t observed;
-    ASSERT_EQ(mx_object_wait_one(h, MX_CHANNEL_READABLE,
-                                 mx_deadline_after(MX_SEC(5)), &observed),
-              MX_OK);
-    ASSERT_EQ(observed & MX_CHANNEL_READABLE, MX_CHANNEL_READABLE);
+    zx_signals_t observed;
+    ASSERT_EQ(zx_object_wait_one(h, ZX_CHANNEL_READABLE,
+                                 zx_deadline_after(ZX_SEC(5)), &observed),
+              ZX_OK);
+    ASSERT_EQ(observed & ZX_CHANNEL_READABLE, ZX_CHANNEL_READABLE);
     uint32_t actual;
-    ASSERT_EQ(mx_channel_read(h, 0, wb->buf, nullptr, sizeof(wb->buf), 0,
-                              &actual, nullptr), MX_OK);
+    ASSERT_EQ(zx_channel_read(h, 0, wb->buf, nullptr, sizeof(wb->buf), 0,
+                              &actual, nullptr), ZX_OK);
     wb->size = actual;
     wb->ptr = wb->buf;
     return check_local_event(wb, expected, event);
@@ -86,12 +86,12 @@
     ASSERT_EQ(mkdir("::dir", 0666), 0);
     DIR* dir = opendir("::dir");
     ASSERT_NONNULL(dir);
-    mx_handle_t h;
+    zx_handle_t h;
     vfs_watch_dir_t request;
-    ASSERT_EQ(mx_channel_create(0, &h, &request.channel), MX_OK);
+    ASSERT_EQ(zx_channel_create(0, &h, &request.channel), ZX_OK);
     request.mask = VFS_WATCH_MASK_ADDED;
     request.options = 0;
-    ASSERT_EQ(ioctl_vfs_watch_dir(dirfd(dir), &request), MX_OK);
+    ASSERT_EQ(ioctl_vfs_watch_dir(dirfd(dir), &request), ZX_OK);
     watch_buffer_t wb;
     memset(&wb, 0, sizeof(wb));
 
@@ -118,7 +118,7 @@
 
     // There shouldn't be anything else sitting around on the channel
     ASSERT_TRUE(check_for_empty(&wb, h));
-    ASSERT_EQ(mx_handle_close(h), 0);
+    ASSERT_EQ(zx_handle_close(h), 0);
 
     ASSERT_EQ(closedir(dir), 0);
     ASSERT_EQ(rmdir("::dir"), 0);
@@ -147,12 +147,12 @@
 
     // These files should be visible to the watcher through the "EXISTING"
     // mechanism.
-    mx_handle_t h;
+    zx_handle_t h;
     vfs_watch_dir_t request;
-    ASSERT_EQ(mx_channel_create(0, &h, &request.channel), MX_OK);
+    ASSERT_EQ(zx_channel_create(0, &h, &request.channel), ZX_OK);
     request.mask = VFS_WATCH_MASK_ADDED | VFS_WATCH_MASK_EXISTING | VFS_WATCH_MASK_IDLE;
     request.options = 0;
-    ASSERT_EQ(ioctl_vfs_watch_dir(dirfd(dir), &request), MX_OK);
+    ASSERT_EQ(ioctl_vfs_watch_dir(dirfd(dir), &request), ZX_OK);
     watch_buffer_t wb;
     memset(&wb, 0, sizeof(wb));
 
@@ -173,9 +173,9 @@
 
     // If we create a secondary watcher with the "EXISTING" request, we'll
     // see all files in the directory, but the first watcher won't see anything.
-    mx_handle_t h2;
-    ASSERT_EQ(mx_channel_create(0, &h2, &request.channel), MX_OK);
-    ASSERT_EQ(ioctl_vfs_watch_dir(dirfd(dir), &request), MX_OK);
+    zx_handle_t h2;
+    ASSERT_EQ(zx_channel_create(0, &h2, &request.channel), ZX_OK);
+    ASSERT_EQ(ioctl_vfs_watch_dir(dirfd(dir), &request), ZX_OK);
     watch_buffer_t wb2;
     memset(&wb2, 0, sizeof(wb2));
     ASSERT_TRUE(check_for_event(&wb2, h2, ".", VFS_WATCH_EVT_EXISTING));
@@ -193,9 +193,9 @@
 
     // There shouldn't be anything else sitting around on either channel
     ASSERT_TRUE(check_for_empty(&wb, h));
-    ASSERT_EQ(mx_handle_close(h), 0);
+    ASSERT_EQ(zx_handle_close(h), 0);
     ASSERT_TRUE(check_for_empty(&wb2, h2));
-    ASSERT_EQ(mx_handle_close(h2), 0);
+    ASSERT_EQ(zx_handle_close(h2), 0);
 
     ASSERT_EQ(closedir(dir), 0);
     ASSERT_EQ(rmdir("::dir"), 0);
@@ -213,16 +213,16 @@
     ASSERT_EQ(mkdir("::dir", 0666), 0);
     DIR* dir = opendir("::dir");
     ASSERT_NONNULL(dir);
-    mx_handle_t h;
+    zx_handle_t h;
     vfs_watch_dir_t request;
 
-    ASSERT_EQ(mx_channel_create(0, &h, &request.channel), MX_OK);
+    ASSERT_EQ(zx_channel_create(0, &h, &request.channel), ZX_OK);
     request.mask = VFS_WATCH_MASK_ADDED | VFS_WATCH_MASK_REMOVED;
     request.options = 0;
 
     watch_buffer_t wb;
     memset(&wb, 0, sizeof(wb));
-    ASSERT_EQ(ioctl_vfs_watch_dir(dirfd(dir), &request), MX_OK);
+    ASSERT_EQ(ioctl_vfs_watch_dir(dirfd(dir), &request), ZX_OK);
 
     ASSERT_TRUE(check_for_empty(&wb, h));
 
@@ -243,7 +243,7 @@
     ASSERT_TRUE(check_for_event(&wb, h, "bar", VFS_WATCH_EVT_REMOVED));
     ASSERT_TRUE(check_for_empty(&wb, h));
 
-    mx_handle_close(h);
+    zx_handle_close(h);
     ASSERT_EQ(closedir(dir), 0);
     ASSERT_EQ(rmdir("::dir"), 0);
 
diff --git a/system/utest/fs/wrap.c b/system/utest/fs/wrap.c
index d60bab3..26334c6 100644
--- a/system/utest/fs/wrap.c
+++ b/system/utest/fs/wrap.c
@@ -17,7 +17,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
-#include <mxio/vfs.h>
+#include <fdio/vfs.h>
 
 // The __wrap_* symbols are generated by the linker, but this is done after all
 // bitcode has been translated when doing the LTO build, and as such compiler
@@ -26,9 +26,9 @@
 #define FN(n) __attribute__((used)) __wrap_##n
 #define FL(n) __real_##n
 
-int status_to_errno(mx_status_t status) {
+int status_to_errno(zx_status_t status) {
     switch (status) {
-    case MX_OK:
+    case ZX_OK:
         return 0;
     default:
         return EIO;
diff --git a/system/utest/fvm/fvm.cpp b/system/utest/fvm/fvm.cpp
index f3f829a..831d090 100644
--- a/system/utest/fvm/fvm.cpp
+++ b/system/utest/fvm/fvm.cpp
@@ -23,12 +23,12 @@
 #include <fs-management/ramdisk.h>
 #include <fvm/fvm.h>
 #include <gpt/gpt.h>
-#include <magenta/device/block.h>
-#include <magenta/device/device.h>
-#include <magenta/device/ramdisk.h>
-#include <magenta/device/vfs.h>
-#include <magenta/syscalls.h>
-#include <mx/vmo.h>
+#include <zircon/device/block.h>
+#include <zircon/device/device.h>
+#include <zircon/device/ramdisk.h>
+#include <zircon/device/vfs.h>
+#include <zircon/syscalls.h>
+#include <zx/vmo.h>
 #include <fbl/algorithm.h>
 #include <fbl/auto_lock.h>
 #include <fbl/limits.h>
@@ -59,8 +59,8 @@
         return -1;
     }
 
-    mx_status_t status = fvm_init(fd, slice_size);
-    if (status != MX_OK) {
+    zx_status_t status = fvm_init(fd, slice_size);
+    if (status != ZX_OK) {
         fprintf(stderr, "fvm: Could not initialize fvm\n");
         destroy_ramdisk(ramdisk_path_out);
         close(fd);
@@ -186,7 +186,7 @@
     bool CheckRead(VmoBuf* vbuf, size_t buf_off, size_t dev_off, size_t len);
     bool Txn(block_fifo_request_t* requests, size_t count) {
         BEGIN_HELPER;
-        ASSERT_EQ(block_fifo_txn(client_, &requests[0], count), MX_OK); END_HELPER;
+        ASSERT_EQ(block_fifo_txn(client_, &requests[0], count), ZX_OK); END_HELPER;
     }
 
     int fd() const { return fd_; }
@@ -210,12 +210,12 @@
         fbl::unique_ptr<uint8_t[]> buf(new (&ac) uint8_t[size]);
         ASSERT_TRUE(ac.check());
 
-        mx::vmo vmo;
-        ASSERT_EQ(mx::vmo::create(size, 0, &vmo), MX_OK);
+        zx::vmo vmo;
+        ASSERT_EQ(zx::vmo::create(size, 0, &vmo), ZX_OK);
 
-        mx_handle_t xfer_vmo;
-        ASSERT_EQ(mx_handle_duplicate(vmo.get(), MX_RIGHT_SAME_RIGHTS,
-                                      &xfer_vmo), MX_OK);
+        zx_handle_t xfer_vmo;
+        ASSERT_EQ(zx_handle_duplicate(vmo.get(), ZX_RIGHT_SAME_RIGHTS,
+                                      &xfer_vmo), ZX_OK);
 
         vmoid_t vmoid;
         ASSERT_GT(ioctl_block_attach_vmo(client->fd(), &xfer_vmo, &vmoid), 0);
@@ -242,13 +242,13 @@
 private:
     friend VmoClient;
 
-    VmoBuf(fbl::RefPtr<VmoClient> client, mx::vmo vmo,
+    VmoBuf(fbl::RefPtr<VmoClient> client, zx::vmo vmo,
            fbl::unique_ptr<uint8_t[]> buf, vmoid_t vmoid) :
         client_(fbl::move(client)), vmo_(fbl::move(vmo)),
         buf_(fbl::move(buf)), vmoid_(vmoid) {}
 
     fbl::RefPtr<VmoClient> client_;
-    mx::vmo vmo_;
+    zx::vmo vmo_;
     fbl::unique_ptr<uint8_t[]> buf_;
     vmoid_t vmoid_;
 };
@@ -258,10 +258,10 @@
     fbl::AllocChecker ac;
     fbl::RefPtr<VmoClient> vc = fbl::AdoptRef(new (&ac) VmoClient());
     ASSERT_TRUE(ac.check());
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ASSERT_GT(ioctl_block_get_fifos(fd, &fifo), 0, "Failed to get FIFO");
     ASSERT_GT(ioctl_block_alloc_txn(fd, &vc->txnid_), 0, "Failed to alloc txn");
-    ASSERT_EQ(block_fifo_create_client(fifo, &vc->client_), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &vc->client_), ZX_OK);
     vc->fd_ = fd;
     *out = fbl::move(vc);
     END_HELPER;
@@ -275,7 +275,7 @@
 
     // Write to the registered VMO
     size_t actual;
-    ASSERT_EQ(vbuf->vmo_.write(&vbuf->buf_[buf_off], buf_off, len, &actual), MX_OK);
+    ASSERT_EQ(vbuf->vmo_.write(&vbuf->buf_[buf_off], buf_off, len, &actual), ZX_OK);
     ASSERT_EQ(len, actual);
 
     // Write to the block device
@@ -311,7 +311,7 @@
 
     // Read from the registered VMO
     size_t actual;
-    ASSERT_EQ(vbuf->vmo_.read(out.get(), buf_off, len, &actual), MX_OK);
+    ASSERT_EQ(vbuf->vmo_.read(out.get(), buf_off, len, &actual), ZX_OK);
     ASSERT_EQ(len, actual);
 
     ASSERT_EQ(memcmp(&vbuf->buf_[buf_off], out.get(), len), 0);
@@ -423,7 +423,7 @@
     int fd = open(ramdisk_path, O_RDWR);
     ASSERT_GT(fd, 0);
     size_t slice_size = blk_size * blk_count;
-    ASSERT_EQ(fvm_init(fd, slice_size), MX_ERR_NO_SPACE);
+    ASSERT_EQ(fvm_init(fd, slice_size), ZX_ERR_NO_SPACE);
     ASSERT_EQ(EndFVMTest(ramdisk_path), 0, "unmounting FVM");
     END_TEST;
 }
@@ -1537,14 +1537,14 @@
              fvm_driver, kTestPartName1);
     ASSERT_EQ(mkfs(partition_path, DISK_FORMAT_MINFS, launch_stdio_sync,
                    &default_mkfs_options),
-              MX_OK);
+              ZX_OK);
 
     // Mount the VPart
     const char* mount_path = "/tmp/minfs_test_mountpath";
     ASSERT_EQ(mkdir(mount_path, 0666), 0);
     ASSERT_EQ(mount(vp_fd, mount_path, DISK_FORMAT_MINFS, &default_mount_options,
                     launch_stdio_async),
-              MX_OK);
+              ZX_OK);
 
     // Verify that the mount was successful
     int rootfd = open(mount_path, O_RDONLY | O_DIRECTORY);
@@ -1562,7 +1562,7 @@
 
     // Clean up
     ASSERT_EQ(close(rootfd), 0);
-    ASSERT_EQ(umount(mount_path), MX_OK);
+    ASSERT_EQ(umount(mount_path), ZX_OK);
     ASSERT_EQ(rmdir(mount_path), 0);
     ASSERT_EQ(close(fd), 0);
     ASSERT_EQ(EndFVMTest(ramdisk_path), 0, "unmounting FVM");
@@ -1805,7 +1805,7 @@
 template <size_t ThreadCount>
 int random_access_thread(void* arg) {
     auto st = static_cast<fvm_test_state_t<ThreadCount>*>(arg);
-    unsigned int seed = static_cast<unsigned int>(mx_ticks_get());
+    unsigned int seed = static_cast<unsigned int>(zx_ticks_get());
     unittest_printf("random_access_thread using seed: %u\n", seed);
 
     uint8_t color = 0;
diff --git a/system/utest/fvm/rules.mk b/system/utest/fvm/rules.mk
index 5f4ef17..443116d 100644
--- a/system/utest/fvm/rules.mk
+++ b/system/utest/fvm/rules.mk
@@ -19,8 +19,8 @@
     system/ulib/fs \
     system/ulib/gpt \
     system/ulib/digest \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl \
     system/ulib/sync \
     third_party/ulib/cryptolib \
@@ -28,8 +28,8 @@
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/fs-management \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/handle-alias/handle-alias.c b/system/utest/handle-alias/handle-alias.c
index 70c03f1..0e580fb 100644
--- a/system/utest/handle-alias/handle-alias.c
+++ b/system/utest/handle-alias/handle-alias.c
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -12,9 +12,9 @@
 // How many times to try a given window size.
 #define NUM_PASSES_PER_WINDOW 100
 
-// qsort comparison function for mx_handle_t.
+// qsort comparison function for zx_handle_t.
 static int handle_cmp(const void* left, const void* right) {
-    return *(const mx_handle_t*)left - *(const mx_handle_t*)right;
+    return *(const zx_handle_t*)left - *(const zx_handle_t*)right;
 }
 
 // Prints a message and exits the process with a non-zero status.
@@ -29,37 +29,37 @@
 // Creates/closes |window_size| handles as quickly as possible and looks
 // for aliases. Returns true if any aliases were found.
 static bool find_handle_value_aliases(const size_t window_size) {
-    mx_handle_t event;
-    mx_status_t s = mx_event_create(0, &event);
-    if (s != MX_OK) {
-        FATALF("Can't create event: %s\n", mx_status_get_string(s));
+    zx_handle_t event;
+    zx_status_t s = zx_event_create(0, &event);
+    if (s != ZX_OK) {
+        FATALF("Can't create event: %s\n", zx_status_get_string(s));
     }
-    mx_handle_t* handle_log =
-        (mx_handle_t*)malloc(window_size * sizeof(mx_handle_t));
+    zx_handle_t* handle_log =
+        (zx_handle_t*)malloc(window_size * sizeof(zx_handle_t));
 
     bool saw_aliases = false;
     int pass = 0;
     while (pass++ < NUM_PASSES_PER_WINDOW && !saw_aliases) {
         // Create and close a bunch of handles as quickly as possible.
-        memset(handle_log, 0, window_size * sizeof(mx_handle_t));
+        memset(handle_log, 0, window_size * sizeof(zx_handle_t));
         for (size_t i = 0; i < window_size; i++) {
-            s = mx_handle_duplicate(event, MX_RIGHT_SAME_RIGHTS, &handle_log[i]);
-            if (s != MX_OK) {
+            s = zx_handle_duplicate(event, ZX_RIGHT_SAME_RIGHTS, &handle_log[i]);
+            if (s != ZX_OK) {
                 FATALF("[i == %zd] Can't duplicate event: %s\n",
-                       i, mx_status_get_string(s));
+                       i, zx_status_get_string(s));
             }
             if (handle_log[i] <= 0) {
                 FATALF("[i == %zd] Got bad handle %d\n", i, handle_log[i]);
             }
-            s = mx_handle_close(handle_log[i]);
-            if (s != MX_OK) {
+            s = zx_handle_close(handle_log[i]);
+            if (s != ZX_OK) {
                 FATALF("[i == %zd] Can't close handle %d: %s\n",
-                       i, handle_log[i], mx_status_get_string(s));
+                       i, handle_log[i], zx_status_get_string(s));
             }
         }
 
         // Look for any aliases.
-        qsort(handle_log, window_size, sizeof(mx_handle_t), handle_cmp);
+        qsort(handle_log, window_size, sizeof(zx_handle_t), handle_cmp);
         for (size_t i = 1; i < window_size; i++) {
             if (handle_log[i] == handle_log[i - 1]) {
                 saw_aliases = true;
@@ -69,7 +69,7 @@
     }
 
     free(handle_log);
-    mx_handle_close(event);
+    zx_handle_close(event);
     return saw_aliases;
 }
 
diff --git a/system/utest/handle-alias/rules.mk b/system/utest/handle-alias/rules.mk
index 2372778..93bf6c1 100644
--- a/system/utest/handle-alias/rules.mk
+++ b/system/utest/handle-alias/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := handle-alias-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/hypervisor/block.cpp b/system/utest/hypervisor/block.cpp
index 2a9c17c..43fe348 100644
--- a/system/utest/hypervisor/block.cpp
+++ b/system/utest/hypervisor/block.cpp
@@ -79,7 +79,7 @@
     virtio_mem_t mem;
     block_t block = {};
     setup_block(&block, path, &mem);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     END_TEST;
 }
@@ -95,7 +95,7 @@
     setup_block(&block, path, &mem);
     block.queue.avail->idx = 1;
     block.queue.avail->ring[0] = QUEUE_SIZE;
-    ASSERT_EQ(file_block_device(&block), MX_ERR_OUT_OF_RANGE);
+    ASSERT_EQ(file_block_device(&block), ZX_ERR_OUT_OF_RANGE);
 
     END_TEST;
 }
@@ -113,27 +113,27 @@
 
     block.queue.index = 0;
     set_desc(&mem, 0, sizeof(virtio_mem_t), 1, 0);
-    ASSERT_EQ(file_block_device(&block), MX_ERR_OUT_OF_RANGE);
+    ASSERT_EQ(file_block_device(&block), ZX_ERR_OUT_OF_RANGE);
     ASSERT_EQ(block.queue.used->idx, 0u);
 
     block.queue.index = 0;
     set_desc(&mem, 0, UINT64_MAX, 0, 0);
-    ASSERT_EQ(file_block_device(&block), MX_ERR_OUT_OF_RANGE);
+    ASSERT_EQ(file_block_device(&block), ZX_ERR_OUT_OF_RANGE);
     ASSERT_EQ(block.queue.used->idx, 0u);
 
     block.queue.index = 0;
     set_desc(&mem, 0, 0, UINT32_MAX, 0);
-    ASSERT_EQ(file_block_device(&block), MX_ERR_OUT_OF_RANGE);
+    ASSERT_EQ(file_block_device(&block), ZX_ERR_OUT_OF_RANGE);
     ASSERT_EQ(block.queue.used->idx, 0u);
 
     block.queue.index = 0;
     set_desc(&mem, 0, UINT64_MAX, UINT32_MAX, 0);
-    ASSERT_EQ(file_block_device(&block), MX_ERR_OUT_OF_RANGE);
+    ASSERT_EQ(file_block_device(&block), ZX_ERR_OUT_OF_RANGE);
     ASSERT_EQ(block.queue.used->idx, 0u);
 
     block.queue.index = 0;
     set_desc(&mem, 0, 0, 1, 0);
-    ASSERT_EQ(file_block_device(&block), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(file_block_device(&block), ZX_ERR_INVALID_ARGS);
     ASSERT_EQ(block.queue.used->idx, 0u);
 
     END_TEST;
@@ -152,7 +152,7 @@
 
     set_desc(&mem, 0, offsetof(virtio_mem_t, req), sizeof(virtio_blk_req_t), 1);
     set_desc(&mem, 1, sizeof(virtio_mem_t), 1, 2);
-    ASSERT_EQ(file_block_device(&block), MX_ERR_OUT_OF_RANGE);
+    ASSERT_EQ(file_block_device(&block), ZX_ERR_OUT_OF_RANGE);
     ASSERT_EQ(block.queue.used->idx, 0u);
 
     END_TEST;
@@ -172,7 +172,7 @@
     set_desc(&mem, 0, offsetof(virtio_mem_t, req), sizeof(virtio_blk_req_t), 1);
     set_desc(&mem, 1, offsetof(virtio_mem_t, data), DATA_SIZE, 2);
     set_desc(&mem, 2, offsetof(virtio_mem_t, status), 0, QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(file_block_device(&block), ZX_ERR_INVALID_ARGS);
     ASSERT_EQ(block.queue.used->idx, 0u);
 
     END_TEST;
@@ -193,7 +193,7 @@
     set_desc(&mem, 0, offsetof(virtio_mem_t, req), sizeof(virtio_blk_req_t), 1);
     set_desc(&mem, 1, offsetof(virtio_mem_t, data), DATA_SIZE, 2);
     set_desc(&mem, 2, offsetof(virtio_mem_t, status), sizeof(uint8_t), QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     ASSERT_EQ(block.queue.used->idx, 1u);
     ASSERT_EQ(block.queue.used->ring[0].id, 0u);
@@ -218,7 +218,7 @@
 
     set_desc(&mem, 0, offsetof(virtio_mem_t, req), sizeof(virtio_blk_req_t), 1);
     set_desc(&mem, 1, offsetof(virtio_mem_t, status), sizeof(uint8_t), QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     ASSERT_EQ(block.queue.used->idx, 1u);
     ASSERT_EQ(block.queue.used->ring[0].id, 0u);
@@ -243,7 +243,7 @@
     set_desc(&mem, 0, offsetof(virtio_mem_t, req), sizeof(virtio_blk_req_t), 1);
     set_desc(&mem, 1, offsetof(virtio_mem_t, data), DATA_SIZE, 2);
     set_desc(&mem, 2, offsetof(virtio_mem_t, status), sizeof(uint8_t), QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     uint8_t expected[DATA_SIZE];
     memset(expected, 0, DATA_SIZE);
@@ -273,7 +273,7 @@
     set_desc(&mem, 1, offsetof(virtio_mem_t, data), DATA_SIZE / 2, 2);
     set_desc(&mem, 2, offsetof(virtio_mem_t, data) + (DATA_SIZE / 2), DATA_SIZE / 2, 3);
     set_desc(&mem, 3, offsetof(virtio_mem_t, status), sizeof(uint8_t), QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     uint8_t expected[DATA_SIZE];
     memset(expected, 0, DATA_SIZE);
@@ -303,7 +303,7 @@
     set_desc(&mem, 0, offsetof(virtio_mem_t, req), sizeof(virtio_blk_req_t), 1);
     set_desc(&mem, 1, offsetof(virtio_mem_t, data), DATA_SIZE, 2);
     set_desc(&mem, 2, offsetof(virtio_mem_t, status), sizeof(uint8_t), QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     uint8_t actual[DATA_SIZE];
     ASSERT_EQ(lseek(block.fd, 0, SEEK_SET), 0);
@@ -338,7 +338,7 @@
     set_desc(&mem, 1, offsetof(virtio_mem_t, data), DATA_SIZE / 2, 2);
     set_desc(&mem, 2, offsetof(virtio_mem_t, data) + (DATA_SIZE / 2), DATA_SIZE / 2, 3);
     set_desc(&mem, 3, offsetof(virtio_mem_t, status), sizeof(uint8_t), QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     uint8_t actual[DATA_SIZE];
     ASSERT_EQ(lseek(block.fd, 0, SEEK_SET), 0);
@@ -370,7 +370,7 @@
 
     set_desc(&mem, 0, offsetof(virtio_mem_t, req), sizeof(virtio_blk_req_t), 1);
     set_desc(&mem, 1, offsetof(virtio_mem_t, status), sizeof(uint8_t), QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     ASSERT_EQ(block.queue.used->idx, 1u);
     ASSERT_EQ(block.queue.used->ring[0].id, 0u);
@@ -395,7 +395,7 @@
     set_desc(&mem, 0, offsetof(virtio_mem_t, req), sizeof(virtio_blk_req_t), 1);
     set_desc(&mem, 1, offsetof(virtio_mem_t, data), DATA_SIZE, 2);
     set_desc(&mem, 2, offsetof(virtio_mem_t, status), sizeof(uint8_t), QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     ASSERT_EQ(block.queue.used->idx, 1u);
     ASSERT_EQ(block.queue.used->ring[0].id, 0u);
@@ -405,21 +405,21 @@
     END_TEST;
 }
 
-static mx_status_t write_sector(int fd, uint8_t value, uint32_t sector, size_t len) {
+static zx_status_t write_sector(int fd, uint8_t value, uint32_t sector, size_t len) {
     if (len > SECTOR_SIZE)
-        return MX_ERR_OUT_OF_RANGE;
+        return ZX_ERR_OUT_OF_RANGE;
 
     uint8_t buffer[SECTOR_SIZE];
     memset(buffer, value, len);
 
     ssize_t ret = lseek(fd, sector * SECTOR_SIZE, SEEK_SET);
     if (ret < 0)
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
     ret = write(fd, buffer, len);
     if (ret < 0)
-        return MX_ERR_IO;
+        return ZX_ERR_IO;
 
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* Queue up 2 read requests for different sectors and verify both will be
@@ -459,9 +459,9 @@
     block.queue.avail->idx = 2;
 
     // Initalize block device. Write unique bit patterns to sector 1 and 2.
-    ASSERT_EQ(write_sector(block.fd, request1_bitpattern, 0, DATA_SIZE), MX_OK);
-    ASSERT_EQ(write_sector(block.fd, request2_bitpattern, 1, DATA_SIZE), MX_OK);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(write_sector(block.fd, request1_bitpattern, 0, DATA_SIZE), ZX_OK);
+    ASSERT_EQ(write_sector(block.fd, request2_bitpattern, 1, DATA_SIZE), ZX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     // Verify request 1.
     uint8_t expected[DATA_SIZE];
@@ -499,7 +499,7 @@
     set_desc(&mem, 0, offsetof(virtio_mem_t, req), sizeof(virtio_blk_req_t), 1);
     set_desc(&mem, 1, offsetof(virtio_mem_t, data), DATA_SIZE, 2);
     set_desc(&mem, 2, offsetof(virtio_mem_t, status), sizeof(uint8_t), QUEUE_SIZE);
-    ASSERT_EQ(file_block_device(&block), MX_OK);
+    ASSERT_EQ(file_block_device(&block), ZX_OK);
 
     // Verify the buffer was returned to the used ring.
     ASSERT_EQ(block.queue.used->idx, 1u);
diff --git a/system/utest/hypervisor/decode.cpp b/system/utest/hypervisor/decode.cpp
index c53feed..62d15a4 100644
--- a/system/utest/hypervisor/decode.cpp
+++ b/system/utest/hypervisor/decode.cpp
@@ -3,23 +3,23 @@
 // found in the LICENSE file.
 
 #include <hypervisor/decode.h>
-#include <magenta/errors.h>
-#include <magenta/syscalls/hypervisor.h>
+#include <zircon/errors.h>
+#include <zircon/syscalls/hypervisor.h>
 #include <unittest/unittest.h>
 
 static bool decode_failure(void) {
     BEGIN_TEST;
 
-    EXPECT_EQ(inst_decode(nullptr, 0, nullptr, nullptr), MX_ERR_BAD_STATE);
-    EXPECT_EQ(inst_decode(nullptr, 32, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(nullptr, 0, nullptr, nullptr), ZX_ERR_BAD_STATE);
+    EXPECT_EQ(inst_decode(nullptr, 32, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
 
     uint8_t bad_rex[] = {0b0100u << 4, 0, 0};
-    EXPECT_EQ(inst_decode(bad_rex, 1, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
-    EXPECT_EQ(inst_decode(bad_rex, 2, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
-    EXPECT_EQ(inst_decode(bad_rex, 3, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(bad_rex, 1, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(bad_rex, 2, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_rex, 3, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
 
     uint8_t bad_len[] = {0, 0};
-    EXPECT_EQ(inst_decode(bad_len, 2, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(bad_len, 2, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
 
     END_TEST;
 }
@@ -28,19 +28,19 @@
     BEGIN_TEST;
 
     uint8_t bad_len[] = {0x89, 0, 0};
-    EXPECT_EQ(inst_decode(bad_len, 3, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_len, 3, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t bad_disp[] = {0x89, 0b01000000};
-    EXPECT_EQ(inst_decode(bad_disp, 2, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_disp, 2, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t has_sib[] = {0x89, 0b01000100, 0, 0};
-    EXPECT_EQ(inst_decode(has_sib, 4, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(has_sib, 4, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
     uint8_t bad_h66[] = {0x66, 0b01001000, 0x89, 0b00010000};
-    EXPECT_EQ(inst_decode(bad_h66, 4, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(bad_h66, 4, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
 
     // mov %ecx, (%rax)
     uint8_t mov[] = {0x89, 0b00001000};
-    mx_vcpu_state_t vcpu_state;
+    zx_vcpu_state_t vcpu_state;
     instruction_t inst;
-    EXPECT_EQ(inst_decode(mov, 2, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(mov, 2, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0u);
@@ -49,7 +49,7 @@
 
     // mov %r10d, (%rax)
     uint8_t rex_mov[] = {0b01000100, 0x89, 0b00010000};
-    EXPECT_EQ(inst_decode(rex_mov, 3, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(rex_mov, 3, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0u);
@@ -58,7 +58,7 @@
 
     // mov %ebx, 0x10(%rax)
     uint8_t mov_disp_1[] = {0x89, 0b01011000, 0x10};
-    EXPECT_EQ(inst_decode(mov_disp_1, 3, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(mov_disp_1, 3, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0u);
@@ -67,7 +67,7 @@
 
     // mov %ebx, 0x1000000(%rax)
     uint8_t mov_disp_4[] = {0x89, 0b10011000, 0, 0, 0, 0x1};
-    EXPECT_EQ(inst_decode(mov_disp_4, 6, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(mov_disp_4, 6, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0u);
@@ -76,7 +76,7 @@
 
     // mov %r12, 0x11(%rax)
     uint8_t rex_mov_disp[] = {0b01001100, 0x89, 0b01100000, 0x11};
-    EXPECT_EQ(inst_decode(rex_mov_disp, 4, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(rex_mov_disp, 4, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 8u);
     EXPECT_EQ(inst.imm, 0u);
@@ -85,7 +85,7 @@
 
     // mov %r14w, 0x13(%rax)
     uint8_t h66_mov_disp[] = {0x66, 0b01000100, 0x89, 0b01110000, 0x13};
-    EXPECT_EQ(inst_decode(h66_mov_disp, 5, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(h66_mov_disp, 5, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 2u);
     EXPECT_EQ(inst.imm, 0u);
@@ -99,19 +99,19 @@
     BEGIN_TEST;
 
     uint8_t bad_len[] = {0x8b, 0, 0};
-    EXPECT_EQ(inst_decode(bad_len, 3, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_len, 3, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t bad_disp[] = {0x8b, 0b01000000};
-    EXPECT_EQ(inst_decode(bad_disp, 2, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_disp, 2, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t has_sib[] = {0x8b, 0b01000100, 0, 0};
-    EXPECT_EQ(inst_decode(has_sib, 4, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(has_sib, 4, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
     uint8_t bad_h66[] = {0x66, 0b01001000, 0x8b, 0b00010000};
-    EXPECT_EQ(inst_decode(bad_h66, 4, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(bad_h66, 4, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
 
     // mov (%rax), %ecx
     uint8_t mov[] = {0x8b, 0b00001000};
-    mx_vcpu_state_t vcpu_state;
+    zx_vcpu_state_t vcpu_state;
     instruction_t inst;
-    EXPECT_EQ(inst_decode(mov, 2, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(mov, 2, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0u);
@@ -120,7 +120,7 @@
 
     // mov (%rax), %r10d
     uint8_t rex_mov[] = {0b01000100, 0x8b, 0b00010000};
-    EXPECT_EQ(inst_decode(rex_mov, 3, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(rex_mov, 3, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0u);
@@ -129,7 +129,7 @@
 
     // mov 0x10(%rax), %ebx
     uint8_t mov_disp_1[] = {0x8b, 0b01011000, 0x10};
-    EXPECT_EQ(inst_decode(mov_disp_1, 3, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(mov_disp_1, 3, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0u);
@@ -138,7 +138,7 @@
 
     // mov 0x10000000(%rax), %ebx
     uint8_t mov_disp_4[] = {0x8b, 0b10011000, 0, 0, 0, 0x1};
-    EXPECT_EQ(inst_decode(mov_disp_4, 6, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(mov_disp_4, 6, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0u);
@@ -147,7 +147,7 @@
 
     // mov 0x11(rax), %r12
     uint8_t rex_mov_disp[] = {0b01001100, 0x8b, 0b01100000, 0x11};
-    EXPECT_EQ(inst_decode(rex_mov_disp, 4, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(rex_mov_disp, 4, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 8u);
     EXPECT_EQ(inst.imm, 0u);
@@ -156,7 +156,7 @@
 
     // mov 0x13(rax), %r14w
     uint8_t h66_mov_disp[] = {0x66, 0b01000100, 0x8b, 0b01110000, 0x13};
-    EXPECT_EQ(inst_decode(h66_mov_disp, 5, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(h66_mov_disp, 5, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 2u);
     EXPECT_EQ(inst.imm, 0u);
@@ -170,21 +170,21 @@
     BEGIN_TEST;
 
     uint8_t bad_len[] = {0xc7, 0};
-    EXPECT_EQ(inst_decode(bad_len, 2, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_len, 2, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t bad_disp[] = {0xc7, 0b01000000};
-    EXPECT_EQ(inst_decode(bad_disp, 2, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_disp, 2, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t has_sib[] = {0xc7, 0b01000100, 0, 0, 0, 0, 0, 0};
-    EXPECT_EQ(inst_decode(has_sib, 8, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(has_sib, 8, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
     uint8_t bad_mod_rm[] = {0xc7, 0b00111000, 0x1, 0, 0, 0};
-    EXPECT_EQ(inst_decode(bad_mod_rm, 6, nullptr, nullptr), MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(inst_decode(bad_mod_rm, 6, nullptr, nullptr), ZX_ERR_INVALID_ARGS);
     uint8_t bad_h66[] = {0x66, 0b01001000, 0xc7, 0, 0, 0, 0, 0x1};
-    EXPECT_EQ(inst_decode(bad_h66, 8, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(bad_h66, 8, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
 
     // movl 0x1, (%rax)
     uint8_t mov[] = {0xc7, 0, 0x1, 0, 0, 0};
-    mx_vcpu_state_t vcpu_state;
+    zx_vcpu_state_t vcpu_state;
     instruction_t inst;
-    EXPECT_EQ(inst_decode(mov, 6, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(mov, 6, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0x1u);
@@ -193,7 +193,7 @@
 
     // movq 0x1000000, (%rax)
     uint8_t rex_mov[] = {0b01001000, 0xc7, 0, 0, 0, 0, 0x1};
-    EXPECT_EQ(inst_decode(rex_mov, 7, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(rex_mov, 7, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 8u);
     EXPECT_EQ(inst.imm, 0x1000000u);
@@ -202,7 +202,7 @@
 
     // movl 0x10, -0x1(%rbx)
     uint8_t mov_disp_1[] = {0xc7, 0b01000011, 0xff, 0x10, 0, 0, 0};
-    EXPECT_EQ(inst_decode(mov_disp_1, 7, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(mov_disp_1, 7, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0x10u);
@@ -211,7 +211,7 @@
 
     // movl 0x1000000, -0x1000000(%rbx)
     uint8_t mov_disp_4[] = {0xc7, 0b10000011, 0, 0, 0, 0xff, 0, 0, 0, 0x1};
-    EXPECT_EQ(inst_decode(mov_disp_4, 10, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(mov_disp_4, 10, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 4u);
     EXPECT_EQ(inst.imm, 0x1000000u);
@@ -220,7 +220,7 @@
 
     // movw 0x100, -0x1(%rax)
     uint8_t h66_mov_disp[] = {0x66, 0b01000100, 0xc7, 0b01000000, 0xff, 0, 0x1};
-    EXPECT_EQ(inst_decode(h66_mov_disp, 7, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(h66_mov_disp, 7, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_WRITE);
     EXPECT_EQ(inst.mem, 2u);
     EXPECT_EQ(inst.imm, 0x100u);
@@ -234,19 +234,19 @@
     BEGIN_TEST;
 
     uint8_t bad_len[] = {0x0f, 0xb6, 0, 0};
-    EXPECT_EQ(inst_decode(bad_len, 4, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_len, 4, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t bad_disp[] = {0x0f, 0xb6, 0b01000000};
-    EXPECT_EQ(inst_decode(bad_disp, 3, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_disp, 3, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t has_sib[] = {0x0f, 0xb6, 0b01000100, 0, 0};
-    EXPECT_EQ(inst_decode(has_sib, 5, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(has_sib, 5, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
     uint8_t has_h66[] = {0x66, 0x0f, 0xb6, 0b00001000};
-    EXPECT_EQ(inst_decode(has_h66, 4, nullptr, nullptr), MX_ERR_BAD_STATE);
+    EXPECT_EQ(inst_decode(has_h66, 4, nullptr, nullptr), ZX_ERR_BAD_STATE);
 
     // movzb (%rax), %ecx
     uint8_t movz[] = {0x0f, 0xb6, 0b00001000};
-    mx_vcpu_state_t vcpu_state;
+    zx_vcpu_state_t vcpu_state;
     instruction_t inst;
-    EXPECT_EQ(inst_decode(movz, 3, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(movz, 3, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 1u);
     EXPECT_EQ(inst.imm, 0u);
@@ -255,7 +255,7 @@
 
     // movzb (%rax), %r10d
     uint8_t rex_movz[] = {0b01000100, 0x0f, 0xb6, 0b00010000};
-    EXPECT_EQ(inst_decode(rex_movz, 4, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(rex_movz, 4, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 1u);
     EXPECT_EQ(inst.imm, 0u);
@@ -264,7 +264,7 @@
 
     // movzb 0x10(%rax), %ebx
     uint8_t movz_disp_1[] = {0x0f, 0xb6, 0b01011000, 0x10};
-    EXPECT_EQ(inst_decode(movz_disp_1, 4, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(movz_disp_1, 4, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 1u);
     EXPECT_EQ(inst.imm, 0u);
@@ -273,7 +273,7 @@
 
     // movzb 0x10000000(%rax), %ebx
     uint8_t movz_disp_4[] = {0x0f, 0xb6, 0b10011000, 0, 0, 0, 0x1};
-    EXPECT_EQ(inst_decode(movz_disp_4, 7, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(movz_disp_4, 7, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 1u);
     EXPECT_EQ(inst.imm, 0u);
@@ -282,7 +282,7 @@
 
     // movzb 0x11(rax), %r12
     uint8_t rex_movz_disp[] = {0b01001100, 0x0f, 0xb6, 0b01100000, 0x11};
-    EXPECT_EQ(inst_decode(rex_movz_disp, 5, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(rex_movz_disp, 5, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 1u);
     EXPECT_EQ(inst.imm, 0u);
@@ -296,19 +296,19 @@
     BEGIN_TEST;
 
     uint8_t bad_len[] = {0x0f, 0xb7, 0, 0};
-    EXPECT_EQ(inst_decode(bad_len, 4, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_len, 4, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t bad_disp[] = {0x0f, 0xb7, 0b01000000};
-    EXPECT_EQ(inst_decode(bad_disp, 3, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_disp, 3, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t has_sib[] = {0x0f, 0xb7, 0b01000100, 0, 0};
-    EXPECT_EQ(inst_decode(has_sib, 5, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(has_sib, 5, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
     uint8_t has_h66[] = {0x66, 0x0f, 0xb7, 0b00001000};
-    EXPECT_EQ(inst_decode(has_h66, 4, nullptr, nullptr), MX_ERR_BAD_STATE);
+    EXPECT_EQ(inst_decode(has_h66, 4, nullptr, nullptr), ZX_ERR_BAD_STATE);
 
     // movzw (%rax), %ecx
     uint8_t movz[] = {0x0f, 0xb7, 0b00001000};
-    mx_vcpu_state_t vcpu_state;
+    zx_vcpu_state_t vcpu_state;
     instruction_t inst;
-    EXPECT_EQ(inst_decode(movz, 3, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(movz, 3, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 2u);
     EXPECT_EQ(inst.imm, 0u);
@@ -317,7 +317,7 @@
 
     // movzw (%rax), %r10d
     uint8_t rex_movz[] = {0b01000100, 0x0f, 0xb7, 0b00010000};
-    EXPECT_EQ(inst_decode(rex_movz, 4, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(rex_movz, 4, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 2u);
     EXPECT_EQ(inst.imm, 0u);
@@ -326,7 +326,7 @@
 
     // movzw 0x10(%rax), %ebx
     uint8_t movz_disp_1[] = {0x0f, 0xb7, 0b01011000, 0x10};
-    EXPECT_EQ(inst_decode(movz_disp_1, 4, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(movz_disp_1, 4, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 2u);
     EXPECT_EQ(inst.imm, 0u);
@@ -335,7 +335,7 @@
 
     // movzw 0x10000000(%rax), %ebx
     uint8_t movz_disp_4[] = {0x0f, 0xb7, 0b10011000, 0, 0, 0, 0x1};
-    EXPECT_EQ(inst_decode(movz_disp_4, 7, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(movz_disp_4, 7, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 2u);
     EXPECT_EQ(inst.imm, 0u);
@@ -344,7 +344,7 @@
 
     // movzw 0x11(rax), %r12
     uint8_t rex_movz_disp[] = {0b01001100, 0x0f, 0xb7, 0b01100000, 0x11};
-    EXPECT_EQ(inst_decode(rex_movz_disp, 5, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(rex_movz_disp, 5, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_MOV_READ);
     EXPECT_EQ(inst.mem, 2u);
     EXPECT_EQ(inst.imm, 0u);
@@ -358,21 +358,21 @@
     BEGIN_TEST;
 
     uint8_t bad_len[] = {0xf6, 0};
-    EXPECT_EQ(inst_decode(bad_len, 2, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_len, 2, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t bad_disp[] = {0xf6, 0b01000000, 0};
-    EXPECT_EQ(inst_decode(bad_disp, 3, nullptr, nullptr), MX_ERR_OUT_OF_RANGE);
+    EXPECT_EQ(inst_decode(bad_disp, 3, nullptr, nullptr), ZX_ERR_OUT_OF_RANGE);
     uint8_t has_sib[] = {0xf6, 0b01000100, 0, 0};
-    EXPECT_EQ(inst_decode(has_sib, 4, nullptr, nullptr), MX_ERR_NOT_SUPPORTED);
+    EXPECT_EQ(inst_decode(has_sib, 4, nullptr, nullptr), ZX_ERR_NOT_SUPPORTED);
     uint8_t bad_mod_rm[] = {0xf6, 0b00111000, 0x1};
-    EXPECT_EQ(inst_decode(bad_mod_rm, 3, nullptr, nullptr), MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(inst_decode(bad_mod_rm, 3, nullptr, nullptr), ZX_ERR_INVALID_ARGS);
     uint8_t has_h66[] = {0x66, 0xf6, 0b00001000, 0};
-    EXPECT_EQ(inst_decode(has_h66, 4, nullptr, nullptr), MX_ERR_BAD_STATE);
+    EXPECT_EQ(inst_decode(has_h66, 4, nullptr, nullptr), ZX_ERR_BAD_STATE);
 
     // test 0x1, (%rax)
     uint8_t test[] = {0xf6, 0, 0x1};
-    mx_vcpu_state_t vcpu_state;
+    zx_vcpu_state_t vcpu_state;
     instruction_t inst;
-    EXPECT_EQ(inst_decode(test, 3, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(test, 3, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_TEST);
     EXPECT_EQ(inst.mem, 1u);
     EXPECT_EQ(inst.imm, 0x1u);
@@ -381,7 +381,7 @@
 
     // test 0x10, -0x1(%rbx)
     uint8_t test_disp_1[] = {0xf6, 0b01000011, 0xff, 0x10};
-    EXPECT_EQ(inst_decode(test_disp_1, 4, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(test_disp_1, 4, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_TEST);
     EXPECT_EQ(inst.mem, 1u);
     EXPECT_EQ(inst.imm, 0x10u);
@@ -390,7 +390,7 @@
 
     // test 0x11, -0x1000000(%rbx)
     uint8_t test_disp_4[] = {0xf6, 0b10000011, 0, 0, 0, 0xff, 0x11};
-    EXPECT_EQ(inst_decode(test_disp_4, 7, &vcpu_state, &inst), MX_OK);
+    EXPECT_EQ(inst_decode(test_disp_4, 7, &vcpu_state, &inst), ZX_OK);
     EXPECT_EQ(inst.type, INST_TEST);
     EXPECT_EQ(inst.mem, 1u);
     EXPECT_EQ(inst.imm, 0x11u);
diff --git a/system/utest/hypervisor/guest.cpp b/system/utest/hypervisor/guest.cpp
index 2dfd528..e06f039 100644
--- a/system/utest/hypervisor/guest.cpp
+++ b/system/utest/hypervisor/guest.cpp
@@ -7,16 +7,16 @@
 
 #include <hypervisor/decode.h>
 #include <hypervisor/guest.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/hypervisor.h>
-#include <magenta/syscalls/port.h>
-#include <magenta/types.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/hypervisor.h>
+#include <zircon/syscalls/port.h>
+#include <zircon/types.h>
 #include <unittest/unittest.h>
 
 #include "constants_priv.h"
 
-static const uint32_t kMapFlags = MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE;
+static const uint32_t kMapFlags = ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE;
 
 extern const char vcpu_resume_start[];
 extern const char vcpu_resume_end[];
@@ -30,28 +30,28 @@
 typedef struct test {
     bool supported;
 
-    mx_handle_t guest;
-    mx_handle_t guest_physmem;
+    zx_handle_t guest;
+    zx_handle_t guest_physmem;
     uintptr_t guest_physaddr;
 
-    mx_handle_t vcpu;
+    zx_handle_t vcpu;
 #if __x86_64__
-    mx_handle_t vcpu_apicmem;
+    zx_handle_t vcpu_apicmem;
 #endif // __x86_64__
 } test_t;
 
 static bool teardown(test_t* test) {
-    if (test->vcpu != MX_HANDLE_INVALID)
-        ASSERT_EQ(mx_handle_close(test->vcpu), MX_OK);
+    if (test->vcpu != ZX_HANDLE_INVALID)
+        ASSERT_EQ(zx_handle_close(test->vcpu), ZX_OK);
 #if __x86_64__
-    if (test->vcpu_apicmem != MX_HANDLE_INVALID)
-        ASSERT_EQ(mx_handle_close(test->vcpu_apicmem), MX_OK);
+    if (test->vcpu_apicmem != ZX_HANDLE_INVALID)
+        ASSERT_EQ(zx_handle_close(test->vcpu_apicmem), ZX_OK);
 #endif // __x86_64__
 
-    if (test->guest != MX_HANDLE_INVALID)
-        ASSERT_EQ(mx_handle_close(test->guest), MX_OK);
-    ASSERT_EQ(mx_vmar_unmap(mx_vmar_root_self(), test->guest_physaddr, VMO_SIZE), MX_OK);
-    ASSERT_EQ(mx_handle_close(test->guest_physmem), MX_OK);
+    if (test->guest != ZX_HANDLE_INVALID)
+        ASSERT_EQ(zx_handle_close(test->guest), ZX_OK);
+    ASSERT_EQ(zx_vmar_unmap(zx_vmar_root_self(), test->guest_physaddr, VMO_SIZE), ZX_OK);
+    ASSERT_EQ(zx_handle_close(test->guest_physmem), ZX_OK);
 
     return true;
 }
@@ -59,47 +59,47 @@
 static bool setup(test_t* test, const char* start, const char* end) {
     memset(test, 0, sizeof(*test));
 
-    ASSERT_EQ(mx_vmo_create(VMO_SIZE, 0, &test->guest_physmem), MX_OK);
+    ASSERT_EQ(zx_vmo_create(VMO_SIZE, 0, &test->guest_physmem), ZX_OK);
 
-    ASSERT_EQ(mx_vmar_map(mx_vmar_root_self(), 0, test->guest_physmem, 0, VMO_SIZE, kMapFlags,
+    ASSERT_EQ(zx_vmar_map(zx_vmar_root_self(), 0, test->guest_physmem, 0, VMO_SIZE, kMapFlags,
                           &test->guest_physaddr),
-              MX_OK);
+              ZX_OK);
 
-    mx_handle_t resource;
-    ASSERT_EQ(guest_get_resource(&resource), MX_OK);
+    zx_handle_t resource;
+    ASSERT_EQ(guest_get_resource(&resource), ZX_OK);
 
-    mx_status_t status = mx_guest_create(resource, 0, test->guest_physmem, &test->guest);
-    test->supported = status != MX_ERR_NOT_SUPPORTED;
+    zx_status_t status = zx_guest_create(resource, 0, test->guest_physmem, &test->guest);
+    test->supported = status != ZX_ERR_NOT_SUPPORTED;
     if (!test->supported) {
         fprintf(stderr, "Guest creation not supported\n");
         return teardown(test);
     }
-    ASSERT_EQ(status, MX_OK);
-    mx_handle_close(resource);
+    ASSERT_EQ(status, ZX_OK);
+    zx_handle_close(resource);
 
     // Setup the guest.
     uintptr_t guest_ip;
-    ASSERT_EQ(guest_create_page_table(test->guest_physaddr, VMO_SIZE, &guest_ip), MX_OK);
+    ASSERT_EQ(guest_create_page_table(test->guest_physaddr, VMO_SIZE, &guest_ip), ZX_OK);
 
 #if __x86_64__
     memcpy((void*)(test->guest_physaddr + guest_ip), start, end - start);
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &test->vcpu_apicmem), MX_OK);
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &test->vcpu_apicmem), ZX_OK);
 #endif // __x86_64__
 
-    mx_vcpu_create_args_t args = {
+    zx_vcpu_create_args_t args = {
         guest_ip,
 #if __x86_64__
         0 /* cr3 */,
         test->vcpu_apicmem,
 #endif // __x86_64__
     };
-    status = mx_vcpu_create(test->guest, 0, &args, &test->vcpu);
-    test->supported = status != MX_ERR_NOT_SUPPORTED;
+    status = zx_vcpu_create(test->guest, 0, &args, &test->vcpu);
+    test->supported = status != ZX_ERR_NOT_SUPPORTED;
     if (!test->supported) {
         fprintf(stderr, "VCPU creation not supported\n");
         return teardown(test);
     }
-    ASSERT_EQ(status, MX_OK);
+    ASSERT_EQ(status, ZX_OK);
 
     return true;
 }
@@ -114,20 +114,20 @@
         return true;
     }
 
-    mx_port_packet_t packet = {};
-    ASSERT_EQ(mx_vcpu_resume(test.vcpu, &packet), MX_OK);
-    EXPECT_EQ(packet.type, MX_PKT_TYPE_GUEST_IO);
+    zx_port_packet_t packet = {};
+    ASSERT_EQ(zx_vcpu_resume(test.vcpu, &packet), ZX_OK);
+    EXPECT_EQ(packet.type, ZX_PKT_TYPE_GUEST_IO);
     EXPECT_EQ(packet.guest_io.port, UART_PORT);
     EXPECT_EQ(packet.guest_io.access_size, 1u);
     EXPECT_EQ(packet.guest_io.data[0], 'm');
 
-    ASSERT_EQ(mx_vcpu_resume(test.vcpu, &packet), MX_OK);
+    ASSERT_EQ(zx_vcpu_resume(test.vcpu, &packet), ZX_OK);
     EXPECT_EQ(packet.guest_io.port, UART_PORT);
-    EXPECT_EQ(packet.type, MX_PKT_TYPE_GUEST_IO);
+    EXPECT_EQ(packet.type, ZX_PKT_TYPE_GUEST_IO);
     EXPECT_EQ(packet.guest_io.access_size, 1u);
     EXPECT_EQ(packet.guest_io.data[0], 'x');
 
-    ASSERT_EQ(mx_vcpu_resume(test.vcpu, &packet), MX_OK);
+    ASSERT_EQ(zx_vcpu_resume(test.vcpu, &packet), ZX_OK);
     EXPECT_EQ(packet.guest_io.port, EXIT_TEST_PORT);
 
     ASSERT_TRUE(teardown(&test));
@@ -145,7 +145,7 @@
         return true;
     }
 
-    mx_vcpu_state_t vcpu_state = {
+    zx_vcpu_state_t vcpu_state = {
 #if __x86_64__
         .rax = 1u,
         .rcx = 2u,
@@ -167,14 +167,14 @@
 #endif // __x86_64__
     };
 
-    ASSERT_EQ(mx_vcpu_write_state(test.vcpu, MX_VCPU_STATE, &vcpu_state, sizeof(vcpu_state)),
-              MX_OK);
+    ASSERT_EQ(zx_vcpu_write_state(test.vcpu, ZX_VCPU_STATE, &vcpu_state, sizeof(vcpu_state)),
+              ZX_OK);
 
-    mx_port_packet_t packet = {};
-    ASSERT_EQ(mx_vcpu_resume(test.vcpu, &packet), MX_OK);
+    zx_port_packet_t packet = {};
+    ASSERT_EQ(zx_vcpu_resume(test.vcpu, &packet), ZX_OK);
     EXPECT_EQ(packet.guest_io.port, EXIT_TEST_PORT);
 
-    ASSERT_EQ(mx_vcpu_read_state(test.vcpu, MX_VCPU_STATE, &vcpu_state, sizeof(vcpu_state)), MX_OK);
+    ASSERT_EQ(zx_vcpu_read_state(test.vcpu, ZX_VCPU_STATE, &vcpu_state, sizeof(vcpu_state)), ZX_OK);
 
 #if __x86_64__
     EXPECT_EQ(vcpu_state.rax, 2u);
@@ -212,18 +212,18 @@
     }
 
     // Trap on access to the last page.
-    ASSERT_EQ(mx_guest_set_trap(test.guest, MX_GUEST_TRAP_MEM, VMO_SIZE - PAGE_SIZE, PAGE_SIZE,
-                                MX_HANDLE_INVALID, 0),
-              MX_OK);
+    ASSERT_EQ(zx_guest_set_trap(test.guest, ZX_GUEST_TRAP_MEM, VMO_SIZE - PAGE_SIZE, PAGE_SIZE,
+                                ZX_HANDLE_INVALID, 0),
+              ZX_OK);
 
-    mx_port_packet_t packet = {};
-    ASSERT_EQ(mx_vcpu_resume(test.vcpu, &packet), MX_OK);
+    zx_port_packet_t packet = {};
+    ASSERT_EQ(zx_vcpu_resume(test.vcpu, &packet), ZX_OK);
 
 #if __x86_64__
-    mx_vcpu_state_t vcpu_state;
+    zx_vcpu_state_t vcpu_state;
     instruction_t inst;
     ASSERT_EQ(inst_decode(packet.guest_mem.inst_buf, packet.guest_mem.inst_len, &vcpu_state, &inst),
-              MX_OK);
+              ZX_OK);
     ASSERT_EQ(packet.guest_mem.addr, VMO_SIZE - PAGE_SIZE);
     ASSERT_EQ(inst.type, INST_MOV_READ);
     ASSERT_EQ(inst.mem, 8u);
@@ -247,20 +247,20 @@
         return true;
     }
 
-    mx_handle_t port;
-    ASSERT_EQ(mx_port_create(0, &port), MX_OK);
+    zx_handle_t port;
+    ASSERT_EQ(zx_port_create(0, &port), ZX_OK);
 
     // Trap on writes to TRAP_PORT.
-    ASSERT_EQ(mx_guest_set_trap(test.guest, MX_GUEST_TRAP_IO, TRAP_PORT, 1, port, 0), MX_OK);
+    ASSERT_EQ(zx_guest_set_trap(test.guest, ZX_GUEST_TRAP_IO, TRAP_PORT, 1, port, 0), ZX_OK);
 
-    mx_port_packet_t packet = {};
-    ASSERT_EQ(mx_vcpu_resume(test.vcpu, &packet), MX_OK);
+    zx_port_packet_t packet = {};
+    ASSERT_EQ(zx_vcpu_resume(test.vcpu, &packet), ZX_OK);
     EXPECT_EQ(packet.guest_io.port, EXIT_TEST_PORT);
 
-    ASSERT_EQ(mx_port_wait(port, MX_TIME_INFINITE, &packet, 0), MX_OK);
+    ASSERT_EQ(zx_port_wait(port, ZX_TIME_INFINITE, &packet, 0), ZX_OK);
     EXPECT_EQ(packet.guest_io.port, TRAP_PORT);
 
-    mx_handle_close(port);
+    zx_handle_close(port);
     ASSERT_TRUE(teardown(&test));
 
     END_TEST;
diff --git a/system/utest/hypervisor/page_table.cpp b/system/utest/hypervisor/page_table.cpp
index 66f45e8..364d0ad 100644
--- a/system/utest/hypervisor/page_table.cpp
+++ b/system/utest/hypervisor/page_table.cpp
@@ -60,7 +60,7 @@
     page_table actual[4] = INITIALIZE_PAGE_TABLE;
     page_table expected[4] = INITIALIZE_PAGE_TABLE;
 
-    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, 1 << 30, &pte_off), MX_OK);
+    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, 1 << 30, &pte_off), ZX_OK);
 
     // pml4
     expected[0].entries[0] = PAGE_SIZE | X86_PTE_P | X86_PTE_RW;
@@ -79,7 +79,7 @@
     page_table actual[4] = INITIALIZE_PAGE_TABLE;
     page_table expected[4] = INITIALIZE_PAGE_TABLE;
 
-    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, 2 << 20, &pte_off), MX_OK);
+    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, 2 << 20, &pte_off), ZX_OK);
 
     // pml4
     expected[0].entries[0] = PAGE_SIZE | X86_PTE_P | X86_PTE_RW;
@@ -100,7 +100,7 @@
     page_table actual[4] = INITIALIZE_PAGE_TABLE;
     page_table expected[4] = INITIALIZE_PAGE_TABLE;
 
-    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, 4 * 4 << 10, &pte_off), MX_OK);
+    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, 4 * 4 << 10, &pte_off), ZX_OK);
 
     // pml4
     expected[0].entries[0] = PAGE_SIZE | X86_PTE_P | X86_PTE_RW;
@@ -126,7 +126,7 @@
     page_table actual[4] = INITIALIZE_PAGE_TABLE;
     page_table expected[4] = INITIALIZE_PAGE_TABLE;
 
-    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, (2 << 20) + (4 << 10), &pte_off), MX_OK);
+    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, (2 << 20) + (4 << 10), &pte_off), ZX_OK);
 
     // pml4
     expected[0].entries[0] = PAGE_SIZE | X86_PTE_P | X86_PTE_RW;
@@ -168,7 +168,7 @@
     //
     // PT
     // >  264 mapped pages
-    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, 0x87B08000, &pte_off), MX_OK);
+    ASSERT_EQ(guest_create_page_table((uintptr_t)actual, 0x87B08000, &pte_off), ZX_OK);
 
     // pml4
     expected[0].entries[0] = PAGE_SIZE | X86_PTE_P | X86_PTE_RW;
diff --git a/system/utest/hypervisor/pci.cpp b/system/utest/hypervisor/pci.cpp
index 8af51b3..eae6b23 100644
--- a/system/utest/hypervisor/pci.cpp
+++ b/system/utest/hypervisor/pci.cpp
@@ -17,7 +17,7 @@
 
     // Access Vendor/Device ID as a single 32bit read.
     uint32_t value = 0;
-    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_VENDOR_ID, 4, &value), MX_OK,
+    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_VENDOR_ID, 4, &value), ZX_OK,
               "Failed to read PCI_CONFIG_VENDOR_ID");
     EXPECT_EQ(value, PCI_VENDOR_ID_INTEL | (PCI_DEVICE_ID_INTEL_Q35 << 16),
               "Unexpected value of PCI_CONFIG_VENDOR_ID");
@@ -37,7 +37,7 @@
     for (int i = 0; i < 4; ++i) {
         uint16_t reg = static_cast<uint16_t>(PCI_CONFIG_VENDOR_ID + i);
         uint32_t value = 0;
-        EXPECT_EQ(pci_device_read(device, reg, 1, &value), MX_OK,
+        EXPECT_EQ(pci_device_read(device, reg, 1, &value), ZX_OK,
                   "Failed to read PCI_CONFIG_VENDOR_ID");
         EXPECT_EQ(value, bits_shift(expected_device_vendor, i * 8 + 7, i * 8),
                   "Unexpected value of PCI_CONFIG_VENDOR_ID");
@@ -63,12 +63,12 @@
 
     // Set all bits in the BAR register. The device will ignore writes to the
     // LSBs which we can read out to determine the size.
-    EXPECT_EQ(pci_device_write(device, PCI_CONFIG_BASE_ADDRESSES, 4, UINT32_MAX), MX_OK,
+    EXPECT_EQ(pci_device_write(device, PCI_CONFIG_BASE_ADDRESSES, 4, UINT32_MAX), ZX_OK,
               "Failed to write BAR0 to PCI config space");
 
     // Read out BAR and compute size.
     uint32_t value = 0;
-    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_BASE_ADDRESSES, 4, &value), MX_OK,
+    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_BASE_ADDRESSES, 4, &value), ZX_OK,
               "Failed to read BAR0 from PCI config space");
     EXPECT_EQ(value & PCI_BAR_IO_TYPE_MASK, PCI_BAR_IO_TYPE_PIO,
               "Expected PIO bit to be set in BAR");
@@ -107,7 +107,7 @@
     // a pointer in Configuration Space to a linked list of new capabilities.
     // Refer to Section 6.7 for details on New Capabilities.
     uint32_t status = 0;
-    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_STATUS, 2, &status), MX_OK,
+    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_STATUS, 2, &status), ZX_OK,
               "Failed to read status register from PCI config space.\n");
     EXPECT_TRUE(status & PCI_STATUS_NEW_CAPS,
                 "CAP bit not set in status register with a cap list present.\n");
@@ -115,14 +115,14 @@
     // Read the cap pointer from config space. Here just verify it points to
     // some location beyond the pre-defined header.
     uint32_t cap_ptr = 0;
-    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_CAPABILITIES, 1, &cap_ptr), MX_OK,
+    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_CAPABILITIES, 1, &cap_ptr), ZX_OK,
               "Failed to read CAP pointer from PCI config space.\n");
     EXPECT_LT(0x40u, cap_ptr, "CAP pointer does not lie beyond the reserved region.\n");
 
     // Read the capability. This will be the Cap ID, next pointer (0), followed
     // by data bytes (starting at index 2).
     uint32_t cap_value = 0;
-    EXPECT_EQ(pci_device_read(device, static_cast<uint16_t>(cap_ptr), 4, &cap_value), MX_OK,
+    EXPECT_EQ(pci_device_read(device, static_cast<uint16_t>(cap_ptr), 4, &cap_value), ZX_OK,
               "Failed to read CAP value from PCI config space.\n");
     EXPECT_EQ(0x0a0f0009u, cap_value,
               "Incorrect CAP value read from PCI config space.\n");
@@ -153,11 +153,11 @@
 
     uint32_t cap_ptr = 0;
     uint32_t cap_header;
-    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_CAPABILITIES, 1, &cap_ptr), MX_OK,
+    EXPECT_EQ(pci_device_read(device, PCI_CONFIG_CAPABILITIES, 1, &cap_ptr), ZX_OK,
               "Failed to read CAP pointer from PCI config space.\n");
     for (uint8_t i = 0; i < num_caps; ++i) {
         // Read the current capability.
-        EXPECT_EQ(pci_device_read(device, static_cast<uint16_t>(cap_ptr), 4, &cap_header), MX_OK,
+        EXPECT_EQ(pci_device_read(device, static_cast<uint16_t>(cap_ptr), 4, &cap_header), ZX_OK,
                   "Failed to read CAP from PCI config space.\n");
         // ID is the first byte.
         EXPECT_EQ(i, cap_header & UINT8_MAX, "Incorrect CAP ID read.\n");
diff --git a/system/utest/hypervisor/rules.mk b/system/utest/hypervisor/rules.mk
index 1e4c193..88e63a9 100644
--- a/system/utest/hypervisor/rules.mk
+++ b/system/utest/hypervisor/rules.mk
@@ -30,8 +30,8 @@
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/hypervisor \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 MODULE_STATIC_LIBS += \
diff --git a/system/utest/hypervisor/uart.cpp b/system/utest/hypervisor/uart.cpp
index 3b13423..13edef3 100644
--- a/system/utest/hypervisor/uart.cpp
+++ b/system/utest/hypervisor/uart.cpp
@@ -17,7 +17,7 @@
 
 static void stub_io_apic(io_apic_t* io_apic) {
     static local_apic_t local_apic = {};
-    local_apic.vcpu = MX_HANDLE_INVALID;
+    local_apic.vcpu = ZX_HANDLE_INVALID;
     io_apic_init(io_apic);
     io_apic->local_apic[0] = &local_apic;
 }
@@ -27,12 +27,12 @@
     io_apic->redirect[X86_INT_UART * 2] = EXPECTED_INT;
 }
 
-static mx_status_t ok_raise_interrupt(mx_handle_t vcpu, uint32_t vector) {
-    return vector == EXPECTED_INT ? MX_OK : MX_ERR_INTERNAL;
+static zx_status_t ok_raise_interrupt(zx_handle_t vcpu, uint32_t vector) {
+    return vector == EXPECTED_INT ? ZX_OK : ZX_ERR_INTERNAL;
 }
 
-static mx_status_t fail_raise_interrupt(mx_handle_t vcpu, uint32_t vector) {
-    return MX_ERR_BAD_STATE;
+static zx_status_t fail_raise_interrupt(zx_handle_t vcpu, uint32_t vector) {
+    return ZX_ERR_BAD_STATE;
 }
 
 static bool irq_redirect(void) {
@@ -46,13 +46,13 @@
         uart_init(&uart, &io_apic);
         uart.raise_interrupt = fail_raise_interrupt;
 
-        mx_packet_guest_io_t guest_io = {};
+        zx_packet_guest_io_t guest_io = {};
         guest_io.port = UART_INTERRUPT_ENABLE_PORT;
         guest_io.access_size = 1;
         guest_io.u8 = UART_INTERRUPT_ENABLE_THR_EMPTY;
 
-        mx_status_t status = uart_write(&uart, &guest_io);
-        ASSERT_EQ(status, MX_OK, "");
+        zx_status_t status = uart_write(&uart, &guest_io);
+        ASSERT_EQ(status, ZX_OK, "");
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_NONE, "");
     }
     {
@@ -61,13 +61,13 @@
         uart_init(&uart, &io_apic);
         uart.raise_interrupt = ok_raise_interrupt;
 
-        mx_packet_guest_io_t guest_io = {};
+        zx_packet_guest_io_t guest_io = {};
         guest_io.port = UART_INTERRUPT_ENABLE_PORT;
         guest_io.access_size = 1;
         guest_io.u8 = UART_INTERRUPT_ENABLE_THR_EMPTY;
 
-        mx_status_t status = uart_write(&uart, &guest_io);
-        ASSERT_EQ(status, MX_OK, "");
+        zx_status_t status = uart_write(&uart, &guest_io);
+        ASSERT_EQ(status, ZX_OK, "");
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_THR_EMPTY, "");
     }
     END_TEST;
@@ -82,9 +82,9 @@
         uart.interrupt_id = UART_INTERRUPT_ID_THR_EMPTY;
         uart.raise_interrupt = fail_raise_interrupt;
 
-        mx_vcpu_io_t vcpu_io;
-        mx_status_t status = uart_read(&uart, UART_INTERRUPT_ID_PORT, &vcpu_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_vcpu_io_t vcpu_io;
+        zx_status_t status = uart_read(&uart, UART_INTERRUPT_ID_PORT, &vcpu_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(vcpu_io.access_size, 1);
         ASSERT_EQ(vcpu_io.u8, UART_INTERRUPT_ID_THR_EMPTY);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_NONE);
@@ -95,9 +95,9 @@
         uart.interrupt_id = UART_INTERRUPT_ID_RDA;
         uart.raise_interrupt = fail_raise_interrupt;
 
-        mx_vcpu_io_t vcpu_io;
-        mx_status_t status = uart_read(&uart, UART_INTERRUPT_ID_PORT, &vcpu_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_vcpu_io_t vcpu_io;
+        zx_status_t status = uart_read(&uart, UART_INTERRUPT_ID_PORT, &vcpu_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(vcpu_io.access_size, 1);
         ASSERT_EQ(vcpu_io.u8, UART_INTERRUPT_ID_RDA);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_RDA);
@@ -121,10 +121,10 @@
         uart.rx_buffer = 'a';
         uart.interrupt_id = UART_INTERRUPT_ID_RDA;
         uart.interrupt_enable = UART_INTERRUPT_ENABLE_THR_EMPTY;
-        mx_vcpu_io_t vcpu_io;
+        zx_vcpu_io_t vcpu_io;
 
-        mx_status_t status = uart_read(&uart, UART_RECEIVE_PORT, &vcpu_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_status_t status = uart_read(&uart, UART_RECEIVE_PORT, &vcpu_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(vcpu_io.access_size, 1);
         ASSERT_EQ(vcpu_io.u8, 'a');
         ASSERT_EQ(uart.rx_buffer, 0);
@@ -138,10 +138,10 @@
         uart.raise_interrupt = fail_raise_interrupt;
         uart.interrupt_id = UART_INTERRUPT_ID_THR_EMPTY;
         uart.interrupt_enable = UART_INTERRUPT_ENABLE_NONE;
-        mx_vcpu_io_t vcpu_io;
+        zx_vcpu_io_t vcpu_io;
 
-        mx_status_t status = uart_read(&uart, UART_RECEIVE_PORT, &vcpu_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_status_t status = uart_read(&uart, UART_RECEIVE_PORT, &vcpu_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_THR_EMPTY);
     }
     END_TEST;
@@ -160,13 +160,13 @@
         uart.line_control = UART_LINE_CONTROL_DIV_LATCH;
         uart.interrupt_enable = 0;
 
-        mx_packet_guest_io_t guest_io = {};
+        zx_packet_guest_io_t guest_io = {};
         guest_io.port = UART_INTERRUPT_ENABLE_PORT;
         guest_io.access_size = 1;
         guest_io.u8 = UART_INTERRUPT_ENABLE_RDA;
 
-        mx_status_t status = uart_write(&uart, &guest_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_status_t status = uart_write(&uart, &guest_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(uart.interrupt_enable, 0);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_NONE); // should be untouched
     }
@@ -179,13 +179,13 @@
         uart_init(&uart, &io_apic);
         uart.raise_interrupt = fail_raise_interrupt;
 
-        mx_packet_guest_io_t guest_io = {};
+        zx_packet_guest_io_t guest_io = {};
         guest_io.port = UART_INTERRUPT_ENABLE_PORT;
         guest_io.access_size = 1;
         guest_io.u8 = UART_INTERRUPT_ENABLE_RDA;
 
-        mx_status_t status = uart_write(&uart, &guest_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_status_t status = uart_write(&uart, &guest_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(uart.interrupt_enable, UART_INTERRUPT_ENABLE_RDA);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_NONE); // should be untouched
     }
@@ -197,14 +197,14 @@
         uart.line_status = UART_LINE_STATUS_DATA_READY;
         uart.raise_interrupt = fail_raise_interrupt;
 
-        mx_packet_guest_io_t guest_io = {};
+        zx_packet_guest_io_t guest_io = {};
         guest_io.port = UART_INTERRUPT_ENABLE_PORT;
         guest_io.access_size = 1;
         // THR enable should trigger a THR interrupt
         guest_io.u8 = UART_INTERRUPT_ENABLE_THR_EMPTY;
 
-        mx_status_t status = uart_write(&uart, &guest_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_status_t status = uart_write(&uart, &guest_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(uart.interrupt_enable, UART_INTERRUPT_ENABLE_THR_EMPTY);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_NONE); // should be untouched
     }
@@ -215,14 +215,14 @@
         uart_init(&uart, &io_apic);
         uart.raise_interrupt = ok_raise_interrupt;
 
-        mx_packet_guest_io_t guest_io = {};
+        zx_packet_guest_io_t guest_io = {};
         guest_io.port = UART_INTERRUPT_ENABLE_PORT;
         guest_io.access_size = 1;
         // THR enable should trigger a THR interrupt
         guest_io.u8 = UART_INTERRUPT_ENABLE_THR_EMPTY;
 
-        mx_status_t status = uart_write(&uart, &guest_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_status_t status = uart_write(&uart, &guest_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(uart.interrupt_enable, UART_INTERRUPT_ENABLE_THR_EMPTY);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_THR_EMPTY);
     }
@@ -247,13 +247,13 @@
         // should remain the same.
         uart.line_control = UART_LINE_CONTROL_DIV_LATCH;
         uart.interrupt_id = UART_INTERRUPT_ID_THR_EMPTY;
-        mx_packet_guest_io_t guest_io = {};
+        zx_packet_guest_io_t guest_io = {};
         guest_io.port = UART_RECEIVE_PORT;
         guest_io.u8 = 0x1;
         guest_io.access_size = 1;
 
-        mx_status_t status = uart_write(&uart, &guest_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_status_t status = uart_write(&uart, &guest_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_THR_EMPTY);
     }
     {
@@ -266,15 +266,15 @@
         uart.interrupt_enable = UART_INTERRUPT_ENABLE_NONE;
         uart.raise_interrupt = fail_raise_interrupt;
 
-        mx_packet_guest_io_t guest_io = {};
+        zx_packet_guest_io_t guest_io = {};
         guest_io.port = UART_RECEIVE_PORT;
         guest_io.access_size = 3;
         guest_io.data[0] = 0x75;
         guest_io.data[1] = 0x61;
         guest_io.data[2] = 0x0d;
 
-        mx_status_t status = uart_write(&uart, &guest_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_status_t status = uart_write(&uart, &guest_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(uart.line_status, UART_LINE_STATUS_THR_EMPTY | UART_LINE_STATUS_DATA_READY);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_NONE);
     }
@@ -287,15 +287,15 @@
         // If THR empty interrupts are enabled, an interrupt should be raised.
         uart.interrupt_enable = UART_INTERRUPT_ENABLE_THR_EMPTY;
         uart.interrupt_id = UART_INTERRUPT_ID_NONE;
-        mx_packet_guest_io_t guest_io = {};
+        zx_packet_guest_io_t guest_io = {};
         guest_io.port = UART_RECEIVE_PORT;
         guest_io.access_size = 3;
         guest_io.data[0] = 0x72;
         guest_io.data[1] = 0x74;
         guest_io.data[2] = 0x0d;
 
-        mx_status_t status = uart_write(&uart, &guest_io);
-        ASSERT_EQ(status, MX_OK);
+        zx_status_t status = uart_write(&uart, &guest_io);
+        ASSERT_EQ(status, ZX_OK);
         ASSERT_EQ(uart.line_status, UART_LINE_STATUS_THR_EMPTY | UART_LINE_STATUS_DATA_READY);
         ASSERT_EQ(uart.interrupt_id, UART_INTERRUPT_ID_THR_EMPTY);
     }
diff --git a/system/utest/hypervisor/vcpu.cpp b/system/utest/hypervisor/vcpu.cpp
index af89a45..94fb303 100644
--- a/system/utest/hypervisor/vcpu.cpp
+++ b/system/utest/hypervisor/vcpu.cpp
@@ -11,8 +11,8 @@
 #include <hypervisor/pci.h>
 #include <hypervisor/uart.h>
 #include <hypervisor/vcpu.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <unittest/unittest.h>
 
 #define PCI_TYPE1_ADDR(bus, device, function, reg)                                                 \
@@ -25,25 +25,25 @@
     io_apic_t io_apic;
     io_port_t io_port;
     pci_bus_t bus;
-    mx_vcpu_io_t vcpu_io;
+    zx_vcpu_io_t vcpu_io;
 } test_t;
 
-static mx_status_t vcpu_read_test_state(vcpu_ctx_t* vcpu_ctx, uint32_t kind, void* buffer,
+static zx_status_t vcpu_read_test_state(vcpu_ctx_t* vcpu_ctx, uint32_t kind, void* buffer,
                                         uint32_t len) {
-    return MX_ERR_INTERNAL;
+    return ZX_ERR_INTERNAL;
 }
 
-static mx_status_t vcpu_write_test_state(vcpu_ctx_t* vcpu_ctx, uint32_t kind, const void* buffer,
+static zx_status_t vcpu_write_test_state(vcpu_ctx_t* vcpu_ctx, uint32_t kind, const void* buffer,
                                          uint32_t len) {
-    if (kind != MX_VCPU_IO || len != sizeof(mx_vcpu_io_t))
-        return MX_ERR_INVALID_ARGS;
+    if (kind != ZX_VCPU_IO || len != sizeof(zx_vcpu_io_t))
+        return ZX_ERR_INVALID_ARGS;
     test_t* test = (test_t*)vcpu_ctx;
-    auto io = static_cast<const mx_vcpu_io_t*>(buffer);
+    auto io = static_cast<const zx_vcpu_io_t*>(buffer);
     memcpy(&test->vcpu_io, io, sizeof(*io));
-    return MX_OK;
+    return ZX_OK;
 }
 
-static mx_status_t setup(test_t* test) {
+static zx_status_t setup(test_t* test) {
     memset(test, 0, sizeof(*test));
     vcpu_init(&test->vcpu_ctx);
     io_apic_init(&test->io_apic);
@@ -59,7 +59,7 @@
     // test structure.
     test->vcpu_ctx.read_state = vcpu_read_test_state;
     test->vcpu_ctx.write_state = vcpu_write_test_state;
-    return MX_OK;
+    return ZX_OK;
 }
 
 /* Test handling of an IO packet for an input instruction.
@@ -71,8 +71,8 @@
     BEGIN_TEST;
 
     test_t test;
-    mx_port_packet_t packet = {};
-    ASSERT_EQ(setup(&test), MX_OK, "Failed to initialize test");
+    zx_port_packet_t packet = {};
+    ASSERT_EQ(setup(&test), ZX_OK, "Failed to initialize test");
 
     // Initialize the hosts register to an arbitrary non-zero value.
     uart_t uart;
@@ -81,11 +81,11 @@
     test.guest_ctx.uart = &uart;
 
     // Send a guest packet to to read the UART line control port.
-    packet.type = MX_PKT_TYPE_GUEST_IO;
+    packet.type = ZX_PKT_TYPE_GUEST_IO;
     packet.guest_io.input = true;
     packet.guest_io.port = UART_LINE_CONTROL_PORT;
     packet.guest_io.access_size = 1;
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
 
     // Verify result value was written to RAX.
     EXPECT_EQ(test.vcpu_io.u8, uart.line_control, "RAX was not populated with expected value");
@@ -101,8 +101,8 @@
     BEGIN_TEST;
 
     test_t test;
-    mx_packet_guest_io_t io = {};
-    ASSERT_EQ(setup(&test), MX_OK, "Failed to initialize test");
+    zx_packet_guest_io_t io = {};
+    ASSERT_EQ(setup(&test), ZX_OK, "Failed to initialize test");
 
     uart_t uart;
     uart_init(&uart, &test.io_apic);
@@ -113,7 +113,7 @@
     io.port = UART_LINE_CONTROL_PORT;
     io.access_size = 1;
     io.u8 = 0xaf;
-    EXPECT_EQ(uart_write(&uart, &io), MX_OK, "Failed to handle UART IO packet");
+    EXPECT_EQ(uart_write(&uart, &io), ZX_OK, "Failed to handle UART IO packet");
 
     // Verify packet value was saved to the host port state.
     EXPECT_EQ(io.u8, uart.line_control, "UART was not populated with expected value");
@@ -141,34 +141,34 @@
     BEGIN_TEST;
 
     test_t test;
-    mx_port_packet_t packet = {};
-    ASSERT_EQ(setup(&test), MX_OK, "Failed to setup test");
+    zx_port_packet_t packet = {};
+    ASSERT_EQ(setup(&test), ZX_OK, "Failed to setup test");
 
     // 32 bit write.
-    packet.type = MX_PKT_TYPE_GUEST_IO;
+    packet.type = ZX_PKT_TYPE_GUEST_IO;
     packet.guest_io.input = false;
     packet.guest_io.port = PCI_CONFIG_ADDRESS_PORT_BASE;
     packet.guest_io.access_size = 4;
     packet.guest_io.u32 = 0x12345678;
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
     EXPECT_EQ(test.bus.config_addr, 0x12345678u, "Incorrect address read from PCI address port");
 
     // 16 bit write to bits 31..16. Other bits remain unchanged.
-    packet.type = MX_PKT_TYPE_GUEST_IO;
+    packet.type = ZX_PKT_TYPE_GUEST_IO;
     packet.guest_io.input = false;
     packet.guest_io.port = PCI_CONFIG_ADDRESS_PORT_BASE + 2;
     packet.guest_io.access_size = 2;
     packet.guest_io.u16 = 0xFACE;
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
     EXPECT_EQ(test.bus.config_addr, 0xFACE5678u, "Incorrect address read from PCI address port");
 
     // 8 bit write to bits (15..8). Other bits remain unchanged.
-    packet.type = MX_PKT_TYPE_GUEST_IO;
+    packet.type = ZX_PKT_TYPE_GUEST_IO;
     packet.guest_io.input = false;
     packet.guest_io.port = PCI_CONFIG_ADDRESS_PORT_BASE + 1;
     packet.guest_io.access_size = 1;
     packet.guest_io.u8 = 0x99;
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
     EXPECT_EQ(test.bus.config_addr, 0xFACE9978u, "Incorrect address read from PCI address port");
 
     END_TEST;
@@ -182,36 +182,36 @@
     BEGIN_TEST;
 
     test_t test;
-    mx_port_packet_t packet = {};
-    ASSERT_EQ(setup(&test), MX_OK, "Failed to setup test");
+    zx_port_packet_t packet = {};
+    ASSERT_EQ(setup(&test), ZX_OK, "Failed to setup test");
     test.bus.config_addr = 0x12345678;
 
     // 32 bit read (bits 31..0).
-    packet.type = MX_PKT_TYPE_GUEST_IO;
+    packet.type = ZX_PKT_TYPE_GUEST_IO;
     packet.guest_io.input = true;
     packet.guest_io.port = PCI_CONFIG_ADDRESS_PORT_BASE;
     packet.guest_io.access_size = 4;
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
     EXPECT_EQ(test.vcpu_io.access_size, 4, "Incorrect IO access_size");
     EXPECT_EQ(test.vcpu_io.u32, 0x12345678u, "Incorrect address read from PCI address port");
 
     // 16 bit read (bits 31..16).
     test.vcpu_io.u16 = 0;
-    packet.type = MX_PKT_TYPE_GUEST_IO;
+    packet.type = ZX_PKT_TYPE_GUEST_IO;
     packet.guest_io.input = true;
     packet.guest_io.port = PCI_CONFIG_ADDRESS_PORT_BASE + 2;
     packet.guest_io.access_size = 2;
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
     EXPECT_EQ(test.vcpu_io.access_size, 2, "Incorrect IO access_size");
     EXPECT_EQ(test.vcpu_io.u16, 0x1234u, "Incorrect address read from PCI address port");
 
     // 8 bit read (bits 15..8).
     test.vcpu_io.u8 = 0;
-    packet.type = MX_PKT_TYPE_GUEST_IO;
+    packet.type = ZX_PKT_TYPE_GUEST_IO;
     packet.guest_io.input = true;
     packet.guest_io.port = PCI_CONFIG_ADDRESS_PORT_BASE + 1;
     packet.guest_io.access_size = 1;
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
     EXPECT_EQ(test.vcpu_io.access_size, 1, "Incorrect IO access_size");
     EXPECT_EQ(test.vcpu_io.u8, 0x56u, "Incorrect address read from PCI address port");
 
@@ -226,23 +226,23 @@
     BEGIN_TEST;
 
     test_t test;
-    mx_port_packet_t packet = {};
-    ASSERT_EQ(setup(&test), MX_OK, "Failed to setup test");
+    zx_port_packet_t packet = {};
+    ASSERT_EQ(setup(&test), ZX_OK, "Failed to setup test");
 
     // 16-bit read.
     test.bus.config_addr = PCI_TYPE1_ADDR(0, 0, 0, 0);
-    packet.type = MX_PKT_TYPE_GUEST_IO;
+    packet.type = ZX_PKT_TYPE_GUEST_IO;
     packet.guest_io.input = true;
     packet.guest_io.port = PCI_CONFIG_DATA_PORT_BASE;
     packet.guest_io.access_size = 2;
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
     EXPECT_EQ(test.vcpu_io.access_size, 2, "Incorrect IO access_size");
     EXPECT_EQ(test.vcpu_io.u16, PCI_VENDOR_ID_INTEL, "Incorrect value read from PCI data port");
 
     // 32-bit read from same address. Result should now contain the Device ID
     // in the upper 16 bits
     packet.guest_io.access_size = 4;
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
     EXPECT_EQ(test.vcpu_io.access_size, 4, "Incorrect IO access_size");
     EXPECT_EQ(test.vcpu_io.u32, PCI_VENDOR_ID_INTEL | (PCI_DEVICE_ID_INTEL_Q35 << 16),
               "Incorrect value read from PCI data port");
@@ -260,7 +260,7 @@
     // Add the register offset to the data port base address.
     packet.guest_io.port =
         PCI_CONFIG_DATA_PORT_BASE + (PCI_CONFIG_DEVICE_ID & bit_mask<uint32_t>(2));
-    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), MX_OK, "Failed to handle guest packet");
+    EXPECT_EQ(vcpu_packet_handler(&test.vcpu_ctx, &packet), ZX_OK, "Failed to handle guest packet");
     EXPECT_EQ(test.vcpu_io.access_size, 2, "Incorrect IO access_size");
     EXPECT_EQ(test.vcpu_io.u16, PCI_DEVICE_ID_INTEL_Q35, "Incorrect value read from PCI data port");
 
diff --git a/system/utest/int-types/rules.mk b/system/utest/int-types/rules.mk
index 95eaad3..19fe8cf 100644
--- a/system/utest/int-types/rules.mk
+++ b/system/utest/int-types/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_STATIC_LIBS := system/ulib/fbl
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/last-handle/last-handle.cpp b/system/utest/last-handle/last-handle.cpp
index 0f52c9e..1f4da3e 100644
--- a/system/utest/last-handle/last-handle.cpp
+++ b/system/utest/last-handle/last-handle.cpp
@@ -6,141 +6,141 @@
 #include <stdio.h>
 #include <threads.h>
 
-#include <mx/channel.h>
-#include <mx/event.h>
-#include <mx/handle.h>
-#include <mx/port.h>
+#include <zx/channel.h>
+#include <zx/event.h>
+#include <zx/handle.h>
+#include <zx/port.h>
 
 #include <fbl/type_support.h>
 
-#include <magenta/syscalls/port.h>
+#include <zircon/syscalls/port.h>
 
 #include <unistd.h>
 #include <unittest/unittest.h>
 
 static bool basic_test() {
     // Test that"
-    // 1- handles starts with the MX_SIGNAL_LAST_HANDLE active.
+    // 1- handles starts with the ZX_SIGNAL_LAST_HANDLE active.
     // 2- the signal deactives on duplication.
     // 3- the signal comes back on closing the duplicated handle.
-    // 4- the MX_SIGNAL_LAST_HANDLE cannot be touched with mx_object_signal().
+    // 4- the ZX_SIGNAL_LAST_HANDLE cannot be touched with zx_object_signal().
 
     BEGIN_TEST;
-    mx::event event;
-    ASSERT_EQ(mx::event::create(0u, &event), MX_OK);
-    mx_signals_t observed = 0u;
+    zx::event event;
+    ASSERT_EQ(zx::event::create(0u, &event), ZX_OK);
+    zx_signals_t observed = 0u;
     EXPECT_EQ(
-        event.wait_one(MX_SIGNAL_LAST_HANDLE, MX_TIME_INFINITE, &observed), MX_OK);
-    EXPECT_EQ(observed, MX_SIGNAL_LAST_HANDLE);
+        event.wait_one(ZX_SIGNAL_LAST_HANDLE, ZX_TIME_INFINITE, &observed), ZX_OK);
+    EXPECT_EQ(observed, ZX_SIGNAL_LAST_HANDLE);
 
-    mx::event dup;
-    EXPECT_EQ(event.duplicate(MX_RIGHT_SAME_RIGHTS, &dup), MX_OK);
+    zx::event dup;
+    EXPECT_EQ(event.duplicate(ZX_RIGHT_SAME_RIGHTS, &dup), ZX_OK);
 
-    EXPECT_EQ(event.wait_one(MX_SIGNAL_LAST_HANDLE, 0u, &observed), MX_ERR_TIMED_OUT);
+    EXPECT_EQ(event.wait_one(ZX_SIGNAL_LAST_HANDLE, 0u, &observed), ZX_ERR_TIMED_OUT);
     EXPECT_EQ(observed, 0u);
 
     dup.reset();
     EXPECT_EQ(
-        event.wait_one(MX_SIGNAL_LAST_HANDLE, MX_TIME_INFINITE, &observed), MX_OK);
-    EXPECT_EQ(observed, MX_SIGNAL_LAST_HANDLE);
+        event.wait_one(ZX_SIGNAL_LAST_HANDLE, ZX_TIME_INFINITE, &observed), ZX_OK);
+    EXPECT_EQ(observed, ZX_SIGNAL_LAST_HANDLE);
 
-    EXPECT_EQ(event.signal(MX_SIGNAL_LAST_HANDLE, 0), MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(event.signal(ZX_SIGNAL_LAST_HANDLE, 0), ZX_ERR_INVALID_ARGS);
     END_TEST;
 }
 
 static bool replace_test() {
     // Test that:
-    // 1- replacing the handle keeps the MX_SIGNAL_LAST_HANDLE signal.
-    // 2- replacing a duplicate does not spuriosly signal MX_SIGNAL_LAST_HANDLE.
-    // 3- closing the replacement does signal MX_SIGNAL_LAST_HANDLE.
+    // 1- replacing the handle keeps the ZX_SIGNAL_LAST_HANDLE signal.
+    // 2- replacing a duplicate does not spuriosly signal ZX_SIGNAL_LAST_HANDLE.
+    // 3- closing the replacement does signal ZX_SIGNAL_LAST_HANDLE.
     // Note: we rely on a port to detect the edge transition, if any.
 
     BEGIN_TEST;
-    mx::event old_ev;
-    ASSERT_EQ(mx::event::create(0u, &old_ev), MX_OK);
+    zx::event old_ev;
+    ASSERT_EQ(zx::event::create(0u, &old_ev), ZX_OK);
 
-    mx::event new_ev;
-    EXPECT_EQ(old_ev.replace(MX_RIGHT_SAME_RIGHTS, &new_ev), MX_OK);
+    zx::event new_ev;
+    EXPECT_EQ(old_ev.replace(ZX_RIGHT_SAME_RIGHTS, &new_ev), ZX_OK);
 
-    mx_signals_t observed = 0u;
+    zx_signals_t observed = 0u;
     EXPECT_EQ(
-        new_ev.wait_one(MX_SIGNAL_LAST_HANDLE, MX_TIME_INFINITE, &observed), MX_OK);
-    EXPECT_EQ(observed, MX_SIGNAL_LAST_HANDLE);
+        new_ev.wait_one(ZX_SIGNAL_LAST_HANDLE, ZX_TIME_INFINITE, &observed), ZX_OK);
+    EXPECT_EQ(observed, ZX_SIGNAL_LAST_HANDLE);
 
-    mx::event dup;
-    EXPECT_EQ(new_ev.duplicate(MX_RIGHT_SAME_RIGHTS, &dup), MX_OK);
+    zx::event dup;
+    EXPECT_EQ(new_ev.duplicate(ZX_RIGHT_SAME_RIGHTS, &dup), ZX_OK);
 
-    mx::port port;
-    ASSERT_EQ(mx::port::create(0, &port), MX_OK);
+    zx::port port;
+    ASSERT_EQ(zx::port::create(0, &port), ZX_OK);
 
     EXPECT_EQ(new_ev.wait_async(
-        port, 1u, MX_SIGNAL_LAST_HANDLE, MX_WAIT_ASYNC_ONCE), MX_OK);
+        port, 1u, ZX_SIGNAL_LAST_HANDLE, ZX_WAIT_ASYNC_ONCE), ZX_OK);
 
-    mx_port_packet_t packet = {};
-    EXPECT_EQ(port.wait(0ull, &packet, 0u), MX_ERR_TIMED_OUT);
+    zx_port_packet_t packet = {};
+    EXPECT_EQ(port.wait(0ull, &packet, 0u), ZX_ERR_TIMED_OUT);
 
-    mx::event new_dup;
-    EXPECT_EQ(dup.replace(MX_RIGHT_SAME_RIGHTS, &new_dup), MX_OK);
-    EXPECT_EQ(port.wait(0ull, &packet, 0u), MX_ERR_TIMED_OUT);
+    zx::event new_dup;
+    EXPECT_EQ(dup.replace(ZX_RIGHT_SAME_RIGHTS, &new_dup), ZX_OK);
+    EXPECT_EQ(port.wait(0ull, &packet, 0u), ZX_ERR_TIMED_OUT);
 
     new_dup.reset();
-    EXPECT_EQ(port.wait(MX_TIME_INFINITE, &packet, 0u), MX_OK);
-    EXPECT_EQ(packet.type, MX_PKT_TYPE_SIGNAL_ONE);
-    EXPECT_EQ(packet.signal.observed, MX_SIGNAL_LAST_HANDLE);
+    EXPECT_EQ(port.wait(ZX_TIME_INFINITE, &packet, 0u), ZX_OK);
+    EXPECT_EQ(packet.type, ZX_PKT_TYPE_SIGNAL_ONE);
+    EXPECT_EQ(packet.signal.observed, ZX_SIGNAL_LAST_HANDLE);
 
     END_TEST;
 }
 
 static bool channel_test() {
     // Test that:
-    // 1- Sending/receiving a duplicated object never triggers MX_SIGNAL_LAST_HANDLE. The
+    // 1- Sending/receiving a duplicated object never triggers ZX_SIGNAL_LAST_HANDLE. The
     //    handle count is still 2, even though one handle is not accessible to
     //    any process.
     // 2- Sending an object and closing the send side of a channel does not trigger
-    //    MX_SIGNAL_LAST_HANDLE.
-    // 3- Closing the receive side of #2 does trigger MX_SIGNAL_LAST_HANDLE.
+    //    ZX_SIGNAL_LAST_HANDLE.
+    // 3- Closing the receive side of #2 does trigger ZX_SIGNAL_LAST_HANDLE.
 
     BEGIN_TEST;
-    mx::event event;
-    ASSERT_EQ(mx::event::create(0u, &event), MX_OK);
+    zx::event event;
+    ASSERT_EQ(zx::event::create(0u, &event), ZX_OK);
 
-    mx::channel channel[2];
-    ASSERT_EQ(mx::channel::create(0u, &channel[0], &channel[1]), MX_OK);
+    zx::channel channel[2];
+    ASSERT_EQ(zx::channel::create(0u, &channel[0], &channel[1]), ZX_OK);
 
-    mx::port port;
-    ASSERT_EQ(mx::port::create(0, &port), MX_OK);
+    zx::port port;
+    ASSERT_EQ(zx::port::create(0, &port), ZX_OK);
 
-    mx_handle_t dup_ev;
-    EXPECT_EQ(mx_handle_duplicate(event.get(), MX_RIGHT_SAME_RIGHTS, &dup_ev), MX_OK);
+    zx_handle_t dup_ev;
+    EXPECT_EQ(zx_handle_duplicate(event.get(), ZX_RIGHT_SAME_RIGHTS, &dup_ev), ZX_OK);
 
     ASSERT_EQ(event.wait_async(
-        port, 1u, MX_SIGNAL_LAST_HANDLE, MX_WAIT_ASYNC_ONCE), MX_OK);
+        port, 1u, ZX_SIGNAL_LAST_HANDLE, ZX_WAIT_ASYNC_ONCE), ZX_OK);
 
     uint32_t actual_b;
     uint32_t actual_h;
-    mx_port_packet_t packet = {};
+    zx_port_packet_t packet = {};
 
     for (int ix = 0; ix != 4; ++ix) {
-        ASSERT_EQ(channel[0].write(0u, nullptr, 0u, &dup_ev, 1u), MX_OK);
+        ASSERT_EQ(channel[0].write(0u, nullptr, 0u, &dup_ev, 1u), ZX_OK);
         dup_ev = 0u;
 
-        EXPECT_EQ(port.wait(0ull, &packet, 0u), MX_ERR_TIMED_OUT);
+        EXPECT_EQ(port.wait(0ull, &packet, 0u), ZX_ERR_TIMED_OUT);
 
         ASSERT_EQ(channel[1].read(
-            0u, nullptr, 0, &actual_b, &dup_ev, 1u, &actual_h), MX_OK);
+            0u, nullptr, 0, &actual_b, &dup_ev, 1u, &actual_h), ZX_OK);
 
-        EXPECT_EQ(port.wait(0ull, &packet, 0u), MX_ERR_TIMED_OUT);
+        EXPECT_EQ(port.wait(0ull, &packet, 0u), ZX_ERR_TIMED_OUT);
     }
 
-    ASSERT_EQ(channel[0].write(0u, nullptr, 0u, &dup_ev, 1u), MX_OK);
+    ASSERT_EQ(channel[0].write(0u, nullptr, 0u, &dup_ev, 1u), ZX_OK);
 
     channel[0].reset();
-    EXPECT_EQ(port.wait(0ull, &packet, 0u), MX_ERR_TIMED_OUT);
+    EXPECT_EQ(port.wait(0ull, &packet, 0u), ZX_ERR_TIMED_OUT);
 
     channel[1].reset();
-    EXPECT_EQ(port.wait(MX_TIME_INFINITE, &packet, 0u), MX_OK);
-    EXPECT_EQ(packet.type, MX_PKT_TYPE_SIGNAL_ONE);
-    EXPECT_EQ(packet.signal.observed, MX_SIGNAL_LAST_HANDLE);
+    EXPECT_EQ(port.wait(ZX_TIME_INFINITE, &packet, 0u), ZX_OK);
+    EXPECT_EQ(packet.type, ZX_PKT_TYPE_SIGNAL_ONE);
+    EXPECT_EQ(packet.signal.observed, ZX_SIGNAL_LAST_HANDLE);
 
     END_TEST;
 }
diff --git a/system/utest/last-handle/rules.mk b/system/utest/last-handle/rules.mk
index 0b6281b..d303edf 100644
--- a/system/utest/last-handle/rules.mk
+++ b/system/utest/last-handle/rules.mk
@@ -14,10 +14,10 @@
 MODULE_NAME := last-handle-test
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl \
 
 MODULE_LIBS := \
-    system/ulib/mxio system/ulib/magenta system/ulib/unittest system/ulib/c
+    system/ulib/fdio system/ulib/zircon system/ulib/unittest system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/launchpad/launchpad.c b/system/utest/launchpad/launchpad.c
index 7774892..5bf2455 100644
--- a/system/utest/launchpad/launchpad.c
+++ b/system/utest/launchpad/launchpad.c
@@ -11,13 +11,13 @@
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
 
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <limits.h>
 
-#include <mxio/util.h>
+#include <fdio/util.h>
 
 #include <unittest/unittest.h>
 
@@ -40,39 +40,39 @@
 
     launchpad_t* lp = NULL;
 
-    mx_handle_t mxio_job = mx_job_default();
-    ASSERT_NE(mxio_job, MX_HANDLE_INVALID, "no mxio job object");
+    zx_handle_t fdio_job = zx_job_default();
+    ASSERT_NE(fdio_job, ZX_HANDLE_INVALID, "no fdio job object");
 
-    mx_handle_t job_copy = MX_HANDLE_INVALID;
-    ASSERT_EQ(mx_handle_duplicate(mxio_job, MX_RIGHT_SAME_RIGHTS, &job_copy),
-              MX_OK, "mx_handle_duplicate failed");
+    zx_handle_t job_copy = ZX_HANDLE_INVALID;
+    ASSERT_EQ(zx_handle_duplicate(fdio_job, ZX_RIGHT_SAME_RIGHTS, &job_copy),
+              ZX_OK, "zx_handle_duplicate failed");
 
-    mx_status_t status = launchpad_create(job_copy, test_inferior_child_name, &lp);
-    ASSERT_EQ(status, MX_OK, "launchpad_create");
+    zx_status_t status = launchpad_create(job_copy, test_inferior_child_name, &lp);
+    ASSERT_EQ(status, ZX_OK, "launchpad_create");
 
-    mx_handle_t vmo;
-    ASSERT_EQ(launchpad_vmo_from_file(program_path, &vmo), MX_OK, "");
+    zx_handle_t vmo;
+    ASSERT_EQ(launchpad_vmo_from_file(program_path, &vmo), ZX_OK, "");
     status = launchpad_elf_load(lp, vmo);
-    ASSERT_EQ(status, MX_OK, "launchpad_elf_load");
+    ASSERT_EQ(status, ZX_OK, "launchpad_elf_load");
 
-    mx_vaddr_t base, entry;
+    zx_vaddr_t base, entry;
     status = launchpad_get_base_address(lp, &base);
-    ASSERT_EQ(status, MX_OK, "launchpad_get_base_address");
+    ASSERT_EQ(status, ZX_OK, "launchpad_get_base_address");
     status = launchpad_get_entry_address(lp, &entry);
-    ASSERT_EQ(status, MX_OK, "launchpad_get_entry_address");
+    ASSERT_EQ(status, ZX_OK, "launchpad_get_entry_address");
     ASSERT_GT(base, 0u, "base > 0");
 
-    mx_handle_t dynld_vmo = MX_HANDLE_INVALID;
-    ASSERT_EQ(launchpad_vmo_from_file(dynld_path, &dynld_vmo), MX_OK, "");
-    ASSERT_NE(dynld_vmo, MX_HANDLE_INVALID, "launchpad_vmo_from_file");
+    zx_handle_t dynld_vmo = ZX_HANDLE_INVALID;
+    ASSERT_EQ(launchpad_vmo_from_file(dynld_path, &dynld_vmo), ZX_OK, "");
+    ASSERT_NE(dynld_vmo, ZX_HANDLE_INVALID, "launchpad_vmo_from_file");
     elf_load_header_t header;
     uintptr_t phoff;
     status = elf_load_prepare(dynld_vmo, NULL, 0, &header, &phoff);
-    ASSERT_EQ(status, MX_OK, "elf_load_prepare");
+    ASSERT_EQ(status, ZX_OK, "elf_load_prepare");
     unittest_printf("entry %p, base %p, header entry %p\n",
                     (void*) entry, (void*) base, (void*) header.e_entry);
     ASSERT_EQ(entry, base + header.e_entry, "bad value for base or entry");
-    mx_handle_close(dynld_vmo);
+    zx_handle_close(dynld_vmo);
 
     launchpad_destroy(lp);
 
@@ -83,8 +83,8 @@
     BEGIN_TEST;
 
     launchpad_t* lp;
-    ASSERT_EQ(launchpad_create(MX_HANDLE_INVALID, "argument size test", &lp),
-              MX_OK, "");
+    ASSERT_EQ(launchpad_create(ZX_HANDLE_INVALID, "argument size test", &lp),
+              ZX_OK, "");
 
     char* big = malloc(size + 3);
     big[0] = ':';
@@ -92,21 +92,21 @@
     memset(&big[2], 'x', size);
     big[2 + size] = '\0';
     const char* const argv[] = { "/boot/bin/sh", "-c", big };
-    EXPECT_EQ(launchpad_set_args(lp, countof(argv), argv), MX_OK, "");
+    EXPECT_EQ(launchpad_set_args(lp, countof(argv), argv), ZX_OK, "");
     free(big);
 
-    EXPECT_EQ(launchpad_load_from_file(lp, argv[0]), MX_OK, "");
+    EXPECT_EQ(launchpad_load_from_file(lp, argv[0]), ZX_OK, "");
 
-    mx_handle_t proc = MX_HANDLE_INVALID;
+    zx_handle_t proc = ZX_HANDLE_INVALID;
     const char* errmsg = "???";
-    EXPECT_EQ(launchpad_go(lp, &proc, &errmsg), MX_OK, errmsg);
+    EXPECT_EQ(launchpad_go(lp, &proc, &errmsg), ZX_OK, errmsg);
 
-    EXPECT_EQ(mx_object_wait_one(proc, MX_PROCESS_TERMINATED,
-                                 MX_TIME_INFINITE, NULL), MX_OK, "");
-    mx_info_process_t info;
-    EXPECT_EQ(mx_object_get_info(proc, MX_INFO_PROCESS,
-                                 &info, sizeof(info), NULL, NULL), MX_OK, "");
-    EXPECT_EQ(mx_handle_close(proc), MX_OK, "");
+    EXPECT_EQ(zx_object_wait_one(proc, ZX_PROCESS_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL), ZX_OK, "");
+    zx_info_process_t info;
+    EXPECT_EQ(zx_object_get_info(proc, ZX_INFO_PROCESS,
+                                 &info, sizeof(info), NULL, NULL), ZX_OK, "");
+    EXPECT_EQ(zx_handle_close(proc), ZX_OK, "");
 
     EXPECT_EQ(info.return_code, 0, "shell exit status");
 
diff --git a/system/utest/launchpad/rules.mk b/system/utest/launchpad/rules.mk
index cbc37b2..edb6cc7 100644
--- a/system/utest/launchpad/rules.mk
+++ b/system/utest/launchpad/rules.mk
@@ -20,8 +20,8 @@
 MODULE_LIBS := \
     system/ulib/unittest \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/libmx/mx-test.cpp b/system/utest/libmx/mx-test.cpp
deleted file mode 100644
index a13a143..0000000
--- a/system/utest/libmx/mx-test.cpp
+++ /dev/null
@@ -1,278 +0,0 @@
-// Copyright 2016 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <assert.h>
-#include <stdio.h>
-
-#include <mx/channel.h>
-#include <mx/event.h>
-#include <mx/eventpair.h>
-#include <mx/handle.h>
-#include <mx/job.h>
-#include <mx/port.h>
-#include <mx/process.h>
-#include <mx/socket.h>
-#include <mx/thread.h>
-#include <mx/time.h>
-#include <mx/vmar.h>
-
-#include <fbl/type_support.h>
-
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/syscalls/port.h>
-
-#include <unistd.h>
-#include <unittest/unittest.h>
-
-static mx_status_t validate_handle(mx_handle_t handle) {
-    return mx_object_get_info(handle, MX_INFO_HANDLE_VALID, 0, NULL, 0u, NULL);
-}
-
-static bool handle_invalid_test() {
-    BEGIN_TEST;
-    mx::handle handle;
-    // A default constructed handle is invalid.
-    ASSERT_EQ(handle.release(), MX_HANDLE_INVALID);
-    END_TEST;
-}
-
-static bool handle_close_test() {
-    BEGIN_TEST;
-    mx_handle_t raw_event;
-    ASSERT_EQ(mx_event_create(0u, &raw_event), MX_OK);
-    ASSERT_EQ(validate_handle(raw_event), MX_OK);
-    {
-        mx::handle handle(raw_event);
-    }
-    // Make sure the handle was closed.
-    ASSERT_EQ(validate_handle(raw_event), MX_ERR_BAD_HANDLE);
-    END_TEST;
-}
-
-static bool handle_move_test() {
-    BEGIN_TEST;
-    mx::event event;
-    // Check move semantics.
-    ASSERT_EQ(mx::event::create(0u, &event), MX_OK);
-    mx::handle handle(fbl::move(event));
-    ASSERT_EQ(event.release(), MX_HANDLE_INVALID);
-    ASSERT_EQ(validate_handle(handle.get()), MX_OK);
-    END_TEST;
-}
-
-static bool handle_duplicate_test() {
-    BEGIN_TEST;
-    mx_handle_t raw_event;
-    mx::handle dup;
-    ASSERT_EQ(mx_event_create(0u, &raw_event), MX_OK);
-    mx::handle handle(raw_event);
-    ASSERT_EQ(handle.duplicate(MX_RIGHT_SAME_RIGHTS, &dup), MX_OK);
-    // The duplicate must be valid as well as the original.
-    ASSERT_EQ(validate_handle(dup.get()), MX_OK);
-    ASSERT_EQ(validate_handle(raw_event), MX_OK);
-    END_TEST;
-}
-
-static bool handle_replace_test() {
-    BEGIN_TEST;
-    mx_handle_t raw_event;
-    mx::handle rep;
-    ASSERT_EQ(mx_event_create(0u, &raw_event), MX_OK);
-    {
-        mx::handle handle(raw_event);
-        ASSERT_EQ(handle.replace(MX_RIGHT_SAME_RIGHTS, &rep), MX_OK);
-        ASSERT_EQ(handle.release(), MX_HANDLE_INVALID);
-    }
-    // The original shoould be invalid and the replacement should be valid.
-    ASSERT_EQ(validate_handle(raw_event), MX_ERR_BAD_HANDLE);
-    ASSERT_EQ(validate_handle(rep.get()), MX_OK);
-    END_TEST;
-}
-
-static bool event_test() {
-    BEGIN_TEST;
-    mx::event event;
-    ASSERT_EQ(mx::event::create(0u, &event), MX_OK);
-    ASSERT_EQ(validate_handle(event.get()), MX_OK);
-    // TODO(cpu): test more.
-    END_TEST;
-}
-
-static bool event_duplicate_test() {
-    BEGIN_TEST;
-    mx::event event;
-    mx::event dup;
-    ASSERT_EQ(mx::event::create(0u, &event), MX_OK);
-    ASSERT_EQ(event.duplicate(MX_RIGHT_SAME_RIGHTS, &dup), MX_OK);
-    // The duplicate must be valid as well as the original.
-    ASSERT_EQ(validate_handle(dup.get()), MX_OK);
-    ASSERT_EQ(validate_handle(event.get()), MX_OK);
-    END_TEST;
-}
-
-static bool channel_test() {
-    BEGIN_TEST;
-    mx::channel channel[2];
-    ASSERT_EQ(mx::channel::create(0u, &channel[0], &channel[1]), MX_OK);
-    ASSERT_EQ(validate_handle(channel[0].get()), MX_OK);
-    ASSERT_EQ(validate_handle(channel[1].get()), MX_OK);
-    // TODO(cpu): test more.
-    END_TEST;
-}
-
-static bool socket_test() {
-    BEGIN_TEST;
-    mx::socket socket[2];
-    ASSERT_EQ(mx::socket::create(0u, &socket[0], &socket[1]), MX_OK);
-    ASSERT_EQ(validate_handle(socket[0].get()), MX_OK);
-    ASSERT_EQ(validate_handle(socket[1].get()), MX_OK);
-    // TODO(cpu): test more.
-    END_TEST;
-}
-
-static bool eventpair_test() {
-    BEGIN_TEST;
-    mx::eventpair evpair[2];
-    ASSERT_EQ(mx::eventpair::create(0u, &evpair[0], &evpair[1]), MX_OK);
-    ASSERT_EQ(validate_handle(evpair[0].get()), MX_OK);
-    ASSERT_EQ(validate_handle(evpair[1].get()), MX_OK);
-    // TODO(cpu): test more.
-    END_TEST;
-}
-
-static bool vmar_test() {
-    BEGIN_TEST;
-    mx::vmar vmar;
-    const size_t size = getpagesize();
-    uintptr_t addr;
-    ASSERT_EQ(mx::vmar::root_self().allocate(0u, size, MX_VM_FLAG_CAN_MAP_READ, &vmar, &addr),
-              MX_OK);
-    ASSERT_EQ(validate_handle(vmar.get()), MX_OK);
-    ASSERT_EQ(vmar.destroy(), MX_OK);
-    // TODO(teisenbe): test more.
-    END_TEST;
-}
-
-static bool port_test() {
-    BEGIN_TEST;
-    mx::port port;
-    ASSERT_EQ(mx::port::create(0, &port), MX_OK);
-    ASSERT_EQ(validate_handle(port.get()), MX_OK);
-
-    mx::channel channel[2];
-    auto key = 1111ull;
-    ASSERT_EQ(mx::channel::create(0u, &channel[0], &channel[1]), MX_OK);
-    ASSERT_EQ(channel[0].wait_async(
-        port, key, MX_CHANNEL_READABLE, MX_WAIT_ASYNC_ONCE), MX_OK);
-    ASSERT_EQ(channel[1].write(0u, "12345", 5, nullptr, 0u), MX_OK);
-
-    mx_port_packet_t packet = {};
-    ASSERT_EQ(port.wait(0ull, &packet, 0u), MX_OK);
-    ASSERT_EQ(packet.key, key);
-    ASSERT_EQ(packet.type, MX_PKT_TYPE_SIGNAL_ONE);
-    ASSERT_EQ(packet.signal.count, 1u);
-    END_TEST;
-}
-
-static bool time_test() {
-    BEGIN_TEST;
-
-    // Just a smoke test
-    ASSERT_GE(mx::deadline_after(10), 10);
-
-    END_TEST;
-}
-
-template <typename T>
-static bool reference_thing(const T& p) {
-    BEGIN_HELPER;
-    ASSERT_TRUE(static_cast<bool>(p), "invalid handle");
-    END_HELPER;
-}
-
-static bool thread_self_test() {
-    BEGIN_TEST;
-
-    mx_handle_t raw = mx_thread_self();
-    ASSERT_EQ(validate_handle(raw), MX_OK);
-
-    EXPECT_TRUE(reference_thing<mx::thread>(mx::thread::self()));
-    EXPECT_EQ(validate_handle(raw), MX_OK);
-
-    // This does not compile:
-    //const mx::thread self = mx::thread::self();
-
-    END_TEST;
-}
-
-static bool process_self_test() {
-    BEGIN_TEST;
-
-    mx_handle_t raw = mx_process_self();
-    ASSERT_EQ(validate_handle(raw), MX_OK);
-
-    EXPECT_TRUE(reference_thing<mx::process>(mx::process::self()));
-    EXPECT_EQ(validate_handle(raw), MX_OK);
-
-    // This does not compile:
-    //const mx::process self = mx::process::self();
-
-    END_TEST;
-}
-
-static bool vmar_root_self_test() {
-    BEGIN_TEST;
-
-    mx_handle_t raw = mx_vmar_root_self();
-    ASSERT_EQ(validate_handle(raw), MX_OK);
-
-    EXPECT_TRUE(reference_thing<mx::vmar>(mx::vmar::root_self()));
-    EXPECT_EQ(validate_handle(raw), MX_OK);
-
-    // This does not compile:
-    //const mx::vmar root_self = mx::vmar::root_self();
-
-    END_TEST;
-}
-
-static bool job_default_test() {
-    BEGIN_TEST;
-
-    mx_handle_t raw = mx_job_default();
-    ASSERT_EQ(validate_handle(raw), MX_OK);
-
-    EXPECT_TRUE(reference_thing<mx::job>(mx::job::default_job()));
-    EXPECT_EQ(validate_handle(raw), MX_OK);
-
-    // This does not compile:
-    //const mx::job default_job = mx::job::default_job();
-
-    END_TEST;
-}
-
-BEGIN_TEST_CASE(libmx_tests)
-RUN_TEST(handle_invalid_test)
-RUN_TEST(handle_close_test)
-RUN_TEST(handle_move_test)
-RUN_TEST(handle_duplicate_test)
-RUN_TEST(handle_replace_test)
-RUN_TEST(event_test)
-RUN_TEST(event_duplicate_test)
-RUN_TEST(channel_test)
-RUN_TEST(socket_test)
-RUN_TEST(eventpair_test)
-RUN_TEST(vmar_test)
-RUN_TEST(port_test)
-RUN_TEST(time_test)
-RUN_TEST(thread_self_test)
-RUN_TEST(process_self_test)
-RUN_TEST(vmar_root_self_test)
-RUN_TEST(job_default_test)
-END_TEST_CASE(libmx_tests)
-
-int main(int argc, char** argv) {
-    bool success = unittest_run_all_tests(argc, argv);
-    return success ? 0 : -1;
-}
diff --git a/system/utest/libmx/rules.mk b/system/utest/libmx/rules.mk
index 91140fe..4b5ef33 100644
--- a/system/utest/libmx/rules.mk
+++ b/system/utest/libmx/rules.mk
@@ -9,15 +9,15 @@
 MODULE_TYPE := usertest
 
 MODULE_SRCS += \
-    $(LOCAL_DIR)/mx-test.cpp \
+    $(LOCAL_DIR)/zx-test.cpp \
 
 MODULE_NAME := libmx-test
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl \
 
 MODULE_LIBS := \
-    system/ulib/mxio system/ulib/magenta system/ulib/unittest system/ulib/c
+    system/ulib/fdio system/ulib/zircon system/ulib/unittest system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/libmx/zx-test.cpp b/system/utest/libmx/zx-test.cpp
new file mode 100644
index 0000000..f2b0184
--- /dev/null
+++ b/system/utest/libmx/zx-test.cpp
@@ -0,0 +1,278 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <assert.h>
+#include <stdio.h>
+
+#include <zx/channel.h>
+#include <zx/event.h>
+#include <zx/eventpair.h>
+#include <zx/handle.h>
+#include <zx/job.h>
+#include <zx/port.h>
+#include <zx/process.h>
+#include <zx/socket.h>
+#include <zx/thread.h>
+#include <zx/time.h>
+#include <zx/vmar.h>
+
+#include <fbl/type_support.h>
+
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/syscalls/port.h>
+
+#include <unistd.h>
+#include <unittest/unittest.h>
+
+static zx_status_t validate_handle(zx_handle_t handle) {
+    return zx_object_get_info(handle, ZX_INFO_HANDLE_VALID, 0, NULL, 0u, NULL);
+}
+
+static bool handle_invalid_test() {
+    BEGIN_TEST;
+    zx::handle handle;
+    // A default constructed handle is invalid.
+    ASSERT_EQ(handle.release(), ZX_HANDLE_INVALID);
+    END_TEST;
+}
+
+static bool handle_close_test() {
+    BEGIN_TEST;
+    zx_handle_t raw_event;
+    ASSERT_EQ(zx_event_create(0u, &raw_event), ZX_OK);
+    ASSERT_EQ(validate_handle(raw_event), ZX_OK);
+    {
+        zx::handle handle(raw_event);
+    }
+    // Make sure the handle was closed.
+    ASSERT_EQ(validate_handle(raw_event), ZX_ERR_BAD_HANDLE);
+    END_TEST;
+}
+
+static bool handle_move_test() {
+    BEGIN_TEST;
+    zx::event event;
+    // Check move semantics.
+    ASSERT_EQ(zx::event::create(0u, &event), ZX_OK);
+    zx::handle handle(fbl::move(event));
+    ASSERT_EQ(event.release(), ZX_HANDLE_INVALID);
+    ASSERT_EQ(validate_handle(handle.get()), ZX_OK);
+    END_TEST;
+}
+
+static bool handle_duplicate_test() {
+    BEGIN_TEST;
+    zx_handle_t raw_event;
+    zx::handle dup;
+    ASSERT_EQ(zx_event_create(0u, &raw_event), ZX_OK);
+    zx::handle handle(raw_event);
+    ASSERT_EQ(handle.duplicate(ZX_RIGHT_SAME_RIGHTS, &dup), ZX_OK);
+    // The duplicate must be valid as well as the original.
+    ASSERT_EQ(validate_handle(dup.get()), ZX_OK);
+    ASSERT_EQ(validate_handle(raw_event), ZX_OK);
+    END_TEST;
+}
+
+static bool handle_replace_test() {
+    BEGIN_TEST;
+    zx_handle_t raw_event;
+    zx::handle rep;
+    ASSERT_EQ(zx_event_create(0u, &raw_event), ZX_OK);
+    {
+        zx::handle handle(raw_event);
+        ASSERT_EQ(handle.replace(ZX_RIGHT_SAME_RIGHTS, &rep), ZX_OK);
+        ASSERT_EQ(handle.release(), ZX_HANDLE_INVALID);
+    }
+    // The original shoould be invalid and the replacement should be valid.
+    ASSERT_EQ(validate_handle(raw_event), ZX_ERR_BAD_HANDLE);
+    ASSERT_EQ(validate_handle(rep.get()), ZX_OK);
+    END_TEST;
+}
+
+static bool event_test() {
+    BEGIN_TEST;
+    zx::event event;
+    ASSERT_EQ(zx::event::create(0u, &event), ZX_OK);
+    ASSERT_EQ(validate_handle(event.get()), ZX_OK);
+    // TODO(cpu): test more.
+    END_TEST;
+}
+
+static bool event_duplicate_test() {
+    BEGIN_TEST;
+    zx::event event;
+    zx::event dup;
+    ASSERT_EQ(zx::event::create(0u, &event), ZX_OK);
+    ASSERT_EQ(event.duplicate(ZX_RIGHT_SAME_RIGHTS, &dup), ZX_OK);
+    // The duplicate must be valid as well as the original.
+    ASSERT_EQ(validate_handle(dup.get()), ZX_OK);
+    ASSERT_EQ(validate_handle(event.get()), ZX_OK);
+    END_TEST;
+}
+
+static bool channel_test() {
+    BEGIN_TEST;
+    zx::channel channel[2];
+    ASSERT_EQ(zx::channel::create(0u, &channel[0], &channel[1]), ZX_OK);
+    ASSERT_EQ(validate_handle(channel[0].get()), ZX_OK);
+    ASSERT_EQ(validate_handle(channel[1].get()), ZX_OK);
+    // TODO(cpu): test more.
+    END_TEST;
+}
+
+static bool socket_test() {
+    BEGIN_TEST;
+    zx::socket socket[2];
+    ASSERT_EQ(zx::socket::create(0u, &socket[0], &socket[1]), ZX_OK);
+    ASSERT_EQ(validate_handle(socket[0].get()), ZX_OK);
+    ASSERT_EQ(validate_handle(socket[1].get()), ZX_OK);
+    // TODO(cpu): test more.
+    END_TEST;
+}
+
+static bool eventpair_test() {
+    BEGIN_TEST;
+    zx::eventpair evpair[2];
+    ASSERT_EQ(zx::eventpair::create(0u, &evpair[0], &evpair[1]), ZX_OK);
+    ASSERT_EQ(validate_handle(evpair[0].get()), ZX_OK);
+    ASSERT_EQ(validate_handle(evpair[1].get()), ZX_OK);
+    // TODO(cpu): test more.
+    END_TEST;
+}
+
+static bool vmar_test() {
+    BEGIN_TEST;
+    zx::vmar vmar;
+    const size_t size = getpagesize();
+    uintptr_t addr;
+    ASSERT_EQ(zx::vmar::root_self().allocate(0u, size, ZX_VM_FLAG_CAN_MAP_READ, &vmar, &addr),
+              ZX_OK);
+    ASSERT_EQ(validate_handle(vmar.get()), ZX_OK);
+    ASSERT_EQ(vmar.destroy(), ZX_OK);
+    // TODO(teisenbe): test more.
+    END_TEST;
+}
+
+static bool port_test() {
+    BEGIN_TEST;
+    zx::port port;
+    ASSERT_EQ(zx::port::create(0, &port), ZX_OK);
+    ASSERT_EQ(validate_handle(port.get()), ZX_OK);
+
+    zx::channel channel[2];
+    auto key = 1111ull;
+    ASSERT_EQ(zx::channel::create(0u, &channel[0], &channel[1]), ZX_OK);
+    ASSERT_EQ(channel[0].wait_async(
+        port, key, ZX_CHANNEL_READABLE, ZX_WAIT_ASYNC_ONCE), ZX_OK);
+    ASSERT_EQ(channel[1].write(0u, "12345", 5, nullptr, 0u), ZX_OK);
+
+    zx_port_packet_t packet = {};
+    ASSERT_EQ(port.wait(0ull, &packet, 0u), ZX_OK);
+    ASSERT_EQ(packet.key, key);
+    ASSERT_EQ(packet.type, ZX_PKT_TYPE_SIGNAL_ONE);
+    ASSERT_EQ(packet.signal.count, 1u);
+    END_TEST;
+}
+
+static bool time_test() {
+    BEGIN_TEST;
+
+    // Just a smoke test
+    ASSERT_GE(zx::deadline_after(10), 10);
+
+    END_TEST;
+}
+
+template <typename T>
+static bool reference_thing(const T& p) {
+    BEGIN_HELPER;
+    ASSERT_TRUE(static_cast<bool>(p), "invalid handle");
+    END_HELPER;
+}
+
+static bool thread_self_test() {
+    BEGIN_TEST;
+
+    zx_handle_t raw = zx_thread_self();
+    ASSERT_EQ(validate_handle(raw), ZX_OK);
+
+    EXPECT_TRUE(reference_thing<zx::thread>(zx::thread::self()));
+    EXPECT_EQ(validate_handle(raw), ZX_OK);
+
+    // This does not compile:
+    //const zx::thread self = zx::thread::self();
+
+    END_TEST;
+}
+
+static bool process_self_test() {
+    BEGIN_TEST;
+
+    zx_handle_t raw = zx_process_self();
+    ASSERT_EQ(validate_handle(raw), ZX_OK);
+
+    EXPECT_TRUE(reference_thing<zx::process>(zx::process::self()));
+    EXPECT_EQ(validate_handle(raw), ZX_OK);
+
+    // This does not compile:
+    //const zx::process self = zx::process::self();
+
+    END_TEST;
+}
+
+static bool vmar_root_self_test() {
+    BEGIN_TEST;
+
+    zx_handle_t raw = zx_vmar_root_self();
+    ASSERT_EQ(validate_handle(raw), ZX_OK);
+
+    EXPECT_TRUE(reference_thing<zx::vmar>(zx::vmar::root_self()));
+    EXPECT_EQ(validate_handle(raw), ZX_OK);
+
+    // This does not compile:
+    //const zx::vmar root_self = zx::vmar::root_self();
+
+    END_TEST;
+}
+
+static bool job_default_test() {
+    BEGIN_TEST;
+
+    zx_handle_t raw = zx_job_default();
+    ASSERT_EQ(validate_handle(raw), ZX_OK);
+
+    EXPECT_TRUE(reference_thing<zx::job>(zx::job::default_job()));
+    EXPECT_EQ(validate_handle(raw), ZX_OK);
+
+    // This does not compile:
+    //const zx::job default_job = zx::job::default_job();
+
+    END_TEST;
+}
+
+BEGIN_TEST_CASE(libmx_tests)
+RUN_TEST(handle_invalid_test)
+RUN_TEST(handle_close_test)
+RUN_TEST(handle_move_test)
+RUN_TEST(handle_duplicate_test)
+RUN_TEST(handle_replace_test)
+RUN_TEST(event_test)
+RUN_TEST(event_duplicate_test)
+RUN_TEST(channel_test)
+RUN_TEST(socket_test)
+RUN_TEST(eventpair_test)
+RUN_TEST(vmar_test)
+RUN_TEST(port_test)
+RUN_TEST(time_test)
+RUN_TEST(thread_self_test)
+RUN_TEST(process_self_test)
+RUN_TEST(vmar_root_self_test)
+RUN_TEST(job_default_test)
+END_TEST_CASE(libmx_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/system/utest/mdi/mditest.c b/system/utest/mdi/mditest.c
index b4efbab..6167014 100644
--- a/system/utest/mdi/mditest.c
+++ b/system/utest/mdi/mditest.c
@@ -11,9 +11,9 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include <magenta/boot/bootdata.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <zircon/boot/bootdata.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 #include <mdi/mdi.h>
 #include <unittest/unittest.h>
 
diff --git a/system/utest/mdi/rules.mk b/system/utest/mdi/rules.mk
index 3460e70..5c3ee79 100644
--- a/system/utest/mdi/rules.mk
+++ b/system/utest/mdi/rules.mk
@@ -13,7 +13,7 @@
 
 MODULE_NAME := mdi-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mdi system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/mdi system/ulib/fdio system/ulib/c
 
 # for including MDI_HEADER
 MODULE_COMPILEFLAGS := -I$(BUILDDIR)/utest/mdi
diff --git a/system/utest/msd/msd.c b/system/utest/msd/msd.c
index 7d15034..ab09c74 100644
--- a/system/utest/msd/msd.c
+++ b/system/utest/msd/msd.c
@@ -9,7 +9,7 @@
 #include <string.h>
 
 
-#include <mxio/io.h>
+#include <fdio/io.h>
 
 // change this number to change how many bytes are being written/read
 #define TEST_LEN 1024
diff --git a/system/utest/msd/rules.mk b/system/utest/msd/rules.mk
index 735b84e..4e7bc2d 100644
--- a/system/utest/msd/rules.mk
+++ b/system/utest/msd/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_NAME := msd-test
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/namespace/namespace-test.c b/system/utest/namespace/namespace-test.c
index 87b1135..50bba40 100644
--- a/system/utest/namespace/namespace-test.c
+++ b/system/utest/namespace/namespace-test.c
@@ -12,9 +12,9 @@
 #include <unistd.h>
 
 #include <launchpad/launchpad.h>
-#include <mxio/namespace.h>
-#include <magenta/compiler.h>
-#include <magenta/syscalls.h>
+#include <fdio/namespace.h>
+#include <zircon/compiler.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 typedef struct {
@@ -38,15 +38,15 @@
     ASSERT_TRUE(mkdir("/tmp/fake-namespace-test-tmp", 066) == 0 || errno == EEXIST, "");
 
     // Create new ns
-    mxio_ns_t* ns;
-    ASSERT_EQ(mxio_ns_create(&ns), MX_OK, "");
+    fdio_ns_t* ns;
+    ASSERT_EQ(fdio_ns_create(&ns), ZX_OK, "");
     for (unsigned n = 0; n < countof(NS); n++) {
         int fd = open(NS[n].remote, O_RDONLY | O_DIRECTORY);
         ASSERT_GT(fd, 0, "");
-        ASSERT_EQ(mxio_ns_bind_fd(ns, NS[n].local, fd), MX_OK, "");
+        ASSERT_EQ(fdio_ns_bind_fd(ns, NS[n].local, fd), ZX_OK, "");
         ASSERT_EQ(close(fd), 0, "");
     }
-    ASSERT_EQ(mxio_ns_chdir(ns), MX_OK, "");
+    ASSERT_EQ(fdio_ns_chdir(ns), ZX_OK, "");
 
     DIR* dir;
     struct dirent* de;
diff --git a/system/utest/namespace/rules.mk b/system/utest/namespace/rules.mk
index bd93759..6b7d5b0 100644
--- a/system/utest/namespace/rules.mk
+++ b/system/utest/namespace/rules.mk
@@ -14,8 +14,8 @@
 
 MODULE_LIBS := \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c \
     system/ulib/unittest \
 
diff --git a/system/utest/policy/job-policy.cpp b/system/utest/policy/job-policy.cpp
index b97caec..cbbf1d7 100644
--- a/system/utest/policy/job-policy.cpp
+++ b/system/utest/policy/job-policy.cpp
@@ -6,23 +6,23 @@
 #include <stdio.h>
 #include <threads.h>
 
-#include <mx/channel.h>
-#include <mx/event.h>
-#include <mx/handle.h>
-#include <mx/job.h>
-#include <mx/port.h>
-#include <mx/process.h>
-#include <mx/thread.h>
-#include <mx/vmar.h>
+#include <zx/channel.h>
+#include <zx/event.h>
+#include <zx/handle.h>
+#include <zx/job.h>
+#include <zx/port.h>
+#include <zx/process.h>
+#include <zx/thread.h>
+#include <zx/vmar.h>
 
 #include <fbl/algorithm.h>
 #include <fbl/type_support.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls/debug.h>
-#include <magenta/syscalls/exception.h>
-#include <magenta/syscalls/policy.h>
-#include <magenta/syscalls/port.h>
+#include <zircon/process.h>
+#include <zircon/syscalls/debug.h>
+#include <zircon/syscalls/exception.h>
+#include <zircon/syscalls/policy.h>
+#include <zircon/syscalls/port.h>
 
 #include <mini-process/mini-process.h>
 
@@ -32,40 +32,40 @@
 static const unsigned kExceptionPortKey = 42u;
 
 // Basic job operation is tested by core-tests.
-static mx::job make_job() {
-    mx::job job;
-    if (mx::job::create(mx_job_default(), 0u, &job) != MX_OK)
-        return mx::job();
+static zx::job make_job() {
+    zx::job job;
+    if (zx::job::create(zx_job_default(), 0u, &job) != ZX_OK)
+        return zx::job();
     return job;
 }
 
-static mx::process make_test_process(const mx::job& job, mx::thread* out_thread,
-                                     mx_handle_t* ctrl) {
-    mx::vmar vmar;
-    mx::process proc;
-    mx_status_t status = mx::process::create(job, "poltst", 6u, 0u, &proc, &vmar);
-    if (status != MX_OK)
-        return mx::process();
+static zx::process make_test_process(const zx::job& job, zx::thread* out_thread,
+                                     zx_handle_t* ctrl) {
+    zx::vmar vmar;
+    zx::process proc;
+    zx_status_t status = zx::process::create(job, "poltst", 6u, 0u, &proc, &vmar);
+    if (status != ZX_OK)
+        return zx::process();
 
-    mx::thread thread;
-    status = mx::thread::create(proc, "poltst", 6u, 0, &thread);
-    if (status != MX_OK)
-        return mx::process();
+    zx::thread thread;
+    status = zx::thread::create(proc, "poltst", 6u, 0, &thread);
+    if (status != ZX_OK)
+        return zx::process();
     if (out_thread) {
-        status = thread.duplicate(MX_RIGHT_SAME_RIGHTS, out_thread);
-        if (status != MX_OK)
-            return mx::process();
+        status = thread.duplicate(ZX_RIGHT_SAME_RIGHTS, out_thread);
+        if (status != ZX_OK)
+            return zx::process();
     }
 
-    mx::event event;
-    status = mx::event::create(0u, &event);
-    if (status != MX_OK)
-        return mx::process();
+    zx::event event;
+    status = zx::event::create(0u, &event);
+    if (status != ZX_OK)
+        return zx::process();
 
     auto thr = thread.release();
     status = start_mini_process_etc(proc.get(), thr, vmar.get(), event.release(), ctrl);
-    if (status != MX_OK)
-        return mx::process();
+    if (status != ZX_OK)
+        return zx::process();
 
     return proc;
 }
@@ -73,36 +73,36 @@
 static bool abs_then_rel() {
     BEGIN_TEST;
 
-    mx_policy_basic_t policy[] = {
-        { MX_POL_BAD_HANDLE, MX_POL_ACTION_KILL } };
+    zx_policy_basic_t policy[] = {
+        { ZX_POL_BAD_HANDLE, ZX_POL_ACTION_KILL } };
 
     auto job = make_job();
     EXPECT_EQ(job.set_policy(
-        MX_JOB_POL_ABSOLUTE, MX_JOB_POL_BASIC, policy, fbl::count_of(policy)), MX_OK);
+        ZX_JOB_POL_ABSOLUTE, ZX_JOB_POL_BASIC, policy, fbl::count_of(policy)), ZX_OK);
 
     // A contradictory policy should fail.
-    policy[0].policy = MX_POL_ACTION_EXCEPTION | MX_POL_ACTION_DENY;
+    policy[0].policy = ZX_POL_ACTION_EXCEPTION | ZX_POL_ACTION_DENY;
     EXPECT_EQ(job.set_policy(
-        MX_JOB_POL_ABSOLUTE, MX_JOB_POL_BASIC, policy, fbl::count_of(policy)), MX_ERR_ALREADY_EXISTS);
+        ZX_JOB_POL_ABSOLUTE, ZX_JOB_POL_BASIC, policy, fbl::count_of(policy)), ZX_ERR_ALREADY_EXISTS);
 
     // The same again will succeed.
-    policy[0].policy = MX_POL_ACTION_KILL;
+    policy[0].policy = ZX_POL_ACTION_KILL;
     EXPECT_EQ(job.set_policy(
-        MX_JOB_POL_ABSOLUTE, MX_JOB_POL_BASIC, policy, fbl::count_of(policy)), MX_OK);
+        ZX_JOB_POL_ABSOLUTE, ZX_JOB_POL_BASIC, policy, fbl::count_of(policy)), ZX_OK);
 
     // A contradictory relative policy will succeed, but is a no-op
-    policy[0].policy = MX_POL_ACTION_ALLOW;
+    policy[0].policy = ZX_POL_ACTION_ALLOW;
     EXPECT_EQ(job.set_policy(
-        MX_JOB_POL_RELATIVE, MX_JOB_POL_BASIC, policy, fbl::count_of(policy)), MX_OK);
+        ZX_JOB_POL_RELATIVE, ZX_JOB_POL_BASIC, policy, fbl::count_of(policy)), ZX_OK);
 
-    mx_policy_basic_t more[] = {
-        { MX_POL_NEW_CHANNEL, MX_POL_ACTION_ALLOW | MX_POL_ACTION_EXCEPTION },
-        { MX_POL_NEW_FIFO, MX_POL_ACTION_DENY } };
+    zx_policy_basic_t more[] = {
+        { ZX_POL_NEW_CHANNEL, ZX_POL_ACTION_ALLOW | ZX_POL_ACTION_EXCEPTION },
+        { ZX_POL_NEW_FIFO, ZX_POL_ACTION_DENY } };
 
     // An additional absolute policy that doesn't contradict existing
     // policy can be added.
     EXPECT_EQ(job.set_policy(
-        MX_JOB_POL_ABSOLUTE, MX_JOB_POL_BASIC, more, fbl::count_of(more)), MX_OK);
+        ZX_JOB_POL_ABSOLUTE, ZX_JOB_POL_BASIC, more, fbl::count_of(more)), ZX_OK);
 
     END_TEST;
 }
@@ -110,36 +110,36 @@
 static bool invalid_calls(uint32_t options) {
     auto job = make_job();
 
-    EXPECT_EQ(job.set_policy(options, MX_JOB_POL_BASIC, nullptr, 0u), MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(job.set_policy(options, ZX_JOB_POL_BASIC, nullptr, 0u), ZX_ERR_INVALID_ARGS);
 
-    EXPECT_EQ(job.set_policy(options, MX_JOB_POL_BASIC, nullptr, 5u), MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(job.set_policy(options, ZX_JOB_POL_BASIC, nullptr, 5u), ZX_ERR_INVALID_ARGS);
 
-    mx_policy_basic_t policy1[] = {
-        { MX_POL_BAD_HANDLE, MX_POL_ACTION_KILL },
+    zx_policy_basic_t policy1[] = {
+        { ZX_POL_BAD_HANDLE, ZX_POL_ACTION_KILL },
     };
 
-    EXPECT_EQ(job.set_policy(options, MX_JOB_POL_BASIC, policy1, 0u), MX_ERR_INVALID_ARGS);
+    EXPECT_EQ(job.set_policy(options, ZX_JOB_POL_BASIC, policy1, 0u), ZX_ERR_INVALID_ARGS);
 
-    mx_policy_basic_t policy2[] = {
-        { 100001u, MX_POL_ACTION_KILL },
+    zx_policy_basic_t policy2[] = {
+        { 100001u, ZX_POL_ACTION_KILL },
     };
 
     EXPECT_EQ(job.set_policy(
-        options, MX_JOB_POL_BASIC, policy2, fbl::count_of(policy2)), MX_ERR_INVALID_ARGS);
+        options, ZX_JOB_POL_BASIC, policy2, fbl::count_of(policy2)), ZX_ERR_INVALID_ARGS);
 
-    mx_policy_basic_t policy3[] = {
-        { MX_POL_BAD_HANDLE, 100001u },
+    zx_policy_basic_t policy3[] = {
+        { ZX_POL_BAD_HANDLE, 100001u },
     };
 
     EXPECT_EQ(job.set_policy(
-        options, MX_JOB_POL_BASIC, policy3, fbl::count_of(policy2)), MX_ERR_NOT_SUPPORTED);
+        options, ZX_JOB_POL_BASIC, policy3, fbl::count_of(policy2)), ZX_ERR_NOT_SUPPORTED);
 
     // The job will still accept a valid combination:
-    mx_policy_basic_t policy4[] = {
-        { MX_POL_BAD_HANDLE, MX_POL_ACTION_KILL } };
+    zx_policy_basic_t policy4[] = {
+        { ZX_POL_BAD_HANDLE, ZX_POL_ACTION_KILL } };
 
     EXPECT_EQ(job.set_policy(
-        options, MX_JOB_POL_BASIC, policy4, fbl::count_of(policy4)), MX_OK);
+        options, ZX_JOB_POL_BASIC, policy4, fbl::count_of(policy4)), ZX_OK);
 
     return true;
 }
@@ -147,7 +147,7 @@
 static bool invalid_calls_abs() {
     BEGIN_TEST;
 
-    invalid_calls(MX_JOB_POL_ABSOLUTE);
+    invalid_calls(ZX_JOB_POL_ABSOLUTE);
 
     END_TEST;
 }
@@ -155,7 +155,7 @@
 static bool invalid_calls_rel() {
     BEGIN_TEST;
 
-    invalid_calls(MX_JOB_POL_RELATIVE);
+    invalid_calls(ZX_JOB_POL_RELATIVE);
 
     END_TEST;
 }
@@ -163,29 +163,29 @@
 // Test that executing the given mini-process.h command (|minip_cmd|)
 // produces the given result (|expect|) when the given policy is in force.
 static bool test_invoking_policy(
-    mx_policy_basic_t* pol, uint32_t pol_count, uint32_t minip_cmd, mx_status_t expect) {
+    zx_policy_basic_t* pol, uint32_t pol_count, uint32_t minip_cmd, zx_status_t expect) {
     auto job = make_job();
-    ASSERT_EQ(job.set_policy(MX_JOB_POL_ABSOLUTE, MX_JOB_POL_BASIC, pol, pol_count), MX_OK);
+    ASSERT_EQ(job.set_policy(ZX_JOB_POL_ABSOLUTE, ZX_JOB_POL_BASIC, pol, pol_count), ZX_OK);
 
-    mx_handle_t ctrl;
+    zx_handle_t ctrl;
     auto proc = make_test_process(job, nullptr, &ctrl);
     ASSERT_TRUE(proc.is_valid());
-    ASSERT_NE(ctrl, MX_HANDLE_INVALID);
+    ASSERT_NE(ctrl, ZX_HANDLE_INVALID);
 
-    mx_handle_t obj;
+    zx_handle_t obj;
     EXPECT_EQ(mini_process_cmd(ctrl, minip_cmd, &obj), expect);
-    EXPECT_EQ(mini_process_cmd(ctrl, MINIP_CMD_EXIT_NORMAL, nullptr), MX_ERR_PEER_CLOSED);
+    EXPECT_EQ(mini_process_cmd(ctrl, MINIP_CMD_EXIT_NORMAL, nullptr), ZX_ERR_PEER_CLOSED);
 
-    mx_handle_close(ctrl);
+    zx_handle_close(ctrl);
     return true;
 }
 
 static bool enforce_deny_event() {
     BEGIN_TEST;
 
-    mx_policy_basic_t policy[] = { { MX_POL_NEW_EVENT, MX_POL_ACTION_DENY } };
+    zx_policy_basic_t policy[] = { { ZX_POL_NEW_EVENT, ZX_POL_ACTION_DENY } };
     test_invoking_policy(policy, fbl::count_of(policy), MINIP_CMD_CREATE_EVENT,
-                         MX_ERR_ACCESS_DENIED);
+                         ZX_ERR_ACCESS_DENIED);
 
     END_TEST;
 }
@@ -193,9 +193,9 @@
 static bool enforce_deny_channel() {
     BEGIN_TEST;
 
-    mx_policy_basic_t policy[] = { { MX_POL_NEW_CHANNEL, MX_POL_ACTION_DENY } };
+    zx_policy_basic_t policy[] = { { ZX_POL_NEW_CHANNEL, ZX_POL_ACTION_DENY } };
     test_invoking_policy(policy, fbl::count_of(policy), MINIP_CMD_CREATE_CHANNEL,
-                         MX_ERR_ACCESS_DENIED);
+                         ZX_ERR_ACCESS_DENIED);
 
     END_TEST;
 }
@@ -203,9 +203,9 @@
 static bool enforce_deny_any() {
     BEGIN_TEST;
 
-    mx_policy_basic_t policy[] = { { MX_POL_NEW_ANY, MX_POL_ACTION_DENY } };
+    zx_policy_basic_t policy[] = { { ZX_POL_NEW_ANY, ZX_POL_ACTION_DENY } };
     test_invoking_policy(policy, fbl::count_of(policy), MINIP_CMD_CREATE_EVENT,
-                         MX_ERR_ACCESS_DENIED);
+                         ZX_ERR_ACCESS_DENIED);
 
     END_TEST;
 }
@@ -213,9 +213,9 @@
 static bool enforce_allow_any() {
     BEGIN_TEST;
 
-    mx_policy_basic_t policy[] = { { MX_POL_NEW_ANY, MX_POL_ACTION_ALLOW } };
+    zx_policy_basic_t policy[] = { { ZX_POL_NEW_ANY, ZX_POL_ACTION_ALLOW } };
     test_invoking_policy(policy, fbl::count_of(policy), MINIP_CMD_CREATE_EVENT,
-                         MX_OK);
+                         ZX_OK);
 
     END_TEST;
 }
@@ -223,40 +223,40 @@
 static bool enforce_deny_but_event() {
     BEGIN_TEST;
 
-    mx_policy_basic_t policy[] = {
-        { MX_POL_NEW_ANY, MX_POL_ACTION_DENY },
-        { MX_POL_NEW_EVENT, MX_POL_ACTION_ALLOW }
+    zx_policy_basic_t policy[] = {
+        { ZX_POL_NEW_ANY, ZX_POL_ACTION_DENY },
+        { ZX_POL_NEW_EVENT, ZX_POL_ACTION_ALLOW }
     };
     test_invoking_policy(policy, fbl::count_of(policy), MINIP_CMD_CREATE_EVENT,
-                         MX_OK);
+                         ZX_OK);
     test_invoking_policy(policy, fbl::count_of(policy), MINIP_CMD_CREATE_CHANNEL,
-                         MX_ERR_ACCESS_DENIED);
+                         ZX_ERR_ACCESS_DENIED);
 
     END_TEST;
 }
 
-static bool get_koid(mx_handle_t handle, mx_koid_t* koid) {
-    mx_info_handle_basic_t info;
-    ASSERT_EQ(mx_object_get_info(
-                  handle, MX_INFO_HANDLE_BASIC, &info, sizeof(info),
-                  nullptr, nullptr), MX_OK);
+static bool get_koid(zx_handle_t handle, zx_koid_t* koid) {
+    zx_info_handle_basic_t info;
+    ASSERT_EQ(zx_object_get_info(
+                  handle, ZX_INFO_HANDLE_BASIC, &info, sizeof(info),
+                  nullptr, nullptr), ZX_OK);
     *koid = info.koid;
     return true;
 }
 
 #if defined(__x86_64__)
 
-typedef struct mx_x86_64_general_regs mx_general_regs_t;
+typedef struct zx_x86_64_general_regs zx_general_regs_t;
 
-static uint64_t get_syscall_result(mx_general_regs_t* regs) {
+static uint64_t get_syscall_result(zx_general_regs_t* regs) {
     return regs->rax;
 }
 
 #elif defined(__aarch64__)
 
-typedef struct mx_arm64_general_regs mx_general_regs_t;
+typedef struct zx_arm64_general_regs zx_general_regs_t;
 
-static uint64_t get_syscall_result(mx_general_regs_t* regs) {
+static uint64_t get_syscall_result(zx_general_regs_t* regs) {
     return regs->r[0];
 }
 
@@ -269,54 +269,54 @@
 // is in force.  In addition, it tests that a debug port exception gets
 // generated.
 static bool test_invoking_policy_with_exception(
-    mx_policy_basic_t* policy, uint32_t policy_count, uint32_t minip_cmd,
-    mx_status_t expected_syscall_result) {
+    zx_policy_basic_t* policy, uint32_t policy_count, uint32_t minip_cmd,
+    zx_status_t expected_syscall_result) {
     auto job = make_job();
-    ASSERT_EQ(job.set_policy(MX_JOB_POL_ABSOLUTE, MX_JOB_POL_BASIC, policy,
-                             policy_count), MX_OK);
+    ASSERT_EQ(job.set_policy(ZX_JOB_POL_ABSOLUTE, ZX_JOB_POL_BASIC, policy,
+                             policy_count), ZX_OK);
 
-    mx_handle_t ctrl;
-    mx::thread thread;
+    zx_handle_t ctrl;
+    zx::thread thread;
     auto proc = make_test_process(job, &thread, &ctrl);
     ASSERT_TRUE(proc.is_valid());
-    ASSERT_NE(ctrl, MX_HANDLE_INVALID);
+    ASSERT_NE(ctrl, ZX_HANDLE_INVALID);
 
-    mx_handle_t exc_port;
-    ASSERT_EQ(mx_port_create(0, &exc_port), MX_OK);
-    ASSERT_EQ(mx_task_bind_exception_port(
+    zx_handle_t exc_port;
+    ASSERT_EQ(zx_port_create(0, &exc_port), ZX_OK);
+    ASSERT_EQ(zx_task_bind_exception_port(
                   proc.get(), exc_port, kExceptionPortKey,
-                  MX_EXCEPTION_PORT_DEBUGGER),
-              MX_OK);
+                  ZX_EXCEPTION_PORT_DEBUGGER),
+              ZX_OK);
 
-    EXPECT_EQ(mini_process_cmd_send(ctrl, minip_cmd), MX_OK);
+    EXPECT_EQ(mini_process_cmd_send(ctrl, minip_cmd), ZX_OK);
 
     // Check that the subprocess did not return a reply yet (indicating
     // that it was suspended).
-    EXPECT_EQ(mx_object_wait_one(ctrl, MX_CHANNEL_READABLE,
-                                 mx_deadline_after(MX_MSEC(1)), nullptr),
-              MX_ERR_TIMED_OUT);
+    EXPECT_EQ(zx_object_wait_one(ctrl, ZX_CHANNEL_READABLE,
+                                 zx_deadline_after(ZX_MSEC(1)), nullptr),
+              ZX_ERR_TIMED_OUT);
 
     // Check that we receive an exception message.
-    mx_port_packet_t packet;
-    ASSERT_EQ(mx_port_wait(exc_port, MX_TIME_INFINITE, &packet, 0), MX_OK);
+    zx_port_packet_t packet;
+    ASSERT_EQ(zx_port_wait(exc_port, ZX_TIME_INFINITE, &packet, 0), ZX_OK);
 
     // Check the exception message contents.
     ASSERT_EQ(packet.key, kExceptionPortKey);
-    ASSERT_EQ(packet.type, (uint32_t)MX_EXCP_POLICY_ERROR);
+    ASSERT_EQ(packet.type, (uint32_t)ZX_EXCP_POLICY_ERROR);
 
-    mx_koid_t pid;
-    mx_koid_t tid;
+    zx_koid_t pid;
+    zx_koid_t tid;
     ASSERT_TRUE(get_koid(proc.get(), &pid));
     ASSERT_TRUE(get_koid(thread.get(), &tid));
     ASSERT_EQ(packet.exception.pid, pid);
     ASSERT_EQ(packet.exception.tid, tid);
 
     // Check that we can read the thread's register state.
-    mx_general_regs_t regs;
+    zx_general_regs_t regs;
     uint32_t size_read;
-    ASSERT_EQ(mx_thread_read_state(thread.get(), MX_THREAD_STATE_REGSET0,
+    ASSERT_EQ(zx_thread_read_state(thread.get(), ZX_THREAD_STATE_REGSET0,
                                    &regs, sizeof(regs), &size_read),
-              MX_OK);
+              ZX_OK);
     ASSERT_EQ(size_read, sizeof(regs));
     ASSERT_EQ(get_syscall_result(&regs), (uint64_t)expected_syscall_result);
     // TODO(mseaborn): Check the values of other registers.  We could check
@@ -325,25 +325,25 @@
     // using crashlogger gives a correct backtrace.
 
     // Resume the thread.
-    ASSERT_EQ(mx_task_resume(thread.get(), MX_RESUME_EXCEPTION), MX_OK);
+    ASSERT_EQ(zx_task_resume(thread.get(), ZX_RESUME_EXCEPTION), ZX_OK);
     // Check that the read-ready state of the channel changed compared with
     // the earlier check.
-    EXPECT_EQ(mx_object_wait_one(ctrl, MX_CHANNEL_READABLE, MX_TIME_INFINITE,
+    EXPECT_EQ(zx_object_wait_one(ctrl, ZX_CHANNEL_READABLE, ZX_TIME_INFINITE,
                                  nullptr),
-              MX_OK);
+              ZX_OK);
 
     // Check that we receive a reply message from the resumed thread.
-    mx_handle_t obj;
+    zx_handle_t obj;
     EXPECT_EQ(mini_process_cmd_read_reply(ctrl, &obj),
               expected_syscall_result);
-    if (expected_syscall_result == MX_OK)
-        EXPECT_EQ(mx_handle_close(obj), MX_OK);
+    if (expected_syscall_result == ZX_OK)
+        EXPECT_EQ(zx_handle_close(obj), ZX_OK);
 
     // Clean up: Tell the subprocess to exit.
     EXPECT_EQ(mini_process_cmd(ctrl, MINIP_CMD_EXIT_NORMAL, nullptr),
-              MX_ERR_PEER_CLOSED);
+              ZX_ERR_PEER_CLOSED);
 
-    mx_handle_close(ctrl);
+    zx_handle_close(ctrl);
 
     return true;
 }
@@ -351,11 +351,11 @@
 static bool test_exception_on_new_event_and_deny() {
     BEGIN_TEST;
 
-    mx_policy_basic_t policy[] = {
-        { MX_POL_NEW_EVENT, MX_POL_ACTION_DENY | MX_POL_ACTION_EXCEPTION },
+    zx_policy_basic_t policy[] = {
+        { ZX_POL_NEW_EVENT, ZX_POL_ACTION_DENY | ZX_POL_ACTION_EXCEPTION },
     };
     test_invoking_policy_with_exception(
-        policy, fbl::count_of(policy), MINIP_CMD_CREATE_EVENT, MX_ERR_ACCESS_DENIED);
+        policy, fbl::count_of(policy), MINIP_CMD_CREATE_EVENT, ZX_ERR_ACCESS_DENIED);
 
     END_TEST;
 }
@@ -363,54 +363,54 @@
 static bool test_exception_on_new_event_but_allow() {
     BEGIN_TEST;
 
-    mx_policy_basic_t policy[] = {
-        { MX_POL_NEW_EVENT, MX_POL_ACTION_ALLOW | MX_POL_ACTION_EXCEPTION },
+    zx_policy_basic_t policy[] = {
+        { ZX_POL_NEW_EVENT, ZX_POL_ACTION_ALLOW | ZX_POL_ACTION_EXCEPTION },
     };
     test_invoking_policy_with_exception(
-        policy, fbl::count_of(policy), MINIP_CMD_CREATE_EVENT, MX_OK);
+        policy, fbl::count_of(policy), MINIP_CMD_CREATE_EVENT, ZX_OK);
 
     END_TEST;
 }
 
-// Test MX_POL_BAD_HANDLE when syscalls are allowed to continue.
+// Test ZX_POL_BAD_HANDLE when syscalls are allowed to continue.
 static bool test_error_on_bad_handle() {
     BEGIN_TEST;
 
-    // The ALLOW and DENY actions should be equivalent for MX_POL_BAD_HANDLE.
-    uint32_t actions[] = { MX_POL_ACTION_ALLOW, MX_POL_ACTION_DENY };
+    // The ALLOW and DENY actions should be equivalent for ZX_POL_BAD_HANDLE.
+    uint32_t actions[] = { ZX_POL_ACTION_ALLOW, ZX_POL_ACTION_DENY };
     for (uint32_t action : actions) {
         unittest_printf_critical("Testing action=%d\n", action);
-        mx_policy_basic_t policy[] = {
-            { MX_POL_BAD_HANDLE, action },
+        zx_policy_basic_t policy[] = {
+            { ZX_POL_BAD_HANDLE, action },
         };
         test_invoking_policy(
             policy, fbl::count_of(policy), MINIP_CMD_USE_BAD_HANDLE_CLOSED,
-            MX_ERR_BAD_HANDLE);
+            ZX_ERR_BAD_HANDLE);
         test_invoking_policy(
             policy, fbl::count_of(policy), MINIP_CMD_USE_BAD_HANDLE_TRANSFERRED,
-            MX_ERR_BAD_HANDLE);
+            ZX_ERR_BAD_HANDLE);
     }
 
     END_TEST;
 }
 
-// Test MX_POL_BAD_HANDLE with MX_POL_ACTION_EXCEPTION.
+// Test ZX_POL_BAD_HANDLE with ZX_POL_ACTION_EXCEPTION.
 static bool test_exception_on_bad_handle() {
     BEGIN_TEST;
 
-    // The ALLOW and DENY actions should be equivalent for MX_POL_BAD_HANDLE.
-    uint32_t actions[] = { MX_POL_ACTION_ALLOW, MX_POL_ACTION_DENY };
+    // The ALLOW and DENY actions should be equivalent for ZX_POL_BAD_HANDLE.
+    uint32_t actions[] = { ZX_POL_ACTION_ALLOW, ZX_POL_ACTION_DENY };
     for (uint32_t action : actions) {
         unittest_printf_critical("Testing action=%d\n", action);
-        mx_policy_basic_t policy[] = {
-            { MX_POL_BAD_HANDLE, action | MX_POL_ACTION_EXCEPTION },
+        zx_policy_basic_t policy[] = {
+            { ZX_POL_BAD_HANDLE, action | ZX_POL_ACTION_EXCEPTION },
         };
         test_invoking_policy_with_exception(
             policy, fbl::count_of(policy), MINIP_CMD_USE_BAD_HANDLE_CLOSED,
-            MX_ERR_BAD_HANDLE);
+            ZX_ERR_BAD_HANDLE);
         test_invoking_policy_with_exception(
             policy, fbl::count_of(policy), MINIP_CMD_USE_BAD_HANDLE_TRANSFERRED,
-            MX_ERR_BAD_HANDLE);
+            ZX_ERR_BAD_HANDLE);
     }
 
     END_TEST;
diff --git a/system/utest/policy/rules.mk b/system/utest/policy/rules.mk
index 2f49aab..a6a38d6 100644
--- a/system/utest/policy/rules.mk
+++ b/system/utest/policy/rules.mk
@@ -14,12 +14,12 @@
 MODULE_NAME := policy-test
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl \
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/unittest \
     system/ulib/c \
     system/ulib/mini-process \
diff --git a/system/utest/posixio/README.md b/system/utest/posixio/README.md
index ff46b0e..536bb26 100644
--- a/system/utest/posixio/README.md
+++ b/system/utest/posixio/README.md
@@ -1,7 +1,7 @@
 # POSIX IO Tests
 
 This directory contains API coverage tests of POSIX IO. This is
-loosely defined as the set of functions that mxio implements. The goal
+loosely defined as the set of functions that fdio implements. The goal
 is to test the error cases of each of these functions. It is not a
 test of the underlying RIO transport or backing filesystems.
 
diff --git a/system/utest/posixio/rules.mk b/system/utest/posixio/rules.mk
index d1f12a1..157df20 100644
--- a/system/utest/posixio/rules.mk
+++ b/system/utest/posixio/rules.mk
@@ -14,9 +14,9 @@
 MODULE_NAME := posixio-test
 
 MODULE_LIBS := \
-    system/ulib/magenta \
+    system/ulib/zircon \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/processor/processor.c b/system/utest/processor/processor.c
index 226f201..2b3f006 100644
--- a/system/utest/processor/processor.c
+++ b/system/utest/processor/processor.c
@@ -4,7 +4,7 @@
 
 #include <assert.h>
 #include <errno.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 #include <pthread.h>
 #include <stdio.h>
diff --git a/system/utest/processor/rules.mk b/system/utest/processor/rules.mk
index 91f3521..54afac7 100644
--- a/system/utest/processor/rules.mk
+++ b/system/utest/processor/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := processor-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/property/property.c b/system/utest/property/property.c
index 4cb2cd1..d976973 100644
--- a/system/utest/property/property.c
+++ b/system/utest/property/property.c
@@ -9,68 +9,68 @@
 #include <string.h>
 #include <threads.h>
 
-#include <magenta/compiler.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
-#include <magenta/threads.h>
-#include <mxio/util.h>
+#include <zircon/compiler.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+#include <zircon/threads.h>
+#include <fdio/util.h>
 #include <test-utils/test-utils.h>
 #include <unittest/unittest.h>
 
-static bool get_rights(mx_handle_t handle, mx_rights_t* rights) {
-    mx_info_handle_basic_t info;
-    ASSERT_EQ(mx_object_get_info(handle, MX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL), MX_OK, "");
+static bool get_rights(zx_handle_t handle, zx_rights_t* rights) {
+    zx_info_handle_basic_t info;
+    ASSERT_EQ(zx_object_get_info(handle, ZX_INFO_HANDLE_BASIC, &info, sizeof(info), NULL, NULL), ZX_OK, "");
     *rights = info.rights;
     return true;
 }
 
-static bool get_new_rights(mx_handle_t handle, mx_rights_t new_rights, mx_handle_t* new_handle) {
-    ASSERT_EQ(mx_handle_duplicate(handle, new_rights, new_handle), MX_OK, "");
+static bool get_new_rights(zx_handle_t handle, zx_rights_t new_rights, zx_handle_t* new_handle) {
+    ASSERT_EQ(zx_handle_duplicate(handle, new_rights, new_handle), ZX_OK, "");
     return true;
 }
 
-// |object| must have MX_RIGHT_{GET,SET}_PROPERTY.
+// |object| must have ZX_RIGHT_{GET,SET}_PROPERTY.
 
-static bool test_name_property(mx_handle_t object) {
-    char set_name[MX_MAX_NAME_LEN];
-    char get_name[MX_MAX_NAME_LEN];
+static bool test_name_property(zx_handle_t object) {
+    char set_name[ZX_MAX_NAME_LEN];
+    char get_name[ZX_MAX_NAME_LEN];
 
     // empty name
     strcpy(set_name, "");
-    EXPECT_EQ(mx_object_set_property(object, MX_PROP_NAME,
+    EXPECT_EQ(zx_object_set_property(object, ZX_PROP_NAME,
                                      set_name, strlen(set_name)),
-              MX_OK, "");
-    EXPECT_EQ(mx_object_get_property(object, MX_PROP_NAME,
+              ZX_OK, "");
+    EXPECT_EQ(zx_object_get_property(object, ZX_PROP_NAME,
                                      get_name, sizeof(get_name)),
-              MX_OK, "");
+              ZX_OK, "");
     EXPECT_EQ(strcmp(get_name, set_name), 0, "");
 
     // largest possible name
     memset(set_name, 'x', sizeof(set_name) - 1);
     set_name[sizeof(set_name) - 1] = '\0';
-    EXPECT_EQ(mx_object_set_property(object, MX_PROP_NAME,
+    EXPECT_EQ(zx_object_set_property(object, ZX_PROP_NAME,
                                      set_name, strlen(set_name)),
-              MX_OK, "");
-    EXPECT_EQ(mx_object_get_property(object, MX_PROP_NAME,
+              ZX_OK, "");
+    EXPECT_EQ(zx_object_get_property(object, ZX_PROP_NAME,
                                      get_name, sizeof(get_name)),
-              MX_OK, "");
+              ZX_OK, "");
     EXPECT_EQ(strcmp(get_name, set_name), 0, "");
 
     // too large a name by 1
     memset(set_name, 'x', sizeof(set_name));
-    EXPECT_EQ(mx_object_set_property(object, MX_PROP_NAME,
+    EXPECT_EQ(zx_object_set_property(object, ZX_PROP_NAME,
                                      set_name, sizeof(set_name)),
-              MX_OK, "");
+              ZX_OK, "");
 
-    mx_rights_t current_rights;
+    zx_rights_t current_rights;
     if (get_rights(object, &current_rights)) {
-        mx_rights_t cant_set_rights = current_rights &= ~MX_RIGHT_SET_PROPERTY;
-        mx_handle_t cant_set;
+        zx_rights_t cant_set_rights = current_rights &= ~ZX_RIGHT_SET_PROPERTY;
+        zx_handle_t cant_set;
         if (get_new_rights(object, cant_set_rights, &cant_set)) {
-            EXPECT_EQ(mx_object_set_property(cant_set, MX_PROP_NAME, "", 0), MX_ERR_ACCESS_DENIED, "");
-            mx_handle_close(cant_set);
+            EXPECT_EQ(zx_object_set_property(cant_set, ZX_PROP_NAME, "", 0), ZX_ERR_ACCESS_DENIED, "");
+            zx_handle_close(cant_set);
         }
     }
 
@@ -80,7 +80,7 @@
 static bool process_name_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t self = mx_process_self();
+    zx_handle_t self = zx_process_self();
     bool success = test_name_property(self);
     if (!success)
         return false;
@@ -91,7 +91,7 @@
 static bool thread_name_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t main_thread = thrd_get_mx_handle(thrd_current());
+    zx_handle_t main_thread = thrd_get_zx_handle(thrd_current());
     unittest_printf("thread handle %d\n", main_thread);
     bool success = test_name_property(main_thread);
     if (!success)
@@ -103,14 +103,14 @@
 static bool vmo_name_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(16, 0u, &vmo), MX_OK, "");
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(16, 0u, &vmo), ZX_OK, "");
     unittest_printf("VMO handle %d\n", vmo);
 
     // Name should start out empty.
-    char name[MX_MAX_NAME_LEN] = {'x', '\0'};
-    EXPECT_EQ(mx_object_get_property(vmo, MX_PROP_NAME, name, sizeof(name)),
-              MX_OK, "");
+    char name[ZX_MAX_NAME_LEN] = {'x', '\0'};
+    EXPECT_EQ(zx_object_get_property(vmo, ZX_PROP_NAME, name, sizeof(name)),
+              ZX_OK, "");
     EXPECT_EQ(strcmp("", name), 0, "");
 
     // Check the rest.
@@ -123,31 +123,31 @@
 
 // Returns a job, its child job, and its grandchild job.
 #define NUM_TEST_JOBS 3
-static mx_status_t get_test_jobs(mx_handle_t jobs_out[NUM_TEST_JOBS]) {
-    static mx_handle_t test_jobs[NUM_TEST_JOBS] = {MX_HANDLE_INVALID};
+static zx_status_t get_test_jobs(zx_handle_t jobs_out[NUM_TEST_JOBS]) {
+    static zx_handle_t test_jobs[NUM_TEST_JOBS] = {ZX_HANDLE_INVALID};
 
-    if (test_jobs[0] == MX_HANDLE_INVALID) {
-        mx_handle_t root;
-        mx_status_t s = mx_job_create(mx_job_default(), 0, &root);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "root job"); // Poison the test
+    if (test_jobs[0] == ZX_HANDLE_INVALID) {
+        zx_handle_t root;
+        zx_status_t s = zx_job_create(zx_job_default(), 0, &root);
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "root job"); // Poison the test
             return s;
         }
-        mx_handle_t child;
-        s = mx_job_create(root, 0, &child);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "child job");
-            mx_task_kill(root);
-            mx_handle_close(root);
+        zx_handle_t child;
+        s = zx_job_create(root, 0, &child);
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "child job");
+            zx_task_kill(root);
+            zx_handle_close(root);
             return s;
         }
-        mx_handle_t gchild;
-        s = mx_job_create(child, 0, &gchild);
-        if (s != MX_OK) {
-            EXPECT_EQ(s, MX_OK, "grandchild job");
-            mx_task_kill(root); // Kills child, too
-            mx_handle_close(child);
-            mx_handle_close(root);
+        zx_handle_t gchild;
+        s = zx_job_create(child, 0, &gchild);
+        if (s != ZX_OK) {
+            EXPECT_EQ(s, ZX_OK, "grandchild job");
+            zx_task_kill(root); // Kills child, too
+            zx_handle_close(child);
+            zx_handle_close(root);
             return s;
         }
         test_jobs[0] = root;
@@ -155,32 +155,32 @@
         test_jobs[2] = gchild;
     }
     memcpy(jobs_out, test_jobs, sizeof(test_jobs));
-    return MX_OK;
+    return ZX_OK;
 }
 
 static bool assert_test_jobs_importance(
-    mx_job_importance_t root_imp, mx_job_importance_t child_imp,
-    mx_job_importance_t gchild_imp) {
+    zx_job_importance_t root_imp, zx_job_importance_t child_imp,
+    zx_job_importance_t gchild_imp) {
 
-    mx_handle_t jobs[NUM_TEST_JOBS];
-    ASSERT_EQ(get_test_jobs(jobs), MX_OK, "");
+    zx_handle_t jobs[NUM_TEST_JOBS];
+    ASSERT_EQ(get_test_jobs(jobs), ZX_OK, "");
 
-    mx_job_importance_t importance = 0xffff;
-    EXPECT_EQ(mx_object_get_property(jobs[0], MX_PROP_JOB_IMPORTANCE,
-                                     &importance, sizeof(mx_job_importance_t)),
-              MX_OK, "");
+    zx_job_importance_t importance = 0xffff;
+    EXPECT_EQ(zx_object_get_property(jobs[0], ZX_PROP_JOB_IMPORTANCE,
+                                     &importance, sizeof(zx_job_importance_t)),
+              ZX_OK, "");
     EXPECT_EQ(root_imp, importance, "");
 
     importance = 0xffff;
-    EXPECT_EQ(mx_object_get_property(jobs[1], MX_PROP_JOB_IMPORTANCE,
-                                     &importance, sizeof(mx_job_importance_t)),
-              MX_OK, "");
+    EXPECT_EQ(zx_object_get_property(jobs[1], ZX_PROP_JOB_IMPORTANCE,
+                                     &importance, sizeof(zx_job_importance_t)),
+              ZX_OK, "");
     EXPECT_EQ(child_imp, importance, "");
 
     importance = 0xffff;
-    EXPECT_EQ(mx_object_get_property(jobs[2], MX_PROP_JOB_IMPORTANCE,
-                                     &importance, sizeof(mx_job_importance_t)),
-              MX_OK, "");
+    EXPECT_EQ(zx_object_get_property(jobs[2], ZX_PROP_JOB_IMPORTANCE,
+                                     &importance, sizeof(zx_job_importance_t)),
+              ZX_OK, "");
     EXPECT_EQ(gchild_imp, importance, "");
 
     return true;
@@ -189,62 +189,62 @@
 static bool importance_smoke_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t jobs[NUM_TEST_JOBS];
-    ASSERT_EQ(get_test_jobs(jobs), MX_OK, "");
+    zx_handle_t jobs[NUM_TEST_JOBS];
+    ASSERT_EQ(get_test_jobs(jobs), ZX_OK, "");
 
-    static const mx_job_importance_t kImpInherited =
-        MX_JOB_IMPORTANCE_INHERITED;
-    static const mx_job_importance_t kImpMin = MX_JOB_IMPORTANCE_MIN;
-    static const mx_job_importance_t kImpHalf =
-        (MX_JOB_IMPORTANCE_MAX - MX_JOB_IMPORTANCE_MIN) / 2 +
-        MX_JOB_IMPORTANCE_MIN;
-    static const mx_job_importance_t kImpMax = MX_JOB_IMPORTANCE_MAX;
+    static const zx_job_importance_t kImpInherited =
+        ZX_JOB_IMPORTANCE_INHERITED;
+    static const zx_job_importance_t kImpMin = ZX_JOB_IMPORTANCE_MIN;
+    static const zx_job_importance_t kImpHalf =
+        (ZX_JOB_IMPORTANCE_MAX - ZX_JOB_IMPORTANCE_MIN) / 2 +
+        ZX_JOB_IMPORTANCE_MIN;
+    static const zx_job_importance_t kImpMax = ZX_JOB_IMPORTANCE_MAX;
 
     // Set all to the same importance.
     for (int i = 0; i < NUM_TEST_JOBS; i++) {
         char msg[32];
         snprintf(msg, sizeof(msg), "[%d] handle %d", i, jobs[i]);
-        EXPECT_EQ(mx_object_set_property(jobs[i], MX_PROP_JOB_IMPORTANCE,
+        EXPECT_EQ(zx_object_set_property(jobs[i], ZX_PROP_JOB_IMPORTANCE,
                                          &kImpMax,
-                                         sizeof(mx_job_importance_t)),
-                  MX_OK, msg);
+                                         sizeof(zx_job_importance_t)),
+                  ZX_OK, msg);
     }
     EXPECT_TRUE(assert_test_jobs_importance(
                     kImpMax, kImpMax, kImpMax),
                 "");
 
     // Tweak the child.
-    EXPECT_EQ(mx_object_set_property(jobs[1], MX_PROP_JOB_IMPORTANCE,
-                                     &kImpHalf, sizeof(mx_job_importance_t)),
-              MX_OK, "");
+    EXPECT_EQ(zx_object_set_property(jobs[1], ZX_PROP_JOB_IMPORTANCE,
+                                     &kImpHalf, sizeof(zx_job_importance_t)),
+              ZX_OK, "");
     EXPECT_TRUE(assert_test_jobs_importance(
                     kImpMax, kImpHalf, kImpMax),
                 "");
 
     // Tweak the grandchild.
-    EXPECT_EQ(mx_object_set_property(jobs[2], MX_PROP_JOB_IMPORTANCE,
-                                     &kImpMin, sizeof(mx_job_importance_t)),
-              MX_OK, "");
+    EXPECT_EQ(zx_object_set_property(jobs[2], ZX_PROP_JOB_IMPORTANCE,
+                                     &kImpMin, sizeof(zx_job_importance_t)),
+              ZX_OK, "");
     EXPECT_TRUE(assert_test_jobs_importance(
                     kImpMax, kImpHalf, kImpMin),
                 "");
 
     // Setting the grandchild to "inherited" should make it look like it
     // has the child's importance.
-    EXPECT_EQ(mx_object_set_property(jobs[2], MX_PROP_JOB_IMPORTANCE,
+    EXPECT_EQ(zx_object_set_property(jobs[2], ZX_PROP_JOB_IMPORTANCE,
                                      &kImpInherited,
-                                     sizeof(mx_job_importance_t)),
-              MX_OK, "");
+                                     sizeof(zx_job_importance_t)),
+              ZX_OK, "");
     EXPECT_TRUE(assert_test_jobs_importance(
                     kImpMax, kImpHalf, kImpHalf),
                 "");
 
     // Setting the child to "inherited" should cause both child and grandchild
     // to pick up the root importance.
-    EXPECT_EQ(mx_object_set_property(jobs[1], MX_PROP_JOB_IMPORTANCE,
+    EXPECT_EQ(zx_object_set_property(jobs[1], ZX_PROP_JOB_IMPORTANCE,
                                      &kImpInherited,
-                                     sizeof(mx_job_importance_t)),
-              MX_OK, "");
+                                     sizeof(zx_job_importance_t)),
+              ZX_OK, "");
     EXPECT_TRUE(assert_test_jobs_importance(
                     kImpMax, kImpMax, kImpMax),
                 "");
@@ -255,15 +255,15 @@
 static bool bad_importance_value_fails(void) {
     BEGIN_TEST;
 
-    mx_handle_t job;
+    zx_handle_t job;
     {
-        mx_handle_t jobs[NUM_TEST_JOBS];
-        ASSERT_EQ(get_test_jobs(jobs), MX_OK, "");
+        zx_handle_t jobs[NUM_TEST_JOBS];
+        ASSERT_EQ(get_test_jobs(jobs), ZX_OK, "");
         // Only need one job.
         job = jobs[0];
     }
 
-    mx_job_importance_t bad_values[] = {
+    zx_job_importance_t bad_values[] = {
         -3,
         -2,
         256,
@@ -271,13 +271,13 @@
     };
 
     for (size_t i = 0; i < countof(bad_values); i++) {
-        mx_job_importance_t bad_value = bad_values[i];
+        zx_job_importance_t bad_value = bad_values[i];
         char msg[32];
         snprintf(msg, sizeof(msg), "bad value %" PRId32, bad_value);
-        EXPECT_EQ(mx_object_set_property(job, MX_PROP_JOB_IMPORTANCE,
+        EXPECT_EQ(zx_object_set_property(job, ZX_PROP_JOB_IMPORTANCE,
                                          &bad_value,
-                                         sizeof(mx_job_importance_t)),
-                  MX_ERR_OUT_OF_RANGE, msg);
+                                         sizeof(zx_job_importance_t)),
+                  ZX_ERR_OUT_OF_RANGE, msg);
     }
 
     END_TEST;
diff --git a/system/utest/property/rules.mk b/system/utest/property/rules.mk
index 97a2b1a..a5f4404 100644
--- a/system/utest/property/rules.mk
+++ b/system/utest/property/rules.mk
@@ -16,8 +16,8 @@
     system/ulib/unittest \
     system/ulib/test-utils \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/pty/pty-test.c b/system/utest/pty/pty-test.c
index 17d9fb6..2b3403f 100644
--- a/system/utest/pty/pty-test.c
+++ b/system/utest/pty/pty-test.c
@@ -10,14 +10,14 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#include <mxio/io.h>
+#include <fdio/io.h>
 
-#include <magenta/device/pty.h>
+#include <zircon/device/pty.h>
 
 // returns an int to avoid sign errors from ASSERT_*()
 static int fd_signals(int fd) {
     uint32_t signals = 0;
-    mxio_wait_fd(fd, 0, &signals, 0);
+    fdio_wait_fd(fd, 0, &signals, 0);
     return signals;
 }
 
@@ -176,14 +176,14 @@
     ASSERT_EQ(errno, EAGAIN, "");
 
     uint32_t n = 2;
-    ASSERT_EQ(ioctl_pty_make_active(pc, &n), MX_ERR_NOT_FOUND, "");
+    ASSERT_EQ(ioctl_pty_make_active(pc, &n), ZX_ERR_NOT_FOUND, "");
 
     // non-controlling client cannot change active client
-    ASSERT_EQ(ioctl_pty_make_active(pc1, &n), MX_ERR_ACCESS_DENIED, "");
+    ASSERT_EQ(ioctl_pty_make_active(pc1, &n), ZX_ERR_ACCESS_DENIED, "");
 
     // but controlling client can
     n = 1;
-    ASSERT_EQ(ioctl_pty_make_active(pc, &n), MX_OK, "");
+    ASSERT_EQ(ioctl_pty_make_active(pc, &n), ZX_OK, "");
     ASSERT_EQ(fd_signals(pc), 0, "");
     ASSERT_EQ(fd_signals(pc1), POLLOUT, "");
     ASSERT_EQ(write(pc1, "test", 4), 4, "");
diff --git a/system/utest/pty/rules.mk b/system/utest/pty/rules.mk
index 7e6c0ad..5b24df0 100644
--- a/system/utest/pty/rules.mk
+++ b/system/utest/pty/rules.mk
@@ -12,6 +12,6 @@
 
 MODULE_NAME := pty-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/qsort/rules.mk b/system/utest/qsort/rules.mk
index b1f49ad..81c7c6c 100644
--- a/system/utest/qsort/rules.mk
+++ b/system/utest/qsort/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := qsort-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/race-tests/race-tests.cpp b/system/utest/race-tests/race-tests.cpp
index 6d87e38..e533f65 100644
--- a/system/utest/race-tests/race-tests.cpp
+++ b/system/utest/race-tests/race-tests.cpp
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 
 #include <launchpad/launchpad.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 #include <unittest/unittest.h>
 
@@ -19,41 +19,41 @@
 static const char* g_executable_filename;
 
 static void* ThreadFunc(void* thread_arg) {
-    mx_process_exit(200);
+    zx_process_exit(200);
 }
 
 static void Subprocess() {
     pthread_t thread;
     pthread_create(&thread, NULL, ThreadFunc, NULL);
-    mx_process_exit(100);
+    zx_process_exit(100);
 }
 
 // This is a regression test for an issue where the exit status for a
-// process -- as reported by mx_object_get_info()'s return_code field --
+// process -- as reported by zx_object_get_info()'s return_code field --
 // could change.  That could happen if multiple threads called
-// mx_process_exit() concurrently.
+// zx_process_exit() concurrently.
 static bool test_process_exit_status_race() {
     BEGIN_TEST;
 
     // Launch a subprocess.
     launchpad_t* lp;
-    ASSERT_EQ(launchpad_create(MX_HANDLE_INVALID, "test_process", &lp),
-              MX_OK);
-    ASSERT_EQ(launchpad_load_from_file(lp, g_executable_filename), MX_OK);
+    ASSERT_EQ(launchpad_create(ZX_HANDLE_INVALID, "test_process", &lp),
+              ZX_OK);
+    ASSERT_EQ(launchpad_load_from_file(lp, g_executable_filename), ZX_OK);
     const char* args[] = { g_executable_filename, "--subprocess" };
-    ASSERT_EQ(launchpad_set_args(lp, fbl::count_of(args), args), MX_OK);
-    ASSERT_EQ(launchpad_clone(lp, LP_CLONE_ALL), MX_OK);
-    mx_handle_t proc;
+    ASSERT_EQ(launchpad_set_args(lp, fbl::count_of(args), args), ZX_OK);
+    ASSERT_EQ(launchpad_clone(lp, LP_CLONE_ALL), ZX_OK);
+    zx_handle_t proc;
     const char* errmsg;
-    ASSERT_EQ(launchpad_go(lp, &proc, &errmsg), MX_OK);
+    ASSERT_EQ(launchpad_go(lp, &proc, &errmsg), ZX_OK);
 
     for (;;) {
         // Query the process state.
-        mx_info_process_t info1;
+        zx_info_process_t info1;
         size_t records_read;
-        ASSERT_EQ(mx_object_get_info(
-                      proc, MX_INFO_PROCESS, &info1, sizeof(info1),
-                      &records_read, NULL), MX_OK);
+        ASSERT_EQ(zx_object_get_info(
+                      proc, ZX_INFO_PROCESS, &info1, sizeof(info1),
+                      &records_read, NULL), ZX_OK);
         ASSERT_EQ(records_read, 1u);
 
         // If the process was reported as exited, query its state again.
@@ -61,10 +61,10 @@
             EXPECT_TRUE(info1.return_code == 100 ||
                         info1.return_code == 200);
 
-            mx_info_process_t info2;
-            ASSERT_EQ(mx_object_get_info(
-                          proc, MX_INFO_PROCESS, &info2, sizeof(info2),
-                          &records_read, NULL), MX_OK);
+            zx_info_process_t info2;
+            ASSERT_EQ(zx_object_get_info(
+                          proc, ZX_INFO_PROCESS, &info2, sizeof(info2),
+                          &records_read, NULL), ZX_OK);
             ASSERT_EQ(records_read, 1u);
             // Do the results match what we got before?
             EXPECT_TRUE(info2.exited);
@@ -75,7 +75,7 @@
     }
 
     // Clean up.
-    ASSERT_EQ(mx_handle_close(proc), MX_OK);
+    ASSERT_EQ(zx_handle_close(proc), ZX_OK);
 
     END_TEST;
 }
diff --git a/system/utest/race-tests/rules.mk b/system/utest/race-tests/rules.mk
index fd5772f..673a58f 100644
--- a/system/utest/race-tests/rules.mk
+++ b/system/utest/race-tests/rules.mk
@@ -18,8 +18,8 @@
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/launchpad \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 MODULE_STATIC_LIBS := system/ulib/fbl
diff --git a/system/utest/ramdisk/ramdisk.cpp b/system/utest/ramdisk/ramdisk.cpp
index a25bbd6..47ff2d7 100644
--- a/system/utest/ramdisk/ramdisk.cpp
+++ b/system/utest/ramdisk/ramdisk.cpp
@@ -17,9 +17,9 @@
 
 #include <block-client/client.h>
 #include <fs-management/ramdisk.h>
-#include <magenta/device/block.h>
-#include <magenta/device/ramdisk.h>
-#include <magenta/syscalls.h>
+#include <zircon/device/block.h>
+#include <zircon/device/ramdisk.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 #include <fbl/alloc_checker.h>
 #include <fbl/array.h>
@@ -246,19 +246,19 @@
     int fd = get_ramdisk(PAGE_SIZE, 512);
 
     // Set up fifo, txn, client, vmo...
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     txnid_t txnid;
     expected = sizeof(txnid_t);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
     uint64_t vmo_size = PAGE_SIZE * 3;
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(vmo_size, 0, &vmo), MX_OK, "Failed to create VMO");
-    mx_handle_t xfer_vmo;
-    ASSERT_EQ(mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo), MX_OK);
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(vmo_size, 0, &vmo), ZX_OK, "Failed to create VMO");
+    zx_handle_t xfer_vmo;
+    ASSERT_EQ(zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo), ZX_OK);
     vmoid_t vmoid;
     expected = sizeof(vmoid_t);
     ASSERT_EQ(ioctl_block_attach_vmo(fd, &xfer_vmo, &vmoid), expected,
@@ -280,9 +280,9 @@
     // the first few blocks.
     auto bg_thread = [](void* arg) {
         thread_args_t* ta = reinterpret_cast<thread_args_t*>(arg);
-        mx_status_t status;
-        while ((status = block_fifo_txn(ta->client, ta->request, 1)) == MX_OK) {}
-        return (status == MX_ERR_BAD_STATE) ? 0 : -1;
+        zx_status_t status;
+        while ((status = block_fifo_txn(ta->client, ta->request, 1)) == ZX_OK) {}
+        return (status == ZX_ERR_BAD_STATE) ? 0 : -1;
     };
 
     thread_args_t args;
@@ -339,12 +339,12 @@
     // Get a FIFO connection to a ramdisk and immediately close it
     BEGIN_TEST;
     int fd = get_ramdisk(PAGE_SIZE / 2, 512);
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO after closing");
-    ASSERT_EQ(ioctl_block_fifo_close(fd), MX_OK, "Failed to close fifo");
+    ASSERT_EQ(ioctl_block_fifo_close(fd), ZX_OK, "Failed to close fifo");
     ASSERT_GE(ioctl_ramdisk_unlink(fd), 0, "Could not unlink ramdisk device");
     close(fd);
     END_TEST;
@@ -360,7 +360,7 @@
     BEGIN_TEST;
     // Set up the initial handshake connection with the ramdisk
     int fd = get_ramdisk(PAGE_SIZE, 512);
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     txnid_t txnid;
@@ -369,22 +369,22 @@
 
     // Create an arbitrary VMO, fill it with some stuff
     uint64_t vmo_size = PAGE_SIZE * 3;
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(vmo_size, 0, &vmo), MX_OK, "Failed to create VMO");
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(vmo_size, 0, &vmo), ZX_OK, "Failed to create VMO");
     fbl::AllocChecker ac;
     fbl::unique_ptr<uint8_t[]> buf(new (&ac) uint8_t[vmo_size]);
     ASSERT_TRUE(ac.check());
     fill_random(buf.get(), vmo_size);
 
     size_t actual;
-    ASSERT_EQ(mx_vmo_write(vmo, buf.get(), 0, vmo_size, &actual), MX_OK);
+    ASSERT_EQ(zx_vmo_write(vmo, buf.get(), 0, vmo_size, &actual), ZX_OK);
     ASSERT_EQ(actual, vmo_size);
 
     // Send a handle to the vmo to the block device, get a vmoid which identifies it
     vmoid_t vmoid;
     expected = sizeof(vmoid_t);
-    mx_handle_t xfer_vmo;
-    ASSERT_EQ(mx_handle_duplicate(vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo), MX_OK);
+    zx_handle_t xfer_vmo;
+    ASSERT_EQ(zx_handle_duplicate(vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo), ZX_OK);
     ASSERT_EQ(ioctl_block_attach_vmo(fd, &xfer_vmo, &vmoid), expected,
               "Failed to attach vmo");
 
@@ -406,25 +406,25 @@
     requests[1].dev_offset = PAGE_SIZE * 100;
 
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], fbl::count_of(requests)), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], fbl::count_of(requests)), ZX_OK);
 
     // Empty the vmo, then read the info we just wrote to the disk
     fbl::unique_ptr<uint8_t[]> out(new (&ac) uint8_t[vmo_size]());
     ASSERT_TRUE(ac.check());
 
-    ASSERT_EQ(mx_vmo_write(vmo, out.get(), 0, vmo_size, &actual), MX_OK);
+    ASSERT_EQ(zx_vmo_write(vmo, out.get(), 0, vmo_size, &actual), ZX_OK);
     requests[0].opcode = BLOCKIO_READ;
     requests[1].opcode = BLOCKIO_READ;
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], fbl::count_of(requests)), MX_OK);
-    ASSERT_EQ(mx_vmo_read(vmo, out.get(), 0, vmo_size, &actual), MX_OK);
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], fbl::count_of(requests)), ZX_OK);
+    ASSERT_EQ(zx_vmo_read(vmo, out.get(), 0, vmo_size, &actual), ZX_OK);
     ASSERT_EQ(memcmp(buf.get(), out.get(), vmo_size), 0, "Read data not equal to written data");
 
     // Close the current vmo
     requests[0].opcode = BLOCKIO_CLOSE_VMO;
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], 1), MX_OK);
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], 1), ZX_OK);
 
-    ASSERT_EQ(mx_handle_close(vmo), MX_OK);
+    ASSERT_EQ(zx_handle_close(vmo), ZX_OK);
     block_fifo_release_client(client);
     ASSERT_GE(ioctl_ramdisk_unlink(fd), 0, "Could not unlink ramdisk device");
     ASSERT_EQ(close(fd), 0);
@@ -433,7 +433,7 @@
 
 typedef struct {
     uint64_t vmo_size;
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     vmoid_t vmoid;
     fbl::unique_ptr<uint8_t[]> buf;
 } test_vmo_object_t;
@@ -441,20 +441,20 @@
 // Creates a VMO, fills it with data, and gives it to the block device.
 bool create_vmo_helper(int fd, test_vmo_object_t* obj, size_t kBlockSize) {
     obj->vmo_size = kBlockSize + (rand() % 5) * kBlockSize;
-    ASSERT_EQ(mx_vmo_create(obj->vmo_size, 0, &obj->vmo), MX_OK,
+    ASSERT_EQ(zx_vmo_create(obj->vmo_size, 0, &obj->vmo), ZX_OK,
               "Failed to create vmo");
     fbl::AllocChecker ac;
     obj->buf.reset(new (&ac) uint8_t[obj->vmo_size]);
     ASSERT_TRUE(ac.check());
     fill_random(obj->buf.get(), obj->vmo_size);
     size_t actual;
-    ASSERT_EQ(mx_vmo_write(obj->vmo, obj->buf.get(), 0, obj->vmo_size, &actual),
-              MX_OK, "Failed to write to vmo");
+    ASSERT_EQ(zx_vmo_write(obj->vmo, obj->buf.get(), 0, obj->vmo_size, &actual),
+              ZX_OK, "Failed to write to vmo");
     ASSERT_EQ(obj->vmo_size, actual, "Could not write entire VMO");
 
     ssize_t expected = sizeof(vmoid_t);
-    mx_handle_t xfer_vmo;
-    ASSERT_EQ(mx_handle_duplicate(obj->vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo), MX_OK,
+    zx_handle_t xfer_vmo;
+    ASSERT_EQ(zx_handle_duplicate(obj->vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo), ZX_OK,
               "Failed to duplicate vmo");
     ASSERT_EQ(ioctl_block_attach_vmo(fd, &xfer_vmo, &obj->vmoid), expected,
               "Failed to attach vmo");
@@ -481,7 +481,7 @@
         requests[b].dev_offset = i * kBlockSize + b * (kBlockSize * objs);
     }
     // Write entire vmos at once
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), MX_OK);
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), ZX_OK);
     return true;
 }
 
@@ -493,8 +493,8 @@
     fbl::unique_ptr<uint8_t[]> out(new (&ac) uint8_t[obj->vmo_size]());
     ASSERT_TRUE(ac.check());
     size_t actual;
-    ASSERT_EQ(mx_vmo_write(obj->vmo, out.get(), 0, obj->vmo_size, &actual),
-              MX_OK);
+    ASSERT_EQ(zx_vmo_write(obj->vmo, out.get(), 0, obj->vmo_size, &actual),
+              ZX_OK);
 
     // Next, read to the vmo from the disk
     size_t blocks = obj->vmo_size / kBlockSize;
@@ -509,12 +509,12 @@
         requests[b].dev_offset = i * kBlockSize + b * (kBlockSize * objs);
     }
     // Read entire vmos at once
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), MX_OK);
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), ZX_OK);
 
     // Finally, write from the vmo to an out buffer, where we can compare
     // the results with the input buffer.
-    ASSERT_EQ(mx_vmo_read(obj->vmo, out.get(), 0, obj->vmo_size, &actual),
-              MX_OK);
+    ASSERT_EQ(zx_vmo_read(obj->vmo, out.get(), 0, obj->vmo_size, &actual),
+              ZX_OK);
     ASSERT_EQ(memcmp(obj->buf.get(), out.get(), obj->vmo_size), 0,
               "Read data not equal to written data");
     return true;
@@ -526,8 +526,8 @@
     request.txnid = txnid;
     request.vmoid = obj->vmoid;
     request.opcode = BLOCKIO_CLOSE_VMO;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_OK);
-    ASSERT_EQ(mx_handle_close(obj->vmo), MX_OK);
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_OK);
+    ASSERT_EQ(zx_handle_close(obj->vmo), ZX_OK);
     return true;
 }
 
@@ -536,14 +536,14 @@
     // Set up the initial handshake connection with the ramdisk
     const size_t kBlockSize = PAGE_SIZE;
     int fd = get_ramdisk(kBlockSize, 1 << 18);
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     txnid_t txnid;
     expected = sizeof(txnid);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
 
     // Create multiple VMOs
     fbl::AllocChecker ac;
@@ -585,7 +585,7 @@
     test_vmo_object_t* obj = fifoarg->obj;
     size_t i = fifoarg->i;
     size_t objs = fifoarg->objs;
-    mx_handle_t fd = fifoarg->fd;
+    zx_handle_t fd = fifoarg->fd;
     fifo_client_t* client = fifoarg->client;
     size_t kBlockSize = fifoarg->kBlockSize;
 
@@ -606,11 +606,11 @@
     // Set up the initial handshake connection with the ramdisk
     const size_t kBlockSize = PAGE_SIZE;
     int fd = get_ramdisk(kBlockSize, 1 << 18);
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
 
     // Create multiple VMOs
     size_t num_threads = 10;
@@ -657,13 +657,13 @@
     int fd = get_ramdisk(kBlockSize, 1 << 18);
 
     // Create a connection to the ramdisk
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
-    ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), MX_ERR_ALREADY_BOUND,
+    ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), ZX_ERR_ALREADY_BOUND,
               "Expected fifo to already be bound");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
     txnid_t txnid;
     expected = sizeof(txnid_t);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
@@ -677,14 +677,14 @@
     }
 
     // Now that we've set up the connection for a few VMOs, shut down the fifo
-    ASSERT_EQ(mx_handle_close(fifo), MX_OK);
+    ASSERT_EQ(zx_handle_close(fifo), ZX_OK);
 
     // Attempting to batch any operations to the fifo should fail
     block_fifo_request_t request;
     request.txnid = txnid;
     request.vmoid = objs[0].vmoid;
     request.opcode = BLOCKIO_CLOSE_VMO;
-    ASSERT_NE(block_fifo_txn(client, &request, 1), MX_OK,
+    ASSERT_NE(block_fifo_txn(client, &request, 1), ZX_OK,
               "Expected operation to fail after closing FIFO");
 
     // Free the dead client
@@ -696,7 +696,7 @@
     // The block server should still be functioning. We should be able to re-bind to it
     expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
     expected = sizeof(txnid);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
 
@@ -726,11 +726,11 @@
     int fd = get_ramdisk(kBlockSize, 1 << 18);
 
     // Create a connection to the ramdisk
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
 
     // Create a vmo
     test_vmo_object_t obj;
@@ -755,8 +755,8 @@
             requests[b].dev_offset = 0;
         }
 
-        ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), MX_OK);
-        ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), MX_OK, "Failed to free txn");
+        ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), ZX_OK);
+        ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), ZX_OK, "Failed to free txn");
     }
 
     block_fifo_release_client(client);
@@ -772,11 +772,11 @@
     int fd = get_ramdisk(kBlockSize, 1 << 18);
 
     // Create a connection to the ramdisk
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
     test_vmo_object_t obj;
     ASSERT_TRUE(create_vmo_helper(fd, &obj, kBlockSize));
 
@@ -801,39 +801,39 @@
     }
 
     // This should be caught locally by the client library
-    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(block_fifo_txn(client, &requests[0], requests.size()), ZX_ERR_INVALID_ARGS);
 
     // Since the client-side automatically appends the "TXN_END" flag, we avoid using it here.
     for (size_t i = 0; i < requests.size(); i++) {
         uint32_t actual;
 retry_write:
-        mx_status_t status = mx_fifo_write(fifo, &requests[i], sizeof(block_fifo_request_t),
+        zx_status_t status = zx_fifo_write(fifo, &requests[i], sizeof(block_fifo_request_t),
                                            &actual);
-        if (status == MX_ERR_SHOULD_WAIT) {
-            mx_signals_t signals;
-            ASSERT_EQ(mx_object_wait_one(fifo, MX_FIFO_WRITABLE, MX_TIME_INFINITE, &signals),
-                      MX_OK);
-            ASSERT_EQ(signals & MX_FIFO_WRITABLE, MX_FIFO_WRITABLE);
+        if (status == ZX_ERR_SHOULD_WAIT) {
+            zx_signals_t signals;
+            ASSERT_EQ(zx_object_wait_one(fifo, ZX_FIFO_WRITABLE, ZX_TIME_INFINITE, &signals),
+                      ZX_OK);
+            ASSERT_EQ(signals & ZX_FIFO_WRITABLE, ZX_FIFO_WRITABLE);
             goto retry_write;
         } else {
-            ASSERT_EQ(status, MX_OK);
+            ASSERT_EQ(status, ZX_OK);
         }
     }
 
     // Even though we never sent a request for TXN_END, we'll get a response because
     // we filled our txn to the brim.
-    mx_signals_t signals;
-    ASSERT_EQ(mx_object_wait_one(fifo, MX_FIFO_READABLE, MX_TIME_INFINITE, &signals),
-              MX_OK);
-    ASSERT_EQ(signals & MX_FIFO_READABLE, MX_FIFO_READABLE);
+    zx_signals_t signals;
+    ASSERT_EQ(zx_object_wait_one(fifo, ZX_FIFO_READABLE, ZX_TIME_INFINITE, &signals),
+              ZX_OK);
+    ASSERT_EQ(signals & ZX_FIFO_READABLE, ZX_FIFO_READABLE);
     block_fifo_response_t response;
     uint32_t count;
-    ASSERT_EQ(mx_fifo_read(fifo, &response, sizeof(block_fifo_response_t), &count), MX_OK);
-    ASSERT_EQ(response.status, MX_OK);
+    ASSERT_EQ(zx_fifo_read(fifo, &response, sizeof(block_fifo_response_t), &count), ZX_OK);
+    ASSERT_EQ(response.status, ZX_OK);
     ASSERT_EQ(response.txnid, txnid);
 
     // The txn should still be usable! We should still be able to send a close request.
-    ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), MX_OK, "Failed to free txn");
+    ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), ZX_OK, "Failed to free txn");
     block_fifo_release_client(client);
     ASSERT_GE(ioctl_ramdisk_unlink(fd), 0, "Could not unlink ramdisk device");
     ASSERT_EQ(close(fd), 0);
@@ -848,11 +848,11 @@
     int fd = get_ramdisk(kBlockSize, 1 << 18);
 
     // Create a connection to the ramdisk
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
     txnid_t txnid;
     expected = sizeof(txnid_t);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
@@ -869,9 +869,9 @@
     request.length     = static_cast<uint32_t>(kBlockSize);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_IO, "Expected IO error with bad vmoid");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_IO, "Expected IO error with bad vmoid");
 
-    ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), MX_OK, "Failed to free txn");
+    ASSERT_EQ(ioctl_block_free_txn(fd, &txnid), ZX_OK, "Failed to free txn");
     block_fifo_release_client(client);
     ASSERT_GE(ioctl_ramdisk_unlink(fd), 0, "Could not unlink ramdisk device");
     ASSERT_EQ(close(fd), 0);
@@ -886,11 +886,11 @@
     int fd = get_ramdisk(kBlockSize, 1 << 18);
 
     // Create a connection to the ramdisk
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
 
     // Create a vmo
     test_vmo_object_t obj;
@@ -904,7 +904,7 @@
     request.length     = static_cast<uint32_t>(kBlockSize);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_IO, "Expected IO error with bad txnid");
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_IO, "Expected IO error with bad txnid");
 
     block_fifo_release_client(client);
     ASSERT_GE(ioctl_ramdisk_unlink(fd), 0, "Could not unlink ramdisk device");
@@ -920,11 +920,11 @@
     int fd = get_ramdisk(kBlockSize, 1 << 18);
 
     // Create a connection to the ramdisk
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
     txnid_t txnid;
     expected = sizeof(txnid_t);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
@@ -944,25 +944,25 @@
     request.length     = static_cast<uint32_t>(kBlockSize - 1);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS);
 
     // Send a request that has a non-block aligned length (+1)
     request.length     = static_cast<uint32_t>(kBlockSize + 1);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS);
 
     // Send a request that has a non-block aligned device offset
     request.length     = static_cast<uint32_t>(kBlockSize);
     request.vmo_offset = 0;
     request.dev_offset = 1;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS);
 
     // Actually, we don't care about aligning VMO offsets, so this request should be fine
     request.length     = static_cast<uint32_t>(kBlockSize);
     request.vmo_offset = 1;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_OK);
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_OK);
 
     block_fifo_release_client(client);
     ASSERT_GE(ioctl_ramdisk_unlink(fd), 0, "Could not unlink ramdisk device");
@@ -978,29 +978,29 @@
     int fd = get_ramdisk(kBlockSize, 1 << 18);
 
     // Create a connection to the ramdisk
-    mx_handle_t fifo;
+    zx_handle_t fifo;
     ssize_t expected = sizeof(fifo);
     ASSERT_EQ(ioctl_block_get_fifos(fd, &fifo), expected, "Failed to get FIFO");
     fifo_client_t* client;
-    ASSERT_EQ(block_fifo_create_client(fifo, &client), MX_OK);
+    ASSERT_EQ(block_fifo_create_client(fifo, &client), ZX_OK);
     txnid_t txnid;
     expected = sizeof(txnid_t);
     ASSERT_EQ(ioctl_block_alloc_txn(fd, &txnid), expected, "Failed to allocate txn");
 
     test_vmo_object_t obj;
     obj.vmo_size = kBlockSize;
-    ASSERT_EQ(mx_vmo_create(obj.vmo_size, 0, &obj.vmo), MX_OK,
+    ASSERT_EQ(zx_vmo_create(obj.vmo_size, 0, &obj.vmo), ZX_OK,
               "Failed to create vmo");
     fbl::AllocChecker ac;
     obj.buf.reset(new (&ac) uint8_t[obj.vmo_size]);
     ASSERT_TRUE(ac.check());
     fill_random(obj.buf.get(), obj.vmo_size);
     size_t actual;
-    ASSERT_EQ(mx_vmo_write(obj.vmo, obj.buf.get(), 0, obj.vmo_size, &actual),
-              MX_OK, "Failed to write to vmo");
+    ASSERT_EQ(zx_vmo_write(obj.vmo, obj.buf.get(), 0, obj.vmo_size, &actual),
+              ZX_OK, "Failed to write to vmo");
     ASSERT_EQ(obj.vmo_size, actual, "Could not write entire VMO");
-    mx_handle_t xfer_vmo;
-    ASSERT_EQ(mx_handle_duplicate(obj.vmo, MX_RIGHT_SAME_RIGHTS, &xfer_vmo), MX_OK,
+    zx_handle_t xfer_vmo;
+    ASSERT_EQ(zx_handle_duplicate(obj.vmo, ZX_RIGHT_SAME_RIGHTS, &xfer_vmo), ZX_OK,
               "Failed to duplicate vmo");
     expected = sizeof(vmoid_t);
     ASSERT_EQ(ioctl_block_attach_vmo(fd, &xfer_vmo, &obj.vmoid), expected,
@@ -1014,14 +1014,14 @@
     request.length     = static_cast<uint32_t>(kBlockSize - 1);
     request.vmo_offset = 0;
     request.dev_offset = 0;
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS);
     request.length     = static_cast<uint32_t>(kBlockSize + 1);
     // Do the same thing, but for reading
     request.opcode     = BLOCKIO_READ;
     request.length     = static_cast<uint32_t>(kBlockSize - 1);
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS);
     request.length     = static_cast<uint32_t>(kBlockSize + 1);
-    ASSERT_EQ(block_fifo_txn(client, &request, 1), MX_ERR_INVALID_ARGS);
+    ASSERT_EQ(block_fifo_txn(client, &request, 1), ZX_ERR_INVALID_ARGS);
 
     block_fifo_release_client(client);
     ASSERT_GE(ioctl_ramdisk_unlink(fd), 0, "Could not unlink ramdisk device");
diff --git a/system/utest/ramdisk/rules.mk b/system/utest/ramdisk/rules.mk
index c7f6785..e7ad4f6 100644
--- a/system/utest/ramdisk/rules.mk
+++ b/system/utest/ramdisk/rules.mk
@@ -17,14 +17,14 @@
 MODULE_STATIC_LIBS := \
     system/ulib/block-client \
     system/ulib/sync \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
     system/ulib/fs-management \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/region-alloc/common.h b/system/utest/region-alloc/common.h
index 8fef662..0323351 100644
--- a/system/utest/region-alloc/common.h
+++ b/system/utest/region-alloc/common.h
@@ -82,69 +82,69 @@
 typedef struct {
     uint64_t    size;
     uint64_t    align;
-    mx_status_t res;
+    zx_status_t res;
     size_t      region;
 } alloc_by_size_alloc_test_t;
 
 static const alloc_by_size_alloc_test_t ALLOC_BY_SIZE_TESTS[] = {
     // Invalid parameter failures
-    { .size = 0x00000000, .align = 0x00000001, .res = MX_ERR_INVALID_ARGS, 0 },  // bad size
-    { .size = 0x00000001, .align = 0x00000000, .res = MX_ERR_INVALID_ARGS, 0 },  // bad align
-    { .size = 0x00000001, .align = 0x00001001, .res = MX_ERR_INVALID_ARGS, 0 },  // bad align
+    { .size = 0x00000000, .align = 0x00000001, .res = ZX_ERR_INVALID_ARGS, 0 },  // bad size
+    { .size = 0x00000001, .align = 0x00000000, .res = ZX_ERR_INVALID_ARGS, 0 },  // bad align
+    { .size = 0x00000001, .align = 0x00001001, .res = ZX_ERR_INVALID_ARGS, 0 },  // bad align
 
     // Initially unsatisfiable
-    { .size = 0x10000000, .align = 0x00000001, .res = MX_ERR_NOT_FOUND, 0 },  // too large
-    { .size = 0x00005000, .align = 0x10000000, .res = MX_ERR_NOT_FOUND, 0 },  // Cannot align
+    { .size = 0x10000000, .align = 0x00000001, .res = ZX_ERR_NOT_FOUND, 0 },  // too large
+    { .size = 0x00005000, .align = 0x10000000, .res = ZX_ERR_NOT_FOUND, 0 },  // Cannot align
 
     // Should succeed, all pulled from first chunk
-    { .size = (1 <<  0), .align = (1 <<  1), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  1), .align = (1 <<  2), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  2), .align = (1 <<  3), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  3), .align = (1 <<  4), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  4), .align = (1 <<  5), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  5), .align = (1 <<  6), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  6), .align = (1 <<  7), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  7), .align = (1 <<  8), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  8), .align = (1 <<  9), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  9), .align = (1 << 10), .res = MX_OK, .region = 0 },
-    { .size = (1 << 10), .align = (1 << 11), .res = MX_OK, .region = 0 },
+    { .size = (1 <<  0), .align = (1 <<  1), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  1), .align = (1 <<  2), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  2), .align = (1 <<  3), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  3), .align = (1 <<  4), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  4), .align = (1 <<  5), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  5), .align = (1 <<  6), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  6), .align = (1 <<  7), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  7), .align = (1 <<  8), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  8), .align = (1 <<  9), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  9), .align = (1 << 10), .res = ZX_OK, .region = 0 },
+    { .size = (1 << 10), .align = (1 << 11), .res = ZX_OK, .region = 0 },
 
     // Perform some allocations which are large enough that they can only be
     // satisfied with results from region 1.  Exercise the various range
     // splitting cases.
-    { .size = (4 << 10), .align = (4 << 10), .res = MX_OK, .region = 1 }, // front of region 1
-    { .size = (4 << 10), .align = (4 << 11), .res = MX_OK, .region = 1 }, // middle of region 1
-    { .size = 0xfc000,   .align = (4 << 12), .res = MX_OK, .region = 1 }, // back of region 1
+    { .size = (4 << 10), .align = (4 << 10), .res = ZX_OK, .region = 1 }, // front of region 1
+    { .size = (4 << 10), .align = (4 << 11), .res = ZX_OK, .region = 1 }, // middle of region 1
+    { .size = 0xfc000,   .align = (4 << 12), .res = ZX_OK, .region = 1 }, // back of region 1
 
     // Repeat the small allocation pass again.  Because of the alignment
     // restrictions, the first pass should have fragmented the first region.
     // This pass should soak up those fragments.
-    { .size = (3),       .align = (1 <<  0), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  1), .align = (1 <<  1), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  2), .align = (1 <<  2), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  3), .align = (1 <<  3), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  4), .align = (1 <<  4), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  5), .align = (1 <<  5), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  6), .align = (1 <<  6), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  7), .align = (1 <<  7), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  8), .align = (1 <<  8), .res = MX_OK, .region = 0 },
-    { .size = (1 <<  9), .align = (1 <<  9), .res = MX_OK, .region = 0 },
-    { .size = (1 << 10), .align = (1 << 10), .res = MX_OK, .region = 0 },
+    { .size = (3),       .align = (1 <<  0), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  1), .align = (1 <<  1), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  2), .align = (1 <<  2), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  3), .align = (1 <<  3), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  4), .align = (1 <<  4), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  5), .align = (1 <<  5), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  6), .align = (1 <<  6), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  7), .align = (1 <<  7), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  8), .align = (1 <<  8), .res = ZX_OK, .region = 0 },
+    { .size = (1 <<  9), .align = (1 <<  9), .res = ZX_OK, .region = 0 },
+    { .size = (1 << 10), .align = (1 << 10), .res = ZX_OK, .region = 0 },
 
     // Region 0 should be exhausted at this point.  Asking for even one more
     // byte should give us an allocation from from region 1.
-    { .size = 1, .align = 1, .res = MX_OK, .region = 1 },
+    { .size = 1, .align = 1, .res = ZX_OK, .region = 1 },
 
     // All that should be left in the pool is a 4k region and a 4k - 1 byte
     // region.  Ask for two 4k regions with arbitrary alignment.  The first
     // request should succeed while the second request should fail.
-    { .size = (4 << 10), .align = 1, .res = MX_OK, .region = 1 },
-    { .size = (4 << 10), .align = 1, .res = MX_ERR_NOT_FOUND, 0 },
+    { .size = (4 << 10), .align = 1, .res = ZX_OK, .region = 1 },
+    { .size = (4 << 10), .align = 1, .res = ZX_ERR_NOT_FOUND, 0 },
 
     // Finally, soak up the last of the space with a 0xFFF byte allocation.
     // Afterwards, we should be unable to allocate even a single byte
-    { .size = 0xFFF, .align = 1, .res = MX_OK, .region = 1 },
-    { .size = 1,     .align = 1, .res = MX_ERR_NOT_FOUND, 0 },
+    { .size = 0xFFF, .align = 1, .res = ZX_OK, .region = 1 },
+    { .size = 1,     .align = 1, .res = ZX_ERR_NOT_FOUND, 0 },
 };
 
 #define ALLOC_SPECIFIC_REGION_BASE (0x1000)
@@ -156,122 +156,122 @@
 
 typedef struct {
     ralloc_region_t req;
-    mx_status_t     res;
+    zx_status_t     res;
 } alloc_specific_alloc_test_t;
 
 static const alloc_specific_alloc_test_t ALLOC_SPECIFIC_TESTS[] = {
     // Invalid parameter failures
-    { .req = { .base = 0x0000000000000000, .size = 0x00 }, .res = MX_ERR_INVALID_ARGS },  // 0 size
-    { .req = { .base = 0xffffffffffffffff, .size = 0x01 }, .res = MX_ERR_INVALID_ARGS },  // wraps
-    { .req = { .base = 0xfffffffffffffff0, .size = 0x20 }, .res = MX_ERR_INVALID_ARGS },  // wraps
+    { .req = { .base = 0x0000000000000000, .size = 0x00 }, .res = ZX_ERR_INVALID_ARGS },  // 0 size
+    { .req = { .base = 0xffffffffffffffff, .size = 0x01 }, .res = ZX_ERR_INVALID_ARGS },  // wraps
+    { .req = { .base = 0xfffffffffffffff0, .size = 0x20 }, .res = ZX_ERR_INVALID_ARGS },  // wraps
 
     // Bad requests
-    { .req = { .base = 0x0800, .size =   0x1 }, .res = MX_ERR_NOT_FOUND },  // total miss
-    { .req = { .base = 0x0fff, .size = 0x100 }, .res = MX_ERR_NOT_FOUND },  // clips the front
-    { .req = { .base = 0x1f01, .size = 0x100 }, .res = MX_ERR_NOT_FOUND },  // clips the back
-    { .req = { .base = 0x2000, .size =   0x1 }, .res = MX_ERR_NOT_FOUND },  // total miss
+    { .req = { .base = 0x0800, .size =   0x1 }, .res = ZX_ERR_NOT_FOUND },  // total miss
+    { .req = { .base = 0x0fff, .size = 0x100 }, .res = ZX_ERR_NOT_FOUND },  // clips the front
+    { .req = { .base = 0x1f01, .size = 0x100 }, .res = ZX_ERR_NOT_FOUND },  // clips the back
+    { .req = { .base = 0x2000, .size =   0x1 }, .res = ZX_ERR_NOT_FOUND },  // total miss
 
     // Good requests
-    { .req = { .base = 0x1000, .size = 0x100 }, .res = MX_OK },  // front of range.
-    { .req = { .base = 0x1f00, .size = 0x100 }, .res = MX_OK },  // back of range.
-    { .req = { .base = 0x1700, .size = 0x200 }, .res = MX_OK },  // middle of range.
+    { .req = { .base = 0x1000, .size = 0x100 }, .res = ZX_OK },  // front of range.
+    { .req = { .base = 0x1f00, .size = 0x100 }, .res = ZX_OK },  // back of range.
+    { .req = { .base = 0x1700, .size = 0x200 }, .res = ZX_OK },  // middle of range.
 
     // Requests which would have been good initially, but are bad now.
-    { .req = { .base = 0x1000, .size = 0x100 }, .res = MX_ERR_NOT_FOUND },
-    { .req = { .base = 0x1080, .size =  0x80 }, .res = MX_ERR_NOT_FOUND },
-    { .req = { .base = 0x10ff, .size =   0x1 }, .res = MX_ERR_NOT_FOUND },
-    { .req = { .base = 0x10ff, .size = 0x100 }, .res = MX_ERR_NOT_FOUND },
+    { .req = { .base = 0x1000, .size = 0x100 }, .res = ZX_ERR_NOT_FOUND },
+    { .req = { .base = 0x1080, .size =  0x80 }, .res = ZX_ERR_NOT_FOUND },
+    { .req = { .base = 0x10ff, .size =   0x1 }, .res = ZX_ERR_NOT_FOUND },
+    { .req = { .base = 0x10ff, .size = 0x100 }, .res = ZX_ERR_NOT_FOUND },
 
-    { .req = { .base = 0x1f00, .size = 0x100 }, .res = MX_ERR_NOT_FOUND },
-    { .req = { .base = 0x1e01, .size = 0x100 }, .res = MX_ERR_NOT_FOUND },
-    { .req = { .base = 0x1e81, .size =  0x80 }, .res = MX_ERR_NOT_FOUND },
-    { .req = { .base = 0x1eff, .size =   0x2 }, .res = MX_ERR_NOT_FOUND },
+    { .req = { .base = 0x1f00, .size = 0x100 }, .res = ZX_ERR_NOT_FOUND },
+    { .req = { .base = 0x1e01, .size = 0x100 }, .res = ZX_ERR_NOT_FOUND },
+    { .req = { .base = 0x1e81, .size =  0x80 }, .res = ZX_ERR_NOT_FOUND },
+    { .req = { .base = 0x1eff, .size =   0x2 }, .res = ZX_ERR_NOT_FOUND },
 
-    { .req = { .base = 0x1800, .size = 0x100 }, .res = MX_ERR_NOT_FOUND },
-    { .req = { .base = 0x1880, .size = 0x100 }, .res = MX_ERR_NOT_FOUND },
-    { .req = { .base = 0x1780, .size = 0x100 }, .res = MX_ERR_NOT_FOUND },
+    { .req = { .base = 0x1800, .size = 0x100 }, .res = ZX_ERR_NOT_FOUND },
+    { .req = { .base = 0x1880, .size = 0x100 }, .res = ZX_ERR_NOT_FOUND },
+    { .req = { .base = 0x1780, .size = 0x100 }, .res = ZX_ERR_NOT_FOUND },
 
     // Soak up the remaining regions.  There should be 2 left.
-    { .req = { .base = 0x1100, .size = 0x600 }, .res = MX_OK },
-    { .req = { .base = 0x1900, .size = 0x600 }, .res = MX_OK },
+    { .req = { .base = 0x1100, .size = 0x600 }, .res = ZX_OK },
+    { .req = { .base = 0x1900, .size = 0x600 }, .res = ZX_OK },
 };
 
 typedef struct {
     ralloc_region_t reg;    // Region to add
     bool            ovl;    // Whether to allow overlap or not.
     size_t          cnt;    // Expected available region count afterwards.
-    mx_status_t     res;    // Expected result.
+    zx_status_t     res;    // Expected result.
 } alloc_add_overlap_test_t;
 
 static const alloc_add_overlap_test_t ADD_OVERLAP_TESTS[] = {
     // Add a region, then try to add it again without allowing overlap.  This
     // should fail.  Then add the region again, this time allowing overlap.
     // This should succeed.
-    { .reg = { .base = 0x10000, .size = 0x1000 }, .ovl = false, .cnt = 1, .res = MX_OK },
-    { .reg = { .base = 0x10000, .size = 0x1000 }, .ovl = false, .cnt = 1, .res = MX_ERR_INVALID_ARGS },
-    { .reg = { .base = 0x10000, .size = 0x1000 }, .ovl = true,  .cnt = 1, .res = MX_OK },
+    { .reg = { .base = 0x10000, .size = 0x1000 }, .ovl = false, .cnt = 1, .res = ZX_OK },
+    { .reg = { .base = 0x10000, .size = 0x1000 }, .ovl = false, .cnt = 1, .res = ZX_ERR_INVALID_ARGS },
+    { .reg = { .base = 0x10000, .size = 0x1000 }, .ovl = true,  .cnt = 1, .res = ZX_OK },
 
     // Current: [0x10000, 0x11000)
     // Add a region to the front which fits perfectly with the existing region.
     // This should succeed, even when we do not allow overlapping.
-    { .reg = { .base = 0xF800,  .size = 0x800 },  .ovl = false, .cnt = 1, .res = MX_OK },
-    { .reg = { .base = 0xF800,  .size = 0x800 },  .ovl = true,  .cnt = 1, .res = MX_OK },
+    { .reg = { .base = 0xF800,  .size = 0x800 },  .ovl = false, .cnt = 1, .res = ZX_OK },
+    { .reg = { .base = 0xF800,  .size = 0x800 },  .ovl = true,  .cnt = 1, .res = ZX_OK },
 
     // Current: [0xF800, 0x11000)
     // Same exercise, but this time add to the back.
-    { .reg = { .base = 0x11000, .size = 0x800 },  .ovl = false, .cnt = 1, .res = MX_OK },
-    { .reg = { .base = 0x11000, .size = 0x800 },  .ovl = true,  .cnt = 1, .res = MX_OK },
+    { .reg = { .base = 0x11000, .size = 0x800 },  .ovl = false, .cnt = 1, .res = ZX_OK },
+    { .reg = { .base = 0x11000, .size = 0x800 },  .ovl = true,  .cnt = 1, .res = ZX_OK },
 
     // Current: [0xF800, 0x11800)
     // Now attempt to add a region which overlaps the front by a single byte.
     // This should fail unless we explicitly permit it.
-    { .reg = { .base = 0xF000,  .size = 0x801 },  .ovl = false, .cnt = 1, .res = MX_ERR_INVALID_ARGS },
-    { .reg = { .base = 0xF000,  .size = 0x801 },  .ovl = true,  .cnt = 1, .res = MX_OK },
+    { .reg = { .base = 0xF000,  .size = 0x801 },  .ovl = false, .cnt = 1, .res = ZX_ERR_INVALID_ARGS },
+    { .reg = { .base = 0xF000,  .size = 0x801 },  .ovl = true,  .cnt = 1, .res = ZX_OK },
 
     // Current: [0xF000, 0x12000)
     // Same exercise, this time adding to the back.
-    { .reg = { .base = 0x117FF, .size = 0x801 },  .ovl = false, .cnt = 1, .res = MX_ERR_INVALID_ARGS },
-    { .reg = { .base = 0x117FF, .size = 0x801 },  .ovl = true,  .cnt = 1, .res = MX_OK },
+    { .reg = { .base = 0x117FF, .size = 0x801 },  .ovl = false, .cnt = 1, .res = ZX_ERR_INVALID_ARGS },
+    { .reg = { .base = 0x117FF, .size = 0x801 },  .ovl = true,  .cnt = 1, .res = ZX_OK },
 
     // Current: [0xE000, 0x13000)
     // Add a region which completely contains the existing region.
-    { .reg = { .base = 0xE000,  .size = 0x5000 }, .ovl = false, .cnt = 1, .res = MX_ERR_INVALID_ARGS },
-    { .reg = { .base = 0xE000,  .size = 0x5000 }, .ovl = true,  .cnt = 1, .res = MX_OK },
+    { .reg = { .base = 0xE000,  .size = 0x5000 }, .ovl = false, .cnt = 1, .res = ZX_ERR_INVALID_ARGS },
+    { .reg = { .base = 0xE000,  .size = 0x5000 }, .ovl = true,  .cnt = 1, .res = ZX_OK },
 
     // Add some regions which are not connected to the existing region.
-    { .reg = { .base = 0x14000, .size = 0x1000 }, .ovl = false, .cnt = 2, .res = MX_OK },
-    { .reg = { .base = 0x16000, .size = 0x1000 }, .ovl = false, .cnt = 3, .res = MX_OK },
-    { .reg = { .base = 0x18000, .size = 0x1000 }, .ovl = false, .cnt = 4, .res = MX_OK },
-    { .reg = { .base = 0x1A000, .size = 0x1000 }, .ovl = false, .cnt = 5, .res = MX_OK },
-    { .reg = { .base = 0x1C000, .size = 0x1000 }, .ovl = false, .cnt = 6, .res = MX_OK },
+    { .reg = { .base = 0x14000, .size = 0x1000 }, .ovl = false, .cnt = 2, .res = ZX_OK },
+    { .reg = { .base = 0x16000, .size = 0x1000 }, .ovl = false, .cnt = 3, .res = ZX_OK },
+    { .reg = { .base = 0x18000, .size = 0x1000 }, .ovl = false, .cnt = 4, .res = ZX_OK },
+    { .reg = { .base = 0x1A000, .size = 0x1000 }, .ovl = false, .cnt = 5, .res = ZX_OK },
+    { .reg = { .base = 0x1C000, .size = 0x1000 }, .ovl = false, .cnt = 6, .res = ZX_OK },
 
     // Current: [0xE000,  0x13000) [0x14000, 0x15000) [0x16000, 0x17000) [0x18000, 0x19000)
     //          [0x1A000, 0x1B000) [0x1C000, 0x1D000)
 
     // Add a region which ties two regions together.
-    { .reg = { .base = 0x12FFF, .size = 0x1002 }, .ovl = false, .cnt = 6, .res = MX_ERR_INVALID_ARGS },
-    { .reg = { .base = 0x12FFF, .size = 0x1002 }, .ovl = true,  .cnt = 5, .res = MX_OK },
+    { .reg = { .base = 0x12FFF, .size = 0x1002 }, .ovl = false, .cnt = 6, .res = ZX_ERR_INVALID_ARGS },
+    { .reg = { .base = 0x12FFF, .size = 0x1002 }, .ovl = true,  .cnt = 5, .res = ZX_OK },
 
     // Current: [0xE000,  0x15000) [0x16000, 0x17000) [0x18000, 0x19000) [0x1A000, 0x1B000)
     //          [0x1C000, 0x1D000)
 
     // Add a region which completely consumes one region, and intersects the
     // front of another.
-    { .reg = { .base = 0x15800, .size = 0x3000 }, .ovl = false, .cnt = 5, .res = MX_ERR_INVALID_ARGS },
-    { .reg = { .base = 0x15800, .size = 0x3000 }, .ovl = true,  .cnt = 4, .res = MX_OK },
+    { .reg = { .base = 0x15800, .size = 0x3000 }, .ovl = false, .cnt = 5, .res = ZX_ERR_INVALID_ARGS },
+    { .reg = { .base = 0x15800, .size = 0x3000 }, .ovl = true,  .cnt = 4, .res = ZX_OK },
 
     // Current: [0xE000,  0x15000) [0x15800, 0x19000) [0x1A000, 0x1B000) [0x1C000, 0x1D000)
 
     // Same test as before, but this time from the end.
-    { .reg = { .base = 0x18800, .size = 0x3000 }, .ovl = false, .cnt = 4, .res = MX_ERR_INVALID_ARGS },
-    { .reg = { .base = 0x18800, .size = 0x3000 }, .ovl = true,  .cnt = 3, .res = MX_OK },
+    { .reg = { .base = 0x18800, .size = 0x3000 }, .ovl = false, .cnt = 4, .res = ZX_ERR_INVALID_ARGS },
+    { .reg = { .base = 0x18800, .size = 0x3000 }, .ovl = true,  .cnt = 3, .res = ZX_OK },
 
     // Current: [0xE000,  0x15000) [0x15800, 0x1B800) [0x1C000, 0x1D000)
 
     // Add one more region, this one should consume and unify all regions in the
     // set.
-    { .reg = { .base = 0xD000, .size = 0x11000 }, .ovl = false, .cnt = 3, .res = MX_ERR_INVALID_ARGS },
-    { .reg = { .base = 0xD000, .size = 0x11000 }, .ovl = true,  .cnt = 1, .res = MX_OK },
+    { .reg = { .base = 0xD000, .size = 0x11000 }, .ovl = false, .cnt = 3, .res = ZX_ERR_INVALID_ARGS },
+    { .reg = { .base = 0xD000, .size = 0x11000 }, .ovl = true,  .cnt = 1, .res = ZX_OK },
 
     // Current: [0xD000,  0x1E000)
 };
@@ -281,7 +281,7 @@
     bool            add;        // Whether to this is an add operation or not.
     bool            incomplete; // If subtracting, do we allow incomplete subtraction?
     size_t          cnt;        // Expected available region count the operation.
-    bool            res;        // Whether we expect succes MX_ERR_INVALID_ARGS.
+    bool            res;        // Whether we expect succes ZX_ERR_INVALID_ARGS.
 } alloc_subtract_test_t;
 
 // Temp macro to help make the test table pretty.
diff --git a/system/utest/region-alloc/region-alloc-c-api.c b/system/utest/region-alloc/region-alloc-c-api.c
index 62002c7..0caf971 100644
--- a/system/utest/region-alloc/region-alloc-c-api.c
+++ b/system/utest/region-alloc/region-alloc-c-api.c
@@ -15,12 +15,12 @@
     // Require that this succeeds, we will not be able to run the tests without
     // it.
     ralloc_pool_t* pool;
-    ASSERT_EQ(MX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
+    ASSERT_EQ(ZX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
     ASSERT_NONNULL(pool, "");
 
     // Create an allocator.
     ralloc_allocator_t* alloc;
-    ASSERT_EQ(MX_OK, ralloc_create_allocator(&alloc), "");
+    ASSERT_EQ(ZX_OK, ralloc_create_allocator(&alloc), "");
     ASSERT_NONNULL(alloc, "");
 
     {
@@ -29,15 +29,15 @@
         const ralloc_region_t tmp = { .base = 0u, .size = 1u };
         const ralloc_region_t* out;
 
-        EXPECT_EQ(MX_ERR_BAD_STATE, ralloc_add_region(alloc, &tmp, false), "");
-        EXPECT_EQ(MX_ERR_BAD_STATE, ralloc_get_sized_region_ex(alloc, 1u, 1u, &out), "");
-        EXPECT_EQ(MX_ERR_BAD_STATE, ralloc_get_specific_region_ex(alloc, &tmp, &out), "");
+        EXPECT_EQ(ZX_ERR_BAD_STATE, ralloc_add_region(alloc, &tmp, false), "");
+        EXPECT_EQ(ZX_ERR_BAD_STATE, ralloc_get_sized_region_ex(alloc, 1u, 1u, &out), "");
+        EXPECT_EQ(ZX_ERR_BAD_STATE, ralloc_get_specific_region_ex(alloc, &tmp, &out), "");
         EXPECT_NULL(ralloc_get_sized_region(alloc, 1u, 1u), "");
         EXPECT_NULL(ralloc_get_specific_region(alloc, &tmp), "");
     }
 
     // Assign our pool to our allocator, but hold onto the pool for now.
-    EXPECT_EQ(MX_OK, ralloc_set_region_pool(alloc, pool), "");
+    EXPECT_EQ(ZX_OK, ralloc_set_region_pool(alloc, pool), "");
 
     // Release our pool reference.  The allocator should be holding onto its own
     // reference at this point.
@@ -46,14 +46,14 @@
 
     // Add some regions to our allocator.
     for (size_t i = 0; i < countof(GOOD_REGIONS); ++i)
-        EXPECT_EQ(MX_OK, ralloc_add_region(alloc, &GOOD_REGIONS[i], false), "");
+        EXPECT_EQ(ZX_OK, ralloc_add_region(alloc, &GOOD_REGIONS[i], false), "");
 
     // Make a new pool and try to assign it to the allocator.  This should fail
     // because the allocator is currently using resources from its currently
     // assigned pool.
-    ASSERT_EQ(MX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
+    ASSERT_EQ(ZX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
     ASSERT_NONNULL(pool, "");
-    EXPECT_EQ(MX_ERR_BAD_STATE, ralloc_set_region_pool(alloc, pool), "");
+    EXPECT_EQ(ZX_ERR_BAD_STATE, ralloc_set_region_pool(alloc, pool), "");
 
     // Add a bunch of adjacent regions to our pool.  Try to add so many
     // that we would normally run out of bookkeeping space.  We should not
@@ -63,7 +63,7 @@
         ralloc_region_t tmp = { .base = GOOD_MERGE_REGION_BASE,
                                      .size = GOOD_MERGE_REGION_SIZE };
         for (size_t i = 0; i < OOM_RANGE_LIMIT; ++i) {
-            ASSERT_EQ(MX_OK, ralloc_add_region(alloc, &tmp, false), "");
+            ASSERT_EQ(ZX_OK, ralloc_add_region(alloc, &tmp, false), "");
             tmp.base += tmp.size;
         }
     }
@@ -71,7 +71,7 @@
     // Attempt (and fail) to add some bad regions (regions which overlap,
     // regions which wrap the address space)
     for (size_t i = 0; i < countof(BAD_REGIONS); ++i)
-        EXPECT_EQ(MX_ERR_INVALID_ARGS, ralloc_add_region(alloc, &BAD_REGIONS[i], false), "");
+        EXPECT_EQ(ZX_ERR_INVALID_ARGS, ralloc_add_region(alloc, &BAD_REGIONS[i], false), "");
 
     // Force the region bookkeeping pool to run out of memory by adding more and
     // more regions until we eventuall run out of room.  Make sure that the
@@ -82,11 +82,11 @@
         ralloc_region_t tmp = { .base = BAD_MERGE_REGION_BASE,
                                 .size = BAD_MERGE_REGION_SIZE };
         for (i = 0; i < OOM_RANGE_LIMIT; ++i) {
-            mx_status_t res;
+            zx_status_t res;
 
             res = ralloc_add_region(alloc, &tmp, false);
-            if (res != MX_OK) {
-                EXPECT_EQ(MX_ERR_NO_MEMORY, res, "");
+            if (res != ZX_OK) {
+                EXPECT_EQ(ZX_ERR_NO_MEMORY, res, "");
                 break;
             }
 
@@ -102,7 +102,7 @@
 
     // Now assign the second pool to the allocator.  Now that the allocator is
     // no longer using any resources, this should succeed.
-    EXPECT_EQ(MX_OK, ralloc_set_region_pool(alloc, pool), "");
+    EXPECT_EQ(ZX_OK, ralloc_set_region_pool(alloc, pool), "");
 
     // Release our pool reference.
     ralloc_release_pool(pool);
@@ -120,13 +120,13 @@
     ralloc_allocator_t* alloc = NULL;
     {
         ralloc_pool_t* pool;
-        ASSERT_EQ(MX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
+        ASSERT_EQ(ZX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
         ASSERT_NONNULL(pool, "");
 
         // Create an allocator and add our region pool to it.
-        ASSERT_EQ(MX_OK, ralloc_create_allocator(&alloc), "");
+        ASSERT_EQ(ZX_OK, ralloc_create_allocator(&alloc), "");
         ASSERT_NONNULL(alloc, "");
-        ASSERT_EQ(MX_OK, ralloc_set_region_pool(alloc, pool), "");
+        ASSERT_EQ(ZX_OK, ralloc_set_region_pool(alloc, pool), "");
 
         // Release our pool reference.  The allocator should be holding onto its own
         // reference at this point.
@@ -134,7 +134,7 @@
     }
 
     for (size_t i = 0; i < countof(ALLOC_BY_SIZE_REGIONS); ++i)
-        EXPECT_EQ(MX_OK, ralloc_add_region(alloc, &ALLOC_BY_SIZE_REGIONS[i], false), "");
+        EXPECT_EQ(ZX_OK, ralloc_add_region(alloc, &ALLOC_BY_SIZE_REGIONS[i], false), "");
 
     // Run the alloc by size tests.  Hold onto the regions it allocates so they
     // can be cleaned up properly when the test finishes.
@@ -143,7 +143,7 @@
 
     for (size_t i = 0; i < countof(ALLOC_BY_SIZE_TESTS); ++i) {
         const alloc_by_size_alloc_test_t* TEST = ALLOC_BY_SIZE_TESTS + i;
-        mx_status_t res = ralloc_get_sized_region_ex(alloc,
+        zx_status_t res = ralloc_get_sized_region_ex(alloc,
                                                      TEST->size,
                                                      TEST->align,
                                                      regions + i);
@@ -154,7 +154,7 @@
         // If the allocation claimed to succeed, we should have gotten
         // back a non-null region.  Otherwise, we should have gotten a
         // null region back.
-        if (res == MX_OK) {
+        if (res == ZX_OK) {
             ASSERT_NONNULL(regions[i], "");
         } else {
             EXPECT_NULL(regions[i], "");
@@ -163,7 +163,7 @@
         // If the allocation succeeded, and we expected it to succeed,
         // the allocation should have come from the test region we
         // expect and be aligned in the way we asked.
-        if ((res == MX_OK) && (TEST->res == MX_OK)) {
+        if ((res == ZX_OK) && (TEST->res == ZX_OK)) {
             ASSERT_LT(TEST->region, countof(ALLOC_BY_SIZE_TESTS), "");
             EXPECT_TRUE(region_contains_region(ALLOC_BY_SIZE_REGIONS + TEST->region,
                                                regions[i]), "");
@@ -190,13 +190,13 @@
     ralloc_allocator_t* alloc = NULL;
     {
         ralloc_pool_t* pool;
-        ASSERT_EQ(MX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
+        ASSERT_EQ(ZX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
         ASSERT_NONNULL(pool, "");
 
         // Create an allocator and add our region pool to it.
-        ASSERT_EQ(MX_OK, ralloc_create_allocator(&alloc), "");
+        ASSERT_EQ(ZX_OK, ralloc_create_allocator(&alloc), "");
         ASSERT_NONNULL(alloc, "");
-        ASSERT_EQ(MX_OK, ralloc_set_region_pool(alloc, pool), "");
+        ASSERT_EQ(ZX_OK, ralloc_set_region_pool(alloc, pool), "");
 
         // Release our pool reference.  The allocator should be holding onto its own
         // reference at this point.
@@ -204,7 +204,7 @@
     }
 
     for (size_t i = 0; i < countof(ALLOC_SPECIFIC_REGIONS); ++i)
-        EXPECT_EQ(MX_OK, ralloc_add_region(alloc, &ALLOC_SPECIFIC_REGIONS[i], false), "");
+        EXPECT_EQ(ZX_OK, ralloc_add_region(alloc, &ALLOC_SPECIFIC_REGIONS[i], false), "");
 
     // Run the alloc by size tests.  Hold onto the regions it allocates so they
     // can be cleaned up properly when the test finishes.
@@ -213,14 +213,14 @@
 
     for (size_t i = 0; i < countof(ALLOC_SPECIFIC_TESTS); ++i) {
         const alloc_specific_alloc_test_t* TEST = ALLOC_SPECIFIC_TESTS + i;
-        mx_status_t res = ralloc_get_specific_region_ex(alloc, &TEST->req, regions + i);
+        zx_status_t res = ralloc_get_specific_region_ex(alloc, &TEST->req, regions + i);
 
         // Make sure we get the test result we were expecting.
         EXPECT_EQ(TEST->res, res, "");
 
         // If the allocation claimed to succeed, we should have gotten back a
         // non-null region which exactly matches our requested region.
-        if (res == MX_OK) {
+        if (res == ZX_OK) {
             ASSERT_NONNULL(regions[i], "");
             EXPECT_EQ(TEST->req.base, regions[i]->base, "");
             EXPECT_EQ(TEST->req.size, regions[i]->size, "");
@@ -247,13 +247,13 @@
     ralloc_allocator_t* alloc = NULL;
     {
         ralloc_pool_t* pool;
-        ASSERT_EQ(MX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
+        ASSERT_EQ(ZX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
         ASSERT_NONNULL(pool, "");
 
         // Create an allocator and add our region pool to it.
-        ASSERT_EQ(MX_OK, ralloc_create_allocator(&alloc), "");
+        ASSERT_EQ(ZX_OK, ralloc_create_allocator(&alloc), "");
         ASSERT_NONNULL(alloc, "");
-        ASSERT_EQ(MX_OK, ralloc_set_region_pool(alloc, pool), "");
+        ASSERT_EQ(ZX_OK, ralloc_set_region_pool(alloc, pool), "");
 
         // Release our pool reference.  The allocator should be holding onto its own
         // reference at this point.
@@ -264,7 +264,7 @@
     for (size_t i = 0; i < countof(ADD_OVERLAP_TESTS); ++i) {
         const alloc_add_overlap_test_t* TEST = ADD_OVERLAP_TESTS + i;
 
-        mx_status_t res = ralloc_add_region(alloc, &TEST->reg, TEST->ovl);
+        zx_status_t res = ralloc_add_region(alloc, &TEST->reg, TEST->ovl);
 
         EXPECT_EQ(TEST->res, res, "");
         EXPECT_EQ(TEST->cnt, ralloc_get_available_region_count(alloc), "");
@@ -283,13 +283,13 @@
     ralloc_allocator_t* alloc = NULL;
     {
         ralloc_pool_t* pool;
-        ASSERT_EQ(MX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
+        ASSERT_EQ(ZX_OK, ralloc_create_pool(REGION_POOL_MAX_SIZE, &pool), "");
         ASSERT_NONNULL(pool, "");
 
         // Create an allocator and add our region pool to it.
-        ASSERT_EQ(MX_OK, ralloc_create_allocator(&alloc), "");
+        ASSERT_EQ(ZX_OK, ralloc_create_allocator(&alloc), "");
         ASSERT_NONNULL(alloc, "");
-        ASSERT_EQ(MX_OK, ralloc_set_region_pool(alloc, pool), "");
+        ASSERT_EQ(ZX_OK, ralloc_set_region_pool(alloc, pool), "");
 
         // Release our pool reference.  The allocator should be holding onto its own
         // reference at this point.
@@ -300,13 +300,13 @@
     for (size_t i = 0; i < countof(SUBTRACT_TESTS); ++i) {
         const alloc_subtract_test_t* TEST = SUBTRACT_TESTS + i;
 
-        mx_status_t res;
+        zx_status_t res;
         if (TEST->add)
             res = ralloc_add_region(alloc, &TEST->reg, false);
         else
             res = ralloc_sub_region(alloc, &TEST->reg, TEST->incomplete);
 
-        EXPECT_EQ(TEST->res ? MX_OK : MX_ERR_INVALID_ARGS, res, "");
+        EXPECT_EQ(TEST->res ? ZX_OK : ZX_ERR_INVALID_ARGS, res, "");
         EXPECT_EQ(TEST->cnt, ralloc_get_available_region_count(alloc), "");
     }
 
diff --git a/system/utest/region-alloc/region-alloc.cpp b/system/utest/region-alloc/region-alloc.cpp
index b296df8..e53b679 100644
--- a/system/utest/region-alloc/region-alloc.cpp
+++ b/system/utest/region-alloc/region-alloc.cpp
@@ -20,9 +20,9 @@
         // Make sure that it refuses to perform any operations because it has no
         // RegionPool assigned to it yet.
         RegionAllocator::Region::UPtr tmp;
-        EXPECT_EQ(MX_ERR_BAD_STATE, alloc.AddRegion({ 0u, 1u }));
-        EXPECT_EQ(MX_ERR_BAD_STATE, alloc.GetRegion(1, tmp));
-        EXPECT_EQ(MX_ERR_BAD_STATE, alloc.GetRegion({ 0u, 1u }, tmp));
+        EXPECT_EQ(ZX_ERR_BAD_STATE, alloc.AddRegion({ 0u, 1u }));
+        EXPECT_EQ(ZX_ERR_BAD_STATE, alloc.GetRegion(1, tmp));
+        EXPECT_EQ(ZX_ERR_BAD_STATE, alloc.GetRegion({ 0u, 1u }, tmp));
         EXPECT_NULL(alloc.GetRegion(1));
         EXPECT_NULL(alloc.GetRegion({ 0u, 1u }));
     }
@@ -32,7 +32,7 @@
     ASSERT_NONNULL(pool);
 
     // Assign our pool to our allocator, but hold onto the pool for now.
-    ASSERT_EQ(MX_OK, alloc.SetRegionPool(pool));
+    ASSERT_EQ(ZX_OK, alloc.SetRegionPool(pool));
     EXPECT_NONNULL(pool);
 
     // Create another allocator and transfer ownership of our region pool
@@ -45,14 +45,14 @@
 
     // Add some regions to our allocator.
     for (size_t i = 0; i < fbl::count_of(GOOD_REGIONS); ++i)
-        EXPECT_EQ(MX_OK, alloc.AddRegion(GOOD_REGIONS[i]));
+        EXPECT_EQ(ZX_OK, alloc.AddRegion(GOOD_REGIONS[i]));
 
     // Make a new pool and try to assign it to the allocator.  This should fail
     // because the allocator is currently using resources from its currently
     // assigned pool.
     auto pool2 = RegionAllocator::RegionPool::Create(REGION_POOL_MAX_SIZE);
     ASSERT_NONNULL(pool2);
-    EXPECT_EQ(MX_ERR_BAD_STATE, alloc.SetRegionPool(pool2));
+    EXPECT_EQ(ZX_ERR_BAD_STATE, alloc.SetRegionPool(pool2));
 
     // Add a bunch of adjacent regions to our pool.  Try to add so many
     // that we would normally run out of bookkeeping space.  We should not
@@ -62,7 +62,7 @@
         ralloc_region_t tmp = { .base = GOOD_MERGE_REGION_BASE,
                                 .size = GOOD_MERGE_REGION_SIZE };
         for (size_t i = 0; i < OOM_RANGE_LIMIT; ++i) {
-            ASSERT_EQ(MX_OK, alloc.AddRegion(tmp));
+            ASSERT_EQ(ZX_OK, alloc.AddRegion(tmp));
             tmp.base += tmp.size;
         }
     }
@@ -70,7 +70,7 @@
     // Attempt (and fail) to add some bad regions (regions which overlap,
     // regions which wrap the address space)
     for (size_t i = 0; i < fbl::count_of(BAD_REGIONS); ++i)
-        EXPECT_EQ(MX_ERR_INVALID_ARGS, alloc.AddRegion(BAD_REGIONS[i]));
+        EXPECT_EQ(ZX_ERR_INVALID_ARGS, alloc.AddRegion(BAD_REGIONS[i]));
 
     // Force the region bookkeeping pool to run out of memory by adding more and
     // more regions until we eventually run out of room.  Make sure that the
@@ -81,11 +81,11 @@
         ralloc_region_t tmp = { .base = BAD_MERGE_REGION_BASE,
                                 .size = BAD_MERGE_REGION_SIZE };
         for (i = 0; i < OOM_RANGE_LIMIT; ++i) {
-            mx_status_t res;
+            zx_status_t res;
 
             res = alloc.AddRegion(tmp);
-            if (res != MX_OK) {
-                EXPECT_EQ(MX_ERR_NO_MEMORY, res);
+            if (res != ZX_OK) {
+                EXPECT_EQ(ZX_ERR_NO_MEMORY, res);
                 break;
             }
 
@@ -101,7 +101,7 @@
 
     // Now assign pool2 to the allocator.  Now that it is no longer using any
     // resources, this should succeed.
-    EXPECT_EQ(MX_OK, alloc.SetRegionPool(fbl::move(pool2)));
+    EXPECT_EQ(ZX_OK, alloc.SetRegionPool(fbl::move(pool2)));
     EXPECT_NULL(pool2);
 
     END_TEST;
@@ -114,7 +114,7 @@
     RegionAllocator alloc(RegionAllocator::RegionPool::Create(REGION_POOL_MAX_SIZE));
 
     for (size_t i = 0; i < fbl::count_of(ALLOC_BY_SIZE_REGIONS); ++i)
-        ASSERT_EQ(MX_OK, alloc.AddRegion(ALLOC_BY_SIZE_REGIONS[i]));
+        ASSERT_EQ(ZX_OK, alloc.AddRegion(ALLOC_BY_SIZE_REGIONS[i]));
 
     // Run the alloc by size tests.  Hold onto the regions it allocates so they
     // don't automatically get returned to the pool.
@@ -122,7 +122,7 @@
 
     for (size_t i = 0; i < fbl::count_of(ALLOC_BY_SIZE_TESTS); ++i) {
         const alloc_by_size_alloc_test_t* TEST = ALLOC_BY_SIZE_TESTS + i;
-        mx_status_t res = alloc.GetRegion(TEST->size, TEST->align, regions[i]);
+        zx_status_t res = alloc.GetRegion(TEST->size, TEST->align, regions[i]);
 
         // Make sure we get the test result we were expecting.
         EXPECT_EQ(TEST->res, res);
@@ -130,7 +130,7 @@
         // If the allocation claimed to succeed, we should have gotten
         // back a non-null region.  Otherwise, we should have gotten a
         // null region back.
-        if (res == MX_OK) {
+        if (res == ZX_OK) {
             ASSERT_NONNULL(regions[i]);
         } else {
             EXPECT_NULL(regions[i]);
@@ -139,7 +139,7 @@
         // If the allocation succeeded, and we expected it to succeed,
         // the allocation should have come from the test region we
         // expect and be aligned in the way we asked.
-        if ((res == MX_OK) && (TEST->res == MX_OK)) {
+        if ((res == ZX_OK) && (TEST->res == ZX_OK)) {
             ASSERT_LT(TEST->region, fbl::count_of(ALLOC_BY_SIZE_TESTS));
             EXPECT_TRUE(region_contains_region(ALLOC_BY_SIZE_REGIONS + TEST->region,
                                                regions[i].get()));
@@ -162,7 +162,7 @@
     RegionAllocator alloc(RegionAllocator::RegionPool::Create(REGION_POOL_MAX_SIZE));
 
     for (size_t i = 0; i < fbl::count_of(ALLOC_SPECIFIC_REGIONS); ++i)
-        ASSERT_EQ(MX_OK, alloc.AddRegion(ALLOC_SPECIFIC_REGIONS[i]));
+        ASSERT_EQ(ZX_OK, alloc.AddRegion(ALLOC_SPECIFIC_REGIONS[i]));
 
     // Run the alloc specific tests.  Hold onto the regions it allocates so they
     // don't automatically get returned to the pool.
@@ -170,14 +170,14 @@
 
     for (size_t i = 0; i < fbl::count_of(ALLOC_SPECIFIC_TESTS); ++i) {
         const alloc_specific_alloc_test_t* TEST = ALLOC_SPECIFIC_TESTS + i;
-        mx_status_t res = alloc.GetRegion(TEST->req, regions[i]);
+        zx_status_t res = alloc.GetRegion(TEST->req, regions[i]);
 
         // Make sure we get the test result we were expecting.
         EXPECT_EQ(TEST->res, res);
 
         // If the allocation claimed to succeed, we should have gotten back a
         // non-null region which exactly matches our requested region.
-        if (res == MX_OK) {
+        if (res == ZX_OK) {
             ASSERT_NONNULL(regions[i]);
             EXPECT_EQ(TEST->req.base, regions[i]->base);
             EXPECT_EQ(TEST->req.size, regions[i]->size);
@@ -203,7 +203,7 @@
     for (size_t i = 0; i < fbl::count_of(ADD_OVERLAP_TESTS); ++i) {
         const alloc_add_overlap_test_t* TEST = ADD_OVERLAP_TESTS + i;
 
-        mx_status_t res = alloc.AddRegion(TEST->reg, TEST->ovl);
+        zx_status_t res = alloc.AddRegion(TEST->reg, TEST->ovl);
 
         EXPECT_EQ(TEST->res, res);
         EXPECT_EQ(TEST->cnt, alloc.AvailableRegionCount());
@@ -222,13 +222,13 @@
     for (size_t i = 0; i < fbl::count_of(SUBTRACT_TESTS); ++i) {
         const alloc_subtract_test_t* TEST = SUBTRACT_TESTS + i;
 
-        mx_status_t res;
+        zx_status_t res;
         if (TEST->add)
             res = alloc.AddRegion(TEST->reg);
         else
             res = alloc.SubtractRegion(TEST->reg, TEST->incomplete);
 
-        EXPECT_EQ(TEST->res ? MX_OK : MX_ERR_INVALID_ARGS, res);
+        EXPECT_EQ(TEST->res ? ZX_OK : ZX_ERR_INVALID_ARGS, res);
         EXPECT_EQ(TEST->cnt, alloc.AvailableRegionCount());
     }
 
diff --git a/system/utest/region-alloc/rules.mk b/system/utest/region-alloc/rules.mk
index 1f66719..df0ac93 100644
--- a/system/utest/region-alloc/rules.mk
+++ b/system/utest/region-alloc/rules.mk
@@ -17,12 +17,12 @@
 
 MODULE_STATIC_LIBS := \
     system/ulib/region-alloc \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/unittest
 
 include make/module.mk
diff --git a/system/utest/register-state/register-state-test.cpp b/system/utest/register-state/register-state-test.cpp
index 3db7474..7c101af 100644
--- a/system/utest/register-state/register-state-test.cpp
+++ b/system/utest/register-state/register-state-test.cpp
@@ -5,7 +5,7 @@
 #include <assert.h>
 #include <pthread.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 #if defined(__x86_64__)
@@ -64,7 +64,7 @@
     // should be at least one CPU that has >1 of our threads scheduled on
     // it, so saving and restoring gs_base between those threads should get
     // exercised.
-    uint32_t thread_count = mx_system_get_num_cpus() * 2;
+    uint32_t thread_count = zx_system_get_num_cpus() * 2;
     ASSERT_GT(thread_count, 0);
 
     pthread_t tids[thread_count];
@@ -143,7 +143,7 @@
     //
     // It is possible that this thread is interrupted by an interrupt, but
     // not very likely, because this thread does not execute very long.
-    EXPECT_EQ(mx_nanosleep(mx_deadline_after(MX_MSEC(1))), MX_OK);
+    EXPECT_EQ(zx_nanosleep(zx_deadline_after(ZX_MSEC(1))), ZX_OK);
 
     EXPECT_EQ(get_ds(), 0);
     EXPECT_EQ(get_es(), 0);
diff --git a/system/utest/register-state/rules.mk b/system/utest/register-state/rules.mk
index 855c13a..56cf661 100644
--- a/system/utest/register-state/rules.mk
+++ b/system/utest/register-state/rules.mk
@@ -15,8 +15,8 @@
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/unittest \
 
 include make/module.mk
diff --git a/system/utest/sanitizer/rules.mk b/system/utest/sanitizer/rules.mk
index 0eac586..4db85cf 100644
--- a/system/utest/sanitizer/rules.mk
+++ b/system/utest/sanitizer/rules.mk
@@ -17,8 +17,8 @@
 MODULE_LIBS := \
     system/ulib/unittest \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/sanitizer/sanitizer-utils.c b/system/utest/sanitizer/sanitizer-utils.c
index 7686252..596a74c 100644
--- a/system/utest/sanitizer/sanitizer-utils.c
+++ b/system/utest/sanitizer/sanitizer-utils.c
@@ -3,10 +3,10 @@
 // found in the LICENSE file.
 
 #include <launchpad/loader-service.h>
-#include <magenta/dlfcn.h>
-#include <magenta/processargs.h>
-#include <magenta/sanitizer.h>
-#include <magenta/syscalls.h>
+#include <zircon/dlfcn.h>
+#include <zircon/processargs.h>
+#include <zircon/sanitizer.h>
+#include <zircon/syscalls.h>
 
 #include <unittest/unittest.h>
 
@@ -17,9 +17,9 @@
 static atomic_bool my_loader_service_ok;
 static atomic_int my_loader_service_calls;
 
-static mx_status_t sink_test_loader_service(void* arg, uint32_t load_op,
-                                            mx_handle_t request_handle,
-                                            const char* name, mx_handle_t* out) {
+static zx_status_t sink_test_loader_service(void* arg, uint32_t load_op,
+                                            zx_handle_t request_handle,
+                                            const char* name, zx_handle_t* out) {
     ++my_loader_service_calls;
 
     EXPECT_EQ(load_op, (uint32_t)LOADER_SVC_OP_PUBLISH_DATA_SINK,
@@ -28,20 +28,20 @@
     EXPECT_STR_EQ(TEST_SINK_NAME, name, sizeof(TEST_SINK_NAME) - 1,
                   "called with unexpected name");
 
-    EXPECT_NE(request_handle, MX_HANDLE_INVALID,
+    EXPECT_NE(request_handle, ZX_HANDLE_INVALID,
              "called with invalid handle");
 
-    char vmo_name[MX_MAX_NAME_LEN];
-    EXPECT_EQ(mx_object_get_property(request_handle, MX_PROP_NAME,
+    char vmo_name[ZX_MAX_NAME_LEN];
+    EXPECT_EQ(zx_object_get_property(request_handle, ZX_PROP_NAME,
                                      vmo_name, sizeof(vmo_name)),
-              MX_OK, "get MX_PROP_NAME");
+              ZX_OK, "get ZX_PROP_NAME");
     EXPECT_STR_EQ(TEST_SINK_NAME, vmo_name, sizeof(vmo_name),
                   "not called with expected VMO handle");
 
-    EXPECT_EQ(mx_handle_close(request_handle), MX_OK, "");
+    EXPECT_EQ(zx_handle_close(request_handle), ZX_OK, "");
 
     my_loader_service_ok = current_test_info->all_ok;
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool publish_data_test(void) {
@@ -50,20 +50,20 @@
     my_loader_service_calls = 0;
 
     // Spin up our test service.
-    mx_handle_t my_service;
-    mx_status_t status = loader_service_simple(&sink_test_loader_service, NULL, &my_service);
-    ASSERT_EQ(status, MX_OK, "mxio_loader_service");
+    zx_handle_t my_service;
+    zx_status_t status = loader_service_simple(&sink_test_loader_service, NULL, &my_service);
+    ASSERT_EQ(status, ZX_OK, "fdio_loader_service");
 
     // Install the service.
-    mx_handle_t old = dl_set_loader_service(my_service);
-    EXPECT_NE(old, MX_HANDLE_INVALID, "dl_set_loader_service");
+    zx_handle_t old = dl_set_loader_service(my_service);
+    EXPECT_NE(old, ZX_HANDLE_INVALID, "dl_set_loader_service");
 
     // Make up a VMO to publish.
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(0, 0, &vmo), MX_OK, "");
-    EXPECT_EQ(mx_object_set_property(vmo, MX_PROP_NAME,
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(0, 0, &vmo), ZX_OK, "");
+    EXPECT_EQ(zx_object_set_property(vmo, ZX_PROP_NAME,
                                      TEST_SINK_NAME, sizeof(TEST_SINK_NAME)),
-              MX_OK, "");
+              ZX_OK, "");
 
     // Publish the VMO to our data sink.
     __sanitizer_publish_data(TEST_SINK_NAME, vmo);
@@ -74,36 +74,36 @@
     EXPECT_TRUE(my_loader_service_ok, "loader service thread not happy");
 
     // Put things back to how they were.
-    mx_handle_t old2 = dl_set_loader_service(old);
+    zx_handle_t old2 = dl_set_loader_service(old);
     EXPECT_EQ(old2, my_service, "unexpected previous service handle");
-    mx_handle_close(old2);
+    zx_handle_close(old2);
 
     END_TEST;
 }
 
-static mx_handle_t test_config_vmo = MX_HANDLE_INVALID;
+static zx_handle_t test_config_vmo = ZX_HANDLE_INVALID;
 
-static mx_status_t config_test_loader_service(void* arg, uint32_t load_op,
-                                              mx_handle_t request_handle,
+static zx_status_t config_test_loader_service(void* arg, uint32_t load_op,
+                                              zx_handle_t request_handle,
                                               const char* name,
-                                              mx_handle_t* out) {
+                                              zx_handle_t* out) {
     ++my_loader_service_calls;
 
     EXPECT_EQ(load_op, (uint32_t)LOADER_SVC_OP_LOAD_DEBUG_CONFIG,
               "called with unexpected load op");
 
-    EXPECT_EQ(request_handle, MX_HANDLE_INVALID, "called with a handle");
+    EXPECT_EQ(request_handle, ZX_HANDLE_INVALID, "called with a handle");
 
-    mx_handle_t result = MX_HANDLE_INVALID;
+    zx_handle_t result = ZX_HANDLE_INVALID;
     if (!strcmp(TEST_CONFIG_GOOD_NAME, name)) {
-        EXPECT_NE(test_config_vmo, MX_HANDLE_INVALID, "");
+        EXPECT_NE(test_config_vmo, ZX_HANDLE_INVALID, "");
         *out = test_config_vmo;
-        result = MX_OK;
+        result = ZX_OK;
     } else {
         EXPECT_STR_EQ(TEST_CONFIG_BAD_NAME,
                       name, sizeof(TEST_CONFIG_BAD_NAME) - 1,
                       "called with unexpected name");
-        result = MX_ERR_NOT_FOUND;
+        result = ZX_ERR_NOT_FOUND;
     }
 
     my_loader_service_ok = current_test_info->all_ok;
@@ -116,37 +116,37 @@
     my_loader_service_calls = 0;
 
     // Spin up our test service.
-    mx_handle_t my_service;
-    mx_status_t status =
+    zx_handle_t my_service;
+    zx_status_t status =
         loader_service_simple(&config_test_loader_service, NULL, &my_service);
-    ASSERT_EQ(status, MX_OK, "mxio_loader_service");
+    ASSERT_EQ(status, ZX_OK, "fdio_loader_service");
 
     // Install the service.
-    mx_handle_t old = dl_set_loader_service(my_service);
-    EXPECT_NE(old, MX_HANDLE_INVALID, "dl_set_loader_service");
+    zx_handle_t old = dl_set_loader_service(my_service);
+    EXPECT_NE(old, ZX_HANDLE_INVALID, "dl_set_loader_service");
 
     // Make up a VMO that we'll get back from the service.
-    ASSERT_EQ(mx_vmo_create(0, 0, &test_config_vmo), MX_OK, "");
+    ASSERT_EQ(zx_vmo_create(0, 0, &test_config_vmo), ZX_OK, "");
 
     // Test the success case.
-    mx_handle_t vmo = MX_HANDLE_INVALID;
+    zx_handle_t vmo = ZX_HANDLE_INVALID;
     EXPECT_EQ(__sanitizer_get_configuration(TEST_CONFIG_GOOD_NAME, &vmo),
-              MX_OK, "__sanitizer_get_configuration on valid name");
+              ZX_OK, "__sanitizer_get_configuration on valid name");
     EXPECT_EQ(vmo, test_config_vmo, "not the expected VMO handle");
 
     EXPECT_EQ(my_loader_service_calls, 1,
               "loader-service not called exactly once");
     EXPECT_TRUE(my_loader_service_ok, "loader service thread not happy");
 
-    EXPECT_EQ(mx_handle_close(test_config_vmo), MX_OK, "");
-    test_config_vmo = MX_HANDLE_INVALID;
+    EXPECT_EQ(zx_handle_close(test_config_vmo), ZX_OK, "");
+    test_config_vmo = ZX_HANDLE_INVALID;
 
     my_loader_service_ok = false;
     my_loader_service_calls = 0;
 
     // Test the failure case.
     EXPECT_EQ(__sanitizer_get_configuration(TEST_CONFIG_BAD_NAME, &vmo),
-              MX_ERR_NOT_FOUND,
+              ZX_ERR_NOT_FOUND,
               "__sanitizer_get_configuration on invalid name");
 
     EXPECT_EQ(my_loader_service_calls, 1,
@@ -154,9 +154,9 @@
     EXPECT_TRUE(my_loader_service_ok, "loader service thread not happy");
 
     // Put things back to how they were.
-    mx_handle_t old2 = dl_set_loader_service(old);
+    zx_handle_t old2 = dl_set_loader_service(old);
     EXPECT_EQ(old2, my_service, "unexpected previous service handle");
-    mx_handle_close(old2);
+    zx_handle_close(old2);
 
     END_TEST;
 }
diff --git a/system/utest/stdio/rules.mk b/system/utest/stdio/rules.mk
index c2d85e4..b2737cf 100644
--- a/system/utest/stdio/rules.mk
+++ b/system/utest/stdio/rules.mk
@@ -21,8 +21,8 @@
 MODULE_LIBS := \
     system/ulib/unittest \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/stdio/stdio.c b/system/utest/stdio/stdio.c
index ed809cc..19af65b 100644
--- a/system/utest/stdio/stdio.c
+++ b/system/utest/stdio/stdio.c
@@ -15,12 +15,12 @@
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
 
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 
-#include <mxio/util.h>
+#include <fdio/util.h>
 
 #include <unittest/unittest.h>
 
@@ -58,30 +58,30 @@
     const char* file = "/boot/bin/lsusb";
     launchpad_t* lp = NULL;
 
-    mx_handle_t mxio_job = mx_job_default();
-    ASSERT_NE(mxio_job, MX_HANDLE_INVALID, "no mxio job object");
+    zx_handle_t fdio_job = zx_job_default();
+    ASSERT_NE(fdio_job, ZX_HANDLE_INVALID, "no fdio job object");
 
-    mx_handle_t job_copy = MX_HANDLE_INVALID;
-    ASSERT_EQ(mx_handle_duplicate(mxio_job, MX_RIGHT_SAME_RIGHTS, &job_copy),
-              MX_OK, "mx_handle_duplicate failed");
+    zx_handle_t job_copy = ZX_HANDLE_INVALID;
+    ASSERT_EQ(zx_handle_duplicate(fdio_job, ZX_RIGHT_SAME_RIGHTS, &job_copy),
+              ZX_OK, "zx_handle_duplicate failed");
 
     ASSERT_EQ(launchpad_create(job_copy,
                                "launchpad_pipe_stdio_test", &lp),
-              MX_OK, "launchpad_create failed");
+              ZX_OK, "launchpad_create failed");
     ASSERT_EQ(launchpad_set_args(lp, 1, &file),
-              MX_OK, "launchpad_arguments failed");
-    ASSERT_EQ(launchpad_add_vdso_vmo(lp), MX_OK,
+              ZX_OK, "launchpad_arguments failed");
+    ASSERT_EQ(launchpad_add_vdso_vmo(lp), ZX_OK,
               "launchpad_add_vdso_vmo failed");
-    ASSERT_EQ(launchpad_clone(lp, LP_CLONE_MXIO_NAMESPACE | LP_CLONE_MXIO_CWD),
-              MX_OK, "launchpad_clone failed");
+    ASSERT_EQ(launchpad_clone(lp, LP_CLONE_FDIO_NAMESPACE | LP_CLONE_FDIO_CWD),
+              ZX_OK, "launchpad_clone failed");
 
-    mx_handle_t vmo;
-    ASSERT_EQ(launchpad_vmo_from_file(file, &vmo), MX_OK, "");
+    zx_handle_t vmo;
+    ASSERT_EQ(launchpad_vmo_from_file(file, &vmo), ZX_OK, "");
     ASSERT_EQ(launchpad_elf_load(lp, vmo),
-              MX_OK, "launchpad_elf_load failed");
+              ZX_OK, "launchpad_elf_load failed");
 
-    ASSERT_EQ(launchpad_load_vdso(lp, MX_HANDLE_INVALID),
-              MX_OK, "launchpad_load_vdso failed");
+    ASSERT_EQ(launchpad_load_vdso(lp, ZX_HANDLE_INVALID),
+              ZX_OK, "launchpad_load_vdso failed");
 
     // stdio pipe fds [ours, theirs]
     int stdin_fds[2];
@@ -93,18 +93,18 @@
     ASSERT_EQ(stdio_pipe(stderr_fds, false), 0, "stderr pipe creation failed");
 
     // Transfer the child's stdio pipes
-    ASSERT_EQ(launchpad_transfer_fd(lp, stdin_fds[1], 0), MX_OK,
+    ASSERT_EQ(launchpad_transfer_fd(lp, stdin_fds[1], 0), ZX_OK,
               "failed to transfer stdin pipe to child process");
-    ASSERT_EQ(launchpad_transfer_fd(lp, stdout_fds[1], 1), MX_OK,
+    ASSERT_EQ(launchpad_transfer_fd(lp, stdout_fds[1], 1), ZX_OK,
               "failed to transfer stdout pipe to child process");
-    ASSERT_EQ(launchpad_transfer_fd(lp, stderr_fds[1], 2), MX_OK,
+    ASSERT_EQ(launchpad_transfer_fd(lp, stderr_fds[1], 2), ZX_OK,
               "failed to transfer stderr pipe to child process");
 
     // Start the process
-    mx_handle_t p = MX_HANDLE_INVALID;
-    mx_status_t status = launchpad_go(lp, &p, NULL);
-    ASSERT_EQ(status, MX_OK, "");
-    ASSERT_NE(p, MX_HANDLE_INVALID, "process handle != 0");
+    zx_handle_t p = ZX_HANDLE_INVALID;
+    zx_status_t status = launchpad_go(lp, &p, NULL);
+    ASSERT_EQ(status, ZX_OK, "");
+    ASSERT_NE(p, ZX_HANDLE_INVALID, "process handle != 0");
 
     // Read the stdio
     uint8_t* out = NULL;
@@ -126,21 +126,21 @@
     close(stderr_fds[0]);
 
     // Wait for the process to finish
-    mx_status_t r;
+    zx_status_t r;
 
-    r = mx_object_wait_one(p, MX_PROCESS_TERMINATED,
-                           MX_TIME_INFINITE, NULL);
-    ASSERT_EQ(r, MX_OK, "mx_object_wait_one failed");
+    r = zx_object_wait_one(p, ZX_PROCESS_TERMINATED,
+                           ZX_TIME_INFINITE, NULL);
+    ASSERT_EQ(r, ZX_OK, "zx_object_wait_one failed");
 
     // read the return code
-    mx_info_process_t proc_info;
+    zx_info_process_t proc_info;
     size_t actual = 0;
-    mx_object_get_info(p, MX_INFO_PROCESS, &proc_info,
+    zx_object_get_info(p, ZX_INFO_PROCESS, &proc_info,
                        sizeof(proc_info), &actual, NULL);
     ASSERT_EQ(actual, (size_t)1, "Must get one and only one process info");
     ASSERT_EQ(proc_info.return_code, 0, "lsusb must return 0");
 
-    mx_handle_close(p);
+    zx_handle_close(p);
 
     END_TEST;
 }
diff --git a/system/utest/sysconf/rules.mk b/system/utest/sysconf/rules.mk
index 54e7097..181d9a2 100644
--- a/system/utest/sysconf/rules.mk
+++ b/system/utest/sysconf/rules.mk
@@ -13,6 +13,6 @@
 
 MODULE_NAME := sysconf-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/sysgen/rules.mk b/system/utest/sysgen/rules.mk
index a1bf0ce..d48efae 100644
--- a/system/utest/sysgen/rules.mk
+++ b/system/utest/sysgen/rules.mk
@@ -16,8 +16,8 @@
 MODULE_LIBS := \
     system/ulib/unittest \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/sysgen/sysgen.c b/system/utest/sysgen/sysgen.c
index 5c1a404..a82384a 100644
--- a/system/utest/sysgen/sysgen.c
+++ b/system/utest/sysgen/sysgen.c
@@ -4,28 +4,28 @@
 
 #include <string.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 static bool wrapper_test(void) {
     BEGIN_TEST;
-    ASSERT_EQ(mx_syscall_test_wrapper(1, 2, 3), 6, "syscall_test_wrapper doesn't add up");
-    ASSERT_EQ(mx_syscall_test_wrapper(-1, 2, 3), MX_ERR_INVALID_ARGS, "vdso should have checked args");
-    ASSERT_EQ(mx_syscall_test_wrapper(10, 20, 30), MX_ERR_OUT_OF_RANGE, "vdso should have checked the return");
+    ASSERT_EQ(zx_syscall_test_wrapper(1, 2, 3), 6, "syscall_test_wrapper doesn't add up");
+    ASSERT_EQ(zx_syscall_test_wrapper(-1, 2, 3), ZX_ERR_INVALID_ARGS, "vdso should have checked args");
+    ASSERT_EQ(zx_syscall_test_wrapper(10, 20, 30), ZX_ERR_OUT_OF_RANGE, "vdso should have checked the return");
     END_TEST;
 }
 
 static bool syscall_test(void) {
     BEGIN_TEST;
-    ASSERT_EQ(mx_syscall_test_8(1, 2, 3, 4, 5, 6, 7, 8), 36, "syscall8_test doesn't add up");
-    ASSERT_EQ(mx_syscall_test_7(1, 2, 3, 4, 5, 6, 7), 28, "syscall7_test doesn't add up");
-    ASSERT_EQ(mx_syscall_test_6(1, 2, 3, 4, 5, 6), 21, "syscall6_test doesn't add up");
-    ASSERT_EQ(mx_syscall_test_5(1, 2, 3, 4, 5), 15, "syscall5_test doesn't add up");
-    ASSERT_EQ(mx_syscall_test_4(1, 2, 3, 4), 10, "syscall4_test doesn't add up");
-    ASSERT_EQ(mx_syscall_test_3(1, 2, 3), 6, "syscall3_test doesn't add up");
-    ASSERT_EQ(mx_syscall_test_2(1, 2), 3, "syscall2_test doesn't add up");
-    ASSERT_EQ(mx_syscall_test_1(1), 1, "syscall1_test doesn't add up");
-    ASSERT_EQ(mx_syscall_test_0(), 0, "syscall0_test doesn't add up");
+    ASSERT_EQ(zx_syscall_test_8(1, 2, 3, 4, 5, 6, 7, 8), 36, "syscall8_test doesn't add up");
+    ASSERT_EQ(zx_syscall_test_7(1, 2, 3, 4, 5, 6, 7), 28, "syscall7_test doesn't add up");
+    ASSERT_EQ(zx_syscall_test_6(1, 2, 3, 4, 5, 6), 21, "syscall6_test doesn't add up");
+    ASSERT_EQ(zx_syscall_test_5(1, 2, 3, 4, 5), 15, "syscall5_test doesn't add up");
+    ASSERT_EQ(zx_syscall_test_4(1, 2, 3, 4), 10, "syscall4_test doesn't add up");
+    ASSERT_EQ(zx_syscall_test_3(1, 2, 3), 6, "syscall3_test doesn't add up");
+    ASSERT_EQ(zx_syscall_test_2(1, 2), 3, "syscall2_test doesn't add up");
+    ASSERT_EQ(zx_syscall_test_1(1), 1, "syscall1_test doesn't add up");
+    ASSERT_EQ(zx_syscall_test_0(), 0, "syscall0_test doesn't add up");
     END_TEST;
 }
 
diff --git a/system/utest/sysinfo/main.cpp b/system/utest/sysinfo/main.cpp
index cd99932..d222dd2 100644
--- a/system/utest/sysinfo/main.cpp
+++ b/system/utest/sysinfo/main.cpp
@@ -5,9 +5,9 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include <magenta/device/sysinfo.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/device/sysinfo.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <unittest/unittest.h>
 
 bool get_root_resource_succeeds() {
@@ -17,21 +17,21 @@
     int fd = open("/dev/misc/sysinfo", O_RDWR);
     ASSERT_GE(fd, 0, "Can't open sysinfo");
 
-    mx_handle_t root_resource;
+    zx_handle_t root_resource;
     ssize_t n = ioctl_sysinfo_get_root_resource(fd, &root_resource);
     close(fd);
     ASSERT_EQ(n, sizeof(root_resource), "ioctl failed");
 
     // Make sure it's a resource with the expected rights.
-    mx_info_handle_basic_t info;
-    ASSERT_EQ(mx_object_get_info(root_resource, MX_INFO_HANDLE_BASIC, &info,
+    zx_info_handle_basic_t info;
+    ASSERT_EQ(zx_object_get_info(root_resource, ZX_INFO_HANDLE_BASIC, &info,
                                  sizeof(info), nullptr, nullptr),
-              MX_OK, "Can't get handle info");
-    EXPECT_EQ(info.type, MX_OBJ_TYPE_RESOURCE, "Unexpected type");
-    EXPECT_EQ(info.rights, MX_RIGHT_TRANSFER, "Unexpected rights");
+              ZX_OK, "Can't get handle info");
+    EXPECT_EQ(info.type, ZX_OBJ_TYPE_RESOURCE, "Unexpected type");
+    EXPECT_EQ(info.rights, ZX_RIGHT_TRANSFER, "Unexpected rights");
 
     // Clean up.
-    EXPECT_EQ(mx_handle_close(root_resource), MX_OK);
+    EXPECT_EQ(zx_handle_close(root_resource), ZX_OK);
 
     END_TEST;
 }
diff --git a/system/utest/sysinfo/rules.mk b/system/utest/sysinfo/rules.mk
index afeaa30..a31431b 100644
--- a/system/utest/sysinfo/rules.mk
+++ b/system/utest/sysinfo/rules.mk
@@ -15,8 +15,8 @@
 
 MODULE_LIBS := \
     system/ulib/unittest \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/task-utils/rules.mk b/system/utest/task-utils/rules.mk
index 80a2a5f..36d2282 100644
--- a/system/utest/task-utils/rules.mk
+++ b/system/utest/task-utils/rules.mk
@@ -14,12 +14,12 @@
 MODULE_NAME := task-utils-test
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/task-utils
 
 MODULE_LIBS := \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/c \
     system/ulib/unittest
 
diff --git a/system/utest/task-utils/walker.cpp b/system/utest/task-utils/walker.cpp
index be0cb17..0e26ddd 100644
--- a/system/utest/task-utils/walker.cpp
+++ b/system/utest/task-utils/walker.cpp
@@ -4,16 +4,16 @@
 
 #include <task-utils/walker.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <unittest/unittest.h>
 
 namespace {
 
-bool is_valid_handle(mx_handle_t handle) {
-    return mx_object_get_info(
-               handle, MX_INFO_HANDLE_VALID, nullptr, 0, nullptr, nullptr) ==
-           MX_OK;
+bool is_valid_handle(zx_handle_t handle) {
+    return zx_object_get_info(
+               handle, ZX_INFO_HANDLE_VALID, nullptr, 0, nullptr, nullptr) ==
+           ZX_OK;
 }
 
 // TestTaskEnumerator ctor flags.
@@ -51,8 +51,8 @@
     }
 
 protected:
-    virtual mx_status_t OnJob(int depth, mx_handle_t job, mx_koid_t koid,
-                              mx_koid_t parent_koid) override {
+    virtual zx_status_t OnJob(int depth, zx_handle_t job, zx_koid_t koid,
+                              zx_koid_t parent_koid) override {
         EXPECT_TRUE(has_on_job());
         EXPECT_GE(depth, 0);
         EXPECT_TRUE(is_valid_handle(job));
@@ -63,29 +63,29 @@
             EXPECT_NE(parent_koid, 0, "non-root job");
         }
         jobs_seen_++;
-        return MX_OK;
+        return ZX_OK;
     }
-    virtual mx_status_t OnProcess(int depth, mx_handle_t process,
-                                  mx_koid_t koid,
-                                  mx_koid_t parent_koid) override {
+    virtual zx_status_t OnProcess(int depth, zx_handle_t process,
+                                  zx_koid_t koid,
+                                  zx_koid_t parent_koid) override {
         EXPECT_TRUE(has_on_process());
         EXPECT_GT(depth, 0, "process depth should always be > 0");
         EXPECT_TRUE(is_valid_handle(process));
         EXPECT_NE(koid, 0);
         EXPECT_NE(parent_koid, 0);
         processes_seen_++;
-        return MX_OK;
+        return ZX_OK;
     }
-    virtual mx_status_t OnThread(int depth, mx_handle_t thread,
-                                 mx_koid_t koid,
-                                 mx_koid_t parent_koid) override {
+    virtual zx_status_t OnThread(int depth, zx_handle_t thread,
+                                 zx_koid_t koid,
+                                 zx_koid_t parent_koid) override {
         EXPECT_TRUE(has_on_thread());
         EXPECT_GT(depth, 1, "thread depth should always be > 1");
         EXPECT_TRUE(is_valid_handle(thread));
         EXPECT_NE(koid, 0);
         EXPECT_NE(parent_koid, 0);
         threads_seen_++;
-        return MX_OK;
+        return ZX_OK;
     }
 
 private:
@@ -108,12 +108,12 @@
     // same for other tests in this file. utest/core/object-info and
     // utest/policy (and maybe more) already do their own test job-tree
     // building; create a common helper lib.
-    EXPECT_EQ(tte.WalkRootJobTree(), MX_OK);
+    EXPECT_EQ(tte.WalkRootJobTree(), ZX_OK);
     tte.Validate();
     END_TEST;
 }
 
-// A subclass of TestTaskEnumerator that will return a non-MX_OK status
+// A subclass of TestTaskEnumerator that will return a non-ZX_OK status
 // at some point, demonstrating that the walk stops and the status value
 // is passed to the caller.
 class FailingTaskEnumerator : public TestTaskEnumerator {
@@ -122,7 +122,7 @@
         : TestTaskEnumerator(flags), poison_depth_(poison_depth) {}
 
     // An unusual error code not used by the base class.
-    static constexpr mx_status_t FailingStatus = MX_ERR_STOP;
+    static constexpr zx_status_t FailingStatus = ZX_ERR_STOP;
 
 private:
     // Not worth calling since the walk will stop before completing.
@@ -130,30 +130,30 @@
         EXPECT_TRUE(false);
     }
 
-    mx_status_t OnJob(int depth, mx_handle_t job,
-                      mx_koid_t koid, mx_koid_t parent_koid) override {
+    zx_status_t OnJob(int depth, zx_handle_t job,
+                      zx_koid_t koid, zx_koid_t parent_koid) override {
         EXPECT_FALSE(poisoned_);
         return MaybePoison(
             depth,
             TestTaskEnumerator::OnJob(depth, job, koid, parent_koid));
     }
-    mx_status_t OnProcess(int depth, mx_handle_t process,
-                          mx_koid_t koid, mx_koid_t parent_koid) override {
+    zx_status_t OnProcess(int depth, zx_handle_t process,
+                          zx_koid_t koid, zx_koid_t parent_koid) override {
         EXPECT_FALSE(poisoned_);
         return MaybePoison(
             depth,
             TestTaskEnumerator::OnProcess(depth, process, koid, parent_koid));
     }
-    mx_status_t OnThread(int depth, mx_handle_t thread,
-                         mx_koid_t koid, mx_koid_t parent_koid) override {
+    zx_status_t OnThread(int depth, zx_handle_t thread,
+                         zx_koid_t koid, zx_koid_t parent_koid) override {
         EXPECT_FALSE(poisoned_);
         return MaybePoison(
             depth,
             TestTaskEnumerator::OnThread(depth, thread, koid, parent_koid));
     }
 
-    mx_status_t MaybePoison(int depth, mx_status_t s) {
-        if (s == MX_OK && depth >= poison_depth_) {
+    zx_status_t MaybePoison(int depth, zx_status_t s) {
+        if (s == ZX_OK && depth >= poison_depth_) {
             poisoned_ = true;
             return FailingStatus;
         }
diff --git a/system/utest/thread-initial-state/arm64.S b/system/utest/thread-initial-state/arm64.S
index 6721cd1..92e4e9b 100644
--- a/system/utest/thread-initial-state/arm64.S
+++ b/system/utest/thread-initial-state/arm64.S
@@ -89,6 +89,6 @@
     check_simd d29, v29.D[1]
     check_simd d30, v30.D[1]
     check_simd d31, v31.D[1]
-    b mx_thread_exit
+    b zx_thread_exit
 .Lfail:
     b print_fail
diff --git a/system/utest/thread-initial-state/init-state.c b/system/utest/thread-initial-state/init-state.c
index ad423e3..745a4c5 100644
--- a/system/utest/thread-initial-state/init-state.c
+++ b/system/utest/thread-initial-state/init-state.c
@@ -3,54 +3,54 @@
 // found in the LICENSE file.
 
 #include <assert.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 #include <stdio.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 extern void thread_entry(uintptr_t arg);
 
 int print_fail(void) {
     EXPECT_TRUE(false, "Failed");
-    mx_thread_exit();
+    zx_thread_exit();
     return 1; // Not reached
 }
 
-// create a thread using the raw magenta api.
+// create a thread using the raw zircon api.
 // cannot use a higher level api because they'll use trampoline functions that'll trash
 // registers on entry.
-mx_status_t raw_thread_create(void (*thread_entry)(uintptr_t arg), uintptr_t arg,
-                               mx_handle_t* out)
+zx_status_t raw_thread_create(void (*thread_entry)(uintptr_t arg), uintptr_t arg,
+                               zx_handle_t* out)
 {
     // preallocated stack to satisfy the thread we create
     static uint8_t stack[1024] __ALIGNED(16);
 
-    mx_handle_t handle;
-    mx_status_t status = mx_thread_create(mx_process_self(), "", 0, 0, &handle);
+    zx_handle_t handle;
+    zx_status_t status = zx_thread_create(zx_process_self(), "", 0, 0, &handle);
     if (status < 0)
         return status;
 
-    status = mx_thread_start(handle, (uintptr_t)thread_entry,
+    status = zx_thread_start(handle, (uintptr_t)thread_entry,
                              (uintptr_t)stack + sizeof(stack),
                              arg, 0);
     if (status < 0) {
-        mx_handle_close(handle);
+        zx_handle_close(handle);
         return status;
     }
 
     *out = handle;
-    return MX_OK;
+    return ZX_OK;
 }
 
 bool tis_test(void) {
     BEGIN_TEST;
     uintptr_t arg = 0x1234567890abcdef;
-    mx_handle_t handle = MX_HANDLE_INVALID;
-    mx_status_t status = raw_thread_create(thread_entry, arg, & handle);
-    ASSERT_EQ(status, MX_OK, "Error while thread creation");
+    zx_handle_t handle = ZX_HANDLE_INVALID;
+    zx_status_t status = raw_thread_create(thread_entry, arg, & handle);
+    ASSERT_EQ(status, ZX_OK, "Error while thread creation");
 
-    status = mx_object_wait_one(handle, MX_THREAD_TERMINATED, MX_TIME_INFINITE, NULL);
+    status = zx_object_wait_one(handle, ZX_THREAD_TERMINATED, ZX_TIME_INFINITE, NULL);
     ASSERT_GE(status, 0, "Error while thread wait");
     END_TEST;
 }
diff --git a/system/utest/thread-initial-state/rules.mk b/system/utest/thread-initial-state/rules.mk
index d3e6841..fbb09dc 100644
--- a/system/utest/thread-initial-state/rules.mk
+++ b/system/utest/thread-initial-state/rules.mk
@@ -18,6 +18,6 @@
 
 MODULE_NAME := thread-initial-state-test
 
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/thread-initial-state/x86-64.S b/system/utest/thread-initial-state/x86-64.S
index ff0b4c5..9b28e4e 100644
--- a/system/utest/thread-initial-state/x86-64.S
+++ b/system/utest/thread-initial-state/x86-64.S
@@ -132,6 +132,6 @@
     check_ymm %ymm15
 .Lno_avx:
 
-    jmp mx_thread_exit@PLT
+    jmp zx_thread_exit@PLT
 .Lfail:
     jmp print_fail
diff --git a/system/utest/thread-injection/injected/injected.c b/system/utest/thread-injection/injected/injected.c
index eca4fb1..2c7b39d 100644
--- a/system/utest/thread-injection/injected/injected.c
+++ b/system/utest/thread-injection/injected/injected.c
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include <inttypes.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <stdatomic.h>
 #include <stdlib.h>
 
@@ -25,11 +25,11 @@
     // process) is waiting on this futex.  Wake it up with a value it's
     // looking for.  When it sees this value arrive, the test succeeds.
     atomic_store(my_futex, MAGIC);
-    mx_status_t status = mx_futex_wake(my_futex, -1);
-    if (status != MX_OK)
+    zx_status_t status = zx_futex_wake(my_futex, -1);
+    if (status != ZX_OK)
         abort();
 
     // If we return, that will call exit and kill the whole process.
     // Just exit this thread instead.
-    mx_thread_exit();
+    zx_thread_exit();
 }
diff --git a/system/utest/thread-injection/injected/rules.mk b/system/utest/thread-injection/injected/rules.mk
index 3679c3a..4714ce4 100644
--- a/system/utest/thread-injection/injected/rules.mk
+++ b/system/utest/thread-injection/injected/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_NAME := thread-injection-injected
 
-MODULE_LIBS := system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/thread-injection/injector/injector.c b/system/utest/thread-injection/injector/injector.c
index a893ff9..88c8560 100644
--- a/system/utest/thread-injection/injector/injector.c
+++ b/system/utest/thread-injection/injector/injector.c
@@ -5,9 +5,9 @@
 #include <inttypes.h>
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -16,9 +16,9 @@
 #define HELPER "/boot/bin/thread-injection-injected"
 
 int main(void) {
-    mx_handle_t h = mx_get_startup_handle(PA_HND(PA_USER0, 0));
-    if (h == MX_HANDLE_INVALID) {
-        fprintf(stderr, "mx_get_startup_handle: %d\n", h);
+    zx_handle_t h = zx_get_startup_handle(PA_HND(PA_USER0, 0));
+    if (h == ZX_HANDLE_INVALID) {
+        fprintf(stderr, "zx_get_startup_handle: %d\n", h);
         return 1;
     }
 
@@ -26,12 +26,12 @@
     // its process and VMAR handles and know where its bits are.
     struct helper_data data;
     uint32_t bytes = sizeof(data);
-    mx_handle_t handles[2];
+    zx_handle_t handles[2];
     uint32_t nhandles = countof(handles);
-    mx_status_t status = mx_channel_read(h, 0, &data, handles, bytes,
+    zx_status_t status = zx_channel_read(h, 0, &data, handles, bytes,
                                          nhandles, &bytes, &nhandles);
-    if (status != MX_OK) {
-        fprintf(stderr, "mx_channel_read: %d\n", status);
+    if (status != ZX_OK) {
+        fprintf(stderr, "zx_channel_read: %d\n", status);
         return 1;
     }
     if (bytes != sizeof(data)) {
@@ -44,28 +44,28 @@
         return 1;
     }
 
-    const mx_handle_t proc = handles[0];
-    const mx_handle_t vmar = handles[1];
+    const zx_handle_t proc = handles[0];
+    const zx_handle_t vmar = handles[1];
 
     // Load up the launchpad with the injected program.  This works just
     // like normal program launching, but it goes into a process that
     // already exists (and has another program running in it!).
     launchpad_t* lp;
     status = launchpad_create_with_process(proc, vmar, &lp);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "launchpad_create_with_process: %d\n", status);
         return 1;
     }
 
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     status = launchpad_vmo_from_file(HELPER, &vmo);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "launchpad_vmo_from_file: %d\n", status);
         return 1;
     }
 
     status = launchpad_elf_load(lp, vmo);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "launchpad_elf_load: %d\n", status);
         return 1;
     }
@@ -76,7 +76,7 @@
     snprintf(buf, sizeof(buf), "%#" PRIxPTR, (uintptr_t)data.futex_addr);
     const char *argv[] = { HELPER, buf };
     status = launchpad_set_args(lp, 2, argv);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         fprintf(stderr, "launchpad_arguments: %d\n", status);
         return 1;
     }
@@ -88,8 +88,8 @@
     // program's bootstrap pipe, though the two uses are unrelated.)
     // Launchpad will send the bootstrap messages on our end of the pipe.
     status = launchpad_start_injected(lp, "injected", h, data.bootstrap);
-    mx_handle_close(h);
-    if (status != MX_OK) {
+    zx_handle_close(h);
+    if (status != ZX_OK) {
         fprintf(stderr, "launchpad_start_injected: %d\n", status);
         return 1;
     }
diff --git a/system/utest/thread-injection/injector/rules.mk b/system/utest/thread-injection/injector/rules.mk
index c2f8b48..158272d 100644
--- a/system/utest/thread-injection/injector/rules.mk
+++ b/system/utest/thread-injection/injector/rules.mk
@@ -15,6 +15,6 @@
 MODULE_NAME := thread-injection-injector
 
 MODULE_LIBS := \
-    system/ulib/launchpad system/ulib/magenta system/ulib/c
+    system/ulib/launchpad system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/thread-injection/private.h b/system/utest/thread-injection/private.h
index 066a121..7afec7a 100644
--- a/system/utest/thread-injection/private.h
+++ b/system/utest/thread-injection/private.h
@@ -9,7 +9,7 @@
 
 struct helper_data {
     atomic_int* futex_addr;
-    mx_handle_t bootstrap;
+    zx_handle_t bootstrap;
 };
 
 #define MAGIC 0xb00bee
diff --git a/system/utest/thread-injection/rules.mk b/system/utest/thread-injection/rules.mk
index 50b75bc..210625c 100644
--- a/system/utest/thread-injection/rules.mk
+++ b/system/utest/thread-injection/rules.mk
@@ -14,7 +14,7 @@
 MODULE_NAME := thread-injection-test
 
 MODULE_LIBS := \
-    system/ulib/unittest system/ulib/launchpad system/ulib/magenta system/ulib/c
+    system/ulib/unittest system/ulib/launchpad system/ulib/zircon system/ulib/c
 
 MODULES += $(LOCAL_DIR)/injector $(LOCAL_DIR)/injected
 
diff --git a/system/utest/thread-injection/thread-injection.c b/system/utest/thread-injection/thread-injection.c
index 9351468..8f4dad4 100644
--- a/system/utest/thread-injection/thread-injection.c
+++ b/system/utest/thread-injection/thread-injection.c
@@ -3,9 +3,9 @@
 // found in the LICENSE file.
 
 #include <launchpad/launchpad.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 #include <stdatomic.h>
 #include <stdio.h>
 #include <unittest/unittest.h>
@@ -23,11 +23,11 @@
     // another process, so it relies on us (the injectee) having
     // created the channel beforehand and told the injector its handle
     // number in this process.
-    mx_handle_t injector_channel_handle, injector_channel;
-    mx_status_t status = mx_channel_create(0, &injector_channel,
+    zx_handle_t injector_channel_handle, injector_channel;
+    zx_status_t status = zx_channel_create(0, &injector_channel,
                                            &injector_channel_handle);
     char msg[128];
-    snprintf(msg, sizeof(msg), "mx_channel_create failed: %d", status);
+    snprintf(msg, sizeof(msg), "zx_channel_create failed: %d", status);
     ASSERT_EQ(status, 0, msg);
 
     // Now send our own process handle to the injector, along with
@@ -38,23 +38,23 @@
         .futex_addr = &my_futex,
         .bootstrap = injector_channel,
     };
-    mx_handle_t handles[2];
+    zx_handle_t handles[2];
 
-    status = mx_handle_duplicate(mx_process_self(), MX_RIGHT_SAME_RIGHTS,
+    status = zx_handle_duplicate(zx_process_self(), ZX_RIGHT_SAME_RIGHTS,
                                  &handles[0]);
-    snprintf(msg, sizeof(msg), "mx_handle_duplicate failed on %#x: %d",
-             mx_process_self(), status);
+    snprintf(msg, sizeof(msg), "zx_handle_duplicate failed on %#x: %d",
+             zx_process_self(), status);
     ASSERT_EQ(status, 0, msg);
 
-    status = mx_handle_duplicate(mx_vmar_root_self(), MX_RIGHT_SAME_RIGHTS,
+    status = zx_handle_duplicate(zx_vmar_root_self(), ZX_RIGHT_SAME_RIGHTS,
                                  &handles[1]);
-    snprintf(msg, sizeof(msg), "mx_handle_duplicate failed on %#x: %d",
-             mx_vmar_root_self(), status);
+    snprintf(msg, sizeof(msg), "zx_handle_duplicate failed on %#x: %d",
+             zx_vmar_root_self(), status);
     ASSERT_EQ(status, 0, msg);
 
-    status = mx_channel_write(injector_channel, 0, &data, sizeof(data),
+    status = zx_channel_write(injector_channel, 0, &data, sizeof(data),
                               handles, countof(handles));
-    snprintf(msg, sizeof(msg), "mx_channel_write failed: %d", status);
+    snprintf(msg, sizeof(msg), "zx_channel_write failed: %d", status);
     ASSERT_EQ(status, 0, msg);
 
     // Start the injector program, which will inject a third program
@@ -69,33 +69,33 @@
     launchpad_add_handle(lp, injector_channel_handle, id);
     launchpad_clone(lp, LP_CLONE_ALL);
 
-    mx_handle_t proc;
+    zx_handle_t proc;
     const char* errmsg;
-    ASSERT_EQ(launchpad_go(lp, &proc, &errmsg), MX_OK,
+    ASSERT_EQ(launchpad_go(lp, &proc, &errmsg), ZX_OK,
               launchpad_error_message(lp));
 
     // Now the injector will inject the "injected" program into this process.
     // When that program starts up, it will see the &my_futex value and
-    // do a store of the magic value and a mx_futex_wake operation.
+    // do a store of the magic value and a zx_futex_wake operation.
     // When it's done that, the test has succeeded.
-    while (status == MX_OK && atomic_load(&my_futex) == 0) {
-        status = mx_futex_wait(&my_futex, 0, mx_deadline_after(MX_SEC(10)));
-        snprintf(msg, sizeof(msg), "mx_futex_wait failed: %d", status);
-        EXPECT_EQ(status, MX_OK, msg);
+    while (status == ZX_OK && atomic_load(&my_futex) == 0) {
+        status = zx_futex_wait(&my_futex, 0, zx_deadline_after(ZX_SEC(10)));
+        snprintf(msg, sizeof(msg), "zx_futex_wait failed: %d", status);
+        EXPECT_EQ(status, ZX_OK, msg);
     }
     snprintf(msg, sizeof(msg), "futex set to %#x", my_futex);
     EXPECT_EQ(my_futex, MAGIC, msg);
 
     // Make sure the injector completed successfully.
     // If it didn't, the futex wait probably timed out too.
-    ASSERT_EQ(mx_object_wait_one(proc, MX_PROCESS_TERMINATED,
-                                 MX_TIME_INFINITE, NULL),
-              MX_OK, "waiting for injector to finish");
-    mx_info_process_t proc_info;
-    ASSERT_EQ(mx_object_get_info(proc, MX_INFO_PROCESS,
+    ASSERT_EQ(zx_object_wait_one(proc, ZX_PROCESS_TERMINATED,
+                                 ZX_TIME_INFINITE, NULL),
+              ZX_OK, "waiting for injector to finish");
+    zx_info_process_t proc_info;
+    ASSERT_EQ(zx_object_get_info(proc, ZX_INFO_PROCESS,
                                  &proc_info, sizeof(proc_info), NULL, NULL),
-              MX_OK, "getting injector exit status");
-    mx_handle_close(proc);
+              ZX_OK, "getting injector exit status");
+    zx_handle_close(proc);
     EXPECT_EQ(proc_info.return_code, 0, "injector exit status");
 
     END_TEST;
diff --git a/system/utest/timers/rules.mk b/system/utest/timers/rules.mk
index bbf5467..2ae3bbf 100644
--- a/system/utest/timers/rules.mk
+++ b/system/utest/timers/rules.mk
@@ -14,12 +14,12 @@
 MODULE_NAME := timers-test
 
 MODULE_STATIC_LIBS := \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl \
 
 MODULE_LIBS := \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/unittest \
     system/ulib/c \
 
diff --git a/system/utest/timers/timers.cpp b/system/utest/timers/timers.cpp
index d4ff4f1..c71897b 100644
--- a/system/utest/timers/timers.cpp
+++ b/system/utest/timers/timers.cpp
@@ -6,7 +6,7 @@
 #include <stdio.h>
 #include <threads.h>
 
-#include <mx/timer.h>
+#include <zx/timer.h>
 
 #include <fbl/type_support.h>
 
@@ -15,39 +15,39 @@
 
 static bool basic_test() {
     BEGIN_TEST;
-    mx::timer timer;
-    ASSERT_EQ(mx::timer::create(0, MX_CLOCK_MONOTONIC, &timer), MX_OK);
+    zx::timer timer;
+    ASSERT_EQ(zx::timer::create(0, ZX_CLOCK_MONOTONIC, &timer), ZX_OK);
 
-    mx_signals_t pending;
-    EXPECT_EQ(timer.wait_one(MX_TIMER_SIGNALED, 0u, &pending), MX_ERR_TIMED_OUT);
-    EXPECT_EQ(pending, MX_SIGNAL_LAST_HANDLE);
+    zx_signals_t pending;
+    EXPECT_EQ(timer.wait_one(ZX_TIMER_SIGNALED, 0u, &pending), ZX_ERR_TIMED_OUT);
+    EXPECT_EQ(pending, ZX_SIGNAL_LAST_HANDLE);
 
     for (int ix = 0; ix != 10; ++ix) {
-        const auto deadline_timer = mx_deadline_after(MX_MSEC(50));
-        const auto deadline_wait = mx_deadline_after(MX_SEC(1));
+        const auto deadline_timer = zx_deadline_after(ZX_MSEC(50));
+        const auto deadline_wait = zx_deadline_after(ZX_SEC(1));
         // Timer should fire faster than the wait timeout.
-        ASSERT_EQ(timer.set(deadline_timer, 0u), MX_OK);
+        ASSERT_EQ(timer.set(deadline_timer, 0u), ZX_OK);
 
-        EXPECT_EQ(timer.wait_one(MX_TIMER_SIGNALED, deadline_wait, &pending), MX_OK);
-        EXPECT_EQ(pending, MX_TIMER_SIGNALED | MX_SIGNAL_LAST_HANDLE);
+        EXPECT_EQ(timer.wait_one(ZX_TIMER_SIGNALED, deadline_wait, &pending), ZX_OK);
+        EXPECT_EQ(pending, ZX_TIMER_SIGNALED | ZX_SIGNAL_LAST_HANDLE);
     }
     END_TEST;
 }
 
 static bool restart_test() {
     BEGIN_TEST;
-    mx::timer timer;
-    ASSERT_EQ(mx::timer::create(0, MX_CLOCK_MONOTONIC, &timer), MX_OK);
+    zx::timer timer;
+    ASSERT_EQ(zx::timer::create(0, ZX_CLOCK_MONOTONIC, &timer), ZX_OK);
 
-    mx_signals_t pending;
+    zx_signals_t pending;
     for (int ix = 0; ix != 10; ++ix) {
-        const auto deadline_timer = mx_deadline_after(MX_MSEC(500));
-        const auto deadline_wait = mx_deadline_after(MX_MSEC(1));
+        const auto deadline_timer = zx_deadline_after(ZX_MSEC(500));
+        const auto deadline_wait = zx_deadline_after(ZX_MSEC(1));
         // Setting a timer already running is equivalent to a cancel + set.
-        ASSERT_EQ(timer.set(deadline_timer, 0u), MX_OK);
+        ASSERT_EQ(timer.set(deadline_timer, 0u), ZX_OK);
 
-        EXPECT_EQ(timer.wait_one(MX_TIMER_SIGNALED, deadline_wait, &pending), MX_ERR_TIMED_OUT);
-        EXPECT_EQ(pending, MX_SIGNAL_LAST_HANDLE);
+        EXPECT_EQ(timer.wait_one(ZX_TIMER_SIGNALED, deadline_wait, &pending), ZX_ERR_TIMED_OUT);
+        EXPECT_EQ(pending, ZX_SIGNAL_LAST_HANDLE);
     }
     END_TEST;
 }
@@ -55,9 +55,9 @@
 static bool invalid_calls() {
     BEGIN_TEST;
 
-    mx::timer timer;
-    ASSERT_EQ(mx::timer::create(0, MX_CLOCK_UTC, &timer), MX_ERR_INVALID_ARGS);
-    ASSERT_EQ(mx::timer::create(MX_TIMER_SLACK_LATE + 1, MX_CLOCK_UTC, &timer), MX_ERR_INVALID_ARGS);
+    zx::timer timer;
+    ASSERT_EQ(zx::timer::create(0, ZX_CLOCK_UTC, &timer), ZX_ERR_INVALID_ARGS);
+    ASSERT_EQ(zx::timer::create(ZX_TIMER_SLACK_LATE + 1, ZX_CLOCK_UTC, &timer), ZX_ERR_INVALID_ARGS);
 
     END_TEST;
 }
@@ -65,9 +65,9 @@
 static bool edge_cases() {
     BEGIN_TEST;
 
-    mx::timer timer;
-    ASSERT_EQ(mx::timer::create(0, MX_CLOCK_MONOTONIC, &timer), MX_OK);
-    ASSERT_EQ(timer.set(0u, 0u), MX_OK);
+    zx::timer timer;
+    ASSERT_EQ(zx::timer::create(0, ZX_CLOCK_MONOTONIC, &timer), ZX_OK);
+    ASSERT_EQ(timer.set(0u, 0u), ZX_OK);
 
     END_TEST;
 }
@@ -77,16 +77,16 @@
 static bool restart_race() {
     BEGIN_TEST;
 
-    const mx_time_t kTestDuration = MX_SEC(5);
-    auto start = mx_time_get(MX_CLOCK_MONOTONIC);
+    const zx_time_t kTestDuration = ZX_SEC(5);
+    auto start = zx_time_get(ZX_CLOCK_MONOTONIC);
 
-    mx::timer timer;
-    ASSERT_EQ(mx::timer::create(0, MX_CLOCK_MONOTONIC, &timer), MX_OK);
-    while (mx_time_get(MX_CLOCK_MONOTONIC) - start < kTestDuration) {
-        ASSERT_EQ(timer.set(mx_deadline_after(MX_USEC(100)), 0u), MX_OK);
+    zx::timer timer;
+    ASSERT_EQ(zx::timer::create(0, ZX_CLOCK_MONOTONIC, &timer), ZX_OK);
+    while (zx_time_get(ZX_CLOCK_MONOTONIC) - start < kTestDuration) {
+        ASSERT_EQ(timer.set(zx_deadline_after(ZX_USEC(100)), 0u), ZX_OK);
     }
 
-    EXPECT_EQ(timer.cancel(), MX_OK);
+    EXPECT_EQ(timer.cancel(), ZX_OK);
 
     END_TEST;
 }
@@ -96,22 +96,22 @@
 // the signal.
 static bool signals_asserted_immediately() {
     BEGIN_TEST;
-    mx::timer timer;
-    ASSERT_EQ(mx::timer::create(0, MX_CLOCK_MONOTONIC, &timer), MX_OK);
+    zx::timer timer;
+    ASSERT_EQ(zx::timer::create(0, ZX_CLOCK_MONOTONIC, &timer), ZX_OK);
 
     for (int i = 0; i < 100; i++) {
-        mx_time_t now = mx_time_get(MX_CLOCK_MONOTONIC);
+        zx_time_t now = zx_time_get(ZX_CLOCK_MONOTONIC);
 
-        EXPECT_EQ(timer.set(now, 0u), MX_OK);
+        EXPECT_EQ(timer.set(now, 0u), ZX_OK);
 
-        mx_signals_t pending;
-        EXPECT_EQ(timer.wait_one(MX_TIMER_SIGNALED, 0u, &pending), MX_OK);
-        EXPECT_EQ(pending, MX_TIMER_SIGNALED | MX_SIGNAL_LAST_HANDLE);
+        zx_signals_t pending;
+        EXPECT_EQ(timer.wait_one(ZX_TIMER_SIGNALED, 0u, &pending), ZX_OK);
+        EXPECT_EQ(pending, ZX_TIMER_SIGNALED | ZX_SIGNAL_LAST_HANDLE);
 
-        EXPECT_EQ(timer.cancel(), MX_OK);
+        EXPECT_EQ(timer.cancel(), ZX_OK);
 
-        EXPECT_EQ(timer.wait_one(MX_TIMER_SIGNALED, 0u, &pending), MX_ERR_TIMED_OUT);
-        EXPECT_EQ(pending, MX_SIGNAL_LAST_HANDLE);
+        EXPECT_EQ(timer.wait_one(ZX_TIMER_SIGNALED, 0u, &pending), ZX_ERR_TIMED_OUT);
+        EXPECT_EQ(pending, ZX_SIGNAL_LAST_HANDLE);
     }
 
     END_TEST;
@@ -126,34 +126,34 @@
 
 static bool coalesce_test(uint32_t mode) {
     BEGIN_TEST;
-    // The second timer will coalesce to the first one for MX_TIMER_SLACK_LATE
-    // but not for  MX_TIMER_SLACK_EARLY. This test is not precise because the
+    // The second timer will coalesce to the first one for ZX_TIMER_SLACK_LATE
+    // but not for  ZX_TIMER_SLACK_EARLY. This test is not precise because the
     // system might have other timers that interfere with it. Precise tests are
     // avaliable as kernel tests.
 
-    mx::timer timer_1;
-    ASSERT_EQ(mx::timer::create(0, MX_CLOCK_MONOTONIC, &timer_1), MX_OK);
-    mx::timer timer_2;
-    ASSERT_EQ(mx::timer::create(mode, MX_CLOCK_MONOTONIC, &timer_2), MX_OK);
+    zx::timer timer_1;
+    ASSERT_EQ(zx::timer::create(0, ZX_CLOCK_MONOTONIC, &timer_1), ZX_OK);
+    zx::timer timer_2;
+    ASSERT_EQ(zx::timer::create(mode, ZX_CLOCK_MONOTONIC, &timer_2), ZX_OK);
 
-    mx_time_t start = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t start = zx_time_get(ZX_CLOCK_MONOTONIC);
 
-    const auto deadline_1 = start + MX_MSEC(350);
-    const auto deadline_2 = start + MX_MSEC(250);
+    const auto deadline_1 = start + ZX_MSEC(350);
+    const auto deadline_2 = start + ZX_MSEC(250);
 
-    ASSERT_EQ(timer_1.set(deadline_1, 0u), MX_OK);
-    ASSERT_EQ(timer_2.set(deadline_2, MX_MSEC(110)), MX_OK);
+    ASSERT_EQ(timer_1.set(deadline_1, 0u), ZX_OK);
+    ASSERT_EQ(timer_2.set(deadline_2, ZX_MSEC(110)), ZX_OK);
 
-    mx_signals_t pending;
-    EXPECT_EQ(timer_2.wait_one(MX_TIMER_SIGNALED, MX_TIME_INFINITE, &pending), MX_OK);
-    EXPECT_EQ(pending, MX_TIMER_SIGNALED | MX_SIGNAL_LAST_HANDLE);
+    zx_signals_t pending;
+    EXPECT_EQ(timer_2.wait_one(ZX_TIMER_SIGNALED, ZX_TIME_INFINITE, &pending), ZX_OK);
+    EXPECT_EQ(pending, ZX_TIMER_SIGNALED | ZX_SIGNAL_LAST_HANDLE);
 
-    auto duration = mx_time_get(MX_CLOCK_MONOTONIC) - start;
+    auto duration = zx_time_get(ZX_CLOCK_MONOTONIC) - start;
 
-    if (mode == MX_TIMER_SLACK_LATE) {
-        EXPECT_GE(duration, MX_MSEC(350));
-    } else if (mode == MX_TIMER_SLACK_EARLY) {
-        EXPECT_LE(duration, MX_MSEC(345));
+    if (mode == ZX_TIMER_SLACK_LATE) {
+        EXPECT_GE(duration, ZX_MSEC(350));
+    } else if (mode == ZX_TIMER_SLACK_EARLY) {
+        EXPECT_LE(duration, ZX_MSEC(345));
     } else {
         assert(false);
     }
@@ -162,12 +162,12 @@
 
 // Test is disabled, see coalesce_test().
 static bool coalesce_test_early() {
-    return coalesce_test(MX_TIMER_SLACK_EARLY);
+    return coalesce_test(ZX_TIMER_SLACK_EARLY);
 }
 
 // Test is disabled, see coalesce_test().
 static bool coalesce_test_late() {
-    return coalesce_test(MX_TIMER_SLACK_LATE);
+    return coalesce_test(ZX_TIMER_SLACK_LATE);
 }
 
 BEGIN_TEST_CASE(timers_test)
diff --git a/system/utest/trace-benchmark/benchmarks.cpp b/system/utest/trace-benchmark/benchmarks.cpp
index 480b474..e7536be 100644
--- a/system/utest/trace-benchmark/benchmarks.cpp
+++ b/system/utest/trace-benchmark/benchmarks.cpp
@@ -6,7 +6,7 @@
 
 #include <stdio.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 #include <trace-engine/instrumentation.h>
 #include <trace/event.h>
@@ -47,7 +47,7 @@
             trace_string_ref_t category_ref;
             trace_context_t* context = trace_acquire_context_for_category(
                 "-disabled", &category_ref);
-            MX_DEBUG_ASSERT(!context);
+            ZX_DEBUG_ASSERT(!context);
         });
     }
 
diff --git a/system/utest/trace-benchmark/benchmarks.h b/system/utest/trace-benchmark/benchmarks.h
index a977d1d..00c9455 100644
--- a/system/utest/trace-benchmark/benchmarks.h
+++ b/system/utest/trace-benchmark/benchmarks.h
@@ -6,7 +6,7 @@
 
 #include <stdio.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 static constexpr unsigned kWarmUpIterations = 100;
 static constexpr unsigned kRunIterations = 1000000;
@@ -15,13 +15,13 @@
 // Returns a value in microseconds.
 template <typename T>
 float Measure(unsigned iterations, const T& closure) {
-    uint64_t start = mx_ticks_get();
+    uint64_t start = zx_ticks_get();
     for (unsigned i = 0; i < iterations; i++) {
         closure();
     }
-    uint64_t stop = mx_ticks_get();
+    uint64_t stop = zx_ticks_get();
     return static_cast<float>(stop - start) * 1000000.f /
-           static_cast<float>(mx_ticks_per_second());
+           static_cast<float>(zx_ticks_per_second());
 }
 
 // Runs a closure repeatedly and prints its timing.
diff --git a/system/utest/trace-benchmark/benchmarks_ntrace.cpp b/system/utest/trace-benchmark/benchmarks_ntrace.cpp
index 9b9bc9f..c9f2545 100644
--- a/system/utest/trace-benchmark/benchmarks_ntrace.cpp
+++ b/system/utest/trace-benchmark/benchmarks_ntrace.cpp
@@ -13,11 +13,11 @@
     puts("Running benchmarks with NTRACE...\n");
 
     Run("TRACE_ENABLED with NTRACE", [] {
-        MX_DEBUG_ASSERT(!TRACE_ENABLED());
+        ZX_DEBUG_ASSERT(!TRACE_ENABLED());
     });
 
     Run("TRACE_CATEGORY_ENABLED with NTRACE", [] {
-        MX_DEBUG_ASSERT(!TRACE_CATEGORY_ENABLED("+enabled"));
+        ZX_DEBUG_ASSERT(!TRACE_CATEGORY_ENABLED("+enabled"));
     });
 
     Run("TRACE_DURATION_BEGIN macro with 0 arguments with NTRACE", [] {
diff --git a/system/utest/trace-benchmark/main.cpp b/system/utest/trace-benchmark/main.cpp
index 3a67b71..5b20865 100644
--- a/system/utest/trace-benchmark/main.cpp
+++ b/system/utest/trace-benchmark/main.cpp
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include <stdio.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 #include <async/loop.h>
 #include <async/task.h>
@@ -28,9 +28,9 @@
     }
 
     void Start() {
-        mx_status_t status = trace_start_engine(loop_->async(), this,
+        zx_status_t status = trace_start_engine(loop_->async(), this,
                                                 buffer_.get(), buffer_.size());
-        MX_DEBUG_ASSERT(status == MX_OK);
+        ZX_DEBUG_ASSERT(status == ZX_OK);
 
         puts("\nTrace started\n");
     }
@@ -42,11 +42,11 @@
     }
 
     void TraceStopped(async_t* async,
-                      mx_status_t disposition,
+                      zx_status_t disposition,
                       size_t buffer_bytes_written) override {
         puts("\nTrace stopped");
 
-        MX_DEBUG_ASSERT(disposition == MX_OK);
+        ZX_DEBUG_ASSERT(disposition == ZX_OK);
         loop_->Quit();
     }
 
@@ -64,11 +64,11 @@
     handler.Start();
 
     async::Task task(0u);
-    task.set_handler([](async_t* async, mx_status_t status) {
+    task.set_handler([](async_t* async, zx_status_t status) {
         RunTracingEnabledBenchmarks();
         RunNoTraceBenchmarks();
 
-        trace_stop_engine(MX_OK);
+        trace_stop_engine(ZX_OK);
         return ASYNC_TASK_FINISHED;
     });
     task.Post(loop.async());
diff --git a/system/utest/trace-benchmark/rules.mk b/system/utest/trace-benchmark/rules.mk
index 6d087d4..561ecd5 100644
--- a/system/utest/trace-benchmark/rules.mk
+++ b/system/utest/trace-benchmark/rules.mk
@@ -19,15 +19,15 @@
     system/ulib/trace \
     system/ulib/async \
     system/ulib/async.loop \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
     system/ulib/fbl \
-    system/ulib/mx
+    system/ulib/zx
 
 MODULE_LIBS := \
     system/ulib/async.default \
     system/ulib/c \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/trace-engine
 
 include make/module.mk
diff --git a/system/utest/trace-reader/records_tests.cpp b/system/utest/trace-reader/records_tests.cpp
index 1141ee3..ef75891 100644
--- a/system/utest/trace-reader/records_tests.cpp
+++ b/system/utest/trace-reader/records_tests.cpp
@@ -23,8 +23,8 @@
     BEGIN_TEST;
 
     trace::ProcessThread pt;
-    EXPECT_EQ(MX_KOID_INVALID, pt.process_koid());
-    EXPECT_EQ(MX_KOID_INVALID, pt.thread_koid());
+    EXPECT_EQ(ZX_KOID_INVALID, pt.process_koid());
+    EXPECT_EQ(ZX_KOID_INVALID, pt.thread_koid());
     EXPECT_FALSE(!!pt);
 
     pt = trace::ProcessThread(0, 1);
@@ -249,9 +249,9 @@
 
     // koid
 
-    av = trace::ArgumentValue::MakeKoid(MX_KOID_INVALID);
+    av = trace::ArgumentValue::MakeKoid(ZX_KOID_INVALID);
     EXPECT_EQ(trace::ArgumentType::kKoid, av.type());
-    EXPECT_EQ(MX_KOID_INVALID, av.GetKoid());
+    EXPECT_EQ(ZX_KOID_INVALID, av.GetKoid());
 
     av = trace::ArgumentValue::MakeKoid(UINT64_MAX);
     EXPECT_EQ(trace::ArgumentType::kKoid, av.type());
@@ -685,10 +685,10 @@
         args.push_back(trace::Argument("arg2", trace::ArgumentValue::MakeDouble(-3.14)));
 
         trace::Record r(trace::Record::KernelObject{
-            123, MX_OBJ_TYPE_VMO, "name", fbl::move(args)});
+            123, ZX_OBJ_TYPE_VMO, "name", fbl::move(args)});
         EXPECT_EQ(trace::RecordType::kKernelObject, r.type());
         EXPECT_EQ(123, r.GetKernelObject().koid);
-        EXPECT_EQ(MX_OBJ_TYPE_VMO, r.GetKernelObject().object_type);
+        EXPECT_EQ(ZX_OBJ_TYPE_VMO, r.GetKernelObject().object_type);
         EXPECT_TRUE(r.GetKernelObject().name == "name");
         EXPECT_EQ(2, r.GetKernelObject().arguments.size());
         EXPECT_TRUE(r.GetKernelObject().arguments[0].name() == "arg1");
@@ -699,7 +699,7 @@
         trace::Record m(fbl::move(r));
         EXPECT_EQ(trace::RecordType::kKernelObject, m.type());
         EXPECT_EQ(123, m.GetKernelObject().koid);
-        EXPECT_EQ(MX_OBJ_TYPE_VMO, m.GetKernelObject().object_type);
+        EXPECT_EQ(ZX_OBJ_TYPE_VMO, m.GetKernelObject().object_type);
         EXPECT_TRUE(m.GetKernelObject().name == "name");
         EXPECT_EQ(2, m.GetKernelObject().arguments.size());
         EXPECT_TRUE(m.GetKernelObject().arguments[0].name() == "arg1");
@@ -710,7 +710,7 @@
         r = fbl::move(m);
         EXPECT_EQ(trace::RecordType::kKernelObject, r.type());
         EXPECT_EQ(123, r.GetKernelObject().koid);
-        EXPECT_EQ(MX_OBJ_TYPE_VMO, r.GetKernelObject().object_type);
+        EXPECT_EQ(ZX_OBJ_TYPE_VMO, r.GetKernelObject().object_type);
         EXPECT_TRUE(r.GetKernelObject().name == "name");
         EXPECT_EQ(2, r.GetKernelObject().arguments.size());
         EXPECT_TRUE(r.GetKernelObject().arguments[0].name() == "arg1");
diff --git a/system/utest/trace-reader/rules.mk b/system/utest/trace-reader/rules.mk
index 92b4bc8..f24aa99 100644
--- a/system/utest/trace-reader/rules.mk
+++ b/system/utest/trace-reader/rules.mk
@@ -22,14 +22,14 @@
 MODULE_STATIC_LIBS := \
     system/ulib/trace-reader \
     system/ulib/trace-engine \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl
 
 MODULE_LIBS := \
     system/ulib/c \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/unittest
 
 include make/module.mk
diff --git a/system/utest/trace/engine_tests.cpp b/system/utest/trace/engine_tests.cpp
index 8c086d9..eaf1ae0 100644
--- a/system/utest/trace/engine_tests.cpp
+++ b/system/utest/trace/engine_tests.cpp
@@ -10,7 +10,7 @@
 #include <fbl/string.h>
 #include <fbl/string_printf.h>
 #include <fbl/vector.h>
-#include <mx/event.h>
+#include <zx/event.h>
 #include <trace-engine/instrumentation.h>
 
 namespace {
@@ -25,10 +25,10 @@
     thrd_t thread;
     int result = thrd_create(&thread, RunClosure,
                              new fbl::Closure(fbl::move(closure)));
-    MX_ASSERT(result == thrd_success);
+    ZX_ASSERT(result == thrd_success);
 
     result = thrd_join(thread, nullptr);
-    MX_ASSERT(result == thrd_success);
+    ZX_ASSERT(result == thrd_success);
 }
 
 bool test_normal_shutdown() {
@@ -36,7 +36,7 @@
 
     fixture_start_tracing();
     fixture_stop_tracing();
-    EXPECT_EQ(MX_OK, fixture_get_disposition());
+    EXPECT_EQ(ZX_OK, fixture_get_disposition());
 
     END_TRACE_TEST;
 }
@@ -46,7 +46,7 @@
 
     fixture_start_tracing();
     fixture_stop_tracing_hard();
-    EXPECT_EQ(MX_ERR_CANCELED, fixture_get_disposition());
+    EXPECT_EQ(ZX_ERR_CANCELED, fixture_get_disposition());
 
     END_TRACE_TEST;
 }
@@ -116,22 +116,22 @@
 bool test_observer() {
     BEGIN_TRACE_TEST;
 
-    mx::event event;
-    EXPECT_EQ(MX_OK, mx::event::create(0u, &event));
+    zx::event event;
+    EXPECT_EQ(ZX_OK, zx::event::create(0u, &event));
 
-    EXPECT_EQ(MX_OK, trace_register_observer(event.get()));
-    EXPECT_EQ(MX_ERR_TIMED_OUT, event.wait_one(MX_EVENT_SIGNALED, 0u, nullptr));
+    EXPECT_EQ(ZX_OK, trace_register_observer(event.get()));
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, event.wait_one(ZX_EVENT_SIGNALED, 0u, nullptr));
 
     fixture_start_tracing();
-    EXPECT_EQ(MX_OK, event.wait_one(MX_EVENT_SIGNALED, 0u, nullptr));
+    EXPECT_EQ(ZX_OK, event.wait_one(ZX_EVENT_SIGNALED, 0u, nullptr));
 
-    EXPECT_EQ(MX_OK, event.signal(MX_EVENT_SIGNALED, 0u));
-    EXPECT_EQ(MX_ERR_TIMED_OUT, event.wait_one(MX_EVENT_SIGNALED, 0u, nullptr));
+    EXPECT_EQ(ZX_OK, event.signal(ZX_EVENT_SIGNALED, 0u));
+    EXPECT_EQ(ZX_ERR_TIMED_OUT, event.wait_one(ZX_EVENT_SIGNALED, 0u, nullptr));
 
     fixture_stop_tracing();
-    EXPECT_EQ(MX_OK, event.wait_one(MX_EVENT_SIGNALED, 0u, nullptr));
+    EXPECT_EQ(ZX_OK, event.wait_one(ZX_EVENT_SIGNALED, 0u, nullptr));
 
-    EXPECT_EQ(MX_OK, trace_unregister_observer(event.get()));
+    EXPECT_EQ(ZX_OK, trace_unregister_observer(event.get()));
 
     END_TRACE_TEST;
 }
@@ -139,14 +139,14 @@
 bool test_observer_errors() {
     BEGIN_TRACE_TEST;
 
-    mx::event event;
-    EXPECT_EQ(MX_OK, mx::event::create(0u, &event));
+    zx::event event;
+    EXPECT_EQ(ZX_OK, zx::event::create(0u, &event));
 
-    EXPECT_EQ(MX_OK, trace_register_observer(event.get()));
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, trace_register_observer(event.get()));
+    EXPECT_EQ(ZX_OK, trace_register_observer(event.get()));
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, trace_register_observer(event.get()));
 
-    EXPECT_EQ(MX_OK, trace_unregister_observer(event.get()));
-    EXPECT_EQ(MX_ERR_NOT_FOUND, trace_unregister_observer(event.get()));
+    EXPECT_EQ(ZX_OK, trace_unregister_observer(event.get()));
+    EXPECT_EQ(ZX_ERR_NOT_FOUND, trace_unregister_observer(event.get()));
 
     END_TRACE_TEST;
 }
@@ -374,7 +374,7 @@
     {
         auto context = trace::TraceContext::Acquire();
 
-        trace_context_write_instant_event_record(context.get(), mx_ticks_get(),
+        trace_context_write_instant_event_record(context.get(), zx_ticks_get(),
                                                  &thread, &cat, &name,
                                                  TRACE_SCOPE_GLOBAL,
                                                  args, fbl::count_of(args));
diff --git a/system/utest/trace/event_tests_common.h b/system/utest/trace/event_tests_common.h
index 76c81df..0bfc1dc 100644
--- a/system/utest/trace/event_tests_common.h
+++ b/system/utest/trace/event_tests_common.h
@@ -12,7 +12,7 @@
 
 #include <trace/event.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <unittest/unittest.h>
 
 #ifdef __cplusplus
@@ -445,8 +445,8 @@
 static bool test_kernel_object(void) {
     BEGIN_TRACE_TEST;
 
-    mx_handle_t event;
-    mx_event_create(0u, &event);
+    zx_handle_t event;
+    zx_event_create(0u, &event);
 
     fixture_start_tracing();
 
@@ -465,7 +465,7 @@
 ",
                    "");
 
-    mx_handle_close(event);
+    zx_handle_close(event);
 
     END_TRACE_TEST;
 }
diff --git a/system/utest/trace/fixture.cpp b/system/utest/trace/fixture.cpp
index 23f6b3b..3b4b1e5 100644
--- a/system/utest/trace/fixture.cpp
+++ b/system/utest/trace/fixture.cpp
@@ -9,10 +9,10 @@
 #include <string.h>
 #include <sys/types.h>
 
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 #include <async/loop.h>
-#include <mx/event.h>
+#include <zx/event.h>
 #include <fbl/algorithm.h>
 #include <fbl/array.h>
 #include <fbl/string.h>
@@ -30,8 +30,8 @@
 public:
     Fixture()
         : buffer_(new uint8_t[kBufferSizeBytes], kBufferSizeBytes) {
-        mx_status_t status = mx::event::create(0u, &trace_stopped_);
-        MX_DEBUG_ASSERT(status == MX_OK);
+        zx_status_t status = zx::event::create(0u, &trace_stopped_);
+        ZX_DEBUG_ASSERT(status == ZX_OK);
     }
 
     ~Fixture() {
@@ -46,9 +46,9 @@
         loop_.StartThread("trace test");
 
         // Asynchronously start the engine.
-        mx_status_t status = trace_start_engine(loop_.async(), this,
+        zx_status_t status = trace_start_engine(loop_.async(), this,
                                                 buffer_.get(), buffer_.size());
-        MX_DEBUG_ASSERT(status == MX_OK);
+        ZX_DEBUG_ASSERT(status == ZX_OK);
     }
 
     void StopTracing(bool hard_shutdown) {
@@ -59,24 +59,24 @@
         // If we're performing a hard shutdown, skip this step and begin immediately
         // tearing down the loop.  The trace engine should stop itself.
         if (!hard_shutdown) {
-            mx_status_t status = trace_stop_engine(MX_OK);
-            MX_DEBUG_ASSERT(status == MX_OK);
+            zx_status_t status = trace_stop_engine(ZX_OK);
+            ZX_DEBUG_ASSERT(status == ZX_OK);
 
-            status = trace_stopped_.wait_one(MX_EVENT_SIGNALED,
-                                             mx_deadline_after(MX_MSEC(1000)), nullptr);
-            MX_DEBUG_ASSERT(status == MX_OK);
+            status = trace_stopped_.wait_one(ZX_EVENT_SIGNALED,
+                                             zx_deadline_after(ZX_MSEC(1000)), nullptr);
+            ZX_DEBUG_ASSERT(status == ZX_OK);
         }
 
         // Shut down the loop (implicily joins the thread we started earlier).
         // When this completes we know the trace engine is really stopped.
         loop_.Shutdown();
 
-        MX_DEBUG_ASSERT(observed_stopped_callback_);
+        ZX_DEBUG_ASSERT(observed_stopped_callback_);
 
         trace_running_ = false;
     }
 
-    mx_status_t disposition() const {
+    zx_status_t disposition() const {
         return disposition_;
     }
 
@@ -103,23 +103,23 @@
     }
 
     void TraceStopped(async_t* async,
-                      mx_status_t disposition,
+                      zx_status_t disposition,
                       size_t buffer_bytes_written) override {
-        MX_DEBUG_ASSERT(!observed_stopped_callback_);
+        ZX_DEBUG_ASSERT(!observed_stopped_callback_);
         observed_stopped_callback_ = true;
-        MX_DEBUG_ASSERT(async = loop_.async());
+        ZX_DEBUG_ASSERT(async = loop_.async());
         disposition_ = disposition;
         buffer_bytes_written_ = buffer_bytes_written;
 
-        trace_stopped_.signal(0u, MX_EVENT_SIGNALED);
+        trace_stopped_.signal(0u, ZX_EVENT_SIGNALED);
     }
 
     async::Loop loop_;
     fbl::Array<uint8_t> buffer_;
     bool trace_running_ = false;
-    mx_status_t disposition_ = MX_ERR_INTERNAL;
+    zx_status_t disposition_ = ZX_ERR_INTERNAL;
     size_t buffer_bytes_written_ = 0u;
-    mx::event trace_stopped_;
+    zx::event trace_stopped_;
     bool observed_stopped_callback_ = false;
 };
 
@@ -128,38 +128,38 @@
 } // namespace
 
 void fixture_set_up(void) {
-    MX_DEBUG_ASSERT(!g_fixture);
+    ZX_DEBUG_ASSERT(!g_fixture);
     g_fixture = new Fixture();
 }
 
 void fixture_tear_down(void) {
-    MX_DEBUG_ASSERT(g_fixture);
+    ZX_DEBUG_ASSERT(g_fixture);
     delete g_fixture;
     g_fixture = nullptr;
 }
 
 void fixture_start_tracing() {
-    MX_DEBUG_ASSERT(g_fixture);
+    ZX_DEBUG_ASSERT(g_fixture);
     g_fixture->StartTracing();
 }
 
 void fixture_stop_tracing() {
-    MX_DEBUG_ASSERT(g_fixture);
+    ZX_DEBUG_ASSERT(g_fixture);
     g_fixture->StopTracing(false);
 }
 
 void fixture_stop_tracing_hard() {
-    MX_DEBUG_ASSERT(g_fixture);
+    ZX_DEBUG_ASSERT(g_fixture);
     g_fixture->StopTracing(true);
 }
 
-mx_status_t fixture_get_disposition(void) {
-    MX_DEBUG_ASSERT(g_fixture);
+zx_status_t fixture_get_disposition(void) {
+    ZX_DEBUG_ASSERT(g_fixture);
     return g_fixture->disposition();
 }
 
 bool fixture_compare_records(const char* expected) {
-    MX_DEBUG_ASSERT(g_fixture);
+    ZX_DEBUG_ASSERT(g_fixture);
     BEGIN_HELPER;
 
     g_fixture->StopTracing(false);
@@ -175,7 +175,7 @@
     ASSERT_GE(records.size(), 1u, "expected an initialization record");
     ASSERT_EQ(trace::RecordType::kInitialization, records[0].type(),
               "expected initialization record");
-    EXPECT_EQ(mx_ticks_per_second(),
+    EXPECT_EQ(zx_ticks_per_second(),
               records[0].GetInitialization().ticks_per_second);
     records.erase(0);
 
diff --git a/system/utest/trace/fixture.h b/system/utest/trace/fixture.h
index 315f552..208ae0b 100644
--- a/system/utest/trace/fixture.h
+++ b/system/utest/trace/fixture.h
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <unittest/unittest.h>
 
 __BEGIN_CDECLS
@@ -19,7 +19,7 @@
 void fixture_start_tracing(void);
 void fixture_stop_tracing(void);
 void fixture_stop_tracing_hard(void);
-mx_status_t fixture_get_disposition(void);
+zx_status_t fixture_get_disposition(void);
 bool fixture_compare_records(const char* expected);
 
 inline void fixture_scope_cleanup(bool* scope) {
diff --git a/system/utest/trace/rules.mk b/system/utest/trace/rules.mk
index eddfeb5..13c5fbe 100644
--- a/system/utest/trace/rules.mk
+++ b/system/utest/trace/rules.mk
@@ -25,15 +25,15 @@
     system/ulib/trace-reader \
     system/ulib/async \
     system/ulib/async.loop \
-    system/ulib/mx \
-    system/ulib/mxcpp \
+    system/ulib/zx \
+    system/ulib/zxcpp \
     system/ulib/fbl
 
 MODULE_LIBS := \
     system/ulib/async.default \
     system/ulib/c \
-    system/ulib/magenta \
-    system/ulib/mxio \
+    system/ulib/zircon \
+    system/ulib/fdio \
     system/ulib/trace-engine \
     system/ulib/unittest
 
diff --git a/system/utest/vdso-base/rules.mk b/system/utest/vdso-base/rules.mk
index c9ffbcb..fc2a7d5 100644
--- a/system/utest/vdso-base/rules.mk
+++ b/system/utest/vdso-base/rules.mk
@@ -15,8 +15,8 @@
 
 MODULE_LIBS := \
     system/ulib/unittest \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/vdso-base/vdso-base.c b/system/utest/vdso-base/vdso-base.c
index 157a227..face284 100644
--- a/system/utest/vdso-base/vdso-base.c
+++ b/system/utest/vdso-base/vdso-base.c
@@ -4,11 +4,11 @@
 
 #include <dlfcn.h>
 #include <link.h>
-#include <magenta/dlfcn.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxio/util.h>
+#include <zircon/dlfcn.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <fdio/util.h>
 #include <stdio.h>
 #include <sys/param.h>
 #include <string.h>
@@ -20,8 +20,8 @@
 
     char msg[128];
 
-    struct link_map* lm = dlopen("libmagenta.so", RTLD_NOLOAD);
-    snprintf(msg, sizeof(msg), "dlopen(\"libmagenta.so\") failed: %s",
+    struct link_map* lm = dlopen("libzircon.so", RTLD_NOLOAD);
+    snprintf(msg, sizeof(msg), "dlopen(\"libzircon.so\") failed: %s",
              dlerror());
     EXPECT_NONNULL(lm, msg);
     uintptr_t rtld_vdso_base = lm->l_addr;
@@ -30,11 +30,11 @@
     EXPECT_EQ(ok, 0, msg);
 
     uintptr_t prop_vdso_base;
-    mx_status_t status =
-        mx_object_get_property(mx_process_self(),
-                               MX_PROP_PROCESS_VDSO_BASE_ADDRESS,
+    zx_status_t status =
+        zx_object_get_property(zx_process_self(),
+                               ZX_PROP_PROCESS_VDSO_BASE_ADDRESS,
                                &prop_vdso_base, sizeof(prop_vdso_base));
-    snprintf(msg, sizeof(msg), "mx_object_get_property failed: %d", status);
+    snprintf(msg, sizeof(msg), "zx_object_get_property failed: %d", status);
     EXPECT_EQ(status, 0, msg);
 
     EXPECT_EQ(rtld_vdso_base, prop_vdso_base,
@@ -59,11 +59,11 @@
     char msg[128];
 
     uintptr_t prop_vdso_base;
-    mx_status_t status =
-        mx_object_get_property(mx_process_self(),
-                               MX_PROP_PROCESS_VDSO_BASE_ADDRESS,
+    zx_status_t status =
+        zx_object_get_property(zx_process_self(),
+                               ZX_PROP_PROCESS_VDSO_BASE_ADDRESS,
                                &prop_vdso_base, sizeof(prop_vdso_base));
-    snprintf(msg, sizeof(msg), "mx_object_get_property failed: %d", status);
+    snprintf(msg, sizeof(msg), "zx_object_get_property failed: %d", status);
     ASSERT_EQ(status, 0, msg);
 
     struct dl_phdr_info info = { .dlpi_addr = prop_vdso_base };
@@ -84,15 +84,15 @@
     ASSERT_NE(vdso_code_len, 0u, "vDSO has no code segment?");
 
     // Removing the vDSO code mapping is not allowed.
-    status = mx_vmar_unmap(mx_vmar_root_self(),
+    status = zx_vmar_unmap(zx_vmar_root_self(),
                            vdso_code_start, vdso_code_len);
-    EXPECT_EQ(status, MX_ERR_ACCESS_DENIED, "unmap vDSO code");
+    EXPECT_EQ(status, ZX_ERR_ACCESS_DENIED, "unmap vDSO code");
 
     // Nor is removing a whole range overlapping the vDSO code.
-    status = mx_vmar_unmap(mx_vmar_root_self(),
+    status = zx_vmar_unmap(zx_vmar_root_self(),
                            vdso_code_start - PAGE_SIZE,
                            PAGE_SIZE * 2);
-    EXPECT_EQ(status, MX_ERR_ACCESS_DENIED, "unmap range overlapping vDSO code");
+    EXPECT_EQ(status, ZX_ERR_ACCESS_DENIED, "unmap range overlapping vDSO code");
 
     END_TEST;
 }
@@ -100,8 +100,8 @@
 bool vdso_map_test(void) {
     BEGIN_TEST;
 
-    mx_handle_t vmo = mx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0));
-    ASSERT_NE(vmo, MX_HANDLE_INVALID, "mx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0))");
+    zx_handle_t vmo = zx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0));
+    ASSERT_NE(vmo, ZX_HANDLE_INVALID, "zx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0))");
 
     // Since we already have a vDSO mapping, loading it again should fail.
     void* h = dlopen_vmo(vmo, RTLD_LOCAL);
@@ -111,23 +111,23 @@
     // We can't meaningfully test the other constraints on our own
     // process, because the "there can be only one" constraint trumps them.
     const char* name = "vdso_map_test";
-    mx_handle_t proc, vmar;
-    ASSERT_EQ(mx_process_create(mx_job_default(),
+    zx_handle_t proc, vmar;
+    ASSERT_EQ(zx_process_create(zx_job_default(),
                                 name, strlen(name), 0, &proc, &vmar),
-              MX_OK, "mx_process_create failed");
+              ZX_OK, "zx_process_create failed");
 
     // This should fail because it's an executable mapping of
     // the wrong portion of the vDSO image (the first page is
     // rodata including the ELF headers).  Only the actual code
     // segment can be mapped executable.
     uintptr_t addr;
-    mx_status_t status = mx_vmar_map(
+    zx_status_t status = zx_vmar_map(
         vmar, 0, vmo, 0, PAGE_SIZE,
-        MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, &addr);
-    EXPECT_EQ(status, MX_ERR_ACCESS_DENIED, "map vDSO data as executable");
+        ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, &addr);
+    EXPECT_EQ(status, ZX_ERR_ACCESS_DENIED, "map vDSO data as executable");
 
-    mx_handle_close(proc);
-    mx_handle_close(vmar);
+    zx_handle_close(proc);
+    zx_handle_close(vmar);
 
     END_TEST;
 }
diff --git a/system/utest/vdso-variant/helper/rules.mk b/system/utest/vdso-variant/helper/rules.mk
index 819671b..21f2746 100644
--- a/system/utest/vdso-variant/helper/rules.mk
+++ b/system/utest/vdso-variant/helper/rules.mk
@@ -15,8 +15,8 @@
 
 MODULE_LIBS := \
     system/ulib/unittest \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/vdso-variant/helper/vdso-variant-helper.c b/system/utest/vdso-variant/helper/vdso-variant-helper.c
index 06772f5..6bcac72 100644
--- a/system/utest/vdso-variant/helper/vdso-variant-helper.c
+++ b/system/utest/vdso-variant/helper/vdso-variant-helper.c
@@ -10,8 +10,8 @@
 #include <unistd.h>
 #include <unittest/unittest.h>
 
-#define GOOD_SYMBOL     "mx_syscall_test_0"
-#define BAD_SYMBOL      "mx_syscall_test_1"
+#define GOOD_SYMBOL     "zx_syscall_test_0"
+#define BAD_SYMBOL      "zx_syscall_test_1"
 
 bool vdso_open_test(void) {
     BEGIN_TEST;
@@ -51,7 +51,7 @@
 bool vdso_missing_test_syscall1_test(void) {
     BEGIN_TEST;
 
-    void* dso = dlopen("libmagenta.so", RTLD_LOCAL | RTLD_NOLOAD);
+    void* dso = dlopen("libzircon.so", RTLD_LOCAL | RTLD_NOLOAD);
     ASSERT_NONNULL(dso, dlerror());
 
     EXPECT_NONNULL(dlsym(dso, GOOD_SYMBOL), dlerror());
diff --git a/system/utest/vdso-variant/rules.mk b/system/utest/vdso-variant/rules.mk
index 72f3dcb..4e4ade5 100644
--- a/system/utest/vdso-variant/rules.mk
+++ b/system/utest/vdso-variant/rules.mk
@@ -15,8 +15,8 @@
 
 MODULE_LIBS := \
     system/ulib/launchpad \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/vdso-variant/vdso-variant.c b/system/utest/vdso-variant/vdso-variant.c
index 1500c3c..1c8f03c 100644
--- a/system/utest/vdso-variant/vdso-variant.c
+++ b/system/utest/vdso-variant/vdso-variant.c
@@ -4,9 +4,9 @@
 
 #include <fcntl.h>
 #include <launchpad/launchpad.h>
-#include <magenta/syscalls.h>
-#include <magenta/status.h>
-#include <mxio/io.h>
+#include <zircon/syscalls.h>
+#include <zircon/status.h>
+#include <fdio/io.h>
 #include <stdio.h>
 #include <unistd.h>
 
@@ -19,40 +19,40 @@
         return 1;
     }
 
-    mx_handle_t vdso_vmo;
-    mx_status_t status = mxio_get_exact_vmo(fd, &vdso_vmo);
+    zx_handle_t vdso_vmo;
+    zx_status_t status = fdio_get_exact_vmo(fd, &vdso_vmo);
     close(fd);
-    if (status != MX_OK) {
-        printf("mxio_get_exact_vmo(%d): %s\n", fd, mx_status_get_string(status));
+    if (status != ZX_OK) {
+        printf("fdio_get_exact_vmo(%d): %s\n", fd, zx_status_get_string(status));
         return status;
     }
 
     launchpad_set_vdso_vmo(vdso_vmo);
 
     launchpad_t* lp;
-    launchpad_create(MX_HANDLE_INVALID, "vdso-variant-helper", &lp);
+    launchpad_create(ZX_HANDLE_INVALID, "vdso-variant-helper", &lp);
     launchpad_clone(lp, LP_CLONE_ALL);
     launchpad_set_args(lp, 1, (const char*[]){"vdso-variant-helper"});
     launchpad_load_from_file(lp, "/boot/bin/vdso-variant-helper");
-    mx_handle_t proc;
+    zx_handle_t proc;
     const char* errmsg;
     status = launchpad_go(lp, &proc, &errmsg);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("launchpad_go: %s\n", errmsg);
         return status;
     }
 
-    status = mx_object_wait_one(proc, MX_PROCESS_TERMINATED,
-                                MX_TIME_INFINITE, NULL);
-    if (status != MX_OK) {
-        printf("mx_object_wait_one: %s\n", mx_status_get_string(status));
+    status = zx_object_wait_one(proc, ZX_PROCESS_TERMINATED,
+                                ZX_TIME_INFINITE, NULL);
+    if (status != ZX_OK) {
+        printf("zx_object_wait_one: %s\n", zx_status_get_string(status));
         return status;
     }
-    mx_info_process_t info;
-    status = mx_object_get_info(proc, MX_INFO_PROCESS, &info, sizeof(info),
+    zx_info_process_t info;
+    status = zx_object_get_info(proc, ZX_INFO_PROCESS, &info, sizeof(info),
                                 NULL, NULL);
-    if (status != MX_OK) {
-        printf("mx_object_get_info: %s\n", mx_status_get_string(status));
+    if (status != ZX_OK) {
+        printf("zx_object_get_info: %s\n", zx_status_get_string(status));
         return status;
     }
 
diff --git a/system/utest/vdso/rules.mk b/system/utest/vdso/rules.mk
index 634988e..33e811e 100644
--- a/system/utest/vdso/rules.mk
+++ b/system/utest/vdso/rules.mk
@@ -15,14 +15,14 @@
 
 MODULE_STATIC_LIBS := \
     system/ulib/elfload \
-    system/ulib/mx \
+    system/ulib/zx \
     system/ulib/fbl \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
 
 MODULE_LIBS := \
     system/ulib/unittest \
-    system/ulib/mxio \
-    system/ulib/magenta \
+    system/ulib/fdio \
+    system/ulib/zircon \
     system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/vdso/vdso.cpp b/system/utest/vdso/vdso.cpp
index dc82859..1325c05 100644
--- a/system/utest/vdso/vdso.cpp
+++ b/system/utest/vdso/vdso.cpp
@@ -4,32 +4,32 @@
 
 #include <elfload/elfload.h>
 #include <limits.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <mxcpp/new.h>
-#include <mx/process.h>
-#include <mx/vmar.h>
-#include <mx/vmo.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zxcpp/new.h>
+#include <zx/process.h>
+#include <zx/vmar.h>
+#include <zx/vmo.h>
 #include <fbl/array.h>
 #include <string.h>
 #include <unittest/unittest.h>
 
-static const mx::vmo vdso_vmo{mx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0))};
+static const zx::vmo vdso_vmo{zx_get_startup_handle(PA_HND(PA_VMO_VDSO, 0))};
 
 class ScratchPad {
 public:
     ScratchPad() = delete;
     ScratchPad(const char* name) {
-        EXPECT_EQ(mx_process_create(
-                      mx_job_default(),
+        EXPECT_EQ(zx_process_create(
+                      zx_job_default(),
                       name, static_cast<uint32_t>(strlen(name)), 0,
                       process_.reset_and_get_address(),
                       root_vmar_.reset_and_get_address()),
-                  MX_OK, "mx_process_create");
+                  ZX_OK, "zx_process_create");
     }
 
-    const mx::vmar& root_vmar() const { return root_vmar_; }
+    const zx::vmar& root_vmar() const { return root_vmar_; }
     uintptr_t vdso_base() const { return vdso_base_; }
     uintptr_t vdso_code_offset() const { return vdso_code_offset_; }
     uintptr_t vdso_code_size() const { return vdso_code_size_; }
@@ -40,18 +40,18 @@
         return vdso_code_offset_ + vdso_code_size_;
     }
 
-    mx_status_t load_vdso(mx::vmar* segments_vmar = nullptr,
+    zx_status_t load_vdso(zx::vmar* segments_vmar = nullptr,
                           bool really_load = true) {
         elf_load_header_t header;
         uintptr_t phoff;
-        mx_status_t status = elf_load_prepare(vdso_vmo.get(), nullptr, 0,
+        zx_status_t status = elf_load_prepare(vdso_vmo.get(), nullptr, 0,
                                               &header, &phoff);
-        if (status == MX_OK) {
+        if (status == ZX_OK) {
             fbl::Array<elf_phdr_t> phdrs(new elf_phdr_t[header.e_phnum],
                                           header.e_phnum);
             status = elf_load_read_phdrs(vdso_vmo.get(), phdrs.get(), phoff,
                                          header.e_phnum);
-            if (status == MX_OK) {
+            if (status == ZX_OK) {
                 for (const auto& ph : phdrs) {
                     if (ph.p_type == PT_LOAD && (ph.p_type & PF_X)) {
                         vdso_code_offset_ = ph.p_vaddr;
@@ -69,13 +69,13 @@
         return status;
     }
 
-    mx_status_t compute_vdso_sizes() {
+    zx_status_t compute_vdso_sizes() {
         return load_vdso(nullptr, false);
     }
 
 private:
-    mx::process process_;
-    mx::vmar root_vmar_;
+    zx::process process_;
+    zx::vmar root_vmar_;
     uintptr_t vdso_base_ = 0;
     uintptr_t vdso_code_offset_ = 0;
     uintptr_t vdso_code_size_ = 0;
@@ -87,10 +87,10 @@
     ScratchPad scratch(__func__);
 
     // Load the vDSO once.  That's on me.
-    EXPECT_EQ(scratch.load_vdso(), MX_OK, "load vDSO into empty process");
+    EXPECT_EQ(scratch.load_vdso(), ZX_OK, "load vDSO into empty process");
 
     // Load the vDSO twice.  Can't get loaded again.
-    EXPECT_EQ(scratch.load_vdso(), MX_ERR_ACCESS_DENIED, "load vDSO second time");
+    EXPECT_EQ(scratch.load_vdso(), ZX_ERR_ACCESS_DENIED, "load vDSO second time");
 
     END_TEST;
 }
@@ -101,52 +101,52 @@
     ScratchPad scratch(__func__);
 
     // Load the vDSO and hold onto the sub-VMAR.
-    mx::vmar vdso_vmar;
-    EXPECT_EQ(scratch.load_vdso(&vdso_vmar), MX_OK, "load vDSO");
+    zx::vmar vdso_vmar;
+    EXPECT_EQ(scratch.load_vdso(&vdso_vmar), ZX_OK, "load vDSO");
 
     // Changing protections on the code pages is forbidden.
     EXPECT_EQ(vdso_vmar.protect(scratch.vdso_code_address(),
                                 scratch.vdso_code_size(),
-                                MX_VM_FLAG_PERM_READ),
-              MX_ERR_ACCESS_DENIED, "mx_vmar_protect on vDSO code");
+                                ZX_VM_FLAG_PERM_READ),
+              ZX_ERR_ACCESS_DENIED, "zx_vmar_protect on vDSO code");
 
-    mx::vmo vmo;
-    ASSERT_EQ(mx::vmo::create(scratch.vdso_total_size(), 0, &vmo),
-              MX_OK, "mx_vmo_create");
+    zx::vmo vmo;
+    ASSERT_EQ(zx::vmo::create(scratch.vdso_total_size(), 0, &vmo),
+              ZX_OK, "zx_vmo_create");
 
     // Implicit unmapping by overwriting the mapping is forbidden.
     uintptr_t addr = 0;
     EXPECT_EQ(vdso_vmar.map(0, vmo, 0, scratch.vdso_total_size(),
-                            MX_VM_FLAG_PERM_READ |
-                            MX_VM_FLAG_SPECIFIC_OVERWRITE,
+                            ZX_VM_FLAG_PERM_READ |
+                            ZX_VM_FLAG_SPECIFIC_OVERWRITE,
                             &addr),
-              MX_ERR_ACCESS_DENIED, "mx_vmar_map to overmap vDSO");
-    EXPECT_EQ(addr, 0, "mx_vmar_map to overmap vDSO");
+              ZX_ERR_ACCESS_DENIED, "zx_vmar_map to overmap vDSO");
+    EXPECT_EQ(addr, 0, "zx_vmar_map to overmap vDSO");
 
     // Also forbidden if done from a parent VMAR.
-    mx_info_vmar_t root_vmar_info;
-    ASSERT_EQ(scratch.root_vmar().get_info(MX_INFO_VMAR, &root_vmar_info,
+    zx_info_vmar_t root_vmar_info;
+    ASSERT_EQ(scratch.root_vmar().get_info(ZX_INFO_VMAR, &root_vmar_info,
                                            sizeof(root_vmar_info),
                                            nullptr, nullptr),
-              MX_OK, "mx_object_get_info on root VMAR");
+              ZX_OK, "zx_object_get_info on root VMAR");
     EXPECT_EQ(scratch.root_vmar().
               map(scratch.vdso_base() - root_vmar_info.base, vmo,
                   0, scratch.vdso_total_size(),
-                  MX_VM_FLAG_PERM_READ | MX_VM_FLAG_SPECIFIC_OVERWRITE,
+                  ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_SPECIFIC_OVERWRITE,
                   &addr),
-              MX_ERR_ACCESS_DENIED, "mx_vmar_map to overmap vDSO from root");
-    EXPECT_EQ(addr, 0, "mx_vmar_map to overmap vDSO from root");
+              ZX_ERR_ACCESS_DENIED, "zx_vmar_map to overmap vDSO from root");
+    EXPECT_EQ(addr, 0, "zx_vmar_map to overmap vDSO from root");
 
     // Explicit unmapping covering the vDSO code region is forbidden.
     EXPECT_EQ(scratch.root_vmar().unmap(scratch.vdso_base(),
                                         scratch.vdso_total_size()),
-              MX_ERR_ACCESS_DENIED, "mx_vmar_unmap to unmap vDSO");
+              ZX_ERR_ACCESS_DENIED, "zx_vmar_unmap to unmap vDSO");
 
     // Implicit unmapping by destroying a containing VMAR is forbidden.
     EXPECT_EQ(vdso_vmar.destroy(),
-              MX_ERR_ACCESS_DENIED, "mx_vmar_destroy to unmap vDSO");
+              ZX_ERR_ACCESS_DENIED, "zx_vmar_destroy to unmap vDSO");
     EXPECT_EQ(scratch.root_vmar().destroy(),
-              MX_ERR_ACCESS_DENIED, "mx_vmar_destroy on root to unmap vDSO");
+              ZX_ERR_ACCESS_DENIED, "zx_vmar_destroy on root to unmap vDSO");
 
     END_TEST;
 }
@@ -156,15 +156,15 @@
 
     ScratchPad scratch(__func__);
 
-    ASSERT_EQ(scratch.compute_vdso_sizes(), MX_OK,
+    ASSERT_EQ(scratch.compute_vdso_sizes(), ZX_OK,
               "cannot read vDSO program headers");
 
     // Try to map the first page, which is not the code, as executable.
     uintptr_t addr;
     EXPECT_EQ(scratch.root_vmar().
               map(0, vdso_vmo, 0, PAGE_SIZE,
-                  MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, &addr),
-              MX_ERR_ACCESS_DENIED, "executable mapping of wrong part of vDSO");
+                  ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, &addr),
+              ZX_ERR_ACCESS_DENIED, "executable mapping of wrong part of vDSO");
 
     // Try to map only part of the code, not the whole code segment.
     ASSERT_GE(scratch.vdso_code_size(), PAGE_SIZE, "vDSO code < page??");
@@ -172,8 +172,8 @@
         ASSERT_EQ(scratch.vdso_code_size() % PAGE_SIZE, 0);
         EXPECT_EQ(scratch.root_vmar().
                   map(0, vdso_vmo, scratch.vdso_code_offset(), PAGE_SIZE,
-                      MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, &addr),
-                  MX_ERR_ACCESS_DENIED,
+                      ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, &addr),
+                  ZX_ERR_ACCESS_DENIED,
                   "executable mapping of subset of vDSO code");
     }
 
diff --git a/system/utest/vmo/bench.cpp b/system/utest/vmo/bench.cpp
index 9bf1b22..aa2f982 100644
--- a/system/utest/vmo/bench.cpp
+++ b/system/utest/vmo/bench.cpp
@@ -9,44 +9,44 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include <magenta/compiler.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/compiler.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <fbl/algorithm.h>
 
 #include "bench.h"
 
 // spin the cpu a bit to make sure the frequency is cranked to the top
-static void spin(mx_time_t nanosecs) {
-    mx_time_t t = mx_time_get(MX_CLOCK_MONOTONIC);
+static void spin(zx_time_t nanosecs) {
+    zx_time_t t = zx_time_get(ZX_CLOCK_MONOTONIC);
 
-    while (mx_time_get(MX_CLOCK_MONOTONIC) - t < nanosecs)
+    while (zx_time_get(ZX_CLOCK_MONOTONIC) - t < nanosecs)
         ;
 }
 
 template <typename T>
-inline mx_time_t time_it(T func) {
-    spin(MX_MSEC(10));
+inline zx_time_t time_it(T func) {
+    spin(ZX_MSEC(10));
 
-    mx_time_t t = mx_time_get(MX_CLOCK_MONOTONIC);
+    zx_time_t t = zx_time_get(ZX_CLOCK_MONOTONIC);
     func();
-    return mx_time_get(MX_CLOCK_MONOTONIC) - t;
+    return zx_time_get(ZX_CLOCK_MONOTONIC) - t;
 }
 
 int vmo_run_benchmark() {
-    mx_time_t t;
-    //mx_handle_t vmo;
+    zx_time_t t;
+    //zx_handle_t vmo;
 
     printf("starting VMO benchmark\n");
 
     // allocate a bunch of large vmos, delete them
     const size_t size = 32*1024*1024;
-    mx_handle_t vmos[32];
+    zx_handle_t vmos[32];
     uintptr_t ptr;
 
     t = time_it([&](){
         for (auto& vmo : vmos) {
-            mx_vmo_create(size, 0, &vmo);
+            zx_vmo_create(size, 0, &vmo);
         }
     });
 
@@ -54,16 +54,16 @@
 
     t = time_it([&](){
         for (auto& vmo : vmos) {
-            mx_handle_close(vmo);
+            zx_handle_close(vmo);
         }
     });
     printf("\ttook %" PRIu64 " nsecs to delete %zu vmos of size %zu\n", t, fbl::count_of(vmos), size);
 
     // create a vmo and demand fault it in
-    mx_handle_t vmo;
-    mx_vmo_create(size, 0, &vmo);
+    zx_handle_t vmo;
+    zx_vmo_create(size, 0, &vmo);
 
-    mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &ptr);
+    zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &ptr);
 
     t = time_it([&](){
         for (size_t i = 0; i < size; i += PAGE_SIZE) {
@@ -95,12 +95,12 @@
 
     // unmap the original mapping
     t = time_it([&](){
-        mx_vmar_unmap(mx_vmar_root_self(), ptr, size);
+        zx_vmar_unmap(zx_vmar_root_self(), ptr, size);
     });
     printf("\ttook %" PRIu64 " nsecs to unmap the vmo %zu (%zu pages)\n", t, size, size / PAGE_SIZE);
 
     // map it a again and time read faulting it
-    mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &ptr);
+    zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &ptr);
 
     t = time_it([&](){
         for (size_t i = 0; i < size; i += PAGE_SIZE) {
@@ -109,10 +109,10 @@
     });
     printf("\ttook %" PRIu64 " nsecs to read fault in vmo of size %zu in another mapping\n", t, size);
 
-    mx_vmar_unmap(mx_vmar_root_self(), ptr, size);
+    zx_vmar_unmap(zx_vmar_root_self(), ptr, size);
 
     // map it a again and time write faulting it
-    mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &ptr);
+    zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &ptr);
 
     t = time_it([&](){
         for (size_t i = 0; i < size; i += PAGE_SIZE) {
@@ -121,18 +121,18 @@
     });
     printf("\ttook %" PRIu64 " nsecs to write fault in vmo of size %zu in another mapping\n", t, size);
 
-    mx_vmar_unmap(mx_vmar_root_self(), ptr, size);
+    zx_vmar_unmap(zx_vmar_root_self(), ptr, size);
 
     // delete the vmo
     t = time_it([&](){
-        mx_handle_close(vmo);
+        zx_handle_close(vmo);
     });
     printf("\ttook %" PRIu64 " nsecs to delete populated vmo of size %zu\n", t, size);
 
     // create a second vmo and write fault it in directly
-    mx_vmo_create(size, 0, &vmo);
+    zx_vmo_create(size, 0, &vmo);
 
-    mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &ptr);
+    zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &ptr);
 
     t = time_it([&](){
         for (size_t i = 0; i < size; i += PAGE_SIZE) {
@@ -141,39 +141,39 @@
     });
     printf("\ttook %" PRIu64 " nsecs to write fault in vmo of size %zu\n", t, size);
 
-    mx_handle_close(vmo);
+    zx_handle_close(vmo);
 
     // create a vmo and commit and decommit it directly
-    mx_vmo_create(size, 0, &vmo);
+    zx_vmo_create(size, 0, &vmo);
 
     t = time_it([&](){
-        mx_vmo_op_range(vmo, MX_VMO_OP_COMMIT, 0, size, nullptr, 0);
+        zx_vmo_op_range(vmo, ZX_VMO_OP_COMMIT, 0, size, nullptr, 0);
     });
     printf("\ttook %" PRIu64 " nsecs to commit vmo of size %zu\n", t, size);
 
     uint64_t addrs[size / PAGE_SIZE];
     t = time_it([&](){
-        mx_status_t status = mx_vmo_op_range(vmo, MX_VMO_OP_LOOKUP, 0, size, addrs, sizeof(addrs));
-        if (status != MX_OK) {
+        zx_status_t status = zx_vmo_op_range(vmo, ZX_VMO_OP_LOOKUP, 0, size, addrs, sizeof(addrs));
+        if (status != ZX_OK) {
             __builtin_trap();
         }
     });
     printf("\ttook %" PRIu64 " nsecs to lookup vmo of size %zu\n", t, size);
 
     t = time_it([&](){
-        mx_status_t status = mx_vmo_op_range(vmo, MX_VMO_OP_COMMIT, 0, size, nullptr, 0);
-        if (status != MX_OK) {
+        zx_status_t status = zx_vmo_op_range(vmo, ZX_VMO_OP_COMMIT, 0, size, nullptr, 0);
+        if (status != ZX_OK) {
             __builtin_trap();
         }
     });
     printf("\ttook %" PRIu64 " nsecs to commit already committed vmo of size %zu\n", t, size);
 
     t = time_it([&](){
-        mx_vmo_op_range(vmo, MX_VMO_OP_DECOMMIT, 0, size, nullptr, 0);
+        zx_vmo_op_range(vmo, ZX_VMO_OP_DECOMMIT, 0, size, nullptr, 0);
     });
     printf("\ttook %" PRIu64 " nsecs to decommit vmo of size %zu\n", t, size);
 
-    mx_handle_close(vmo);
+    zx_handle_close(vmo);
 
     printf("done with benchmark\n");
 
diff --git a/system/utest/vmo/rules.mk b/system/utest/vmo/rules.mk
index 055d17c..3443b98 100644
--- a/system/utest/vmo/rules.mk
+++ b/system/utest/vmo/rules.mk
@@ -15,6 +15,6 @@
 MODULE_NAME := vmo-test
 
 MODULE_STATIC_LIBS := system/ulib/pretty system/ulib/fbl
-MODULE_LIBS := system/ulib/unittest system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/unittest system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/system/utest/vmo/vmo.cpp b/system/utest/vmo/vmo.cpp
index cb0a057..16610ee 100644
--- a/system/utest/vmo/vmo.cpp
+++ b/system/utest/vmo/vmo.cpp
@@ -10,9 +10,9 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <fbl/algorithm.h>
 #include <pretty/hexdump.h>
 #include <unittest/unittest.h>
@@ -22,18 +22,18 @@
 bool vmo_create_test() {
     BEGIN_TEST;
 
-    mx_status_t status;
-    mx_handle_t vmo[16];
+    zx_status_t status;
+    zx_handle_t vmo[16];
 
     // allocate a bunch of vmos then free them
     for (size_t i = 0; i < fbl::count_of(vmo); i++) {
-        status = mx_vmo_create(i * PAGE_SIZE, 0, &vmo[i]);
-        EXPECT_EQ(MX_OK, status, "vm_object_create");
+        status = zx_vmo_create(i * PAGE_SIZE, 0, &vmo[i]);
+        EXPECT_EQ(ZX_OK, status, "vm_object_create");
     }
 
     for (size_t i = 0; i < fbl::count_of(vmo); i++) {
-        status = mx_handle_close(vmo[i]);
-        EXPECT_EQ(MX_OK, status, "handle_close");
+        status = zx_handle_close(vmo[i]);
+        EXPECT_EQ(ZX_OK, status, "handle_close");
     }
 
     END_TEST;
@@ -42,18 +42,18 @@
 bool vmo_read_write_test() {
     BEGIN_TEST;
 
-    mx_status_t status;
+    zx_status_t status;
     size_t size;
-    mx_handle_t vmo;
+    zx_handle_t vmo;
 
     // allocate an object and read/write from it
     const size_t len = PAGE_SIZE * 4;
-    status = mx_vmo_create(len, 0, &vmo);
-    EXPECT_EQ(status, MX_OK, "vm_object_create");
+    status = zx_vmo_create(len, 0, &vmo);
+    EXPECT_EQ(status, ZX_OK, "vm_object_create");
 
     char buf[len];
-    status = mx_vmo_read(vmo, buf, 0, sizeof(buf), &size);
-    EXPECT_EQ(status, MX_OK, "vm_object_read");
+    status = zx_vmo_read(vmo, buf, 0, sizeof(buf), &size);
+    EXPECT_EQ(status, ZX_OK, "vm_object_read");
     EXPECT_EQ(sizeof(buf), size, "vm_object_read");
 
     // make sure it's full of zeros
@@ -67,26 +67,26 @@
     }
 
     memset(buf, 0x99, sizeof(buf));
-    status = mx_vmo_write(vmo, buf, 0, sizeof(buf), &size);
-    EXPECT_EQ(status, MX_OK, "vm_object_write");
+    status = zx_vmo_write(vmo, buf, 0, sizeof(buf), &size);
+    EXPECT_EQ(status, ZX_OK, "vm_object_write");
     EXPECT_EQ(sizeof(buf), size, "vm_object_write");
 
     // map it
     uintptr_t ptr;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, len,
-                         MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, &ptr);
-    EXPECT_EQ(MX_OK, status, "vm_map");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, len,
+                         ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, &ptr);
+    EXPECT_EQ(ZX_OK, status, "vm_map");
     EXPECT_NE(0u, ptr, "vm_map");
 
     // check that it matches what we last wrote into it
     EXPECT_BYTES_EQ((uint8_t*)buf, (uint8_t*)ptr, sizeof(buf), "mapped buffer");
 
-    status = mx_vmar_unmap(mx_vmar_root_self(), ptr, len);
-    EXPECT_EQ(MX_OK, status, "vm_unmap");
+    status = zx_vmar_unmap(zx_vmar_root_self(), ptr, len);
+    EXPECT_EQ(ZX_OK, status, "vm_unmap");
 
     // close the handle
-    status = mx_handle_close(vmo);
-    EXPECT_EQ(MX_OK, status, "handle_close");
+    status = zx_handle_close(vmo);
+    EXPECT_EQ(ZX_OK, status, "handle_close");
 
     END_TEST;
 }
@@ -94,44 +94,44 @@
 bool vmo_map_test() {
     BEGIN_TEST;
 
-    mx_status_t status;
-    mx_handle_t vmo;
+    zx_status_t status;
+    zx_handle_t vmo;
     uintptr_t ptr[3] = {};
 
     // allocate a vmo
-    status = mx_vmo_create(4 * PAGE_SIZE, 0, &vmo);
-    EXPECT_EQ(MX_OK, status, "vm_object_create");
+    status = zx_vmo_create(4 * PAGE_SIZE, 0, &vmo);
+    EXPECT_EQ(ZX_OK, status, "vm_object_create");
 
     // do a regular map
     ptr[0] = 0;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, PAGE_SIZE,
-                         MX_VM_FLAG_PERM_READ, &ptr[0]);
-    EXPECT_EQ(MX_OK, status, "map");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, PAGE_SIZE,
+                         ZX_VM_FLAG_PERM_READ, &ptr[0]);
+    EXPECT_EQ(ZX_OK, status, "map");
     EXPECT_NE(0u, ptr[0], "map address");
     //printf("mapped %#" PRIxPTR "\n", ptr[0]);
 
     // try to map something completely out of range without any fixed mapping, should succeed
     ptr[2] = UINTPTR_MAX;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, PAGE_SIZE,
-                         MX_VM_FLAG_PERM_READ, &ptr[2]);
-    EXPECT_EQ(MX_OK, status, "map");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, PAGE_SIZE,
+                         ZX_VM_FLAG_PERM_READ, &ptr[2]);
+    EXPECT_EQ(ZX_OK, status, "map");
     EXPECT_NE(0u, ptr[2], "map address");
 
     // try to map something completely out of range fixed, should fail
     uintptr_t map_addr;
-    status = mx_vmar_map(mx_vmar_root_self(), UINTPTR_MAX,
+    status = zx_vmar_map(zx_vmar_root_self(), UINTPTR_MAX,
                          vmo, 0, PAGE_SIZE,
-                         MX_VM_FLAG_PERM_READ | MX_VM_FLAG_SPECIFIC, &map_addr);
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, status, "map");
+                         ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_SPECIFIC, &map_addr);
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, status, "map");
 
     // cleanup
-    status = mx_handle_close(vmo);
-    EXPECT_EQ(MX_OK, status, "handle_close");
+    status = zx_handle_close(vmo);
+    EXPECT_EQ(ZX_OK, status, "handle_close");
 
     for (auto p: ptr) {
         if (p) {
-            status = mx_vmar_unmap(mx_vmar_root_self(), p, PAGE_SIZE);
-            EXPECT_EQ(MX_OK, status, "unmap");
+            status = zx_vmar_unmap(zx_vmar_root_self(), p, PAGE_SIZE);
+            EXPECT_EQ(ZX_OK, status, "unmap");
         }
     }
 
@@ -141,31 +141,31 @@
 bool vmo_read_only_map_test() {
     BEGIN_TEST;
 
-    mx_status_t status;
-    mx_handle_t vmo;
+    zx_status_t status;
+    zx_handle_t vmo;
 
     // allocate an object and read/write from it
     const size_t len = PAGE_SIZE;
-    status = mx_vmo_create(len, 0, &vmo);
-    EXPECT_EQ(MX_OK, status, "vm_object_create");
+    status = zx_vmo_create(len, 0, &vmo);
+    EXPECT_EQ(ZX_OK, status, "vm_object_create");
 
     // map it
     uintptr_t ptr;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, len,
-                         MX_VM_FLAG_PERM_READ, &ptr);
-    EXPECT_EQ(MX_OK, status, "vm_map");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, len,
+                         ZX_VM_FLAG_PERM_READ, &ptr);
+    EXPECT_EQ(ZX_OK, status, "vm_map");
     EXPECT_NE(0u, ptr, "vm_map");
 
     size_t sz;
-    auto sstatus = mx_cprng_draw((void*)ptr, 1, &sz);
+    auto sstatus = zx_cprng_draw((void*)ptr, 1, &sz);
     EXPECT_LT(sstatus, 0, "write");
 
-    status = mx_vmar_unmap(mx_vmar_root_self(), ptr, len);
-    EXPECT_EQ(MX_OK, status, "vm_unmap");
+    status = zx_vmar_unmap(zx_vmar_root_self(), ptr, len);
+    EXPECT_EQ(ZX_OK, status, "vm_unmap");
 
     // close the handle
-    status = mx_handle_close(vmo);
-    EXPECT_EQ(MX_OK, status, "handle_close");
+    status = zx_handle_close(vmo);
+    EXPECT_EQ(ZX_OK, status, "handle_close");
 
     END_TEST;
 }
@@ -173,45 +173,45 @@
 bool vmo_no_perm_map_test() {
     BEGIN_TEST;
 
-    mx_status_t status;
-    mx_handle_t vmo;
-    mx_handle_t channel[2];
+    zx_status_t status;
+    zx_handle_t vmo;
+    zx_handle_t channel[2];
 
     // create a channel for testing read permissions via syscall failure
-    status = mx_channel_create(0, &channel[0], &channel[1]);
-    EXPECT_EQ(MX_OK, status, "vm_channel_create");
+    status = zx_channel_create(0, &channel[0], &channel[1]);
+    EXPECT_EQ(ZX_OK, status, "vm_channel_create");
 
     // allocate an object and read/write from it
     const size_t len = PAGE_SIZE;
-    status = mx_vmo_create(len, 0, &vmo);
-    EXPECT_EQ(MX_OK, status, "vm_object_create");
+    status = zx_vmo_create(len, 0, &vmo);
+    EXPECT_EQ(ZX_OK, status, "vm_object_create");
 
     // map it with read permissions
     uintptr_t ptr;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, len, MX_VM_FLAG_PERM_READ, &ptr);
-    EXPECT_EQ(MX_OK, status, "vm_map");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, len, ZX_VM_FLAG_PERM_READ, &ptr);
+    EXPECT_EQ(ZX_OK, status, "vm_map");
     EXPECT_NE(0u, ptr, "vm_map");
 
     // protect it to no permissions
-    status = mx_vmar_protect(mx_vmar_root_self(), ptr, len, 0);
-    EXPECT_EQ(MX_OK, status, "vm_protect");
+    status = zx_vmar_protect(zx_vmar_root_self(), ptr, len, 0);
+    EXPECT_EQ(ZX_OK, status, "vm_protect");
 
     // test writing to the mapping
     size_t sz;
-    status = mx_cprng_draw(reinterpret_cast<void*>(ptr), 1, &sz);
-    EXPECT_NE(status, MX_OK, "write");
+    status = zx_cprng_draw(reinterpret_cast<void*>(ptr), 1, &sz);
+    EXPECT_NE(status, ZX_OK, "write");
 
     // test reading from the mapping
-    status = mx_channel_write(channel[0], 0, reinterpret_cast<void*>(ptr), 1, nullptr, 0);
-    EXPECT_NE(status, MX_OK, "read");
+    status = zx_channel_write(channel[0], 0, reinterpret_cast<void*>(ptr), 1, nullptr, 0);
+    EXPECT_NE(status, ZX_OK, "read");
 
-    status = mx_vmar_unmap(mx_vmar_root_self(), ptr, len);
-    EXPECT_EQ(MX_OK, status, "vm_unmap");
+    status = zx_vmar_unmap(zx_vmar_root_self(), ptr, len);
+    EXPECT_EQ(ZX_OK, status, "vm_unmap");
 
     // close the handle
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "handle_close");
-    EXPECT_EQ(MX_OK, mx_handle_close(channel[0]), "handle_close");
-    EXPECT_EQ(MX_OK, mx_handle_close(channel[1]), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(channel[0]), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(channel[1]), "handle_close");
 
     END_TEST;
 }
@@ -219,53 +219,53 @@
 bool vmo_no_perm_protect_test() {
     BEGIN_TEST;
 
-    mx_status_t status;
-    mx_handle_t vmo;
-    mx_handle_t channel[2];
+    zx_status_t status;
+    zx_handle_t vmo;
+    zx_handle_t channel[2];
 
     // create a channel for testing read permissions via syscall failure
-    status = mx_channel_create(0, &channel[0], &channel[1]);
-    EXPECT_EQ(MX_OK, status, "vm_channel_create");
+    status = zx_channel_create(0, &channel[0], &channel[1]);
+    EXPECT_EQ(ZX_OK, status, "vm_channel_create");
 
     // allocate an object and read/write from it
     const size_t len = PAGE_SIZE;
-    status = mx_vmo_create(len, 0, &vmo);
-    EXPECT_EQ(MX_OK, status, "vm_object_create");
+    status = zx_vmo_create(len, 0, &vmo);
+    EXPECT_EQ(ZX_OK, status, "vm_object_create");
 
     // map it with no permissions
     uintptr_t ptr;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, len, 0, &ptr);
-    EXPECT_EQ(MX_OK, status, "vm_map");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, len, 0, &ptr);
+    EXPECT_EQ(ZX_OK, status, "vm_map");
     EXPECT_NE(0u, ptr, "vm_map");
 
     // test writing to the mapping
     size_t sz;
-    status = mx_cprng_draw(reinterpret_cast<void*>(ptr), 1, &sz);
-    EXPECT_NE(status, MX_OK, "write");
+    status = zx_cprng_draw(reinterpret_cast<void*>(ptr), 1, &sz);
+    EXPECT_NE(status, ZX_OK, "write");
 
     // test reading from the mapping
-    status = mx_channel_write(channel[0], 0, reinterpret_cast<void*>(ptr), 1, nullptr, 0);
-    EXPECT_NE(status, MX_OK, "read");
+    status = zx_channel_write(channel[0], 0, reinterpret_cast<void*>(ptr), 1, nullptr, 0);
+    EXPECT_NE(status, ZX_OK, "read");
 
     // protect it to read permissions and make sure it works as expected
-    status = mx_vmar_protect(mx_vmar_root_self(), ptr, len, MX_VM_FLAG_PERM_READ);
-    EXPECT_EQ(MX_OK, status, "vm_protect");
+    status = zx_vmar_protect(zx_vmar_root_self(), ptr, len, ZX_VM_FLAG_PERM_READ);
+    EXPECT_EQ(ZX_OK, status, "vm_protect");
 
     // test writing to the mapping
-    status = mx_cprng_draw(reinterpret_cast<void*>(ptr), 1, &sz);
-    EXPECT_NE(status, MX_OK, "write");
+    status = zx_cprng_draw(reinterpret_cast<void*>(ptr), 1, &sz);
+    EXPECT_NE(status, ZX_OK, "write");
 
     // test reading from the mapping
-    status = mx_channel_write(channel[0], 0, reinterpret_cast<void*>(ptr), 1, nullptr, 0);
-    EXPECT_EQ(status, MX_OK, "read");
+    status = zx_channel_write(channel[0], 0, reinterpret_cast<void*>(ptr), 1, nullptr, 0);
+    EXPECT_EQ(status, ZX_OK, "read");
 
-    status = mx_vmar_unmap(mx_vmar_root_self(), ptr, len);
-    EXPECT_EQ(MX_OK, status, "vm_unmap");
+    status = zx_vmar_unmap(zx_vmar_root_self(), ptr, len);
+    EXPECT_EQ(ZX_OK, status, "vm_unmap");
 
     // close the handle
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "handle_close");
-    EXPECT_EQ(MX_OK, mx_handle_close(channel[0]), "handle_close");
-    EXPECT_EQ(MX_OK, mx_handle_close(channel[1]), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(channel[0]), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(channel[1]), "handle_close");
 
     END_TEST;
 }
@@ -273,67 +273,67 @@
 bool vmo_resize_test() {
     BEGIN_TEST;
 
-    mx_status_t status;
-    mx_handle_t vmo;
+    zx_status_t status;
+    zx_handle_t vmo;
 
     // allocate an object
     size_t len = PAGE_SIZE * 4;
-    status = mx_vmo_create(len, 0, &vmo);
-    EXPECT_EQ(MX_OK, status, "vm_object_create");
+    status = zx_vmo_create(len, 0, &vmo);
+    EXPECT_EQ(ZX_OK, status, "vm_object_create");
 
     // get the size that we set it to
     uint64_t size = 0x99999999;
-    status = mx_vmo_get_size(vmo, &size);
-    EXPECT_EQ(MX_OK, status, "vm_object_get_size");
+    status = zx_vmo_get_size(vmo, &size);
+    EXPECT_EQ(ZX_OK, status, "vm_object_get_size");
     EXPECT_EQ(len, size, "vm_object_get_size");
 
     // try to resize it
     len += PAGE_SIZE;
-    status = mx_vmo_set_size(vmo, len);
-    EXPECT_EQ(MX_OK, status, "vm_object_set_size");
+    status = zx_vmo_set_size(vmo, len);
+    EXPECT_EQ(ZX_OK, status, "vm_object_set_size");
 
     // get the size again
     size = 0x99999999;
-    status = mx_vmo_get_size(vmo, &size);
-    EXPECT_EQ(MX_OK, status, "vm_object_get_size");
+    status = zx_vmo_get_size(vmo, &size);
+    EXPECT_EQ(ZX_OK, status, "vm_object_get_size");
     EXPECT_EQ(len, size, "vm_object_get_size");
 
     // try to resize it to a ludicrous size
-    status = mx_vmo_set_size(vmo, UINT64_MAX);
-    EXPECT_EQ(MX_ERR_OUT_OF_RANGE, status, "vm_object_set_size too big");
+    status = zx_vmo_set_size(vmo, UINT64_MAX);
+    EXPECT_EQ(ZX_ERR_OUT_OF_RANGE, status, "vm_object_set_size too big");
 
     // map it
     uintptr_t ptr;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, len,
-                         MX_VM_FLAG_PERM_READ, &ptr);
-    EXPECT_EQ(MX_OK, status, "vm_map");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, len,
+                         ZX_VM_FLAG_PERM_READ, &ptr);
+    EXPECT_EQ(ZX_OK, status, "vm_map");
     EXPECT_NONNULL(ptr, "vm_map");
 
     // resize it with it mapped
-    status = mx_vmo_set_size(vmo, size);
-    EXPECT_EQ(MX_OK, status, "vm_object_set_size");
+    status = zx_vmo_set_size(vmo, size);
+    EXPECT_EQ(ZX_OK, status, "vm_object_set_size");
 
     // unmap it
-    status = mx_vmar_unmap(mx_vmar_root_self(), ptr, len);
-    EXPECT_EQ(MX_OK, status, "unmap");
+    status = zx_vmar_unmap(zx_vmar_root_self(), ptr, len);
+    EXPECT_EQ(ZX_OK, status, "unmap");
 
     // close the handle
-    status = mx_handle_close(vmo);
-    EXPECT_EQ(MX_OK, status, "handle_close");
+    status = zx_handle_close(vmo);
+    EXPECT_EQ(ZX_OK, status, "handle_close");
 
     END_TEST;
 }
 
-static bool rights_test_map_helper(mx_handle_t vmo, size_t len, uint32_t flags, bool expect_success, mx_status_t fail_err_code, const char *msg) {
+static bool rights_test_map_helper(zx_handle_t vmo, size_t len, uint32_t flags, bool expect_success, zx_status_t fail_err_code, const char *msg) {
     uintptr_t ptr;
 
-    mx_status_t r = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, len, flags,
+    zx_status_t r = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, len, flags,
                                 &ptr);
     if (expect_success) {
-        EXPECT_EQ(MX_OK, r, msg);
+        EXPECT_EQ(ZX_OK, r, msg);
 
-        r = mx_vmar_unmap(mx_vmar_root_self(), ptr, len);
-        EXPECT_EQ(MX_OK, r, "unmap");
+        r = zx_vmar_unmap(zx_vmar_root_self(), ptr, len);
+        EXPECT_EQ(ZX_OK, r, "unmap");
     } else {
         EXPECT_EQ(fail_err_code, r, msg);
     }
@@ -342,12 +342,12 @@
 }
 
 // Returns zero on failure.
-static mx_rights_t get_handle_rights(mx_handle_t h) {
-    mx_info_handle_basic_t info;
-    mx_status_t s = mx_object_get_info(h, MX_INFO_HANDLE_BASIC, &info,
+static zx_rights_t get_handle_rights(zx_handle_t h) {
+    zx_info_handle_basic_t info;
+    zx_status_t s = zx_object_get_info(h, ZX_INFO_HANDLE_BASIC, &info,
                                        sizeof(info), nullptr, nullptr);
-    if (s != MX_OK) {
-        EXPECT_EQ(s, MX_OK);  // Poison the test
+    if (s != ZX_OK) {
+        EXPECT_EQ(s, ZX_OK);  // Poison the test
         return 0;
     }
     return info.rights;
@@ -359,137 +359,137 @@
     char buf[4096];
     size_t len = PAGE_SIZE * 4;
     size_t r;
-    mx_status_t status;
-    mx_handle_t vmo, vmo2;
+    zx_status_t status;
+    zx_handle_t vmo, vmo2;
 
     // allocate an object
-    status = mx_vmo_create(len, 0, &vmo);
-    EXPECT_EQ(MX_OK, status, "vm_object_create");
+    status = zx_vmo_create(len, 0, &vmo);
+    EXPECT_EQ(ZX_OK, status, "vm_object_create");
 
     // Check that the handle has at least the expected rights.
     // This list should match the list in docs/syscalls/vmo_create.md.
-    static const mx_rights_t kExpectedRights =
-        MX_RIGHT_DUPLICATE |
-        MX_RIGHT_TRANSFER |
-        MX_RIGHT_READ |
-        MX_RIGHT_WRITE |
-        MX_RIGHT_EXECUTE |
-        MX_RIGHT_MAP |
-        MX_RIGHT_GET_PROPERTY |
-        MX_RIGHT_SET_PROPERTY;
+    static const zx_rights_t kExpectedRights =
+        ZX_RIGHT_DUPLICATE |
+        ZX_RIGHT_TRANSFER |
+        ZX_RIGHT_READ |
+        ZX_RIGHT_WRITE |
+        ZX_RIGHT_EXECUTE |
+        ZX_RIGHT_MAP |
+        ZX_RIGHT_GET_PROPERTY |
+        ZX_RIGHT_SET_PROPERTY;
     EXPECT_EQ(kExpectedRights, kExpectedRights & get_handle_rights(vmo));
 
     // test that we can read/write it
-    status = mx_vmo_read(vmo, buf, 0, 0, &r);
+    status = zx_vmo_read(vmo, buf, 0, 0, &r);
     EXPECT_EQ(0, status, "vmo_read");
-    status = mx_vmo_write(vmo, buf, 0, 0, &r);
+    status = zx_vmo_write(vmo, buf, 0, 0, &r);
     EXPECT_EQ(0, status, "vmo_write");
 
-    vmo2 = MX_HANDLE_INVALID;
-    mx_handle_duplicate(vmo, MX_RIGHT_READ, &vmo2);
-    status = mx_vmo_read(vmo2, buf, 0, 0, &r);
+    vmo2 = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(vmo, ZX_RIGHT_READ, &vmo2);
+    status = zx_vmo_read(vmo2, buf, 0, 0, &r);
     EXPECT_EQ(0, status, "vmo_read");
-    status = mx_vmo_write(vmo2, buf, 0, 0, &r);
-    EXPECT_EQ(MX_ERR_ACCESS_DENIED, status, "vmo_write");
-    mx_handle_close(vmo2);
+    status = zx_vmo_write(vmo2, buf, 0, 0, &r);
+    EXPECT_EQ(ZX_ERR_ACCESS_DENIED, status, "vmo_write");
+    zx_handle_close(vmo2);
 
-    vmo2 = MX_HANDLE_INVALID;
-    mx_handle_duplicate(vmo, MX_RIGHT_WRITE, &vmo2);
-    status = mx_vmo_read(vmo2, buf, 0, 0, &r);
-    EXPECT_EQ(MX_ERR_ACCESS_DENIED, status, "vmo_read");
-    status = mx_vmo_write(vmo2, buf, 0, 0, &r);
+    vmo2 = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(vmo, ZX_RIGHT_WRITE, &vmo2);
+    status = zx_vmo_read(vmo2, buf, 0, 0, &r);
+    EXPECT_EQ(ZX_ERR_ACCESS_DENIED, status, "vmo_read");
+    status = zx_vmo_write(vmo2, buf, 0, 0, &r);
     EXPECT_EQ(0, status, "vmo_write");
-    mx_handle_close(vmo2);
+    zx_handle_close(vmo2);
 
-    vmo2 = MX_HANDLE_INVALID;
-    mx_handle_duplicate(vmo, 0, &vmo2);
-    status = mx_vmo_read(vmo2, buf, 0, 0, &r);
-    EXPECT_EQ(MX_ERR_ACCESS_DENIED, status, "vmo_read");
-    status = mx_vmo_write(vmo2, buf, 0, 0, &r);
-    EXPECT_EQ(MX_ERR_ACCESS_DENIED, status, "vmo_write");
-    mx_handle_close(vmo2);
+    vmo2 = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(vmo, 0, &vmo2);
+    status = zx_vmo_read(vmo2, buf, 0, 0, &r);
+    EXPECT_EQ(ZX_ERR_ACCESS_DENIED, status, "vmo_read");
+    status = zx_vmo_write(vmo2, buf, 0, 0, &r);
+    EXPECT_EQ(ZX_ERR_ACCESS_DENIED, status, "vmo_write");
+    zx_handle_close(vmo2);
 
     // full perm test
     if (!rights_test_map_helper(vmo, len, 0, true, 0, "map_noperms")) return false;
-    if (!rights_test_map_helper(vmo, len, MX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
-    if (!rights_test_map_helper(vmo, len, MX_VM_FLAG_PERM_WRITE, false, MX_ERR_INVALID_ARGS, "map_write")) return false;
-    if (!rights_test_map_helper(vmo, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, true, 0, "map_readwrite")) return false;
-    if (!rights_test_map_helper(vmo, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readwriteexec")) return false;
-    if (!rights_test_map_helper(vmo, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readexec")) return false;
+    if (!rights_test_map_helper(vmo, len, ZX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
+    if (!rights_test_map_helper(vmo, len, ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_INVALID_ARGS, "map_write")) return false;
+    if (!rights_test_map_helper(vmo, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, true, 0, "map_readwrite")) return false;
+    if (!rights_test_map_helper(vmo, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readwriteexec")) return false;
+    if (!rights_test_map_helper(vmo, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readexec")) return false;
 
     // try most of the permuations of mapping a vmo with various rights dropped
-    vmo2 = MX_HANDLE_INVALID;
-    mx_handle_duplicate(vmo, MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_EXECUTE, &vmo2);
-    if (!rights_test_map_helper(vmo2, len, 0, false, MX_ERR_ACCESS_DENIED, "map_noperms")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ, false, MX_ERR_ACCESS_DENIED, "map_read")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_WRITE, false, MX_ERR_ACCESS_DENIED, "map_write")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, false, MX_ERR_ACCESS_DENIED, "map_readwrite")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE, false, MX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, false, MX_ERR_ACCESS_DENIED, "map_readexec")) return false;
-    mx_handle_close(vmo2);
+    vmo2 = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(vmo, ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_EXECUTE, &vmo2);
+    if (!rights_test_map_helper(vmo2, len, 0, false, ZX_ERR_ACCESS_DENIED, "map_noperms")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ, false, ZX_ERR_ACCESS_DENIED, "map_read")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_ACCESS_DENIED, "map_write")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_ACCESS_DENIED, "map_readwrite")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE, false, ZX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, false, ZX_ERR_ACCESS_DENIED, "map_readexec")) return false;
+    zx_handle_close(vmo2);
 
-    vmo2 = MX_HANDLE_INVALID;
-    mx_handle_duplicate(vmo, MX_RIGHT_READ | MX_RIGHT_MAP, &vmo2);
+    vmo2 = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(vmo, ZX_RIGHT_READ | ZX_RIGHT_MAP, &vmo2);
     if (!rights_test_map_helper(vmo2, len, 0, true, 0, "map_noperms")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_WRITE, false, MX_ERR_INVALID_ARGS, "map_write")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, false, MX_ERR_ACCESS_DENIED, "map_readwrite")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE, false, MX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, false, MX_ERR_ACCESS_DENIED, "map_readexec")) return false;
-    mx_handle_close(vmo2);
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_INVALID_ARGS, "map_write")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_ACCESS_DENIED, "map_readwrite")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE, false, ZX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, false, ZX_ERR_ACCESS_DENIED, "map_readexec")) return false;
+    zx_handle_close(vmo2);
 
-    vmo2 = MX_HANDLE_INVALID;
-    mx_handle_duplicate(vmo, MX_RIGHT_WRITE | MX_RIGHT_MAP, &vmo2);
+    vmo2 = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(vmo, ZX_RIGHT_WRITE | ZX_RIGHT_MAP, &vmo2);
     if (!rights_test_map_helper(vmo2, len, 0, true, 0, "map_noperms")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ, false, MX_ERR_ACCESS_DENIED, "map_read")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_WRITE, false, MX_ERR_INVALID_ARGS, "map_write")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, false, MX_ERR_ACCESS_DENIED, "map_readwrite")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE, false, MX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, false, MX_ERR_ACCESS_DENIED, "map_readexec")) return false;
-    mx_handle_close(vmo2);
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ, false, ZX_ERR_ACCESS_DENIED, "map_read")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_INVALID_ARGS, "map_write")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_ACCESS_DENIED, "map_readwrite")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE, false, ZX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, false, ZX_ERR_ACCESS_DENIED, "map_readexec")) return false;
+    zx_handle_close(vmo2);
 
-    vmo2 = MX_HANDLE_INVALID;
-    mx_handle_duplicate(vmo, MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_MAP, &vmo2);
+    vmo2 = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(vmo, ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_MAP, &vmo2);
     if (!rights_test_map_helper(vmo2, len, 0, true, 0, "map_noperms")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_WRITE, false, MX_ERR_INVALID_ARGS, "map_write")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, true, 0, "map_readwrite")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE, false, MX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, false, MX_ERR_ACCESS_DENIED, "map_readexec")) return false;
-    mx_handle_close(vmo2);
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_INVALID_ARGS, "map_write")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, true, 0, "map_readwrite")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE, false, ZX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, false, ZX_ERR_ACCESS_DENIED, "map_readexec")) return false;
+    zx_handle_close(vmo2);
 
-    vmo2 = MX_HANDLE_INVALID;
-    mx_handle_duplicate(vmo, MX_RIGHT_READ | MX_RIGHT_EXECUTE | MX_RIGHT_MAP, &vmo2);
+    vmo2 = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(vmo, ZX_RIGHT_READ | ZX_RIGHT_EXECUTE | ZX_RIGHT_MAP, &vmo2);
     if (!rights_test_map_helper(vmo2, len, 0, true, 0, "map_noperms")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_WRITE, false, MX_ERR_INVALID_ARGS, "map_write")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, false, MX_ERR_ACCESS_DENIED, "map_readwrite")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE, false, MX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
-    if (!rights_test_map_helper(vmo, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readexec")) return false;
-    mx_handle_close(vmo2);
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_INVALID_ARGS, "map_write")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_ACCESS_DENIED, "map_readwrite")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE, false, ZX_ERR_ACCESS_DENIED, "map_readwriteexec")) return false;
+    if (!rights_test_map_helper(vmo, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readexec")) return false;
+    zx_handle_close(vmo2);
 
-    vmo2 = MX_HANDLE_INVALID;
-    mx_handle_duplicate(vmo, MX_RIGHT_READ | MX_RIGHT_WRITE | MX_RIGHT_EXECUTE | MX_RIGHT_MAP, &vmo2);
+    vmo2 = ZX_HANDLE_INVALID;
+    zx_handle_duplicate(vmo, ZX_RIGHT_READ | ZX_RIGHT_WRITE | ZX_RIGHT_EXECUTE | ZX_RIGHT_MAP, &vmo2);
     if (!rights_test_map_helper(vmo2, len, 0, true, 0, "map_noperms")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_WRITE, false, MX_ERR_INVALID_ARGS, "map_write")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE, true, 0, "map_readwrite")) return false;
-    if (!rights_test_map_helper(vmo2, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readwriteexec")) return false;
-    if (!rights_test_map_helper(vmo, len, MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readexec")) return false;
-    mx_handle_close(vmo2);
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ, true, 0, "map_read")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_WRITE, false, ZX_ERR_INVALID_ARGS, "map_write")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE, true, 0, "map_readwrite")) return false;
+    if (!rights_test_map_helper(vmo2, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readwriteexec")) return false;
+    if (!rights_test_map_helper(vmo, len, ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_EXECUTE, true, 0, "map_readexec")) return false;
+    zx_handle_close(vmo2);
 
     // test that we can get/set a property on it
     const char *set_name = "test vmo";
-    status = mx_object_set_property(vmo, MX_PROP_NAME, set_name, sizeof(set_name));
-    EXPECT_EQ(MX_OK, status, "set_property");
-    char get_name[MX_MAX_NAME_LEN];
-    status = mx_object_get_property(vmo, MX_PROP_NAME, get_name, sizeof(get_name));
-    EXPECT_EQ(MX_OK, status, "get_property");
+    status = zx_object_set_property(vmo, ZX_PROP_NAME, set_name, sizeof(set_name));
+    EXPECT_EQ(ZX_OK, status, "set_property");
+    char get_name[ZX_MAX_NAME_LEN];
+    status = zx_object_get_property(vmo, ZX_PROP_NAME, get_name, sizeof(get_name));
+    EXPECT_EQ(ZX_OK, status, "get_property");
     EXPECT_STR_EQ(set_name, get_name, sizeof(set_name), "vmo name");
 
     // close the handle
-    status = mx_handle_close(vmo);
-    EXPECT_EQ(MX_OK, status, "handle_close");
+    status = zx_handle_close(vmo);
+    EXPECT_EQ(ZX_OK, status, "handle_close");
 
     END_TEST;
 }
@@ -497,35 +497,35 @@
 bool vmo_lookup_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    mx_status_t status;
+    zx_handle_t vmo;
+    zx_status_t status;
 
     const size_t size = 16384;
-    mx_paddr_t buf[size / PAGE_SIZE];
+    zx_paddr_t buf[size / PAGE_SIZE];
 
-    status = mx_vmo_create(size, 0, &vmo);
+    status = zx_vmo_create(size, 0, &vmo);
     EXPECT_EQ(0, status, "vm_object_create");
 
     // do a lookup (this should fail becase the pages aren't committed)
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_LOOKUP, 0, size, buf, sizeof(buf));
-    EXPECT_EQ(MX_ERR_NO_MEMORY, status, "lookup on uncommitted vmo");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_LOOKUP, 0, size, buf, sizeof(buf));
+    EXPECT_EQ(ZX_ERR_NO_MEMORY, status, "lookup on uncommitted vmo");
 
     // commit the memory
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_COMMIT, 0, size, buf, sizeof(buf));
-    EXPECT_EQ(MX_OK, status, "committing memory");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_COMMIT, 0, size, buf, sizeof(buf));
+    EXPECT_EQ(ZX_OK, status, "committing memory");
 
     // do a lookup (should succeed)
     memset(buf, 0, sizeof(buf));
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_LOOKUP, 0, size, buf, sizeof(buf));
-    EXPECT_EQ(MX_OK, status, "lookup on committed vmo");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_LOOKUP, 0, size, buf, sizeof(buf));
+    EXPECT_EQ(ZX_OK, status, "lookup on committed vmo");
 
     for (auto addr: buf)
         EXPECT_NE(0u, addr, "looked up address");
 
     // do a lookup with an odd offset and an end pointer that ends up at an odd offset
     memset(buf, 0, sizeof(buf));
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_LOOKUP, 1, size - PAGE_SIZE, buf, sizeof(buf));
-    EXPECT_EQ(MX_OK, status, "lookup on committed vmo");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_LOOKUP, 1, size - PAGE_SIZE, buf, sizeof(buf));
+    EXPECT_EQ(ZX_OK, status, "lookup on committed vmo");
 
     for (auto addr: buf)
         EXPECT_NE(0u, addr, "looked up address");
@@ -533,20 +533,20 @@
     // invalid args
 
     // do a lookup with no size
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_LOOKUP, 0, 0, buf, sizeof(buf));
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, status, "zero size on lookup");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_LOOKUP, 0, 0, buf, sizeof(buf));
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, status, "zero size on lookup");
 
     // do a lookup out of range
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_LOOKUP, size + 1, 1, buf, sizeof(buf));
-    EXPECT_EQ(MX_ERR_OUT_OF_RANGE, status, "out of range");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_LOOKUP, size + 1, 1, buf, sizeof(buf));
+    EXPECT_EQ(ZX_ERR_OUT_OF_RANGE, status, "out of range");
 
     // do a lookup out of range
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_LOOKUP, 0, size + 1, buf, sizeof(buf));
-    EXPECT_EQ(MX_ERR_BUFFER_TOO_SMALL, status, "buffer too small");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_LOOKUP, 0, size + 1, buf, sizeof(buf));
+    EXPECT_EQ(ZX_ERR_BUFFER_TOO_SMALL, status, "buffer too small");
 
     // close the handle
-    status = mx_handle_close(vmo);
-    EXPECT_EQ(MX_OK, status, "handle_close");
+    status = zx_handle_close(vmo);
+    EXPECT_EQ(ZX_OK, status, "handle_close");
 
     END_TEST;
 }
@@ -554,47 +554,47 @@
 bool vmo_commit_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    mx_status_t status;
+    zx_handle_t vmo;
+    zx_status_t status;
     uintptr_t ptr, ptr2, ptr3;
 
     // create a vmo
     const size_t size = 16384;
 
-    status = mx_vmo_create(size, 0, &vmo);
+    status = zx_vmo_create(size, 0, &vmo);
     EXPECT_EQ(0, status, "vm_object_create");
 
     // commit a range of it
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_COMMIT, 0, size, nullptr, 0);
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_COMMIT, 0, size, nullptr, 0);
     EXPECT_EQ(0, status, "vm commit");
 
     // decommit that range
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_DECOMMIT, 0, size, nullptr, 0);
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_DECOMMIT, 0, size, nullptr, 0);
     EXPECT_EQ(0, status, "vm decommit");
 
     // commit a range of it
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_COMMIT, 0, size, nullptr, 0);
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_COMMIT, 0, size, nullptr, 0);
     EXPECT_EQ(0, status, "vm commit");
 
     // map it
     ptr = 0;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size,
-                         MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &ptr);
-    EXPECT_EQ(MX_OK, status, "map");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size,
+                         ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &ptr);
+    EXPECT_EQ(ZX_OK, status, "map");
     EXPECT_NONNULL(ptr, "map address");
 
     // second mapping with an offset
     ptr2 = 0;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, PAGE_SIZE, size,
-                         MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &ptr2);
-    EXPECT_EQ(MX_OK, status, "map2");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, PAGE_SIZE, size,
+                         ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &ptr2);
+    EXPECT_EQ(ZX_OK, status, "map2");
     EXPECT_NONNULL(ptr2, "map address2");
 
     // third mapping with a totally non-overlapping offset
     ptr3 = 0;
-    status = mx_vmar_map(mx_vmar_root_self(), 0, vmo, size * 2, size,
-                         MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &ptr3);
-    EXPECT_EQ(MX_OK, status, "map3");
+    status = zx_vmar_map(zx_vmar_root_self(), 0, vmo, size * 2, size,
+                         ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &ptr3);
+    EXPECT_EQ(ZX_OK, status, "map3");
     EXPECT_NONNULL(ptr3, "map address3");
 
     // write into it at offset PAGE_SIZE, read it back
@@ -607,7 +607,7 @@
     EXPECT_EQ(99u, (*u32a), "written memory");
 
     // decommit page 0
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_DECOMMIT, 0, PAGE_SIZE, nullptr, 0);
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_DECOMMIT, 0, PAGE_SIZE, nullptr, 0);
     EXPECT_EQ(0, status, "vm decommit");
 
     // verify that it didn't get unmapped
@@ -616,7 +616,7 @@
     EXPECT_EQ(99u, (*u32a), "written memory2");
 
     // decommit page 1
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_DECOMMIT, PAGE_SIZE, PAGE_SIZE, nullptr, 0);
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_DECOMMIT, PAGE_SIZE, PAGE_SIZE, nullptr, 0);
     EXPECT_EQ(0, status, "vm decommit");
 
     // verify that it did get unmapped
@@ -625,16 +625,16 @@
     EXPECT_EQ(0u, (*u32a), "written memory2");
 
     // unmap our vmos
-    status = mx_vmar_unmap(mx_vmar_root_self(), ptr, size);
-    EXPECT_EQ(MX_OK, status, "vm_unmap");
-    status = mx_vmar_unmap(mx_vmar_root_self(), ptr2, size);
-    EXPECT_EQ(MX_OK, status, "vm_unmap");
-    status = mx_vmar_unmap(mx_vmar_root_self(), ptr3, size);
-    EXPECT_EQ(MX_OK, status, "vm_unmap");
+    status = zx_vmar_unmap(zx_vmar_root_self(), ptr, size);
+    EXPECT_EQ(ZX_OK, status, "vm_unmap");
+    status = zx_vmar_unmap(zx_vmar_root_self(), ptr2, size);
+    EXPECT_EQ(ZX_OK, status, "vm_unmap");
+    status = zx_vmar_unmap(zx_vmar_root_self(), ptr3, size);
+    EXPECT_EQ(ZX_OK, status, "vm_unmap");
 
     // close the handle
-    status = mx_handle_close(vmo);
-    EXPECT_EQ(MX_OK, status, "handle_close");
+    status = zx_handle_close(vmo);
+    EXPECT_EQ(ZX_OK, status, "handle_close");
 
     END_TEST;
 }
@@ -642,19 +642,19 @@
 bool vmo_zero_page_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    mx_status_t status;
+    zx_handle_t vmo;
+    zx_status_t status;
     uintptr_t ptr[3];
 
     // create a vmo
     const size_t size = PAGE_SIZE * 4;
 
-    EXPECT_EQ(MX_OK, mx_vmo_create(size, 0, &vmo), "vm_object_create");
+    EXPECT_EQ(ZX_OK, zx_vmo_create(size, 0, &vmo), "vm_object_create");
 
     // make a few mappings of the vmo
     for (auto &p: ptr) {
-        EXPECT_EQ(MX_OK,
-                mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &p),
+        EXPECT_EQ(ZX_OK,
+                zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &p),
                 "map");
         EXPECT_NONNULL(ptr, "map address");
     }
@@ -684,8 +684,8 @@
     // write to the page via a vmo_write call
     uint32_t v = 100;
     size_t written;
-    status = mx_vmo_write(vmo, &v, PAGE_SIZE, sizeof(v), &written);
-    EXPECT_EQ(MX_OK, status, "writing to vmo");
+    status = zx_vmo_write(vmo, &v, PAGE_SIZE, sizeof(v), &written);
+    EXPECT_EQ(ZX_OK, status, "writing to vmo");
 
     // expect it to read back the new value
     EXPECT_EQ(100, *val, "read 100 from former zero page");
@@ -695,22 +695,22 @@
     EXPECT_EQ(0, *val, "read zero");
 
     // commit this range of the vmo via a commit call
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_COMMIT, PAGE_SIZE * 2, PAGE_SIZE, nullptr, 0);
-    EXPECT_EQ(MX_OK, status, "committing memory");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_COMMIT, PAGE_SIZE * 2, PAGE_SIZE, nullptr, 0);
+    EXPECT_EQ(ZX_OK, status, "committing memory");
 
     // write to the third page
-    status = mx_vmo_write(vmo, &v, PAGE_SIZE * 2, sizeof(v), &written);
-    EXPECT_EQ(MX_OK, status, "writing to vmo");
+    status = zx_vmo_write(vmo, &v, PAGE_SIZE * 2, sizeof(v), &written);
+    EXPECT_EQ(ZX_OK, status, "writing to vmo");
 
     // expect it to read back the new value
     EXPECT_EQ(100, *val, "read 100 from former zero page");
 
     // unmap
     for (auto p: ptr)
-        EXPECT_EQ(MX_OK, mx_vmar_unmap(mx_vmar_root_self(), p, size), "unmap");
+        EXPECT_EQ(ZX_OK, zx_vmar_unmap(zx_vmar_root_self(), p, size), "unmap");
 
     // close the handle
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "handle_close");
 
     END_TEST;
 }
@@ -719,38 +719,38 @@
 bool vmo_clone_test_1() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    mx_handle_t clone_vmo[3];
+    zx_handle_t vmo;
+    zx_handle_t clone_vmo[3];
 
     // create a vmo
     const size_t size = PAGE_SIZE * 4;
-    EXPECT_EQ(MX_OK, mx_vmo_create(size, 0, &vmo), "vm_object_create");
-    EXPECT_EQ(MX_OK, mx_object_set_property(vmo, MX_PROP_NAME, "test1", 5), "mx_object_set_property");
+    EXPECT_EQ(ZX_OK, zx_vmo_create(size, 0, &vmo), "vm_object_create");
+    EXPECT_EQ(ZX_OK, zx_object_set_property(vmo, ZX_PROP_NAME, "test1", 5), "zx_object_set_property");
 
     // clone it
-    clone_vmo[0] = MX_HANDLE_INVALID;
-    EXPECT_EQ(MX_OK, mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[0]), "vm_clone");
-    EXPECT_NE(MX_HANDLE_INVALID, clone_vmo[0], "vm_clone_handle");
-    char name[MX_MAX_NAME_LEN];
-    EXPECT_EQ(MX_OK, mx_object_get_property(clone_vmo[0], MX_PROP_NAME, name, MX_MAX_NAME_LEN), "mx_object_get_property");
+    clone_vmo[0] = ZX_HANDLE_INVALID;
+    EXPECT_EQ(ZX_OK, zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[0]), "vm_clone");
+    EXPECT_NE(ZX_HANDLE_INVALID, clone_vmo[0], "vm_clone_handle");
+    char name[ZX_MAX_NAME_LEN];
+    EXPECT_EQ(ZX_OK, zx_object_get_property(clone_vmo[0], ZX_PROP_NAME, name, ZX_MAX_NAME_LEN), "zx_object_get_property");
     EXPECT_TRUE(!strcmp(name, "test1"), "get_name");
 
     // clone it a second time
-    clone_vmo[1] = MX_HANDLE_INVALID;
-    EXPECT_EQ(MX_OK, mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[1]), "vm_clone");
-    EXPECT_NE(MX_HANDLE_INVALID, clone_vmo[1], "vm_clone_handle");
+    clone_vmo[1] = ZX_HANDLE_INVALID;
+    EXPECT_EQ(ZX_OK, zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[1]), "vm_clone");
+    EXPECT_NE(ZX_HANDLE_INVALID, clone_vmo[1], "vm_clone_handle");
 
     // clone the clone
-    clone_vmo[2] = MX_HANDLE_INVALID;
-    EXPECT_EQ(MX_OK, mx_vmo_clone(clone_vmo[1], MX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[2]), "vm_clone");
-    EXPECT_NE(MX_HANDLE_INVALID, clone_vmo[2], "vm_clone_handle");
+    clone_vmo[2] = ZX_HANDLE_INVALID;
+    EXPECT_EQ(ZX_OK, zx_vmo_clone(clone_vmo[1], ZX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[2]), "vm_clone");
+    EXPECT_NE(ZX_HANDLE_INVALID, clone_vmo[2], "vm_clone_handle");
 
     // close the original handle
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "handle_close");
 
     // close the clone handles
     for (auto h: clone_vmo)
-        EXPECT_EQ(MX_OK, mx_handle_close(h), "handle_close");
+        EXPECT_EQ(ZX_OK, zx_handle_close(h), "handle_close");
 
     END_TEST;
 }
@@ -759,30 +759,30 @@
 bool vmo_clone_test_2() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    mx_handle_t clone_vmo[1];
+    zx_handle_t vmo;
+    zx_handle_t clone_vmo[1];
     //uintptr_t ptr;
     size_t bytes_handled;
 
     // create a vmo
     const size_t size = PAGE_SIZE * 4;
-    EXPECT_EQ(MX_OK, mx_vmo_create(size, 0, &vmo), "vm_object_create");
+    EXPECT_EQ(ZX_OK, zx_vmo_create(size, 0, &vmo), "vm_object_create");
 
     // fill the original with stuff
     for (size_t off = 0; off < size; off += sizeof(off)) {
-        mx_vmo_write(vmo, &off, off, sizeof(off), &bytes_handled);
+        zx_vmo_write(vmo, &off, off, sizeof(off), &bytes_handled);
     }
 
     // clone it
-    clone_vmo[0] = MX_HANDLE_INVALID;
-    EXPECT_EQ(MX_OK, mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[0]), "vm_clone");
-    EXPECT_NE(MX_HANDLE_INVALID, clone_vmo[0], "vm_clone_handle");
+    clone_vmo[0] = ZX_HANDLE_INVALID;
+    EXPECT_EQ(ZX_OK, zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[0]), "vm_clone");
+    EXPECT_NE(ZX_HANDLE_INVALID, clone_vmo[0], "vm_clone_handle");
 
     // verify that the clone reads back as the same
     for (size_t off = 0; off < size; off += sizeof(off)) {
         size_t val;
 
-        mx_vmo_read(clone_vmo[0], &val, off, sizeof(val), &bytes_handled);
+        zx_vmo_read(clone_vmo[0], &val, off, sizeof(val), &bytes_handled);
 
         if (val != off) {
             EXPECT_EQ(val, off, "vm_clone read back");
@@ -792,17 +792,17 @@
 
     // write to part of the clone
     size_t val = 99;
-    mx_vmo_write(clone_vmo[0], &val, 0, sizeof(val), &bytes_handled);
+    zx_vmo_write(clone_vmo[0], &val, 0, sizeof(val), &bytes_handled);
 
     // verify the clone was written to
-    EXPECT_EQ(MX_OK, mx_vmo_read(clone_vmo[0], &val, 0, sizeof(val), &bytes_handled), "writing to clone");
+    EXPECT_EQ(ZX_OK, zx_vmo_read(clone_vmo[0], &val, 0, sizeof(val), &bytes_handled), "writing to clone");
 
     // verify it was written to
     EXPECT_EQ(99, val, "reading back from clone");
 
     // verify that the rest of the page it was written two was cloned
     for (size_t off = sizeof(val); off < PAGE_SIZE; off += sizeof(off)) {
-        mx_vmo_read(clone_vmo[0], &val, off, sizeof(val), &bytes_handled);
+        zx_vmo_read(clone_vmo[0], &val, off, sizeof(val), &bytes_handled);
 
         if (val != off) {
             EXPECT_EQ(val, off, "vm_clone read back");
@@ -812,7 +812,7 @@
 
     // verify that it didn't trash the original
     for (size_t off = 0; off < size; off += sizeof(off)) {
-        mx_vmo_read(vmo, &val, off, sizeof(val), &bytes_handled);
+        zx_vmo_read(vmo, &val, off, sizeof(val), &bytes_handled);
 
         if (val != off) {
             EXPECT_EQ(val, off, "vm_clone read back of original");
@@ -823,16 +823,16 @@
     // write to the original in the part that is still visible to the clone
     val = 99;
     uint64_t offset = PAGE_SIZE * 2;
-    EXPECT_EQ(MX_OK, mx_vmo_write(vmo, &val, offset, sizeof(val), &bytes_handled), "writing to original");
-    EXPECT_EQ(MX_OK, mx_vmo_read(clone_vmo[0], &val, offset, sizeof(val), &bytes_handled), "reading back original from clone");
+    EXPECT_EQ(ZX_OK, zx_vmo_write(vmo, &val, offset, sizeof(val), &bytes_handled), "writing to original");
+    EXPECT_EQ(ZX_OK, zx_vmo_read(clone_vmo[0], &val, offset, sizeof(val), &bytes_handled), "reading back original from clone");
     EXPECT_EQ(99, val, "checking value");
 
     // close the clone handles
     for (auto h: clone_vmo)
-        EXPECT_EQ(MX_OK, mx_handle_close(h), "handle_close");
+        EXPECT_EQ(ZX_OK, zx_handle_close(h), "handle_close");
 
     // close the original handle
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "handle_close");
 
     END_TEST;
 }
@@ -841,8 +841,8 @@
 bool vmo_clone_test_3() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    mx_handle_t clone_vmo[1];
+    zx_handle_t vmo;
+    zx_handle_t clone_vmo[1];
     uintptr_t ptr;
     uintptr_t clone_ptr;
     volatile uint32_t *p;
@@ -850,21 +850,21 @@
 
     // create a vmo
     const size_t size = PAGE_SIZE * 4;
-    EXPECT_EQ(MX_OK, mx_vmo_create(size, 0, &vmo), "vm_object_create");
+    EXPECT_EQ(ZX_OK, zx_vmo_create(size, 0, &vmo), "vm_object_create");
 
     // map it
-    EXPECT_EQ(MX_OK,
-            mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &ptr),
+    EXPECT_EQ(ZX_OK,
+            zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &ptr),
             "map");
     EXPECT_NONNULL(ptr, "map address");
     p = (volatile uint32_t *)ptr;
 
     // clone it and map that
-    clone_vmo[0] = MX_HANDLE_INVALID;
-    EXPECT_EQ(MX_OK, mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[0]), "vm_clone");
-    EXPECT_NE(MX_HANDLE_INVALID, clone_vmo[0], "vm_clone_handle");
-    EXPECT_EQ(MX_OK,
-            mx_vmar_map(mx_vmar_root_self(), 0, clone_vmo[0], 0, size, MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &clone_ptr),
+    clone_vmo[0] = ZX_HANDLE_INVALID;
+    EXPECT_EQ(ZX_OK, zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo[0]), "vm_clone");
+    EXPECT_NE(ZX_HANDLE_INVALID, clone_vmo[0], "vm_clone_handle");
+    EXPECT_EQ(ZX_OK,
+            zx_vmar_map(zx_vmar_root_self(), 0, clone_vmo[0], 0, size, ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &clone_ptr),
             "map");
     EXPECT_NONNULL(clone_ptr, "map address");
     cp = (volatile uint32_t *)clone_ptr;
@@ -896,14 +896,14 @@
     EXPECT_EQ(99, p[0], "read back from original");
 
     // close the original handle
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "handle_close");
 
     // close the clone handle
-    EXPECT_EQ(MX_OK, mx_handle_close(clone_vmo[0]), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(clone_vmo[0]), "handle_close");
 
     // unmap
-    EXPECT_EQ(MX_OK, mx_vmar_unmap(mx_vmar_root_self(), ptr, size), "unmap");
-    EXPECT_EQ(MX_OK, mx_vmar_unmap(mx_vmar_root_self(), clone_ptr, size), "unmap");
+    EXPECT_EQ(ZX_OK, zx_vmar_unmap(zx_vmar_root_self(), ptr, size), "unmap");
+    EXPECT_EQ(ZX_OK, zx_vmar_unmap(zx_vmar_root_self(), clone_ptr, size), "unmap");
 
     END_TEST;
 }
@@ -912,8 +912,8 @@
 bool vmo_clone_decommit_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    mx_handle_t clone_vmo;
+    zx_handle_t vmo;
+    zx_handle_t clone_vmo;
     uintptr_t ptr;
     uintptr_t clone_ptr;
     volatile uint32_t *p;
@@ -921,21 +921,21 @@
 
     // create a vmo
     const size_t size = PAGE_SIZE * 4;
-    EXPECT_EQ(MX_OK, mx_vmo_create(size, 0, &vmo), "vm_object_create");
+    EXPECT_EQ(ZX_OK, zx_vmo_create(size, 0, &vmo), "vm_object_create");
 
     // map it
-    EXPECT_EQ(MX_OK,
-            mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &ptr),
+    EXPECT_EQ(ZX_OK,
+            zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &ptr),
             "map");
     EXPECT_NONNULL(ptr, "map address");
     p = (volatile uint32_t *)ptr;
 
     // clone it and map that
-    clone_vmo = MX_HANDLE_INVALID;
-    EXPECT_EQ(MX_OK, mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo), "vm_clone");
-    EXPECT_NE(MX_HANDLE_INVALID, clone_vmo, "vm_clone_handle");
-    EXPECT_EQ(MX_OK,
-            mx_vmar_map(mx_vmar_root_self(), 0, clone_vmo, 0, size, MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &clone_ptr),
+    clone_vmo = ZX_HANDLE_INVALID;
+    EXPECT_EQ(ZX_OK, zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo), "vm_clone");
+    EXPECT_NE(ZX_HANDLE_INVALID, clone_vmo, "vm_clone_handle");
+    EXPECT_EQ(ZX_OK,
+            zx_vmar_map(zx_vmar_root_self(), 0, clone_vmo, 0, size, ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &clone_ptr),
             "map");
     EXPECT_NONNULL(clone_ptr, "map address");
     cp = (volatile uint32_t *)clone_ptr;
@@ -950,7 +950,7 @@
     EXPECT_EQ(100, cp[0], "read back from clone");
     EXPECT_EQ(99, p[0], "read back from original");
 
-    EXPECT_EQ(MX_OK, mx_vmo_op_range(clone_vmo, MX_VMO_OP_DECOMMIT, 0, PAGE_SIZE, NULL, 0));
+    EXPECT_EQ(ZX_OK, zx_vmo_op_range(clone_vmo, ZX_VMO_OP_DECOMMIT, 0, PAGE_SIZE, NULL, 0));
 
     // make sure that clone reverted to original, and that parent is unaffected
     // by the decommit
@@ -963,14 +963,14 @@
     EXPECT_EQ(99, p[0], "read back from original");
 
     // close the original handle
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "handle_close");
 
     // close the clone handle
-    EXPECT_EQ(MX_OK, mx_handle_close(clone_vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(clone_vmo), "handle_close");
 
     // unmap
-    EXPECT_EQ(MX_OK, mx_vmar_unmap(mx_vmar_root_self(), ptr, size), "unmap");
-    EXPECT_EQ(MX_OK, mx_vmar_unmap(mx_vmar_root_self(), clone_ptr, size), "unmap");
+    EXPECT_EQ(ZX_OK, zx_vmar_unmap(zx_vmar_root_self(), ptr, size), "unmap");
+    EXPECT_EQ(ZX_OK, zx_vmar_unmap(zx_vmar_root_self(), clone_ptr, size), "unmap");
 
     END_TEST;
 }
@@ -979,8 +979,8 @@
 bool vmo_clone_commit_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    mx_handle_t clone_vmo;
+    zx_handle_t vmo;
+    zx_handle_t clone_vmo;
     uintptr_t ptr;
     uintptr_t clone_ptr;
     volatile uint32_t *p;
@@ -988,21 +988,21 @@
 
     // create a vmo
     const size_t size = PAGE_SIZE * 4;
-    EXPECT_EQ(MX_OK, mx_vmo_create(size, 0, &vmo), "vm_object_create");
+    EXPECT_EQ(ZX_OK, zx_vmo_create(size, 0, &vmo), "vm_object_create");
 
     // map it
-    EXPECT_EQ(MX_OK,
-            mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &ptr),
+    EXPECT_EQ(ZX_OK,
+            zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &ptr),
             "map");
     EXPECT_NONNULL(ptr, "map address");
     p = (volatile uint32_t *)ptr;
 
     // clone it and map that
-    clone_vmo = MX_HANDLE_INVALID;
-    EXPECT_EQ(MX_OK, mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo), "vm_clone");
-    EXPECT_NE(MX_HANDLE_INVALID, clone_vmo, "vm_clone_handle");
-    EXPECT_EQ(MX_OK,
-            mx_vmar_map(mx_vmar_root_self(), 0, clone_vmo, 0, size, MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &clone_ptr),
+    clone_vmo = ZX_HANDLE_INVALID;
+    EXPECT_EQ(ZX_OK, zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE, 0, size, &clone_vmo), "vm_clone");
+    EXPECT_NE(ZX_HANDLE_INVALID, clone_vmo, "vm_clone_handle");
+    EXPECT_EQ(ZX_OK,
+            zx_vmar_map(zx_vmar_root_self(), 0, clone_vmo, 0, size, ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &clone_ptr),
             "map");
     EXPECT_NONNULL(clone_ptr, "map address");
     cp = (volatile uint32_t *)clone_ptr;
@@ -1012,7 +1012,7 @@
     EXPECT_EQ(0x99999999, p[0], "wrote to original");
     EXPECT_EQ(0x99999999, cp[0], "read back from clone");
 
-    EXPECT_EQ(MX_OK, mx_vmo_op_range(clone_vmo, MX_VMO_OP_COMMIT, 0, PAGE_SIZE, NULL, 0));
+    EXPECT_EQ(ZX_OK, zx_vmo_op_range(clone_vmo, ZX_VMO_OP_COMMIT, 0, PAGE_SIZE, NULL, 0));
 
     // make sure that clone has the same contents as the parent
     for (size_t i = 0; i < PAGE_SIZE / sizeof(*p); ++i) {
@@ -1025,20 +1025,20 @@
     EXPECT_EQ(0, cp[0], "wrote to clone");
     EXPECT_EQ(0x99999999, p[0], "read back from original");
 
-    EXPECT_EQ(MX_OK, mx_vmo_op_range(clone_vmo, MX_VMO_OP_DECOMMIT, 0, PAGE_SIZE, NULL, 0));
+    EXPECT_EQ(ZX_OK, zx_vmo_op_range(clone_vmo, ZX_VMO_OP_DECOMMIT, 0, PAGE_SIZE, NULL, 0));
 
     EXPECT_EQ(0x99999999, cp[0], "clone should match orig again");
     EXPECT_EQ(0x99999999, p[0], "read back from original");
 
     // close the original handle
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "handle_close");
 
     // close the clone handle
-    EXPECT_EQ(MX_OK, mx_handle_close(clone_vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_handle_close(clone_vmo), "handle_close");
 
     // unmap
-    EXPECT_EQ(MX_OK, mx_vmar_unmap(mx_vmar_root_self(), ptr, size), "unmap");
-    EXPECT_EQ(MX_OK, mx_vmar_unmap(mx_vmar_root_self(), clone_ptr, size), "unmap");
+    EXPECT_EQ(ZX_OK, zx_vmar_unmap(zx_vmar_root_self(), ptr, size), "unmap");
+    EXPECT_EQ(ZX_OK, zx_vmar_unmap(zx_vmar_root_self(), clone_ptr, size), "unmap");
 
     END_TEST;
 }
@@ -1046,34 +1046,34 @@
 bool vmo_cache_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     const size_t size = PAGE_SIZE * 4;
 
-    // The objects returned by mx_vmo_create() are VmObjectPaged objects which
+    // The objects returned by zx_vmo_create() are VmObjectPaged objects which
     // should not support these syscalls.
-    EXPECT_EQ(MX_OK, mx_vmo_create(size, 0, &vmo), "creation for cache_policy");
-    EXPECT_EQ(MX_ERR_NOT_SUPPORTED, mx_vmo_set_cache_policy(vmo, MX_CACHE_POLICY_UNCACHED),
+    EXPECT_EQ(ZX_OK, zx_vmo_create(size, 0, &vmo), "creation for cache_policy");
+    EXPECT_EQ(ZX_ERR_NOT_SUPPORTED, zx_vmo_set_cache_policy(vmo, ZX_CACHE_POLICY_UNCACHED),
               "attempt set cache");
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "close handle");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "close handle");
     END_TEST;
 }
 
 bool vmo_decommit_misaligned_test() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    EXPECT_EQ(MX_OK, mx_vmo_create(PAGE_SIZE * 2, 0, &vmo), "creation for decommit test");
+    zx_handle_t vmo;
+    EXPECT_EQ(ZX_OK, zx_vmo_create(PAGE_SIZE * 2, 0, &vmo), "creation for decommit test");
 
-    mx_status_t status = mx_vmo_op_range(vmo, MX_VMO_OP_DECOMMIT, 0x10, 0x100, NULL, 0);
-    EXPECT_EQ(MX_OK, status, "decommitting uncommitted memory");
+    zx_status_t status = zx_vmo_op_range(vmo, ZX_VMO_OP_DECOMMIT, 0x10, 0x100, NULL, 0);
+    EXPECT_EQ(ZX_OK, status, "decommitting uncommitted memory");
 
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_COMMIT, 0x10, 0x100, NULL, 0);
-    EXPECT_EQ(MX_OK, status, "committing memory");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_COMMIT, 0x10, 0x100, NULL, 0);
+    EXPECT_EQ(ZX_OK, status, "committing memory");
 
-    status = mx_vmo_op_range(vmo, MX_VMO_OP_DECOMMIT, 0x10, 0x100, NULL, 0);
-    EXPECT_EQ(MX_OK, status, "decommitting memory");
+    status = zx_vmo_op_range(vmo, ZX_VMO_OP_DECOMMIT, 0x10, 0x100, NULL, 0);
+    EXPECT_EQ(ZX_OK, status, "decommitting memory");
 
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "close handle");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "close handle");
     END_TEST;
 }
 
@@ -1081,8 +1081,8 @@
 bool vmo_clone_test_4() {
     BEGIN_TEST;
 
-    mx_handle_t vmo;
-    mx_handle_t clone_vmo[1];
+    zx_handle_t vmo;
+    zx_handle_t clone_vmo[1];
     uintptr_t ptr;
     uintptr_t clone_ptr;
     volatile size_t *p;
@@ -1091,11 +1091,11 @@
 
     // create a vmo
     const size_t size = PAGE_SIZE * 4;
-    EXPECT_EQ(MX_OK, mx_vmo_create(size, 0, &vmo), "vm_object_create");
+    EXPECT_EQ(ZX_OK, zx_vmo_create(size, 0, &vmo), "vm_object_create");
 
     // map it
-    EXPECT_EQ(MX_OK,
-            mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size, MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &ptr),
+    EXPECT_EQ(ZX_OK,
+            zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size, ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &ptr),
             "map");
     EXPECT_NONNULL(ptr, "map address");
     p = (volatile size_t *)ptr;
@@ -1105,16 +1105,16 @@
         p[off] = off;
 
     // make sure that non page aligned clones do not work
-    clone_vmo[0] = MX_HANDLE_INVALID;
-    EXPECT_EQ(MX_ERR_INVALID_ARGS, mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE, 1, size, &clone_vmo[0]), "vm_clone");
+    clone_vmo[0] = ZX_HANDLE_INVALID;
+    EXPECT_EQ(ZX_ERR_INVALID_ARGS, zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE, 1, size, &clone_vmo[0]), "vm_clone");
 
     // create a clone that extends beyond the parent by one page
-    clone_vmo[0] = MX_HANDLE_INVALID;
-    EXPECT_EQ(MX_OK, mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE, PAGE_SIZE, size, &clone_vmo[0]), "vm_clone");
+    clone_vmo[0] = ZX_HANDLE_INVALID;
+    EXPECT_EQ(ZX_OK, zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE, PAGE_SIZE, size, &clone_vmo[0]), "vm_clone");
 
     // map the clone
-    EXPECT_EQ(MX_OK,
-            mx_vmar_map(mx_vmar_root_self(), 0, clone_vmo[0], 0, size, MX_VM_FLAG_PERM_READ|MX_VM_FLAG_PERM_WRITE, &clone_ptr),
+    EXPECT_EQ(ZX_OK,
+            zx_vmar_map(zx_vmar_root_self(), 0, clone_vmo[0], 0, size, ZX_VM_FLAG_PERM_READ|ZX_VM_FLAG_PERM_WRITE, &clone_ptr),
             "map");
     EXPECT_NONNULL(clone_ptr, "map address");
     cp = (volatile size_t *)clone_ptr;
@@ -1136,7 +1136,7 @@
     }
 
     // resize the original
-    EXPECT_EQ(MX_OK, mx_vmo_set_size(vmo, size + PAGE_SIZE), "extend the vmo");
+    EXPECT_EQ(ZX_OK, zx_vmo_set_size(vmo, size + PAGE_SIZE), "extend the vmo");
 
     // verify that the last page we have mapped still returns zeros
     for (size_t off = (size - PAGE_SIZE) / sizeof(off); off < size / sizeof(off); off++) {
@@ -1148,16 +1148,16 @@
 
     // write to the new part of the original
     size_t val = 99;
-    EXPECT_EQ(MX_OK, mx_vmo_write(vmo, &val, size, sizeof(val), &handled_bytes), "writing to original after extending");
+    EXPECT_EQ(ZX_OK, zx_vmo_write(vmo, &val, size, sizeof(val), &handled_bytes), "writing to original after extending");
 
     // verify that it is reflected in the clone
     EXPECT_EQ(99, cp[(size - PAGE_SIZE) / sizeof(*cp)], "modified newly exposed part of cow clone");
 
     // resize the original again, completely extending it beyond he clone
-    EXPECT_EQ(MX_OK, mx_vmo_set_size(vmo, size + PAGE_SIZE * 2), "extend the vmo");
+    EXPECT_EQ(ZX_OK, zx_vmo_set_size(vmo, size + PAGE_SIZE * 2), "extend the vmo");
 
     // resize the original to zero
-    EXPECT_EQ(MX_OK, mx_vmo_set_size(vmo, 0), "truncate the vmo");
+    EXPECT_EQ(ZX_OK, zx_vmo_set_size(vmo, 0), "truncate the vmo");
 
     // verify that the clone now reads completely zeros, since it never COWed
     for (size_t off = 0; off < size / sizeof(off); off++) {
@@ -1168,10 +1168,10 @@
     }
 
     // close and unmap
-    EXPECT_EQ(MX_OK, mx_handle_close(vmo), "handle_close");
-    EXPECT_EQ(MX_OK, mx_vmar_unmap(mx_vmar_root_self(), ptr, size), "unmap");
-    EXPECT_EQ(MX_OK, mx_handle_close(clone_vmo[0]), "handle_close");
-    EXPECT_EQ(MX_OK, mx_vmar_unmap(mx_vmar_root_self(), clone_ptr, size), "unmap");
+    EXPECT_EQ(ZX_OK, zx_handle_close(vmo), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_vmar_unmap(zx_vmar_root_self(), ptr, size), "unmap");
+    EXPECT_EQ(ZX_OK, zx_handle_close(clone_vmo[0]), "handle_close");
+    EXPECT_EQ(ZX_OK, zx_vmar_unmap(zx_vmar_root_self(), clone_ptr, size), "unmap");
 
     END_TEST;
 }
@@ -1182,53 +1182,53 @@
     static const char kOldVmoName[] = "original";
     static const char kNewVmoName[] = "clone";
 
-    static const mx_rights_t kOldVmoRights =
-        MX_RIGHT_READ | MX_RIGHT_DUPLICATE;
-    static const mx_rights_t kNewVmoRights =
-        kOldVmoRights | MX_RIGHT_WRITE |
-        MX_RIGHT_GET_PROPERTY | MX_RIGHT_SET_PROPERTY;
+    static const zx_rights_t kOldVmoRights =
+        ZX_RIGHT_READ | ZX_RIGHT_DUPLICATE;
+    static const zx_rights_t kNewVmoRights =
+        kOldVmoRights | ZX_RIGHT_WRITE |
+        ZX_RIGHT_GET_PROPERTY | ZX_RIGHT_SET_PROPERTY;
 
-    mx_handle_t vmo;
-    ASSERT_EQ(mx_vmo_create(PAGE_SIZE, 0, &vmo),
-              MX_OK);
-    ASSERT_EQ(mx_object_set_property(vmo, MX_PROP_NAME,
+    zx_handle_t vmo;
+    ASSERT_EQ(zx_vmo_create(PAGE_SIZE, 0, &vmo),
+              ZX_OK);
+    ASSERT_EQ(zx_object_set_property(vmo, ZX_PROP_NAME,
                                      kOldVmoName, sizeof(kOldVmoName)),
-              MX_OK);
+              ZX_OK);
     ASSERT_EQ(get_handle_rights(vmo) & kOldVmoRights, kOldVmoRights);
 
-    mx_handle_t reduced_rights_vmo;
-    ASSERT_EQ(mx_handle_duplicate(vmo, kOldVmoRights, &reduced_rights_vmo),
-              MX_OK);
+    zx_handle_t reduced_rights_vmo;
+    ASSERT_EQ(zx_handle_duplicate(vmo, kOldVmoRights, &reduced_rights_vmo),
+              ZX_OK);
     EXPECT_EQ(get_handle_rights(reduced_rights_vmo), kOldVmoRights);
 
-    mx_handle_t clone;
-    ASSERT_EQ(mx_vmo_clone(reduced_rights_vmo, MX_VMO_CLONE_COPY_ON_WRITE,
+    zx_handle_t clone;
+    ASSERT_EQ(zx_vmo_clone(reduced_rights_vmo, ZX_VMO_CLONE_COPY_ON_WRITE,
                            0, PAGE_SIZE, &clone),
-              MX_OK);
+              ZX_OK);
 
-    EXPECT_EQ(mx_handle_close(reduced_rights_vmo), MX_OK);
+    EXPECT_EQ(zx_handle_close(reduced_rights_vmo), ZX_OK);
 
-    ASSERT_EQ(mx_object_set_property(clone, MX_PROP_NAME,
+    ASSERT_EQ(zx_object_set_property(clone, ZX_PROP_NAME,
                                      kNewVmoName, sizeof(kNewVmoName)),
-              MX_OK);
+              ZX_OK);
 
-    char oldname[MX_MAX_NAME_LEN] = "bad";
-    EXPECT_EQ(mx_object_get_property(vmo, MX_PROP_NAME,
+    char oldname[ZX_MAX_NAME_LEN] = "bad";
+    EXPECT_EQ(zx_object_get_property(vmo, ZX_PROP_NAME,
                                      oldname, sizeof(oldname)),
-              MX_OK);
+              ZX_OK);
     EXPECT_STR_EQ(oldname, kOldVmoName, sizeof(kOldVmoName),
                   "original VMO name");
 
-    char newname[MX_MAX_NAME_LEN] = "bad";
-    EXPECT_EQ(mx_object_get_property(clone, MX_PROP_NAME,
+    char newname[ZX_MAX_NAME_LEN] = "bad";
+    EXPECT_EQ(zx_object_get_property(clone, ZX_PROP_NAME,
                                      newname, sizeof(newname)),
-              MX_OK);
+              ZX_OK);
     EXPECT_STR_EQ(newname, kNewVmoName, sizeof(kNewVmoName),
                   "clone VMO name");
 
-    EXPECT_EQ(mx_handle_close(vmo), MX_OK);
+    EXPECT_EQ(zx_handle_close(vmo), ZX_OK);
     EXPECT_EQ(get_handle_rights(clone), kNewVmoRights);
-    EXPECT_EQ(mx_handle_close(clone), MX_OK);
+    EXPECT_EQ(zx_handle_close(clone), ZX_OK);
 
     END_TEST;
 }
diff --git a/third_party/lib/acpica/README.fuchsia b/third_party/lib/acpica/README.fuchsia
index 8b335ee..29248c6 100644
--- a/third_party/lib/acpica/README.fuchsia
+++ b/third_party/lib/acpica/README.fuchsia
@@ -7,10 +7,10 @@
 - Added README.fuchsia
 - Added rules.mk
 - Added LICENSE containing copy of source license banner
-- Added source/include/platform/acmagenta.h
+- Added source/include/platform/aczircon.h
 - Added source/include/platform/acfuchsia.h
-- Modified source/include/platform/acenv.h to use acmagenta.h/acfuchsia.h
-- Added source/os_specific/service_layers/osmagenta.c
+- Modified source/include/platform/acenv.h to use aczircon.h/acfuchsia.h
+- Added source/os_specific/service_layers/oszircon.c
 - Added source/os_specific/service_layers/osfuchsia.c
 - Moved everything in source/include into source/include/acpica
 - Wrapped source/include/acpica/acpi.h with __BEGIN_CDECLS/__END_CDECLS
diff --git a/third_party/lib/acpica/rules.mk b/third_party/lib/acpica/rules.mk
index 3ac2676..6bb2367 100644
--- a/third_party/lib/acpica/rules.mk
+++ b/third_party/lib/acpica/rules.mk
@@ -35,6 +35,6 @@
 	$(LOCAL_DIR)/source/components/utilities/utstate.c \
 	$(LOCAL_DIR)/source/components/utilities/utstring.c \
 	$(LOCAL_DIR)/source/components/utilities/utxferror.c \
-	$(LOCAL_DIR)/source/os_specific/service_layers/osmagenta.cpp
+	$(LOCAL_DIR)/source/os_specific/service_layers/oszircon.cpp
 
 include make/module.mk
diff --git a/third_party/lib/acpica/source/include/acpica/acpi.h b/third_party/lib/acpica/source/include/acpica/acpi.h
index 2d8bb95..492ce6f 100644
--- a/third_party/lib/acpica/source/include/acpica/acpi.h
+++ b/third_party/lib/acpica/source/include/acpica/acpi.h
@@ -44,7 +44,7 @@
 #ifndef __ACPI_H__
 #define __ACPI_H__
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/third_party/lib/acpica/source/include/acpica/platform/acenv.h b/third_party/lib/acpica/source/include/acpica/platform/acenv.h
index b83cf3e..45808eb 100644
--- a/third_party/lib/acpica/source/include/acpica/platform/acenv.h
+++ b/third_party/lib/acpica/source/include/acpica/platform/acenv.h
@@ -219,7 +219,7 @@
 #include "achaiku.h"
 
 #elif defined(LK)
-#include "acmagenta.h"
+#include "aczircon.h"
 
 #elif defined(__Fuchsia__)
 #include "acfuchsia.h"
diff --git a/third_party/lib/acpica/source/include/acpica/platform/acfuchsia.h b/third_party/lib/acpica/source/include/acpica/platform/acfuchsia.h
index 184cc37..10ec50a 100644
--- a/third_party/lib/acpica/source/include/acpica/platform/acfuchsia.h
+++ b/third_party/lib/acpica/source/include/acpica/platform/acfuchsia.h
@@ -7,7 +7,7 @@
 #include <stdbool.h>
 #include <threads.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <semaphore.h>
 
 /*
@@ -25,9 +25,9 @@
 #error Unexpected architecture
 #endif
 
-extern mx_handle_t root_resource_handle;
+extern zx_handle_t root_resource_handle;
 
-#define ACPI_FLUSH_CPU_CACHE() mx_acpi_cache_flush(root_resource_handle)
+#define ACPI_FLUSH_CPU_CACHE() zx_acpi_cache_flush(root_resource_handle)
 
 // Use the standard library headers
 #define ACPI_USE_STANDARD_HEADERS
diff --git a/third_party/lib/acpica/source/include/acpica/platform/acmagenta.h b/third_party/lib/acpica/source/include/acpica/platform/aczircon.h
similarity index 94%
rename from third_party/lib/acpica/source/include/acpica/platform/acmagenta.h
rename to third_party/lib/acpica/source/include/acpica/platform/aczircon.h
index 8768c4c..2e08c22 100644
--- a/third_party/lib/acpica/source/include/acpica/platform/acmagenta.h
+++ b/third_party/lib/acpica/source/include/acpica/platform/aczircon.h
@@ -31,7 +31,7 @@
 // Use the builtin cache implementation
 #define ACPI_USE_LOCAL_CACHE
 
-// Specify the types Magenta uses for various common objects
+// Specify the types Zircon uses for various common objects
 #define ACPI_CPU_FLAGS spin_lock_saved_state_t
 #define ACPI_SPINLOCK spin_lock_t*
 
diff --git a/third_party/lib/acpica/source/os_specific/service_layers/osfuchsia.cpp b/third_party/lib/acpica/source/os_specific/service_layers/osfuchsia.cpp
index 36004f7..7c39e30 100644
--- a/third_party/lib/acpica/source/os_specific/service_layers/osfuchsia.cpp
+++ b/third_party/lib/acpica/source/os_specific/service_layers/osfuchsia.cpp
@@ -11,10 +11,10 @@
 #include <threads.h>
 
 #include <hw/inout.h>
-#include <magenta/assert.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <mxcpp/new.h>
+#include <zircon/assert.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zxcpp/new.h>
 #include <fbl/auto_lock.h>
 #include <fbl/intrusive_hash_table.h>
 #include <fbl/unique_ptr.h>
@@ -25,10 +25,10 @@
 
 #include "acpi.h"
 
-__WEAK mx_handle_t root_resource_handle;
+__WEAK zx_handle_t root_resource_handle;
 
 #define _COMPONENT          ACPI_OS_SERVICES
-ACPI_MODULE_NAME    ("osmagenta")
+ACPI_MODULE_NAME    ("oszircon")
 
 #define LOCAL_TRACE 0
 
@@ -53,7 +53,7 @@
     // @param length Length of the mapping
     // @param vmo_handle Handle to the mapped VMO
     AcpiOsMappingNode(uintptr_t vaddr, uintptr_t vaddr_actual,
-                      size_t length, mx_handle_t vmo_handle);
+                      size_t length, zx_handle_t vmo_handle);
     ~AcpiOsMappingNode();
 
     // Trait implementation for fbl::HashTable
@@ -64,7 +64,7 @@
     uintptr_t vaddr_;
     uintptr_t vaddr_actual_;
     size_t length_;
-    mx_handle_t vmo_handle_;
+    zx_handle_t vmo_handle_;
 };
 
 fbl::Mutex os_mapping_lock;
@@ -75,39 +75,39 @@
 const size_t PCIE_MAX_FUNCTIONS_PER_DEVICE = 8;
 
 AcpiOsMappingNode::AcpiOsMappingNode(uintptr_t vaddr, uintptr_t vaddr_actual,
-                                     size_t length, mx_handle_t vmo_handle)
+                                     size_t length, zx_handle_t vmo_handle)
     : vaddr_(vaddr), vaddr_actual_(vaddr_actual),
       length_(length), vmo_handle_(vmo_handle) {
 }
 
 AcpiOsMappingNode::~AcpiOsMappingNode() {
-    mx_vmar_unmap(mx_vmar_root_self(), (uintptr_t)vaddr_actual_, length_);
-    mx_handle_close(vmo_handle_);
+    zx_vmar_unmap(zx_vmar_root_self(), (uintptr_t)vaddr_actual_, length_);
+    zx_handle_close(vmo_handle_);
 }
 
-static mx_status_t mmap_physical(mx_paddr_t phys, size_t size, uint32_t cache_policy,
-                                 mx_handle_t* out_vmo, mx_vaddr_t* out_vaddr) {
-    mx_handle_t vmo;
-    mx_vaddr_t vaddr;
-    mx_status_t st = mx_vmo_create_physical(root_resource_handle, phys, size, &vmo);
-    if (st != MX_OK) {
+static zx_status_t mmap_physical(zx_paddr_t phys, size_t size, uint32_t cache_policy,
+                                 zx_handle_t* out_vmo, zx_vaddr_t* out_vaddr) {
+    zx_handle_t vmo;
+    zx_vaddr_t vaddr;
+    zx_status_t st = zx_vmo_create_physical(root_resource_handle, phys, size, &vmo);
+    if (st != ZX_OK) {
         return st;
     }
-    st = mx_vmo_set_cache_policy(vmo, cache_policy);
-    if (st != MX_OK) {
-        mx_handle_close(vmo);
+    st = zx_vmo_set_cache_policy(vmo, cache_policy);
+    if (st != ZX_OK) {
+        zx_handle_close(vmo);
         return st;
     }
-    st = mx_vmar_map(mx_vmar_root_self(), 0, vmo, 0, size,
-                     MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE | MX_VM_FLAG_MAP_RANGE,
+    st = zx_vmar_map(zx_vmar_root_self(), 0, vmo, 0, size,
+                     ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE | ZX_VM_FLAG_MAP_RANGE,
                      &vaddr);
-    if (st != MX_OK) {
-        mx_handle_close(vmo);
+    if (st != ZX_OK) {
+        zx_handle_close(vmo);
         return st;
     } else {
         *out_vmo = vmo;
         *out_vaddr = vaddr;
-        return MX_OK;
+        return ZX_OK;
     }
 }
 
@@ -135,7 +135,7 @@
         return status;
     }
     /* TODO(teisenbe): be less permissive */
-    mx_mmap_device_io(root_resource_handle, 0, 65536);
+    zx_mmap_device_io(root_resource_handle, 0, 65536);
     return AE_OK;
 }
 
@@ -162,7 +162,7 @@
     ACPI_PHYSICAL_ADDRESS TableAddress = 0;
     ACPI_STATUS status = AcpiFindRootPointer(&TableAddress);
 
-    uint32_t uefi_rsdp = (uint32_t)mx_acpi_uefi_rsdp(root_resource_handle);
+    uint32_t uefi_rsdp = (uint32_t)zx_acpi_uefi_rsdp(root_resource_handle);
     if (uefi_rsdp != 0) {
         return uefi_rsdp;
     }
@@ -226,7 +226,7 @@
     return AE_OK;
 }
 
-// If we decide to make use of a more Magenta specific cache mechanism,
+// If we decide to make use of a more Zircon specific cache mechanism,
 // remove the ACPI_USE_LOCAL_CACHE define from the header and implement these
 // functions.
 #if 0
@@ -330,10 +330,10 @@
 
     uintptr_t vaddr;
     size_t length = end - aligned_address;
-    mx_handle_t vmo;
-    mx_status_t status = mmap_physical(aligned_address, end - aligned_address,
-                                       MX_CACHE_POLICY_CACHED, &vmo, &vaddr);
-    if (status != MX_OK) {
+    zx_handle_t vmo;
+    zx_status_t status = mmap_physical(aligned_address, end - aligned_address,
+                                       ZX_CACHE_POLICY_CACHED, &vmo, &vaddr);
+    if (status != ZX_OK) {
         return NULL;
     }
 
@@ -390,7 +390,7 @@
  *         executing thread. The value -1 is reserved and must not be returned
  *         by this interface.
  */
-static_assert(sizeof(ACPI_THREAD_ID) >= sizeof(mx_handle_t), "tid size");
+static_assert(sizeof(ACPI_THREAD_ID) >= sizeof(zx_handle_t), "tid size");
 ACPI_THREAD_ID AcpiOsGetThreadId() {
     return (uintptr_t)thrd_current();
 }
@@ -504,7 +504,7 @@
         // If we're asked to sleep for a long time (>1.5 months), shorten it
         Milliseconds = UINT32_MAX;
     }
-    mx_nanosleep(mx_deadline_after(MX_MSEC(Milliseconds)));
+    zx_nanosleep(zx_deadline_after(ZX_MSEC(Milliseconds)));
 }
 
 /**
@@ -515,7 +515,7 @@
  * @param Microseconds The amount of time to delay, in microseconds.
  */
 void AcpiOsStall(UINT32 Microseconds) {
-    mx_nanosleep(mx_deadline_after(MX_USEC(Microseconds)));
+    zx_nanosleep(zx_deadline_after(ZX_USEC(Microseconds)));
 }
 
 /**
@@ -584,24 +584,24 @@
 
     if (Timeout == UINT16_MAX) {
         if (sem_wait(Handle) < 0) {
-            MX_ASSERT_MSG(false, "sem_wait failed %d", errno);
+            ZX_ASSERT_MSG(false, "sem_wait failed %d", errno);
         }
         return AE_OK;
     }
 
-    mx_time_t now = mx_time_get(MX_CLOCK_UTC);
+    zx_time_t now = zx_time_get(ZX_CLOCK_UTC);
     struct timespec then = {
-        .tv_sec = static_cast<time_t>(now / MX_SEC(1)),
-        .tv_nsec = static_cast<long>(now % MX_SEC(1)),
+        .tv_sec = static_cast<time_t>(now / ZX_SEC(1)),
+        .tv_nsec = static_cast<long>(now % ZX_SEC(1)),
     };
-    then.tv_nsec += MX_MSEC(Timeout);
-    if (then.tv_nsec > static_cast<long>(MX_SEC(1))) {
-        then.tv_sec += then.tv_nsec / MX_SEC(1);
-        then.tv_nsec %= MX_SEC(1);
+    then.tv_nsec += ZX_MSEC(Timeout);
+    if (then.tv_nsec > static_cast<long>(ZX_SEC(1))) {
+        then.tv_sec += then.tv_nsec / ZX_SEC(1);
+        then.tv_nsec %= ZX_SEC(1);
     }
 
     if (sem_timedwait(Handle, &then) < 0) {
-        MX_ASSERT_MSG(errno == ETIMEDOUT, "sem_timedwait failed unexpectedly %d", errno);
+        ZX_ASSERT_MSG(errno == ETIMEDOUT, "sem_timedwait failed unexpectedly %d", errno);
         return AE_TIME;
     }
     return AE_OK;
@@ -696,21 +696,21 @@
 // ACPICA's
 struct acpi_irq_thread_arg {
     ACPI_OSD_HANDLER handler;
-    mx_handle_t irq_handle;
+    zx_handle_t irq_handle;
     void *context;
 };
 static int acpi_irq_thread(void *arg) {
     struct acpi_irq_thread_arg *real_arg = (struct acpi_irq_thread_arg *)arg;
     while (1) {
-        mx_status_t status = mx_interrupt_wait(real_arg->irq_handle);
-        if (status != MX_OK) {
+        zx_status_t status = zx_interrupt_wait(real_arg->irq_handle);
+        if (status != ZX_OK) {
             continue;
         }
 
         // TODO: Should we do something with the return value from the handler?
         real_arg->handler(real_arg->context);
 
-        mx_interrupt_complete(real_arg->irq_handle);
+        zx_interrupt_complete(real_arg->irq_handle);
     }
     return 0;
 }
@@ -754,10 +754,10 @@
         return AE_NO_MEMORY;
     }
 
-    mx_handle_t handle;
-    mx_status_t status = mx_interrupt_create(root_resource_handle, InterruptLevel,
-                                             MX_FLAG_REMAP_IRQ, &handle);
-    if (status != MX_OK) {
+    zx_handle_t handle;
+    zx_status_t status = zx_interrupt_create(root_resource_handle, InterruptLevel,
+                                             ZX_FLAG_REMAP_IRQ, &handle);
+    if (status != ZX_OK) {
         free(arg);
         return AE_ERROR;
     }
@@ -951,17 +951,17 @@
     uint8_t offset = static_cast<uint8_t>(Register);
     uint8_t width = static_cast<uint8_t>(Width);
     uint32_t val = *Value & 0xFFFFFFFF; // PIO access can only be 32 bits
-    mx_status_t status = mx_pci_cfg_pio_rw(root_resource_handle, bus, dev, func, offset,
+    zx_status_t status = zx_pci_cfg_pio_rw(root_resource_handle, bus, dev, func, offset,
                                            &val, width, Write);
 
     *Value = val;
 
 #ifdef ACPI_DEBUG_OUTPUT
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         printf("ACPIOS: pci rw error: %d\n", status);
     }
 #endif // ACPI_DEBUG_OUTPUT
-    return (status == MX_OK) ? AE_OK : AE_ERROR;
+    return (status == ZX_OK) ? AE_OK : AE_ERROR;
 #endif // __x86_64__
 
     return AE_NOT_IMPLEMENTED;
diff --git a/third_party/lib/acpica/source/os_specific/service_layers/osmagenta.cpp b/third_party/lib/acpica/source/os_specific/service_layers/oszircon.cpp
similarity index 98%
rename from third_party/lib/acpica/source/os_specific/service_layers/osmagenta.cpp
rename to third_party/lib/acpica/source/os_specific/service_layers/oszircon.cpp
index be716b1..0c740c4 100644
--- a/third_party/lib/acpica/source/os_specific/service_layers/osmagenta.cpp
+++ b/third_party/lib/acpica/source/os_specific/service_layers/oszircon.cpp
@@ -20,7 +20,7 @@
 #include "acpi.h"
 
 #define _COMPONENT          ACPI_OS_SERVICES
-ACPI_MODULE_NAME    ("osmagenta")
+ACPI_MODULE_NAME    ("oszircon")
 
 #define LOCAL_TRACE 0
 
@@ -149,7 +149,7 @@
             aligned_address,
             0,
             ARCH_MMU_FLAG_PERM_READ | ARCH_MMU_FLAG_PERM_WRITE);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         return NULL;
     }
     const uintptr_t real_addr =
@@ -168,7 +168,7 @@
 void AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Length) {
     status_t status = VmAspace::kernel_aspace()->FreeRegion(
             reinterpret_cast<vaddr_t>(LogicalAddress));
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         TRACEF("WARNING: ACPI failed to free region %p, size %" PRIu64 "\n",
                LogicalAddress, (uint64_t)Length);
     }
diff --git a/third_party/lib/fdt/LICENSE b/third_party/lib/fdt/LICENSE
index 498961c..0c38d62 100644
--- a/third_party/lib/fdt/LICENSE
+++ b/third_party/lib/fdt/LICENSE
@@ -1,4 +1,4 @@
-Magenta chooses to use the BSD License (option b):
+Zircon chooses to use the BSD License (option b):
 
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
diff --git a/third_party/lib/fdt/include/libfdt.h b/third_party/lib/fdt/include/libfdt.h
index 7a8304b..63e743a 100644
--- a/third_party/lib/fdt/include/libfdt.h
+++ b/third_party/lib/fdt/include/libfdt.h
@@ -53,7 +53,7 @@
 
 #include <libfdt_env.h>
 #include <fdt.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS;
 
diff --git a/third_party/lib/jitterentropy/include/lib/jitterentropy/jitterentropy.h b/third_party/lib/jitterentropy/include/lib/jitterentropy/jitterentropy.h
index d4795d3..f417953 100644
--- a/third_party/lib/jitterentropy/include/lib/jitterentropy/jitterentropy.h
+++ b/third_party/lib/jitterentropy/include/lib/jitterentropy/jitterentropy.h
@@ -52,7 +52,7 @@
 #ifndef _JITTERENTROPY_H
 #define _JITTERENTROPY_H
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
@@ -162,7 +162,7 @@
 
 /* -- END of statistical test function -- */
 
-/* -- BEGIN Magenta interface -- */
+/* -- BEGIN Zircon interface -- */
 
 /* Initialize an entropy collector using already allocated memory. This function
  * is to jent_entropy_collector_alloc as placement new is to regular new in C++.
@@ -185,7 +185,7 @@
         unsigned int mem_block_size, unsigned int mem_block_count,
         unsigned int mem_loops, bool stir);
 
-/* -- END of Magenta interface -- */
+/* -- END of Zircon interface -- */
 
 __END_CDECLS;
 
diff --git a/third_party/lib/jitterentropy/jitterentropy-base.c b/third_party/lib/jitterentropy/jitterentropy-base.c
index 2aa89e5..892fcd5 100644
--- a/third_party/lib/jitterentropy/jitterentropy-base.c
+++ b/third_party/lib/jitterentropy/jitterentropy-base.c
@@ -53,7 +53,7 @@
  *
  * - Add #include lines for stdlib.h, string.h, and
  *   lib/jitterentropy/internal.h.
- * - Change #include line for Magenta file conventions.
+ * - Change #include line for Zircon file conventions.
  * - Remove CONFIG_CRYPTO_CPU_JITTERENTROPY_STAT flag.
  * - Add jent_entropy_collector_init definition.
  * - Remove '#pragma GCC optimize ("O0")' (not recognized by clang)
@@ -798,7 +798,7 @@
 }
 
 /***************************************************************************
- * Magenta interface
+ * Zircon interface
  ***************************************************************************/
 
 void jent_entropy_collector_init(
@@ -807,13 +807,13 @@
         unsigned int mem_loops, bool stir) {
     DEBUG_ASSERT(((size_t)mem_block_size) * mem_block_count <= mem_size);
     memset(ec, 0, sizeof(*ec));
-    /* Oversample rate. The jitterentropy man page (not included with Magenta)
+    /* Oversample rate. The jitterentropy man page (not included with Zircon)
      * suggests a value of 1. Higher values cause jitterentropy to discount its
      * entropy estimates by a factor of osr, so that more random bytes are
      * collected than would be with osr == 1. */
     ec->osr = 1;
     /* For now, we don't enable the FIPS 140-2 test mode built into
-     * jitterentropy. Magenta should handle entropy source health tests itself,
+     * jitterentropy. Zircon should handle entropy source health tests itself,
      * to ensure uniform testing of all entropy sources. */
     ec->fips_enabled = 0;
     ec->stir = stir;
diff --git a/third_party/uapp/dash/rules.mk b/third_party/uapp/dash/rules.mk
index 35c3484..3651b64 100644
--- a/third_party/uapp/dash/rules.mk
+++ b/third_party/uapp/dash/rules.mk
@@ -12,7 +12,7 @@
     $(LOCAL_DIR)/src/alias.c \
     $(LOCAL_DIR)/src/arith_yacc.c \
     $(LOCAL_DIR)/src/arith_yylex.c \
-    $(LOCAL_DIR)/src/bltin/magenta.c \
+    $(LOCAL_DIR)/src/bltin/zircon.c \
     $(LOCAL_DIR)/src/bltin/printf.c \
     $(LOCAL_DIR)/src/bltin/test.c \
     $(LOCAL_DIR)/src/bltin/times.c \
@@ -48,8 +48,8 @@
 MODULE_NAME := sh
 
 MODULE_STATIC_LIBS := system/ulib/pretty third_party/ulib/linenoise
-MODULE_LIBS := system/ulib/magenta system/ulib/launchpad system/ulib/c
-MODULE_LIBS += system/ulib/mxio  # Needed by ulib/linenoise
+MODULE_LIBS := system/ulib/zircon system/ulib/launchpad system/ulib/c
+MODULE_LIBS += system/ulib/fdio  # Needed by ulib/linenoise
 
 MODULE_CFLAGS := -D_GNU_SOURCE -DBSD -DIFS_BROKEN -DJOBS=0 -DSHELL \
                  -DUSE_LINENOISE
diff --git a/third_party/uapp/dash/src/bltin/magenta.c b/third_party/uapp/dash/src/bltin/zircon.c
similarity index 96%
rename from third_party/uapp/dash/src/bltin/magenta.c
rename to third_party/uapp/dash/src/bltin/zircon.c
index 56c2e46..43fbdc6 100644
--- a/third_party/uapp/dash/src/bltin/magenta.c
+++ b/third_party/uapp/dash/src/bltin/zircon.c
@@ -15,10 +15,10 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <pretty/hexdump.h>
 
-#include <magenta/device/dmctl.h>
+#include <zircon/device/dmctl.h>
 
 int mxc_dump(int argc, char** argv) {
     int fd;
@@ -53,7 +53,7 @@
 
 int mxc_msleep(int argc, char** argv) {
     if (argc == 2) {
-        mx_nanosleep(mx_deadline_after(MX_MSEC(atoi(argv[1]))));
+        zx_nanosleep(zx_deadline_after(ZX_MSEC(atoi(argv[1]))));
     }
     return 0;
 }
@@ -486,26 +486,26 @@
     }
     snprintf(cmd.name, sizeof(cmd.name), command);
 
-    mx_handle_t h;
-    if (mx_socket_create(0, &cmd.h, &h) < 0) {
+    zx_handle_t h;
+    if (zx_socket_create(0, &cmd.h, &h) < 0) {
         return -1;
     }
 
     int r = ioctl_dmctl_command(fd, &cmd);
     close(fd);
     if (r < 0) {
-        mx_handle_close(h);
+        zx_handle_close(h);
         return r;
     }
 
     for (;;) {
-        mx_status_t status;
+        zx_status_t status;
         char buf[32768];
         size_t actual;
-        if ((status = mx_socket_read(h, 0, buf, sizeof(buf), &actual)) < 0) {
-            if (status == MX_ERR_SHOULD_WAIT) {
-                mx_object_wait_one(h, MX_SOCKET_READABLE | MX_SOCKET_PEER_CLOSED,
-                                   MX_TIME_INFINITE, NULL);
+        if ((status = zx_socket_read(h, 0, buf, sizeof(buf), &actual)) < 0) {
+            if (status == ZX_ERR_SHOULD_WAIT) {
+                zx_object_wait_one(h, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED,
+                                   ZX_TIME_INFINITE, NULL);
                 continue;
             }
             break;
@@ -520,7 +520,7 @@
             }
         }
     }
-    mx_handle_close(h);
+    zx_handle_close(h);
 
     return 0;
 }
diff --git a/third_party/uapp/dash/src/controller.c b/third_party/uapp/dash/src/controller.c
index 88a5176..8aa1db2 100644
--- a/third_party/uapp/dash/src/controller.c
+++ b/third_party/uapp/dash/src/controller.c
@@ -5,13 +5,13 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 
 #include <linenoise/linenoise.h>
 
-static mx_handle_t ctrl_channel = MX_HANDLE_INVALID;
+static zx_handle_t ctrl_channel = ZX_HANDLE_INVALID;
 
 // Maximum length of a history entry, including the ending '\n'.
 static const size_t kMaxHistoryEntrySize = 1024;
@@ -23,44 +23,44 @@
 static const size_t kAddRemoteEntryCommandLen = sizeof(kAddRemoteEntryCommand) - 1;
 
 void controller_init() {
-  ctrl_channel = mx_get_startup_handle(PA_HND(PA_USER1, 0));
+  ctrl_channel = zx_get_startup_handle(PA_HND(PA_USER1, 0));
 
-  if (ctrl_channel == MX_HANDLE_INVALID) {
+  if (ctrl_channel == ZX_HANDLE_INVALID) {
     // Running without a shell controller.
     return;
   }
 
   // Initialize the shell history.
-  mx_status_t status = mx_channel_write(ctrl_channel, 0, kGetHistoryCommand,
+  zx_status_t status = zx_channel_write(ctrl_channel, 0, kGetHistoryCommand,
                                         kGetHistoryCommandLen, NULL, 0);
-  if (status != MX_OK) {
+  if (status != ZX_OK) {
     fprintf(stderr,
             "Failed to write the get_history command to the ctrl channel.\n");
     return;
   }
 
-  status = mx_object_wait_one(ctrl_channel,
-                              MX_CHANNEL_READABLE | MX_CHANNEL_PEER_CLOSED,
-                              mx_deadline_after(MX_SEC(5)), NULL);
-  if (status != MX_OK) {
+  status = zx_object_wait_one(ctrl_channel,
+                              ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED,
+                              zx_deadline_after(ZX_SEC(5)), NULL);
+  if (status != ZX_OK) {
     fprintf(stderr, "Failed to wait on the ctrl channel.\n");
     return;
   }
 
-  mx_handle_t history_vmo;
+  zx_handle_t history_vmo;
   uint32_t read_bytes = 0;
   uint32_t read_handles = 0;
-  status = mx_channel_read(ctrl_channel, 0, NULL, &history_vmo, 0,
+  status = zx_channel_read(ctrl_channel, 0, NULL, &history_vmo, 0,
                            1, &read_bytes, &read_handles);
-  if (status != MX_OK) {
+  if (status != ZX_OK) {
     fprintf(stderr,
             "Failed to read the ctrl response to the get_history command.\n");
     return;
   }
 
   uint64_t history_vmo_size = 0;
-  status = mx_vmo_get_size(history_vmo, &history_vmo_size);
-  if (status != MX_OK) {
+  status = zx_vmo_get_size(history_vmo, &history_vmo_size);
+  if (status != ZX_OK) {
     fprintf(stderr, "Failed to get the size of the history vmo.\n");
     return;
   }
@@ -69,9 +69,9 @@
   while (history_vmo_offset < history_vmo_size) {
     char buffer[kMaxHistoryEntrySize];
     size_t actually_read = 0;
-    status = mx_vmo_read(history_vmo, &buffer, history_vmo_offset,
+    status = zx_vmo_read(history_vmo, &buffer, history_vmo_offset,
                          sizeof(buffer), &actually_read);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
       fprintf(stderr, "Failed to read from the history vmo.\n");
       return;
     }
@@ -100,26 +100,26 @@
 }
 
 void controller_add_local_entry(const char* entry, size_t length) {
-  if (ctrl_channel == MX_HANDLE_INVALID || length > kMaxHistoryEntrySize) {
+  if (ctrl_channel == ZX_HANDLE_INVALID || length > kMaxHistoryEntrySize) {
     return;
   }
   char buffer[kAddLocalEntryCommandLen + kMaxHistoryEntrySize];
   memcpy(buffer, kAddLocalEntryCommand, kAddLocalEntryCommandLen);
   memcpy(buffer + kAddLocalEntryCommandLen, entry, length);
-  mx_status_t status = mx_channel_write(ctrl_channel, 0,
+  zx_status_t status = zx_channel_write(ctrl_channel, 0,
                                         buffer, kAddLocalEntryCommandLen + length,
                                         NULL, 0);
-  if (status != MX_OK) {
+  if (status != ZX_OK) {
     fprintf(stderr,
             "Failed to write the add_to_history command to the ctrl channel\n");
-    mx_handle_close(ctrl_channel);
-    ctrl_channel = MX_HANDLE_INVALID;
+    zx_handle_close(ctrl_channel);
+    ctrl_channel = ZX_HANDLE_INVALID;
     return;
   }
 }
 
 void controller_pull_remote_entries() {
-  if (ctrl_channel == MX_HANDLE_INVALID) {
+  if (ctrl_channel == ZX_HANDLE_INVALID) {
     return;
   }
 
@@ -129,9 +129,9 @@
 
   while(true) {
     uint32_t read_bytes = 0;
-    mx_status_t status = mx_channel_read(ctrl_channel, 0, buffer, NULL,
+    zx_status_t status = zx_channel_read(ctrl_channel, 0, buffer, NULL,
                                          sizeof(buffer) - 1, 0, &read_bytes, NULL);
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
       if (strncmp(buffer, kAddRemoteEntryCommand, kAddRemoteEntryCommandLen) != 0) {
         fprintf(stderr, "Unrecognized shell controller command.\n");
         continue;
@@ -139,7 +139,7 @@
       buffer[read_bytes] = '\0';
       const char* start = buffer + kAddRemoteEntryCommandLen;
       linenoiseHistoryAdd(start);
-    } else if (status == MX_ERR_SHOULD_WAIT) {
+    } else if (status == ZX_ERR_SHOULD_WAIT) {
       return;
     } else {
       fprintf(stderr, "Failed to read the command from the ctrl channel, status: %u.\n", status);
diff --git a/third_party/uapp/dash/src/eval.c b/third_party/uapp/dash/src/eval.c
index 97d38ac..7aa752b 100644
--- a/third_party/uapp/dash/src/eval.c
+++ b/third_party/uapp/dash/src/eval.c
@@ -32,8 +32,8 @@
  * SUCH DAMAGE.
  */
 
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
 #include <stdlib.h>
 #include <signal.h>
 #include <unistd.h>
@@ -477,7 +477,7 @@
 	}
 	INTOFF;
 	jp = makejob(n, 1);
-	mx_handle_t process;
+	zx_handle_t process;
 	const char* const* envp = (const char* const*)environment();
 
 	// Run in the foreground (of the subshell running in the background)
@@ -485,18 +485,18 @@
 		n->type = NSUBSHELL;
 
 	const char* errmsg = NULL;
-	mx_status_t exec_result = process_subshell(n, envp, &process, NULL, &errmsg);
-        if (exec_result == MX_OK) {
+	zx_status_t exec_result = process_subshell(n, envp, &process, NULL, &errmsg);
+        if (exec_result == ZX_OK) {
 		/* Process-tracking management */
 		forkparent(jp, n, backgnd, process);
         } else {
-		sh_error("Failed to create subshell (%s): %s", mx_status_get_string(exec_result), errmsg);
+		sh_error("Failed to create subshell (%s): %s", zx_status_get_string(exec_result), errmsg);
 		return exec_result;
 	}
 	status = 0;
 	if (! backgnd) {
 		status = process_await_termination(process, true);
-		mx_handle_close(process);
+		zx_handle_close(process);
 	}
 	INTON;
 	return status;
@@ -573,26 +573,26 @@
 		} else {
 			fds[1] = STDOUT_FILENO;
 		}
-		mx_handle_t process;
+		zx_handle_t process;
 		const char* errmsg = NULL;
 		const char* const* envp = (const char* const*)environment();
-		mx_status_t status = process_subshell (lp->n, envp, &process, fds, &errmsg);
+		zx_status_t status = process_subshell (lp->n, envp, &process, fds, &errmsg);
 		if (fds[0] != STDIN_FILENO)
 			close(fds[0]);
 		if (fds[1] != STDOUT_FILENO)
 			close(fds[1]);
-		if (status == MX_OK) {
+		if (status == ZX_OK) {
 			/* Process-tracking management */
 			forkparent(jp, lp->n, FORK_NOJOB, process);
 		} else {
 			freejob(jp);
-			sh_error("Failed to create shell: %s: %s", mx_status_get_string(status), errmsg);
+			sh_error("Failed to create shell: %s: %s", zx_status_get_string(status), errmsg);
 		}
 	}
 
 	if (n->npipe.backgnd == 0) {
 		status = waitforjob(jp);
-		TRACE(("evalpipe:  job done exit status: %s\n", mx_status_get_string(status)));
+		TRACE(("evalpipe:  job done exit status: %s\n", zx_status_get_string(status)));
 	}
 	INTON;
 
@@ -625,15 +625,15 @@
 	if (pipe(pip) < 0)
 		sh_error("Pipe call failed");
 	jp = makejob(n, 1);
-	mx_handle_t process;
+	zx_handle_t process;
 	const char* errmsg = NULL;
 	const char* const* envp = (const char* const*)environment();
 	int fds[3] = { STDIN_FILENO, pip[1], STDERR_FILENO };
-	mx_status_t status = process_subshell(n, envp, &process, &fds[0], &errmsg);
+	zx_status_t status = process_subshell(n, envp, &process, &fds[0], &errmsg);
         close(pip[1]);
-	if (status != MX_OK) {
+	if (status != ZX_OK) {
 		freejob(jp);
-		sh_error("Failed to create subshell: %s: %s", mx_status_get_string(status), errmsg);
+		sh_error("Failed to create subshell: %s: %s", zx_status_get_string(status), errmsg);
 	} else {
                 /* Process-tracking management */
 		forkparent(jp, n, FORK_NOJOB, process);
@@ -848,17 +848,17 @@
 	/* Execute the command. */
 	switch (cmdentry.cmdtype) {
 	default: {
-		mx_handle_t process = MX_HANDLE_INVALID;
+		zx_handle_t process = ZX_HANDLE_INVALID;
 		const char* errmsg = NULL;
 		status = process_launch(argc, (const char* const*)argv, path,
 		                        cmdentry.u.index, &process, &errmsg);
 		if (status) {
-			sh_error("Cannot create child process: %s: %s", mx_status_get_string(status), errmsg);
+			sh_error("Cannot create child process: %s: %s", zx_status_get_string(status), errmsg);
 			break;
 		}
 		settitle(argv[0]);
 		status = process_await_termination(process, true);
-		mx_handle_close(process);
+		zx_handle_close(process);
 		settitle("sh");
 		break;
 	}
diff --git a/third_party/uapp/dash/src/jobs.c b/third_party/uapp/dash/src/jobs.c
index 733c2a2..ce9747e 100644
--- a/third_party/uapp/dash/src/jobs.c
+++ b/third_party/uapp/dash/src/jobs.c
@@ -1037,7 +1037,7 @@
 				break;
 			}
 			status = process_await_termination (sp->pid, false);
-			if (status != MX_ERR_TIMED_OUT) {
+			if (status != ZX_ERR_TIMED_OUT) {
 				// Convert status to something that looks
 				// like a wait()-generated status.
 				status = (status & 0xff) << 8;
diff --git a/third_party/uapp/dash/src/main.c b/third_party/uapp/dash/src/main.c
index 354489a..b3e6cbf 100644
--- a/third_party/uapp/dash/src/main.c
+++ b/third_party/uapp/dash/src/main.c
@@ -32,9 +32,9 @@
  * SUCH DAMAGE.
  */
 
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
@@ -76,7 +76,7 @@
 
 STATIC void read_profile(const char *);
 STATIC char *find_dot_file(char *);
-STATIC void evalifsubshell(mx_handle_t);
+STATIC void evalifsubshell(zx_handle_t);
 static int cmdloop(int);
 int main(int, char **);
 
@@ -147,9 +147,9 @@
 	init();
 	setstackmark(&smark);
 
-	mx_handle_t ast_vmo = mx_get_startup_handle(PA_HND(PA_USER0, 0));
+	zx_handle_t ast_vmo = zx_get_startup_handle(PA_HND(PA_USER0, 0));
 
-	login = procargs(argc, argv, ast_vmo != MX_HANDLE_INVALID);
+	login = procargs(argc, argv, ast_vmo != ZX_HANDLE_INVALID);
 
         // Fuchsia: recognize if we have been invoked for the purpose of evaluating
 	// an expression (i.e., node) and exiting immediately.
@@ -199,20 +199,20 @@
 }
 
 STATIC void
-evalifsubshell(mx_handle_t ast_vmo)
+evalifsubshell(zx_handle_t ast_vmo)
 {
-	if (ast_vmo == MX_HANDLE_INVALID)
+	if (ast_vmo == ZX_HANDLE_INVALID)
 		return;
 
 	uint64_t size;
-	mx_status_t status = mx_vmo_get_size(ast_vmo, &size);
-	if (status != MX_OK)
+	zx_status_t status = zx_vmo_get_size(ast_vmo, &size);
+	if (status != ZX_OK)
 		exit(status);
 
 	char buffer[size];
 
 	size_t num_read;
-	status = mx_vmo_read(ast_vmo, buffer, 0, size, &num_read);
+	status = zx_vmo_read(ast_vmo, buffer, 0, size, &num_read);
 	if (status < 0 || (size_t)num_read != size)
 		exit(status);
 
diff --git a/third_party/uapp/dash/src/mknodes.c b/third_party/uapp/dash/src/mknodes.c
index 5c5bad4..55c4edf 100644
--- a/third_party/uapp/dash/src/mknodes.c
+++ b/third_party/uapp/dash/src/mknodes.c
@@ -225,7 +225,7 @@
 	if ((cfile = fopen("nodes.c", "w")) == NULL)
 		error("Can't create nodes.c");
 	fputs(writer, hfile);
-	fputs("#include <magenta/types.h>\n\n", hfile);
+	fputs("#include <zircon/types.h>\n\n", hfile);
 	for (i = 0 ; i < ntypes ; i++)
 		fprintf(hfile, "#define %s %d\n", nodename[i], i);
 	fputs("\n\n\n", hfile);
@@ -252,7 +252,7 @@
 	fputs("};\n\n\n", hfile);
 	fputs("struct funcnode *copyfunc(union node *);\n", hfile);
 	fputs("void freefunc(struct funcnode *);\n", hfile);
-	fputs("mx_status_t codec_encode(struct nodelist *nlist, mx_handle_t *vmo);\n", hfile);
+	fputs("zx_status_t codec_encode(struct nodelist *nlist, zx_handle_t *vmo);\n", hfile);
 	fputs("struct nodelist* codec_decode(char *buffer, size_t length);\n", hfile);
 
 	fputs(writer, cfile);
diff --git a/third_party/uapp/dash/src/nodes.c b/third_party/uapp/dash/src/nodes.c
index a818fcb..6486bbb 100644
--- a/third_party/uapp/dash/src/nodes.c
+++ b/third_party/uapp/dash/src/nodes.c
@@ -38,7 +38,7 @@
  *	@(#)nodes.c.pat	8.2 (Berkeley) 5/4/95
  */
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <stdlib.h>
 
 /*
@@ -687,8 +687,8 @@
 // * A sequence of null-terminated strings, in the order the strings are
 //   encountered in a pre-order traversal of the node tree.
 
-mx_status_t
-codec_encode(struct nodelist *nlist, mx_handle_t *vmo)
+zx_status_t
+codec_encode(struct nodelist *nlist, zx_handle_t *vmo)
 {
 	funcblocksize = 0;
 	funcstringsize = 0;
@@ -725,11 +725,11 @@
 	encodenodelist(nlist);
 
 	// And VMO-ify the whole thing
-	mx_status_t status = mx_vmo_create(total_size, 0, vmo);
-	if (status != MX_OK)
+	zx_status_t status = zx_vmo_create(total_size, 0, vmo);
+	if (status != ZX_OK)
 		return status;
 	size_t actual;
-	return mx_vmo_write(*vmo, buffer, 0, total_size, &actual);
+	return zx_vmo_write(*vmo, buffer, 0, total_size, &actual);
 }
 
 struct nodelist *codec_decode(char *buffer, size_t length)
diff --git a/third_party/uapp/dash/src/nodes.c.pat b/third_party/uapp/dash/src/nodes.c.pat
index 97416af..43c77f0 100644
--- a/third_party/uapp/dash/src/nodes.c.pat
+++ b/third_party/uapp/dash/src/nodes.c.pat
@@ -34,7 +34,7 @@
  *	@(#)nodes.c.pat	8.2 (Berkeley) 5/4/95
  */
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <stdlib.h>
 
 /*
@@ -329,8 +329,8 @@
 // * A sequence of null-terminated strings, in the order the strings are
 //   encountered in a pre-order traversal of the node tree.
 
-mx_status_t
-codec_encode(struct nodelist *nlist, mx_handle_t *vmo)
+zx_status_t
+codec_encode(struct nodelist *nlist, zx_handle_t *vmo)
 {
 	funcblocksize = 0;
 	funcstringsize = 0;
@@ -367,11 +367,11 @@
 	encodenodelist(nlist);
 
 	// And VMO-ify the whole thing
-	mx_status_t status = mx_vmo_create(total_size, 0, vmo);
-	if (status != MX_OK)
+	zx_status_t status = zx_vmo_create(total_size, 0, vmo);
+	if (status != ZX_OK)
 		return status;
 	size_t actual;
-	return mx_vmo_write(*vmo, buffer, 0, total_size, &actual);
+	return zx_vmo_write(*vmo, buffer, 0, total_size, &actual);
 }
 
 struct nodelist *codec_decode(char *buffer, size_t length)
diff --git a/third_party/uapp/dash/src/nodes.h b/third_party/uapp/dash/src/nodes.h
index be46b77..edcc97b 100644
--- a/third_party/uapp/dash/src/nodes.h
+++ b/third_party/uapp/dash/src/nodes.h
@@ -2,7 +2,7 @@
  * This file was generated by the mknodes program.
  */
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #define NCMD 0
 #define NPIPE 1
@@ -178,5 +178,5 @@
 
 struct funcnode *copyfunc(union node *);
 void freefunc(struct funcnode *);
-mx_status_t codec_encode(struct nodelist *nlist, mx_handle_t *vmo);
+zx_status_t codec_encode(struct nodelist *nlist, zx_handle_t *vmo);
 struct nodelist* codec_decode(char *buffer, size_t length);
diff --git a/third_party/uapp/dash/src/process.c b/third_party/uapp/dash/src/process.c
index 3181d35..5c2a8cb 100644
--- a/third_party/uapp/dash/src/process.c
+++ b/third_party/uapp/dash/src/process.c
@@ -4,10 +4,10 @@
 
 #include <launchpad/launchpad.h>
 #include <launchpad/vmo.h>
-#include <magenta/process.h>
-#include <magenta/processargs.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/process.h>
+#include <zircon/processargs.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <string.h>
 #include <unistd.h>
 
@@ -26,7 +26,7 @@
     launchpad_load_from_file(lp, filename);
     launchpad_set_args(lp, argc, argv);
     launchpad_set_environ(lp, envp);
-    launchpad_clone(lp, LP_CLONE_MXIO_NAMESPACE | LP_CLONE_MXIO_CWD);
+    launchpad_clone(lp, LP_CLONE_FDIO_NAMESPACE | LP_CLONE_FDIO_CWD);
 
     if (fds) {
         launchpad_clone_fd(lp, fds[0], STDIN_FILENO);
@@ -39,8 +39,8 @@
     }
 }
 
-static mx_status_t launch(const char* filename, int argc, const char* const* argv,
-                          const char* const* envp, mx_handle_t* process, const char** errmsg) {
+static zx_status_t launch(const char* filename, int argc, const char* const* argv,
+                          const char* const* envp, zx_handle_t* process, const char** errmsg) {
     launchpad_t* lp = NULL;
     launchpad_create(0, filename, &lp);
     prepare_launch(lp, filename, argc, argv, envp, NULL);
@@ -61,17 +61,17 @@
     }
 }
 
-mx_status_t process_subshell(union node* n, const char* const* envp, mx_handle_t* process, int *fds,
+zx_status_t process_subshell(union node* n, const char* const* envp, zx_handle_t* process, int *fds,
                              const char** errmsg)
 {
     if (!orig_arg0)
-        return MX_ERR_NOT_FOUND;
+        return ZX_ERR_NOT_FOUND;
 
     launchpad_t* lp = NULL;
 
     // TODO(abarth): Handle the redirects properly (i.e., implement
     // redirect(n->nredir.redirect) using launchpad);
-    mx_handle_t ast_vmo = MX_HANDLE_INVALID;
+    zx_handle_t ast_vmo = ZX_HANDLE_INVALID;
 
     // Create a node for our expression
     struct nodelist *nlist = ckmalloc(sizeof(struct nodelist));
@@ -82,7 +82,7 @@
     hashiter(addfuncdef, &nlist);
 
     // Encode the node list
-    mx_status_t status = codec_encode(nlist, &ast_vmo);
+    zx_status_t status = codec_encode(nlist, &ast_vmo);
 
     // Clean up
     while (nlist) {
@@ -91,7 +91,7 @@
         nlist = next;
     }
 
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return status;
 
     launchpad_create(0, orig_arg0, &lp);
@@ -110,21 +110,21 @@
     return launchpad_go(lp, process, errmsg);
 }
 
-int process_launch(int argc, const char* const* argv, const char* path, int index, mx_handle_t* process,
+int process_launch(int argc, const char* const* argv, const char* path, int index, zx_handle_t* process,
                    const char** errmsg) {
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
 
     // All exported variables
     const char* const* envp = (const char* const*)environment();
 
     if (strchr(argv[0], '/') != NULL) {
         status = launch(argv[0], argc, argv, envp, process, errmsg);
-        if (status == MX_OK)
+        if (status == ZX_OK)
             return 0;
     } else {
-        status = MX_ERR_NOT_FOUND;
+        status = ZX_ERR_NOT_FOUND;
         const char* filename = NULL;
-        while (status != MX_OK && (filename = padvance(&path, argv[0])) != NULL) {
+        while (status != ZX_OK && (filename = padvance(&path, argv[0])) != NULL) {
             if (--index < 0 && pathopt == NULL)
                 status = launch(filename, argc, argv, envp, process, errmsg);
             stunalloc(filename);
@@ -132,11 +132,11 @@
     }
 
     switch (status) {
-    case MX_OK:
+    case ZX_OK:
         return 0;
-    case MX_ERR_ACCESS_DENIED:
+    case ZX_ERR_ACCESS_DENIED:
         return 126;
-    case MX_ERR_NOT_FOUND:
+    case ZX_ERR_NOT_FOUND:
         return 127;
     default:
         return 2;
@@ -144,19 +144,19 @@
 }
 
 /* Check for process termination (block if requested). When not blocking,
-   returns MX_ERR_TIMED_OUT if process hasn't exited yet.  */
-int process_await_termination(mx_handle_t process, bool blocking) {
-    mx_time_t timeout = blocking ? MX_TIME_INFINITE : 0;
-    mx_signals_t signals_observed;
-    mx_status_t status = mx_object_wait_one(process, MX_TASK_TERMINATED, timeout, &signals_observed);
-    if (status != MX_OK && status != MX_ERR_TIMED_OUT)
+   returns ZX_ERR_TIMED_OUT if process hasn't exited yet.  */
+int process_await_termination(zx_handle_t process, bool blocking) {
+    zx_time_t timeout = blocking ? ZX_TIME_INFINITE : 0;
+    zx_signals_t signals_observed;
+    zx_status_t status = zx_object_wait_one(process, ZX_TASK_TERMINATED, timeout, &signals_observed);
+    if (status != ZX_OK && status != ZX_ERR_TIMED_OUT)
         return status;
-    if (!blocking && status == MX_ERR_TIMED_OUT && !signals_observed)
-        return MX_ERR_TIMED_OUT;
+    if (!blocking && status == ZX_ERR_TIMED_OUT && !signals_observed)
+        return ZX_ERR_TIMED_OUT;
 
-    mx_info_process_t proc_info;
-    status = mx_object_get_info(process, MX_INFO_PROCESS, &proc_info, sizeof(proc_info), NULL, NULL);
-    if (status != MX_OK)
+    zx_info_process_t proc_info;
+    status = zx_object_get_info(process, ZX_INFO_PROCESS, &proc_info, sizeof(proc_info), NULL, NULL);
+    if (status != ZX_OK)
         return status;
 
     return proc_info.return_code;
diff --git a/third_party/uapp/dash/src/process.h b/third_party/uapp/dash/src/process.h
index c7e57c3..0896036 100644
--- a/third_party/uapp/dash/src/process.h
+++ b/third_party/uapp/dash/src/process.h
@@ -4,15 +4,15 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 union node;
 
 int process_launch(int argc, const char* const* argv, const char* path,
-                   int index, mx_handle_t* process, const char** errmsg);
+                   int index, zx_handle_t* process, const char** errmsg);
 
-mx_status_t process_subshell(union node* n, const char* const* envp, mx_handle_t* process, int *fds,
+zx_status_t process_subshell(union node* n, const char* const* envp, zx_handle_t* process, int *fds,
                              const char** errmsg);
 
 // Waits for the process to terminate and returns the exit code for the process.
-int process_await_termination(mx_handle_t process, bool blocking);
+int process_await_termination(zx_handle_t process, bool blocking);
diff --git a/third_party/uapp/dash/src/shell.h b/third_party/uapp/dash/src/shell.h
index eb2460b..5559f15 100644
--- a/third_party/uapp/dash/src/shell.h
+++ b/third_party/uapp/dash/src/shell.h
@@ -49,7 +49,7 @@
  * a quit signal will generate a core dump.
  */
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <sys/param.h>
 
 #ifndef JOBS
diff --git a/third_party/uapp/dash/src/tab.c b/third_party/uapp/dash/src/tab.c
index 1f73f73..b097701 100644
--- a/third_party/uapp/dash/src/tab.c
+++ b/third_party/uapp/dash/src/tab.c
@@ -10,7 +10,7 @@
 #include <string.h>
 
 #include <linenoise/linenoise.h>
-#include <magenta/assert.h>
+#include <zircon/assert.h>
 
 #include "shell.h"
 #include "nodes.h"
@@ -76,7 +76,7 @@
 // |state->line_separator| begin the line before the file completion.
 static void complete_at_dir(DIR* dir, completion_state_t* state,
                             linenoiseCompletions* completions) {
-    MX_DEBUG_ASSERT(strchr(state->file_prefix, '/') == NULL);
+    ZX_DEBUG_ASSERT(strchr(state->file_prefix, '/') == NULL);
     size_t file_prefix_len = strlen(state->file_prefix);
 
     struct dirent *de;
@@ -157,8 +157,8 @@
             // Case 1.
             // Because we are in a command, partial_path[-1] is a
             // space we want to zero out.
-            MX_DEBUG_ASSERT(token.start > 0);
-            MX_DEBUG_ASSERT(partial_path[-1] == ' ');
+            ZX_DEBUG_ASSERT(token.start > 0);
+            ZX_DEBUG_ASSERT(partial_path[-1] == ' ');
             partial_path[-1] = '\0';
 
             completion_state.line_prefix = buf;
@@ -175,7 +175,7 @@
         // Case 3.
         // Because we are in a multiple component file path,
         // *file_prefix is a '/' we want to zero out.
-        MX_DEBUG_ASSERT(*file_prefix == '/');
+        ZX_DEBUG_ASSERT(*file_prefix == '/');
         *file_prefix = '\0';
 
         completion_state.line_prefix = buf;
diff --git a/third_party/uapp/fsck-msdosfs/rules.mk b/third_party/uapp/fsck-msdosfs/rules.mk
index 4b3d75e..bfa26e9 100644
--- a/third_party/uapp/fsck-msdosfs/rules.mk
+++ b/third_party/uapp/fsck-msdosfs/rules.mk
@@ -17,6 +17,6 @@
 
 MODULE_NAME := fsck-msdosfs
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/third_party/uapp/kilo/kilo.c b/third_party/uapp/kilo/kilo.c
index 3fc4dd9..48df59b 100644
--- a/third_party/uapp/kilo/kilo.c
+++ b/third_party/uapp/kilo/kilo.c
@@ -54,7 +54,7 @@
 #include <fcntl.h>
 
 #ifdef __Fuchsia__
-#include <magenta/device/console.h>
+#include <zircon/device/console.h>
 
 static time_t time(void* arg) {
     return 0;
@@ -545,7 +545,7 @@
     case HL_MLCOMMENT: return 36;     /* cyan */
     case HL_KEYWORD1: return 33;    /* yellow */
     case HL_KEYWORD2: return 32;    /* green */
-    case HL_STRING: return 35;      /* magenta */
+    case HL_STRING: return 35;      /* zircon */
     case HL_NUMBER: return 31;      /* red */
     case HL_MATCH: return 34;      /* blu */
     default: return 37;             /* white */
diff --git a/third_party/uapp/kilo/rules.mk b/third_party/uapp/kilo/rules.mk
index 6a65555..9a818ee 100644
--- a/third_party/uapp/kilo/rules.mk
+++ b/third_party/uapp/kilo/rules.mk
@@ -22,7 +22,7 @@
 
 MODULE_NAME := kilo
 
-MODULE_LIBS := system/ulib/mxio system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/c
 
 ifeq ($(call TOBOOL,$(USE_CLANG)),false)
 MODULE_CFLAGS += -Wno-discarded-qualifiers
@@ -33,7 +33,7 @@
 # NOTE(raggi): kilo.c inclusion is disabled for now, as it is the only
 # non-BUILDDIR-relative entry in bootfs.manifest. Having the relative entry
 # means that rebuilding bootdata from the manifest must be run from inside the
-# magenta source tree. We do not expose a source directory, and we don't want to
+# zircon source tree. We do not expose a source directory, and we don't want to
 # use absolute paths in the build here. We could install the file to the build
 # dir instead.
 # USER_MANIFEST_LINES += src/kilo.c=$(LOCAL_DIR)/kilo.c
diff --git a/third_party/uapp/mkfs-msdosfs/rules.mk b/third_party/uapp/mkfs-msdosfs/rules.mk
index 68fe072..472b6c6 100644
--- a/third_party/uapp/mkfs-msdosfs/rules.mk
+++ b/third_party/uapp/mkfs-msdosfs/rules.mk
@@ -14,6 +14,6 @@
 
 MODULE_NAME := mkfs-msdosfs
 
-MODULE_LIBS := system/ulib/mxio system/ulib/magenta system/ulib/c
+MODULE_LIBS := system/ulib/fdio system/ulib/zircon system/ulib/c
 
 include make/module.mk
diff --git a/third_party/ulib/acpica/rules.mk b/third_party/ulib/acpica/rules.mk
index 74b781b..7fd570d 100644
--- a/third_party/ulib/acpica/rules.mk
+++ b/third_party/ulib/acpica/rules.mk
@@ -201,7 +201,7 @@
 MODULE_STATIC_LIBS := \
     system/ulib/ddk \
     system/ulib/fbl \
-    system/ulib/mxcpp \
+    system/ulib/zxcpp \
 
 MODULE_LIBS := \
     system/ulib/c
diff --git a/third_party/ulib/backtrace/config.h b/third_party/ulib/backtrace/config.h
index c9b5d4b..47d89d9 100644
--- a/third_party/ulib/backtrace/config.h
+++ b/third_party/ulib/backtrace/config.h
@@ -1,4 +1,4 @@
-/* magenta version of libbacktrace */
+/* zircon version of libbacktrace */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* ELF size: 32 or 64 */
diff --git a/third_party/ulib/backtrace/include/backtrace/backtrace-supported.h b/third_party/ulib/backtrace/include/backtrace/backtrace-supported.h
index 7ccdd75..85727f1 100644
--- a/third_party/ulib/backtrace/include/backtrace/backtrace-supported.h
+++ b/third_party/ulib/backtrace/include/backtrace/backtrace-supported.h
@@ -1,4 +1,4 @@
-/* magenta version of backtrace-supported.h */
+/* zircon version of backtrace-supported.h */
 /* backtrace-supported.h.in -- Whether stack backtrace is supported.
    Copyright (C) 2012-2016 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google.
diff --git a/third_party/ulib/backtrace/rules.mk b/third_party/ulib/backtrace/rules.mk
index f0fa20b..5c80322 100644
--- a/third_party/ulib/backtrace/rules.mk
+++ b/third_party/ulib/backtrace/rules.mk
@@ -21,7 +21,7 @@
 MODULE_SO_NAME := backtrace
 
 MODULE_LIBS := \
-    third_party/ulib/ngunwind system/ulib/magenta system/ulib/c
+    third_party/ulib/ngunwind system/ulib/zircon system/ulib/c
 
 # Compile this with frame pointers so that if we crash the crashlogger
 # the simplistic unwinder will work.
diff --git a/third_party/ulib/cksum/include/lib/cksum.h b/third_party/ulib/cksum/include/lib/cksum.h
index 73e3c46..88217b1 100644
--- a/third_party/ulib/cksum/include/lib/cksum.h
+++ b/third_party/ulib/cksum/include/lib/cksum.h
@@ -4,7 +4,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 __BEGIN_CDECLS
 
diff --git a/third_party/ulib/cryptolib/include/lib/crypto/cryptolib.h b/third_party/ulib/cryptolib/include/lib/crypto/cryptolib.h
index 9f827c8..84c3f44 100644
--- a/third_party/ulib/cryptolib/include/lib/crypto/cryptolib.h
+++ b/third_party/ulib/cryptolib/include/lib/crypto/cryptolib.h
@@ -22,7 +22,7 @@
 #pragma once
 
 #include <inttypes.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 
 #define clBIGNUMBYTES 256      // 2048 bit key length max
 #define clBIGNUMWORDS (clBIGNUMBYTES / sizeof(uint32_t))
diff --git a/third_party/ulib/jemalloc/src/pages.c b/third_party/ulib/jemalloc/src/pages.c
index c37588f..e9f6adb 100644
--- a/third_party/ulib/jemalloc/src/pages.c
+++ b/third_party/ulib/jemalloc/src/pages.c
@@ -21,9 +21,9 @@
 
 #include <threads.h>
 
-#include <magenta/process.h>
-#include <magenta/status.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/status.h>
+#include <zircon/syscalls.h>
 
 // Reserve a terabyte of address space for heap allocations.
 #define VMAR_SIZE (1ull << 40)
@@ -34,8 +34,8 @@
 // chunks of address space. To maintain claims to address space we
 // must use our own vmar.
 static uintptr_t pages_base;
-static mx_handle_t pages_vmar;
-static mx_handle_t pages_vmo;
+static zx_handle_t pages_vmar;
+static zx_handle_t pages_vmo;
 
 // Protect reservations to the pages_vmar.
 static mtx_t vmar_lock;
@@ -68,24 +68,24 @@
 	} else {
 		// TODO(kulakowski) Use MG-942 instead of having to
 		// allocate and destroy under a lock.
-		mx_handle_t subvmar;
+		zx_handle_t subvmar;
 		uintptr_t subvmar_base;
-		mx_status_t status = _mx_vmar_allocate(pages_vmar, 0u, len,
-		    MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+		zx_status_t status = _zx_vmar_allocate(pages_vmar, 0u, len,
+		    ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
 		    &subvmar, &subvmar_base);
-		if (status != MX_OK)
+		if (status != ZX_OK)
 			abort();
-		_mx_vmar_destroy(subvmar);
-		_mx_handle_close(subvmar);
+		_zx_vmar_destroy(subvmar);
+		_zx_handle_close(subvmar);
 		offset = subvmar_base - pages_base;
 	}
 
 	uintptr_t ptr = 0;
-	uint32_t mx_flags = MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE |
-	    MX_VM_FLAG_SPECIFIC;
-	mx_status_t status = _mx_vmar_map(pages_vmar, offset, pages_vmo,
-	    offset, len, mx_flags, &ptr);
-	if (status != MX_OK) {
+	uint32_t zx_flags = ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE |
+	    ZX_VM_FLAG_SPECIFIC;
+	zx_status_t status = _zx_vmar_map(pages_vmar, offset, pages_vmo,
+	    offset, len, zx_flags, &ptr);
+	if (status != ZX_OK) {
 		ptr = 0u;
 	}
 
@@ -93,9 +93,9 @@
 	return (void*)ptr;
 }
 
-static mx_status_t fuchsia_pages_free(void* addr, size_t size) {
+static zx_status_t fuchsia_pages_free(void* addr, size_t size) {
 	uintptr_t ptr = (uintptr_t)addr;
-	return _mx_vmar_unmap(pages_vmar, ptr, size);
+	return _zx_vmar_unmap(pages_vmar, ptr, size);
 }
 
 static void* fuchsia_pages_trim(void* ret, void* addr, size_t size,
@@ -163,14 +163,14 @@
 #ifdef _WIN32
 	if (VirtualFree(addr, 0, MEM_RELEASE) == 0)
 #elif __Fuchsia__
-	mx_status_t status = fuchsia_pages_free(addr, size);
-	if (status != MX_OK)
+	zx_status_t status = fuchsia_pages_free(addr, size);
+	if (status != ZX_OK)
 #else
 	if (munmap(addr, size) == -1)
 #endif
 	{
 #if __Fuchsia__
-		const char* buf = _mx_status_get_string(status);
+		const char* buf = _zx_status_get_string(status);
 #else
 		char buf[BUFERROR_BUF];
 		buferror(get_errno(), buf, sizeof(buf));
@@ -390,18 +390,18 @@
 #endif
 
 #if defined(__Fuchsia__)
-	uint32_t vmar_flags = MX_VM_FLAG_CAN_MAP_SPECIFIC | MX_VM_FLAG_CAN_MAP_READ |
-	    MX_VM_FLAG_CAN_MAP_WRITE;
-	mx_status_t status = _mx_vmar_allocate(_mx_vmar_root_self(), 0, VMAR_SIZE,
+	uint32_t vmar_flags = ZX_VM_FLAG_CAN_MAP_SPECIFIC | ZX_VM_FLAG_CAN_MAP_READ |
+	    ZX_VM_FLAG_CAN_MAP_WRITE;
+	zx_status_t status = _zx_vmar_allocate(_zx_vmar_root_self(), 0, VMAR_SIZE,
 					       vmar_flags, &pages_vmar, &pages_base);
-	if (status != MX_OK)
+	if (status != ZX_OK)
 		abort();
-	status = _mx_vmo_create(VMAR_SIZE, 0, &pages_vmo);
-	if (status != MX_OK)
+	status = _zx_vmo_create(VMAR_SIZE, 0, &pages_vmo);
+	if (status != ZX_OK)
 		abort();
-	status = _mx_object_set_property(pages_vmo, MX_PROP_NAME, MMAP_VMO_NAME,
+	status = _zx_object_set_property(pages_vmo, ZX_PROP_NAME, MMAP_VMO_NAME,
 	    strlen(MMAP_VMO_NAME));
-	if (status != MX_OK)
+	if (status != ZX_OK)
 		abort();
 #endif
 
diff --git a/third_party/ulib/linenoise/README.fuchsia.md b/third_party/ulib/linenoise/README.fuchsia.md
index 9cba5fd..144b96e 100644
--- a/third_party/ulib/linenoise/README.fuchsia.md
+++ b/third_party/ulib/linenoise/README.fuchsia.md
@@ -1,4 +1,4 @@
-This is a port of linenoise for the Magenta userspace.
+This is a port of linenoise for the Zircon userspace.
 
 The upstream repository is https://github.com/antirez/linenoise
 at commit c894b9e59f02203dbe4e2be657572cf88c4230c3
diff --git a/third_party/ulib/linenoise/README.markdown b/third_party/ulib/linenoise/README.markdown
index e01642c..bce9791 100644
--- a/third_party/ulib/linenoise/README.markdown
+++ b/third_party/ulib/linenoise/README.markdown
@@ -212,7 +212,7 @@
     green = 32
     yellow = 33
     blue = 34
-    magenta = 35
+    zircon = 35
     cyan = 36
     white = 37;
 
diff --git a/third_party/ulib/linenoise/linenoise.c b/third_party/ulib/linenoise/linenoise.c
index 2f10c25..ae3100c 100644
--- a/third_party/ulib/linenoise/linenoise.c
+++ b/third_party/ulib/linenoise/linenoise.c
@@ -118,8 +118,8 @@
 #include <poll.h>
 
 #ifdef __Fuchsia__
-#include <magenta/device/console.h>
-#include <mxio/io.h>
+#include <zircon/device/console.h>
+#include <fdio/io.h>
 #endif
 
 #include "linenoise.h"
@@ -318,7 +318,7 @@
 static int getColumns(int ifd, int ofd) {
 #ifdef __Fuchsia__
     ioctl_console_dimensions_t dims;
-    ssize_t r = mxio_ioctl(0, IOCTL_CONSOLE_GET_DIMENSIONS,NULL, 0, &dims,
+    ssize_t r = fdio_ioctl(0, IOCTL_CONSOLE_GET_DIMENSIONS,NULL, 0, &dims,
         sizeof(dims));
     if (r != sizeof(dims)) {
 #else
diff --git a/third_party/ulib/linenoise/rules.mk b/third_party/ulib/linenoise/rules.mk
index 169e955..2a5d0c0 100644
--- a/third_party/ulib/linenoise/rules.mk
+++ b/third_party/ulib/linenoise/rules.mk
@@ -20,7 +20,7 @@
 
 MODULE_SRCS = $(LOCAL_DIR)/linenoise.c
 
-MODULE_LIBS := system/ulib/mxio
+MODULE_LIBS := system/ulib/fdio
 
 MODULE_CFLAGS := -I$(LOCAL_DIR)/include/linenoise
 
diff --git a/third_party/ulib/musl/include/magenta/threads.h b/third_party/ulib/musl/include/magenta/threads.h
deleted file mode 100644
index 2ded4ef..0000000
--- a/third_party/ulib/musl/include/magenta/threads.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma once
-
-#include <magenta/types.h>
-#include <threads.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Get the mx_handle_t corresponding to the thrd_t. This handle is
-// still owned by the C11 thread, and will not persist after the
-// thread exits and is joined or detached. Callers must duplicate the
-// handle, therefore, if they wish the thread handle to outlive the
-// execution of the C11 thread.
-mx_handle_t thrd_get_mx_handle(thrd_t t);
-
-// Converts a threads.h-style status value to an |mx_status_t|.
-static inline mx_status_t __PURE thrd_status_to_mx_status(int thrd_status) {
-    switch (thrd_status) {
-    case thrd_success:
-        return MX_OK;
-    case thrd_nomem:
-        return MX_ERR_NO_MEMORY;
-    case thrd_timedout:
-        return MX_ERR_TIMED_OUT;
-    case thrd_busy:
-        return MX_ERR_SHOULD_WAIT;
-    default:
-    case thrd_error:
-        return MX_ERR_INTERNAL;
-    }
-}
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/third_party/ulib/musl/include/sys/sem.h b/third_party/ulib/musl/include/sys/sem.h
index be4da82..864161f 100644
--- a/third_party/ulib/musl/include/sys/sem.h
+++ b/third_party/ulib/musl/include/sys/sem.h
@@ -43,7 +43,7 @@
     int semopm;
     int semume;
     int semusz;
-    int semvmx;
+    int semvzx;
     int semaem;
 };
 
diff --git a/third_party/ulib/musl/include/threads.h b/third_party/ulib/musl/include/threads.h
index 6fbbb86..ff3ec3e 100644
--- a/third_party/ulib/musl/include/threads.h
+++ b/third_party/ulib/musl/include/threads.h
@@ -48,7 +48,7 @@
 
 int thrd_create(thrd_t*, thrd_start_t, void*);
 #ifdef _ALL_SOURCE
-// |name| is silently truncated to a maximum of MX_MAX_NAME_LEN-1 characters.
+// |name| is silently truncated to a maximum of ZX_MAX_NAME_LEN-1 characters.
 int thrd_create_with_name(thrd_t*, thrd_start_t, void*, const char* name);
 #endif
 _Noreturn void thrd_exit(int);
diff --git a/third_party/ulib/musl/include/magenta/dlfcn.h b/third_party/ulib/musl/include/zircon/dlfcn.h
similarity index 75%
rename from third_party/ulib/musl/include/magenta/dlfcn.h
rename to third_party/ulib/musl/include/zircon/dlfcn.h
index 8b0d9c7..d97a17a 100644
--- a/third_party/ulib/musl/include/magenta/dlfcn.h
+++ b/third_party/ulib/musl/include/zircon/dlfcn.h
@@ -1,25 +1,25 @@
 #pragma once
 
 #include <dlfcn.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-void* dlopen_vmo(mx_handle_t, int);
+void* dlopen_vmo(zx_handle_t, int);
 
 // Replace the handle to the "loader service" used to map names
 // to VM objects for dlopen et al.  This takes ownership of the
 // given handle, and gives the caller ownership of the old handle
 // in the return value.
-mx_handle_t dl_set_loader_service(mx_handle_t new_svc);
+zx_handle_t dl_set_loader_service(zx_handle_t new_svc);
 
 // Ask the active "loader service" (if there is one), to return
 // a new connection.  Not all loader services need support this.
 // On success, a channel handle to the new connection is returned
 // via out.
-mx_status_t dl_clone_loader_service(mx_handle_t* out);
+zx_status_t dl_clone_loader_service(zx_handle_t* out);
 
 #ifdef __cplusplus
 }
diff --git a/third_party/ulib/musl/include/magenta/sanitizer.h b/third_party/ulib/musl/include/zircon/sanitizer.h
similarity index 93%
rename from third_party/ulib/musl/include/magenta/sanitizer.h
rename to third_party/ulib/musl/include/zircon/sanitizer.h
index a504ad9..890d125 100644
--- a/third_party/ulib/musl/include/magenta/sanitizer.h
+++ b/third_party/ulib/musl/include/zircon/sanitizer.h
@@ -12,8 +12,8 @@
 // unsanitized builds (only unsanitized shared library binaries are used at
 // link time, including linking the sanitizer runtime shared libraries).
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
@@ -47,7 +47,7 @@
 // Write logging information from the sanitizer runtime.  The buffer
 // is expected to be printable text with '\n' ending each line.
 // Timestamps and globally unique identifiers of the calling process
-// and thread (mx_koid_t) are attached to all messages, so there is no
+// and thread (zx_koid_t) are attached to all messages, so there is no
 // need to include those details in the text.  The log of messages
 // written with this call automatically includes address and ELF build
 // ID details of the program and all shared libraries sufficient to
@@ -61,7 +61,7 @@
 // Runtimes that have binary data to publish (e.g. coverage) use this
 // interface.  The name describes the data sink that will receive this
 // blob of data; the string is not used after this call returns.  The
-// caller creates a VMO (e.g. mx_vmo_create) and passes it in; the VMO
+// caller creates a VMO (e.g. zx_vmo_create) and passes it in; the VMO
 // handle is consumed by this call.  Each particular data sink has its
 // own conventions about both the format of the data in the VMO and the
 // protocol for when data must be written there.  For some sinks, the
@@ -70,7 +70,7 @@
 // throughout the life of the process, to be analyzed only after the
 // process terminates.  Yet others might use an asynchronous shared
 // memory protocol between producer and consumer.
-void __sanitizer_publish_data(const char* sink_name, mx_handle_t vmo);
+void __sanitizer_publish_data(const char* sink_name, zx_handle_t vmo);
 
 // Runtimes that want to read configuration files use this interface.
 // The name is a string from the user (something akin to a file name
@@ -78,8 +78,8 @@
 // after this call returns.  On success, this yields a read-only VMO
 // handle from which the contents associated with that name can be
 // read; the caller is responsible for closing this handle.
-mx_status_t __sanitizer_get_configuration(const char* config_name,
-                                          mx_handle_t* out_vmo);
+zx_status_t __sanitizer_get_configuration(const char* config_name,
+                                          zx_handle_t* out_vmo);
 
 // The "hook" interfaces are functions that the sanitizer runtime library
 // can define and libc will call.  There are default definitions in libc
@@ -91,7 +91,7 @@
 // This is called at program startup, with the arguments that will be
 // passed to main.  This is called before any other application code,
 // including both static constructors and initialization of things like
-// mxio and mx_get_startup_handle.  It's basically the first thing called
+// fdio and zx_get_startup_handle.  It's basically the first thing called
 // after libc's most basic internal global initialization is complete and
 // the initial thread has switched to its real thread stack.  Since not
 // even all of libc's own constructors have run yet, this should not call
diff --git a/third_party/ulib/musl/include/zircon/threads.h b/third_party/ulib/musl/include/zircon/threads.h
new file mode 100644
index 0000000..6cfc703
--- /dev/null
+++ b/third_party/ulib/musl/include/zircon/threads.h
@@ -0,0 +1,36 @@
+#pragma once
+
+#include <zircon/types.h>
+#include <threads.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Get the zx_handle_t corresponding to the thrd_t. This handle is
+// still owned by the C11 thread, and will not persist after the
+// thread exits and is joined or detached. Callers must duplicate the
+// handle, therefore, if they wish the thread handle to outlive the
+// execution of the C11 thread.
+zx_handle_t thrd_get_zx_handle(thrd_t t);
+
+// Converts a threads.h-style status value to an |zx_status_t|.
+static inline zx_status_t __PURE thrd_status_to_zx_status(int thrd_status) {
+    switch (thrd_status) {
+    case thrd_success:
+        return ZX_OK;
+    case thrd_nomem:
+        return ZX_ERR_NO_MEMORY;
+    case thrd_timedout:
+        return ZX_ERR_TIMED_OUT;
+    case thrd_busy:
+        return ZX_ERR_SHOULD_WAIT;
+    default:
+    case thrd_error:
+        return ZX_ERR_INTERNAL;
+    }
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/third_party/ulib/musl/ldso/dlstart.c b/third_party/ulib/musl/ldso/dlstart.c
index d62e2fd..acb053d 100644
--- a/third_party/ulib/musl/ldso/dlstart.c
+++ b/third_party/ulib/musl/ldso/dlstart.c
@@ -1,6 +1,6 @@
 #include "dynlink.h"
 #include "libc.h"
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdatomic.h>
 #include <stddef.h>
 
diff --git a/third_party/ulib/musl/ldso/dynlink.c b/third_party/ulib/musl/ldso/dynlink.c
index 3ddd5ae..27d912d 100644
--- a/third_party/ulib/musl/ldso/dynlink.c
+++ b/third_party/ulib/musl/ldso/dynlink.c
@@ -2,7 +2,7 @@
 #include "dynlink.h"
 #include "libc.h"
 #include "asan_impl.h"
-#include "magenta_impl.h"
+#include "zircon_impl.h"
 #include "pthread_impl.h"
 #include "stdio_impl.h"
 #include <ctype.h>
@@ -12,9 +12,9 @@
 #include <fcntl.h>
 #include <limits.h>
 #include <link.h>
-#include <magenta/dlfcn.h>
-#include <magenta/process.h>
-#include <magenta/status.h>
+#include <zircon/dlfcn.h>
+#include <zircon/process.h>
+#include <zircon/status.h>
 #include <pthread.h>
 #include <setjmp.h>
 #include <stdalign.h>
@@ -40,7 +40,7 @@
 static void error(const char*, ...);
 static void debugmsg(const char*, ...);
 static void log_write(const void* buf, size_t len);
-static mx_status_t get_library_vmo(const char* name, mx_handle_t* vmo);
+static zx_status_t get_library_vmo(const char* name, zx_handle_t* vmo);
 static void loader_svc_config(const char* config);
 
 #define MAXP2(a, b) (-(-(a) & -(b)))
@@ -80,7 +80,7 @@
     int phnum;
     size_t phentsize;
     int refcnt;
-    mx_handle_t vmar; // Closed after relocation.
+    zx_handle_t vmar; // Closed after relocation.
     Sym* syms;
     uint32_t* hashtab;
     uint32_t* ghashtab;
@@ -147,12 +147,12 @@
 static bool log_libs = false;
 static atomic_uintptr_t unlogged_tail;
 
-static mx_handle_t loader_svc = MX_HANDLE_INVALID;
-static mx_handle_t logger = MX_HANDLE_INVALID;
+static zx_handle_t loader_svc = ZX_HANDLE_INVALID;
+static zx_handle_t logger = ZX_HANDLE_INVALID;
 
 // Various tools use this value to bootstrap their knowledge of the process.
 // E.g., the list of loaded shared libraries is obtained from here.
-// The value is stored in the process's MX_PROPERTY_PROCESS_DEBUG_ADDR so that
+// The value is stored in the process's ZX_PROPERTY_PROCESS_DEBUG_ADDR so that
 // tools can obtain the value when aslr is enabled.
 struct debug* _dl_debug_addr = &debug;
 
@@ -202,18 +202,18 @@
     // is wasted unless the system happens to give us the adjacent page.
     if (alloc_limit - alloc_ptr < size) {
         size_t chunk_size = (size + PAGE_SIZE - 1) & -PAGE_SIZE;
-        mx_handle_t vmo;
-        mx_status_t status = _mx_vmo_create(chunk_size, 0, &vmo);
-        if (status != MX_OK)
+        zx_handle_t vmo;
+        zx_status_t status = _zx_vmo_create(chunk_size, 0, &vmo);
+        if (status != ZX_OK)
             return NULL;
-        _mx_object_set_property(vmo, MX_PROP_NAME,
+        _zx_object_set_property(vmo, ZX_PROP_NAME,
                                 VMO_NAME_DL_ALLOC, sizeof(VMO_NAME_DL_ALLOC));
         uintptr_t chunk;
-        status = _mx_vmar_map(_mx_vmar_root_self(), 0, vmo, 0, chunk_size,
-                              MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+        status = _zx_vmar_map(_zx_vmar_root_self(), 0, vmo, 0, chunk_size,
+                              ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
                               &chunk);
-        _mx_handle_close(vmo);
-        if (status != MX_OK)
+        _zx_handle_close(vmo);
+        if (status != ZX_OK)
             return NULL;
         if (chunk != alloc_limit)
             alloc_ptr = alloc_base = chunk;
@@ -550,10 +550,10 @@
     if (dso->map && dso->map_len) {
         munmap(dso->map, dso->map_len);
     }
-    if (dso->vmar != MX_HANDLE_INVALID) {
-        _mx_vmar_destroy(dso->vmar);
-        _mx_handle_close(dso->vmar);
-        dso->vmar = MX_HANDLE_INVALID;
+    if (dso->vmar != ZX_HANDLE_INVALID) {
+        _zx_vmar_destroy(dso->vmar);
+        _zx_handle_close(dso->vmar);
+        dso->vmar = ZX_HANDLE_INVALID;
     }
 }
 
@@ -664,7 +664,7 @@
     }
 }
 
-__NO_SAFESTACK NO_ASAN static mx_status_t map_library(mx_handle_t vmo,
+__NO_SAFESTACK NO_ASAN static zx_status_t map_library(zx_handle_t vmo,
                                                       struct dso* dso) {
     struct {
         Ehdr ehdr;
@@ -685,8 +685,8 @@
     size_t i;
 
     size_t l;
-    mx_status_t status = _mx_vmo_read(vmo, &buf, 0, sizeof(buf), &l);
-    if (status != MX_OK)
+    zx_status_t status = _zx_vmo_read(vmo, &buf, 0, sizeof(buf), &l);
+    if (status != ZX_OK)
         return status;
     // We cannot support ET_EXEC in the general case, because its fixed
     // addresses might conflict with where the dynamic linker has already
@@ -699,8 +699,8 @@
     if (phsize > sizeof(buf.phdrs))
         goto noexec;
     if (eh->e_phoff + phsize > l) {
-        status = _mx_vmo_read(vmo, buf.phdrs, eh->e_phoff, phsize, &l);
-        if (status != MX_OK)
+        status = _zx_vmo_read(vmo, buf.phdrs, eh->e_phoff, phsize, &l);
+        if (status != ZX_OK)
             goto error;
         if (l != phsize)
             goto noexec;
@@ -752,21 +752,21 @@
     // the new VMAR's handle until relocation has finished, because
     // we need it to adjust page protections for RELRO.
     uintptr_t vmar_base;
-    status = _mx_vmar_allocate(__magenta_vmar_root_self, 0, map_len,
-                               MX_VM_FLAG_CAN_MAP_READ |
-                                   MX_VM_FLAG_CAN_MAP_WRITE |
-                                   MX_VM_FLAG_CAN_MAP_EXECUTE |
-                                   MX_VM_FLAG_CAN_MAP_SPECIFIC,
+    status = _zx_vmar_allocate(__zircon_vmar_root_self, 0, map_len,
+                               ZX_VM_FLAG_CAN_MAP_READ |
+                                   ZX_VM_FLAG_CAN_MAP_WRITE |
+                                   ZX_VM_FLAG_CAN_MAP_EXECUTE |
+                                   ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                &dso->vmar, &vmar_base);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         error("failed to reserve %zu bytes of address space: %d\n",
               map_len, status);
         goto error;
     }
 
-    char vmo_name[MX_MAX_NAME_LEN];
-    if (_mx_object_get_property(vmo, MX_PROP_NAME,
-                                vmo_name, sizeof(vmo_name)) != MX_OK ||
+    char vmo_name[ZX_MAX_NAME_LEN];
+    if (_zx_object_get_property(vmo, ZX_PROP_NAME,
+                                vmo_name, sizeof(vmo_name)) != ZX_OK ||
         vmo_name[0] == '\0')
         memcpy(vmo_name, VMO_NAME_UNKNOWN, sizeof(VMO_NAME_UNKNOWN));
 
@@ -789,12 +789,12 @@
         this_min = ph->p_vaddr & -PAGE_SIZE;
         this_max = (ph->p_vaddr + ph->p_memsz + PAGE_SIZE - 1) & -PAGE_SIZE;
         size_t off_start = ph->p_offset & -PAGE_SIZE;
-        uint32_t mx_flags = MX_VM_FLAG_SPECIFIC;
-        mx_flags |= (ph->p_flags & PF_R) ? MX_VM_FLAG_PERM_READ : 0;
-        mx_flags |= (ph->p_flags & PF_W) ? MX_VM_FLAG_PERM_WRITE : 0;
-        mx_flags |= (ph->p_flags & PF_X) ? MX_VM_FLAG_PERM_EXECUTE : 0;
+        uint32_t zx_flags = ZX_VM_FLAG_SPECIFIC;
+        zx_flags |= (ph->p_flags & PF_R) ? ZX_VM_FLAG_PERM_READ : 0;
+        zx_flags |= (ph->p_flags & PF_W) ? ZX_VM_FLAG_PERM_WRITE : 0;
+        zx_flags |= (ph->p_flags & PF_X) ? ZX_VM_FLAG_PERM_EXECUTE : 0;
         uintptr_t mapaddr = (uintptr_t)base + this_min;
-        mx_handle_t map_vmo = vmo;
+        zx_handle_t map_vmo = vmo;
         size_t map_size = this_max - this_min;
         if (map_size == 0)
             continue;
@@ -808,37 +808,37 @@
                 this_min;
             if (data_size == 0) {
                 // This segment is purely zero-fill.
-                status = _mx_vmo_create(map_size, 0, &map_vmo);
-                if (status == MX_OK) {
-                    char name[MX_MAX_NAME_LEN] = VMO_NAME_PREFIX_BSS;
+                status = _zx_vmo_create(map_size, 0, &map_vmo);
+                if (status == ZX_OK) {
+                    char name[ZX_MAX_NAME_LEN] = VMO_NAME_PREFIX_BSS;
                     memcpy(&name[sizeof(VMO_NAME_PREFIX_BSS) - 1], vmo_name,
-                           MX_MAX_NAME_LEN - sizeof(VMO_NAME_PREFIX_BSS));
-                    _mx_object_set_property(map_vmo, MX_PROP_NAME,
+                           ZX_MAX_NAME_LEN - sizeof(VMO_NAME_PREFIX_BSS));
+                    _zx_object_set_property(map_vmo, ZX_PROP_NAME,
                                             name, strlen(name));
                 }
             } else {
                 // Get a writable (lazy) copy of the portion of the file VMO.
-                status = _mx_vmo_clone(vmo, MX_VMO_CLONE_COPY_ON_WRITE,
+                status = _zx_vmo_clone(vmo, ZX_VMO_CLONE_COPY_ON_WRITE,
                                        off_start, data_size, &map_vmo);
-                if (status == MX_OK && map_size > data_size) {
+                if (status == ZX_OK && map_size > data_size) {
                     // Extend the writable VMO to cover the .bss pages too.
                     // These pages will be zero-filled, not copied from the
                     // file VMO.
-                    status = _mx_vmo_set_size(map_vmo, map_size);
-                    if (status != MX_OK) {
-                        _mx_handle_close(map_vmo);
+                    status = _zx_vmo_set_size(map_vmo, map_size);
+                    if (status != ZX_OK) {
+                        _zx_handle_close(map_vmo);
                         goto error;
                     }
                 }
-                if (status == MX_OK) {
-                    char name[MX_MAX_NAME_LEN] = VMO_NAME_PREFIX_DATA;
+                if (status == ZX_OK) {
+                    char name[ZX_MAX_NAME_LEN] = VMO_NAME_PREFIX_DATA;
                     memcpy(&name[sizeof(VMO_NAME_PREFIX_DATA) - 1], vmo_name,
-                           MX_MAX_NAME_LEN - sizeof(VMO_NAME_PREFIX_DATA));
-                    _mx_object_set_property(map_vmo, MX_PROP_NAME,
+                           ZX_MAX_NAME_LEN - sizeof(VMO_NAME_PREFIX_DATA));
+                    _zx_object_set_property(map_vmo, ZX_PROP_NAME,
                                             name, strlen(name));
                 }
             }
-            if (status != MX_OK)
+            if (status != ZX_OK)
                 goto error;
             off_start = 0;
         } else if (ph->p_memsz > ph->p_filesz) {
@@ -846,11 +846,11 @@
             goto noexec;
         }
 
-        status = _mx_vmar_map(dso->vmar, mapaddr - vmar_base, map_vmo,
-                              off_start, map_size, mx_flags, &mapaddr);
+        status = _zx_vmar_map(dso->vmar, mapaddr - vmar_base, map_vmo,
+                              off_start, map_size, zx_flags, &mapaddr);
         if (map_vmo != vmo)
-            _mx_handle_close(map_vmo);
-        if (status != MX_OK)
+            _zx_handle_close(map_vmo);
+        if (status != ZX_OK)
             goto error;
 
         if (ph->p_memsz > ph->p_filesz) {
@@ -874,15 +874,15 @@
             break;
     }
 
-    return MX_OK;
+    return ZX_OK;
 noexec:
     // We overload this to translate into ENOEXEC later.
-    status = MX_ERR_WRONG_TYPE;
+    status = ZX_ERR_WRONG_TYPE;
 error:
     if (map != MAP_FAILED)
         unmap_library(dso);
-    if (dso->vmar != MX_HANDLE_INVALID)
-        _mx_handle_close(dso->vmar);
+    if (dso->vmar != ZX_HANDLE_INVALID)
+        _zx_handle_close(dso->vmar);
     return status;
 }
 
@@ -1037,16 +1037,16 @@
 }
 
 __NO_SAFESTACK static void trace_load(struct dso* p) {
-    static mx_koid_t pid = MX_KOID_INVALID;
-    if (pid == MX_KOID_INVALID) {
-        mx_info_handle_basic_t process_info;
-        if (_mx_object_get_info(__magenta_process_self,
-                                MX_INFO_HANDLE_BASIC,
+    static zx_koid_t pid = ZX_KOID_INVALID;
+    if (pid == ZX_KOID_INVALID) {
+        zx_info_handle_basic_t process_info;
+        if (_zx_object_get_info(__zircon_process_self,
+                                ZX_INFO_HANDLE_BASIC,
                                 &process_info, sizeof(process_info),
-                                NULL, NULL) == MX_OK) {
+                                NULL, NULL) == ZX_OK) {
             pid = process_info.koid;
         } else {
-            // No point in continually calling mx_object_get_info.
+            // No point in continually calling zx_object_get_info.
             // The first 100 are reserved.
             pid = 1;
         }
@@ -1105,7 +1105,7 @@
     tls_tail = &p->tls;
 }
 
-__NO_SAFESTACK static mx_status_t load_library_vmo(mx_handle_t vmo,
+__NO_SAFESTACK static zx_status_t load_library_vmo(zx_handle_t vmo,
                                                    const char* name,
                                                    int rtld_mode,
                                                    struct dso* needed_by,
@@ -1116,11 +1116,11 @@
 
     if (rtld_mode & RTLD_NOLOAD) {
         *loaded = NULL;
-        return MX_OK;
+        return ZX_OK;
     }
 
-    mx_status_t status = map_library(vmo, &temp_dso);
-    if (status != MX_OK)
+    zx_status_t status = map_library(vmo, &temp_dso);
+    if (status != ZX_OK)
         return status;
 
     decode_dyn(&temp_dso);
@@ -1131,7 +1131,7 @@
         if (p != NULL) {
             unmap_library(&temp_dso);
             *loaded = p;
-            return MX_OK;
+            return ZX_OK;
         }
     }
 
@@ -1141,7 +1141,7 @@
         name = temp_dso.soname;
         if (name == NULL) {
             unmap_library(&temp_dso);
-            return MX_ERR_WRONG_TYPE;
+            return ZX_ERR_WRONG_TYPE;
         }
     }
 
@@ -1172,7 +1172,7 @@
     p = dl_alloc(alloc_size);
     if (!p) {
         unmap_library(&temp_dso);
-        return MX_ERR_NO_MEMORY;
+        return ZX_ERR_NO_MEMORY;
     }
     *p = temp_dso;
     p->refcnt = 1;
@@ -1188,24 +1188,24 @@
     tail = p;
 
     *loaded = p;
-    return MX_OK;
+    return ZX_OK;
 }
 
-__NO_SAFESTACK static mx_status_t load_library(const char* name, int rtld_mode,
+__NO_SAFESTACK static zx_status_t load_library(const char* name, int rtld_mode,
                                                struct dso* needed_by,
                                                struct dso** loaded) {
     if (!*name)
-        return MX_ERR_INVALID_ARGS;
+        return ZX_ERR_INVALID_ARGS;
 
     *loaded = find_library(name);
     if (*loaded != NULL)
-        return MX_OK;
+        return ZX_OK;
 
-    mx_handle_t vmo;
-    mx_status_t status = get_library_vmo(name, &vmo);
-    if (status == MX_OK) {
+    zx_handle_t vmo;
+    zx_status_t status = get_library_vmo(name, &vmo);
+    if (status == ZX_OK) {
         status = load_library_vmo(vmo, name, rtld_mode, needed_by, loaded);
-        _mx_handle_close(vmo);
+        _zx_handle_close(vmo);
     }
 
     return status;
@@ -1222,10 +1222,10 @@
                 continue;
             const char* name = p->strings + p->dynv[i].d_un.d_val;
             struct dso* dep;
-            mx_status_t status = load_library(name, 0, p, &dep);
-            if (status != MX_OK) {
+            zx_status_t status = load_library(name, 0, p, &dep);
+            if (status != ZX_OK) {
                 error("Error loading shared library %s: %s (needed by %s)",
-                      name, _mx_status_get_string(status), p->name);
+                      name, _zx_status_get_string(status), p->name);
                 if (runtime)
                     longjmp(*rtld_fail, 1);
             } else if (deps != NULL) {
@@ -1262,22 +1262,22 @@
         do_relocs(p, laddr(p, dyn[DT_RELA]), dyn[DT_RELASZ], 3);
 
         if (head != &ldso && p->relro_start != p->relro_end) {
-            mx_status_t status =
-                _mx_vmar_protect(p->vmar,
+            zx_status_t status =
+                _zx_vmar_protect(p->vmar,
                                  (uintptr_t)laddr(p, p->relro_start),
                                  p->relro_end - p->relro_start,
-                                 MX_VM_FLAG_PERM_READ);
-            if (status == MX_ERR_BAD_HANDLE &&
-                p == &ldso && p->vmar == MX_HANDLE_INVALID) {
+                                 ZX_VM_FLAG_PERM_READ);
+            if (status == ZX_ERR_BAD_HANDLE &&
+                p == &ldso && p->vmar == ZX_HANDLE_INVALID) {
                 debugmsg("No VMAR_LOADED handle received;"
                          " cannot protect RELRO for %s\n",
                          p->name);
-            } else if (status != MX_OK) {
+            } else if (status != ZX_OK) {
                 error("Error relocating %s: RELRO protection"
                       " %p+%#zx failed: %s",
                       p->name,
                       laddr(p, p->relro_start), p->relro_end - p->relro_start,
-                      _mx_status_get_string(status));
+                      _zx_status_get_string(status));
                 if (runtime)
                     longjmp(*rtld_fail, 1);
             }
@@ -1286,9 +1286,9 @@
         // Hold the VMAR handle only long enough to apply RELRO.
         // Now it's no longer needed and the mappings cannot be
         // changed any more (only unmapped).
-        if (p->vmar != MX_HANDLE_INVALID) {
-            _mx_handle_close(p->vmar);
-            p->vmar = MX_HANDLE_INVALID;
+        if (p->vmar != ZX_HANDLE_INVALID) {
+            _zx_handle_close(p->vmar);
+            p->vmar = ZX_HANDLE_INVALID;
         }
 
         p->relocated = 1;
@@ -1420,13 +1420,13 @@
     return mem + v[1] + DTP_OFFSET;
 }
 
-__NO_SAFESTACK struct pthread* __init_main_thread(mx_handle_t thread_self) {
+__NO_SAFESTACK struct pthread* __init_main_thread(zx_handle_t thread_self) {
     pthread_attr_t attr = DEFAULT_PTHREAD_ATTR;
     attr._a_stacksize = libc.stack_size;
 
-    char thread_self_name[MX_MAX_NAME_LEN];
-    if (_mx_object_get_property(thread_self, MX_PROP_NAME, thread_self_name,
-                                sizeof(thread_self_name)) != MX_OK)
+    char thread_self_name[ZX_MAX_NAME_LEN];
+    if (_zx_object_get_property(thread_self, ZX_PROP_NAME, thread_self_name,
+                                sizeof(thread_self_name)) != ZX_OK)
         strcpy(thread_self_name, "(initial-thread)");
     pthread_t td = __allocate_thread(&attr, thread_self_name, NULL);
     if (td == NULL) {
@@ -1435,11 +1435,11 @@
         _exit(127);
     }
 
-    mx_status_t status = mxr_thread_adopt(thread_self, &td->mxr_thread);
-    if (status != MX_OK)
+    zx_status_t status = zxr_thread_adopt(thread_self, &td->zxr_thread);
+    if (status != ZX_OK)
         __builtin_trap();
 
-    mxr_tp_set(thread_self, pthread_to_tp(td));
+    zxr_tp_set(thread_self, pthread_to_tp(td));
     return td;
 }
 
@@ -1536,7 +1536,7 @@
  * process dependencies and relocations for the main application and
  * transfer control to its entry point. */
 
-__NO_SAFESTACK static void* dls3(mx_handle_t exec_vmo, int argc, char** argv) {
+__NO_SAFESTACK static void* dls3(zx_handle_t exec_vmo, int argc, char** argv) {
     // First load our own dependencies.  Usually this will be just the
     // vDSO, which is already loaded, so there will be nothing to do.
     // In a sanitized build, we'll depend on the sanitizer runtime DSO
@@ -1575,11 +1575,11 @@
             trace_maps = true;
     }
 
-    mx_status_t status = map_library(exec_vmo, &app);
-    _mx_handle_close(exec_vmo);
-    if (status != MX_OK) {
+    zx_status_t status = map_library(exec_vmo, &app);
+    _zx_handle_close(exec_vmo);
+    if (status != ZX_OK) {
         debugmsg("%s: %s: Not a valid dynamic program (%s)\n",
-                 ldso.name, argv[0], _mx_status_get_string(status));
+                 ldso.name, argv[0], _zx_status_get_string(status));
         _exit(1);
     }
 
@@ -1664,10 +1664,10 @@
     debug.base = ldso.base;
     debug.state = 0;
 
-    status = _mx_object_set_property(__magenta_process_self,
-                                     MX_PROP_PROCESS_DEBUG_ADDR,
+    status = _zx_object_set_property(__zircon_process_self,
+                                     ZX_PROP_PROCESS_DEBUG_ADDR,
                                      &_dl_debug_addr, sizeof(_dl_debug_addr));
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         // Bummer. Crashlogger backtraces, debugger sessions, etc. will be
         // problematic, but this isn't fatal.
         // TODO(dje): Is there a way to detect we're here because of being
@@ -1706,89 +1706,89 @@
 }
 
 __NO_SAFESTACK NO_ASAN static dl_start_return_t __dls3(void* start_arg) {
-    mx_handle_t bootstrap = (uintptr_t)start_arg;
+    zx_handle_t bootstrap = (uintptr_t)start_arg;
 
     uint32_t nbytes, nhandles;
-    mx_status_t status = mxr_message_size(bootstrap, &nbytes, &nhandles);
-    if (status != MX_OK) {
-        error("mxr_message_size bootstrap handle %#x failed: %d (%s)",
-              bootstrap, status, _mx_status_get_string(status));
+    zx_status_t status = zxr_message_size(bootstrap, &nbytes, &nhandles);
+    if (status != ZX_OK) {
+        error("zxr_message_size bootstrap handle %#x failed: %d (%s)",
+              bootstrap, status, _zx_status_get_string(status));
         nbytes = nhandles = 0;
     }
 
-    MXR_PROCESSARGS_BUFFER(buffer, nbytes);
-    mx_handle_t handles[nhandles];
-    mx_proc_args_t* procargs;
+    ZXR_PROCESSARGS_BUFFER(buffer, nbytes);
+    zx_handle_t handles[nhandles];
+    zx_proc_args_t* procargs;
     uint32_t* handle_info;
-    if (status == MX_OK)
-        status = mxr_processargs_read(bootstrap, buffer, nbytes,
+    if (status == ZX_OK)
+        status = zxr_processargs_read(bootstrap, buffer, nbytes,
                                       handles, nhandles,
                                       &procargs, &handle_info);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         error("bad message of %u bytes, %u handles"
               " from bootstrap handle %#x: %d (%s)",
               nbytes, nhandles, bootstrap, status,
-              _mx_status_get_string(status));
+              _zx_status_get_string(status));
         nbytes = nhandles = 0;
     }
 
-    mx_handle_t exec_vmo = MX_HANDLE_INVALID;
+    zx_handle_t exec_vmo = ZX_HANDLE_INVALID;
     for (int i = 0; i < nhandles; ++i) {
         switch (PA_HND_TYPE(handle_info[i])) {
         case PA_SVC_LOADER:
-            if (loader_svc != MX_HANDLE_INVALID ||
-                handles[i] == MX_HANDLE_INVALID) {
+            if (loader_svc != ZX_HANDLE_INVALID ||
+                handles[i] == ZX_HANDLE_INVALID) {
                 error("bootstrap message bad LOADER_SVC %#x vs %#x",
                       handles[i], loader_svc);
             }
             loader_svc = handles[i];
             break;
         case PA_VMO_EXECUTABLE:
-            if (exec_vmo != MX_HANDLE_INVALID ||
-                handles[i] == MX_HANDLE_INVALID) {
+            if (exec_vmo != ZX_HANDLE_INVALID ||
+                handles[i] == ZX_HANDLE_INVALID) {
                 error("bootstrap message bad EXEC_VMO %#x vs %#x",
                       handles[i], exec_vmo);
             }
             exec_vmo = handles[i];
             break;
-        case PA_MXIO_LOGGER:
-            if (logger != MX_HANDLE_INVALID ||
-                handles[i] == MX_HANDLE_INVALID) {
-                error("bootstrap message bad MXIO_LOGGER %#x vs %#x",
+        case PA_FDIO_LOGGER:
+            if (logger != ZX_HANDLE_INVALID ||
+                handles[i] == ZX_HANDLE_INVALID) {
+                error("bootstrap message bad FDIO_LOGGER %#x vs %#x",
                       handles[i], logger);
             }
             logger = handles[i];
             break;
         case PA_VMAR_LOADED:
-            if (ldso.vmar != MX_HANDLE_INVALID ||
-                handles[i] == MX_HANDLE_INVALID) {
+            if (ldso.vmar != ZX_HANDLE_INVALID ||
+                handles[i] == ZX_HANDLE_INVALID) {
                 error("bootstrap message bad VMAR_LOADED %#x vs %#x",
                       handles[i], ldso.vmar);
             }
             ldso.vmar = handles[i];
             break;
         case PA_PROC_SELF:
-            __magenta_process_self = handles[i];
+            __zircon_process_self = handles[i];
             break;
         case PA_VMAR_ROOT:
-            __magenta_vmar_root_self = handles[i];
+            __zircon_vmar_root_self = handles[i];
             break;
         default:
-            _mx_handle_close(handles[i]);
+            _zx_handle_close(handles[i]);
             break;
         }
     }
 
-    if (__magenta_process_self == MX_HANDLE_INVALID)
+    if (__zircon_process_self == ZX_HANDLE_INVALID)
         error("bootstrap message bad no proc self");
-    if (__magenta_vmar_root_self == MX_HANDLE_INVALID)
+    if (__zircon_vmar_root_self == ZX_HANDLE_INVALID)
         error("bootstrap message bad no root vmar");
 
     // Unpack the environment strings so dls3 can use getenv.
     char* argv[procargs->args_num + 1];
     char* envp[procargs->environ_num + 1];
-    status = mxr_processargs_strings(buffer, nbytes, argv, envp, NULL);
-    if (status == MX_OK)
+    status = zxr_processargs_strings(buffer, nbytes, argv, envp, NULL);
+    if (status == ZX_OK)
         __environ = envp;
 
     // At this point we can make system calls and have our essential
@@ -1848,20 +1848,20 @@
     }
 }
 
-static void* dlopen_internal(mx_handle_t vmo, const char* file, int mode) {
+static void* dlopen_internal(zx_handle_t vmo, const char* file, int mode) {
     pthread_rwlock_wrlock(&lock);
     __thread_allocation_inhibit();
 
     struct dso* orig_tail = tail;
 
     struct dso* p;
-    mx_status_t status = (vmo != MX_HANDLE_INVALID ?
+    zx_status_t status = (vmo != ZX_HANDLE_INVALID ?
                           load_library_vmo(vmo, file, mode, head, &p) :
                           load_library(file, mode, head, &p));
 
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         error("Error loading shared library %s: %s",
-              file, _mx_status_get_string(status));
+              file, _zx_status_get_string(status));
     fail:
         __thread_allocation_release();
         pthread_rwlock_unlock(&lock);
@@ -1951,19 +1951,19 @@
 void* dlopen(const char* file, int mode) {
     if (!file)
         return head;
-    return dlopen_internal(MX_HANDLE_INVALID, file, mode);
+    return dlopen_internal(ZX_HANDLE_INVALID, file, mode);
 }
 
-void* dlopen_vmo(mx_handle_t vmo, int mode) {
-    if (vmo == MX_HANDLE_INVALID) {
+void* dlopen_vmo(zx_handle_t vmo, int mode) {
+    if (vmo == ZX_HANDLE_INVALID) {
         errno = EINVAL;
         return NULL;
     }
     return dlopen_internal(vmo, NULL, mode);
 }
 
-mx_handle_t dl_set_loader_service(mx_handle_t new_svc) {
-    mx_handle_t old_svc;
+zx_handle_t dl_set_loader_service(zx_handle_t new_svc) {
+    zx_handle_t old_svc;
     pthread_rwlock_wrlock(&lock);
     old_svc = loader_svc;
     loader_svc = new_svc;
@@ -2135,28 +2135,28 @@
 
 // This detects recursion via the error function.
 static bool loader_svc_rpc_in_progress;
-static mx_txid_t loader_svc_txid;
+static zx_txid_t loader_svc_txid;
 
-__NO_SAFESTACK static mx_status_t loader_svc_rpc(uint32_t opcode,
+__NO_SAFESTACK static zx_status_t loader_svc_rpc(uint32_t opcode,
                                                  const void* data, size_t len,
-                                                 mx_handle_t request_handle,
-                                                 mx_handle_t* result) {
+                                                 zx_handle_t request_handle,
+                                                 zx_handle_t* result) {
     // Use a static buffer rather than one on the stack to avoid growing
     // the stack size too much.  Calls to this function are always
     // serialized anyway, so there is no danger of collision.
     static struct {
-        mx_loader_svc_msg_t header;
-        uint8_t data[LOADER_SVC_MSG_MAX - sizeof(mx_loader_svc_msg_t)];
+        zx_loader_svc_msg_t header;
+        uint8_t data[LOADER_SVC_MSG_MAX - sizeof(zx_loader_svc_msg_t)];
     } msg;
 
     loader_svc_rpc_in_progress = true;
 
-    mx_status_t status;
+    zx_status_t status;
     if (len >= sizeof msg.data) {
-        _mx_handle_close(request_handle);
+        _zx_handle_close(request_handle);
         error("message of %zu bytes too large for loader service protocol",
               len);
-        status = MX_ERR_OUT_OF_RANGE;
+        status = ZX_ERR_OUT_OF_RANGE;
         goto out;
     }
 
@@ -2168,14 +2168,14 @@
     if (result != NULL) {
       // Don't return an uninitialized value if the channel call
       // succeeds but doesn't provide any handles.
-      *result = MX_HANDLE_INVALID;
+      *result = ZX_HANDLE_INVALID;
     }
 
-    mx_channel_call_args_t call = {
+    zx_channel_call_args_t call = {
         .wr_bytes = &msg,
         .wr_num_bytes = sizeof(msg.header) + len + 1,
         .wr_handles = &request_handle,
-        .wr_num_handles = request_handle == MX_HANDLE_INVALID ? 0 : 1,
+        .wr_num_handles = request_handle == ZX_HANDLE_INVALID ? 0 : 1,
         .rd_bytes = &msg,
         .rd_num_bytes = sizeof(msg),
         .rd_handles = result,
@@ -2184,18 +2184,18 @@
 
     uint32_t reply_size;
     uint32_t handle_count;
-    mx_status_t read_status = MX_OK;
-    status = _mx_channel_call(loader_svc, 0, MX_TIME_INFINITE,
+    zx_status_t read_status = ZX_OK;
+    status = _zx_channel_call(loader_svc, 0, ZX_TIME_INFINITE,
                               &call, &reply_size, &handle_count,
                               &read_status);
-    if (status != MX_OK) {
-        error("_mx_channel_call of %u bytes to loader service: "
+    if (status != ZX_OK) {
+        error("_zx_channel_call of %u bytes to loader service: "
               "%d (%s), read %d (%s)",
-              call.wr_num_bytes, status, _mx_status_get_string(status),
-              read_status, _mx_status_get_string(read_status));
-        if (status != MX_ERR_CALL_FAILED)
-            _mx_handle_close(request_handle);
-        else if (read_status != MX_OK)
+              call.wr_num_bytes, status, _zx_status_get_string(status),
+              read_status, _zx_status_get_string(read_status));
+        if (status != ZX_ERR_CALL_FAILED)
+            _zx_handle_close(request_handle);
+        else if (read_status != ZX_OK)
             status = read_status;
         goto out;
     }
@@ -2203,26 +2203,26 @@
     if (reply_size != sizeof(msg.header)) {
         error("loader service reply %u bytes != %u",
               reply_size, sizeof(msg.header));
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
         goto out;
     }
     if (msg.header.opcode != LOADER_SVC_OP_STATUS) {
         if (handle_count > 0) {
-            _mx_handle_close(*result);
-            *result = MX_HANDLE_INVALID;
+            _zx_handle_close(*result);
+            *result = ZX_HANDLE_INVALID;
         }
         error("loader service reply opcode %u != %u",
               msg.header.opcode, LOADER_SVC_OP_STATUS);
-        status = MX_ERR_INVALID_ARGS;
+        status = ZX_ERR_INVALID_ARGS;
         goto out;
     }
-    if (msg.header.arg != MX_OK) {
+    if (msg.header.arg != ZX_OK) {
         // |result| is non-null if |handle_count| > 0, because
         // |handle_count| <= |rd_num_handles|.
-        if (handle_count > 0 && *result != MX_HANDLE_INVALID) {
+        if (handle_count > 0 && *result != ZX_HANDLE_INVALID) {
             error("loader service error %d reply contains handle %#x",
                   msg.header.arg, *result);
-            status = MX_ERR_INVALID_ARGS;
+            status = ZX_ERR_INVALID_ARGS;
             goto out;
         }
         status = msg.header.arg;
@@ -2234,35 +2234,35 @@
 }
 
 __NO_SAFESTACK static void loader_svc_config(const char* config) {
-    mx_status_t status = loader_svc_rpc(LOADER_SVC_OP_CONFIG,
+    zx_status_t status = loader_svc_rpc(LOADER_SVC_OP_CONFIG,
                                         config, strlen(config),
-                                        MX_HANDLE_INVALID, NULL);
-    if (status != MX_OK)
+                                        ZX_HANDLE_INVALID, NULL);
+    if (status != ZX_OK)
         debugmsg("LOADER_SVC_OP_CONFIG(%s): %s\n",
-                 config, _mx_status_get_string(status));
+                 config, _zx_status_get_string(status));
 }
 
-__NO_SAFESTACK static mx_status_t get_library_vmo(const char* name,
-                                                  mx_handle_t* result) {
-    if (loader_svc == MX_HANDLE_INVALID) {
+__NO_SAFESTACK static zx_status_t get_library_vmo(const char* name,
+                                                  zx_handle_t* result) {
+    if (loader_svc == ZX_HANDLE_INVALID) {
         error("cannot look up \"%s\" with no loader service", name);
-        return MX_ERR_UNAVAILABLE;
+        return ZX_ERR_UNAVAILABLE;
     }
     return loader_svc_rpc(LOADER_SVC_OP_LOAD_OBJECT, name, strlen(name),
-                          MX_HANDLE_INVALID, result);
+                          ZX_HANDLE_INVALID, result);
 }
 
-__NO_SAFESTACK mx_status_t dl_clone_loader_sevice(mx_handle_t* out) {
-    if (loader_svc == MX_HANDLE_INVALID) {
-        return MX_ERR_UNAVAILABLE;
+__NO_SAFESTACK zx_status_t dl_clone_loader_sevice(zx_handle_t* out) {
+    if (loader_svc == ZX_HANDLE_INVALID) {
+        return ZX_ERR_UNAVAILABLE;
     }
-    mx_handle_t h0, h1;
-    mx_status_t status;
-    if ((status = _mx_channel_create(0, &h0, &h1)) != MX_OK) {
+    zx_handle_t h0, h1;
+    zx_status_t status;
+    if ((status = _zx_channel_create(0, &h0, &h1)) != ZX_OK) {
         return status;
     }
-    if ((status = loader_svc_rpc(LOADER_SVC_OP_CLONE, NULL, 0, h1, NULL)) != MX_OK) {
-        _mx_handle_close(h0);
+    if ((status = loader_svc_rpc(LOADER_SVC_OP_CLONE, NULL, 0, h1, NULL)) != ZX_OK) {
+        _zx_handle_close(h0);
     } else {
         *out = h0;
     }
@@ -2275,17 +2275,17 @@
     if (((const char*)buf)[len - 1] == '\n')
         --len;
 
-    mx_status_t status;
-    if (logger != MX_HANDLE_INVALID)
-        status = _mx_log_write(logger, len, buf, 0);
-    else if (!loader_svc_rpc_in_progress && loader_svc != MX_HANDLE_INVALID)
+    zx_status_t status;
+    if (logger != ZX_HANDLE_INVALID)
+        status = _zx_log_write(logger, len, buf, 0);
+    else if (!loader_svc_rpc_in_progress && loader_svc != ZX_HANDLE_INVALID)
         status = loader_svc_rpc(LOADER_SVC_OP_DEBUG_PRINT, buf, len,
-                                MX_HANDLE_INVALID, NULL);
+                                ZX_HANDLE_INVALID, NULL);
     else {
-        int n = _mx_debug_write(buf, len);
-        status = n < 0 ? n : MX_OK;
+        int n = _zx_debug_write(buf, len);
+        status = n < 0 ? n : ZX_OK;
     }
-    if (status != MX_OK)
+    if (status != ZX_OK)
         __builtin_trap();
 }
 
@@ -2338,30 +2338,30 @@
 }
 
 // We piggy-back on the loader service to publish data from sanitizers.
-void __sanitizer_publish_data(const char* sink_name, mx_handle_t vmo) {
+void __sanitizer_publish_data(const char* sink_name, zx_handle_t vmo) {
     pthread_rwlock_rdlock(&lock);
-    mx_status_t status = loader_svc_rpc(LOADER_SVC_OP_PUBLISH_DATA_SINK,
+    zx_status_t status = loader_svc_rpc(LOADER_SVC_OP_PUBLISH_DATA_SINK,
                                         sink_name, strlen(sink_name),
                                         vmo, NULL);
-    if (status != MX_OK) {
+    if (status != ZX_OK) {
         // TODO(mcgrathr): Send this whereever sanitizer logging goes.
         debugmsg("Failed to publish data sink \"%s\" (%s): %s\n",
-                 sink_name, _mx_status_get_string(status), dlerror());
+                 sink_name, _zx_status_get_string(status), dlerror());
     }
     pthread_rwlock_unlock(&lock);
 }
 
 // ... and to get configuration files for them.
-mx_status_t __sanitizer_get_configuration(const char* name,
-                                          mx_handle_t *out_vmo) {
+zx_status_t __sanitizer_get_configuration(const char* name,
+                                          zx_handle_t *out_vmo) {
     pthread_rwlock_rdlock(&lock);
-    mx_status_t status = loader_svc_rpc(LOADER_SVC_OP_LOAD_DEBUG_CONFIG,
+    zx_status_t status = loader_svc_rpc(LOADER_SVC_OP_LOAD_DEBUG_CONFIG,
                                         name, strlen(name),
-                                        MX_HANDLE_INVALID, out_vmo);
-    if (status != MX_OK) {
+                                        ZX_HANDLE_INVALID, out_vmo);
+    if (status != ZX_OK) {
         // TODO(mcgrathr): Send this whereever sanitizer logging goes.
         debugmsg("Failed to get configuration file \"%s\" (%s): %s\n",
-                 name, _mx_status_get_string(status), dlerror());
+                 name, _zx_status_get_string(status), dlerror());
     }
     pthread_rwlock_unlock(&lock);
     return status;
diff --git a/third_party/ulib/musl/magenta/internal.c b/third_party/ulib/musl/magenta/internal.c
deleted file mode 100644
index 136ee63..0000000
--- a/third_party/ulib/musl/magenta/internal.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "magenta_impl.h"
-
-#undef _mx_process_self
-#undef _mx_vmar_root_self
-#undef _mx_job_default
-
-#include <magenta/process.h>
-
-// TODO: add ATTR_LIBC_VISIBILITY to all 3 exports as soon as Rust no longer depends on these
-mx_handle_t __magenta_process_self;
-mx_handle_t __magenta_vmar_root_self;
-mx_handle_t __magenta_job_default;
-
-mx_handle_t _mx_process_self(void) {
-    return __magenta_process_self;
-}
-__typeof(mx_process_self) mx_process_self
-    __attribute__((weak, alias("_mx_process_self")));
-
-mx_handle_t _mx_vmar_root_self(void) {
-    return __magenta_vmar_root_self;
-}
-__typeof(mx_vmar_root_self) mx_vmar_root_self
-    __attribute__((weak, alias("_mx_vmar_root_self")));
-
-mx_handle_t _mx_job_default(void) {
-    return __magenta_job_default;
-}
-__typeof(mx_job_default) mx_job_default
-    __attribute__((weak, alias("_mx_job_default")));
diff --git a/third_party/ulib/musl/magenta/thrd_get_mx_handle.c b/third_party/ulib/musl/magenta/thrd_get_mx_handle.c
deleted file mode 100644
index b369360..0000000
--- a/third_party/ulib/musl/magenta/thrd_get_mx_handle.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <magenta/process.h>
-#include <magenta/threads.h>
-
-#include <runtime/thread.h>
-
-#include "pthread_impl.h"
-
-mx_handle_t thrd_get_mx_handle(thrd_t t) {
-    return mxr_thread_get_handle(&t->mxr_thread);
-}
-
-mx_handle_t _mx_thread_self(void) {
-    return mxr_thread_get_handle(&__pthread_self()->mxr_thread);
-}
-__typeof(mx_thread_self) mx_thread_self
-    __attribute__((weak, alias("_mx_thread_self")));
diff --git a/third_party/ulib/musl/musl-rules.mk b/third_party/ulib/musl/musl-rules.mk
index 69f271f..5aa6eb1 100644
--- a/third_party/ulib/musl/musl-rules.mk
+++ b/third_party/ulib/musl/musl-rules.mk
@@ -50,9 +50,9 @@
 LOCAL_CFLAGS += -ffreestanding
 
 LOCAL_SRCS := \
-    $(LOCAL_DIR)/magenta/get_startup_handle.c \
-    $(LOCAL_DIR)/magenta/internal.c \
-    $(LOCAL_DIR)/magenta/thrd_get_mx_handle.c \
+    $(LOCAL_DIR)/zircon/get_startup_handle.c \
+    $(LOCAL_DIR)/zircon/internal.c \
+    $(LOCAL_DIR)/zircon/thrd_get_zx_handle.c \
     $(LOCAL_DIR)/pthread/allocate.c \
     $(LOCAL_DIR)/pthread/pthread_atfork.c \
     $(LOCAL_DIR)/pthread/pthread_attr_destroy.c \
@@ -1098,7 +1098,7 @@
 MODULE_CFLAGS := $(LOCAL_CFLAGS)
 MODULE_SRCS := $(LOCAL_SRCS)
 
-MODULE_LIBS := system/ulib/magenta
+MODULE_LIBS := system/ulib/zircon
 MODULE_STATIC_LIBS := system/ulib/runtime
 
 # At link time and in DT_SONAME, musl is known as libc.so.  But the
diff --git a/third_party/ulib/musl/pthread/allocate.c b/third_party/ulib/musl/pthread/allocate.c
index bb44c1d..618cf67 100644
--- a/third_party/ulib/musl/pthread/allocate.c
+++ b/third_party/ulib/musl/pthread/allocate.c
@@ -1,9 +1,9 @@
 #include "libc.h"
-#include "magenta_impl.h"
+#include "zircon_impl.h"
 #include "pthread_impl.h"
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <stddef.h>
 #include <string.h>
 
@@ -66,32 +66,32 @@
     return td;
 }
 
-__NO_SAFESTACK static bool map_block(mx_handle_t parent_vmar,
-                                     mx_handle_t vmo, size_t vmo_offset,
+__NO_SAFESTACK static bool map_block(zx_handle_t parent_vmar,
+                                     zx_handle_t vmo, size_t vmo_offset,
                                      size_t size, size_t before, size_t after,
                                      struct iovec* mapping,
                                      struct iovec* region) {
     region->iov_len = before + size + after;
-    mx_handle_t vmar;
+    zx_handle_t vmar;
     uintptr_t addr;
-    mx_status_t status = _mx_vmar_allocate(parent_vmar, 0, region->iov_len,
-                                           MX_VM_FLAG_CAN_MAP_READ |
-                                           MX_VM_FLAG_CAN_MAP_WRITE |
-                                           MX_VM_FLAG_CAN_MAP_SPECIFIC,
+    zx_status_t status = _zx_vmar_allocate(parent_vmar, 0, region->iov_len,
+                                           ZX_VM_FLAG_CAN_MAP_READ |
+                                           ZX_VM_FLAG_CAN_MAP_WRITE |
+                                           ZX_VM_FLAG_CAN_MAP_SPECIFIC,
                                            &vmar, &addr);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         return true;
     region->iov_base = (void*)addr;
-    status = _mx_vmar_map(vmar, before, vmo, vmo_offset, size,
-                          MX_VM_FLAG_PERM_READ |
-                          MX_VM_FLAG_PERM_WRITE |
-                          MX_VM_FLAG_SPECIFIC, &addr);
-    if (status != MX_OK)
-        _mx_vmar_destroy(vmar);
-    _mx_handle_close(vmar);
+    status = _zx_vmar_map(vmar, before, vmo, vmo_offset, size,
+                          ZX_VM_FLAG_PERM_READ |
+                          ZX_VM_FLAG_PERM_WRITE |
+                          ZX_VM_FLAG_SPECIFIC, &addr);
+    if (status != ZX_OK)
+        _zx_vmar_destroy(vmar);
+    _zx_handle_close(vmar);
     mapping->iov_base = (void*)addr;
     mapping->iov_len = size;
-    return status != MX_OK;
+    return status != ZX_OK;
 }
 
 // This allocates all the per-thread memory for a new thread about to
@@ -117,7 +117,7 @@
 __NO_SAFESTACK pthread_t __allocate_thread(
     const pthread_attr_t* attr,
     const char* thread_name,
-    char vmo_name[MX_MAX_NAME_LEN]) {
+    char vmo_name[ZX_MAX_NAME_LEN]) {
     thread_allocation_acquire();
 
     const size_t guard_size =
@@ -128,17 +128,17 @@
     const size_t tcb_size = round_up_to_page(tls_size);
 
     const size_t vmo_size = tcb_size + stack_size * 2;
-    mx_handle_t vmo;
-    mx_status_t status = _mx_vmo_create(vmo_size, 0, &vmo);
-    if (status != MX_OK) {
+    zx_handle_t vmo;
+    zx_status_t status = _zx_vmo_create(vmo_size, 0, &vmo);
+    if (status != ZX_OK) {
         __thread_allocation_release();
         return NULL;
     }
     struct iovec tcb, tcb_region;
-    if (map_block(_mx_vmar_root_self(), vmo, 0, tcb_size, PAGE_SIZE, PAGE_SIZE,
+    if (map_block(_zx_vmar_root_self(), vmo, 0, tcb_size, PAGE_SIZE, PAGE_SIZE,
                   &tcb, &tcb_region)) {
         __thread_allocation_release();
-        _mx_handle_close(vmo);
+        _zx_handle_close(vmo);
         return NULL;
     }
 
@@ -155,37 +155,37 @@
         // the pthread_t value (and the TLS size if that fits too), but
         // don't use a truncated value since that would be confusing to
         // interpret.
-        if (snprintf(vmo_name, MX_MAX_NAME_LEN, "%s:%p/TLS=%#zx",
-                     thread_name, td, tls_size) < MX_MAX_NAME_LEN ||
-            snprintf(vmo_name, MX_MAX_NAME_LEN, "%s:%p",
-                     thread_name, td) < MX_MAX_NAME_LEN)
+        if (snprintf(vmo_name, ZX_MAX_NAME_LEN, "%s:%p/TLS=%#zx",
+                     thread_name, td, tls_size) < ZX_MAX_NAME_LEN ||
+            snprintf(vmo_name, ZX_MAX_NAME_LEN, "%s:%p",
+                     thread_name, td) < ZX_MAX_NAME_LEN)
             thread_name = vmo_name;
     }
-    _mx_object_set_property(vmo, MX_PROP_NAME,
+    _zx_object_set_property(vmo, ZX_PROP_NAME,
                             thread_name, strlen(thread_name));
 
-    if (map_block(_mx_vmar_root_self(), vmo,
+    if (map_block(_zx_vmar_root_self(), vmo,
                   tcb_size, stack_size, guard_size, 0,
                   &td->safe_stack, &td->safe_stack_region)) {
-        _mx_vmar_unmap(_mx_vmar_root_self(),
+        _zx_vmar_unmap(_zx_vmar_root_self(),
                        (uintptr_t)tcb_region.iov_base, tcb_region.iov_len);
-        _mx_handle_close(vmo);
+        _zx_handle_close(vmo);
         return NULL;
     }
 
-    if (map_block(_mx_vmar_root_self(), vmo,
+    if (map_block(_zx_vmar_root_self(), vmo,
                   tcb_size + stack_size, stack_size, guard_size, 0,
                   &td->unsafe_stack, &td->unsafe_stack_region)) {
-        _mx_vmar_unmap(_mx_vmar_root_self(),
+        _zx_vmar_unmap(_zx_vmar_root_self(),
                        (uintptr_t)td->safe_stack_region.iov_base,
                        td->safe_stack_region.iov_len);
-        _mx_vmar_unmap(_mx_vmar_root_self(),
+        _zx_vmar_unmap(_zx_vmar_root_self(),
                        (uintptr_t)tcb_region.iov_base, tcb_region.iov_len);
-        _mx_handle_close(vmo);
+        _zx_handle_close(vmo);
         return NULL;
     }
 
-    _mx_handle_close(vmo);
+    _zx_handle_close(vmo);
     td->tcb_region = tcb_region;
     td->locale = &libc.global_locale;
     td->head.tp = (uintptr_t)pthread_to_tp(td);
diff --git a/third_party/ulib/musl/pthread/pthread_barrier_wait.c b/third_party/ulib/musl/pthread/pthread_barrier_wait.c
index e97a319..1ef547b 100644
--- a/third_party/ulib/musl/pthread/pthread_barrier_wait.c
+++ b/third_party/ulib/musl/pthread/pthread_barrier_wait.c
@@ -38,7 +38,7 @@
             a_spin();
         atomic_fetch_add(&inst->finished, 1);
         while (atomic_load(&inst->finished) == 1)
-            _mx_futex_wait(&inst->finished, 1, MX_TIME_INFINITE);
+            _zx_futex_wait(&inst->finished, 1, ZX_TIME_INFINITE);
         return PTHREAD_BARRIER_SERIAL_THREAD;
     }
 
diff --git a/third_party/ulib/musl/pthread/pthread_cond_timedwait.c b/third_party/ulib/musl/pthread/pthread_cond_timedwait.c
index b52532e..4ab016a 100644
--- a/third_party/ulib/musl/pthread/pthread_cond_timedwait.c
+++ b/third_party/ulib/musl/pthread/pthread_cond_timedwait.c
@@ -70,7 +70,7 @@
      *     pthread_cond_timedwait() in another thread).
      *  3) After a timeout.
      *  4) On Linux, interrupted by an asynchronous signal.  This does
-     *     not apply on Magenta. */
+     *     not apply on Zircon. */
     do
         e = __timedwait(fut, seq, clock, ts);
     while (*fut == seq && !e);
diff --git a/third_party/ulib/musl/pthread/pthread_create.c b/third_party/ulib/musl/pthread/pthread_create.c
index 32f7153..089d43b 100644
--- a/third_party/ulib/musl/pthread/pthread_create.c
+++ b/third_party/ulib/musl/pthread/pthread_create.c
@@ -2,11 +2,11 @@
 #include "futex_impl.h"
 #include "libc.h"
 #include "pthread_impl.h"
-#include "magenta_impl.h"
+#include "zircon_impl.h"
 #include "stdio_impl.h"
 
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <pthread.h>
 #include <runtime/thread.h>
 #include <runtime/tls.h>
@@ -17,7 +17,7 @@
 
 static inline pthread_t prestart(void* arg) {
     pthread_t self = arg;
-    mxr_tp_set(mxr_thread_get_handle(&self->mxr_thread), pthread_to_tp(self));
+    zxr_tp_set(zxr_thread_get_handle(&self->zxr_thread), pthread_to_tp(self));
     __sanitizer_thread_start_hook(self->sanitizer_hook, (thrd_t)self);
     return self;
 }
@@ -34,7 +34,7 @@
 }
 
 static void deallocate_region(const struct iovec* region) {
-    _mx_vmar_unmap(_mx_vmar_root_self(),
+    _zx_vmar_unmap(_zx_vmar_root_self(),
                    (uintptr_t)region->iov_base, region->iov_len);
 }
 
@@ -46,7 +46,7 @@
     if (attr._a_stackaddr != NULL)
         return ENOTSUP;
 
-    char thread_name[MX_MAX_NAME_LEN];
+    char thread_name[ZX_MAX_NAME_LEN];
     pthread_t new = __allocate_thread(&attr,
                                       attr.__name != NULL ? attr.__name :
                                       attr.__c11 ? "thrd_t" : "pthread_t",
@@ -55,13 +55,13 @@
         return EAGAIN;
 
     const char* name = attr.__name != NULL ? attr.__name : thread_name;
-    mx_status_t status =
-        mxr_thread_create(_mx_process_self(), name, attr._a_detach,
-                          &new->mxr_thread);
-    if (status != MX_OK)
+    zx_status_t status =
+        zxr_thread_create(_zx_process_self(), name, attr._a_detach,
+                          &new->zxr_thread);
+    if (status != ZX_OK)
         goto fail_after_alloc;
 
-    mxr_thread_entry_t start = attr.__c11 ? start_c11 : start_pthread;
+    zxr_thread_entry_t start = attr.__c11 ? start_c11 : start_pthread;
 
     new->start = entry;
     new->start_arg = arg;
@@ -82,11 +82,11 @@
     // This will (hopefully) start the new thread. It could instantly
     // run to completion and deallocate it self. As such, we can't
     // access new->anything after this point.
-    status = mxr_thread_start(&new->mxr_thread,
+    status = zxr_thread_start(&new->zxr_thread,
                               (uintptr_t)new->safe_stack.iov_base,
                               new->safe_stack.iov_len, start, new);
 
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         __sanitizer_thread_create_hook(sanitizer_hook,
                                        (thrd_t)new, thrd_success);
         return 0;
@@ -97,13 +97,13 @@
 
     __sanitizer_thread_create_hook(
         sanitizer_hook, (thrd_t)new,
-        status == MX_ERR_ACCESS_DENIED ? thrd_error : thrd_nomem);
+        status == ZX_ERR_ACCESS_DENIED ? thrd_error : thrd_nomem);
 
 fail_after_alloc:
     deallocate_region(&new->safe_stack_region);
     deallocate_region(&new->unsafe_stack_region);
     deallocate_region(&new->tcb_region);
-    return status == MX_ERR_ACCESS_DENIED ? EPERM : EAGAIN;
+    return status == ZX_ERR_ACCESS_DENIED ? EPERM : EAGAIN;
 }
 
 static _Noreturn void final_exit(pthread_t self)
@@ -115,7 +115,7 @@
 
     // This deallocates the TCB region too for the detached case.
     // If not detached, pthread_join will deallocate it.
-    mxr_thread_exit_unmap_if_detached(&self->mxr_thread, _mx_vmar_root_self(),
+    zxr_thread_exit_unmap_if_detached(&self->zxr_thread, _zx_vmar_root_self(),
                                       (uintptr_t)self->tcb_region.iov_base,
                                       self->tcb_region.iov_len);
 }
diff --git a/third_party/ulib/musl/pthread/pthread_detach.c b/third_party/ulib/musl/pthread/pthread_detach.c
index 92367d9..b66e230 100644
--- a/third_party/ulib/musl/pthread/pthread_detach.c
+++ b/third_party/ulib/musl/pthread/pthread_detach.c
@@ -1,15 +1,15 @@
 #include "pthread_impl.h"
-#include "magenta_impl.h"
-#include <magenta/process.h>
+#include "zircon_impl.h"
+#include <zircon/process.h>
 #include <threads.h>
 
 int __pthread_detach(pthread_t t) {
-    switch (mxr_thread_detach(&t->mxr_thread)) {
-    case MX_OK:
+    switch (zxr_thread_detach(&t->zxr_thread)) {
+    case ZX_OK:
         return 0;
-    case MX_ERR_BAD_STATE:
+    case ZX_ERR_BAD_STATE:
         // It already died before it knew to deallocate itself.
-        _mx_vmar_unmap(_mx_vmar_root_self(),
+        _zx_vmar_unmap(_zx_vmar_root_self(),
                        (uintptr_t)t->tcb_region.iov_base,
                        t->tcb_region.iov_len);
         return 0;
diff --git a/third_party/ulib/musl/pthread/pthread_getattr_np.c b/third_party/ulib/musl/pthread/pthread_getattr_np.c
index 1a7a11b..c619d49 100644
--- a/third_party/ulib/musl/pthread/pthread_getattr_np.c
+++ b/third_party/ulib/musl/pthread/pthread_getattr_np.c
@@ -5,7 +5,7 @@
 
 int pthread_getattr_np(pthread_t t, pthread_attr_t* a) {
     *a = (pthread_attr_t){};
-    a->_a_detach = mxr_thread_detached(&t->mxr_thread);
+    a->_a_detach = zxr_thread_detached(&t->zxr_thread);
     a->_a_stackaddr = t->safe_stack.iov_base;
     a->_a_stacksize = t->safe_stack.iov_len;
     return 0;
diff --git a/third_party/ulib/musl/pthread/pthread_join.c b/third_party/ulib/musl/pthread/pthread_join.c
index 9cea107..11d76e3 100644
--- a/third_party/ulib/musl/pthread/pthread_join.c
+++ b/third_party/ulib/musl/pthread/pthread_join.c
@@ -1,12 +1,12 @@
 #include "pthread_impl.h"
-#include <magenta/process.h>
+#include <zircon/process.h>
 
 int __pthread_join(pthread_t t, void** res) {
-    switch (mxr_thread_join(&t->mxr_thread)) {
-    case MX_OK:
+    switch (zxr_thread_join(&t->zxr_thread)) {
+    case ZX_OK:
         if (res)
             *res = t->result;
-        _mx_vmar_unmap(_mx_vmar_root_self(),
+        _zx_vmar_unmap(_zx_vmar_root_self(),
                        (uintptr_t)t->tcb_region.iov_base,
                        t->tcb_region.iov_len);
         return 0;
diff --git a/third_party/ulib/musl/sanitizers/__asan_early_init.c b/third_party/ulib/musl/sanitizers/__asan_early_init.c
index 26fdf32..1f9e827 100644
--- a/third_party/ulib/musl/sanitizers/__asan_early_init.c
+++ b/third_party/ulib/musl/sanitizers/__asan_early_init.c
@@ -3,12 +3,12 @@
 // found in the LICENSE file.
 
 #include "asan_impl.h"
-#include "magenta_impl.h"
+#include "zircon_impl.h"
 #include "libc.h"
 
 #include <limits.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 
 #define ASAN_SHADOW_SHIFT 3
 
@@ -19,11 +19,11 @@
 static sanitizer_shadow_bounds_t shadow_bounds ATTR_RELRO;
 
 __NO_SAFESTACK NO_ASAN void __asan_early_init(void) {
-    mx_info_vmar_t info;
-    mx_status_t status = _mx_object_get_info(__magenta_vmar_root_self,
-                                             MX_INFO_VMAR, &info, sizeof(info),
+    zx_info_vmar_t info;
+    zx_status_t status = _zx_object_get_info(__zircon_vmar_root_self,
+                                             ZX_INFO_VMAR, &info, sizeof(info),
                                              NULL, NULL);
-    if (status != MX_OK)
+    if (status != ZX_OK)
         __builtin_trap();
 
     // Find the top of the accessible address space.
@@ -45,14 +45,14 @@
     // The VMAR reserved for the shadow covers the region from the
     // lowest permitted mapping address (info.base) up to the notional
     // top of the shadow (shadow_virtual_size).
-    mx_handle_t shadow_vmar;
+    zx_handle_t shadow_vmar;
     uintptr_t shadow_addr;
-    status = _mx_vmar_allocate(
-        __magenta_vmar_root_self, 0, shadow_virtual_size - info.base,
-        MX_VM_FLAG_SPECIFIC | MX_VM_FLAG_CAN_MAP_SPECIFIC |
-        MX_VM_FLAG_CAN_MAP_READ | MX_VM_FLAG_CAN_MAP_WRITE,
+    status = _zx_vmar_allocate(
+        __zircon_vmar_root_self, 0, shadow_virtual_size - info.base,
+        ZX_VM_FLAG_SPECIFIC | ZX_VM_FLAG_CAN_MAP_SPECIFIC |
+        ZX_VM_FLAG_CAN_MAP_READ | ZX_VM_FLAG_CAN_MAP_WRITE,
         &shadow_vmar, &shadow_addr);
-    if (status != MX_OK || shadow_addr != info.base)
+    if (status != ZX_OK || shadow_addr != info.base)
         __builtin_trap();
 
     // The actual shadow that needs to be mapped starts at the top of
@@ -64,28 +64,28 @@
         shadow_shadow_size;
 
     // Now we're ready to allocate and map the actual shadow.
-    mx_handle_t vmo;
-    status = _mx_vmo_create(shadow_used_size, 0, &vmo);
-    if (status != MX_OK)
+    zx_handle_t vmo;
+    status = _zx_vmo_create(shadow_used_size, 0, &vmo);
+    if (status != ZX_OK)
         __builtin_trap();
-    _mx_object_set_property(vmo, MX_PROP_NAME,
+    _zx_object_set_property(vmo, ZX_PROP_NAME,
                             SHADOW_VMO_NAME, sizeof(SHADOW_VMO_NAME) - 1);
 
-    status = _mx_vmar_map(
+    status = _zx_vmar_map(
         shadow_vmar, shadow_shadow_size - info.base, vmo, 0, shadow_used_size,
-        MX_VM_FLAG_SPECIFIC | MX_VM_FLAG_PERM_READ | MX_VM_FLAG_PERM_WRITE,
+        ZX_VM_FLAG_SPECIFIC | ZX_VM_FLAG_PERM_READ | ZX_VM_FLAG_PERM_WRITE,
         &shadow_addr);
-    if (status != MX_OK || shadow_addr != shadow_shadow_size)
+    if (status != ZX_OK || shadow_addr != shadow_shadow_size)
         __builtin_trap();
 
-    status = _mx_handle_close(vmo);
-    if (status != MX_OK)
+    status = _zx_handle_close(vmo);
+    if (status != ZX_OK)
         __builtin_trap();
 
     // Drop the VMAR handle.
     // The mappings in the shadow region can never be changed.
-    status = _mx_handle_close(shadow_vmar);
-    if (status != MX_OK)
+    status = _zx_handle_close(shadow_vmar);
+    if (status != ZX_OK)
         __builtin_trap();
 
     // Store the values to be exported to the sanitizer runtime library.
diff --git a/third_party/ulib/musl/sanitizers/log.c b/third_party/ulib/musl/sanitizers/log.c
index a2ae32c..f231342 100644
--- a/third_party/ulib/musl/sanitizers/log.c
+++ b/third_party/ulib/musl/sanitizers/log.c
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <magenta/sanitizer.h>
+#include <zircon/sanitizer.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/log.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/log.h>
 #include <stddef.h>
 #include <threads.h>
 
@@ -13,15 +13,15 @@
 
 // TODO(mcgrathr): For now, just use kernel log channels.
 // They do the timestamp, process/thread tagging for us.
-static mx_handle_t sanitizer_log;
+static zx_handle_t sanitizer_log;
 static once_flag once = ONCE_FLAG_INIT;
 static void create_sanitizer_log(void) {
-    mx_status_t status = _mx_log_create(0, &sanitizer_log);
-    if (status != MX_OK)
+    zx_status_t status = _zx_log_create(0, &sanitizer_log);
+    if (status != ZX_OK)
         __builtin_trap();
 }
 
-#define MAX_DATA (MX_LOG_RECORD_MAX - offsetof(mx_log_record_t, data))
+#define MAX_DATA (ZX_LOG_RECORD_MAX - offsetof(zx_log_record_t, data))
 
 void __sanitizer_log_write(const char *buffer, size_t len) {
     call_once(&once, &create_sanitizer_log);
@@ -30,8 +30,8 @@
 
     while (len > 0) {
         size_t chunk = len < MAX_DATA ? len : MAX_DATA;
-        mx_status_t status = _mx_log_write(sanitizer_log, chunk, buffer, 0);
-        if (status != MX_OK)
+        zx_status_t status = _zx_log_write(sanitizer_log, chunk, buffer, 0);
+        if (status != ZX_OK)
             __builtin_trap();
         buffer += chunk;
         len -= chunk;
diff --git a/third_party/ulib/musl/src/conf/sysconf.c b/third_party/ulib/musl/src/conf/sysconf.c
index 84284b8..b96601b 100644
--- a/third_party/ulib/musl/src/conf/sysconf.c
+++ b/third_party/ulib/musl/src/conf/sysconf.c
@@ -5,7 +5,7 @@
 #include <sys/resource.h>
 #include <unistd.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #define JT(x) (-256 | (x))
 #define VER JT(1)
@@ -189,11 +189,11 @@
         return SEM_VALUE_MAX;
     case JT_NPROCESSORS_CONF & 255:
     case JT_NPROCESSORS_ONLN & 255:
-        return _mx_system_get_num_cpus();
+        return _zx_system_get_num_cpus();
     case JT_PHYS_PAGES & 255:
-        return _mx_system_get_physmem() / PAGE_SIZE;
+        return _zx_system_get_physmem() / PAGE_SIZE;
     case JT_AVPHYS_PAGES & 255:
-        // TODO(kulakowski) Ask magenta for physical memory allocation
+        // TODO(kulakowski) Ask zircon for physical memory allocation
 
         // Note that on Linux the calculation looks like this
         // depending on whether _SC_PHYS_PAGES was asked for or not:
diff --git a/third_party/ulib/musl/src/env/__libc_start_main.c b/third_party/ulib/musl/src/env/__libc_start_main.c
index 03b3a19..81deb3a 100644
--- a/third_party/ulib/musl/src/env/__libc_start_main.c
+++ b/third_party/ulib/musl/src/env/__libc_start_main.c
@@ -1,13 +1,13 @@
 #include "libc.h"
-#include "magenta_impl.h"
+#include "zircon_impl.h"
 #include "pthread_impl.h"
 #include "setjmp_impl.h"
 #include <elf.h>
 #include <stdatomic.h>
 #include <string.h>
 
-#include <magenta/sanitizer.h>
-#include <magenta/syscalls.h>
+#include <zircon/sanitizer.h>
+#include <zircon/syscalls.h>
 #include <runtime/message.h>
 #include <runtime/processargs.h>
 #include <runtime/thread.h>
@@ -15,7 +15,7 @@
 // Hook for extension libraries to init. Extensions must zero out
 // handle[i] and handle_info[i] for any handles they claim.
 void __libc_extensions_init(uint32_t handle_count,
-                            mx_handle_t handle[],
+                            zx_handle_t handle[],
                             uint32_t handle_info[],
                             uint32_t name_count,
                             char** names) __attribute__((weak));
@@ -24,7 +24,7 @@
     uint32_t argc, nhandles, namec;
     char** argv;
     char** names;
-    mx_handle_t* handles;
+    zx_handle_t* handles;
     uint32_t* handle_info;
     int (*main)(int, char**, char**);
     pthread_t td;
@@ -45,7 +45,7 @@
         __libc_extensions_init(p->nhandles, p->handles, p->handle_info,
                                p->namec, p->names);
 
-    // Give any unclaimed handles to mx_get_startup_handle(). This function
+    // Give any unclaimed handles to zx_get_startup_handle(). This function
     // takes ownership of the data, but not the memory: it assumes that the
     // arrays are valid as long as the process is alive.
     __libc_startup_handles_init(p->nhandles, p->handles, p->handle_info);
@@ -69,9 +69,9 @@
         uintptr_t stack_guard;
         struct setjmp_manglers setjmp_manglers;
     } randoms;
-    static_assert(sizeof(randoms) <= MX_CPRNG_DRAW_MAX_LEN, "");
-    mx_status_t status = _mx_cprng_draw(&randoms, sizeof(randoms), &actual);
-    if (status != MX_OK || actual != sizeof(randoms))
+    static_assert(sizeof(randoms) <= ZX_CPRNG_DRAW_MAX_LEN, "");
+    zx_status_t status = _zx_cprng_draw(&randoms, sizeof(randoms), &actual);
+    if (status != ZX_OK || actual != sizeof(randoms))
         __builtin_trap();
     __stack_chk_guard = randoms.stack_guard;
     __setjmp_manglers = randoms.setjmp_manglers;
@@ -82,25 +82,25 @@
     __asm__("# keepalive %0" :: "m"(randoms));
 
     // extract process startup information from channel in arg
-    mx_handle_t bootstrap = (uintptr_t)arg;
+    zx_handle_t bootstrap = (uintptr_t)arg;
 
     struct start_params p = { .main = main };
     uint32_t nbytes;
-    status = mxr_message_size(bootstrap, &nbytes, &p.nhandles);
-    if (status != MX_OK)
+    status = zxr_message_size(bootstrap, &nbytes, &p.nhandles);
+    if (status != ZX_OK)
         nbytes = p.nhandles = 0;
 
-    MXR_PROCESSARGS_BUFFER(buffer, nbytes);
-    mx_handle_t handles[p.nhandles];
+    ZXR_PROCESSARGS_BUFFER(buffer, nbytes);
+    zx_handle_t handles[p.nhandles];
     p.handles = handles;
-    mx_proc_args_t* procargs = NULL;
-    if (status == MX_OK)
-        status = mxr_processargs_read(bootstrap, buffer, nbytes,
+    zx_proc_args_t* procargs = NULL;
+    if (status == ZX_OK)
+        status = zxr_processargs_read(bootstrap, buffer, nbytes,
                                       handles, p.nhandles,
                                       &procargs, &p.handle_info);
 
     uint32_t envc = 0;
-    if (status == MX_OK) {
+    if (status == ZX_OK) {
         p.argc = procargs->args_num;
         envc = procargs->environ_num;
         p.namec = procargs->names_num;
@@ -122,16 +122,16 @@
     char* names[p.namec + 1];
     p.names = names;
 
-    if (status == MX_OK)
-        status = mxr_processargs_strings(buffer, nbytes, p.argv, __environ, p.names);
-    if (status != MX_OK) {
+    if (status == ZX_OK)
+        status = zxr_processargs_strings(buffer, nbytes, p.argv, __environ, p.names);
+    if (status != ZX_OK) {
         p.argc = 0;
         p.argv = __environ = NULL;
         p.namec = 0;
     }
 
     // Find the handles we're interested in among what we were given.
-    mx_handle_t main_thread_handle = MX_HANDLE_INVALID;
+    zx_handle_t main_thread_handle = ZX_HANDLE_INVALID;
     for (uint32_t i = 0; i < p.nhandles; ++i) {
         switch (PA_HND_TYPE(p.handle_info[i])) {
         case PA_PROC_SELF:
@@ -139,10 +139,10 @@
             // linker startup, but now we have another one.  They
             // should of course be handles to the same process, but
             // just for cleanliness switch to the "main" one.
-            if (__magenta_process_self != MX_HANDLE_INVALID)
-                _mx_handle_close(__magenta_process_self);
-            __magenta_process_self = handles[i];
-            handles[i] = MX_HANDLE_INVALID;
+            if (__zircon_process_self != ZX_HANDLE_INVALID)
+                _zx_handle_close(__zircon_process_self);
+            __zircon_process_self = handles[i];
+            handles[i] = ZX_HANDLE_INVALID;
             p.handle_info[i] = 0;
             break;
 
@@ -151,25 +151,25 @@
             // creation of additional processes.  It may or may not
             // be the job this process is a child of.  It may not
             // be provided at all.
-            if (__magenta_job_default != MX_HANDLE_INVALID)
-                _mx_handle_close(__magenta_job_default);
-            __magenta_job_default = handles[i];
-            handles[i] = MX_HANDLE_INVALID;
+            if (__zircon_job_default != ZX_HANDLE_INVALID)
+                _zx_handle_close(__zircon_job_default);
+            __zircon_job_default = handles[i];
+            handles[i] = ZX_HANDLE_INVALID;
             p.handle_info[i] = 0;
             break;
 
         case PA_VMAR_ROOT:
             // As above for PROC_SELF
-            if (__magenta_vmar_root_self != MX_HANDLE_INVALID)
-                _mx_handle_close(__magenta_vmar_root_self);
-            __magenta_vmar_root_self = handles[i];
-            handles[i] = MX_HANDLE_INVALID;
+            if (__zircon_vmar_root_self != ZX_HANDLE_INVALID)
+                _zx_handle_close(__zircon_vmar_root_self);
+            __zircon_vmar_root_self = handles[i];
+            handles[i] = ZX_HANDLE_INVALID;
             p.handle_info[i] = 0;
             break;
 
         case PA_THREAD_SELF:
             main_thread_handle = handles[i];
-            handles[i] = MX_HANDLE_INVALID;
+            handles[i] = ZX_HANDLE_INVALID;
             p.handle_info[i] = 0;
             break;
         }
diff --git a/third_party/ulib/musl/src/exit/_Exit.c b/third_party/ulib/musl/src/exit/_Exit.c
index fe6cbbb..eb03d58 100644
--- a/third_party/ulib/musl/src/exit/_Exit.c
+++ b/third_party/ulib/musl/src/exit/_Exit.c
@@ -1,9 +1,9 @@
 #include <stdlib.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 _Noreturn void _Exit(int ec) {
     for (;;) {
-        _mx_process_exit(ec);
+        _zx_process_exit(ec);
     }
 }
diff --git a/third_party/ulib/musl/src/exit/abort.c b/third_party/ulib/musl/src/exit/abort.c
index 1cf4f29..531cc9d 100644
--- a/third_party/ulib/musl/src/exit/abort.c
+++ b/third_party/ulib/musl/src/exit/abort.c
@@ -1,10 +1,10 @@
 #include <stdlib.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 _Noreturn void abort(void) {
     for (;;) {
         __builtin_trap();
-        _mx_process_exit(-1);
+        _zx_process_exit(-1);
     }
 }
diff --git a/third_party/ulib/musl/src/fenv/aarch64/fenv.c b/third_party/ulib/musl/src/fenv/aarch64/fenv.c
index 8b443cc..5accbb5 100644
--- a/third_party/ulib/musl/src/fenv/aarch64/fenv.c
+++ b/third_party/ulib/musl/src/fenv/aarch64/fenv.c
@@ -4,7 +4,7 @@
 
 #include <fenv.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 #define ROUND_MASK (FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)
diff --git a/third_party/ulib/musl/src/fenv/x86_64/fenv.c b/third_party/ulib/musl/src/fenv/x86_64/fenv.c
index 26a82fc..2f4d827 100644
--- a/third_party/ulib/musl/src/fenv/x86_64/fenv.c
+++ b/third_party/ulib/musl/src/fenv/x86_64/fenv.c
@@ -4,7 +4,7 @@
 
 #include <fenv.h>
 
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 #include <x86intrin.h>
 
diff --git a/third_party/ulib/musl/src/internal/asan_impl.h b/third_party/ulib/musl/src/internal/asan_impl.h
index f7aeab8..6a38960 100644
--- a/third_party/ulib/musl/src/internal/asan_impl.h
+++ b/third_party/ulib/musl/src/internal/asan_impl.h
@@ -4,8 +4,8 @@
 
 #pragma once
 
-#include <magenta/compiler.h>
-#include <magenta/sanitizer.h>
+#include <zircon/compiler.h>
+#include <zircon/sanitizer.h>
 
 // NOTE: userboot includes memcpy, memmove, and memset source files
 // directly, so it needs to be able to handle their #include's of this
diff --git a/third_party/ulib/musl/src/internal/futex_impl.h b/third_party/ulib/musl/src/internal/futex_impl.h
index 02b0efc..34f58e5 100644
--- a/third_party/ulib/musl/src/internal/futex_impl.h
+++ b/third_party/ulib/musl/src/internal/futex_impl.h
@@ -3,14 +3,14 @@
 #include "atomic.h"
 
 #include <limits.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <stdatomic.h>
 
 void __wait(atomic_int* futex, atomic_int* waiters, int current_value);
 static inline void __wake(atomic_int* futex, int cnt) {
     if (cnt < 0)
         cnt = INT_MAX;
-    _mx_futex_wake(futex, cnt);
+    _zx_futex_wake(futex, cnt);
 }
 
 /* Self-synchronized-destruction-safe lock functions */
@@ -32,8 +32,8 @@
         __wake(l, 1);
 }
 
-static inline void unlock_requeue(atomic_int* l, mx_futex_t* r) {
+static inline void unlock_requeue(atomic_int* l, zx_futex_t* r) {
     atomic_store(l, UNLOCKED);
-    _mx_futex_requeue(l, /* wake count */ 0, /* l futex value */ UNLOCKED,
+    _zx_futex_requeue(l, /* wake count */ 0, /* l futex value */ UNLOCKED,
                       r, /* requeue count */ 1);
 }
diff --git a/third_party/ulib/musl/src/internal/libc.h b/third_party/ulib/musl/src/internal/libc.h
index 3ec7d6b..20554a8 100644
--- a/third_party/ulib/musl/src/internal/libc.h
+++ b/third_party/ulib/musl/src/internal/libc.h
@@ -7,8 +7,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <magenta/compiler.h>
-#include <magenta/types.h>
+#include <zircon/compiler.h>
+#include <zircon/types.h>
 
 struct __locale_map;
 
@@ -56,20 +56,20 @@
 
 void __tls_run_dtors(void) ATTR_LIBC_VISIBILITY;
 
-// Registers the handles that mx_get_startup_handle() will return.
+// Registers the handles that zx_get_startup_handle() will return.
 //
 // This function takes ownership of the data, but not the memory: it assumes
 // that the arrays are valid as long as the process is alive.
 //
 // |handles| and |handle_info| are parallel arrays and must have |nhandles|
 //     entries.
-// |handles| contains the actual handle values, or MX_HANDLE_INVALID if a
+// |handles| contains the actual handle values, or ZX_HANDLE_INVALID if a
 //     handle has already been claimed.
 // |handle_info| contains the PA_HND value associated with the
 //     corresponding element of |handles|, or zero if the handle has already
 //     been claimed.
 void __libc_startup_handles_init(uint32_t nhandles,
-                                 mx_handle_t handles[],
+                                 zx_handle_t handles[],
                                  uint32_t handle_info[]) ATTR_LIBC_VISIBILITY;
 
 _Noreturn void __libc_start_main(void* arg, int (*main)(int, char**, char**));
diff --git a/third_party/ulib/musl/src/internal/magenta_impl.h b/third_party/ulib/musl/src/internal/magenta_impl.h
deleted file mode 100644
index 279b498..0000000
--- a/third_party/ulib/musl/src/internal/magenta_impl.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-
-#include "libc.h"
-#include <magenta/process.h>
-#include <magenta/types.h>
-
-// TODO: add ATTR_LIBC_VISIBILITY to all 3 exports as soon as Rust no longer depends on these
-extern mx_handle_t __magenta_process_self;
-extern mx_handle_t __magenta_vmar_root_self;
-extern mx_handle_t __magenta_job_default;
-
-#define _mx_process_self() (__magenta_process_self + 0)
-#define _mx_vmar_root_self() (__magenta_vmar_root_self + 0)
-#define _mx_job_default() (__magenta_job_default + 0)
diff --git a/third_party/ulib/musl/src/internal/pthread_impl.h b/third_party/ulib/musl/src/internal/pthread_impl.h
index 83687a4..00c7671 100644
--- a/third_party/ulib/musl/src/internal/pthread_impl.h
+++ b/third_party/ulib/musl/src/internal/pthread_impl.h
@@ -12,8 +12,8 @@
 #include <sys/uio.h>
 #include <threads.h>
 
-#include <magenta/stack.h>
-#include <magenta/tls.h>
+#include <zircon/stack.h>
+#include <zircon/tls.h>
 #include <runtime/thread.h>
 #include <runtime/tls.h>
 
@@ -44,7 +44,7 @@
     tp_abi_t abi;
 #endif
 
-    mxr_thread_t mxr_thread;
+    zxr_thread_t zxr_thread;
 
     // The *_region fields describe whole memory regions reserved,
     // including guard pages (for deallocation).  safe_stack and
@@ -97,9 +97,9 @@
 static_assert(TP_OFFSETOF(head.dtv) == 8, "dtv misplaced in struct pthread");
 #endif
 
-static_assert(TP_OFFSETOF(abi.stack_guard) == MX_TLS_STACK_GUARD_OFFSET,
+static_assert(TP_OFFSETOF(abi.stack_guard) == ZX_TLS_STACK_GUARD_OFFSET,
               "stack_guard not at ABI-mandated offset from thread pointer");
-static_assert(TP_OFFSETOF(abi.unsafe_sp) == MX_TLS_UNSAFE_SP_OFFSET,
+static_assert(TP_OFFSETOF(abi.unsafe_sp) == ZX_TLS_UNSAFE_SP_OFFSET,
               "unsafe_sp not at ABI-mandated offset from thread pointer");
 
 static inline void* pthread_to_tp(struct pthread* thread) {
@@ -132,7 +132,7 @@
 void* __tls_get_new(size_t*) ATTR_LIBC_VISIBILITY;
 
 static inline pthread_t __pthread_self(void) {
-    return tp_to_pthread(mxr_tp_get());
+    return tp_to_pthread(zxr_tp_get());
 }
 
 static inline thrd_t __thrd_current(void) {
@@ -143,7 +143,7 @@
     // We rely on the fact that the high bit is not set. For now,
     // let's incur the cost of this check, until we consider the
     // userspace handle value representation completely baked.
-    pid_t id = __pthread_self()->mxr_thread.handle;
+    pid_t id = __pthread_self()->zxr_thread.handle;
     if (id & PTHREAD_MUTEX_OWNED_LOCK_BIT) {
         __builtin_trap();
     }
@@ -178,16 +178,16 @@
 
 #define DEFAULT_PTHREAD_ATTR                                                  \
     ((pthread_attr_t){                                                        \
-        ._a_stacksize = MAGENTA_DEFAULT_STACK_SIZE,                           \
+        ._a_stacksize = ZIRCON_DEFAULT_STACK_SIZE,                           \
         ._a_guardsize = PAGE_SIZE,                                            \
     })
 
 pthread_t __allocate_thread(const pthread_attr_t* attr,
                             const char* thread_name,
-                            char default_name[MX_MAX_NAME_LEN])
+                            char default_name[ZX_MAX_NAME_LEN])
     __attribute__((nonnull(1,2))) ATTR_LIBC_VISIBILITY;
 
-pthread_t __init_main_thread(mx_handle_t thread_self) ATTR_LIBC_VISIBILITY;
+pthread_t __init_main_thread(zx_handle_t thread_self) ATTR_LIBC_VISIBILITY;
 
 int __pthread_once(pthread_once_t*, void (*)(void)) ATTR_LIBC_VISIBILITY;
 
diff --git a/third_party/ulib/musl/src/internal/stdio_impl.h b/third_party/ulib/musl/src/internal/stdio_impl.h
index 5df89a5..733e27f 100644
--- a/third_party/ulib/musl/src/internal/stdio_impl.h
+++ b/third_party/ulib/musl/src/internal/stdio_impl.h
@@ -61,7 +61,7 @@
 int __toread(FILE*) ATTR_LIBC_VISIBILITY;
 int __towrite(FILE*) ATTR_LIBC_VISIBILITY;
 
-mx_status_t _mmap_file(size_t offset, size_t len, uint32_t mx_flags, int flags, int fd,
+zx_status_t _mmap_file(size_t offset, size_t len, uint32_t zx_flags, int flags, int fd,
                        off_t fd_off, uintptr_t* out);
 
 #if defined(__PIC__) && (100 * __GNUC__ + __GNUC_MINOR__ >= 303)
diff --git a/third_party/ulib/musl/src/internal/time_conversion.h b/third_party/ulib/musl/src/internal/time_conversion.h
index d3093cd..caf7a7f 100644
--- a/third_party/ulib/musl/src/internal/time_conversion.h
+++ b/third_party/ulib/musl/src/internal/time_conversion.h
@@ -3,11 +3,11 @@
 #define __NEED_struct_timespec
 
 #include <bits/alltypes.h>
-#include <magenta/types.h>
+#include <zircon/types.h>
 
-static inline mx_time_t __timespec_to_mx_time_t(struct timespec timespec) {
+static inline zx_time_t __timespec_to_zx_time_t(struct timespec timespec) {
     // TODO(kulakowski) Systematic time overflow checking.
-    mx_time_t nanos = timespec.tv_nsec;
+    zx_time_t nanos = timespec.tv_nsec;
     nanos += timespec.tv_sec * 1000000000ull;
     return nanos;
 }
diff --git a/third_party/ulib/musl/src/internal/zircon_impl.h b/third_party/ulib/musl/src/internal/zircon_impl.h
new file mode 100644
index 0000000..af5e3b5
--- /dev/null
+++ b/third_party/ulib/musl/src/internal/zircon_impl.h
@@ -0,0 +1,14 @@
+#pragma once
+
+#include "libc.h"
+#include <zircon/process.h>
+#include <zircon/types.h>
+
+// TODO: add ATTR_LIBC_VISIBILITY to all 3 exports as soon as Rust no longer depends on these
+extern zx_handle_t __zircon_process_self;
+extern zx_handle_t __zircon_vmar_root_self;
+extern zx_handle_t __zircon_job_default;
+
+#define _zx_process_self() (__zircon_process_self + 0)
+#define _zx_vmar_root_self() (__zircon_vmar_root_self + 0)
+#define _zx_job_default() (__zircon_job_default + 0)
diff --git a/third_party/ulib/musl/src/legacy/getloadavg.c b/third_party/ulib/musl/src/legacy/getloadavg.c
index 87f301e..f99558c 100644
--- a/third_party/ulib/musl/src/legacy/getloadavg.c
+++ b/third_party/ulib/musl/src/legacy/getloadavg.c
@@ -6,6 +6,6 @@
         return n ? -1 : 0;
     if (n > 3)
         n = 3;
-    // TODO(kulakowski) Ask magenta for load average.
+    // TODO(kulakowski) Ask zircon for load average.
     return -1;
 }
diff --git a/third_party/ulib/musl/src/math/fmodl.c b/third_party/ulib/musl/src/math/fmodl.c
index e9e12b0..82ead0f 100644
--- a/third_party/ulib/musl/src/math/fmodl.c
+++ b/third_party/ulib/musl/src/math/fmodl.c
@@ -33,30 +33,30 @@
 
 /* x mod y */
 #if LDBL_MANT_DIG == 64
-    uint64_t i, mx, my;
-    mx = ux.i.m;
+    uint64_t i, zx, my;
+    zx = ux.i.m;
     my = uy.i.m;
     for (; ex > ey; ex--) {
-        i = mx - my;
-        if (mx >= my) {
+        i = zx - my;
+        if (zx >= my) {
             if (i == 0)
                 return 0 * x;
-            mx = 2 * i;
-        } else if (2 * mx < mx) {
-            mx = 2 * mx - my;
+            zx = 2 * i;
+        } else if (2 * zx < zx) {
+            zx = 2 * zx - my;
         } else {
-            mx = 2 * mx;
+            zx = 2 * zx;
         }
     }
-    i = mx - my;
-    if (mx >= my) {
+    i = zx - my;
+    if (zx >= my) {
         if (i == 0)
             return 0 * x;
-        mx = i;
+        zx = i;
     }
-    for (; mx >> 63 == 0; mx *= 2, ex--)
+    for (; zx >> 63 == 0; zx *= 2, ex--)
         ;
-    ux.i.m = mx;
+    ux.i.m = zx;
 #elif LDBL_MANT_DIG == 113
     uint64_t hi, lo, xhi, xlo, yhi, ylo;
     xhi = (ux.i2.hi & -1ULL >> 16) | 1ULL << 48;
diff --git a/third_party/ulib/musl/src/math/remquol.c b/third_party/ulib/musl/src/math/remquol.c
index bc02a7e..2627302 100644
--- a/third_party/ulib/musl/src/math/remquol.c
+++ b/third_party/ulib/musl/src/math/remquol.c
@@ -35,35 +35,35 @@
     if (ex >= ey) {
 /* x mod y */
 #if LDBL_MANT_DIG == 64
-        uint64_t i, mx, my;
-        mx = ux.i.m;
+        uint64_t i, zx, my;
+        zx = ux.i.m;
         my = uy.i.m;
         for (; ex > ey; ex--) {
-            i = mx - my;
-            if (mx >= my) {
-                mx = 2 * i;
+            i = zx - my;
+            if (zx >= my) {
+                zx = 2 * i;
                 q++;
                 q <<= 1;
-            } else if (2 * mx < mx) {
-                mx = 2 * mx - my;
+            } else if (2 * zx < zx) {
+                zx = 2 * zx - my;
                 q <<= 1;
                 q++;
             } else {
-                mx = 2 * mx;
+                zx = 2 * zx;
                 q <<= 1;
             }
         }
-        i = mx - my;
-        if (mx >= my) {
-            mx = i;
+        i = zx - my;
+        if (zx >= my) {
+            zx = i;
             q++;
         }
-        if (mx == 0)
+        if (zx == 0)
             ex = -120;
         else
-            for (; mx >> 63 == 0; mx *= 2, ex--)
+            for (; zx >> 63 == 0; zx *= 2, ex--)
                 ;
-        ux.i.m = mx;
+        ux.i.m = zx;
 #elif LDBL_MANT_DIG == 113
         uint64_t hi, lo, xhi, xlo, yhi, ylo;
         xhi = (ux.i2.hi & -1ULL >> 16) | 1ULL << 48;
diff --git a/third_party/ulib/musl/src/mman/mmap.c b/third_party/ulib/musl/src/mman/mmap.c
index be62ca4..5a13520 100644
--- a/third_party/ulib/musl/src/mman/mmap.c
+++ b/third_party/ulib/musl/src/mman/mmap.c
@@ -1,14 +1,14 @@
 #include <errno.h>
 #include <limits.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/object.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
 #include <stdint.h>
 #include <string.h>
 #include <sys/mman.h>
 #include <unistd.h>
 
-#include "magenta_impl.h"
+#include "zircon_impl.h"
 #include "pthread_impl.h"
 #include "stdio_impl.h"
 
@@ -36,19 +36,19 @@
     // round up to page size
     len = (len + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
 
-    // build magenta flags for this
-    uint32_t mx_flags = 0;
-    mx_flags |= (prot & PROT_READ) ? MX_VM_FLAG_PERM_READ : 0;
-    mx_flags |= (prot & PROT_WRITE) ? MX_VM_FLAG_PERM_WRITE : 0;
-    mx_flags |= (prot & PROT_EXEC) ? MX_VM_FLAG_PERM_EXECUTE : 0;
+    // build zircon flags for this
+    uint32_t zx_flags = 0;
+    zx_flags |= (prot & PROT_READ) ? ZX_VM_FLAG_PERM_READ : 0;
+    zx_flags |= (prot & PROT_WRITE) ? ZX_VM_FLAG_PERM_WRITE : 0;
+    zx_flags |= (prot & PROT_EXEC) ? ZX_VM_FLAG_PERM_EXECUTE : 0;
 
     size_t offset = 0;
-    mx_status_t status = MX_OK;
+    zx_status_t status = ZX_OK;
     if (flags & MAP_FIXED) {
-        mx_flags |= MX_VM_FLAG_SPECIFIC;
+        zx_flags |= ZX_VM_FLAG_SPECIFIC;
 
-        mx_info_vmar_t info;
-        status = _mx_object_get_info(_mx_vmar_root_self(), MX_INFO_VMAR, &info,
+        zx_info_vmar_t info;
+        status = _zx_object_get_info(_zx_vmar_root_self(), ZX_INFO_VMAR, &info,
                                      sizeof(info), NULL, NULL);
         if (status < 0 || (uintptr_t)start < info.base) {
             goto fail;
@@ -56,24 +56,24 @@
         offset = (uintptr_t)start - info.base;
     }
 
-    mx_handle_t vmo;
+    zx_handle_t vmo;
     uintptr_t ptr = 0;
     if (flags & MAP_ANON) {
-        if (_mx_vmo_create(len, 0, &vmo) < 0) {
+        if (_zx_vmo_create(len, 0, &vmo) < 0) {
             errno = ENOMEM;
             return MAP_FAILED;
         }
-        _mx_object_set_property(vmo, MX_PROP_NAME, mmap_vmo_name, strlen(mmap_vmo_name));
+        _zx_object_set_property(vmo, ZX_PROP_NAME, mmap_vmo_name, strlen(mmap_vmo_name));
     } else {
-        status = _mmap_file(offset, len, mx_flags, flags, fd, fd_off, &ptr);
+        status = _mmap_file(offset, len, zx_flags, flags, fd, fd_off, &ptr);
         if (status < 0) {
             goto fail;
         }
         return (void*) ptr;
     }
 
-    status = _mx_vmar_map(_mx_vmar_root_self(), offset, vmo, fd_off, len, mx_flags, &ptr);
-    _mx_handle_close(vmo);
+    status = _zx_vmar_map(_zx_vmar_root_self(), offset, vmo, fd_off, len, zx_flags, &ptr);
+    _zx_handle_close(vmo);
     // TODO: map this as shared if we ever implement forking
     if (status < 0) {
         goto fail;
@@ -83,20 +83,20 @@
 
 fail:
     switch(status) {
-    case MX_ERR_BAD_HANDLE:
+    case ZX_ERR_BAD_HANDLE:
         errno = EBADF;
         break;
-    case MX_ERR_NOT_SUPPORTED:
+    case ZX_ERR_NOT_SUPPORTED:
         errno = ENODEV;
         break;
-    case MX_ERR_ACCESS_DENIED:
+    case ZX_ERR_ACCESS_DENIED:
         errno = EACCES;
         break;
-    case MX_ERR_NO_MEMORY:
+    case ZX_ERR_NO_MEMORY:
         errno = ENOMEM;
         break;
-    case MX_ERR_INVALID_ARGS:
-    case MX_ERR_BAD_STATE:
+    case ZX_ERR_INVALID_ARGS:
+    case ZX_ERR_BAD_STATE:
     default:
         errno = EINVAL;
     }
diff --git a/third_party/ulib/musl/src/mman/mprotect.c b/third_party/ulib/musl/src/mman/mprotect.c
index 8ba5ca6..8e890ae 100644
--- a/third_party/ulib/musl/src/mman/mprotect.c
+++ b/third_party/ulib/musl/src/mman/mprotect.c
@@ -1,26 +1,26 @@
 #include "libc.h"
-#include "magenta_impl.h"
+#include "zircon_impl.h"
 #include <errno.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
-#include <magenta/types.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/types.h>
 #include <sys/mman.h>
 
 int __mprotect(void* addr, size_t len, int prot) {
     uintptr_t ptr = (uintptr_t)addr;
-    uint32_t mx_prot = 0;
-    mx_prot |= (prot & PROT_READ) ? MX_VM_FLAG_PERM_READ : 0;
-    mx_prot |= (prot & PROT_WRITE) ? MX_VM_FLAG_PERM_WRITE : 0;
-    mx_prot |= (prot & PROT_EXEC) ? MX_VM_FLAG_PERM_EXECUTE : 0;
-    mx_status_t status = _mx_vmar_protect(_mx_vmar_root_self(), ptr, len, mx_prot);
+    uint32_t zx_prot = 0;
+    zx_prot |= (prot & PROT_READ) ? ZX_VM_FLAG_PERM_READ : 0;
+    zx_prot |= (prot & PROT_WRITE) ? ZX_VM_FLAG_PERM_WRITE : 0;
+    zx_prot |= (prot & PROT_EXEC) ? ZX_VM_FLAG_PERM_EXECUTE : 0;
+    zx_status_t status = _zx_vmar_protect(_zx_vmar_root_self(), ptr, len, zx_prot);
     if (!status)
         return 0;
 
     switch (status) {
-    case MX_ERR_ACCESS_DENIED:
+    case ZX_ERR_ACCESS_DENIED:
         errno = EACCES;
         break;
-    case MX_ERR_INVALID_ARGS:
+    case ZX_ERR_INVALID_ARGS:
         errno = ENOTSUP;
         break;
     default:
diff --git a/third_party/ulib/musl/src/mman/munmap.c b/third_party/ulib/musl/src/mman/munmap.c
index c4f2b04..aa1c845 100644
--- a/third_party/ulib/musl/src/mman/munmap.c
+++ b/third_party/ulib/musl/src/mman/munmap.c
@@ -1,13 +1,13 @@
 #include "libc.h"
-#include "magenta_impl.h"
+#include "zircon_impl.h"
 #include <errno.h>
-#include <magenta/process.h>
-#include <magenta/syscalls.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
 #include <sys/mman.h>
 
 int __munmap(void* start, size_t len) {
     uintptr_t ptr = (uintptr_t)start;
-    mx_status_t status = _mx_vmar_unmap(_mx_vmar_root_self(), ptr, len);
+    zx_status_t status = _zx_vmar_unmap(_zx_vmar_root_self(), ptr, len);
     if (status < 0) {
         errno = EINVAL;
         return -1;
diff --git a/third_party/ulib/musl/src/sched/sched_getcpu.c b/third_party/ulib/musl/src/sched/sched_getcpu.c
index 42ba4ec..5081fb4 100644
--- a/third_party/ulib/musl/src/sched/sched_getcpu.c
+++ b/third_party/ulib/musl/src/sched/sched_getcpu.c
@@ -3,7 +3,7 @@
 #include <sched.h>
 
 int sched_getcpu(void) {
-    // TODO(kulakowski) implement this on magenta
+    // TODO(kulakowski) implement this on zircon
     errno = ENOSYS;
     return -1;
 }
diff --git a/third_party/ulib/musl/src/sched/sched_yield.c b/third_party/ulib/musl/src/sched/sched_yield.c
index f4fd937..2b1ff55 100644
--- a/third_party/ulib/musl/src/sched/sched_yield.c
+++ b/third_party/ulib/musl/src/sched/sched_yield.c
@@ -1,8 +1,8 @@
 #include <sched.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 int sched_yield() {
-    _mx_nanosleep(0ull);
+    _zx_nanosleep(0ull);
     return 0;
 }
diff --git a/third_party/ulib/musl/src/setjmp/aarch64/longjmp.S b/third_party/ulib/musl/src/setjmp/aarch64/longjmp.S
index a7df0b4..161855a 100644
--- a/third_party/ulib/musl/src/setjmp/aarch64/longjmp.S
+++ b/third_party/ulib/musl/src/setjmp/aarch64/longjmp.S
@@ -4,7 +4,7 @@
 
 #include "asm.h"
 #include "setjmp_impl.h"
-#include <magenta/tls.h>
+#include <zircon/tls.h>
 
 #define DW_CFA_expression       0x10
 #define DW_CFA_val_expression   0x16
@@ -146,7 +146,7 @@
 
     // Restore SP last.
     // After this, our CFA is setjmp's CFA rather than longjmp's CFA.
-    str x2, [x0, #MX_TLS_UNSAFE_SP_OFFSET]
+    str x2, [x0, #ZX_TLS_UNSAFE_SP_OFFSET]
     //.cfi_same_value unsafe_sp  -- No DWARF register number for it!
     mov sp, x3
     .cfi_same_value sp
diff --git a/third_party/ulib/musl/src/setjmp/aarch64/setjmp.S b/third_party/ulib/musl/src/setjmp/aarch64/setjmp.S
index 66772e0..a97b632 100644
--- a/third_party/ulib/musl/src/setjmp/aarch64/setjmp.S
+++ b/third_party/ulib/musl/src/setjmp/aarch64/setjmp.S
@@ -4,7 +4,7 @@
 
 #include "asm.h"
 #include "setjmp_impl.h"
-#include <magenta/tls.h>
+#include <zircon/tls.h>
 
 ENTRY(setjmp)
 
@@ -22,7 +22,7 @@
 
     // Get the thread pointer, where the unsafe SP is stored.
     mrs x0, TPIDR_EL0
-    ldr x0, [x0, #MX_TLS_UNSAFE_SP_OFFSET]
+    ldr x0, [x0, #ZX_TLS_UNSAFE_SP_OFFSET]
 
     // Store all the vanilla callee-saves registers.
     stp x19, x20, [x16, #8*JB_X(19)]
diff --git a/third_party/ulib/musl/src/setjmp/x86_64/longjmp.S b/third_party/ulib/musl/src/setjmp/x86_64/longjmp.S
index c9cc900..0cec791 100644
--- a/third_party/ulib/musl/src/setjmp/x86_64/longjmp.S
+++ b/third_party/ulib/musl/src/setjmp/x86_64/longjmp.S
@@ -4,7 +4,7 @@
 
 #include "asm.h"
 #include "setjmp_impl.h"
-#include <magenta/tls.h>
+#include <zircon/tls.h>
 
 #define DW_CFA_expression       0x10
 #define DW_CFA_val_expression   0x16
@@ -88,7 +88,7 @@
     // Restore the demangled values.
     mov %rdx, %rbp
     .cfi_same_value %rbp
-    mov %rsi, %fs:MX_TLS_UNSAFE_SP_OFFSET
+    mov %rsi, %fs:ZX_TLS_UNSAFE_SP_OFFSET
     //.cfi_same_value %unsafe_sp  -- No DWARF register number for it!
     mov %rax, (%rcx)
     .cfi_escape DW_CFA_expression, 16, 3, DW_OP_breg2, 0, DW_OP_deref
diff --git a/third_party/ulib/musl/src/setjmp/x86_64/setjmp.S b/third_party/ulib/musl/src/setjmp/x86_64/setjmp.S
index e0caaba..aee9680 100644
--- a/third_party/ulib/musl/src/setjmp/x86_64/setjmp.S
+++ b/third_party/ulib/musl/src/setjmp/x86_64/setjmp.S
@@ -4,7 +4,7 @@
 
 #include "asm.h"
 #include "setjmp_impl.h"
-#include <magenta/tls.h>
+#include <zircon/tls.h>
 
 ENTRY(setjmp)
 
@@ -12,7 +12,7 @@
     mov (%rsp), %rax                            // PC
     mov %rsp, %rcx                              // SP
     mov %rbp, %rdx                              // FP
-    mov %fs:MX_TLS_UNSAFE_SP_OFFSET, %rsi       // Unsafe SP
+    mov %fs:ZX_TLS_UNSAFE_SP_OFFSET, %rsi       // Unsafe SP
 
     // Store all the vanilla callee-saves registers.
     mov %rbx, 8*JB_RBX(%rdi)
diff --git a/third_party/ulib/musl/src/stdio/remove.c b/third_party/ulib/musl/src/stdio/remove.c
index 067622e..4fb475a 100644
--- a/third_party/ulib/musl/src/stdio/remove.c
+++ b/third_party/ulib/musl/src/stdio/remove.c
@@ -2,7 +2,7 @@
 #include <unistd.h>
 
 int remove(const char* path) {
-    // magenta's unlink(2) works on all filesystem objects, including
+    // zircon's unlink(2) works on all filesystem objects, including
     // directories, so there is no need to check to see whether we
     // must call rmdir.
     return unlink(path);
diff --git a/third_party/ulib/musl/src/string/memccpy.c b/third_party/ulib/musl/src/string/memccpy.c
index 0c2bbd5..5a4ec70 100644
--- a/third_party/ulib/musl/src/string/memccpy.c
+++ b/third_party/ulib/musl/src/string/memccpy.c
@@ -1,7 +1,7 @@
 #include <string.h>
 
 #include <limits.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 #define ALIGN (sizeof(size_t) - 1)
diff --git a/third_party/ulib/musl/src/string/memchr.c b/third_party/ulib/musl/src/string/memchr.c
index 57e93ac..4e3b0d3 100644
--- a/third_party/ulib/musl/src/string/memchr.c
+++ b/third_party/ulib/musl/src/string/memchr.c
@@ -1,7 +1,7 @@
 #include <string.h>
 
 #include <limits.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 #define SS (sizeof(size_t))
diff --git a/third_party/ulib/musl/src/string/strlen.c b/third_party/ulib/musl/src/string/strlen.c
index 540e82f..f7bcd91 100644
--- a/third_party/ulib/musl/src/string/strlen.c
+++ b/third_party/ulib/musl/src/string/strlen.c
@@ -1,7 +1,7 @@
 #include <string.h>
 
 #include <limits.h>
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #include <stdint.h>
 
 #define ALIGN (sizeof(size_t))
diff --git a/third_party/ulib/musl/src/thread/__timedwait.c b/third_party/ulib/musl/src/thread/__timedwait.c
index a58ca22..8c27bf4 100644
--- a/third_party/ulib/musl/src/thread/__timedwait.c
+++ b/third_party/ulib/musl/src/thread/__timedwait.c
@@ -1,40 +1,40 @@
 #include "pthread_impl.h"
 #include <errno.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <time.h>
 
 #include "clock_impl.h"
 
 int __timedwait(atomic_int* futex, int val, clockid_t clk, const struct timespec* at) {
     struct timespec to;
-    mx_time_t deadline = MX_TIME_INFINITE;
+    zx_time_t deadline = ZX_TIME_INFINITE;
 
     if (at) {
-        if (at->tv_nsec >= MX_SEC(1))
+        if (at->tv_nsec >= ZX_SEC(1))
             return EINVAL;
         if (__clock_gettime(clk, &to))
             return EINVAL;
         to.tv_sec = at->tv_sec - to.tv_sec;
         if ((to.tv_nsec = at->tv_nsec - to.tv_nsec) < 0) {
             to.tv_sec--;
-            to.tv_nsec += MX_SEC(1);
+            to.tv_nsec += ZX_SEC(1);
         }
         if (to.tv_sec < 0)
             return ETIMEDOUT;
-        deadline = _mx_deadline_after(MX_SEC(to.tv_sec) + to.tv_nsec);
+        deadline = _zx_deadline_after(ZX_SEC(to.tv_sec) + to.tv_nsec);
     }
 
-    // mx_futex_wait will return MX_ERR_BAD_STATE if someone modifying *addr
+    // zx_futex_wait will return ZX_ERR_BAD_STATE if someone modifying *addr
     // races with this call. But this is indistinguishable from
     // otherwise being woken up just before someone else changes the
     // value. Therefore this functions returns 0 in that case.
-    switch (_mx_futex_wait(futex, val, deadline)) {
-    case MX_OK:
-    case MX_ERR_BAD_STATE:
+    switch (_zx_futex_wait(futex, val, deadline)) {
+    case ZX_OK:
+    case ZX_ERR_BAD_STATE:
         return 0;
-    case MX_ERR_TIMED_OUT:
+    case ZX_ERR_TIMED_OUT:
         return ETIMEDOUT;
-    case MX_ERR_INVALID_ARGS:
+    case ZX_ERR_INVALID_ARGS:
     default:
         __builtin_trap();
     }
diff --git a/third_party/ulib/musl/src/thread/__wait.c b/third_party/ulib/musl/src/thread/__wait.c
index c96776d..17fa23e 100644
--- a/third_party/ulib/musl/src/thread/__wait.c
+++ b/third_party/ulib/musl/src/thread/__wait.c
@@ -12,7 +12,7 @@
     if (waiters)
         atomic_fetch_add(waiters, 1);
     while (atomic_load(futex) == current_value) {
-        _mx_futex_wait(futex, current_value, MX_TIME_INFINITE);
+        _zx_futex_wait(futex, current_value, ZX_TIME_INFINITE);
     }
     if (waiters)
         atomic_fetch_sub(waiters, 1);
diff --git a/third_party/ulib/musl/src/thread/cnd_timedwait.c b/third_party/ulib/musl/src/thread/cnd_timedwait.c
index 355f58a..4a40303 100644
--- a/third_party/ulib/musl/src/thread/cnd_timedwait.c
+++ b/third_party/ulib/musl/src/thread/cnd_timedwait.c
@@ -22,7 +22,7 @@
 
 int cnd_timedwait(cnd_t* restrict c, mtx_t* restrict mutex,
                   const struct timespec* restrict ts) {
-    mxr_mutex_t* m = (mxr_mutex_t*)mutex;
+    zxr_mutex_t* m = (zxr_mutex_t*)mutex;
     int e, clock = c->_c_clock, oldstate;
 
     if (ts && ts->tv_nsec >= 1000000000UL)
@@ -47,16 +47,16 @@
 
     unlock(&c->_c_lock);
 
-    mxr_mutex_unlock(m);
+    zxr_mutex_unlock(m);
 
     /* Wait to be signaled.  There are multiple ways this loop could exit:
      *  1) After being woken by __private_cond_signal().
-     *  2) After being woken by mxr_mutex_unlock(), after we were
+     *  2) After being woken by zxr_mutex_unlock(), after we were
      *     requeued from the condvar's futex to the mutex's futex (by
      *     cnd_timedwait() in another thread).
      *  3) After a timeout.
      *  4) On Linux, interrupted by an asynchronous signal.  This does
-     *     not apply on Magenta. */
+     *     not apply on Zircon. */
     do
         e = __timedwait(fut, seq, clock, ts);
     while (*fut == seq && !e);
@@ -113,12 +113,12 @@
      * There are two reasons for that:
      *  1) If we do the unlock_requeue() below, a condvar waiter will be
      *     requeued to the mutex's futex.  We need to ensure that it will
-     *     be signaled by mxr_mutex_unlock() in future.
+     *     be signaled by zxr_mutex_unlock() in future.
      *  2) If the current thread was woken via an unlock_requeue() +
-     *     mxr_mutex_unlock(), there *might* be another thread waiting for
+     *     zxr_mutex_unlock(), there *might* be another thread waiting for
      *     the mutex after us in the queue.  We need to ensure that it
-     *     will be signaled by mxr_mutex_unlock() in future. */
-    mxr_mutex_lock_with_waiter(m);
+     *     will be signaled by zxr_mutex_unlock() in future. */
+    zxr_mutex_lock_with_waiter(m);
 
     /* By this point, our part of the waiter list cannot change further.
      * It has been unlinked from the condvar by __private_cond_signal().
diff --git a/third_party/ulib/musl/src/thread/mtx_init.c b/third_party/ulib/musl/src/thread/mtx_init.c
index a6236cc..834ee57 100644
--- a/third_party/ulib/musl/src/thread/mtx_init.c
+++ b/third_party/ulib/musl/src/thread/mtx_init.c
@@ -2,14 +2,14 @@
 #include <runtime/mutex.h>
 #include <threads.h>
 
-static_assert(sizeof(mtx_t) == sizeof(mxr_mutex_t), "mtx_t has an unexpected size");
+static_assert(sizeof(mtx_t) == sizeof(zxr_mutex_t), "mtx_t has an unexpected size");
 
 int mtx_init(mtx_t* m, int type) {
     // TODO(kulakowski) Revisit this if anyone actually needs a recursive C11 mutex.
     if (type & mtx_recursive)
         return thrd_error;
 
-    *(mxr_mutex_t*)&m->__i = MXR_MUTEX_INIT;
+    *(zxr_mutex_t*)&m->__i = ZXR_MUTEX_INIT;
 
     return thrd_success;
 }
diff --git a/third_party/ulib/musl/src/thread/mtx_lock.c b/third_party/ulib/musl/src/thread/mtx_lock.c
index c4afd81..a50a035 100644
--- a/third_party/ulib/musl/src/thread/mtx_lock.c
+++ b/third_party/ulib/musl/src/thread/mtx_lock.c
@@ -2,6 +2,6 @@
 #include <threads.h>
 
 int mtx_lock(mtx_t* m) {
-    mxr_mutex_lock((mxr_mutex_t*)&m->__i);
+    zxr_mutex_lock((zxr_mutex_t*)&m->__i);
     return thrd_success;
 }
diff --git a/third_party/ulib/musl/src/thread/mtx_timedlock.c b/third_party/ulib/musl/src/thread/mtx_timedlock.c
index 874b043..6b9d1d2 100644
--- a/third_party/ulib/musl/src/thread/mtx_timedlock.c
+++ b/third_party/ulib/musl/src/thread/mtx_timedlock.c
@@ -1,18 +1,18 @@
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 #include <runtime/mutex.h>
 #include <threads.h>
 
 #include "time_conversion.h"
 
 int mtx_timedlock(mtx_t* restrict m, const struct timespec* restrict ts) {
-    mx_time_t abstime = __timespec_to_mx_time_t(*ts);
-    mx_status_t status = __mxr_mutex_timedlock((mxr_mutex_t*)&m->__i, abstime);
+    zx_time_t abstime = __timespec_to_zx_time_t(*ts);
+    zx_status_t status = __zxr_mutex_timedlock((zxr_mutex_t*)&m->__i, abstime);
     switch (status) {
     default:
         return thrd_error;
     case 0:
         return thrd_success;
-    case MX_ERR_TIMED_OUT:
+    case ZX_ERR_TIMED_OUT:
         return thrd_timedout;
     }
 }
diff --git a/third_party/ulib/musl/src/thread/mtx_trylock.c b/third_party/ulib/musl/src/thread/mtx_trylock.c
index 5e0c629..15af93b 100644
--- a/third_party/ulib/musl/src/thread/mtx_trylock.c
+++ b/third_party/ulib/musl/src/thread/mtx_trylock.c
@@ -2,13 +2,13 @@
 #include <threads.h>
 
 int mtx_trylock(mtx_t* m) {
-    mx_status_t status = mxr_mutex_trylock((mxr_mutex_t*)&m->__i);
+    zx_status_t status = zxr_mutex_trylock((zxr_mutex_t*)&m->__i);
     switch (status) {
     default:
         return thrd_error;
     case 0:
         return thrd_success;
-    case MX_ERR_BAD_STATE:
+    case ZX_ERR_BAD_STATE:
         return thrd_busy;
     }
 }
diff --git a/third_party/ulib/musl/src/thread/mtx_unlock.c b/third_party/ulib/musl/src/thread/mtx_unlock.c
index 6996fa0..f8cc173 100644
--- a/third_party/ulib/musl/src/thread/mtx_unlock.c
+++ b/third_party/ulib/musl/src/thread/mtx_unlock.c
@@ -2,6 +2,6 @@
 #include <threads.h>
 
 int mtx_unlock(mtx_t* m) {
-    mxr_mutex_unlock((mxr_mutex_t*)&m->__i);
+    zxr_mutex_unlock((zxr_mutex_t*)&m->__i);
     return thrd_success;
 }
diff --git a/third_party/ulib/musl/src/thread/thrd_sleep.c b/third_party/ulib/musl/src/thread/thrd_sleep.c
index 6f03e31..7434141 100644
--- a/third_party/ulib/musl/src/thread/thrd_sleep.c
+++ b/third_party/ulib/musl/src/thread/thrd_sleep.c
@@ -1,18 +1,18 @@
 #include <threads.h>
 
 #include <assert.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include "time_conversion.h"
 
 int thrd_sleep(const struct timespec* req, struct timespec* rem) {
-    // For now, Magenta only provides an uninterruptible nanosleep. If
+    // For now, Zircon only provides an uninterruptible nanosleep. If
     // we ever introduce an asynchronous mechanism that would require
     // some EINTR-like logic, then we will also want a nanosleep call
     // which reports back how much time is remaining. Until then,
     // always report back 0 timeout remaining.
 
-    int ret = _mx_nanosleep(_mx_deadline_after(__timespec_to_mx_time_t(*req)));
+    int ret = _zx_nanosleep(_zx_deadline_after(__timespec_to_zx_time_t(*req)));
     assert(ret == 0);
     if (rem) {
         *rem = (struct timespec){
diff --git a/third_party/ulib/musl/src/thread/thrd_yield.c b/third_party/ulib/musl/src/thread/thrd_yield.c
index 9c58342..d5dc637 100644
--- a/third_party/ulib/musl/src/thread/thrd_yield.c
+++ b/third_party/ulib/musl/src/thread/thrd_yield.c
@@ -1,7 +1,7 @@
 #include <threads.h>
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 void thrd_yield() {
-    _mx_nanosleep(0ull);
+    _zx_nanosleep(0ull);
 }
diff --git a/third_party/ulib/musl/src/time/clock_gettime.c b/third_party/ulib/musl/src/time/clock_gettime.c
index 34de852..27054a4 100644
--- a/third_party/ulib/musl/src/time/clock_gettime.c
+++ b/third_party/ulib/musl/src/time/clock_gettime.c
@@ -5,28 +5,28 @@
 
 #include "clock_impl.h"
 
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 int __clock_gettime(clockid_t clk, struct timespec* ts) {
-    uint32_t mx_clock;
+    uint32_t zx_clock;
     switch (clk) {
     case CLOCK_MONOTONIC:
     case CLOCK_MONOTONIC_RAW:
-        mx_clock = MX_CLOCK_MONOTONIC;
+        zx_clock = ZX_CLOCK_MONOTONIC;
         break;
     case CLOCK_REALTIME:
-        mx_clock = MX_CLOCK_UTC;
+        zx_clock = ZX_CLOCK_UTC;
         break;
     case CLOCK_THREAD_CPUTIME_ID:
-        mx_clock = MX_CLOCK_THREAD;
+        zx_clock = ZX_CLOCK_THREAD;
         break;
     default:
         errno = EINVAL;
         return -1;
     }
-    mx_time_t now = _mx_time_get(mx_clock);
-    ts->tv_sec = now / MX_SEC(1);
-    ts->tv_nsec = now % MX_SEC(1);
+    zx_time_t now = _zx_time_get(zx_clock);
+    ts->tv_sec = now / ZX_SEC(1);
+    ts->tv_nsec = now % ZX_SEC(1);
     return 0;
 }
 
diff --git a/third_party/ulib/musl/src/time/nanosleep.c b/third_party/ulib/musl/src/time/nanosleep.c
index 49cc566..f33b3ad 100644
--- a/third_party/ulib/musl/src/time/nanosleep.c
+++ b/third_party/ulib/musl/src/time/nanosleep.c
@@ -1,18 +1,18 @@
 #include <time.h>
 
 #include <assert.h>
-#include <magenta/syscalls.h>
+#include <zircon/syscalls.h>
 
 #include "time_conversion.h"
 
 int nanosleep(const struct timespec* req, struct timespec* rem) {
-    // For now, Magenta only provides an uninterruptible nanosleep. If
+    // For now, Zircon only provides an uninterruptible nanosleep. If
     // we ever introduce an asynchronous mechanism that would require
     // some EINTR-like logic, then we will also want a nanosleep call
     // which reports back how much time is remaining. Until then,
     // always report back 0 timeout remaining.
 
-    int ret = _mx_nanosleep(_mx_deadline_after(__timespec_to_mx_time_t(*req)));
+    int ret = _zx_nanosleep(_zx_deadline_after(__timespec_to_zx_time_t(*req)));
     assert(ret == 0);
     if (rem) {
         *rem = (struct timespec){
diff --git a/third_party/ulib/musl/stubs/idstubs.c b/third_party/ulib/musl/stubs/idstubs.c
index 03c2a30..b950e6e 100644
--- a/third_party/ulib/musl/stubs/idstubs.c
+++ b/third_party/ulib/musl/stubs/idstubs.c
@@ -4,20 +4,20 @@
 #include "libc.h"
 #include <errno.h>
 
-#define MX_PPID ((pid_t)2)
-#define MX_PID ((pid_t)3)
-#define MX_PGID ((pid_t)17)
-#define MX_SID ((pid_t)19)
-#define MX_UID ((uid_t)23)
-#define MX_GID ((gid_t)42)
+#define ZX_PPID ((pid_t)2)
+#define ZX_PID ((pid_t)3)
+#define ZX_PGID ((pid_t)17)
+#define ZX_SID ((pid_t)19)
+#define ZX_UID ((uid_t)23)
+#define ZX_GID ((gid_t)42)
 
 static gid_t stub_getegid(void) {
-    return MX_GID;
+    return ZX_GID;
 }
 weak_alias(stub_getegid, getegid);
 
 static gid_t stub_getgid(void) {
-    return MX_GID;
+    return ZX_GID;
 }
 weak_alias(stub_getgid, getgid);
 
@@ -31,7 +31,7 @@
 static int stub_getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid) {
     if (!rgid || !egid || !sgid)
         return EFAULT;
-    *rgid = *egid = *sgid = MX_GID;
+    *rgid = *egid = *sgid = ZX_GID;
     return 0;
 }
 weak_alias(stub_getresgid, getresgid);
@@ -39,53 +39,53 @@
 static int stub_getresuid(uid_t* ruid, uid_t* euid, uid_t* suid) {
     if (!ruid || !euid || !suid)
         return EFAULT;
-    *ruid = *euid = *suid = MX_UID;
+    *ruid = *euid = *suid = ZX_UID;
     return 0;
 }
 weak_alias(stub_getresuid, getresuid);
 
 static pid_t stub_getpgid(pid_t pid) {
-    return MX_PGID;
+    return ZX_PGID;
 }
 weak_alias(stub_getpgid, getpgid);
 
 static pid_t stub_getpgrp(void) {
-    return MX_PGID;
+    return ZX_PGID;
 }
 weak_alias(stub_getpgrp, getpgrp);
 
 static pid_t stub_getpid(void) {
-    return MX_PID;
+    return ZX_PID;
 }
 weak_alias(stub_getpid, getpid);
 
 static pid_t stub_getppid(void) {
-    return MX_PPID;
+    return ZX_PPID;
 }
 weak_alias(stub_getppid, getppid);
 
 static pid_t stub_getsid(pid_t pid) {
-    return MX_SID;
+    return ZX_SID;
 }
 weak_alias(stub_getsid, getsid);
 
 static uid_t stub_geteuid(void) {
-    return MX_UID;
+    return ZX_UID;
 }
 weak_alias(stub_geteuid, geteuid);
 
 static uid_t stub_getuid(void) {
-    return MX_UID;
+    return ZX_UID;
 }
 weak_alias(stub_getuid, getuid);
 
 static pid_t stub_setsid(void) {
-    return MX_SID;
+    return ZX_SID;
 }
 weak_alias(stub_setsid, setsid);
 
 static int stub_setegid(gid_t egid) {
-    return MX_GID;
+    return ZX_GID;
 }
 weak_alias(stub_setegid, setegid);
 
diff --git a/third_party/ulib/musl/stubs/iostubs.c b/third_party/ulib/musl/stubs/iostubs.c
index 221a768..b88b06b 100644
--- a/third_party/ulib/musl/stubs/iostubs.c
+++ b/third_party/ulib/musl/stubs/iostubs.c
@@ -24,9 +24,9 @@
 }
 weak_alias(stub_write, write);
 
-static mx_status_t stub_mmap_file(size_t offset, size_t len, uint32_t mx_flags, int flags, int fd,
+static zx_status_t stub_mmap_file(size_t offset, size_t len, uint32_t zx_flags, int flags, int fd,
                                   off_t fd_off, uintptr_t* out) {
-    return MX_ERR_NOT_SUPPORTED;
+    return ZX_ERR_NOT_SUPPORTED;
 }
 weak_alias(stub_mmap_file, _mmap_file);
 
diff --git a/third_party/ulib/musl/third_party/complex/ctanh.c b/third_party/ulib/musl/third_party/complex/ctanh.c
index ef4bb7f..09460c8 100644
--- a/third_party/ulib/musl/third_party/complex/ctanh.c
+++ b/third_party/ulib/musl/third_party/complex/ctanh.c
@@ -114,8 +114,8 @@
      * We use a modified formula to avoid spurious overflow.
      */
     if (ix >= 0x40360000) { /* x >= 22 */
-        double exp_mx = exp(-fabs(x));
-        return CMPLX(copysign(1, x), 4 * sin(y) * cos(y) * exp_mx * exp_mx);
+        double exp_zx = exp(-fabs(x));
+        return CMPLX(copysign(1, x), 4 * sin(y) * cos(y) * exp_zx * exp_zx);
     }
 
     /* Kahan's algorithm */
diff --git a/third_party/ulib/musl/third_party/complex/ctanhf.c b/third_party/ulib/musl/third_party/complex/ctanhf.c
index fc122da..c0c4793 100644
--- a/third_party/ulib/musl/third_party/complex/ctanhf.c
+++ b/third_party/ulib/musl/third_party/complex/ctanhf.c
@@ -52,8 +52,8 @@
         return CMPLXF(ix ? y - y : x, y - y);
 
     if (ix >= 0x41300000) { /* x >= 11 */
-        float exp_mx = expf(-fabsf(x));
-        return CMPLXF(copysignf(1, x), 4 * sinf(y) * cosf(y) * exp_mx * exp_mx);
+        float exp_zx = expf(-fabsf(x));
+        return CMPLXF(copysignf(1, x), 4 * sinf(y) * cosf(y) * exp_zx * exp_zx);
     }
 
     t = tanf(y);
diff --git a/third_party/ulib/musl/magenta/get_startup_handle.c b/third_party/ulib/musl/zircon/get_startup_handle.c
similarity index 76%
rename from third_party/ulib/musl/magenta/get_startup_handle.c
rename to third_party/ulib/musl/zircon/get_startup_handle.c
index e9835b9..d54bcdf 100644
--- a/third_party/ulib/musl/magenta/get_startup_handle.c
+++ b/third_party/ulib/musl/zircon/get_startup_handle.c
@@ -3,20 +3,20 @@
 // found in the LICENSE file.
 
 #include "libc.h"
-#include <magenta/process.h>
-#include <magenta/types.h>
+#include <zircon/process.h>
+#include <zircon/types.h>
 
 #define _ALL_SOURCE  // For MTX_INIT
 #include <threads.h>
 
 static mtx_t startup_handles_lock = MTX_INIT;
 static uint32_t startup_handles_num;
-static mx_handle_t* startup_handles;
+static zx_handle_t* startup_handles;
 static uint32_t* startup_handles_info;
 
 static void shave_front(void) {
     while (startup_handles_num > 0 &&
-           startup_handles[0] == MX_HANDLE_INVALID) {
+           startup_handles[0] == ZX_HANDLE_INVALID) {
         --startup_handles_num;
         ++startup_handles;
         ++startup_handles_info;
@@ -25,14 +25,14 @@
 
 static void shave_back(void) {
     while (startup_handles_num > 0 &&
-           startup_handles[startup_handles_num - 1] == MX_HANDLE_INVALID)
+           startup_handles[startup_handles_num - 1] == ZX_HANDLE_INVALID)
         --startup_handles_num;
 }
 
 // This is called only once at startup, so it doesn't need locking.
 ATTR_LIBC_VISIBILITY
 void __libc_startup_handles_init(
-    uint32_t nhandles, mx_handle_t handles[], uint32_t handle_info[]) {
+    uint32_t nhandles, zx_handle_t handles[], uint32_t handle_info[]) {
     startup_handles_num = nhandles;
     startup_handles = handles;
     startup_handles_info = handle_info;
@@ -40,13 +40,13 @@
     shave_back();
 }
 
-mx_handle_t mx_get_startup_handle(uint32_t hnd_info) {
-    mx_handle_t result = MX_HANDLE_INVALID;
+zx_handle_t zx_get_startup_handle(uint32_t hnd_info) {
+    zx_handle_t result = ZX_HANDLE_INVALID;
     mtx_lock(&startup_handles_lock);
     for (uint32_t i = 0; i < startup_handles_num; ++i) {
         if (startup_handles_info[i] == hnd_info) {
             result = startup_handles[i];
-            startup_handles[i] = MX_HANDLE_INVALID;
+            startup_handles[i] = ZX_HANDLE_INVALID;
             startup_handles_info[i] = 0;
             if (i == 0)
                 shave_front();
diff --git a/third_party/ulib/musl/zircon/internal.c b/third_party/ulib/musl/zircon/internal.c
new file mode 100644
index 0000000..fee31ce
--- /dev/null
+++ b/third_party/ulib/musl/zircon/internal.c
@@ -0,0 +1,30 @@
+#include "zircon_impl.h"
+
+#undef _zx_process_self
+#undef _zx_vmar_root_self
+#undef _zx_job_default
+
+#include <zircon/process.h>
+
+// TODO: add ATTR_LIBC_VISIBILITY to all 3 exports as soon as Rust no longer depends on these
+zx_handle_t __zircon_process_self;
+zx_handle_t __zircon_vmar_root_self;
+zx_handle_t __zircon_job_default;
+
+zx_handle_t _zx_process_self(void) {
+    return __zircon_process_self;
+}
+__typeof(zx_process_self) zx_process_self
+    __attribute__((weak, alias("_zx_process_self")));
+
+zx_handle_t _zx_vmar_root_self(void) {
+    return __zircon_vmar_root_self;
+}
+__typeof(zx_vmar_root_self) zx_vmar_root_self
+    __attribute__((weak, alias("_zx_vmar_root_self")));
+
+zx_handle_t _zx_job_default(void) {
+    return __zircon_job_default;
+}
+__typeof(zx_job_default) zx_job_default
+    __attribute__((weak, alias("_zx_job_default")));
diff --git a/third_party/ulib/musl/zircon/thrd_get_zx_handle.c b/third_party/ulib/musl/zircon/thrd_get_zx_handle.c
new file mode 100644
index 0000000..f142a81
--- /dev/null
+++ b/third_party/ulib/musl/zircon/thrd_get_zx_handle.c
@@ -0,0 +1,16 @@
+#include <zircon/process.h>
+#include <zircon/threads.h>
+
+#include <runtime/thread.h>
+
+#include "pthread_impl.h"
+
+zx_handle_t thrd_get_zx_handle(thrd_t t) {
+    return zxr_thread_get_handle(&t->zxr_thread);
+}
+
+zx_handle_t _zx_thread_self(void) {
+    return zxr_thread_get_handle(&__pthread_self()->zxr_thread);
+}
+__typeof(zx_thread_self) zx_thread_self
+    __attribute__((weak, alias("_zx_thread_self")));
diff --git a/third_party/ulib/ngunwind/README.fuchsia.md b/third_party/ulib/ngunwind/README.fuchsia.md
index b382638..71ae62f 100644
--- a/third_party/ulib/ngunwind/README.fuchsia.md
+++ b/third_party/ulib/ngunwind/README.fuchsia.md
@@ -5,7 +5,7 @@
 To make the code more tractable:
 - all the macro magic has been deleted
 - unused ports have been deleted
-- headers have been moved to follow magenta's scheme
+- headers have been moved to follow zircon's scheme
 
 At the present UNW_LOCAL_ONLY support is gone, Fuchsia uses the llvm
 unwinder for that. Ultimately, it is intended to switch Fuchsia to use
diff --git a/third_party/ulib/ngunwind/include/ngunwind/fuchsia.h b/third_party/ulib/ngunwind/include/ngunwind/fuchsia.h
index e328d85..48d0e2d 100644
--- a/third_party/ulib/ngunwind/include/ngunwind/fuchsia.h
+++ b/third_party/ulib/ngunwind/include/ngunwind/fuchsia.h
@@ -28,7 +28,7 @@
 extern "C" {
 #endif
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include "libunwind.h"
 
@@ -38,8 +38,8 @@
 
 typedef struct unw_fuchsia_info unw_fuchsia_info_t;
 
-extern unw_fuchsia_info_t* unw_create_fuchsia(mx_handle_t process,
-                                              mx_handle_t thread,
+extern unw_fuchsia_info_t* unw_create_fuchsia(zx_handle_t process,
+                                              zx_handle_t thread,
                                               struct dsoinfo* dsos,
                                               unw_dso_lookup_func_t* lookup_dso);
 
diff --git a/third_party/ulib/ngunwind/include/ngunwind/private/compiler.h b/third_party/ulib/ngunwind/include/ngunwind/private/compiler.h
index be941a1..0aed8d9 100644
--- a/third_party/ulib/ngunwind/include/ngunwind/private/compiler.h
+++ b/third_party/ulib/ngunwind/include/ngunwind/private/compiler.h
@@ -34,7 +34,7 @@
 /* Not ready to give up on linux support in this library just yet.
    It may be useful when trying to debug something.
    That is why this code is the way it is.  */
-#include <magenta/compiler.h>
+#include <zircon/compiler.h>
 #undef likely
 #undef unlikely
 #endif
diff --git a/third_party/ulib/ngunwind/include/ngunwind/private/fuchsia_i.h b/third_party/ulib/ngunwind/include/ngunwind/private/fuchsia_i.h
index c1e49df..7de6e76 100644
--- a/third_party/ulib/ngunwind/include/ngunwind/private/fuchsia_i.h
+++ b/third_party/ulib/ngunwind/include/ngunwind/private/fuchsia_i.h
@@ -26,7 +26,7 @@
 
 #pragma once
 
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 #include <ngunwind/fuchsia.h>
 
@@ -37,8 +37,8 @@
     struct _Unwind_Context context; // must be first
     unw_addr_space_t remote_as;
 #endif
-    mx_handle_t process;
-    mx_handle_t thread;
+    zx_handle_t process;
+    zx_handle_t thread;
 
     // List of dsos, and lookup function.
     struct dsoinfo* dsos;
diff --git a/third_party/ulib/ngunwind/rules.mk b/third_party/ulib/ngunwind/rules.mk
index 3c7a348..7d7983f 100644
--- a/third_party/ulib/ngunwind/rules.mk
+++ b/third_party/ulib/ngunwind/rules.mk
@@ -99,7 +99,7 @@
 MODULE_SO_NAME := ngunwind
 
 MODULE_LIBS := \
-    system/ulib/magenta system/ulib/c
+    system/ulib/zircon system/ulib/c
 
 # Compile this with frame pointers so that if we crash the crashlogger
 # the simplistic unwinder will work.
diff --git a/third_party/ulib/ngunwind/src/fuchsia.c b/third_party/ulib/ngunwind/src/fuchsia.c
index 2c17feb..8af598a 100644
--- a/third_party/ulib/ngunwind/src/fuchsia.c
+++ b/third_party/ulib/ngunwind/src/fuchsia.c
@@ -31,8 +31,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <magenta/syscalls.h>
-#include <magenta/syscalls/debug.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/debug.h>
 
 #include "fuchsia.h"
 #include "fuchsia_i.h"
@@ -49,11 +49,11 @@
   return rc;
 }
 
-static mx_status_t
-read_mem (mx_handle_t h, mx_vaddr_t vaddr, void* ptr, size_t len)
+static zx_status_t
+read_mem (zx_handle_t h, zx_vaddr_t vaddr, void* ptr, size_t len)
 {
   size_t actual;
-  mx_status_t status = mx_process_read_memory (h, vaddr, ptr, len, &actual);
+  zx_status_t status = zx_process_read_memory (h, vaddr, ptr, len, &actual);
   if (status < 0)
   {
     Debug (3, "read_mem @0x%" PRIxPTR " FAILED %d\n", vaddr, status);
@@ -63,29 +63,29 @@
   {
     // TODO: Use %zd when MG-164 is fixed.
     Debug (3, "read_mem @0x%" PRIxPTR " FAILED, short read %zd\n", vaddr, actual);
-    return MX_ERR_IO;
+    return ZX_ERR_IO;
   }
-  return MX_OK;
+  return ZX_OK;
 }
 
-static mx_status_t
-get_inferior_greg_buf_size (mx_handle_t thread, uint32_t* regset_size)
+static zx_status_t
+get_inferior_greg_buf_size (zx_handle_t thread, uint32_t* regset_size)
 {
   // The general regs are defined to be in regset zero.
-  mx_status_t status = mx_thread_read_state (thread, MX_THREAD_STATE_REGSET0,
+  zx_status_t status = zx_thread_read_state (thread, ZX_THREAD_STATE_REGSET0,
                                              NULL, 0, regset_size);
-  assert (status != MX_OK);
-  if (status == MX_ERR_BUFFER_TOO_SMALL)
-    status = MX_OK;
+  assert (status != ZX_OK);
+  if (status == ZX_ERR_BUFFER_TOO_SMALL)
+    status = ZX_OK;
   return status;
 }
 
-static mx_status_t
-read_inferior_gregs (mx_handle_t thread, void* buf, size_t regset_size)
+static zx_status_t
+read_inferior_gregs (zx_handle_t thread, void* buf, size_t regset_size)
 {
   uint32_t buf_size = (uint32_t) regset_size;
   // By convention the general regs are in regset 0.
-  mx_status_t status = mx_thread_read_state (thread, MX_THREAD_STATE_REGSET0, buf, buf_size, &buf_size);
+  zx_status_t status = zx_thread_read_state (thread, ZX_THREAD_STATE_REGSET0, buf, buf_size, &buf_size);
   return status;
 }
 
@@ -234,13 +234,13 @@
 {
   Debug (3, "called, addr 0x%lx\n", (long) addr);
   unw_fuchsia_info_t* cxt = arg;
-  mx_handle_t process = cxt->process;
+  zx_handle_t process = cxt->process;
   if (write)
   {
     Debug (3, "writing to mem\n");
     return -UNW_EINVAL;
   }
-  mx_status_t status = read_mem (process, addr, val, sizeof(*val));
+  zx_status_t status = read_mem (process, addr, val, sizeof(*val));
   if (status < 0)
       return -UNW_EINVAL;
   char dump[3 * 8 + 1];
@@ -255,13 +255,13 @@
 {
   Debug (3, "called, addr 0x%lx, size %lu\n", (long) addr, (long) size);
   unw_fuchsia_info_t* cxt = arg;
-  mx_handle_t process = cxt->process;
+  zx_handle_t process = cxt->process;
   if (write)
   {
     Debug (3, "writing to mem\n");
     return -UNW_EINVAL;
   }
-  mx_status_t status = read_mem (process, addr, buf, size);
+  zx_status_t status = read_mem (process, addr, buf, size);
   if (status < 0)
   {
     Debug (3, "read failed: %d\n", status);
@@ -282,7 +282,7 @@
 {
   Debug (3, "called, regno %d\n", (int) reg);
   unw_fuchsia_info_t* cxt = arg;
-  mx_handle_t thread = cxt->thread;
+  zx_handle_t thread = cxt->thread;
   if (write)
   {
     Debug (3, "writing to reg\n");
@@ -294,8 +294,8 @@
     return -UNW_EBADREG;
   }
   uint32_t regset_size;
-  mx_status_t status = get_inferior_greg_buf_size (thread, &regset_size);
-  if (status != MX_OK)
+  zx_status_t status = get_inferior_greg_buf_size (thread, &regset_size);
+  if (status != ZX_OK)
   {
     Debug (3, "unable to get greg buf size: %d\n", status);
     return -UNW_EUNSPEC;
@@ -306,7 +306,7 @@
     Debug (3, "malloc failed\n");
     return -UNW_ENOMEM;
   }
-  mx_status_t r = read_inferior_gregs (thread, buf, regset_size);
+  zx_status_t r = read_inferior_gregs (thread, buf, regset_size);
   if (r < 0)
   {
     Debug (3, "error reading gregs: %d\n", r);
@@ -361,7 +361,7 @@
 };
 
 unw_fuchsia_info_t*
-unw_create_fuchsia(mx_handle_t process, mx_handle_t thread,
+unw_create_fuchsia(zx_handle_t process, zx_handle_t thread,
                    struct dsoinfo* dsos, unw_dso_lookup_func_t* lookup_dso)
 {
     unw_fuchsia_info_t* result = malloc (sizeof (*result));
diff --git a/third_party/ulib/uboringssl/README.fuchsia.md b/third_party/ulib/uboringssl/README.fuchsia.md
index c3a5a25..d4213ce 100644
--- a/third_party/ulib/uboringssl/README.fuchsia.md
+++ b/third_party/ulib/uboringssl/README.fuchsia.md
@@ -12,9 +12,9 @@
 <ul>
 <li>Code which should be disabled when in used in kernel has
 <code>#ifdef _KERNEL</code> guards added.</li>
-<li>Code which is added for Magenta is guarded by
+<li>Code which is added for Zircon is guarded by
 <code>#ifdef \__Fuchsia\__</code>.</li>
-<li>New source files are named with a *'-magenta.cpp'* suffix.</li>
+<li>New source files are named with a *'-zircon.cpp'* suffix.</li>
 </ul>
 
 All other code is unchanged from BoringSSL.
@@ -31,7 +31,7 @@
 
 This subset does not include tests from BoringSSL.  When updating from
 [BoringSSL][boringssl], maintainers should first ensure the unit tests in that
-package pass on Fuchsia before updating the subset for Magenta.
+package pass on Fuchsia before updating the subset for Zircon.
 
 Finally, maintainers should update this file with the new [revision][revision]
 of BoringSSL to provide an easy way to confirm boring-crypto was checked.
@@ -42,7 +42,7 @@
 BoringSSL.
 
 [boringssl]: https://fuchsia.googlesource.com/third_party/boringssl/+/master/README.md "BoringSSL"
-[script]: https://fuchsia.googlesource.com/magenta/+/master/third_party/boring-crypto/scripts/check-boringssl.go "check-boringssl.go"
+[script]: https://fuchsia.googlesource.com/zircon/+/master/third_party/boring-crypto/scripts/check-boringssl.go "check-boringssl.go"
 [license]: https://fuchsia.googlesource.com/third_party/boringssl/+/master/LICENSE "BoringSSL license"
 
 [//]: # (UPDATE THE DIGEST WHEN ROLLING BORINGSSL)
diff --git a/third_party/ulib/uboringssl/crypto/cpu-aarch64-magenta.cpp b/third_party/ulib/uboringssl/crypto/cpu-aarch64-zircon.cpp
similarity index 87%
rename from third_party/ulib/uboringssl/crypto/cpu-aarch64-magenta.cpp
rename to third_party/ulib/uboringssl/crypto/cpu-aarch64-zircon.cpp
index 77f2655..65d0cae 100644
--- a/third_party/ulib/uboringssl/crypto/cpu-aarch64-magenta.cpp
+++ b/third_party/ulib/uboringssl/crypto/cpu-aarch64-zircon.cpp
@@ -12,7 +12,7 @@
 
 void OPENSSL_cpuid_setup(void) {
     // TODO(aarongreen): Determine processor cryptographic capabilities. See
-    // magenta/third_party/ulib/musl/include/sys/auxv.h. Without a mechanism
+    // zircon/third_party/ulib/musl/include/sys/auxv.h. Without a mechanism
     // similar to AT_HWCAP, there's currently nothing discoverable.
     return;
 }
diff --git a/third_party/ulib/uboringssl/rules.mk b/third_party/ulib/uboringssl/rules.mk
index f62df2b..e1c0beb 100644
--- a/third_party/ulib/uboringssl/rules.mk
+++ b/third_party/ulib/uboringssl/rules.mk
@@ -11,7 +11,7 @@
 MODULE_TYPE := userlib
 
 MODULE_SRCS := \
-    $(SRC_DIR)/cpu-aarch64-magenta.cpp \
+    $(SRC_DIR)/cpu-aarch64-zircon.cpp \
 
 MODULE_SRCS += \
     $(SRC_DIR)/chacha/chacha.c \
@@ -36,7 +36,7 @@
 MODULE_NAME := uboringssl
 
 MODULE_LIBS := \
-    system/ulib/mxio \
+    system/ulib/fdio \
     system/ulib/c \
 
 include make/module.mk
diff --git a/third_party/ulib/uboringssl/scripts/check-boringssl.go b/third_party/ulib/uboringssl/scripts/check-boringssl.go
index f06c877..0142f8f 100644
--- a/third_party/ulib/uboringssl/scripts/check-boringssl.go
+++ b/third_party/ulib/uboringssl/scripts/check-boringssl.go
@@ -22,7 +22,7 @@
 
 const (
   DefaultBoringSSL = "//third_party/boringssl"
-  DefaultMagenta = "//magenta/third_party/ulib/uboringssl"
+  DefaultZircon = "//zircon/third_party/ulib/uboringssl"
 )
 
 // GetRealPath returns a canonical path, with '//' replaced by $FUCHSIA_DIR
@@ -71,9 +71,9 @@
 
 // IsValidAddedFile returns whether a file found only in boring-crypto and not
 // in boringssl is a valid addition; that is, if it includes a Fuchsia copyright
-// and ends in a -magenta.cpp suffix.
+// and ends in a -zircon.cpp suffix.
 func IsValidAddedFile(path string) bool {
-  if !strings.HasSuffix(path, "-magenta.cpp") {
+  if !strings.HasSuffix(path, "-zircon.cpp") {
     return false
   }
   file, err := os.Open(path)
@@ -184,7 +184,7 @@
 // Main function
 func main() {
   bsslFlag := flag.String("boringssl", DefaultBoringSSL, "BoringSSL repository")
-  mxFlag := flag.String("boring-crypto", DefaultMagenta, "boring-crypto path")
+  mxFlag := flag.String("boring-crypto", DefaultZircon, "boring-crypto path")
   flag.Parse()
   mxRoot :=  GetRealPath(*mxFlag)
   bsslRoot :=  GetRealPath(*bsslFlag)