Synchronization problem stubs and drivers.

This commit is contained in:
Geoffrey Challen
2015-12-31 14:28:15 -05:00
parent 1b63251154
commit f818d0bd30
7 changed files with 514 additions and 0 deletions

28
kern/include/synchprobs.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef _SYNCHPROBS_H_
#define _SYNCHPROBS_H_
/*
* Synchronization problem primitives.
*/
/*
* whalemating.c.
*/
void whalemating_init(void);
void whalemating_cleanup(void);
void male(void *, unsigned long);
void female(void *, unsigned long);
void matchmaker(void *, unsigned long);
/*
* stoplight.c.
*/
void gostraight(void *, unsigned long);
void turnleft(void *, unsigned long);
void turnright(void *, unsigned long);
void stoplight_init(void);
void stoplight_cleanup(void);
#endif /* _SYNCHPROBS_H_ */

View File

@@ -30,6 +30,8 @@
#ifndef _TEST_H_
#define _TEST_H_
#include "opt-synchprobs.h"
/*
* Declarations for test code and other miscellaneous high-level
* functions.
@@ -105,5 +107,24 @@ void menu(char *argstr);
/* The main function, called from start.S. */
void kmain(char *bootstring);
#if OPT_SYNCHPROBS
/*
* Synchronization driver primitives.
*/
void male_start(void);
void male_end(void);
void female_start(void);
void female_end(void);
void matchmaker_start(void);
void matchmaker_end(void);
int whalemating(int, char **);
void inQuadrant(int);
void leaveIntersection(void);
int stoplight(int, char **);
#endif
#endif /* _TEST_H_ */