source: branches/minix3-book/include/minix/type.h@ 4

Last change on this file since 4 was 4, checked in by Mattia Monga, 13 years ago

Importazione sorgenti libro

File size: 3.0 KB
RevLine 
[4]1#ifndef _TYPE_H
2#define _TYPE_H
3
4#ifndef _MINIX_SYS_CONFIG_H
5#include <minix/sys_config.h>
6#endif
7
8#ifndef _TYPES_H
9#include <sys/types.h>
10#endif
11
12/* Type definitions. */
13typedef unsigned int vir_clicks; /* virtual addr/length in clicks */
14typedef unsigned long phys_bytes; /* physical addr/length in bytes */
15typedef unsigned int phys_clicks; /* physical addr/length in clicks */
16
17#if (_MINIX_CHIP == _CHIP_INTEL)
18typedef unsigned int vir_bytes; /* virtual addresses and lengths in bytes */
19#endif
20
21#if (_MINIX_CHIP == _CHIP_M68000)
22typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
23#endif
24
25#if (_MINIX_CHIP == _CHIP_SPARC)
26typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
27#endif
28
29/* Memory map for local text, stack, data segments. */
30struct mem_map {
31 vir_clicks mem_vir; /* virtual address */
32 phys_clicks mem_phys; /* physical address */
33 vir_clicks mem_len; /* length */
34};
35
36/* Memory map for remote memory areas, e.g., for the RAM disk. */
37struct far_mem {
38 int in_use; /* entry in use, unless zero */
39 phys_clicks mem_phys; /* physical address */
40 vir_clicks mem_len; /* length */
41};
42
43/* Structure for virtual copying by means of a vector with requests. */
44struct vir_addr {
45 int proc_nr;
46 int segment;
47 vir_bytes offset;
48};
49
50#define phys_cp_req vir_cp_req
51struct vir_cp_req {
52 struct vir_addr src;
53 struct vir_addr dst;
54 phys_bytes count;
55};
56
57typedef struct {
58 vir_bytes iov_addr; /* address of an I/O buffer */
59 vir_bytes iov_size; /* sizeof an I/O buffer */
60} iovec_t;
61
62/* PM passes the address of a structure of this type to KERNEL when
63 * sys_sendsig() is invoked as part of the signal catching mechanism.
64 * The structure contain all the information that KERNEL needs to build
65 * the signal stack.
66 */
67struct sigmsg {
68 int sm_signo; /* signal number being caught */
69 unsigned long sm_mask; /* mask to restore when handler returns */
70 vir_bytes sm_sighandler; /* address of handler */
71 vir_bytes sm_sigreturn; /* address of _sigreturn in C library */
72 vir_bytes sm_stkptr; /* user stack pointer */
73};
74
75/* This is used to obtain system information through SYS_GETINFO. */
76struct kinfo {
77 phys_bytes code_base; /* base of kernel code */
78 phys_bytes code_size;
79 phys_bytes data_base; /* base of kernel data */
80 phys_bytes data_size;
81 vir_bytes proc_addr; /* virtual address of process table */
82 phys_bytes kmem_base; /* kernel memory layout (/dev/kmem) */
83 phys_bytes kmem_size;
84 phys_bytes bootdev_base; /* boot device from boot image (/dev/boot) */
85 phys_bytes bootdev_size;
86 phys_bytes bootdev_mem;
87 phys_bytes params_base; /* parameters passed by boot monitor */
88 phys_bytes params_size;
89 int nr_procs; /* number of user processes */
90 int nr_tasks; /* number of kernel tasks */
91 char release[6]; /* kernel release number */
92 char version[6]; /* kernel version number */
93 int relocking; /* relocking check (for debugging) */
94};
95
96struct machine {
97 int pc_at;
98 int ps_mca;
99 int processor;
100 int protected;
101 int vdu_ega;
102 int vdu_vga;
103};
104
105#endif /* _TYPE_H */
Note: See TracBrowser for help on using the repository browser.