Move shared headers in common/include
Headers that will be shared between old includes and NetBSD-like includes are moved into common/include tree. They are still copied in /usr/include in 'make includes', so compilation and programs aren't be affected.
This commit is contained in:
@@ -7,29 +7,26 @@ INCS= alloca.h a.out.h ar.h assert.h configfile.h ctype.h \
|
||||
mathconst.h math.h midiparser.h netdb.h pwd.h regex.h \
|
||||
regexp.h setjmp.h sgtty.h signal.h stdarg.h stddef.h \
|
||||
stdint.h stdbool.h stdio.h stdlib.h string.h strings.h sysexits.h \
|
||||
syslog.h tar.h termcap.h termios.h time.h timers.h tools.h \
|
||||
syslog.h tar.h termcap.h time.h timers.h tools.h \
|
||||
ttyent.h ucontext.h unistd.h utime.h utmp.h wchar.h wctype.h \
|
||||
hgfs.h tzfile.h util.h fetch.h mpool.h ndbm.h db.h poll.h resolv.h \
|
||||
memory.h paths.h libexec.h complex.h
|
||||
INCS+= arpa/inet.h arpa/nameser.h
|
||||
INCS+= minix/a.out.h minix/bitmap.h minix/callnr.h minix/cdrom.h \
|
||||
minix/com.h minix/config.h minix/const.h minix/cpufeature.h \
|
||||
minix/crtso.h minix/debug.h minix/devio.h minix/dirent.h \
|
||||
INCS+= minix/a.out.h minix/cdrom.h minix/cpufeature.h \
|
||||
minix/crtso.h minix/dirent.h \
|
||||
minix/dir.h minix/dl_eth.h minix/dmap.h minix/driver.h \
|
||||
minix/limits.h \
|
||||
minix/acpi.h \
|
||||
minix/drivers.h minix/drvlib.h minix/ds.h minix/endpoint.h \
|
||||
minix/fslib.h minix/ioctl.h minix/ipc.h minix/ipcconst.h \
|
||||
minix/keymap.h minix/minlib.h minix/mq.h minix/mthread.h \
|
||||
minix/drivers.h minix/drvlib.h \
|
||||
minix/fslib.h \
|
||||
minix/mq.h minix/mthread.h \
|
||||
minix/netdriver.h minix/partition.h \
|
||||
minix/portio.h minix/priv.h minix/procfs.h minix/profile.h \
|
||||
minix/procfs.h \
|
||||
minix/queryparam.h \
|
||||
minix/rs.h minix/safecopies.h minix/sched.h minix/sef.h minix/sound.h \
|
||||
minix/spin.h minix/sys_config.h minix/sysinfo.h minix/syslib.h \
|
||||
minix/sysutil.h minix/timers.h minix/tty.h minix/type.h minix/types.h \
|
||||
minix/u64.h minix/vfsif.h minix/vm.h minix/vtreefs.h minix/gcov.h \
|
||||
minix/compiler.h minix/compiler-ack.h minix/sha2.h minix/sha1.h minix/md5.h \
|
||||
minix/audio_fw.h minix/hash.h minix/input.h minix/ansi.h
|
||||
minix/sched.h minix/sound.h \
|
||||
minix/tty.h minix/types.h \
|
||||
minix/u64.h minix/vfsif.h minix/vtreefs.h \
|
||||
minix/compiler-ack.h minix/sha2.h minix/sha1.h minix/md5.h \
|
||||
minix/audio_fw.h minix/hash.h minix/input.h
|
||||
INCS+= net/hton.h net/if.h net/ioctl.h net/netlib.h
|
||||
INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \
|
||||
net/gen/eth_hdr.h net/gen/eth_io.h net/gen/icmp.h \
|
||||
@@ -47,6 +44,9 @@ INCS+= netinet/if_ether.h netinet/in.h netinet/tcp.h
|
||||
|
||||
INCSDIR= /usr/include
|
||||
|
||||
.include "../common/include/Makefile.inc"
|
||||
.include "../common/include/Makefile.termios.inc"
|
||||
|
||||
SUBDIR= sys arch
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
INCSDIR= /usr/include/i386
|
||||
|
||||
INCS= archtypes.h bios.h cmos.h cpu.h diskparm.h fpu.h int86.h \
|
||||
interrupt.h mcontext.h memory.h partition.h \
|
||||
pci.h pci_amd.h pci_intel.h pci_sis.h pci_via.h \
|
||||
ports.h stackframe.h vm.h asm.h _align.h param.h elf.h
|
||||
INCS+= _align.h asm.h mcontext.h param.h
|
||||
|
||||
.include "../../../common/include/arch/i386/Makefile.inc"
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
|
||||
#ifndef _I386_TYPES_H
|
||||
#define _I386_TYPES_H
|
||||
|
||||
#include <minix/sys_config.h>
|
||||
#include <machine/stackframe.h>
|
||||
#include <machine/fpu.h>
|
||||
|
||||
struct segdesc_s { /* segment descriptor for protected mode */
|
||||
u16_t limit_low;
|
||||
u16_t base_low;
|
||||
u8_t base_middle;
|
||||
u8_t access; /* |P|DL|1|X|E|R|A| */
|
||||
u8_t granularity; /* |G|X|0|A|LIMT| */
|
||||
u8_t base_high;
|
||||
};
|
||||
|
||||
#define LDT_SIZE (2 + NR_REMOTE_SEGS) /* CS, DS and remote segments */
|
||||
|
||||
/* Fixed local descriptors. */
|
||||
#define CS_LDT_INDEX 0 /* process CS */
|
||||
#define DS_LDT_INDEX 1 /* process DS=ES=FS=GS=SS */
|
||||
#define EXTRA_LDT_INDEX 2 /* first of the extra LDT entries */
|
||||
|
||||
typedef struct segframe {
|
||||
reg_t p_ldt_sel; /* selector in gdt with ldt base and limit */
|
||||
reg_t p_cr3; /* page table root */
|
||||
u32_t *p_cr3_v;
|
||||
struct segdesc_s p_ldt[LDT_SIZE]; /* CS, DS and remote */
|
||||
} segframe_t;
|
||||
|
||||
/* fpu_state_s is used in kernel proc table.
|
||||
* Any changes in this structure requires changes in sconst.h,
|
||||
* since this structure is used in proc structure. */
|
||||
struct fpu_state_s {
|
||||
union fpu_state_u *fpu_save_area_p; /* 16-aligned fpu_save_area */
|
||||
/* fpu_image includes 512 bytes of image itself and
|
||||
* additional 15 bytes required for manual 16-byte alignment. */
|
||||
char fpu_image[527];
|
||||
};
|
||||
|
||||
#define INMEMORY(p) (!p->p_seg.p_cr3 || get_cpulocal_var(ptproc) == p)
|
||||
|
||||
typedef u32_t atomic_t; /* access to an aligned 32bit value is atomic on i386 */
|
||||
|
||||
#endif /* #ifndef _I386_TYPES_H */
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
/* Definitions of several known BIOS addresses. The addresses listed here
|
||||
* are found in three memory areas that have been defined in <ibm/memory.h>.
|
||||
* - the BIOS interrupt vectors
|
||||
* - the BIOS data area
|
||||
* - the motherboard BIOS memory
|
||||
*
|
||||
* Created: March 2005, Jorrit N. Herder
|
||||
*/
|
||||
|
||||
#ifndef _BIOS_H
|
||||
#define _BIOS_H
|
||||
|
||||
/* PART I --
|
||||
* The BIOS interrupt vector table (IVT) area (1024 B as of address 0x0000).
|
||||
* Although this area holds 256 interrupt vectors (with jump addresses), some
|
||||
* vectors actually contain important BIOS data. Some addresses are below.
|
||||
*/
|
||||
#define BIOS_EQUIP_CHECK_ADDR 0x0044
|
||||
#define BIOS_EQUIP_CHECK_SIZE 4L
|
||||
|
||||
#define BIOS_VIDEO_PARAMS_ADDR 0x0074
|
||||
#define BIOS_VIDEO_PARAMS_SIZE 4L
|
||||
|
||||
#define BIOS_FLOP_PARAMS_ADDR 0x0078
|
||||
#define BIOS_FLOP_PARAMS_SIZE 4L
|
||||
|
||||
#define BIOS_HD0_PARAMS_ADDR 0x0104 /* disk 0 parameters */
|
||||
#define BIOS_HD0_PARAMS_SIZE 4L
|
||||
|
||||
#define BIOS_HD1_PARAMS_ADDR 0x0118 /* disk 1 parameters */
|
||||
#define BIOS_HD1_PARAMS_SIZE 4L
|
||||
|
||||
/* PART I --
|
||||
* Addresses in the BIOS data area (256 B as of address 0x0400). The addresses
|
||||
* listed below are the most important ones, and the ones that are currently
|
||||
* used. Other addresses may be defined below when new features are added.
|
||||
*/
|
||||
|
||||
/* Serial ports (COM1-COM4). */
|
||||
#define COM1_IO_PORT_ADDR 0x400 /* COM1 port address */
|
||||
#define COM1_IO_PORT_SIZE 2L
|
||||
#define COM2_IO_PORT_ADDR 0x402 /* COM2 port address */
|
||||
#define COM2_IO_PORT_SIZE 2L
|
||||
#define COM3_IO_PORT_ADDR 0x404 /* COM3 port address */
|
||||
#define COM3_IO_PORT_SIZE 2L
|
||||
#define COM4_IO_PORT_ADDR 0x406 /* COM4 port address */
|
||||
#define COM4_IO_PORT_SIZE 2L
|
||||
|
||||
/* Parallel ports (LPT1-LPT4). */
|
||||
#define LPT1_IO_PORT_ADDR 0x408 /* LPT1 port address */
|
||||
#define LPT1_IO_PORT_SIZE 2L
|
||||
#define LPT2_IO_PORT_ADDR 0x40A /* LPT2 port address */
|
||||
#define LPT2_IO_PORT_SIZE 2L
|
||||
#define LPT3_IO_PORT_ADDR 0x40C /* LPT3 port address */
|
||||
#define LPT3_IO_PORT_SIZE 2L
|
||||
#define LPT4_IO_PORT_ADDR 0x40E /* LPT4 port (except on PS/2) */
|
||||
#define LPT4_IO_PORT_SIZE 2L
|
||||
|
||||
/* Video controller (VDU). */
|
||||
#define VDU_SCREEN_COLS_ADDR 0x44A /* VDU nr of screen columns */
|
||||
#define VDU_SCREEN_COLS_SIZE 2L
|
||||
|
||||
/* Base I/O port address for active 6845 CRT controller. */
|
||||
#define VDU_CRT_BASE_ADDR 0x463 /* 3B4h = mono, 3D4h = color */
|
||||
#define VDU_CRT_BASE_SIZE 2L
|
||||
|
||||
/* Soft reset flags to control shutdown. */
|
||||
#define SOFT_RESET_FLAG_ADDR 0x472 /* soft reset flag on Ctl-Alt-Del */
|
||||
#define SOFT_RESET_FLAG_SIZE 2L
|
||||
#define STOP_MEM_CHECK 0x1234 /* bypass memory tests & CRT init */
|
||||
#define PRESERVE_MEMORY 0x4321 /* preserve memory */
|
||||
#define SYSTEM_SUSPEND 0x5678 /* system suspend */
|
||||
#define MANUFACTURER_TEST 0x9ABC /* manufacturer test */
|
||||
#define CONVERTIBLE_POST 0xABCD /* convertible POST loop */
|
||||
/* ... many other values are used during POST */
|
||||
|
||||
/* Hard disk parameters. (Also see BIOS interrupt vector table above.) */
|
||||
#define NR_HD_DRIVES_ADDR 0x475 /* number of hard disk drives */
|
||||
#define NR_HD_DRIVES_SIZE 1L
|
||||
|
||||
/* Parallel ports (LPT1-LPT4) timeout values. */
|
||||
#define LPT1_TIMEOUT_ADDR 0x478 /* time-out value for LPT1 */
|
||||
#define LPT1_TIMEOUT_SIZE 1L
|
||||
#define LPT2_TIMEOUT_ADDR 0x479 /* time-out value for LPT2 */
|
||||
#define LPT2_TIMEOUT_SIZE 1L
|
||||
#define LPT3_TIMEOUT_ADDR 0x47A /* time-out value for LPT3 */
|
||||
#define LPT3_TIMEOUT_SIZE 1L
|
||||
#define LPT4_TIMEOUT_ADDR 0x47B /* time-out for LPT4 (except PS/2) */
|
||||
#define LPT4_TIMEOUT_SIZE 1L
|
||||
|
||||
/* Serial ports (COM1-COM4) timeout values. */
|
||||
#define COM1_TIMEOUT_ADDR 0x47C /* time-out value for COM1 */
|
||||
#define COM1_TIMEOUT_SIZE 1L
|
||||
#define COM2_TIMEOUT_ADDR 0x47D /* time-out value for COM2 */
|
||||
#define COM2_TIMEOUT_SIZE 1L
|
||||
#define COM3_TIMEOUT_ADDR 0x47E /* time-out value for COM3 */
|
||||
#define COM3_TIMEOUT_SIZE 1L
|
||||
#define COM4_TIMEOUT_ADDR 0x47F /* time-out value for COM4 */
|
||||
#define COM4_TIMEOUT_SIZE 1L
|
||||
|
||||
/* Video controller (VDU). */
|
||||
#define VDU_SCREEN_ROWS_ADDR 0x484 /* screen rows (less 1, EGA+)*/
|
||||
#define VDU_SCREEN_ROWS_SIZE 1L
|
||||
#define VDU_FONTLINES_ADDR 0x485 /* point height of char matrix */
|
||||
#define VDU_FONTLINES_SIZE 2L
|
||||
|
||||
/* Video controller (VDU). */
|
||||
#define VDU_VIDEO_MODE_ADDR 0x49A /* current video mode */
|
||||
#define VDU_VIDEO_MODE_SIZE 1L
|
||||
|
||||
/* PART III --
|
||||
* The motherboard BIOS memory contains some known values that are currently
|
||||
* in use. Other sections in the upper memory area (UMA) addresses vary in
|
||||
* size and locus and are not further defined here. A rough map is given in
|
||||
* <ibm/memory.h>.
|
||||
*/
|
||||
|
||||
/* Machine ID (we're interested in PS/2 and AT models). */
|
||||
#define MACHINE_ID_ADDR 0xFFFFE /* BIOS machine ID byte */
|
||||
#define MACHINE_ID_SIZE 1L
|
||||
#define PS_386_MACHINE 0xF8 /* ID byte for PS/2 modela 70/80 */
|
||||
#define PC_AT_MACHINE 0xFC /* PC/AT, PC/XT286, PS/2 models 50/60 */
|
||||
|
||||
#endif /* _BIOS_H */
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
ibm/cmos.h
|
||||
|
||||
Created: Dec 1998 by Philip Homburg <philip@cs.vu.nl>
|
||||
|
||||
Definitions for the CMOS/realtime clock. Based on the datasheet for the
|
||||
Dallas DS12887, compatible with the Motorola MC146818
|
||||
*/
|
||||
|
||||
#define RTC_INDEX 0x70 /* Bit 7 = NMI enable (1) / disable (0)
|
||||
* bits 0..6 index
|
||||
*/
|
||||
#define RTC_IO 0x71 /* Data register,
|
||||
* Note: the operation following a write to
|
||||
* RTC_INDEX should an access (read or write)
|
||||
* to RTC_IO
|
||||
*/
|
||||
|
||||
#define RTC_SEC 0x0 /* Seconds register */
|
||||
#define RTC_SEC_ALRM 0x1 /* Seconds register for alarm */
|
||||
#define RTC_MIN 0x2 /* Minutes register */
|
||||
#define RTC_MIN_ALRM 0x3 /* Minutes register for alarm */
|
||||
#define RTC_HOUR 0x4 /* Hours register */
|
||||
#define RTC_HOUR_ALRM 0x5 /* Hours register for alarm */
|
||||
#define RTC_WDAY 0x6 /* Day of the week, 1..7, Sunday = 1 */
|
||||
#define RTC_MDAY 0x7 /* Day of the month, 1..31 */
|
||||
#define RTC_MONTH 0x8 /* Month, 1..12 */
|
||||
#define RTC_YEAR 0x9 /* Year, 0..99 */
|
||||
#define RTC_REG_A 0xA
|
||||
#define RTC_A_UIP 0x80 /* Update in progress. When clear,
|
||||
* no update will occur for 244
|
||||
* micro seconds.
|
||||
*/
|
||||
#define RTC_A_DV 0x70 /* Divider bits, valid values are: */
|
||||
#define RTC_A_DV_OK 0x20 /* Normal */
|
||||
#define RTC_A_DV_STOP 0x70 /* Stop, a re-start starts
|
||||
* halfway through a cycle,
|
||||
* i.e. the update occurs after
|
||||
* 500ms.
|
||||
*/
|
||||
#define RTC_A_RS 0x0F /* Int. freq */
|
||||
/* 0 None
|
||||
* 1 256 Hz
|
||||
* 2 128 Hz
|
||||
* 3 8192 Hz
|
||||
* 4 4096 Hz
|
||||
* 5 2048 Hz
|
||||
* 6 1024 Hz
|
||||
* 7 512 Hz
|
||||
* 8 256 Hz
|
||||
* 9 128 Hz
|
||||
* 10 64 Hz
|
||||
* 11 32 Hz
|
||||
* 12 16 Hz
|
||||
* 13 8 Hz
|
||||
* 14 4 Hz
|
||||
* 15 2 Hz
|
||||
*/
|
||||
#define RTC_A_RS_DEF 6 /* Default freq. */
|
||||
#define RTC_REG_B 0xB
|
||||
#define RTC_B_SET 0x80 /* Inhibit updates */
|
||||
#define RTC_B_PIE 0x40 /* Enable periodic interrupts */
|
||||
#define RTC_B_AIE 0x20 /* Enable alarm interrupts */
|
||||
#define RTC_B_UIE 0x10 /* Enable update ended interrupts */
|
||||
#define RTC_B_SQWE 0x08 /* Enable square wave output */
|
||||
#define RTC_B_DM_BCD 0x04 /* Data is in BCD (otherwise binary) */
|
||||
#define RTC_B_24 0x02 /* Count hours in 24-hour mode */
|
||||
#define RTC_B_DSE 0x01 /* Automatic (wrong) daylight savings
|
||||
* updates
|
||||
*/
|
||||
#define RTC_REG_C 0xC
|
||||
|
||||
/* Contents of the general purpose CMOS RAM (source IBM reference manual) */
|
||||
#define CMOS_STATUS 0xE
|
||||
#define CS_LOST_POWER 0x80 /* Chip lost power */
|
||||
#define CS_BAD_CHKSUM 0x40 /* Checksum is incorrect */
|
||||
#define CS_BAD_CONFIG 0x20 /* Bad configuration info */
|
||||
#define CS_BAD_MEMSIZE 0x10 /* Wrong memory size of CMOS */
|
||||
#define CS_BAD_HD 0x08 /* Harddisk failed */
|
||||
#define CS_BAD_TIME 0x04 /* CMOS time is invalid */
|
||||
/* bits 0 and 1 are reserved */
|
||||
|
||||
/*
|
||||
* $PchId: cmos.h,v 1.1 1998/12/16 09:14:21 philip Exp $
|
||||
*/
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef _IBM_CPU_H
|
||||
#define _IBM_CPU_H 1
|
||||
|
||||
#define X86_FLAG_C (1L << 0) /* S Carry */
|
||||
#define X86_FLAG_P (1L << 2) /* S Parity */
|
||||
#define X86_FLAG_A (1L << 4) /* S Aux. carry */
|
||||
#define X86_FLAG_Z (1L << 6) /* S Zero */
|
||||
#define X86_FLAG_S (1L << 7) /* S Sign */
|
||||
|
||||
#define X86_FLAG_T (1L << 8) /* X Trap */
|
||||
#define X86_FLAG_I (1L << 9) /* X Interrupt */
|
||||
#define X86_FLAG_D (1L << 10) /* C Direction */
|
||||
#define X86_FLAG_O (1L << 11) /* S Overflow */
|
||||
|
||||
/* User flags are S (Status) and C (Control) flags. */
|
||||
#define X86_FLAGS_USER (X86_FLAG_C | X86_FLAG_P | X86_FLAG_A | X86_FLAG_Z | \
|
||||
X86_FLAG_S | X86_FLAG_D | X86_FLAG_O)
|
||||
|
||||
#endif
|
||||
@@ -1,20 +0,0 @@
|
||||
/* PC (and AT) BIOS structure to hold disk parameters. Under Minix, it is
|
||||
* used mainly for formatting.
|
||||
*/
|
||||
|
||||
#ifndef _DISKPARM_H
|
||||
#define _DISKPARM_H
|
||||
struct disk_parameter_s {
|
||||
char spec1;
|
||||
char spec2;
|
||||
char motor_turnoff_sec;
|
||||
char sector_size_code;
|
||||
char sectors_per_cylinder;
|
||||
char gap_length;
|
||||
char dtl;
|
||||
char gap_length_for_format;
|
||||
char fill_byte_for_format;
|
||||
char head_settle_msec;
|
||||
char motor_start_eigth_sec;
|
||||
};
|
||||
#endif /* _DISKPARM_H */
|
||||
@@ -1,116 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1996-1997 John D. Polstra.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_ELF_H_
|
||||
#define _MACHINE_ELF_H_ 1
|
||||
|
||||
/*
|
||||
* ELF definitions for the i386 architecture.
|
||||
*/
|
||||
|
||||
#include <sys/elf32.h> /* Definitions common to all 32 bit architectures. */
|
||||
#if defined(__ELF_WORD_SIZE) && __ELF_WORD_SIZE == 64
|
||||
#include <sys/elf64.h> /* Definitions common to all 64 bit architectures. */
|
||||
#endif
|
||||
|
||||
#ifndef __ELF_WORD_SIZE
|
||||
#define __ELF_WORD_SIZE 32 /* Used by <sys/elf_generic.h> */
|
||||
#endif
|
||||
|
||||
#include <sys/elf_generic.h>
|
||||
|
||||
#define ELF_ARCH EM_386
|
||||
|
||||
#define ELF_MACHINE_OK(x) ((x) == EM_386 || (x) == EM_486)
|
||||
|
||||
/*
|
||||
* Auxiliary vector entries for passing information to the interpreter.
|
||||
*
|
||||
* The i386 supplement to the SVR4 ABI specification names this "auxv_t",
|
||||
* but POSIX lays claim to all symbols ending with "_t".
|
||||
*/
|
||||
|
||||
typedef struct { /* Auxiliary vector entry on initial stack */
|
||||
int a_type; /* Entry type. */
|
||||
union {
|
||||
long a_val; /* Integer value. */
|
||||
void *a_ptr; /* Address. */
|
||||
void (*a_fcn)(void); /* Function pointer (not used). */
|
||||
} a_un;
|
||||
} Elf32_Auxinfo;
|
||||
|
||||
#if __ELF_WORD_SIZE == 64
|
||||
/* Fake for amd64 loader support */
|
||||
typedef struct {
|
||||
int fake;
|
||||
} Elf64_Auxinfo;
|
||||
#endif
|
||||
|
||||
__ElfType(Auxinfo);
|
||||
|
||||
/* Values for a_type. */
|
||||
#define AT_NULL 0 /* Terminates the vector. */
|
||||
#define AT_IGNORE 1 /* Ignored entry. */
|
||||
#define AT_EXECFD 2 /* File descriptor of program to load. */
|
||||
#define AT_PHDR 3 /* Program header of program already loaded. */
|
||||
#define AT_PHENT 4 /* Size of each program header entry. */
|
||||
#define AT_PHNUM 5 /* Number of program header entries. */
|
||||
#define AT_PAGESZ 6 /* Page size in bytes. */
|
||||
#define AT_BASE 7 /* Interpreter's base address. */
|
||||
#define AT_FLAGS 8 /* Flags (unused for i386). */
|
||||
#define AT_ENTRY 9 /* Where interpreter should transfer control. */
|
||||
#define AT_NOTELF 10 /* Program is not ELF ?? */
|
||||
#define AT_UID 11 /* Real uid. */
|
||||
#define AT_EUID 12 /* Effective uid. */
|
||||
#define AT_GID 13 /* Real gid. */
|
||||
#define AT_EGID 14 /* Effective gid. */
|
||||
#define AT_EXECPATH 15 /* Path to the executable. */
|
||||
#define AT_CANARY 16 /* Canary for SSP. */
|
||||
#define AT_CANARYLEN 17 /* Length of the canary. */
|
||||
#define AT_OSRELDATE 18 /* OSRELDATE. */
|
||||
#define AT_NCPUS 19 /* Number of CPUs. */
|
||||
#define AT_PAGESIZES 20 /* Pagesizes. */
|
||||
#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */
|
||||
|
||||
#define AT_COUNT 22 /* Count of defined aux entry types. */
|
||||
|
||||
/*
|
||||
* Relocation types.
|
||||
*/
|
||||
|
||||
#define R_386_COUNT 38 /* Count of defined relocation types. */
|
||||
|
||||
/* Define "machine" characteristics */
|
||||
#define ELF_TARG_CLASS ELFCLASS32
|
||||
#define ELF_TARG_DATA ELFDATA2LSB
|
||||
#define ELF_TARG_MACH EM_386
|
||||
#define ELF_TARG_VER 1
|
||||
|
||||
#define ET_DYN_LOAD_ADDR 0x01001000
|
||||
|
||||
#endif /* !_MACHINE_ELF_H_ */
|
||||
@@ -1,50 +0,0 @@
|
||||
#ifndef FPU_H
|
||||
#define FPU_H
|
||||
|
||||
/* x87 FPU state, MMX Technolodgy.
|
||||
* 108 bytes.*/
|
||||
struct fpu_regs_s {
|
||||
u16_t fp_control; /* control */
|
||||
u16_t fp_unused_1;
|
||||
u16_t fp_status; /* status */
|
||||
u16_t fp_unused_2;
|
||||
u16_t fp_tag; /* register tags */
|
||||
u16_t fp_unused_3;
|
||||
u32_t fp_eip; /* eip at failed instruction */
|
||||
u16_t fp_cs; /* cs at failed instruction */
|
||||
u16_t fp_opcode; /* opcode of failed instruction */
|
||||
u32_t fp_dp; /* data address */
|
||||
u16_t fp_ds; /* data segment */
|
||||
u16_t fp_unused_4;
|
||||
u16_t fp_st_regs[8][5]; /* 8 80-bit FP registers */
|
||||
};
|
||||
|
||||
/* x87 FPU, MMX Technolodgy and SSE state.
|
||||
* 512 bytes (if you need size use FPU_XFP_SIZE). */
|
||||
struct xfp_save {
|
||||
u16_t fp_control; /* control */
|
||||
u16_t fp_status; /* status */
|
||||
u16_t fp_tag; /* register tags */
|
||||
u16_t fp_opcode; /* opcode of failed instruction */
|
||||
u32_t fp_eip; /* eip at failed instruction */
|
||||
u16_t fp_cs; /* cs at failed instruction */
|
||||
u16_t fp_unused_1;
|
||||
u32_t fp_dp; /* data address */
|
||||
u16_t fp_ds; /* data segment */
|
||||
u16_t fp_unused_2;
|
||||
u32_t fp_mxcsr; /* MXCSR */
|
||||
u32_t fp_mxcsr_mask; /* MXCSR_MASK */
|
||||
u16_t fp_st_regs[8][8]; /* 128 bytes for ST/MM regs */
|
||||
u32_t fp_xreg_word[32]; /* space for 8 128-bit XMM registers */
|
||||
u32_t fp_padding[56];
|
||||
};
|
||||
|
||||
/* Size of xfp_save structure. */
|
||||
#define FPU_XFP_SIZE 512
|
||||
|
||||
union fpu_state_u {
|
||||
struct fpu_regs_s fpu_regs;
|
||||
struct xfp_save xfp_regs;
|
||||
};
|
||||
|
||||
#endif /* #ifndef FPU_H */
|
||||
@@ -1,61 +0,0 @@
|
||||
/* int86.h - 8086 interrupt types Author: Kees J. Bot
|
||||
* 3 May 2000
|
||||
*/
|
||||
|
||||
/* Registers used in an PC real mode call for BIOS or DOS services. A
|
||||
* driver is called through the vector if the interrupt number is zero.
|
||||
*/
|
||||
union reg86 {
|
||||
struct l {
|
||||
u32_t ef; /* 32 bit flags (output only) */
|
||||
u32_t vec; /* Driver vector (input only) */
|
||||
u32_t _ds_es[1];
|
||||
u32_t eax; /* 32 bit general registers */
|
||||
u32_t ebx;
|
||||
u32_t ecx;
|
||||
u32_t edx;
|
||||
u32_t esi;
|
||||
u32_t edi;
|
||||
u32_t ebp;
|
||||
} l;
|
||||
struct w {
|
||||
u16_t f, _ef[1]; /* 16 bit flags (output only) */
|
||||
u16_t off, seg; /* Driver vector (input only) */
|
||||
u16_t ds, es; /* DS and ES real mode segment regs */
|
||||
u16_t ax, _eax[1]; /* 16 bit general registers */
|
||||
u16_t bx, _ebx[1];
|
||||
u16_t cx, _ecx[1];
|
||||
u16_t dx, _edx[1];
|
||||
u16_t si, _esi[1];
|
||||
u16_t di, _edi[1];
|
||||
u16_t bp, _ebp[1];
|
||||
} w;
|
||||
struct b {
|
||||
u8_t intno, _intno[3]; /* Interrupt number (input only) */
|
||||
u8_t _vec[4];
|
||||
u8_t _ds_es[4];
|
||||
u8_t al, ah, _eax[2]; /* 8 bit general registers */
|
||||
u8_t bl, bh, _ebx[2];
|
||||
u8_t cl, ch, _ecx[2];
|
||||
u8_t dl, dh, _edx[2];
|
||||
u8_t _esi[4];
|
||||
u8_t _edi[4];
|
||||
u8_t _ebp[4];
|
||||
} b;
|
||||
};
|
||||
|
||||
struct reg86u { union reg86 u; }; /* Better for forward declarations */
|
||||
|
||||
/* Parameters passed on ioctls to the memory task. */
|
||||
|
||||
struct mio_int86 { /* MIOCINT86 */
|
||||
union reg86 reg86; /* x86 registers as above */
|
||||
u16_t off, seg; /* Address of kernel buffer */
|
||||
void *buf; /* User data buffer */
|
||||
size_t len; /* Size of user buffer */
|
||||
};
|
||||
|
||||
struct mio_ldt86 { /* MIOCGLDT86, MIOCSLDT86 */
|
||||
size_t idx; /* Index in process' LDT */
|
||||
u16_t entry[4]; /* One LDT entry to get or set. */
|
||||
};
|
||||
@@ -1,65 +0,0 @@
|
||||
/* Interrupt numbers and hardware vectors. */
|
||||
|
||||
#ifndef _INTERRUPT_H
|
||||
#define _INTERRUPT_H
|
||||
|
||||
#if (CHIP == INTEL)
|
||||
|
||||
/* 8259A interrupt controller ports. */
|
||||
#define INT_CTL 0x20 /* I/O port for interrupt controller */
|
||||
#define INT_CTLMASK 0x21 /* setting bits in this port disables ints */
|
||||
#define INT2_CTL 0xA0 /* I/O port for second interrupt controller */
|
||||
#define INT2_CTLMASK 0xA1 /* setting bits in this port disables ints */
|
||||
|
||||
/* Magic numbers for interrupt controller. */
|
||||
#define END_OF_INT 0x20 /* code used to re-enable after an interrupt */
|
||||
|
||||
/* Interrupt vectors defined/reserved by processor. */
|
||||
#define DIVIDE_VECTOR 0 /* divide error */
|
||||
#define DEBUG_VECTOR 1 /* single step (trace) */
|
||||
#define NMI_VECTOR 2 /* non-maskable interrupt */
|
||||
#define BREAKPOINT_VECTOR 3 /* software breakpoint */
|
||||
#define OVERFLOW_VECTOR 4 /* from INTO */
|
||||
|
||||
/* Fixed system call vector. */
|
||||
#define KERN_CALL_VECTOR 32 /* system calls are made with int SYSVEC */
|
||||
#define IPC_VECTOR 33 /* interrupt vector for ipc */
|
||||
|
||||
/* Suitable irq bases for hardware interrupts. Reprogram the 8259(s) from
|
||||
* the PC BIOS defaults since the BIOS doesn't respect all the processor's
|
||||
* reserved vectors (0 to 31).
|
||||
*/
|
||||
#define BIOS_IRQ0_VEC 0x08 /* base of IRQ0-7 vectors used by BIOS */
|
||||
#define BIOS_IRQ8_VEC 0x70 /* base of IRQ8-15 vectors used by BIOS */
|
||||
#define IRQ0_VECTOR 0x50 /* nice vectors to relocate IRQ0-7 to */
|
||||
#define IRQ8_VECTOR 0x70 /* no need to move IRQ8-15 */
|
||||
|
||||
/* Hardware interrupt numbers. */
|
||||
#ifndef CONFIG_APIC
|
||||
#define NR_IRQ_VECTORS 16
|
||||
#else
|
||||
#define NR_IRQ_VECTORS 64
|
||||
#endif
|
||||
#define CLOCK_IRQ 0
|
||||
#define KEYBOARD_IRQ 1
|
||||
#define CASCADE_IRQ 2 /* cascade enable for 2nd AT controller */
|
||||
#define ETHER_IRQ 3 /* default ethernet interrupt vector */
|
||||
#define SECONDARY_IRQ 3 /* RS232 interrupt vector for port 2 */
|
||||
#define RS232_IRQ 4 /* RS232 interrupt vector for port 1 */
|
||||
#define XT_WINI_IRQ 5 /* xt winchester */
|
||||
#define FLOPPY_IRQ 6 /* floppy disk */
|
||||
#define PRINTER_IRQ 7
|
||||
#define CMOS_CLOCK_IRQ 8
|
||||
#define KBD_AUX_IRQ 12 /* AUX (PS/2 mouse) port in kbd controller */
|
||||
#define AT_WINI_0_IRQ 14 /* at winchester controller 0 */
|
||||
#define AT_WINI_1_IRQ 15 /* at winchester controller 1 */
|
||||
|
||||
/* Interrupt number to hardware vector. */
|
||||
#define BIOS_VECTOR(irq) \
|
||||
(((irq) < 8 ? BIOS_IRQ0_VEC : BIOS_IRQ8_VEC) + ((irq) & 0x07))
|
||||
#define VECTOR(irq) \
|
||||
(((irq) < 8 ? IRQ0_VECTOR : IRQ8_VECTOR) + ((irq) & 0x07))
|
||||
|
||||
#endif /* (CHIP == INTEL) */
|
||||
|
||||
#endif /* _INTERRUPT_H */
|
||||
@@ -1,171 +0,0 @@
|
||||
/* Physical memory layout on IBM compatible PCs. Only the major, fixed memory
|
||||
* areas are detailed here. Known addresses of the BIOS data area are defined
|
||||
* in <ibm/bios.h>. The map upper memory area (UMA) is only roughly defined
|
||||
* since the UMA sections may vary in size and locus.
|
||||
*
|
||||
* Created: March 2005, Jorrit N. Herder
|
||||
*/
|
||||
|
||||
/* I/O-mapped peripherals. I/O addresses are different from memory addresses
|
||||
* due to the I/O signal on the ISA bus. Individual I/O ports are defined by
|
||||
* the drivers that use them or looked up with help of the BIOS.
|
||||
*/
|
||||
#define IO_MEMORY_BEGIN 0x0000
|
||||
#define IO_MEMORY_END 0xFFFF
|
||||
|
||||
|
||||
/* Physical memory layout. Design decisions made for the earliest PCs, caused
|
||||
* memory to be broken broken into the following four basic pieces:
|
||||
* - Conventional or base memory: first 640 KB (incl. BIOS data, see below);
|
||||
* The top of conventional memory is often used by the BIOS to store data.
|
||||
* - Upper Memory Area (UMA): upper 384 KB of the first megabyte of memory;
|
||||
* - High Memory Area (HMA): ~ first 64 KB of the second megabyte of memory;
|
||||
* - Extended Memory: all the memory above first megabyte of memory.
|
||||
* The high memory area overlaps with the first 64 KB of extended memory, but
|
||||
* is different from the rest of extended memory because it can be accessed
|
||||
* when the processor is in real mode.
|
||||
*/
|
||||
#define BASE_MEM_BEGIN 0x000000
|
||||
#define BASE_MEM_TOP 0x090000
|
||||
#define BASE_MEM_END 0x09FFFF
|
||||
|
||||
#define UPPER_MEM_BEGIN 0x0A0000
|
||||
#define UPPER_MEM_END 0x0FFFFF
|
||||
|
||||
#define HIGH_MEM_BEGIN 0x100000
|
||||
#define HIGH_MEM_END 0x10FFEF
|
||||
|
||||
#define EXTENDED_MEM_BEGIN 0x100000
|
||||
#define EXTENDED_MEM_END ((unsigned) -1)
|
||||
|
||||
|
||||
/* The logical memory map of the first 1.5 MB is as follows (hexadecimals):
|
||||
*
|
||||
* offset [size] (id) = memory usage
|
||||
* ------------------------------------------------------------------------
|
||||
* 000000 [00400] (I) = Real-Mode Interrupt Vector Table (1024 B)
|
||||
* 000400 [00100] (B) = BIOS Data Area (256 B)
|
||||
* 000800 [00066] (W) = 80286 Loadall workspace
|
||||
* 010000 [10000] (c) = Real-Mode Compatibility Segment (64 KB)
|
||||
* 020000 [70000] (.) = Program-accessible memory (free)
|
||||
* 090000 [10000] (E) = BIOS Extension
|
||||
* 0A0000 [10000] (G) = Graphics Mode Video RAM
|
||||
* 0B0000 [08000] (M) = Monochrome Text Mode Video RAM
|
||||
* 0B8000 [08000] (C) = Color Text Mode Video RAM
|
||||
* 0C0000 [08000] (V) = Video ROM BIOS (would be "a" in PS/2)
|
||||
* 0C8000 [18000] (a) = Adapter ROM + special-purpose RAM (free UMA space)
|
||||
* 0E0000 [10000] (r) = PS/2 Motherboard ROM BIOS (free UMA in non-PS/2)
|
||||
* 0F0000 [06000] (R) = Motherboard ROM BIOS
|
||||
* 0F6000 [08000] (b) = IBM Cassette BASIC ROM ("R" in IBM compatibles)
|
||||
* 0FD000 [02000] (R) = Motherboard ROM BIOS
|
||||
* 100000 [.....] (.) = Extended memory, program-accessible (free)
|
||||
* 100000 [0FFEF] (h) = High Memory Area (HMA)
|
||||
*
|
||||
*
|
||||
* Conventional (Base) Memory:
|
||||
*
|
||||
* : [~~~~~16 KB~~~~][~~~~~16 KB~~~~][~~~~~16 KB~~~~][~~~~~16 KB~~~~]
|
||||
* : 0---1---2---3---4---5---6---7---8---9---A---B---C---D---E---F---
|
||||
* 000000: IBW.............................................................
|
||||
* 010000: cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||
* 020000: ................................................................
|
||||
* 030000: ................................................................
|
||||
* 040000: ................................................................
|
||||
* 050000: ................................................................
|
||||
* 060000: ................................................................
|
||||
* 070000: ................................................................
|
||||
* 080000: ................................................................
|
||||
* 090000: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
||||
*
|
||||
* Upper Memory Area (UMA):
|
||||
*
|
||||
* : 0---1---2---3---4---5---6---7---8---9---A---B---C---D---E---F---
|
||||
* 0A0000: GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
|
||||
* 0B0000: MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
|
||||
* 0C0000: VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
* 0D0000: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
* 0E0000: rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
|
||||
* 0F0000: RRRRRRRRRRRRRRRRRRRRRRRRbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbRRRRRRRR
|
||||
*
|
||||
* Extended Memory:
|
||||
*
|
||||
* : 0---1---2---3---4---5---6---7---8---9---A---B---C---D---E---F---
|
||||
* 100000: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.
|
||||
* 110000: ................................................................
|
||||
* 120000: ................................................................
|
||||
* 130000: ................................................................
|
||||
* 140000: ................................................................
|
||||
* 150000: ................................................................
|
||||
* 160000: ................................................................
|
||||
* 170000: ................................................................
|
||||
*
|
||||
* Source: The logical memory map was partly taken from the book "Upgrading
|
||||
* & Repairing PCs Eight Edition", Macmillan Computer Publishing.
|
||||
*/
|
||||
|
||||
|
||||
/* The bottom part of conventional or base memory is occupied by BIOS data.
|
||||
* The BIOS memory can be distinguished in two parts:
|
||||
* o The first the first 1024 bytes of addressable memory contains the BIOS
|
||||
* real-mode interrupt vector table (IVT). The table is used to access BIOS
|
||||
* hardware services in real-mode by loading a interrupt vector and issuing
|
||||
* an INT instruction. Some vectors contain BIOS data that can be retrieved
|
||||
* directly and are useful in protected-mode as well.
|
||||
* o The BIOS data area is located directly above the interrupt vectors. It
|
||||
* comprises 256 bytes of memory. These data are used by the device drivers
|
||||
* to retrieve hardware details, such as I/O ports to be used.
|
||||
*/
|
||||
#define BIOS_MEM_BEGIN 0x00000 /* all BIOS memory */
|
||||
#define BIOS_MEM_END 0x004FF
|
||||
#define BIOS_IVT_BEGIN 0x00000 /* BIOS interrupt vectors */
|
||||
#define BIOS_IVT_END 0x003FF
|
||||
#define BIOS_DATA_BEGIN 0x00400 /* BIOS data area */
|
||||
#define BIOS_DATA_END 0x004FF
|
||||
|
||||
/* The base memory is followed by 384 KB reserved memory located at the top of
|
||||
* the first MB of physical memory. This memory is known as the upper memory
|
||||
* area (UMA). It is used for memory-mapped peripherals, such as video RAM,
|
||||
* adapter BIOS (adapter ROM and special purpose RAM), and the motherboard
|
||||
* BIOS (I/O system, Power-On Self Test, bootstrap loader). The upper memory
|
||||
* can roughly be distinguished in three parts:
|
||||
*
|
||||
* o The first 128K of the upper memory area (A0000-BFFFF) is reserved for use
|
||||
* by memory-mapped video adapters. Hence, it is also called Video RAM. The
|
||||
* display driver can directly write to this memory and request the hardware
|
||||
* to show the data on the screen.
|
||||
*/
|
||||
#define UMA_VIDEO_RAM_BEGIN 0xA0000 /* video RAM */
|
||||
#define UMA_VIDEO_RAM_END 0xBFFFF
|
||||
#define UMA_GRAPHICS_RAM_BEGIN 0xA0000 /* graphics RAM */
|
||||
#define UMA_GRAPHICS_RAM_END 0xAFFFF
|
||||
#define UMA_MONO_TEXT_BEGIN 0xB0000 /* monochrome text */
|
||||
#define UMA_MONO_TEXT_END 0xB7FFF
|
||||
#define UMA_COLOR_TEXT_BEGIN 0xB8000 /* color text */
|
||||
#define UMA_COLOR_TEXT_END 0xBFFFF
|
||||
|
||||
/* o The next 128K (the memory range C0000-DFFFF) is reserved for the adapter
|
||||
* BIOS that resides in the ROM on some adapter boards. Most VGA-compatible
|
||||
* video adapters use the first 32 KB of this area for their on-board BIOS.
|
||||
* The rest can be used by any other adapters. The IDE controller often
|
||||
* occupies the second 32 KB.
|
||||
*/
|
||||
#define UMA_ADAPTER_BIOS_BEGIN 0xC0000 /* adapter BIOS */
|
||||
#define UMA_ADAPTER_BIOS_END 0xDFFFF
|
||||
#define UMA_VIDEO_BIOS_BEGIN 0xC0000 /* video adapter */
|
||||
#define UMA_VIDEO_BIOS_END 0xC7FFF
|
||||
#define UMA_IDE_HD_BIOS_BEGIN 0xC8000 /* IDE hard disk */
|
||||
#define UMA_IDE_HD_BIOS_END 0xCBFFF
|
||||
|
||||
/* o The last 128K of the upper memory area (E0000-FFFFF) is reserved for
|
||||
* motherboard BIOS (Basic I/O System). The POST (Power-On Self Test) and
|
||||
* bootstrap loader also reside in this space. The memory falls apart in
|
||||
* two areas: Plug & Play BIOS data and the system BIOS data.
|
||||
*/
|
||||
#define UMA_MB_BIOS_BEGIN 0xE0000 /* motherboard BIOS */
|
||||
#define UMA_MB_BIOS_END 0xFFFFF
|
||||
#define UMA_PNP_ESCD_BIOS_BEGIN 0xE0000 /* PnP extended data */
|
||||
#define UMA_PNP_ESCD_BIOS_END 0xEFFFF
|
||||
#define UMA_SYSTEM_BIOS_BEGIN 0xF0000 /* system BIOS */
|
||||
#define UMA_SYSTEM_BIOS_END 0xFFFFF
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/* Description of entry in partition table. */
|
||||
#ifndef _PARTITION_H
|
||||
#define _PARTITION_H
|
||||
|
||||
struct part_entry {
|
||||
unsigned char bootind; /* boot indicator 0/ACTIVE_FLAG */
|
||||
unsigned char start_head; /* head value for first sector */
|
||||
unsigned char start_sec; /* sector value + cyl bits for first sector */
|
||||
unsigned char start_cyl; /* track value for first sector */
|
||||
unsigned char sysind; /* system indicator */
|
||||
unsigned char last_head; /* head value for last sector */
|
||||
unsigned char last_sec; /* sector value + cyl bits for last sector */
|
||||
unsigned char last_cyl; /* track value for last sector */
|
||||
unsigned long lowsec; /* logical first sector */
|
||||
unsigned long size; /* size of partition in sectors */
|
||||
};
|
||||
|
||||
#define ACTIVE_FLAG 0x80 /* value for active in bootind field (hd0) */
|
||||
#define NR_PARTITIONS 4 /* number of entries in partition table */
|
||||
#define PART_TABLE_OFF 0x1BE /* offset of partition table in boot sector */
|
||||
|
||||
/* Partition types. */
|
||||
#define NO_PART 0x00 /* unused entry */
|
||||
#define MINIX_PART 0x81 /* Minix partition type */
|
||||
|
||||
#endif /* _PARTITION_H */
|
||||
@@ -1,145 +0,0 @@
|
||||
/*
|
||||
pci.h
|
||||
|
||||
Created: Jan 2000 by Philip Homburg <philip@cs.vu.nl>
|
||||
*/
|
||||
|
||||
/* Header type 00, normal PCI devices */
|
||||
#define PCI_VID 0x00 /* Vendor ID, 16-bit */
|
||||
#define PCI_DID 0x02 /* Device ID, 16-bit */
|
||||
#define PCI_CR 0x04 /* Command Register, 16-bit */
|
||||
#define PCI_CR_MAST_EN 0x0004 /* Enable Busmaster Access */
|
||||
#define PCI_CR_MEM_EN 0x0002 /* Enable Mem Cycles */
|
||||
#define PCI_CR_IO_EN 0x0001 /* Enable I/O Cycles */
|
||||
#define PCI_SR 0x06 /* PCI status, 16-bit */
|
||||
#define PSR_SSE 0x4000 /* Signaled System Error */
|
||||
#define PSR_RMAS 0x2000 /* Received Master Abort Status */
|
||||
#define PSR_RTAS 0x1000 /* Received Target Abort Status */
|
||||
#define PSR_CAPPTR 0x0010 /* Capabilities list */
|
||||
#define PCI_REV 0x08 /* Revision ID */
|
||||
#define PCI_PIFR 0x09 /* Prog. Interface Register */
|
||||
#define PCI_SCR 0x0A /* Sub-Class Register */
|
||||
#define PCI_BCR 0x0B /* Base-Class Register */
|
||||
#define PCI_CLS 0x0C /* Cache Line Size */
|
||||
#define PCI_LT 0x0D /* Latency Timer */
|
||||
#define PCI_HEADT 0x0E /* Header type, 8-bit */
|
||||
#define PHT_MASK 0x7F /* Header type mask */
|
||||
#define PHT_NORMAL 0x00
|
||||
#define PHT_BRIDGE 0x01
|
||||
#define PHT_CARDBUS 0x02
|
||||
#define PHT_MULTIFUNC 0x80 /* Multiple functions */
|
||||
#define PCI_BIST 0x0F /* Built-in Self Test */
|
||||
#define PCI_BAR 0x10 /* Base Address Register */
|
||||
#define PCI_BAR_IO 0x00000001 /* Reg. refers to I/O space */
|
||||
#define PCI_BAR_TYPE 0x00000006 /* Memory BAR type */
|
||||
#define PCI_TYPE_32 0x00000000 /* 32-bit BAR */
|
||||
#define PCI_TYPE_32_1M 0x00000002 /* 32-bit below 1MB (legacy) */
|
||||
#define PCI_TYPE_64 0x00000004 /* 64-bit BAR */
|
||||
#define PCI_BAR_PREFETCH 0x00000008 /* Memory is prefetchable */
|
||||
#define PCI_BAR_2 0x14 /* Base Address Register */
|
||||
#define PCI_BAR_3 0x18 /* Base Address Register */
|
||||
#define PCI_BAR_4 0x1C /* Base Address Register */
|
||||
#define PCI_BAR_5 0x20 /* Base Address Register */
|
||||
#define PCI_BAR_6 0x24 /* Base Address Register */
|
||||
#define PCI_CBCISPTR 0x28 /* Cardbus CIS Pointer */
|
||||
#define PCI_SUBVID 0x2C /* Subsystem Vendor ID */
|
||||
#define PCI_SUBDID 0x2E /* Subsystem Device ID */
|
||||
#define PCI_EXPROM 0x30 /* Expansion ROM Base Address */
|
||||
#define PCI_CAPPTR 0x34 /* Capabilities Pointer */
|
||||
#define PCI_CP_MASK 0xfc /* Lower 2 bits should be ignored */
|
||||
#define PCI_ILR 0x3C /* Interrupt Line Register */
|
||||
#define PCI_ILR_UNKNOWN 0xFF /* IRQ is unassigned or unknown */
|
||||
#define PCI_IPR 0x3D /* Interrupt Pin Register */
|
||||
#define PCI_MINGNT 0x3E /* Min Grant */
|
||||
#define PCI_MAXLAT 0x3F /* Max Latency */
|
||||
|
||||
/* Header type 01, PCI-to-PCI bridge devices */
|
||||
/* The following registers are in common with type 00:
|
||||
* PCI_VID, PCI_DID, PCI_CR, PCI_SR, PCI_REV, PCI_PIFR, PCI_SCR, PCI_BCR,
|
||||
* PCI_CLS, PCI_LT, PCI_HEADT, PCI_BIST, PCI_BAR, PCI_BAR2, PCI_CAPPTR,
|
||||
* PCI_ILR, PCI_IPR.
|
||||
*/
|
||||
#define PPB_PRIMBN 0x18 /* Primary Bus Number */
|
||||
#define PPB_SECBN 0x19 /* Secondary Bus Number */
|
||||
#define PPB_SUBORDBN 0x1A /* Subordinate Bus Number */
|
||||
#define PPB_SECBLT 0x1B /* Secondary Bus Latency Timer */
|
||||
#define PPB_IOBASE 0x1C /* I/O Base */
|
||||
#define PPB_IOB_MASK 0xf0
|
||||
#define PPB_IOLIMIT 0x1D /* I/O Limit */
|
||||
#define PPB_IOL_MASK 0xf0
|
||||
#define PPB_SSTS 0x1E /* Secondary Status Register */
|
||||
#define PPB_MEMBASE 0x20 /* Memory Base */
|
||||
#define PPB_MEMB_MASK 0xfff0
|
||||
#define PPB_MEMLIMIT 0x22 /* Memory Limit */
|
||||
#define PPB_MEML_MASK 0xfff0
|
||||
#define PPB_PFMEMBASE 0x24 /* Prefetchable Memory Base */
|
||||
#define PPB_PFMEMB_MASK 0xfff0
|
||||
#define PPB_PFMEMLIMIT 0x26 /* Prefetchable Memory Limit */
|
||||
#define PPB_PFMEML_MASK 0xfff0
|
||||
#define PPB_PFMBU32 0x28 /* Prefetchable Memory Base Upper 32 */
|
||||
#define PPB_PFMLU32 0x2C /* Prefetchable Memory Limit Upper 32 */
|
||||
#define PPB_IOBASEU16 0x30 /* I/O Base Upper 16 */
|
||||
#define PPB_IOLIMITU16 0x32 /* I/O Limit Upper 16 */
|
||||
#define PPB_EXPROM 0x38 /* Expansion ROM Base Address */
|
||||
#define PPB_BRIDGECTRL 0x3E /* Bridge Control */
|
||||
#define PPB_BC_CRST 0x40 /* Assert reset line */
|
||||
|
||||
/* Header type 02, Cardbus bridge devices */
|
||||
/* The following registers are in common with type 00:
|
||||
* PCI_VID, PCI_DID, PCI_CR, PCI_SR, PCI_REV, PCI_PIFR, PCI_SCR, PCI_BCR,
|
||||
* PCI_CLS, PCI_LT, PCI_HEADT, PCI_BIST, PCI_BAR, PCI_ILR, PCI_IPR.
|
||||
*/
|
||||
/* The following registers are in common with type 01:
|
||||
* PPB_PRIMBN, PPB_SECBN, PPB_SUBORDBN, PPB_SECBLT.
|
||||
*/
|
||||
#define CBB_CAPPTR 0x14 /* Capability Pointer */
|
||||
#define CBB_SSTS 0x16 /* Secondary Status Register */
|
||||
#define CBB_MEMBASE_0 0x1C /* Memory Base 0 */
|
||||
#define CBB_MEMLIMIT_0 0x20 /* Memory Limit 0 */
|
||||
#define CBB_MEML_MASK 0xfffff000
|
||||
#define CBB_MEMBASE_1 0x24 /* Memory Base 1 */
|
||||
#define CBB_MEMLIMIT_1 0x28 /* Memory Limit 1 */
|
||||
#define CBB_IOBASE_0 0x2C /* I/O Base 0 */
|
||||
#define CBB_IOLIMIT_0 0x30 /* I/O Limit 0 */
|
||||
#define CBB_IOL_MASK 0xfffffffc
|
||||
#define CBB_IOBASE_1 0x34 /* I/O Base 1 */
|
||||
#define CBB_IOLIMIT_1 0x38 /* I/O Limit 1 */
|
||||
#define CBB_BRIDGECTRL 0x3E /* Bridge Control */
|
||||
#define CBB_BC_INTEXCA 0x80 /* Interrupt are routed to ExCAs */
|
||||
#define CBB_BC_CRST 0x40 /* Assert reset line */
|
||||
|
||||
#define CAP_TYPE 0x00 /* Type field in capability */
|
||||
#define CAP_NEXT 0x01 /* Next field in capability */
|
||||
|
||||
#define PCI_BCR_MASS_STORAGE 0x01 /* Mass Storage class */
|
||||
#define PCI_MS_IDE 0x01 /* IDE storage class */
|
||||
#define PCI_IDE_PRI_NATIVE 0x01 /* Primary channel is
|
||||
* in native mode.
|
||||
*/
|
||||
#define PCI_IDE_SEC_NATIVE 0x04 /* Secondary channel is
|
||||
* in native mode.
|
||||
*/
|
||||
|
||||
/* Device type values as ([PCI_BCR] << 16) | ([PCI_SCR] << 8) | [PCI_PIFR] */
|
||||
#define PCI_T3_VGA_OLD 0x000100 /* OLD VGA class code */
|
||||
#define PCI_T3_RAID 0x010400 /* RAID controller */
|
||||
#define PCI_T3_AHCI 0x010601 /* AHCI controller */
|
||||
#define PCI_T3_VGA 0x030000 /* VGA-compatible video card */
|
||||
#define PCI_T3_ISA 0x060100 /* ISA bridge */
|
||||
#define PCI_T3_PCI2PCI 0x060400 /* PCI-to-PCI Bridge device */
|
||||
#define PCI_T3_PCI2PCI_SUBTR 0x060401 /* Subtr. PCI-to-PCI Bridge */
|
||||
#define PCI_T3_CARDBUS 0x060700 /* Bardbus Bridge */
|
||||
|
||||
#define NO_VID 0xffff /* No PCI card present */
|
||||
|
||||
/* Capabilities */
|
||||
#define CAP_T_SECURE_DEV 0x0f /* (AMD) Secure device
|
||||
* capability
|
||||
*/
|
||||
#define CAP_SD_INFO 2 /* Offset from CAP ptr */
|
||||
#define CAP_SD_SUBTYPE_MASK 0x0f /* Mask for subtype */
|
||||
#define CAP_T_SD_DEV 0 /* AMD DEV */
|
||||
|
||||
/*
|
||||
* $PchId: pci.h,v 1.4 2001/12/06 20:21:22 philip Exp $
|
||||
*/
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
pci_amd.h
|
||||
|
||||
Created: Nov 2001 by Philip Homburg <philip@cs.vu.nl>
|
||||
*/
|
||||
|
||||
#define AMD_ISABR_FUNC 3 /* Registers are in function 3 */
|
||||
#define AMD_ISABR_PCIIRQ_LEV 0x54
|
||||
#define AMD_PCILEV_INTA 0x1
|
||||
#define AMD_PCILEV_INTB 0x2
|
||||
#define AMD_PCILEV_INTC 4x2
|
||||
#define AMD_PCILEV_INTD 4x8
|
||||
#define AMD_ISABR_PCIIRQ_ROUTE 0x56
|
||||
#define AMD_PCIIRQ_INTA_MASK 0x000F
|
||||
#define AMD_PCIIRQ_INTB_MASK 0x00F0
|
||||
#define AMD_PCIIRQ_INTC_MASK 0x0F00
|
||||
#define AMD_PCIIRQ_INTD_MASK 0xF000
|
||||
|
||||
/*
|
||||
* $PchId: pci_amd.h,v 1.1 2001/11/09 19:57:37 philip Exp $
|
||||
*/
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
pci_intel.h
|
||||
|
||||
Created: Jan 2000 by Philip Homburg <philip@cs.vu.nl>
|
||||
*/
|
||||
|
||||
#define PCII_CONFADD 0xCF8
|
||||
#define PCIIC_CODE 0x80000000
|
||||
#define PCIIC_BUSNUM_MASK 0xff0000
|
||||
#define PCIIC_BUSNUM_SHIFT 16
|
||||
#define PCIIC_DEVNUM_MASK 0xf800
|
||||
#define PCIIC_DEVNUM_SHIFT 11
|
||||
#define PCIIC_FUNCNUM_MASK 0x700
|
||||
#define PCIIC_FUNCNUM_SHIFT 8
|
||||
#define PCIIC_REGNUM_MASK 0xfc
|
||||
#define PCIIC_REGNUM_SHIFT 2
|
||||
#define PCII_CONFDATA 0xCFC
|
||||
|
||||
#define PCII_SELREG_(bus, dev, func, reg) \
|
||||
(PCIIC_CODE | \
|
||||
(((bus) << PCIIC_BUSNUM_SHIFT) & PCIIC_BUSNUM_MASK) | \
|
||||
(((dev) << PCIIC_DEVNUM_SHIFT) & PCIIC_DEVNUM_MASK) | \
|
||||
(((func) << PCIIC_FUNCNUM_SHIFT) & PCIIC_FUNCNUM_MASK) | \
|
||||
((((reg)/4) << PCIIC_REGNUM_SHIFT) & PCIIC_REGNUM_MASK))
|
||||
#define PCII_UNSEL (0)
|
||||
|
||||
#define PCII_RREG8_(bus, dev, func, reg) \
|
||||
(pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
|
||||
pci_inb(PCII_CONFDATA+((reg)&3)))
|
||||
#define PCII_RREG16_(bus, dev, func, reg) \
|
||||
(pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
|
||||
pci_inw(PCII_CONFDATA+((reg)&2)))
|
||||
#define PCII_RREG32_(bus, dev, func, reg) \
|
||||
(pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
|
||||
pci_inl(PCII_CONFDATA))
|
||||
|
||||
#define PCII_WREG8_(bus, dev, func, reg, val) \
|
||||
(pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
|
||||
pci_outb(PCII_CONFDATA+((reg)&3), (val)))
|
||||
#define PCII_WREG16_(bus, dev, func, reg, val) \
|
||||
(pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
|
||||
pci_outw(PCII_CONFDATA+((reg)&2), (val)))
|
||||
#define PCII_WREG32_(bus, dev, func, reg, val) \
|
||||
(pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
|
||||
pci_outl(PCII_CONFDATA, (val)))
|
||||
|
||||
/* PIIX configuration registers */
|
||||
#define PIIX_PIRQRCA 0x60
|
||||
#define PIIX_IRQ_DI 0x80
|
||||
#define PIIX_IRQ_MASK 0x0F
|
||||
|
||||
/* PIIX extensions to the PIC */
|
||||
#define PIIX_ELCR1 0x4D0
|
||||
#define PIIX_ELCR2 0x4D1
|
||||
|
||||
/*
|
||||
* $PchId: pci_intel.h,v 1.1 2000/08/12 11:20:17 philip Exp $
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
pci_sis.h
|
||||
|
||||
Created: Nov 2001 by Philip Homburg <philip@cs.vu.nl>
|
||||
*/
|
||||
|
||||
/* Constants are taken from pci-irq.c in the Linux kernel source */
|
||||
#define SIS_ISABR_IRQ_A 0x41 /* IRQA routing */
|
||||
#define SIS_ISABR_IRQ_B 0x42 /* IRQB routing */
|
||||
#define SIS_ISABR_IRQ_C 0x43 /* IRQC routing */
|
||||
#define SIS_ISABR_IRQ_D 0x44 /* IRQD routing */
|
||||
#define SIS_IRQ_DISABLED 0x80
|
||||
#define SIS_IRQ_MASK 0x0F
|
||||
|
||||
/*
|
||||
* $PchId: pci_sis.h,v 1.1 2001/12/06 20:22:52 philip Exp $
|
||||
*/
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
pci_via.h
|
||||
|
||||
Created: Jun 2001 by Philip Homburg <philip@cs.vu.nl>
|
||||
*/
|
||||
|
||||
#define VIA_ISABR_EL 0x54 /* Edge or level triggered */
|
||||
#define VIA_ISABR_EL_INTA 0x08 /* Edge (1) or level (0) */
|
||||
#define VIA_ISABR_EL_INTB 0x04
|
||||
#define VIA_ISABR_EL_INTC 0x02
|
||||
#define VIA_ISABR_EL_INTD 0x01
|
||||
|
||||
#define VIA_ISABR_IRQ_R1 0x55 /* IRQ routing 1 */
|
||||
#define VIA_ISABR_IRQ_INTD 0xf0 /* routing for INTD */
|
||||
#define VIA_ISABR_IRQ_INT0 0x0f /* routing for INT0 */
|
||||
#define VIA_ISABR_IRQ_R2 0x56 /* IRQ routing 2 */
|
||||
#define VIA_ISABR_IRQ_INTA 0xf0 /* routing for INTA */
|
||||
#define VIA_ISABR_IRQ_INTB 0x0f /* routing for INTB */
|
||||
#define VIA_ISABR_IRQ_R3 0x57 /* IRQ routing 3 */
|
||||
#define VIA_ISABR_IRQ_INTC 0xf0 /* routing for INTC */
|
||||
#define VIA_ISABR_IRQ_INT1 0x0f /* routing for INT1 */
|
||||
#define VIA_ISABR_IRQ_R4 0x58 /* IRQ routing 4 */
|
||||
#define VIA_ISABR_IRQ_INT2 0x0f /* routing for INT2 */
|
||||
|
||||
/*
|
||||
* $PchId: pci_via.h,v 1.1 2001/06/20 15:50:25 philip Exp $
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/* Addresses and magic numbers for miscellaneous ports. */
|
||||
|
||||
#ifndef _PORTS_H
|
||||
#define _PORTS_H
|
||||
|
||||
#if (CHIP == INTEL)
|
||||
|
||||
/* Miscellaneous ports. */
|
||||
#define PCR 0x65 /* Planar Control Register */
|
||||
#define PORT_B 0x61 /* I/O port for 8255 port B (kbd, beeper...) */
|
||||
#define TIMER0 0x40 /* I/O port for timer channel 0 */
|
||||
#define TIMER2 0x42 /* I/O port for timer channel 2 */
|
||||
#define TIMER_MODE 0x43 /* I/O port for timer mode control */
|
||||
|
||||
#endif /* (CHIP == INTEL) */
|
||||
|
||||
#endif /* _PORTS_H */
|
||||
@@ -1,36 +0,0 @@
|
||||
#ifndef STACK_FRAME_H
|
||||
#define STACK_FRAME_H
|
||||
|
||||
typedef unsigned reg_t; /* machine register */
|
||||
typedef reg_t segdesc_t;
|
||||
|
||||
/* The stack frame layout is determined by the software, but for efficiency
|
||||
* it is laid out so the assembly code to use it is as simple as possible.
|
||||
* 80286 protected mode and all real modes use the same frame, built with
|
||||
* 16-bit registers. Real mode lacks an automatic stack switch, so little
|
||||
* is lost by using the 286 frame for it. The 386 frame differs only in
|
||||
* having 32-bit registers and more segment registers. The same names are
|
||||
* used for the larger registers to avoid differences in the code.
|
||||
*/
|
||||
struct stackframe_s {
|
||||
u16_t gs; /* last item pushed by save */
|
||||
u16_t fs; /* ^ */
|
||||
u16_t es; /* | */
|
||||
u16_t ds; /* | */
|
||||
reg_t di; /* di through cx are not accessed in C */
|
||||
reg_t si; /* order is to match pusha/popa */
|
||||
reg_t fp; /* bp */
|
||||
reg_t st; /* hole for another copy of sp */
|
||||
reg_t bx; /* | */
|
||||
reg_t dx; /* | */
|
||||
reg_t cx; /* | */
|
||||
reg_t retreg; /* ax and above are all pushed by save */
|
||||
reg_t retadr; /* return address for assembly code save() */
|
||||
reg_t pc; /* ^ last item pushed by interrupt */
|
||||
reg_t cs; /* | */
|
||||
reg_t psw; /* | */
|
||||
reg_t sp; /* | */
|
||||
reg_t ss; /* these are pushed by CPU during interrupt */
|
||||
};
|
||||
|
||||
#endif /* #ifndef STACK_FRAME_H */
|
||||
@@ -1,98 +0,0 @@
|
||||
#ifndef __SYS_VM_386_H__
|
||||
#define __SYS_VM_386_H__
|
||||
/*
|
||||
i386/vm.h
|
||||
*/
|
||||
|
||||
#define I386_PAGE_SIZE 4096
|
||||
#define I386_BIG_PAGE_SIZE (I386_PAGE_SIZE*I386_VM_PT_ENTRIES)
|
||||
|
||||
/* i386 paging constants */
|
||||
#define I386_VM_PRESENT 0x001 /* Page is present */
|
||||
#define I386_VM_WRITE 0x002 /* Read/write access allowed */
|
||||
#define I386_VM_USER 0x004 /* User access allowed */
|
||||
#define I386_VM_PWT 0x008 /* Write through */
|
||||
#define I386_VM_PCD 0x010 /* Cache disable */
|
||||
#define I386_VM_ACC 0x020 /* Accessed */
|
||||
#define I386_VM_ADDR_MASK 0xFFFFF000 /* physical address */
|
||||
#define I386_VM_ADDR_MASK_4MB 0xFFC00000 /* physical address */
|
||||
#define I386_VM_OFFSET_MASK_4MB 0x003FFFFF /* physical address */
|
||||
|
||||
/* Page directory specific flags. */
|
||||
#define I386_VM_BIGPAGE 0x080 /* 4MB page */
|
||||
|
||||
/* Page table specific flags. */
|
||||
#define I386_VM_DIRTY (1L<< 6) /* Dirty */
|
||||
#define I386_VM_PS (1L<< 7) /* Page size. */
|
||||
#define I386_VM_GLOBAL (1L<< 8) /* Global. */
|
||||
#define I386_VM_PTAVAIL1 (1L<< 9) /* Available for use. */
|
||||
#define I386_VM_PTAVAIL2 (1L<<10) /* Available for use. */
|
||||
#define I386_VM_PTAVAIL3 (1L<<11) /* Available for use. */
|
||||
|
||||
#define I386_VM_PT_ENT_SIZE 4 /* Size of a page table entry */
|
||||
#define I386_VM_DIR_ENTRIES 1024 /* Number of entries in a page dir */
|
||||
#define I386_VM_DIR_ENT_SHIFT 22 /* Shift to get entry in page dir. */
|
||||
#define I386_VM_PT_ENT_SHIFT 12 /* Shift to get entry in page table */
|
||||
#define I386_VM_PT_ENT_MASK 0x3FF /* Mask to get entry in page table */
|
||||
#define I386_VM_PT_ENTRIES 1024 /* Number of entries in a page table */
|
||||
#define I386_VM_PFA_SHIFT 22 /* Page frame address shift */
|
||||
|
||||
/* CR0 bits */
|
||||
#define I386_CR0_PE 0x00000001 /* Protected mode */
|
||||
#define I386_CR0_MP 0x00000002 /* Monitor Coprocessor */
|
||||
#define I386_CR0_EM 0x00000004 /* Emulate */
|
||||
#define I386_CR0_TS 0x00000008 /* Task Switched */
|
||||
#define I386_CR0_ET 0x00000010 /* Extension Type */
|
||||
#define I386_CR0_WP 0x00010000 /* Enable paging */
|
||||
#define I386_CR0_PG 0x80000000 /* Enable paging */
|
||||
|
||||
/* some CR4 bits */
|
||||
#define I386_CR4_VME 0x00000001 /* Virtual 8086 */
|
||||
#define I386_CR4_PVI 0x00000002 /* Virtual ints */
|
||||
#define I386_CR4_TSD 0x00000004 /* RDTSC privileged */
|
||||
#define I386_CR4_DE 0x00000008 /* Debugging extensions */
|
||||
#define I386_CR4_PSE 0x00000010 /* Page size extensions */
|
||||
#define I386_CR4_PAE 0x00000020 /* Physical addr extens. */
|
||||
#define I386_CR4_MCE 0x00000040 /* Machine check enable */
|
||||
#define I386_CR4_PGE 0x00000080 /* Global page flag enable */
|
||||
|
||||
/* i386 paging 'functions' */
|
||||
#define I386_VM_PTE(v) (((v) >> I386_VM_PT_ENT_SHIFT) & I386_VM_PT_ENT_MASK)
|
||||
#define I386_VM_PDE(v) ( (v) >> I386_VM_DIR_ENT_SHIFT)
|
||||
#define I386_VM_PFA(e) ( (e) & I386_VM_ADDR_MASK)
|
||||
#define I386_VM_PAGE(v) ( (v) >> I386_VM_PFA_SHIFT)
|
||||
|
||||
/* i386 pagefault error code bits */
|
||||
#define I386_VM_PFE_P 0x01 /* Pagefault caused by non-present page.
|
||||
* (otherwise protection violation.)
|
||||
*/
|
||||
#define I386_VM_PFE_W 0x02 /* Caused by write (otherwise read) */
|
||||
#define I386_VM_PFE_U 0x04 /* CPU in user mode (otherwise supervisor) */
|
||||
|
||||
/* CPUID flags */
|
||||
#define CPUID1_EDX_FPU (1L) /* FPU presence */
|
||||
#define CPUID1_EDX_PSE (1L << 3) /* Page Size Extension */
|
||||
#define CPUID1_EDX_PGE (1L << 13) /* Page Global (bit) Enable */
|
||||
#define CPUID1_EDX_APIC_ON_CHIP (1L << 9) /* APIC is present on the chip */
|
||||
#define CPUID1_EDX_TSC (1L << 4) /* Timestamp counter present */
|
||||
#define CPUID1_EDX_HTT (1L << 28) /* Supports HTT */
|
||||
#define CPUID1_EDX_FXSR (1L << 24)
|
||||
#define CPUID1_EDX_SSE (1L << 25)
|
||||
#define CPUID1_EDX_SSE2 (1L << 26)
|
||||
#define CPUID1_ECX_SSE3 (1L)
|
||||
#define CPUID1_ECX_SSSE3 (1L << 9)
|
||||
#define CPUID1_ECX_SSE4_1 (1L << 19)
|
||||
#define CPUID1_ECX_SSE4_2 (1L << 20)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <minix/type.h>
|
||||
|
||||
/* structure used by VM to pass data to the kernel while enabling paging */
|
||||
struct vm_ep_data {
|
||||
struct mem_map * mem_map;
|
||||
vir_bytes data_seg_limit;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* __SYS_VM_386_H__ */
|
||||
@@ -1,76 +0,0 @@
|
||||
/* The <minix/ansi.h> header attempts to decide whether the compiler has enough
|
||||
* conformance to Standard C for Minix to take advantage of. If so, the
|
||||
* symbol _ANSI is defined (as 31459). Otherwise _ANSI is not defined
|
||||
* here, but it may be defined by applications that want to bend the rules.
|
||||
* The magic number in the definition is to inhibit unnecessary bending
|
||||
* of the rules. (For consistency with the new '#ifdef _ANSI" tests in
|
||||
* the headers, _ANSI should really be defined as nothing, but that would
|
||||
* break many library routines that use "#if _ANSI".)
|
||||
|
||||
* If _ANSI ends up being defined, a macro
|
||||
*
|
||||
* _PROTOTYPE(function, params)
|
||||
*
|
||||
* is defined. This macro expands in different ways, generating either
|
||||
* ANSI Standard C prototypes or old-style K&R (Kernighan & Ritchie)
|
||||
* prototypes, as needed. Finally, some programs use _CONST, _VOIDSTAR etc
|
||||
* in such a way that they are portable over both ANSI and K&R compilers.
|
||||
* The appropriate macros are defined here.
|
||||
*/
|
||||
|
||||
#ifndef _MINIX_ANSI_H
|
||||
#define _MINIX_ANSI_H
|
||||
|
||||
#if __STDC__ == 1
|
||||
#define _ANSI 31459 /* compiler claims full ANSI conformance */
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */
|
||||
#endif
|
||||
|
||||
#define _VOIDSTAR void *
|
||||
#define _VOID void
|
||||
|
||||
#ifdef _ANSI
|
||||
|
||||
/* Keep everything for ANSI prototypes. */
|
||||
#define _PROTOTYPE(function, params) function params
|
||||
#define _ARGS(params) params
|
||||
|
||||
#define _CONST const
|
||||
#define _VOLATILE volatile
|
||||
#define _SIZET size_t
|
||||
|
||||
#else
|
||||
|
||||
/* Throw away the parameters for K&R prototypes. */
|
||||
#define _PROTOTYPE(function, params) function()
|
||||
#define _ARGS(params) ()
|
||||
|
||||
#define _CONST
|
||||
#define _VOLATILE
|
||||
#define _SIZET int
|
||||
|
||||
#endif /* _ANSI */
|
||||
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
|
||||
#define __LONG_LONG_SUPPORTED 1
|
||||
#endif
|
||||
|
||||
/* This should be defined as restrict when a C99 compiler is used. */
|
||||
#define _RESTRICT
|
||||
|
||||
/* Setting any of _MINIX, _POSIX_C_SOURCE or _POSIX2_SOURCE implies
|
||||
* _POSIX_SOURCE. (Seems wrong to put this here in ANSI space.)
|
||||
*/
|
||||
#if defined(_MINIX) || _POSIX_C_SOURCE > 0 || defined(_POSIX2_SOURCE)
|
||||
#undef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE 1
|
||||
#endif
|
||||
|
||||
/* What is a va_list? */
|
||||
#include <stdarg.h>
|
||||
#define _BSD_VA_LIST_ va_list
|
||||
|
||||
#endif /* _MINIX_ANSI_H */
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef _BITMAP_H
|
||||
#define _BITMAP_H
|
||||
|
||||
/* Bit map operations to manipulate bits of a simple mask variable. */
|
||||
#define bit_set(mask, n) ((mask) |= (1 << (n)))
|
||||
#define bit_unset(mask, n) ((mask) &= ~(1 << (n)))
|
||||
#define bit_isset(mask, n) ((mask) & (1 << (n)))
|
||||
#define bit_empty(mask) ((mask) = 0)
|
||||
#define bit_fill(mask) ((mask) = ~0)
|
||||
|
||||
/* Definitions previously in kernel/const.h */
|
||||
#define BITCHUNK_BITS (sizeof(bitchunk_t) * CHAR_BIT)
|
||||
#define BITMAP_CHUNKS(nr_bits) (((nr_bits)+BITCHUNK_BITS-1)/BITCHUNK_BITS)
|
||||
#define MAP_CHUNK(map,bit) (map)[((bit)/BITCHUNK_BITS)]
|
||||
#define CHUNK_OFFSET(bit) ((bit)%BITCHUNK_BITS)
|
||||
#define GET_BIT(map,bit) ( MAP_CHUNK(map,bit) & (1 << CHUNK_OFFSET(bit) ))
|
||||
#define SET_BIT(map,bit) ( MAP_CHUNK(map,bit) |= (1 << CHUNK_OFFSET(bit) ))
|
||||
#define UNSET_BIT(map,bit) ( MAP_CHUNK(map,bit) &= ~(1 << CHUNK_OFFSET(bit) ))
|
||||
|
||||
#endif /* _BITMAP_H */
|
||||
@@ -1,121 +0,0 @@
|
||||
#define NCALLS 113 /* number of system calls allowed */
|
||||
|
||||
#define EXIT 1
|
||||
#define FORK 2
|
||||
#define READ 3
|
||||
#define WRITE 4
|
||||
#define OPEN 5
|
||||
#define CLOSE 6
|
||||
#define WAIT 7
|
||||
#define CREAT 8
|
||||
#define LINK 9
|
||||
#define UNLINK 10
|
||||
#define WAITPID 11
|
||||
#define CHDIR 12
|
||||
#define TIME 13
|
||||
#define MKNOD 14
|
||||
#define CHMOD 15
|
||||
#define CHOWN 16
|
||||
#define BRK 17
|
||||
#define STAT 18
|
||||
#define LSEEK 19
|
||||
#define MINIX_GETPID 20
|
||||
#define MOUNT 21
|
||||
#define UMOUNT 22
|
||||
#define SETUID 23
|
||||
#define GETUID 24
|
||||
#define STIME 25
|
||||
#define PTRACE 26
|
||||
#define ALARM 27
|
||||
#define FSTAT 28
|
||||
#define PAUSE 29
|
||||
#define UTIME 30
|
||||
#define ACCESS 33
|
||||
#define SYNC 36
|
||||
#define KILL 37
|
||||
#define RENAME 38
|
||||
#define MKDIR 39
|
||||
#define RMDIR 40
|
||||
#define DUP 41
|
||||
#define PIPE 42
|
||||
#define TIMES 43
|
||||
#define SYMLINK 45
|
||||
#define SETGID 46
|
||||
#define GETGID 47
|
||||
#define SIGNAL 48
|
||||
#define RDLNK 49
|
||||
#define LSTAT 50
|
||||
#define IOCTL 54
|
||||
#define FCNTL 55
|
||||
#define FS_READY 57
|
||||
#define EXEC 59
|
||||
#define UMASK 60
|
||||
#define CHROOT 61
|
||||
#define SETSID 62
|
||||
#define GETPGRP 63
|
||||
#define ITIMER 64
|
||||
#define GETGROUPS 65
|
||||
#define SETGROUPS 66
|
||||
#define GETMCONTEXT 67
|
||||
#define SETMCONTEXT 68
|
||||
|
||||
/* Posix signal handling. */
|
||||
#define SIGACTION 71
|
||||
#define SIGSUSPEND 72
|
||||
#define SIGPENDING 73
|
||||
#define SIGPROCMASK 74
|
||||
#define SIGRETURN 75
|
||||
|
||||
#define REBOOT 76
|
||||
#define SVRCTL 77
|
||||
#define SYSUNAME 78
|
||||
#define GETSYSINFO 79 /* to PM or VFS (obsolete) */
|
||||
#define GETDENTS 80 /* to VFS */
|
||||
#define LLSEEK 81 /* to VFS */
|
||||
#define FSTATFS 82 /* to VFS */
|
||||
#define STATVFS 83 /* to VFS */
|
||||
#define FSTATVFS 84 /* to VFS */
|
||||
#define SELECT 85 /* to VFS */
|
||||
#define FCHDIR 86 /* to VFS */
|
||||
#define FSYNC 87 /* to VFS */
|
||||
#define GETPRIORITY 88 /* to PM */
|
||||
#define SETPRIORITY 89 /* to PM */
|
||||
#define GETTIMEOFDAY 90 /* to PM */
|
||||
#define SETEUID 91 /* to PM */
|
||||
#define SETEGID 92 /* to PM */
|
||||
#define TRUNCATE 93 /* to VFS */
|
||||
#define FTRUNCATE 94 /* to VFS */
|
||||
#define FCHMOD 95 /* to VFS */
|
||||
#define FCHOWN 96 /* to VFS */
|
||||
#define GETSYSINFO_UP 97 /* to PM (obsolete) */
|
||||
#define SPROF 98 /* to PM */
|
||||
#define CPROF 99 /* to PM */
|
||||
|
||||
/* Calls provided by PM and FS that are not part of the API */
|
||||
#define EXEC_NEWMEM 100 /* from VFS or RS to PM: new memory map for
|
||||
* exec
|
||||
*/
|
||||
#define SRV_FORK 101 /* to PM: special fork call for RS */
|
||||
#define EXEC_RESTART 102 /* to PM: final part of exec for RS */
|
||||
#define PROCSTAT 103 /* to PM */
|
||||
#define GETPROCNR 104 /* to PM */
|
||||
|
||||
#define GETEPINFO 107 /* to PM: get pid/uid/gid of an endpoint */
|
||||
#define ADDDMA 108 /* to PM: inform PM about a region of memory
|
||||
* that is used for bus-master DMA
|
||||
*/
|
||||
#define DELDMA 109 /* to PM: inform PM that a region of memory
|
||||
* that is no longer used for bus-master DMA
|
||||
*/
|
||||
#define GETDMA 110 /* to PM: ask PM for a region of memory
|
||||
* that should not be used for bus-master DMA
|
||||
* any longer
|
||||
*/
|
||||
#define SRV_KILL 111 /* to PM: special kill call for RS */
|
||||
|
||||
#define GCOV_FLUSH 112 /* flush gcov data from server to gcov files */
|
||||
|
||||
#define TASK_REPLY 121 /* to VFS: reply code from drivers, not
|
||||
* really a standalone call.
|
||||
*/
|
||||
#define MAPDRIVER 122 /* to VFS, map a device */
|
||||
1189
include/minix/com.h
1189
include/minix/com.h
File diff suppressed because it is too large
Load Diff
@@ -1,49 +0,0 @@
|
||||
/* Definitions for compiler-specific features. */
|
||||
|
||||
#ifndef _MINIX_COMPILER_H
|
||||
#define _MINIX_COMPILER_H
|
||||
|
||||
/*===========================================================================*
|
||||
* Compiler overrides *
|
||||
*===========================================================================*/
|
||||
/* ACK */
|
||||
#ifdef __ACK__
|
||||
#include <minix/compiler-ack.h>
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
* Default values *
|
||||
*===========================================================================*/
|
||||
/*
|
||||
* cdecl calling convention expects the callee to pop the hidden pointer on
|
||||
* struct return. For example, GCC and LLVM comply with this (tested on IA32).
|
||||
*/
|
||||
#ifndef BYTES_TO_POP_ON_STRUCT_RETURN
|
||||
#define BYTES_TO_POP_ON_STRUCT_RETURN $4
|
||||
#endif
|
||||
|
||||
/*
|
||||
* cdecl calling convention requires to push arguments on the stack in a
|
||||
* reverse order to easily support variadic arguments. Thus, instead of
|
||||
* using the proper stdarg.h macros (that nowadays are
|
||||
* compiler-dependant), it may be tempting to directly take the address of
|
||||
* the last argument and considering it as the start of an array. This is
|
||||
* a shortcut that avoid looping to get all the arguments as the CPU
|
||||
* already pushed them on the stack before the call to the function.
|
||||
*
|
||||
* Unfortunately, such an assumption is strictly compiler-dependant and
|
||||
* compilers are free to move the last argument on the stack, as a local
|
||||
* variable, and return the address of the location where the argument was
|
||||
* stored, if asked for. This will break things as the rest of the array's
|
||||
* argument are stored elsewhere (typically, a couple of words above the
|
||||
* location where the argument was stored).
|
||||
*
|
||||
* Conclusion: if unsure on what the compiler may do, do not make any
|
||||
* assumption and use the right (typically compiler-dependant) macros.
|
||||
*/
|
||||
|
||||
#ifndef FUNC_ARGS_ARRAY
|
||||
#define FUNC_ARGS_ARRAY 0
|
||||
#endif
|
||||
|
||||
#endif /* _MINIX_COMPILER_H */
|
||||
@@ -1,125 +0,0 @@
|
||||
#ifndef _CONFIG_H
|
||||
#define _CONFIG_H
|
||||
|
||||
/* Minix release and version numbers. */
|
||||
#define OS_RELEASE "3"
|
||||
#define OS_VERSION "1.9"
|
||||
|
||||
/* This file sets configuration parameters for the MINIX kernel, FS, and PM.
|
||||
* It is divided up into two main sections. The first section contains
|
||||
* user-settable parameters. In the second section, various internal system
|
||||
* parameters are set based on the user-settable parameters.
|
||||
*
|
||||
* Parts of config.h have been moved to sys_config.h, which can be included
|
||||
* by other include files that wish to get at the configuration data, but
|
||||
* don't want to pollute the users namespace. Some editable values have
|
||||
* gone there.
|
||||
*
|
||||
*/
|
||||
|
||||
/* The MACHINE (called _MINIX_MACHINE) setting can be done
|
||||
* in <minix/machine.h>.
|
||||
*/
|
||||
#include <minix/sys_config.h>
|
||||
|
||||
#define MACHINE _MINIX_MACHINE
|
||||
|
||||
#define IBM_PC _MACHINE_IBM_PC
|
||||
|
||||
/* Number of slots in the process table for non-kernel processes. The number
|
||||
* of system processes defines how many processes with special privileges
|
||||
* there can be. User processes share the same properties and count for one.
|
||||
*
|
||||
* These can be changed in sys_config.h.
|
||||
*/
|
||||
#define NR_PROCS _NR_PROCS
|
||||
#define NR_SYS_PROCS _NR_SYS_PROCS
|
||||
#define NR_SYS_CHUNKS BITMAP_CHUNKS(NR_SYS_PROCS)
|
||||
|
||||
/* Number of controller tasks (/dev/cN device classes). */
|
||||
#define NR_CTRLRS 2
|
||||
|
||||
/* DMA_SECTORS may be increased to speed up DMA based drivers. */
|
||||
#define DMA_SECTORS 1 /* DMA buffer size (must be >= 1) */
|
||||
|
||||
/* Which processes should receive diagnostics from the kernel and system?
|
||||
* Directly sending it to TTY only displays the output. Sending it to the
|
||||
* log driver will cause the diagnostics to be buffered and displayed.
|
||||
* Messages are sent by src/lib/sysutil/kputc.c to these processes, in
|
||||
* the order of this array, which must be terminated by NONE. This is used
|
||||
* by drivers and servers that printf().
|
||||
* The kernel does this for its own kprintf() in kernel/utility.c, also using
|
||||
* this array, but a slightly different mechanism.
|
||||
*/
|
||||
#define OUTPUT_PROCS_ARRAY { TTY_PROC_NR, LOG_PROC_NR, NONE }
|
||||
|
||||
/* NR_CONS, NR_RS_LINES, and NR_PTYS determine the number of terminals the
|
||||
* system can handle.
|
||||
*/
|
||||
#define NR_CONS 4 /* # system consoles (1 to 8) */
|
||||
#define NR_RS_LINES 4 /* # rs232 terminals (0 to 4) */
|
||||
#define NR_PTYS 32 /* # pseudo terminals (0 to 64) */
|
||||
|
||||
/* This feature enable the counting of system calls in PM and FS */
|
||||
#define ENABLE_SYSCALL_STATS 0
|
||||
|
||||
/* Max. number of I/O ranges that can be assigned to a process */
|
||||
#define NR_IO_RANGE 64
|
||||
|
||||
/* Max. number of device memory ranges that can be assigned to a process */
|
||||
#define NR_MEM_RANGE 20
|
||||
|
||||
/* Max. number of IRQs that can be assigned to a process */
|
||||
#define NR_IRQ 8
|
||||
|
||||
/* Scheduling priorities. Values must start at zero (highest
|
||||
* priority) and increment.
|
||||
*/
|
||||
#define NR_SCHED_QUEUES 16 /* MUST equal minimum priority + 1 */
|
||||
#define TASK_Q 0 /* highest, used for kernel tasks */
|
||||
#define MAX_USER_Q 0 /* highest priority for user processes */
|
||||
#define USER_Q ((MIN_USER_Q - MAX_USER_Q) / 2 + MAX_USER_Q) /* default
|
||||
(should correspond to nice 0) */
|
||||
#define MIN_USER_Q (NR_SCHED_QUEUES - 1) /* minimum priority for user
|
||||
processes */
|
||||
/* default scheduling quanta */
|
||||
#define USER_QUANTUM 200
|
||||
|
||||
/* defualt user process cpu */
|
||||
#define USER_DEFAULT_CPU -1 /* use the default cpu or do not change the
|
||||
current one */
|
||||
|
||||
/*===========================================================================*
|
||||
* There are no user-settable parameters after this line *
|
||||
*===========================================================================*/
|
||||
/* Set the CHIP type based on the machine selected. The symbol CHIP is actually
|
||||
* indicative of more than just the CPU. For example, machines for which
|
||||
* CHIP == INTEL are expected to have 8259A interrrupt controllers and the
|
||||
* other properties of IBM PC/XT/AT/386 types machines in general. */
|
||||
#define INTEL _CHIP_INTEL /* CHIP type for PC, XT, AT, 386 and clones */
|
||||
#define M68000 _CHIP_M68000 /* CHIP type for Atari, Amiga, Macintosh */
|
||||
#define SPARC _CHIP_SPARC /* CHIP type for SUN-4 (e.g. SPARCstation) */
|
||||
|
||||
/* Set the FP_FORMAT type based on the machine selected, either hw or sw */
|
||||
#define FP_NONE _FP_NONE /* no floating point support */
|
||||
#define FP_IEEE _FP_IEEE /* conform IEEE floating point standard */
|
||||
|
||||
/* _MINIX_CHIP is defined in sys_config.h. */
|
||||
#define CHIP _MINIX_CHIP
|
||||
|
||||
/* _MINIX_FP_FORMAT is defined in sys_config.h. */
|
||||
#define FP_FORMAT _MINIX_FP_FORMAT
|
||||
|
||||
/* _ASKDEV and _FASTLOAD are defined in sys_config.h. */
|
||||
#define ASKDEV _ASKDEV
|
||||
#define FASTLOAD _FASTLOAD
|
||||
|
||||
/* Enable or disable system profiling. */
|
||||
#define SPROFILE 1 /* statistical profiling */
|
||||
#define CPROFILE 0 /* call profiling */
|
||||
|
||||
/* PCI configuration parameters */
|
||||
#define NR_PCIBUS 40
|
||||
#define NR_PCIDEV 50
|
||||
|
||||
#endif /* _CONFIG_H */
|
||||
@@ -1,195 +0,0 @@
|
||||
#ifndef _MINIX_CONST_H
|
||||
#define _MINIX_CONST_H
|
||||
|
||||
#ifndef CHIP
|
||||
#error CHIP is not defined
|
||||
#endif
|
||||
|
||||
/* The UNUSED annotation tells the compiler or lint not to complain
|
||||
* about an unused variable or function parameter.
|
||||
*
|
||||
* A number of different annotations are used, depending on the
|
||||
* compiler or checker that is looking at the code.
|
||||
*
|
||||
* Note that some variants rename the parameter, so if you use
|
||||
* the parameter after all, you'll get a complaint about a missing
|
||||
* variable.
|
||||
*
|
||||
* You use it like this:
|
||||
*
|
||||
* void foo(int UNUSED(x)){}
|
||||
*/
|
||||
|
||||
#ifndef UNUSED
|
||||
#if defined _lint
|
||||
# define UNUSED(v) /*lint -e(715,818)*/ v
|
||||
#elif defined(__GNUC__)
|
||||
# define UNUSED(v) UNUSED_ ## v __attribute((unused))
|
||||
#elif defined __LCLINT__
|
||||
# define UNUSED(v) /*@unused@*/ v
|
||||
#else
|
||||
# define UNUSED(v) _UNUSED_ ## v
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define EXTERN extern /* used in *.h files */
|
||||
#define PRIVATE static /* PRIVATE x limits the scope of x */
|
||||
#define PUBLIC /* PUBLIC is the opposite of PRIVATE */
|
||||
#define FORWARD static /* some compilers require this to be 'static'*/
|
||||
|
||||
#define TRUE 1 /* used for turning integers into Booleans */
|
||||
#define FALSE 0 /* used for turning integers into Booleans */
|
||||
|
||||
#define DEFAULT_HZ 60 /* clock freq (software settable on IBM-PC) */
|
||||
|
||||
#define SUPER_USER ((uid_t) 0) /* uid_t of superuser */
|
||||
|
||||
#include <sys/null.h> /* NULL Pointer */
|
||||
|
||||
#define SCPVEC_NR 64 /* max # of entries in a SYS_VSAFECOPY* request */
|
||||
#define NR_IOREQS 64
|
||||
/* maximum number of entries in an iorequest */
|
||||
|
||||
/* Message passing constants. */
|
||||
#define MESS_SIZE (sizeof(message)) /* might need usizeof from FS here */
|
||||
|
||||
/* Memory related constants. */
|
||||
#define SEGMENT_TYPE 0xFF00 /* bit mask to get segment type */
|
||||
#define SEGMENT_INDEX 0x00FF /* bit mask to get segment index */
|
||||
|
||||
#define LOCAL_SEG 0x0000 /* flags indicating local memory segment */
|
||||
#define NR_LOCAL_SEGS 3 /* # local segments per process (fixed) */
|
||||
#define T 0 /* proc[i].mem_map[T] is for text */
|
||||
#define D 1 /* proc[i].mem_map[D] is for data */
|
||||
#define S 2 /* proc[i].mem_map[S] is for stack */
|
||||
|
||||
#define REMOTE_SEG 0x0100 /* flags indicating remote memory segment */
|
||||
#define NR_REMOTE_SEGS 3 /* # remote memory regions (variable) */
|
||||
|
||||
#define BIOS_SEG 0x0200 /* flags indicating BIOS memory segment */
|
||||
#define NR_BIOS_SEGS 3 /* # BIOS memory regions (variable) */
|
||||
|
||||
#define PHYS_SEG 0x0400 /* flag indicating entire physical memory */
|
||||
|
||||
#define LOCAL_VM_SEG 0x1000 /* same as LOCAL_SEG, but with vm lookup */
|
||||
#define VM_D (LOCAL_VM_SEG | D)
|
||||
#define VM_T (LOCAL_VM_SEG | T)
|
||||
#define MEM_GRANT 3
|
||||
#define VM_GRANT (LOCAL_VM_SEG | MEM_GRANT)
|
||||
|
||||
/* Labels used to disable code sections for different reasons. */
|
||||
#define DEAD_CODE 0 /* unused code in normal configuration */
|
||||
#define FUTURE_CODE 0 /* new code to be activated + tested later */
|
||||
#define TEMP_CODE 1 /* active code to be removed later */
|
||||
|
||||
/* Process name length in the PM process table, including '\0'. */
|
||||
#define PROC_NAME_LEN 16
|
||||
|
||||
/* Miscellaneous */
|
||||
#define BYTE 0377 /* mask for 8 bits */
|
||||
#define READING 0 /* copy data to user */
|
||||
#define WRITING 1 /* copy data from user */
|
||||
#define HAVE_SCATTERED_IO 1 /* scattered I/O is now standard */
|
||||
|
||||
/* Memory is allocated in clicks. */
|
||||
#if (CHIP == INTEL)
|
||||
#define CLICK_SIZE 4096 /* unit in which memory is allocated */
|
||||
#define CLICK_SHIFT 12 /* log2 of CLICK_SIZE */
|
||||
#endif
|
||||
|
||||
#if (CHIP == SPARC) || (CHIP == M68000)
|
||||
#define CLICK_SIZE 4096 /* unit in which memory is allocated */
|
||||
#define CLICK_SHIFT 12 /* log2 of CLICK_SIZE */
|
||||
#endif
|
||||
|
||||
/* Click alignment macros. */
|
||||
#define CLICK_FLOOR(n) (((vir_bytes)(n) / CLICK_SIZE) * CLICK_SIZE)
|
||||
#define CLICK_CEIL(n) CLICK_FLOOR((vir_bytes)(n) + CLICK_SIZE-1)
|
||||
|
||||
/* Sizes of memory tables. The boot monitor distinguishes three memory areas,
|
||||
* namely low mem below 1M, 1M-16M, and mem after 16M. More chunks are needed
|
||||
* for DOS MINIX.
|
||||
*/
|
||||
#define NR_MEMS 8
|
||||
|
||||
|
||||
/* Click to byte conversions (and vice versa). */
|
||||
#define HCLICK_SHIFT 4 /* log2 of HCLICK_SIZE */
|
||||
#define HCLICK_SIZE 16 /* hardware segment conversion magic */
|
||||
#if CLICK_SIZE >= HCLICK_SIZE
|
||||
#define click_to_hclick(n) ((n) << (CLICK_SHIFT - HCLICK_SHIFT))
|
||||
#else
|
||||
#define click_to_hclick(n) ((n) >> (HCLICK_SHIFT - CLICK_SHIFT))
|
||||
#endif
|
||||
#define hclick_to_physb(n) ((phys_bytes) (n) << HCLICK_SHIFT)
|
||||
#define physb_to_hclick(n) ((n) >> HCLICK_SHIFT)
|
||||
|
||||
#define ABS -999 /* this process means absolute memory */
|
||||
|
||||
/* Flag bits for i_mode in the inode. */
|
||||
#define I_TYPE 0170000 /* this field gives inode type */
|
||||
#define I_UNIX_SOCKET 0140000 /* unix domain socket */
|
||||
#define I_SYMBOLIC_LINK 0120000 /* file is a symbolic link */
|
||||
#define I_REGULAR 0100000 /* regular file, not dir or special */
|
||||
#define I_BLOCK_SPECIAL 0060000 /* block special file */
|
||||
#define I_DIRECTORY 0040000 /* file is a directory */
|
||||
#define I_CHAR_SPECIAL 0020000 /* character special file */
|
||||
#define I_NAMED_PIPE 0010000 /* named pipe (FIFO) */
|
||||
#define I_SET_UID_BIT 0004000 /* set effective uid_t on exec */
|
||||
#define I_SET_GID_BIT 0002000 /* set effective gid_t on exec */
|
||||
#define I_SET_STCKY_BIT 0001000 /* sticky bit */
|
||||
#define ALL_MODES 0007777 /* all bits for user, group and others */
|
||||
#define RWX_MODES 0000777 /* mode bits for RWX only */
|
||||
#define R_BIT 0000004 /* Rwx protection bit */
|
||||
#define W_BIT 0000002 /* rWx protection bit */
|
||||
#define X_BIT 0000001 /* rwX protection bit */
|
||||
#define I_NOT_ALLOC 0000000 /* this inode is free */
|
||||
|
||||
/* Some limits. */
|
||||
#define MAX_INODE_NR ((ino_t) 037777777777) /* largest inode number */
|
||||
#define MAX_FILE_POS ((off_t) 0x7FFFFFFF) /* largest legal file offset */
|
||||
#define UMAX_FILE_POS ((unsigned) 0x7FFFFFFF) /* largest legal file offset */
|
||||
|
||||
#define MAX_SYM_LOOPS 8 /* how many symbolic links are recursed */
|
||||
|
||||
#define NO_BLOCK ((block_t) 0) /* absence of a block number */
|
||||
#define NO_ENTRY ((ino_t) 0) /* absence of a dir entry */
|
||||
#define NO_ZONE ((zone_t) 0) /* absence of a zone number */
|
||||
#define NO_DEV ((dev_t) 0) /* absence of a device numb */
|
||||
#define NO_LINK ((nlink_t) 0) /* absence of incoming links */
|
||||
#define INVAL_UID ((uid_t) -1) /* invalid uid value */
|
||||
#define INVAL_GID ((gid_t) -1) /* invalid gid value */
|
||||
|
||||
#define SERVARNAME "cttyline"
|
||||
|
||||
/* Bits for the system property flags in boot image processes. */
|
||||
#define PROC_FULLVM 0x100 /* VM sets and manages full pagetable */
|
||||
|
||||
/* Bits for s_flags in the privilege structure. */
|
||||
#define PREEMPTIBLE 0x002 /* kernel tasks are not preemptible */
|
||||
#define BILLABLE 0x004 /* some processes are not billable */
|
||||
#define DYN_PRIV_ID 0x008 /* privilege id assigned dynamically */
|
||||
|
||||
#define SYS_PROC 0x010 /* system processes have own priv structure */
|
||||
#define CHECK_IO_PORT 0x020 /* check if I/O request is allowed */
|
||||
#define CHECK_IRQ 0x040 /* check if IRQ can be used */
|
||||
#define CHECK_MEM 0x080 /* check if (VM) mem map request is allowed */
|
||||
#define ROOT_SYS_PROC 0x100 /* this is a root system process instance */
|
||||
#define VM_SYS_PROC 0x200 /* this is a vm system process instance */
|
||||
#define LU_SYS_PROC 0x400 /* this is a live updated sys proc instance */
|
||||
#define RST_SYS_PROC 0x800 /* this is a restarted sys proc instance */
|
||||
|
||||
/* Bits for device driver flags managed by RS and VFS. */
|
||||
#define DRV_FORCED 0x01 /* driver is mapped even if not alive yet */
|
||||
|
||||
/* Values for the "verbose" boot monitor variable */
|
||||
#define VERBOSEBOOT_QUIET 0
|
||||
#define VERBOSEBOOT_BASIC 1
|
||||
#define VERBOSEBOOT_EXTRA 2
|
||||
#define VERBOSEBOOT_MAX 3
|
||||
#define VERBOSEBOOTVARNAME "verbose"
|
||||
|
||||
/* magic value to put in struct proc entries for sanity checks. */
|
||||
#define PMAGIC 0xC0FFEE1
|
||||
|
||||
#endif /* _MINIX_CONST_H */
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef _MINIX_DEBUG_H
|
||||
#define _MINIX_DEBUG_H 1
|
||||
|
||||
/* For reminders of things to be fixed. */
|
||||
#define FIXME(str) { static int fixme_warned = 0; \
|
||||
if(!fixme_warned) { \
|
||||
printf("FIXME: %s:%d: %s\n", __FILE__, __LINE__, str);\
|
||||
fixme_warned = 1; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NOT_REACHABLE do { \
|
||||
panic("NOT_REACHABLE at %s:%d", __FILE__, __LINE__); \
|
||||
for(;;); \
|
||||
} while(0)
|
||||
|
||||
#define NOT_IMPLEMENTED do { \
|
||||
panic("NOT_IMPLEMENTED at %s:%d", __FILE__, __LINE__); \
|
||||
} while(0)
|
||||
|
||||
#endif /* _MINIX_DEBUG_H */
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
/* This file provides basic types and some constants for the
|
||||
* SYS_DEVIO and SYS_VDEVIO system calls, which allow user-level
|
||||
* processes to perform device I/O.
|
||||
*
|
||||
* Created:
|
||||
* Apr 08, 2004 by Jorrit N. Herder
|
||||
*/
|
||||
|
||||
#ifndef _DEVIO_H
|
||||
#define _DEVIO_H
|
||||
|
||||
#include <minix/sys_config.h> /* needed to include <minix/type.h> */
|
||||
#include <minix/types.h> /* u8_t, u16_t, u32_t needed */
|
||||
|
||||
typedef u16_t port_t;
|
||||
|
||||
/* We have different granularities of port I/O: 8, 16, 32 bits.
|
||||
* Also see <ibm/portio.h>, which has functions for bytes, words,
|
||||
* and longs. Hence, we need different (port,value)-pair types.
|
||||
*/
|
||||
typedef struct { u16_t port; u8_t value; } pvb_pair_t;
|
||||
typedef struct { u16_t port; u16_t value; } pvw_pair_t;
|
||||
typedef struct { u16_t port; u32_t value; } pvl_pair_t;
|
||||
|
||||
/* Macro shorthand to set (port,value)-pair. */
|
||||
#define pv_set(pv, p, v) do { \
|
||||
u32_t _p = (p), _v = (v); \
|
||||
(pv).port = _p; \
|
||||
(pv).value = _v; \
|
||||
if((pv).port != _p || (pv).value != _v) { \
|
||||
printf("%s:%d: actual port: 0x%x != 0x%lx || " \
|
||||
"actual value: 0x%x != 0x%lx\n", \
|
||||
__FILE__, __LINE__, (pv).port, _p, (pv).value, _v); \
|
||||
panic("pv_set(" #pv ", " #p ", " #v ")"); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#if 0 /* no longer in use !!! */
|
||||
/* Define a number of flags to indicate granularity we are using. */
|
||||
#define MASK_GRANULARITY 0x000F /* not in use! does not match flags */
|
||||
#define PVB_FLAG 'b'
|
||||
#define PVW_FLAG 'w'
|
||||
#define PVL_FLAG 'l'
|
||||
|
||||
/* Flags indicating whether request wants to do input or output. */
|
||||
#define MASK_IN_OR_OUT 0x00F0
|
||||
#define DEVIO_INPUT 0x0010
|
||||
#define DEVIO_OUTPUT 0x0020
|
||||
#endif /* 0 */
|
||||
|
||||
#if 0 /* no longer used !!! */
|
||||
/* Define how large the (port,value)-pair buffer in the kernel is.
|
||||
* This buffer is used to copy the (port,value)-pairs in kernel space.
|
||||
*/
|
||||
#define PV_BUF_SIZE 64 /* creates char pv_buf[PV_BUF_SIZE] */
|
||||
|
||||
/* Note that SYS_VDEVIO sends a pointer to a vector of (port,value)-pairs,
|
||||
* whereas SYS_DEVIO includes a single (port,value)-pair in the messages.
|
||||
* Calculate maximum number of (port,value)-pairs that can be handled
|
||||
* in a single SYS_VDEVIO system call with above struct definitions.
|
||||
*/
|
||||
#define MAX_PVB_PAIRS ((PV_BUF_SIZE * sizeof(char)) / sizeof(pvb_pair_t))
|
||||
#define MAX_PVW_PAIRS ((PV_BUF_SIZE * sizeof(char)) / sizeof(pvw_pair_t))
|
||||
#define MAX_PVL_PAIRS ((PV_BUF_SIZE * sizeof(char)) / sizeof(pvl_pair_t))
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
#endif /* _DEVIO_H */
|
||||
@@ -1,77 +0,0 @@
|
||||
/* Prototypes and definitions for DS interface. */
|
||||
|
||||
#ifndef _MINIX_DS_H
|
||||
#define _MINIX_DS_H
|
||||
|
||||
#include <minix/types.h>
|
||||
#include <minix/endpoint.h>
|
||||
|
||||
/* Flags. */
|
||||
#define DSF_IN_USE 0x001 /* entry is in use */
|
||||
#define DSF_PRIV_RETRIEVE 0x002 /* only owner can retrieve */
|
||||
#define DSF_PRIV_OVERWRITE 0x004 /* only owner can overwrite */
|
||||
#define DSF_PRIV_SNAPSHOT 0x004 /* only owner can take a snapshot */
|
||||
#define DSF_PRIV_SUBSCRIBE 0x008 /* only owner can subscribe */
|
||||
#define DSF_TYPE_U32 0x010 /* u32 data type */
|
||||
#define DSF_TYPE_STR 0x020 /* string data type */
|
||||
#define DSF_TYPE_MEM 0x040 /* memory range data type */
|
||||
#define DSF_TYPE_MAP 0x080 /* mapped memory range data type */
|
||||
#define DSF_TYPE_LABEL 0x100 /* label data type */
|
||||
|
||||
#define DSF_MASK_TYPE 0xFF0 /* mask for type flags. */
|
||||
#define DSF_MASK_INTERNAL 0xFFF /* mask for internal flags. */
|
||||
|
||||
#define DSF_OVERWRITE 0x01000 /* overwrite if entry exists */
|
||||
#define DSF_INITIAL 0x02000 /* check subscriptions immediately */
|
||||
|
||||
#define DSMF_MAP_MAPPED 0x10000 /* map mapped memory range */
|
||||
#define DSMF_COPY_MAPPED 0x20000 /* copy mapped memory range */
|
||||
#define DSMF_COPY_SNAPSHOT 0x40000 /* copy snapshot */
|
||||
|
||||
/* DS constants. */
|
||||
#define DS_MAX_KEYLEN 80 /* Max length of a key, including '\0'. */
|
||||
|
||||
/* DS events. */
|
||||
#define DS_DRIVER_UP 1
|
||||
|
||||
/* ds.c */
|
||||
|
||||
/* U32 */
|
||||
_PROTOTYPE( int ds_publish_u32, (const char *name, u32_t val, int flags));
|
||||
_PROTOTYPE( int ds_retrieve_u32, (const char *name, u32_t *val));
|
||||
_PROTOTYPE( int ds_delete_u32, (const char *ds_name));
|
||||
|
||||
/* STRING */
|
||||
_PROTOTYPE( int ds_publish_str, (const char *name, char *val, int flags));
|
||||
_PROTOTYPE( int ds_retrieve_str, (const char *name, char *val, size_t len));
|
||||
_PROTOTYPE( int ds_delete_str, (const char *ds_name));
|
||||
|
||||
/* MEM */
|
||||
_PROTOTYPE( int ds_publish_mem, (const char *ds_name, void *vaddr,
|
||||
size_t length, int flags));
|
||||
_PROTOTYPE( int ds_retrieve_mem, (const char *ds_name, char *vaddr,
|
||||
size_t *length));
|
||||
_PROTOTYPE( int ds_delete_mem, (const char *ds_name));
|
||||
|
||||
/* MAP */
|
||||
_PROTOTYPE( int ds_publish_map, (const char *ds_name, void *vaddr,
|
||||
size_t length, int flags));
|
||||
_PROTOTYPE( int ds_snapshot_map, (const char *ds_name, int *nr_snapshot));
|
||||
_PROTOTYPE( int ds_retrieve_map, (const char *ds_name, char *vaddr,
|
||||
size_t *length, int nr_snapshot, int flags));
|
||||
_PROTOTYPE( int ds_delete_map, (const char *ds_name));
|
||||
|
||||
/* LABEL */
|
||||
_PROTOTYPE( int ds_publish_label, (const char *ds_name, endpoint_t endpoint,
|
||||
int flags));
|
||||
_PROTOTYPE( int ds_retrieve_label_name, (char *ds_name, endpoint_t endpoint));
|
||||
_PROTOTYPE( int ds_retrieve_label_endpt, (const char *ds_name,
|
||||
endpoint_t *endpoint));
|
||||
_PROTOTYPE( int ds_delete_label, (const char *ds_name));
|
||||
|
||||
/* Subscribe and check. */
|
||||
_PROTOTYPE( int ds_subscribe, (const char *regex, int flags));
|
||||
_PROTOTYPE( int ds_check, (char *ds_name, int *type, endpoint_t *owner_e));
|
||||
|
||||
#endif /* _MINIX_DS_H */
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
#ifndef _MINIX_ENDPOINT_H
|
||||
#define _MINIX_ENDPOINT_H 1
|
||||
|
||||
#include <minix/sys_config.h>
|
||||
#include <minix/com.h>
|
||||
#include <limits.h>
|
||||
#include <minix/type.h>
|
||||
|
||||
/* The point of the padding in 'generation size' is to
|
||||
* allow for certain bogus endpoint numbers such as NONE, ANY, etc.
|
||||
*
|
||||
* The _MAX_MAGIC_PROC is defined by <minix/com.h>. That include
|
||||
* file defines some magic process numbers such as ANY and NONE,
|
||||
* and must never be a valid endpoint number. Therefore we make sure
|
||||
* the generation size is big enough to start the next generation
|
||||
* above the highest magic number.
|
||||
*/
|
||||
#define _ENDPOINT_GENERATION_SIZE (MAX_NR_TASKS+_MAX_MAGIC_PROC+1)
|
||||
#define _ENDPOINT_MAX_GENERATION (INT_MAX/_ENDPOINT_GENERATION_SIZE-1)
|
||||
|
||||
/* Generation + Process slot number <-> endpoint. */
|
||||
#define _ENDPOINT(g, p) ((endpoint_t)((g) * _ENDPOINT_GENERATION_SIZE + (p)))
|
||||
#define _ENDPOINT_G(e) (((e)+MAX_NR_TASKS) / _ENDPOINT_GENERATION_SIZE)
|
||||
#define _ENDPOINT_P(e) \
|
||||
((((e)+MAX_NR_TASKS) % _ENDPOINT_GENERATION_SIZE) - MAX_NR_TASKS)
|
||||
|
||||
#endif
|
||||
@@ -1,16 +0,0 @@
|
||||
#include <sys/types.h>
|
||||
#include <lib.h>
|
||||
#include <stdlib.h>
|
||||
#include <minix/syslib.h>
|
||||
|
||||
/* opcodes for use in gcov buffer */
|
||||
#define GCOVOP_OPEN 23
|
||||
#define GCOVOP_WRITE 24
|
||||
#define GCOVOP_CLOSE 25
|
||||
#define GCOVOP_END 26
|
||||
|
||||
/* More information on the GCOV Minix Wiki page. */
|
||||
|
||||
int gcov_flush_svr(char *buff, int buff_sz, int server_nr);
|
||||
extern void __gcov_flush (void);
|
||||
int do_gcov_flush_impl(message *msg);
|
||||
@@ -1,68 +0,0 @@
|
||||
/* minix/ioctl.h - Ioctl helper definitions. Author: Kees J. Bot
|
||||
* 23 Nov 2002
|
||||
*
|
||||
* This file is included by every header file that defines ioctl codes.
|
||||
*/
|
||||
|
||||
#ifndef _M_IOCTL_H
|
||||
#define _M_IOCTL_H
|
||||
|
||||
#ifndef _TYPES_H
|
||||
#include <minix/types.h>
|
||||
#endif
|
||||
|
||||
#if _EM_WSIZE >= 4
|
||||
/* Ioctls have the command encoded in the low-order word, and the size
|
||||
* of the parameter in the high-order word. The 3 high bits of the high-
|
||||
* order word are used to encode the in/out/void status of the parameter.
|
||||
*/
|
||||
#define _IOCPARM_MASK 0x0FFF
|
||||
#define _IOCPARM_MASK_BIG 0x0FFFFF
|
||||
#define _IOC_VOID 0x20000000
|
||||
#define _IOCTYPE_MASK 0xFFFF
|
||||
#define _IOC_IN 0x40000000
|
||||
#define _IOC_OUT 0x80000000
|
||||
#define _IOC_INOUT (_IOC_IN | _IOC_OUT)
|
||||
|
||||
/* Flag indicating ioctl format with only one type field, and more bits
|
||||
* for the size field (using mask _IOCPARM_MASK_BIG).
|
||||
*/
|
||||
#define _IOC_BIG 0x10000000
|
||||
|
||||
#define _IO(x,y) ((x << 8) | y | _IOC_VOID)
|
||||
#define _IOR(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |\
|
||||
_IOC_OUT)
|
||||
#define _IOW(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |\
|
||||
_IOC_IN)
|
||||
#define _IORW(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |\
|
||||
_IOC_INOUT)
|
||||
|
||||
#define _IOW_BIG(y,t) (y | ((sizeof(t) & _IOCPARM_MASK_BIG) << 8) \
|
||||
| _IOC_IN | _IOC_BIG)
|
||||
#define _IOR_BIG(y,t) (y | ((sizeof(t) & _IOCPARM_MASK_BIG) << 8) \
|
||||
| _IOC_OUT | _IOC_BIG)
|
||||
#define _IORW_BIG(y,t) (y | ((sizeof(t) & _IOCPARM_MASK_BIG) << 8) \
|
||||
| _IOC_INOUT | _IOC_BIG)
|
||||
|
||||
/* Decode an ioctl call. */
|
||||
#define _MINIX_IOCTL_SIZE(i) (((i) >> 16) & _IOCPARM_MASK)
|
||||
#define _MINIX_IOCTL_IOR(i) ((i) & _IOC_OUT)
|
||||
#define _MINIX_IOCTL_IORW(i) ((i) & _IOC_INOUT)
|
||||
#define _MINIX_IOCTL_IOW(i) ((i) & _IOC_IN)
|
||||
|
||||
/* Recognize and decode size of a 'big' ioctl call. */
|
||||
#define _MINIX_IOCTL_BIG(i) ((i) & _IOC_BIG)
|
||||
#define _MINIX_IOCTL_SIZE_BIG(i) (((i) >> 8) & _IOCPARM_MASK_BIG)
|
||||
|
||||
#else
|
||||
/* No fancy encoding on a 16-bit machine. */
|
||||
|
||||
#define _IO(x,y) ((x << 8) | y)
|
||||
#define _IOR(x,y,t) _IO(x,y)
|
||||
#define _IOW(x,y,t) _IO(x,y)
|
||||
#define _IORW(x,y,t) _IO(x,y)
|
||||
#endif
|
||||
|
||||
int ioctl(int _fd, int _request, void *_data);
|
||||
|
||||
#endif /* _M_IOCTL_H */
|
||||
@@ -1,159 +0,0 @@
|
||||
#ifndef _IPC_H
|
||||
#define _IPC_H
|
||||
|
||||
#include <minix/ipcconst.h>
|
||||
#include <minix/type.h>
|
||||
|
||||
/*==========================================================================*
|
||||
* Types relating to messages. *
|
||||
*==========================================================================*/
|
||||
|
||||
#define M1 1
|
||||
#define M3 3
|
||||
#define M4 4
|
||||
#define M3_STRING 14 /* legacy m3_ca1 size (must not be changed) */
|
||||
#define M3_LONG_STRING 16 /* current m3_ca1 size (may be increased) */
|
||||
|
||||
typedef struct {int m1i1, m1i2, m1i3; char *m1p1, *m1p2, *m1p3;} mess_1;
|
||||
typedef struct {int m2i1, m2i2, m2i3; long m2l1, m2l2; char *m2p1;
|
||||
short m2s1;} mess_2;
|
||||
typedef struct {int m3i1, m3i2; char *m3p1; char m3ca1[M3_LONG_STRING];} mess_3;
|
||||
typedef struct {long m4l1, m4l2, m4l3, m4l4, m4l5;} mess_4;
|
||||
typedef struct {short m5s1, m5s2; int m5i1, m5i2; long m5l1, m5l2, m5l3;}mess_5;
|
||||
typedef struct {long m6l1, m6l2, m6l3; short m6s1, m6s2, m6s3; char m6c1, m6c2;
|
||||
char *m6p1, *m6p2;} mess_6;
|
||||
typedef struct {int m7i1, m7i2, m7i3, m7i4, m7i5; char *m7p1, *m7p2;} mess_7;
|
||||
typedef struct {int m8i1, m8i2; char *m8p1, *m8p2, *m8p3, *m8p4;} mess_8;
|
||||
typedef struct {long m9l1, m9l2, m9l3, m9l4, m9l5;
|
||||
short m9s1, m9s2, m9s3, m9s4; } mess_9;
|
||||
|
||||
typedef struct {
|
||||
endpoint_t m_source; /* who sent the message */
|
||||
int m_type; /* what kind of message is it */
|
||||
union {
|
||||
mess_1 m_m1;
|
||||
mess_2 m_m2;
|
||||
mess_3 m_m3;
|
||||
mess_4 m_m4;
|
||||
mess_5 m_m5;
|
||||
mess_7 m_m7;
|
||||
mess_8 m_m8;
|
||||
mess_6 m_m6;
|
||||
mess_9 m_m9;
|
||||
} m_u;
|
||||
} message;
|
||||
|
||||
/* The following defines provide names for useful members. */
|
||||
#define m1_i1 m_u.m_m1.m1i1
|
||||
#define m1_i2 m_u.m_m1.m1i2
|
||||
#define m1_i3 m_u.m_m1.m1i3
|
||||
#define m1_p1 m_u.m_m1.m1p1
|
||||
#define m1_p2 m_u.m_m1.m1p2
|
||||
#define m1_p3 m_u.m_m1.m1p3
|
||||
|
||||
#define m2_i1 m_u.m_m2.m2i1
|
||||
#define m2_i2 m_u.m_m2.m2i2
|
||||
#define m2_i3 m_u.m_m2.m2i3
|
||||
#define m2_l1 m_u.m_m2.m2l1
|
||||
#define m2_l2 m_u.m_m2.m2l2
|
||||
#define m2_p1 m_u.m_m2.m2p1
|
||||
|
||||
#define m2_s1 m_u.m_m2.m2s1
|
||||
|
||||
#define m3_i1 m_u.m_m3.m3i1
|
||||
#define m3_i2 m_u.m_m3.m3i2
|
||||
#define m3_p1 m_u.m_m3.m3p1
|
||||
#define m3_ca1 m_u.m_m3.m3ca1
|
||||
|
||||
#define m4_l1 m_u.m_m4.m4l1
|
||||
#define m4_l2 m_u.m_m4.m4l2
|
||||
#define m4_l3 m_u.m_m4.m4l3
|
||||
#define m4_l4 m_u.m_m4.m4l4
|
||||
#define m4_l5 m_u.m_m4.m4l5
|
||||
|
||||
#define m5_s1 m_u.m_m5.m5s1
|
||||
#define m5_s2 m_u.m_m5.m5s2
|
||||
#define m5_i1 m_u.m_m5.m5i1
|
||||
#define m5_i2 m_u.m_m5.m5i2
|
||||
#define m5_l1 m_u.m_m5.m5l1
|
||||
#define m5_l2 m_u.m_m5.m5l2
|
||||
#define m5_l3 m_u.m_m5.m5l3
|
||||
|
||||
#define m6_l1 m_u.m_m6.m6l1
|
||||
#define m6_l2 m_u.m_m6.m6l2
|
||||
#define m6_l3 m_u.m_m6.m6l3
|
||||
#define m6_s1 m_u.m_m6.m6s1
|
||||
#define m6_s2 m_u.m_m6.m6s2
|
||||
#define m6_s3 m_u.m_m6.m6s3
|
||||
#define m6_c1 m_u.m_m6.m6c1
|
||||
#define m6_c2 m_u.m_m6.m6c2
|
||||
#define m6_p1 m_u.m_m6.m6p1
|
||||
#define m6_p2 m_u.m_m6.m6p2
|
||||
|
||||
#define m7_i1 m_u.m_m7.m7i1
|
||||
#define m7_i2 m_u.m_m7.m7i2
|
||||
#define m7_i3 m_u.m_m7.m7i3
|
||||
#define m7_i4 m_u.m_m7.m7i4
|
||||
#define m7_i5 m_u.m_m7.m7i5
|
||||
#define m7_p1 m_u.m_m7.m7p1
|
||||
#define m7_p2 m_u.m_m7.m7p2
|
||||
|
||||
#define m8_i1 m_u.m_m8.m8i1
|
||||
#define m8_i2 m_u.m_m8.m8i2
|
||||
#define m8_p1 m_u.m_m8.m8p1
|
||||
#define m8_p2 m_u.m_m8.m8p2
|
||||
#define m8_p3 m_u.m_m8.m8p3
|
||||
#define m8_p4 m_u.m_m8.m8p4
|
||||
|
||||
#define m9_l1 m_u.m_m9.m9l1
|
||||
#define m9_l2 m_u.m_m9.m9l2
|
||||
#define m9_l3 m_u.m_m9.m9l3
|
||||
#define m9_l4 m_u.m_m9.m9l4
|
||||
#define m9_l5 m_u.m_m9.m9l5
|
||||
#define m9_s1 m_u.m_m9.m9s1
|
||||
#define m9_s2 m_u.m_m9.m9s2
|
||||
#define m9_s3 m_u.m_m9.m9s3
|
||||
#define m9_s4 m_u.m_m9.m9s4
|
||||
|
||||
/*==========================================================================*
|
||||
* Minix run-time system (IPC). *
|
||||
*==========================================================================*/
|
||||
|
||||
/* Datastructure for asynchronous sends */
|
||||
typedef struct asynmsg
|
||||
{
|
||||
unsigned flags;
|
||||
endpoint_t dst;
|
||||
int result;
|
||||
message msg;
|
||||
} asynmsg_t;
|
||||
|
||||
/* Defines for flags field */
|
||||
#define AMF_EMPTY 0 /* slot is not inuse */
|
||||
#define AMF_VALID 1 /* slot contains message */
|
||||
#define AMF_DONE 2 /* Kernel has processed the message. The
|
||||
* result is stored in 'result'
|
||||
*/
|
||||
#define AMF_NOTIFY 4 /* Send a notification when AMF_DONE is set */
|
||||
#define AMF_NOREPLY 8 /* Not a reply message for a SENDREC */
|
||||
|
||||
/* Hide names to avoid name space pollution. */
|
||||
#define echo _echo
|
||||
#define notify _notify
|
||||
#define sendrec _sendrec
|
||||
#define receive _receive
|
||||
#define send _send
|
||||
#define sendnb _sendnb
|
||||
#define senda _senda
|
||||
|
||||
_PROTOTYPE( int echo, (message *m_ptr) );
|
||||
_PROTOTYPE( int notify, (endpoint_t dest) );
|
||||
_PROTOTYPE( int sendrec, (endpoint_t src_dest, message *m_ptr) );
|
||||
_PROTOTYPE( int receive, (endpoint_t src, message *m_ptr, int *status_ptr));
|
||||
_PROTOTYPE( int send, (endpoint_t dest, message *m_ptr) );
|
||||
_PROTOTYPE( int sendnb, (endpoint_t dest, message *m_ptr) );
|
||||
_PROTOTYPE( int senda, (asynmsg_t *table, size_t count) );
|
||||
|
||||
_PROTOTYPE( int _do_kernel_call, (message *m_ptr) );
|
||||
|
||||
#endif /* _IPC_H */
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef _IPC_CONST_H
|
||||
#define _IPC_CONST_H
|
||||
|
||||
/* System call numbers that are passed when trapping to the kernel. */
|
||||
#define SEND 1 /* blocking send */
|
||||
#define RECEIVE 2 /* blocking receive */
|
||||
#define SENDREC 3 /* SEND + RECEIVE */
|
||||
#define NOTIFY 4 /* asynchronous notify */
|
||||
#define SENDNB 5 /* nonblocking send */
|
||||
#define SENDA 16 /* asynchronous send */
|
||||
#define IPCNO_HIGHEST SENDA
|
||||
|
||||
/* Macros for IPC status code manipulation. */
|
||||
#define IPC_STATUS_CALL_SHIFT 0
|
||||
#define IPC_STATUS_CALL_MASK 0x3F
|
||||
#define IPC_STATUS_CALL(status) \
|
||||
(((status) >> IPC_STATUS_CALL_SHIFT) & IPC_STATUS_CALL_MASK)
|
||||
#define IPC_STATUS_CALL_TO(call) \
|
||||
(((call) & IPC_STATUS_CALL_MASK) << IPC_STATUS_CALL_SHIFT)
|
||||
|
||||
#define IPC_FLG_MSG_FROM_KERNEL 1 /* this message originated in the kernel on
|
||||
behalf of a process, this is a trusted
|
||||
message, never reply to the sender
|
||||
*/
|
||||
#define IPC_STATUS_FLAGS_SHIFT 16
|
||||
#define IPC_STATUS_FLAGS(flgs) ((flgs) << IPC_STATUS_FLAGS_SHIFT)
|
||||
#define IPC_STATUS_FLAGS_TEST(status, flgs) \
|
||||
(((status) >> IPC_STATUS_FLAGS_SHIFT) & (flgs))
|
||||
#endif /* IPC_CONST_H */
|
||||
@@ -1,146 +0,0 @@
|
||||
/* keymap.h - defines for keymapping Author: Marcus Hampel
|
||||
*/
|
||||
#ifndef _SYS__KEYMAP_H
|
||||
#define _SYS__KEYMAP_H
|
||||
|
||||
#define C(c) ((c) & 0x1F) /* Map to control code */
|
||||
#define A(c) ((c) | 0x80) /* Set eight bit (ALT) */
|
||||
#define CA(c) A(C(c)) /* Control-Alt */
|
||||
#define L(c) ((c) | HASCAPS) /* Add "Caps Lock has effect" attribute */
|
||||
|
||||
#define EXT 0x0100 /* Normal function keys */
|
||||
#define CTRL 0x0200 /* Control key */
|
||||
#define SHIFT 0x0400 /* Shift key */
|
||||
#define ALT 0x0800 /* Alternate key */
|
||||
#define EXTKEY 0x1000 /* extended keycode */
|
||||
#define HASCAPS 0x8000 /* Caps Lock has effect */
|
||||
|
||||
/* Scan code conversion. */
|
||||
#define KEY_RELEASE 0200
|
||||
#define ASCII_MASK 0177
|
||||
|
||||
/* Numeric keypad */
|
||||
#define HOME (0x01 + EXT)
|
||||
#define END (0x02 + EXT)
|
||||
#define UP (0x03 + EXT)
|
||||
#define DOWN (0x04 + EXT)
|
||||
#define LEFT (0x05 + EXT)
|
||||
#define RIGHT (0x06 + EXT)
|
||||
#define PGUP (0x07 + EXT)
|
||||
#define PGDN (0x08 + EXT)
|
||||
#define MID (0x09 + EXT)
|
||||
#define NMIN (0x0A + EXT)
|
||||
#define PLUS (0x0B + EXT)
|
||||
#define INSRT (0x0C + EXT)
|
||||
|
||||
/* Alt + Numeric keypad */
|
||||
#define AHOME (0x01 + ALT)
|
||||
#define AEND (0x02 + ALT)
|
||||
#define AUP (0x03 + ALT)
|
||||
#define ADOWN (0x04 + ALT)
|
||||
#define ALEFT (0x05 + ALT)
|
||||
#define ARIGHT (0x06 + ALT)
|
||||
#define APGUP (0x07 + ALT)
|
||||
#define APGDN (0x08 + ALT)
|
||||
#define AMID (0x09 + ALT)
|
||||
#define ANMIN (0x0A + ALT)
|
||||
#define APLUS (0x0B + ALT)
|
||||
#define AINSRT (0x0C + ALT)
|
||||
|
||||
/* Ctrl + Numeric keypad */
|
||||
#define CHOME (0x01 + CTRL)
|
||||
#define CEND (0x02 + CTRL)
|
||||
#define CUP (0x03 + CTRL)
|
||||
#define CDOWN (0x04 + CTRL)
|
||||
#define CLEFT (0x05 + CTRL)
|
||||
#define CRIGHT (0x06 + CTRL)
|
||||
#define CPGUP (0x07 + CTRL)
|
||||
#define CPGDN (0x08 + CTRL)
|
||||
#define CMID (0x09 + CTRL)
|
||||
#define CNMIN (0x0A + CTRL)
|
||||
#define CPLUS (0x0B + CTRL)
|
||||
#define CINSRT (0x0C + CTRL)
|
||||
|
||||
/* Lock keys */
|
||||
#define CALOCK (0x0D + EXT) /* caps lock */
|
||||
#define NLOCK (0x0E + EXT) /* number lock */
|
||||
#define SLOCK (0x0F + EXT) /* scroll lock */
|
||||
|
||||
/* Function keys */
|
||||
#define F1 (0x10 + EXT)
|
||||
#define F2 (0x11 + EXT)
|
||||
#define F3 (0x12 + EXT)
|
||||
#define F4 (0x13 + EXT)
|
||||
#define F5 (0x14 + EXT)
|
||||
#define F6 (0x15 + EXT)
|
||||
#define F7 (0x16 + EXT)
|
||||
#define F8 (0x17 + EXT)
|
||||
#define F9 (0x18 + EXT)
|
||||
#define F10 (0x19 + EXT)
|
||||
#define F11 (0x1A + EXT)
|
||||
#define F12 (0x1B + EXT)
|
||||
|
||||
/* Alt+Fn */
|
||||
#define AF1 (0x10 + ALT)
|
||||
#define AF2 (0x11 + ALT)
|
||||
#define AF3 (0x12 + ALT)
|
||||
#define AF4 (0x13 + ALT)
|
||||
#define AF5 (0x14 + ALT)
|
||||
#define AF6 (0x15 + ALT)
|
||||
#define AF7 (0x16 + ALT)
|
||||
#define AF8 (0x17 + ALT)
|
||||
#define AF9 (0x18 + ALT)
|
||||
#define AF10 (0x19 + ALT)
|
||||
#define AF11 (0x1A + ALT)
|
||||
#define AF12 (0x1B + ALT)
|
||||
|
||||
/* Ctrl+Fn */
|
||||
#define CF1 (0x10 + CTRL)
|
||||
#define CF2 (0x11 + CTRL)
|
||||
#define CF3 (0x12 + CTRL)
|
||||
#define CF4 (0x13 + CTRL)
|
||||
#define CF5 (0x14 + CTRL)
|
||||
#define CF6 (0x15 + CTRL)
|
||||
#define CF7 (0x16 + CTRL)
|
||||
#define CF8 (0x17 + CTRL)
|
||||
#define CF9 (0x18 + CTRL)
|
||||
#define CF10 (0x19 + CTRL)
|
||||
#define CF11 (0x1A + CTRL)
|
||||
#define CF12 (0x1B + CTRL)
|
||||
|
||||
/* Shift+Fn */
|
||||
#define SF1 (0x10 + SHIFT)
|
||||
#define SF2 (0x11 + SHIFT)
|
||||
#define SF3 (0x12 + SHIFT)
|
||||
#define SF4 (0x13 + SHIFT)
|
||||
#define SF5 (0x14 + SHIFT)
|
||||
#define SF6 (0x15 + SHIFT)
|
||||
#define SF7 (0x16 + SHIFT)
|
||||
#define SF8 (0x17 + SHIFT)
|
||||
#define SF9 (0x18 + SHIFT)
|
||||
#define SF10 (0x19 + SHIFT)
|
||||
#define SF11 (0x1A + SHIFT)
|
||||
#define SF12 (0x1B + SHIFT)
|
||||
|
||||
/* Alt+Shift+Fn */
|
||||
#define ASF1 (0x10 + ALT + SHIFT)
|
||||
#define ASF2 (0x11 + ALT + SHIFT)
|
||||
#define ASF3 (0x12 + ALT + SHIFT)
|
||||
#define ASF4 (0x13 + ALT + SHIFT)
|
||||
#define ASF5 (0x14 + ALT + SHIFT)
|
||||
#define ASF6 (0x15 + ALT + SHIFT)
|
||||
#define ASF7 (0x16 + ALT + SHIFT)
|
||||
#define ASF8 (0x17 + ALT + SHIFT)
|
||||
#define ASF9 (0x18 + ALT + SHIFT)
|
||||
#define ASF10 (0x19 + ALT + SHIFT)
|
||||
#define ASF11 (0x1A + ALT + SHIFT)
|
||||
#define ASF12 (0x1B + ALT + SHIFT)
|
||||
|
||||
#define MAP_COLS 6 /* Number of columns in keymap */
|
||||
#define NR_SCAN_CODES 0x80 /* Number of scan codes (rows in keymap) */
|
||||
|
||||
typedef unsigned short keymap_t[NR_SCAN_CODES * MAP_COLS];
|
||||
|
||||
#define KEY_MAGIC "KMAZ" /* Magic number of keymap file */
|
||||
|
||||
#endif /* _SYS__KEYMAP_H */
|
||||
@@ -1,12 +0,0 @@
|
||||
/* The <minix/limits.h> header defines the Minix values for some MINIX
|
||||
* constants. Both the MINIX constants and the non-posix constants
|
||||
* refer to these underlying definitions.
|
||||
*/
|
||||
|
||||
#ifndef _MINIX_LIMITS_H
|
||||
#define _MINIX_LIMITS_H
|
||||
|
||||
#define __MINIX_OPEN_MAX 255 /* a process may have 255 files open */
|
||||
#define __MINIX_PATH_MAX 255 /* a pathname may contain 255 chars */
|
||||
|
||||
#endif /* _MINIX_LIMITS_H */
|
||||
@@ -1,34 +0,0 @@
|
||||
#ifndef _MINLIB
|
||||
#define _MINLIB
|
||||
|
||||
#ifndef _MINIX_ANSI_H
|
||||
#include <minix/ansi.h>
|
||||
#endif
|
||||
|
||||
/* Miscellaneous BSD. */
|
||||
_PROTOTYPE(void swab, (char *_from, char *_to, int _count));
|
||||
_PROTOTYPE(char *itoa, (int _n));
|
||||
_PROTOTYPE(char *getpass, (const char *_prompt));
|
||||
|
||||
/* Miscellaneous MINIX. */
|
||||
_PROTOTYPE(void std_err, (const char *_s));
|
||||
_PROTOTYPE(void prints, (const char *_s, ...));
|
||||
_PROTOTYPE(int fsversion, (char *_dev, char *_prog));
|
||||
_PROTOTYPE(int getprocessor, (void));
|
||||
_PROTOTYPE(void _cpuid, (u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx));
|
||||
_PROTOTYPE(int load_mtab, (char *_prog_name));
|
||||
_PROTOTYPE(int rewrite_mtab, (char *_prog_name));
|
||||
_PROTOTYPE(int get_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4));
|
||||
_PROTOTYPE(int put_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4));
|
||||
|
||||
/* read_tsc() and friends */
|
||||
_PROTOTYPE(void read_tsc, (u32_t *hi, u32_t *lo));
|
||||
_PROTOTYPE(void read_tsc_64, (u64_t *t));
|
||||
|
||||
/* return values for fsversion */
|
||||
#define FSVERSION_MFS1 0x00001
|
||||
#define FSVERSION_MFS2 0x00002
|
||||
#define FSVERSION_MFS3 0x00003
|
||||
#define FSVERSION_EXT2 0x10002
|
||||
|
||||
#endif
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
minix/portio.h
|
||||
|
||||
Created: Jan 15, 1992 by Philip Homburg
|
||||
*/
|
||||
|
||||
#ifndef _PORTIO_H_
|
||||
#define _PORTIO_H_
|
||||
|
||||
#ifndef _TYPES_H
|
||||
#include <minix/types.h>
|
||||
#endif
|
||||
|
||||
unsigned inb(u16_t _port);
|
||||
unsigned inw(u16_t _port);
|
||||
unsigned inl(u16_t _port);
|
||||
void outb(u16_t _port, u8_t _value);
|
||||
void outw(u16_t _port, u16_t _value);
|
||||
void outl(u16_t _port, u32_t _value);
|
||||
void intr_disable(void);
|
||||
void intr_enable(void);
|
||||
|
||||
#endif /* _PORTIO_H_ */
|
||||
@@ -1,99 +0,0 @@
|
||||
/* Privilege-related definitions. */
|
||||
|
||||
#ifndef _MINIX_PRIV_H
|
||||
#define _MINIX_PRIV_H
|
||||
|
||||
#include <minix/com.h>
|
||||
#include <minix/config.h>
|
||||
|
||||
/* Static privilege id definitions. */
|
||||
#define NR_STATIC_PRIV_IDS NR_BOOT_PROCS
|
||||
#define is_static_priv_id(id) (id >= 0 && id < NR_STATIC_PRIV_IDS)
|
||||
#define static_priv_id(n) (NR_TASKS + (n))
|
||||
|
||||
/* Unprivileged user processes all share the privilege structure of the
|
||||
* user processesess.
|
||||
* This id must be fixed because it is used to check send mask entries.
|
||||
*/
|
||||
#define USER_PRIV_ID static_priv_id(ROOT_USR_PROC_NR)
|
||||
/* Specifies a null privilege id.
|
||||
*/
|
||||
#define NULL_PRIV_ID (-1)
|
||||
|
||||
/* Allowed targets. */
|
||||
#define NO_M (-1) /* no targets allowed */
|
||||
#define ALL_M (-2) /* all targets allowed */
|
||||
|
||||
/* Allowed calls. */
|
||||
#define NO_C (-1) /* no calls allowed */
|
||||
#define ALL_C (-2) /* all calls allowed */
|
||||
#define NULL_C (-3) /* null call entry */
|
||||
|
||||
/*
|
||||
* Default privilege settings used in the system
|
||||
*/
|
||||
/* privilege flags */
|
||||
#define IDL_F (SYS_PROC | BILLABLE) /* idle task is not preemptible as we
|
||||
* don't want it to interfere with the
|
||||
* timer tick interrupt handler code.
|
||||
* Unlike other processes idle task is
|
||||
* handled in a special way and is
|
||||
* preempted always if timer tick occurs
|
||||
* and there is another runnable process
|
||||
*/
|
||||
#define TSK_F (SYS_PROC) /* other kernel tasks */
|
||||
#define SRV_F (SYS_PROC | PREEMPTIBLE) /* system services */
|
||||
#define DSRV_F (SRV_F | DYN_PRIV_ID) /* dynamic system services */
|
||||
#define RSYS_F (SRV_F | ROOT_SYS_PROC) /* root sys proc */
|
||||
#define VM_F (SYS_PROC | VM_SYS_PROC) /* vm */
|
||||
#define USR_F (BILLABLE | PREEMPTIBLE) /* user processes */
|
||||
#define IMM_F (ROOT_SYS_PROC | VM_SYS_PROC | PREEMPTIBLE) /* immutable */
|
||||
|
||||
/* allowed traps */
|
||||
#define CSK_T (1 << RECEIVE) /* clock and system */
|
||||
#define TSK_T 0 /* other kernel tasks */
|
||||
#define SRV_T (~0) /* system services */
|
||||
#define DSRV_T (~0) /* dynamic system services */
|
||||
#define USR_T (1 << SENDREC) /* user processes */
|
||||
|
||||
/* allowed targets */
|
||||
#define TSK_M NO_M /* all kernel tasks */
|
||||
#define SRV_M ALL_M /* system services */
|
||||
#define DSRV_M ALL_M /* dynamic system services */
|
||||
#define USR_M ALL_M /* user processes */
|
||||
|
||||
/* allowed kernel calls */
|
||||
#define TSK_KC NO_C /* all kernel tasks */
|
||||
#define SRV_KC ALL_C /* dynamic system services */
|
||||
#define DSRV_KC ALL_C /* default sys proc */
|
||||
#define USR_KC NO_C /* user processes */
|
||||
|
||||
/* allowed vm calls */
|
||||
#define SRV_VC ALL_C /* dynamic system services */
|
||||
#define DSRV_VC ALL_C /* default sys proc */
|
||||
#define USR_VC ALL_C /* user processes */
|
||||
|
||||
/* signal manager */
|
||||
#define SRV_SM ROOT_SYS_PROC_NR /* system services */
|
||||
#define DSRV_SM ROOT_SYS_PROC_NR /* dynamic system services */
|
||||
#define USR_SM PM_PROC_NR /* user processes */
|
||||
|
||||
/* scheduler */
|
||||
#define SRV_SCH KERNEL /* system services */
|
||||
#define DSRV_SCH SCHED_PROC_NR /* dynamic system services */
|
||||
#define USR_SCH NONE /* user processes */
|
||||
|
||||
/* scheduling priority queue. */
|
||||
#define SRV_Q USER_Q /* system services */
|
||||
#define DSRV_Q USER_Q /* dynamic system services */
|
||||
#define USR_Q USER_Q /* user processes */
|
||||
|
||||
/* scheduling quantum. */
|
||||
#define SRV_QT USER_QUANTUM /* system services */
|
||||
#define DSRV_QT USER_QUANTUM /* dynamic system services */
|
||||
#define USR_QT USER_QUANTUM /* user processes */
|
||||
|
||||
/* default CPU */
|
||||
#define DSRV_CPU USER_DEFAULT_CPU
|
||||
|
||||
#endif /* _MINIX_PRIV_H */
|
||||
@@ -1,114 +0,0 @@
|
||||
#ifndef _PROFILE_H
|
||||
#define _PROFILE_H
|
||||
|
||||
#include <minix/ansi.h>
|
||||
#include <minix/type.h>
|
||||
|
||||
/*
|
||||
* Types relating to system profiling. Types are supplied for both
|
||||
* statistical profiling and call profiling.
|
||||
*/
|
||||
|
||||
#if SPROFILE
|
||||
|
||||
# define PROF_START 0 /* start statistical profiling */
|
||||
# define PROF_STOP 1 /* stop statistical profiling */
|
||||
|
||||
#define PROF_RTC 0 /* RTC based profiling */
|
||||
#define PROF_NMI 1 /* NMI based profiling, profiles kernel too */
|
||||
|
||||
/* Info struct to be copied to from kernel to user program. */
|
||||
struct sprof_info_s {
|
||||
int mem_used;
|
||||
int total_samples;
|
||||
int idle_samples;
|
||||
int system_samples;
|
||||
int user_samples;
|
||||
} sprof_info_inst;
|
||||
|
||||
/* What a profiling sample looks like (used for sizeof()). */
|
||||
struct sprof_sample {
|
||||
endpoint_t proc;
|
||||
void * pc;
|
||||
};
|
||||
|
||||
struct sprof_proc {
|
||||
endpoint_t proc;
|
||||
char name[8];
|
||||
};
|
||||
|
||||
#endif /* SPROFILE */
|
||||
|
||||
|
||||
#include <minix/types.h>
|
||||
|
||||
# define PROF_GET 2 /* get call profiling tables */
|
||||
# define PROF_RESET 3 /* reset call profiling tables */
|
||||
|
||||
/* Hash table size in each profiled process is table size + index size.
|
||||
*
|
||||
* Table size = CPROF_TABLE_SIZE * (CPROF_CPATH_MAX_LEN + 16).
|
||||
* Index size = CPROF_INDEX_SIZE * 4;
|
||||
*
|
||||
* Making CPROF_CPATH_MAX_LEN too small may cause call path overruns.
|
||||
* Making CPROF_TABLE_SIZE too small may cause table overruns.
|
||||
*
|
||||
* There are some restrictions: processes in the boot image are loaded
|
||||
* below 16 MB and the kernel is loaded in lower memory (below 640 kB). The
|
||||
* latter is reason to use a different size for the kernel table.
|
||||
*/
|
||||
#define CPROF_TABLE_SIZE_OTHER 3000 /* nr of slots in hash table */
|
||||
#define CPROF_TABLE_SIZE_KERNEL 1500 /* kernel has a smaller table */
|
||||
#define CPROF_CPATH_MAX_LEN 256 /* len of cpath string field: */
|
||||
/* MUST BE MULTIPLE OF WORDSIZE */
|
||||
|
||||
#define CPROF_INDEX_SIZE (10*1024)/* size of index to hash table */
|
||||
#define CPROF_STACK_SIZE 24 /* size of call stack */
|
||||
#define CPROF_PROCNAME_LEN 8 /* len of proc name field */
|
||||
|
||||
#define CPROF_CPATH_OVERRUN 0x1 /* call path overrun */
|
||||
#define CPROF_STACK_OVERRUN 0x2 /* call stack overrun */
|
||||
#define CPROF_TABLE_OVERRUN 0x4 /* hash table overrun */
|
||||
|
||||
#define CPROF_ANNOUNCE_OTHER 1 /* processes announce their profiling
|
||||
* data on n-th entry of procentry */
|
||||
#define CPROF_ACCOUNCE_KERNEL 10000 /* kernel announces not directly */
|
||||
|
||||
/* Prototype for function called by procentry to get size of table. */
|
||||
_PROTOTYPE(int profile_get_tbl_size, (void) );
|
||||
/* Prototype for function called by procentry to get announce number. */
|
||||
_PROTOTYPE(int profile_get_announce, (void) );
|
||||
/* Prototype for function called by procentry to announce control struct
|
||||
* and table locations to the kernel. */
|
||||
_PROTOTYPE(void profile_register, (void *ctl_ptr, void *tbl_ptr) );
|
||||
|
||||
/* Info struct to be copied from kernel to user program. */
|
||||
struct cprof_info_s {
|
||||
int mem_used;
|
||||
int err;
|
||||
} cprof_info_inst;
|
||||
|
||||
/* Data structures for control structure and profiling data table in the
|
||||
* in the profiled processes.
|
||||
*/
|
||||
struct cprof_ctl_s {
|
||||
int reset; /* kernel sets to have table reset */
|
||||
int slots_used; /* proc writes nr slots used in table */
|
||||
int err; /* proc writes errors that occurred */
|
||||
} cprof_ctl_inst;
|
||||
|
||||
struct cprof_tbl_s {
|
||||
struct cprof_tbl_s *next; /* next in chain */
|
||||
char cpath[CPROF_CPATH_MAX_LEN]; /* string with call path */
|
||||
int calls; /* nr of executions of path */
|
||||
u64_t cycles; /* execution time of path, in cycles */
|
||||
} cprof_tbl_inst;
|
||||
|
||||
_PROTOTYPE( int sprofile, (int action, int size, int freq, int type,
|
||||
void *ctl_ptr, void *mem_ptr) );
|
||||
|
||||
_PROTOTYPE( int cprofile, (int action, int size, void *ctl_ptr,
|
||||
void *mem_ptr) );
|
||||
|
||||
#endif /* PROFILE_H */
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
#ifndef RS_H
|
||||
#define RS_H
|
||||
|
||||
/*
|
||||
minix/rs.h
|
||||
|
||||
Interface to the reincarnation server
|
||||
*/
|
||||
|
||||
#include <minix/bitmap.h>
|
||||
#include <minix/com.h>
|
||||
|
||||
/* RSS definitions. */
|
||||
#define RSS_NR_IRQ 16
|
||||
#define RSS_NR_IO 16
|
||||
#define RSS_IRQ_ALL (RSS_NR_IRQ+1)
|
||||
#define RSS_IO_ALL (RSS_NR_IO+1)
|
||||
#define RSS_IPC_ALL "IPC_ALL"
|
||||
#define RSS_IPC_ALL_SYS "IPC_ALL_SYS"
|
||||
|
||||
/* RSS flags. */
|
||||
#define RSS_COPY 0x01 /* keep an in-memory copy of the binary */
|
||||
#define RSS_REUSE 0x04 /* Try to reuse previously copied binary */
|
||||
#define RSS_NOBLOCK 0x08 /* unblock caller immediately */
|
||||
#define RSS_REPLICA 0x10 /* keep a replica of the service */
|
||||
#define RSS_SELF_LU 0x20 /* perform self update */
|
||||
#define RSS_SYS_BASIC_CALLS 0x40 /* include basic kernel calls */
|
||||
#define RSS_VM_BASIC_CALLS 0x80 /* include basic vm calls */
|
||||
|
||||
/* Common definitions. */
|
||||
#define RS_NR_CONTROL 8
|
||||
#define RS_NR_PCI_DEVICE 32
|
||||
#define RS_NR_PCI_CLASS 4
|
||||
#define RS_MAX_LABEL_LEN 16
|
||||
|
||||
/* CPU special values */
|
||||
#define RS_CPU_DEFAULT -1 /* use the default cpu or do not change the current one */
|
||||
#define RS_CPU_BSP -2 /* use the bootstrap cpu */
|
||||
|
||||
/* Labels are copied over separately. */
|
||||
struct rss_label
|
||||
{
|
||||
char *l_addr;
|
||||
size_t l_len;
|
||||
};
|
||||
|
||||
/* Arguments needed to start a new driver or server */
|
||||
struct rs_start
|
||||
{
|
||||
unsigned rss_flags;
|
||||
char *rss_cmd;
|
||||
size_t rss_cmdlen;
|
||||
uid_t rss_uid;
|
||||
endpoint_t rss_sigmgr;
|
||||
endpoint_t rss_scheduler;
|
||||
int rss_priority;
|
||||
int rss_quantum;
|
||||
int rss_major;
|
||||
int rss_dev_style;
|
||||
long rss_period;
|
||||
char *rss_script;
|
||||
size_t rss_scriptlen;
|
||||
int rss_nr_irq;
|
||||
int rss_irq[RSS_NR_IRQ];
|
||||
int rss_nr_io;
|
||||
struct { unsigned base; unsigned len; } rss_io[RSS_NR_IO];
|
||||
int rss_nr_pci_id;
|
||||
struct { u16_t vid; u16_t did; } rss_pci_id[RS_NR_PCI_DEVICE];
|
||||
int rss_nr_pci_class;
|
||||
struct { u32_t pciclass; u32_t mask; } rss_pci_class[RS_NR_PCI_CLASS];
|
||||
bitchunk_t rss_system[SYS_CALL_MASK_SIZE];
|
||||
struct rss_label rss_label;
|
||||
char *rss_ipc;
|
||||
size_t rss_ipclen;
|
||||
bitchunk_t rss_vm[VM_CALL_MASK_SIZE];
|
||||
int rss_nr_control;
|
||||
struct rss_label rss_control[RS_NR_CONTROL];
|
||||
|
||||
/*
|
||||
* SMP specific data
|
||||
*
|
||||
* must be at the end of the structure for binary compatibility with
|
||||
* non-smp sysytems
|
||||
*/
|
||||
int rss_cpu;
|
||||
};
|
||||
|
||||
/* ACL information for access to PCI devices */
|
||||
struct rs_pci
|
||||
{
|
||||
char rsp_label[RS_MAX_LABEL_LEN];
|
||||
int rsp_endpoint;
|
||||
int rsp_nr_device;
|
||||
struct { u16_t vid; u16_t did; } rsp_device[RS_NR_PCI_DEVICE];
|
||||
int rsp_nr_class;
|
||||
struct { u32_t pciclass; u32_t mask; } rsp_class[RS_NR_PCI_CLASS];
|
||||
};
|
||||
|
||||
/* Definition of a public entry of the system process table. */
|
||||
struct rprocpub {
|
||||
short in_use; /* set when the entry is in use */
|
||||
unsigned sys_flags; /* sys flags */
|
||||
endpoint_t endpoint; /* process endpoint number */
|
||||
|
||||
int dev_flags; /* device flags */
|
||||
dev_t dev_nr; /* major device number */
|
||||
int dev_style; /* device style */
|
||||
int dev_style2; /* device style for next major dev number */
|
||||
|
||||
char label[RS_MAX_LABEL_LEN]; /* label of this service */
|
||||
char proc_name[RS_MAX_LABEL_LEN]; /* process name of this service */
|
||||
|
||||
bitchunk_t vm_call_mask[VM_CALL_MASK_SIZE]; /* vm call mask */
|
||||
|
||||
struct rs_pci pci_acl; /* pci acl */
|
||||
};
|
||||
|
||||
_PROTOTYPE( int minix_rs_lookup, (const char *name, endpoint_t *value));
|
||||
|
||||
#endif
|
||||
@@ -1,90 +0,0 @@
|
||||
|
||||
#ifndef _MINIX_SAFECOPIES_H
|
||||
#define _MINIX_SAFECOPIES_H 1
|
||||
|
||||
#include <minix/sys_config.h>
|
||||
#include <minix/types.h>
|
||||
#include <minix/vm.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
int cp_flags; /* CPF_* below */
|
||||
union {
|
||||
struct {
|
||||
/* CPF_DIRECT */
|
||||
endpoint_t cp_who_to; /* grantee */
|
||||
vir_bytes cp_start; /* memory */
|
||||
size_t cp_len; /* size in bytes */
|
||||
char cp_reserved[8]; /* future use */
|
||||
} cp_direct;
|
||||
struct {
|
||||
/* CPF_INDIRECT */
|
||||
endpoint_t cp_who_to; /* grantee */
|
||||
endpoint_t cp_who_from; /* previous granter */
|
||||
cp_grant_id_t cp_grant; /* previous grant */
|
||||
char cp_reserved[8];/* future use */
|
||||
} cp_indirect;
|
||||
struct {
|
||||
/* CPF_MAGIC */
|
||||
endpoint_t cp_who_from; /* granter */
|
||||
endpoint_t cp_who_to; /* grantee */
|
||||
vir_bytes cp_start; /* memory */
|
||||
size_t cp_len; /* size in bytes */
|
||||
char cp_reserved[8]; /* future use */
|
||||
} cp_magic;
|
||||
} cp_u;
|
||||
char cp_reserved[8]; /* future use */
|
||||
} cp_grant_t;
|
||||
|
||||
/* Vectored safecopy. */
|
||||
struct vscp_vec {
|
||||
/* Exactly one of the following must be SELF. */
|
||||
endpoint_t v_from; /* source */
|
||||
endpoint_t v_to; /* destination */
|
||||
|
||||
cp_grant_id_t v_gid; /* grant id of other process */
|
||||
size_t v_offset; /* offset in other grant */
|
||||
vir_bytes v_addr; /* address in copier's space */
|
||||
size_t v_bytes; /* no. of bytes */
|
||||
};
|
||||
|
||||
/* Invalid grant number. */
|
||||
#define GRANT_INVALID ((cp_grant_id_t) -1)
|
||||
#define GRANT_VALID(g) ((g) > GRANT_INVALID)
|
||||
|
||||
/* Operations: any combination is ok. */
|
||||
#define CPF_READ 0x000001 /* Granted process may read. */
|
||||
#define CPF_WRITE 0x000002 /* Granted process may write. */
|
||||
#define CPF_MAP 0x000004 /* Granted process may map. */
|
||||
|
||||
/* Internal flags. */
|
||||
#define CPF_USED 0x000100 /* Grant slot in use. */
|
||||
#define CPF_DIRECT 0x000200 /* Grant from this process to another. */
|
||||
#define CPF_INDIRECT 0x000400 /* Grant from grant to another. */
|
||||
#define CPF_MAGIC 0x000800 /* Grant from any to any. */
|
||||
#define CPF_VALID 0x001000 /* Grant slot contains valid grant. */
|
||||
|
||||
/* Prototypes for functions in libsys. */
|
||||
_PROTOTYPE( cp_grant_id_t cpf_grant_direct, (endpoint_t, vir_bytes, size_t, int));
|
||||
_PROTOTYPE( cp_grant_id_t cpf_grant_indirect, (endpoint_t, endpoint_t, cp_grant_id_t));
|
||||
_PROTOTYPE( cp_grant_id_t cpf_grant_magic, (endpoint_t, endpoint_t, vir_bytes, size_t, int));
|
||||
_PROTOTYPE( int cpf_revoke, (cp_grant_id_t grant_id));
|
||||
_PROTOTYPE( int cpf_lookup, (cp_grant_id_t g, endpoint_t *ep, endpoint_t *ep2));
|
||||
|
||||
_PROTOTYPE( int cpf_getgrants, (cp_grant_id_t *grant_ids, int n));
|
||||
_PROTOTYPE( int cpf_setgrant_direct, (cp_grant_id_t g, endpoint_t who,
|
||||
vir_bytes addr, size_t size, int access));
|
||||
_PROTOTYPE( int cpf_setgrant_indirect, (cp_grant_id_t g, endpoint_t who_to,
|
||||
endpoint_t who_from, cp_grant_id_t his_g));
|
||||
_PROTOTYPE( int cpf_setgrant_magic, (cp_grant_id_t g, endpoint_t who_to,
|
||||
endpoint_t who_from, vir_bytes addr, size_t bytes, int access));
|
||||
_PROTOTYPE( int cpf_setgrant_disable, (cp_grant_id_t grant_id));
|
||||
_PROTOTYPE( void cpf_reload, (void));
|
||||
|
||||
/* Set a process' grant table location and size (in-kernel only). */
|
||||
#define _K_SET_GRANT_TABLE(rp, ptr, entries) \
|
||||
priv(rp)->s_grant_table= (ptr); \
|
||||
priv(rp)->s_grant_entries= (entries);
|
||||
|
||||
#endif /* _MINIX_SAFECOPIES_H */
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
/* Prototypes for System Event Framework (SEF) functions. */
|
||||
|
||||
#ifndef _SEF_H
|
||||
#define _SEF_H
|
||||
|
||||
#include <minix/ipc.h>
|
||||
|
||||
/* SEF entry points for system processes. */
|
||||
_PROTOTYPE( void sef_startup, (void) );
|
||||
_PROTOTYPE( int sef_receive_status, (endpoint_t src, message *m_ptr,
|
||||
int *status_ptr) );
|
||||
_PROTOTYPE( void sef_exit, (int status) );
|
||||
#define sef_receive(src, m_ptr) sef_receive_status(src, m_ptr, NULL)
|
||||
|
||||
/* SEF Debug. */
|
||||
#include <stdio.h>
|
||||
#define sef_dprint printf
|
||||
#define sef_debug_begin() (void)(NULL)
|
||||
#define sef_debug_end() (void)(NULL)
|
||||
|
||||
/*===========================================================================*
|
||||
* SEF Init *
|
||||
*===========================================================================*/
|
||||
/* What to intercept. */
|
||||
#define INTERCEPT_SEF_INIT_REQUESTS 1
|
||||
#define IS_SEF_INIT_REQUEST(mp) ((mp)->m_type == RS_INIT \
|
||||
&& (mp)->m_source == RS_PROC_NR)
|
||||
|
||||
/* Type definitions. */
|
||||
typedef struct {
|
||||
cp_grant_id_t rproctab_gid;
|
||||
endpoint_t endpoint;
|
||||
endpoint_t old_endpoint;
|
||||
} sef_init_info_t;
|
||||
|
||||
/* Callback type definitions. */
|
||||
typedef int(*sef_cb_init_t)(int type, sef_init_info_t *info);
|
||||
typedef int(*sef_cb_init_response_t)(message *m_ptr);
|
||||
|
||||
/* Callback registration helpers. */
|
||||
_PROTOTYPE( void sef_setcb_init_fresh, (sef_cb_init_t cb));
|
||||
_PROTOTYPE( void sef_setcb_init_lu, (sef_cb_init_t cb));
|
||||
_PROTOTYPE( void sef_setcb_init_restart, (sef_cb_init_t cb));
|
||||
_PROTOTYPE( void sef_setcb_init_response, (sef_cb_init_response_t cb) );
|
||||
|
||||
/* Predefined callback implementations. */
|
||||
_PROTOTYPE( int sef_cb_init_null, (int type, sef_init_info_t *info) );
|
||||
_PROTOTYPE( int sef_cb_init_response_null, (message *m_ptr) );
|
||||
|
||||
_PROTOTYPE( int sef_cb_init_fail, (int type, sef_init_info_t *info) );
|
||||
_PROTOTYPE( int sef_cb_init_crash, (int type, sef_init_info_t *info) );
|
||||
_PROTOTYPE( int sef_cb_init_response_rs_reply, (message *m_ptr) );
|
||||
|
||||
/* Macros for predefined callback implementations. */
|
||||
#define SEF_CB_INIT_FRESH_NULL sef_cb_init_null
|
||||
#define SEF_CB_INIT_LU_NULL sef_cb_init_null
|
||||
#define SEF_CB_INIT_RESTART_NULL sef_cb_init_null
|
||||
#define SEF_CB_INIT_RESPONSE_NULL sef_cb_init_response_null
|
||||
|
||||
#define SEF_CB_INIT_FRESH_DEFAULT sef_cb_init_null
|
||||
#define SEF_CB_INIT_LU_DEFAULT sef_cb_init_null
|
||||
#define SEF_CB_INIT_RESTART_DEFAULT sef_cb_init_null
|
||||
#define SEF_CB_INIT_RESPONSE_DEFAULT sef_cb_init_response_rs_reply
|
||||
|
||||
/* Init types. */
|
||||
#define SEF_INIT_FRESH 0 /* init fresh */
|
||||
#define SEF_INIT_LU 1 /* init after live update */
|
||||
#define SEF_INIT_RESTART 2 /* init after restart */
|
||||
|
||||
/* Debug. */
|
||||
#define SEF_INIT_DEBUG_DEFAULT 0
|
||||
|
||||
#ifndef SEF_INIT_DEBUG
|
||||
#define SEF_INIT_DEBUG SEF_INIT_DEBUG_DEFAULT
|
||||
#endif
|
||||
|
||||
#define sef_init_dprint sef_dprint
|
||||
#define sef_init_debug_begin sef_debug_begin
|
||||
#define sef_init_debug_end sef_debug_end
|
||||
|
||||
/*===========================================================================*
|
||||
* SEF Ping *
|
||||
*===========================================================================*/
|
||||
/* What to intercept. */
|
||||
#define INTERCEPT_SEF_PING_REQUESTS 1
|
||||
#define IS_SEF_PING_REQUEST(mp, status) (is_ipc_notify(status) \
|
||||
&& (mp)->m_source == RS_PROC_NR)
|
||||
|
||||
/* Callback type definitions. */
|
||||
typedef void(*sef_cb_ping_reply_t)(endpoint_t source);
|
||||
|
||||
/* Callback registration helpers. */
|
||||
_PROTOTYPE( void sef_setcb_ping_reply, (sef_cb_ping_reply_t cb));
|
||||
|
||||
/* Predefined callback implementations. */
|
||||
_PROTOTYPE( void sef_cb_ping_reply_null, (endpoint_t source) );
|
||||
|
||||
_PROTOTYPE( void sef_cb_ping_reply_pong, (endpoint_t source) );
|
||||
|
||||
/* Macros for predefined callback implementations. */
|
||||
#define SEF_CB_PING_REPLY_NULL sef_cb_ping_reply_null
|
||||
|
||||
#define SEF_CB_PING_REPLY_DEFAULT sef_cb_ping_reply_pong
|
||||
|
||||
/* Debug. */
|
||||
#define SEF_PING_DEBUG_DEFAULT 0
|
||||
|
||||
#ifndef SEF_PING_DEBUG
|
||||
#define SEF_PING_DEBUG SEF_PING_DEBUG_DEFAULT
|
||||
#endif
|
||||
|
||||
#define sef_ping_dprint sef_dprint
|
||||
#define sef_ping_debug_begin sef_debug_begin
|
||||
#define sef_ping_debug_end sef_debug_end
|
||||
|
||||
/*===========================================================================*
|
||||
* SEF Live update *
|
||||
*===========================================================================*/
|
||||
/* What to intercept. */
|
||||
#define INTERCEPT_SEF_LU_REQUESTS 1
|
||||
#define IS_SEF_LU_REQUEST(mp, status) ((mp)->m_type == RS_LU_PREPARE \
|
||||
&& (mp)->m_source == RS_PROC_NR)
|
||||
|
||||
/* Callback type definitions. */
|
||||
typedef int(*sef_cb_lu_prepare_t)(int);
|
||||
typedef int(*sef_cb_lu_state_isvalid_t)(int);
|
||||
typedef void(*sef_cb_lu_state_changed_t)(int, int);
|
||||
typedef void(*sef_cb_lu_state_dump_t)(int);
|
||||
typedef int(*sef_cb_lu_state_save_t)(int);
|
||||
typedef int(*sef_cb_lu_response_t)(message *m_ptr);
|
||||
|
||||
/* Callback registration helpers. */
|
||||
_PROTOTYPE( void sef_setcb_lu_prepare, (sef_cb_lu_prepare_t cb) );
|
||||
_PROTOTYPE( void sef_setcb_lu_state_isvalid, (sef_cb_lu_state_isvalid_t cb) );
|
||||
_PROTOTYPE( void sef_setcb_lu_state_changed, (sef_cb_lu_state_changed_t cb) );
|
||||
_PROTOTYPE( void sef_setcb_lu_state_dump, (sef_cb_lu_state_dump_t cb) );
|
||||
_PROTOTYPE( void sef_setcb_lu_state_save, (sef_cb_lu_state_save_t cb) );
|
||||
_PROTOTYPE( void sef_setcb_lu_response, (sef_cb_lu_response_t cb) );
|
||||
|
||||
/* Predefined callback implementations. */
|
||||
_PROTOTYPE( int sef_cb_lu_prepare_null, (int state) );
|
||||
_PROTOTYPE( int sef_cb_lu_state_isvalid_null, (int state) );
|
||||
_PROTOTYPE( void sef_cb_lu_state_changed_null, (int old_state, int state) );
|
||||
_PROTOTYPE( void sef_cb_lu_state_dump_null, (int state) );
|
||||
_PROTOTYPE( int sef_cb_lu_state_save_null, (int state) );
|
||||
_PROTOTYPE( int sef_cb_lu_response_null, (message *m_ptr) );
|
||||
|
||||
_PROTOTYPE( int sef_cb_lu_prepare_always_ready, (int state) );
|
||||
_PROTOTYPE( int sef_cb_lu_prepare_never_ready, (int state) );
|
||||
_PROTOTYPE( int sef_cb_lu_prepare_crash, (int state) );
|
||||
_PROTOTYPE( int sef_cb_lu_state_isvalid_standard, (int state) );
|
||||
_PROTOTYPE( int sef_cb_lu_state_isvalid_workfree, (int state) );
|
||||
_PROTOTYPE( int sef_cb_lu_response_rs_reply, (message *m_ptr) );
|
||||
|
||||
/* Macros for predefined callback implementations. */
|
||||
#define SEF_CB_LU_PREPARE_NULL sef_cb_lu_prepare_null
|
||||
#define SEF_CB_LU_STATE_ISVALID_NULL sef_cb_lu_state_isvalid_null
|
||||
#define SEF_CB_LU_STATE_CHANGED_NULL sef_cb_lu_state_changed_null
|
||||
#define SEF_CB_LU_STATE_DUMP_NULL sef_cb_lu_state_dump_null
|
||||
#define SEF_CB_LU_STATE_SAVE_NULL sef_cb_lu_state_save_null
|
||||
#define SEF_CB_LU_RESPONSE_NULL sef_cb_lu_response_null
|
||||
|
||||
#define SEF_CB_LU_PREPARE_DEFAULT sef_cb_lu_prepare_null
|
||||
#define SEF_CB_LU_STATE_ISVALID_DEFAULT sef_cb_lu_state_isvalid_null
|
||||
#define SEF_CB_LU_STATE_CHANGED_DEFAULT sef_cb_lu_state_changed_null
|
||||
#define SEF_CB_LU_STATE_DUMP_DEFAULT sef_cb_lu_state_dump_null
|
||||
#define SEF_CB_LU_STATE_SAVE_DEFAULT sef_cb_lu_state_save_null
|
||||
#define SEF_CB_LU_RESPONSE_DEFAULT sef_cb_lu_response_rs_reply
|
||||
|
||||
/* Standard live update states. */
|
||||
#define SEF_LU_STATE_NULL 0 /* null state */
|
||||
#define SEF_LU_STATE_WORK_FREE 1 /* no work in progress */
|
||||
#define SEF_LU_STATE_REQUEST_FREE 2 /* no request in progress */
|
||||
#define SEF_LU_STATE_PROTOCOL_FREE 3 /* no protocol in progress */
|
||||
#define SEF_LU_STATE_CUSTOM_BASE (SEF_LU_STATE_PROTOCOL_FREE+1)
|
||||
#define SEF_LU_STATE_IS_STANDARD(s) ((s) > SEF_LU_STATE_NULL \
|
||||
&& (s) < SEF_LU_STATE_CUSTOM_BASE)
|
||||
|
||||
/* Debug. */
|
||||
#define SEF_LU_DEBUG_DEFAULT 1
|
||||
|
||||
#ifndef SEF_LU_DEBUG
|
||||
#define SEF_LU_DEBUG SEF_LU_DEBUG_DEFAULT
|
||||
#endif
|
||||
|
||||
#define sef_lu_dprint sef_dprint
|
||||
#define sef_lu_debug_begin sef_debug_begin
|
||||
#define sef_lu_debug_end sef_debug_end
|
||||
|
||||
/*===========================================================================*
|
||||
* SEF Signal *
|
||||
*===========================================================================*/
|
||||
/* What to intercept. */
|
||||
#define INTERCEPT_SEF_SIGNAL_REQUESTS 1
|
||||
#define IS_SEF_SIGNAL_REQUEST(mp, status) \
|
||||
(((mp)->m_type == SIGS_SIGNAL_RECEIVED && (mp)->m_source < INIT_PROC_NR) \
|
||||
|| (is_ipc_notify(status) && (mp)->m_source == SYSTEM))
|
||||
|
||||
/* Callback type definitions. */
|
||||
typedef void(*sef_cb_signal_handler_t)(int signo);
|
||||
typedef int(*sef_cb_signal_manager_t)(endpoint_t target, int signo);
|
||||
typedef int(*sef_cb_gcov_t)(message *msg);
|
||||
|
||||
/* Callback registration helpers. */
|
||||
_PROTOTYPE( void sef_setcb_signal_handler, (sef_cb_signal_handler_t cb));
|
||||
_PROTOTYPE( void sef_setcb_signal_manager, (sef_cb_signal_manager_t cb));
|
||||
_PROTOTYPE( void sef_setcb_gcov, (sef_cb_gcov_t cb));
|
||||
|
||||
/* Predefined callback implementations. */
|
||||
_PROTOTYPE( void sef_cb_signal_handler_null, (int signo) );
|
||||
_PROTOTYPE( int sef_cb_signal_manager_null, (endpoint_t target, int signo) );
|
||||
|
||||
_PROTOTYPE( void sef_cb_signal_handler_term, (int signo) );
|
||||
_PROTOTYPE( void sef_cb_signal_handler_posix_default, (int signo) );
|
||||
|
||||
/* Macros for predefined callback implementations. */
|
||||
#define SEF_CB_SIGNAL_HANDLER_NULL sef_cb_signal_handler_null
|
||||
#define SEF_CB_SIGNAL_MANAGER_NULL sef_cb_signal_manager_null
|
||||
|
||||
#define SEF_CB_SIGNAL_HANDLER_DEFAULT sef_cb_signal_handler_null
|
||||
#define SEF_CB_SIGNAL_MANAGER_DEFAULT sef_cb_signal_manager_null
|
||||
|
||||
/* Debug. */
|
||||
#define SEF_SIGNAL_DEBUG_DEFAULT 0
|
||||
|
||||
#ifndef SEF_SIGNAL_DEBUG
|
||||
#define SEF_SIGNAL_DEBUG SEF_SIGNAL_DEBUG_DEFAULT
|
||||
#endif
|
||||
|
||||
#define sef_signal_dprint sef_dprint
|
||||
#define sef_signal_debug_begin sef_debug_begin
|
||||
#define sef_signal_debug_end sef_debug_end
|
||||
|
||||
#endif /* _SEF_H */
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/* Prototypes for condition spinning helper functions (part of libsys). */
|
||||
#ifndef _MINIX_SPIN_H
|
||||
#define _MINIX_SPIN_H
|
||||
|
||||
/* Opaque spin state structure. */
|
||||
typedef struct {
|
||||
int s_state;
|
||||
u32_t s_usecs;
|
||||
u64_t s_base_tsc;
|
||||
clock_t s_base_uptime;
|
||||
int s_timeout;
|
||||
} spin_t;
|
||||
|
||||
/* Functions. */
|
||||
_PROTOTYPE( void spin_init, (spin_t *s, u32_t usecs) );
|
||||
_PROTOTYPE( int spin_check, (spin_t *s) );
|
||||
|
||||
/* Macros. */
|
||||
|
||||
/* Execute a loop for at least 'u' microseconds, using spin object 's'.
|
||||
* The body of the loop is guaranteed to be executed at least once.
|
||||
*/
|
||||
#define SPIN_FOR(s,u) \
|
||||
for (spin_init((s), (u)); spin_check((s)); )
|
||||
|
||||
/* Return whether spin object 's' timed out after a loop. */
|
||||
#define SPIN_TIMEOUT(s) ((s)->s_timeout)
|
||||
|
||||
/* Spin until the given condition becomes true, or 'u' microseconds expired.
|
||||
* The condition is guaranteed to be checked at least once.
|
||||
*/
|
||||
#define SPIN_UNTIL(c,u) do { \
|
||||
spin_t s; \
|
||||
SPIN_FOR(&s,(u)) \
|
||||
if (c) break; \
|
||||
} while (0)
|
||||
|
||||
#endif /* _MINIX_SPIN_H */
|
||||
@@ -1,57 +0,0 @@
|
||||
#ifndef _MINIX_SYS_CONFIG_H
|
||||
#define _MINIX_SYS_CONFIG_H 1
|
||||
|
||||
/*===========================================================================*
|
||||
* This section contains user-settable parameters *
|
||||
*===========================================================================*/
|
||||
#define _MINIX_MACHINE _MACHINE_IBM_PC
|
||||
|
||||
#define _MACHINE_IBM_PC 1 /* any 8088 or 80x86-based system */
|
||||
|
||||
/* Word size in bytes (a constant equal to sizeof(int)). */
|
||||
#if __ACK__ || __GNUC__
|
||||
#define _WORD_SIZE _EM_WSIZE
|
||||
#define _PTR_SIZE _EM_WSIZE
|
||||
#endif
|
||||
|
||||
#define _NR_PROCS 256
|
||||
#define _NR_SYS_PROCS 64
|
||||
|
||||
/* Set the CHIP type based on the machine selected. The symbol CHIP is actually
|
||||
* indicative of more than just the CPU. For example, machines for which
|
||||
* CHIP == INTEL are expected to have 8259A interrrupt controllers and the
|
||||
* other properties of IBM PC/XT/AT/386 types machines in general. */
|
||||
#define _CHIP_INTEL 1 /* CHIP type for PC, XT, AT, 386 and clones */
|
||||
#define _CHIP_M68000 2 /* CHIP type for Atari, Amiga, Macintosh */
|
||||
#define _CHIP_SPARC 3 /* CHIP type for SUN-4 (e.g. SPARCstation) */
|
||||
|
||||
/* Set the FP_FORMAT type based on the machine selected, either hw or sw */
|
||||
#define _FP_NONE 0 /* no floating point support */
|
||||
#define _FP_IEEE 1 /* conform IEEE floating point standard */
|
||||
|
||||
#if (_MINIX_MACHINE == _MACHINE_IBM_PC)
|
||||
#define _MINIX_CHIP _CHIP_INTEL
|
||||
#endif
|
||||
|
||||
#ifndef _MINIX_FP_FORMAT
|
||||
#define _MINIX_FP_FORMAT _FP_NONE
|
||||
#endif
|
||||
|
||||
#ifndef _MINIX_MACHINE
|
||||
error "In <minix/sys_config.h> please define _MINIX_MACHINE"
|
||||
#endif
|
||||
|
||||
#ifndef _MINIX_CHIP
|
||||
error "In <minix/sys_config.h> please define _MINIX_MACHINE to have a legal value"
|
||||
#endif
|
||||
|
||||
#if (_MINIX_MACHINE == 0)
|
||||
error "_MINIX_MACHINE has incorrect value (0)"
|
||||
#endif
|
||||
|
||||
/* Kernel debug checks */
|
||||
#define DEBUG_LOCK_CHECK 1 /* Interrupt Lock/unlock sanity checking. */
|
||||
|
||||
#define _KMESS_BUF_SIZE 10000
|
||||
|
||||
#endif /* _MINIX_SYS_CONFIG_H */
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
#ifndef _MINIX_SYSINFO_H
|
||||
#define _MINIX_SYSINFO_H
|
||||
|
||||
#include <minix/endpoint.h>
|
||||
#include <minix/type.h>
|
||||
|
||||
_PROTOTYPE( int getsysinfo, (endpoint_t who, int what, void *where) );
|
||||
|
||||
/* What system info to retrieve with sysgetinfo(). */
|
||||
#define SI_PROC_TAB 2 /* copy of entire process table */
|
||||
#define SI_DMAP_TAB 3 /* get device <-> driver mappings */
|
||||
#define SI_DATA_STORE 5 /* get copy of data store mappings */
|
||||
#define SI_SUBSCRIPTION 6 /* get copy of data store subscriptions */
|
||||
#define SI_LOADINFO 7 /* get copy of load average structure */
|
||||
#define SI_CALL_STATS 9 /* system call statistics */
|
||||
#define SI_PROCPUB_TAB 11 /* copy of public entries of process table */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,274 +0,0 @@
|
||||
/* Prototypes for system library functions. */
|
||||
|
||||
#ifndef _SYSLIB_H
|
||||
#define _SYSLIB_H
|
||||
|
||||
#ifndef _TYPES_H
|
||||
#include <minix/types.h>
|
||||
#endif
|
||||
|
||||
#ifndef _IPC_H
|
||||
#include <minix/ipc.h>
|
||||
#endif
|
||||
|
||||
#include <minix/u64.h>
|
||||
|
||||
#ifndef _DEVIO_H
|
||||
#include <minix/devio.h>
|
||||
#endif
|
||||
|
||||
#include <minix/safecopies.h>
|
||||
#include <minix/sef.h>
|
||||
#include <machine/mcontext.h>
|
||||
|
||||
/* Forward declaration */
|
||||
struct reg86u;
|
||||
struct rs_pci;
|
||||
|
||||
#define SYSTASK SYSTEM
|
||||
|
||||
/*==========================================================================*
|
||||
* Minix system library. *
|
||||
*==========================================================================*/
|
||||
_PROTOTYPE( int _taskcall, (endpoint_t who, int syscallnr, message *msgptr));
|
||||
_PROTOTYPE( int _kernel_call, (int syscallnr, message *msgptr));
|
||||
|
||||
_PROTOTYPE( int sys_abort, (int how, ...));
|
||||
_PROTOTYPE( int sys_enable_iop, (endpoint_t proc_ep));
|
||||
_PROTOTYPE( int sys_exec, (endpoint_t proc_ep, char *ptr,
|
||||
char *aout, vir_bytes initpc));
|
||||
_PROTOTYPE( int sys_fork, (endpoint_t parent, endpoint_t child, endpoint_t *,
|
||||
struct mem_map *ptr, u32_t vm, vir_bytes *));
|
||||
_PROTOTYPE( int sys_newmap, (endpoint_t proc_ep, struct mem_map *ptr));
|
||||
_PROTOTYPE( int sys_clear, (endpoint_t proc_ep));
|
||||
_PROTOTYPE( int sys_exit, (void));
|
||||
_PROTOTYPE( int sys_trace, (int req, endpoint_t proc_ep, long addr, long *data_p));
|
||||
|
||||
_PROTOTYPE( int sys_schedule, (endpoint_t proc_ep, int priority,
|
||||
int quantum, int cpu));
|
||||
_PROTOTYPE( int sys_schedctl, (unsigned flags, endpoint_t proc_ep,
|
||||
int priority, int quantum, int cpu));
|
||||
|
||||
/* Shorthands for sys_runctl() system call. */
|
||||
#define sys_stop(proc_ep) sys_runctl(proc_ep, RC_STOP, 0)
|
||||
#define sys_delay_stop(proc_ep) sys_runctl(proc_ep, RC_STOP, RC_DELAY)
|
||||
#define sys_resume(proc_ep) sys_runctl(proc_ep, RC_RESUME, 0)
|
||||
_PROTOTYPE( int sys_runctl, (endpoint_t proc_ep, int action, int flags));
|
||||
|
||||
_PROTOTYPE( int sys_update, (endpoint_t src_ep, endpoint_t dst_ep));
|
||||
_PROTOTYPE( int sys_statectl, (int request));
|
||||
_PROTOTYPE( int sys_privctl, (endpoint_t proc_ep, int req, void *p));
|
||||
_PROTOTYPE( int sys_privquery_mem, (endpoint_t proc_ep,
|
||||
phys_bytes physstart, phys_bytes physlen));
|
||||
_PROTOTYPE( int sys_setgrant, (cp_grant_t *grants, int ngrants));
|
||||
|
||||
_PROTOTYPE( int sys_int86, (struct reg86u *reg86p));
|
||||
_PROTOTYPE( int sys_vm_setbuf, (phys_bytes base, phys_bytes size,
|
||||
phys_bytes high));
|
||||
_PROTOTYPE( int sys_vm_map, (endpoint_t proc_ep, int do_map,
|
||||
phys_bytes base, phys_bytes size, phys_bytes offset));
|
||||
_PROTOTYPE( int sys_vmctl, (endpoint_t who, int param, u32_t value));
|
||||
_PROTOTYPE( int sys_vmctl_get_cr3_i386, (endpoint_t who, u32_t *cr3) );
|
||||
_PROTOTYPE( int sys_vmctl_get_memreq, (endpoint_t *who, vir_bytes *mem,
|
||||
vir_bytes *len, int *wrflag, endpoint_t *who_s, vir_bytes *mem_s,
|
||||
endpoint_t *) );
|
||||
_PROTOTYPE( int sys_vmctl_enable_paging, (void * data));
|
||||
|
||||
_PROTOTYPE( int sys_readbios, (phys_bytes address, void *buf, size_t size));
|
||||
_PROTOTYPE( int sys_stime, (time_t boottime));
|
||||
_PROTOTYPE( int sys_sysctl, (int ctl, char *arg1, int arg2));
|
||||
_PROTOTYPE( int sys_sysctl_stacktrace, (endpoint_t who));
|
||||
_PROTOTYPE( int sys_vmctl_get_mapping, (int index, phys_bytes *addr,
|
||||
phys_bytes *len, int *flags));
|
||||
_PROTOTYPE( int sys_vmctl_reply_mapping, (int index, vir_bytes addr));
|
||||
_PROTOTYPE( int sys_vmctl_set_addrspace, (endpoint_t who,
|
||||
phys_bytes ptroot, void *ptroot_v));
|
||||
|
||||
|
||||
/* Shorthands for sys_sdevio() system call. */
|
||||
#define sys_insb(port, proc_ep, buffer, count) \
|
||||
sys_sdevio(DIO_INPUT_BYTE, port, proc_ep, buffer, count, 0)
|
||||
#define sys_insw(port, proc_ep, buffer, count) \
|
||||
sys_sdevio(DIO_INPUT_WORD, port, proc_ep, buffer, count, 0)
|
||||
#define sys_outsb(port, proc_ep, buffer, count) \
|
||||
sys_sdevio(DIO_OUTPUT_BYTE, port, proc_ep, buffer, count, 0)
|
||||
#define sys_outsw(port, proc_ep, buffer, count) \
|
||||
sys_sdevio(DIO_OUTPUT_WORD, port, proc_ep, buffer, count, 0)
|
||||
#define sys_safe_insb(port, ept, grant, offset, count) \
|
||||
sys_sdevio(DIO_SAFE_INPUT_BYTE, port, ept, (void*)grant, count, offset)
|
||||
#define sys_safe_outsb(port, ept, grant, offset, count) \
|
||||
sys_sdevio(DIO_SAFE_OUTPUT_BYTE, port, ept, (void*)grant, count, offset)
|
||||
#define sys_safe_insw(port, ept, grant, offset, count) \
|
||||
sys_sdevio(DIO_SAFE_INPUT_WORD, port, ept, (void*)grant, count, offset)
|
||||
#define sys_safe_outsw(port, ept, grant, offset, count) \
|
||||
sys_sdevio(DIO_SAFE_OUTPUT_WORD, port, ept, (void*)grant, count, offset)
|
||||
_PROTOTYPE( int sys_sdevio, (int req, long port, endpoint_t proc_ep,
|
||||
void *buffer, int count, vir_bytes offset));
|
||||
_PROTOTYPE(void *alloc_contig, (size_t len, int flags, phys_bytes *phys));
|
||||
_PROTOTYPE(int free_contig, (void *addr, size_t len));
|
||||
|
||||
#define AC_ALIGN4K 0x01
|
||||
#define AC_LOWER16M 0x02
|
||||
#define AC_ALIGN64K 0x04
|
||||
#define AC_LOWER1M 0x08
|
||||
|
||||
/* Clock functionality: get system times, (un)schedule an alarm call, or
|
||||
* retrieve/set a process-virtual timer.
|
||||
*/
|
||||
_PROTOTYPE( int sys_times, (endpoint_t proc_ep, clock_t *user_time,
|
||||
clock_t *sys_time, clock_t *uptime, time_t *boottime));
|
||||
_PROTOTYPE(int sys_setalarm, (clock_t exp_time, int abs_time));
|
||||
_PROTOTYPE( int sys_vtimer, (endpoint_t proc_nr, int which, clock_t *newval,
|
||||
clock_t *oldval));
|
||||
|
||||
/* Shorthands for sys_irqctl() system call. */
|
||||
#define sys_irqdisable(hook_id) \
|
||||
sys_irqctl(IRQ_DISABLE, 0, 0, hook_id)
|
||||
#define sys_irqenable(hook_id) \
|
||||
sys_irqctl(IRQ_ENABLE, 0, 0, hook_id)
|
||||
#define sys_irqsetpolicy(irq_vec, policy, hook_id) \
|
||||
sys_irqctl(IRQ_SETPOLICY, irq_vec, policy, hook_id)
|
||||
#define sys_irqrmpolicy(hook_id) \
|
||||
sys_irqctl(IRQ_RMPOLICY, 0, 0, hook_id)
|
||||
_PROTOTYPE ( int sys_irqctl, (int request, int irq_vec, int policy,
|
||||
int *irq_hook_id) );
|
||||
|
||||
/* Shorthands for sys_vircopy() and sys_physcopy() system calls. */
|
||||
#define sys_biosin(bios_vir, dst_vir, bytes) \
|
||||
sys_vircopy(SELF, BIOS_SEG, bios_vir, SELF, D, dst_vir, bytes)
|
||||
#define sys_biosout(src_vir, bios_vir, bytes) \
|
||||
sys_vircopy(SELF, D, src_vir, SELF, BIOS_SEG, bios_vir, bytes)
|
||||
#define sys_datacopy(src_proc, src_vir, dst_proc, dst_vir, bytes) \
|
||||
sys_vircopy(src_proc, D, src_vir, dst_proc, D, dst_vir, bytes)
|
||||
#define sys_textcopy(src_proc, src_vir, dst_proc, dst_vir, bytes) \
|
||||
sys_vircopy(src_proc, T, src_vir, dst_proc, T, dst_vir, bytes)
|
||||
#define sys_stackcopy(src_proc, src_vir, dst_proc, dst_vir, bytes) \
|
||||
sys_vircopy(src_proc, S, src_vir, dst_proc, S, dst_vir, bytes)
|
||||
_PROTOTYPE(int sys_vircopy, (endpoint_t src_proc, int src_s, vir_bytes src_v,
|
||||
endpoint_t dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes));
|
||||
|
||||
#define sys_abscopy(src_phys, dst_phys, bytes) \
|
||||
sys_physcopy(NONE, PHYS_SEG, src_phys, NONE, PHYS_SEG, dst_phys, bytes)
|
||||
_PROTOTYPE(int sys_physcopy, (endpoint_t src_proc, int src_seg, vir_bytes src_vir,
|
||||
endpoint_t dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes));
|
||||
|
||||
|
||||
/* Grant-based copy functions. */
|
||||
_PROTOTYPE(int sys_safecopyfrom, (endpoint_t source, cp_grant_id_t grant,
|
||||
vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg));
|
||||
_PROTOTYPE(int sys_safecopyto, (endpoint_t dest, cp_grant_id_t grant,
|
||||
vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg));
|
||||
_PROTOTYPE(int sys_vsafecopy, (struct vscp_vec *copyvec, int elements));
|
||||
|
||||
_PROTOTYPE(int sys_memset, (unsigned long pattern,
|
||||
phys_bytes base, phys_bytes bytes));
|
||||
|
||||
/* Grant-based map functions. */
|
||||
_PROTOTYPE(int sys_safemap, (endpoint_t grantor, cp_grant_id_t grant,
|
||||
vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg,
|
||||
int writable));
|
||||
_PROTOTYPE(int sys_saferevmap_gid, (cp_grant_id_t grant));
|
||||
_PROTOTYPE(int sys_saferevmap_addr, (vir_bytes addr));
|
||||
_PROTOTYPE(int sys_safeunmap, (int my_seg, vir_bytes my_address));
|
||||
|
||||
_PROTOTYPE(int sys_umap, (endpoint_t proc_ep, int seg, vir_bytes vir_addr,
|
||||
vir_bytes bytes, phys_bytes *phys_addr));
|
||||
_PROTOTYPE(int sys_umap_data_fb, (endpoint_t proc_ep, vir_bytes vir_addr,
|
||||
vir_bytes bytes, phys_bytes *phys_addr));
|
||||
_PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off,
|
||||
phys_bytes phys, vir_bytes size));
|
||||
|
||||
/* Shorthands for sys_getinfo() system call. */
|
||||
#define sys_getkmessages(dst) sys_getinfo(GET_KMESSAGES, dst, 0,0,0)
|
||||
#define sys_getkinfo(dst) sys_getinfo(GET_KINFO, dst, 0,0,0)
|
||||
#define sys_getloadinfo(dst) sys_getinfo(GET_LOADINFO, dst, 0,0,0)
|
||||
#define sys_getmachine(dst) sys_getinfo(GET_MACHINE, dst, 0,0,0)
|
||||
#define sys_getcpuinfo(dst) sys_getinfo(GET_CPUINFO, dst, 0,0,0)
|
||||
#define sys_getproctab(dst) sys_getinfo(GET_PROCTAB, dst, 0,0,0)
|
||||
#define sys_getprivtab(dst) sys_getinfo(GET_PRIVTAB, dst, 0,0,0)
|
||||
#define sys_getproc(dst,nr) sys_getinfo(GET_PROC, dst, 0,0, nr)
|
||||
#define sys_getrandomness(dst) sys_getinfo(GET_RANDOMNESS, dst, 0,0,0)
|
||||
#define sys_getrandom_bin(d,b) sys_getinfo(GET_RANDOMNESS_BIN, d, 0,0,b)
|
||||
#define sys_getimage(dst) sys_getinfo(GET_IMAGE, dst, 0,0,0)
|
||||
#define sys_getirqhooks(dst) sys_getinfo(GET_IRQHOOKS, dst, 0,0,0)
|
||||
#define sys_getirqactids(dst) sys_getinfo(GET_IRQACTIDS, dst, 0,0,0)
|
||||
#define sys_getmonparams(v,vl) sys_getinfo(GET_MONPARAMS, v,vl, 0,0)
|
||||
#define sys_getschedinfo(v1,v2) sys_getinfo(GET_SCHEDINFO, v1,0, v2,0)
|
||||
#define sys_getpriv(dst, nr) sys_getinfo(GET_PRIV, dst, 0,0, nr)
|
||||
#define sys_getidletsc(dst) sys_getinfo(GET_IDLETSC, dst, 0,0,0)
|
||||
#define sys_getaoutheader(dst,nr) sys_getinfo(GET_AOUTHEADER, dst, 0,0,nr)
|
||||
_PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
|
||||
void *val_ptr2, int val_len2) );
|
||||
_PROTOTYPE(int sys_whoami, (endpoint_t *ep, char *name, int namelen,
|
||||
int *priv_flags));
|
||||
|
||||
/* Signal control. */
|
||||
_PROTOTYPE(int sys_kill, (endpoint_t proc_ep, int sig) );
|
||||
_PROTOTYPE(int sys_sigsend, (endpoint_t proc_ep, struct sigmsg *sig_ctxt) );
|
||||
_PROTOTYPE(int sys_sigreturn, (endpoint_t proc_ep, struct sigmsg *sig_ctxt) );
|
||||
_PROTOTYPE(int sys_getksig, (endpoint_t *proc_ep, sigset_t *k_sig_map) );
|
||||
_PROTOTYPE(int sys_endksig, (endpoint_t proc_ep) );
|
||||
|
||||
/* NOTE: two different approaches were used to distinguish the device I/O
|
||||
* types 'byte', 'word', 'long': the latter uses #define and results in a
|
||||
* smaller implementation, but looses the static type checking.
|
||||
*/
|
||||
_PROTOTYPE(int sys_voutb, (pvb_pair_t *pvb_pairs, int nr_ports) );
|
||||
_PROTOTYPE(int sys_voutw, (pvw_pair_t *pvw_pairs, int nr_ports) );
|
||||
_PROTOTYPE(int sys_voutl, (pvl_pair_t *pvl_pairs, int nr_ports) );
|
||||
_PROTOTYPE(int sys_vinb, (pvb_pair_t *pvb_pairs, int nr_ports) );
|
||||
_PROTOTYPE(int sys_vinw, (pvw_pair_t *pvw_pairs, int nr_ports) );
|
||||
_PROTOTYPE(int sys_vinl, (pvl_pair_t *pvl_pairs, int nr_ports) );
|
||||
|
||||
/* Shorthands for sys_out() system call. */
|
||||
#define sys_outb(p,v) sys_out((p), (unsigned long) (v), _DIO_BYTE)
|
||||
#define sys_outw(p,v) sys_out((p), (unsigned long) (v), _DIO_WORD)
|
||||
#define sys_outl(p,v) sys_out((p), (unsigned long) (v), _DIO_LONG)
|
||||
_PROTOTYPE(int sys_out, (int port, unsigned long value, int type) );
|
||||
|
||||
/* Shorthands for sys_in() system call. */
|
||||
#define sys_inb(p,v) sys_in((p), (v), _DIO_BYTE)
|
||||
#define sys_inw(p,v) sys_in((p), (v), _DIO_WORD)
|
||||
#define sys_inl(p,v) sys_in((p), (v), _DIO_LONG)
|
||||
_PROTOTYPE(int sys_in, (int port, unsigned long *value, int type) );
|
||||
|
||||
/* pci.c */
|
||||
_PROTOTYPE( void pci_init, (void) );
|
||||
_PROTOTYPE( void pci_init1, (char *name) );
|
||||
_PROTOTYPE( int pci_first_dev, (int *devindp, u16_t *vidp, u16_t *didp) );
|
||||
_PROTOTYPE( int pci_next_dev, (int *devindp, u16_t *vidp, u16_t *didp) );
|
||||
_PROTOTYPE( int pci_find_dev, (u8_t bus, u8_t dev, u8_t func,
|
||||
int *devindp) );
|
||||
_PROTOTYPE( void pci_reserve, (int devind) );
|
||||
_PROTOTYPE( int pci_reserve_ok, (int devind) );
|
||||
_PROTOTYPE( void pci_ids, (int devind, u16_t *vidp, u16_t *didp) );
|
||||
_PROTOTYPE( void pci_rescan_bus, (u8_t busnr) );
|
||||
_PROTOTYPE( u8_t pci_attr_r8, (int devind, int port) );
|
||||
_PROTOTYPE( u16_t pci_attr_r16, (int devind, int port) );
|
||||
_PROTOTYPE( u32_t pci_attr_r32, (int devind, int port) );
|
||||
_PROTOTYPE( void pci_attr_w8, (int devind, int port, u8_t value) );
|
||||
_PROTOTYPE( void pci_attr_w16, (int devind, int port, u16_t value) );
|
||||
_PROTOTYPE( void pci_attr_w32, (int devind, int port, u32_t value) );
|
||||
_PROTOTYPE( char *pci_dev_name, (u16_t vid, u16_t did) );
|
||||
_PROTOTYPE( char *pci_slot_name, (int devind) );
|
||||
_PROTOTYPE( int pci_set_acl, (struct rs_pci *rs_pci) );
|
||||
_PROTOTYPE( int pci_del_acl, (endpoint_t proc_ep) );
|
||||
_PROTOTYPE( int pci_get_bar, (int devind, int port, u32_t *base,
|
||||
u32_t *size, int *ioflag) );
|
||||
|
||||
/* Profiling. */
|
||||
_PROTOTYPE( int sys_sprof, (int action, int size, int freq, int type,
|
||||
endpoint_t endpt, void *ctl_ptr, void *mem_ptr) );
|
||||
_PROTOTYPE( int sys_cprof, (int action, int size, endpoint_t endpt,
|
||||
void *ctl_ptr, void *mem_ptr) );
|
||||
_PROTOTYPE( int sys_profbuf, (void *ctl_ptr, void *mem_ptr) );
|
||||
|
||||
/* machine context */
|
||||
_PROTOTYPE( int sys_getmcontext, (endpoint_t proc, mcontext_t *mcp) );
|
||||
_PROTOTYPE( int sys_setmcontext, (endpoint_t proc, mcontext_t *mcp) );
|
||||
|
||||
/* input */
|
||||
_PROTOTYPE( int tty_input_inject, (int type, int code, int val) );
|
||||
|
||||
#endif /* _SYSLIB_H */
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
#ifndef _MINIX_SYSUTIL_H
|
||||
#define _MINIX_SYSUTIL_H 1
|
||||
|
||||
#include <minix/ipc.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* Extra system library definitions to support device drivers and servers.
|
||||
*
|
||||
* Created:
|
||||
* Mar 15, 2004 by Jorrit N. Herder
|
||||
*
|
||||
* Changes:
|
||||
* May 31, 2005: added printf, kputc (relocated from syslib)
|
||||
* May 31, 2005: added getuptime
|
||||
* Mar 18, 2005: added tickdelay
|
||||
* Oct 01, 2004: added env_parse, env_prefix, env_panic
|
||||
* Jul 13, 2004: added fkey_ctl
|
||||
* Apr 28, 2004: added report, panic
|
||||
* Mar 31, 2004: setup like other libraries, such as syslib
|
||||
*/
|
||||
|
||||
/*==========================================================================*
|
||||
* Miscellaneous helper functions.
|
||||
*==========================================================================*/
|
||||
|
||||
/* Environment parsing return values. */
|
||||
#define EP_BUF_SIZE 128 /* local buffer for env value */
|
||||
#define EP_UNSET 0 /* variable not set */
|
||||
#define EP_OFF 1 /* var = off */
|
||||
#define EP_ON 2 /* var = on (or field left blank) */
|
||||
#define EP_SET 3 /* var = 1:2:3 (nonblank field) */
|
||||
#define EP_EGETKENV 4 /* sys_getkenv() failed ... */
|
||||
|
||||
extern int env_argc;
|
||||
extern char **env_argv;
|
||||
|
||||
_PROTOTYPE( void env_setargs, (int argc, char *argv[]) );
|
||||
_PROTOTYPE( int env_get_param, (char *key, char *value, int max_size) );
|
||||
_PROTOTYPE( int env_prefix, (char *env, char *prefix) );
|
||||
_PROTOTYPE( void env_panic, (char *key) );
|
||||
_PROTOTYPE( int env_parse, (char *env, char *fmt, int field, long *param,
|
||||
long min, long max) );
|
||||
|
||||
#define fkey_map(fkeys, sfkeys) fkey_ctl(FKEY_MAP, (fkeys), (sfkeys))
|
||||
#define fkey_unmap(fkeys, sfkeys) fkey_ctl(FKEY_UNMAP, (fkeys), (sfkeys))
|
||||
#define fkey_events(fkeys, sfkeys) fkey_ctl(FKEY_EVENTS, (fkeys), (sfkeys))
|
||||
_PROTOTYPE( int fkey_ctl, (int req, int *fkeys, int *sfkeys) );
|
||||
|
||||
_PROTOTYPE( int printf, (const char *fmt, ...));
|
||||
_PROTOTYPE( void kputc, (int c));
|
||||
_PROTOTYPE( __dead void panic, (const char *fmt, ...));
|
||||
_PROTOTYPE( int getuptime, (clock_t *ticks));
|
||||
_PROTOTYPE( int getuptime2, (clock_t *ticks, time_t *boottime));
|
||||
_PROTOTYPE( int tickdelay, (clock_t ticks));
|
||||
_PROTOTYPE( int tsc_calibrate, (void));
|
||||
_PROTOTYPE( u32_t sys_hz, (void));
|
||||
_PROTOTYPE( double getidle, (void));
|
||||
_PROTOTYPE( void util_stacktrace, (void));
|
||||
_PROTOTYPE( void util_nstrcat, (char *str, unsigned long n) );
|
||||
_PROTOTYPE( void util_stacktrace_strcat, (char *));
|
||||
_PROTOTYPE( int micro_delay, (u32_t micros));
|
||||
_PROTOTYPE( u32_t tsc_64_to_micros, (u64_t tsc));
|
||||
_PROTOTYPE( u32_t tsc_to_micros, (u32_t low, u32_t high));
|
||||
_PROTOTYPE( u32_t tsc_get_khz, (void));
|
||||
_PROTOTYPE( u32_t micros_to_ticks, (u32_t micros));
|
||||
_PROTOTYPE( void ser_putc, (char c));
|
||||
_PROTOTYPE( void get_randomness, (struct k_randomness *, int));
|
||||
|
||||
#define asynsend(ep, msg) asynsend3(ep, msg, 0)
|
||||
_PROTOTYPE( int asynsend3, (endpoint_t ep, message *msg, int flags));
|
||||
|
||||
#define ASSERT(c) if(!(c)) { panic("%s:%d: assert %s failed", __FILE__, __LINE__, #c); }
|
||||
|
||||
/* timing library */
|
||||
#define TIMING_CATEGORIES 20
|
||||
|
||||
#define TIMING_POINTS 20 /* timing resolution */
|
||||
#define TIMING_CATEGORIES 20
|
||||
#define TIMING_NAME 10
|
||||
|
||||
struct util_timingdata {
|
||||
char names[TIMING_NAME];
|
||||
unsigned long lock_timings[TIMING_POINTS];
|
||||
unsigned long lock_timings_range[2];
|
||||
unsigned long binsize, resets, misses, measurements;
|
||||
unsigned long starttimes[2]; /* nonzero if running */
|
||||
};
|
||||
|
||||
typedef struct util_timingdata util_timingdata_t;
|
||||
|
||||
#endif /* _MINIX_SYSUTIL_H */
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef _MINIX_TIMERS_H
|
||||
#define _MINIX_TIMERS_H
|
||||
|
||||
/* Timers abstraction for system processes. This would be in minix/sysutil.h
|
||||
* if it weren't for naming conflicts.
|
||||
*/
|
||||
|
||||
#include <timers.h>
|
||||
|
||||
_PROTOTYPE( void init_timer, (timer_t *tp));
|
||||
_PROTOTYPE( void set_timer, (timer_t *tp, int ticks, tmr_func_t watchdog,
|
||||
int arg));
|
||||
_PROTOTYPE( void cancel_timer, (timer_t *tp));
|
||||
_PROTOTYPE( void expire_timers, (clock_t now));
|
||||
|
||||
#endif /* _MINIX_TIMERS_H */
|
||||
@@ -1,215 +0,0 @@
|
||||
#ifndef _TYPE_H
|
||||
#define _TYPE_H
|
||||
|
||||
#ifndef _MINIX_SYS_CONFIG_H
|
||||
#include <minix/sys_config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _TYPES_H
|
||||
#include <minix/types.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Type definitions. */
|
||||
typedef unsigned int vir_clicks; /* virtual addr/length in clicks */
|
||||
typedef unsigned long phys_bytes; /* physical addr/length in bytes */
|
||||
typedef unsigned int phys_clicks; /* physical addr/length in clicks */
|
||||
typedef int endpoint_t; /* process identifier */
|
||||
|
||||
typedef int32_t cp_grant_id_t; /* A grant ID. */
|
||||
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
typedef long unsigned int vir_bytes; /* virtual addresses/lengths in bytes */
|
||||
#endif
|
||||
|
||||
#if (_MINIX_CHIP == _CHIP_M68000)
|
||||
typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
|
||||
#endif
|
||||
|
||||
#if (_MINIX_CHIP == _CHIP_SPARC)
|
||||
typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
|
||||
#endif
|
||||
|
||||
/* Memory map for local text, stack, data segments. */
|
||||
struct mem_map {
|
||||
vir_clicks mem_vir; /* virtual address */
|
||||
phys_clicks mem_phys; /* physical address */
|
||||
vir_clicks mem_len; /* length */
|
||||
};
|
||||
|
||||
/* Memory map for remote memory areas, e.g., for the RAM disk. */
|
||||
struct far_mem {
|
||||
int in_use; /* entry in use, unless zero */
|
||||
phys_clicks mem_phys; /* physical address */
|
||||
vir_clicks mem_len; /* length */
|
||||
};
|
||||
|
||||
/* Structure for virtual copying by means of a vector with requests. */
|
||||
struct vir_addr {
|
||||
endpoint_t proc_nr_e;
|
||||
int segment;
|
||||
vir_bytes offset;
|
||||
};
|
||||
|
||||
#define phys_cp_req vir_cp_req
|
||||
struct vir_cp_req {
|
||||
struct vir_addr src;
|
||||
struct vir_addr dst;
|
||||
phys_bytes count;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
vir_bytes iov_addr; /* address of an I/O buffer */
|
||||
vir_bytes iov_size; /* sizeof an I/O buffer */
|
||||
} iovec_t;
|
||||
|
||||
typedef struct {
|
||||
cp_grant_id_t iov_grant; /* grant ID of an I/O buffer */
|
||||
vir_bytes iov_size; /* sizeof an I/O buffer */
|
||||
} iovec_s_t;
|
||||
|
||||
/* PM passes the address of a structure of this type to KERNEL when
|
||||
* sys_sigsend() is invoked as part of the signal catching mechanism.
|
||||
* The structure contain all the information that KERNEL needs to build
|
||||
* the signal stack.
|
||||
*/
|
||||
struct sigmsg {
|
||||
int sm_signo; /* signal number being caught */
|
||||
unsigned long sm_mask; /* mask to restore when handler returns */
|
||||
vir_bytes sm_sighandler; /* address of handler */
|
||||
vir_bytes sm_sigreturn; /* address of _sigreturn in C library */
|
||||
vir_bytes sm_stkptr; /* user stack pointer */
|
||||
};
|
||||
|
||||
/* This is used to obtain system information through SYS_GETINFO. */
|
||||
struct kinfo {
|
||||
phys_bytes code_base; /* base of kernel code */
|
||||
phys_bytes code_size;
|
||||
phys_bytes data_base; /* base of kernel data */
|
||||
phys_bytes data_size;
|
||||
vir_bytes proc_addr; /* virtual address of process table */
|
||||
phys_bytes _kmem_base; /* kernel memory layout (/dev/kmem) */
|
||||
phys_bytes _kmem_size;
|
||||
phys_bytes bootdev_base; /* boot device from boot image (/dev/boot) */
|
||||
phys_bytes bootdev_size;
|
||||
phys_bytes ramdev_base; /* boot device from boot image (/dev/boot) */
|
||||
phys_bytes ramdev_size;
|
||||
phys_bytes _params_base; /* parameters passed by boot monitor */
|
||||
phys_bytes _params_size;
|
||||
int nr_procs; /* number of user processes */
|
||||
int nr_tasks; /* number of kernel tasks */
|
||||
char release[6]; /* kernel release number */
|
||||
char version[6]; /* kernel version number */
|
||||
};
|
||||
|
||||
/* Load data accounted every this no. of seconds. */
|
||||
#define _LOAD_UNIT_SECS 6 /* Changing this breaks ABI. */
|
||||
|
||||
/* Load data history is kept for this long. */
|
||||
#define _LOAD_HISTORY_MINUTES 15 /* Changing this breaks ABI. */
|
||||
#define _LOAD_HISTORY_SECONDS (60*_LOAD_HISTORY_MINUTES)
|
||||
|
||||
/* We need this many slots to store the load history. */
|
||||
#define _LOAD_HISTORY (_LOAD_HISTORY_SECONDS/_LOAD_UNIT_SECS)
|
||||
|
||||
/* Runnable processes and other load-average information. */
|
||||
struct loadinfo {
|
||||
u16_t proc_load_history[_LOAD_HISTORY]; /* history of proc_s_cur */
|
||||
u16_t proc_last_slot;
|
||||
clock_t last_clock;
|
||||
};
|
||||
|
||||
struct cpu_info {
|
||||
u8_t vendor;
|
||||
u8_t family;
|
||||
u8_t model;
|
||||
u8_t stepping;
|
||||
u32_t freq; /* in MHz */
|
||||
u32_t flags[2];
|
||||
};
|
||||
|
||||
struct machine {
|
||||
int pc_at;
|
||||
int ps_mca;
|
||||
int processor;
|
||||
unsigned processors_count; /* how many cpus are available */
|
||||
unsigned bsp_id; /* id of the bootstrap cpu */
|
||||
int padding; /* used to be protected */
|
||||
int vdu_ega;
|
||||
int vdu_vga;
|
||||
int apic_enabled; /* does the kernel use APIC or not? */
|
||||
phys_bytes acpi_rsdp; /* where is the acpi RSDP */
|
||||
};
|
||||
|
||||
struct io_range
|
||||
{
|
||||
unsigned ior_base; /* Lowest I/O port in range */
|
||||
unsigned ior_limit; /* Highest I/O port in range */
|
||||
};
|
||||
|
||||
struct mem_range
|
||||
{
|
||||
phys_bytes mr_base; /* Lowest memory address in range */
|
||||
phys_bytes mr_limit; /* Highest memory address in range */
|
||||
};
|
||||
|
||||
/* For EXEC_NEWMEM */
|
||||
struct exec_newmem
|
||||
{
|
||||
vir_bytes text_addr; /* Starting address of text section */
|
||||
vir_bytes text_bytes; /* Length of text section (in bytes) */
|
||||
vir_bytes data_addr; /* Starting address of data section */
|
||||
vir_bytes data_bytes; /* Length of data section (in bytes) */
|
||||
vir_bytes tot_bytes; /* Minimum stack region size (in bytes) */
|
||||
vir_bytes args_bytes; /* Arguments/environ size on stack (in bytes) */
|
||||
int sep_id; /* Separate I&D? */
|
||||
int is_elf; /* Is ELF exe? */
|
||||
dev_t st_dev; /* Device holding executable file */
|
||||
ino_t st_ino; /* Inode of executable file */
|
||||
time_t st_ctime; /* Last changed time of executable file */
|
||||
uid_t new_uid; /* Process UID after exec */
|
||||
gid_t new_gid; /* Process GID after exec */
|
||||
char progname[16]; /* Should be at least PROC_NAME_LEN */
|
||||
};
|
||||
|
||||
/* Memory chunks. */
|
||||
struct memory {
|
||||
phys_bytes base;
|
||||
phys_bytes size;
|
||||
};
|
||||
|
||||
#define STATICINIT(v, n) \
|
||||
if(!(v)) { \
|
||||
if(!((v) = alloc_contig(sizeof(*(v)) * (n), 0, NULL))) { \
|
||||
panic("allocating " #v " failed: %d", n); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* The kernel outputs diagnostic messages in a circular buffer. */
|
||||
struct kmessages {
|
||||
int km_next; /* next index to write */
|
||||
int km_size; /* current size in buffer */
|
||||
char km_buf[_KMESS_BUF_SIZE]; /* buffer for messages */
|
||||
};
|
||||
|
||||
#include <minix/config.h>
|
||||
#include <machine/interrupt.h>
|
||||
|
||||
/* randomness struct: random sources after interrupts: */
|
||||
#define RANDOM_SOURCES 16
|
||||
#define RANDOM_ELEMENTS 64
|
||||
|
||||
typedef unsigned short rand_t;
|
||||
|
||||
struct k_randomness {
|
||||
int random_elements, random_sources;
|
||||
struct k_randomness_bin {
|
||||
int r_next; /* next index to write */
|
||||
int r_size; /* number of random elements */
|
||||
rand_t r_buf[RANDOM_ELEMENTS]; /* buffer for random info */
|
||||
} bin[RANDOM_SOURCES];
|
||||
};
|
||||
|
||||
#endif /* _TYPE_H */
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
/* Prototypes and definitions for VM interface. */
|
||||
|
||||
#ifndef _MINIX_VM_H
|
||||
#define _MINIX_VM_H
|
||||
|
||||
#include <minix/types.h>
|
||||
#include <minix/endpoint.h>
|
||||
|
||||
_PROTOTYPE( int vm_exit, (endpoint_t ep));
|
||||
_PROTOTYPE( int vm_fork, (endpoint_t ep, int slotno, endpoint_t *child_ep));
|
||||
_PROTOTYPE( int vm_brk, (endpoint_t ep, char *newaddr));
|
||||
_PROTOTYPE( int vm_exec_newmem, (endpoint_t ep, struct exec_newmem *args,
|
||||
int args_bytes, char **ret_stack_top, int *ret_flags));
|
||||
_PROTOTYPE( int vm_push_sig, (endpoint_t ep, vir_bytes *old_sp));
|
||||
_PROTOTYPE( int vm_willexit, (endpoint_t ep));
|
||||
_PROTOTYPE( int vm_adddma, (endpoint_t req_e, endpoint_t proc_e,
|
||||
phys_bytes start, phys_bytes size) );
|
||||
_PROTOTYPE( int vm_deldma, (endpoint_t req_e, endpoint_t proc_e,
|
||||
phys_bytes start, phys_bytes size) );
|
||||
_PROTOTYPE( int vm_getdma, (endpoint_t req_e, endpoint_t *procp,
|
||||
phys_bytes *basep, phys_bytes *sizep) );
|
||||
_PROTOTYPE( void *vm_map_phys, (endpoint_t who, void *physaddr, size_t len));
|
||||
_PROTOTYPE( int vm_unmap_phys, (endpoint_t who, void *vaddr, size_t len));
|
||||
|
||||
_PROTOTYPE( int vm_notify_sig, (endpoint_t ep, endpoint_t ipc_ep));
|
||||
_PROTOTYPE( int vm_set_priv, (int procnr, void *buf));
|
||||
_PROTOTYPE( int vm_update, (endpoint_t src_e, endpoint_t dst_e));
|
||||
_PROTOTYPE( int vm_memctl, (endpoint_t ep, int req));
|
||||
_PROTOTYPE( int vm_query_exit, (int *endpt));
|
||||
_PROTOTYPE( int vm_forgetblock, (u64_t id));
|
||||
_PROTOTYPE( void vm_forgetblocks, (void));
|
||||
_PROTOTYPE( int vm_yield_block_get_block, (u64_t yieldid, u64_t getid,
|
||||
void *mem, vir_bytes len));
|
||||
|
||||
/* Invalid ID with special meaning for the vm_yield_block_get_block
|
||||
* interface.
|
||||
*/
|
||||
#define VM_BLOCKID_NONE make64(ULONG_MAX, ULONG_MAX)
|
||||
|
||||
/* VM kernel request types. */
|
||||
#define VMPTYPE_NONE 0
|
||||
#define VMPTYPE_CHECK 1
|
||||
#define VMPTYPE_COWMAP 2
|
||||
#define VMPTYPE_SMAP 3
|
||||
#define VMPTYPE_SUNMAP 4
|
||||
|
||||
struct vm_stats_info {
|
||||
unsigned int vsi_pagesize; /* page size */
|
||||
unsigned long vsi_total; /* total number of memory pages */
|
||||
unsigned long vsi_free; /* number of free pages */
|
||||
unsigned long vsi_largest; /* largest number of consecutive free pages */
|
||||
unsigned long vsi_cached; /* number of pages cached for file systems */
|
||||
};
|
||||
|
||||
struct vm_usage_info {
|
||||
vir_bytes vui_total; /* total amount of process memory */
|
||||
vir_bytes vui_common; /* part of memory mapped in more than once */
|
||||
vir_bytes vui_shared; /* shared (non-COW) part of common memory */
|
||||
};
|
||||
|
||||
struct vm_region_info {
|
||||
int vri_seg; /* segment of virtual region (T or D) */
|
||||
vir_bytes vri_addr; /* base address of region */
|
||||
vir_bytes vri_length; /* length of region */
|
||||
int vri_prot; /* protection flags (PROT_) */
|
||||
int vri_flags; /* memory flags (subset of MAP_) */
|
||||
};
|
||||
|
||||
#define MAX_VRI_COUNT 64 /* max. number of regions provided at once */
|
||||
|
||||
_PROTOTYPE( int vm_info_stats, (struct vm_stats_info *vfi) );
|
||||
_PROTOTYPE( int vm_info_usage, (endpoint_t who,
|
||||
struct vm_usage_info *vui) );
|
||||
_PROTOTYPE( int vm_info_region, (endpoint_t who,
|
||||
struct vm_region_info *vri, int count, vir_bytes *next) );
|
||||
|
||||
#endif /* _MINIX_VM_H */
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
|
||||
INCSDIR= /usr/include/sys
|
||||
|
||||
INCS= asynchio.h dir.h file.h ioc_cmos.h ioc_disk.h \
|
||||
ioc_file.h ioc_memory.h ioc_scsi.h ioc_sound.h ioc_tape.h \
|
||||
ioctl.h ioc_tty.h ipc.h jmp_buf.h kbdio.h mman.h \
|
||||
INCS= asynchio.h dir.h file.h \
|
||||
ioctl.h ipc.h jmp_buf.h kbdio.h mman.h \
|
||||
mount.h mtio.h param.h ptrace.h queue.h resource.h \
|
||||
select.h sem.h shm.h sigcontext.h signal.h socket.h \
|
||||
soundcard.h statfs.h statvfs.h stat.h svrctl.h timeb.h \
|
||||
@@ -12,4 +11,7 @@ INCS= asynchio.h dir.h file.h ioc_cmos.h ioc_disk.h \
|
||||
utsname.h video.h vm.h wait.h cdefs.h null.h poll.h \
|
||||
elf32.h elf64.h elf_common.h elf_generic.h
|
||||
|
||||
.include "../../common/include/sys/Makefile.inc"
|
||||
.include "../../common/include/sys/Makefile.mount.inc"
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/* sys/ioc_cmos.h - CMOS ioctl() command codes.
|
||||
*/
|
||||
|
||||
#ifndef _S_I_CMOS_H
|
||||
#define _S_I_CMOS_H
|
||||
|
||||
#include <minix/ioctl.h>
|
||||
|
||||
#define CIOCGETTIME _IOR('c', 1, struct tm)
|
||||
#define CIOCGETTIMEY2K _IOR('c', 2, struct tm)
|
||||
#define CIOCSETTIME _IOW('c', 3, u32_t)
|
||||
#define CIOCSETTIMEY2K _IOW('c', 4, u32_t)
|
||||
|
||||
#endif /* _S_I_CMOS_H */
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/* sys/ioc_disk.h - Disk ioctl() command codes. Author: Kees J. Bot
|
||||
* 23 Nov 2002
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _S_I_DISK_H
|
||||
#define _S_I_DISK_H
|
||||
|
||||
#include <minix/ioctl.h>
|
||||
|
||||
#define DIOCSETP _IOW('d', 3, struct partition)
|
||||
#define DIOCGETP _IOR('d', 4, struct partition)
|
||||
#define DIOCEJECT _IO ('d', 5)
|
||||
#define DIOCTIMEOUT _IORW('d', 6, int)
|
||||
#define DIOCOPENCT _IOR('d', 7, int)
|
||||
#define DIOCFLUSH _IO ('d', 8)
|
||||
#define DIOCSETWC _IOW('d', 9, int)
|
||||
#define DIOCGETWC _IOR('d', 10, int)
|
||||
|
||||
#endif /* _S_I_DISK_H */
|
||||
@@ -1,11 +0,0 @@
|
||||
/* sys/ioc_file.h - File ioctl() command codes.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_IOC_FILE_H
|
||||
#define _SYS_IOC_FILE_H
|
||||
|
||||
#include <minix/ioctl.h>
|
||||
|
||||
#define FIONREAD _IOR('f', 1, int)
|
||||
|
||||
#endif /* _SYS_IOC_FILE_H */
|
||||
@@ -1,16 +0,0 @@
|
||||
/* sys/ioc_memory.h - Memory ioctl() command codes.
|
||||
* Author: Kees J. Bot
|
||||
* 23 Nov 2002
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _S_I_MEMORY_H
|
||||
#define _S_I_MEMORY_H
|
||||
|
||||
#include <minix/ioctl.h>
|
||||
|
||||
#define MIOCRAMSIZE _IOW('m', 3, u32_t)
|
||||
#define MIOCMAP _IOW('m', 4, struct mapreq)
|
||||
#define MIOCUNMAP _IOW('m', 5, struct mapreq)
|
||||
|
||||
#endif /* _S_I_MEMORY_H */
|
||||
@@ -1,13 +0,0 @@
|
||||
/* sys/ioc_scsi.h - SCSI ioctl() command codes. Author: Kees J. Bot
|
||||
* 23 Nov 2002
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _S_I_SCSI_H
|
||||
#define _S_I_SCSI_H
|
||||
|
||||
#include <minix/ioctl.h>
|
||||
|
||||
#define SCIOCCMD _IOW('S', 1, struct scsicmd)
|
||||
|
||||
#endif /* _S_I_SCSI_H */
|
||||
@@ -1,34 +0,0 @@
|
||||
/* sys/ioc_sound.h - Sound ioctl() command codes. Author: Kees J. Bot
|
||||
* 23 Nov 2002
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _S_I_SOUND_H
|
||||
#define _S_I_SOUND_H
|
||||
|
||||
#include <minix/ioctl.h>
|
||||
|
||||
/* Soundcard DSP ioctls. */
|
||||
#define DSPIORATE _IOW('s', 1, unsigned int)
|
||||
#define DSPIOSTEREO _IOW('s', 2, unsigned int)
|
||||
#define DSPIOSIZE _IOW('s', 3, unsigned int)
|
||||
#define DSPIOBITS _IOW('s', 4, unsigned int)
|
||||
#define DSPIOSIGN _IOW('s', 5, unsigned int)
|
||||
#define DSPIOMAX _IOR('s', 6, unsigned int)
|
||||
#define DSPIORESET _IO ('s', 7)
|
||||
#define DSPIOFREEBUF _IOR('s', 30, unsigned int)
|
||||
#define DSPIOSAMPLESINBUF _IOR('s', 31, unsigned int)
|
||||
#define DSPIOPAUSE _IO ('s', 32)
|
||||
#define DSPIORESUME _IO ('s', 33)
|
||||
|
||||
/* Soundcard mixer ioctls. */
|
||||
#define MIXIOGETVOLUME _IORW('s', 10, struct volume_level)
|
||||
#define MIXIOGETINPUTLEFT _IORW('s', 11, struct inout_ctrl)
|
||||
#define MIXIOGETINPUTRIGHT _IORW('s', 12, struct inout_ctrl)
|
||||
#define MIXIOGETOUTPUT _IORW('s', 13, struct inout_ctrl)
|
||||
#define MIXIOSETVOLUME _IORW('s', 20, struct volume_level)
|
||||
#define MIXIOSETINPUTLEFT _IORW('s', 21, struct inout_ctrl)
|
||||
#define MIXIOSETINPUTRIGHT _IORW('s', 22, struct inout_ctrl)
|
||||
#define MIXIOSETOUTPUT _IORW('s', 23, struct inout_ctrl)
|
||||
|
||||
#endif /* _S_I_SOUND_H */
|
||||
@@ -1,15 +0,0 @@
|
||||
/* sys/ioc_tape.h - Magnetic Tape ioctl() command codes.
|
||||
* Author: Kees J. Bot
|
||||
* 23 Nov 2002
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _S_I_TAPE_H
|
||||
#define _S_I_TAPE_H
|
||||
|
||||
#include <minix/ioctl.h>
|
||||
|
||||
#define MTIOCTOP _IOW('M', 1, struct mtop)
|
||||
#define MTIOCGET _IOR('M', 2, struct mtget)
|
||||
|
||||
#endif /* _S_I_TAPE_H */
|
||||
@@ -1,43 +0,0 @@
|
||||
/* sys/ioc_tty.h - Terminal ioctl() command codes.
|
||||
* Author: Kees J. Bot
|
||||
* 23 Nov 2002
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _S_I_TTY_H
|
||||
#define _S_I_TTY_H
|
||||
|
||||
#include <minix/ioctl.h>
|
||||
|
||||
/* Terminal ioctls. */
|
||||
#define TCGETS _IOR('T', 8, struct termios) /* tcgetattr */
|
||||
#define TCSETS _IOW('T', 9, struct termios) /* tcsetattr, TCSANOW */
|
||||
#define TCSETSW _IOW('T', 10, struct termios) /* tcsetattr, TCSADRAIN */
|
||||
#define TCSETSF _IOW('T', 11, struct termios) /* tcsetattr, TCSAFLUSH */
|
||||
#define TCSBRK _IOW('T', 12, int) /* tcsendbreak */
|
||||
#define TCDRAIN _IO ('T', 13) /* tcdrain */
|
||||
#define TCFLOW _IOW('T', 14, int) /* tcflow */
|
||||
#define TCFLSH _IOW('T', 15, int) /* tcflush */
|
||||
#define TIOCGWINSZ _IOR('T', 16, struct winsize)
|
||||
#define TIOCSWINSZ _IOW('T', 17, struct winsize)
|
||||
#define TIOCGPGRP _IOW('T', 18, int)
|
||||
#define TIOCSPGRP _IOW('T', 19, int)
|
||||
#define TIOCSFON_OLD _IOW('T', 20, u8_t [8192])
|
||||
#define TIOCSFON _IOW_BIG(1, u8_t [8192])
|
||||
|
||||
/* Legacy <sgtty.h> */
|
||||
#define TIOCGETP _IOR('t', 1, struct sgttyb)
|
||||
#define TIOCSETP _IOW('t', 2, struct sgttyb)
|
||||
#define TIOCGETC _IOR('t', 3, struct tchars)
|
||||
#define TIOCSETC _IOW('t', 4, struct tchars)
|
||||
|
||||
/* Keyboard ioctls. */
|
||||
#define KIOCBELL _IOW('k', 1, struct kio_bell)
|
||||
#define KIOCSLEDS _IOW('k', 2, struct kio_leds)
|
||||
#define KIOCSMAP _IOW('k', 3, keymap_t)
|
||||
|
||||
/* /dev/video ioctls. */
|
||||
#define TIOCMAPMEM _IORW('v', 1, struct mapreqvm)
|
||||
#define TIOCUNMAPMEM _IORW('v', 2, struct mapreqvm)
|
||||
|
||||
#endif /* _S_I_TTY_H */
|
||||
@@ -1,24 +0,0 @@
|
||||
/* <sys/mount.h>
|
||||
* definitions for mount(2)
|
||||
*/
|
||||
|
||||
#ifndef _MOUNT_H
|
||||
#define _MOUNT_H
|
||||
|
||||
#define MS_RDONLY 0x001 /* Mount device read only */
|
||||
#define MS_REUSE 0x002 /* Tell RS to try reusing binary from memory */
|
||||
#define MS_LABEL16 0x004 /* Mount message points to 16-byte label */
|
||||
#define MS_EXISTING 0x008 /* Tell mount to use already running server */
|
||||
|
||||
|
||||
/* Function Prototypes. */
|
||||
#ifndef _MINIX_ANSI_H
|
||||
#include <minix/ansi.h>
|
||||
#endif
|
||||
|
||||
_PROTOTYPE( int mount, (char *_spec, char *_name, int _mountflags,
|
||||
char *type, char *args) );
|
||||
_PROTOTYPE( int umount, (const char *_name) );
|
||||
_PROTOTYPE( int umount2, (const char *_name, int flags) );
|
||||
|
||||
#endif /* _MOUNT_H */
|
||||
@@ -1,207 +0,0 @@
|
||||
/* The <termios.h> header is used for controlling tty modes. */
|
||||
|
||||
#ifndef _TERMIOS_H
|
||||
#define _TERMIOS_H
|
||||
|
||||
typedef unsigned short tcflag_t;
|
||||
typedef unsigned char cc_t;
|
||||
typedef unsigned int speed_t;
|
||||
|
||||
#define NCCS 20 /* size of cc_c array, some extra space
|
||||
* for extensions. */
|
||||
|
||||
/* Primary terminal control structure. POSIX Table 7-1. */
|
||||
struct termios {
|
||||
tcflag_t c_iflag; /* input modes */
|
||||
tcflag_t c_oflag; /* output modes */
|
||||
tcflag_t c_cflag; /* control modes */
|
||||
tcflag_t c_lflag; /* local modes */
|
||||
speed_t c_ispeed; /* input speed */
|
||||
speed_t c_ospeed; /* output speed */
|
||||
cc_t c_cc[NCCS]; /* control characters */
|
||||
};
|
||||
|
||||
/* Values for termios c_iflag bit map. POSIX Table 7-2. */
|
||||
#define BRKINT 0x0001 /* signal interrupt on break */
|
||||
#define ICRNL 0x0002 /* map CR to NL on input */
|
||||
#define IGNBRK 0x0004 /* ignore break */
|
||||
#define IGNCR 0x0008 /* ignore CR */
|
||||
#define IGNPAR 0x0010 /* ignore characters with parity errors */
|
||||
#define INLCR 0x0020 /* map NL to CR on input */
|
||||
#define INPCK 0x0040 /* enable input parity check */
|
||||
#define ISTRIP 0x0080 /* mask off 8th bit */
|
||||
#define IXOFF 0x0100 /* enable start/stop input control */
|
||||
#define IXON 0x0200 /* enable start/stop output control */
|
||||
#define PARMRK 0x0400 /* mark parity errors in the input queue */
|
||||
|
||||
/* Values for termios c_oflag bit map. POSIX Sec. 7.1.2.3. */
|
||||
#define OPOST 0x0001 /* perform output processing */
|
||||
|
||||
/* Values for termios c_cflag bit map. POSIX Table 7-3. */
|
||||
#define CLOCAL 0x0001 /* ignore modem status lines */
|
||||
#define CREAD 0x0002 /* enable receiver */
|
||||
#define CSIZE 0x000C /* number of bits per character */
|
||||
#define CS5 0x0000 /* if CSIZE is CS5, characters are 5 bits */
|
||||
#define CS6 0x0004 /* if CSIZE is CS6, characters are 6 bits */
|
||||
#define CS7 0x0008 /* if CSIZE is CS7, characters are 7 bits */
|
||||
#define CS8 0x000C /* if CSIZE is CS8, characters are 8 bits */
|
||||
#define CSTOPB 0x0010 /* send 2 stop bits if set, else 1 */
|
||||
#define HUPCL 0x0020 /* hang up on last close */
|
||||
#define PARENB 0x0040 /* enable parity on output */
|
||||
#define PARODD 0x0080 /* use odd parity if set, else even */
|
||||
|
||||
/* Values for termios c_lflag bit map. POSIX Table 7-4. */
|
||||
#define ECHO 0x0001 /* enable echoing of input characters */
|
||||
#define ECHOE 0x0002 /* echo ERASE as backspace */
|
||||
#define ECHOK 0x0004 /* echo KILL */
|
||||
#define ECHONL 0x0008 /* echo NL */
|
||||
#define ICANON 0x0010 /* canonical input (erase and kill enabled) */
|
||||
#define IEXTEN 0x0020 /* enable extended functions */
|
||||
#define ISIG 0x0040 /* enable signals */
|
||||
#define NOFLSH 0x0080 /* disable flush after interrupt or quit */
|
||||
#define TOSTOP 0x0100 /* send SIGTTOU (job control, not implemented*/
|
||||
|
||||
/* Indices into c_cc array. Default values in parentheses. POSIX Table 7-5. */
|
||||
#define VEOF 0 /* cc_c[VEOF] = EOF char (^D) */
|
||||
#define VEOL 1 /* cc_c[VEOL] = EOL char (undef) */
|
||||
#define VERASE 2 /* cc_c[VERASE] = ERASE char (^H) */
|
||||
#define VINTR 3 /* cc_c[VINTR] = INTR char (DEL) */
|
||||
#define VKILL 4 /* cc_c[VKILL] = KILL char (^U) */
|
||||
#define VMIN 5 /* cc_c[VMIN] = MIN value for timer */
|
||||
#define VQUIT 6 /* cc_c[VQUIT] = QUIT char (^\) */
|
||||
#define VTIME 7 /* cc_c[VTIME] = TIME value for timer */
|
||||
#define VSUSP 8 /* cc_c[VSUSP] = SUSP (^Z, ignored) */
|
||||
#define VSTART 9 /* cc_c[VSTART] = START char (^S) */
|
||||
#define VSTOP 10 /* cc_c[VSTOP] = STOP char (^Q) */
|
||||
|
||||
#define _POSIX_VDISABLE (cc_t)0xFF /* You can't even generate this
|
||||
* character with 'normal' keyboards.
|
||||
* But some language specific keyboards
|
||||
* can generate 0xFF. It seems that all
|
||||
* 256 are used, so cc_t should be a
|
||||
* short...
|
||||
*/
|
||||
|
||||
/* Values for the baud rate settings. POSIX Table 7-6. */
|
||||
#define B0 0x0000 /* hang up the line */
|
||||
#define B50 0x1000 /* 50 baud */
|
||||
#define B75 0x2000 /* 75 baud */
|
||||
#define B110 0x3000 /* 110 baud */
|
||||
#define B134 0x4000 /* 134.5 baud */
|
||||
#define B150 0x5000 /* 150 baud */
|
||||
#define B200 0x6000 /* 200 baud */
|
||||
#define B300 0x7000 /* 300 baud */
|
||||
#define B600 0x8000 /* 600 baud */
|
||||
#define B1200 0x9000 /* 1200 baud */
|
||||
#define B1800 0xA000 /* 1800 baud */
|
||||
#define B2400 0xB000 /* 2400 baud */
|
||||
#define B4800 0xC000 /* 4800 baud */
|
||||
#define B9600 0xD000 /* 9600 baud */
|
||||
#define B19200 0xE000 /* 19200 baud */
|
||||
#define B38400 0xF000 /* 38400 baud */
|
||||
|
||||
/* Optional actions for tcsetattr(). POSIX Sec. 7.2.1.2. */
|
||||
#define TCSANOW 1 /* changes take effect immediately */
|
||||
#define TCSADRAIN 2 /* changes take effect after output is done */
|
||||
#define TCSAFLUSH 3 /* wait for output to finish and flush input */
|
||||
|
||||
/* Queue_selector values for tcflush(). POSIX Sec. 7.2.2.2. */
|
||||
#define TCIFLUSH 1 /* flush accumulated input data */
|
||||
#define TCOFLUSH 2 /* flush accumulated output data */
|
||||
#define TCIOFLUSH 3 /* flush accumulated input and output data */
|
||||
|
||||
/* Action values for tcflow(). POSIX Sec. 7.2.2.2. */
|
||||
#define TCOOFF 1 /* suspend output */
|
||||
#define TCOON 2 /* restart suspended output */
|
||||
#define TCIOFF 3 /* transmit a STOP character on the line */
|
||||
#define TCION 4 /* transmit a START character on the line */
|
||||
|
||||
/* Function Prototypes. */
|
||||
#ifndef _MINIX_ANSI_H
|
||||
#include <minix/ansi.h>
|
||||
#endif
|
||||
|
||||
_PROTOTYPE( int tcsendbreak, (int _fildes, int _duration) );
|
||||
_PROTOTYPE( int tcdrain, (int _filedes) );
|
||||
_PROTOTYPE( int tcflush, (int _filedes, int _queue_selector) );
|
||||
_PROTOTYPE( int tcflow, (int _filedes, int _action) );
|
||||
_PROTOTYPE( speed_t cfgetispeed, (const struct termios *_termios_p) );
|
||||
_PROTOTYPE( speed_t cfgetospeed, (const struct termios *_termios_p) );
|
||||
_PROTOTYPE( int cfsetispeed, (struct termios *_termios_p, speed_t _speed) );
|
||||
_PROTOTYPE( int cfsetospeed, (struct termios *_termios_p, speed_t _speed) );
|
||||
_PROTOTYPE( int tcgetattr, (int _filedes, struct termios *_termios_p) );
|
||||
_PROTOTYPE( int tcsetattr, \
|
||||
(int _filedes, int _opt_actions, const struct termios *_termios_p) );
|
||||
|
||||
#define cfgetispeed(termios_p) ((termios_p)->c_ispeed)
|
||||
#define cfgetospeed(termios_p) ((termios_p)->c_ospeed)
|
||||
#define cfsetispeed(termios_p, speed) ((termios_p)->c_ispeed = (speed), 0)
|
||||
#define cfsetospeed(termios_p, speed) ((termios_p)->c_ospeed = (speed), 0)
|
||||
|
||||
#ifdef _MINIX
|
||||
/* Here are the local extensions to the POSIX standard for Minix. Posix
|
||||
* conforming programs are not able to access these, and therefore they are
|
||||
* only defined when a Minix program is compiled.
|
||||
*/
|
||||
|
||||
/* Extensions to the termios c_iflag bit map. */
|
||||
#define IXANY 0x0800 /* allow any key to continue ouptut */
|
||||
#define SCANCODES 0x1000 /* send scancodes */
|
||||
|
||||
/* Extensions to the termios c_oflag bit map. They are only active iff
|
||||
* OPOST is enabled. */
|
||||
#define ONLCR 0x0002 /* Map NL to CR-NL on output */
|
||||
#define XTABS 0x0004 /* Expand tabs to spaces */
|
||||
#define ONOEOT 0x0008 /* discard EOT's (^D) on output) */
|
||||
|
||||
/* Extensions to the termios c_lflag bit map. */
|
||||
#define LFLUSHO 0x0200 /* Flush output. */
|
||||
|
||||
/* Extensions to the c_cc array. */
|
||||
#define VREPRINT 11 /* cc_c[VREPRINT] (^R) */
|
||||
#define VLNEXT 12 /* cc_c[VLNEXT] (^V) */
|
||||
#define VDISCARD 13 /* cc_c[VDISCARD] (^O) */
|
||||
|
||||
/* Extensions to baud rate settings. */
|
||||
#define B57600 0x0100 /* 57600 baud */
|
||||
#define B115200 0x0200 /* 115200 baud */
|
||||
|
||||
/* These are the default settings used by the kernel and by 'stty sane' */
|
||||
|
||||
#define TCTRL_DEF (CREAD | CS8 | HUPCL)
|
||||
#define TINPUT_DEF (BRKINT | ICRNL | IXON | IXANY)
|
||||
#define TOUTPUT_DEF (OPOST | ONLCR)
|
||||
#define TLOCAL_DEF (ISIG | IEXTEN | ICANON | ECHO | ECHOE)
|
||||
#define TSPEED_DEF B9600
|
||||
|
||||
#define TEOF_DEF '\4' /* ^D */
|
||||
#define TEOL_DEF _POSIX_VDISABLE
|
||||
#define TERASE_DEF '\10' /* ^H */
|
||||
#define TINTR_DEF '\3' /* ^C */
|
||||
#define TKILL_DEF '\25' /* ^U */
|
||||
#define TMIN_DEF 1
|
||||
#define TQUIT_DEF '\34' /* ^\ */
|
||||
#define TSTART_DEF '\21' /* ^Q */
|
||||
#define TSTOP_DEF '\23' /* ^S */
|
||||
#define TSUSP_DEF '\32' /* ^Z */
|
||||
#define TTIME_DEF 0
|
||||
#define TREPRINT_DEF '\22' /* ^R */
|
||||
#define TLNEXT_DEF '\26' /* ^V */
|
||||
#define TDISCARD_DEF '\17' /* ^O */
|
||||
|
||||
/* Window size. This information is stored in the TTY driver but not used.
|
||||
* This can be used for screen based applications in a window environment.
|
||||
* The ioctls TIOCGWINSZ and TIOCSWINSZ can be used to get and set this
|
||||
* information.
|
||||
*/
|
||||
#endif /* _MINIX */
|
||||
|
||||
struct winsize
|
||||
{
|
||||
unsigned short ws_row; /* rows, in characters */
|
||||
unsigned short ws_col; /* columns, in characters */
|
||||
unsigned short ws_xpixel; /* horizontal size, pixels */
|
||||
unsigned short ws_ypixel; /* vertical size, pixels */
|
||||
};
|
||||
|
||||
#endif /* _TERMIOS_H */
|
||||
Reference in New Issue
Block a user