| // Copyright 2018 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. |
| |
| part of zircon; |
| |
| // This is autogenerated from Zircon headers. Do not edit directly. |
| // Generated by //topaz/public/dart/zircon/extract-zircon-constants.py |
| |
| // ignore_for_file: constant_identifier_names |
| // ignore_for_file: public_member_api_docs |
| abstract class ZX { |
| ZX._(); |
| static const int OK = 0; |
| static const int ERR_INTERNAL = -1; |
| static const int ERR_NOT_SUPPORTED = -2; |
| static const int ERR_NO_RESOURCES = -3; |
| static const int ERR_NO_MEMORY = -4; |
| static const int ERR_INTERNAL_INTR_RETRY = -6; |
| static const int ERR_INVALID_ARGS = -10; |
| static const int ERR_BAD_HANDLE = -11; |
| static const int ERR_WRONG_TYPE = -12; |
| static const int ERR_BAD_SYSCALL = -13; |
| static const int ERR_OUT_OF_RANGE = -14; |
| static const int ERR_BUFFER_TOO_SMALL = -15; |
| static const int ERR_BAD_STATE = -20; |
| static const int ERR_TIMED_OUT = -21; |
| static const int ERR_SHOULD_WAIT = -22; |
| static const int ERR_CANCELED = -23; |
| static const int ERR_PEER_CLOSED = -24; |
| static const int ERR_NOT_FOUND = -25; |
| static const int ERR_ALREADY_EXISTS = -26; |
| static const int ERR_ALREADY_BOUND = -27; |
| static const int ERR_UNAVAILABLE = -28; |
| static const int ERR_ACCESS_DENIED = -30; |
| static const int ERR_IO = -40; |
| static const int ERR_IO_REFUSED = -41; |
| static const int ERR_IO_DATA_INTEGRITY = -42; |
| static const int ERR_IO_DATA_LOSS = -43; |
| static const int ERR_IO_NOT_PRESENT = -44; |
| static const int ERR_IO_OVERRUN = -45; |
| static const int ERR_IO_MISSED_DEADLINE = -46; |
| static const int ERR_IO_INVALID = -47; |
| static const int ERR_BAD_PATH = -50; |
| static const int ERR_NOT_DIR = -51; |
| static const int ERR_NOT_FILE = -52; |
| static const int ERR_FILE_BIG = -53; |
| static const int ERR_NO_SPACE = -54; |
| static const int ERR_NOT_EMPTY = -55; |
| static const int ERR_STOP = -60; |
| static const int ERR_NEXT = -61; |
| static const int ERR_ASYNC = -62; |
| static const int ERR_PROTOCOL_NOT_SUPPORTED = -70; |
| static const int ERR_ADDRESS_UNREACHABLE = -71; |
| static const int ERR_ADDRESS_IN_USE = -72; |
| static const int ERR_NOT_CONNECTED = -73; |
| static const int ERR_CONNECTION_REFUSED = -74; |
| static const int ERR_CONNECTION_RESET = -75; |
| static const int ERR_CONNECTION_ABORTED = -76; |
| static const int HANDLE_INVALID = 0; |
| static const int TIME_INFINITE = 0xFFFFFFFFFFFFFFFF; |
| static const int CLOCK_MONOTONIC = 0; |
| static const int CLOCK_UTC = 1; |
| static const int CLOCK_THREAD = 2; |
| static const int SIGNAL_NONE = 0; |
| static const int USER_SIGNAL_ALL = 0xff000000; |
| static const int USER_SIGNAL_0 = 1 << 24; |
| static const int USER_SIGNAL_1 = 1 << 25; |
| static const int USER_SIGNAL_2 = 1 << 26; |
| static const int USER_SIGNAL_3 = 1 << 27; |
| static const int USER_SIGNAL_4 = 1 << 28; |
| static const int USER_SIGNAL_5 = 1 << 29; |
| static const int USER_SIGNAL_6 = 1 << 30; |
| static const int USER_SIGNAL_7 = 1 << 31; |
| static const int SIGNAL_HANDLE_CLOSED = 1 << 23; |
| static const int EVENT_SIGNALED = 1 << 3; |
| static const int EVENT_SIGNAL_MASK = (0xff000000) | (1 << 3); |
| static const int EVENTPAIR_SIGNALED = 1 << 3; |
| static const int EVENTPAIR_PEER_CLOSED = 1 << 2; |
| static const int EVENTPAIR_SIGNAL_MASK = (0xff000000) | (1 << 3) | (1 << 2); |
| static const int CHANNEL_READABLE = 1 << 0; |
| static const int CHANNEL_WRITABLE = 1 << 1; |
| static const int CHANNEL_PEER_CLOSED = 1 << 2; |
| static const int SOCKET_READABLE = 1 << 0; |
| static const int SOCKET_WRITABLE = 1 << 1; |
| static const int SOCKET_PEER_CLOSED = 1 << 2; |
| static const int SOCKET_READ_DISABLED = 1 << 4; |
| static const int SOCKET_WRITE_DISABLED = 1 << 5; |
| static const int SOCKET_CONTROL_READABLE = 1 << 6; |
| static const int SOCKET_CONTROL_WRITABLE = 1 << 7; |
| static const int SOCKET_ACCEPT = 1 << 8; |
| static const int SOCKET_SHARE = 1 << 9; |
| static const int FIFO_READABLE = 1 << 0; |
| static const int FIFO_WRITABLE = 1 << 1; |
| static const int FIFO_PEER_CLOSED = 1 << 2; |
| static const int TASK_TERMINATED = 1 << 3; |
| static const int JOB_NO_PROCESSES = 1 << 3; |
| static const int JOB_NO_JOBS = 1 << 4; |
| static const int PROCESS_TERMINATED = 1 << 3; |
| static const int THREAD_TERMINATED = 1 << 3; |
| static const int THREAD_RUNNING = 1 << 4; |
| static const int THREAD_SUSPENDED = 1 << 5; |
| static const int LOG_READABLE = 1 << 0; |
| static const int LOG_WRITABLE = 1 << 1; |
| static const int TIMER_SIGNALED = 1 << 3; |
| static const int VMO_ZERO_CHILDREN = 1 << 3; |
| static const int KOID_INVALID = 0; |
| static const int KOID_KERNEL = 1; |
| static const int WAIT_MANY_MAX_ITEMS = 16; |
| static const int RIGHT_NONE = 0; |
| static const int RIGHT_DUPLICATE = 1 << 0; |
| static const int RIGHT_TRANSFER = 1 << 1; |
| static const int RIGHT_READ = 1 << 2; |
| static const int RIGHT_WRITE = 1 << 3; |
| static const int RIGHT_EXECUTE = 1 << 4; |
| static const int RIGHT_MAP = 1 << 5; |
| static const int RIGHT_GET_PROPERTY = 1 << 6; |
| static const int RIGHT_SET_PROPERTY = 1 << 7; |
| static const int RIGHT_ENUMERATE = 1 << 8; |
| static const int RIGHT_DESTROY = 1 << 9; |
| static const int RIGHT_SET_POLICY = 1 << 10; |
| static const int RIGHT_GET_POLICY = 1 << 11; |
| static const int RIGHT_SIGNAL = 1 << 12; |
| static const int RIGHT_SIGNAL_PEER = 1 << 13; |
| static const int RIGHT_WAIT = 1 << 14; |
| static const int RIGHT_INSPECT = 1 << 15; |
| static const int RIGHT_MANAGE_JOB = 1 << 16; |
| static const int RIGHT_MANAGE_PROCESS = 1 << 17; |
| static const int RIGHT_MANAGE_THREAD = 1 << 18; |
| static const int RIGHT_APPLY_PROFILE = 1 << 19; |
| static const int RIGHT_SAME_RIGHTS = 1 << 31; |
| static const int RIGHTS_BASIC = (1 << 1) | (1 << 0) | (1 << 14) | (1 << 15); |
| static const int RIGHTS_IO = (1 << 2) | (1 << 3); |
| static const int RIGHTS_PROPERTY = (1 << 6) | (1 << 7); |
| static const int RIGHTS_POLICY = (1 << 11) | (1 << 10); |
| static const int VMO_OP_COMMIT = 1; |
| static const int VMO_OP_DECOMMIT = 2; |
| static const int VMO_OP_LOCK = 3; |
| static const int VMO_OP_UNLOCK = 4; |
| static const int VMO_OP_CACHE_SYNC = 6; |
| static const int VMO_OP_CACHE_INVALIDATE = 7; |
| static const int VMO_OP_CACHE_CLEAN = 8; |
| static const int VMO_OP_CACHE_CLEAN_INVALIDATE = 9; |
| static const int VMO_CLONE_COPY_ON_WRITE = 1; |
| static const int VM_FLAG_PERM_READ = 1 << 0; |
| static const int VM_FLAG_PERM_WRITE = 1 << 1; |
| static const int VM_FLAG_PERM_EXECUTE = 1 << 2; |
| static const int VM_FLAG_COMPACT = 1 << 3; |
| static const int VM_FLAG_SPECIFIC = 1 << 4; |
| static const int VM_FLAG_SPECIFIC_OVERWRITE = 1 << 5; |
| static const int VM_FLAG_CAN_MAP_SPECIFIC = 1 << 6; |
| static const int VM_FLAG_CAN_MAP_READ = 1 << 7; |
| static const int VM_FLAG_CAN_MAP_WRITE = 1 << 8; |
| static const int VM_FLAG_CAN_MAP_EXECUTE = 1 << 9; |
| static const int VM_FLAG_MAP_RANGE = 1 << 10; |
| static const int MAX_NAME_LEN = 32; |
| static const int CPRNG_DRAW_MAX_LEN = 256; |
| static const int CPRNG_ADD_ENTROPY_MAX_LEN = 256; |
| static const int INTERRUPT_REMAP_IRQ = 0x1; |
| static const int INTERRUPT_MODE_DEFAULT = 0 << 1; |
| static const int INTERRUPT_MODE_EDGE_LOW = 1 << 1; |
| static const int INTERRUPT_MODE_EDGE_HIGH = 2 << 1; |
| static const int INTERRUPT_MODE_LEVEL_LOW = 3 << 1; |
| static const int INTERRUPT_MODE_LEVEL_HIGH = 4 << 1; |
| static const int INTERRUPT_MODE_EDGE_BOTH = 5 << 1; |
| static const int INTERRUPT_MODE_MASK = 0xe; |
| static const int INTERRUPT_VIRTUAL = 0x10; |
| static const int INTERRUPT_SLOT_USER = 62; |
| static const int INTERRUPT_MAX_SLOTS = 62; |
| static const int PCI_INTERRUPT_SLOT = 0; |
| static const int CHANNEL_READ_MAY_DISCARD = 1; |
| static const int CHANNEL_MAX_MSG_BYTES = 65536; |
| static const int CHANNEL_MAX_MSG_HANDLES = 64; |
| static const int SOCKET_SHUTDOWN_WRITE = 1 << 0; |
| static const int SOCKET_SHUTDOWN_READ = 1 << 1; |
| static const int SOCKET_SHUTDOWN_MASK = (1 << 0) | (1 << 1); |
| static const int SOCKET_STREAM = 0 << 0; |
| static const int SOCKET_DATAGRAM = 1 << 0; |
| static const int SOCKET_HAS_CONTROL = 1 << 1; |
| static const int SOCKET_HAS_ACCEPT = 1 << 2; |
| static const int SOCKET_CREATE_MASK = (1 << 0) | (1 << 1) | (1 << 2); |
| static const int SOCKET_CONTROL = 1 << 2; |
| static const int CACHE_POLICY_CACHED = 0; |
| static const int CACHE_POLICY_UNCACHED = 1; |
| static const int CACHE_POLICY_UNCACHED_DEVICE = 2; |
| static const int CACHE_POLICY_WRITE_COMBINING = 3; |
| static const int CACHE_POLICY_MASK = 3; |
| static const int CACHE_FLUSH_INSN = 1 << 0; |
| static const int CACHE_FLUSH_DATA = 1 << 1; |
| static const int CACHE_FLUSH_INVALIDATE = 1 << 2; |
| static const int TIMER_SLACK_CENTER = 0; |
| static const int TIMER_SLACK_EARLY = 1; |
| static const int TIMER_SLACK_LATE = 2; |
| static const int BTI_PERM_READ = 1 << 0; |
| static const int BTI_PERM_WRITE = 1 << 1; |
| static const int BTI_PERM_EXECUTE = 1 << 2; |
| static const int BTI_COMPRESS = 1 << 3; |
| static const int OBJ_TYPE_NONE = 0; |
| static const int OBJ_TYPE_PROCESS = 1; |
| static const int OBJ_TYPE_THREAD = 2; |
| static const int OBJ_TYPE_VMO = 3; |
| static const int OBJ_TYPE_CHANNEL = 4; |
| static const int OBJ_TYPE_EVENT = 5; |
| static const int OBJ_TYPE_PORT = 6; |
| static const int OBJ_TYPE_INTERRUPT = 9; |
| static const int OBJ_TYPE_PCI_DEVICE = 11; |
| static const int OBJ_TYPE_LOG = 12; |
| static const int OBJ_TYPE_SOCKET = 14; |
| static const int OBJ_TYPE_RESOURCE = 15; |
| static const int OBJ_TYPE_EVENTPAIR = 16; |
| static const int OBJ_TYPE_JOB = 17; |
| static const int OBJ_TYPE_VMAR = 18; |
| static const int OBJ_TYPE_FIFO = 19; |
| static const int OBJ_TYPE_GUEST = 20; |
| static const int OBJ_TYPE_VCPU = 21; |
| static const int OBJ_TYPE_TIMER = 22; |
| static const int OBJ_TYPE_IOMMU = 23; |
| static const int OBJ_TYPE_BTI = 24; |
| static const int OBJ_TYPE_PROFILE = 25; |
| static const int OBJ_TYPE_PMT = 26; |
| static const int OBJ_TYPE_SUSPEND_TOKEN = 27; |
| static const int OBJ_TYPE_LAST = 28; |
| } |
| |
| String getStringForStatus(int status) { |
| switch (status) { |
| case ZX.OK: |
| return 'OK'; |
| case ZX.ERR_INTERNAL: |
| return 'ERR_INTERNAL'; |
| case ZX.ERR_NOT_SUPPORTED: |
| return 'ERR_NOT_SUPPORTED'; |
| case ZX.ERR_NO_RESOURCES: |
| return 'ERR_NO_RESOURCES'; |
| case ZX.ERR_NO_MEMORY: |
| return 'ERR_NO_MEMORY'; |
| case ZX.ERR_INTERNAL_INTR_RETRY: |
| return 'ERR_INTERNAL_INTR_RETRY'; |
| case ZX.ERR_INVALID_ARGS: |
| return 'ERR_INVALID_ARGS'; |
| case ZX.ERR_BAD_HANDLE: |
| return 'ERR_BAD_HANDLE'; |
| case ZX.ERR_WRONG_TYPE: |
| return 'ERR_WRONG_TYPE'; |
| case ZX.ERR_BAD_SYSCALL: |
| return 'ERR_BAD_SYSCALL'; |
| case ZX.ERR_OUT_OF_RANGE: |
| return 'ERR_OUT_OF_RANGE'; |
| case ZX.ERR_BUFFER_TOO_SMALL: |
| return 'ERR_BUFFER_TOO_SMALL'; |
| case ZX.ERR_BAD_STATE: |
| return 'ERR_BAD_STATE'; |
| case ZX.ERR_TIMED_OUT: |
| return 'ERR_TIMED_OUT'; |
| case ZX.ERR_SHOULD_WAIT: |
| return 'ERR_SHOULD_WAIT'; |
| case ZX.ERR_CANCELED: |
| return 'ERR_CANCELED'; |
| case ZX.ERR_PEER_CLOSED: |
| return 'ERR_PEER_CLOSED'; |
| case ZX.ERR_NOT_FOUND: |
| return 'ERR_NOT_FOUND'; |
| case ZX.ERR_ALREADY_EXISTS: |
| return 'ERR_ALREADY_EXISTS'; |
| case ZX.ERR_ALREADY_BOUND: |
| return 'ERR_ALREADY_BOUND'; |
| case ZX.ERR_UNAVAILABLE: |
| return 'ERR_UNAVAILABLE'; |
| case ZX.ERR_ACCESS_DENIED: |
| return 'ERR_ACCESS_DENIED'; |
| case ZX.ERR_IO: |
| return 'ERR_IO'; |
| case ZX.ERR_IO_REFUSED: |
| return 'ERR_IO_REFUSED'; |
| case ZX.ERR_IO_DATA_INTEGRITY: |
| return 'ERR_IO_DATA_INTEGRITY'; |
| case ZX.ERR_IO_DATA_LOSS: |
| return 'ERR_IO_DATA_LOSS'; |
| case ZX.ERR_IO_NOT_PRESENT: |
| return 'ERR_IO_NOT_PRESENT'; |
| case ZX.ERR_IO_OVERRUN: |
| return 'ERR_IO_OVERRUN'; |
| case ZX.ERR_IO_MISSED_DEADLINE: |
| return 'ERR_IO_MISSED_DEADLINE'; |
| case ZX.ERR_IO_INVALID: |
| return 'ERR_IO_INVALID'; |
| case ZX.ERR_BAD_PATH: |
| return 'ERR_BAD_PATH'; |
| case ZX.ERR_NOT_DIR: |
| return 'ERR_NOT_DIR'; |
| case ZX.ERR_NOT_FILE: |
| return 'ERR_NOT_FILE'; |
| case ZX.ERR_FILE_BIG: |
| return 'ERR_FILE_BIG'; |
| case ZX.ERR_NO_SPACE: |
| return 'ERR_NO_SPACE'; |
| case ZX.ERR_NOT_EMPTY: |
| return 'ERR_NOT_EMPTY'; |
| case ZX.ERR_STOP: |
| return 'ERR_STOP'; |
| case ZX.ERR_NEXT: |
| return 'ERR_NEXT'; |
| case ZX.ERR_ASYNC: |
| return 'ERR_ASYNC'; |
| case ZX.ERR_PROTOCOL_NOT_SUPPORTED: |
| return 'ERR_PROTOCOL_NOT_SUPPORTED'; |
| case ZX.ERR_ADDRESS_UNREACHABLE: |
| return 'ERR_ADDRESS_UNREACHABLE'; |
| case ZX.ERR_ADDRESS_IN_USE: |
| return 'ERR_ADDRESS_IN_USE'; |
| case ZX.ERR_NOT_CONNECTED: |
| return 'ERR_NOT_CONNECTED'; |
| case ZX.ERR_CONNECTION_REFUSED: |
| return 'ERR_CONNECTION_REFUSED'; |
| case ZX.ERR_CONNECTION_RESET: |
| return 'ERR_CONNECTION_RESET'; |
| case ZX.ERR_CONNECTION_ABORTED: |
| return 'ERR_CONNECTION_ABORTED'; |
| default: |
| return '(unknown: $status)'; |
| } |
| } |