diskevent.h
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Copyright (C) 1996-1998 by the Board of Trustees
* of Leland Stanford Junior University.
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
/* @TITLE "diskevent.h: manage a heap of future events"*/
/*
* The disk-device module is event driven. This module keeps the event
* request mechanism, which is based on proteus SimRequests,
* abstracted away from the bulk of the disk device code.
*
* Functions
* DDEventInit
* DDEventRequest
* DDEventPrint
* DDEventCancel
*
* David Kotz 1994
*/
/* $Id: diskevent.h,v 1.1.1.1 2002/05/29 01:09:11 blythe Exp $ */
#ifndef DISKEVENT_H
#define DISKEVENT_H
#include "time.h"
typedef enum {
NOP,
DISKMOVE,
STARTDISKXFER,
ENDDISKXFER,
CONSIDERBUSXFER,
STARTBUSXFER,
ENDBUSXFER,
SENDCOMMAND,
ENDCOMMAND,
CONTROLLER,
SENDSYNCCOMMAND,
ENDSYNCCOMMAND,
SENDBUFFERMESG,
ENDBUFFERMESG,
SENDDONEMESSAGE,
ENDDONEMESSAGE
} REQUESTCODE;
typedef void DDEvent; /* internally, is a SimRequest */
extern void DDEventInit(void);
extern DDEvent * DDEventRequest(REQUESTCODE event, TICS eventTime, int disk);
extern void DDEventPrint(FILE *fp, void *req); /* (, SimRequest *) */
extern void DDEventCancel(DDEvent *ddev);
extern void DDEventWakeup(int disk,int stid, TICS when); /* note STID not TID */
/* list of disk-device request types,
* initialized in diskdevice.c,
* used in diskevent.c
*/
typedef void (*DDhandler)(int disk, TICS eventTime);
struct dd_handlers {
DDhandler handler; /* function implementing this event type */
char name[20]; /* name of that event type */
};
extern struct dd_handlers DDhandlers[];
#endif /* DISKEVENT_H */