4 #ifndef _MINIX_SYS_CONFIG_H
5 #include <minix/sys_config.h>
9 #include <minix/types.h>
14 /* Type definitions. */
15 typedef unsigned int vir_clicks
; /* virtual addr/length in clicks */
16 typedef unsigned long phys_bytes
; /* physical addr/length in bytes */
17 typedef unsigned int phys_clicks
; /* physical addr/length in clicks */
18 typedef int endpoint_t
; /* process identifier */
20 typedef int32_t cp_grant_id_t
; /* A grant ID. */
22 #if (_MINIX_CHIP == _CHIP_INTEL)
23 typedef long unsigned int vir_bytes
; /* virtual addresses/lengths in bytes */
26 #if (_MINIX_CHIP == _CHIP_M68000)
27 typedef unsigned long vir_bytes
;/* virtual addresses and lengths in bytes */
30 #if (_MINIX_CHIP == _CHIP_SPARC)
31 typedef unsigned long vir_bytes
;/* virtual addresses and lengths in bytes */
34 /* Memory map for local text, stack, data segments. */
36 vir_clicks mem_vir
; /* virtual address */
37 phys_clicks mem_phys
; /* physical address */
38 vir_clicks mem_len
; /* length */
41 /* Memory map for remote memory areas, e.g., for the RAM disk. */
43 int in_use
; /* entry in use, unless zero */
44 phys_clicks mem_phys
; /* physical address */
45 vir_clicks mem_len
; /* length */
48 /* Structure for virtual copying by means of a vector with requests. */
55 #define phys_cp_req vir_cp_req
63 vir_bytes iov_addr
; /* address of an I/O buffer */
64 vir_bytes iov_size
; /* sizeof an I/O buffer */
68 cp_grant_id_t iov_grant
; /* grant ID of an I/O buffer */
69 vir_bytes iov_size
; /* sizeof an I/O buffer */
72 /* PM passes the address of a structure of this type to KERNEL when
73 * sys_sigsend() is invoked as part of the signal catching mechanism.
74 * The structure contain all the information that KERNEL needs to build
78 int sm_signo
; /* signal number being caught */
79 unsigned long sm_mask
; /* mask to restore when handler returns */
80 vir_bytes sm_sighandler
; /* address of handler */
81 vir_bytes sm_sigreturn
; /* address of _sigreturn in C library */
82 vir_bytes sm_stkptr
; /* user stack pointer */
85 /* This is used to obtain system information through SYS_GETINFO. */
87 phys_bytes code_base
; /* base of kernel code */
89 phys_bytes data_base
; /* base of kernel data */
91 vir_bytes proc_addr
; /* virtual address of process table */
92 phys_bytes _kmem_base
; /* kernel memory layout (/dev/kmem) */
93 phys_bytes _kmem_size
;
94 phys_bytes bootdev_base
; /* boot device from boot image (/dev/boot) */
95 phys_bytes bootdev_size
;
96 phys_bytes ramdev_base
; /* boot device from boot image (/dev/boot) */
97 phys_bytes ramdev_size
;
98 phys_bytes _params_base
; /* parameters passed by boot monitor */
99 phys_bytes _params_size
;
100 int nr_procs
; /* number of user processes */
101 int nr_tasks
; /* number of kernel tasks */
102 char release
[6]; /* kernel release number */
103 char version
[6]; /* kernel version number */
106 /* Load data accounted every this no. of seconds. */
107 #define _LOAD_UNIT_SECS 6 /* Changing this breaks ABI. */
109 /* Load data history is kept for this long. */
110 #define _LOAD_HISTORY_MINUTES 15 /* Changing this breaks ABI. */
111 #define _LOAD_HISTORY_SECONDS (60*_LOAD_HISTORY_MINUTES)
113 /* We need this many slots to store the load history. */
114 #define _LOAD_HISTORY (_LOAD_HISTORY_SECONDS/_LOAD_UNIT_SECS)
116 /* Runnable processes and other load-average information. */
118 u16_t proc_load_history
[_LOAD_HISTORY
]; /* history of proc_s_cur */
119 u16_t proc_last_slot
;
127 int padding
; /* used to be protected */
134 unsigned ior_base
; /* Lowest I/O port in range */
135 unsigned ior_limit
; /* Highest I/O port in range */
140 phys_bytes mr_base
; /* Lowest memory address in range */
141 phys_bytes mr_limit
; /* Highest memory address in range */
144 /* For EXEC_NEWMEM */
147 vir_bytes text_bytes
;
148 vir_bytes data_bytes
;
151 vir_bytes args_bytes
;
158 char progname
[16]; /* Should be at least PROC_NAME_LEN */
167 #define STATICINIT(v, n) \
169 if(!((v) = alloc_contig(sizeof(*(v)) * (n), 0, NULL))) { \
170 panic("allocating " #v " failed: %d", n); \
174 /* The kernel outputs diagnostic messages in a circular buffer. */
176 int km_next
; /* next index to write */
177 int km_size
; /* current size in buffer */
178 char km_buf
[_KMESS_BUF_SIZE
]; /* buffer for messages */
181 #include <minix/config.h>
182 #include <machine/interrupt.h>
184 /* randomness struct: random sources after interrupts: */
185 #define RANDOM_SOURCES NR_IRQ_VECTORS
186 #define RANDOM_ELEMENTS 64
188 typedef unsigned short rand_t
;
190 struct k_randomness
{
191 int random_elements
, random_sources
;
192 struct k_randomness_bin
{
193 int r_next
; /* next index to write */
194 int r_size
; /* number of random elements */
195 rand_t r_buf
[RANDOM_ELEMENTS
]; /* buffer for random info */
196 } bin
[RANDOM_SOURCES
];
199 /* information on PCI devices */
201 #define PCIINFO_ENTRY_SIZE 80
203 struct pciinfo_entry
{
206 char pie_name
[PCIINFO_ENTRY_SIZE
];
211 struct pciinfo_entry pi_entries
[NR_PCIDEV
];