10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*2712Snn35248 * Common Development and Distribution License (the "License"). 6*2712Snn35248 * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*2712Snn35248 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */ 270Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */ 280Sstevel@tonic-gate /* All Rights Reserved */ 290Sstevel@tonic-gate 300Sstevel@tonic-gate #ifndef _SYS_SYSI86_H 310Sstevel@tonic-gate #define _SYS_SYSI86_H 320Sstevel@tonic-gate 330Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 340Sstevel@tonic-gate 350Sstevel@tonic-gate #ifdef __cplusplus 360Sstevel@tonic-gate extern "C" { 370Sstevel@tonic-gate #endif 380Sstevel@tonic-gate 390Sstevel@tonic-gate #ifndef DIRSIZ 400Sstevel@tonic-gate #define DIRSIZ 14 410Sstevel@tonic-gate #endif 420Sstevel@tonic-gate 430Sstevel@tonic-gate /* 440Sstevel@tonic-gate * Commands for sysi86 system call (1-?) 450Sstevel@tonic-gate */ 460Sstevel@tonic-gate 470Sstevel@tonic-gate #define SI86SWPI 1 /* General swap interface. */ 480Sstevel@tonic-gate #define SI86SYM 2 /* acquire boot-built symbol table */ 490Sstevel@tonic-gate #define SI86CONF 4 /* acquire boot-built configuration table */ 500Sstevel@tonic-gate #define SI86BOOT 5 /* acquire timestamp and name of program */ 510Sstevel@tonic-gate /* booted */ 520Sstevel@tonic-gate #define SI86AUTO 9 /* was an auto-config boot done? */ 530Sstevel@tonic-gate #define SI86EDT 10 /* copy contents of EDT to user */ 540Sstevel@tonic-gate #define SI86SWAP 12 /* Declare swap space */ 550Sstevel@tonic-gate #define SI86FPHW 40 /* what (if any?) floating-point hardware */ 560Sstevel@tonic-gate #define SI86FPSTART 41 /* extended version of SI86FPHW */ 570Sstevel@tonic-gate 580Sstevel@tonic-gate #define GRNON 52 /* set green light to solid on state */ 590Sstevel@tonic-gate #define GRNFLASH 53 /* start green light flashing */ 600Sstevel@tonic-gate #define STIME 54 /* set internal time */ 610Sstevel@tonic-gate #define SETNAME 56 /* rename the system */ 620Sstevel@tonic-gate #define RNVR 58 /* read NVRAM */ 630Sstevel@tonic-gate #define WNVR 59 /* write NVRAM */ 640Sstevel@tonic-gate #define RTODC 60 /* read time of day clock */ 650Sstevel@tonic-gate #define CHKSER 61 /* check soft serial number */ 660Sstevel@tonic-gate #define SI86NVPRT 62 /* print an xtra_nvr structure */ 670Sstevel@tonic-gate #define SANUPD 63 /* sanity update of kernel buffers */ 680Sstevel@tonic-gate #define SI86KSTR 64 /* make a copy of a kernel string */ 690Sstevel@tonic-gate #define SI86MEM 65 /* return the memory size of system */ 700Sstevel@tonic-gate #define SI86TODEMON 66 /* Transfer control to firmware. */ 710Sstevel@tonic-gate #define SI86CCDEMON 67 /* Control character access to demon. */ 720Sstevel@tonic-gate #define SI86CACHE 68 /* Turn cache on and off. */ 730Sstevel@tonic-gate #define SI86DELMEM 69 /* Delete available memory for testing. */ 740Sstevel@tonic-gate #define SI86ADDMEM 70 /* Add back deleted memory. */ 750Sstevel@tonic-gate /* 71 through 74 reserved for VPIX */ 760Sstevel@tonic-gate #define SI86V86 71 /* V86 system calls (see below) */ 770Sstevel@tonic-gate #define SI86SLTIME 72 /* Set local time correction */ 780Sstevel@tonic-gate #define SI86DSCR 75 /* Set a segment or gate descriptor */ 790Sstevel@tonic-gate #define RDUBLK 76 /* Read U Block */ 800Sstevel@tonic-gate /* NFA entry point */ 810Sstevel@tonic-gate #define SI86NFA 77 /* make nfa_sys system call */ 820Sstevel@tonic-gate #define SI86VM86 81 830Sstevel@tonic-gate #define SI86VMENABLE 82 840Sstevel@tonic-gate #define SI86LIMUSER 91 /* license interface */ 850Sstevel@tonic-gate #define SI86RDID 92 /* ROM BIOS Machid ID */ 860Sstevel@tonic-gate #define SI86RDBOOT 93 /* Bootable Non-SCSI Hard Disk */ 870Sstevel@tonic-gate /* XENIX Support */ 880Sstevel@tonic-gate #define SI86SHFIL 100 /* map a file into addr space of a proc */ 890Sstevel@tonic-gate #define SI86PCHRGN 101 /* make globally visible change to a region */ 900Sstevel@tonic-gate #define SI86BADVISE 102 /* badvise subcommand - see below for */ 910Sstevel@tonic-gate /* badvise subfunction definitions */ 920Sstevel@tonic-gate #define SI86SHRGN 103 /* enable/disable XENIX small model shared */ 930Sstevel@tonic-gate /* data context switching */ 940Sstevel@tonic-gate #define SI86CHIDT 104 /* set user level int 0xf0, ... 0xff handlers */ 950Sstevel@tonic-gate #define SI86EMULRDA 105 /* remove special emulator read access */ 960Sstevel@tonic-gate 970Sstevel@tonic-gate /* 980Sstevel@tonic-gate * NOTE: Numbers 106 - 110 have been registered and are reserved 990Sstevel@tonic-gate * for future use for AT&T hardware. 1000Sstevel@tonic-gate */ 1010Sstevel@tonic-gate 1020Sstevel@tonic-gate /* 1030Sstevel@tonic-gate * Commands for allowing the real time clock to keep local time. 1040Sstevel@tonic-gate */ 1050Sstevel@tonic-gate 1060Sstevel@tonic-gate #define WTODC 111 /* write tod clock */ 1070Sstevel@tonic-gate #define SGMTL 112 /* set GMT lag */ 1080Sstevel@tonic-gate #define GGMTL 113 /* get GMT lag */ 1090Sstevel@tonic-gate #define RTCSYNC 114 /* set UNIX 'time' based on RTC and GMT lag */ 1100Sstevel@tonic-gate 1110Sstevel@tonic-gate #define V86SC_IOPL 4 /* The only supported V86 system call */ 1120Sstevel@tonic-gate 1130Sstevel@tonic-gate /* 1140Sstevel@tonic-gate * The SI86DSCR subcommand of the sysi86() system call 1150Sstevel@tonic-gate * sets a segment or gate descriptor in the kernel. 1160Sstevel@tonic-gate * The following descriptor types are accepted: 1170Sstevel@tonic-gate * - executable and data segments in the LDT at DPL 3 1180Sstevel@tonic-gate * - a call gate in the GDT at DPL 3 that points to a segment in the LDT 1190Sstevel@tonic-gate * The request structure declared below is used to pass the values 1200Sstevel@tonic-gate * to be placed in the descriptor. A pointer to the structure is 1210Sstevel@tonic-gate * passed as the second argument of the system call. 1220Sstevel@tonic-gate * If acc1 is zero, the descriptor is cleared. 1230Sstevel@tonic-gate */ 1240Sstevel@tonic-gate 1250Sstevel@tonic-gate /* 1260Sstevel@tonic-gate * XX64 Do we need to support this for 64-bit apps? 1270Sstevel@tonic-gate * 1280Sstevel@tonic-gate * request structure passed by user 1290Sstevel@tonic-gate */ 1300Sstevel@tonic-gate struct ssd { 1310Sstevel@tonic-gate unsigned int sel; /* descriptor selector */ 1320Sstevel@tonic-gate unsigned int bo; /* segment base or gate offset */ 1330Sstevel@tonic-gate unsigned int ls; /* segment limit or gate selector */ 1340Sstevel@tonic-gate unsigned int acc1; /* access byte 5 */ 1350Sstevel@tonic-gate unsigned int acc2; /* access bits in byte 6 or gate count */ 1360Sstevel@tonic-gate }; 1370Sstevel@tonic-gate 1380Sstevel@tonic-gate #define SI86SSD_TYPE(ssd) ((ssd)->acc1 & 0x1F) 1390Sstevel@tonic-gate #define SI86SSD_DPL(ssd) (((ssd)->acc1 >> 5) & 0x3) 1400Sstevel@tonic-gate #define SI86SSD_PRES(ssd) (((ssd)->acc1 >> 7) & 1) 1410Sstevel@tonic-gate #define SI86SSD_ISUSEG(ssd) (SI86SSD_TYPE(ssd) >= SDT_MEMRO) 1420Sstevel@tonic-gate #define SI86SSD_ISLONG(ssd) ((ssd)->acc2 & 0x2) 1430Sstevel@tonic-gate 1440Sstevel@tonic-gate #ifdef _KERNEL 1450Sstevel@tonic-gate extern void usd_to_ssd(user_desc_t *, struct ssd *, selector_t); 146*2712Snn35248 extern int setdscr(struct ssd *); 1470Sstevel@tonic-gate #endif /* _KERNEL */ 1480Sstevel@tonic-gate 1490Sstevel@tonic-gate /* 1500Sstevel@tonic-gate * The SI86SHFIL subcommand of the sysi86() system call 1510Sstevel@tonic-gate * maps a file into a region in user address space. 1520Sstevel@tonic-gate * The request structure declared below is used to pass the 1530Sstevel@tonic-gate * system call parameters. A pointer to the structure is 1540Sstevel@tonic-gate * passed as the second argument of the system call. 1550Sstevel@tonic-gate */ 1560Sstevel@tonic-gate struct mmf { 1570Sstevel@tonic-gate char *mf_filename; /* path name of file */ 1580Sstevel@tonic-gate long mf_filesz; /* Size in bytes of section of file */ 1590Sstevel@tonic-gate /* from which this region is mapped. */ 1600Sstevel@tonic-gate long mf_regsz; /* Size of region in bytes */ 1610Sstevel@tonic-gate short mf_flags; /* Either 0 or RG_NOSHARE */ 1620Sstevel@tonic-gate }; 1630Sstevel@tonic-gate 1640Sstevel@tonic-gate /* 1650Sstevel@tonic-gate * The SI86PCHRGN subcommand of the sysi86() system call 1660Sstevel@tonic-gate * change the memory mapped image of a file. 1670Sstevel@tonic-gate * The request structure declared below is used to pass the values 1680Sstevel@tonic-gate * system call parameters. A pointer to the structure is 1690Sstevel@tonic-gate * passed as the second argument of the system call. 1700Sstevel@tonic-gate */ 1710Sstevel@tonic-gate struct cmf { 1720Sstevel@tonic-gate char *cf_srcva; /* modified image address */ 1730Sstevel@tonic-gate char *cf_dstva; /* location to patch */ 1740Sstevel@tonic-gate long cf_count; /* size of patch */ 1750Sstevel@tonic-gate }; 1760Sstevel@tonic-gate 1770Sstevel@tonic-gate /* 1780Sstevel@tonic-gate * The SI86BADVISE subcommand of the sysi86() system call specifies 1790Sstevel@tonic-gate * XENIX variant behavior for certain system calls and kernel routines. 1800Sstevel@tonic-gate * The 'arg' argument of sysi86() for SI86BADVISE is an integer. Bits 1810Sstevel@tonic-gate * 8..15 specify SI86B_SET or SI86B_GET. Bits 0..7 contain 1820Sstevel@tonic-gate * SI86B_PRE_SV, SI86B_XOUT, or SI86B_XSDSWTCH. All these constants are 1830Sstevel@tonic-gate * defined below. The 'arg' argument thus consists of either SI86B_SET 1840Sstevel@tonic-gate * OR'ed with zero or more of SI86B_PRE_SV, SI86B_XOUT, and SI86B_XSDSWTCH, 1850Sstevel@tonic-gate * or of SI86B_GET. 1860Sstevel@tonic-gate */ 1870Sstevel@tonic-gate #define SI86B_SET 0x0100 /* set badvise bits */ 1880Sstevel@tonic-gate #define SI86B_GET 0x0200 /* retrieve badvise bits */ 1890Sstevel@tonic-gate 1900Sstevel@tonic-gate #define SI86B_PRE_SV 0x0008 /* follow pre-System V x.out behavior */ 1910Sstevel@tonic-gate #define SI86B_XOUT 0x0010 /* follow XENIX x.out behavior */ 1920Sstevel@tonic-gate #define SI86B_XSDSWTCH 0x0080 /* XENIX small model shared data */ 1930Sstevel@tonic-gate /* context switching enabled */ 1940Sstevel@tonic-gate 1950Sstevel@tonic-gate /* 1960Sstevel@tonic-gate * The request structure declared below is used by the XENIX 286 emulator 1970Sstevel@tonic-gate * (/bin/x286emul) in conjunction with the SI86SHRGN subcommand of sysi86(). 1980Sstevel@tonic-gate * The SI86SHRGN subcommand is used by the XENIX 286 emulator to support 1990Sstevel@tonic-gate * XENIX shared data. The second argument passed to sysi86() is a 2000Sstevel@tonic-gate * pointer to an xsdbuf struct. 2010Sstevel@tonic-gate * 2020Sstevel@tonic-gate * If the 'xsd_cmd' field of xsdbuf is SI86SHR_CP, the XENIX 286 emulator is 2030Sstevel@tonic-gate * using the SI86SHRGN subcommand to set up XENIX small model shared data 2040Sstevel@tonic-gate * context switching support for a given XENIX shared data segment. In this 2050Sstevel@tonic-gate * case, the xsdbuf struct contains the start addr for the shared data in 2060Sstevel@tonic-gate * 386 space, followed by the start addr for the shared data in the 286 2070Sstevel@tonic-gate * executable's private data. 2080Sstevel@tonic-gate * 2090Sstevel@tonic-gate * If the 'xsd_cmd' field is SI86SHR_SZ, the XENIX 286 emulator is using the 2100Sstevel@tonic-gate * SI86SHRGN subcommand to retrieve the size of an existing XENIX shared 2110Sstevel@tonic-gate * data segment. In this case, the xsdbuf struct contains the start addr 2120Sstevel@tonic-gate * for the shared data in 386 space. 2130Sstevel@tonic-gate * The size of the shared data segment starting at 'xsd_386vaddr' will 2140Sstevel@tonic-gate * be returned in the 'xsd_size' field by sysi86(). 2150Sstevel@tonic-gate */ 2160Sstevel@tonic-gate 2170Sstevel@tonic-gate #define SI86SHR_CP 0x1 /* SI86SHRGN used for XENIX sd context switch */ 2180Sstevel@tonic-gate #define SI86SHR_SZ 0x2 /* SI86SHRGN used to get XENIX sd seg size */ 2190Sstevel@tonic-gate 2200Sstevel@tonic-gate struct xsdbuf { 2210Sstevel@tonic-gate unsigned xsd_cmd; /* SI86SHRGN subcommand, either SI86SHR_CP */ 2220Sstevel@tonic-gate /* or SI86SHR_SZ. */ 2230Sstevel@tonic-gate char *xsd_386vaddr; /* Addr of "real" XENIX shared data seg in */ 2240Sstevel@tonic-gate /* the emulator. */ 2250Sstevel@tonic-gate union { 2260Sstevel@tonic-gate char *xsd_286vaddr; /* Addr of XENIX shared data seg */ 2270Sstevel@tonic-gate /* in the 286 data portion of the */ 2280Sstevel@tonic-gate /* emulator. */ 2290Sstevel@tonic-gate unsigned long xsd_size; /* Size of XENIX shared data seg */ 2300Sstevel@tonic-gate } xsd_un; 2310Sstevel@tonic-gate }; 2320Sstevel@tonic-gate /* End XENIX Support */ 2330Sstevel@tonic-gate 2340Sstevel@tonic-gate /* 2350Sstevel@tonic-gate * Cascade defines 2360Sstevel@tonic-gate */ 2370Sstevel@tonic-gate 2380Sstevel@tonic-gate #define C2 'E' 2390Sstevel@tonic-gate #define C3 'F' 2400Sstevel@tonic-gate #define C4 'G' 2410Sstevel@tonic-gate #define C6 'K' 2420Sstevel@tonic-gate 2430Sstevel@tonic-gate /* Enterprise IDNO defines */ 2440Sstevel@tonic-gate #define E8R1 'R' 2450Sstevel@tonic-gate 2460Sstevel@tonic-gate #ifndef _KERNEL 2470Sstevel@tonic-gate #ifdef __STDC__ 2480Sstevel@tonic-gate extern int sysi86(int, ...); 2490Sstevel@tonic-gate #else 2500Sstevel@tonic-gate extern int sysi86(); 2510Sstevel@tonic-gate #endif /* __STDC__ */ 2520Sstevel@tonic-gate #endif /* !_KERNEL */ 2530Sstevel@tonic-gate 2540Sstevel@tonic-gate #ifdef __cplusplus 2550Sstevel@tonic-gate } 2560Sstevel@tonic-gate #endif 2570Sstevel@tonic-gate 2580Sstevel@tonic-gate #endif /* _SYS_SYSI86_H */ 259