minix/kernel/type.h
Ben Gras c078ec0331 Basic VM and other minor improvements.
Not complete, probably not fully debugged or optimized.
2008-11-19 12:26:10 +00:00

63 lines
2 KiB
C
Executable file

#ifndef TYPE_H
#define TYPE_H
#include <minix/com.h>
typedef _PROTOTYPE( void task_t, (void) );
/* Process table and system property related types. */
typedef int proc_nr_t; /* process table entry number */
typedef short sys_id_t; /* system process index */
typedef struct { /* bitmap for system indexes */
bitchunk_t chunk[BITMAP_CHUNKS(NR_SYS_PROCS)];
} sys_map_t;
struct boot_image {
proc_nr_t proc_nr; /* process number to use */
task_t *initial_pc; /* start function for tasks */
int flags; /* process flags */
unsigned char quantum; /* quantum (tick count) */
int priority; /* scheduling priority */
int stksize; /* stack size for tasks */
short trap_mask; /* allowed system call traps */
bitchunk_t ipc_to; /* send mask protection */
int *k_calls; /* kern. call protection */
int nr_k_calls;
char proc_name[P_NAME_LEN]; /* name in process table */
endpoint_t endpoint; /* endpoint number when started */
};
struct randomness {
struct {
int r_next; /* next index to write */
int r_size; /* number of random elements */
unsigned short r_buf[RANDOM_ELEMENTS]; /* buffer for random info */
} bin[RANDOM_SOURCES];
};
typedef unsigned long irq_policy_t;
typedef unsigned long irq_id_t;
typedef struct irq_hook {
struct irq_hook *next; /* next hook in chain */
int (*handler)(struct irq_hook *); /* interrupt handler */
int irq; /* IRQ vector number */
int id; /* id of this hook */
int proc_nr_e; /* (endpoint) NONE if not in use */
irq_id_t notify_id; /* id to return on interrupt */
irq_policy_t policy; /* bit mask for policy */
} irq_hook_t;
typedef int (*irq_handler_t)(struct irq_hook *);
/* Timing measurements. */
struct lock_timingdata {
char names[TIMING_NAME];
unsigned long lock_timings[TIMING_POINTS];
unsigned long lock_timings_range[2];
unsigned long binsize, resets, misses, measurements;
};
EXTERN struct lock_timingdata timingdata[TIMING_CATEGORIES];
#endif /* TYPE_H */