4 typedef _PROTOTYPE( void task_t
, (void) );
6 /* Process table and system property related types. */
7 typedef int proc_nr_t
; /* process table entry number */
8 typedef short sys_id_t
; /* system process index */
9 typedef struct { /* bitmap for system indexes */
10 bitchunk_t chunk
[BITMAP_CHUNKS(NR_SYS_PROCS
)];
14 proc_nr_t proc_nr
; /* process number to use */
15 task_t
*initial_pc
; /* start function for tasks */
16 int flags
; /* process flags */
17 unsigned char quantum
; /* quantum (tick count) */
18 int priority
; /* scheduling priority */
19 int stksize
; /* stack size for tasks */
20 short trap_mask
; /* allowed system call traps */
21 bitchunk_t ipc_to
; /* send mask protection */
22 long call_mask
; /* system call protection */
23 char proc_name
[P_NAME_LEN
]; /* name in process table */
24 int endpoint
; /* endpoint number when started */
28 phys_clicks base
; /* start address of chunk */
29 phys_clicks size
; /* size of memory chunk */
32 /* The kernel outputs diagnostic messages in a circular buffer. */
34 int km_next
; /* next index to write */
35 int km_size
; /* current size in buffer */
36 char km_buf
[KMESS_BUF_SIZE
]; /* buffer for messages */
41 int r_next
; /* next index to write */
42 int r_size
; /* number of random elements */
43 unsigned short r_buf
[RANDOM_ELEMENTS
]; /* buffer for random info */
44 } bin
[RANDOM_SOURCES
];
48 typedef unsigned reg_t
; /* machine register */
50 /* The stack frame layout is determined by the software, but for efficiency
51 * it is laid out so the assembly code to use it is as simple as possible.
52 * 80286 protected mode and all real modes use the same frame, built with
53 * 16-bit registers. Real mode lacks an automatic stack switch, so little
54 * is lost by using the 286 frame for it. The 386 frame differs only in
55 * having 32-bit registers and more segment registers. The same names are
56 * used for the larger registers to avoid differences in the code.
58 struct stackframe_s
{ /* proc_ptr points here */
60 u16_t gs
; /* last item pushed by save */
65 reg_t di
; /* di through cx are not accessed in C */
66 reg_t si
; /* order is to match pusha/popa */
68 reg_t st
; /* hole for another copy of sp */
72 reg_t retreg
; /* ax and above are all pushed by save */
73 reg_t retadr
; /* return address for assembly code save() */
74 reg_t pc
; /* ^ last item pushed by interrupt */
78 reg_t ss
; /* these are pushed by CPU during interrupt */
81 struct segdesc_s
{ /* segment descriptor for protected mode */
85 u8_t access
; /* |P|DL|1|X|E|R|A| */
86 u8_t granularity
; /* |G|X|0|A|LIMT| */
90 typedef unsigned long irq_policy_t
;
91 typedef unsigned long irq_id_t
;
93 typedef struct irq_hook
{
94 struct irq_hook
*next
; /* next hook in chain */
95 int (*handler
)(struct irq_hook
*); /* interrupt handler */
96 int irq
; /* IRQ vector number */
97 int id
; /* id of this hook */
98 int proc_nr_e
; /* (endpoint) NONE if not in use */
99 irq_id_t notify_id
; /* id to return on interrupt */
100 irq_policy_t policy
; /* bit mask for policy */
103 typedef int (*irq_handler_t
)(struct irq_hook
*);
105 #endif /* (CHIP == INTEL) */
108 /* M68000 specific types go here. */
109 #endif /* (CHIP == M68000) */