aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / libc / src / unix / nto / neutrino.rs
| 1 | //! APIs that are specific to QNX Neutrino and not found in other operating systems |
| 2 | |
| 3 | use crate::prelude::*; |
| 4 | |
| 5 | pub type nto_job_t = crate::sync_t; |
| 6 | |
| 7 | s! { |
| 8 | pub struct syspage_entry_info { |
| 9 | pub entry_off: u16, |
| 10 | pub entry_size: u16, |
| 11 | } |
| 12 | pub struct syspage_array_info { |
| 13 | entry_off: u16, |
| 14 | entry_size: u16, |
| 15 | element_size: u16, |
| 16 | } |
| 17 | |
| 18 | pub struct intrspin { |
| 19 | pub value: c_uint, // volatile |
| 20 | } |
| 21 | |
| 22 | pub struct iov_t { |
| 23 | pub iov_base: *mut c_void, // union |
| 24 | pub iov_len: size_t, |
| 25 | } |
| 26 | |
| 27 | pub struct _itimer { |
| 28 | pub nsec: u64, |
| 29 | pub interval_nsec: u64, |
| 30 | } |
| 31 | |
| 32 | pub struct _msg_info64 { |
| 33 | pub nd: u32, |
| 34 | pub srcnd: u32, |
| 35 | pub pid: crate::pid_t, |
| 36 | pub tid: i32, |
| 37 | pub chid: i32, |
| 38 | pub scoid: i32, |
| 39 | pub coid: i32, |
| 40 | pub priority: i16, |
| 41 | pub flags: i16, |
| 42 | pub msglen: isize, |
| 43 | pub srcmsglen: isize, |
| 44 | pub dstmsglen: isize, |
| 45 | pub type_id: u32, |
| 46 | reserved: Padding<u32>, |
| 47 | } |
| 48 | |
| 49 | pub struct _cred_info { |
| 50 | pub ruid: crate::uid_t, |
| 51 | pub euid: crate::uid_t, |
| 52 | pub suid: crate::uid_t, |
| 53 | pub rgid: crate::gid_t, |
| 54 | pub egid: crate::gid_t, |
| 55 | pub sgid: crate::gid_t, |
| 56 | pub ngroups: u32, |
| 57 | pub grouplist: [crate::gid_t; 8], |
| 58 | } |
| 59 | |
| 60 | pub struct _client_info { |
| 61 | pub nd: u32, |
| 62 | pub pid: crate::pid_t, |
| 63 | pub sid: crate::pid_t, |
| 64 | pub flags: u32, |
| 65 | pub cred: crate::_cred_info, |
| 66 | } |
| 67 | |
| 68 | pub struct _client_able { |
| 69 | pub ability: u32, |
| 70 | pub flags: u32, |
| 71 | pub range_lo: u64, |
| 72 | pub range_hi: u64, |
| 73 | } |
| 74 | |
| 75 | pub struct nto_channel_config { |
| 76 | pub event: crate::sigevent, |
| 77 | pub num_pulses: c_uint, |
| 78 | pub rearm_threshold: c_uint, |
| 79 | pub options: c_uint, |
| 80 | reserved: Padding<[c_uint; 3]>, |
| 81 | } |
| 82 | |
| 83 | // TODO: The following structures are defined in a header file which doesn't |
| 84 | // appear as part of the default headers found in a standard installation |
| 85 | // of Neutrino 7.1 SDP. Commented out for now. |
| 86 | //pub struct _asyncmsg_put_header { |
| 87 | // pub err: c_int, |
| 88 | // pub iov: *mut crate::iov_t, |
| 89 | // pub parts: c_int, |
| 90 | // pub handle: c_uint, |
| 91 | // pub cb: Option< |
| 92 | // unsafe extern "C" fn( |
| 93 | // err: c_int, |
| 94 | // buf: *mut c_void, |
| 95 | // handle: c_uint, |
| 96 | // ) -> c_int>, |
| 97 | // pub put_hdr_flags: c_uint, |
| 98 | //} |
| 99 | |
| 100 | //pub struct _asyncmsg_connection_attr { |
| 101 | // pub call_back: Option< |
| 102 | // unsafe extern "C" fn( |
| 103 | // err: c_int, |
| 104 | // buff: *mut c_void, |
| 105 | // handle: c_uint, |
| 106 | // ) -> c_int>, |
| 107 | // pub buffer_size: size_t, |
| 108 | // pub max_num_buffer: c_uint, |
| 109 | // pub trigger_num_msg: c_uint, |
| 110 | // pub trigger_time: crate::_itimer, |
| 111 | // reserve: Padding<c_uint>, |
| 112 | //} |
| 113 | |
| 114 | //pub struct _asyncmsg_connection_descriptor { |
| 115 | // pub flags: c_uint, |
| 116 | // pub sendq_size: c_uint, |
| 117 | // pub sendq_head: c_uint, |
| 118 | // pub sendq_tail: c_uint, |
| 119 | // pub sendq_free: c_uint, |
| 120 | // pub err: c_int, |
| 121 | // pub ev: crate::sigevent, |
| 122 | // pub num_curmsg: c_uint, |
| 123 | // pub ttimer: crate::timer_t, |
| 124 | // pub block_con: crate::pthread_cond_t, |
| 125 | // pub mu: crate::pthread_mutex_t, |
| 126 | // reserved: Padding<c_uint>, |
| 127 | // pub attr: crate::_asyncmsg_connection_attr, |
| 128 | // reserves: Padding<[c_uint; 3]>, |
| 129 | // pub sendq: [crate::_asyncmsg_put_header; 1], // flexarray |
| 130 | //} |
| 131 | |
| 132 | pub struct __c_anonymous_struct_ev { |
| 133 | pub event: crate::sigevent, |
| 134 | pub coid: c_int, |
| 135 | } |
| 136 | |
| 137 | pub struct _channel_connect_attr { |
| 138 | // union |
| 139 | pub ev: crate::__c_anonymous_struct_ev, |
| 140 | } |
| 141 | |
| 142 | // FIXME(1.0): This should not implement `PartialEq` |
| 143 | #[allow(unpredictable_function_pointer_comparisons)] |
| 144 | pub struct _sighandler_info { |
| 145 | pub siginfo: crate::siginfo_t, |
| 146 | pub handler: Option<unsafe extern "C" fn(value: c_int)>, |
| 147 | pub context: *mut c_void, |
| 148 | } |
| 149 | |
| 150 | pub struct __c_anonymous_struct_time { |
| 151 | pub length: c_uint, |
| 152 | pub scale: c_uint, |
| 153 | } |
| 154 | |
| 155 | pub struct _idle_hook { |
| 156 | pub hook_size: c_uint, |
| 157 | pub cmd: c_uint, |
| 158 | pub mode: c_uint, |
| 159 | pub latency: c_uint, |
| 160 | pub next_fire: u64, |
| 161 | pub curr_time: u64, |
| 162 | pub tod_adjust: u64, |
| 163 | pub resp: c_uint, |
| 164 | pub time: __c_anonymous_struct_time, |
| 165 | pub trigger: crate::sigevent, |
| 166 | pub intrs: *mut c_uint, |
| 167 | pub block_stack_size: c_uint, |
| 168 | } |
| 169 | |
| 170 | pub struct _clockadjust { |
| 171 | pub tick_count: u32, |
| 172 | pub tick_nsec_inc: i32, |
| 173 | } |
| 174 | |
| 175 | pub struct qtime_entry { |
| 176 | pub cycles_per_sec: u64, |
| 177 | pub nsec_tod_adjust: u64, // volatile |
| 178 | pub nsec: u64, // volatile |
| 179 | pub nsec_inc: u32, |
| 180 | pub boot_time: u32, |
| 181 | pub adjust: _clockadjust, |
| 182 | pub timer_rate: u32, |
| 183 | pub timer_scale: i32, |
| 184 | pub timer_load: u32, |
| 185 | pub intr: i32, |
| 186 | pub epoch: u32, |
| 187 | pub flags: u32, |
| 188 | pub rr_interval_mul: u32, |
| 189 | pub timer_load_hi: u32, |
| 190 | pub nsec_stable: u64, // volatile |
| 191 | pub timer_load_max: u64, |
| 192 | pub timer_prog_time: u32, |
| 193 | spare: [u32; 7], |
| 194 | } |
| 195 | |
| 196 | pub struct _sched_info { |
| 197 | pub priority_min: c_int, |
| 198 | pub priority_max: c_int, |
| 199 | pub interval: u64, |
| 200 | pub priority_priv: c_int, |
| 201 | reserved: Padding<[c_int; 11]>, |
| 202 | } |
| 203 | |
| 204 | pub struct _timer_info { |
| 205 | pub itime: crate::_itimer, |
| 206 | pub otime: crate::_itimer, |
| 207 | pub flags: u32, |
| 208 | pub tid: i32, |
| 209 | pub notify: i32, |
| 210 | pub clockid: crate::clockid_t, |
| 211 | pub overruns: u32, |
| 212 | pub event: crate::sigevent, // union |
| 213 | } |
| 214 | |
| 215 | pub struct _clockperiod { |
| 216 | pub nsec: u32, |
| 217 | pub fract: i32, |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | s_no_extra_traits! { |
| 222 | #[repr(align(8))] |
| 223 | pub struct syspage_entry { |
| 224 | pub size: u16, |
| 225 | pub total_size: u16, |
| 226 | pub type_: u16, |
| 227 | pub num_cpu: u16, |
| 228 | pub system_private: syspage_entry_info, |
| 229 | pub old_asinfo: syspage_entry_info, |
| 230 | pub __mangle_name_to_cause_compilation_errs_meminfo: syspage_entry_info, |
| 231 | pub hwinfo: syspage_entry_info, |
| 232 | pub old_cpuinfo: syspage_entry_info, |
| 233 | pub old_cacheattr: syspage_entry_info, |
| 234 | pub qtime: syspage_entry_info, |
| 235 | pub callout: syspage_entry_info, |
| 236 | pub callin: syspage_entry_info, |
| 237 | pub typed_strings: syspage_entry_info, |
| 238 | pub strings: syspage_entry_info, |
| 239 | pub old_intrinfo: syspage_entry_info, |
| 240 | pub smp: syspage_entry_info, |
| 241 | pub pminfo: syspage_entry_info, |
| 242 | pub old_mdriver: syspage_entry_info, |
| 243 | spare0: [u32; 1], |
| 244 | __reserved: Padding<[u8; 160]>, // anonymous union with architecture dependent structs |
| 245 | pub new_asinfo: syspage_array_info, |
| 246 | pub new_cpuinfo: syspage_array_info, |
| 247 | pub new_cacheattr: syspage_array_info, |
| 248 | pub new_intrinfo: syspage_array_info, |
| 249 | pub new_mdriver: syspage_array_info, |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | pub const SYSMGR_PID: u32 = 1; |
| 254 | pub const SYSMGR_CHID: u32 = 1; |
| 255 | pub const SYSMGR_COID: u32 = _NTO_SIDE_CHANNEL; |
| 256 | pub const SYSMGR_HANDLE: u32 = 0; |
| 257 | |
| 258 | pub const STATE_DEAD: c_int = 0x00; |
| 259 | pub const STATE_RUNNING: c_int = 0x01; |
| 260 | pub const STATE_READY: c_int = 0x02; |
| 261 | pub const STATE_STOPPED: c_int = 0x03; |
| 262 | pub const STATE_SEND: c_int = 0x04; |
| 263 | pub const STATE_RECEIVE: c_int = 0x05; |
| 264 | pub const STATE_REPLY: c_int = 0x06; |
| 265 | pub const STATE_STACK: c_int = 0x07; |
| 266 | pub const STATE_WAITTHREAD: c_int = 0x08; |
| 267 | pub const STATE_WAITPAGE: c_int = 0x09; |
| 268 | pub const STATE_SIGSUSPEND: c_int = 0x0a; |
| 269 | pub const STATE_SIGWAITINFO: c_int = 0x0b; |
| 270 | pub const STATE_NANOSLEEP: c_int = 0x0c; |
| 271 | pub const STATE_MUTEX: c_int = 0x0d; |
| 272 | pub const STATE_CONDVAR: c_int = 0x0e; |
| 273 | pub const STATE_JOIN: c_int = 0x0f; |
| 274 | pub const STATE_INTR: c_int = 0x10; |
| 275 | pub const STATE_SEM: c_int = 0x11; |
| 276 | pub const STATE_WAITCTX: c_int = 0x12; |
| 277 | pub const STATE_NET_SEND: c_int = 0x13; |
| 278 | pub const STATE_NET_REPLY: c_int = 0x14; |
| 279 | pub const STATE_MAX: c_int = 0x18; |
| 280 | |
| 281 | pub const _NTO_TIMEOUT_RECEIVE: i32 = 1 << STATE_RECEIVE; |
| 282 | pub const _NTO_TIMEOUT_SEND: i32 = 1 << STATE_SEND; |
| 283 | pub const _NTO_TIMEOUT_REPLY: i32 = 1 << STATE_REPLY; |
| 284 | pub const _NTO_TIMEOUT_SIGSUSPEND: i32 = 1 << STATE_SIGSUSPEND; |
| 285 | pub const _NTO_TIMEOUT_SIGWAITINFO: i32 = 1 << STATE_SIGWAITINFO; |
| 286 | pub const _NTO_TIMEOUT_NANOSLEEP: i32 = 1 << STATE_NANOSLEEP; |
| 287 | pub const _NTO_TIMEOUT_MUTEX: i32 = 1 << STATE_MUTEX; |
| 288 | pub const _NTO_TIMEOUT_CONDVAR: i32 = 1 << STATE_CONDVAR; |
| 289 | pub const _NTO_TIMEOUT_JOIN: i32 = 1 << STATE_JOIN; |
| 290 | pub const _NTO_TIMEOUT_INTR: i32 = 1 << STATE_INTR; |
| 291 | pub const _NTO_TIMEOUT_SEM: i32 = 1 << STATE_SEM; |
| 292 | |
| 293 | pub const _NTO_MI_ENDIAN_BIG: u32 = 1; |
| 294 | pub const _NTO_MI_ENDIAN_DIFF: u32 = 2; |
| 295 | pub const _NTO_MI_UNBLOCK_REQ: u32 = 256; |
| 296 | pub const _NTO_MI_NET_CRED_DIRTY: u32 = 512; |
| 297 | pub const _NTO_MI_CONSTRAINED: u32 = 1024; |
| 298 | pub const _NTO_MI_CHROOT: u32 = 2048; |
| 299 | pub const _NTO_MI_BITS_64: u32 = 4096; |
| 300 | pub const _NTO_MI_BITS_DIFF: u32 = 8192; |
| 301 | pub const _NTO_MI_SANDBOX: u32 = 16384; |
| 302 | |
| 303 | pub const _NTO_CI_ENDIAN_BIG: u32 = 1; |
| 304 | pub const _NTO_CI_BKGND_PGRP: u32 = 4; |
| 305 | pub const _NTO_CI_ORPHAN_PGRP: u32 = 8; |
| 306 | pub const _NTO_CI_STOPPED: u32 = 128; |
| 307 | pub const _NTO_CI_UNABLE: u32 = 256; |
| 308 | pub const _NTO_CI_TYPE_ID: u32 = 512; |
| 309 | pub const _NTO_CI_CHROOT: u32 = 2048; |
| 310 | pub const _NTO_CI_BITS_64: u32 = 4096; |
| 311 | pub const _NTO_CI_SANDBOX: u32 = 16384; |
| 312 | pub const _NTO_CI_LOADER: u32 = 32768; |
| 313 | pub const _NTO_CI_FULL_GROUPS: u32 = 2147483648; |
| 314 | |
| 315 | pub const _NTO_TI_ACTIVE: u32 = 1; |
| 316 | pub const _NTO_TI_ABSOLUTE: u32 = 2; |
| 317 | pub const _NTO_TI_EXPIRED: u32 = 4; |
| 318 | pub const _NTO_TI_TOD_BASED: u32 = 8; |
| 319 | pub const _NTO_TI_TARGET_PROCESS: u32 = 16; |
| 320 | pub const _NTO_TI_REPORT_TOLERANCE: u32 = 32; |
| 321 | pub const _NTO_TI_PRECISE: u32 = 64; |
| 322 | pub const _NTO_TI_TOLERANT: u32 = 128; |
| 323 | pub const _NTO_TI_WAKEUP: u32 = 256; |
| 324 | pub const _NTO_TI_PROCESS_TOLERANT: u32 = 512; |
| 325 | pub const _NTO_TI_HIGH_RESOLUTION: u32 = 1024; |
| 326 | |
| 327 | pub const _PULSE_TYPE: u32 = 0; |
| 328 | pub const _PULSE_SUBTYPE: u32 = 0; |
| 329 | pub const _PULSE_CODE_UNBLOCK: i32 = -32; |
| 330 | pub const _PULSE_CODE_DISCONNECT: i32 = -33; |
| 331 | pub const _PULSE_CODE_THREADDEATH: i32 = -34; |
| 332 | pub const _PULSE_CODE_COIDDEATH: i32 = -35; |
| 333 | pub const _PULSE_CODE_NET_ACK: i32 = -36; |
| 334 | pub const _PULSE_CODE_NET_UNBLOCK: i32 = -37; |
| 335 | pub const _PULSE_CODE_NET_DETACH: i32 = -38; |
| 336 | pub const _PULSE_CODE_RESTART: i32 = -39; |
| 337 | pub const _PULSE_CODE_NORESTART: i32 = -40; |
| 338 | pub const _PULSE_CODE_UNBLOCK_RESTART: i32 = -41; |
| 339 | pub const _PULSE_CODE_UNBLOCK_TIMER: i32 = -42; |
| 340 | pub const _PULSE_CODE_MINAVAIL: u32 = 0; |
| 341 | pub const _PULSE_CODE_MAXAVAIL: u32 = 127; |
| 342 | |
| 343 | pub const _NTO_HARD_FLAGS_END: u32 = 1; |
| 344 | |
| 345 | pub const _NTO_PULSE_IF_UNIQUE: u32 = 4096; |
| 346 | pub const _NTO_PULSE_REPLACE: u32 = 8192; |
| 347 | |
| 348 | pub const _NTO_PF_NOCLDSTOP: u32 = 1; |
| 349 | pub const _NTO_PF_LOADING: u32 = 2; |
| 350 | pub const _NTO_PF_TERMING: u32 = 4; |
| 351 | pub const _NTO_PF_ZOMBIE: u32 = 8; |
| 352 | pub const _NTO_PF_NOZOMBIE: u32 = 16; |
| 353 | pub const _NTO_PF_FORKED: u32 = 32; |
| 354 | pub const _NTO_PF_ORPHAN_PGRP: u32 = 64; |
| 355 | pub const _NTO_PF_STOPPED: u32 = 128; |
| 356 | pub const _NTO_PF_DEBUG_STOPPED: u32 = 256; |
| 357 | pub const _NTO_PF_BKGND_PGRP: u32 = 512; |
| 358 | pub const _NTO_PF_NOISYNC: u32 = 1024; |
| 359 | pub const _NTO_PF_CONTINUED: u32 = 2048; |
| 360 | pub const _NTO_PF_CHECK_INTR: u32 = 4096; |
| 361 | pub const _NTO_PF_COREDUMP: u32 = 8192; |
| 362 | pub const _NTO_PF_RING0: u32 = 32768; |
| 363 | pub const _NTO_PF_SLEADER: u32 = 65536; |
| 364 | pub const _NTO_PF_WAITINFO: u32 = 131072; |
| 365 | pub const _NTO_PF_DESTROYALL: u32 = 524288; |
| 366 | pub const _NTO_PF_NOCOREDUMP: u32 = 1048576; |
| 367 | pub const _NTO_PF_WAITDONE: u32 = 4194304; |
| 368 | pub const _NTO_PF_TERM_WAITING: u32 = 8388608; |
| 369 | pub const _NTO_PF_ASLR: u32 = 16777216; |
| 370 | pub const _NTO_PF_EXECED: u32 = 33554432; |
| 371 | pub const _NTO_PF_APP_STOPPED: u32 = 67108864; |
| 372 | pub const _NTO_PF_64BIT: u32 = 134217728; |
| 373 | pub const _NTO_PF_NET: u32 = 268435456; |
| 374 | pub const _NTO_PF_NOLAZYSTACK: u32 = 536870912; |
| 375 | pub const _NTO_PF_NOEXEC_STACK: u32 = 1073741824; |
| 376 | pub const _NTO_PF_LOADER_PERMS: u32 = 2147483648; |
| 377 | |
| 378 | pub const _NTO_TF_INTR_PENDING: u32 = 65536; |
| 379 | pub const _NTO_TF_DETACHED: u32 = 131072; |
| 380 | pub const _NTO_TF_SHR_MUTEX: u32 = 262144; |
| 381 | pub const _NTO_TF_SHR_MUTEX_EUID: u32 = 524288; |
| 382 | pub const _NTO_TF_THREADS_HOLD: u32 = 1048576; |
| 383 | pub const _NTO_TF_UNBLOCK_REQ: u32 = 4194304; |
| 384 | pub const _NTO_TF_ALIGN_FAULT: u32 = 16777216; |
| 385 | pub const _NTO_TF_SSTEP: u32 = 33554432; |
| 386 | pub const _NTO_TF_ALLOCED_STACK: u32 = 67108864; |
| 387 | pub const _NTO_TF_NOMULTISIG: u32 = 134217728; |
| 388 | pub const _NTO_TF_LOW_LATENCY: u32 = 268435456; |
| 389 | pub const _NTO_TF_IOPRIV: u32 = 2147483648; |
| 390 | |
| 391 | pub const _NTO_TCTL_IO_PRIV: u32 = 1; |
| 392 | pub const _NTO_TCTL_THREADS_HOLD: u32 = 2; |
| 393 | pub const _NTO_TCTL_THREADS_CONT: u32 = 3; |
| 394 | pub const _NTO_TCTL_RUNMASK: u32 = 4; |
| 395 | pub const _NTO_TCTL_ALIGN_FAULT: u32 = 5; |
| 396 | pub const _NTO_TCTL_RUNMASK_GET_AND_SET: u32 = 6; |
| 397 | pub const _NTO_TCTL_PERFCOUNT: u32 = 7; |
| 398 | pub const _NTO_TCTL_ONE_THREAD_HOLD: u32 = 8; |
| 399 | pub const _NTO_TCTL_ONE_THREAD_CONT: u32 = 9; |
| 400 | pub const _NTO_TCTL_RUNMASK_GET_AND_SET_INHERIT: u32 = 10; |
| 401 | pub const _NTO_TCTL_NAME: u32 = 11; |
| 402 | pub const _NTO_TCTL_RCM_GET_AND_SET: u32 = 12; |
| 403 | pub const _NTO_TCTL_SHR_MUTEX: u32 = 13; |
| 404 | pub const _NTO_TCTL_IO: u32 = 14; |
| 405 | pub const _NTO_TCTL_NET_KIF_GET_AND_SET: u32 = 15; |
| 406 | pub const _NTO_TCTL_LOW_LATENCY: u32 = 16; |
| 407 | pub const _NTO_TCTL_ADD_EXIT_EVENT: u32 = 17; |
| 408 | pub const _NTO_TCTL_DEL_EXIT_EVENT: u32 = 18; |
| 409 | pub const _NTO_TCTL_IO_LEVEL: u32 = 19; |
| 410 | pub const _NTO_TCTL_RESERVED: u32 = 2147483648; |
| 411 | pub const _NTO_TCTL_IO_LEVEL_INHERIT: u32 = 1073741824; |
| 412 | pub const _NTO_IO_LEVEL_NONE: u32 = 1; |
| 413 | pub const _NTO_IO_LEVEL_1: u32 = 2; |
| 414 | pub const _NTO_IO_LEVEL_2: u32 = 3; |
| 415 | |
| 416 | pub const _NTO_THREAD_NAME_MAX: u32 = 100; |
| 417 | |
| 418 | pub const _NTO_CHF_FIXED_PRIORITY: u32 = 1; |
| 419 | pub const _NTO_CHF_UNBLOCK: u32 = 2; |
| 420 | pub const _NTO_CHF_THREAD_DEATH: u32 = 4; |
| 421 | pub const _NTO_CHF_DISCONNECT: u32 = 8; |
| 422 | pub const _NTO_CHF_NET_MSG: u32 = 16; |
| 423 | pub const _NTO_CHF_SENDER_LEN: u32 = 32; |
| 424 | pub const _NTO_CHF_COID_DISCONNECT: u32 = 64; |
| 425 | pub const _NTO_CHF_REPLY_LEN: u32 = 128; |
| 426 | pub const _NTO_CHF_PULSE_POOL: u32 = 256; |
| 427 | pub const _NTO_CHF_ASYNC_NONBLOCK: u32 = 512; |
| 428 | pub const _NTO_CHF_ASYNC: u32 = 1024; |
| 429 | pub const _NTO_CHF_GLOBAL: u32 = 2048; |
| 430 | pub const _NTO_CHF_PRIVATE: u32 = 4096; |
| 431 | pub const _NTO_CHF_MSG_PAUSING: u32 = 8192; |
| 432 | pub const _NTO_CHF_INHERIT_RUNMASK: u32 = 16384; |
| 433 | pub const _NTO_CHF_UNBLOCK_TIMER: u32 = 32768; |
| 434 | |
| 435 | pub const _NTO_CHO_CUSTOM_EVENT: u32 = 1; |
| 436 | |
| 437 | pub const _NTO_COF_CLOEXEC: u32 = 1; |
| 438 | pub const _NTO_COF_DEAD: u32 = 2; |
| 439 | pub const _NTO_COF_NOSHARE: u32 = 64; |
| 440 | pub const _NTO_COF_NETCON: u32 = 128; |
| 441 | pub const _NTO_COF_NONBLOCK: u32 = 256; |
| 442 | pub const _NTO_COF_ASYNC: u32 = 512; |
| 443 | pub const _NTO_COF_GLOBAL: u32 = 1024; |
| 444 | pub const _NTO_COF_NOEVENT: u32 = 2048; |
| 445 | pub const _NTO_COF_INSECURE: u32 = 4096; |
| 446 | pub const _NTO_COF_REG_EVENTS: u32 = 8192; |
| 447 | pub const _NTO_COF_UNREG_EVENTS: u32 = 16384; |
| 448 | pub const _NTO_COF_MASK: u32 = 65535; |
| 449 | |
| 450 | pub const _NTO_SIDE_CHANNEL: u32 = 1073741824; |
| 451 | |
| 452 | pub const _NTO_CONNECTION_SCOID: u32 = 65536; |
| 453 | pub const _NTO_GLOBAL_CHANNEL: u32 = 1073741824; |
| 454 | |
| 455 | pub const _NTO_TIMEOUT_MASK: u32 = (1 << STATE_MAX) - 1; |
| 456 | pub const _NTO_TIMEOUT_ACTIVE: u32 = 1 << STATE_MAX; |
| 457 | pub const _NTO_TIMEOUT_IMMEDIATE: u32 = 1 << (STATE_MAX + 1); |
| 458 | |
| 459 | pub const _NTO_IC_LATENCY: u32 = 0; |
| 460 | |
| 461 | pub const _NTO_INTR_FLAGS_END: u32 = 1; |
| 462 | pub const _NTO_INTR_FLAGS_NO_UNMASK: u32 = 2; |
| 463 | pub const _NTO_INTR_FLAGS_PROCESS: u32 = 4; |
| 464 | pub const _NTO_INTR_FLAGS_TRK_MSK: u32 = 8; |
| 465 | pub const _NTO_INTR_FLAGS_ARRAY: u32 = 16; |
| 466 | pub const _NTO_INTR_FLAGS_EXCLUSIVE: u32 = 32; |
| 467 | pub const _NTO_INTR_FLAGS_FPU: u32 = 64; |
| 468 | |
| 469 | pub const _NTO_INTR_CLASS_EXTERNAL: u32 = 0; |
| 470 | pub const _NTO_INTR_CLASS_SYNTHETIC: u32 = 2147418112; |
| 471 | |
| 472 | pub const _NTO_INTR_SPARE: u32 = 2147483647; |
| 473 | |
| 474 | pub const _NTO_HOOK_IDLE: u32 = 2147418113; |
| 475 | pub const _NTO_HOOK_OVERDRIVE: u32 = 2147418114; |
| 476 | pub const _NTO_HOOK_LAST: u32 = 2147418114; |
| 477 | pub const _NTO_HOOK_IDLE2_FLAG: u32 = 32768; |
| 478 | |
| 479 | pub const _NTO_IH_CMD_SLEEP_SETUP: u32 = 1; |
| 480 | pub const _NTO_IH_CMD_SLEEP_BLOCK: u32 = 2; |
| 481 | pub const _NTO_IH_CMD_SLEEP_WAKEUP: u32 = 4; |
| 482 | pub const _NTO_IH_CMD_SLEEP_ONLINE: u32 = 8; |
| 483 | pub const _NTO_IH_RESP_NEEDS_BLOCK: u32 = 1; |
| 484 | pub const _NTO_IH_RESP_NEEDS_WAKEUP: u32 = 2; |
| 485 | pub const _NTO_IH_RESP_NEEDS_ONLINE: u32 = 4; |
| 486 | pub const _NTO_IH_RESP_SYNC_TIME: u32 = 16; |
| 487 | pub const _NTO_IH_RESP_SYNC_TLB: u32 = 32; |
| 488 | pub const _NTO_IH_RESP_SUGGEST_OFFLINE: u32 = 256; |
| 489 | pub const _NTO_IH_RESP_SLEEP_MODE_REACHED: u32 = 512; |
| 490 | pub const _NTO_IH_RESP_DELIVER_INTRS: u32 = 1024; |
| 491 | |
| 492 | pub const _NTO_READIOV_SEND: u32 = 0; |
| 493 | pub const _NTO_READIOV_REPLY: u32 = 1; |
| 494 | |
| 495 | pub const _NTO_KEYDATA_VTID: u32 = 2147483648; |
| 496 | |
| 497 | pub const _NTO_KEYDATA_PATHSIGN: u32 = 32768; |
| 498 | pub const _NTO_KEYDATA_OP_MASK: u32 = 255; |
| 499 | pub const _NTO_KEYDATA_VERIFY: u32 = 0; |
| 500 | pub const _NTO_KEYDATA_CALCULATE: u32 = 1; |
| 501 | pub const _NTO_KEYDATA_CALCULATE_REUSE: u32 = 2; |
| 502 | pub const _NTO_KEYDATA_PATHSIGN_VERIFY: u32 = 32768; |
| 503 | pub const _NTO_KEYDATA_PATHSIGN_CALCULATE: u32 = 32769; |
| 504 | pub const _NTO_KEYDATA_PATHSIGN_CALCULATE_REUSE: u32 = 32770; |
| 505 | |
| 506 | pub const _NTO_SCTL_SETPRIOCEILING: u32 = 1; |
| 507 | pub const _NTO_SCTL_GETPRIOCEILING: u32 = 2; |
| 508 | pub const _NTO_SCTL_SETEVENT: u32 = 3; |
| 509 | pub const _NTO_SCTL_MUTEX_WAKEUP: u32 = 4; |
| 510 | pub const _NTO_SCTL_MUTEX_CONSISTENT: u32 = 5; |
| 511 | pub const _NTO_SCTL_SEM_VALUE: u32 = 6; |
| 512 | |
| 513 | pub const _NTO_CLIENTINFO_GETGROUPS: u32 = 1; |
| 514 | pub const _NTO_CLIENTINFO_GETTYPEID: u32 = 2; |
| 515 | |
| 516 | extern "C" { |
| 517 | pub fn ChannelCreate(__flags: c_uint) -> c_int; |
| 518 | pub fn ChannelCreate_r(__flags: c_uint) -> c_int; |
| 519 | pub fn ChannelCreatePulsePool(__flags: c_uint, __config: *const nto_channel_config) -> c_int; |
| 520 | pub fn ChannelCreateExt( |
| 521 | __flags: c_uint, |
| 522 | __mode: crate::mode_t, |
| 523 | __bufsize: usize, |
| 524 | __maxnumbuf: c_uint, |
| 525 | __ev: *const crate::sigevent, |
| 526 | __cred: *mut _cred_info, |
| 527 | ) -> c_int; |
| 528 | pub fn ChannelDestroy(__chid: c_int) -> c_int; |
| 529 | pub fn ChannelDestroy_r(__chid: c_int) -> c_int; |
| 530 | pub fn ConnectAttach( |
| 531 | __nd: u32, |
| 532 | __pid: crate::pid_t, |
| 533 | __chid: c_int, |
| 534 | __index: c_uint, |
| 535 | __flags: c_int, |
| 536 | ) -> c_int; |
| 537 | pub fn ConnectAttach_r( |
| 538 | __nd: u32, |
| 539 | __pid: crate::pid_t, |
| 540 | __chid: c_int, |
| 541 | __index: c_uint, |
| 542 | __flags: c_int, |
| 543 | ) -> c_int; |
| 544 | |
| 545 | // TODO: The following function uses a structure defined in a header file |
| 546 | // which doesn't appear as part of the default headers found in a |
| 547 | // standard installation of Neutrino 7.1 SDP. Commented out for now. |
| 548 | //pub fn ConnectAttachExt( |
| 549 | // __nd: u32, |
| 550 | // __pid: crate::pid_t, |
| 551 | // __chid: c_int, |
| 552 | // __index: c_uint, |
| 553 | // __flags: c_int, |
| 554 | // __cd: *mut _asyncmsg_connection_descriptor, |
| 555 | //) -> c_int; |
| 556 | pub fn ConnectDetach(__coid: c_int) -> c_int; |
| 557 | pub fn ConnectDetach_r(__coid: c_int) -> c_int; |
| 558 | pub fn ConnectServerInfo(__pid: crate::pid_t, __coid: c_int, __info: *mut _msg_info64) |
| 559 | -> c_int; |
| 560 | pub fn ConnectServerInfo_r( |
| 561 | __pid: crate::pid_t, |
| 562 | __coid: c_int, |
| 563 | __info: *mut _msg_info64, |
| 564 | ) -> c_int; |
| 565 | pub fn ConnectClientInfoExtraArgs( |
| 566 | __scoid: c_int, |
| 567 | __info_pp: *mut _client_info, |
| 568 | __ngroups: c_int, |
| 569 | __abilities: *mut _client_able, |
| 570 | __nable: c_int, |
| 571 | __type_id: *mut c_uint, |
| 572 | ) -> c_int; |
| 573 | pub fn ConnectClientInfoExtraArgs_r( |
| 574 | __scoid: c_int, |
| 575 | __info_pp: *mut _client_info, |
| 576 | __ngroups: c_int, |
| 577 | __abilities: *mut _client_able, |
| 578 | __nable: c_int, |
| 579 | __type_id: *mut c_uint, |
| 580 | ) -> c_int; |
| 581 | pub fn ConnectClientInfo(__scoid: c_int, __info: *mut _client_info, __ngroups: c_int) -> c_int; |
| 582 | pub fn ConnectClientInfo_r( |
| 583 | __scoid: c_int, |
| 584 | __info: *mut _client_info, |
| 585 | __ngroups: c_int, |
| 586 | ) -> c_int; |
| 587 | pub fn ConnectClientInfoExt( |
| 588 | __scoid: c_int, |
| 589 | __info_pp: *mut *mut _client_info, |
| 590 | flags: c_int, |
| 591 | ) -> c_int; |
| 592 | pub fn ClientInfoExtFree(__info_pp: *mut *mut _client_info) -> c_int; |
| 593 | pub fn ConnectClientInfoAble( |
| 594 | __scoid: c_int, |
| 595 | __info_pp: *mut *mut _client_info, |
| 596 | flags: c_int, |
| 597 | abilities: *mut _client_able, |
| 598 | nable: c_int, |
| 599 | ) -> c_int; |
| 600 | pub fn ConnectFlags( |
| 601 | __pid: crate::pid_t, |
| 602 | __coid: c_int, |
| 603 | __mask: c_uint, |
| 604 | __bits: c_uint, |
| 605 | ) -> c_int; |
| 606 | pub fn ConnectFlags_r( |
| 607 | __pid: crate::pid_t, |
| 608 | __coid: c_int, |
| 609 | __mask: c_uint, |
| 610 | __bits: c_uint, |
| 611 | ) -> c_int; |
| 612 | pub fn ChannelConnectAttr( |
| 613 | __id: c_uint, |
| 614 | __old_attr: *mut _channel_connect_attr, |
| 615 | __new_attr: *mut _channel_connect_attr, |
| 616 | __flags: c_uint, |
| 617 | ) -> c_int; |
| 618 | pub fn MsgSend( |
| 619 | __coid: c_int, |
| 620 | __smsg: *const c_void, |
| 621 | __sbytes: usize, |
| 622 | __rmsg: *mut c_void, |
| 623 | __rbytes: usize, |
| 624 | ) -> c_long; |
| 625 | pub fn MsgSend_r( |
| 626 | __coid: c_int, |
| 627 | __smsg: *const c_void, |
| 628 | __sbytes: usize, |
| 629 | __rmsg: *mut c_void, |
| 630 | __rbytes: usize, |
| 631 | ) -> c_long; |
| 632 | pub fn MsgSendnc( |
| 633 | __coid: c_int, |
| 634 | __smsg: *const c_void, |
| 635 | __sbytes: usize, |
| 636 | __rmsg: *mut c_void, |
| 637 | __rbytes: usize, |
| 638 | ) -> c_long; |
| 639 | pub fn MsgSendnc_r( |
| 640 | __coid: c_int, |
| 641 | __smsg: *const c_void, |
| 642 | __sbytes: usize, |
| 643 | __rmsg: *mut c_void, |
| 644 | __rbytes: usize, |
| 645 | ) -> c_long; |
| 646 | pub fn MsgSendsv( |
| 647 | __coid: c_int, |
| 648 | __smsg: *const c_void, |
| 649 | __sbytes: usize, |
| 650 | __riov: *const crate::iovec, |
| 651 | __rparts: usize, |
| 652 | ) -> c_long; |
| 653 | pub fn MsgSendsv_r( |
| 654 | __coid: c_int, |
| 655 | __smsg: *const c_void, |
| 656 | __sbytes: usize, |
| 657 | __riov: *const crate::iovec, |
| 658 | __rparts: usize, |
| 659 | ) -> c_long; |
| 660 | pub fn MsgSendsvnc( |
| 661 | __coid: c_int, |
| 662 | __smsg: *const c_void, |
| 663 | __sbytes: usize, |
| 664 | __riov: *const crate::iovec, |
| 665 | __rparts: usize, |
| 666 | ) -> c_long; |
| 667 | pub fn MsgSendsvnc_r( |
| 668 | __coid: c_int, |
| 669 | __smsg: *const c_void, |
| 670 | __sbytes: usize, |
| 671 | __riov: *const crate::iovec, |
| 672 | __rparts: usize, |
| 673 | ) -> c_long; |
| 674 | pub fn MsgSendvs( |
| 675 | __coid: c_int, |
| 676 | __siov: *const crate::iovec, |
| 677 | __sparts: usize, |
| 678 | __rmsg: *mut c_void, |
| 679 | __rbytes: usize, |
| 680 | ) -> c_long; |
| 681 | pub fn MsgSendvs_r( |
| 682 | __coid: c_int, |
| 683 | __siov: *const crate::iovec, |
| 684 | __sparts: usize, |
| 685 | __rmsg: *mut c_void, |
| 686 | __rbytes: usize, |
| 687 | ) -> c_long; |
| 688 | pub fn MsgSendvsnc( |
| 689 | __coid: c_int, |
| 690 | __siov: *const crate::iovec, |
| 691 | __sparts: usize, |
| 692 | __rmsg: *mut c_void, |
| 693 | __rbytes: usize, |
| 694 | ) -> c_long; |
| 695 | pub fn MsgSendvsnc_r( |
| 696 | __coid: c_int, |
| 697 | __siov: *const crate::iovec, |
| 698 | __sparts: usize, |
| 699 | __rmsg: *mut c_void, |
| 700 | __rbytes: usize, |
| 701 | ) -> c_long; |
| 702 | pub fn MsgSendv( |
| 703 | __coid: c_int, |
| 704 | __siov: *const crate::iovec, |
| 705 | __sparts: usize, |
| 706 | __riov: *const crate::iovec, |
| 707 | __rparts: usize, |
| 708 | ) -> c_long; |
| 709 | pub fn MsgSendv_r( |
| 710 | __coid: c_int, |
| 711 | __siov: *const crate::iovec, |
| 712 | __sparts: usize, |
| 713 | __riov: *const crate::iovec, |
| 714 | __rparts: usize, |
| 715 | ) -> c_long; |
| 716 | pub fn MsgSendvnc( |
| 717 | __coid: c_int, |
| 718 | __siov: *const crate::iovec, |
| 719 | __sparts: usize, |
| 720 | __riov: *const crate::iovec, |
| 721 | __rparts: usize, |
| 722 | ) -> c_long; |
| 723 | pub fn MsgSendvnc_r( |
| 724 | __coid: c_int, |
| 725 | __siov: *const crate::iovec, |
| 726 | __sparts: usize, |
| 727 | __riov: *const crate::iovec, |
| 728 | __rparts: usize, |
| 729 | ) -> c_long; |
| 730 | pub fn MsgReceive( |
| 731 | __chid: c_int, |
| 732 | __msg: *mut c_void, |
| 733 | __bytes: usize, |
| 734 | __info: *mut _msg_info64, |
| 735 | ) -> c_int; |
| 736 | pub fn MsgReceive_r( |
| 737 | __chid: c_int, |
| 738 | __msg: *mut c_void, |
| 739 | __bytes: usize, |
| 740 | __info: *mut _msg_info64, |
| 741 | ) -> c_int; |
| 742 | pub fn MsgReceivev( |
| 743 | __chid: c_int, |
| 744 | __iov: *const crate::iovec, |
| 745 | __parts: usize, |
| 746 | __info: *mut _msg_info64, |
| 747 | ) -> c_int; |
| 748 | pub fn MsgReceivev_r( |
| 749 | __chid: c_int, |
| 750 | __iov: *const crate::iovec, |
| 751 | __parts: usize, |
| 752 | __info: *mut _msg_info64, |
| 753 | ) -> c_int; |
| 754 | pub fn MsgReceivePulse( |
| 755 | __chid: c_int, |
| 756 | __pulse: *mut c_void, |
| 757 | __bytes: usize, |
| 758 | __info: *mut _msg_info64, |
| 759 | ) -> c_int; |
| 760 | pub fn MsgReceivePulse_r( |
| 761 | __chid: c_int, |
| 762 | __pulse: *mut c_void, |
| 763 | __bytes: usize, |
| 764 | __info: *mut _msg_info64, |
| 765 | ) -> c_int; |
| 766 | pub fn MsgReceivePulsev( |
| 767 | __chid: c_int, |
| 768 | __iov: *const crate::iovec, |
| 769 | __parts: usize, |
| 770 | __info: *mut _msg_info64, |
| 771 | ) -> c_int; |
| 772 | pub fn MsgReceivePulsev_r( |
| 773 | __chid: c_int, |
| 774 | __iov: *const crate::iovec, |
| 775 | __parts: usize, |
| 776 | __info: *mut _msg_info64, |
| 777 | ) -> c_int; |
| 778 | pub fn MsgReply( |
| 779 | __rcvid: c_int, |
| 780 | __status: c_long, |
| 781 | __msg: *const c_void, |
| 782 | __bytes: usize, |
| 783 | ) -> c_int; |
| 784 | pub fn MsgReply_r( |
| 785 | __rcvid: c_int, |
| 786 | __status: c_long, |
| 787 | __msg: *const c_void, |
| 788 | __bytes: usize, |
| 789 | ) -> c_int; |
| 790 | pub fn MsgReplyv( |
| 791 | __rcvid: c_int, |
| 792 | __status: c_long, |
| 793 | __iov: *const crate::iovec, |
| 794 | __parts: usize, |
| 795 | ) -> c_int; |
| 796 | pub fn MsgReplyv_r( |
| 797 | __rcvid: c_int, |
| 798 | __status: c_long, |
| 799 | __iov: *const crate::iovec, |
| 800 | __parts: usize, |
| 801 | ) -> c_int; |
| 802 | pub fn MsgReadiov( |
| 803 | __rcvid: c_int, |
| 804 | __iov: *const crate::iovec, |
| 805 | __parts: usize, |
| 806 | __offset: usize, |
| 807 | __flags: c_int, |
| 808 | ) -> isize; |
| 809 | pub fn MsgReadiov_r( |
| 810 | __rcvid: c_int, |
| 811 | __iov: *const crate::iovec, |
| 812 | __parts: usize, |
| 813 | __offset: usize, |
| 814 | __flags: c_int, |
| 815 | ) -> isize; |
| 816 | pub fn MsgRead(__rcvid: c_int, __msg: *mut c_void, __bytes: usize, __offset: usize) -> isize; |
| 817 | pub fn MsgRead_r(__rcvid: c_int, __msg: *mut c_void, __bytes: usize, __offset: usize) -> isize; |
| 818 | pub fn MsgReadv( |
| 819 | __rcvid: c_int, |
| 820 | __iov: *const crate::iovec, |
| 821 | __parts: usize, |
| 822 | __offset: usize, |
| 823 | ) -> isize; |
| 824 | pub fn MsgReadv_r( |
| 825 | __rcvid: c_int, |
| 826 | __iov: *const crate::iovec, |
| 827 | __parts: usize, |
| 828 | __offset: usize, |
| 829 | ) -> isize; |
| 830 | pub fn MsgWrite(__rcvid: c_int, __msg: *const c_void, __bytes: usize, __offset: usize) |
| 831 | -> isize; |
| 832 | pub fn MsgWrite_r( |
| 833 | __rcvid: c_int, |
| 834 | __msg: *const c_void, |
| 835 | __bytes: usize, |
| 836 | __offset: usize, |
| 837 | ) -> isize; |
| 838 | pub fn MsgWritev( |
| 839 | __rcvid: c_int, |
| 840 | __iov: *const crate::iovec, |
| 841 | __parts: usize, |
| 842 | __offset: usize, |
| 843 | ) -> isize; |
| 844 | pub fn MsgWritev_r( |
| 845 | __rcvid: c_int, |
| 846 | __iov: *const crate::iovec, |
| 847 | __parts: usize, |
| 848 | __offset: usize, |
| 849 | ) -> isize; |
| 850 | pub fn MsgSendPulse(__coid: c_int, __priority: c_int, __code: c_int, __value: c_int) -> c_int; |
| 851 | pub fn MsgSendPulse_r(__coid: c_int, __priority: c_int, __code: c_int, __value: c_int) |
| 852 | -> c_int; |
| 853 | pub fn MsgSendPulsePtr( |
| 854 | __coid: c_int, |
| 855 | __priority: c_int, |
| 856 | __code: c_int, |
| 857 | __value: *mut c_void, |
| 858 | ) -> c_int; |
| 859 | pub fn MsgSendPulsePtr_r( |
| 860 | __coid: c_int, |
| 861 | __priority: c_int, |
| 862 | __code: c_int, |
| 863 | __value: *mut c_void, |
| 864 | ) -> c_int; |
| 865 | pub fn MsgDeliverEvent(__rcvid: c_int, __event: *const crate::sigevent) -> c_int; |
| 866 | pub fn MsgDeliverEvent_r(__rcvid: c_int, __event: *const crate::sigevent) -> c_int; |
| 867 | pub fn MsgVerifyEvent(__rcvid: c_int, __event: *const crate::sigevent) -> c_int; |
| 868 | pub fn MsgVerifyEvent_r(__rcvid: c_int, __event: *const crate::sigevent) -> c_int; |
| 869 | pub fn MsgRegisterEvent(__event: *mut crate::sigevent, __coid: c_int) -> c_int; |
| 870 | pub fn MsgRegisterEvent_r(__event: *mut crate::sigevent, __coid: c_int) -> c_int; |
| 871 | pub fn MsgUnregisterEvent(__event: *const crate::sigevent) -> c_int; |
| 872 | pub fn MsgUnregisterEvent_r(__event: *const crate::sigevent) -> c_int; |
| 873 | pub fn MsgInfo(__rcvid: c_int, __info: *mut _msg_info64) -> c_int; |
| 874 | pub fn MsgInfo_r(__rcvid: c_int, __info: *mut _msg_info64) -> c_int; |
| 875 | pub fn MsgKeyData( |
| 876 | __rcvid: c_int, |
| 877 | __oper: c_int, |
| 878 | __key: u32, |
| 879 | __newkey: *mut u32, |
| 880 | __iov: *const crate::iovec, |
| 881 | __parts: c_int, |
| 882 | ) -> c_int; |
| 883 | pub fn MsgKeyData_r( |
| 884 | __rcvid: c_int, |
| 885 | __oper: c_int, |
| 886 | __key: u32, |
| 887 | __newkey: *mut u32, |
| 888 | __iov: *const crate::iovec, |
| 889 | __parts: c_int, |
| 890 | ) -> c_int; |
| 891 | pub fn MsgError(__rcvid: c_int, __err: c_int) -> c_int; |
| 892 | pub fn MsgError_r(__rcvid: c_int, __err: c_int) -> c_int; |
| 893 | pub fn MsgCurrent(__rcvid: c_int) -> c_int; |
| 894 | pub fn MsgCurrent_r(__rcvid: c_int) -> c_int; |
| 895 | pub fn MsgSendAsyncGbl( |
| 896 | __coid: c_int, |
| 897 | __smsg: *const c_void, |
| 898 | __sbytes: usize, |
| 899 | __msg_prio: c_uint, |
| 900 | ) -> c_int; |
| 901 | pub fn MsgSendAsync(__coid: c_int) -> c_int; |
| 902 | pub fn MsgReceiveAsyncGbl( |
| 903 | __chid: c_int, |
| 904 | __rmsg: *mut c_void, |
| 905 | __rbytes: usize, |
| 906 | __info: *mut _msg_info64, |
| 907 | __coid: c_int, |
| 908 | ) -> c_int; |
| 909 | pub fn MsgReceiveAsync(__chid: c_int, __iov: *const crate::iovec, __parts: c_uint) -> c_int; |
| 910 | pub fn MsgPause(__rcvid: c_int, __cookie: c_uint) -> c_int; |
| 911 | pub fn MsgPause_r(__rcvid: c_int, __cookie: c_uint) -> c_int; |
| 912 | |
| 913 | pub fn SignalKill( |
| 914 | __nd: u32, |
| 915 | __pid: crate::pid_t, |
| 916 | __tid: c_int, |
| 917 | __signo: c_int, |
| 918 | __code: c_int, |
| 919 | __value: c_int, |
| 920 | ) -> c_int; |
| 921 | pub fn SignalKill_r( |
| 922 | __nd: u32, |
| 923 | __pid: crate::pid_t, |
| 924 | __tid: c_int, |
| 925 | __signo: c_int, |
| 926 | __code: c_int, |
| 927 | __value: c_int, |
| 928 | ) -> c_int; |
| 929 | pub fn SignalKillSigval( |
| 930 | __nd: u32, |
| 931 | __pid: crate::pid_t, |
| 932 | __tid: c_int, |
| 933 | __signo: c_int, |
| 934 | __code: c_int, |
| 935 | __value: *const crate::sigval, |
| 936 | ) -> c_int; |
| 937 | pub fn SignalKillSigval_r( |
| 938 | __nd: u32, |
| 939 | __pid: crate::pid_t, |
| 940 | __tid: c_int, |
| 941 | __signo: c_int, |
| 942 | __code: c_int, |
| 943 | __value: *const crate::sigval, |
| 944 | ) -> c_int; |
| 945 | pub fn SignalReturn(__info: *mut _sighandler_info) -> c_int; |
| 946 | pub fn SignalFault(__sigcode: c_uint, __regs: *mut c_void, __refaddr: usize) -> c_int; |
| 947 | pub fn SignalAction( |
| 948 | __pid: crate::pid_t, |
| 949 | __sigstub: unsafe extern "C" fn(), |
| 950 | __signo: c_int, |
| 951 | __act: *const crate::sigaction, |
| 952 | __oact: *mut crate::sigaction, |
| 953 | ) -> c_int; |
| 954 | pub fn SignalAction_r( |
| 955 | __pid: crate::pid_t, |
| 956 | __sigstub: unsafe extern "C" fn(), |
| 957 | __signo: c_int, |
| 958 | __act: *const crate::sigaction, |
| 959 | __oact: *mut crate::sigaction, |
| 960 | ) -> c_int; |
| 961 | pub fn SignalProcmask( |
| 962 | __pid: crate::pid_t, |
| 963 | __tid: c_int, |
| 964 | __how: c_int, |
| 965 | __set: *const crate::sigset_t, |
| 966 | __oldset: *mut crate::sigset_t, |
| 967 | ) -> c_int; |
| 968 | pub fn SignalProcmask_r( |
| 969 | __pid: crate::pid_t, |
| 970 | __tid: c_int, |
| 971 | __how: c_int, |
| 972 | __set: *const crate::sigset_t, |
| 973 | __oldset: *mut crate::sigset_t, |
| 974 | ) -> c_int; |
| 975 | pub fn SignalSuspend(__set: *const crate::sigset_t) -> c_int; |
| 976 | pub fn SignalSuspend_r(__set: *const crate::sigset_t) -> c_int; |
| 977 | pub fn SignalWaitinfo(__set: *const crate::sigset_t, __info: *mut crate::siginfo_t) -> c_int; |
| 978 | pub fn SignalWaitinfo_r(__set: *const crate::sigset_t, __info: *mut crate::siginfo_t) -> c_int; |
| 979 | pub fn SignalWaitinfoMask( |
| 980 | __set: *const crate::sigset_t, |
| 981 | __info: *mut crate::siginfo_t, |
| 982 | __mask: *const crate::sigset_t, |
| 983 | ) -> c_int; |
| 984 | pub fn SignalWaitinfoMask_r( |
| 985 | __set: *const crate::sigset_t, |
| 986 | __info: *mut crate::siginfo_t, |
| 987 | __mask: *const crate::sigset_t, |
| 988 | ) -> c_int; |
| 989 | pub fn ThreadCreate( |
| 990 | __pid: crate::pid_t, |
| 991 | __func: unsafe extern "C" fn(__arg: *mut c_void) -> *mut c_void, |
| 992 | __arg: *mut c_void, |
| 993 | __attr: *const crate::_thread_attr, |
| 994 | ) -> c_int; |
| 995 | pub fn ThreadCreate_r( |
| 996 | __pid: crate::pid_t, |
| 997 | __func: unsafe extern "C" fn(__arg: *mut c_void) -> *mut c_void, |
| 998 | __arg: *mut c_void, |
| 999 | __attr: *const crate::_thread_attr, |
| 1000 | ) -> c_int; |
| 1001 | |
| 1002 | pub fn ThreadDestroy(__tid: c_int, __priority: c_int, __status: *mut c_void) -> c_int; |
| 1003 | pub fn ThreadDestroy_r(__tid: c_int, __priority: c_int, __status: *mut c_void) -> c_int; |
| 1004 | pub fn ThreadDetach(__tid: c_int) -> c_int; |
| 1005 | pub fn ThreadDetach_r(__tid: c_int) -> c_int; |
| 1006 | pub fn ThreadJoin(__tid: c_int, __status: *mut *mut c_void) -> c_int; |
| 1007 | pub fn ThreadJoin_r(__tid: c_int, __status: *mut *mut c_void) -> c_int; |
| 1008 | pub fn ThreadCancel(__tid: c_int, __canstub: unsafe extern "C" fn()) -> c_int; |
| 1009 | pub fn ThreadCancel_r(__tid: c_int, __canstub: unsafe extern "C" fn()) -> c_int; |
| 1010 | pub fn ThreadCtl(__cmd: c_int, __data: *mut c_void) -> c_int; |
| 1011 | pub fn ThreadCtl_r(__cmd: c_int, __data: *mut c_void) -> c_int; |
| 1012 | pub fn ThreadCtlExt( |
| 1013 | __pid: crate::pid_t, |
| 1014 | __tid: c_int, |
| 1015 | __cmd: c_int, |
| 1016 | __data: *mut c_void, |
| 1017 | ) -> c_int; |
| 1018 | pub fn ThreadCtlExt_r( |
| 1019 | __pid: crate::pid_t, |
| 1020 | __tid: c_int, |
| 1021 | __cmd: c_int, |
| 1022 | __data: *mut c_void, |
| 1023 | ) -> c_int; |
| 1024 | |
| 1025 | pub fn InterruptHookTrace( |
| 1026 | __handler: Option<unsafe extern "C" fn(arg1: c_int) -> *const crate::sigevent>, |
| 1027 | __flags: c_uint, |
| 1028 | ) -> c_int; |
| 1029 | pub fn InterruptHookIdle( |
| 1030 | __handler: Option<unsafe extern "C" fn(arg1: *mut u64, arg2: *mut qtime_entry)>, |
| 1031 | __flags: c_uint, |
| 1032 | ) -> c_int; |
| 1033 | pub fn InterruptHookIdle2( |
| 1034 | __handler: Option< |
| 1035 | unsafe extern "C" fn(arg1: c_uint, arg2: *mut syspage_entry, arg3: *mut _idle_hook), |
| 1036 | >, |
| 1037 | __flags: c_uint, |
| 1038 | ) -> c_int; |
| 1039 | pub fn InterruptHookOverdriveEvent(__event: *const crate::sigevent, __flags: c_uint) -> c_int; |
| 1040 | pub fn InterruptAttachEvent( |
| 1041 | __intr: c_int, |
| 1042 | __event: *const crate::sigevent, |
| 1043 | __flags: c_uint, |
| 1044 | ) -> c_int; |
| 1045 | pub fn InterruptAttachEvent_r( |
| 1046 | __intr: c_int, |
| 1047 | __event: *const crate::sigevent, |
| 1048 | __flags: c_uint, |
| 1049 | ) -> c_int; |
| 1050 | pub fn InterruptAttach( |
| 1051 | __intr: c_int, |
| 1052 | __handler: Option< |
| 1053 | unsafe extern "C" fn(__area: *mut c_void, __id: c_int) -> *const crate::sigevent, |
| 1054 | >, |
| 1055 | __area: *const c_void, |
| 1056 | __size: c_int, |
| 1057 | __flags: c_uint, |
| 1058 | ) -> c_int; |
| 1059 | pub fn InterruptAttach_r( |
| 1060 | __intr: c_int, |
| 1061 | __handler: Option< |
| 1062 | unsafe extern "C" fn(__area: *mut c_void, __id: c_int) -> *const crate::sigevent, |
| 1063 | >, |
| 1064 | __area: *const c_void, |
| 1065 | __size: c_int, |
| 1066 | __flags: c_uint, |
| 1067 | ) -> c_int; |
| 1068 | pub fn InterruptAttachArray( |
| 1069 | __intr: c_int, |
| 1070 | __handler: Option< |
| 1071 | unsafe extern "C" fn(__area: *mut c_void, __id: c_int) -> *const *const crate::sigevent, |
| 1072 | >, |
| 1073 | __area: *const c_void, |
| 1074 | __size: c_int, |
| 1075 | __flags: c_uint, |
| 1076 | ) -> c_int; |
| 1077 | pub fn InterruptAttachArray_r( |
| 1078 | __intr: c_int, |
| 1079 | __handler: Option< |
| 1080 | unsafe extern "C" fn(__area: *mut c_void, __id: c_int) -> *const *const crate::sigevent, |
| 1081 | >, |
| 1082 | __area: *const c_void, |
| 1083 | __size: c_int, |
| 1084 | __flags: c_uint, |
| 1085 | ) -> c_int; |
| 1086 | pub fn InterruptDetach(__id: c_int) -> c_int; |
| 1087 | pub fn InterruptDetach_r(__id: c_int) -> c_int; |
| 1088 | pub fn InterruptWait(__flags: c_int, __timeout: *const u64) -> c_int; |
| 1089 | pub fn InterruptWait_r(__flags: c_int, __timeout: *const u64) -> c_int; |
| 1090 | pub fn InterruptCharacteristic( |
| 1091 | __type: c_int, |
| 1092 | __id: c_int, |
| 1093 | __new: *mut c_uint, |
| 1094 | __old: *mut c_uint, |
| 1095 | ) -> c_int; |
| 1096 | pub fn InterruptCharacteristic_r( |
| 1097 | __type: c_int, |
| 1098 | __id: c_int, |
| 1099 | __new: *mut c_uint, |
| 1100 | __old: *mut c_uint, |
| 1101 | ) -> c_int; |
| 1102 | |
| 1103 | pub fn SchedGet(__pid: crate::pid_t, __tid: c_int, __param: *mut crate::sched_param) -> c_int; |
| 1104 | pub fn SchedGet_r(__pid: crate::pid_t, __tid: c_int, __param: *mut crate::sched_param) |
| 1105 | -> c_int; |
| 1106 | pub fn SchedGetCpuNum() -> c_uint; |
| 1107 | pub fn SchedSet( |
| 1108 | __pid: crate::pid_t, |
| 1109 | __tid: c_int, |
| 1110 | __algorithm: c_int, |
| 1111 | __param: *const crate::sched_param, |
| 1112 | ) -> c_int; |
| 1113 | pub fn SchedSet_r( |
| 1114 | __pid: crate::pid_t, |
| 1115 | __tid: c_int, |
| 1116 | __algorithm: c_int, |
| 1117 | __param: *const crate::sched_param, |
| 1118 | ) -> c_int; |
| 1119 | pub fn SchedInfo( |
| 1120 | __pid: crate::pid_t, |
| 1121 | __algorithm: c_int, |
| 1122 | __info: *mut crate::_sched_info, |
| 1123 | ) -> c_int; |
| 1124 | pub fn SchedInfo_r( |
| 1125 | __pid: crate::pid_t, |
| 1126 | __algorithm: c_int, |
| 1127 | __info: *mut crate::_sched_info, |
| 1128 | ) -> c_int; |
| 1129 | pub fn SchedYield() -> c_int; |
| 1130 | pub fn SchedYield_r() -> c_int; |
| 1131 | pub fn SchedCtl(__cmd: c_int, __data: *mut c_void, __length: usize) -> c_int; |
| 1132 | pub fn SchedCtl_r(__cmd: c_int, __data: *mut c_void, __length: usize) -> c_int; |
| 1133 | pub fn SchedJobCreate(__job: *mut nto_job_t) -> c_int; |
| 1134 | pub fn SchedJobCreate_r(__job: *mut nto_job_t) -> c_int; |
| 1135 | pub fn SchedJobDestroy(__job: *mut nto_job_t) -> c_int; |
| 1136 | pub fn SchedJobDestroy_r(__job: *mut nto_job_t) -> c_int; |
| 1137 | pub fn SchedWaypoint( |
| 1138 | __job: *mut nto_job_t, |
| 1139 | __new: *const i64, |
| 1140 | __max: *const i64, |
| 1141 | __old: *mut i64, |
| 1142 | ) -> c_int; |
| 1143 | pub fn SchedWaypoint_r( |
| 1144 | __job: *mut nto_job_t, |
| 1145 | __new: *const i64, |
| 1146 | __max: *const i64, |
| 1147 | __old: *mut i64, |
| 1148 | ) -> c_int; |
| 1149 | |
| 1150 | pub fn TimerCreate(__id: crate::clockid_t, __notify: *const crate::sigevent) -> c_int; |
| 1151 | pub fn TimerCreate_r(__id: crate::clockid_t, __notify: *const crate::sigevent) -> c_int; |
| 1152 | pub fn TimerDestroy(__id: crate::timer_t) -> c_int; |
| 1153 | pub fn TimerDestroy_r(__id: crate::timer_t) -> c_int; |
| 1154 | pub fn TimerSettime( |
| 1155 | __id: crate::timer_t, |
| 1156 | __flags: c_int, |
| 1157 | __itime: *const crate::_itimer, |
| 1158 | __oitime: *mut crate::_itimer, |
| 1159 | ) -> c_int; |
| 1160 | pub fn TimerSettime_r( |
| 1161 | __id: crate::timer_t, |
| 1162 | __flags: c_int, |
| 1163 | __itime: *const crate::_itimer, |
| 1164 | __oitime: *mut crate::_itimer, |
| 1165 | ) -> c_int; |
| 1166 | pub fn TimerInfo( |
| 1167 | __pid: crate::pid_t, |
| 1168 | __id: crate::timer_t, |
| 1169 | __flags: c_int, |
| 1170 | __info: *mut crate::_timer_info, |
| 1171 | ) -> c_int; |
| 1172 | pub fn TimerInfo_r( |
| 1173 | __pid: crate::pid_t, |
| 1174 | __id: crate::timer_t, |
| 1175 | __flags: c_int, |
| 1176 | __info: *mut crate::_timer_info, |
| 1177 | ) -> c_int; |
| 1178 | pub fn TimerAlarm( |
| 1179 | __id: crate::clockid_t, |
| 1180 | __itime: *const crate::_itimer, |
| 1181 | __otime: *mut crate::_itimer, |
| 1182 | ) -> c_int; |
| 1183 | pub fn TimerAlarm_r( |
| 1184 | __id: crate::clockid_t, |
| 1185 | __itime: *const crate::_itimer, |
| 1186 | __otime: *mut crate::_itimer, |
| 1187 | ) -> c_int; |
| 1188 | pub fn TimerTimeout( |
| 1189 | __id: crate::clockid_t, |
| 1190 | __flags: c_int, |
| 1191 | __notify: *const crate::sigevent, |
| 1192 | __ntime: *const u64, |
| 1193 | __otime: *mut u64, |
| 1194 | ) -> c_int; |
| 1195 | pub fn TimerTimeout_r( |
| 1196 | __id: crate::clockid_t, |
| 1197 | __flags: c_int, |
| 1198 | __notify: *const crate::sigevent, |
| 1199 | __ntime: *const u64, |
| 1200 | __otime: *mut u64, |
| 1201 | ) -> c_int; |
| 1202 | |
| 1203 | pub fn SyncTypeCreate( |
| 1204 | __type: c_uint, |
| 1205 | __sync: *mut crate::sync_t, |
| 1206 | __attr: *const crate::_sync_attr, |
| 1207 | ) -> c_int; |
| 1208 | pub fn SyncTypeCreate_r( |
| 1209 | __type: c_uint, |
| 1210 | __sync: *mut crate::sync_t, |
| 1211 | __attr: *const crate::_sync_attr, |
| 1212 | ) -> c_int; |
| 1213 | pub fn SyncDestroy(__sync: *mut crate::sync_t) -> c_int; |
| 1214 | pub fn SyncDestroy_r(__sync: *mut crate::sync_t) -> c_int; |
| 1215 | pub fn SyncCtl(__cmd: c_int, __sync: *mut crate::sync_t, __data: *mut c_void) -> c_int; |
| 1216 | pub fn SyncCtl_r(__cmd: c_int, __sync: *mut crate::sync_t, __data: *mut c_void) -> c_int; |
| 1217 | pub fn SyncMutexEvent(__sync: *mut crate::sync_t, event: *const crate::sigevent) -> c_int; |
| 1218 | pub fn SyncMutexEvent_r(__sync: *mut crate::sync_t, event: *const crate::sigevent) -> c_int; |
| 1219 | pub fn SyncMutexLock(__sync: *mut crate::sync_t) -> c_int; |
| 1220 | pub fn SyncMutexLock_r(__sync: *mut crate::sync_t) -> c_int; |
| 1221 | pub fn SyncMutexUnlock(__sync: *mut crate::sync_t) -> c_int; |
| 1222 | pub fn SyncMutexUnlock_r(__sync: *mut crate::sync_t) -> c_int; |
| 1223 | pub fn SyncMutexRevive(__sync: *mut crate::sync_t) -> c_int; |
| 1224 | pub fn SyncMutexRevive_r(__sync: *mut crate::sync_t) -> c_int; |
| 1225 | pub fn SyncCondvarWait(__sync: *mut crate::sync_t, __mutex: *mut crate::sync_t) -> c_int; |
| 1226 | pub fn SyncCondvarWait_r(__sync: *mut crate::sync_t, __mutex: *mut crate::sync_t) -> c_int; |
| 1227 | pub fn SyncCondvarSignal(__sync: *mut crate::sync_t, __all: c_int) -> c_int; |
| 1228 | pub fn SyncCondvarSignal_r(__sync: *mut crate::sync_t, __all: c_int) -> c_int; |
| 1229 | pub fn SyncSemPost(__sync: *mut crate::sync_t) -> c_int; |
| 1230 | pub fn SyncSemPost_r(__sync: *mut crate::sync_t) -> c_int; |
| 1231 | pub fn SyncSemWait(__sync: *mut crate::sync_t, __tryto: c_int) -> c_int; |
| 1232 | pub fn SyncSemWait_r(__sync: *mut crate::sync_t, __tryto: c_int) -> c_int; |
| 1233 | |
| 1234 | pub fn ClockTime(__id: crate::clockid_t, _new: *const u64, __old: *mut u64) -> c_int; |
| 1235 | pub fn ClockTime_r(__id: crate::clockid_t, _new: *const u64, __old: *mut u64) -> c_int; |
| 1236 | pub fn ClockAdjust( |
| 1237 | __id: crate::clockid_t, |
| 1238 | _new: *const crate::_clockadjust, |
| 1239 | __old: *mut crate::_clockadjust, |
| 1240 | ) -> c_int; |
| 1241 | pub fn ClockAdjust_r( |
| 1242 | __id: crate::clockid_t, |
| 1243 | _new: *const crate::_clockadjust, |
| 1244 | __old: *mut crate::_clockadjust, |
| 1245 | ) -> c_int; |
| 1246 | pub fn ClockPeriod( |
| 1247 | __id: crate::clockid_t, |
| 1248 | _new: *const crate::_clockperiod, |
| 1249 | __old: *mut crate::_clockperiod, |
| 1250 | __reserved: c_int, |
| 1251 | ) -> c_int; |
| 1252 | pub fn ClockPeriod_r( |
| 1253 | __id: crate::clockid_t, |
| 1254 | _new: *const crate::_clockperiod, |
| 1255 | __old: *mut crate::_clockperiod, |
| 1256 | __reserved: c_int, |
| 1257 | ) -> c_int; |
| 1258 | pub fn ClockId(__pid: crate::pid_t, __tid: c_int) -> c_int; |
| 1259 | pub fn ClockId_r(__pid: crate::pid_t, __tid: c_int) -> c_int; |
| 1260 | |
| 1261 | // |
| 1262 | //TODO: The following commented out functions are implemented in assembly. |
| 1263 | // We can implmement them either via a C stub or rust's inline assembly. |
| 1264 | // |
| 1265 | //pub fn InterruptEnable(); |
| 1266 | //pub fn InterruptDisable(); |
| 1267 | pub fn InterruptMask(__intr: c_int, __id: c_int) -> c_int; |
| 1268 | pub fn InterruptUnmask(__intr: c_int, __id: c_int) -> c_int; |
| 1269 | //pub fn InterruptLock(__spin: *mut intrspin); |
| 1270 | //pub fn InterruptUnlock(__spin: *mut intrspin); |
| 1271 | //pub fn InterruptStatus() -> c_uint; |
| 1272 | } |