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 <sys/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 00017 #if (_MINIX_CHIP == _CHIP_INTEL) 00018 typedef unsigned int vir_bytes; /* virtual addresses and lengths in bytes */ 00019 #endif 00020 00021 #if (_MINIX_CHIP == _CHIP_M68000) 00022 typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */ 00023 #endif 00024 00025 #if (_MINIX_CHIP == _CHIP_SPARC) 00026 typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */ 00027 #endif 00028 00029 /* Memory map for local text, stack, data segments. */ 00030 struct mem_map { 00031 vir_clicks mem_vir; /* virtual address */ 00032 phys_clicks mem_phys; /* physical address */ 00033 vir_clicks mem_len; /* length */ 00034 }; 00035 00036 /* Memory map for remote memory areas, e.g., for the RAM disk. */ 00037 struct far_mem { 00038 int in_use; /* entry in use, unless zero */ 00039 phys_clicks mem_phys; /* physical address */ 00040 vir_clicks mem_len; /* length */ 00041 }; 00042 00043 /* Structure for virtual copying by means of a vector with requests. */ 00044 struct vir_addr { 00045 int proc_nr_e; 00046 int segment; 00047 vir_bytes offset; 00048 }; 00049 00050 /* Memory allocation by PM. */ 00051 struct hole { 00052 struct hole *h_next; /* pointer to next entry on the list */ 00053 phys_clicks h_base; /* where does the hole begin? */ 00054 phys_clicks h_len; /* how big is the hole? */ 00055 }; 00056 00057 /* Memory info from PM. */ 00058 struct pm_mem_info { 00059 struct hole pmi_holes[_NR_HOLES];/* memory (un)allocations */ 00060 u32_t pmi_hi_watermark; /* highest ever-used click + 1 */ 00061 }; 00062 00063 #define phys_cp_req vir_cp_req 00064 struct vir_cp_req { 00065 struct vir_addr src; 00066 struct vir_addr dst; 00067 phys_bytes count; 00068 }; 00069 00070 typedef struct { 00071 vir_bytes iov_addr; /* address of an I/O buffer */ 00072 vir_bytes iov_size; /* sizeof an I/O buffer */ 00073 } iovec_t; 00074 00075 /* PM passes the address of a structure of this type to KERNEL when 00076 * sys_sendsig() is invoked as part of the signal catching mechanism. 00077 * The structure contain all the information that KERNEL needs to build 00078 * the signal stack. 00079 */ 00080 struct sigmsg { 00081 int sm_signo; /* signal number being caught */ 00082 unsigned long sm_mask; /* mask to restore when handler returns */ 00083 vir_bytes sm_sighandler; /* address of handler */ 00084 vir_bytes sm_sigreturn; /* address of _sigreturn in C library */ 00085 vir_bytes sm_stkptr; /* user stack pointer */ 00086 }; 00087 00088 /* This is used to obtain system information through SYS_GETINFO. */ 00089 struct kinfo { 00090 phys_bytes code_base; /* base of kernel code */ 00091 phys_bytes code_size; 00092 phys_bytes data_base; /* base of kernel data */ 00093 phys_bytes data_size; 00094 vir_bytes proc_addr; /* virtual address of process table */ 00095 phys_bytes kmem_base; /* kernel memory layout (/dev/kmem) */ 00096 phys_bytes kmem_size; 00097 phys_bytes bootdev_base; /* boot device from boot image (/dev/boot) */ 00098 phys_bytes bootdev_size; 00099 phys_bytes ramdev_base; /* boot device from boot image (/dev/boot) */ 00100 phys_bytes ramdev_size; 00101 phys_bytes params_base; /* parameters passed by boot monitor */ 00102 phys_bytes params_size; 00103 int nr_procs; /* number of user processes */ 00104 int nr_tasks; /* number of kernel tasks */ 00105 char release[6]; /* kernel release number */ 00106 char version[6]; /* kernel version number */ 00107 #if DEBUG_LOCK_CHECK 00108 int relocking; /* interrupt locking depth (should be 0) */ 00109 #endif 00110 }; 00111 00112 /* Load data accounted every this no. of seconds. */ 00113 #define _LOAD_UNIT_SECS 6 00114 00115 /* Load data history is kept for this long. */ 00116 #define _LOAD_HISTORY_MINUTES 15 00117 #define _LOAD_HISTORY_SECONDS (60*_LOAD_HISTORY_MINUTES) 00118 00119 /* We need this many slots to store the load history. */ 00120 #define _LOAD_HISTORY (_LOAD_HISTORY_SECONDS/_LOAD_UNIT_SECS) 00121 00122 /* Runnable processes and other load-average information. */ 00123 struct loadinfo { 00124 u16_t proc_load_history[_LOAD_HISTORY]; /* history of proc_s_cur */ 00125 u16_t proc_last_slot; 00126 clock_t last_clock; 00127 }; 00128 00129 struct machine { 00130 int pc_at; 00131 int ps_mca; 00132 int processor; 00133 int protected; 00134 int vdu_ega; 00135 int vdu_vga; 00136 }; 00137 00138 struct io_range 00139 { 00140 unsigned ior_base; /* Lowest I/O port in range */ 00141 unsigned ior_limit; /* Highest I/O port in range */ 00142 }; 00143 00144 struct mem_range 00145 { 00146 phys_bytes mr_base; /* Lowest memory address in range */ 00147 phys_bytes mr_limit; /* Highest memory address in range */ 00148 }; 00149 00150 #endif /* _TYPE_H */
1.4.6