1 # 1 "../../i86pc/ml/comm_page.s" 2 # 1 "/home/git3/dehawe/titanic_53/usr/src/uts/i86pc/unix//" 3 # 1 "<built-in>" 4 # 1 "<command-line>" 5 # 1 "../../i86pc/ml/comm_page.s" 6 7 /* 8 * This file and its contents are supplied under the terms of the 9 * Common Development and Distribution License ("CDDL"), version 1.0. 10 * You may only use this file in accordance with the terms of version 11 * 1.0 of the CDDL. 12 * 13 * A full copy of the text of the CDDL should have accompanied this 14 * source. A copy of the CDDL is also available via the Internet at 15 * http://www.illumos.org/license/CDDL. 16 */ 17 18 /* 19 * Copyright 2016 Joyent, Inc. 20 */ 21 22 # 1 "../../intel/sys/asm_linkage.h" 1 23 /* 24 * CDDL HEADER START 25 * 26 * The contents of this file are subject to the terms of the 27 * Common Development and Distribution License, Version 1.0 only 28 * (the "License"). You may not use this file except in compliance 29 * with the License. 30 * 31 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 32 * or http://www.opensolaris.org/os/licensing. 33 * See the License for the specific language governing permissions 34 * and limitations under the License. 35 * 36 * When distributing Covered Code, include this CDDL HEADER in each 37 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 38 * If applicable, add the following below this CDDL HEADER, with the 39 * fields enclosed by brackets "[]" replaced with your own identifying 40 * information: Portions Copyright [yyyy] [name of copyright owner] 41 * 42 * CDDL HEADER END 43 */ 44 /* 45 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 46 * Use is subject to license terms. 47 */ 48 49 50 51 52 #pragma ident "%Z%%M% %I% %E% SMI" 53 54 55 56 # 1 "../../intel/ia32/sys/asm_linkage.h" 1 57 /* 58 * CDDL HEADER START 59 * 60 * The contents of this file are subject to the terms of the 61 * Common Development and Distribution License (the "License"). 62 * You may not use this file except in compliance with the License. 63 * 64 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 65 * or http://www.opensolaris.org/os/licensing. 66 * See the License for the specific language governing permissions 67 * and limitations under the License. 68 * 69 * When distributing Covered Code, include this CDDL HEADER in each 70 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 71 * If applicable, add the following below this CDDL HEADER, with the 72 * fields enclosed by brackets "[]" replaced with your own identifying 73 * information: Portions Copyright [yyyy] [name of copyright owner] 74 * 75 * CDDL HEADER END 76 */ 77 78 /* 79 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 80 * Use is subject to license terms. 81 */ 82 83 84 85 86 #pragma ident "%Z%%M% %I% %E% SMI" 87 88 # 1 "../../intel/sys/stack.h" 1 89 /* 90 * CDDL HEADER START 91 * 92 * The contents of this file are subject to the terms of the 93 * Common Development and Distribution License, Version 1.0 only 94 * (the "License"). You may not use this file except in compliance 95 * with the License. 96 * 97 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 98 * or http://www.opensolaris.org/os/licensing. 99 * See the License for the specific language governing permissions 100 * and limitations under the License. 101 * 102 * When distributing Covered Code, include this CDDL HEADER in each 103 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 104 * If applicable, add the following below this CDDL HEADER, with the 105 * fields enclosed by brackets "[]" replaced with your own identifying 106 * information: Portions Copyright [yyyy] [name of copyright owner] 107 * 108 * CDDL HEADER END 109 */ 110 /* 111 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 112 * Use is subject to license terms. 113 */ 114 115 116 117 118 #pragma ident "%Z%%M% %I% %E% SMI" 119 120 121 122 # 1 "../../intel/ia32/sys/stack.h" 1 123 /* 124 * CDDL HEADER START 125 * 126 * The contents of this file are subject to the terms of the 127 * Common Development and Distribution License, Version 1.0 only 128 * (the "License"). You may not use this file except in compliance 129 * with the License. 130 * 131 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 132 * or http://www.opensolaris.org/os/licensing. 133 * See the License for the specific language governing permissions 134 * and limitations under the License. 135 * 136 * When distributing Covered Code, include this CDDL HEADER in each 137 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 138 * If applicable, add the following below this CDDL HEADER, with the 139 * fields enclosed by brackets "[]" replaced with your own identifying 140 * information: Portions Copyright [yyyy] [name of copyright owner] 141 * 142 * CDDL HEADER END 143 */ 144 /* 145 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 146 * Use is subject to license terms. 147 */ 148 149 150 151 152 #pragma ident "%Z%%M% %I% %E% SMI" 153 154 155 156 # 1 "../../common/sys/types.h" 1 157 /* 158 * CDDL HEADER START 159 * 160 * The contents of this file are subject to the terms of the 161 * Common Development and Distribution License (the "License"). 162 * You may not use this file except in compliance with the License. 163 * 164 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 165 * or http://www.opensolaris.org/os/licensing. 166 * See the License for the specific language governing permissions 167 * and limitations under the License. 168 * 169 * When distributing Covered Code, include this CDDL HEADER in each 170 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 171 * If applicable, add the following below this CDDL HEADER, with the 172 * fields enclosed by brackets "[]" replaced with your own identifying 173 * information: Portions Copyright [yyyy] [name of copyright owner] 174 * 175 * CDDL HEADER END 176 */ 177 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 178 /* All Rights Reserved */ 179 180 181 /* 182 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 183 * Use is subject to license terms. 184 * 185 * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 186 * Copyright 2016 Joyent, Inc. 187 */ 188 189 190 191 192 # 1 "../../common/sys/feature_tests.h" 1 193 /* 194 * CDDL HEADER START 195 * 196 * The contents of this file are subject to the terms of the 197 * Common Development and Distribution License (the "License"). 198 * You may not use this file except in compliance with the License. 199 * 200 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 201 * or http://www.opensolaris.org/os/licensing. 202 * See the License for the specific language governing permissions 203 * and limitations under the License. 204 * 205 * When distributing Covered Code, include this CDDL HEADER in each 206 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 207 * If applicable, add the following below this CDDL HEADER, with the 208 * fields enclosed by brackets "[]" replaced with your own identifying 209 * information: Portions Copyright [yyyy] [name of copyright owner] 210 * 211 * CDDL HEADER END 212 */ 213 214 /* 215 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 216 * Copyright 2016 Joyent, Inc. 217 * 218 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 219 * Use is subject to license terms. 220 */ 221 222 223 224 225 # 1 "../../common/sys/ccompile.h" 1 226 /* 227 * CDDL HEADER START 228 * 229 * The contents of this file are subject to the terms of the 230 * Common Development and Distribution License, Version 1.0 only 231 * (the "License"). You may not use this file except in compliance 232 * with the License. 233 * 234 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 235 * or http://www.opensolaris.org/os/licensing. 236 * See the License for the specific language governing permissions 237 * and limitations under the License. 238 * 239 * When distributing Covered Code, include this CDDL HEADER in each 240 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 241 * If applicable, add the following below this CDDL HEADER, with the 242 * fields enclosed by brackets "[]" replaced with your own identifying 243 * information: Portions Copyright [yyyy] [name of copyright owner] 244 * 245 * CDDL HEADER END 246 */ 247 /* 248 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 249 * Use is subject to license terms. 250 */ 251 /* 252 * Copyright 2015 EveryCity Ltd. All rights reserved. 253 */ 254 255 256 257 258 /* 259 * This file contains definitions designed to enable different compilers 260 * to be used harmoniously on Solaris systems. 261 */ 262 263 264 265 266 267 /* 268 * Allow for version tests for compiler bugs and features. 269 */ 270 # 54 "../../common/sys/ccompile.h" 271 /* 272 * analogous to lint's PRINTFLIKEn 273 */ 274 275 276 277 278 279 /* 280 * Handle the kernel printf routines that can take '%b' too 281 */ 282 # 78 "../../common/sys/ccompile.h" 283 /* 284 * This one's pretty obvious -- the function never returns 285 */ 286 287 288 /* 289 * The function is 'extern inline' and expects GNU C89 behaviour, not C99 290 * behaviour. 291 * 292 * Should only be used on 'extern inline' definitions for GCC. 293 */ 294 295 296 297 298 299 300 /* 301 * The function has control flow such that it may return multiple times (in 302 * the manner of setjmp or vfork) 303 */ 304 305 306 307 308 309 310 /* 311 * This is an appropriate label for functions that do not 312 * modify their arguments, e.g. strlen() 313 */ 314 315 316 /* 317 * This is a stronger form of __pure__. Can be used for functions 318 * that do not modify their arguments and don't depend on global 319 * memory. 320 */ 321 322 323 324 325 /* 326 * This attribute, attached to a variable, means that the variable is meant to 327 * be possibly unused. GCC will not produce a warning for this variable. 328 */ 329 # 138 "../../common/sys/ccompile.h" 330 /* 331 * Shorthand versions for readability 332 */ 333 # 34 "../../common/sys/feature_tests.h" 2 334 # 1 "../../common/sys/isa_defs.h" 1 335 /* 336 * CDDL HEADER START 337 * 338 * The contents of this file are subject to the terms of the 339 * Common Development and Distribution License (the "License"). 340 * You may not use this file except in compliance with the License. 341 * 342 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 343 * or http://www.opensolaris.org/os/licensing. 344 * See the License for the specific language governing permissions 345 * and limitations under the License. 346 * 347 * 348 * When distributing Covered Code, include this CDDL HEADER in each 349 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 350 * If applicable, add the following below this CDDL HEADER, with the 351 * fields enclosed by brackets "[]" replaced with your own identifying 352 * information: Portions Copyright [yyyy] [name of copyright owner] 353 * 354 * CDDL HEADER END 355 */ 356 357 /* 358 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 359 * Use is subject to license terms. 360 * Copyright 2016 Joyent, Inc. 361 */ 362 363 364 365 366 /* 367 * This header file serves to group a set of well known defines and to 368 * set these for each instruction set architecture. These defines may 369 * be divided into two groups; characteristics of the processor and 370 * implementation choices for Solaris on a processor. 371 * 372 * Processor Characteristics: 373 * 374 * _LITTLE_ENDIAN / _BIG_ENDIAN: 375 * The natural byte order of the processor. A pointer to an int points 376 * to the least/most significant byte of that int. 377 * 378 * _STACK_GROWS_UPWARD / _STACK_GROWS_DOWNWARD: 379 * The processor specific direction of stack growth. A push onto the 380 * stack increases/decreases the stack pointer, so it stores data at 381 * successively higher/lower addresses. (Stackless machines ignored 382 * without regrets). 383 * 384 * _LONG_LONG_HTOL / _LONG_LONG_LTOH: 385 * A pointer to a long long points to the most/least significant long 386 * within that long long. 387 * 388 * _BIT_FIELDS_HTOL / _BIT_FIELDS_LTOH: 389 * The C compiler assigns bit fields from the high/low to the low/high end 390 * of an int (most to least significant vs. least to most significant). 391 * 392 * _IEEE_754: 393 * The processor (or supported implementations of the processor) 394 * supports the ieee-754 floating point standard. No other floating 395 * point standards are supported (or significant). Any other supported 396 * floating point formats are expected to be cased on the ISA processor 397 * symbol. 398 * 399 * _CHAR_IS_UNSIGNED / _CHAR_IS_SIGNED: 400 * The C Compiler implements objects of type `char' as `unsigned' or 401 * `signed' respectively. This is really an implementation choice of 402 * the compiler writer, but it is specified in the ABI and tends to 403 * be uniform across compilers for an instruction set architecture. 404 * Hence, it has the properties of a processor characteristic. 405 * 406 * _CHAR_ALIGNMENT / _SHORT_ALIGNMENT / _INT_ALIGNMENT / _LONG_ALIGNMENT / 407 * _LONG_LONG_ALIGNMENT / _DOUBLE_ALIGNMENT / _LONG_DOUBLE_ALIGNMENT / 408 * _POINTER_ALIGNMENT / _FLOAT_ALIGNMENT: 409 * The ABI defines alignment requirements of each of the primitive 410 * object types. Some, if not all, may be hardware requirements as 411 * well. The values are expressed in "byte-alignment" units. 412 * 413 * _MAX_ALIGNMENT: 414 * The most stringent alignment requirement as specified by the ABI. 415 * Equal to the maximum of all the above _XXX_ALIGNMENT values. 416 * 417 * _MAX_ALIGNMENT_TYPE: 418 * The name of the C type that has the value descried in _MAX_ALIGNMENT. 419 * 420 * _ALIGNMENT_REQUIRED: 421 * True or false (1 or 0) whether or not the hardware requires the ABI 422 * alignment. 423 * 424 * _LONG_LONG_ALIGNMENT_32 425 * The 32-bit ABI supported by a 64-bit kernel may have different 426 * alignment requirements for primitive object types. The value of this 427 * identifier is expressed in "byte-alignment" units. 428 * 429 * _HAVE_CPUID_INSN 430 * This indicates that the architecture supports the 'cpuid' 431 * instruction as defined by Intel. (Intel allows other vendors 432 * to extend the instruction for their own purposes.) 433 * 434 * 435 * Implementation Choices: 436 * 437 * _ILP32 / _LP64: 438 * This specifies the compiler data type implementation as specified in 439 * the relevant ABI. The choice between these is strongly influenced 440 * by the underlying hardware, but is not absolutely tied to it. 441 * Currently only two data type models are supported: 442 * 443 * _ILP32: 444 * Int/Long/Pointer are 32 bits. This is the historical UNIX 445 * and Solaris implementation. Due to its historical standing, 446 * this is the default case. 447 * 448 * _LP64: 449 * Long/Pointer are 64 bits, Int is 32 bits. This is the chosen 450 * implementation for 64-bit ABIs such as SPARC V9. 451 * 452 * _I32LPx: 453 * A compilation environment where 'int' is 32-bit, and 454 * longs and pointers are simply the same size. 455 * 456 * In all cases, Char is 8 bits and Short is 16 bits. 457 * 458 * _SUNOS_VTOC_8 / _SUNOS_VTOC_16 / _SVR4_VTOC_16: 459 * This specifies the form of the disk VTOC (or label): 460 * 461 * _SUNOS_VTOC_8: 462 * This is a VTOC form which is upwardly compatible with the 463 * SunOS 4.x disk label and allows 8 partitions per disk. 464 * 465 * _SUNOS_VTOC_16: 466 * In this format the incore vtoc image matches the ondisk 467 * version. It allows 16 slices per disk, and is not 468 * compatible with the SunOS 4.x disk label. 469 * 470 * Note that these are not the only two VTOC forms possible and 471 * additional forms may be added. One possible form would be the 472 * SVr4 VTOC form. The symbol for that is reserved now, although 473 * it is not implemented. 474 * 475 * _SVR4_VTOC_16: 476 * This VTOC form is compatible with the System V Release 4 477 * VTOC (as implemented on the SVr4 Intel and 3b ports) with 478 * 16 partitions per disk. 479 * 480 * 481 * _DMA_USES_PHYSADDR / _DMA_USES_VIRTADDR 482 * This describes the type of addresses used by system DMA: 483 * 484 * _DMA_USES_PHYSADDR: 485 * This type of DMA, used in the x86 implementation, 486 * requires physical addresses for DMA buffers. The 24-bit 487 * addresses used by some legacy boards is the source of the 488 * "low-memory" (<16MB) requirement for some devices using DMA. 489 * 490 * _DMA_USES_VIRTADDR: 491 * This method of DMA allows the use of virtual addresses for 492 * DMA transfers. 493 * 494 * _FIRMWARE_NEEDS_FDISK / _NO_FDISK_PRESENT 495 * This indicates the presence/absence of an fdisk table. 496 * 497 * _FIRMWARE_NEEDS_FDISK 498 * The fdisk table is required by system firmware. If present, 499 * it allows a disk to be subdivided into multiple fdisk 500 * partitions, each of which is equivalent to a separate, 501 * virtual disk. This enables the co-existence of multiple 502 * operating systems on a shared hard disk. 503 * 504 * _NO_FDISK_PRESENT 505 * If the fdisk table is absent, it is assumed that the entire 506 * media is allocated for a single operating system. 507 * 508 * _HAVE_TEM_FIRMWARE 509 * Defined if this architecture has the (fallback) option of 510 * using prom_* calls for doing I/O if a suitable kernel driver 511 * is not available to do it. 512 * 513 * _DONT_USE_1275_GENERIC_NAMES 514 * Controls whether or not device tree node names should 515 * comply with the IEEE 1275 "Generic Names" Recommended 516 * Practice. With _DONT_USE_GENERIC_NAMES, device-specific 517 * names identifying the particular device will be used. 518 * 519 * __i386_COMPAT 520 * This indicates whether the i386 ABI is supported as a *non-native* 521 * mode for the platform. When this symbol is defined: 522 * - 32-bit xstat-style system calls are enabled 523 * - 32-bit xmknod-style system calls are enabled 524 * - 32-bit system calls use i386 sizes -and- alignments 525 * 526 * Note that this is NOT defined for the i386 native environment! 527 * 528 * __x86 529 * This is ONLY a synonym for defined(__i386) || defined(__amd64) 530 * which is useful only insofar as these two architectures share 531 * common attributes. Analogous to __sparc. 532 * 533 * _PSM_MODULES 534 * This indicates whether or not the implementation uses PSM 535 * modules for processor support, reading /etc/mach from inside 536 * the kernel to extract a list. 537 * 538 * _RTC_CONFIG 539 * This indicates whether or not the implementation uses /etc/rtc_config 540 * to configure the real-time clock in the kernel. 541 * 542 * _UNIX_KRTLD 543 * This indicates that the implementation uses a dynamically 544 * linked unix + krtld to form the core kernel image at boot 545 * time, or (in the absence of this symbol) a prelinked kernel image. 546 * 547 * _OBP 548 * This indicates the firmware interface is OBP. 549 * 550 * _SOFT_HOSTID 551 * This indicates that the implementation obtains the hostid 552 * from the file /etc/hostid, rather than from hardware. 553 */ 554 555 556 557 558 559 /* 560 * The following set of definitions characterize Solaris on AMD's 561 * 64-bit systems. 562 */ 563 # 239 "../../common/sys/isa_defs.h" 564 /* 565 * Define the appropriate "processor characteristics" 566 */ 567 # 265 "../../common/sys/isa_defs.h" 568 /* 569 * Different alignment constraints for the i386 ABI in compatibility mode 570 */ 571 572 573 /* 574 * Define the appropriate "implementation choices". 575 */ 576 # 290 "../../common/sys/isa_defs.h" 577 /* 578 * The feature test macro __i386 is generic for all processors implementing 579 * the Intel 386 instruction set or a superset of it. Specifically, this 580 * includes all members of the 386, 486, and Pentium family of processors. 581 */ 582 # 35 "../../common/sys/feature_tests.h" 2 583 584 585 586 587 588 /* 589 * Values of _POSIX_C_SOURCE 590 * 591 * undefined not a POSIX compilation 592 * 1 POSIX.1-1990 compilation 593 * 2 POSIX.2-1992 compilation 594 * 199309L POSIX.1b-1993 compilation (Real Time) 595 * 199506L POSIX.1c-1995 compilation (POSIX Threads) 596 * 200112L POSIX.1-2001 compilation (Austin Group Revision) 597 * 200809L POSIX.1-2008 compilation 598 */ 599 600 601 602 603 /* 604 * The feature test macros __XOPEN_OR_POSIX, _STRICT_STDC, _STRICT_SYMBOLS, 605 * and _STDC_C99 are Sun implementation specific macros created in order to 606 * compress common standards specified feature test macros for easier reading. 607 * These macros should not be used by the application developer as 608 * unexpected results may occur. Instead, the user should reference 609 * standards(5) for correct usage of the standards feature test macros. 610 * 611 * __XOPEN_OR_POSIX Used in cases where a symbol is defined by both 612 * X/Open or POSIX or in the negative, when neither 613 * X/Open or POSIX defines a symbol. 614 * 615 * _STRICT_STDC __STDC__ is specified by the C Standards and defined 616 * by the compiler. For Sun compilers the value of 617 * __STDC__ is either 1, 0, or not defined based on the 618 * compilation mode (see cc(1)). When the value of 619 * __STDC__ is 1 and in the absence of any other feature 620 * test macros, the namespace available to the application 621 * is limited to only those symbols defined by the C 622 * Standard. _STRICT_STDC provides a more readable means 623 * of identifying symbols defined by the standard, or in 624 * the negative, symbols that are extensions to the C 625 * Standard. See additional comments for GNU C differences. 626 * 627 * _STDC_C99 __STDC_VERSION__ is specified by the C standards and 628 * defined by the compiler and indicates the version of 629 * the C standard. A value of 199901L indicates a 630 * compiler that complies with ISO/IEC 9899:1999, other- 631 * wise known as the C99 standard. 632 * 633 * _STDC_C11 Like _STDC_C99 except that the value of __STDC_VERSION__ 634 * is 201112L indicating a compiler that compiles with 635 * ISO/IEXC 9899:2011, otherwise known as the C11 standard. 636 * 637 * _STRICT_SYMBOLS Used in cases where symbol visibility is restricted 638 * by the standards, and the user has not explicitly 639 * relaxed the strictness via __EXTENSIONS__. 640 */ 641 642 643 644 645 646 /* 647 * ISO/IEC 9899:1990 and it's revisions, ISO/IEC 9899:1999 and ISO/IEC 648 * 99899:2011 specify the following predefined macro name: 649 * 650 * __STDC__ The integer constant 1, intended to indicate a conforming 651 * implementation. 652 * 653 * Furthermore, a strictly conforming program shall use only those features 654 * of the language and library specified in these standards. A conforming 655 * implementation shall accept any strictly conforming program. 656 * 657 * Based on these requirements, Sun's C compiler defines __STDC__ to 1 for 658 * strictly conforming environments and __STDC__ to 0 for environments that 659 * use ANSI C semantics but allow extensions to the C standard. For non-ANSI 660 * C semantics, Sun's C compiler does not define __STDC__. 661 * 662 * The GNU C project interpretation is that __STDC__ should always be defined 663 * to 1 for compilation modes that accept ANSI C syntax regardless of whether 664 * or not extensions to the C standard are used. Violations of conforming 665 * behavior are conditionally flagged as warnings via the use of the 666 * -pedantic option. In addition to defining __STDC__ to 1, the GNU C 667 * compiler also defines __STRICT_ANSI__ as a means of specifying strictly 668 * conforming environments using the -ansi or -std=<standard> options. 669 * 670 * In the absence of any other compiler options, Sun and GNU set the value 671 * of __STDC__ as follows when using the following options: 672 * 673 * Value of __STDC__ __STRICT_ANSI__ 674 * 675 * cc -Xa (default) 0 undefined 676 * cc -Xt (transitional) 0 undefined 677 * cc -Xc (strictly conforming) 1 undefined 678 * cc -Xs (K&R C) undefined undefined 679 * 680 * gcc (default) 1 undefined 681 * gcc -ansi, -std={c89, c99,...) 1 defined 682 * gcc -traditional (K&R) undefined undefined 683 * 684 * The default compilation modes for Sun C compilers versus GNU C compilers 685 * results in a differing value for __STDC__ which results in a more 686 * restricted namespace when using Sun compilers. To allow both GNU and Sun 687 * interpretations to peacefully co-exist, we use the following Sun 688 * implementation _STRICT_STDC_ macro: 689 */ 690 # 150 "../../common/sys/feature_tests.h" 691 /* 692 * Compiler complies with ISO/IEC 9899:1999 or ISO/IEC 9989:2011 693 */ 694 # 162 "../../common/sys/feature_tests.h" 695 /* 696 * Use strict symbol visibility. 697 */ 698 699 700 701 702 703 /* 704 * Large file interfaces: 705 * 706 * _LARGEFILE_SOURCE 707 * 1 large file-related additions to POSIX 708 * interfaces requested (fseeko, etc.) 709 * _LARGEFILE64_SOURCE 710 * 1 transitional large-file-related interfaces 711 * requested (seek64, stat64, etc.) 712 * 713 * The corresponding announcement macros are respectively: 714 * _LFS_LARGEFILE 715 * _LFS64_LARGEFILE 716 * (These are set in <unistd.h>.) 717 * 718 * Requesting _LARGEFILE64_SOURCE implies requesting _LARGEFILE_SOURCE as 719 * well. 720 * 721 * The large file interfaces are made visible regardless of the initial values 722 * of the feature test macros under certain circumstances: 723 * - If no explicit standards-conforming environment is requested (neither 724 * of _POSIX_SOURCE nor _XOPEN_SOURCE is defined and the value of 725 * __STDC__ does not imply standards conformance). 726 * - Extended system interfaces are explicitly requested (__EXTENSIONS__ 727 * is defined). 728 * - Access to in-kernel interfaces is requested (_KERNEL or _KMEMUSER is 729 * defined). (Note that this dependency is an artifact of the current 730 * kernel implementation and may change in future releases.) 731 */ 732 # 210 "../../common/sys/feature_tests.h" 733 /* 734 * Large file compilation environment control: 735 * 736 * The setting of _FILE_OFFSET_BITS controls the size of various file-related 737 * types and governs the mapping between file-related source function symbol 738 * names and the corresponding binary entry points. 739 * 740 * In the 32-bit environment, the default value is 32; if not set, set it to 741 * the default here, to simplify tests in other headers. 742 * 743 * In the 64-bit compilation environment, the only value allowed is 64. 744 */ 745 # 238 "../../common/sys/feature_tests.h" 746 /* 747 * Use of _XOPEN_SOURCE 748 * 749 * The following X/Open specifications are supported: 750 * 751 * X/Open Portability Guide, Issue 3 (XPG3) 752 * X/Open CAE Specification, Issue 4 (XPG4) 753 * X/Open CAE Specification, Issue 4, Version 2 (XPG4v2) 754 * X/Open CAE Specification, Issue 5 (XPG5) 755 * Open Group Technical Standard, Issue 6 (XPG6), also referred to as 756 * IEEE Std. 1003.1-2001 and ISO/IEC 9945:2002. 757 * Open Group Technical Standard, Issue 7 (XPG7), also referred to as 758 * IEEE Std. 1003.1-2008 and ISO/IEC 9945:2009. 759 * 760 * XPG4v2 is also referred to as UNIX 95 (SUS or SUSv1). 761 * XPG5 is also referred to as UNIX 98 or the Single Unix Specification, 762 * Version 2 (SUSv2) 763 * XPG6 is the result of a merge of the X/Open and POSIX specifications 764 * and as such is also referred to as IEEE Std. 1003.1-2001 in 765 * addition to UNIX 03 and SUSv3. 766 * XPG7 is also referred to as UNIX 08 and SUSv4. 767 * 768 * When writing a conforming X/Open application, as per the specification 769 * requirements, the appropriate feature test macros must be defined at 770 * compile time. These are as follows. For more info, see standards(5). 771 * 772 * Feature Test Macro Specification 773 * ------------------------------------------------ ------------- 774 * _XOPEN_SOURCE XPG3 775 * _XOPEN_SOURCE && _XOPEN_VERSION = 4 XPG4 776 * _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1 XPG4v2 777 * _XOPEN_SOURCE = 500 XPG5 778 * _XOPEN_SOURCE = 600 (or POSIX_C_SOURCE=200112L) XPG6 779 * _XOPEN_SOURCE = 700 (or POSIX_C_SOURCE=200809L) XPG7 780 * 781 * In order to simplify the guards within the headers, the following 782 * implementation private test macros have been created. Applications 783 * must NOT use these private test macros as unexpected results will 784 * occur. 785 * 786 * Note that in general, the use of these private macros is cumulative. 787 * For example, the use of _XPG3 with no other restrictions on the X/Open 788 * namespace will make the symbols visible for XPG3 through XPG6 789 * compilation environments. The use of _XPG4_2 with no other X/Open 790 * namespace restrictions indicates that the symbols were introduced in 791 * XPG4v2 and are therefore visible for XPG4v2 through XPG6 compilation 792 * environments, but not for XPG3 or XPG4 compilation environments. 793 * 794 * _XPG3 X/Open Portability Guide, Issue 3 (XPG3) 795 * _XPG4 X/Open CAE Specification, Issue 4 (XPG4) 796 * _XPG4_2 X/Open CAE Specification, Issue 4, Version 2 (XPG4v2/UNIX 95/SUS) 797 * _XPG5 X/Open CAE Specification, Issue 5 (XPG5/UNIX 98/SUSv2) 798 * _XPG6 Open Group Technical Standard, Issue 6 (XPG6/UNIX 03/SUSv3) 799 * _XPG7 Open Group Technical Standard, Issue 7 (XPG7/UNIX 08/SUSv4) 800 */ 801 802 /* X/Open Portability Guide, Issue 3 */ 803 # 341 "../../common/sys/feature_tests.h" 804 /* 805 * _XOPEN_VERSION is defined by the X/Open specifications and is not 806 * normally defined by the application, except in the case of an XPG4 807 * application. On the implementation side, _XOPEN_VERSION defined with 808 * the value of 3 indicates an XPG3 application. _XOPEN_VERSION defined 809 * with the value of 4 indicates an XPG4 or XPG4v2 (UNIX 95) application. 810 * _XOPEN_VERSION defined with a value of 500 indicates an XPG5 (UNIX 98) 811 * application and with a value of 600 indicates an XPG6 (UNIX 03) 812 * application and with a value of 700 indicates an XPG7 (UNIX 08). 813 * The appropriate version is determined by the use of the 814 * feature test macros described earlier. The value of _XOPEN_VERSION 815 * defaults to 3 otherwise indicating support for XPG3 applications. 816 */ 817 # 368 "../../common/sys/feature_tests.h" 818 /* 819 * ANSI C and ISO 9899:1990 say the type long long doesn't exist in strictly 820 * conforming environments. ISO 9899:1999 says it does. 821 * 822 * The presence of _LONGLONG_TYPE says "long long exists" which is therefore 823 * defined in all but strictly conforming environments that disallow it. 824 */ 825 # 388 "../../common/sys/feature_tests.h" 826 /* 827 * The following macro defines a value for the ISO C99 restrict 828 * keyword so that _RESTRICT_KYWD resolves to "restrict" if 829 * an ISO C99 compiler is used, "__restrict" for c++ and "" (null string) 830 * if any other compiler is used. This allows for the use of single 831 * prototype declarations regardless of compiler version. 832 */ 833 834 835 836 837 /* 838 * NOTE: The whitespace between the '#' and 'define' is significant. 839 * It foils gcc's fixincludes from defining a redundant 'restrict'. 840 */ 841 /* CSTYLED */ 842 843 844 845 846 847 848 /* 849 * The following macro defines a value for the ISO C11 _Noreturn 850 * keyword so that _NORETURN_KYWD resolves to "_Noreturn" if 851 * an ISO C11 compiler is used and "" (null string) if any other 852 * compiler is used. This allows for the use of single prototype 853 * declarations regardless of compiler version. 854 */ 855 856 857 858 859 860 861 862 /* 863 * The following macro indicates header support for the ANSI C++ 864 * standard. The ISO/IEC designation for this is ISO/IEC FDIS 14882. 865 */ 866 867 868 /* 869 * The following macro indicates header support for the C99 standard, 870 * ISO/IEC 9899:1999, Programming Languages - C. 871 */ 872 873 874 /* 875 * The following macro indicates header support for the C99 standard, 876 * ISO/IEC 9899:2011, Programming Languages - C. 877 */ 878 879 880 /* 881 * The following macro indicates header support for DTrace. The value is an 882 * integer that corresponds to the major version number for DTrace. 883 */ 884 # 37 "../../common/sys/types.h" 2 885 # 1 "../../common/sys/isa_defs.h" 1 886 /* 887 * CDDL HEADER START 888 * 889 * The contents of this file are subject to the terms of the 890 * Common Development and Distribution License (the "License"). 891 * You may not use this file except in compliance with the License. 892 * 893 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 894 * or http://www.opensolaris.org/os/licensing. 895 * See the License for the specific language governing permissions 896 * and limitations under the License. 897 * 898 * 899 * When distributing Covered Code, include this CDDL HEADER in each 900 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 901 * If applicable, add the following below this CDDL HEADER, with the 902 * fields enclosed by brackets "[]" replaced with your own identifying 903 * information: Portions Copyright [yyyy] [name of copyright owner] 904 * 905 * CDDL HEADER END 906 */ 907 908 /* 909 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 910 * Use is subject to license terms. 911 * Copyright 2016 Joyent, Inc. 912 */ 913 # 38 "../../common/sys/types.h" 2 914 915 /* 916 * Machine dependent definitions moved to <sys/machtypes.h>. 917 */ 918 # 1 "../../intel/sys/machtypes.h" 1 919 /* 920 * CDDL HEADER START 921 * 922 * The contents of this file are subject to the terms of the 923 * Common Development and Distribution License, Version 1.0 only 924 * (the "License"). You may not use this file except in compliance 925 * with the License. 926 * 927 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 928 * or http://www.opensolaris.org/os/licensing. 929 * See the License for the specific language governing permissions 930 * and limitations under the License. 931 * 932 * When distributing Covered Code, include this CDDL HEADER in each 933 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 934 * If applicable, add the following below this CDDL HEADER, with the 935 * fields enclosed by brackets "[]" replaced with your own identifying 936 * information: Portions Copyright [yyyy] [name of copyright owner] 937 * 938 * CDDL HEADER END 939 */ 940 /* 941 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 942 * Use is subject to license terms. 943 */ 944 945 946 947 948 #pragma ident "%Z%%M% %I% %E% SMI" 949 950 # 1 "../../common/sys/feature_tests.h" 1 951 /* 952 * CDDL HEADER START 953 * 954 * The contents of this file are subject to the terms of the 955 * Common Development and Distribution License (the "License"). 956 * You may not use this file except in compliance with the License. 957 * 958 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 959 * or http://www.opensolaris.org/os/licensing. 960 * See the License for the specific language governing permissions 961 * and limitations under the License. 962 * 963 * When distributing Covered Code, include this CDDL HEADER in each 964 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 965 * If applicable, add the following below this CDDL HEADER, with the 966 * fields enclosed by brackets "[]" replaced with your own identifying 967 * information: Portions Copyright [yyyy] [name of copyright owner] 968 * 969 * CDDL HEADER END 970 */ 971 972 /* 973 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 974 * Copyright 2016 Joyent, Inc. 975 * 976 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 977 * Use is subject to license terms. 978 */ 979 # 33 "../../intel/sys/machtypes.h" 2 980 981 982 983 # 1 "../../intel/ia32/sys/machtypes.h" 1 984 /* 985 * CDDL HEADER START 986 * 987 * The contents of this file are subject to the terms of the 988 * Common Development and Distribution License (the "License"). 989 * You may not use this file except in compliance with the License. 990 * 991 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 992 * or http://www.opensolaris.org/os/licensing. 993 * See the License for the specific language governing permissions 994 * and limitations under the License. 995 * 996 * When distributing Covered Code, include this CDDL HEADER in each 997 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 998 * If applicable, add the following below this CDDL HEADER, with the 999 * fields enclosed by brackets "[]" replaced with your own identifying 1000 * information: Portions Copyright [yyyy] [name of copyright owner] 1001 * 1002 * CDDL HEADER END 1003 */ 1004 /* 1005 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 1006 * Use is subject to license terms. 1007 */ 1008 1009 1010 1011 1012 #pragma ident "%Z%%M% %I% %E% SMI" 1013 1014 1015 1016 1017 1018 /* 1019 * Machine dependent types: 1020 * 1021 * intel ia32 Version 1022 */ 1023 # 61 "../../intel/ia32/sys/machtypes.h" 1024 typedef struct _label_t { long val[8]; } label_t; 1025 1026 1027 1028 typedef unsigned char lock_t; /* lock work for busy wait */ 1029 # 37 "../../intel/sys/machtypes.h" 2 1030 # 43 "../../common/sys/types.h" 2 1031 1032 /* 1033 * Include fixed width type declarations proposed by the ISO/JTC1/SC22/WG14 C 1034 * committee's working draft for the revision of the current ISO C standard, 1035 * ISO/IEC 9899:1990 Programming language - C. These are not currently 1036 * required by any standard but constitute a useful, general purpose set 1037 * of type definitions which is namespace clean with respect to all standards. 1038 */ 1039 1040 # 1 "../../common/sys/inttypes.h" 1 1041 /* 1042 * CDDL HEADER START 1043 * 1044 * The contents of this file are subject to the terms of the 1045 * Common Development and Distribution License, Version 1.0 only 1046 * (the "License"). You may not use this file except in compliance 1047 * with the License. 1048 * 1049 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1050 * or http://www.opensolaris.org/os/licensing. 1051 * See the License for the specific language governing permissions 1052 * and limitations under the License. 1053 * 1054 * When distributing Covered Code, include this CDDL HEADER in each 1055 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1056 * If applicable, add the following below this CDDL HEADER, with the 1057 * fields enclosed by brackets "[]" replaced with your own identifying 1058 * information: Portions Copyright [yyyy] [name of copyright owner] 1059 * 1060 * CDDL HEADER END 1061 */ 1062 /* 1063 * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 1064 * Use is subject to license terms. 1065 */ 1066 1067 1068 1069 1070 #pragma ident "%Z%%M% %I% %E% SMI" 1071 1072 /* 1073 * This header, <sys/inttypes.h>, contains (through nested inclusion) the 1074 * vast majority of the facilities specified for <inttypes.h> as defined 1075 * by the ISO C Standard, ISO/IEC 9899:1999 Programming language - C. 1076 * 1077 * Kernel/Driver developers are encouraged to include this file to access 1078 * the fixed size types, limits and utility macros. Application developers 1079 * should use the standard defined header <inttypes.h>. 1080 */ 1081 1082 # 1 "../../common/sys/feature_tests.h" 1 1083 /* 1084 * CDDL HEADER START 1085 * 1086 * The contents of this file are subject to the terms of the 1087 * Common Development and Distribution License (the "License"). 1088 * You may not use this file except in compliance with the License. 1089 * 1090 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1091 * or http://www.opensolaris.org/os/licensing. 1092 * See the License for the specific language governing permissions 1093 * and limitations under the License. 1094 * 1095 * When distributing Covered Code, include this CDDL HEADER in each 1096 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1097 * If applicable, add the following below this CDDL HEADER, with the 1098 * fields enclosed by brackets "[]" replaced with your own identifying 1099 * information: Portions Copyright [yyyy] [name of copyright owner] 1100 * 1101 * CDDL HEADER END 1102 */ 1103 1104 /* 1105 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 1106 * Copyright 2016 Joyent, Inc. 1107 * 1108 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 1109 * Use is subject to license terms. 1110 */ 1111 # 43 "../../common/sys/inttypes.h" 2 1112 # 1 "../../common/sys/int_types.h" 1 1113 /* 1114 * CDDL HEADER START 1115 * 1116 * The contents of this file are subject to the terms of the 1117 * Common Development and Distribution License, Version 1.0 only 1118 * (the "License"). You may not use this file except in compliance 1119 * with the License. 1120 * 1121 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1122 * or http://www.opensolaris.org/os/licensing. 1123 * See the License for the specific language governing permissions 1124 * and limitations under the License. 1125 * 1126 * When distributing Covered Code, include this CDDL HEADER in each 1127 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1128 * If applicable, add the following below this CDDL HEADER, with the 1129 * fields enclosed by brackets "[]" replaced with your own identifying 1130 * information: Portions Copyright [yyyy] [name of copyright owner] 1131 * 1132 * CDDL HEADER END 1133 */ 1134 /* 1135 * Copyright 2014 Garrett D'Amore <garrett@damore.org> 1136 * 1137 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 1138 * Use is subject to license terms. 1139 */ 1140 1141 1142 1143 1144 /* 1145 * This file, <sys/int_types.h>, is part of the Sun Microsystems implementation 1146 * of <inttypes.h> defined in the ISO C standard, ISO/IEC 9899:1999 1147 * Programming language - C. 1148 * 1149 * Programs/Modules should not directly include this file. Access to the 1150 * types defined in this file should be through the inclusion of one of the 1151 * following files: 1152 * 1153 * <sys/types.h> Provides only the "_t" types defined in this 1154 * file which is a subset of the contents of 1155 * <inttypes.h>. (This can be appropriate for 1156 * all programs/modules except those claiming 1157 * ANSI-C conformance.) 1158 * 1159 * <sys/inttypes.h> Provides the Kernel and Driver appropriate 1160 * components of <inttypes.h>. 1161 * 1162 * <inttypes.h> For use by applications. 1163 * 1164 * See these files for more details. 1165 */ 1166 1167 # 1 "../../common/sys/feature_tests.h" 1 1168 /* 1169 * CDDL HEADER START 1170 * 1171 * The contents of this file are subject to the terms of the 1172 * Common Development and Distribution License (the "License"). 1173 * You may not use this file except in compliance with the License. 1174 * 1175 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1176 * or http://www.opensolaris.org/os/licensing. 1177 * See the License for the specific language governing permissions 1178 * and limitations under the License. 1179 * 1180 * When distributing Covered Code, include this CDDL HEADER in each 1181 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1182 * If applicable, add the following below this CDDL HEADER, with the 1183 * fields enclosed by brackets "[]" replaced with your own identifying 1184 * information: Portions Copyright [yyyy] [name of copyright owner] 1185 * 1186 * CDDL HEADER END 1187 */ 1188 1189 /* 1190 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 1191 * Copyright 2016 Joyent, Inc. 1192 * 1193 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 1194 * Use is subject to license terms. 1195 */ 1196 # 56 "../../common/sys/int_types.h" 2 1197 1198 1199 1200 1201 1202 /* 1203 * Basic / Extended integer types 1204 * 1205 * The following defines the basic fixed-size integer types. 1206 * 1207 * Implementations are free to typedef them to Standard C integer types or 1208 * extensions that they support. If an implementation does not support one 1209 * of the particular integer data types below, then it should not define the 1210 * typedefs and macros corresponding to that data type. Note that int8_t 1211 * is not defined in -Xs mode on ISAs for which the ABI specifies "char" 1212 * as an unsigned entity because there is no way to define an eight bit 1213 * signed integral. 1214 */ 1215 1216 typedef char int8_t; 1217 1218 1219 1220 typedef short int16_t; 1221 typedef int int32_t; 1222 1223 1224 typedef long int64_t; 1225 1226 1227 1228 1229 1230 1231 1232 typedef unsigned char uint8_t; 1233 typedef unsigned short uint16_t; 1234 typedef unsigned int uint32_t; 1235 1236 typedef unsigned long uint64_t; 1237 1238 1239 1240 1241 1242 1243 /* 1244 * intmax_t and uintmax_t are to be the longest (in number of bits) signed 1245 * and unsigned integer types supported by the implementation. 1246 */ 1247 1248 typedef int64_t intmax_t; 1249 typedef uint64_t uintmax_t; 1250 1251 1252 1253 1254 1255 /* 1256 * intptr_t and uintptr_t are signed and unsigned integer types large enough 1257 * to hold any data pointer; that is, data pointers can be assigned into or 1258 * from these integer types without losing precision. 1259 */ 1260 1261 typedef long intptr_t; 1262 typedef unsigned long uintptr_t; 1263 1264 1265 1266 1267 1268 /* 1269 * The following define the fastest integer types that can hold the 1270 * specified number of bits. 1271 */ 1272 1273 typedef char int_fast8_t; 1274 1275 1276 1277 typedef int int_fast16_t; 1278 typedef int int_fast32_t; 1279 1280 typedef long int_fast64_t; 1281 1282 1283 1284 1285 1286 1287 typedef unsigned char uint_fast8_t; 1288 typedef unsigned int uint_fast16_t; 1289 typedef unsigned int uint_fast32_t; 1290 1291 typedef unsigned long uint_fast64_t; 1292 1293 1294 1295 1296 1297 1298 /* 1299 * The following define the smallest integer types that can hold the 1300 * specified number of bits. 1301 */ 1302 1303 typedef char int_least8_t; 1304 1305 1306 1307 typedef short int_least16_t; 1308 typedef int int_least32_t; 1309 1310 typedef long int_least64_t; 1311 1312 1313 1314 1315 1316 1317 /* 1318 * If these are changed, please update char16_t and char32_t in head/uchar.h. 1319 */ 1320 typedef unsigned char uint_least8_t; 1321 typedef unsigned short uint_least16_t; 1322 typedef unsigned int uint_least32_t; 1323 1324 typedef unsigned long uint_least64_t; 1325 # 44 "../../common/sys/inttypes.h" 2 1326 1327 # 1 "../../common/sys/int_limits.h" 1 1328 /* 1329 * CDDL HEADER START 1330 * 1331 * The contents of this file are subject to the terms of the 1332 * Common Development and Distribution License, Version 1.0 only 1333 * (the "License"). You may not use this file except in compliance 1334 * with the License. 1335 * 1336 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1337 * or http://www.opensolaris.org/os/licensing. 1338 * See the License for the specific language governing permissions 1339 * and limitations under the License. 1340 * 1341 * When distributing Covered Code, include this CDDL HEADER in each 1342 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1343 * If applicable, add the following below this CDDL HEADER, with the 1344 * fields enclosed by brackets "[]" replaced with your own identifying 1345 * information: Portions Copyright [yyyy] [name of copyright owner] 1346 * 1347 * CDDL HEADER END 1348 */ 1349 /* 1350 * Copyright 2014 Garrett D'Amore <garrett@damore.org> 1351 * 1352 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 1353 * Use is subject to license terms. 1354 */ 1355 1356 1357 1358 1359 /* 1360 * This file, <sys/int_limits.h>, is part of the Sun Microsystems implementation 1361 * of <inttypes.h> as defined in the ISO C standard, ISO/IEC 9899:1999 1362 * Programming language - C. 1363 * 1364 * Programs/Modules should not directly include this file. Access to the 1365 * types defined in this file should be through the inclusion of one of the 1366 * following files: 1367 * 1368 * <limits.h> This nested inclusion is disabled for strictly 1369 * ANSI-C conforming compilations. The *_MIN 1370 * definitions are not visible to POSIX or XPG 1371 * conforming applications (due to what may be 1372 * a bug in the specification - this is under 1373 * investigation) 1374 * 1375 * <sys/inttypes.h> Provides the Kernel and Driver appropriate 1376 * components of <inttypes.h>. 1377 * 1378 * <inttypes.h> For use by applications. 1379 * 1380 * See these files for more details. 1381 */ 1382 1383 # 1 "../../common/sys/feature_tests.h" 1 1384 /* 1385 * CDDL HEADER START 1386 * 1387 * The contents of this file are subject to the terms of the 1388 * Common Development and Distribution License (the "License"). 1389 * You may not use this file except in compliance with the License. 1390 * 1391 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1392 * or http://www.opensolaris.org/os/licensing. 1393 * See the License for the specific language governing permissions 1394 * and limitations under the License. 1395 * 1396 * When distributing Covered Code, include this CDDL HEADER in each 1397 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1398 * If applicable, add the following below this CDDL HEADER, with the 1399 * fields enclosed by brackets "[]" replaced with your own identifying 1400 * information: Portions Copyright [yyyy] [name of copyright owner] 1401 * 1402 * CDDL HEADER END 1403 */ 1404 1405 /* 1406 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 1407 * Copyright 2016 Joyent, Inc. 1408 * 1409 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 1410 * Use is subject to license terms. 1411 */ 1412 # 57 "../../common/sys/int_limits.h" 2 1413 1414 1415 1416 1417 1418 /* 1419 * Limits 1420 * 1421 * The following define the limits for the types defined in <sys/int_types.h>. 1422 * 1423 * INTMAX_MIN (minimum value of the largest supported signed integer type), 1424 * INTMAX_MAX (maximum value of the largest supported signed integer type), 1425 * and UINTMAX_MAX (maximum value of the largest supported unsigned integer 1426 * type) can be set to implementation defined limits. 1427 * 1428 * NOTE : A programmer can test to see whether an implementation supports 1429 * a particular size of integer by testing if the macro that gives the 1430 * maximum for that datatype is defined. For example, if #ifdef UINT64_MAX 1431 * tests false, the implementation does not support unsigned 64 bit integers. 1432 * 1433 * The type of these macros is intentionally unspecified. 1434 * 1435 * The types int8_t, int_least8_t, and int_fast8_t are not defined for ISAs 1436 * where the ABI specifies "char" as unsigned when the translation mode is 1437 * not ANSI-C. 1438 */ 1439 # 141 "../../common/sys/int_limits.h" 1440 /* 1441 * The following 2 macros are provided for testing whether the types 1442 * intptr_t and uintptr_t (integers large enough to hold a void *) are 1443 * defined in this header. They are needed in case the architecture can't 1444 * represent a pointer in any standard integral type. 1445 */ 1446 # 155 "../../common/sys/int_limits.h" 1447 /* Maximum limits of ptrdiff_t defined in <sys/types.h> */ 1448 1449 1450 1451 1452 1453 1454 /* 1455 * Maximum value of a "size_t". SIZE_MAX was previously defined 1456 * in <limits.h>, however, the standards specify it be defined 1457 * in <stdint.h>. The <stdint.h> headers includes this header as 1458 * does <limits.h>. The value of SIZE_MAX should not deviate 1459 * from the value of ULONG_MAX defined <sys/types.h>. 1460 */ 1461 1462 1463 1464 1465 1466 1467 /* Maximum limit of sig_atomic_t defined in <sys/types.h> */ 1468 1469 1470 1471 1472 /* 1473 * Maximum limit of wchar_t. The WCHAR_* macros are also 1474 * defined in <iso/wchar_iso.h>, but inclusion of that header 1475 * will break ISO/IEC C namespace. 1476 */ 1477 1478 1479 1480 1481 /* Maximum limit of wint_t */ 1482 1483 1484 1485 1486 /* 1487 * It is probably a bug in the POSIX specification (IEEE-1003.1-1990) that 1488 * when including <limits.h> that the suffix _MAX is reserved but not the 1489 * suffix _MIN. However, until that issue is resolved.... 1490 */ 1491 # 230 "../../common/sys/int_limits.h" 1492 /* Minimum value of a pointer-holding signed integer type */ 1493 1494 1495 1496 1497 1498 1499 /* Minimum limits of ptrdiff_t defined in <sys/types.h> */ 1500 1501 1502 1503 1504 1505 1506 /* Minimum limit of sig_atomic_t defined in <sys/types.h> */ 1507 1508 1509 1510 1511 /* 1512 * Minimum limit of wchar_t. The WCHAR_* macros are also 1513 * defined in <iso/wchar_iso.h>, but inclusion of that header 1514 * will break ISO/IEC C namespace. 1515 */ 1516 1517 1518 1519 1520 /* Minimum limit of wint_t */ 1521 # 46 "../../common/sys/inttypes.h" 2 1522 # 1 "../../common/sys/int_const.h" 1 1523 /* 1524 * CDDL HEADER START 1525 * 1526 * The contents of this file are subject to the terms of the 1527 * Common Development and Distribution License, Version 1.0 only 1528 * (the "License"). You may not use this file except in compliance 1529 * with the License. 1530 * 1531 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1532 * or http://www.opensolaris.org/os/licensing. 1533 * See the License for the specific language governing permissions 1534 * and limitations under the License. 1535 * 1536 * When distributing Covered Code, include this CDDL HEADER in each 1537 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1538 * If applicable, add the following below this CDDL HEADER, with the 1539 * fields enclosed by brackets "[]" replaced with your own identifying 1540 * information: Portions Copyright [yyyy] [name of copyright owner] 1541 * 1542 * CDDL HEADER END 1543 */ 1544 /* 1545 * Copyright 2014 Garrett D'Amore <garrett@damore.org> 1546 * 1547 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 1548 * Use is subject to license terms. 1549 */ 1550 1551 1552 1553 1554 /* 1555 * This file, <sys/int_const.h>, is part of the Sun Microsystems implementation 1556 * of <inttypes.h> as proposed in the ISO/JTC1/SC22/WG14 C committee's working 1557 * draft for the revision of the current ISO C standard, ISO/IEC 9899:1990 1558 * Programming language - C. 1559 * 1560 * Programs/Modules should not directly include this file. Access to the 1561 * types defined in this file should be through the inclusion of one of the 1562 * following files: 1563 * 1564 * <sys/inttypes.h> Provides the Kernel and Driver appropriate 1565 * components of <inttypes.h>. 1566 * 1567 * <inttypes.h> For use by applications. 1568 * 1569 * See these files for more details. 1570 * 1571 * Use at your own risk. This file will track the evolution of the revision 1572 * of the current ISO C standard. As of February 1996, the committee is 1573 * squarely behind the fixed sized types. 1574 */ 1575 1576 # 1 "../../common/sys/feature_tests.h" 1 1577 /* 1578 * CDDL HEADER START 1579 * 1580 * The contents of this file are subject to the terms of the 1581 * Common Development and Distribution License (the "License"). 1582 * You may not use this file except in compliance with the License. 1583 * 1584 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1585 * or http://www.opensolaris.org/os/licensing. 1586 * See the License for the specific language governing permissions 1587 * and limitations under the License. 1588 * 1589 * When distributing Covered Code, include this CDDL HEADER in each 1590 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1591 * If applicable, add the following below this CDDL HEADER, with the 1592 * fields enclosed by brackets "[]" replaced with your own identifying 1593 * information: Portions Copyright [yyyy] [name of copyright owner] 1594 * 1595 * CDDL HEADER END 1596 */ 1597 1598 /* 1599 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 1600 * Copyright 2016 Joyent, Inc. 1601 * 1602 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 1603 * Use is subject to license terms. 1604 */ 1605 # 55 "../../common/sys/int_const.h" 2 1606 1607 1608 1609 1610 1611 /* 1612 * Constants 1613 * 1614 * The following macros create constants of the types defined in 1615 * <sys/int_types.h>. The intent is that: 1616 * Constants defined using these macros have a specific size and 1617 * signedness. The suffix used for int64_t and uint64_t (ll and ull) 1618 * are for examples only. Implementations are permitted to use other 1619 * suffixes. 1620 * 1621 * The "CSTYLED" comments are flags to an internal code style analysis tool 1622 * telling it to silently accept the line which follows. This internal 1623 * standard requires a space between arguments, but the historical, 1624 * non-ANSI-C ``method'' of concatenation can't tolerate those spaces. 1625 */ 1626 /* CSTYLED */ 1627 1628 1629 1630 1631 1632 1633 /* CSTYLED */ 1634 # 91 "../../common/sys/int_const.h" 1635 /* CSTYLED */ 1636 1637 /* CSTYLED */ 1638 1639 /* CSTYLED */ 1640 1641 1642 /* CSTYLED */ 1643 # 108 "../../common/sys/int_const.h" 1644 /* CSTYLED */ 1645 1646 /* CSTYLED */ 1647 # 47 "../../common/sys/inttypes.h" 2 1648 # 1 "../../common/sys/int_fmtio.h" 1 1649 /* 1650 * CDDL HEADER START 1651 * 1652 * The contents of this file are subject to the terms of the 1653 * Common Development and Distribution License, Version 1.0 only 1654 * (the "License"). You may not use this file except in compliance 1655 * with the License. 1656 * 1657 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1658 * or http://www.opensolaris.org/os/licensing. 1659 * See the License for the specific language governing permissions 1660 * and limitations under the License. 1661 * 1662 * When distributing Covered Code, include this CDDL HEADER in each 1663 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1664 * If applicable, add the following below this CDDL HEADER, with the 1665 * fields enclosed by brackets "[]" replaced with your own identifying 1666 * information: Portions Copyright [yyyy] [name of copyright owner] 1667 * 1668 * CDDL HEADER END 1669 */ 1670 /* 1671 * Copyright 2014 Garrett D'Amore <garrett@damore.org> 1672 * 1673 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 1674 * Use is subject to license terms. 1675 */ 1676 1677 1678 1679 1680 /* 1681 * This file, <sys/int_fmtio.h>, is part of the Sun Microsystems implementation 1682 * of <inttypes.h> as defined by the ISO C Standard, ISO/IEC 9899:1999 1683 * Programming language - C. 1684 * 1685 * ISO International Organization for Standardization. 1686 * 1687 * Programs/Modules should not directly include this file. Access to the 1688 * types defined in this file should be through the inclusion of one of the 1689 * following files: 1690 * 1691 * <sys/inttypes.h> Provides the Kernel and Driver appropriate 1692 * components of <inttypes.h>. 1693 * 1694 * <inttypes.h> For use by applications. 1695 * 1696 * See these files for more details. 1697 */ 1698 1699 # 1 "../../common/sys/feature_tests.h" 1 1700 /* 1701 * CDDL HEADER START 1702 * 1703 * The contents of this file are subject to the terms of the 1704 * Common Development and Distribution License (the "License"). 1705 * You may not use this file except in compliance with the License. 1706 * 1707 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1708 * or http://www.opensolaris.org/os/licensing. 1709 * See the License for the specific language governing permissions 1710 * and limitations under the License. 1711 * 1712 * When distributing Covered Code, include this CDDL HEADER in each 1713 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1714 * If applicable, add the following below this CDDL HEADER, with the 1715 * fields enclosed by brackets "[]" replaced with your own identifying 1716 * information: Portions Copyright [yyyy] [name of copyright owner] 1717 * 1718 * CDDL HEADER END 1719 */ 1720 1721 /* 1722 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 1723 * Copyright 2016 Joyent, Inc. 1724 * 1725 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 1726 * Use is subject to license terms. 1727 */ 1728 # 52 "../../common/sys/int_fmtio.h" 2 1729 1730 1731 1732 1733 1734 /* 1735 * Formatted I/O 1736 * 1737 * The following macros can be used even when an implementation has not 1738 * extended the printf/scanf family of functions. 1739 * 1740 * The form of the names of the macros is either "PRI" for printf specifiers 1741 * or "SCN" for scanf specifiers, followed by the conversion specifier letter 1742 * followed by the datatype size. For example, PRId32 is the macro for 1743 * the printf d conversion specifier with the flags for 32 bit datatype. 1744 * 1745 * An example using one of these macros: 1746 * 1747 * uint64_t u; 1748 * printf("u = %016" PRIx64 "\n", u); 1749 * 1750 * For the purpose of example, the definitions of the printf/scanf macros 1751 * below have the values appropriate for a machine with 8 bit shorts, 16 1752 * bit shorts, 32 bit ints, 32 or 64 bit longs depending on compilation 1753 * mode, and 64 bit long longs. 1754 */ 1755 1756 /* 1757 * fprintf macros for signed integers 1758 */ 1759 # 139 "../../common/sys/int_fmtio.h" 1760 /* 1761 * fprintf macros for unsigned integers 1762 */ 1763 # 227 "../../common/sys/int_fmtio.h" 1764 /* 1765 * fprintf macros for pointers 1766 */ 1767 # 247 "../../common/sys/int_fmtio.h" 1768 /* 1769 * fscanf macros for signed integers 1770 */ 1771 # 282 "../../common/sys/int_fmtio.h" 1772 /* 1773 * fscanf macros for unsigned integers 1774 */ 1775 # 349 "../../common/sys/int_fmtio.h" 1776 /* 1777 * The following macros define I/O formats for intmax_t and uintmax_t. 1778 */ 1779 # 48 "../../common/sys/inttypes.h" 2 1780 # 53 "../../common/sys/types.h" 2 1781 1782 1783 1784 1785 1786 # 1 "../../common/sys/types32.h" 1 1787 /* 1788 * CDDL HEADER START 1789 * 1790 * The contents of this file are subject to the terms of the 1791 * Common Development and Distribution License (the "License"). 1792 * You may not use this file except in compliance with the License. 1793 * 1794 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1795 * or http://www.opensolaris.org/os/licensing. 1796 * See the License for the specific language governing permissions 1797 * and limitations under the License. 1798 * 1799 * When distributing Covered Code, include this CDDL HEADER in each 1800 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1801 * If applicable, add the following below this CDDL HEADER, with the 1802 * fields enclosed by brackets "[]" replaced with your own identifying 1803 * information: Portions Copyright [yyyy] [name of copyright owner] 1804 * 1805 * CDDL HEADER END 1806 */ 1807 /* 1808 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 1809 * Use is subject to license terms. 1810 * Copyright 2015 Nexenta Systems, Inc. 1811 */ 1812 1813 1814 1815 1816 #pragma ident "%Z%%M% %I% %E% SMI" 1817 1818 # 1 "../../common/sys/int_types.h" 1 1819 /* 1820 * CDDL HEADER START 1821 * 1822 * The contents of this file are subject to the terms of the 1823 * Common Development and Distribution License, Version 1.0 only 1824 * (the "License"). You may not use this file except in compliance 1825 * with the License. 1826 * 1827 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 1828 * or http://www.opensolaris.org/os/licensing. 1829 * See the License for the specific language governing permissions 1830 * and limitations under the License. 1831 * 1832 * When distributing Covered Code, include this CDDL HEADER in each 1833 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1834 * If applicable, add the following below this CDDL HEADER, with the 1835 * fields enclosed by brackets "[]" replaced with your own identifying 1836 * information: Portions Copyright [yyyy] [name of copyright owner] 1837 * 1838 * CDDL HEADER END 1839 */ 1840 /* 1841 * Copyright 2014 Garrett D'Amore <garrett@damore.org> 1842 * 1843 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 1844 * Use is subject to license terms. 1845 */ 1846 # 33 "../../common/sys/types32.h" 2 1847 1848 1849 1850 1851 1852 /* 1853 * Interoperability types for programs. Used for: 1854 * 1855 * Crossing between 32-bit and 64-bit domains. 1856 * 1857 * On disk data formats such as filesystem meta data 1858 * and disk label. 1859 * 1860 * Note: Applications should never include this 1861 * header file. 1862 */ 1863 typedef uint32_t caddr32_t; 1864 typedef int32_t daddr32_t; 1865 typedef int32_t off32_t; 1866 typedef uint32_t ino32_t; 1867 typedef int32_t blkcnt32_t; 1868 typedef uint32_t fsblkcnt32_t; 1869 typedef uint32_t fsfilcnt32_t; 1870 typedef int32_t id32_t; 1871 typedef uint32_t major32_t; 1872 typedef uint32_t minor32_t; 1873 typedef int32_t key32_t; 1874 typedef uint32_t mode32_t; 1875 typedef uint32_t uid32_t; 1876 typedef uint32_t gid32_t; 1877 typedef uint32_t nlink32_t; 1878 typedef uint32_t dev32_t; 1879 typedef int32_t pid32_t; 1880 typedef uint32_t size32_t; 1881 typedef int32_t ssize32_t; 1882 typedef int32_t time32_t; 1883 typedef int32_t clock32_t; 1884 typedef uint32_t uintptr32_t; 1885 typedef int32_t intptr32_t; 1886 1887 struct timeval32 { 1888 time32_t tv_sec; /* seconds */ 1889 int32_t tv_usec; /* and microseconds */ 1890 }; 1891 1892 typedef struct timespec32 { 1893 time32_t tv_sec; /* seconds */ 1894 int32_t tv_nsec; /* and nanoseconds */ 1895 } timespec32_t; 1896 1897 typedef struct timespec32 timestruc32_t; 1898 1899 typedef struct itimerspec32 { 1900 struct timespec32 it_interval; 1901 struct timespec32 it_value; 1902 } itimerspec32_t; 1903 # 59 "../../common/sys/types.h" 2 1904 1905 1906 1907 1908 1909 1910 /* 1911 * Strictly conforming ANSI C environments prior to the 1999 1912 * revision of the C Standard (ISO/IEC 9899:1999) do not have 1913 * the long long data type. 1914 */ 1915 1916 typedef long long longlong_t; 1917 typedef unsigned long long u_longlong_t; 1918 # 85 "../../common/sys/types.h" 1919 /* 1920 * These types (t_{u}scalar_t) exist because the XTI/TPI/DLPI standards had 1921 * to use them instead of int32_t and uint32_t because DEC had 1922 * shipped 64-bit wide. 1923 */ 1924 1925 typedef int32_t t_scalar_t; 1926 typedef uint32_t t_uscalar_t; 1927 1928 1929 1930 1931 1932 /* 1933 * POSIX Extensions 1934 */ 1935 typedef unsigned char uchar_t; 1936 typedef unsigned short ushort_t; 1937 typedef unsigned int uint_t; 1938 typedef unsigned long ulong_t; 1939 1940 typedef char *caddr_t; /* ?<core address> type */ 1941 typedef long daddr_t; /* <disk address> type */ 1942 typedef short cnt_t; /* ?<count> type */ 1943 1944 1945 1946 1947 typedef long ptrdiff_t; /* pointer difference */ 1948 1949 1950 1951 1952 1953 /* 1954 * VM-related types 1955 */ 1956 typedef ulong_t pfn_t; /* page frame number */ 1957 typedef ulong_t pgcnt_t; /* number of pages */ 1958 typedef long spgcnt_t; /* signed number of pages */ 1959 1960 typedef uchar_t use_t; /* use count for swap. */ 1961 typedef short sysid_t; 1962 typedef short index_t; 1963 typedef void *timeout_id_t; /* opaque handle from timeout(9F) */ 1964 typedef void *bufcall_id_t; /* opaque handle from bufcall(9F) */ 1965 1966 /* 1967 * The size of off_t and related types depends on the setting of 1968 * _FILE_OFFSET_BITS. (Note that other system headers define other types 1969 * related to those defined here.) 1970 * 1971 * If _LARGEFILE64_SOURCE is defined, variants of these types that are 1972 * explicitly 64 bits wide become available. 1973 */ 1974 1975 1976 1977 1978 typedef long off_t; /* offsets within files */ 1979 1980 1981 1982 1983 1984 1985 typedef off_t off64_t; /* offsets within files */ 1986 # 160 "../../common/sys/types.h" 1987 typedef ulong_t ino_t; /* expanded inode type */ 1988 typedef long blkcnt_t; /* count of file blocks */ 1989 typedef ulong_t fsblkcnt_t; /* count of file system blocks */ 1990 typedef ulong_t fsfilcnt_t; /* count of files */ 1991 # 173 "../../common/sys/types.h" 1992 typedef ino_t ino64_t; /* expanded inode type */ 1993 typedef blkcnt_t blkcnt64_t; /* count of file blocks */ 1994 typedef fsblkcnt_t fsblkcnt64_t; /* count of file system blocks */ 1995 typedef fsfilcnt_t fsfilcnt64_t; /* count of files */ 1996 # 186 "../../common/sys/types.h" 1997 typedef int blksize_t; /* used for block sizes */ 1998 1999 2000 2001 2002 2003 2004 2005 typedef enum { B_FALSE, B_TRUE } boolean_t; 2006 # 205 "../../common/sys/types.h" 2007 /* 2008 * The {u,}pad64_t types can be used in structures such that those structures 2009 * may be accessed by code produced by compilation environments which don't 2010 * support a 64 bit integral datatype. The intention is not to allow 2011 * use of these fields in such environments, but to maintain the alignment 2012 * and offsets of the structure. 2013 * 2014 * Similar comments for {u,}pad128_t. 2015 * 2016 * Note that these types do NOT generate any stronger alignment constraints 2017 * than those available in the underlying ABI. See <sys/isa_defs.h> 2018 */ 2019 2020 typedef int64_t pad64_t; 2021 typedef uint64_t upad64_t; 2022 # 232 "../../common/sys/types.h" 2023 typedef union { 2024 long double _q; 2025 int32_t _l[4]; 2026 } pad128_t; 2027 2028 typedef union { 2029 long double _q; 2030 uint32_t _l[4]; 2031 } upad128_t; 2032 2033 typedef longlong_t offset_t; 2034 typedef u_longlong_t u_offset_t; 2035 typedef u_longlong_t len_t; 2036 typedef u_longlong_t diskaddr_t; 2037 2038 typedef uint64_t paddr_t; 2039 2040 2041 /* 2042 * Definitions remaining from previous partial support for 64-bit file 2043 * offsets. This partial support for devices greater than 2gb requires 2044 * compiler support for long long. 2045 */ 2046 2047 typedef union { 2048 offset_t _f; /* Full 64 bit offset value */ 2049 struct { 2050 int32_t _l; /* lower 32 bits of offset value */ 2051 int32_t _u; /* upper 32 bits of offset value */ 2052 } _p; 2053 } lloff_t; 2054 # 276 "../../common/sys/types.h" 2055 typedef union { 2056 longlong_t _f; /* Full 64 bit disk address value */ 2057 struct { 2058 int32_t _l; /* lower 32 bits of disk address value */ 2059 int32_t _u; /* upper 32 bits of disk address value */ 2060 } _p; 2061 } lldaddr_t; 2062 # 295 "../../common/sys/types.h" 2063 typedef uint_t k_fltset_t; /* kernel fault set type */ 2064 2065 /* 2066 * The following type is for various kinds of identifiers. The 2067 * actual type must be the same for all since some system calls 2068 * (such as sigsend) take arguments that may be any of these 2069 * types. The enumeration type idtype_t defined in sys/procset.h 2070 * is used to indicate what type of id is being specified -- 2071 * a process id, process group id, session id, scheduling class id, 2072 * user id, group id, project id, task id or zone id. 2073 */ 2074 2075 typedef int id_t; 2076 2077 2078 2079 2080 typedef id_t lgrp_id_t; /* lgroup ID */ 2081 2082 /* 2083 * Type useconds_t is an unsigned integral type capable of storing 2084 * values at least in the range of zero to 1,000,000. 2085 */ 2086 typedef uint_t useconds_t; /* Time, in microseconds */ 2087 2088 2089 2090 typedef long suseconds_t; /* signed # of microseconds */ 2091 2092 2093 /* 2094 * Typedefs for dev_t components. 2095 */ 2096 2097 typedef uint_t major_t; /* major part of device number */ 2098 typedef uint_t minor_t; /* minor part of device number */ 2099 2100 2101 2102 2103 2104 /* 2105 * The data type of a thread priority. 2106 */ 2107 typedef short pri_t; 2108 2109 /* 2110 * The data type for a CPU flags field. (Can be extended to larger unsigned 2111 * types, if needed, limited by ability to update atomically.) 2112 */ 2113 typedef ushort_t cpu_flag_t; 2114 2115 /* 2116 * For compatibility reasons the following typedefs (prefixed o_) 2117 * can't grow regardless of the EFT definition. Although, 2118 * applications should not explicitly use these typedefs 2119 * they may be included via a system header definition. 2120 * WARNING: These typedefs may be removed in a future 2121 * release. 2122 * ex. the definitions in s5inode.h (now obsoleted) 2123 * remained small to preserve compatibility 2124 * in the S5 file system type. 2125 */ 2126 typedef ushort_t o_mode_t; /* old file attribute type */ 2127 typedef short o_dev_t; /* old device type */ 2128 typedef ushort_t o_uid_t; /* old UID type */ 2129 typedef o_uid_t o_gid_t; /* old GID type */ 2130 typedef short o_nlink_t; /* old file link type */ 2131 typedef short o_pid_t; /* old process id type */ 2132 typedef ushort_t o_ino_t; /* old inode type */ 2133 2134 2135 /* 2136 * POSIX and XOPEN Declarations 2137 */ 2138 typedef int key_t; /* IPC key type */ 2139 2140 typedef uint_t mode_t; /* file attribute type */ 2141 2142 2143 2144 2145 2146 2147 typedef unsigned int uid_t; /* UID type */ 2148 2149 2150 typedef uid_t gid_t; /* GID type */ 2151 2152 typedef uint32_t datalink_id_t; 2153 typedef uint32_t vrid_t; 2154 2155 typedef id_t taskid_t; 2156 typedef id_t projid_t; 2157 typedef id_t poolid_t; 2158 typedef id_t zoneid_t; 2159 typedef id_t ctid_t; 2160 2161 /* 2162 * POSIX definitions are same as defined in thread.h and synch.h. 2163 * Any changes made to here should be reflected in corresponding 2164 * files as described in comments. 2165 */ 2166 typedef uint_t pthread_t; /* = thread_t in thread.h */ 2167 typedef uint_t pthread_key_t; /* = thread_key_t in thread.h */ 2168 2169 /* "Magic numbers" tagging synchronization object types */ 2170 2171 2172 2173 2174 2175 typedef struct _pthread_mutex { /* = mutex_t in synch.h */ 2176 struct { 2177 uint16_t __pthread_mutex_flag1; 2178 uint8_t __pthread_mutex_flag2; 2179 uint8_t __pthread_mutex_ceiling; 2180 uint16_t __pthread_mutex_type; 2181 uint16_t __pthread_mutex_magic; 2182 } __pthread_mutex_flags; 2183 union { 2184 struct { 2185 uint8_t __pthread_mutex_pad[8]; 2186 } __pthread_mutex_lock64; 2187 struct { 2188 uint32_t __pthread_ownerpid; 2189 uint32_t __pthread_lockword; 2190 } __pthread_mutex_lock32; 2191 upad64_t __pthread_mutex_owner64; 2192 } __pthread_mutex_lock; 2193 upad64_t __pthread_mutex_data; 2194 } pthread_mutex_t; 2195 2196 typedef struct _pthread_cond { /* = cond_t in synch.h */ 2197 struct { 2198 uint8_t __pthread_cond_flag[4]; 2199 uint16_t __pthread_cond_type; 2200 uint16_t __pthread_cond_magic; 2201 } __pthread_cond_flags; 2202 upad64_t __pthread_cond_data; 2203 } pthread_cond_t; 2204 2205 /* 2206 * UNIX 98 Extension 2207 */ 2208 typedef struct _pthread_rwlock { /* = rwlock_t in synch.h */ 2209 int32_t __pthread_rwlock_readers; 2210 uint16_t __pthread_rwlock_type; 2211 uint16_t __pthread_rwlock_magic; 2212 pthread_mutex_t __pthread_rwlock_mutex; 2213 pthread_cond_t __pthread_rwlock_readercv; 2214 pthread_cond_t __pthread_rwlock_writercv; 2215 } pthread_rwlock_t; 2216 2217 /* 2218 * SUSV3 2219 */ 2220 typedef struct { 2221 uint32_t __pthread_barrier_count; 2222 uint32_t __pthread_barrier_current; 2223 upad64_t __pthread_barrier_cycle; 2224 upad64_t __pthread_barrier_reserved; 2225 pthread_mutex_t __pthread_barrier_lock; 2226 pthread_cond_t __pthread_barrier_cond; 2227 } pthread_barrier_t; 2228 2229 typedef pthread_mutex_t pthread_spinlock_t; 2230 2231 /* 2232 * attributes for threads, dynamically allocated by library 2233 */ 2234 typedef struct _pthread_attr { 2235 void *__pthread_attrp; 2236 } pthread_attr_t; 2237 2238 /* 2239 * attributes for mutex, dynamically allocated by library 2240 */ 2241 typedef struct _pthread_mutexattr { 2242 void *__pthread_mutexattrp; 2243 } pthread_mutexattr_t; 2244 2245 /* 2246 * attributes for cond, dynamically allocated by library 2247 */ 2248 typedef struct _pthread_condattr { 2249 void *__pthread_condattrp; 2250 } pthread_condattr_t; 2251 2252 /* 2253 * pthread_once 2254 */ 2255 typedef struct _once { 2256 upad64_t __pthread_once_pad[4]; 2257 } pthread_once_t; 2258 2259 /* 2260 * UNIX 98 Extensions 2261 * attributes for rwlock, dynamically allocated by library 2262 */ 2263 typedef struct _pthread_rwlockattr { 2264 void *__pthread_rwlockattrp; 2265 } pthread_rwlockattr_t; 2266 2267 /* 2268 * SUSV3 2269 * attributes for pthread_barrier_t, dynamically allocated by library 2270 */ 2271 typedef struct { 2272 void *__pthread_barrierattrp; 2273 } pthread_barrierattr_t; 2274 2275 typedef ulong_t dev_t; /* expanded device type */ 2276 2277 2278 typedef uint_t nlink_t; /* file link type */ 2279 typedef int pid_t; /* process id type */ 2280 # 520 "../../common/sys/types.h" 2281 typedef ulong_t size_t; /* size of something in bytes */ 2282 # 529 "../../common/sys/types.h" 2283 typedef long ssize_t; /* size of something in bytes or -1 */ 2284 2285 2286 2287 2288 2289 2290 2291 typedef long time_t; /* time of day in seconds */ 2292 2293 2294 2295 2296 typedef long clock_t; /* relative time in a specified resolution */ 2297 2298 2299 2300 2301 typedef int clockid_t; /* clock identifier type */ 2302 2303 2304 2305 2306 typedef int timer_t; /* timer identifier type */ 2307 2308 2309 2310 2311 /* BEGIN CSTYLED */ 2312 typedef unsigned char unchar; 2313 typedef unsigned short ushort; 2314 typedef unsigned int uint; 2315 typedef unsigned long ulong; 2316 /* END CSTYLED */ 2317 # 574 "../../common/sys/types.h" 2318 /* min value of a "long int" */ 2319 2320 /* max value of a "long int" */ 2321 2322 /* max of "unsigned long int" */ 2323 # 587 "../../common/sys/types.h" 2324 /* min of "long long int" */ 2325 2326 /* max of "long long int" */ 2327 2328 /* max of "unsigned long long int" */ 2329 # 605 "../../common/sys/types.h" 2330 /* 2331 * The following is the value of type id_t to use to indicate the 2332 * caller's current id. See procset.h for the type idtype_t 2333 * which defines which kind of id is being specified. 2334 */ 2335 # 620 "../../common/sys/types.h" 2336 /* 2337 * The following value of type pfn_t is used to indicate 2338 * invalid page frame number. 2339 */ 2340 2341 2342 2343 /* BEGIN CSTYLED */ 2344 typedef unsigned char u_char; 2345 typedef unsigned short u_short; 2346 typedef unsigned int u_int; 2347 typedef unsigned long u_long; 2348 typedef struct _quad { int val[2]; } quad_t; /* used by UFS */ 2349 typedef quad_t quad; /* used by UFS */ 2350 /* END CSTYLED */ 2351 2352 /* 2353 * Nested include for BSD/sockets source compatibility. 2354 * (The select macros used to be defined here). 2355 */ 2356 # 1 "../../common/sys/select.h" 1 2357 /* 2358 * CDDL HEADER START 2359 * 2360 * The contents of this file are subject to the terms of the 2361 * Common Development and Distribution License (the "License"). 2362 * You may not use this file except in compliance with the License. 2363 * 2364 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2365 * or http://www.opensolaris.org/os/licensing. 2366 * See the License for the specific language governing permissions 2367 * and limitations under the License. 2368 * 2369 * When distributing Covered Code, include this CDDL HEADER in each 2370 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2371 * If applicable, add the following below this CDDL HEADER, with the 2372 * fields enclosed by brackets "[]" replaced with your own identifying 2373 * information: Portions Copyright [yyyy] [name of copyright owner] 2374 * 2375 * CDDL HEADER END 2376 */ 2377 2378 /* 2379 * Copyright 2014 Garrett D'Amore <garrett@damore.org> 2380 * 2381 * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 2382 * 2383 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 2384 * Use is subject to license terms. 2385 */ 2386 2387 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 2388 /* All Rights Reserved */ 2389 2390 /* 2391 * University Copyright- Copyright (c) 1982, 1986, 1988 2392 * The Regents of the University of California 2393 * All Rights Reserved 2394 * 2395 * University Acknowledgment- Portions of this document are derived from 2396 * software developed by the University of California, Berkeley, and its 2397 * contributors. 2398 */ 2399 2400 2401 2402 2403 # 1 "../../common/sys/feature_tests.h" 1 2404 /* 2405 * CDDL HEADER START 2406 * 2407 * The contents of this file are subject to the terms of the 2408 * Common Development and Distribution License (the "License"). 2409 * You may not use this file except in compliance with the License. 2410 * 2411 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2412 * or http://www.opensolaris.org/os/licensing. 2413 * See the License for the specific language governing permissions 2414 * and limitations under the License. 2415 * 2416 * When distributing Covered Code, include this CDDL HEADER in each 2417 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2418 * If applicable, add the following below this CDDL HEADER, with the 2419 * fields enclosed by brackets "[]" replaced with your own identifying 2420 * information: Portions Copyright [yyyy] [name of copyright owner] 2421 * 2422 * CDDL HEADER END 2423 */ 2424 2425 /* 2426 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 2427 * Copyright 2016 Joyent, Inc. 2428 * 2429 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2430 * Use is subject to license terms. 2431 */ 2432 # 48 "../../common/sys/select.h" 2 2433 # 62 "../../common/sys/select.h" 2434 /* 2435 * The sigset_t type is defined in <sys/signal.h> and duplicated 2436 * in <sys/ucontext.h> as a result of XPG4v2 requirements. XPG6 2437 * now allows the visibility of signal.h in this header, however 2438 * an order of inclusion problem occurs as a result of inclusion 2439 * of <sys/select.h> in <signal.h> under certain conditions. 2440 * Rather than include <sys/signal.h> here, we've duplicated 2441 * the sigset_t type instead. This type is required for the XPG6 2442 * introduced pselect() function also declared in this header. 2443 */ 2444 2445 2446 typedef struct { /* signal set type */ 2447 unsigned int __sigbits[4]; 2448 } sigset_t; 2449 2450 2451 2452 2453 /* 2454 * Select uses bit masks of file descriptors in longs. 2455 * These macros manipulate such bit fields. 2456 * FD_SETSIZE may be defined by the user, but the default here 2457 * should be >= NOFILE (param.h). 2458 */ 2459 # 108 "../../common/sys/select.h" 2460 typedef long fd_mask; 2461 2462 typedef long fds_mask; 2463 2464 /* 2465 * The value of _NBBY needs to be consistant with the value 2466 * of NBBY in <sys/param.h>. 2467 */ 2468 # 136 "../../common/sys/select.h" 2469 typedef struct fd_set { 2470 2471 2472 2473 long fds_bits[(((65536)+(((sizeof (fds_mask) * 8))-1))/((sizeof (fds_mask) * 8)))]; 2474 } fd_set; 2475 # 641 "../../common/sys/types.h" 2 2476 2477 2478 2479 /* 2480 * _VOID was defined to be either void or char but this is not 2481 * required because previous SunOS compilers have accepted the void 2482 * type. However, because many system header and source files use the 2483 * void keyword, the volatile keyword, and ANSI C function prototypes, 2484 * non-ANSI compilers cannot compile the system anyway. The _VOID macro 2485 * should therefore not be used and remains for source compatibility 2486 * only. 2487 */ 2488 /* CSTYLED */ 2489 # 35 "../../intel/ia32/sys/stack.h" 2 2490 2491 2492 2493 2494 2495 2496 2497 /* 2498 * In the x86 world, a stack frame looks like this: 2499 * 2500 * |--------------------------| 2501 * 4n+8(%ebp) ->| argument word n | 2502 * | ... | (Previous frame) 2503 * 8(%ebp) ->| argument word 0 | 2504 * |--------------------------|-------------------- 2505 * 4(%ebp) ->| return address | 2506 * |--------------------------| 2507 * 0(%ebp) ->| previous %ebp (optional) | 2508 * |--------------------------| 2509 * -4(%ebp) ->| unspecified | (Current frame) 2510 * | ... | 2511 * 0(%esp) ->| variable size | 2512 * |--------------------------| 2513 */ 2514 2515 /* 2516 * Stack alignment macros. 2517 */ 2518 # 73 "../../intel/ia32/sys/stack.h" 2519 /* 2520 * In the amd64 world, a stack frame looks like this: 2521 * 2522 * |--------------------------| 2523 * 8n+16(%rbp)->| argument word n | 2524 * | ... | (Previous frame) 2525 * 16(%rbp) ->| argument word 0 | 2526 * |--------------------------|-------------------- 2527 * 8(%rbp) ->| return address | 2528 * |--------------------------| 2529 * 0(%rbp) ->| previous %rbp | 2530 * |--------------------------| 2531 * -8(%rbp) ->| unspecified | (Current frame) 2532 * | ... | 2533 * 0(%rsp) ->| variable size | 2534 * |--------------------------| 2535 * -128(%rsp) ->| reserved for function | 2536 * |--------------------------| 2537 * 2538 * The end of the input argument area must be aligned on a 16-byte 2539 * boundary; i.e. (%rsp - 8) % 16 == 0 at function entry. 2540 * 2541 * The 128-byte location beyond %rsp is considered to be reserved for 2542 * functions and is NOT modified by signal handlers. It can be used 2543 * to store temporary data that is not needed across function calls. 2544 */ 2545 2546 /* 2547 * Stack alignment macros. 2548 */ 2549 # 149 "../../intel/ia32/sys/stack.h" 2550 struct regs; 2551 2552 void traceregs(struct regs *); 2553 void traceback(caddr_t); 2554 # 35 "../../intel/sys/stack.h" 2 2555 # 33 "../../intel/ia32/sys/asm_linkage.h" 2 2556 # 1 "../../intel/sys/trap.h" 1 2557 /* 2558 * CDDL HEADER START 2559 * 2560 * The contents of this file are subject to the terms of the 2561 * Common Development and Distribution License, Version 1.0 only 2562 * (the "License"). You may not use this file except in compliance 2563 * with the License. 2564 * 2565 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2566 * or http://www.opensolaris.org/os/licensing. 2567 * See the License for the specific language governing permissions 2568 * and limitations under the License. 2569 * 2570 * When distributing Covered Code, include this CDDL HEADER in each 2571 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2572 * If applicable, add the following below this CDDL HEADER, with the 2573 * fields enclosed by brackets "[]" replaced with your own identifying 2574 * information: Portions Copyright [yyyy] [name of copyright owner] 2575 * 2576 * CDDL HEADER END 2577 */ 2578 /* 2579 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 2580 * Use is subject to license terms. 2581 */ 2582 2583 2584 2585 2586 #pragma ident "%Z%%M% %I% %E% SMI" 2587 2588 2589 2590 # 1 "../../intel/ia32/sys/trap.h" 1 2591 /* 2592 * CDDL HEADER START 2593 * 2594 * The contents of this file are subject to the terms of the 2595 * Common Development and Distribution License (the "License"). 2596 * You may not use this file except in compliance with the License. 2597 * 2598 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2599 * or http://www.opensolaris.org/os/licensing. 2600 * See the License for the specific language governing permissions 2601 * and limitations under the License. 2602 * 2603 * When distributing Covered Code, include this CDDL HEADER in each 2604 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2605 * If applicable, add the following below this CDDL HEADER, with the 2606 * fields enclosed by brackets "[]" replaced with your own identifying 2607 * information: Portions Copyright [yyyy] [name of copyright owner] 2608 * 2609 * CDDL HEADER END 2610 */ 2611 /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */ 2612 /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */ 2613 /* All Rights Reserved */ 2614 2615 /* 2616 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 2617 * Use is subject to license terms. 2618 */ 2619 # 37 "../../intel/ia32/sys/trap.h" 2620 /* 2621 * Trap type values 2622 */ 2623 # 69 "../../intel/ia32/sys/trap.h" 2624 /* 2625 * Pseudo traps. 2626 */ 2627 2628 2629 2630 2631 2632 2633 /* 2634 * Values of error code on stack in case of page fault 2635 */ 2636 2637 2638 2639 2640 2641 2642 /* (else supervisor) */ 2643 2644 /* or kernel tried to execute a user page */ 2645 /* (Intel SMEP) */ 2646 2647 /* 2648 * Definitions for fast system call subfunctions 2649 */ 2650 # 35 "../../intel/sys/trap.h" 2 2651 # 34 "../../intel/ia32/sys/asm_linkage.h" 2 2652 # 35 "../../intel/sys/asm_linkage.h" 2 2653 # 18 "../../i86pc/ml/comm_page.s" 2 2654 # 1 "../../i86pc/sys/asm_misc.h" 1 2655 /* 2656 * CDDL HEADER START 2657 * 2658 * The contents of this file are subject to the terms of the 2659 * Common Development and Distribution License (the "License"). 2660 * You may not use this file except in compliance with the License. 2661 * 2662 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2663 * or http://www.opensolaris.org/os/licensing. 2664 * See the License for the specific language governing permissions 2665 * and limitations under the License. 2666 * 2667 * When distributing Covered Code, include this CDDL HEADER in each 2668 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2669 * If applicable, add the following below this CDDL HEADER, with the 2670 * fields enclosed by brackets "[]" replaced with your own identifying 2671 * information: Portions Copyright [yyyy] [name of copyright owner] 2672 * 2673 * CDDL HEADER END 2674 */ 2675 /* 2676 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2677 * Use is subject to license terms. 2678 */ 2679 2680 2681 2682 2683 #pragma ident "%Z%%M% %I% %E% SMI" 2684 # 19 "../../i86pc/ml/comm_page.s" 2 2685 # 1 "../../common/sys/param.h" 1 2686 /* 2687 * CDDL HEADER START 2688 * 2689 * The contents of this file are subject to the terms of the 2690 * Common Development and Distribution License (the "License"). 2691 * You may not use this file except in compliance with the License. 2692 * 2693 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2694 * or http://www.opensolaris.org/os/licensing. 2695 * See the License for the specific language governing permissions 2696 * and limitations under the License. 2697 * 2698 * When distributing Covered Code, include this CDDL HEADER in each 2699 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2700 * If applicable, add the following below this CDDL HEADER, with the 2701 * fields enclosed by brackets "[]" replaced with your own identifying 2702 * information: Portions Copyright [yyyy] [name of copyright owner] 2703 * 2704 * CDDL HEADER END 2705 */ 2706 2707 /* 2708 * Copyright 2014 Nexenta Systems, Inc. All rights reserved. 2709 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 2710 */ 2711 2712 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 2713 /* All Rights Reserved */ 2714 2715 /* 2716 * University Copyright- Copyright (c) 1982, 1986, 1988 2717 * The Regents of the University of California 2718 * All Rights Reserved 2719 * 2720 * University Acknowledgment- Portions of this document are derived from 2721 * software developed by the University of California, Berkeley, and its 2722 * contributors. 2723 */ 2724 2725 2726 2727 2728 2729 # 1 "../../common/sys/types.h" 1 2730 /* 2731 * CDDL HEADER START 2732 * 2733 * The contents of this file are subject to the terms of the 2734 * Common Development and Distribution License (the "License"). 2735 * You may not use this file except in compliance with the License. 2736 * 2737 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2738 * or http://www.opensolaris.org/os/licensing. 2739 * See the License for the specific language governing permissions 2740 * and limitations under the License. 2741 * 2742 * When distributing Covered Code, include this CDDL HEADER in each 2743 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2744 * If applicable, add the following below this CDDL HEADER, with the 2745 * fields enclosed by brackets "[]" replaced with your own identifying 2746 * information: Portions Copyright [yyyy] [name of copyright owner] 2747 * 2748 * CDDL HEADER END 2749 */ 2750 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 2751 /* All Rights Reserved */ 2752 2753 2754 /* 2755 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2756 * Use is subject to license terms. 2757 * 2758 * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 2759 * Copyright 2016 Joyent, Inc. 2760 */ 2761 # 45 "../../common/sys/param.h" 2 2762 # 1 "../../common/sys/isa_defs.h" 1 2763 /* 2764 * CDDL HEADER START 2765 * 2766 * The contents of this file are subject to the terms of the 2767 * Common Development and Distribution License (the "License"). 2768 * You may not use this file except in compliance with the License. 2769 * 2770 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2771 * or http://www.opensolaris.org/os/licensing. 2772 * See the License for the specific language governing permissions 2773 * and limitations under the License. 2774 * 2775 * 2776 * When distributing Covered Code, include this CDDL HEADER in each 2777 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2778 * If applicable, add the following below this CDDL HEADER, with the 2779 * fields enclosed by brackets "[]" replaced with your own identifying 2780 * information: Portions Copyright [yyyy] [name of copyright owner] 2781 * 2782 * CDDL HEADER END 2783 */ 2784 2785 /* 2786 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2787 * Use is subject to license terms. 2788 * Copyright 2016 Joyent, Inc. 2789 */ 2790 # 46 "../../common/sys/param.h" 2 2791 2792 2793 # 1 "../../common/sys/null.h" 1 2794 /* 2795 * This file and its contents are supplied under the terms of the 2796 * Common Development and Distribution License ("CDDL"), version 1.0. 2797 * You may only use this file in accordance with the terms of version 2798 * 1.0 of the CDDL. 2799 * 2800 * A full copy of the text of the CDDL should have accompanied this 2801 * source. A copy of the CDDL is also available via the Internet at 2802 * http://www.illumos.org/license/CDDL. 2803 */ 2804 2805 /* 2806 * Copyright 2014-2016 PALO, Richard. 2807 */ 2808 # 49 "../../common/sys/param.h" 2 2809 2810 2811 2812 2813 2814 /* 2815 * Fundamental variables; don't change too often. 2816 */ 2817 2818 /* 2819 * _POSIX_VDISABLE has historically been defined in <sys/param.h> since 2820 * an early merge with AT&T source. It has also historically been defined 2821 * in <sys/termios.h>. The POSIX standard, IEEE Std. 1003.1-1988 initially 2822 * required the existence of _POSIX_VDISABLE in <sys/termios.h>. 2823 * Subsequent versions of the IEEE Standard as well as the X/Open 2824 * specifications required that _POSIX_VDISABLE be defined in <unistd.h> 2825 * while still allowing for it's existence in other headers. With the 2826 * introduction of XPG6, _POSIX_VDISABLE can only be defined in <unistd.h>. 2827 */ 2828 # 123 "../../common/sys/param.h" 2829 /* compatibility purposes only */ 2830 /* and will be removed in a */ 2831 /* later release */ 2832 2833 /* 2834 * These define the maximum and minimum allowable values of the 2835 * configurable parameter NGROUPS_MAX. 2836 */ 2837 2838 2839 2840 2841 /* 2842 * NGROUPS_MAX_DEFAULT: *MUST* match NGROUPS_MAX value in limits.h. 2843 */ 2844 2845 2846 /* 2847 * Default process priority. Keep it in sync with limits.h. 2848 */ 2849 2850 2851 /* 2852 * Fundamental constants of the implementation--cannot be changed easily. 2853 */ 2854 # 171 "../../common/sys/param.h" 2855 /* REMOTE -- whether machine is primary, secondary, or regular */ 2856 2857 2858 2859 /* 2860 * MAXPATHLEN defines the longest permissible path length, 2861 * including the terminating null, after expanding symbolic links. 2862 * TYPICALMAXPATHLEN is used in a few places as an optimization 2863 * with a local buffer on the stack to avoid kmem_alloc(). 2864 * MAXSYMLINKS defines the maximum number of symbolic links 2865 * that may be expanded in a path name. It should be set high 2866 * enough to allow all legitimate uses, but halt infinite loops 2867 * reasonably quickly. 2868 * MAXNAMELEN is the length (including the terminating null) of 2869 * the longest permissible file (component) name. 2870 */ 2871 2872 2873 2874 2875 2876 /* 2877 * MAXLINKNAMELEN defines the longest possible permitted datalink name, 2878 * including the terminating NUL. Note that this must not be larger 2879 * than related networking constants such as LIFNAMSIZ. 2880 */ 2881 2882 2883 2884 2885 2886 2887 /* 2888 * The following are defined to be the same as 2889 * defined in /usr/include/limits.h. They are 2890 * needed for pipe and FIFO compatibility. 2891 */ 2892 # 220 "../../common/sys/param.h" 2893 /* macros replacing interleaving functions */ 2894 2895 2896 2897 /* 2898 * File system parameters and macros. 2899 * 2900 * The file system is made out of blocks of at most MAXBSIZE units, 2901 * with smaller units (fragments) only in the last direct block. 2902 * MAXBSIZE primarily determines the size of buffers in the buffer 2903 * pool. It may be made larger without any effect on existing 2904 * file systems; however making it smaller make make some file 2905 * systems unmountable. 2906 * 2907 * Note that the blocked devices are assumed to have DEV_BSIZE 2908 * "sectors" and that fragments must be some multiple of this size. 2909 */ 2910 # 261 "../../common/sys/param.h" 2911 /* 64 bit versions of btodb and dbtob */ 2912 # 276 "../../common/sys/param.h" 2913 /* 2914 * Size of arg list passed in by user. 2915 */ 2916 # 287 "../../common/sys/param.h" 2917 /* 2918 * Scale factor for scaled integers used to count 2919 * %cpu time and load averages. 2920 */ 2921 2922 2923 2924 /* 2925 * Delay units are in microseconds. 2926 * 2927 * XXX These macros are not part of the DDI! 2928 */ 2929 2930 extern void drv_usecwait(clock_t); 2931 # 317 "../../common/sys/param.h" 2932 /* 2933 * The following is to free utilities from machine dependencies within 2934 * an architecture. Must be included after definition of DEV_BSIZE. 2935 */ 2936 2937 2938 2939 2940 # 1 "../../i86pc/sys/machparam.h" 1 2941 /* 2942 * CDDL HEADER START 2943 * 2944 * The contents of this file are subject to the terms of the 2945 * Common Development and Distribution License (the "License"). 2946 * You may not use this file except in compliance with the License. 2947 * 2948 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2949 * or http://www.opensolaris.org/os/licensing. 2950 * See the License for the specific language governing permissions 2951 * and limitations under the License. 2952 * 2953 * When distributing Covered Code, include this CDDL HEADER in each 2954 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2955 * If applicable, add the following below this CDDL HEADER, with the 2956 * fields enclosed by brackets "[]" replaced with your own identifying 2957 * information: Portions Copyright [yyyy] [name of copyright owner] 2958 * 2959 * CDDL HEADER END 2960 */ 2961 /* 2962 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. 2963 * Copyright 2016 Joyent, Inc. 2964 */ 2965 2966 /* Copyright (c) 1988 AT&T */ 2967 /* All Rights Reserved */ 2968 2969 2970 2971 2972 2973 2974 # 1 "../../common/sys/types.h" 1 2975 /* 2976 * CDDL HEADER START 2977 * 2978 * The contents of this file are subject to the terms of the 2979 * Common Development and Distribution License (the "License"). 2980 * You may not use this file except in compliance with the License. 2981 * 2982 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 2983 * or http://www.opensolaris.org/os/licensing. 2984 * See the License for the specific language governing permissions 2985 * and limitations under the License. 2986 * 2987 * When distributing Covered Code, include this CDDL HEADER in each 2988 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 2989 * If applicable, add the following below this CDDL HEADER, with the 2990 * fields enclosed by brackets "[]" replaced with your own identifying 2991 * information: Portions Copyright [yyyy] [name of copyright owner] 2992 * 2993 * CDDL HEADER END 2994 */ 2995 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 2996 /* All Rights Reserved */ 2997 2998 2999 /* 3000 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 3001 * Use is subject to license terms. 3002 * 3003 * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 3004 * Copyright 2016 Joyent, Inc. 3005 */ 3006 # 35 "../../i86pc/sys/machparam.h" 2 3007 # 52 "../../i86pc/sys/machparam.h" 3008 /* 3009 * Machine dependent parameters and limits. 3010 */ 3011 3012 3013 /* 3014 * If NCPU grows beyond 256, sizing for the x86 comm page will require 3015 * adjustment. 3016 */ 3017 3018 3019 3020 3021 3022 3023 3024 /* NCPU_P2 is NCPU rounded to a power of 2 */ 3025 3026 3027 /* 3028 * The value defined below could grow to 16. hat structure and 3029 * page_t have room for 16 nodes. 3030 */ 3031 3032 3033 3034 /* 3035 * Define the FPU symbol if we could run on a machine with an external 3036 * FPU (i.e. not integrated with the normal machine state like the vax). 3037 * 3038 * The fpu is defined in the architecture manual, and the kernel hides 3039 * its absence if it is not present, that's pretty integrated, no? 3040 */ 3041 3042 /* supported page sizes */ 3043 3044 3045 /* 3046 * MMU_PAGES* describes the physical page size used by the mapping hardware. 3047 * PAGES* describes the logical page size used by the system. 3048 */ 3049 # 110 "../../i86pc/sys/machparam.h" 3050 /* 3051 * DATA_ALIGN is used to define the alignment of the Unix data segment. 3052 */ 3053 3054 3055 /* 3056 * DEFAULT KERNEL THREAD stack size (in pages). 3057 */ 3058 # 130 "../../i86pc/sys/machparam.h" 3059 /* 3060 * KERNELBASE is the virtual address at which the kernel segments start in 3061 * all contexts. 3062 * 3063 * KERNELBASE is not fixed. The value of KERNELBASE can change with 3064 * installed memory or on 32 bit systems the eprom variable 'eprom_kernelbase'. 3065 * 3066 * common/conf/param.c requires a compile time defined value for KERNELBASE. 3067 * This value is save in the variable _kernelbase. _kernelbase may then be 3068 * modified with to a different value in i86pc/os/startup.c. 3069 * 3070 * Most code should be using kernelbase, which resolves to a reference to 3071 * _kernelbase. 3072 */ 3073 # 163 "../../i86pc/sys/machparam.h" 3074 /* 3075 * Size of the unmapped "red zone" at the very bottom of the kernel's 3076 * address space. Corresponds to 1 slot in the toplevel pagetable. 3077 */ 3078 3079 3080 /* 3081 * Base of 'core' heap area, which is used for kernel and module text/data 3082 * that must be within a 2GB range to allow for rip-relative addressing. 3083 */ 3084 3085 3086 /* 3087 * Beginning of the segkpm window. A lower value than this is used if 3088 * physical addresses exceed 1TB. See i86pc/os/startup.c 3089 */ 3090 3091 3092 /* 3093 * This is valloc_base, above seg_kpm, but below everything else. 3094 * A lower value than this may be used if SEGKPM_BASE is adjusted. 3095 * See i86pc/os/startup.c 3096 */ 3097 3098 3099 /* 3100 * default and boundary sizes for segkp 3101 */ 3102 3103 3104 3105 3106 /* 3107 * minimum size for segzio 3108 */ 3109 3110 3111 3112 /* 3113 * During intial boot we limit heap to the top 4Gig. 3114 */ 3115 3116 3117 /* 3118 * VMWare works best if we don't use the top 64Meg of memory for amd64. 3119 * Set KERNEL_TEXT to top_o_memory - 64Meg - 8 Meg for 8Meg of nucleus pages. 3120 */ 3121 3122 3123 3124 /* 3125 * Virtual address range available to the debugger 3126 */ 3127 3128 3129 3130 /* 3131 * Define upper limit on user address space 3132 * 3133 * In amd64, the upper limit on a 64-bit user address space is 1 large page 3134 * (2MB) below kernelbase. The upper limit for a 32-bit user address space 3135 * is 1 small page (4KB) below the top of the 32-bit range. The 64-bit 3136 * limit give dtrace the red zone it needs below kernelbase. The 32-bit 3137 * limit gives us a small red zone to detect address-space overruns in a 3138 * user program. 3139 * 3140 * On the hypervisor, we limit the user to memory below the VA hole. 3141 * Subtract 1 large page for a red zone. 3142 */ 3143 # 295 "../../i86pc/sys/machparam.h" 3144 /* 3145 * Reserve pages just below KERNEL_TEXT for the GDT, IDT, TSS and debug info. 3146 * 3147 * For now, DEBUG_INFO_VA must be first in this list for "xm" initiated dumps 3148 * of solaris domUs to be usable with mdb. Relying on a fixed VA is not viable 3149 * long term, but it's the best we've got for now. 3150 */ 3151 # 313 "../../i86pc/sys/machparam.h" 3152 extern uintptr_t kernelbase, segmap_start, segmapsize; 3153 3154 3155 /* 3156 * ARGSBASE is the base virtual address of the range which 3157 * the kernel uses to map the arguments for exec. 3158 */ 3159 3160 3161 /* 3162 * reserve space for modules 3163 */ 3164 3165 3166 3167 /* 3168 * The heap has a region allocated from it of HEAPTEXT_SIZE bytes specifically 3169 * for module text. 3170 */ 3171 3172 3173 /* 3174 * Size of a kernel threads stack. It must be a whole number of pages 3175 * since the segment it comes from will only allocate space in pages. 3176 */ 3177 3178 3179 /* 3180 * Size of a cpu startup thread stack. (It must be a whole number of pages 3181 * since the containing segment only allocates space in pages.) 3182 */ 3183 3184 3185 3186 /* 3187 * Bus types 3188 */ 3189 # 326 "../../common/sys/param.h" 2 3190 3191 3192 3193 3194 3195 3196 3197 extern int cpu_decay_factor; 3198 extern pid_t maxpid; 3199 extern pid_t jump_pid; 3200 3201 extern uintptr_t _kernelbase; 3202 extern uintptr_t _userlimit; 3203 extern uintptr_t _userlimit32; 3204 3205 3206 /* 3207 * These three variables have been added within the #if defined(lint) 3208 * below to ensure visibility to lint. This is a short term workaround 3209 * to handle poor interaction between SS12 lint and these variables. 3210 * CR 6742611 has been logged to address these issues. 3211 */ 3212 # 402 "../../common/sys/param.h" 3213 /* 3214 * Some random macros for units conversion. 3215 * 3216 * These are machine independent but contain constants (*PAGESHIFT) which 3217 * are only defined in the machine dependent file. 3218 */ 3219 3220 /* 3221 * MMU pages to bytes, and back (with and without rounding) 3222 */ 3223 3224 3225 3226 3227 /* 3228 * 2 versions of pages to disk blocks 3229 */ 3230 3231 3232 3233 /* 3234 * pages to bytes, and back (with and without rounding) 3235 * Large Files: The explicit cast of x to unsigned int is deliberately 3236 * removed as part of large files work. We pass longlong values to 3237 * theses macros. 3238 * 3239 * Cast the input to ptob() to be a page count. This enforces 64-bit 3240 * math on 64-bit kernels. For 32-bit kernels, callers must explicitly 3241 * cast the input to be a 64-bit type if values greater than 4GB/PAGESIZE 3242 * are possible. 3243 */ 3244 # 442 "../../common/sys/param.h" 3245 /* 3246 * disk blocks to pages, rounded and truncated 3247 */ 3248 3249 3250 3251 3252 /* 3253 * kB to pages and back 3254 */ 3255 3256 3257 3258 /* 3259 * POSIX.4 related configuration parameters 3260 */ 3261 # 20 "../../i86pc/ml/comm_page.s" 2 3262 # 1 "../../i86pc/sys/comm_page.h" 1 3263 /* 3264 * This file and its contents are supplied under the terms of the 3265 * Common Development and Distribution License ("CDDL"), version 1.0. 3266 * You may only use this file in accordance with the terms of version 3267 * 1.0 of the CDDL. 3268 * 3269 * A full copy of the text of the CDDL should have accompanied this 3270 * source. A copy of the CDDL is also available via the Internet at 3271 * http://www.illumos.org/license/CDDL. 3272 */ 3273 3274 /* 3275 * Copyright 2016 Joyent, Inc. 3276 */ 3277 3278 3279 3280 3281 3282 # 1 "../../common/sys/types.h" 1 3283 /* 3284 * CDDL HEADER START 3285 * 3286 * The contents of this file are subject to the terms of the 3287 * Common Development and Distribution License (the "License"). 3288 * You may not use this file except in compliance with the License. 3289 * 3290 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3291 * or http://www.opensolaris.org/os/licensing. 3292 * See the License for the specific language governing permissions 3293 * and limitations under the License. 3294 * 3295 * When distributing Covered Code, include this CDDL HEADER in each 3296 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3297 * If applicable, add the following below this CDDL HEADER, with the 3298 * fields enclosed by brackets "[]" replaced with your own identifying 3299 * information: Portions Copyright [yyyy] [name of copyright owner] 3300 * 3301 * CDDL HEADER END 3302 */ 3303 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 3304 /* All Rights Reserved */ 3305 3306 3307 /* 3308 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 3309 * Use is subject to license terms. 3310 * 3311 * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 3312 * Copyright 2016 Joyent, Inc. 3313 */ 3314 # 21 "../../i86pc/sys/comm_page.h" 2 3315 # 1 "../../common/sys/param.h" 1 3316 /* 3317 * CDDL HEADER START 3318 * 3319 * The contents of this file are subject to the terms of the 3320 * Common Development and Distribution License (the "License"). 3321 * You may not use this file except in compliance with the License. 3322 * 3323 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3324 * or http://www.opensolaris.org/os/licensing. 3325 * See the License for the specific language governing permissions 3326 * and limitations under the License. 3327 * 3328 * When distributing Covered Code, include this CDDL HEADER in each 3329 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3330 * If applicable, add the following below this CDDL HEADER, with the 3331 * fields enclosed by brackets "[]" replaced with your own identifying 3332 * information: Portions Copyright [yyyy] [name of copyright owner] 3333 * 3334 * CDDL HEADER END 3335 */ 3336 3337 /* 3338 * Copyright 2014 Nexenta Systems, Inc. All rights reserved. 3339 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3340 */ 3341 3342 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 3343 /* All Rights Reserved */ 3344 3345 /* 3346 * University Copyright- Copyright (c) 1982, 1986, 1988 3347 * The Regents of the University of California 3348 * All Rights Reserved 3349 * 3350 * University Acknowledgment- Portions of this document are derived from 3351 * software developed by the University of California, Berkeley, and its 3352 * contributors. 3353 */ 3354 # 22 "../../i86pc/sys/comm_page.h" 2 3355 # 1 "../../common/sys/time.h" 1 3356 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 3357 /* All Rights Reserved */ 3358 3359 3360 /* 3361 * Copyright (c) 1982, 1986, 1993 Regents of the University of California. 3362 * All rights reserved. The Berkeley software License Agreement 3363 * specifies the terms and conditions for redistribution. 3364 */ 3365 3366 /* 3367 * Copyright 2014 Garrett D'Amore <garrett@damore.org> 3368 * 3369 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 3370 * Use is subject to license terms. 3371 * 3372 * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 3373 */ 3374 3375 /* 3376 * Copyright (c) 2013, 2015 by Delphix. All rights reserved. 3377 */ 3378 3379 3380 3381 3382 # 1 "../../common/sys/feature_tests.h" 1 3383 /* 3384 * CDDL HEADER START 3385 * 3386 * The contents of this file are subject to the terms of the 3387 * Common Development and Distribution License (the "License"). 3388 * You may not use this file except in compliance with the License. 3389 * 3390 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3391 * or http://www.opensolaris.org/os/licensing. 3392 * See the License for the specific language governing permissions 3393 * and limitations under the License. 3394 * 3395 * When distributing Covered Code, include this CDDL HEADER in each 3396 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3397 * If applicable, add the following below this CDDL HEADER, with the 3398 * fields enclosed by brackets "[]" replaced with your own identifying 3399 * information: Portions Copyright [yyyy] [name of copyright owner] 3400 * 3401 * CDDL HEADER END 3402 */ 3403 3404 /* 3405 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 3406 * Copyright 2016 Joyent, Inc. 3407 * 3408 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 3409 * Use is subject to license terms. 3410 */ 3411 # 28 "../../common/sys/time.h" 2 3412 3413 /* 3414 * Structure returned by gettimeofday(2) system call, 3415 * and used in other calls. 3416 */ 3417 # 52 "../../common/sys/time.h" 3418 struct timeval { 3419 time_t tv_sec; /* seconds */ 3420 suseconds_t tv_usec; /* and microseconds */ 3421 }; 3422 3423 3424 3425 # 1 "../../common/sys/types32.h" 1 3426 /* 3427 * CDDL HEADER START 3428 * 3429 * The contents of this file are subject to the terms of the 3430 * Common Development and Distribution License (the "License"). 3431 * You may not use this file except in compliance with the License. 3432 * 3433 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3434 * or http://www.opensolaris.org/os/licensing. 3435 * See the License for the specific language governing permissions 3436 * and limitations under the License. 3437 * 3438 * When distributing Covered Code, include this CDDL HEADER in each 3439 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3440 * If applicable, add the following below this CDDL HEADER, with the 3441 * fields enclosed by brackets "[]" replaced with your own identifying 3442 * information: Portions Copyright [yyyy] [name of copyright owner] 3443 * 3444 * CDDL HEADER END 3445 */ 3446 /* 3447 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 3448 * Use is subject to license terms. 3449 * Copyright 2015 Nexenta Systems, Inc. 3450 */ 3451 # 60 "../../common/sys/time.h" 2 3452 # 84 "../../common/sys/time.h" 3453 struct timezone { 3454 int tz_minuteswest; /* minutes west of Greenwich */ 3455 int tz_dsttime; /* type of dst correction */ 3456 }; 3457 # 96 "../../common/sys/time.h" 3458 /* 3459 * Needed for longlong_t type. Placement of this due to <sys/types.h> 3460 * including <sys/select.h> which relies on the presense of the itimerval 3461 * structure. 3462 */ 3463 3464 # 1 "../../common/sys/types.h" 1 3465 /* 3466 * CDDL HEADER START 3467 * 3468 * The contents of this file are subject to the terms of the 3469 * Common Development and Distribution License (the "License"). 3470 * You may not use this file except in compliance with the License. 3471 * 3472 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3473 * or http://www.opensolaris.org/os/licensing. 3474 * See the License for the specific language governing permissions 3475 * and limitations under the License. 3476 * 3477 * When distributing Covered Code, include this CDDL HEADER in each 3478 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3479 * If applicable, add the following below this CDDL HEADER, with the 3480 * fields enclosed by brackets "[]" replaced with your own identifying 3481 * information: Portions Copyright [yyyy] [name of copyright owner] 3482 * 3483 * CDDL HEADER END 3484 */ 3485 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 3486 /* All Rights Reserved */ 3487 3488 3489 /* 3490 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 3491 * Use is subject to license terms. 3492 * 3493 * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 3494 * Copyright 2016 Joyent, Inc. 3495 */ 3496 # 103 "../../common/sys/time.h" 2 3497 # 123 "../../common/sys/time.h" 3498 /* 3499 * Operations on timevals. 3500 */ 3501 # 193 "../../common/sys/time.h" 3502 /* 3503 * Names of the interval timers, and structure 3504 * defining a timer setting. 3505 */ 3506 3507 3508 3509 /* time and when system is running on */ 3510 /* behalf of the process. */ 3511 3512 /* time profiling of multithreaded */ 3513 /* programs. */ 3514 3515 3516 struct itimerval { 3517 struct timeval it_interval; /* timer interval */ 3518 struct timeval it_value; /* current value */ 3519 }; 3520 3521 3522 3523 struct itimerval32 { 3524 struct timeval32 it_interval; 3525 struct timeval32 it_value; 3526 }; 3527 # 239 "../../common/sys/time.h" 3528 /* 3529 * Definitions for commonly used resolutions. 3530 */ 3531 # 257 "../../common/sys/time.h" 3532 /* 3533 * Time expressed as a 64-bit nanosecond counter. 3534 */ 3535 typedef longlong_t hrtime_t; 3536 3537 3538 3539 # 1 "../../common/sys/time_impl.h" 1 3540 /* 3541 * CDDL HEADER START 3542 * 3543 * The contents of this file are subject to the terms of the 3544 * Common Development and Distribution License, Version 1.0 only 3545 * (the "License"). You may not use this file except in compliance 3546 * with the License. 3547 * 3548 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3549 * or http://www.opensolaris.org/os/licensing. 3550 * See the License for the specific language governing permissions 3551 * and limitations under the License. 3552 * 3553 * When distributing Covered Code, include this CDDL HEADER in each 3554 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3555 * If applicable, add the following below this CDDL HEADER, with the 3556 * fields enclosed by brackets "[]" replaced with your own identifying 3557 * information: Portions Copyright [yyyy] [name of copyright owner] 3558 * 3559 * CDDL HEADER END 3560 */ 3561 /* 3562 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 3563 * Use is subject to license terms. 3564 */ 3565 3566 /* 3567 * Implementation-private. This header should not be included 3568 * directly by an application. The application should instead 3569 * include <time.h> which includes this header conditionally 3570 * depending on which feature test macros are defined. By default, 3571 * this header is included by <time.h>. X/Open and POSIX 3572 * standards requirements result in this header being included 3573 * by <time.h> only under a restricted set of conditions. 3574 */ 3575 3576 3577 3578 3579 # 1 "../../common/sys/feature_tests.h" 1 3580 /* 3581 * CDDL HEADER START 3582 * 3583 * The contents of this file are subject to the terms of the 3584 * Common Development and Distribution License (the "License"). 3585 * You may not use this file except in compliance with the License. 3586 * 3587 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3588 * or http://www.opensolaris.org/os/licensing. 3589 * See the License for the specific language governing permissions 3590 * and limitations under the License. 3591 * 3592 * When distributing Covered Code, include this CDDL HEADER in each 3593 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3594 * If applicable, add the following below this CDDL HEADER, with the 3595 * fields enclosed by brackets "[]" replaced with your own identifying 3596 * information: Portions Copyright [yyyy] [name of copyright owner] 3597 * 3598 * CDDL HEADER END 3599 */ 3600 3601 /* 3602 * Copyright 2013 Garrett D'Amore <garrett@damore.org> 3603 * Copyright 2016 Joyent, Inc. 3604 * 3605 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 3606 * Use is subject to license terms. 3607 */ 3608 # 41 "../../common/sys/time_impl.h" 2 3609 # 53 "../../common/sys/time_impl.h" 3610 /* 3611 * Time expressed in seconds and nanoseconds 3612 */ 3613 3614 typedef struct timespec { /* definition per POSIX.4 */ 3615 time_t tv_sec; /* seconds */ 3616 long tv_nsec; /* and nanoseconds */ 3617 } timespec_t; 3618 3619 3620 3621 # 1 "../../common/sys/types32.h" 1 3622 /* 3623 * CDDL HEADER START 3624 * 3625 * The contents of this file are subject to the terms of the 3626 * Common Development and Distribution License (the "License"). 3627 * You may not use this file except in compliance with the License. 3628 * 3629 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3630 * or http://www.opensolaris.org/os/licensing. 3631 * See the License for the specific language governing permissions 3632 * and limitations under the License. 3633 * 3634 * When distributing Covered Code, include this CDDL HEADER in each 3635 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3636 * If applicable, add the following below this CDDL HEADER, with the 3637 * fields enclosed by brackets "[]" replaced with your own identifying 3638 * information: Portions Copyright [yyyy] [name of copyright owner] 3639 * 3640 * CDDL HEADER END 3641 */ 3642 /* 3643 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 3644 * Use is subject to license terms. 3645 * Copyright 2015 Nexenta Systems, Inc. 3646 */ 3647 # 65 "../../common/sys/time_impl.h" 2 3648 # 81 "../../common/sys/time_impl.h" 3649 typedef struct timespec timestruc_t; /* definition per SVr4 */ 3650 3651 /* 3652 * The following has been left in for backward compatibility. Portable 3653 * applications should not use the structure name timestruc. 3654 */ 3655 3656 3657 3658 3659 3660 /* 3661 * Timer specification 3662 */ 3663 typedef struct itimerspec { /* definition per POSIX.4 */ 3664 struct timespec it_interval; /* timer period */ 3665 struct timespec it_value; /* timer expiration */ 3666 } itimerspec_t; 3667 # 265 "../../common/sys/time.h" 2 3668 # 1 "../../common/sys/mutex.h" 1 3669 /* 3670 * CDDL HEADER START 3671 * 3672 * The contents of this file are subject to the terms of the 3673 * Common Development and Distribution License (the "License"). 3674 * You may not use this file except in compliance with the License. 3675 * 3676 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3677 * or http://www.opensolaris.org/os/licensing. 3678 * See the License for the specific language governing permissions 3679 * and limitations under the License. 3680 * 3681 * When distributing Covered Code, include this CDDL HEADER in each 3682 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3683 * If applicable, add the following below this CDDL HEADER, with the 3684 * fields enclosed by brackets "[]" replaced with your own identifying 3685 * information: Portions Copyright [yyyy] [name of copyright owner] 3686 * 3687 * CDDL HEADER END 3688 */ 3689 /* 3690 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. 3691 */ 3692 3693 3694 3695 3696 3697 # 1 "../../common/sys/types.h" 1 3698 /* 3699 * CDDL HEADER START 3700 * 3701 * The contents of this file are subject to the terms of the 3702 * Common Development and Distribution License (the "License"). 3703 * You may not use this file except in compliance with the License. 3704 * 3705 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 3706 * or http://www.opensolaris.org/os/licensing. 3707 * See the License for the specific language governing permissions 3708 * and limitations under the License. 3709 * 3710 * When distributing Covered Code, include this CDDL HEADER in each 3711 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 3712 * If applicable, add the following below this CDDL HEADER, with the 3713 * fields enclosed by brackets "[]" replaced with your own identifying 3714 * information: Portions Copyright [yyyy] [name of copyright owner] 3715 * 3716 * CDDL HEADER END 3717 */ 3718 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 3719 /* All Rights Reserved */ 3720 3721 3722 /* 3723 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 3724 * Use is subject to license terms. 3725 * 3726 * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 3727 * Copyright 2016 Joyent, Inc. 3728 */ 3729 # 30 "../../common/sys/mutex.h" 2 3730 # 38 "../../common/sys/mutex.h" 3731 /* 3732 * Public interface to mutual exclusion locks. See mutex(9F) for details. 3733 * 3734 * The basic mutex type is MUTEX_ADAPTIVE, which is expected to be used 3735 * in almost all of the kernel. MUTEX_SPIN provides interrupt blocking 3736 * and must be used in interrupt handlers above LOCK_LEVEL. The iblock 3737 * cookie argument to mutex_init() encodes the interrupt level to block. 3738 * The iblock cookie must be NULL for adaptive locks. 3739 * 3740 * MUTEX_DEFAULT is the type usually specified (except in drivers) to 3741 * mutex_init(). It is identical to MUTEX_ADAPTIVE. 3742 * 3743 * MUTEX_DRIVER is always used by drivers. mutex_init() converts this to 3744 * either MUTEX_ADAPTIVE or MUTEX_SPIN depending on the iblock cookie. 3745 * 3746 * Mutex statistics can be gathered on the fly, without rebooting or 3747 * recompiling the kernel, via the lockstat driver (lockstat(7D)). 3748 */ 3749 typedef enum { 3750 MUTEX_ADAPTIVE = 0, /* spin if owner is running, otherwise block */ 3751 MUTEX_SPIN = 1, /* block interrupts and spin */ 3752 MUTEX_DRIVER = 4, /* driver (DDI) mutex */ 3753 MUTEX_DEFAULT = 6 /* kernel default mutex */ 3754 } kmutex_type_t; 3755 3756 typedef struct mutex { 3757 3758 void *_opaque[1]; 3759 3760 3761 3762 } kmutex_t; 3763 3764 3765 3766 /* 3767 * A padded mutex, one per 64 byte cache line. Use when false sharing is 3768 * an issue but beware of the extra memory it uses. Consumers may want to 3769 * consider aligning their pad_mutex_t's to a cache line boundary as well. 3770 */ 3771 typedef struct pad_mutex { 3772 kmutex_t pad_mutex; 3773 3774 char pad_pad[64 - sizeof (kmutex_t)]; 3775 3776 } pad_mutex_t; 3777 3778 3779 3780 3781 extern void mutex_init(kmutex_t *, char *, kmutex_type_t, void *); 3782 extern void mutex_destroy(kmutex_t *); 3783 extern void mutex_enter(kmutex_t *); 3784 extern int mutex_tryenter(kmutex_t *); 3785 extern void mutex_exit(kmutex_t *); 3786 extern int mutex_owned(const kmutex_t *); 3787 extern struct _kthread *mutex_owner(const kmutex_t *); 3788 3789 extern ushort_t mutex_backoff_base; 3790 extern uint_t mutex_backoff_cap; 3791 extern ushort_t mutex_cap_factor; 3792 extern uchar_t mutex_backoff_shift; 3793 extern void (*mutex_lock_delay)(uint_t); 3794 extern uint_t (*mutex_lock_backoff)(uint_t); 3795 extern void (*mutex_delay)(void); 3796 extern void mutex_delay_default(void); 3797 extern void mutex_sync(void); 3798 3799 extern void default_lock_delay(uint_t); 3800 extern uint_t default_lock_backoff(uint_t); 3801 # 266 "../../common/sys/time.h" 2 3802 3803 extern int tick_per_msec; /* clock ticks per millisecond (may be zero) */ 3804 extern int msec_per_tick; /* milliseconds per clock tick (may be zero) */ 3805 extern int usec_per_tick; /* microseconds per clock tick */ 3806 extern int nsec_per_tick; /* nanoseconds per clock tick */ 3807 3808 /* 3809 * Macros to convert from common units of time (sec, msec, usec, nsec, 3810 * timeval, timestruc) to clock ticks and vice versa. 3811 */ 3812 # 330 "../../common/sys/time.h" 3813 typedef struct todinfo { 3814 int tod_sec; /* seconds 0-59 */ 3815 int tod_min; /* minutes 0-59 */ 3816 int tod_hour; /* hours 0-23 */ 3817 int tod_dow; /* day of week 1-7 */ 3818 int tod_day; /* day of month 1-31 */ 3819 int tod_month; /* month 1-12 */ 3820 int tod_year; /* year 70+ */ 3821 } todinfo_t; 3822 3823 extern int64_t timedelta; 3824 extern int timechanged; 3825 extern int tod_needsync; 3826 extern kmutex_t tod_lock; 3827 extern volatile timestruc_t hrestime; 3828 extern hrtime_t hres_last_tick; 3829 extern int64_t hrestime_adj; 3830 extern uint_t adj_shift; 3831 3832 extern timestruc_t tod_get(void); 3833 extern void tod_set(timestruc_t); 3834 extern void set_hrestime(timestruc_t *); 3835 extern todinfo_t utc_to_tod(time_t); 3836 extern time_t tod_to_utc(todinfo_t); 3837 extern int hr_clock_lock(void); 3838 extern void hr_clock_unlock(int); 3839 extern hrtime_t gethrtime(void); 3840 extern hrtime_t gethrtime_unscaled(void); 3841 extern hrtime_t gethrtime_max(void); 3842 extern hrtime_t gethrtime_waitfree(void); 3843 extern void scalehrtime(hrtime_t *); 3844 extern uint64_t unscalehrtime(hrtime_t); 3845 extern void gethrestime(timespec_t *); 3846 extern time_t gethrestime_sec(void); 3847 extern void gethrestime_lasttick(timespec_t *); 3848 extern void hrt2ts(hrtime_t, timestruc_t *); 3849 extern hrtime_t ts2hrt(const timestruc_t *); 3850 extern void hrt2tv(hrtime_t, struct timeval *); 3851 extern hrtime_t tv2hrt(struct timeval *); 3852 extern int itimerfix(struct timeval *, int); 3853 extern int itimerdecr(struct itimerval *, int); 3854 extern void timevaladd(struct timeval *, struct timeval *); 3855 extern void timevalsub(struct timeval *, struct timeval *); 3856 extern void timevalfix(struct timeval *); 3857 extern void dtrace_hres_tick(void); 3858 3859 extern clock_t ddi_get_lbolt(void); 3860 extern int64_t ddi_get_lbolt64(void); 3861 3862 3863 extern void hrt2ts32(hrtime_t, timestruc32_t *); 3864 # 409 "../../common/sys/time.h" 3865 /* 3866 * gettimeofday() and settimeofday() were included in SVr4 due to their 3867 * common use in BSD based applications. They were to be included exactly 3868 * as in BSD, with two parameters. However, AT&T/USL noted that the second 3869 * parameter was unused and deleted it, thereby making a routine included 3870 * for compatibility, incompatible. 3871 * 3872 * XSH4.2 (spec 1170) defines gettimeofday and settimeofday to have two 3873 * parameters. 3874 * 3875 * This has caused general disagreement in the application community as to 3876 * the syntax of these routines. Solaris defaults to the XSH4.2 definition. 3877 * The flag _SVID_GETTOD may be used to force the SVID version. 3878 */ 3879 # 446 "../../common/sys/time.h" 3880 /* 3881 * The inclusion of <time.h> is historical and was added for 3882 * backward compatibility in delta 1.2 when a number of definitions 3883 * were moved out of <sys/time.h>. More recently, the timespec and 3884 * itimerspec structure definitions, along with the _CLOCK_*, CLOCK_*, 3885 * _TIMER_*, and TIMER_* symbols were moved to <sys/time_impl.h>, 3886 * which is now included by <time.h>. This change was due to POSIX 3887 * 1003.1b-1993 and X/Open UNIX 98 requirements. For non-POSIX and 3888 * non-X/Open applications, including this header will still make 3889 * visible these definitions. 3890 */ 3891 3892 3893 3894 3895 3896 /* 3897 * The inclusion of <sys/select.h> is needed for the FD_CLR, 3898 * FD_ISSET, FD_SET, and FD_SETSIZE macros as well as the 3899 * select() prototype defined in the XOpen specifications 3900 * beginning with XSH4v2. Placement required after definition 3901 * for itimerval. 3902 */ 3903 # 23 "../../i86pc/sys/comm_page.h" 2 3904 # 33 "../../i86pc/sys/comm_page.h" 3905 /* 3906 * x86 comm page 3907 * 3908 * This struct defines the data format for the "comm page": kernel data made 3909 * directly available to userspace for read-only operations. This enables 3910 * facilities such as clock_gettime to operate entirely in userspace without 3911 * the need for a trap or fasttrap. 3912 * 3913 * A note about 32-bit/64-bit compatibility: 3914 * The current format of the comm page is designed to be consistent for both 3915 * 32-bit and 64-bit programs running in a 64-bit kernel. On 32-bit kernels, 3916 * the comm page is not exposed to userspace due to the difference in 3917 * timespec_t sizing. 3918 * 3919 * This struct is instantiated "by hand" in assembly to preserve the global 3920 * symbols it contains. That layout must be kept in sync with the structure 3921 * defined here. 3922 * See: "uts/i86pc/ml/comm_page.s" 3923 */ 3924 typedef struct comm_page_s { 3925 hrtime_t cp_tsc_last; 3926 hrtime_t cp_tsc_hrtime_base; 3927 hrtime_t cp_tsc_resume_cap; 3928 uint32_t cp_tsc_type; 3929 uint32_t cp_tsc_max_delta; 3930 3931 volatile uint32_t cp_hres_lock; /* must be 8-byte aligned */ 3932 uint32_t cp_nsec_scale; 3933 int64_t cp_hrestime_adj; 3934 hrtime_t cp_hres_last_tick; 3935 uint32_t cp_tsc_ncpu; 3936 uint32_t _cp_pad; 3937 volatile int64_t cp_hrestime[2]; 3938 3939 hrtime_t cp_tsc_sync_tick_delta[256]; 3940 3941 3942 3943 3944 } comm_page_t; 3945 3946 3947 extern comm_page_t comm_page; 3948 3949 3950 extern hrtime_t tsc_last; 3951 extern hrtime_t tsc_hrtime_base; 3952 extern hrtime_t tsc_resume_cap; 3953 extern uint32_t tsc_type; 3954 extern uint32_t tsc_max_delta; 3955 extern volatile uint32_t hres_lock; 3956 extern uint32_t nsec_scale; 3957 extern int64_t hrestime_adj; 3958 extern hrtime_t hres_last_tick; 3959 extern uint32_t tsc_ncpu; 3960 extern volatile timestruc_t hrestime; 3961 extern hrtime_t tsc_sync_tick_delta[256]; 3962 # 21 "../../i86pc/ml/comm_page.s" 2 3963 # 1 "../../i86pc/sys/tsc.h" 1 3964 /* 3965 * This file and its contents are supplied under the terms of the 3966 * Common Development and Distribution License ("CDDL"), version 1.0. 3967 * You may only use this file in accordance with the terms of version 3968 * 1.0 of the CDDL. 3969 * 3970 * A full copy of the text of the CDDL should have accompanied this 3971 * source. A copy of the CDDL is also available via the Internet at 3972 * http://www.illumos.org/license/CDDL. 3973 */ 3974 3975 /* 3976 * Copyright 2016 Joyent, Inc. 3977 */ 3978 3979 3980 3981 3982 /* 3983 * flags to patch tsc_read routine. 3984 */ 3985 # 22 "../../i86pc/ml/comm_page.s" 2 3986 3987 3988 3989 hrtime_t tsc_last; 3990 hrtime_t tsc_resume_cap; 3991 hrtime_t tsc_hrtime_base; 3992 uint32_t tsc_max_delta; 3993 volatile uint32_t hres_lock; 3994 uint32_t tsc_type; 3995 uint32_t nsec_scale; 3996 int64_t hrestime_adj; 3997 hrtime_t hres_last_tick; 3998 uint32_t tsc_ncpu; 3999 volatile timestruc_t hrestime; 4000 hrtime_t tsc_sync_tick_delta[256]; 4001 4002 comm_page_t comm_page; 4003