blob: 2c631d3bad98570fcfaa6a675c7f7dfd787d6949 [file] [log] [blame]
// Copyright 2020 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.
// This specific FIDL file is used in two contexts:
//
// 1. Define the `zx` library for plain-vanilla FIDL files, i.e. channel
// transport
// 2. Part of the overall definition of the Kernel ABI, i.e. Syscall transport
//
// Since the FIDL compiler does not support splitting definitions per-transport
// yet, we split definitions by file.
library zx;
// zx_status_t and errors.h.
//
// TODO(fxbug.dev/109734): Status.
alias status = int32;
// zx_time_t: absolute monotonic time in nanoseconds, from a device-specific
// timebase defined here:
// https://fuchsia.dev/fuchsia-src/concepts/kernel/time/monotonic.md
//
// TODO(fxbug.dev/109734): Time.
alias time = int64;
// zx_duration_t: a duration in nanoseconds.
//
// TODO(fxbug.dev/109734): Duration.
alias duration = int64;
// zx_ticks_t: a duration in hardware ticks.
//
// TODO(fxbug.dev/109734): Ticks.
alias ticks = int64;
// zx_koid_t: global kernel object id.
//
// TODO(fxbug.dev/109734): Koid.
alias koid = uint64;
// zx_vaddr_t: virtual address.
//
// TODO(fxbug.dev/109734): Vaddr.
alias vaddr = uint64;
// zx_paddr_t: physical address.
//
// TODO(fxbug.dev/109734): Paddr.
alias paddr = uint64;
// zx_paddr32_t: low mem physical address.
//
// TODO(fxbug.dev/109734): Paddr32.
alias paddr32 = uint32;
// zx_gpaddr_t: hypervisor guest physical addresses.
//
// TODO(fxbug.dev/109734): Gpaddr.
alias gpaddr = uint64;
// zx_off_t: offset.
//
// TODO(fxbug.dev/109734): Off.
alias off = uint64;
// See zircon/processargs.h.
//
// TODO(fxbug.dev/109734): Procarg.
alias procarg = uint32;
// zx_signals_t.
//
// TODO(fxbug.dev/109734): Signals.
alias signals = uint32;
// TODO(fxbug.dev/51002): These are currently duplicated with zircon/types.h.
// Eventually the definitions in zircon/types.h will be generated from this
// source.
const CHANNEL_MAX_MSG_BYTES uint64 = 65536;
const CHANNEL_MAX_MSG_HANDLES uint64 = 64;
const MAX_NAME_LEN uint64 = 32;
const MAX_CPUS uint64 = 512;
// TODO(fxbug.dev/109734): ObjType.
type obj_type = strict enum : uint32 {
NONE = 0;
PROCESS = 1;
THREAD = 2;
VMO = 3;
CHANNEL = 4;
EVENT = 5;
PORT = 6;
INTERRUPT = 9;
PCI_DEVICE = 11;
LOG = 12;
SOCKET = 14;
RESOURCE = 15;
EVENTPAIR = 16;
JOB = 17;
VMAR = 18;
FIFO = 19;
GUEST = 20;
VCPU = 21;
TIMER = 22;
IOMMU = 23;
BTI = 24;
PROFILE = 25;
PMT = 26;
SUSPEND_TOKEN = 27;
PAGER = 28;
EXCEPTION = 29;
CLOCK = 30;
STREAM = 31;
MSI = 32;
};
resource_definition handle : uint32 {
properties {
subtype obj_type;
rights rights;
};
};