Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
script3r
GitHub Repository: script3r/os161
Path: blob/master/kern/include/test.h
2093 views
1
/*
2
* Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
3
* The President and Fellows of Harvard College.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
7
* are met:
8
* 1. Redistributions of source code must retain the above copyright
9
* notice, this list of conditions and the following disclaimer.
10
* 2. Redistributions in binary form must reproduce the above copyright
11
* notice, this list of conditions and the following disclaimer in the
12
* documentation and/or other materials provided with the distribution.
13
* 3. Neither the name of the University nor the names of its contributors
14
* may be used to endorse or promote products derived from this software
15
* without specific prior written permission.
16
*
17
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
18
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
21
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
* SUCH DAMAGE.
28
*/
29
30
#ifndef _TEST_H_
31
#define _TEST_H_
32
33
/*
34
* Declarations for test code and other miscellaneous high-level
35
* functions.
36
*/
37
38
39
/* This is only actually available if OPT_SYNCHPROBS is set. */
40
int whalemating(int, char **);
41
42
/*
43
* 08 Feb 2012 : GWA : Adding drivers for synchronization problems.
44
*
45
* Whalemating.
46
*/
47
48
void male_start(void);
49
void male_end(void);
50
void female_start(void);
51
void female_end(void);
52
void matchmaker_start(void);
53
void matchmaker_end(void);
54
int whalemating(int, char **);
55
56
void male(void *, unsigned long);
57
void female(void *, unsigned long);
58
void matchmaker(void *, unsigned long);
59
void whalemating_init(void);
60
void whalemating_cleanup(void);
61
62
/*
63
* Traffic light.
64
*/
65
66
void inQuadrant(int);
67
void leaveIntersection(void);
68
int stoplight(int, char **);
69
70
void gostraight(void *, unsigned long);
71
void turnleft(void *, unsigned long);
72
void turnright(void *, unsigned long);
73
void stoplight_init(void);
74
void stoplight_cleanup(void);
75
76
/*
77
* Test code.
78
*/
79
80
/* lib tests */
81
int arraytest(int, char **);
82
int bitmaptest(int, char **);
83
int queuetest(int, char **);
84
85
/* thread tests */
86
int threadtest(int, char **);
87
int threadtest2(int, char **);
88
int threadtest3(int, char **);
89
int semtest(int, char **);
90
int locktest(int, char **);
91
int cvtest(int, char **);
92
int cvtest2(int, char **);
93
94
/* filesystem tests */
95
int fstest(int, char **);
96
int readstress(int, char **);
97
int writestress(int, char **);
98
int writestress2(int, char **);
99
int createstress(int, char **);
100
int printfile(int, char **);
101
102
/* other tests */
103
int malloctest(int, char **);
104
int mallocstress(int, char **);
105
int nettest(int, char **);
106
107
/* Routine for running a user-level program. */
108
int runprogram(char *progname);
109
110
/* Kernel menu system. */
111
void menu(char *argstr);
112
113
/* The main function, called from start.S. */
114
void kmain(char *bootstring);
115
116
117
#endif /* _TEST_H_ */
118
119