blob: 7b939122b02cedb158777b339e4854f76f47b38d [file] [log] [blame] [edit]
// 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.
alias Status = int32;
// These aliases all represent points in or quantities of time.
// See the block comments on the declaration of the associated C types in
// //zircon/system/public/zircon/time.h for more information on each of these
// types. Further documentation on timelines in Fuchsia can be found in
// https://fuchsia.dev/fuchsia-src/concepts/kernel/time/overview.
//
// zx_time_t: A point in time on either timeline in nanoseconds (ns).
alias Time = int64;
// zx_instant_mono_t: A point in time on the mono timeline in ns.
alias InstantMono = int64;
// zx_instant_boot_t: A point in time on the boot timeline in ns.
alias InstantBoot = int64;
// zx_ticks_t: A point in time or quantity of hardware ticks.
alias Ticks = int64;
// zx_instant_mono_ticks_t: A point in time on the mono timeline in ticks.
alias InstantMonoTicks = int64;
// zx_instant_boot_ticks_t: A point in time on the boot timeline in ticks.
alias InstantBootTicks = int64;
// zx_duration_t: A quantity of time in nanoseconds.
alias Duration = int64;
// zx_duration_mono_t: A quantity of time on the mono timeline in ns.
alias DurationMono = int64;
// zx_duration_boot_t: A quantity of time on the boot timeline in ns.
alias DurationBoot = int64;
// zx_koid_t: global kernel object id.
alias Koid = uint64;
// zx_off_t: offset.
alias Off = uint64;
// TODO(https://fxbug.dev/42128146): 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 IOB_MAX_REGIONS uint64 = 64;
const MAX_NAME_LEN uint64 = 32;
const MAX_CPUS uint64 = 512;
type ObjType = 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;
IOB = 33;
};
resource_definition Handle : uint32 {
properties {
subtype ObjType;
rights Rights;
};
};