00001 #ifndef _TYPE_H 00002 #define _TYPE_H 00003 00004 #ifndef _MINIX_SYS_CONFIG_H 00005 #include <minix/sys_config.h> 00006 #endif 00007 00008 #ifndef _TYPES_H 00009 #include <minix/types.h> 00010 #endif 00011 00012 /* Type definitions. */ 00013 typedef unsigned int vir_clicks; /* virtual addr/length in clicks */ 00014 typedef unsigned long phys_bytes; /* physical addr/length in bytes */ 00015 typedef unsigned int phys_clicks; /* physical addr/length in clicks */ 00016 typedef int endpoint_t; /* process identifier */ 00017 00018 #if (_MINIX_CHIP == _CHIP_INTEL) 00019 typedef long unsigned int vir_bytes; /* virtual addresses/lengths in bytes */ 00020 #endif 00021 00022 #if (_MINIX_CHIP == _CHIP_M68000) 00023 typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */ 00024 #endif 00025 00026 #if (_MINIX_CHIP == _CHIP_SPARC) 00027 typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */ 00028 #endif 00029 00030 /* Memory map for local text, stack, data segments. */ 00031 struct mem_map { 00032 vir_clicks mem_vir; /* virtual address */ 00033 phys_clicks mem_phys; /* physical address */ 00034 vir_clicks mem_len; /* length */ 00035 }; 00036 00037 /* Memory map for remote memory areas, e.g., for the RAM disk. */ 00038 struct far_mem { 00039 int in_use; /* entry in use, unless zero */ 00040 phys_clicks mem_phys; /* physical address */ 00041 vir_clicks mem_len; /* length */ 00042 }; 00043 00044 /* Structure for virtual copying by means of a vector with requests. */ 00045 struct vir_addr { 00046 int proc_nr_e; 00047 int segment; 00048 vir_bytes offset; 00049 }; 00050 00051 #define phys_cp_req vir_cp_req 00052 struct vir_cp_req { 00053 struct vir_addr src; 00054 struct vir_addr dst; 00055 phys_bytes count; 00056 }; 00057 00058 typedef struct { 00059 vir_bytes iov_addr; /* address of an I/O buffer */ 00060 vir_bytes iov_size; /* sizeof an I/O buffer */ 00061 } iovec_t; 00062 00063 typedef struct { 00064 int iov_grant; /* grant ID of an I/O buffer */ 00065 vir_bytes iov_size; /* sizeof an I/O buffer */ 00066 } iovec_s_t; 00067 00068 /* PM passes the address of a structure of this type to KERNEL when 00069 * sys_sigsend() is invoked as part of the signal catching mechanism. 00070 * The structure contain all the information that KERNEL needs to build 00071 * the signal stack. 00072 */ 00073 struct sigmsg { 00074 int sm_signo; /* signal number being caught */ 00075 unsigned long sm_mask; /* mask to restore when handler returns */ 00076 vir_bytes sm_sighandler; /* address of handler */ 00077 vir_bytes sm_sigreturn; /* address of _sigreturn in C library */ 00078 vir_bytes sm_stkptr; /* user stack pointer */ 00079 }; 00080 00081 /* This is used to obtain system information through SYS_GETINFO. */ 00082 struct kinfo { 00083 phys_bytes code_base; /* base of kernel code */ 00084 phys_bytes code_size; 00085 phys_bytes data_base; /* base of kernel data */ 00086 phys_bytes data_size; 00087 vir_bytes proc_addr; /* virtual address of process table */ 00088 phys_bytes _kmem_base; /* kernel memory layout (/dev/kmem) */ 00089 phys_bytes _kmem_size; 00090 phys_bytes bootdev_base; /* boot device from boot image (/dev/boot) */ 00091 phys_bytes bootdev_size; 00092 phys_bytes ramdev_base; /* boot device from boot image (/dev/boot) */ 00093 phys_bytes ramdev_size; 00094 phys_bytes _params_base; /* parameters passed by boot monitor */ 00095 phys_bytes _params_size; 00096 int nr_procs; /* number of user processes */ 00097 int nr_tasks; /* number of kernel tasks */ 00098 char release[6]; /* kernel release number */ 00099 char version[6]; /* kernel version number */ 00100 }; 00101 00102 /* Load data accounted every this no. of seconds. */ 00103 #define _LOAD_UNIT_SECS 6 /* Changing this breaks ABI. */ 00104 00105 /* Load data history is kept for this long. */ 00106 #define _LOAD_HISTORY_MINUTES 15 /* Changing this breaks ABI. */ 00107 #define _LOAD_HISTORY_SECONDS (60*_LOAD_HISTORY_MINUTES) 00108 00109 /* We need this many slots to store the load history. */ 00110 #define _LOAD_HISTORY (_LOAD_HISTORY_SECONDS/_LOAD_UNIT_SECS) 00111 00112 /* Runnable processes and other load-average information. */ 00113 struct loadinfo { 00114 u16_t proc_load_history[_LOAD_HISTORY]; /* history of proc_s_cur */ 00115 u16_t proc_last_slot; 00116 clock_t last_clock; 00117 }; 00118 00119 struct machine { 00120 int pc_at; 00121 int ps_mca; 00122 int processor; 00123 int padding; /* used to be protected */ 00124 int vdu_ega; 00125 int vdu_vga; 00126 }; 00127 00128 struct io_range 00129 { 00130 unsigned ior_base; /* Lowest I/O port in range */ 00131 unsigned ior_limit; /* Highest I/O port in range */ 00132 }; 00133 00134 struct mem_range 00135 { 00136 phys_bytes mr_base; /* Lowest memory address in range */ 00137 phys_bytes mr_limit; /* Highest memory address in range */ 00138 }; 00139 00140 /* For EXEC_NEWMEM */ 00141 struct exec_newmem 00142 { 00143 vir_bytes text_bytes; 00144 vir_bytes data_bytes; 00145 vir_bytes bss_bytes; 00146 vir_bytes tot_bytes; 00147 vir_bytes args_bytes; 00148 int sep_id; 00149 dev_t st_dev; 00150 ino_t st_ino; 00151 time_t st_ctime; 00152 uid_t new_uid; 00153 gid_t new_gid; 00154 char progname[16]; /* Should be at least PROC_NAME_LEN */ 00155 }; 00156 00157 /* Memory chunks. */ 00158 struct memory { 00159 phys_bytes base; 00160 phys_bytes size; 00161 }; 00162 00163 #define STATICINIT(v, n) \ 00164 if(!(v)) { \ 00165 if(!((v) = alloc_contig(sizeof(*(v)) * (n), 0, NULL))) { \ 00166 panic(__FILE__, "allocating " #v " failed", n); \ 00167 } \ 00168 } 00169 00170 /* The kernel outputs diagnostic messages in a circular buffer. */ 00171 struct kmessages { 00172 int km_next; /* next index to write */ 00173 int km_size; /* current size in buffer */ 00174 char km_buf[_KMESS_BUF_SIZE]; /* buffer for messages */ 00175 }; 00176 00177 #include <minix/config.h> 00178 #include <ibm/interrupt.h> 00179 00180 /* randomness struct: random sources after interrupts: */ 00181 #define RANDOM_SOURCES NR_IRQ_VECTORS 00182 #define RANDOM_ELEMENTS 64 00183 00184 typedef unsigned short rand_t; 00185 00186 struct k_randomness { 00187 int random_elements, random_sources; 00188 struct k_randomness_bin { 00189 int r_next; /* next index to write */ 00190 int r_size; /* number of random elements */ 00191 rand_t r_buf[RANDOM_ELEMENTS]; /* buffer for random info */ 00192 } bin[RANDOM_SOURCES]; 00193 }; 00194 00195 /* information on PCI devices */ 00196 00197 #define PCIINFO_ENTRY_SIZE 80 00198 00199 struct pciinfo_entry { 00200 u16_t pie_vid; 00201 u16_t pie_did; 00202 char pie_name[PCIINFO_ENTRY_SIZE]; 00203 }; 00204 00205 struct pciinfo { 00206 size_t pi_count; 00207 struct pciinfo_entry pi_entries[NR_PCIDEV]; 00208 }; 00209 00210 #endif /* _TYPE_H */ 00211
1.5.8