|
|
1.1 root 1: /*
2: * Copyright (c) 1993,1994 The University of Utah and
3: * the Computer Systems Laboratory (CSL). All rights reserved.
4: *
5: * Permission to use, copy, modify and distribute this software and its
6: * documentation is hereby granted, provided that both the copyright
7: * notice and this permission notice appear in all copies of the
8: * software, derivative works or modified versions, and any portions
9: * thereof, and that both notices appear in supporting documentation.
10: *
11: * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
12: * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
13: * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
14: *
15: * CSL requests users of this software to return to [email protected] any
16: * improvements that they make and grant CSL redistribution rights.
17: *
18: * Author: Bryan Ford, University of Utah CSL
19: */
20: /*
21: * File: shuttle.h
22: * Author: Bryan Ford
23: *
24: * This file contains definitions for shuttles,
25: * which handle microscheduling for individual threads.
26: *
27: */
28:
29: #ifndef _KERN_SHUTTLE_H_
30: #define _KERN_SHUTTLE_H_
31:
32: #include <kern/lock.h>
33:
34:
35:
36: struct Shuttle {
37: /* XXX must be first in thread */
38: /*
39: * NOTE: The runq field in the thread structure has an unusual
40: * locking protocol. If its value is RUN_QUEUE_NULL, then it is
41: * locked by the thread_lock, but if its value is something else
42: * (i.e. a run_queue) then it is locked by that run_queue's lock.
43: */
44: queue_chain_t links; /* current run queue links */
45: run_queue_t runq; /* run queue p is on SEE BELOW */
46:
47: /* Next pointer when on a queue */
48: struct Shuttle *next;
49:
50: /* Micropriority level */
51: int priority;
52:
53: /* General-purpose pointer field whose use depends on what the
54: thread happens to be doing */
55: void *message;
56:
57: int foobar[1];
58: };
59: typedef struct Shuttle Shuttle;
60:
61:
62:
63: /* Exported functions */
64:
65:
66:
67: /* Machine-dependent code must define the following functions */
68:
69:
70:
71: #endif _KERN_SHUTTLE_H_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.