-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrtx.h
68 lines (55 loc) · 2.06 KB
/
rtx.h
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
/*--------------------------------------------------------------------------
*
* ECE354 RTX
*
* File name : rtx.h
* Description: header file defining the primitive interfaces
* and testing process information
* Author : Irene Huang i.huang@ece.uwaterloo.ca
* Date : June 20th, 2007
* Note : setTestProcs() needs to be invoked before you can make
* use of RTXEVAL_TEST_PROCS[NUM_TEST_PROCS] array
*---------------------------------------------------------------------------
*/
#ifndef _RTX_H_
#define _RTX_H_
#include "rtx_inc.h"
/* Process Priority. The bigger the number is, the lower the priority is*/
#define HIGH 0
#define MEDIUM 1
#define LOW 2
#define LOWEST 3
#define NUM_TEST_PROCS 6
/* Primitives as specified in the project description*/
/* Interprocess Communications*/
int send_message (int process_ID, void * MessageEnvelope);
void * receive_message(int * sender_ID);
/*Memory Management*/
void * request_memory_block();
int release_memory_block(void * MemoryBlock);
/*Process Management*/
int release_processor();
/*Timing Service*/
int delayed_send(int process_ID, void * MessageEnvelope, int delay);
/*Process Priority*/
int set_process_priority (int process_ID, int priority);
int get_process_priority (int process_ID);
/*Auto Eval Test Process Information Starts*/
#if defined (_RTX_EVAL_)
typedef struct RTXEVAL_PROC {
UINT32 pid; //pid of test process
UINT8 priority; //priority of test process
UINT32 stacksize; //stack size of test process
VOID (*rtxeval_proc_entry)(); //entry point of test process
} RTXEVAL_PROC;
/*
routine that sets up RTXEVAL_TEST_PROCS[NUM_TEST_PROCS] information
It needs to be called by your RTX process initialization routine
before you can use RTXEVAL_TEST_PROCS[NUM_TEST_PROCS] array.
*/
extern VOID setTestProcs(); // routine to set test proc info
/*RTXEVAL_TEST_PROCS[i] contains information of test process i*/
extern RTXEVAL_PROC RTXEVAL_TEST_PROCS[NUM_TEST_PROCS];
#endif
/*Auto Eval Test Process Information Ends*/
#endif